]> Dogcows Code - chaz/openbox/blobdiff - openbox/frame.c
fixed to accomodate the changes to the render/ API.
[chaz/openbox] / openbox / frame.c
index 358144dc7ead61c773969cbdd66fc83e42fe77d0..4307c98a292062712b676d3a86f138bbf825efaf 100644 (file)
@@ -14,65 +14,6 @@ static void layout_title(Frame *self);
 
 void frame_startup()
 {
-    RECT_SET(theme_a_focused_pressed_desk->area, 0, 0,
-             theme_button_size, theme_button_size);
-    RECT_SET(theme_a_focused_pressed_set_desk->area, 0, 0,
-             theme_button_size, theme_button_size);
-    RECT_SET(theme_a_focused_unpressed_desk->area, 0, 0,
-             theme_button_size, theme_button_size);
-    RECT_SET(theme_a_unfocused_pressed_desk->area, 0, 0,
-             theme_button_size, theme_button_size);
-    RECT_SET(theme_a_unfocused_pressed_set_desk->area, 0, 0,
-             theme_button_size, theme_button_size);
-    RECT_SET(theme_a_unfocused_unpressed_desk->area, 0, 0,
-             theme_button_size, theme_button_size);
-    RECT_SET(theme_a_focused_pressed_shade->area, 0, 0,
-             theme_button_size, theme_button_size);
-    RECT_SET(theme_a_focused_pressed_set_shade->area, 0, 0,
-             theme_button_size, theme_button_size);
-    RECT_SET(theme_a_focused_unpressed_shade->area, 0, 0,
-             theme_button_size, theme_button_size);
-    RECT_SET(theme_a_unfocused_pressed_shade->area, 0, 0,
-             theme_button_size, theme_button_size);
-    RECT_SET(theme_a_unfocused_pressed_set_shade->area, 0, 0,
-             theme_button_size, theme_button_size);
-    RECT_SET(theme_a_unfocused_unpressed_shade->area, 0, 0,
-             theme_button_size, theme_button_size);
-    RECT_SET(theme_a_focused_pressed_iconify->area, 0, 0,
-             theme_button_size, theme_button_size);
-    RECT_SET(theme_a_focused_unpressed_iconify->area, 0, 0,
-             theme_button_size, theme_button_size);
-    RECT_SET(theme_a_unfocused_pressed_iconify->area, 0, 0,
-             theme_button_size, theme_button_size);
-    RECT_SET(theme_a_unfocused_unpressed_iconify->area, 0, 0,
-             theme_button_size, theme_button_size);
-    RECT_SET(theme_a_unfocused_unpressed_iconify->area, 0, 0,
-             theme_button_size, theme_button_size);
-    RECT_SET(theme_a_focused_pressed_max->area, 0, 0,
-             theme_button_size, theme_button_size);
-    RECT_SET(theme_a_focused_pressed_set_max->area, 0, 0,
-             theme_button_size, theme_button_size);
-    RECT_SET(theme_a_focused_unpressed_max->area, 0, 0,
-             theme_button_size, theme_button_size);
-    RECT_SET(theme_a_unfocused_pressed_max->area, 0, 0,
-             theme_button_size, theme_button_size);
-    RECT_SET(theme_a_unfocused_pressed_set_max->area, 0, 0,
-             theme_button_size, theme_button_size);
-    RECT_SET(theme_a_unfocused_unpressed_max->area, 0, 0,
-             theme_button_size, theme_button_size);
-    RECT_SET(theme_a_focused_pressed_close->area, 0, 0,
-             theme_button_size, theme_button_size);
-    RECT_SET(theme_a_focused_unpressed_close->area, 0, 0,
-             theme_button_size, theme_button_size);
-    RECT_SET(theme_a_unfocused_pressed_close->area, 0, 0,
-             theme_button_size, theme_button_size);
-    RECT_SET(theme_a_unfocused_unpressed_close->area, 0, 0,
-             theme_button_size, theme_button_size);
-
-    RECT_SET(theme_a_focused_grip->area, 0, 0,
-             theme_grip_width, theme_handle_height);
-    RECT_SET(theme_a_unfocused_grip->area, 0, 0,
-             theme_grip_width, theme_handle_height);
 }
 
 void frame_shutdown()
@@ -83,8 +24,8 @@ static Window createWindow(Window parent, unsigned long mask,
                           XSetWindowAttributes *attrib)
 {
     return XCreateWindow(ob_display, parent, 0, 0, 1, 1, 0,
-                        render_depth, InputOutput, render_visual,
-                        mask, attrib);
+                        RrDepth(ob_rr_inst), InputOutput,
+                         RrVisual(ob_rr_inst), mask, attrib);
                        
 }
 
@@ -155,13 +96,13 @@ Frame *frame_new()
                   theme_grip_width, theme_handle_height);
 
     /* set up the dynamic appearances */
