merge in r6153-6154 from the 3.4 branch
[dana/openbox.git] / render / theme.h
1 /* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
2
3    theme.h for the Openbox window manager
4    Copyright (c) 2006        Mikael Magnusson
5    Copyright (c) 2003-2007   Dana Jansens
6
7    This program is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 2 of the License, or
10    (at your option) any later version.
11
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16
17    See the COPYING file for a copy of the GNU General Public License.
18 */
19
20 #ifndef __theme_h
21 #define __theme_h
22
23 #include "render.h"
24
25 G_BEGIN_DECLS
26
27 typedef struct _RrTheme RrTheme;
28
29 struct _RrTheme {
30     const RrInstance *inst;
31
32     /* style settings - fonts */
33     RrFont *win_font_focused;
34     RrFont *win_font_unfocused;
35     RrFont *menu_title_font;
36     RrFont *menu_font;
37     RrFont *osd_font;
38
39     /* style settings - geometry */
40     gint paddingx;
41     gint paddingy;
42     gint handle_height;
43     gint fbwidth; /*!< frame border width */
44     gint mbwidth; /*!< menu border width */
45     gint cbwidthx;
46     gint cbwidthy;
47     gint menu_overlap;
48     /* these ones are calculated, not set directly by the theme file */
49     gint win_font_height;
50     gint menu_title_font_height;
51     gint menu_font_height;
52     gint label_height;
53     gint title_height;
54     gint button_size;
55     gint grip_width;
56     gint menu_title_label_height;
57     gint menu_title_height;
58
59     /* style settings - colors */
60     RrColor *menu_b_color;
61     RrColor *frame_b_color;
62     RrColor *cb_focused_color;
63     RrColor *cb_unfocused_color;
64     RrColor *title_focused_color;
65     RrColor *title_unfocused_color;
66     RrColor *titlebut_disabled_focused_color;
67     RrColor *titlebut_disabled_unfocused_color;
68     RrColor *titlebut_hover_focused_color;
69     RrColor *titlebut_hover_unfocused_color;
70     RrColor *titlebut_toggled_hover_focused_color;
71     RrColor *titlebut_toggled_hover_unfocused_color;
72     RrColor *titlebut_toggled_focused_pressed_color;
73     RrColor *titlebut_toggled_unfocused_pressed_color;
74     RrColor *titlebut_toggled_focused_unpressed_color;
75     RrColor *titlebut_toggled_unfocused_unpressed_color;
76     RrColor *titlebut_focused_pressed_color;
77     RrColor *titlebut_unfocused_pressed_color;
78     RrColor *titlebut_focused_unpressed_color;
79     RrColor *titlebut_unfocused_unpressed_color;
80     RrColor *menu_title_color;
81     RrColor *menu_color;
82     RrColor *menu_selected_color;
83     RrColor *menu_disabled_color;
84     RrColor *menu_disabled_selected_color;
85     RrColor *title_focused_shadow_color;
86     gchar    title_focused_shadow_alpha;
87     RrColor *title_unfocused_shadow_color;
88     gchar    title_unfocused_shadow_alpha;
89     RrColor *osd_color;
90     RrColor *osd_shadow_color;
91     gchar    osd_shadow_alpha;
92     RrColor *menu_title_shadow_color;
93     gchar    menu_title_shadow_alpha;
94     RrColor *menu_text_normal_shadow_color;
95     gchar    menu_text_normal_shadow_alpha;
96     RrColor *menu_text_selected_shadow_color;
97     gchar    menu_text_selected_shadow_alpha;
98     RrColor *menu_text_disabled_shadow_color;
99     gchar    menu_text_disabled_shadow_alpha;
100     RrColor *menu_text_disabled_selected_shadow_color;
101     gchar    menu_text_disabled_selected_shadow_alpha;
102
103     /* style settings - pics */
104     RrPixel32 *def_win_icon; /* 48x48 RGBA */
105
106     /* style settings - masks */
107     RrPixmapMask *max_mask;
108     RrPixmapMask *max_hover_mask;
109     RrPixmapMask *max_pressed_mask;
110     RrPixmapMask *max_toggled_mask;
111     RrPixmapMask *max_toggled_hover_mask;
112     RrPixmapMask *max_toggled_pressed_mask;
113     RrPixmapMask *max_disabled_mask;
114     RrPixmapMask *iconify_mask;
115     RrPixmapMask *iconify_hover_mask;
116     RrPixmapMask *iconify_pressed_mask;
117     RrPixmapMask *iconify_disabled_mask;
118     RrPixmapMask *desk_mask;
119     RrPixmapMask *desk_hover_mask;
120     RrPixmapMask *desk_pressed_mask;
121     RrPixmapMask *desk_toggled_mask;
122     RrPixmapMask *desk_toggled_hover_mask;
123     RrPixmapMask *desk_toggled_pressed_mask;
124     RrPixmapMask *desk_disabled_mask;
125     RrPixmapMask *shade_mask;
126     RrPixmapMask *shade_hover_mask;
127     RrPixmapMask *shade_pressed_mask;
128     RrPixmapMask *shade_toggled_mask;
129     RrPixmapMask *shade_toggled_hover_mask;
130     RrPixmapMask *shade_toggled_pressed_mask;
131     RrPixmapMask *shade_disabled_mask;
132     RrPixmapMask *close_mask;
133     RrPixmapMask *close_hover_mask;
134     RrPixmapMask *close_disabled_mask;
135     RrPixmapMask *close_pressed_mask;
136
137     RrPixmapMask *menu_bullet_mask; /* submenu pointer */
138     RrPixmapMask *menu_toggle_mask; /* menu boolean */
139
140     /* global appearances */
141     RrAppearance *a_disabled_focused_max;
142     RrAppearance *a_disabled_unfocused_max;
143     RrAppearance *a_hover_focused_max;
144     RrAppearance *a_hover_unfocused_max;
145     RrAppearance *a_focused_unpressed_max;
146     RrAppearance *a_focused_pressed_max;
147     RrAppearance *a_unfocused_unpressed_max;
148     RrAppearance *a_unfocused_pressed_max;
149     RrAppearance *a_toggled_hover_focused_max;
150     RrAppearance *a_toggled_hover_unfocused_max;
151     RrAppearance *a_toggled_focused_unpressed_max;
152     RrAppearance *a_toggled_focused_pressed_max;
153     RrAppearance *a_toggled_unfocused_unpressed_max;
154     RrAppearance *a_toggled_unfocused_pressed_max;
155     RrAppearance *a_disabled_focused_close;
156     RrAppearance *a_disabled_unfocused_close;
157     RrAppearance *a_hover_focused_close;
158     RrAppearance *a_hover_unfocused_close;
159     RrAppearance *a_focused_unpressed_close;
160     RrAppearance *a_focused_pressed_close;
161     RrAppearance *a_unfocused_unpressed_close;
162     RrAppearance *a_unfocused_pressed_close;
163     RrAppearance *a_disabled_focused_desk;
164     RrAppearance *a_disabled_unfocused_desk;
165     RrAppearance *a_hover_focused_desk;
166     RrAppearance *a_hover_unfocused_desk;
167     RrAppearance *a_focused_unpressed_desk;
168     RrAppearance *a_focused_pressed_desk;
169     RrAppearance *a_unfocused_unpressed_desk;
170     RrAppearance *a_unfocused_pressed_desk;
171     RrAppearance *a_toggled_hover_focused_desk;
172     RrAppearance *a_toggled_hover_unfocused_desk;
173     RrAppearance *a_toggled_focused_unpressed_desk;
174     RrAppearance *a_toggled_focused_pressed_desk;
175     RrAppearance *a_toggled_unfocused_unpressed_desk;
176     RrAppearance *a_toggled_unfocused_pressed_desk;
177     RrAppearance *a_disabled_focused_shade;
178     RrAppearance *a_disabled_unfocused_shade;
179     RrAppearance *a_hover_focused_shade;
180     RrAppearance *a_hover_unfocused_shade;
181     RrAppearance *a_focused_unpressed_shade;
182     RrAppearance *a_focused_pressed_shade;
183     RrAppearance *a_unfocused_unpressed_shade;
184     RrAppearance *a_unfocused_pressed_shade;
185     RrAppearance *a_toggled_hover_focused_shade;
186     RrAppearance *a_toggled_hover_unfocused_shade;
187     RrAppearance *a_toggled_focused_unpressed_shade;
188     RrAppearance *a_toggled_focused_pressed_shade;
189     RrAppearance *a_toggled_unfocused_unpressed_shade;
190     RrAppearance *a_toggled_unfocused_pressed_shade;
191     RrAppearance *a_disabled_focused_iconify;
192     RrAppearance *a_disabled_unfocused_iconify;
193     RrAppearance *a_hover_focused_iconify;
194     RrAppearance *a_hover_unfocused_iconify;
195     RrAppearance *a_focused_unpressed_iconify;
196     RrAppearance *a_focused_pressed_iconify;
197     RrAppearance *a_unfocused_unpressed_iconify;
198     RrAppearance *a_unfocused_pressed_iconify;
199     RrAppearance *a_focused_grip;
200     RrAppearance *a_unfocused_grip;
201     RrAppearance *a_focused_title;
202     RrAppearance *a_unfocused_title;
203     RrAppearance *a_focused_label;
204     RrAppearance *a_unfocused_label;
205     /* always parentrelative, so no focused/unfocused */
206     RrAppearance *a_icon;
207     RrAppearance *a_focused_handle;
208     RrAppearance *a_unfocused_handle;
209     RrAppearance *a_menu_text_title;
210     RrAppearance *a_menu_title;
211     RrAppearance *a_menu;
212     RrAppearance *a_menu_normal;
213     RrAppearance *a_menu_selected;
214     RrAppearance *a_menu_disabled;
215     RrAppearance *a_menu_disabled_selected;
216     RrAppearance *a_menu_text_normal;
217     RrAppearance *a_menu_text_disabled;
218     RrAppearance *a_menu_text_disabled_selected;
219     RrAppearance *a_menu_text_selected;
220     RrAppearance *a_menu_bullet_normal;
221     RrAppearance *a_menu_bullet_selected;
222     RrAppearance *a_clear;     /* clear with no texture */
223     RrAppearance *a_clear_tex; /* clear with a texture */
224
225     RrAppearance *osd_hilite_bg; /* can never be parent relative */
226     RrAppearance *osd_hilite_fg; /* can never be parent relative */
227     RrAppearance *osd_hilite_label; /* can be parent relative */
228     RrAppearance *osd_unhilite_fg; /* can never be parent relative */
229
230 };
231
232 /*! The font values are all optional. If a NULL is used for any of them, then
233   the default font will be used. */
234 RrTheme* RrThemeNew(const RrInstance *inst, gchar *theme,
235                     RrFont *active_window_font, RrFont *inactive_window_font,
236                     RrFont *menu_title_font, RrFont *menu_item_font,
237                     RrFont *osd_font);
238 void RrThemeFree(RrTheme *theme);
239
240 G_END_DECLS
241
242 #endif