From: Dave Foster Date: Wed, 12 Dec 2007 23:02:38 +0000 (-0500) Subject: Buttons seem to work! X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=8058df3f7ce153e31cfebaa696a7e892999acb2b;p=chaz%2Fopenbox Buttons seem to work! --- diff --git a/obrender/button.h b/obrender/button.h index 59d04f94..659c3ea9 100644 --- a/obrender/button.h +++ b/obrender/button.h @@ -7,50 +7,5 @@ #include #include -struct _RrButton { - const RrInstance *inst; - - /* colors */ - RrColor *focused_unpressed_color; - RrColor *unfocused_unpressed_color; - RrColor *focused_pressed_color; - RrColor *unfocused_pressed_color; - RrColor *disabled_focused_color; - RrColor *disabled_unfocused_color; - RrColor *hover_focused_color; - RrColor *hover_unfocused_color; - RrColor *toggled_hover_focused_color; - RrColor *toggled_hover_unfocused_color; - RrColor *toggled_focused_pressed_color; - RrColor *toggled_unfocused_pressed_color; - RrColor *toggled_focused_unpressed_color; - RrColor *toggled_unfocused_unpressed_color; - - /* masks */ - RrPixmapMask *mask; - RrPixmapMask *pressed_mask; - RrPixmapMask *disabled_mask; - RrPixmapMask *hover_mask; - RrPixmapMask *toggled_mask; - RrPixmapMask *toggled_hover_mask; - RrPixmapMask *toggled_pressed_mask; - - /* textures */ - RrAppearance *a_focused_unpressed; - RrAppearance *a_unfocused_unpressed; - RrAppearance *a_focused_pressed; - RrAppearance *a_unfocused_pressed; - RrAppearance *a_disabled_focused; - RrAppearance *a_disabled_unfocused; - RrAppearance *a_hover_focused; - RrAppearance *a_hover_unfocused; - RrAppearance *a_toggled_focused_unpressed; - RrAppearance *a_toggled_unfocused_unpressed; - RrAppearance *a_toggled_focused_pressed; - RrAppearance *a_toggled_unfocused_pressed; - RrAppearance *a_toggled_hover_focused; - RrAppearance *a_toggled_hover_unfocused; - -}; #endif /* __button_h */ diff --git a/obrender/render.h b/obrender/render.h index dad3c540..d8d47c9d 100644 --- a/obrender/render.h +++ b/obrender/render.h @@ -272,6 +272,52 @@ struct _RrImage { gpointer destroy_data; }; +struct _RrButton { + const RrInstance *inst; + + /* colors */ + RrColor *focused_unpressed_color; + RrColor *unfocused_unpressed_color; + RrColor *focused_pressed_color; + RrColor *unfocused_pressed_color; + RrColor *disabled_focused_color; + RrColor *disabled_unfocused_color; + RrColor *hover_focused_color; + RrColor *hover_unfocused_color; + RrColor *toggled_hover_focused_color; + RrColor *toggled_hover_unfocused_color; + RrColor *toggled_focused_pressed_color; + RrColor *toggled_unfocused_pressed_color; + RrColor *toggled_focused_unpressed_color; + RrColor *toggled_unfocused_unpressed_color; + + /* masks */ + RrPixmapMask *mask; + RrPixmapMask *pressed_mask; + RrPixmapMask *disabled_mask; + RrPixmapMask *hover_mask; + RrPixmapMask *toggled_mask; + RrPixmapMask *toggled_hover_mask; + RrPixmapMask *toggled_pressed_mask; + + /* textures */ + RrAppearance *a_focused_unpressed; + RrAppearance *a_unfocused_unpressed; + RrAppearance *a_focused_pressed; + RrAppearance *a_unfocused_pressed; + RrAppearance *a_disabled_focused; + RrAppearance *a_disabled_unfocused; + RrAppearance *a_hover_focused; + RrAppearance *a_hover_unfocused; + RrAppearance *a_toggled_focused_unpressed; + RrAppearance *a_toggled_unfocused_unpressed; + RrAppearance *a_toggled_focused_pressed; + RrAppearance *a_toggled_unfocused_pressed; + RrAppearance *a_toggled_hover_focused; + RrAppearance *a_toggled_hover_unfocused; + +}; + /* these are the same on all endian machines because it seems to be dependant on the endianness of the gfx card, not the cpu. */ #define RrDefaultAlphaOffset 24 diff --git a/obrender/theme.c b/obrender/theme.c index a2b45e60..fe43c1cf 100644 --- a/obrender/theme.c +++ b/obrender/theme.c @@ -738,7 +738,7 @@ RrTheme* RrThemeNew(const RrInstance *inst, const gchar *name, /* hover */ READ_APPEARANCE_COPY("window.active.button-desk.hover.bg", theme->btn_desk->a_hover_focused, TRUE, - theme->a_focused_unpressed); + theme->btn_desk->a_focused_unpressed); READ_APPEARANCE_COPY("window.inactive.button-desk.hover.bg", theme->btn_desk->a_hover_unfocused, TRUE, theme->btn_desk->a_unfocused_unpressed); @@ -1178,228 +1178,228 @@ RrTheme* RrThemeNew(const RrInstance *inst, const gchar *name, theme->a_menu_text_disabled_selected->texture[0].data.text.shadow_alpha = theme->menu_text_disabled_shadow_alpha; - theme->a_disabled_focused_max->texture[0].type = - theme->a_disabled_unfocused_max->texture[0].type = - theme->a_hover_focused_max->texture[0].type = - theme->a_hover_unfocused_max->texture[0].type = - theme->a_toggled_hover_focused_max->texture[0].type = - theme->a_toggled_hover_unfocused_max->texture[0].type = - theme->a_toggled_focused_unpressed_max->texture[0].type = - theme->a_toggled_unfocused_unpressed_max->texture[0].type = - theme->a_toggled_focused_pressed_max->texture[0].type = - theme->a_toggled_unfocused_pressed_max->texture[0].type = - theme->a_focused_unpressed_max->texture[0].type = - theme->a_focused_pressed_max->texture[0].type = - theme->a_unfocused_unpressed_max->texture[0].type = - theme->a_unfocused_pressed_max->texture[0].type = - theme->a_disabled_focused_close->texture[0].type = - theme->a_disabled_unfocused_close->texture[0].type = - theme->a_hover_focused_close->texture[0].type = - theme->a_hover_unfocused_close->texture[0].type = - theme->a_focused_unpressed_close->texture[0].type = - theme->a_focused_pressed_close->texture[0].type = - theme->a_unfocused_unpressed_close->texture[0].type = - theme->a_unfocused_pressed_close->texture[0].type = - theme->a_disabled_focused_desk->texture[0].type = - theme->a_disabled_unfocused_desk->texture[0].type = - theme->a_hover_focused_desk->texture[0].type = - theme->a_hover_unfocused_desk->texture[0].type = - theme->a_toggled_hover_focused_desk->texture[0].type = - theme->a_toggled_hover_unfocused_desk->texture[0].type = - theme->a_toggled_focused_unpressed_desk->texture[0].type = - theme->a_toggled_unfocused_unpressed_desk->texture[0].type = - theme->a_toggled_focused_pressed_desk->texture[0].type = - theme->a_toggled_unfocused_pressed_desk->texture[0].type = - theme->a_focused_unpressed_desk->texture[0].type = - theme->a_focused_pressed_desk->texture[0].type = - theme->a_unfocused_unpressed_desk->texture[0].type = - theme->a_unfocused_pressed_desk->texture[0].type = - theme->a_disabled_focused_shade->texture[0].type = - theme->a_disabled_unfocused_shade->texture[0].type = - theme->a_hover_focused_shade->texture[0].type = - theme->a_hover_unfocused_shade->texture[0].type = - theme->a_toggled_hover_focused_shade->texture[0].type = - theme->a_toggled_hover_unfocused_shade->texture[0].type = - theme->a_toggled_focused_unpressed_shade->texture[0].type = - theme->a_toggled_unfocused_unpressed_shade->texture[0].type = - theme->a_toggled_focused_pressed_shade->texture[0].type = - theme->a_toggled_unfocused_pressed_shade->texture[0].type = - theme->a_focused_unpressed_shade->texture[0].type = - theme->a_focused_pressed_shade->texture[0].type = - theme->a_unfocused_unpressed_shade->texture[0].type = - theme->a_unfocused_pressed_shade->texture[0].type = - theme->a_disabled_focused_iconify->texture[0].type = - theme->a_disabled_unfocused_iconify->texture[0].type = - theme->a_hover_focused_iconify->texture[0].type = - theme->a_hover_unfocused_iconify->texture[0].type = - theme->a_focused_unpressed_iconify->texture[0].type = - theme->a_focused_pressed_iconify->texture[0].type = - theme->a_unfocused_unpressed_iconify->texture[0].type = - theme->a_unfocused_pressed_iconify->texture[0].type = + theme->btn_max->a_disabled_focused->texture[0].type = + theme->btn_max->a_disabled_unfocused->texture[0].type = + theme->btn_max->a_hover_focused->texture[0].type = + theme->btn_max->a_hover_unfocused->texture[0].type = + theme->btn_max->a_toggled_hover_focused->texture[0].type = + theme->btn_max->a_toggled_hover_unfocused->texture[0].type = + theme->btn_max->a_toggled_focused_unpressed->texture[0].type = + theme->btn_max->a_toggled_unfocused_unpressed->texture[0].type = + theme->btn_max->a_toggled_focused_pressed->texture[0].type = + theme->btn_max->a_toggled_unfocused_pressed->texture[0].type = + theme->btn_max->a_focused_unpressed->texture[0].type = + theme->btn_max->a_focused_pressed->texture[0].type = + theme->btn_max->a_unfocused_unpressed->texture[0].type = + theme->btn_max->a_unfocused_pressed->texture[0].type = + theme->btn_close->a_disabled_focused->texture[0].type = + theme->btn_close->a_disabled_unfocused->texture[0].type = + theme->btn_close->a_hover_focused->texture[0].type = + theme->btn_close->a_hover_unfocused->texture[0].type = + theme->btn_close->a_focused_unpressed->texture[0].type = + theme->btn_close->a_focused_pressed->texture[0].type = + theme->btn_close->a_unfocused_unpressed->texture[0].type = + theme->btn_close->a_unfocused_pressed->texture[0].type = + theme->btn_desk->a_disabled_focused->texture[0].type = + theme->btn_desk->a_disabled_unfocused->texture[0].type = + theme->btn_desk->a_hover_focused->texture[0].type = + theme->btn_desk->a_hover_unfocused->texture[0].type = + theme->btn_desk->a_toggled_hover_focused->texture[0].type = + theme->btn_desk->a_toggled_hover_unfocused->texture[0].type = + theme->btn_desk->a_toggled_focused_unpressed->texture[0].type = + theme->btn_desk->a_toggled_unfocused_unpressed->texture[0].type = + theme->btn_desk->a_toggled_focused_pressed->texture[0].type = + theme->btn_desk->a_toggled_unfocused_pressed->texture[0].type = + theme->btn_desk->a_focused_unpressed->texture[0].type = + theme->btn_desk->a_focused_pressed->texture[0].type = + theme->btn_desk->a_unfocused_unpressed->texture[0].type = + theme->btn_desk->a_unfocused_pressed->texture[0].type = + theme->btn_shade->a_disabled_focused->texture[0].type = + theme->btn_shade->a_disabled_unfocused->texture[0].type = + theme->btn_shade->a_hover_focused->texture[0].type = + theme->btn_shade->a_hover_unfocused->texture[0].type = + theme->btn_shade->a_toggled_hover_focused->texture[0].type = + theme->btn_shade->a_toggled_hover_unfocused->texture[0].type = + theme->btn_shade->a_toggled_focused_unpressed->texture[0].type = + theme->btn_shade->a_toggled_unfocused_unpressed->texture[0].type = + theme->btn_shade->a_toggled_focused_pressed->texture[0].type = + theme->btn_shade->a_toggled_unfocused_pressed->texture[0].type = + theme->btn_shade->a_focused_unpressed->texture[0].type = + theme->btn_shade->a_focused_pressed->texture[0].type = + theme->btn_shade->a_unfocused_unpressed->texture[0].type = + theme->btn_shade->a_unfocused_pressed->texture[0].type = + theme->btn_iconify->a_disabled_focused->texture[0].type = + theme->btn_iconify->a_disabled_unfocused->texture[0].type = + theme->btn_iconify->a_hover_focused->texture[0].type = + theme->btn_iconify->a_hover_unfocused->texture[0].type = + theme->btn_iconify->a_focused_unpressed->texture[0].type = + theme->btn_iconify->a_focused_pressed->texture[0].type = + theme->btn_iconify->a_unfocused_unpressed->texture[0].type = + theme->btn_iconify->a_unfocused_pressed->texture[0].type = theme->a_menu_bullet_normal->texture[0].type = theme->a_menu_bullet_selected->texture[0].type = RR_TEXTURE_MASK; - theme->a_disabled_focused_max->texture[0].data.mask.mask = - theme->a_disabled_unfocused_max->texture[0].data.mask.mask = - theme->max_disabled_mask; - theme->a_hover_focused_max->texture[0].data.mask.mask = - theme->a_hover_unfocused_max->texture[0].data.mask.mask = - theme->max_hover_mask; - theme->a_focused_pressed_max->texture[0].data.mask.mask = - theme->a_unfocused_pressed_max->texture[0].data.mask.mask = - theme->max_pressed_mask; - theme->a_focused_unpressed_max->texture[0].data.mask.mask = - theme->a_unfocused_unpressed_max->texture[0].data.mask.mask = - theme->max_mask; - theme->a_toggled_hover_focused_max->texture[0].data.mask.mask = - theme->a_toggled_hover_unfocused_max->texture[0].data.mask.mask = - theme->max_toggled_hover_mask; - theme->a_toggled_focused_unpressed_max->texture[0].data.mask.mask = - theme->a_toggled_unfocused_unpressed_max->texture[0].data.mask.mask = - theme->max_toggled_mask; - theme->a_toggled_focused_pressed_max->texture[0].data.mask.mask = - theme->a_toggled_unfocused_pressed_max->texture[0].data.mask.mask = - theme->max_toggled_pressed_mask; - theme->a_disabled_focused_close->texture[0].data.mask.mask = - theme->a_disabled_unfocused_close->texture[0].data.mask.mask = - theme->close_disabled_mask; - theme->a_hover_focused_close->texture[0].data.mask.mask = - theme->a_hover_unfocused_close->texture[0].data.mask.mask = - theme->close_hover_mask; - theme->a_focused_pressed_close->texture[0].data.mask.mask = - theme->a_unfocused_pressed_close->texture[0].data.mask.mask = - theme->close_pressed_mask; - theme->a_focused_unpressed_close->texture[0].data.mask.mask = - theme->a_unfocused_unpressed_close->texture[0].data.mask.mask = - theme->close_mask; - theme->a_disabled_focused_desk->texture[0].data.mask.mask = - theme->a_disabled_unfocused_desk->texture[0].data.mask.mask = - theme->desk_disabled_mask; - theme->a_hover_focused_desk->texture[0].data.mask.mask = - theme->a_hover_unfocused_desk->texture[0].data.mask.mask = - theme->desk_hover_mask; - theme->a_focused_pressed_desk->texture[0].data.mask.mask = - theme->a_unfocused_pressed_desk->texture[0].data.mask.mask = - theme->desk_pressed_mask; - theme->a_focused_unpressed_desk->texture[0].data.mask.mask = - theme->a_unfocused_unpressed_desk->texture[0].data.mask.mask = - theme->desk_mask; - theme->a_toggled_hover_focused_desk->texture[0].data.mask.mask = - theme->a_toggled_hover_unfocused_desk->texture[0].data.mask.mask = - theme->desk_toggled_hover_mask; - theme->a_toggled_focused_unpressed_desk->texture[0].data.mask.mask = - theme->a_toggled_unfocused_unpressed_desk->texture[0].data.mask.mask = - theme->desk_toggled_mask; - theme->a_toggled_focused_pressed_desk->texture[0].data.mask.mask = - theme->a_toggled_unfocused_pressed_desk->texture[0].data.mask.mask = - theme->desk_toggled_pressed_mask; - theme->a_disabled_focused_shade->texture[0].data.mask.mask = - theme->a_disabled_unfocused_shade->texture[0].data.mask.mask = - theme->shade_disabled_mask; - theme->a_hover_focused_shade->texture[0].data.mask.mask = - theme->a_hover_unfocused_shade->texture[0].data.mask.mask = - theme->shade_hover_mask; - theme->a_focused_pressed_shade->texture[0].data.mask.mask = - theme->a_unfocused_pressed_shade->texture[0].data.mask.mask = - theme->shade_pressed_mask; - theme->a_focused_unpressed_shade->texture[0].data.mask.mask = - theme->a_unfocused_unpressed_shade->texture[0].data.mask.mask = - theme->shade_mask; - theme->a_toggled_hover_focused_shade->texture[0].data.mask.mask = - theme->a_toggled_hover_unfocused_shade->texture[0].data.mask.mask = - theme->shade_toggled_hover_mask; - theme->a_toggled_focused_unpressed_shade->texture[0].data.mask.mask = - theme->a_toggled_unfocused_unpressed_shade->texture[0].data.mask.mask = - theme->shade_toggled_mask; - theme->a_toggled_focused_pressed_shade->texture[0].data.mask.mask = - theme->a_toggled_unfocused_pressed_shade->texture[0].data.mask.mask = - theme->shade_toggled_pressed_mask; - theme->a_disabled_focused_iconify->texture[0].data.mask.mask = - theme->a_disabled_unfocused_iconify->texture[0].data.mask.mask = - theme->iconify_disabled_mask; - theme->a_hover_focused_iconify->texture[0].data.mask.mask = - theme->a_hover_unfocused_iconify->texture[0].data.mask.mask = - theme->iconify_hover_mask; - theme->a_focused_pressed_iconify->texture[0].data.mask.mask = - theme->a_unfocused_pressed_iconify->texture[0].data.mask.mask = - theme->iconify_pressed_mask; - theme->a_focused_unpressed_iconify->texture[0].data.mask.mask = - theme->a_unfocused_unpressed_iconify->texture[0].data.mask.mask = - theme->iconify_mask; + theme->btn_max->a_disabled_focused->texture[0].data.mask.mask = + theme->btn_max->a_disabled_unfocused->texture[0].data.mask.mask = + theme->btn_max->disabled_mask; + theme->btn_max->a_hover_focused->texture[0].data.mask.mask = + theme->btn_max->a_hover_unfocused->texture[0].data.mask.mask = + theme->btn_max->hover_mask; + theme->btn_max->a_focused_pressed->texture[0].data.mask.mask = + theme->btn_max->a_unfocused_pressed->texture[0].data.mask.mask = + theme->btn_max->pressed_mask; + theme->btn_max->a_focused_unpressed->texture[0].data.mask.mask = + theme->btn_max->a_unfocused_unpressed->texture[0].data.mask.mask = + theme->btn_max->mask; + theme->btn_max->a_toggled_hover_focused->texture[0].data.mask.mask = + theme->btn_max->a_toggled_hover_unfocused->texture[0].data.mask.mask = + theme->btn_max->toggled_hover_mask; + theme->btn_max->a_toggled_focused_unpressed->texture[0].data.mask.mask = + theme->btn_max->a_toggled_unfocused_unpressed->texture[0].data.mask.mask = + theme->btn_max->toggled_mask; + theme->btn_max->a_toggled_focused_pressed->texture[0].data.mask.mask = + theme->btn_max->a_toggled_unfocused_pressed->texture[0].data.mask.mask = + theme->btn_max->toggled_pressed_mask; + theme->btn_close->a_disabled_focused->texture[0].data.mask.mask = + theme->btn_close->a_disabled_unfocused->texture[0].data.mask.mask = + theme->btn_close->disabled_mask; + theme->btn_close->a_hover_focused->texture[0].data.mask.mask = + theme->btn_close->a_hover_unfocused->texture[0].data.mask.mask = + theme->btn_close->hover_mask; + theme->btn_close->a_focused_pressed->texture[0].data.mask.mask = + theme->btn_close->a_unfocused_pressed->texture[0].data.mask.mask = + theme->btn_close->pressed_mask; + theme->btn_close->a_focused_unpressed->texture[0].data.mask.mask = + theme->btn_close->a_unfocused_unpressed->texture[0].data.mask.mask = + theme->btn_close->mask; + theme->btn_desk->a_disabled_focused->texture[0].data.mask.mask = + theme->btn_desk->a_disabled_unfocused->texture[0].data.mask.mask = + theme->btn_desk->disabled_mask; + theme->btn_desk->a_hover_focused->texture[0].data.mask.mask = + theme->btn_desk->a_hover_unfocused->texture[0].data.mask.mask = + theme->btn_desk->hover_mask; + theme->btn_desk->a_focused_pressed->texture[0].data.mask.mask = + theme->btn_desk->a_unfocused_pressed->texture[0].data.mask.mask = + theme->btn_desk->pressed_mask; + theme->btn_desk->a_focused_unpressed->texture[0].data.mask.mask = + theme->btn_desk->a_unfocused_unpressed->texture[0].data.mask.mask = + theme->btn_desk->mask; + theme->btn_desk->a_toggled_hover_focused->texture[0].data.mask.mask = + theme->btn_desk->a_toggled_hover_unfocused->texture[0].data.mask.mask = + theme->btn_desk->toggled_hover_mask; + theme->btn_desk->a_toggled_focused_unpressed->texture[0].data.mask.mask = + theme->btn_desk->a_toggled_unfocused_unpressed->texture[0].data.mask.mask = + theme->btn_desk->toggled_mask; + theme->btn_desk->a_toggled_focused_pressed->texture[0].data.mask.mask = + theme->btn_desk->a_toggled_unfocused_pressed->texture[0].data.mask.mask = + theme->btn_desk->toggled_pressed_mask; + theme->btn_shade->a_disabled_focused->texture[0].data.mask.mask = + theme->btn_shade->a_disabled_unfocused->texture[0].data.mask.mask = + theme->btn_shade->disabled_mask; + theme->btn_shade->a_hover_focused->texture[0].data.mask.mask = + theme->btn_shade->a_hover_unfocused->texture[0].data.mask.mask = + theme->btn_shade->hover_mask; + theme->btn_shade->a_focused_pressed->texture[0].data.mask.mask = + theme->btn_shade->a_unfocused_pressed->texture[0].data.mask.mask = + theme->btn_shade->pressed_mask; + theme->btn_shade->a_focused_unpressed->texture[0].data.mask.mask = + theme->btn_shade->a_unfocused_unpressed->texture[0].data.mask.mask = + theme->btn_shade->mask; + theme->btn_shade->a_toggled_hover_focused->texture[0].data.mask.mask = + theme->btn_shade->a_toggled_hover_unfocused->texture[0].data.mask.mask = + theme->btn_shade->toggled_hover_mask; + theme->btn_shade->a_toggled_focused_unpressed->texture[0].data.mask.mask = + theme->btn_shade->a_toggled_unfocused_unpressed->texture[0].data.mask.mask = + theme->btn_shade->toggled_mask; + theme->btn_shade->a_toggled_focused_pressed->texture[0].data.mask.mask = + theme->btn_shade->a_toggled_unfocused_pressed->texture[0].data.mask.mask = + theme->btn_shade->toggled_pressed_mask; + theme->btn_iconify->a_disabled_focused->texture[0].data.mask.mask = + theme->btn_iconify->a_disabled_unfocused->texture[0].data.mask.mask = + theme->btn_iconify->disabled_mask; + theme->btn_iconify->a_hover_focused->texture[0].data.mask.mask = + theme->btn_iconify->a_hover_unfocused->texture[0].data.mask.mask = + theme->btn_iconify->hover_mask; + theme->btn_iconify->a_focused_pressed->texture[0].data.mask.mask = + theme->btn_iconify->a_unfocused_pressed->texture[0].data.mask.mask = + theme->btn_iconify->pressed_mask; + theme->btn_iconify->a_focused_unpressed->texture[0].data.mask.mask = + theme->btn_iconify->a_unfocused_unpressed->texture[0].data.mask.mask = + theme->btn_iconify->mask; theme->a_menu_bullet_normal->texture[0].data.mask.mask = theme->a_menu_bullet_selected->texture[0].data.mask.mask = theme->menu_bullet_mask; - theme->a_disabled_focused_max->texture[0].data.mask.color = - theme->a_disabled_focused_close->texture[0].data.mask.color = - theme->a_disabled_focused_desk->texture[0].data.mask.color = - theme->a_disabled_focused_shade->texture[0].data.mask.color = - theme->a_disabled_focused_iconify->texture[0].data.mask.color = + theme->btn_max->a_disabled_focused->texture[0].data.mask.color = + theme->btn_close->a_disabled_focused->texture[0].data.mask.color = + theme->btn_desk->a_disabled_focused->texture[0].data.mask.color = + theme->btn_shade->a_disabled_focused->texture[0].data.mask.color = + theme->btn_iconify->a_disabled_focused->texture[0].data.mask.color = theme->titlebut_disabled_focused_color; - theme->a_disabled_unfocused_max->texture[0].data.mask.color = - theme->a_disabled_unfocused_close->texture[0].data.mask.color = - theme->a_disabled_unfocused_desk->texture[0].data.mask.color = - theme->a_disabled_unfocused_shade->texture[0].data.mask.color = - theme->a_disabled_unfocused_iconify->texture[0].data.mask.color = + theme->btn_max->a_disabled_unfocused->texture[0].data.mask.color = + theme->btn_close->a_disabled_unfocused->texture[0].data.mask.color = + theme->btn_desk->a_disabled_unfocused->texture[0].data.mask.color = + theme->btn_shade->a_disabled_unfocused->texture[0].data.mask.color = + theme->btn_iconify->a_disabled_unfocused->texture[0].data.mask.color = theme->titlebut_disabled_unfocused_color; - theme->a_hover_focused_max->texture[0].data.mask.color = - theme->a_hover_focused_close->texture[0].data.mask.color = - theme->a_hover_focused_desk->texture[0].data.mask.color = - theme->a_hover_focused_shade->texture[0].data.mask.color = - theme->a_hover_focused_iconify->texture[0].data.mask.color = + theme->btn_max->a_hover_focused->texture[0].data.mask.color = + theme->btn_close->a_hover_focused->texture[0].data.mask.color = + theme->btn_desk->a_hover_focused->texture[0].data.mask.color = + theme->btn_shade->a_hover_focused->texture[0].data.mask.color = + theme->btn_iconify->a_hover_focused->texture[0].data.mask.color = theme->titlebut_hover_focused_color; - theme->a_hover_unfocused_max->texture[0].data.mask.color = - theme->a_hover_unfocused_close->texture[0].data.mask.color = - theme->a_hover_unfocused_desk->texture[0].data.mask.color = - theme->a_hover_unfocused_shade->texture[0].data.mask.color = - theme->a_hover_unfocused_iconify->texture[0].data.mask.color = + theme->btn_max->a_hover_unfocused->texture[0].data.mask.color = + theme->btn_close->a_hover_unfocused->texture[0].data.mask.color = + theme->btn_desk->a_hover_unfocused->texture[0].data.mask.color = + theme->btn_shade->a_hover_unfocused->texture[0].data.mask.color = + theme->btn_iconify->a_hover_unfocused->texture[0].data.mask.color = theme->titlebut_hover_unfocused_color; - theme->a_toggled_hover_focused_max->texture[0].data.mask.color = - theme->a_toggled_hover_focused_desk->texture[0].data.mask.color = - theme->a_toggled_hover_focused_shade->texture[0].data.mask.color = + theme->btn_max->a_toggled_hover_focused->texture[0].data.mask.color = + theme->btn_desk->a_toggled_hover_focused->texture[0].data.mask.color = + theme->btn_shade->a_toggled_hover_focused->texture[0].data.mask.color = theme->titlebut_toggled_hover_focused_color; - theme->a_toggled_hover_unfocused_max->texture[0].data.mask.color = - theme->a_toggled_hover_unfocused_desk->texture[0].data.mask.color = - theme->a_toggled_hover_unfocused_shade->texture[0].data.mask.color = + theme->btn_max->a_toggled_hover_unfocused->texture[0].data.mask.color = + theme->btn_desk->a_toggled_hover_unfocused->texture[0].data.mask.color = + theme->btn_shade->a_toggled_hover_unfocused->texture[0].data.mask.color = theme->titlebut_toggled_hover_unfocused_color; - theme->a_toggled_focused_unpressed_max->texture[0].data.mask.color = - theme->a_toggled_focused_unpressed_desk->texture[0].data.mask.color = - theme->a_toggled_focused_unpressed_shade->texture[0].data.mask.color = + theme->btn_max->a_toggled_focused_unpressed->texture[0].data.mask.color = + theme->btn_desk->a_toggled_focused_unpressed->texture[0].data.mask.color = + theme->btn_shade->a_toggled_focused_unpressed->texture[0].data.mask.color = theme->titlebut_toggled_focused_unpressed_color; - theme->a_toggled_unfocused_unpressed_max->texture[0].data.mask.color = - theme->a_toggled_unfocused_unpressed_desk->texture[0].data.mask.color = - theme->a_toggled_unfocused_unpressed_shade->texture[0].data.mask.color= + theme->btn_max->a_toggled_unfocused_unpressed->texture[0].data.mask.color = + theme->btn_desk->a_toggled_unfocused_unpressed->texture[0].data.mask.color = + theme->btn_shade->a_toggled_unfocused_unpressed->texture[0].data.mask.color= theme->titlebut_toggled_unfocused_unpressed_color; - theme->a_toggled_focused_pressed_max->texture[0].data.mask.color = - theme->a_toggled_focused_pressed_desk->texture[0].data.mask.color = - theme->a_toggled_focused_pressed_shade->texture[0].data.mask.color = + theme->btn_max->a_toggled_focused_pressed->texture[0].data.mask.color = + theme->btn_desk->a_toggled_focused_pressed->texture[0].data.mask.color = + theme->btn_shade->a_toggled_focused_pressed->texture[0].data.mask.color = theme->titlebut_toggled_focused_pressed_color; - theme->a_toggled_unfocused_pressed_max->texture[0].data.mask.color = - theme->a_toggled_unfocused_pressed_desk->texture[0].data.mask.color = - theme->a_toggled_unfocused_pressed_shade->texture[0].data.mask.color = + theme->btn_max->a_toggled_unfocused_pressed->texture[0].data.mask.color = + theme->btn_desk->a_toggled_unfocused_pressed->texture[0].data.mask.color = + theme->btn_shade->a_toggled_unfocused_pressed->texture[0].data.mask.color = theme->titlebut_toggled_unfocused_pressed_color; - theme->a_focused_unpressed_max->texture[0].data.mask.color = - theme->a_focused_unpressed_close->texture[0].data.mask.color = - theme->a_focused_unpressed_desk->texture[0].data.mask.color = - theme->a_focused_unpressed_shade->texture[0].data.mask.color = - theme->a_focused_unpressed_iconify->texture[0].data.mask.color = + theme->btn_max->a_focused_unpressed->texture[0].data.mask.color = + theme->btn_close->a_focused_unpressed->texture[0].data.mask.color = + theme->btn_desk->a_focused_unpressed->texture[0].data.mask.color = + theme->btn_shade->a_focused_unpressed->texture[0].data.mask.color = + theme->btn_iconify->a_focused_unpressed->texture[0].data.mask.color = theme->titlebut_focused_unpressed_color; - theme->a_focused_pressed_max->texture[0].data.mask.color = - theme->a_focused_pressed_close->texture[0].data.mask.color = - theme->a_focused_pressed_desk->texture[0].data.mask.color = - theme->a_focused_pressed_shade->texture[0].data.mask.color = - theme->a_focused_pressed_iconify->texture[0].data.mask.color = + theme->btn_max->a_focused_pressed->texture[0].data.mask.color = + theme->btn_close->a_focused_pressed->texture[0].data.mask.color = + theme->btn_desk->a_focused_pressed->texture[0].data.mask.color = + theme->btn_shade->a_focused_pressed->texture[0].data.mask.color = + theme->btn_iconify->a_focused_pressed->texture[0].data.mask.color = theme->titlebut_focused_pressed_color; - theme->a_unfocused_unpressed_max->texture[0].data.mask.color = - theme->a_unfocused_unpressed_close->texture[0].data.mask.color = - theme->a_unfocused_unpressed_desk->texture[0].data.mask.color = - theme->a_unfocused_unpressed_shade->texture[0].data.mask.color = - theme->a_unfocused_unpressed_iconify->texture[0].data.mask.color = + theme->btn_max->a_unfocused_unpressed->texture[0].data.mask.color = + theme->btn_close->a_unfocused_unpressed->texture[0].data.mask.color = + theme->btn_desk->a_unfocused_unpressed->texture[0].data.mask.color = + theme->btn_shade->a_unfocused_unpressed->texture[0].data.mask.color = + theme->btn_iconify->a_unfocused_unpressed->texture[0].data.mask.color = theme->titlebut_unfocused_unpressed_color; - theme->a_unfocused_pressed_max->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 = - theme->a_unfocused_pressed_iconify->texture[0].data.mask.color = + theme->btn_max->a_unfocused_pressed->texture[0].data.mask.color = + theme->btn_close->a_unfocused_pressed->texture[0].data.mask.color = + theme->btn_desk->a_unfocused_pressed->texture[0].data.mask.color = + theme->btn_shade->a_unfocused_pressed->texture[0].data.mask.color = + theme->btn_iconify->a_unfocused_pressed->texture[0].data.mask.color = theme->titlebut_unfocused_pressed_color; theme->a_menu_bullet_normal->texture[0].data.mask.color = theme->menu_color; @@ -1478,6 +1478,12 @@ void RrThemeFree(RrTheme *theme) if (theme) { g_free(theme->name); + RrButtonFree(theme->btn_max); + RrButtonFree(theme->btn_close); + RrButtonFree(theme->btn_desk); + RrButtonFree(theme->btn_shade); + RrButtonFree(theme->btn_iconify); + RrColorFree(theme->menu_border_color); RrColorFree(theme->osd_border_color); RrColorFree(theme->frame_focused_border_color); @@ -1521,36 +1527,7 @@ void RrThemeFree(RrTheme *theme) RrColorFree(theme->menu_text_disabled_selected_shadow_color); g_free(theme->def_win_icon); - - RrPixmapMaskFree(theme->max_mask); - RrPixmapMaskFree(theme->max_toggled_mask); - RrPixmapMaskFree(theme->max_toggled_hover_mask); - RrPixmapMaskFree(theme->max_toggled_pressed_mask); - RrPixmapMaskFree(theme->max_disabled_mask); - RrPixmapMaskFree(theme->max_hover_mask); - RrPixmapMaskFree(theme->max_pressed_mask); - RrPixmapMaskFree(theme->desk_mask); - RrPixmapMaskFree(theme->desk_toggled_mask); - RrPixmapMaskFree(theme->desk_toggled_hover_mask); - RrPixmapMaskFree(theme->desk_toggled_pressed_mask); - RrPixmapMaskFree(theme->desk_disabled_mask); - RrPixmapMaskFree(theme->desk_hover_mask); - RrPixmapMaskFree(theme->desk_pressed_mask); - RrPixmapMaskFree(theme->shade_mask); - RrPixmapMaskFree(theme->shade_toggled_mask); - RrPixmapMaskFree(theme->shade_toggled_hover_mask); - RrPixmapMaskFree(theme->shade_toggled_pressed_mask); - RrPixmapMaskFree(theme->shade_disabled_mask); - RrPixmapMaskFree(theme->shade_hover_mask); - RrPixmapMaskFree(theme->shade_pressed_mask); - RrPixmapMaskFree(theme->iconify_mask); - RrPixmapMaskFree(theme->iconify_disabled_mask); - RrPixmapMaskFree(theme->iconify_hover_mask); - RrPixmapMaskFree(theme->iconify_pressed_mask); - RrPixmapMaskFree(theme->close_mask); - RrPixmapMaskFree(theme->close_disabled_mask); - RrPixmapMaskFree(theme->close_hover_mask); - RrPixmapMaskFree(theme->close_pressed_mask); + RrPixmapMaskFree(theme->menu_bullet_mask); RrPixmapMaskFree(theme->down_arrow_mask); RrPixmapMaskFree(theme->up_arrow_mask); diff --git a/openbox/client_menu.c b/openbox/client_menu.c index fd2549cf..cf41ded7 100644 --- a/openbox/client_menu.c +++ b/openbox/client_menu.c @@ -400,11 +400,11 @@ void client_menu_startup(void) menu_add_normal(menu, CLIENT_RESIZE, _("Resi_ze"), NULL, TRUE); e = menu_add_normal(menu, CLIENT_ICONIFY, _("Ico_nify"), NULL, TRUE); - e->data.normal.mask = ob_rr_theme->iconify_mask; + e->data.normal.mask = ob_rr_theme->btn_iconify->mask; set_icon_color(e); e = menu_add_normal(menu, CLIENT_MAXIMIZE, _("Ma_ximize"), NULL, TRUE); - e->data.normal.mask = ob_rr_theme->max_mask; + e->data.normal.mask = ob_rr_theme->btn_max->mask; set_icon_color(e); e = menu_add_normal(menu, CLIENT_SHADE, _("_Roll up/down"), NULL, TRUE); @@ -416,6 +416,6 @@ void client_menu_startup(void) menu_add_separator(menu, -1, NULL); e = menu_add_normal(menu, CLIENT_CLOSE, _("_Close"), NULL, TRUE); - e->data.normal.mask = ob_rr_theme->close_mask; + e->data.normal.mask = ob_rr_theme->btn_close->mask; set_icon_color(e); } diff --git a/openbox/framerender.c b/openbox/framerender.c index 28c12ae2..8ddba608 100644 --- a/openbox/framerender.c +++ b/openbox/framerender.c @@ -127,116 +127,116 @@ void framerender_frame(ObFrame *self) t = ob_rr_theme->a_focused_title; l = ob_rr_theme->a_focused_label; m = (!(self->decorations & OB_FRAME_DECOR_MAXIMIZE) ? - ob_rr_theme->a_disabled_focused_max : + ob_rr_theme->btn_max->a_disabled_focused : (self->client->max_vert || self->client->max_horz ? (self->max_press ? - ob_rr_theme->a_toggled_focused_pressed_max : + ob_rr_theme->btn_max->a_toggled_focused_pressed : (self->max_hover ? - ob_rr_theme->a_toggled_hover_focused_max : - ob_rr_theme->a_toggled_focused_unpressed_max)) : + ob_rr_theme->btn_max->a_toggled_hover_focused : + ob_rr_theme->btn_max->a_toggled_focused_unpressed)) : (self->max_press ? - ob_rr_theme->a_focused_pressed_max : + ob_rr_theme->btn_max->a_focused_pressed : (self->max_hover ? - ob_rr_theme->a_hover_focused_max : - ob_rr_theme->a_focused_unpressed_max)))); + ob_rr_theme->btn_max->a_hover_focused : + ob_rr_theme->btn_max->a_focused_unpressed)))); n = ob_rr_theme->a_icon; i = (!(self->decorations & OB_FRAME_DECOR_ICONIFY) ? - ob_rr_theme->a_disabled_focused_iconify : + ob_rr_theme->btn_iconify->a_disabled_focused : (self->iconify_press ? - ob_rr_theme->a_focused_pressed_iconify : + ob_rr_theme->btn_iconify->a_focused_pressed : (self->iconify_hover ? - ob_rr_theme->a_hover_focused_iconify : - ob_rr_theme->a_focused_unpressed_iconify))); + ob_rr_theme->btn_iconify->a_hover_focused : + ob_rr_theme->btn_iconify->a_focused_unpressed))); d = (!(self->decorations & OB_FRAME_DECOR_ALLDESKTOPS) ? - ob_rr_theme->a_disabled_focused_desk : + ob_rr_theme->btn_desk->a_disabled_focused : (self->client->desktop == DESKTOP_ALL ? (self->desk_press ? - ob_rr_theme->a_toggled_focused_pressed_desk : + ob_rr_theme->btn_desk->a_toggled_focused_pressed : (self->desk_hover ? - ob_rr_theme->a_toggled_hover_focused_desk : - ob_rr_theme->a_toggled_focused_unpressed_desk)) : + ob_rr_theme->btn_desk->a_toggled_hover_focused : + ob_rr_theme->btn_desk->a_toggled_focused_unpressed)) : (self->desk_press ? - ob_rr_theme->a_focused_pressed_desk : + ob_rr_theme->btn_desk->a_focused_pressed : (self->desk_hover ? - ob_rr_theme->a_hover_focused_desk : - ob_rr_theme->a_focused_unpressed_desk)))); + ob_rr_theme->btn_desk->a_hover_focused : + ob_rr_theme->btn_desk->a_focused_unpressed)))); s = (!(self->decorations & OB_FRAME_DECOR_SHADE) ? - ob_rr_theme->a_disabled_focused_shade : + ob_rr_theme->btn_shade->a_disabled_focused : (self->client->shaded ? (self->shade_press ? - ob_rr_theme->a_toggled_focused_pressed_shade : + ob_rr_theme->btn_shade->a_toggled_focused_pressed : (self->shade_hover ? - ob_rr_theme->a_toggled_hover_focused_shade : - ob_rr_theme->a_toggled_focused_unpressed_shade)) : + ob_rr_theme->btn_shade->a_toggled_hover_focused : + ob_rr_theme->btn_shade->a_toggled_focused_unpressed)) : (self->shade_press ? - ob_rr_theme->a_focused_pressed_shade : + ob_rr_theme->btn_shade->a_focused_pressed : (self->shade_hover ? - ob_rr_theme->a_hover_focused_shade : - ob_rr_theme->a_focused_unpressed_shade)))); + ob_rr_theme->btn_shade->a_hover_focused : + ob_rr_theme->btn_shade->a_focused_unpressed)))); c = (!(self->decorations & OB_FRAME_DECOR_CLOSE) ? - ob_rr_theme->a_disabled_focused_close : + ob_rr_theme->btn_close->a_disabled_focused : (self->close_press ? - ob_rr_theme->a_focused_pressed_close : + ob_rr_theme->btn_close->a_focused_pressed : (self->close_hover ? - ob_rr_theme->a_hover_focused_close : - ob_rr_theme->a_focused_unpressed_close))); + ob_rr_theme->btn_close->a_hover_focused : + ob_rr_theme->btn_close->a_focused_unpressed))); } else { t = ob_rr_theme->a_unfocused_title; l = ob_rr_theme->a_unfocused_label; m = (!(self->decorations & OB_FRAME_DECOR_MAXIMIZE) ? - ob_rr_theme->a_disabled_unfocused_max : + ob_rr_theme->btn_max->a_disabled_unfocused : (self->client->max_vert || self->client->max_horz ? (self->max_press ? - ob_rr_theme->a_toggled_unfocused_pressed_max : + ob_rr_theme->btn_max->a_toggled_unfocused_pressed : (self->max_hover ? - ob_rr_theme->a_toggled_hover_unfocused_max : - ob_rr_theme->a_toggled_unfocused_unpressed_max)) : + ob_rr_theme->btn_max->a_toggled_hover_unfocused : + ob_rr_theme->btn_max->a_toggled_unfocused_unpressed)) : (self->max_press ? - ob_rr_theme->a_unfocused_pressed_max : + ob_rr_theme->btn_max->a_unfocused_pressed : (self->max_hover ? - ob_rr_theme->a_hover_unfocused_max : - ob_rr_theme->a_unfocused_unpressed_max)))); + ob_rr_theme->btn_max->a_hover_unfocused : + ob_rr_theme->btn_max->a_unfocused_unpressed)))); n = ob_rr_theme->a_icon; i = (!(self->decorations & OB_FRAME_DECOR_ICONIFY) ? - ob_rr_theme->a_disabled_unfocused_iconify : + ob_rr_theme->btn_iconify->a_disabled_unfocused : (self->iconify_press ? - ob_rr_theme->a_unfocused_pressed_iconify : + ob_rr_theme->btn_iconify->a_unfocused_pressed : (self->iconify_hover ? - ob_rr_theme->a_hover_unfocused_iconify : - ob_rr_theme->a_unfocused_unpressed_iconify))); + ob_rr_theme->btn_iconify->a_hover_unfocused : + ob_rr_theme->btn_iconify->a_unfocused_unpressed))); d = (!(self->decorations & OB_FRAME_DECOR_ALLDESKTOPS) ? - ob_rr_theme->a_disabled_unfocused_desk : + ob_rr_theme->btn_desk->a_disabled_unfocused : (self->client->desktop == DESKTOP_ALL ? (self->desk_press ? - ob_rr_theme->a_toggled_unfocused_pressed_desk : + ob_rr_theme->btn_desk->a_toggled_unfocused_pressed : (self->desk_hover ? - ob_rr_theme->a_toggled_hover_unfocused_desk : - ob_rr_theme->a_toggled_unfocused_unpressed_desk)) : + ob_rr_theme->btn_desk->a_toggled_hover_unfocused : + ob_rr_theme->btn_desk->a_toggled_unfocused_unpressed)) : (self->desk_press ? - ob_rr_theme->a_unfocused_pressed_desk : + ob_rr_theme->btn_desk->a_unfocused_pressed : (self->desk_hover ? - ob_rr_theme->a_hover_unfocused_desk : - ob_rr_theme->a_unfocused_unpressed_desk)))); + ob_rr_theme->btn_desk->a_hover_unfocused : + ob_rr_theme->btn_desk->a_unfocused_unpressed)))); s = (!(self->decorations & OB_FRAME_DECOR_SHADE) ? - ob_rr_theme->a_disabled_unfocused_shade : + ob_rr_theme->btn_shade->a_disabled_unfocused : (self->client->shaded ? (self->shade_press ? - ob_rr_theme->a_toggled_unfocused_pressed_shade : + ob_rr_theme->btn_shade->a_toggled_unfocused_pressed : (self->shade_hover ? - ob_rr_theme->a_toggled_hover_unfocused_shade : - ob_rr_theme->a_toggled_unfocused_unpressed_shade)) : + ob_rr_theme->btn_shade->a_toggled_hover_unfocused : + ob_rr_theme->btn_shade->a_toggled_unfocused_unpressed)) : (self->shade_press ? - ob_rr_theme->a_unfocused_pressed_shade : + ob_rr_theme->btn_shade->a_unfocused_pressed : (self->shade_hover ? - ob_rr_theme->a_hover_unfocused_shade : - ob_rr_theme->a_unfocused_unpressed_shade)))); + ob_rr_theme->btn_shade->a_hover_unfocused : + ob_rr_theme->btn_shade->a_unfocused_unpressed)))); c = (!(self->decorations & OB_FRAME_DECOR_CLOSE) ? - ob_rr_theme->a_disabled_unfocused_close : + ob_rr_theme->btn_close->a_disabled_unfocused : (self->close_press ? - ob_rr_theme->a_unfocused_pressed_close : + ob_rr_theme->btn_close->a_unfocused_pressed : (self->close_hover ? - ob_rr_theme->a_hover_unfocused_close : - ob_rr_theme->a_unfocused_unpressed_close))); + ob_rr_theme->btn_close->a_hover_unfocused : + ob_rr_theme->btn_close->a_unfocused_unpressed))); } clear = ob_rr_theme->a_clear;