]> Dogcows Code - chaz/openbox/commitdiff
fixed to accomodate the changes to the render/ API.
authorDana Jansens <danakj@orodu.net>
Sat, 21 Jun 2003 00:42:47 +0000 (00:42 +0000)
committerDana Jansens <danakj@orodu.net>
Sat, 21 Jun 2003 00:42:47 +0000 (00:42 +0000)
14 files changed:
openbox/client.c
openbox/dock.c
openbox/dock.h
openbox/frame.c
openbox/frame.h
openbox/framerender.c
openbox/menu.c
openbox/menu.h
openbox/menu_render.c
openbox/moveresize.c
openbox/openbox.c
openbox/openbox.h
openbox/popup.c
openbox/screen.c

index 249309094209cdab75f6b2d96e6a3c415beb2373..d7a99def5c6d125fe9b1109cbd0c180ffa96fee6 100644 (file)
@@ -1355,10 +1355,11 @@ void client_update_icons(Client *self)
             self->nicons++;
             self->icons = g_new(Icon, self->nicons);
             xerror_set_ignore(TRUE);
-            if (!render_pixmap_to_rgba(data[0], data[1],
-                                       &self->icons[self->nicons-1].width,
-                                       &self->icons[self->nicons-1].height,
-                                       &self->icons[self->nicons-1].data)) {
+            if (!RrPixmapToRGBA(ob_rr_inst,
+                                data[0], data[1],
+                                &self->icons[self->nicons-1].width,
+                                &self->icons[self->nicons-1].height,
+                                &self->icons[self->nicons-1].data)) {
                 g_free(&self->icons[self->nicons-1]);
                 self->nicons--;
             }
@@ -1373,12 +1374,13 @@ void client_update_icons(Client *self)
                 self->nicons++;
                 self->icons = g_new(Icon, self->nicons);
                 xerror_set_ignore(TRUE);
-                if (!render_pixmap_to_rgba(hints->icon_pixmap,
-                                           (hints->flags & IconMaskHint ?
-                                            hints->icon_mask : None),
-                                           &self->icons[self->nicons-1].width,
-                                           &self->icons[self->nicons-1].height,
-                                           &self->icons[self->nicons-1].data)){
+                if (!RrPixmapToRGBA(ob_rr_inst,
+                                    hints->icon_pixmap,
+                                    (hints->flags & IconMaskHint ?
+                                     hints->icon_mask : None),
+                                    &self->icons[self->nicons-1].width,
+                                    &self->icons[self->nicons-1].height,
+                                    &self->icons[self->nicons-1].data)){
                     g_free(&self->icons[self->nicons-1]);
                     self->nicons--;
                 }
index 82efe0718075dc54ef53a34780f6a859a0256946..3fb9c78d8914b9fc175e2ba815d8e965e83c12f9 100644 (file)
@@ -28,10 +28,11 @@ void dock_startup()
     attrib.event_mask = DOCK_EVENT_MASK;
     attrib.override_redirect = True;
     dock->frame = XCreateWindow(ob_display, ob_root, 0, 0, 1, 1, 0,
-                                render_depth, InputOutput, render_visual,
+                                RrDepth(ob_rr_inst), InputOutput,
+                                RrVisual(ob_rr_inst),
                                 CWOverrideRedirect | CWEventMask,
                                 &attrib);
-    dock->a_frame = appearance_copy(theme_a_unfocused_title);
+    dock->a_frame = RrAppearanceCopy(theme_a_unfocused_title);
     XSetWindowBorder(ob_display, dock->frame, theme_b_color->pixel);
     XSetWindowBorderWidth(ob_display, dock->frame, theme_bwidth);
 
@@ -43,7 +44,7 @@ void dock_startup()
 void dock_shutdown()
 {
     XDestroyWindow(ob_display, dock->frame);
-    appearance_free(dock->a_frame);
+    RrAppearanceFree(dock->a_frame);
     g_hash_table_remove(window_map, &dock->frame);
     stacking_remove(dock);
 }
@@ -352,7 +353,7 @@ void dock_configure()
         XMoveResizeWindow(ob_display, dock->frame,
                           dock->x, dock->y, dock->w, dock->h);
 
-        paint(dock->frame, dock->a_frame, dock->w, dock->h);
+        RrPaint(dock->a_frame, dock->frame, dock->w, dock->h);
         XMapWindow(ob_display, dock->frame);
     } else
         XUnmapWindow(ob_display, dock->frame);
index 2b6dc4d2fdf28202ba2241aedfff7b98145acb76..d70519a3e3a837a304aa9c2c993246d0c2dec64a 100644 (file)
@@ -27,7 +27,7 @@ typedef struct Dock {
     ObWindow obwin;
 
     Window frame;
-    Appearance *a_frame;
+    RrAppearance *a_frame;
 
     /* actual position (when not auto-hidden) */
     int x, y;
index b47d064be7869d25c7de069ade2356a1a9300653..4307c98a292062712b676d3a86f138bbf825efaf 100644 (file)
@@ -24,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);
                        
 }
 
