#include <widget.hh>
Inheritance diagram for otk::Widget:


Public Types | |
| typedef std::list< Widget * > | WidgetList |
| enum | Direction { Horizontal, Vertical } |
Public Methods | |
| Widget (Widget *parent, Direction=Horizontal) | |
| Widget (EventDispatcher *event_dispatcher, RenderStyle *style, Direction direction=Horizontal, Cursor cursor=0, int bevel_width=1, bool override_redirect=false) | |
| virtual | ~Widget () |
| virtual void | update () |
| void | exposeHandler (const XExposeEvent &e) |
| Called when a window becomes visible to the user. | |
| void | configureHandler (const XConfigureEvent &e) |
| Called when the window as been reconfigured. | |
| Window | window (void) const |
| const Widget * | parent (void) const |
| const WidgetList & | children (void) const |
| unsigned int | screen (void) const |
| const Rect & | rect (void) const |
| void | move (const Point &to) |
| void | move (int x, int y) |
| virtual void | setWidth (int) |
| virtual void | setHeight (int) |
| virtual int | width () const |
| virtual int | height () const |
| virtual void | resize (const Point &to) |
| virtual void | resize (int x, int y) |
| virtual void | setGeometry (const Rect &new_geom) |
| virtual void | setGeometry (const Point &topleft, int width, int height) |
| virtual void | setGeometry (int x, int y, int width, int height) |
| bool | isVisible (void) const |
| virtual void | show (bool recursive=false) |
| virtual void | hide (bool recursive=false) |
| bool | isFocused (void) const |
| virtual void | focus (void) |
| virtual void | unfocus (void) |
| bool | hasGrabbedMouse (void) const |
| bool | grabMouse (void) |
| void | ungrabMouse (void) |
| bool | hasGrabbedKeyboard (void) const |
| bool | grabKeyboard (void) |
| void | ungrabKeyboard (void) |
| RenderTexture * | texture (void) const |
| virtual void | setTexture (RenderTexture *texture) |
| const RenderColor * | borderColor (void) const |
| virtual void | setBorderColor (const RenderColor *color) |
| int | borderWidth (void) const |
| void | setBorderWidth (int width) |
| virtual void | addChild (Widget *child, bool front=false) |
| virtual void | removeChild (Widget *child) |
| bool | isStretchableHorz (void) const |
| void | setStretchableHorz (bool s_horz=true) |
| bool | isStretchableVert (void) const |
| void | setStretchableVert (bool s_vert=true) |
| Cursor | cursor (void) const |
| void | setCursor (Cursor cursor) |
| int | bevelWidth (void) const |
| void | setBevelWidth (int bevel_width) |
| Direction | direction (void) const |
| void | setDirection (Direction dir) |
| RenderStyle * | style (void) const |
| virtual void | setStyle (RenderStyle *style) |
| EventDispatcher * | eventDispatcher (void) |
| void | setEventDispatcher (EventDispatcher *disp) |
Protected Methods | |
| virtual void | adjust (void) |
| virtual void | create (bool override_redirect=false) |
| virtual void | adjustHorz (void) |
| virtual void | adjustVert (void) |
| virtual void | internalResize (int width, int height) |
| virtual void | render (void) |
| virtual void | renderForeground () |
Protected Attributes | |
| bool | _dirty |
| bool | _focused |
| Window | _window |
| Widget * | _parent |
| WidgetList | _children |
| RenderStyle * | _style |
| Direction | _direction |
| Cursor | _cursor |
| int | _bevel_width |
| int | _ignore_config |
| bool | _visible |
| bool | _grabbed_mouse |
| bool | _grabbed_keyboard |
| bool | _stretchable_vert |
| bool | _stretchable_horz |
| RenderTexture * | _texture |
| Pixmap | _bg_pixmap |
| unsigned int | _bg_pixel |
| const RenderColor * | _bcolor |
| unsigned int | _bwidth |
| Rect | _rect |
| unsigned int | _screen |
| bool | _fixed_width |
| bool | _fixed_height |
| Surface * | _surface |
| EventDispatcher * | _event_dispatcher |
|
|
Definition at line 28 of file widget.hh. Referenced by adjustHorz(), and adjustVert(). |
|
|
Definition at line 26 of file widget.hh. Referenced by direction().
00026 { Horizontal, Vertical };
|
|
||||||||||||
|
Definition at line 17 of file widget.cc. References _event_dispatcher, addChild(), create(), and otk::EventDispatcher::registerHandler().
00018 : EventHandler(), 00019 _dirty(false), _focused(false), 00020 _parent(parent), _style(parent->style()), _direction(direction), 00021 _cursor(parent->cursor()), _bevel_width(parent->bevelWidth()), 00022 _ignore_config(0), 00023 _visible(false), _grabbed_mouse(false), 00024 _grabbed_keyboard(false), _stretchable_vert(false), 00025 _stretchable_horz(false), _texture(0), _bg_pixmap(0), _bg_pixel(0), 00026 _bcolor(0), _bwidth(0), _rect(0, 0, 1, 1), _screen(parent->screen()), 00027 _fixed_width(false), _fixed_height(false), 00028 _surface(0), 00029 _event_dispatcher(parent->eventDispatcher()) 00030 { 00031 assert(parent); 00032 parent->addChild(this); 00033 create(); 00034 _event_dispatcher->registerHandler(_window, this); 00035 } |
|
||||||||||||||||||||||||||||
|
Definition at line 37 of file widget.cc. References _event_dispatcher, create(), and otk::EventDispatcher::registerHandler().
00040 : EventHandler(), 00041 _dirty(false),_focused(false), 00042 _parent(0), _style(style), _direction(direction), _cursor(cursor), 00043 _bevel_width(bevel_width), _ignore_config(0), _visible(false), 00044 _grabbed_mouse(false), _grabbed_keyboard(false), 00045 _stretchable_vert(false), _stretchable_horz(false), _texture(0), 00046 _bg_pixmap(0), _bg_pixel(0), _bcolor(0), _bwidth(0), _rect(0, 0, 1, 1), 00047 _screen(style->screen()), _fixed_width(false), _fixed_height(false), 00048 _surface(0), 00049 _event_dispatcher(event_dispatcher) 00050 { 00051 assert(event_dispatcher); 00052 assert(style); 00053 create(override_redirect); 00054 _event_dispatcher->registerHandler(_window, this); 00055 } |
|
|
Definition at line 57 of file widget.cc. References _children, _event_dispatcher, _parent, _surface, otk::EventDispatcher::clearHandler(), hide(), and removeChild().
00058 {
00059 if (_visible)
00060 hide();
00061
00062 if (_surface)
00063 delete _surface;
00064
00065 _event_dispatcher->clearHandler(_window);
00066
00067 std::for_each(_children.begin(), _children.end(), PointerAssassin());
00068
00069 if (_parent)
00070 _parent->removeChild(this);
00071
00072 XDestroyWindow(**display, _window);
00073 }
|
|
||||||||||||
|
Definition at line 442 of file widget.cc. References _children. Referenced by Widget().
|
|
|
Reimplemented in ob::BackgroundWidget, ob::ButtonWidget, ob::Frame, and ob::LabelWidget. Definition at line 287 of file widget.cc. References _direction, adjustHorz(), adjustVert(), and Horizontal. Referenced by update().
00288 {
00289 if (_direction == Horizontal)
00290 adjustHorz();
00291 else
00292 adjustVert();
00293 }
|
|
|
Definition at line 295 of file widget.cc. References _bevel_width, _children, _rect, otk::Rect::height(), internalResize(), isStretchableHorz(), isStretchableVert(), move(), setHeight(), WidgetList, otk::Rect::width(), width(), and otk::Rect::x(). Referenced by adjust().
00296 {
00297 if (_children.size() == 0)
00298 return;
00299
00300 Widget *tmp;
00301 WidgetList::iterator it, end = _children.end();
00302
00303 int tallest = 0;
00304 int width = _bevel_width;
00305 WidgetList stretchable;
00306
00307 for (it = _children.begin(); it != end; ++it) {
00308 tmp = *it;
00309 if (tmp->isStretchableVert())
00310 tmp->setHeight(_rect.height() > _bevel_width * 2 ?
00311 _rect.height() - _bevel_width * 2 : _bevel_width);
00312 if (tmp->isStretchableHorz())
00313 stretchable.push_back(tmp);
00314 else
00315 width += tmp->_rect.width() + _bevel_width;
00316
00317 if (tmp->_rect.height() > tallest)
00318 tallest = tmp->_rect.height();
00319 }
00320
00321 if (stretchable.size() > 0) {
00322 WidgetList::iterator str_it = stretchable.begin(),
00323 str_end = stretchable.end();
00324
00325 int str_width = _rect.width() - width / stretchable.size();
00326
00327 for (; str_it != str_end; ++str_it)
00328 (*str_it)->setWidth(str_width > _bevel_width ? str_width - _bevel_width
00329 : _bevel_width);
00330 }
00331
00332 Widget *prev_widget = 0;
00333
00334 for (it = _children.begin(); it != end; ++it) {
00335 tmp = *it;
00336 int x, y;
00337
00338 if (prev_widget)
00339 x = prev_widget->_rect.x() + prev_widget->_rect.width() + _bevel_width;
00340 else
00341 x = _bevel_width;
00342 y = (tallest - tmp->_rect.height()) / 2 + _bevel_width;
00343
00344 tmp->move(x, y);
00345
00346 prev_widget = tmp;
00347 }
00348 internalResize(width, tallest + _bevel_width * 2);
00349 }
|
|
|
Definition at line 351 of file widget.cc. References _bevel_width, _children, _rect, otk::Rect::height(), height(), internalResize(), isStretchableHorz(), isStretchableVert(), move(), setWidth(), WidgetList, otk::Rect::width(), and otk::Rect::y(). Referenced by adjust().
00352 {
00353 if (_children.size() == 0)
00354 return;
00355
00356 Widget *tmp;
00357 WidgetList::iterator it, end = _children.end();
00358
00359 int widest = 0;
00360 int height = _bevel_width;
00361 WidgetList stretchable;
00362
00363 for (it = _children.begin(); it != end; ++it) {
00364 tmp = *it;
00365 if (tmp->isStretchableHorz())
00366 tmp->setWidth(_rect.width() > _bevel_width * 2 ?
00367 _rect.width() - _bevel_width * 2 : _bevel_width);
00368 if (tmp->isStretchableVert())
00369 stretchable.push_back(tmp);
00370 else
00371 height += tmp->_rect.height() + _bevel_width;
00372
00373 if (tmp->_rect.width() > widest)
00374 widest = tmp->_rect.width();
00375 }
00376
00377 if (stretchable.size() > 0) {
00378 WidgetList::iterator str_it = stretchable.begin(),
00379 str_end = stretchable.end();
00380
00381 int str_height = _rect.height() - height / stretchable.size();
00382
00383 for (; str_it != str_end; ++str_it)
00384 (*str_it)->setHeight(str_height > _bevel_width ?
00385 str_height - _bevel_width : _bevel_width);
00386 }
00387 if (stretchable.size() > 0)
00388 height = _rect.height();
00389
00390 Widget *prev_widget = 0;
00391
00392 for (it = _children.begin(); it != end; ++it) {
00393 tmp = *it;
00394 int x, y;
00395
00396 if (prev_widget)
00397 y = prev_widget->_rect.y() + prev_widget->_rect.height() + _bevel_width;
00398 else
00399 y = _bevel_width;
00400 x = (widest - tmp->_rect.width()) / 2 + _bevel_width;
00401
00402 tmp->move(x, y);
00403
00404 prev_widget = tmp;
00405 }
00406
00407 internalResize(widest + _bevel_width * 2, height);
00408 }
|
|
|
Definition at line 111 of file widget.hh. References _bevel_width.
00111 { return _bevel_width; }
|
|
|
Definition at line 84 of file widget.hh. References _bcolor. Referenced by otk::FocusWidget::FocusWidget().
00084 { return _bcolor; }
|
|
|
Definition at line 90 of file widget.hh. References _bwidth.
00090 { return _bwidth; }
|
|
|
Definition at line 44 of file widget.hh. References _children.
00044 { return _children; }
|
|
|
Called when the window as been reconfigured.
Reimplemented from otk::EventHandler. Definition at line 490 of file widget.cc. References _dirty, _ignore_config, _rect, otk::Rect::height(), height(), otk::Rect::setSize(), update(), otk::Rect::width(), and width().
00491 {
00492 EventHandler::configureHandler(e);
00493
00494 if (_ignore_config) {
00495 _ignore_config--;
00496 } else {
00497 int width = e.width;
00498 int height = e.height;
00499
00500 XEvent ev;
00501 while (XCheckTypedWindowEvent(**display, _window, ConfigureNotify, &ev)) {
00502 width = ev.xconfigure.width;
00503 height = ev.xconfigure.height;
00504 }
00505
00506 if (!(width == _rect.width() && height == _rect.height())) {
00507 _dirty = true;
00508 _rect.setSize(width, height);
00509 }
00510 update();
00511 }
00512 }
|
|
|
Definition at line 75 of file widget.cc. References _cursor, _ignore_config, _parent, _rect, _window, otk::ScreenInfo::colormap(), otk::ScreenInfo::depth(), otk::display, otk::Rect::height(), otk::ScreenInfo::rootWindow(), otk::Display::screenInfo(), otk::Rect::setRect(), otk::ScreenInfo::visual(), otk::Rect::width(), window(), otk::Rect::x(), and otk::Rect::y(). Referenced by Widget().
00076 {
00077 const ScreenInfo *scr_info = display->screenInfo(_screen);
00078 Window p_window = _parent ? _parent->window() : scr_info->rootWindow();
00079
00080 _rect.setRect(0, 0, 1, 1); // just some initial values
00081
00082 XSetWindowAttributes attrib_create;
00083 unsigned long create_mask = CWBackPixmap | CWBorderPixel | CWEventMask;
00084
00085 attrib_create.background_pixmap = None;
00086 attrib_create.colormap = scr_info->colormap();
00087 attrib_create.event_mask = ButtonPressMask | ButtonReleaseMask |
00088 ButtonMotionMask | ExposureMask | StructureNotifyMask;
00089
00090 if (override_redirect) {
00091 create_mask |= CWOverrideRedirect;
00092 attrib_create.override_redirect = true;
00093 }
00094
00095 if (_cursor) {
00096 create_mask |= CWCursor;
00097 attrib_create.cursor = _cursor;
00098 }
00099
00100 _window = XCreateWindow(**display, p_window, _rect.x(),
00101 _rect.y(), _rect.width(), _rect.height(), 0,
00102 scr_info->depth(), InputOutput,
00103 scr_info->visual(), create_mask, &attrib_create);
00104 _ignore_config++;
00105 }
|
|
|
Definition at line 105 of file widget.hh. References _cursor.
00105 { return _cursor; }
|
|
|
Definition at line 115 of file widget.hh. References _direction, and Direction.
00115 { return _direction; }
|
|
|
Definition at line 121 of file widget.hh. References _event_dispatcher.
00122 { return _event_dispatcher; }
|
|
|
Called when a window becomes visible to the user.
Reimplemented from otk::EventHandler. Definition at line 484 of file widget.cc.
00485 {
00486 EventHandler::exposeHandler(e);
00487 // XClearArea(**display, _window, e.x, e.y, e.width, e.height, false);
00488 }
|
|
|
Reimplemented in ob::BackgroundWidget, ob::ButtonWidget, ob::Frame, ob::LabelWidget, and otk::FocusWidget. Definition at line 208 of file widget.cc. References _children, and _focused. Referenced by ob::LabelWidget::focus(), ob::Frame::focus(), ob::ButtonWidget::focus(), and ob::BackgroundWidget::focus().
|
|
|
Definition at line 249 of file widget.cc. References _grabbed_keyboard.
00250 {
00251 Status ret = XGrabKeyboard(**display, _window, True,
00252 GrabModeSync, GrabModeAsync, CurrentTime);
00253 _grabbed_keyboard = (ret == GrabSuccess);
00254 return _grabbed_keyboard;
00255
00256 }
|
|
|
Definition at line 228 of file widget.cc. References _grabbed_mouse.
00229 {
00230 Status ret = XGrabPointer(**display, _window, True,
00231 (ButtonPressMask | ButtonReleaseMask |
00232 ButtonMotionMask | EnterWindowMask |
00233 LeaveWindowMask | PointerMotionMask),
00234 GrabModeSync, GrabModeAsync, None, None,
00235 CurrentTime);
00236 _grabbed_mouse = (ret == GrabSuccess);
00237 return _grabbed_mouse;
00238 }
|
|
|
Definition at line 76 of file widget.hh. References _grabbed_keyboard.
00076 { return _grabbed_keyboard; }
|
|
|
Definition at line 72 of file widget.hh. References _grabbed_mouse.
00072 { return _grabbed_mouse; }
|
|
|
Definition at line 55 of file widget.hh. References _rect, and otk::Rect::height(). Referenced by ob::Frame::adjustShape(), ob::Frame::adjustSize(), adjustVert(), and configureHandler().
00055 { return _rect.height(); }
|
|
|
Definition at line 193 of file widget.cc. References _children, and _visible. Referenced by ob::Frame::adjustSize(), ob::Client::setDesktop(), ob::Screen::unmanageWindow(), and ~Widget().
|
|
||||||||||||
|
Definition at line 425 of file widget.cc. References _fixed_height, _fixed_width, _rect, otk::Rect::height(), resize(), and otk::Rect::width(). Referenced by adjustHorz(), adjustVert(), otk::Label::update(), and otk::FocusLabel::update().
00426 {
00427 assert(w > 0 && h > 0);
00428
00429 bool fw = _fixed_width, fh = _fixed_height;
00430
00431 if (! fw && ! fh)
00432 resize(w, h);
00433 else if (! fw)
00434 resize(w, _rect.height());
00435 else if (! fh)
00436 resize(_rect.width(), h);
00437
00438 _fixed_width = fw;
00439 _fixed_height = fh;
00440 }
|
|
|
Reimplemented in otk::FocusWidget. Definition at line 68 of file widget.hh. References _focused.
00068 { return _focused; };
|
|
|
Definition at line 99 of file widget.hh. References _stretchable_horz. Referenced by adjustHorz(), and adjustVert().
00099 { return _stretchable_horz; }
|
|
|
Definition at line 102 of file widget.hh. References _stretchable_vert. Referenced by adjustHorz(), and adjustVert().
00102 { return _stretchable_vert; }
|
|
|
Definition at line 64 of file widget.hh. References _visible. Referenced by ob::Client::focus().
00064 { return _visible; };
|
|
||||||||||||
|
Definition at line 126 of file widget.cc. References _ignore_config, _rect, and otk::Rect::setPos().
00127 {
00128 _rect.setPos(x, y);
00129 XMoveWindow(**display, _window, x, y);
00130 _ignore_config++;
00131 }
|
|
|
Definition at line 121 of file widget.cc. References otk::Point::x(), and otk::Point::y(). Referenced by adjustHorz(), ob::Frame::adjustPosition(), ob::Frame::adjustSize(), and adjustVert().
00122 {
00123 move(to.x(), to.y());
00124 }
|
|
|
Definition at line 43 of file widget.hh. References _parent.
00043 { return _parent; }
|
|
|
Definition at line 46 of file widget.hh. References _rect. Referenced by ob::Frame::adjustShape(), ob::Frame::adjustSize(), ob::Client::maximize(), and ob::Client::updateNormalHints().
00046 { return _rect; }
|
|
|
Definition at line 451 of file widget.cc. References _children. Referenced by ~Widget().
|
|
|
Definition at line 267 of file widget.cc. References _rect, _surface, _texture, otk::display, otk::RenderControl::drawBackground(), otk::Surface::pixmap(), otk::Display::renderControl(), renderForeground(), and otk::Rect::size(). Referenced by update().
00268 {
00269 if (!_texture) {
00270 XSetWindowBackgroundPixmap(**display, _window, ParentRelative);
00271 return;
00272 }
00273
00274 Surface *s = _surface; // save the current surface
00275
00276 _surface = new Surface(_screen, _rect.size());
00277 display->renderControl(_screen)->drawBackground(*_surface, *_texture);
00278
00279 renderForeground(); // for inherited types to render onto the _surface
00280
00281 XSetWindowBackgroundPixmap(**display, _window, _surface->pixmap());
00282
00283 if (s)
00284 delete s; // delete the old surface *after* its pixmap isn't in use anymore
00285 }
|
|
|
Reimplemented in ob::ButtonWidget, ob::LabelWidget, otk::FocusLabel, and otk::Label. Definition at line 136 of file widget.hh. Referenced by render(), ob::LabelWidget::renderForeground(), and ob::ButtonWidget::renderForeground().
00136 {} // for overriding
|
|
||||||||||||
|
Definition at line 138 of file widget.cc. References _fixed_height, _fixed_width, _rect, setGeometry(), otk::Rect::x(), and otk::Rect::y().
00139 {
00140 assert(w > 0 && h > 0);
00141 _fixed_width = _fixed_height = true;
00142 setGeometry(_rect.x(), _rect.y(), w, h);
00143 }
|
|
|
Definition at line 133 of file widget.cc. References otk::Point::x(), and otk::Point::y(). Referenced by ob::Frame::adjustSize(), otk::Label::fitSize(), otk::FocusLabel::fitSize(), internalResize(), and main().
00134 {
00135 resize(to.x(), to.y());
00136 }
|
|
|
Definition at line 45 of file widget.hh. References _screen.
00045 { return _screen; }
|
|
|
Definition at line 112 of file widget.hh. References _bevel_width. Referenced by main().
00113 { assert(bevel_width > 0); _bevel_width = bevel_width; }
|
|
|
Reimplemented in otk::FocusWidget. Definition at line 85 of file widget.hh. References _bcolor. Referenced by ob::Frame::setStyle(), ob::ButtonWidget::setStyle(), ob::BackgroundWidget::setStyle(), and ob::BackgroundWidget::setTextures().
00085 {
00086 assert(color); _bcolor = color;
00087 XSetWindowBorder(**display, _window, color->pixel());
00088 }
|
|
|
Definition at line 91 of file widget.hh. References _bwidth. Referenced by ob::Frame::adjustSize().
00091 {
00092 _bwidth = width;
00093 XSetWindowBorderWidth(**display, _window, width);
00094 }
|
|
|
Definition at line 106 of file widget.hh. References _cursor. Referenced by ob::Frame::Frame().
00106 {
00107 _cursor = cursor;
00108 XDefineCursor(**display, _window, _cursor);
00109 }
|
|
|
Definition at line 116 of file widget.hh. References _direction. Referenced by main().
00116 { _direction = dir; }
|
|
|
Definition at line 476 of file widget.cc. References _event_dispatcher, otk::EventDispatcher::clearHandler(), and otk::EventDispatcher::registerHandler().
00477 {
00478 if (_event_dispatcher)
00479 _event_dispatcher->clearHandler(_window);
00480 _event_dispatcher = disp;
00481 _event_dispatcher->registerHandler(_window, this);
00482 }
|
|
||||||||||||||||||||
|
Definition at line 155 of file widget.cc. References _dirty, _ignore_config, _parent, and _rect.
00156 {
00157 _rect = Rect(x, y, width, height);
00158 _dirty = true;
00159
00160 // make all parents dirty too
00161 Widget *p = _parent;
00162 while (p) {
00163 p->_dirty = true;
00164 p = p->_parent;
00165 }
00166
00167 // don't use an XMoveResizeWindow here, because it doesn't seem to move
00168 // windows with StaticGravity? This works, that didn't.
00169 XResizeWindow(**display, _window, width, height);
00170 XMoveWindow(**display, _window, x, y);
00171 _ignore_config+=2;
00172 }
|
|
||||||||||||||||
|
Definition at line 150 of file widget.cc. References setGeometry(), otk::Point::x(), and otk::Point::y().
00151 {
00152 setGeometry(topleft.x(), topleft.y(), width, height);
00153 }
|
|
|
Definition at line 145 of file widget.cc. References otk::Rect::height(), otk::Rect::width(), otk::Rect::x(), and otk::Rect::y(). Referenced by ob::Frame::adjustSize(), resize(), setGeometry(), setHeight(), and setWidth().
00146 {
00147 setGeometry(new_geom.x(), new_geom.y(), new_geom.width(), new_geom.height());
00148 }
|
|
|
Definition at line 114 of file widget.cc. References _fixed_height, _rect, setGeometry(), otk::Rect::width(), otk::Rect::x(), and otk::Rect::y(). Referenced by adjustHorz(), and main().
00115 {
00116 assert(h > 0);
00117 _fixed_height = true;
00118 setGeometry(_rect.x(), _rect.y(), _rect.width(), h);
00119 }
|
|
|
Definition at line 100 of file widget.hh. References _stretchable_horz. Referenced by main().
00100 { _stretchable_horz = s_horz; }
|
|
|
Definition at line 103 of file widget.hh. References _stretchable_vert. Referenced by main().
00103 { _stretchable_vert = s_vert; }
|
|
|
Reimplemented in ob::BackgroundWidget, ob::ButtonWidget, ob::Frame, ob::LabelWidget, otk::AppWidget, otk::Button, otk::FocusLabel, and otk::Label. Definition at line 464 of file widget.cc. References _children, _dirty, and _style. Referenced by ob::LabelWidget::setStyle(), ob::Frame::setStyle(), and ob::ButtonWidget::setStyle().
|
|
|
Reimplemented in otk::Button, and otk::FocusWidget. Definition at line 81 of file widget.hh. References _dirty, and _texture. Referenced by main(), otk::Label::setStyle(), otk::AppWidget::setStyle(), ob::LabelWidget::setTextures(), ob::ButtonWidget::setTextures(), and ob::BackgroundWidget::setTextures().
|
|
|
Definition at line 107 of file widget.cc. References _fixed_width, _rect, otk::Rect::height(), setGeometry(), otk::Rect::x(), and otk::Rect::y(). Referenced by ob::Frame::adjustSize(), adjustVert(), and main().
00108 {
00109 assert(w > 0);
00110 _fixed_width = true;
00111 setGeometry(_rect.x(), _rect.y(), w, _rect.height());
00112 }
|
|
|
Definition at line 174 of file widget.cc. References _children, _visible, and update(). Referenced by ob::Frame::adjustSize(), ob::Frame::Frame(), ob::Screen::manageWindow(), and ob::Client::setDesktop().
00175 {
00176 if (_visible)
00177 return;
00178
00179 // make sure the internal state isn't mangled
00180 if (_dirty)
00181 update();
00182
00183 if (recursive) {
00184 WidgetList::iterator it = _children.begin(), end = _children.end();
00185 for (; it != end; ++it)
00186 (*it)->show(recursive);
00187 }
00188
00189 XMapWindow(**display, _window);
00190 _visible = true;
00191 }
|
|
|
Definition at line 118 of file widget.hh. References _style. Referenced by otk::Label::fitSize(), otk::FocusLabel::fitSize(), otk::Label::fitString(), otk::FocusLabel::fitString(), otk::Label::renderForeground(), otk::FocusLabel::renderForeground(), otk::Label::update(), and otk::FocusLabel::update().
00118 { return _style; }
|
|
|
Definition at line 80 of file widget.hh. References _texture. Referenced by otk::FocusWidget::FocusWidget().
00080 { return _texture; }
|
|
|
Reimplemented in ob::BackgroundWidget, ob::ButtonWidget, ob::Frame, ob::LabelWidget, and otk::FocusWidget. Definition at line 218 of file widget.cc. References _children, and _focused. Referenced by ob::Frame::Frame(), ob::LabelWidget::unfocus(), ob::Frame::unfocus(), ob::ButtonWidget::unfocus(), and ob::BackgroundWidget::unfocus().
|
|
|
Definition at line 258 of file widget.cc. References _grabbed_keyboard.
00259 {
00260 if (! _grabbed_keyboard)
00261 return;
00262
00263 XUngrabKeyboard(**display, CurrentTime);
00264 _grabbed_keyboard = false;
00265 }
|
|
|
Definition at line 240 of file widget.cc. References _grabbed_mouse.
00241 {
00242 if (! _grabbed_mouse)
00243 return;
00244
00245 XUngrabPointer(**display, CurrentTime);
00246 _grabbed_mouse = false;
00247 }
|
|
|
Reimplemented in ob::ButtonWidget, otk::FocusLabel, and otk::Label. Definition at line 410 of file widget.cc. References _children, _dirty, adjust(), and render(). Referenced by ob::Frame::adjustSize(), configureHandler(), ob::Frame::focus(), otk::FocusWidget::focus(), ob::Frame::setTitle(), show(), ob::Frame::unfocus(), otk::FocusWidget::unfocus(), and ob::ButtonWidget::update().
|
|
|
Definition at line 54 of file widget.hh. References _rect, and otk::Rect::width(). Referenced by adjustHorz(), ob::Frame::adjustShape(), ob::Frame::adjustSize(), configureHandler(), ob::LabelWidget::renderForeground(), ob::ButtonWidget::renderForeground(), otk::Label::renderForeground(), and otk::FocusLabel::renderForeground().
00054 { return _rect.width(); }
|
|
|
Definition at line 42 of file widget.hh. References _window. Referenced by ob::Frame::adjustShape(), otk::AppWidget::AppWidget(), ob::Frame::button_alldesk(), ob::Frame::button_close(), ob::Frame::button_iconify(), ob::Frame::button_max(), create(), ob::Bindings::grabButton(), ob::Frame::grabClient(), ob::Frame::grip_left(), ob::Frame::grip_right(), ob::Frame::handle(), ob::Frame::label(), ob::Screen::lowerWindow(), ob::Screen::manageWindow(), ob::Frame::plate(), ob::Screen::raiseWindow(), ob::Frame::titlebar(), and ob::Screen::unmanageWindow().
00042 { return _window; }
|
|
|
Definition at line 161 of file widget.hh. Referenced by borderColor(), and setBorderColor(). |
|
|
Definition at line 146 of file widget.hh. Referenced by adjustHorz(), adjustVert(), bevelWidth(), and setBevelWidth(). |
|
|
|
|
|
|
|
|
Definition at line 162 of file widget.hh. Referenced by borderWidth(), and setBorderWidth(). |
|
|
Definition at line 141 of file widget.hh. Referenced by addChild(), adjustHorz(), adjustVert(), children(), focus(), hide(), removeChild(), setStyle(), show(), unfocus(), update(), and ~Widget(). |
|
|
Definition at line 145 of file widget.hh. Referenced by create(), cursor(), and setCursor(). |
|
|
Definition at line 144 of file widget.hh. Referenced by adjust(), direction(), and setDirection(). |
|
|
Definition at line 127 of file widget.hh. Referenced by configureHandler(), ob::LabelWidget::renderForeground(), ob::ButtonWidget::renderForeground(), setGeometry(), setStyle(), ob::LabelWidget::setText(), otk::Label::setText(), otk::FocusLabel::setText(), setTexture(), and update(). |
|
|
Definition at line 172 of file widget.hh. Referenced by eventDispatcher(), setEventDispatcher(), Widget(), and ~Widget(). |
|
|
Definition at line 168 of file widget.hh. Referenced by internalResize(), resize(), setHeight(), otk::Label::update(), and otk::FocusLabel::update(). |
|
|
Definition at line 167 of file widget.hh. Referenced by internalResize(), resize(), setWidth(), otk::Label::update(), and otk::FocusLabel::update(). |
|
|
Definition at line 128 of file widget.hh. Referenced by focus(), otk::FocusWidget::FocusWidget(), isFocused(), otk::FocusWidget::isFocused(), otk::FocusWidget::isUnfocused(), ob::ButtonWidget::renderForeground(), unfocus(), and otk::FocusWidget::unfocus(). |
|
|
Definition at line 152 of file widget.hh. Referenced by grabKeyboard(), hasGrabbedKeyboard(), and ungrabKeyboard(). |
|
|
Definition at line 151 of file widget.hh. Referenced by grabMouse(), hasGrabbedMouse(), and ungrabMouse(). |
|
|
Definition at line 147 of file widget.hh. Referenced by configureHandler(), create(), move(), and setGeometry(). |
|
|
Definition at line 140 of file widget.hh. Referenced by create(), parent(), setGeometry(), and ~Widget(). |
|
|
Definition at line 164 of file widget.hh. Referenced by adjustHorz(), adjustVert(), configureHandler(), create(), height(), internalResize(), move(), rect(), render(), ob::ButtonWidget::renderForeground(), resize(), setGeometry(), setHeight(), setWidth(), otk::Label::update(), otk::FocusLabel::update(), and width(). |
|
|
Reimplemented in ob::Frame. Definition at line 165 of file widget.hh. Referenced by screen(). |
|
|
Definition at line 155 of file widget.hh. Referenced by isStretchableHorz(), and setStretchableHorz(). |
|
|
Definition at line 154 of file widget.hh. Referenced by isStretchableVert(), and setStretchableVert(). |
|
|
|
Definition at line 170 of file widget.hh. Referenced by render(), ob::LabelWidget::renderForeground(), ob::ButtonWidget::renderForeground(), and ~Widget(). |
|
|
Definition at line 157 of file widget.hh. Referenced by render(), setTexture(), and texture(). |
|
|
Definition at line 149 of file widget.hh. Referenced by hide(), isVisible(), and show(). |
|
|
|
1.3-rc2