-    self->a_unfocused_title = appearance_copy(theme_a_unfocused_title);
-    self->a_focused_title = appearance_copy(theme_a_focused_title);
-    self->a_unfocused_label = appearance_copy(theme_a_unfocused_label);
-    self->a_focused_label = appearance_copy(theme_a_focused_label);
-    self->a_unfocused_handle = appearance_copy(theme_a_unfocused_handle);
-    self->a_focused_handle = appearance_copy(theme_a_focused_handle);
-    self->a_icon = appearance_copy(theme_a_icon);
+    self->a_unfocused_title = RrAppearanceCopy(theme_a_unfocused_title);
+    self->a_focused_title = RrAppearanceCopy(theme_a_focused_title);
+    self->a_unfocused_label = RrAppearanceCopy(theme_a_unfocused_label);
+    self->a_focused_label = RrAppearanceCopy(theme_a_focused_label);
+    self->a_unfocused_handle = RrAppearanceCopy(theme_a_unfocused_handle);
+    self->a_focused_handle = RrAppearanceCopy(theme_a_focused_handle);
+    self->a_icon = RrAppearanceCopy(theme_a_icon);
 
     self->max_press = self->close_press = self->desk_press = 
        self->iconify_press = self->shade_press = FALSE;
@@ -171,13 +112,13 @@ Frame *frame_new()
 
 static void frame_free(Frame *self)
 {
-    appearance_free(self->a_unfocused_title); 
-    appearance_free(self->a_focused_title);
-    appearance_free(self->a_unfocused_label);
-    appearance_free(self->a_focused_label);
-    appearance_free(self->a_unfocused_handle);
-    appearance_free(self->a_focused_handle);
-    appearance_free(self->a_icon);
+    RrAppearanceFree(self->a_unfocused_title); 
+    RrAppearanceFree(self->a_focused_title);
+    RrAppearanceFree(self->a_unfocused_label);
+    RrAppearanceFree(self->a_focused_label);
+    RrAppearanceFree(self->a_unfocused_handle);
+    RrAppearanceFree(self->a_focused_handle);
+    RrAppearanceFree(self->a_icon);
 
     XDestroyWindow(ob_display, self->window);
 
@@ -287,11 +228,6 @@ void frame_adjust_area(Frame *self, gboolean moved, gboolean resized)
             self->innersize.top += theme_title_height + self->bwidth;
             XMapWindow(ob_display, self->title);
 
-            RECT_SET(self->a_focused_title->area, 0, 0,
-                     self->width, theme_title_height);
-            RECT_SET(self->a_unfocused_title->area, 0, 0,
-                     self->width, theme_title_height);
-
             /* layout the title bar elements */
             layout_title(self);
         } else
@@ -310,25 +246,11 @@ void frame_adjust_area(Frame *self, gboolean moved, gboolean resized)
                 self->bwidth;
             XMapWindow(ob_display, self->handle);
 
-            if (theme_a_focused_grip->surface.grad ==
-                Background_ParentRelative)
-                RECT_SET(self->a_focused_handle->area, 0, 0,
-                         self->width, theme_handle_height);
-            else
-                RECT_SET(self->a_focused_handle->area,
-                         theme_grip_width + self->bwidth, 0,
-                         self->width - (theme_grip_width + self->bwidth) * 2,
-                         theme_handle_height);
-            if (theme_a_unfocused_grip->surface.grad ==
-                Background_ParentRelative)
-                RECT_SET(self->a_unfocused_handle->area, 0, 0,
-                         self->width, theme_handle_height);
-            else
-                RECT_SET(self->a_unfocused_handle->area,
-                         theme_grip_width + self->bwidth, 0,
-                         self->width - (theme_grip_width + self->bwidth) * 2,
-                         theme_handle_height);
-
+            /* XXX make a subwindow with these dimentions?
+               theme_grip_width + self->bwidth, 0,
+               self->width - (theme_grip_width + self->bwidth) * 2,
+               theme_handle_height);
+            */
         } else
             XUnmapWindow(ob_display, self->handle);
     }
@@ -561,8 +483,6 @@ static void layout_title(Frame *self)
        case 'N':
            if (!n) break;
            self->icon_x = x;
-            RECT_SET(self->a_icon->area, 0, 0,
-                     theme_button_size + 2, theme_button_size + 2);
            XMapWindow(ob_display, self->icon);
            XMoveWindow(ob_display, self->icon, x, theme_bevel);
            x += theme_button_size + 2 + theme_bevel + 1;
@@ -611,11 +531,6 @@ static void layout_title(Frame *self)
            break;
        }
     }
-
-    RECT_SET(self->a_focused_label->area, 0, 0,
-             self->label_width, theme_label_height);
-    RECT_SET(self->a_unfocused_label->area, 0, 0,
-             self->label_width, theme_label_height);
 }
 
 Context frame_context_from_string(char *name)
This page took 0.030393 seconds and 4 git commands to generate.