@@ -96,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;
@@ -112,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);
 
index 3d395342f21ea97a33a4f980183c65b2a528cafa..bfce4a7d266233a2f4349bc7cb287adf2b059cf0 100644 (file)
@@ -50,13 +50,13 @@ typedef struct Frame {
     Window lgrip;
     Window rgrip;
 
-    Appearance *a_unfocused_title;
-    Appearance *a_focused_title;
-    Appearance *a_unfocused_label;
-    Appearance *a_focused_label;
-    Appearance *a_icon;
-    Appearance *a_unfocused_handle;
-    Appearance *a_focused_handle;
+    RrAppearance *a_unfocused_title;
+    RrAppearance *a_focused_title;
+    RrAppearance *a_unfocused_label;
+    RrAppearance *a_focused_label;
+    RrAppearance *a_icon;
+    RrAppearance *a_unfocused_handle;
+    RrAppearance *a_focused_handle;
 
     Strut  innersize;
 
index d5d3ac8daa943e8af97e3fd8050e03ff07677ef2..0781c8c7afbeb5964d855dbc553cf55e4c802ff9 100644 (file)
@@ -4,13 +4,13 @@
 #include "framerender.h"
 #include "render/theme.h"
 
-static void framerender_label(Frame *self, Appearance *a);
-static void framerender_icon(Frame *self, Appearance *a);
-static void framerender_max(Frame *self, Appearance *a);
-static void framerender_iconify(Frame *self, Appearance *a);
-static void framerender_desk(Frame *self, Appearance *a);
-static void framerender_shade(Frame *self, Appearance *a);
-static void framerender_close(Frame *self, Appearance *a);
+static void framerender_label(Frame *self, RrAppearance *a);
+static void framerender_icon(Frame *self, RrAppearance *a);
+static void framerender_max(Frame *self, RrAppearance *a);
+static void framerender_iconify(Frame *self, RrAppearance *a);
+static void framerender_desk(Frame *self, RrAppearance *a);
+static void framerender_shade(Frame *self, RrAppearance *a);
+static void framerender_close(Frame *self, RrAppearance *a);
 
 void framerender_frame(Frame *self)
 {
@@ -22,7 +22,7 @@ void framerender_frame(Frame *self)
                          theme_cb_unfocused_color->pixel);
 
     if (self->client->decorations & Decor_Titlebar) {
-        Appearance *t, *l, *m, *n, *i, *d, *s, *c;
+        RrAppearance *t, *l, *m, *n, *i, *d, *s, *c;
 
         t = (self->focused ?
              self->a_focused_title : self->a_unfocused_title);
@@ -76,7 +76,7 @@ void framerender_frame(Frame *self)
               theme_a_unfocused_pressed_close :
               theme_a_unfocused_unpressed_close));
 
-        paint(self->title, t, self->width, theme_title_height);
+        RrPaint(t, self->title, self->width, theme_title_height);
 
         /* set parents for any parent relative guys */
         l->surface.parent = t;
