1 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
4 # include "../config.h"
7 #include "backgroundwidget.hh"
11 OBBackgroundWidget::OBBackgroundWidget(otk::OtkWidget *parent,
12 OBWidget::WidgetType type)
13 : otk::OtkWidget(parent),
19 OBBackgroundWidget::~OBBackgroundWidget()
24 void OBBackgroundWidget::setTextures()
29 setTexture(_style->getTitleFocus());
31 setTexture(_style->getTitleUnfocus());
35 setTexture(_style->getHandleFocus());
37 setTexture(_style->getHandleUnfocus());
41 setBorderColor(&_style->getFrameFocus()->color());
43 setBorderColor(&_style->getFrameUnfocus()->color());
46 assert(false); // there's no other background widgets!
51 void OBBackgroundWidget::setStyle(otk::Style *style)
53 OtkWidget::setStyle(style);
58 setBorderColor(_style->getBorderColor());
63 assert(false); // there's no other background widgets!
68 void OBBackgroundWidget::focus()
70 otk::OtkWidget::focus();
75 void OBBackgroundWidget::unfocus()
77 otk::OtkWidget::unfocus();
82 void OBBackgroundWidget::adjust()
84 // nothing to adjust here. its done in OBFrame::adjustSize
87 void OBBackgroundWidget::grabButtons(bool grab)
90 // grab simple button clicks on the client, but pass them through too
91 otk::OBDisplay::grabButton(Button1, 0, _window, true,
92 ButtonPressMask, GrabModeSync, GrabModeSync,
93 _window, None, false);
94 otk::OBDisplay::grabButton(Button2, 0, _window, true,
95 ButtonPressMask, GrabModeSync, GrabModeSync,
96 _window, None, false);
97 otk::OBDisplay::grabButton(Button3, 0, _window, true,
98 ButtonPressMask, GrabModeSync, GrabModeSync,
99 _window, None, false);
100 otk::OBDisplay::grabButton(Button4, 0, _window, true,
101 ButtonPressMask, GrabModeSync, GrabModeSync,
102 _window, None, false);
103 otk::OBDisplay::grabButton(Button5, 0, _window, true,
104 ButtonPressMask, GrabModeSync, GrabModeSync,
105 _window, None, false);
107 otk::OBDisplay::ungrabButton(Button1, 0, _window);
108 otk::OBDisplay::ungrabButton(Button2, 0, _window);
109 otk::OBDisplay::ungrabButton(Button3, 0, _window);
110 otk::OBDisplay::ungrabButton(Button4, 0, _window);
111 otk::OBDisplay::ungrabButton(Button5, 0, _window);
115 void OBBackgroundWidget::buttonPressHandler(const XButtonEvent &e)
117 XAllowEvents(otk::OBDisplay::display, ReplayPointer, e.time);