4 #include "framerender.h"
5 #include "render2/theme.h"
7 void framerender_frame(Frame *self)
9 /* XXX plate, client border */
11 if (self->client->decorations & Decor_Titlebar) {
12 struct RrSurface *t, *l, *m, *n, *i, *d, *s, *c;
15 ob_theme->title_f : ob_theme->title);
17 ob_theme->label_f : ob_theme->label);
19 (self->client->max_vert || self->client->max_horz ?
20 ob_theme->max_p_f : (self->max_press ?
21 ob_theme->max_p_f : ob_theme->max_f)) :
22 (self->client->max_vert || self->client->max_horz ?
23 ob_theme->max_p : (self->max_press ?
24 ob_theme->max_p : ob_theme->max)));
27 (self->iconify_press ?
28 ob_theme->iconify_p_f : ob_theme->iconify_f) :
29 (self->iconify_press ?
30 ob_theme->iconify_p : ob_theme->iconify));
32 (self->client->desktop == DESKTOP_ALL ?
33 ob_theme->desk_p_f : (self->desk_press ?
34 ob_theme->desk_p_f : ob_theme->desk_f)) :
35 (self->client->desktop == DESKTOP_ALL ?
36 ob_theme->desk_p : (self->desk_press ?
37 ob_theme->desk_p : ob_theme->desk)));
39 (self->client->shaded ?
40 ob_theme->shade_p_f : (self->shade_press ?
41 ob_theme->shade_p_f : ob_theme->shade_f)):
42 (self->client->shaded ?
43 ob_theme->shade_p : (self->shade_press ?
44 ob_theme->shade_p : ob_theme->shade)));
47 ob_theme->close_p_f : ob_theme->close_f) :
49 ob_theme->close_p : ob_theme->close));
51 RrSurfaceCopy(self->s_title, t);
52 RrSurfaceCopy(self->s_label, l);
54 RrTextureSetText(self->s_label, 0, ob_theme->title_font,
55 ob_theme->title_justify,
57 &ob_theme->title_color_f : &ob_theme->title_color),
60 if (self->icon_x >= 0) {
63 RrSurfaceCopy(self->s_icon, n);
65 icon = client_icon(self->client,
66 RrThemeButtonSize(ob_theme) + 2,
67 RrThemeButtonSize(ob_theme) + 2);
69 RrTextureSetRGBA(self->s_icon, 0,
71 0, 0, icon->width, icon->height);
73 RrTextureSetNone(self->s_icon, 0);
75 if (self->iconify_x >= 0)
76 RrSurfaceCopy(self->s_iconify, i);
77 if (self->desk_x >= 0)
78 RrSurfaceCopy(self->s_desk, d);
79 if (self->shade_x >= 0)
80 RrSurfaceCopy(self->s_shade, s);
81 if (self->close_x >= 0)
82 RrSurfaceCopy(self->s_close, c);
85 if (self->client->decorations & Decor_Handle) {
86 struct RrSurface *h, *g;
89 ob_theme->handle_f : ob_theme->handle);
91 ob_theme->grip_f : ob_theme->grip);
93 RrSurfaceCopy(self->s_handle, h);
94 RrSurfaceCopy(self->s_lgrip, g);
95 RrSurfaceCopy(self->s_rgrip, g);
97 /* XXX this could be more efficient */
98 RrPaint(self->s_frame);