@@ -117,82 +117,82 @@ void framerender_frame(Frame *self)
     }
 
     if (self->client->decorations & Decor_Handle) {
-        Appearance *h, *g;
+        RrAppearance *h, *g;
 
         h = (self->focused ?
              self->a_focused_handle : self->a_unfocused_handle);
 
-        paint(self->handle, h, self->width, theme_handle_height);
+        RrPaint(h, self->handle, self->width, theme_handle_height);
 
         g = (self->focused ?
              theme_a_focused_grip : theme_a_unfocused_grip);
 
-        if (g->surface.grad == Background_ParentRelative)
+        if (g->surface.grad == RR_SURFACE_PARENTREL)
             g->surface.parent = h;
 
         g->surface.parentx = 0;
         g->surface.parenty = 0;
 
-        paint(self->lgrip, g, theme_grip_width, theme_handle_height);
+        RrPaint(g, self->lgrip, theme_grip_width, theme_handle_height);
 
         g->surface.parentx = self->width - theme_grip_width;
         g->surface.parenty = 0;
 
-        paint(self->rgrip, g, theme_grip_width, theme_handle_height);
+        RrPaint(g, self->rgrip, theme_grip_width, theme_handle_height);
     }
 }
 
-static void framerender_label(Frame *self, Appearance *a)
+static void framerender_label(Frame *self, RrAppearance *a)
 {
     if (self->label_x < 0) return;
     /* set the texture's text! */
     a->texture[0].data.text.string = self->client->title;
-    paint(self->label, a, self->label_width, theme_label_height);
+    RrPaint(a, self->label, self->label_width, theme_label_height);
 }
 
-static void framerender_icon(Frame *self, Appearance *a)
+static void framerender_icon(Frame *self, RrAppearance *a)
 {
     if (self->icon_x < 0) return;
 
     if (self->client->nicons) {
         Icon *icon = client_icon(self->client,
                                  theme_button_size + 2, theme_button_size + 2);
-        a->texture[0].type = RGBA;
+        a->texture[0].type = RR_TEXTURE_RGBA;
         a->texture[0].data.rgba.width = icon->width;
         a->texture[0].data.rgba.height = icon->height;
         a->texture[0].data.rgba.data = icon->data;
     } else
-        a->texture[0].type = NoTexture;
+        a->texture[0].type = RR_TEXTURE_NONE;
 
-    paint(self->icon, a, theme_button_size + 2, theme_button_size + 2);
+    RrPaint(a, self->icon, theme_button_size + 2, theme_button_size + 2);
 }
 
-static void framerender_max(Frame *self, Appearance *a)
+static void framerender_max(Frame *self, RrAppearance *a)
 {
     if (self->max_x < 0) return;
-    paint(self->max, a, theme_button_size, theme_button_size);
+    RrPaint(a, self->max, theme_button_size, theme_button_size);
 }
 
-static void framerender_iconify(Frame *self, Appearance *a)
+static void framerender_iconify(Frame *self, RrAppearance *a)
 {
     if (self->iconify_x < 0) return;
-    paint(self->iconify, a, theme_button_size, theme_button_size);
+    RrPaint(a, self->iconify, theme_button_size, theme_button_size);
 }
 
-static void framerender_desk(Frame *self, Appearance *a)
+static void framerender_desk(Frame *self, RrAppearance *a)
 {
     if (self->desk_x < 0) return;
-    paint(self->desk, a, theme_button_size, theme_button_size);
+    RrPaint(a, self->desk, theme_button_size, theme_button_size);
 }
 
-static void framerender_shade(Frame *self, Appearance *a)
+static void framerender_shade(Frame *self, RrAppearance *a)
 {
     if (self->shade_x < 0) return;
-    paint(self->shade, a, theme_button_size, theme_button_size);
+    RrPaint(a, self->shade, theme_button_size, theme_button_size);
 }
 
-static void framerender_close(Frame *self, Appearance *a)
+static void framerender_close(Frame *self, RrAppearance *a)
 {
     if (self->close_x < 0) return;
-    paint(self->close, a, theme_button_size, theme_button_size);
+    RrPaint(a, self->close, theme_button_size, theme_button_size);
 }
