From: Dana Jansens Date: Sat, 29 Mar 2003 21:24:37 +0000 (+0000) Subject: add support for foo.pressed.mask to load a different mask for pressed buttons X-Git-Url: https://git.dogcows.com/gitweb?a=commitdiff_plain;h=71ade2a9b913f5d13e02aa89e3c09729348c9f82;p=chaz%2Fopenbox add support for foo.pressed.mask to load a different mask for pressed buttons --- diff --git a/engines/openbox/obengine.c b/engines/openbox/obengine.c index c4d0c817..4372f158 100644 --- a/engines/openbox/obengine.c +++ b/engines/openbox/obengine.c @@ -37,10 +37,14 @@ int ob_s_winfont_shadow; int ob_s_winfont_shadow_offset; ObFont *ob_s_winfont; /* style settings - masks */ -pixmap_mask *ob_s_max_mask; -pixmap_mask *ob_s_icon_mask; -pixmap_mask *ob_s_desk_mask; -pixmap_mask *ob_s_close_mask; +pixmap_mask *ob_s_max_pressed_mask; +pixmap_mask *ob_s_max_unpressed_mask; +pixmap_mask *ob_s_iconify_pressed_mask; +pixmap_mask *ob_s_iconify_unpressed_mask; +pixmap_mask *ob_s_desk_pressed_mask; +pixmap_mask *ob_s_desk_unpressed_mask; +pixmap_mask *ob_s_close_pressed_mask; +pixmap_mask *ob_s_close_unpressed_mask; /* global appearances */ Appearance *ob_a_focused_unpressed_max; @@ -101,7 +105,10 @@ gboolean startup() ob_s_title_unfocused_color = ob_s_title_focused_color = ob_s_titlebut_unfocused_color = ob_s_titlebut_focused_color = NULL; ob_s_winfont = NULL; - ob_s_max_mask = ob_s_icon_mask = ob_s_desk_mask = ob_s_close_mask = NULL; + ob_s_max_pressed_mask = ob_s_max_unpressed_mask = NULL; + ob_s_iconify_pressed_mask = ob_s_iconify_unpressed_mask = NULL; + ob_s_desk_pressed_mask = ob_s_desk_unpressed_mask = NULL; + ob_s_close_pressed_mask = ob_s_close_unpressed_mask = NULL; ob_a_focused_unpressed_max = appearance_new(Surface_Planar, 1); ob_a_focused_pressed_max = appearance_new(Surface_Planar, 1); @@ -186,10 +193,22 @@ void shutdown() if (ob_s_titlebut_focused_color != NULL) color_free(ob_s_titlebut_focused_color); - if (ob_s_max_mask != NULL) pixmap_mask_free(ob_s_max_mask); - if (ob_s_desk_mask != NULL) pixmap_mask_free(ob_s_desk_mask); - if (ob_s_icon_mask != NULL) pixmap_mask_free(ob_s_icon_mask); - if (ob_s_close_mask != NULL) pixmap_mask_free(ob_s_close_mask); + if (ob_s_max_pressed_mask != NULL) + pixmap_mask_free(ob_s_max_pressed_mask); + if (ob_s_max_unpressed_mask != NULL) + pixmap_mask_free(ob_s_max_unpressed_mask); + if (ob_s_desk_pressed_mask != NULL) + pixmap_mask_free(ob_s_desk_pressed_mask); + if (ob_s_desk_unpressed_mask != NULL) + pixmap_mask_free(ob_s_desk_unpressed_mask); + if (ob_s_iconify_pressed_mask != NULL) + pixmap_mask_free(ob_s_iconify_pressed_mask); + if (ob_s_iconify_unpressed_mask != NULL) + pixmap_mask_free(ob_s_iconify_unpressed_mask); + if (ob_s_close_pressed_mask != NULL) + pixmap_mask_free(ob_s_close_pressed_mask); + if (ob_s_close_unpressed_mask != NULL) + pixmap_mask_free(ob_s_close_unpressed_mask); if (ob_s_winfont != NULL) font_close(ob_s_winfont); diff --git a/engines/openbox/obengine.h b/engines/openbox/obengine.h index df6cdbcd..ad07e0d5 100644 --- a/engines/openbox/obengine.h +++ b/engines/openbox/obengine.h @@ -32,10 +32,14 @@ extern int ob_s_winfont_shadow; extern int ob_s_winfont_shadow_offset; extern ObFont *ob_s_winfont; -extern pixmap_mask *ob_s_max_mask; -extern pixmap_mask *ob_s_icon_mask; -extern pixmap_mask *ob_s_desk_mask; -extern pixmap_mask *ob_s_close_mask; +extern pixmap_mask *ob_s_max_pressed_mask; +extern pixmap_mask *ob_s_max_unpressed_mask; +extern pixmap_mask *ob_s_iconify_pressed_mask; +extern pixmap_mask *ob_s_iconify_unpressed_mask; +extern pixmap_mask *ob_s_desk_pressed_mask; +extern pixmap_mask *ob_s_desk_unpressed_mask; +extern pixmap_mask *ob_s_close_pressed_mask; +extern pixmap_mask *ob_s_close_unpressed_mask; extern Appearance *ob_a_focused_unpressed_max; extern Appearance *ob_a_focused_pressed_max; diff --git a/engines/openbox/obtheme.c b/engines/openbox/obtheme.c index f1bb2981..86850bae 100644 --- a/engines/openbox/obtheme.c +++ b/engines/openbox/obtheme.c @@ -355,21 +355,44 @@ gboolean obtheme_load() &ob_s_titlebut_unfocused_color)) ob_s_titlebut_unfocused_color = color_new(0xff, 0xff, 0xff); - if (!read_mask(db, "window.button.max.mask", &ob_s_max_mask)) { + if (!read_mask(db, "window.button.max.mask", &ob_s_max_unpressed_mask)) { char data[] = { 0x7c, 0x44, 0x47, 0x47, 0x7f, 0x1f, 0x1f }; - ob_s_max_mask = pixmap_mask_new(7, 7, data); + ob_s_max_unpressed_mask = pixmap_mask_new(7, 7, data); } - if (!read_mask(db, "window.button.icon.mask", &ob_s_icon_mask)) { + if (!read_mask(db, "window.button.max.pressed.mask", + &ob_s_max_pressed_mask)) { + ob_s_max_pressed_mask = pixmap_mask_copy(ob_s_max_unpressed_mask); + } + + if (!read_mask(db, "window.button.icon.mask", + &ob_s_iconify_unpressed_mask)) { char data[] = { 0x00, 0x00, 0x00, 0x00, 0x3e, 0x3e, 0x3e }; - ob_s_icon_mask = pixmap_mask_new(7, 7, data); + ob_s_iconify_unpressed_mask = pixmap_mask_new(7, 7, data); } - if (!read_mask(db, "window.button.stick.mask", &ob_s_desk_mask)) { + if (!read_mask(db, "window.button.icon.pressed.mask", + &ob_s_iconify_pressed_mask)) { + ob_s_iconify_pressed_mask = + pixmap_mask_copy(ob_s_iconify_unpressed_mask); + } + + if (!read_mask(db, "window.button.stick.mask", + &ob_s_desk_unpressed_mask)) { char data[] = { 0x00, 0x36, 0x36, 0x00, 0x36, 0x36, 0x00 }; - ob_s_desk_mask = pixmap_mask_new(7, 7, data); + ob_s_desk_unpressed_mask = pixmap_mask_new(7, 7, data); } - if (!read_mask(db, "window.button.close.mask", &ob_s_close_mask)) { + if (!read_mask(db, "window.button.stick.pressed.mask", + &ob_s_desk_pressed_mask)) { + ob_s_desk_pressed_mask = pixmap_mask_copy(ob_s_desk_unpressed_mask); + } + + if (!read_mask(db, "window.button.close.mask", + &ob_s_close_unpressed_mask)) { char data[] = { 0x22, 0x77, 0x3e, 0x1c, 0x3e, 0x77, 0x22 }; - ob_s_close_mask = pixmap_mask_new(7, 7, data); + ob_s_close_unpressed_mask = pixmap_mask_new(7, 7, data); + } + if (!read_mask(db, "window.button.close.pressed.mask", + &ob_s_close_pressed_mask)) { + ob_s_close_pressed_mask = pixmap_mask_copy(ob_s_close_unpressed_mask); } if (!read_appearance(db, "window.title.focus", ob_a_focused_title)) @@ -461,24 +484,29 @@ gboolean obtheme_load() ob_a_unfocused_unpressed_iconify->texture[0].type = ob_a_unfocused_pressed_iconify->texture[0].type = Bitmask; ob_a_focused_unpressed_max->texture[0].data.mask.mask = - ob_a_focused_pressed_max->texture[0].data.mask.mask = ob_a_unfocused_unpressed_max->texture[0].data.mask.mask = - ob_a_unfocused_pressed_max->texture[0].data.mask.mask = ob_s_max_mask; + ob_s_max_unpressed_mask; + ob_a_focused_pressed_max->texture[0].data.mask.mask = + ob_a_unfocused_pressed_max->texture[0].data.mask.mask = + ob_s_max_pressed_mask; ob_a_focused_unpressed_close->texture[0].data.mask.mask = - ob_a_focused_pressed_close->texture[0].data.mask.mask = - ob_a_unfocused_unpressed_close->texture[0].data.mask.mask = + ob_a_unfocused_unpressed_close->texture[0].data.mask.mask = + ob_s_close_unpressed_mask; + ob_a_focused_pressed_close->texture[0].data.mask.mask = ob_a_unfocused_pressed_close->texture[0].data.mask.mask = - ob_s_close_mask; + ob_s_close_pressed_mask; ob_a_focused_unpressed_desk->texture[0].data.mask.mask = - ob_a_focused_pressed_desk->texture[0].data.mask.mask = ob_a_unfocused_unpressed_desk->texture[0].data.mask.mask = + ob_s_desk_unpressed_mask; + ob_a_focused_pressed_desk->texture[0].data.mask.mask = ob_a_unfocused_pressed_desk->texture[0].data.mask.mask = - ob_s_desk_mask; + ob_s_desk_pressed_mask; ob_a_focused_unpressed_iconify->texture[0].data.mask.mask = - ob_a_focused_pressed_iconify->texture[0].data.mask.mask = ob_a_unfocused_unpressed_iconify->texture[0].data.mask.mask = + ob_s_iconify_unpressed_mask; + ob_a_focused_pressed_iconify->texture[0].data.mask.mask = ob_a_unfocused_pressed_iconify->texture[0].data.mask.mask = - ob_s_icon_mask; + ob_s_iconify_pressed_mask; ob_a_focused_unpressed_max->texture[0].data.mask.color = ob_a_focused_pressed_max->texture[0].data.mask.color = ob_a_focused_unpressed_close->texture[0].data.mask.color =