summaryrefslogtreecommitdiff
path: root/libmetacity/meta-theme-impl-private.h
blob: 50bced5007a4470323314feba5509bdbd427e862 (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
/*
 * 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.h"
#include "meta-frame-borders.h"
#include "meta-frame-enums.h"
#include "meta-frame-style.h"
#include "meta-style-info-private.h"

G_BEGIN_DECLS

typedef struct _MetaFrameGeometry MetaFrameGeometry;

#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);

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

  void       (* calc_geometry)     (MetaThemeImpl            *impl,
                                    MetaFrameLayout          *layout,
                                    MetaStyleInfo            *style_info,
                                    gboolean                  composited,
                                    gint                      text_height,
                                    MetaFrameFlags            flags,
                                    gint                      client_width,
                                    gint                      client_height,
                                    const 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,
                                    MetaButtonState           button_states[META_BUTTON_TYPE_LAST],
                                    GdkPixbuf                *mini_icon,
                                    GdkPixbuf                *icon);
};

G_GNUC_INTERNAL
void               meta_theme_impl_add_style_set (MetaThemeImpl           *impl,
                                                  MetaFrameType            type,
                                                  MetaFrameStyleSet       *style_set);

G_GNUC_INTERNAL
MetaFrameStyleSet *meta_theme_impl_get_style_set (MetaThemeImpl           *impl,
                                                  MetaFrameType            type);

G_GNUC_INTERNAL
void               get_button_rect               (MetaButtonType           type,
                                                  const MetaFrameGeometry *fgeom,
                                                  gint                     middle_background_offset,
                                                  GdkRectangle            *rect);

G_GNUC_INTERNAL
MetaButtonState    map_button_state              (MetaButtonType           button_type,
                                                  const MetaFrameGeometry *fgeom,
                                                  gint                     middle_bg_offset,
                                                  MetaButtonState          button_states[META_BUTTON_TYPE_LAST]);

G_END_DECLS

#endif