#include "../../render/render.h"
#include "../../render/color.h"
#include "../../render/font.h"
+#include "../../render/mask.h"
#include <X11/Xlib.h>
#include <glib.h>
color_rgb *s_cb_unfocused_color;
color_rgb *s_title_focused_color;
color_rgb *s_title_unfocused_color;
+color_rgb *s_titlebut_focused_color;
+color_rgb *s_titlebut_unfocused_color;
/* style settings - fonts */
int s_winfont_height;
int s_winfont_shadow;
int s_winfont_shadow_offset;
ObFont *s_winfont;
+/* style settings - masks */
+pixmap_mask *s_max_mask;
+pixmap_mask *s_icon_mask;
+pixmap_mask *s_desk_mask;
+pixmap_mask *s_close_mask;
/* global appearances */
Appearance *a_focused_unpressed_max;
g_quark_from_string("close");
s_b_color = s_cb_unfocused_color = s_cb_focused_color =
- s_title_unfocused_color = s_title_focused_color = NULL;
+ s_title_unfocused_color = s_title_focused_color =
+ s_titlebut_unfocused_color = s_titlebut_focused_color = NULL;
s_winfont = NULL;
+ s_max_mask = s_icon_mask = s_desk_mask = s_close_mask = NULL;
- a_focused_unpressed_max = appearance_new(Surface_Planar, 0);//1);
- a_focused_pressed_max = appearance_new(Surface_Planar, 0);//1);
- a_unfocused_unpressed_max = appearance_new(Surface_Planar, 0);//1);
- a_unfocused_pressed_max = appearance_new(Surface_Planar, 0);//1);
+ a_focused_unpressed_max = appearance_new(Surface_Planar, 1);
+ a_focused_pressed_max = appearance_new(Surface_Planar, 1);
+ a_unfocused_unpressed_max = appearance_new(Surface_Planar, 1);
+ a_unfocused_pressed_max = appearance_new(Surface_Planar, 1);
a_focused_unpressed_close = NULL;
a_focused_pressed_close = NULL;
a_unfocused_unpressed_close = NULL;
if (s_cb_focused_color != NULL) color_free(s_cb_focused_color);
if (s_title_unfocused_color != NULL) color_free(s_title_unfocused_color);
if (s_title_focused_color != NULL) color_free(s_title_focused_color);
+ if (s_titlebut_unfocused_color != NULL)
+ color_free(s_titlebut_unfocused_color);
+ if (s_titlebut_focused_color != NULL)
+ color_free(s_titlebut_focused_color);
+
+ if (s_max_mask != NULL) pixmap_mask_free(s_max_mask);
+ if (s_desk_mask != NULL) pixmap_mask_free(s_desk_mask);
+ if (s_icon_mask != NULL) pixmap_mask_free(s_icon_mask);
+ if (s_close_mask != NULL) pixmap_mask_free(s_close_mask);
if (s_winfont != NULL) font_close(s_winfont);
return ret;
}
+gboolean read_mask(XrmDatabase db, char *rname, pixmap_mask **value)
+{
+ gboolean ret = FALSE;
+ char *rclass = create_class_name(rname);
+ char *rettype;
+ XrmValue retvalue;
+
+ if (XrmGetResource(db, rname, rclass, &rettype, &retvalue) &&
+ retvalue.addr != NULL) {
+ }
+
+ g_free(rclass);
+ return ret;
+}
+
static void parse_appearance(char *tex, SurfaceColorType *grad,
ReliefType *relief, BevelType *bevel,
gboolean *interlaced, gboolean *border)
if (!read_color(db, "window.label.unfocus.textColor",
&s_title_unfocused_color))
s_title_unfocused_color = color_new(0xff, 0xff, 0xff);
+ if (!read_color(db, "window.button.focus.picColor",
+ &s_titlebut_focused_color))
+ s_titlebut_focused_color = color_new(0, 0, 0);
+ if (!read_color(db, "window.button.unfocus.picColor",
+ &s_titlebut_unfocused_color))
+ s_titlebut_unfocused_color = color_new(0xff, 0xff, 0xff);
+
+ if (!read_mask(db, "window.button.max.mask", &s_max_mask)) {
+ char data [] = { 0x7c, 0x44, 0x47, 0x47, 0x7f, 0x1f, 0x1f };
+ s_max_mask = pixmap_mask_new(7, 7, data);
+ }
+ if (!read_mask(db, "window.button.icon.mask", &s_icon_mask)) {
+ char data[] = { 0x00, 0x00, 0x00, 0x00, 0x3e, 0x3e, 0x3e };
+ s_icon_mask = pixmap_mask_new(7, 7, data);
+ }
+ if (!read_mask(db, "window.button.stick.mask", &s_desk_mask)) {
+ char data[] = { 0x00, 0x36, 0x36, 0x00, 0x36, 0x36, 0x00 };
+ s_desk_mask = pixmap_mask_new(7, 7, data);
+ }
+ if (!read_mask(db, "window.button.close.mask", &s_close_mask)) {
+ char data[] = { 0x22, 0x77, 0x3e, 0x1c, 0x3e, 0x77, 0x22 };
+ s_close_mask = pixmap_mask_new(7, 7, data);
+ }
if (!read_appearance(db, "window.title.focus", a_focused_title))
set_default_appearance(a_focused_title);
a_icon->surface.data.planar.grad = Background_ParentRelative;
- /* XXX load the button masks */
-
/* set up the textures */
a_focused_label->texture[0].type = Text;
a_focused_label->texture[0].data.text.font = s_winfont;
a_unfocused_label->texture[0].data.text.offset = s_winfont_shadow_offset;
a_unfocused_label->texture[0].data.text.color = s_title_unfocused_color;
+ a_focused_unpressed_max->texture[0].type =
+ a_focused_pressed_max->texture[0].type =
+ a_unfocused_unpressed_max->texture[0].type =
+ a_unfocused_pressed_max->texture[0].type =
+ a_focused_unpressed_close->texture[0].type =
+ a_focused_pressed_close->texture[0].type =
+ a_unfocused_unpressed_close->texture[0].type =
+ a_unfocused_pressed_close->texture[0].type =
+ a_focused_unpressed_desk->texture[0].type =
+ a_focused_pressed_desk->texture[0].type =
+ a_unfocused_unpressed_desk->texture[0].type =
+ a_unfocused_pressed_desk->texture[0].type =
+ a_focused_unpressed_iconify->texture[0].type =
+ a_focused_pressed_iconify->texture[0].type =
+ a_unfocused_unpressed_iconify->texture[0].type =
+ a_unfocused_pressed_iconify->texture[0].type = Bitmask;
+ a_focused_unpressed_max->texture[0].data.mask.mask =
+ a_focused_pressed_max->texture[0].data.mask.mask =
+ a_unfocused_unpressed_max->texture[0].data.mask.mask =
+ a_unfocused_pressed_max->texture[0].data.mask.mask = s_max_mask;
+ a_focused_unpressed_close->texture[0].data.mask.mask =
+ a_focused_pressed_close->texture[0].data.mask.mask =
+ a_unfocused_unpressed_close->texture[0].data.mask.mask =
+ a_unfocused_pressed_close->texture[0].data.mask.mask = s_close_mask;
+ a_focused_unpressed_desk->texture[0].data.mask.mask =
+ a_focused_pressed_desk->texture[0].data.mask.mask =
+ a_unfocused_unpressed_desk->texture[0].data.mask.mask =
+ a_unfocused_pressed_desk->texture[0].data.mask.mask = s_desk_mask;
+ a_focused_unpressed_iconify->texture[0].data.mask.mask =
+ a_focused_pressed_iconify->texture[0].data.mask.mask =
+ a_unfocused_unpressed_iconify->texture[0].data.mask.mask =
+ a_unfocused_pressed_iconify->texture[0].data.mask.mask = s_icon_mask;
+ a_focused_unpressed_max->texture[0].data.mask.color =
+ a_focused_pressed_max->texture[0].data.mask.color =
+ a_focused_unpressed_close->texture[0].data.mask.color =
+ a_focused_pressed_close->texture[0].data.mask.color =
+ a_focused_unpressed_desk->texture[0].data.mask.color =
+ a_focused_pressed_desk->texture[0].data.mask.color =
+ a_focused_unpressed_iconify->texture[0].data.mask.color =
+ a_focused_pressed_iconify->texture[0].data.mask.color =
+ s_titlebut_focused_color;
+ a_unfocused_unpressed_max->texture[0].data.mask.color =
+ a_unfocused_pressed_max->texture[0].data.mask.color =
+ a_unfocused_unpressed_close->texture[0].data.mask.color =
+ a_unfocused_pressed_close->texture[0].data.mask.color =
+ a_unfocused_unpressed_desk->texture[0].data.mask.color =
+ a_unfocused_pressed_desk->texture[0].data.mask.color =
+ a_unfocused_unpressed_iconify->texture[0].data.mask.color =
+ a_unfocused_pressed_iconify->texture[0].data.mask.color =
+ s_titlebut_unfocused_color;
+
XrmDestroyDatabase(db);
return TRUE;
}