X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fframerender.c;h=0781c8c7afbeb5964d855dbc553cf55e4c802ff9;hb=a4a0cb78294bb1809b836ea1e86e9d7294bb2929;hp=11092333263858fc6791373151b1db88f403337a;hpb=6e93be1d2e07ace0c21bc040cfb2e4890667d033;p=chaz%2Fopenbox diff --git a/openbox/framerender.c b/openbox/framerender.c index 11092333..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); + RrPaint(t, self->title, self->width, theme_title_height); /* set parents for any parent relative guys */ l->surface.parent = t; @@ -117,104 +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); + + 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; - paint(self->handle, h); - } else - paint(self->handle, h); g->surface.parentx = 0; g->surface.parenty = 0; - paint(self->lgrip, g); + 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); + 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; - RECT_SET(a->texture[0].position, 0, 0, - self->label_width, theme_label_height); - - paint(self->label, a); + 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; - RECT_SET(self->a_icon->texture[0].position, 0, 0, - theme_button_size + 2, theme_button_size + 2); } else - a->texture[0].type = NoTexture; + a->texture[0].type = RR_TEXTURE_NONE; - paint(self->icon, a); + 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; - - RECT_SET(a->texture[0].position, 0, 0, - theme_button_size, theme_button_size); - paint(self->max, a); + 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; - - RECT_SET(a->texture[0].position, 0, 0, - theme_button_size, theme_button_size); - paint(self->iconify, a); + 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; - - RECT_SET(a->texture[0].position, 0, 0, - theme_button_size, theme_button_size); - paint(self->desk, a); + 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; - - RECT_SET(a->texture[0].position, 0, 0, - theme_button_size, theme_button_size); - paint(self->shade, a); + 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; - - RECT_SET(a->texture[0].position, 0, 0, - theme_button_size, theme_button_size); - paint(self->close, a); + RrPaint(a, self->close, theme_button_size, theme_button_size); }