summaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-03-17 00:09:37 +0000
committerDana Jansens <danakj@orodu.net>2003-03-17 00:09:37 +0000
commit717c0fa62c1a725b6cb2903574ef9738bd6df0c3 (patch)
tree46ca00228f5146c641741c0d53e4cb6664a91bf6 /engines
parent1f289469584bb87659ca1e78f75e3542de84d0cd (diff)
trying to render text!
Diffstat (limited to 'engines')
-rw-r--r--engines/openbox/openbox.c30
-rw-r--r--engines/openbox/theme.c14
2 files changed, 24 insertions, 20 deletions
diff --git a/engines/openbox/openbox.c b/engines/openbox/openbox.c
index 80e9e812..75dc3267 100644
--- a/engines/openbox/openbox.c
+++ b/engines/openbox/openbox.c
@@ -134,7 +134,8 @@ gboolean startup()
g_quark_from_string("icon");
g_quark_from_string("close");
- s_b_color = s_cb_unfocused_color = s_cb_focused_color = NULL;
+ s_b_color = s_cb_unfocused_color = s_cb_focused_color =
+ s_title_unfocused_color = s_title_focused_color = NULL;
s_winfont = NULL;
a_focused_unpressed_max = appearance_new(Surface_Planar, 0);//1);
@@ -163,18 +164,6 @@ gboolean startup()
a_focused_handle = appearance_new(Surface_Planar, 0);
a_unfocused_handle = appearance_new(Surface_Planar, 0);
- a_focused_label->texture[0].type = Text;
- a_focused_label->texture[0].data.text.font = s_winfont;
- a_focused_label->texture[0].data.text.shadow = s_winfont_shadow;
- a_focused_label->texture[0].data.text.offset = s_winfont_shadow_offset;
- a_focused_label->texture[0].data.text.color = s_title_focused_color;
-
- a_unfocused_label->texture[0].type = Text;
- a_unfocused_label->texture[0].data.text.font = s_winfont;
- a_unfocused_label->texture[0].data.text.shadow = s_winfont_shadow;
- a_unfocused_label->texture[0].data.text.offset = s_winfont_shadow_offset;
- a_unfocused_label->texture[0].data.text.color = s_title_unfocused_color;
-
return load();
}
@@ -183,6 +172,8 @@ void shutdown()
if (s_b_color != NULL) color_free(s_b_color);
if (s_cb_unfocused_color != NULL) color_free(s_cb_unfocused_color);
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_winfont != NULL) font_close(s_winfont);
@@ -747,16 +738,17 @@ static void render(ObFrame *self)
static void render_label(ObFrame *self)
{
+ Appearance *a;
+
if (self->label_x < 0) return;
+ a = (self->frame.client->focused ?
+ self->a_focused_label : self->a_focused_label);
+
/* set the texture's text! */
- self->a_focused_label->texture[0].data.text.string =
- self->frame.client->title;
+ a->texture[0].data.text.string = self->frame.client->title;
- paint(self->label, (self->frame.client->focused ?
- self->a_focused_label :
- self->a_unfocused_label),
- self->label_width, LABEL_HEIGHT);
+ paint(self->label, a, self->label_width, LABEL_HEIGHT);
}
static void render_icon(ObFrame *self)
diff --git a/engines/openbox/theme.c b/engines/openbox/theme.c
index b5e4b982..18a04e8f 100644
--- a/engines/openbox/theme.c
+++ b/engines/openbox/theme.c
@@ -328,9 +328,21 @@ gboolean load()
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_focused_label->texture[0].data.text.shadow = s_winfont_shadow;
+ a_focused_label->texture[0].data.text.offset = s_winfont_shadow_offset;
+ a_focused_label->texture[0].data.text.color = s_title_focused_color;
+
+ a_unfocused_label->texture[0].type = Text;
+ a_unfocused_label->texture[0].data.text.font = s_winfont;
+ a_unfocused_label->texture[0].data.text.shadow = s_winfont_shadow;
+ a_unfocused_label->texture[0].data.text.offset = s_winfont_shadow_offset;
+ a_unfocused_label->texture[0].data.text.color = s_title_unfocused_color;
+
XrmDestroyDatabase(db);
return TRUE;
}