-static XrmDatabase loaddb(RrTheme *theme, char *name);
-static gboolean read_int(XrmDatabase db, char *rname, int *value);
-static gboolean read_string(XrmDatabase db, char *rname, char **value);
+static XrmDatabase loaddb(RrTheme *theme, gchar *name);
+static gboolean read_int(XrmDatabase db, gchar *rname, gint *value);
+static gboolean read_string(XrmDatabase db, gchar *rname, gchar **value);
static gboolean read_color(XrmDatabase db, const RrInstance *inst,
gchar *rname, RrColor **value);
static gboolean read_mask(const RrInstance *inst,
static gboolean read_color(XrmDatabase db, const RrInstance *inst,
gchar *rname, RrColor **value);
static gboolean read_mask(const RrInstance *inst,
- theme->app_hilite_bg = RrAppearanceNew(inst, 0);
- theme->app_unhilite_bg = RrAppearanceNew(inst, 0);
- theme->app_hilite_fg = RrAppearanceNew(inst, 0);
- theme->app_unhilite_fg = RrAppearanceNew(inst, 0);
- theme->app_hilite_label = RrAppearanceNew(inst, 1);
- theme->app_unhilite_label = RrAppearanceNew(inst, 1);
-
if (theme->handle_height <= 0 || theme->handle_height > 100)
theme->handle_height = 6;
if (!read_int(db, "padding.width", &theme->padding) ||
if (theme->handle_height <= 0 || theme->handle_height > 100)
theme->handle_height = 6;
if (!read_int(db, "padding.width", &theme->padding) ||
theme->cbwidth = theme->padding;
/* load colors */
if (!read_color(db, inst,
"border.color", &theme->b_color))
theme->cbwidth = theme->padding;
/* load colors */
if (!read_color(db, inst,
"border.color", &theme->b_color))
if (!read_color(db, inst,
"window.active.client.color",
&theme->cb_focused_color))
if (!read_color(db, inst,
"window.active.client.color",
&theme->cb_focused_color))
if (!read_color(db, inst,
"window.inactive.client.color",
&theme->cb_unfocused_color))
if (!read_color(db, inst,
"window.inactive.client.color",
&theme->cb_unfocused_color))
if (!read_color(db, inst,
"window.active.label.text.color",
&theme->title_focused_color))
if (!read_color(db, inst,
"window.active.label.text.color",
&theme->title_focused_color))
if (!read_color(db, inst,
"window.inactive.label.text.color",
&theme->title_unfocused_color))
if (!read_color(db, inst,
"window.inactive.label.text.color",
&theme->title_unfocused_color))
if (!read_color(db, inst,
"window.active.button.unpressed.image.color",
&theme->titlebut_focused_unpressed_color))
if (!read_color(db, inst,
"window.active.button.unpressed.image.color",
&theme->titlebut_focused_unpressed_color))
if (!read_color(db, inst,
"window.inactive.button.unpressed.image.color",
&theme->titlebut_unfocused_unpressed_color))
if (!read_color(db, inst,
"window.inactive.button.unpressed.image.color",
&theme->titlebut_unfocused_unpressed_color))
RrColorNew(inst, 0xff, 0xff, 0xff);
if (!read_color(db, inst,
"window.active.button.pressed.image.color",
&theme->titlebut_focused_pressed_color))
RrColorNew(inst, 0xff, 0xff, 0xff);
if (!read_color(db, inst,
"window.active.button.pressed.image.color",
&theme->titlebut_focused_pressed_color))
if (!read_color(db, inst,
"window.inactive.button.pressed.image.color",
&theme->titlebut_unfocused_pressed_color))
if (!read_color(db, inst,
"window.inactive.button.pressed.image.color",
&theme->titlebut_unfocused_pressed_color))
if (!read_color(db, inst,
"window.active.button.disabled.image.color",
&theme->titlebut_disabled_focused_color))
if (!read_color(db, inst,
"window.active.button.disabled.image.color",
&theme->titlebut_disabled_focused_color))
RrColorNew(inst, 0xff, 0xff, 0xff);
if (!read_color(db, inst,
"window.inactive.button.disabled.image.color",
&theme->titlebut_disabled_unfocused_color))
RrColorNew(inst, 0xff, 0xff, 0xff);
if (!read_color(db, inst,
"window.inactive.button.disabled.image.color",
&theme->titlebut_disabled_unfocused_color))
if (!read_color(db, inst,
"window.active.button.hover.image.color",
&theme->titlebut_hover_focused_color))
if (!read_color(db, inst,
"window.active.button.hover.image.color",
&theme->titlebut_hover_focused_color))
if (!read_color(db, inst,
"window.inactive.button.hover.image.color",
&theme->titlebut_hover_unfocused_color))
if (!read_color(db, inst,
"window.inactive.button.hover.image.color",
&theme->titlebut_hover_unfocused_color))
if (!read_color(db, inst,
"window.active.button.toggled.image.color",
&theme->titlebut_toggled_focused_color))
if (!read_color(db, inst,
"window.active.button.toggled.image.color",
&theme->titlebut_toggled_focused_color))
if (!read_color(db, inst,
"window.inactive.button.toggled.image.color",
&theme->titlebut_toggled_unfocused_color))
if (!read_color(db, inst,
"window.inactive.button.toggled.image.color",
&theme->titlebut_toggled_unfocused_color))
if (!read_mask(inst, "max_hover.xbm", theme, &theme->max_hover_mask)) {
theme->max_hover_mask = RrPixmapMaskCopy(theme->max_mask);
}
if (!read_mask(inst, "max_hover.xbm", theme, &theme->max_hover_mask)) {
theme->max_hover_mask = RrPixmapMaskCopy(theme->max_mask);
}
{
guchar data[] = { 0x7f, 0x7f, 0x7f, 0x41, 0x41, 0x41, 0x7f };
{
guchar data[] = { 0x7f, 0x7f, 0x7f, 0x41, 0x41, 0x41, 0x7f };
}
{
guchar data[] = { 0x7c, 0x44, 0x47, 0x47, 0x7f, 0x1f, 0x1f };
}
{
guchar data[] = { 0x7c, 0x44, 0x47, 0x47, 0x7f, 0x1f, 0x1f };
} else {
{
guchar data[] = { 0x00, 0x00, 0x00, 0x00, 0x7f, 0x7f, 0x7f };
} else {
{
guchar data[] = { 0x00, 0x00, 0x00, 0x00, 0x7f, 0x7f, 0x7f };
} else {
{
guchar data[] = { 0x63, 0x63, 0x00, 0x00, 0x00, 0x63, 0x63 };
} else {
{
guchar data[] = { 0x63, 0x63, 0x00, 0x00, 0x00, 0x63, 0x63 };
}
{
guchar data[] = { 0x00, 0x36, 0x36, 0x08, 0x36, 0x36, 0x00 };
theme->desk_toggled_mask = RrPixmapMaskNew(inst, 7, 7,
}
{
guchar data[] = { 0x00, 0x36, 0x36, 0x08, 0x36, 0x36, 0x00 };
theme->desk_toggled_mask = RrPixmapMaskNew(inst, 7, 7,
} else {
{
guchar data[] = { 0x7f, 0x7f, 0x7f, 0x00, 0x00, 0x00, 0x00 };
} else {
{
guchar data[] = { 0x7f, 0x7f, 0x7f, 0x00, 0x00, 0x00, 0x00 };
}
{
guchar data[] = { 0x7f, 0x7f, 0x7f, 0x00, 0x00, 0x00, 0x7f };
theme->shade_toggled_mask = RrPixmapMaskNew(inst, 7, 7,
}
{
guchar data[] = { 0x7f, 0x7f, 0x7f, 0x00, 0x00, 0x00, 0x7f };
theme->shade_toggled_mask = RrPixmapMaskNew(inst, 7, 7,
} else {
{
guchar data[] = { 0x63, 0x77, 0x3e, 0x1c, 0x3e, 0x77, 0x63 };
} else {
{
guchar data[] = { 0x63, 0x77, 0x3e, 0x1c, 0x3e, 0x77, 0x63 };
if (!read_mask(inst, "bullet.xbm", theme, &theme->menu_bullet_mask)) {
guchar data[] = { 0x01, 0x03, 0x07, 0x0f, 0x07, 0x03, 0x01 };
if (!read_mask(inst, "bullet.xbm", theme, &theme->menu_bullet_mask)) {
guchar data[] = { 0x01, 0x03, 0x07, 0x0f, 0x07, 0x03, 0x01 };
}
/* read the decoration textures */
if (!read_appearance(db, inst,
"window.active.title.bg", theme->a_focused_title,
FALSE))
}
/* read the decoration textures */
if (!read_appearance(db, inst,
"window.active.title.bg", theme->a_focused_title,
FALSE))
if (!read_appearance(db, inst,
"window.inactive.title.bg", theme->a_unfocused_title,
FALSE))
if (!read_appearance(db, inst,
"window.inactive.title.bg", theme->a_unfocused_title,
FALSE))
if (!read_appearance(db, inst,
"window.active.label.bg", theme->a_focused_label,
TRUE))
if (!read_appearance(db, inst,
"window.active.label.bg", theme->a_focused_label,
TRUE))
if (!read_appearance(db, inst,
"window.inactive.label.bg", theme->a_unfocused_label,
TRUE))
if (!read_appearance(db, inst,
"window.inactive.label.bg", theme->a_unfocused_label,
TRUE))
if (!read_appearance(db, inst,
"window.active.handle.bg", theme->a_focused_handle,
FALSE))
if (!read_appearance(db, inst,
"window.active.handle.bg", theme->a_focused_handle,
FALSE))
if (!read_appearance(db, inst,
"window.inactive.handle.bg",theme->a_unfocused_handle,
FALSE))
if (!read_appearance(db, inst,
"window.inactive.handle.bg",theme->a_unfocused_handle,
FALSE))
if (!read_appearance(db, inst,
"window.active.grip.bg", theme->a_focused_grip,
TRUE))
if (!read_appearance(db, inst,
"window.active.grip.bg", theme->a_focused_grip,
TRUE))
if (!read_appearance(db, inst,
"window.inactive.grip.bg", theme->a_unfocused_grip,
TRUE))
if (!read_appearance(db, inst,
"window.inactive.grip.bg", theme->a_unfocused_grip,
TRUE))
if (!read_appearance(db, inst,
"menu.items.bg", theme->a_menu,
FALSE))
if (!read_appearance(db, inst,
"menu.items.bg", theme->a_menu,
FALSE))
if (!read_appearance(db, inst,
"menu.title.bg", theme->a_menu_title,
FALSE))
if (!read_appearance(db, inst,
"menu.title.bg", theme->a_menu_title,
FALSE))
if (!read_appearance(db, inst,
"menu.items.active.bg", theme->a_menu_selected,
TRUE))
if (!read_appearance(db, inst,
"menu.items.active.bg", theme->a_menu_selected,
TRUE))
- if (!read_appearance(db, inst,
- "window.active.title.bg", theme->app_hilite_bg,
- FALSE))
- set_default_appearance(theme->app_hilite_bg);
- if (!read_appearance(db, inst,
- "window.active.label.bg", theme->app_hilite_label,
- TRUE))
- set_default_appearance(theme->app_hilite_label);
+ theme->app_hilite_bg = RrAppearanceCopy(theme->a_focused_title);
+ theme->app_hilite_label = RrAppearanceCopy(theme->a_focused_label);
if (theme->a_focused_label->surface.grad != RR_SURFACE_PARENTREL)
theme->app_hilite_fg = RrAppearanceCopy(theme->a_focused_label);
else
theme->app_hilite_fg = RrAppearanceCopy(theme->a_focused_title);
if (theme->a_focused_label->surface.grad != RR_SURFACE_PARENTREL)
theme->app_hilite_fg = RrAppearanceCopy(theme->a_focused_label);
else
theme->app_hilite_fg = RrAppearanceCopy(theme->a_focused_title);
- if (!read_appearance(db, inst,
- "window.inactive.title.bg", theme->app_unhilite_bg,
- FALSE))
- set_default_appearance(theme->app_unhilite_bg);
- if (!read_appearance(db, inst,
- "window.inactive.label.bg", theme->app_unhilite_label,
- TRUE))
- set_default_appearance(theme->app_unhilite_label);
+ theme->app_unhilite_bg = RrAppearanceCopy(theme->a_unfocused_title);
+ theme->app_unhilite_label = RrAppearanceCopy(theme->a_unfocused_label);
/* read buttons textures */
if (!read_appearance(db, inst,
"window.active.button.disabled.bg",
/* read buttons textures */
if (!read_appearance(db, inst,
"window.active.button.disabled.bg",
TRUE))
set_default_appearance(theme->a_disabled_focused_max);
if (!read_appearance(db, inst,
"window.inactive.button.disabled.bg",
TRUE))
set_default_appearance(theme->a_disabled_focused_max);
if (!read_appearance(db, inst,
"window.inactive.button.disabled.bg",
TRUE))
set_default_appearance(theme->a_disabled_unfocused_max);
if (!read_appearance(db, inst,
"window.active.button.pressed.bg",
TRUE))
set_default_appearance(theme->a_disabled_unfocused_max);
if (!read_appearance(db, inst,
"window.active.button.pressed.bg",
TRUE))
set_default_appearance(theme->a_focused_pressed_max);
if (!read_appearance(db, inst,
"window.inactive.button.pressed.bg",
TRUE))
set_default_appearance(theme->a_focused_pressed_max);
if (!read_appearance(db, inst,
"window.inactive.button.pressed.bg",
TRUE))
set_default_appearance(theme->a_unfocused_pressed_max);
if (!read_appearance(db, inst,
"window.active.button.toggled.bg",
TRUE))
set_default_appearance(theme->a_unfocused_pressed_max);
if (!read_appearance(db, inst,
"window.active.button.toggled.bg",
}
if (!read_appearance(db, inst,
"window.inactive.button.toggled.bg",
}
if (!read_appearance(db, inst,
"window.inactive.button.toggled.bg",
}
if (!read_appearance(db, inst,
"window.active.button.unpressed.bg",
}
if (!read_appearance(db, inst,
"window.active.button.unpressed.bg",
if (!read_appearance(db, inst,
"window.inactive.button.unpressed.bg",
if (!read_appearance(db, inst,
"window.inactive.button.unpressed.bg",
if (!read_appearance(db, inst,
"window.active.button.hover.bg",
if (!read_appearance(db, inst,
"window.active.button.hover.bg",
}
if (!read_appearance(db, inst,
"window.inactive.button.hover.bg",
}
if (!read_appearance(db, inst,
"window.inactive.button.hover.bg",
theme->a_unfocused_unpressed_shade->texture[0].data.mask.color =
theme->a_unfocused_unpressed_iconify->texture[0].data.mask.color =
theme->titlebut_unfocused_unpressed_color;
theme->a_unfocused_unpressed_shade->texture[0].data.mask.color =
theme->a_unfocused_unpressed_iconify->texture[0].data.mask.color =
theme->titlebut_unfocused_unpressed_color;
theme->a_unfocused_pressed_close->texture[0].data.mask.color =
theme->a_unfocused_pressed_desk->texture[0].data.mask.color =
theme->a_unfocused_pressed_shade->texture[0].data.mask.color =
theme->a_unfocused_pressed_close->texture[0].data.mask.color =
theme->a_unfocused_pressed_desk->texture[0].data.mask.color =
theme->a_unfocused_pressed_shade->texture[0].data.mask.color =
right now, so if anyone complains, here is how to keep text from
going over the title's bevel/border with a padding.width of 0 and a
bevelless/borderless label
right now, so if anyone complains, here is how to keep text from
going over the title's bevel/border with a padding.width of 0 and a
bevelless/borderless label
- RrMargins(theme->a_focused_title, &fl, &ft, &fr, &fb);
- RrMargins(theme->a_unfocused_title, &ul, &ut, &ur, &ub);
- theme->title_height = theme->label_height +
- MAX(MAX(theme->padding * 2, ft + fb),
- MAX(theme->padding * 2, ut + ub));
+ RrMargins(theme->a_focused_title, &fl, &ft, &fr, &fb);
+ RrMargins(theme->a_unfocused_title, &ul, &ut, &ur, &ub);
+ theme->title_height = theme->label_height +
+ MAX(MAX(theme->padding * 2, ft + fb),
+ MAX(theme->padding * 2, ut + ub));
- retvalue.addr != NULL) {
- *value = (int)strtol(retvalue.addr, &end, 10);
- if (end != retvalue.addr)
- ret = TRUE;
+ retvalue.addr != NULL) {
+ *value = (gint)strtol(retvalue.addr, &end, 10);
+ if (end != retvalue.addr)
+ ret = TRUE;
s = g_build_filename(theme->path, maskname, NULL);
if (XReadBitmapFileData(s, &w, &h, &b, &hx, &hy) == BitmapSuccess) {
ret = TRUE;
s = g_build_filename(theme->path, maskname, NULL);
if (XReadBitmapFileData(s, &w, &h, &b, &hx, &hy) == BitmapSuccess) {
ret = TRUE;
- if (strstr(tex, "gradient") != NULL) {
- if (strstr(tex, "crossdiagonal") != NULL)
- *grad = RR_SURFACE_CROSS_DIAGONAL;
- else if (strstr(tex, "pyramid") != NULL)
- *grad = RR_SURFACE_PYRAMID;
- else if (strstr(tex, "horizontal") != NULL)
- *grad = RR_SURFACE_HORIZONTAL;
- else if (strstr(tex, "vertical") != NULL)
- *grad = RR_SURFACE_VERTICAL;
- else
- *grad = RR_SURFACE_DIAGONAL;
- } else {
- *grad = RR_SURFACE_SOLID;
- }
-
- if (strstr(tex, "sunken") != NULL)
- *relief = RR_RELIEF_SUNKEN;
- else if (strstr(tex, "flat") != NULL)
- *relief = RR_RELIEF_FLAT;
- else
- *relief = RR_RELIEF_RAISED;
-
- *border = FALSE;
- if (*relief == RR_RELIEF_FLAT) {
- if (strstr(tex, "border") != NULL)
- *border = TRUE;
- } else {
- if (strstr(tex, "bevel2") != NULL)
- *bevel = RR_BEVEL_2;
- else
- *bevel = RR_BEVEL_1;
- }
-
- if (strstr(tex, "interlaced") != NULL)
- *interlaced = TRUE;
- else
- *interlaced = FALSE;
+ if (strstr(tex, "gradient") != NULL) {
+ if (strstr(tex, "crossdiagonal") != NULL)
+ *grad = RR_SURFACE_CROSS_DIAGONAL;
+ else if (strstr(tex, "pyramid") != NULL)
+ *grad = RR_SURFACE_PYRAMID;
+ else if (strstr(tex, "horizontal") != NULL)
+ *grad = RR_SURFACE_HORIZONTAL;
+ else if (strstr(tex, "vertical") != NULL)
+ *grad = RR_SURFACE_VERTICAL;
+ else
+ *grad = RR_SURFACE_DIAGONAL;
+ } else {
+ *grad = RR_SURFACE_SOLID;
+ }
+
+ if (strstr(tex, "sunken") != NULL)
+ *relief = RR_RELIEF_SUNKEN;
+ else if (strstr(tex, "flat") != NULL)
+ *relief = RR_RELIEF_FLAT;
+ else
+ *relief = RR_RELIEF_RAISED;
+
+ *border = FALSE;
+ if (*relief == RR_RELIEF_FLAT) {
+ if (strstr(tex, "border") != NULL)
+ *border = TRUE;
+ } else {
+ if (strstr(tex, "bevel2") != NULL)
+ *bevel = RR_BEVEL_2;
+ else
+ *bevel = RR_BEVEL_1;
+ }
+
+ if (strstr(tex, "interlaced") != NULL)
+ *interlaced = TRUE;
+ else
+ *interlaced = FALSE;
- char *rclass = create_class_name(rname);
- char *cname, *ctoname, *bcname, *icname;
- char *rettype;
+ gchar *rclass = create_class_name(rname);
+ gchar *cname, *ctoname, *bcname, *icname;
+ gchar *rettype;