From: Dana Jansens Date: Sat, 21 Jun 2003 00:42:47 +0000 (+0000) Subject: fixed to accomodate the changes to the render/ API. X-Git-Url: https://git.dogcows.com/gitweb?a=commitdiff_plain;h=a4a0cb78294bb1809b836ea1e86e9d7294bb2929;p=chaz%2Fopenbox fixed to accomodate the changes to the render/ API. --- diff --git a/openbox/client.c b/openbox/client.c index 24930909..d7a99def 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -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--; } diff --git a/openbox/dock.c b/openbox/dock.c index 82efe071..3fb9c78d 100644 --- a/openbox/dock.c +++ b/openbox/dock.c @@ -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); diff --git a/openbox/dock.h b/openbox/dock.h index 2b6dc4d2..d70519a3 100644 --- a/openbox/dock.h +++ b/openbox/dock.h @@ -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; diff --git a/openbox/frame.c b/openbox/frame.c index b47d064b..4307c98a 100644 --- a/openbox/frame.c +++ b/openbox/frame.c @@ -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); diff --git a/openbox/frame.h b/openbox/frame.h index 3d395342..bfce4a7d 100644 --- a/openbox/frame.h +++ b/openbox/frame.h @@ -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; diff --git a/openbox/framerender.c b/openbox/framerender.c index d5d3ac8d..0781c8c7 100644 --- a/openbox/framerender.c +++ b/openbox/framerender.c @@ -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); } diff --git a/openbox/menu.c b/openbox/menu.c index 2af1a01f..86291768 100644 --- a/openbox/menu.c +++ b/openbox/menu.c @@ -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; diff --git a/openbox/menu.h b/openbox/menu.h index 49a79fb4..7b0fb678 100644 --- a/openbox/menu.h +++ b/openbox/menu.h @@ -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; diff --git a/openbox/menu_render.c b/openbox/menu_render.c index a03f2caa..55819cd4 100644 --- a/openbox/menu_render.c +++ b/openbox/menu_render.c @@ -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); } diff --git a/openbox/moveresize.c b/openbox/moveresize.c index 871e9653..4b1ee6ea 100644 --- a/openbox/moveresize.c +++ b/openbox/moveresize.c @@ -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)); diff --git a/openbox/openbox.c b/openbox/openbox.c index 0455e88c..6cde2c0e 100644 --- a/openbox/openbox.c +++ b/openbox/openbox.c @@ -45,17 +45,18 @@ #include -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) { diff --git a/openbox/openbox.h b/openbox/openbox.h index 51f62079..eec3fd7c 100644 --- a/openbox/openbox.h +++ b/openbox/openbox.h @@ -1,6 +1,8 @@ #ifndef __openbox_h #define __openbox_h +#include "render/render.h" + #ifdef USE_LIBSN # define SN_API_NOT_YET_FROZEN # include @@ -9,6 +11,8 @@ #include #include +extern RrInstance *ob_rr_inst; + /*! The X display */ extern Display *ob_display; diff --git a/openbox/popup.c b/openbox/popup.c index 48c40f28..2e65570e 100644 --- a/openbox/popup.c +++ b/openbox/popup.c @@ -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); diff --git a/openbox/screen.c b/openbox/screen.c index 85bf036d..d438a800 100644 --- a/openbox/screen.c +++ b/openbox/screen.c @@ -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); } }