1 /* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
3 theme.c for the Openbox window manager
4 Copyright (c) 2006 Mikael Magnusson
5 Copyright (c) 2003-2007 Dana Jansens
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.
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.
17 See the COPYING file for a copy of the GNU General Public License.
26 #include "parser/parse.h"
35 const RrInstance
*inst
;
39 static void parse_style(gchar
*tex
, RrSurfaceColorType
*grad
,
40 RrReliefType
*relief
, RrBevelType
*bevel
,
41 gboolean
*interlaced
, gboolean
*border
,
42 gboolean allow_trans
);
43 static gboolean
read_mask(ParseState
*ps
, gchar
*maskname
,
44 RrPixmapMask
**value
);
45 static RrPixel32
* read_c_image(gint width
, gint height
, const guint8
*data
);
46 static void set_default_appearance(RrAppearance
*a
);
47 static xmlNodePtr
find_node(xmlNodePtr n
, gchar
*names
[]);
48 static gboolean
find_int(ParseState
*ps
, xmlNodePtr n
, gchar
*names
[],
49 gint
*integer
, gint lower
, gint upper
);
50 static gboolean
find_string(ParseState
*ps
, xmlNodePtr n
, gchar
*names
[],
52 static gboolean
find_color(ParseState
*ps
, xmlNodePtr n
, gchar
*names
[],
53 RrColor
**color
, gchar
*alpha
);
54 static gboolean
find_point(ParseState
*ps
, xmlNodePtr n
, gchar
*names
[],
56 gint lowx
, gint lowy
, gint upx
, gint upy
);
57 static gboolean
find_shadow(ParseState
*ps
, xmlNodePtr n
, gchar
*names
[],
59 static gboolean
find_appearance(ParseState
*ps
, xmlNodePtr n
, gchar
*names
[],
60 RrAppearance
*a
, gboolean allow_trans
);
62 /* make a null terminated array out of a list of strings */
63 #define L(args...) (gchar*[]){args,NULL}
64 /* shortcut to the various find_* functions */
65 #define FIND(type, args...) find_##type(&ps, root, args)
67 RrTheme
* RrThemeNew(const RrInstance
*inst
, gchar
*name
,
68 RrFont
*active_window_font
, RrFont
*inactive_window_font
,
69 RrFont
*menu_title_font
, RrFont
*menu_item_font
)
73 RrJustify winjust
, mtitlejust
;
78 if (!parse_load_theme(name
, &ps
.doc
, &root
, &ps
.path
)) {
79 g_warning("Falling back to the default theme: '%s'",
81 /* make it fall back to default theme */
86 if (!parse_load_theme(DEFAULT_THEME
, &ps
.doc
, &root
, &ps
.path
))
91 theme
= g_new0(RrTheme
, 1);
94 theme
->a_disabled_focused_max
= RrAppearanceNew(inst
, 1);
95 theme
->a_disabled_unfocused_max
= RrAppearanceNew(inst
, 1);
96 theme
->a_hover_focused_max
= RrAppearanceNew(inst
, 1);
97 theme
->a_hover_unfocused_max
= RrAppearanceNew(inst
, 1);
98 theme
->a_toggled_focused_max
= RrAppearanceNew(inst
, 1);
99 theme
->a_toggled_unfocused_max
= RrAppearanceNew(inst
, 1);
100 theme
->a_focused_unpressed_max
= RrAppearanceNew(inst
, 1);
101 theme
->a_focused_pressed_max
= RrAppearanceNew(inst
, 1);
102 theme
->a_unfocused_unpressed_max
= RrAppearanceNew(inst
, 1);
103 theme
->a_unfocused_pressed_max
= RrAppearanceNew(inst
, 1);
104 theme
->a_focused_grip
= RrAppearanceNew(inst
, 0);
105 theme
->a_unfocused_grip
= RrAppearanceNew(inst
, 0);
106 theme
->a_focused_title
= RrAppearanceNew(inst
, 0);
107 theme
->a_unfocused_title
= RrAppearanceNew(inst
, 0);
108 theme
->a_focused_label
= RrAppearanceNew(inst
, 1);
109 theme
->a_unfocused_label
= RrAppearanceNew(inst
, 1);
110 theme
->a_icon
= RrAppearanceNew(inst
, 1);
111 theme
->a_focused_handle
= RrAppearanceNew(inst
, 0);
112 theme
->a_unfocused_handle
= RrAppearanceNew(inst
, 0);
113 theme
->a_menu
= RrAppearanceNew(inst
, 0);
114 theme
->a_menu_title
= RrAppearanceNew(inst
, 1);
115 theme
->a_menu_normal
= RrAppearanceNew(inst
, 0);
116 theme
->a_menu_disabled
= RrAppearanceNew(inst
, 0);
117 theme
->a_menu_selected
= RrAppearanceNew(inst
, 0);
118 theme
->a_menu_text_normal
= RrAppearanceNew(inst
, 1);
119 theme
->a_menu_text_disabled
= RrAppearanceNew(inst
, 1);
120 theme
->a_menu_text_selected
= RrAppearanceNew(inst
, 1);
121 theme
->a_menu_bullet_normal
= RrAppearanceNew(inst
, 1);
122 theme
->a_menu_bullet_selected
= RrAppearanceNew(inst
, 1);
123 theme
->a_clear
= RrAppearanceNew(inst
, 0);
124 theme
->a_clear_tex
= RrAppearanceNew(inst
, 1);
126 /* load the font stuff */
128 if (active_window_font
) {
129 theme
->win_font_focused
= active_window_font
;
130 RrFontRef(active_window_font
);
132 theme
->win_font_focused
= RrFontOpenDefault(inst
);
134 if (inactive_window_font
) {
135 theme
->win_font_unfocused
= inactive_window_font
;
136 RrFontRef(inactive_window_font
);
138 theme
->win_font_unfocused
= RrFontOpenDefault(inst
);
140 winjust
= RR_JUSTIFY_LEFT
;
141 if (FIND(string
, L( "window", "justify"), &str
)) {
142 if (strcmp(str
, "right") == 0)
143 winjust
= RR_JUSTIFY_RIGHT
;
144 else if (strcmp(str
, "center") == 0)
145 winjust
= RR_JUSTIFY_CENTER
;
148 if (menu_title_font
) {
149 theme
->menu_title_font
= menu_title_font
;
150 RrFontRef(menu_title_font
);
152 theme
->menu_title_font
= RrFontOpenDefault(inst
);
154 mtitlejust
= RR_JUSTIFY_LEFT
;
155 if (FIND(string
, L("menu", "justify"), &str
)) {
156 if (strcmp(str
, "right") == 0)
157 mtitlejust
= RR_JUSTIFY_RIGHT
;
158 else if (strcmp(str
, "center") == 0)
159 mtitlejust
= RR_JUSTIFY_CENTER
;
162 if (menu_item_font
) {
163 theme
->menu_font
= menu_item_font
;
164 RrFontRef(menu_item_font
);
166 theme
->menu_font
= RrFontOpenDefault(inst
);
168 /* load direct dimensions */
169 if (!FIND(int, L("menu","overlap"),
170 &theme
->menu_overlap
, -100, 100))
171 theme
->menu_overlap
= 0;
173 if (!FIND(int, L("dimensions","handle"), &theme
->handle_height
, 0, 100))
174 theme
->handle_height
= 6;
176 if (!FIND(point
, L("dimensions","padding"),
177 &theme
->paddingx
, &theme
->paddingy
, 0, 100, 0, 100))
178 theme
->paddingx
= theme
->paddingy
= 3;
180 if (!FIND(int, L("window","border","width"),
181 &theme
->fbwidth
, 0, 100))
184 /* menu border width inherits from frame border width */
185 if (!FIND(int, L("menu","border","width"),
186 &theme
->mbwidth
, 0, 100))
187 theme
->mbwidth
= theme
->fbwidth
;
189 if (!FIND(point
, L("window","clientpadding"), &theme
->cbwidthx
,
190 &theme
->cbwidthy
, 0, 100, 0, 100))
191 theme
->cbwidthx
= theme
->cbwidthy
= 1;
194 if (!FIND(color
, L("window","border","primary"),
195 &theme
->frame_b_color
, NULL
))
196 theme
->frame_b_color
= RrColorNew(inst
, 0, 0, 0);
198 /* menu border color inherits from frame border color */
199 if (!FIND(color
, L("menu","border","primary"),
200 &theme
->menu_b_color
, NULL
))
201 theme
->menu_b_color
= RrColorNew(inst
,
202 theme
->frame_b_color
->r
,
203 theme
->frame_b_color
->g
,
204 theme
->frame_b_color
->b
);
205 if (!FIND(color
, L("window","active","clientpadding"),
206 &theme
->cb_focused_color
, NULL
))
207 theme
->cb_focused_color
= RrColorNew(inst
, 255, 255, 255);
208 if (!FIND(color
, L("window","inactive","clientpadding"),
209 &theme
->cb_unfocused_color
, NULL
))
210 theme
->cb_unfocused_color
= RrColorNew(inst
, 255, 255, 255);
211 if (!FIND(color
, L("window","active","label","text","primary"),
212 &theme
->title_focused_color
, NULL
))
213 theme
->title_focused_color
= RrColorNew(inst
, 0x0, 0x0, 0x0);
214 if (!FIND(color
, L("osd","text","primary"),
215 &theme
->osd_color
, NULL
))
216 theme
->osd_color
= RrColorNew(inst
,
217 theme
->title_focused_color
->r
,
218 theme
->title_focused_color
->g
,
219 theme
->title_focused_color
->b
);
220 if (!FIND(color
, L("window","inactive","label","text","primary"),
221 &theme
->title_unfocused_color
, NULL
))
222 theme
->title_unfocused_color
= RrColorNew(inst
, 0xff, 0xff, 0xff);
223 if (!FIND(color
, L("window","active","buttons","unpressed","image"),
224 &theme
->titlebut_focused_unpressed_color
, NULL
))
225 theme
->titlebut_focused_unpressed_color
= RrColorNew(inst
, 0, 0, 0);
226 if (!FIND(color
, L("window","inactive","buttons", "unpressed","image"),
227 &theme
->titlebut_unfocused_unpressed_color
, NULL
))
228 theme
->titlebut_unfocused_unpressed_color
=
229 RrColorNew(inst
, 0xff, 0xff, 0xff);
230 if (!FIND(color
, L("window","active","buttons","pressed","image"),
231 &theme
->titlebut_focused_pressed_color
, NULL
))
232 theme
->titlebut_focused_pressed_color
=
234 theme
->titlebut_focused_unpressed_color
->r
,
235 theme
->titlebut_focused_unpressed_color
->g
,
236 theme
->titlebut_focused_unpressed_color
->b
);
237 if (!FIND(color
, L("window","inactive","buttons","pressed","image"),
238 &theme
->titlebut_unfocused_pressed_color
, NULL
))
239 theme
->titlebut_unfocused_pressed_color
=
241 theme
->titlebut_unfocused_unpressed_color
->r
,
242 theme
->titlebut_unfocused_unpressed_color
->g
,
243 theme
->titlebut_unfocused_unpressed_color
->b
);
244 if (!FIND(color
, L("window","active","buttons","disabled","image"),
245 &theme
->titlebut_disabled_focused_color
, NULL
))
246 theme
->titlebut_disabled_focused_color
=
247 RrColorNew(inst
, 0xff, 0xff, 0xff);
248 if (!FIND(color
, L("window","inactive","buttons","disabled","image"),
249 &theme
->titlebut_disabled_unfocused_color
, NULL
))
250 theme
->titlebut_disabled_unfocused_color
= RrColorNew(inst
, 0, 0, 0);
252 L("window","active","buttons","hover","image"),
253 &theme
->titlebut_hover_focused_color
, NULL
))
254 theme
->titlebut_hover_focused_color
=
256 theme
->titlebut_focused_unpressed_color
->r
,
257 theme
->titlebut_focused_unpressed_color
->g
,
258 theme
->titlebut_focused_unpressed_color
->b
);
259 if (!FIND(color
, L("window","inactive","buttons","hover","image"),
260 &theme
->titlebut_hover_unfocused_color
, NULL
))
261 theme
->titlebut_hover_unfocused_color
=
263 theme
->titlebut_unfocused_unpressed_color
->r
,
264 theme
->titlebut_unfocused_unpressed_color
->g
,
265 theme
->titlebut_unfocused_unpressed_color
->b
);
266 if (!FIND(color
, L("window","active","buttons","toggled","image"),
267 &theme
->titlebut_toggled_focused_color
, NULL
))
268 theme
->titlebut_toggled_focused_color
=
270 theme
->titlebut_focused_pressed_color
->r
,
271 theme
->titlebut_focused_pressed_color
->g
,
272 theme
->titlebut_focused_pressed_color
->b
);
273 if (!FIND(color
, L("window","inactive","buttons","toggled","image"),
274 &theme
->titlebut_toggled_unfocused_color
, NULL
))
275 theme
->titlebut_toggled_unfocused_color
=
277 theme
->titlebut_unfocused_pressed_color
->r
,
278 theme
->titlebut_unfocused_pressed_color
->g
,
279 theme
->titlebut_unfocused_pressed_color
->b
);
280 if (!FIND(color
, L("menu","title","text","primary"),
281 &theme
->menu_title_color
, NULL
))
282 theme
->menu_title_color
= RrColorNew(inst
, 0, 0, 0);
283 if (!FIND(color
, L("menu","inactive","primary"), &theme
->menu_color
, NULL
))
284 theme
->menu_color
= RrColorNew(inst
, 0xff, 0xff, 0xff);
285 if (!FIND(color
, L("menu","disabled","primary"),
286 &theme
->menu_disabled_color
, NULL
))
287 theme
->menu_disabled_color
= RrColorNew(inst
, 0, 0, 0);
288 if (!FIND(color
, L("menu","active","text","primary"),
289 &theme
->menu_selected_color
, NULL
))
290 theme
->menu_selected_color
= RrColorNew(inst
, 0, 0, 0);
291 if (!FIND(color
, L("window","active","label","text","shadow","primary"),
292 &theme
->title_focused_shadow_color
,
293 &theme
->title_focused_shadow_alpha
))
295 theme
->title_focused_shadow_color
= RrColorNew(inst
, 0, 0, 0);
296 theme
->title_focused_shadow_alpha
= 50;
298 if (!FIND(color
, L("osd","text","shadow","primary"),
299 &theme
->osd_shadow_color
, &theme
->osd_shadow_alpha
))
301 theme
->osd_shadow_color
=
302 RrColorNew(inst
, theme
->title_focused_shadow_color
->r
,
303 theme
->title_focused_shadow_color
->g
,
304 theme
->title_focused_shadow_color
->b
);
305 theme
->osd_shadow_alpha
= theme
->title_focused_shadow_alpha
;
307 if (!FIND(color
, L("window","inactive","label","text","shadow","primary"),
308 &theme
->title_unfocused_shadow_color
,
309 &theme
->title_unfocused_shadow_alpha
))
311 theme
->title_unfocused_shadow_color
= RrColorNew(inst
, 0, 0, 0);
312 theme
->title_unfocused_shadow_alpha
= 50;
314 if (!FIND(color
, L("menu","title","text","shadow","primary"),
315 &theme
->menu_title_shadow_color
,
316 &theme
->menu_title_shadow_alpha
))
318 theme
->menu_title_shadow_color
= RrColorNew(inst
, 0, 0, 0);
319 theme
->menu_title_shadow_alpha
= 50;
321 if (!FIND(color
, L("menu","inactive","shadow","primary"),
322 &theme
->menu_text_normal_shadow_color
,
323 &theme
->menu_text_normal_shadow_alpha
))
325 theme
->menu_text_normal_shadow_color
= RrColorNew(inst
, 0, 0, 0);
326 theme
->menu_text_normal_shadow_alpha
= 50;
328 if (!FIND(color
, L("menu","active","text","shadow","primary"),
329 &theme
->menu_text_selected_shadow_color
,
330 &theme
->menu_text_selected_shadow_alpha
))
332 theme
->menu_text_selected_shadow_color
= RrColorNew(inst
, 0, 0, 0);
333 theme
->menu_text_selected_shadow_alpha
= 50;
335 if (!FIND(color
, L("menu","disabled","shadow","primary"),
336 &theme
->menu_text_disabled_shadow_color
,
337 &theme
->menu_text_disabled_shadow_alpha
))
339 theme
->menu_text_disabled_shadow_color
=
340 RrColorNew(inst
, theme
->menu_text_normal_shadow_color
->r
,
341 theme
->menu_text_normal_shadow_color
->g
,
342 theme
->menu_text_normal_shadow_color
->b
);
343 theme
->menu_text_disabled_shadow_alpha
=
344 theme
->menu_text_normal_shadow_alpha
;
347 /* load the image masks */
348 if (read_mask(&ps
, "max.xbm", &theme
->max_mask
)) {
349 if (!read_mask(&ps
, "max_pressed.xbm", &theme
->max_pressed_mask
))
350 theme
->max_pressed_mask
= RrPixmapMaskCopy(theme
->max_mask
);
351 if (!read_mask(&ps
, "max_toggled.xbm", &theme
->max_toggled_mask
))
352 theme
->max_toggled_mask
=
353 RrPixmapMaskCopy(theme
->max_pressed_mask
);
354 if (!read_mask(&ps
, "max_disabled.xbm", &theme
->max_disabled_mask
))
355 theme
->max_disabled_mask
= RrPixmapMaskCopy(theme
->max_mask
);
356 if (!read_mask(&ps
, "max_hover.xbm", &theme
->max_hover_mask
))
357 theme
->max_hover_mask
= RrPixmapMaskCopy(theme
->max_mask
);
360 guchar data
[] = { 0x7f, 0x7f, 0x7f, 0x41, 0x41, 0x41, 0x7f };
361 theme
->max_mask
= RrPixmapMaskNew(inst
, 7, 7, (gchar
*)data
);
364 guchar data
[] = { 0x7c, 0x44, 0x47, 0x47, 0x7f, 0x1f, 0x1f };
365 theme
->max_toggled_mask
= RrPixmapMaskNew(inst
, 7, 7, (gchar
*)data
);
367 theme
->max_pressed_mask
= RrPixmapMaskCopy(theme
->max_mask
);
368 theme
->max_disabled_mask
= RrPixmapMaskCopy(theme
->max_mask
);
369 theme
->max_hover_mask
= RrPixmapMaskCopy(theme
->max_mask
);
372 if (read_mask(&ps
, "iconify.xbm", &theme
->iconify_mask
)) {
373 if (!read_mask(&ps
, "iconify_pressed.xbm",
374 &theme
->iconify_pressed_mask
))
375 theme
->iconify_pressed_mask
=
376 RrPixmapMaskCopy(theme
->iconify_mask
);
377 if (!read_mask(&ps
, "iconify_disabled.xbm",
378 &theme
->iconify_disabled_mask
))
379 theme
->iconify_disabled_mask
=
380 RrPixmapMaskCopy(theme
->iconify_mask
);
381 if (!read_mask(&ps
, "iconify_hover.xbm", &theme
->iconify_hover_mask
))
382 theme
->iconify_hover_mask
= RrPixmapMaskCopy(theme
->iconify_mask
);
385 guchar data
[] = { 0x00, 0x00, 0x00, 0x00, 0x7f, 0x7f, 0x7f };
386 theme
->iconify_mask
= RrPixmapMaskNew(inst
, 7, 7, (gchar
*)data
);
388 theme
->iconify_pressed_mask
= RrPixmapMaskCopy(theme
->iconify_mask
);
389 theme
->iconify_disabled_mask
= RrPixmapMaskCopy(theme
->iconify_mask
);
390 theme
->iconify_hover_mask
= RrPixmapMaskCopy(theme
->iconify_mask
);
393 theme
->def_win_icon
= read_c_image(OB_DEFAULT_ICON_WIDTH
,
394 OB_DEFAULT_ICON_HEIGHT
,
395 OB_DEFAULT_ICON_pixel_data
);
397 if (read_mask(&ps
, "desk.xbm", &theme
->desk_mask
)) {
398 if (!read_mask(&ps
, "desk_pressed.xbm", &theme
->desk_pressed_mask
))
399 theme
->desk_pressed_mask
= RrPixmapMaskCopy(theme
->desk_mask
);
400 if (!read_mask(&ps
, "desk_toggled.xbm", &theme
->desk_toggled_mask
))
401 theme
->desk_toggled_mask
=
402 RrPixmapMaskCopy(theme
->desk_pressed_mask
);
403 if (!read_mask(&ps
, "desk_disabled.xbm", &theme
->desk_disabled_mask
))
404 theme
->desk_disabled_mask
= RrPixmapMaskCopy(theme
->desk_mask
);
405 if (!read_mask(&ps
, "desk_hover.xbm", &theme
->desk_hover_mask
))
406 theme
->desk_hover_mask
= RrPixmapMaskCopy(theme
->desk_mask
);
409 guchar data
[] = { 0x63, 0x63, 0x00, 0x00, 0x00, 0x63, 0x63 };
410 theme
->desk_mask
= RrPixmapMaskNew(inst
, 7, 7, (gchar
*)data
);
413 guchar data
[] = { 0x00, 0x36, 0x36, 0x08, 0x36, 0x36, 0x00 };
414 theme
->desk_toggled_mask
= RrPixmapMaskNew(inst
, 7, 7,
417 theme
->desk_pressed_mask
= RrPixmapMaskCopy(theme
->desk_mask
);
418 theme
->desk_disabled_mask
= RrPixmapMaskCopy(theme
->desk_mask
);
419 theme
->desk_hover_mask
= RrPixmapMaskCopy(theme
->desk_mask
);
422 if (read_mask(&ps
, "shade.xbm", &theme
->shade_mask
)) {
423 if (!read_mask(&ps
, "shade_pressed.xbm", &theme
->shade_pressed_mask
))
424 theme
->shade_pressed_mask
= RrPixmapMaskCopy(theme
->shade_mask
);
425 if (!read_mask(&ps
, "shade_toggled.xbm", &theme
->shade_toggled_mask
))
426 theme
->shade_toggled_mask
=
427 RrPixmapMaskCopy(theme
->shade_pressed_mask
);
428 if (!read_mask(&ps
, "shade_disabled.xbm", &theme
->shade_disabled_mask
))
429 theme
->shade_disabled_mask
= RrPixmapMaskCopy(theme
->shade_mask
);
430 if (!read_mask(&ps
, "shade_hover.xbm", &theme
->shade_hover_mask
))
431 theme
->shade_hover_mask
= RrPixmapMaskCopy(theme
->shade_mask
);
434 guchar data
[] = { 0x7f, 0x7f, 0x7f, 0x00, 0x00, 0x00, 0x00 };
435 theme
->shade_mask
= RrPixmapMaskNew(inst
, 7, 7, (gchar
*)data
);
438 guchar data
[] = { 0x7f, 0x7f, 0x7f, 0x00, 0x00, 0x00, 0x7f };
439 theme
->shade_toggled_mask
= RrPixmapMaskNew(inst
, 7, 7,
442 theme
->shade_pressed_mask
= RrPixmapMaskCopy(theme
->shade_mask
);
443 theme
->shade_disabled_mask
= RrPixmapMaskCopy(theme
->shade_mask
);
444 theme
->shade_hover_mask
= RrPixmapMaskCopy(theme
->shade_mask
);
447 if (read_mask(&ps
, "close.xbm", &theme
->close_mask
)) {
448 if (!read_mask(&ps
, "close_pressed.xbm", &theme
->close_pressed_mask
))
449 theme
->close_pressed_mask
= RrPixmapMaskCopy(theme
->close_mask
);
450 if (!read_mask(&ps
, "close_disabled.xbm", &theme
->close_disabled_mask
))
451 theme
->close_disabled_mask
= RrPixmapMaskCopy(theme
->close_mask
);
452 if (!read_mask(&ps
, "close_hover.xbm", &theme
->close_hover_mask
))
453 theme
->close_hover_mask
= RrPixmapMaskCopy(theme
->close_mask
);
456 guchar data
[] = { 0x63, 0x77, 0x3e, 0x1c, 0x3e, 0x77, 0x63 };
457 theme
->close_mask
= RrPixmapMaskNew(inst
, 7, 7, (gchar
*)data
);
459 theme
->close_pressed_mask
= RrPixmapMaskCopy(theme
->close_mask
);
460 theme
->close_disabled_mask
= RrPixmapMaskCopy(theme
->close_mask
);
461 theme
->close_hover_mask
= RrPixmapMaskCopy(theme
->close_mask
);
464 if (!read_mask(&ps
, "bullet.xbm", &theme
->menu_bullet_mask
)) {
465 guchar data
[] = { 0x01, 0x03, 0x07, 0x0f, 0x07, 0x03, 0x01 };
466 theme
->menu_bullet_mask
= RrPixmapMaskNew(inst
, 4, 7, (gchar
*)data
);
469 /* read the decoration textures */
470 if (!FIND(appearance
, L("window","active","titlebar"),
471 theme
->a_focused_title
, FALSE
))
472 set_default_appearance(theme
->a_focused_title
);
473 if (!FIND(appearance
, L("window","inactive","titlebar"),
474 theme
->a_unfocused_title
, FALSE
))
475 set_default_appearance(theme
->a_unfocused_title
);
476 if (!FIND(appearance
, L("window","active","label"),
477 theme
->a_focused_label
, TRUE
))
478 set_default_appearance(theme
->a_focused_label
);
479 if (!FIND(appearance
, L("window","inactive","label"),
480 theme
->a_unfocused_label
, TRUE
))
481 set_default_appearance(theme
->a_unfocused_label
);
482 if (!FIND(appearance
, L("window","active","handle"),
483 theme
->a_focused_handle
, FALSE
))
484 set_default_appearance(theme
->a_focused_handle
);
485 if (!FIND(appearance
, L("window","inactive","handle"),
486 theme
->a_unfocused_handle
, FALSE
))
487 set_default_appearance(theme
->a_unfocused_handle
);
488 if (!FIND(appearance
, L("window","active","grip"),
489 theme
->a_focused_grip
, TRUE
))
490 set_default_appearance(theme
->a_focused_grip
);
491 if (!FIND(appearance
, L("window","inactive","grip"),
492 theme
->a_unfocused_grip
, TRUE
))
493 set_default_appearance(theme
->a_unfocused_grip
);
494 if (!FIND(appearance
, L("menu","entries"), theme
->a_menu
, FALSE
))
495 set_default_appearance(theme
->a_menu
);
496 if (!FIND(appearance
, L("menu","title"), theme
->a_menu_title
, FALSE
))
497 set_default_appearance(theme
->a_menu_title
);
498 if (!FIND(appearance
, L("menu", "active"), theme
->a_menu_selected
, TRUE
))
499 set_default_appearance(theme
->a_menu_selected
);
501 /* read the appearances for rendering non-decorations */
502 theme
->osd_hilite_bg
= RrAppearanceCopy(theme
->a_focused_title
);
503 theme
->osd_hilite_label
= RrAppearanceCopy(theme
->a_focused_label
);
504 if (theme
->a_focused_label
->surface
.grad
!= RR_SURFACE_PARENTREL
)
505 theme
->osd_hilite_fg
= RrAppearanceCopy(theme
->a_focused_label
);
507 theme
->osd_hilite_fg
= RrAppearanceCopy(theme
->a_focused_title
);
508 if (theme
->a_unfocused_label
->surface
.grad
!= RR_SURFACE_PARENTREL
)
509 theme
->osd_unhilite_fg
= RrAppearanceCopy(theme
->a_unfocused_label
);
511 theme
->osd_unhilite_fg
= RrAppearanceCopy(theme
->a_unfocused_title
);
513 /* read buttons textures */
514 if (!FIND(appearance
, L("window","active","buttons","disabled"),
515 theme
->a_disabled_focused_max
, TRUE
))
516 set_default_appearance(theme
->a_disabled_focused_max
);
517 if (!FIND(appearance
, L("window","inactive","buttons","disabled"),
518 theme
->a_disabled_unfocused_max
, TRUE
))
519 set_default_appearance(theme
->a_disabled_unfocused_max
);
520 if (!FIND(appearance
, L("window","active","buttons","pressed"),
521 theme
->a_focused_pressed_max
, TRUE
))
522 set_default_appearance(theme
->a_focused_pressed_max
);
523 if (!FIND(appearance
, L("window","inactive","buttons","pressed"),
524 theme
->a_unfocused_pressed_max
, TRUE
))
525 set_default_appearance(theme
->a_unfocused_pressed_max
);
526 if (!FIND(appearance
, L("window","active","buttons","toggled"),
527 theme
->a_toggled_focused_max
, TRUE
))
529 RrAppearanceFree(theme
->a_toggled_focused_max
);
530 theme
->a_toggled_focused_max
=
531 RrAppearanceCopy(theme
->a_focused_pressed_max
);
533 if (!FIND(appearance
, L("window","inactive","buttons","toggled"),
534 theme
->a_toggled_unfocused_max
, TRUE
))
536 RrAppearanceFree(theme
->a_toggled_unfocused_max
);
537 theme
->a_toggled_unfocused_max
=
538 RrAppearanceCopy(theme
->a_unfocused_pressed_max
);
540 if (!FIND(appearance
, L("window","active","buttons","unpressed"),
541 theme
->a_focused_unpressed_max
, TRUE
))
542 set_default_appearance(theme
->a_focused_unpressed_max
);
543 if (!FIND(appearance
, L("window","inactive","buttons","unpressed"),
544 theme
->a_unfocused_unpressed_max
, TRUE
))
545 set_default_appearance(theme
->a_unfocused_unpressed_max
);
546 if (!FIND(appearance
, L("window","active","buttons","hover"),
547 theme
->a_hover_focused_max
, TRUE
))
549 RrAppearanceFree(theme
->a_hover_focused_max
);
550 theme
->a_hover_focused_max
=
551 RrAppearanceCopy(theme
->a_focused_unpressed_max
);
553 if (!FIND(appearance
, L("window","inactive","buttons","hover"),
554 theme
->a_hover_unfocused_max
, TRUE
))
556 RrAppearanceFree(theme
->a_hover_unfocused_max
);
557 theme
->a_hover_unfocused_max
=
558 RrAppearanceCopy(theme
->a_unfocused_unpressed_max
);
561 theme
->a_disabled_focused_close
=
562 RrAppearanceCopy(theme
->a_disabled_focused_max
);
563 theme
->a_disabled_unfocused_close
=
564 RrAppearanceCopy(theme
->a_disabled_unfocused_max
);
565 theme
->a_hover_focused_close
=
566 RrAppearanceCopy(theme
->a_hover_focused_max
);
567 theme
->a_hover_unfocused_close
=
568 RrAppearanceCopy(theme
->a_hover_unfocused_max
);
569 theme
->a_unfocused_unpressed_close
=
570 RrAppearanceCopy(theme
->a_unfocused_unpressed_max
);
571 theme
->a_unfocused_pressed_close
=
572 RrAppearanceCopy(theme
->a_unfocused_pressed_max
);
573 theme
->a_focused_unpressed_close
=
574 RrAppearanceCopy(theme
->a_focused_unpressed_max
);
575 theme
->a_focused_pressed_close
=
576 RrAppearanceCopy(theme
->a_focused_pressed_max
);
577 theme
->a_disabled_focused_desk
=
578 RrAppearanceCopy(theme
->a_disabled_focused_max
);
579 theme
->a_disabled_unfocused_desk
=
580 RrAppearanceCopy(theme
->a_disabled_unfocused_max
);
581 theme
->a_hover_focused_desk
=
582 RrAppearanceCopy(theme
->a_hover_focused_max
);
583 theme
->a_hover_unfocused_desk
=
584 RrAppearanceCopy(theme
->a_hover_unfocused_max
);
585 theme
->a_toggled_focused_desk
=
586 RrAppearanceCopy(theme
->a_toggled_focused_max
);
587 theme
->a_toggled_unfocused_desk
=
588 RrAppearanceCopy(theme
->a_toggled_unfocused_max
);
589 theme
->a_unfocused_unpressed_desk
=
590 RrAppearanceCopy(theme
->a_unfocused_unpressed_max
);
591 theme
->a_unfocused_pressed_desk
=
592 RrAppearanceCopy(theme
->a_unfocused_pressed_max
);
593 theme
->a_focused_unpressed_desk
=
594 RrAppearanceCopy(theme
->a_focused_unpressed_max
);
595 theme
->a_focused_pressed_desk
=
596 RrAppearanceCopy(theme
->a_focused_pressed_max
);
597 theme
->a_disabled_focused_shade
=
598 RrAppearanceCopy(theme
->a_disabled_focused_max
);
599 theme
->a_disabled_unfocused_shade
=
600 RrAppearanceCopy(theme
->a_disabled_unfocused_max
);
601 theme
->a_hover_focused_shade
=
602 RrAppearanceCopy(theme
->a_hover_focused_max
);
603 theme
->a_hover_unfocused_shade
=
604 RrAppearanceCopy(theme
->a_hover_unfocused_max
);
605 theme
->a_toggled_focused_shade
=
606 RrAppearanceCopy(theme
->a_toggled_focused_max
);
607 theme
->a_toggled_unfocused_shade
=
608 RrAppearanceCopy(theme
->a_toggled_unfocused_max
);
609 theme
->a_unfocused_unpressed_shade
=
610 RrAppearanceCopy(theme
->a_unfocused_unpressed_max
);
611 theme
->a_unfocused_pressed_shade
=
612 RrAppearanceCopy(theme
->a_unfocused_pressed_max
);
613 theme
->a_focused_unpressed_shade
=
614 RrAppearanceCopy(theme
->a_focused_unpressed_max
);
615 theme
->a_focused_pressed_shade
=
616 RrAppearanceCopy(theme
->a_focused_pressed_max
);
617 theme
->a_disabled_focused_iconify
=
618 RrAppearanceCopy(theme
->a_disabled_focused_max
);
619 theme
->a_disabled_unfocused_iconify
=
620 RrAppearanceCopy(theme
->a_disabled_focused_max
);
621 theme
->a_hover_focused_iconify
=
622 RrAppearanceCopy(theme
->a_hover_focused_max
);
623 theme
->a_hover_unfocused_iconify
=
624 RrAppearanceCopy(theme
->a_hover_unfocused_max
);
625 theme
->a_unfocused_unpressed_iconify
=
626 RrAppearanceCopy(theme
->a_unfocused_unpressed_max
);
627 theme
->a_unfocused_pressed_iconify
=
628 RrAppearanceCopy(theme
->a_unfocused_pressed_max
);
629 theme
->a_focused_unpressed_iconify
=
630 RrAppearanceCopy(theme
->a_focused_unpressed_max
);
631 theme
->a_focused_pressed_iconify
=
632 RrAppearanceCopy(theme
->a_focused_pressed_max
);
634 theme
->a_icon
->surface
.grad
=
635 theme
->a_clear
->surface
.grad
=
636 theme
->a_clear_tex
->surface
.grad
=
637 theme
->a_menu_normal
->surface
.grad
=
638 theme
->a_menu_disabled
->surface
.grad
=
639 theme
->a_menu_text_normal
->surface
.grad
=
640 theme
->a_menu_text_disabled
->surface
.grad
=
641 theme
->a_menu_text_selected
->surface
.grad
=
642 theme
->a_menu_bullet_normal
->surface
.grad
=
643 theme
->a_menu_bullet_selected
->surface
.grad
= RR_SURFACE_PARENTREL
;
645 /* set up the textures */
646 theme
->a_focused_label
->texture
[0].type
=
647 theme
->osd_hilite_label
->texture
[0].type
= RR_TEXTURE_TEXT
;
648 theme
->a_focused_label
->texture
[0].data
.text
.justify
= winjust
;
649 theme
->osd_hilite_label
->texture
[0].data
.text
.justify
= RR_JUSTIFY_LEFT
;
650 theme
->a_focused_label
->texture
[0].data
.text
.font
=
651 theme
->osd_hilite_label
->texture
[0].data
.text
.font
=
652 theme
->win_font_focused
;
653 theme
->a_focused_label
->texture
[0].data
.text
.color
=
654 theme
->title_focused_color
;
655 theme
->osd_hilite_label
->texture
[0].data
.text
.color
=
658 if (!FIND(shadow
, L("window","active","label","text","shadow","offset"),
659 theme
->a_focused_label
))
660 theme
->a_focused_label
->texture
[0].data
.text
.shadow_offset_x
=
661 theme
->a_focused_label
->texture
[0].data
.text
.shadow_offset_y
= 0;
662 theme
->a_focused_label
->texture
[0].data
.text
.shadow_color
=
663 theme
->title_focused_shadow_color
;
664 theme
->a_focused_label
->texture
[0].data
.text
.shadow_alpha
=
665 theme
->title_focused_shadow_alpha
;
667 if (!FIND(shadow
, L("osd","text","shadow","offset"),
668 theme
->osd_hilite_label
))
670 theme
->osd_hilite_label
->texture
[0].data
.text
.shadow_offset_x
=
671 theme
->a_focused_label
->texture
[0].data
.text
.shadow_offset_x
;
672 theme
->osd_hilite_label
->texture
[0].data
.text
.shadow_offset_y
=
673 theme
->a_focused_label
->texture
[0].data
.text
.shadow_offset_y
;
675 theme
->osd_hilite_label
->texture
[0].data
.text
.shadow_color
=
676 theme
->osd_shadow_color
;
677 theme
->osd_hilite_label
->texture
[0].data
.text
.shadow_alpha
=
678 theme
->osd_shadow_alpha
;
680 theme
->a_unfocused_label
->texture
[0].type
= RR_TEXTURE_TEXT
;
681 theme
->a_unfocused_label
->texture
[0].data
.text
.justify
= winjust
;
682 theme
->a_unfocused_label
->texture
[0].data
.text
.font
=
683 theme
->win_font_unfocused
;
684 theme
->a_unfocused_label
->texture
[0].data
.text
.color
=
685 theme
->title_unfocused_color
;
687 if (!FIND(shadow
, L("window","inactive","label","text","shadow","offset"),
688 theme
->a_unfocused_label
))
689 theme
->a_unfocused_label
->texture
[0].data
.text
.shadow_offset_x
=
690 theme
->a_unfocused_label
->texture
[0].data
.text
.shadow_offset_y
= 0;
691 theme
->a_unfocused_label
->texture
[0].data
.text
.shadow_color
=
692 theme
->title_unfocused_shadow_color
;
693 theme
->a_unfocused_label
->texture
[0].data
.text
.shadow_alpha
=
694 theme
->title_unfocused_shadow_alpha
;
696 theme
->a_menu_title
->texture
[0].type
= RR_TEXTURE_TEXT
;
697 theme
->a_menu_title
->texture
[0].data
.text
.justify
= mtitlejust
;
698 theme
->a_menu_title
->texture
[0].data
.text
.font
= theme
->menu_title_font
;
699 theme
->a_menu_title
->texture
[0].data
.text
.color
= theme
->menu_title_color
;
701 if (!FIND(shadow
, L("menu","title","text","shadow","offset"),
702 theme
->a_menu_title
))
703 theme
->a_menu_title
->texture
[0].data
.text
.shadow_offset_x
=
704 theme
->a_menu_title
->texture
[0].data
.text
.shadow_offset_y
= 0;
705 theme
->a_menu_title
->texture
[0].data
.text
.shadow_color
=
706 theme
->menu_title_shadow_color
;
707 theme
->a_menu_title
->texture
[0].data
.text
.shadow_alpha
=
708 theme
->menu_title_shadow_alpha
;
710 theme
->a_menu_text_normal
->texture
[0].type
=
711 theme
->a_menu_text_disabled
->texture
[0].type
=
712 theme
->a_menu_text_selected
->texture
[0].type
= RR_TEXTURE_TEXT
;
713 theme
->a_menu_text_normal
->texture
[0].data
.text
.justify
=
714 theme
->a_menu_text_disabled
->texture
[0].data
.text
.justify
=
715 theme
->a_menu_text_selected
->texture
[0].data
.text
.justify
=
717 theme
->a_menu_text_normal
->texture
[0].data
.text
.font
=
718 theme
->a_menu_text_disabled
->texture
[0].data
.text
.font
=
719 theme
->a_menu_text_selected
->texture
[0].data
.text
.font
=
721 theme
->a_menu_text_normal
->texture
[0].data
.text
.color
= theme
->menu_color
;
722 theme
->a_menu_text_disabled
->texture
[0].data
.text
.color
=
723 theme
->menu_disabled_color
;
724 theme
->a_menu_text_selected
->texture
[0].data
.text
.color
=
725 theme
->menu_selected_color
;
727 if (!FIND(shadow
, L("menu","inactive","shadow","offset"),
728 theme
->a_menu_text_normal
))
729 theme
->a_menu_text_normal
->texture
[0].data
.text
.shadow_offset_x
=
730 theme
->a_menu_text_normal
->texture
[0].data
.text
.shadow_offset_y
=
732 if (!FIND(shadow
, L("menu","active","text","shadow","offset"),
733 theme
->a_menu_text_selected
))
734 theme
->a_menu_text_selected
->texture
[0].data
.text
.shadow_offset_x
=
735 theme
->a_menu_text_selected
->texture
[0].data
.text
.shadow_offset_y
=
737 if (!FIND(shadow
, L("menu","disabled","shadow","offset"),
738 theme
->a_menu_text_disabled
))
739 theme
->a_menu_text_disabled
->texture
[0].data
.text
.shadow_offset_x
=
740 theme
->a_menu_text_disabled
->texture
[0].data
.text
.shadow_offset_y
=
742 theme
->a_menu_text_normal
->texture
[0].data
.text
.shadow_color
=
743 theme
->menu_text_normal_shadow_color
;
744 theme
->a_menu_text_normal
->texture
[0].data
.text
.shadow_alpha
=
745 theme
->menu_text_normal_shadow_alpha
;
746 theme
->a_menu_text_selected
->texture
[0].data
.text
.shadow_color
=
747 theme
->menu_text_selected_shadow_color
;
748 theme
->a_menu_text_selected
->texture
[0].data
.text
.shadow_alpha
=
749 theme
->menu_text_selected_shadow_alpha
;
750 theme
->a_menu_text_disabled
->texture
[0].data
.text
.shadow_color
=
751 theme
->menu_text_disabled_shadow_color
;
752 theme
->a_menu_text_disabled
->texture
[0].data
.text
.shadow_alpha
=
753 theme
->menu_text_disabled_shadow_alpha
;
755 theme
->a_disabled_focused_max
->texture
[0].type
=
756 theme
->a_disabled_unfocused_max
->texture
[0].type
=
757 theme
->a_hover_focused_max
->texture
[0].type
=
758 theme
->a_hover_unfocused_max
->texture
[0].type
=
759 theme
->a_toggled_focused_max
->texture
[0].type
=
760 theme
->a_toggled_unfocused_max
->texture
[0].type
=
761 theme
->a_focused_unpressed_max
->texture
[0].type
=
762 theme
->a_focused_pressed_max
->texture
[0].type
=
763 theme
->a_unfocused_unpressed_max
->texture
[0].type
=
764 theme
->a_unfocused_pressed_max
->texture
[0].type
=
765 theme
->a_disabled_focused_close
->texture
[0].type
=
766 theme
->a_disabled_unfocused_close
->texture
[0].type
=
767 theme
->a_hover_focused_close
->texture
[0].type
=
768 theme
->a_hover_unfocused_close
->texture
[0].type
=
769 theme
->a_focused_unpressed_close
->texture
[0].type
=
770 theme
->a_focused_pressed_close
->texture
[0].type
=
771 theme
->a_unfocused_unpressed_close
->texture
[0].type
=
772 theme
->a_unfocused_pressed_close
->texture
[0].type
=
773 theme
->a_disabled_focused_desk
->texture
[0].type
=
774 theme
->a_disabled_unfocused_desk
->texture
[0].type
=
775 theme
->a_hover_focused_desk
->texture
[0].type
=
776 theme
->a_hover_unfocused_desk
->texture
[0].type
=
777 theme
->a_toggled_focused_desk
->texture
[0].type
=
778 theme
->a_toggled_unfocused_desk
->texture
[0].type
=
779 theme
->a_focused_unpressed_desk
->texture
[0].type
=
780 theme
->a_focused_pressed_desk
->texture
[0].type
=
781 theme
->a_unfocused_unpressed_desk
->texture
[0].type
=
782 theme
->a_unfocused_pressed_desk
->texture
[0].type
=
783 theme
->a_disabled_focused_shade
->texture
[0].type
=
784 theme
->a_disabled_unfocused_shade
->texture
[0].type
=
785 theme
->a_hover_focused_shade
->texture
[0].type
=
786 theme
->a_hover_unfocused_shade
->texture
[0].type
=
787 theme
->a_toggled_focused_shade
->texture
[0].type
=
788 theme
->a_toggled_unfocused_shade
->texture
[0].type
=
789 theme
->a_focused_unpressed_shade
->texture
[0].type
=
790 theme
->a_focused_pressed_shade
->texture
[0].type
=
791 theme
->a_unfocused_unpressed_shade
->texture
[0].type
=
792 theme
->a_unfocused_pressed_shade
->texture
[0].type
=
793 theme
->a_disabled_focused_iconify
->texture
[0].type
=
794 theme
->a_disabled_unfocused_iconify
->texture
[0].type
=
795 theme
->a_hover_focused_iconify
->texture
[0].type
=
796 theme
->a_hover_unfocused_iconify
->texture
[0].type
=
797 theme
->a_focused_unpressed_iconify
->texture
[0].type
=
798 theme
->a_focused_pressed_iconify
->texture
[0].type
=
799 theme
->a_unfocused_unpressed_iconify
->texture
[0].type
=
800 theme
->a_unfocused_pressed_iconify
->texture
[0].type
=
801 theme
->a_menu_bullet_normal
->texture
[0].type
=
802 theme
->a_menu_bullet_selected
->texture
[0].type
= RR_TEXTURE_MASK
;
804 theme
->a_disabled_focused_max
->texture
[0].data
.mask
.mask
=
805 theme
->a_disabled_unfocused_max
->texture
[0].data
.mask
.mask
=
806 theme
->max_disabled_mask
;
807 theme
->a_hover_focused_max
->texture
[0].data
.mask
.mask
=
808 theme
->a_hover_unfocused_max
->texture
[0].data
.mask
.mask
=
809 theme
->max_hover_mask
;
810 theme
->a_focused_pressed_max
->texture
[0].data
.mask
.mask
=
811 theme
->a_unfocused_pressed_max
->texture
[0].data
.mask
.mask
=
812 theme
->max_pressed_mask
;
813 theme
->a_focused_unpressed_max
->texture
[0].data
.mask
.mask
=
814 theme
->a_unfocused_unpressed_max
->texture
[0].data
.mask
.mask
=
816 theme
->a_toggled_focused_max
->texture
[0].data
.mask
.mask
=
817 theme
->a_toggled_unfocused_max
->texture
[0].data
.mask
.mask
=
818 theme
->max_toggled_mask
;
819 theme
->a_disabled_focused_close
->texture
[0].data
.mask
.mask
=
820 theme
->a_disabled_unfocused_close
->texture
[0].data
.mask
.mask
=
821 theme
->close_disabled_mask
;
822 theme
->a_hover_focused_close
->texture
[0].data
.mask
.mask
=
823 theme
->a_hover_unfocused_close
->texture
[0].data
.mask
.mask
=
824 theme
->close_hover_mask
;
825 theme
->a_focused_pressed_close
->texture
[0].data
.mask
.mask
=
826 theme
->a_unfocused_pressed_close
->texture
[0].data
.mask
.mask
=
827 theme
->close_pressed_mask
;
828 theme
->a_focused_unpressed_close
->texture
[0].data
.mask
.mask
=
829 theme
->a_unfocused_unpressed_close
->texture
[0].data
.mask
.mask
=
831 theme
->a_disabled_focused_desk
->texture
[0].data
.mask
.mask
=
832 theme
->a_disabled_unfocused_desk
->texture
[0].data
.mask
.mask
=
833 theme
->desk_disabled_mask
;
834 theme
->a_hover_focused_desk
->texture
[0].data
.mask
.mask
=
835 theme
->a_hover_unfocused_desk
->texture
[0].data
.mask
.mask
=
836 theme
->desk_hover_mask
;
837 theme
->a_focused_pressed_desk
->texture
[0].data
.mask
.mask
=
838 theme
->a_unfocused_pressed_desk
->texture
[0].data
.mask
.mask
=
839 theme
->desk_pressed_mask
;
840 theme
->a_focused_unpressed_desk
->texture
[0].data
.mask
.mask
=
841 theme
->a_unfocused_unpressed_desk
->texture
[0].data
.mask
.mask
=
843 theme
->a_toggled_focused_desk
->texture
[0].data
.mask
.mask
=
844 theme
->a_toggled_unfocused_desk
->texture
[0].data
.mask
.mask
=
845 theme
->desk_toggled_mask
;
846 theme
->a_disabled_focused_shade
->texture
[0].data
.mask
.mask
=
847 theme
->a_disabled_unfocused_shade
->texture
[0].data
.mask
.mask
=
848 theme
->shade_disabled_mask
;
849 theme
->a_hover_focused_shade
->texture
[0].data
.mask
.mask
=
850 theme
->a_hover_unfocused_shade
->texture
[0].data
.mask
.mask
=
851 theme
->shade_hover_mask
;
852 theme
->a_focused_pressed_shade
->texture
[0].data
.mask
.mask
=
853 theme
->a_unfocused_pressed_shade
->texture
[0].data
.mask
.mask
=
854 theme
->shade_pressed_mask
;
855 theme
->a_focused_unpressed_shade
->texture
[0].data
.mask
.mask
=
856 theme
->a_unfocused_unpressed_shade
->texture
[0].data
.mask
.mask
=
858 theme
->a_toggled_focused_shade
->texture
[0].data
.mask
.mask
=
859 theme
->a_toggled_unfocused_shade
->texture
[0].data
.mask
.mask
=
860 theme
->shade_toggled_mask
;
861 theme
->a_disabled_focused_iconify
->texture
[0].data
.mask
.mask
=
862 theme
->a_disabled_unfocused_iconify
->texture
[0].data
.mask
.mask
=
863 theme
->iconify_disabled_mask
;
864 theme
->a_hover_focused_iconify
->texture
[0].data
.mask
.mask
=
865 theme
->a_hover_unfocused_iconify
->texture
[0].data
.mask
.mask
=
866 theme
->iconify_hover_mask
;
867 theme
->a_focused_pressed_iconify
->texture
[0].data
.mask
.mask
=
868 theme
->a_unfocused_pressed_iconify
->texture
[0].data
.mask
.mask
=
869 theme
->iconify_pressed_mask
;
870 theme
->a_focused_unpressed_iconify
->texture
[0].data
.mask
.mask
=
871 theme
->a_unfocused_unpressed_iconify
->texture
[0].data
.mask
.mask
=
873 theme
->a_menu_bullet_normal
->texture
[0].data
.mask
.mask
=
874 theme
->a_menu_bullet_selected
->texture
[0].data
.mask
.mask
=
875 theme
->menu_bullet_mask
;
876 theme
->a_disabled_focused_max
->texture
[0].data
.mask
.color
=
877 theme
->a_disabled_focused_close
->texture
[0].data
.mask
.color
=
878 theme
->a_disabled_focused_desk
->texture
[0].data
.mask
.color
=
879 theme
->a_disabled_focused_shade
->texture
[0].data
.mask
.color
=
880 theme
->a_disabled_focused_iconify
->texture
[0].data
.mask
.color
=
881 theme
->titlebut_disabled_focused_color
;
882 theme
->a_disabled_unfocused_max
->texture
[0].data
.mask
.color
=
883 theme
->a_disabled_unfocused_close
->texture
[0].data
.mask
.color
=
884 theme
->a_disabled_unfocused_desk
->texture
[0].data
.mask
.color
=
885 theme
->a_disabled_unfocused_shade
->texture
[0].data
.mask
.color
=
886 theme
->a_disabled_unfocused_iconify
->texture
[0].data
.mask
.color
=
887 theme
->titlebut_disabled_unfocused_color
;
888 theme
->a_hover_focused_max
->texture
[0].data
.mask
.color
=
889 theme
->a_hover_focused_close
->texture
[0].data
.mask
.color
=
890 theme
->a_hover_focused_desk
->texture
[0].data
.mask
.color
=
891 theme
->a_hover_focused_shade
->texture
[0].data
.mask
.color
=
892 theme
->a_hover_focused_iconify
->texture
[0].data
.mask
.color
=
893 theme
->titlebut_hover_focused_color
;
894 theme
->a_hover_unfocused_max
->texture
[0].data
.mask
.color
=
895 theme
->a_hover_unfocused_close
->texture
[0].data
.mask
.color
=
896 theme
->a_hover_unfocused_desk
->texture
[0].data
.mask
.color
=
897 theme
->a_hover_unfocused_shade
->texture
[0].data
.mask
.color
=
898 theme
->a_hover_unfocused_iconify
->texture
[0].data
.mask
.color
=
899 theme
->titlebut_hover_unfocused_color
;
900 theme
->a_toggled_focused_max
->texture
[0].data
.mask
.color
=
901 theme
->a_toggled_focused_desk
->texture
[0].data
.mask
.color
=
902 theme
->a_toggled_focused_shade
->texture
[0].data
.mask
.color
=
903 theme
->titlebut_toggled_focused_color
;
904 theme
->a_toggled_unfocused_max
->texture
[0].data
.mask
.color
=
905 theme
->a_toggled_unfocused_desk
->texture
[0].data
.mask
.color
=
906 theme
->a_toggled_unfocused_shade
->texture
[0].data
.mask
.color
=
907 theme
->titlebut_toggled_unfocused_color
;
908 theme
->a_focused_unpressed_max
->texture
[0].data
.mask
.color
=
909 theme
->a_focused_unpressed_close
->texture
[0].data
.mask
.color
=
910 theme
->a_focused_unpressed_desk
->texture
[0].data
.mask
.color
=
911 theme
->a_focused_unpressed_shade
->texture
[0].data
.mask
.color
=
912 theme
->a_focused_unpressed_iconify
->texture
[0].data
.mask
.color
=
913 theme
->titlebut_focused_unpressed_color
;
914 theme
->a_focused_pressed_max
->texture
[0].data
.mask
.color
=
915 theme
->a_focused_pressed_close
->texture
[0].data
.mask
.color
=
916 theme
->a_focused_pressed_desk
->texture
[0].data
.mask
.color
=
917 theme
->a_focused_pressed_shade
->texture
[0].data
.mask
.color
=
918 theme
->a_focused_pressed_iconify
->texture
[0].data
.mask
.color
=
919 theme
->titlebut_focused_pressed_color
;
920 theme
->a_unfocused_unpressed_max
->texture
[0].data
.mask
.color
=
921 theme
->a_unfocused_unpressed_close
->texture
[0].data
.mask
.color
=
922 theme
->a_unfocused_unpressed_desk
->texture
[0].data
.mask
.color
=
923 theme
->a_unfocused_unpressed_shade
->texture
[0].data
.mask
.color
=
924 theme
->a_unfocused_unpressed_iconify
->texture
[0].data
.mask
.color
=
925 theme
->titlebut_unfocused_unpressed_color
;
926 theme
->a_unfocused_pressed_max
->texture
[0].data
.mask
.color
=
927 theme
->a_unfocused_pressed_close
->texture
[0].data
.mask
.color
=
928 theme
->a_unfocused_pressed_desk
->texture
[0].data
.mask
.color
=
929 theme
->a_unfocused_pressed_shade
->texture
[0].data
.mask
.color
=
930 theme
->a_unfocused_pressed_iconify
->texture
[0].data
.mask
.color
=
931 theme
->titlebut_unfocused_pressed_color
;
932 theme
->a_menu_bullet_normal
->texture
[0].data
.mask
.color
=
934 theme
->a_menu_bullet_selected
->texture
[0].data
.mask
.color
=
935 theme
->menu_selected_color
;
941 gint ft
, fb
, fl
, fr
, ut
, ub
, ul
, ur
;
942 RrAppearance
*a
, *b
, *c
;
944 /* caluclate the font heights*/
945 a
= theme
->a_focused_label
;
946 theme
->win_font_height
=
947 RrFontHeight(theme
->win_font_focused
,
948 a
->texture
[0].data
.text
.shadow_offset_y
);
949 a
= theme
->a_unfocused_label
;
950 theme
->win_font_height
=
951 MAX(theme
->win_font_height
,
952 RrFontHeight(theme
->win_font_unfocused
,
953 a
->texture
[0].data
.text
.shadow_offset_y
));
954 a
= theme
->a_menu_title
;
955 theme
->menu_title_font_height
=
956 RrFontHeight(theme
->menu_title_font
,
957 a
->texture
[0].data
.text
.shadow_offset_y
);
958 a
= theme
->a_menu_text_normal
;
959 b
= theme
->a_menu_text_selected
;
960 c
= theme
->a_menu_text_disabled
;
961 theme
->menu_font_height
=
962 RrFontHeight(theme
->menu_font
,
963 MAX(a
->texture
[0].data
.text
.shadow_offset_y
,
964 MAX(b
->texture
[0].data
.text
.shadow_offset_y
,
965 c
->texture
[0].data
.text
.shadow_offset_y
)));
967 RrMargins(theme
->a_focused_label
, &fl
, &ft
, &fr
, &fb
);
968 RrMargins(theme
->a_unfocused_label
, &ul
, &ut
, &ur
, &ub
);
969 theme
->label_height
= theme
->win_font_height
+ MAX(ft
+ fb
, ut
+ ub
);
971 /* this would be nice I think, since padding.width can now be 0,
972 but it breaks frame.c horribly and I don't feel like fixing that
973 right now, so if anyone complains, here is how to keep text from
974 going over the title's bevel/border with a padding.width of 0 and a
975 bevelless/borderless label
976 RrMargins(theme->a_focused_title, &fl, &ft, &fr, &fb);
977 RrMargins(theme->a_unfocused_title, &ul, &ut, &ur, &ub);
978 theme->title_height = theme->label_height +
979 MAX(MAX(theme->padding * 2, ft + fb),
980 MAX(theme->padding * 2, ut + ub));
982 theme
->title_height
= theme
->label_height
+ theme
->paddingy
* 2;
983 /* this should match the above title_height given the same font size
985 theme
->menu_title_height
= theme
->menu_title_font_height
+
988 theme
->button_size
= theme
->label_height
- 2;
989 theme
->grip_width
= 25;
994 void RrThemeFree(RrTheme
*theme
)
997 RrColorFree(theme
->menu_b_color
);
998 RrColorFree(theme
->frame_b_color
);
999 RrColorFree(theme
->cb_unfocused_color
);
1000 RrColorFree(theme
->cb_focused_color
);
1001 RrColorFree(theme
->title_focused_color
);
1002 RrColorFree(theme
->title_unfocused_color
);
1003 RrColorFree(theme
->titlebut_disabled_focused_color
);
1004 RrColorFree(theme
->titlebut_disabled_unfocused_color
);
1005 RrColorFree(theme
->titlebut_hover_focused_color
);
1006 RrColorFree(theme
->titlebut_hover_unfocused_color
);
1007 RrColorFree(theme
->titlebut_toggled_focused_color
);
1008 RrColorFree(theme
->titlebut_toggled_unfocused_color
);
1009 RrColorFree(theme
->titlebut_focused_pressed_color
);
1010 RrColorFree(theme
->titlebut_unfocused_pressed_color
);
1011 RrColorFree(theme
->titlebut_focused_unpressed_color
);
1012 RrColorFree(theme
->titlebut_unfocused_unpressed_color
);
1013 RrColorFree(theme
->menu_title_color
);
1014 RrColorFree(theme
->menu_color
);
1015 RrColorFree(theme
->menu_disabled_color
);
1016 RrColorFree(theme
->menu_selected_color
);
1017 RrColorFree(theme
->title_focused_shadow_color
);
1018 RrColorFree(theme
->title_unfocused_shadow_color
);
1019 RrColorFree(theme
->osd_color
);
1020 RrColorFree(theme
->osd_shadow_color
);
1021 RrColorFree(theme
->menu_title_shadow_color
);
1022 RrColorFree(theme
->menu_text_normal_shadow_color
);
1023 RrColorFree(theme
->menu_text_selected_shadow_color
);
1024 RrColorFree(theme
->menu_text_disabled_shadow_color
);
1026 g_free(theme
->def_win_icon
);
1028 RrPixmapMaskFree(theme
->max_mask
);
1029 RrPixmapMaskFree(theme
->max_toggled_mask
);
1030 RrPixmapMaskFree(theme
->max_disabled_mask
);
1031 RrPixmapMaskFree(theme
->max_hover_mask
);
1032 RrPixmapMaskFree(theme
->max_pressed_mask
);
1033 RrPixmapMaskFree(theme
->desk_mask
);
1034 RrPixmapMaskFree(theme
->desk_toggled_mask
);
1035 RrPixmapMaskFree(theme
->desk_disabled_mask
);
1036 RrPixmapMaskFree(theme
->desk_hover_mask
);
1037 RrPixmapMaskFree(theme
->desk_pressed_mask
);
1038 RrPixmapMaskFree(theme
->shade_mask
);
1039 RrPixmapMaskFree(theme
->shade_toggled_mask
);
1040 RrPixmapMaskFree(theme
->shade_disabled_mask
);
1041 RrPixmapMaskFree(theme
->shade_hover_mask
);
1042 RrPixmapMaskFree(theme
->shade_pressed_mask
);
1043 RrPixmapMaskFree(theme
->iconify_mask
);
1044 RrPixmapMaskFree(theme
->iconify_disabled_mask
);
1045 RrPixmapMaskFree(theme
->iconify_hover_mask
);
1046 RrPixmapMaskFree(theme
->iconify_pressed_mask
);
1047 RrPixmapMaskFree(theme
->close_mask
);
1048 RrPixmapMaskFree(theme
->close_disabled_mask
);
1049 RrPixmapMaskFree(theme
->close_hover_mask
);
1050 RrPixmapMaskFree(theme
->close_pressed_mask
);
1051 RrPixmapMaskFree(theme
->menu_bullet_mask
);
1053 RrFontClose(theme
->win_font_focused
);
1054 RrFontClose(theme
->win_font_unfocused
);
1055 RrFontClose(theme
->menu_title_font
);
1056 RrFontClose(theme
->menu_font
);
1058 RrAppearanceFree(theme
->a_disabled_focused_max
);
1059 RrAppearanceFree(theme
->a_disabled_unfocused_max
);
1060 RrAppearanceFree(theme
->a_hover_focused_max
);
1061 RrAppearanceFree(theme
->a_hover_unfocused_max
);
1062 RrAppearanceFree(theme
->a_toggled_focused_max
);
1063 RrAppearanceFree(theme
->a_toggled_unfocused_max
);
1064 RrAppearanceFree(theme
->a_focused_unpressed_max
);
1065 RrAppearanceFree(theme
->a_focused_pressed_max
);
1066 RrAppearanceFree(theme
->a_unfocused_unpressed_max
);
1067 RrAppearanceFree(theme
->a_unfocused_pressed_max
);
1068 RrAppearanceFree(theme
->a_disabled_focused_close
);
1069 RrAppearanceFree(theme
->a_disabled_unfocused_close
);
1070 RrAppearanceFree(theme
->a_hover_focused_close
);
1071 RrAppearanceFree(theme
->a_hover_unfocused_close
);
1072 RrAppearanceFree(theme
->a_focused_unpressed_close
);
1073 RrAppearanceFree(theme
->a_focused_pressed_close
);
1074 RrAppearanceFree(theme
->a_unfocused_unpressed_close
);
1075 RrAppearanceFree(theme
->a_unfocused_pressed_close
);
1076 RrAppearanceFree(theme
->a_disabled_focused_desk
);
1077 RrAppearanceFree(theme
->a_disabled_unfocused_desk
);
1078 RrAppearanceFree(theme
->a_hover_focused_desk
);
1079 RrAppearanceFree(theme
->a_hover_unfocused_desk
);
1080 RrAppearanceFree(theme
->a_toggled_focused_desk
);
1081 RrAppearanceFree(theme
->a_toggled_unfocused_desk
);
1082 RrAppearanceFree(theme
->a_focused_unpressed_desk
);
1083 RrAppearanceFree(theme
->a_focused_pressed_desk
);
1084 RrAppearanceFree(theme
->a_unfocused_unpressed_desk
);
1085 RrAppearanceFree(theme
->a_unfocused_pressed_desk
);
1086 RrAppearanceFree(theme
->a_disabled_focused_shade
);
1087 RrAppearanceFree(theme
->a_disabled_unfocused_shade
);
1088 RrAppearanceFree(theme
->a_hover_focused_shade
);
1089 RrAppearanceFree(theme
->a_hover_unfocused_shade
);
1090 RrAppearanceFree(theme
->a_toggled_focused_shade
);
1091 RrAppearanceFree(theme
->a_toggled_unfocused_shade
);
1092 RrAppearanceFree(theme
->a_focused_unpressed_shade
);
1093 RrAppearanceFree(theme
->a_focused_pressed_shade
);
1094 RrAppearanceFree(theme
->a_unfocused_unpressed_shade
);
1095 RrAppearanceFree(theme
->a_unfocused_pressed_shade
);
1096 RrAppearanceFree(theme
->a_disabled_focused_iconify
);
1097 RrAppearanceFree(theme
->a_disabled_unfocused_iconify
);
1098 RrAppearanceFree(theme
->a_hover_focused_iconify
);
1099 RrAppearanceFree(theme
->a_hover_unfocused_iconify
);
1100 RrAppearanceFree(theme
->a_focused_unpressed_iconify
);
1101 RrAppearanceFree(theme
->a_focused_pressed_iconify
);
1102 RrAppearanceFree(theme
->a_unfocused_unpressed_iconify
);
1103 RrAppearanceFree(theme
->a_unfocused_pressed_iconify
);
1104 RrAppearanceFree(theme
->a_focused_grip
);
1105 RrAppearanceFree(theme
->a_unfocused_grip
);
1106 RrAppearanceFree(theme
->a_focused_title
);
1107 RrAppearanceFree(theme
->a_unfocused_title
);
1108 RrAppearanceFree(theme
->a_focused_label
);
1109 RrAppearanceFree(theme
->a_unfocused_label
);
1110 RrAppearanceFree(theme
->a_icon
);
1111 RrAppearanceFree(theme
->a_focused_handle
);
1112 RrAppearanceFree(theme
->a_unfocused_handle
);
1113 RrAppearanceFree(theme
->a_menu
);
1114 RrAppearanceFree(theme
->a_menu_title
);
1115 RrAppearanceFree(theme
->a_menu_normal
);
1116 RrAppearanceFree(theme
->a_menu_disabled
);
1117 RrAppearanceFree(theme
->a_menu_selected
);
1118 RrAppearanceFree(theme
->a_menu_text_normal
);
1119 RrAppearanceFree(theme
->a_menu_text_disabled
);
1120 RrAppearanceFree(theme
->a_menu_text_selected
);
1121 RrAppearanceFree(theme
->a_menu_bullet_normal
);
1122 RrAppearanceFree(theme
->a_menu_bullet_selected
);
1123 RrAppearanceFree(theme
->a_clear
);
1124 RrAppearanceFree(theme
->a_clear_tex
);
1125 RrAppearanceFree(theme
->osd_hilite_bg
);
1126 RrAppearanceFree(theme
->osd_hilite_fg
);
1127 RrAppearanceFree(theme
->osd_hilite_label
);
1128 RrAppearanceFree(theme
->osd_unhilite_fg
);
1134 static gboolean
read_mask(ParseState
*ps
, gchar
*maskname
,
1135 RrPixmapMask
**value
)
1137 gboolean ret
= FALSE
;
1139 gint hx
, hy
; /* ignored */
1143 s
= g_build_filename(ps
->path
, maskname
, NULL
);
1144 if (XReadBitmapFileData(s
, &w
, &h
, &b
, &hx
, &hy
) == BitmapSuccess
) {
1146 *value
= RrPixmapMaskNew(ps
->inst
, w
, h
, (gchar
*)b
);
1154 static void set_default_appearance(RrAppearance
*a
)
1156 a
->surface
.grad
= RR_SURFACE_SOLID
;
1157 a
->surface
.relief
= RR_RELIEF_FLAT
;
1158 a
->surface
.bevel
= RR_BEVEL_1
;
1159 a
->surface
.interlaced
= FALSE
;
1160 a
->surface
.border
= FALSE
;
1161 a
->surface
.primary
= RrColorNew(a
->inst
, 0, 0, 0);
1162 a
->surface
.secondary
= RrColorNew(a
->inst
, 0, 0, 0);
1165 /* Reads the output from gimp's C-Source file format into valid RGBA data for
1166 an RrTextureRGBA. */
1167 static RrPixel32
* read_c_image(gint width
, gint height
, const guint8
*data
)
1172 p
= im
= g_memdup(data
, width
* height
* sizeof(RrPixel32
));
1174 for (i
= 0; i
< width
* height
; ++i
) {
1175 guchar a
= ((*p
>> 24) & 0xff);
1176 guchar b
= ((*p
>> 16) & 0xff);
1177 guchar g
= ((*p
>> 8) & 0xff);
1178 guchar r
= ((*p
>> 0) & 0xff);
1180 *p
= ((r
<< RrDefaultRedOffset
) +
1181 (g
<< RrDefaultGreenOffset
) +
1182 (b
<< RrDefaultBlueOffset
) +
1183 (a
<< RrDefaultAlphaOffset
));
1190 static void parse_style(gchar
*tex
, RrSurfaceColorType
*grad
,
1191 RrReliefType
*relief
, RrBevelType
*bevel
,
1192 gboolean
*interlaced
, gboolean
*border
,
1193 gboolean allow_trans
)
1197 /* convert to all lowercase */
1198 for (t
= tex
; *t
!= '\0'; ++t
)
1199 *t
= g_ascii_tolower(*t
);
1201 if (allow_trans
&& strstr(tex
, "parentrelative") != NULL
) {
1202 *grad
= RR_SURFACE_PARENTREL
;
1204 if (strstr(tex
, "gradient") != NULL
) {
1205 if (strstr(tex
, "crossdiagonal") != NULL
)
1206 *grad
= RR_SURFACE_CROSS_DIAGONAL
;
1207 else if (strstr(tex
, "pyramid") != NULL
)
1208 *grad
= RR_SURFACE_PYRAMID
;
1209 else if (strstr(tex
, "mirrorhorizontal") != NULL
)
1210 *grad
= RR_SURFACE_MIRROR_HORIZONTAL
;
1211 else if (strstr(tex
, "horizontal") != NULL
)
1212 *grad
= RR_SURFACE_HORIZONTAL
;
1213 else if (strstr(tex
, "splitvertical") != NULL
)
1214 *grad
= RR_SURFACE_SPLIT_VERTICAL
;
1215 else if (strstr(tex
, "vertical") != NULL
)
1216 *grad
= RR_SURFACE_VERTICAL
;
1218 *grad
= RR_SURFACE_DIAGONAL
;
1220 *grad
= RR_SURFACE_SOLID
;
1223 if (strstr(tex
, "sunken") != NULL
)
1224 *relief
= RR_RELIEF_SUNKEN
;
1225 else if (strstr(tex
, "flat") != NULL
)
1226 *relief
= RR_RELIEF_FLAT
;
1228 *relief
= RR_RELIEF_RAISED
;
1231 if (*relief
== RR_RELIEF_FLAT
) {
1232 if (strstr(tex
, "border") != NULL
)
1235 if (strstr(tex
, "bevel2") != NULL
)
1236 *bevel
= RR_BEVEL_2
;
1238 *bevel
= RR_BEVEL_1
;
1241 if (strstr(tex
, "interlaced") != NULL
)
1244 *interlaced
= FALSE
;
1248 static xmlNodePtr
find_node(xmlNodePtr n
, gchar
*names
[])
1252 for (i
= 0; names
[i
] && n
; ++i
)
1253 n
= parse_find_node(names
[i
], n
->children
);
1257 static gboolean
find_int(ParseState
*ps
, xmlNodePtr n
, gchar
*names
[],
1258 gint
*integer
, gint lower
, gint upper
)
1262 if ((n
= find_node(n
, names
))) {
1263 i
= parse_int(ps
->doc
, n
);
1264 if (i
>= lower
&& i
<= upper
) {
1272 static gboolean
find_string(ParseState
*ps
, xmlNodePtr n
, gchar
*names
[],
1275 if ((n
= find_node(n
, names
))) {
1276 *string
= parse_string(ps
->doc
, n
);
1282 static gboolean
find_color(ParseState
*ps
, xmlNodePtr n
, gchar
*names
[],
1283 RrColor
**color
, gchar
*alpha
)
1285 if ((n
= find_node(n
, names
))) {
1287 if (parse_attr_int("r", n
, &r
) &&
1288 parse_attr_int("g", n
, &g
) &&
1289 parse_attr_int("b", n
, &b
) &&
1290 parse_attr_int("a", n
, &a
) &&
1291 r
>= 0 && g
>= 0 && b
>= 0 && a
>= 0 &&
1292 r
< 256 && g
< 256 && b
< 256 && a
< 256)
1294 *color
= RrColorNew(ps
->inst
, r
, g
, b
);
1295 if (alpha
) *alpha
= a
;
1302 static gboolean
find_point(ParseState
*ps
, xmlNodePtr n
, gchar
*names
[],
1304 gint lowx
, gint upx
, gint lowy
, gint upy
)
1306 if ((n
= find_node(n
, names
))) {
1308 if (parse_attr_int("x", n
, &a
) &&
1309 parse_attr_int("y", n
, &b
) &&
1310 a
>= lowx
&& a
<= upx
&& b
>= lowy
&& b
<= upy
)
1319 static gboolean
find_shadow(ParseState
*ps
, xmlNodePtr n
, gchar
*names
[],
1322 return find_point(ps
, n
, names
,
1323 &a
->texture
[0].data
.text
.shadow_offset_x
,
1324 &a
->texture
[0].data
.text
.shadow_offset_y
,
1328 static gboolean
find_appearance(ParseState
*ps
, xmlNodePtr n
, gchar
*names
[],
1329 RrAppearance
*a
, gboolean allow_trans
)
1333 if (!(n
= find_node(n
, names
)))
1336 if ((n2
= find_node(n
, L("style")))) {
1337 gchar
*s
= parse_string(ps
->doc
, n2
);
1338 parse_style(s
, &a
->surface
.grad
, &a
->surface
.relief
,
1339 &a
->surface
.bevel
, &a
->surface
.interlaced
,
1340 &a
->surface
.border
, allow_trans
);
1345 if (!find_color(ps
, n
, L("primary"), &a
->surface
.primary
, NULL
))
1346 a
->surface
.primary
= RrColorNew(ps
->inst
, 0, 0, 0);
1347 if (!find_color(ps
, n
, L("secondary"), &a
->surface
.secondary
, NULL
))
1348 a
->surface
.secondary
= RrColorNew(ps
->inst
, 0, 0, 0);
1349 if (a
->surface
.border
)
1350 if (!find_color(ps
, n
, L("border"),
1351 &a
->surface
.border_color
, NULL
))
1352 a
->surface
.border_color
= RrColorNew(ps
->inst
, 0, 0, 0);
1353 if (a
->surface
.interlaced
)
1354 if (!find_color(ps
, n
, L("interlace"),
1355 &a
->surface
.interlace_color
, NULL
))
1356 a
->surface
.interlace_color
= RrColorNew(ps
->inst
, 0, 0, 0);