Fix menu placement to avoid dead xinerama areas, possibly break other stuff
[dana/openbox.git] / obrender / 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_hilite;
38     RrFont *osd_font_unhilite;
39
40     /* style settings - geometry */
41     gint paddingx;
42     gint paddingy;
43     gint handle_height;
44     gint fbwidth; /*!< frame border width */
45     gint mbwidth; /*!< menu border width */
46     gint obwidth; /*!< osd border width */
47     gint cbwidthx;
48     gint cbwidthy;
49     gint menu_overlap_x;
50     gint menu_overlap_y;
51     gint menu_sep_width;
52     gint menu_sep_paddingx;
53     gint menu_sep_paddingy;
54     /* these ones are calculated, not set directly by the theme file */
55     gint win_font_height;
56     gint menu_title_font_height;
57     gint menu_font_height;
58     gint label_height;
59     gint title_height;
60     gint button_size;
61     gint grip_width;
62     gint menu_title_label_height;
63     gint menu_title_height;
64
65     /* style settings - colors */
66     RrColor *menu_border_color;
67     RrColor *osd_border_color;
68     RrColor *frame_focused_border_color;
69     RrColor *frame_unfocused_border_color;
70     RrColor *title_separator_focused_color;
71     RrColor *title_separator_unfocused_color;
72     RrColor *cb_focused_color;
73     RrColor *cb_unfocused_color;
74     RrColor *title_focused_color;
75     RrColor *title_unfocused_color;
76     RrColor *titlebut_disabled_focused_color;
77     RrColor *titlebut_disabled_unfocused_color;
78     RrColor *titlebut_hover_focused_color;
79     RrColor *titlebut_hover_unfocused_color;
80     RrColor *titlebut_toggled_hover_focused_color;
81     RrColor *titlebut_toggled_hover_unfocused_color;
82     RrColor *titlebut_toggled_focused_pressed_color;
83     RrColor *titlebut_toggled_unfocused_pressed_color;
84     RrColor *titlebut_toggled_focused_unpressed_color;
85     RrColor *titlebut_toggled_unfocused_unpressed_color;
86     RrColor *titlebut_focused_pressed_color;
87     RrColor *titlebut_unfocused_pressed_color;
88     RrColor *titlebut_focused_unpressed_color;
89     RrColor *titlebut_unfocused_unpressed_color;
90     RrColor *menu_title_color;
91     RrColor *menu_sep_color;
92     RrColor *menu_color;
93     RrColor *menu_selected_color;
94     RrColor *menu_disabled_color;
95     RrColor *menu_disabled_selected_color;
96     RrColor *title_focused_shadow_color;
97     gchar    title_focused_shadow_alpha;
98     RrColor *title_unfocused_shadow_color;
99     gchar    title_unfocused_shadow_alpha;
100     RrColor *osd_text_active_color;
101     RrColor *osd_text_inactive_color;
102     RrColor *osd_text_active_shadow_color;
103     RrColor *osd_text_inactive_shadow_color;
104     gchar    osd_text_active_shadow_alpha;
105     gchar    osd_text_inactive_shadow_alpha;
106     RrColor *osd_pressed_color;
107     RrColor *osd_unpressed_color;
108     RrColor *osd_focused_color;
109     RrColor *osd_pressed_lineart;
110     RrColor *osd_focused_lineart;
111     RrColor *menu_title_shadow_color;
112     gchar    menu_title_shadow_alpha;
113     RrColor *menu_text_normal_shadow_color;
114     gchar    menu_text_normal_shadow_alpha;
115     RrColor *menu_text_selected_shadow_color;
116     gchar    menu_text_selected_shadow_alpha;
117     RrColor *menu_text_disabled_shadow_color;
118     gchar    menu_text_disabled_shadow_alpha;
119     RrColor *menu_text_disabled_selected_shadow_color;
120     gchar    menu_text_disabled_selected_shadow_alpha;
121
122     /* style settings - pics */
123     RrPixel32 *def_win_icon; /* RGBA */
124     gint       def_win_icon_w;
125     gint       def_win_icon_h;
126
127     /* style settings - masks */
128     RrPixmapMask *max_mask;
129     RrPixmapMask *max_hover_mask;
130     RrPixmapMask *max_pressed_mask;
131     RrPixmapMask *max_toggled_mask;
132     RrPixmapMask *max_toggled_hover_mask;
133     RrPixmapMask *max_toggled_pressed_mask;
134     RrPixmapMask *max_disabled_mask;
135     RrPixmapMask *iconify_mask;
136     RrPixmapMask *iconify_hover_mask;
137     RrPixmapMask *iconify_pressed_mask;
138     RrPixmapMask *iconify_disabled_mask;
139     RrPixmapMask *desk_mask;
140     RrPixmapMask *desk_hover_mask;
141     RrPixmapMask *desk_pressed_mask;
142     RrPixmapMask *desk_toggled_mask;
143     RrPixmapMask *desk_toggled_hover_mask;
144     RrPixmapMask *desk_toggled_pressed_mask;
145     RrPixmapMask *desk_disabled_mask;
146     RrPixmapMask *shade_mask;
147     RrPixmapMask *shade_hover_mask;
148     RrPixmapMask *shade_pressed_mask;
149     RrPixmapMask *shade_toggled_mask;
150     RrPixmapMask *shade_toggled_hover_mask;
151     RrPixmapMask *shade_toggled_pressed_mask;
152     RrPixmapMask *shade_disabled_mask;
153     RrPixmapMask *close_mask;
154     RrPixmapMask *close_hover_mask;
155     RrPixmapMask *close_disabled_mask;
156     RrPixmapMask *close_pressed_mask;
157
158     RrPixmapMask *menu_bullet_mask; /* submenu pointer */
159 #if 0
160     RrPixmapMask *menu_toggle_mask; /* menu boolean */
161 #endif
162
163     RrPixmapMask *down_arrow_mask;
164     RrPixmapMask *up_arrow_mask;
165
166     /* global appearances */
167     RrAppearance *a_disabled_focused_max;
168     RrAppearance *a_disabled_unfocused_max;
169     RrAppearance *a_hover_focused_max;
170     RrAppearance *a_hover_unfocused_max;
171     RrAppearance *a_focused_unpressed_max;
172     RrAppearance *a_focused_pressed_max;
173     RrAppearance *a_unfocused_unpressed_max;
174     RrAppearance *a_unfocused_pressed_max;
175     RrAppearance *a_toggled_hover_focused_max;
176     RrAppearance *a_toggled_hover_unfocused_max;
177     RrAppearance *a_toggled_focused_unpressed_max;
178     RrAppearance *a_toggled_focused_pressed_max;
179     RrAppearance *a_toggled_unfocused_unpressed_max;
180     RrAppearance *a_toggled_unfocused_pressed_max;
181     RrAppearance *a_disabled_focused_close;
182     RrAppearance *a_disabled_unfocused_close;
183     RrAppearance *a_hover_focused_close;
184     RrAppearance *a_hover_unfocused_close;
185     RrAppearance *a_focused_unpressed_close;
186     RrAppearance *a_focused_pressed_close;
187     RrAppearance *a_unfocused_unpressed_close;
188     RrAppearance *a_unfocused_pressed_close;
189     RrAppearance *a_disabled_focused_desk;
190     RrAppearance *a_disabled_unfocused_desk;
191     RrAppearance *a_hover_focused_desk;
192     RrAppearance *a_hover_unfocused_desk;
193     RrAppearance *a_focused_unpressed_desk;
194     RrAppearance *a_focused_pressed_desk;
195     RrAppearance *a_unfocused_unpressed_desk;
196     RrAppearance *a_unfocused_pressed_desk;
197     RrAppearance *a_toggled_hover_focused_desk;
198     RrAppearance *a_toggled_hover_unfocused_desk;
199     RrAppearance *a_toggled_focused_unpressed_desk;
200     RrAppearance *a_toggled_focused_pressed_desk;
201     RrAppearance *a_toggled_unfocused_unpressed_desk;
202     RrAppearance *a_toggled_unfocused_pressed_desk;
203     RrAppearance *a_disabled_focused_shade;
204     RrAppearance *a_disabled_unfocused_shade;
205     RrAppearance *a_hover_focused_shade;
206     RrAppearance *a_hover_unfocused_shade;
207     RrAppearance *a_focused_unpressed_shade;
208     RrAppearance *a_focused_pressed_shade;
209     RrAppearance *a_unfocused_unpressed_shade;
210     RrAppearance *a_unfocused_pressed_shade;
211     RrAppearance *a_toggled_hover_focused_shade;
212     RrAppearance *a_toggled_hover_unfocused_shade;
213     RrAppearance *a_toggled_focused_unpressed_shade;
214     RrAppearance *a_toggled_focused_pressed_shade;
215     RrAppearance *a_toggled_unfocused_unpressed_shade;
216     RrAppearance *a_toggled_unfocused_pressed_shade;
217     RrAppearance *a_disabled_focused_iconify;
218     RrAppearance *a_disabled_unfocused_iconify;
219     RrAppearance *a_hover_focused_iconify;
220     RrAppearance *a_hover_unfocused_iconify;
221     RrAppearance *a_focused_unpressed_iconify;
222     RrAppearance *a_focused_pressed_iconify;
223     RrAppearance *a_unfocused_unpressed_iconify;
224     RrAppearance *a_unfocused_pressed_iconify;
225     RrAppearance *a_focused_grip;
226     RrAppearance *a_unfocused_grip;
227     RrAppearance *a_focused_title;
228     RrAppearance *a_unfocused_title;
229     RrAppearance *a_focused_label;
230     RrAppearance *a_unfocused_label;
231     /* always parentrelative, so no focused/unfocused */
232     RrAppearance *a_icon;
233     RrAppearance *a_focused_handle;
234     RrAppearance *a_unfocused_handle;
235     RrAppearance *a_menu_text_title;
236     RrAppearance *a_menu_title;
237     RrAppearance *a_menu;
238     RrAppearance *a_menu_normal;
239     RrAppearance *a_menu_selected;
240     RrAppearance *a_menu_disabled;
241     RrAppearance *a_menu_disabled_selected;
242     RrAppearance *a_menu_text_normal;
243     RrAppearance *a_menu_text_disabled;
244     RrAppearance *a_menu_text_disabled_selected;
245     RrAppearance *a_menu_text_selected;
246     RrAppearance *a_menu_bullet_normal;
247     RrAppearance *a_menu_bullet_selected;
248     RrAppearance *a_clear;     /* clear with no texture */
249     RrAppearance *a_clear_tex; /* clear with a texture */
250
251     RrAppearance *osd_bg; /* can never be parent relative */
252     RrAppearance *osd_hilite_bg; /* can never be parent relative */
253     RrAppearance *osd_hilite_label; /* can be parent relative */
254     RrAppearance *osd_unhilite_bg; /* can never be parent relative */
255     RrAppearance *osd_unhilite_label; /* can be parent relative */
256     RrAppearance *osd_pressed_button;
257     RrAppearance *osd_unpressed_button;
258     RrAppearance *osd_focused_button;
259
260     gchar *name;
261 };
262
263 /*! The font values are all optional. If a NULL is used for any of them, then
264   the default font will be used. */
265 RrTheme* RrThemeNew(const RrInstance *inst, const gchar *theme,
266                     gboolean allow_fallback,
267                     RrFont *active_window_font, RrFont *inactive_window_font,
268                     RrFont *menu_title_font, RrFont *menu_item_font,
269                     RrFont *active_osd_font, RrFont *inactive_osd_font);
270 void RrThemeFree(RrTheme *theme);
271
272 G_END_DECLS
273
274 #endif