summaryrefslogtreecommitdiff
path: root/libmetacity/meta-theme-impl-private.h
blob: 7155d3321ef4d9f86b732faa4b1aabddb47075fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
/*
 * Copyright (C) 2016 Alberts Muktupāvels
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef META_THEME_IMPL_PRIVATE_H
#define META_THEME_IMPL_PRIVATE_H

#include "meta-button-layout-private.h"
#include "meta-frame-borders.h"
#include "meta-frame-enums.h"
#include "meta-frame-style-private.h"
#include "meta-style-info-private.h"

G_BEGIN_DECLS

typedef struct _MetaFrameGeometry MetaFrameGeometry;

G_GNUC_INTERNAL
#define META_TYPE_THEME_IMPL meta_theme_impl_get_type ()
G_DECLARE_DERIVABLE_TYPE (MetaThemeImpl, meta_theme_impl,
                          META, THEME_IMPL, GObject)

struct _MetaThemeImplClass
{
  GObjectClass parent_class;

  gboolean         (* load)              (MetaThemeImpl            *impl,
                                          const gchar              *name,
                                          GError                  **error);

  MetaFrameStyle * (* get_frame_style)   (MetaThemeImpl            *impl,
                                          MetaFrameType             type,
                                          MetaFrameFlags            flags);

  void             (* get_frame_borders) (MetaThemeImpl            *impl,
                                          MetaFrameLayout          *layout,
                                          MetaStyleInfo            *style_info,
                                          gint                      text_height,
                                          MetaFrameFlags            flags,
                                          MetaFrameType             type,
                                          MetaFrameBorders         *borders);

  void             (* calc_geometry)     (MetaThemeImpl            *impl,
                                          MetaFrameLayout          *layout,
                                          MetaStyleInfo            *style_info,
                                          gint                      text_height,
                                          MetaFrameFlags            flags,
                                          gint                      client_width,
                                          gint                      client_height,
                                          MetaButtonLayout         *button_layout,
                                          MetaFrameType             type,
                                          MetaFrameGeometry        *fgeom);

  void             (* draw_frame)        (MetaThemeImpl            *impl,
                                          MetaFrameStyle           *style,
                                          MetaStyleInfo            *style_info,
                                          cairo_t                  *cr,
                                          const MetaFrameGeometry  *fgeom,
                                          PangoLayout              *title_layout,
                                          MetaFrameFlags            flags,
                                          const MetaButtonLayout   *button_layout,
                                          GdkPixbuf                *mini_icon,
                                          GdkPixbuf                *icon);
};

G_GNUC_INTERNAL
void               meta_theme_impl_set_composited (MetaThemeImpl           *impl,
                                                   gboolean                 composited);

G_GNUC_INTERNAL
gboolean           meta_theme_impl_get_composited (MetaThemeImpl           *impl);

G_GNUC_INTERNAL
void               meta_theme_impl_set_scale      (MetaThemeImpl           *impl,
                                                   gint                     scale);

G_GNUC_INTERNAL
gint               meta_theme_impl_get_scale      (MetaThemeImpl           *impl);

G_GNUC_INTERNAL
void               scale_border                   (GtkBorder               *border,
                                                   double                   factor);

G_GNUC_INTERNAL
gboolean           is_button_visible              (MetaButton              *button,
                                                   MetaFrameFlags           flags);

G_GNUC_INTERNAL
gboolean           strip_button                   (MetaButton              *buttons,
                                                   gint                     n_buttons,
                                                   MetaButtonType           type);

G_GNUC_INTERNAL
gboolean           strip_buttons                  (MetaButtonLayout        *layout,
                                                   gint                    *n_left,
                                                   gint                    *n_right);

G_END_DECLS

#endif