+void Frame::renderMax()
+{
+ if (!(_decorations & Client::Decor_Maximize)) return;
+ bool press = _max_press || _client->maxVert() || _client->maxHorz();
+ renderButton(_client->screen(), _client->focused(), press, _max,
+ &_max_sur, geom.button_size,
+ otk::RenderStyle::style(_client->screen())->maximizeMask(),
+ geom.max_x, (geom.bevel + 1), _title_sur);
+}
+
+void Frame::renderDesk()
+{
+ if (!(_decorations & Client::Decor_AllDesktops)) return;
+ bool press = _desk_press || _client->desktop() == 0xffffffff;
+ renderButton(_client->screen(), _client->focused(), press, _desk,
+ &_desk_sur, geom.button_size,
+ otk::RenderStyle::style(_client->screen())->alldesktopsMask(),
+ geom.desktop_x, (geom.bevel + 1), _title_sur);
+}
+
+void Frame::renderIconify()
+{
+ if (!(_decorations & Client::Decor_Iconify)) return;
+ renderButton(_client->screen(), _client->focused(), _iconify_press, _iconify,
+ &_iconify_sur, geom.button_size,
+ otk::RenderStyle::style(_client->screen())->iconifyMask(),
+ geom.iconify_x, (geom.bevel + 1), _title_sur);
+}
+
+void Frame::renderClose()
+{
+ if (!(_decorations & Client::Decor_Close)) return;
+ renderButton(_client->screen(), _client->focused(), _close_press, _close,
+ &_close_sur, geom.button_size,
+ otk::RenderStyle::style(_client->screen())->closeMask(),
+ geom.close_x, (geom.bevel + 1), _title_sur);
+}
+
+void Frame::renderIcon()
+{
+ if (!(_decorations & Client::Decor_Icon)) return;
+ const int screen = _client->screen();
+ const otk::RenderControl *control = otk::display->renderControl(screen);
+
+ otk::Surface *s = new otk::Surface(screen, otk::Size(geom.button_size,
+ geom.button_size));
+ otk::pixel32 *dest = s->pixelData(), *src;
+ int w = _title_sur->size().width();
+
+ src = _title_sur->pixelData() + w * (geom.bevel + 1) + geom.icon_x;
+
+ // get the background under the icon button
+ for (int y = 0; y < geom.button_size; ++y, src += w - geom.button_size)
+ for (int x = 0; x < geom.button_size; ++x, ++dest, ++src)
+ *dest = *src;
+ // draw the icon over it
+ const Icon *icon = _client->icon(otk::Size(geom.button_size,
+ geom.button_size));
+ control->drawImage(*s, icon->w, icon->h, icon->data);
+ if (!icon->data) {
+ Pixmap p = _client->pixmapIcon(), m = _client->pixmapIconMask();
+ if (p != None)
+ control->drawImage(*s, p, m);
+ }