]> Dogcows Code - chaz/openbox/commitdiff
add support for foo.pressed.mask to load a different mask for pressed buttons
authorDana Jansens <danakj@orodu.net>
Sat, 29 Mar 2003 21:24:37 +0000 (21:24 +0000)
committerDana Jansens <danakj@orodu.net>
Sat, 29 Mar 2003 21:24:37 +0000 (21:24 +0000)
engines/openbox/obengine.c
engines/openbox/obengine.h
engines/openbox/obtheme.c

index c4d0c8171992e143678c6d21dd0b84b0adefc4b4..4372f1588d14fbeeee46a00447c7fdbcb7c4119f 100644 (file)
@@ -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);
 
index df6cdbcd3e7ee3f2301f310f2643e08eae52cf0b..ad07e0d56ceaa83e280981e00b73648c214806ff 100644 (file)
@@ -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;
index f1bb2981b88eeaaa802c97817249b37b523fc3d9..86850bae650aa6259a25ff10b8ca070c9b8d640a 100644 (file)
@@ -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 = 
This page took 0.027203 seconds and 4 git commands to generate.