namespace ob {
-OBBackgroundWidget::OBBackgroundWidget(otk::OtkWidget *parent,
- OBWidget::WidgetType type)
- : otk::OtkWidget(parent),
- OBWidget(type)
+BackgroundWidget::BackgroundWidget(otk::Widget *parent,
+ WidgetBase::WidgetType type)
+ : otk::Widget(parent),
+ WidgetBase(type)
{
}
-OBBackgroundWidget::~OBBackgroundWidget()
+BackgroundWidget::~BackgroundWidget()
{
}
-void OBBackgroundWidget::setTextures()
+void BackgroundWidget::setTextures()
{
switch (type()) {
case Type_Titlebar:
if (_focused)
- setTexture(_style->getTitleFocus());
+ setTexture(_style->titlebarFocusBackground());
else
- setTexture(_style->getTitleUnfocus());
+ setTexture(_style->titlebarUnfocusBackground());
break;
case Type_Handle:
if (_focused)
- setTexture(_style->getHandleFocus());
+ setTexture(_style->handleFocusBackground());
else
- setTexture(_style->getHandleUnfocus());
+ setTexture(_style->handleUnfocusBackground());
break;
case Type_Plate:
if (_focused)
- setBorderColor(&_style->getFrameFocus()->color());
+ setBorderColor(_style->clientBorderFocusColor());
else
- setBorderColor(&_style->getFrameUnfocus()->color());
+ setBorderColor(_style->clientBorderUnfocusColor());
break;
default:
assert(false); // there's no other background widgets!
}
-void OBBackgroundWidget::setStyle(otk::Style *style)
+void BackgroundWidget::setStyle(otk::RenderStyle *style)
{
- OtkWidget::setStyle(style);
+ Widget::setStyle(style);
setTextures();
switch (type()) {
case Type_Titlebar:
case Type_Handle:
- setBorderColor(_style->getBorderColor());
+ setBorderColor(_style->frameBorderColor());
break;
case Type_Plate:
break;
}
-void OBBackgroundWidget::focus()
+void BackgroundWidget::focus()
{
- otk::OtkWidget::focus();
+ otk::Widget::focus();
setTextures();
}
-void OBBackgroundWidget::unfocus()
+void BackgroundWidget::unfocus()
{
- otk::OtkWidget::unfocus();
+ otk::Widget::unfocus();
setTextures();
}
-void OBBackgroundWidget::adjust()
+void BackgroundWidget::adjust()
{
- // nothing to adjust here. its done in OBFrame::adjustSize
-}
-
-void OBBackgroundWidget::grabButtons(bool grab)
-{
- if (grab) {
- // grab simple button clicks on the client, but pass them through too
- otk::OBDisplay::grabButton(Button1, 0, _window, true,
- ButtonPressMask, GrabModeSync, GrabModeSync,
- _window, None, false);
- otk::OBDisplay::grabButton(Button2, 0, _window, true,
- ButtonPressMask, GrabModeSync, GrabModeSync,
- _window, None, false);
- otk::OBDisplay::grabButton(Button3, 0, _window, true,
- ButtonPressMask, GrabModeSync, GrabModeSync,
- _window, None, false);
- otk::OBDisplay::grabButton(Button4, 0, _window, true,
- ButtonPressMask, GrabModeSync, GrabModeSync,
- _window, None, false);
- otk::OBDisplay::grabButton(Button5, 0, _window, true,
- ButtonPressMask, GrabModeSync, GrabModeSync,
- _window, None, false);
- } else {
- otk::OBDisplay::ungrabButton(Button1, 0, _window);
- otk::OBDisplay::ungrabButton(Button2, 0, _window);
- otk::OBDisplay::ungrabButton(Button3, 0, _window);
- otk::OBDisplay::ungrabButton(Button4, 0, _window);
- otk::OBDisplay::ungrabButton(Button5, 0, _window);
- }
-}
-
-void OBBackgroundWidget::buttonPressHandler(const XButtonEvent &e)
-{
- XAllowEvents(otk::OBDisplay::display, ReplayPointer, e.time);
+ // nothing to adjust here. its done in Frame::adjustSize
}
}