1
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
3
/* Marco Theme Rendering */
6
* Copyright (C) 2001 Havoc Pennington
8
* This program is free software; you can redistribute it and/or
9
* modify it under the terms of the GNU General Public License as
10
* published by the Free Software Foundation; either version 2 of the
11
* License, or (at your option) any later version.
13
* This program is distributed in the hope that it will be useful, but
14
* WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
* General Public License for more details.
18
* You should have received a copy of the GNU General Public License
19
* along with this program; if not, write to the Free Software
20
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
32
typedef struct _MetaFrameStyle MetaFrameStyle;
33
typedef struct _MetaFrameStyleSet MetaFrameStyleSet;
34
typedef struct _MetaDrawOp MetaDrawOp;
35
typedef struct _MetaDrawOpList MetaDrawOpList;
36
typedef struct _MetaGradientSpec MetaGradientSpec;
37
typedef struct _MetaAlphaGradientSpec MetaAlphaGradientSpec;
38
typedef struct _MetaColorSpec MetaColorSpec;
39
typedef struct _MetaFrameLayout MetaFrameLayout;
40
typedef struct _MetaButtonSpace MetaButtonSpace;
41
typedef struct _MetaFrameGeometry MetaFrameGeometry;
42
typedef struct _MetaTheme MetaTheme;
43
typedef struct _MetaPositionExprEnv MetaPositionExprEnv;
44
typedef struct _MetaDrawInfo MetaDrawInfo;
46
#define META_THEME_ERROR (g_quark_from_static_string ("meta-theme-error"))
50
META_THEME_ERROR_FRAME_GEOMETRY,
51
META_THEME_ERROR_BAD_CHARACTER,
52
META_THEME_ERROR_BAD_PARENS,
53
META_THEME_ERROR_UNKNOWN_VARIABLE,
54
META_THEME_ERROR_DIVIDE_BY_ZERO,
55
META_THEME_ERROR_MOD_ON_FLOAT,
56
META_THEME_ERROR_FAILED
60
* Whether a button's size is calculated from the area around it (aspect
61
* sizing) or is given as a fixed height and width in pixels (fixed sizing).
63
* \bug This could be done away with; see the comment at the top of
68
META_BUTTON_SIZING_ASPECT,
69
META_BUTTON_SIZING_FIXED,
70
META_BUTTON_SIZING_LAST
74
* Various parameters used to calculate the geometry of a frame.
75
* They are used inside a MetaFrameStyle.
76
* This corresponds closely to the <frame_geometry> tag in a theme file.
78
* \bug button_sizing isn't really necessary, because we could easily say
79
* that if button_aspect is zero, the height and width are fixed values.
80
* This would also mean that MetaButtonSizing didn't need to exist, and
83
struct _MetaFrameLayout
85
/** Reference count. */
88
/** Size of left side */
90
/** Size of right side */
92
/** Size of bottom side */
95
/** Border of blue title region
98
GtkBorder title_border;
100
/** Extra height for inside of title region, above the font height */
101
int title_vertical_pad;
103
/** Right indent of buttons from edges of frame */
104
int right_titlebar_edge;
105
/** Left indent of buttons from edges of frame */
106
int left_titlebar_edge;
109
* Sizing rule of buttons, either META_BUTTON_SIZING_ASPECT
110
* (in which case button_aspect will be honoured, and
111
* button_width and button_height set from it), or
112
* META_BUTTON_SIZING_FIXED (in which case we read the width
113
* and height directly).
115
MetaButtonSizing button_sizing;
118
* Ratio of height/width. Honoured only if
119
* button_sizing==META_BUTTON_SIZING_ASPECT.
120
* Otherwise we figure out the height from the button_border.
122
double button_aspect;
124
/** Width of a button; set even when we are using aspect sizing */
127
/** Height of a button; set even when we are using aspect sizing */
130
/** Space around buttons */
131
GtkBorder button_border;
133
/** scale factor for title text */
136
/** Whether title text will be displayed */
139
/** Whether we should hide the buttons */
140
guint hide_buttons : 1;
142
/** Radius of the top left-hand corner; 0 if not rounded */
143
guint top_left_corner_rounded_radius;
144
/** Radius of the top right-hand corner; 0 if not rounded */
145
guint top_right_corner_rounded_radius;
146
/** Radius of the bottom left-hand corner; 0 if not rounded */
147
guint bottom_left_corner_rounded_radius;
148
/** Radius of the bottom right-hand corner; 0 if not rounded */
149
guint bottom_right_corner_rounded_radius;
153
* The computed size of a button (really just a way of tying its
154
* visible and clickable areas together).
155
* The reason for two different rectangles here is Fitts' law & maximized
156
* windows; see bug #97703 for more details.
158
struct _MetaButtonSpace
160
/** The screen area where the button's image is drawn */
161
GdkRectangle visible;
162
/** The screen area where the button can be activated by clicking */
163
GdkRectangle clickable;
167
* Calculated actual geometry of the frame
169
struct _MetaFrameGeometry
179
GdkRectangle title_rect;
181
int left_titlebar_edge;
182
int right_titlebar_edge;
183
int top_titlebar_edge;
184
int bottom_titlebar_edge;
186
/* used for a memset hack */
187
#define ADDRESS_OF_BUTTON_RECTS(fgeom) (((char*)(fgeom)) + G_STRUCT_OFFSET (MetaFrameGeometry, close_rect))
188
#define LENGTH_OF_BUTTON_RECTS (G_STRUCT_OFFSET (MetaFrameGeometry, right_right_background) + sizeof (GdkRectangle) - G_STRUCT_OFFSET (MetaFrameGeometry, close_rect))
190
/* The button rects (if changed adjust memset hack) */
191
MetaButtonSpace close_rect;
192
MetaButtonSpace max_rect;
193
MetaButtonSpace min_rect;
194
MetaButtonSpace menu_rect;
195
MetaButtonSpace shade_rect;
196
MetaButtonSpace above_rect;
197
MetaButtonSpace stick_rect;
198
MetaButtonSpace unshade_rect;
199
MetaButtonSpace unabove_rect;
200
MetaButtonSpace unstick_rect;
202
#define MAX_MIDDLE_BACKGROUNDS (MAX_BUTTONS_PER_CORNER - 2)
203
GdkRectangle left_single_background;
204
GdkRectangle left_left_background;
205
GdkRectangle left_middle_backgrounds[MAX_MIDDLE_BACKGROUNDS];
206
GdkRectangle left_right_background;
207
GdkRectangle right_single_background;
208
GdkRectangle right_left_background;
209
GdkRectangle right_middle_backgrounds[MAX_MIDDLE_BACKGROUNDS];
210
GdkRectangle right_right_background;
211
/* End of button rects (if changed adjust memset hack) */
214
guint top_left_corner_rounded_radius;
215
guint top_right_corner_rounded_radius;
216
guint bottom_left_corner_rounded_radius;
217
guint bottom_right_corner_rounded_radius;
222
META_IMAGE_FILL_SCALE, /* default, needs to be all-bits-zero for g_new0 */
228
META_COLOR_SPEC_BASIC,
230
META_COLOR_SPEC_BLEND,
231
META_COLOR_SPEC_SHADE
238
META_GTK_COLOR_LIGHT,
243
META_GTK_COLOR_TEXT_AA,
245
} MetaGtkColorComponent;
247
struct _MetaColorSpec
249
MetaColorSpecType type;
256
MetaGtkColorComponent component;
260
MetaColorSpec *foreground;
261
MetaColorSpec *background;
275
struct _MetaGradientSpec
277
MetaGradientType type;
281
struct _MetaAlphaGradientSpec
283
MetaGradientType type;
284
unsigned char *alphas;
290
GdkPixbuf *mini_icon;
292
PangoLayout *title_layout;
293
int title_layout_width;
294
int title_layout_height;
295
const MetaFrameGeometry *fgeom;
299
* A drawing operation in our simple vector drawing language.
303
/** Basic drawing-- line */
305
/** Basic drawing-- rectangle */
307
/** Basic drawing-- arc */
310
/** Clip to a rectangle */
313
/* Texture thingies */
315
/** Just a filled rectangle with alpha */
320
/** GTK theme engine stuff */
325
/** App's window icon */
327
/** App's window title */
329
/** a draw op list */
331
/** tiled draw op list */
341
POS_TOKEN_OPEN_PAREN,
342
POS_TOKEN_CLOSE_PAREN
358
* A token, as output by the tokeniser.
389
* A computed expression in our simple vector drawing language.
390
* While it appears to take the form of a tree, this is actually
391
* merely a list; concerns such as precedence of operators are
392
* currently recomputed on every recalculation.
394
* Created by meta_draw_spec_new(), destroyed by meta_draw_spec_free().
395
* pos_eval() fills this with ...FIXME. Are tokens a tree or a list?
398
typedef struct _MetaDrawSpec
401
* If this spec is constant, this is the value of the constant;
402
* otherwise it is zero.
406
/** A list of tokens in the expression. */
409
/** How many tokens are in the tokens list. */
412
/** Does the expression contain any variables? */
413
gboolean constant : 1;
417
* A single drawing operation in our simple vector drawing language.
423
/* Positions are strings because they can be expressions */
427
MetaColorSpec *color_spec;
438
MetaColorSpec *color_spec;
443
MetaDrawSpec *height;
447
MetaColorSpec *color_spec;
452
MetaDrawSpec *height;
461
MetaDrawSpec *height;
465
MetaColorSpec *color_spec;
466
MetaAlphaGradientSpec *alpha_spec;
470
MetaDrawSpec *height;
474
MetaGradientSpec *gradient_spec;
475
MetaAlphaGradientSpec *alpha_spec;
479
MetaDrawSpec *height;
483
MetaColorSpec *colorize_spec;
484
MetaAlphaGradientSpec *alpha_spec;
489
MetaDrawSpec *height;
491
guint32 colorize_cache_pixel;
492
GdkPixbuf *colorize_cache_pixbuf;
493
MetaImageFillType fill_type;
494
unsigned int vertical_stripes : 1;
495
unsigned int horizontal_stripes : 1;
500
GtkShadowType shadow;
507
MetaDrawSpec *height;
512
GtkShadowType shadow;
516
MetaDrawSpec *height;
527
MetaAlphaGradientSpec *alpha_spec;
531
MetaDrawSpec *height;
532
MetaImageFillType fill_type;
536
MetaColorSpec *color_spec;
542
MetaDrawOpList *op_list;
546
MetaDrawSpec *height;
550
MetaDrawOpList *op_list;
554
MetaDrawSpec *height;
555
MetaDrawSpec *tile_xoffset;
556
MetaDrawSpec *tile_yoffset;
557
MetaDrawSpec *tile_width;
558
MetaDrawSpec *tile_height;
565
* A list of MetaDrawOp objects. Maintains a reference count.
566
* Grows as necessary and allows the allocation of unused spaces
567
* to keep reallocations to a minimum.
569
* \bug Do we really win anything from not using the equivalent
572
struct _MetaDrawOpList
582
META_BUTTON_STATE_NORMAL,
583
META_BUTTON_STATE_PRESSED,
584
META_BUTTON_STATE_PRELIGHT,
585
META_BUTTON_STATE_LAST
590
/* Ordered so that background is drawn first */
591
META_BUTTON_TYPE_LEFT_LEFT_BACKGROUND,
592
META_BUTTON_TYPE_LEFT_MIDDLE_BACKGROUND,
593
META_BUTTON_TYPE_LEFT_RIGHT_BACKGROUND,
594
META_BUTTON_TYPE_RIGHT_LEFT_BACKGROUND,
595
META_BUTTON_TYPE_RIGHT_MIDDLE_BACKGROUND,
596
META_BUTTON_TYPE_RIGHT_RIGHT_BACKGROUND,
597
META_BUTTON_TYPE_CLOSE,
598
META_BUTTON_TYPE_MAXIMIZE,
599
META_BUTTON_TYPE_MINIMIZE,
600
META_BUTTON_TYPE_MENU,
601
META_BUTTON_TYPE_SHADE,
602
META_BUTTON_TYPE_ABOVE,
603
META_BUTTON_TYPE_STICK,
604
META_BUTTON_TYPE_UNSHADE,
605
META_BUTTON_TYPE_UNABOVE,
606
META_BUTTON_TYPE_UNSTICK,
607
META_BUTTON_TYPE_LAST
612
META_MENU_ICON_TYPE_CLOSE,
613
META_MENU_ICON_TYPE_MAXIMIZE,
614
META_MENU_ICON_TYPE_UNMAXIMIZE,
615
META_MENU_ICON_TYPE_MINIMIZE,
616
META_MENU_ICON_TYPE_LAST
621
/* Listed in the order in which the textures are drawn.
622
* (though this only matters for overlaps of course.)
623
* Buttons are drawn after the frame textures.
625
* On the corners, horizontal pieces are arbitrarily given the
635
META_FRAME_PIECE_ENTIRE_BACKGROUND,
636
/* entire titlebar background */
637
META_FRAME_PIECE_TITLEBAR,
638
/* portion of the titlebar background inside the titlebar
641
META_FRAME_PIECE_TITLEBAR_MIDDLE,
642
/* left end of titlebar */
643
META_FRAME_PIECE_LEFT_TITLEBAR_EDGE,
644
/* right end of titlebar */
645
META_FRAME_PIECE_RIGHT_TITLEBAR_EDGE,
646
/* top edge of titlebar */
647
META_FRAME_PIECE_TOP_TITLEBAR_EDGE,
648
/* bottom edge of titlebar */
649
META_FRAME_PIECE_BOTTOM_TITLEBAR_EDGE,
650
/* render over title background (text area) */
651
META_FRAME_PIECE_TITLE,
652
/* left edge of the frame */
653
META_FRAME_PIECE_LEFT_EDGE,
654
/* right edge of the frame */
655
META_FRAME_PIECE_RIGHT_EDGE,
656
/* bottom edge of the frame */
657
META_FRAME_PIECE_BOTTOM_EDGE,
658
/* place over entire frame, after drawing everything else */
659
META_FRAME_PIECE_OVERLAY,
660
/* Used to get size of the enum */
661
META_FRAME_PIECE_LAST
664
#define N_GTK_STATES 5
667
* How to draw a frame in a particular state (say, a focussed, non-maximised,
668
* resizable frame). This corresponds closely to the <frame_style> tag
671
struct _MetaFrameStyle
673
/** Reference count. */
677
* Settings which are unspecified here will be taken from there.
679
MetaFrameStyle *parent;
680
/** Operations for drawing each kind of button in each state. */
681
MetaDrawOpList *buttons[META_BUTTON_TYPE_LAST][META_BUTTON_STATE_LAST];
682
/** Operations for drawing each piece of the frame. */
683
MetaDrawOpList *pieces[META_FRAME_PIECE_LAST];
685
* Details such as the height and width of each edge, the corner rounding,
686
* and the aspect ratio of the buttons.
688
MetaFrameLayout *layout;
690
* Background colour of the window. Only present in theme formats
691
* 2 and above. Can be NULL to use the standard GTK theme engine.
693
MetaColorSpec *window_background_color;
695
* Transparency of the window background. 0=transparent; 255=opaque.
697
guint8 window_background_alpha;
702
* normal -> noresize / vert only / horz only / both
703
* focused / unfocused
704
* max -> focused / unfocused
705
* shaded -> focused / unfocused
706
* max/shaded -> focused / unfocused
708
* so 4 states with 8 sub-states in one, 2 sub-states in the other 3,
711
* 14 window states times 7 or 8 window types. Except some
712
* window types never get a frame so that narrows it down a bit.
717
META_FRAME_STATE_NORMAL,
718
META_FRAME_STATE_MAXIMIZED,
719
META_FRAME_STATE_SHADED,
720
META_FRAME_STATE_MAXIMIZED_AND_SHADED,
721
META_FRAME_STATE_LAST
726
META_FRAME_RESIZE_NONE,
727
META_FRAME_RESIZE_VERTICAL,
728
META_FRAME_RESIZE_HORIZONTAL,
729
META_FRAME_RESIZE_BOTH,
730
META_FRAME_RESIZE_LAST
736
META_FRAME_FOCUS_YES,
737
META_FRAME_FOCUS_LAST
741
* How to draw frames at different times: when it's maximised or not, shaded
742
* or not, when it's focussed or not, and (for non-maximised windows), when
743
* it can be horizontally or vertically resized, both, or neither.
744
* Not all window types actually get a frame.
746
* A theme contains one of these objects for each type of window (each
747
* MetaFrameType), that is, normal, dialogue (modal and non-modal), etc.
749
* This corresponds closely to the <frame_style_set> tag in a theme file.
751
struct _MetaFrameStyleSet
754
MetaFrameStyleSet *parent;
755
MetaFrameStyle *normal_styles[META_FRAME_RESIZE_LAST][META_FRAME_FOCUS_LAST];
756
MetaFrameStyle *maximized_styles[META_FRAME_FOCUS_LAST];
757
MetaFrameStyle *shaded_styles[META_FRAME_RESIZE_LAST][META_FRAME_FOCUS_LAST];
758
MetaFrameStyle *maximized_and_shaded_styles[META_FRAME_FOCUS_LAST];
762
* A theme. This is a singleton class which groups all settings from a theme
765
* \bug It is rather useless to keep the metadata fields in core, I think.
769
/** Name of the theme (on disk), e.g. "Crux" */
771
/** Path to the files associated with the theme */
774
* Filename of the XML theme file.
775
* \bug Kept lying around for no discernable reason.
778
/** Metadata: Human-readable name of the theme. */
780
/** Metadata: Author of the theme. */
782
/** Metadata: Copyright holder. */
784
/** Metadata: Date of the theme. */
786
/** Metadata: Description of the theme. */
788
/** Version of the theme format. Older versions cannot use the features
789
* of newer versions even if they think they can (this is to allow forward
790
* and backward compatibility.
792
guint format_version;
794
/** Symbol table of integer constants. */
795
GHashTable *integer_constants;
796
/** Symbol table of float constants. */
797
GHashTable *float_constants;
799
* Symbol table of colour constants (hex triples, and triples
802
GHashTable *color_constants;
803
GHashTable *images_by_filename;
804
GHashTable *layouts_by_name;
805
GHashTable *draw_op_lists_by_name;
806
GHashTable *styles_by_name;
807
GHashTable *style_sets_by_name;
808
MetaFrameStyleSet *style_sets_by_type[META_FRAME_TYPE_LAST];
812
GQuark quark_object_width;
813
GQuark quark_object_height;
814
GQuark quark_left_width;
815
GQuark quark_right_width;
816
GQuark quark_top_height;
817
GQuark quark_bottom_height;
818
GQuark quark_mini_icon_width;
819
GQuark quark_mini_icon_height;
820
GQuark quark_icon_width;
821
GQuark quark_icon_height;
822
GQuark quark_title_width;
823
GQuark quark_title_height;
826
struct _MetaPositionExprEnv
829
/* size of an object being drawn, if it has a natural size */
832
/* global object sizes, always available */
840
int mini_icon_height;
843
/* Theme so we can look up constants */
847
MetaFrameLayout* meta_frame_layout_new (void);
848
MetaFrameLayout* meta_frame_layout_copy (const MetaFrameLayout *src);
849
void meta_frame_layout_ref (MetaFrameLayout *layout);
850
void meta_frame_layout_unref (MetaFrameLayout *layout);
851
void meta_frame_layout_get_borders (const MetaFrameLayout *layout,
853
MetaFrameFlags flags,
858
void meta_frame_layout_calc_geometry (const MetaFrameLayout *layout,
860
MetaFrameFlags flags,
863
const MetaButtonLayout *button_layout,
864
MetaFrameGeometry *fgeom,
867
gboolean meta_frame_layout_validate (const MetaFrameLayout *layout,
870
gboolean meta_parse_position_expression (MetaDrawSpec *spec,
871
const MetaPositionExprEnv *env,
875
gboolean meta_parse_size_expression (MetaDrawSpec *spec,
876
const MetaPositionExprEnv *env,
880
MetaDrawSpec* meta_draw_spec_new (MetaTheme *theme,
883
void meta_draw_spec_free (MetaDrawSpec *spec);
885
MetaColorSpec* meta_color_spec_new (MetaColorSpecType type);
886
MetaColorSpec* meta_color_spec_new_from_string (const char *str,
888
MetaColorSpec* meta_color_spec_new_gtk (MetaGtkColorComponent component,
890
void meta_color_spec_free (MetaColorSpec *spec);
891
void meta_color_spec_render (MetaColorSpec *spec,
896
MetaDrawOp* meta_draw_op_new (MetaDrawType type);
897
void meta_draw_op_free (MetaDrawOp *op);
898
void meta_draw_op_draw (const MetaDrawOp *op,
900
GdkDrawable *drawable,
901
const GdkRectangle *clip,
902
const MetaDrawInfo *info,
903
/* logical region being drawn */
904
MetaRectangle logical_region);
906
void meta_draw_op_draw_with_style (const MetaDrawOp *op,
909
GdkDrawable *drawable,
910
const GdkRectangle *clip,
911
const MetaDrawInfo *info,
912
/* logical region being drawn */
913
MetaRectangle logical_region);
915
MetaDrawOpList* meta_draw_op_list_new (int n_preallocs);
916
void meta_draw_op_list_ref (MetaDrawOpList *op_list);
917
void meta_draw_op_list_unref (MetaDrawOpList *op_list);
918
void meta_draw_op_list_draw (const MetaDrawOpList *op_list,
920
GdkDrawable *drawable,
921
const GdkRectangle *clip,
922
const MetaDrawInfo *info,
924
void meta_draw_op_list_draw_with_style (const MetaDrawOpList *op_list,
927
GdkDrawable *drawable,
928
const GdkRectangle *clip,
929
const MetaDrawInfo *info,
931
void meta_draw_op_list_append (MetaDrawOpList *op_list,
933
gboolean meta_draw_op_list_validate (MetaDrawOpList *op_list,
935
gboolean meta_draw_op_list_contains (MetaDrawOpList *op_list,
936
MetaDrawOpList *child);
938
MetaGradientSpec* meta_gradient_spec_new (MetaGradientType type);
939
void meta_gradient_spec_free (MetaGradientSpec *desc);
940
GdkPixbuf* meta_gradient_spec_render (const MetaGradientSpec *desc,
944
gboolean meta_gradient_spec_validate (MetaGradientSpec *spec,
947
MetaAlphaGradientSpec* meta_alpha_gradient_spec_new (MetaGradientType type,
949
void meta_alpha_gradient_spec_free (MetaAlphaGradientSpec *spec);
952
MetaFrameStyle* meta_frame_style_new (MetaFrameStyle *parent);
953
void meta_frame_style_ref (MetaFrameStyle *style);
954
void meta_frame_style_unref (MetaFrameStyle *style);
956
void meta_frame_style_draw (MetaFrameStyle *style,
958
GdkDrawable *drawable,
961
const GdkRectangle *clip,
962
const MetaFrameGeometry *fgeom,
965
PangoLayout *title_layout,
967
MetaButtonState button_states[META_BUTTON_TYPE_LAST],
968
GdkPixbuf *mini_icon,
972
void meta_frame_style_draw_with_style (MetaFrameStyle *style,
975
GdkDrawable *drawable,
978
const GdkRectangle *clip,
979
const MetaFrameGeometry *fgeom,
982
PangoLayout *title_layout,
984
MetaButtonState button_states[META_BUTTON_TYPE_LAST],
985
GdkPixbuf *mini_icon,
989
gboolean meta_frame_style_validate (MetaFrameStyle *style,
990
guint current_theme_version,
993
MetaFrameStyleSet* meta_frame_style_set_new (MetaFrameStyleSet *parent);
994
void meta_frame_style_set_ref (MetaFrameStyleSet *style_set);
995
void meta_frame_style_set_unref (MetaFrameStyleSet *style_set);
997
gboolean meta_frame_style_set_validate (MetaFrameStyleSet *style_set,
1000
MetaTheme* meta_theme_get_current (void);
1001
void meta_theme_set_current (const char *name,
1002
gboolean force_reload);
1004
MetaTheme* meta_theme_new (void);
1005
void meta_theme_free (MetaTheme *theme);
1006
gboolean meta_theme_validate (MetaTheme *theme,
1008
GdkPixbuf* meta_theme_load_image (MetaTheme *theme,
1009
const char *filename,
1010
guint size_of_theme_icons,
1013
MetaFrameStyle* meta_theme_get_frame_style (MetaTheme *theme,
1015
MetaFrameFlags flags);
1017
double meta_theme_get_title_scale (MetaTheme *theme,
1019
MetaFrameFlags flags);
1021
void meta_theme_draw_frame (MetaTheme *theme,
1023
GdkDrawable *drawable,
1024
const GdkRectangle *clip,
1028
MetaFrameFlags flags,
1031
PangoLayout *title_layout,
1033
const MetaButtonLayout *button_layout,
1034
MetaButtonState button_states[META_BUTTON_TYPE_LAST],
1035
GdkPixbuf *mini_icon,
1038
void meta_theme_draw_frame_by_name (MetaTheme *theme,
1040
GdkDrawable *drawable,
1041
const GdkRectangle *clip,
1044
const gchar *style_name,
1045
MetaFrameFlags flags,
1048
PangoLayout *title_layout,
1050
const MetaButtonLayout *button_layout,
1051
MetaButtonState button_states[META_BUTTON_TYPE_LAST],
1052
GdkPixbuf *mini_icon,
1055
void meta_theme_draw_frame_with_style (MetaTheme *theme,
1056
GtkStyle *style_gtk,
1058
GdkDrawable *drawable,
1059
const GdkRectangle *clip,
1063
MetaFrameFlags flags,
1066
PangoLayout *title_layout,
1068
const MetaButtonLayout *button_layout,
1069
MetaButtonState button_states[META_BUTTON_TYPE_LAST],
1070
GdkPixbuf *mini_icon,
1073
void meta_theme_get_frame_borders (MetaTheme *theme,
1076
MetaFrameFlags flags,
1081
void meta_theme_calc_geometry (MetaTheme *theme,
1084
MetaFrameFlags flags,
1087
const MetaButtonLayout *button_layout,
1088
MetaFrameGeometry *fgeom);
1090
MetaFrameLayout* meta_theme_lookup_layout (MetaTheme *theme,
1092
void meta_theme_insert_layout (MetaTheme *theme,
1094
MetaFrameLayout *layout);
1095
MetaDrawOpList* meta_theme_lookup_draw_op_list (MetaTheme *theme,
1097
void meta_theme_insert_draw_op_list (MetaTheme *theme,
1099
MetaDrawOpList *op_list);
1100
MetaFrameStyle* meta_theme_lookup_style (MetaTheme *theme,
1102
void meta_theme_insert_style (MetaTheme *theme,
1104
MetaFrameStyle *style);
1105
MetaFrameStyleSet* meta_theme_lookup_style_set (MetaTheme *theme,
1107
void meta_theme_insert_style_set (MetaTheme *theme,
1109
MetaFrameStyleSet *style_set);
1110
gboolean meta_theme_define_int_constant (MetaTheme *theme,
1114
gboolean meta_theme_lookup_int_constant (MetaTheme *theme,
1117
gboolean meta_theme_define_float_constant (MetaTheme *theme,
1121
gboolean meta_theme_lookup_float_constant (MetaTheme *theme,
1125
gboolean meta_theme_define_color_constant (MetaTheme *theme,
1129
gboolean meta_theme_lookup_color_constant (MetaTheme *theme,
1133
gboolean meta_theme_replace_constants (MetaTheme *theme,
1140
PangoFontDescription* meta_gtk_widget_get_font_desc (GtkWidget *widget,
1142
const PangoFontDescription *override);
1143
int meta_pango_font_desc_get_text_height (const PangoFontDescription *font_desc,
1144
PangoContext *context);
1147
/* Enum converters */
1148
MetaGtkColorComponent meta_color_component_from_string (const char *str);
1149
const char* meta_color_component_to_string (MetaGtkColorComponent component);
1150
MetaButtonState meta_button_state_from_string (const char *str);
1151
const char* meta_button_state_to_string (MetaButtonState state);
1152
MetaButtonType meta_button_type_from_string (const char *str,
1154
const char* meta_button_type_to_string (MetaButtonType type);
1155
MetaFramePiece meta_frame_piece_from_string (const char *str);
1156
const char* meta_frame_piece_to_string (MetaFramePiece piece);
1157
MetaFrameState meta_frame_state_from_string (const char *str);
1158
const char* meta_frame_state_to_string (MetaFrameState state);
1159
MetaFrameResize meta_frame_resize_from_string (const char *str);
1160
const char* meta_frame_resize_to_string (MetaFrameResize resize);
1161
MetaFrameFocus meta_frame_focus_from_string (const char *str);
1162
const char* meta_frame_focus_to_string (MetaFrameFocus focus);
1163
MetaFrameType meta_frame_type_from_string (const char *str);
1164
const char* meta_frame_type_to_string (MetaFrameType type);
1165
MetaGradientType meta_gradient_type_from_string (const char *str);
1166
const char* meta_gradient_type_to_string (MetaGradientType type);
1167
GtkStateType meta_gtk_state_from_string (const char *str);
1168
const char* meta_gtk_state_to_string (GtkStateType state);
1169
GtkShadowType meta_gtk_shadow_from_string (const char *str);
1170
const char* meta_gtk_shadow_to_string (GtkShadowType shadow);
1171
GtkArrowType meta_gtk_arrow_from_string (const char *str);
1172
const char* meta_gtk_arrow_to_string (GtkArrowType arrow);
1173
MetaImageFillType meta_image_fill_type_from_string (const char *str);
1174
const char* meta_image_fill_type_to_string (MetaImageFillType fill_type);
1176
guint meta_theme_earliest_version_with_button (MetaButtonType type);
1179
#define META_THEME_ALLOWS(theme, feature) (theme->format_version >= feature)
1181
/* What version of the theme file format were various features introduced in? */
1182
#define META_THEME_SHADE_STICK_ABOVE_BUTTONS 2
1183
#define META_THEME_UBIQUITOUS_CONSTANTS 2
1184
#define META_THEME_VARIED_ROUND_CORNERS 2
1185
#define META_THEME_IMAGES_FROM_ICON_THEMES 2
1186
#define META_THEME_UNRESIZABLE_SHADED_STYLES 2
1187
#define META_THEME_DEGREES_IN_ARCS 2
1188
#define META_THEME_HIDDEN_BUTTONS 2
1189
#define META_THEME_COLOR_CONSTANTS 2
1190
#define META_THEME_FRAME_BACKGROUNDS 2