index 2af1a01f2f791e78f91ae273c84939193109ebed..862917685a2d70eea83db54270e197dc265525ee 100644 (file)
@@ -39,7 +39,7 @@ void menu_destroy_hash_value(Menu *self)
 
     stacking_remove(self);
 
-    appearance_free(self->a_title);
+    RrAppearanceFree(self->a_title);
     XDestroyWindow(ob_display, self->title);
     XDestroyWindow(ob_display, self->frame);
     XDestroyWindow(ob_display, self->items);
@@ -54,9 +54,9 @@ void menu_entry_free(MenuEntry *self)
 
     g_hash_table_remove(window_map, &self->item);
 
-    appearance_free(self->a_item);
-    appearance_free(self->a_disabled);
-    appearance_free(self->a_hilite);
+    RrAppearanceFree(self->a_item);
+    RrAppearanceFree(self->a_disabled);
+    RrAppearanceFree(self->a_hilite);
     XDestroyWindow(ob_display, self->item);
 
     g_free(self);
@@ -125,8 +125,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);
                        
 }
 
@@ -173,8 +173,8 @@ Menu *menu_new_full(char *label, char *name, Menu *parent,
     XMapWindow(ob_display, self->title);
     XMapWindow(ob_display, self->items);
 
-    self->a_title = appearance_copy(theme_a_menu_title);
-    self->a_items = appearance_copy(theme_a_menu);
+    self->a_title = RrAppearanceCopy(theme_a_menu_title);
+    self->a_items = RrAppearanceCopy(theme_a_menu);
 
     g_hash_table_insert(window_map, &self->frame, self);
     g_hash_table_insert(window_map, &self->title, self);
@@ -234,9 +234,9 @@ void menu_add_entry(Menu *menu, MenuEntry *entry)
     attrib.event_mask = ENTRY_EVENTMASK;
     entry->item = createWindow(menu->items, CWEventMask, &attrib);
     XMapWindow(ob_display, entry->item);
-    entry->a_item = appearance_copy(theme_a_menu_item);
-    entry->a_disabled = appearance_copy(theme_a_menu_disabled);
-    entry->a_hilite = appearance_copy(theme_a_menu_hilite);
+    entry->a_item = RrAppearanceCopy(theme_a_menu_item);
+    entry->a_disabled = RrAppearanceCopy(theme_a_menu_disabled);
+    entry->a_hilite = RrAppearanceCopy(theme_a_menu_hilite);
 
     menu->invalid = TRUE;
 
index 49a79fb4d266ccd2bc8cb126201375372d1882d9..7b0fb678ec63b7fdb49b38b07d4b8b20f7341f82 100644 (file)
@@ -46,10 +46,10 @@ typedef struct Menu {
     Client *client;
     Window frame;
     Window title;
-    Appearance *a_title;
+    RrAppearance *a_title;
     int title_min_w, title_h;
     Window items;
-    Appearance *a_items;
+    RrAppearance *a_items;
     int bullet_w;
     int item_h;
     Point location;
@@ -84,9 +84,9 @@ typedef struct {
 
     /* render stuff */
     Window item;
-    Appearance *a_item;
-    Appearance *a_disabled;
-    Appearance *a_hilite;
+    RrAppearance *a_item;
+    RrAppearance *a_disabled;
+    RrAppearance *a_hilite;
     int y;
     int min_w;
 } MenuEntry;
index a03f2caab526f78026e9513c02cc845450eb89c9..55819cd4c50a4be7ac807134cb001439483fe75f 100644 (file)
@@ -29,7 +29,7 @@ void menu_render_full(Menu *self) {
     /* set texture data and size them mofos out */
     if (self->label) {
        self->a_title->texture[0].data.text.string = self->label;
-       appearance_minsize(self->a_title, &self->title_min_w, &self->title_h);
+       RrMinsize(self->a_title, &self->title_min_w, &self->title_h);
        self->title_min_w += theme_bevel * 2;
        self->title_h += theme_bevel * 2;
        self->size.width = MAX(self->size.width, self->title_min_w);
@@ -40,16 +40,16 @@ void menu_render_full(Menu *self) {
         int h;
 
         e->a_item->texture[0].data.text.string = e->label;
-        appearance_minsize(e->a_item, &e->min_w, &self->item_h);
+        RrMinsize(e->a_item, &e->min_w, &self->item_h);
         self->size.width = MAX(self->size.width, e->min_w);
 
         e->a_disabled->texture[0].data.text.string = e->label;
-        appearance_minsize(e->a_disabled, &e->min_w, &h);
+        RrMinsize(e->a_disabled, &e->min_w, &h);
         self->item_h = MAX(self->item_h, h);
         self->size.width = MAX(self->size.width, e->min_w);
        
         e->a_hilite->texture[0].data.text.string = e->label;
-        appearance_minsize(e->a_hilite, &e->min_w, &h);
+        RrMinsize(e->a_hilite, &e->min_w, &h);
         self->item_h = MAX(self->item_h, h);
         self->size.width = MAX(self->size.width, e->min_w);
 
@@ -72,8 +72,8 @@ void menu_render_full(Menu *self) {
                      items_h);
 
     if (self->label)
-       paint(self->title, self->a_title, self->size.width, self->title_h);
-    paint(self->items, self->a_items, self->size.width, items_h);
+       RrPaint(self->a_title, self->title, self->size.width, self->title_h);
+    RrPaint(self->a_items, self->items, self->size.width, items_h);
 
     item_y = 0;
     for (it = self->entries; it; it = it->next) {
@@ -89,7 +89,7 @@ void menu_render_full(Menu *self) {
 void menu_entry_render(MenuEntry *self)
 {
     Menu *menu = self->parent;
-    Appearance *a;
+    RrAppearance *a;
     
     switch (self->render_type) {
     case MenuEntryRenderType_Submenu:
@@ -123,5 +123,5 @@ void menu_entry_render(MenuEntry *self)
     a->surface.parentx = 0;
     a->surface.parenty = self->y;
 
-    paint(self->item, a, menu->size.width, menu->item_h);
+    RrPaint(a, self->item, menu->size.width, menu->item_h);
 }
index 871e96536f6e4867d8c850a0029560dbee69ab0f..4b1ee6ea0db8995a30bdce42d5687ae02d456a79 100644 (file)
@@ -53,7 +53,8 @@ void moveresize_startup()
 
     attrib.save_under = True;
     opaque_window.win = XCreateWindow(ob_display, ob_root, 0, 0, 1, 1, 0,
-                                      render_depth, InputOutput, render_visual,
+                                      RrDepth(ob_rr_inst), InputOutput,
+                                      RrVisual(ob_rr_inst),
                                       CWSaveUnder, &attrib);
     stacking_add(INTERNAL_AS_WINDOW(&opaque_window));
     stacking_raise(INTERNAL_AS_WINDOW(&opaque_window));
index 0455e88c523406e929a1aba28a4745d89550b72a..6cde2c0e0d70dce042e27a8ad8ee89572e4521a6 100644 (file)
 
 #include <X11/cursorfont.h>
 
-Display *ob_display  = NULL;
-int      ob_screen;
-Window   ob_root;
-State    ob_state;
-gboolean ob_shutdown = FALSE;
-gboolean ob_restart  = FALSE;
-char    *ob_restart_path = NULL;
-gboolean ob_remote   = TRUE;
-gboolean ob_sync     = FALSE;
-Cursors  ob_cursors;
-char    *ob_rc_path  = NULL;
+RrInstance *ob_rr_inst = NULL;
+Display    *ob_display = NULL;
+int         ob_screen;
+Window      ob_root;
+State       ob_state;
+gboolean    ob_shutdown = FALSE;
+gboolean    ob_restart  = FALSE;
+char       *ob_restart_path = NULL;
+gboolean    ob_remote   = TRUE;
+gboolean    ob_sync     = FALSE;
+Cursors     ob_cursors;
+char       *ob_rc_path  = NULL;
 
 void signal_handler(const ObEvent *e, void *data);
 void parse_args(int argc, char **argv);
@@ -128,6 +129,12 @@ int main(int argc, char **argv)
     ob_screen = DefaultScreen(ob_display);
     ob_root = RootWindow(ob_display, ob_screen);
 
+    ob_rr_inst = RrInstanceNew(ob_display, ob_screen);
+    if (ob_rr_inst == NULL) {
+        g_critical("Failed to initialize the render library.");
+        exit(1);
+    }
+
     /* XXX fork self onto other screens */
      
     XSynchronize(ob_display, ob_sync);
@@ -170,9 +177,8 @@ int main(int argc, char **argv)
         /* anything that is going to read data from the rc file needs to be 
            in this group */
        timer_startup();
-       render_startup();
        font_startup();
-        theme_startup();
+        theme_startup(ob_rr_inst);
        event_startup();
         grab_startup();
         plugin_startup();
@@ -229,13 +235,13 @@ int main(int argc, char **argv)
         grab_shutdown();
        event_shutdown();
         theme_shutdown();
-       render_shutdown();
        timer_shutdown();
         config_shutdown();
     }
 
     dispatch_shutdown();
 
+    RrInstanceFree(ob_rr_inst);
     XCloseDisplay(ob_display);
 
     if (ob_restart) {
index 51f620793d6ee7c3043d20a42052ce3a41b2ff3b..eec3fd7c37d312ee9bd079908e64745c906d4078 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef __openbox_h
 #define __openbox_h
 
+#include "render/render.h"
+
 #ifdef USE_LIBSN
 #  define SN_API_NOT_YET_FROZEN
 #  include <libsn/sn.h>
@@ -9,6 +11,8 @@
 #include <glib.h>
 #include <X11/Xlib.h>
 
+extern RrInstance *ob_rr_inst;
+
 /*! The X display */
 extern Display *ob_display; 
 
index 48c40f28a0b985e08fa76ea1afca0efa8fac3bc4..2e65570e518634cf3ecd74d8244d5eb48fd6d4a6 100644 (file)
@@ -13,9 +13,9 @@ typedef struct Popup {
     Window text;
 
     gboolean hasicon;
-    Appearance *a_bg;
-    Appearance *a_icon;
-    Appearance *a_text;
+    RrAppearance *a_bg;
+    RrAppearance *a_icon;
+    RrAppearance *a_text;
     int gravity;
     int x;
     int y;
@@ -45,12 +45,12 @@ void popup_free(Popup *self)
         XDestroyWindow(ob_display, self->bg);
         XDestroyWindow(ob_display, self->text);
         XDestroyWindow(ob_display, self->icon);
-        appearance_free(self->a_bg);
+        RrAppearanceFree(self->a_bg);
         if (self->hasicon)
-            appearance_free(self->a_icon);
+            RrAppearanceFree(self->a_icon);
     }
     if (self->a_text)
-        appearance_free(self->a_text);
+        RrAppearanceFree(self->a_text);
     stacking_remove(self);
     g_free(self);
 }
@@ -74,10 +74,10 @@ void popup_size_to_string(Popup *self, char *text)
     int iconw;
 
     if (!self->a_text)
-        self->a_text = appearance_copy(theme_app_hilite_label);
+        self->a_text = RrAppearanceCopy(theme_app_hilite_label);
 
     self->a_text->texture[0].data.text.string = text;
-    appearance_minsize(self->a_text, &textw, &texth);
+    RrMinsize(self->a_text, &textw, &texth);
     textw += theme_bevel * 2;
     texth += theme_bevel * 2;
 
@@ -97,45 +97,46 @@ void popup_show(Popup *self, char *text, Icon *icon)
     if (!self->bg) {
         attrib.override_redirect = True;
         self->bg = XCreateWindow(ob_display, ob_root,
-                                 0, 0, 1, 1, 0, render_depth, InputOutput,
-                                 render_visual, CWOverrideRedirect, &attrib);
+                                 0, 0, 1, 1, 0, RrDepth(ob_rr_inst),
+                                 InputOutput, RrVisual(ob_rr_inst),
+                                 CWOverrideRedirect, &attrib);
 
         XSetWindowBorderWidth(ob_display, self->bg, theme_bwidth);
         XSetWindowBorder(ob_display, self->bg, theme_b_color->pixel);
 
         self->text = XCreateWindow(ob_display, self->bg,
-                                   0, 0, 1, 1, 0, render_depth, InputOutput,
-                                   render_visual, 0, NULL);
+                                   0, 0, 1, 1, 0, RrDepth(ob_rr_inst),
+                                   InputOutput, RrVisual(ob_rr_inst), 0, NULL);
         if (self->hasicon)
             self->icon = XCreateWindow(ob_display, self->bg,
                                        0, 0, 1, 1, 0,
-                                       render_depth, InputOutput,
-                                       render_visual, 0, NULL);
+                                       RrDepth(ob_rr_inst), InputOutput,
+                                       RrVisual(ob_rr_inst), 0, NULL);
 
         XMapWindow(ob_display, self->text);
         XMapWindow(ob_display, self->icon);
 
-        self->a_bg = appearance_copy(theme_app_hilite_bg);
+        self->a_bg = RrAppearanceCopy(theme_app_hilite_bg);
         if (self->hasicon)
-            self->a_icon = appearance_copy(theme_app_icon);
+            self->a_icon = RrAppearanceCopy(theme_app_icon);
     }
     if (!self->a_text)
-        self->a_text = appearance_copy(theme_app_hilite_label);
+        self->a_text = RrAppearanceCopy(theme_app_hilite_label);
 
     /* set up the textures */
     self->a_text->texture[0].data.text.string = text;
     if (self->hasicon) {
         if (icon) {
-            self->a_icon->texture[0].type = RGBA;
+            self->a_icon->texture[0].type = RR_TEXTURE_RGBA;
             self->a_icon->texture[0].data.rgba.width = icon->width;
             self->a_icon->texture[0].data.rgba.height = icon->height;
             self->a_icon->texture[0].data.rgba.data = icon->data;
         } else
-            self->a_icon->texture[0].type = NoTexture;
+            self->a_icon->texture[0].type = RR_TEXTURE_NONE;
     }
 
     /* measure the shit out */
-    appearance_minsize(self->a_text, &textw, &texth);
+    RrMinsize(self->a_text, &textw, &texth);
     textw += theme_bevel * 2;
     texth += theme_bevel * 2;
 
@@ -208,10 +209,10 @@ void popup_show(Popup *self, char *text, Icon *icon)
                           theme_bevel, theme_bevel, iconw, texth);
     }
 
-    paint(self->bg, self->a_bg, w, h);
-    paint(self->text, self->a_text, textw, texth);
+    RrPaint(self->a_bg, self->bg, w, h);
+    RrPaint(self->a_text, self->text, textw, texth);
     if (self->hasicon)
-        paint(self->icon, self->a_icon, iconw, texth);
+        RrPaint(self->a_icon, self->icon, iconw, texth);
 
     if (!self->mapped) {
         XMapWindow(ob_display, self->bg);
index 85bf036d44b488f13a62e3fb659721507bffe07b..d438a8000114e67192672eddd0ff16f0ae71c373 100644 (file)
@@ -484,17 +484,17 @@ void screen_install_colormap(Client *client, gboolean install)
 
     if (client == NULL) {
        if (install)
-           XInstallColormap(ob_display, render_colormap);
+           XInstallColormap(RrDisplay(ob_rr_inst), RrColormap(ob_rr_inst));
        else
-           XUninstallColormap(ob_display, render_colormap);
+           XUninstallColormap(RrDisplay(ob_rr_inst), RrColormap(ob_rr_inst));
     } else {
        if (XGetWindowAttributes(ob_display, client->window, &wa) &&
             wa.colormap != None) {
             xerror_set_ignore(TRUE);
            if (install)
-               XInstallColormap(ob_display, wa.colormap);
+               XInstallColormap(RrDisplay(ob_rr_inst), wa.colormap);
            else
-               XUninstallColormap(ob_display, wa.colormap);
+               XUninstallColormap(RrDisplay(ob_rr_inst), wa.colormap);
             xerror_set_ignore(FALSE);
        }
     }
This page took 0.056005 seconds and 4 git commands to generate.