summaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-04-02 07:46:46 +0000
committerDana Jansens <danakj@orodu.net>2003-04-02 07:46:46 +0000
commit71c8b0b7b2cf2fa79ac4c81b7756f2b230f2de7a (patch)
tree7294b08a6708be789f5f674418c7dc80809d78b4 /engines
parent4875ff5f8ed227a989c699fe6d8390396e485815 (diff)
create a generic tokenizer/sectionizer for the config file. pass off the token to functions registered for each section to parse them further. some fixes for the engine irt font shadows, and fixed a bug with rendering the iconify button when it was not in the layout
Diffstat (limited to 'engines')
-rw-r--r--engines/openbox/Makefile.am1
-rw-r--r--engines/openbox/obengine.c9
-rw-r--r--engines/openbox/obengine.h1
-rw-r--r--engines/openbox/obtheme.c30
4 files changed, 21 insertions, 20 deletions
diff --git a/engines/openbox/Makefile.am b/engines/openbox/Makefile.am
index 800956d9..33efbb71 100644
--- a/engines/openbox/Makefile.am
+++ b/engines/openbox/Makefile.am
@@ -5,7 +5,6 @@ CPPFLAGS=$(XFT_CFLAGS) $(GLIB_CFLAGS) @CPPFLAGS@ \
-DENGINEDIR=\"$(enginedir)\" \
-DTHEMEDIR=\"$(themedir)\" \
-DDEFAULT_THEME=\"nyz\" \
--DDEFAULT_FONT=\"Sans-7\" \
-DG_LOG_DOMAIN=\"Openbox-Engine\"
engine_LTLIBRARIES=openbox.la
diff --git a/engines/openbox/obengine.c b/engines/openbox/obengine.c
index b6b9638f..f98bb36c 100644
--- a/engines/openbox/obengine.c
+++ b/engines/openbox/obengine.c
@@ -36,6 +36,7 @@ color_rgb *ob_s_titlebut_unfocused_color;
int ob_s_winfont_height;
int ob_s_winfont_shadow;
int ob_s_winfont_shadow_offset;
+int ob_s_winfont_shadow_tint;
ObFont *ob_s_winfont;
/* style settings - masks */
pixmap_mask *ob_s_max_set_mask;
@@ -495,7 +496,7 @@ void frame_adjust_area(ObFrame *self, gboolean moved, gboolean resized)
self->icon_x = -1;
self->desk_x = -1;
self->shade_x = -1;
- self->icon_x = -1;
+ self->iconify_x = -1;
self->label_x = -1;
self->max_x = -1;
self->close_x = -1;
@@ -712,10 +713,8 @@ static void layout_title(ObFrame *self)
n = d = i = l = m = c = s = FALSE;
- if (!config_get("titlebar.layout", Config_String, &layout)) {
- layout.string = "NDSLIMC";
- config_set("titlebar.layout", Config_String, layout);
- }
+ if (!config_get("titlebar.layout", Config_String, &layout))
+ g_assert_not_reached();
/* figure out whats being shown, and the width of the label */
self->label_width = self->width - (ob_s_bevel + 1) * 2;
diff --git a/engines/openbox/obengine.h b/engines/openbox/obengine.h
index 4f9cb5b6..b4e46983 100644
--- a/engines/openbox/obengine.h
+++ b/engines/openbox/obengine.h
@@ -30,6 +30,7 @@ extern color_rgb *ob_s_titlebut_unfocused_color;
extern int ob_s_winfont_height;
extern int ob_s_winfont_shadow;
extern int ob_s_winfont_shadow_offset;
+extern int ob_s_winfont_shadow_tint;
extern ObFont *ob_s_winfont;
extern pixmap_mask *ob_s_max_set_mask;
diff --git a/engines/openbox/obtheme.c b/engines/openbox/obtheme.c
index ccd17cc0..3f45c209 100644
--- a/engines/openbox/obtheme.c
+++ b/engines/openbox/obtheme.c
@@ -277,7 +277,7 @@ gboolean obtheme_load()
XrmDatabase db = NULL;
Justify winjust;
char *winjuststr;
- ConfigValue theme, shadow, offset, font;
+ ConfigValue theme, shadow, offset, font, tint;
if (config_get("theme", Config_String, &theme)) {
db = loaddb(theme.string);
@@ -299,21 +299,21 @@ gboolean obtheme_load()
/* load the font, not from the theme file tho, its in the config */
- if (!config_get("font.shadow", Config_Bool, &shadow)) {
- shadow.bool = TRUE; /* default */
- config_set("font.shadow", Config_Bool, shadow);
- }
+ if (!config_get("font.shadow", Config_Bool, &shadow))
+ g_assert_not_reached();
ob_s_winfont_shadow = shadow.bool;
- if (!config_get("font.shadow.offset", Config_Integer, &offset) ||
- offset.integer < 0 || offset.integer >= 10) {
- offset.integer = 1; /* default */
- config_set("font.shadow.offset", Config_Integer, offset);
- }
+ if (!config_get("font.shadow.offset", Config_Integer, &offset))
+ g_assert_not_reached();
ob_s_winfont_shadow_offset = offset.integer;
- if (!config_get("font", Config_String, &font)) {
- font.string = DEFAULT_FONT;
- config_set("font", Config_String, font);
- }
+ if (!config_get("font.shadow.tint", Config_Integer, &tint))
+ g_assert_not_reached();
+ /* XXX put these checks into the config system somehow!!! */
+ if (tint.integer < -100) tint.integer = -100;
+ if (tint.integer > 100) tint.integer = 100;
+ config_set("font.shadow.tint", Config_Integer, tint);
+ ob_s_winfont_shadow_tint = tint.integer;
+ if (!config_get("font", Config_String, &font))
+ g_assert_not_reached();
ob_s_winfont = font_open(font.string);
ob_s_winfont_height = font_height(ob_s_winfont, ob_s_winfont_shadow,
ob_s_winfont_shadow_offset);
@@ -495,6 +495,7 @@ gboolean obtheme_load()
ob_a_focused_label->texture[0].data.text.shadow = ob_s_winfont_shadow;
ob_a_focused_label->texture[0].data.text.offset =
ob_s_winfont_shadow_offset;
+ ob_a_focused_label->texture[0].data.text.tint = ob_s_winfont_shadow_tint;
ob_a_focused_label->texture[0].data.text.color = ob_s_title_focused_color;
ob_a_unfocused_label->texture[0].type = Text;
@@ -503,6 +504,7 @@ gboolean obtheme_load()
ob_a_unfocused_label->texture[0].data.text.shadow = ob_s_winfont_shadow;
ob_a_unfocused_label->texture[0].data.text.offset =
ob_s_winfont_shadow_offset;
+ ob_a_unfocused_label->texture[0].data.text.tint = ob_s_winfont_shadow_tint;
ob_a_unfocused_label->texture[0].data.text.color =
ob_s_title_unfocused_color;