X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=otk%2Fwidget.hh;h=7d183c28963571b2e69cb1e48049275d27505388;hb=0348a2f3abd2334f5f5812c5fb45c1b4fffb46a5;hp=5583faca87717338c3a0e9b9e9cb63236ebebd02;hpb=8f8acc24933830d4f5784616b9b0c5896bde0b93;p=chaz%2Fopenbox diff --git a/otk/widget.hh b/otk/widget.hh index 5583faca..7d183c28 100644 --- a/otk/widget.hh +++ b/otk/widget.hh @@ -4,10 +4,11 @@ #include "rect.hh" #include "point.hh" -#include "texture.hh" +#include "rendertexture.hh" #include "style.hh" #include "eventdispatcher.hh" #include "display.hh" +#include "surface.hh" extern "C" { #include @@ -76,20 +77,20 @@ public: bool grabKeyboard(void); void ungrabKeyboard(void); - inline Texture *texture(void) const { return _texture; } - virtual void setTexture(Texture *texture) + inline RenderTexture *texture(void) const { return _texture; } + virtual void setTexture(RenderTexture *texture) { _texture = texture; _dirty = true; } inline const Color *borderColor(void) const { return _bcolor; } virtual void setBorderColor(const Color *color) { assert(color); _bcolor = color; - XSetWindowBorder(Display::display, _window, color->pixel()); + XSetWindowBorder(**display, _window, color->pixel()); } inline int borderWidth(void) const { return _bwidth; } void setBorderWidth(int width) { _bwidth = width; - XSetWindowBorderWidth(Display::display, _window, width); + XSetWindowBorderWidth(**display, _window, width); } virtual void addChild(Widget *child, bool front = false); @@ -104,7 +105,7 @@ public: inline Cursor cursor(void) const { return _cursor; } void setCursor(Cursor cursor) { _cursor = cursor; - XDefineCursor(Display::display, _window, _cursor); + XDefineCursor(**display, _window, _cursor); } inline int bevelWidth(void) const { return _bevel_width; } @@ -132,6 +133,7 @@ protected: virtual void adjustVert(void); virtual void internalResize(int width, int height); virtual void render(void); + virtual void renderForeground(void) {} // for overriding Window _window; @@ -152,7 +154,7 @@ protected: bool _stretchable_vert; bool _stretchable_horz; - Texture *_texture; + RenderTexture *_texture; Pixmap _bg_pixmap; unsigned int _bg_pixel; @@ -165,6 +167,8 @@ protected: bool _fixed_width; bool _fixed_height; + Surface _surface; + EventDispatcher *_event_dispatcher; };