X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=otk%2Fwidget.hh;h=3427e6814942d5a6ee8092ddb973f29fdb5d55db;hb=59ef3022a4ce0a23e6d54f7d73a2aa77721e9cc9;hp=5583faca87717338c3a0e9b9e9cb63236ebebd02;hpb=8f8acc24933830d4f5784616b9b0c5896bde0b93;p=chaz%2Fopenbox diff --git a/otk/widget.hh b/otk/widget.hh index 5583faca..3427e681 100644 --- a/otk/widget.hh +++ b/otk/widget.hh @@ -4,10 +4,11 @@ #include "rect.hh" #include "point.hh" -#include "texture.hh" -#include "style.hh" +#include "rendertexture.hh" +#include "renderstyle.hh" #include "eventdispatcher.hh" #include "display.hh" +#include "surface.hh" extern "C" { #include @@ -27,13 +28,13 @@ public: typedef std::list WidgetList; Widget(Widget *parent, Direction = Horizontal); - Widget(EventDispatcher *event_dispatcher, Style *style, + 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); + virtual void update(); void exposeHandler(const XExposeEvent &e); void configureHandler(const XConfigureEvent &e); @@ -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) { + inline const RenderColor *borderColor(void) const { return _bcolor; } + virtual void setBorderColor(const RenderColor *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; } @@ -114,8 +115,11 @@ public: inline Direction direction(void) const { return _direction; } void setDirection(Direction dir) { _direction = dir; } - inline Style *style(void) const { return _style; } - virtual void setStyle(Style *style); + inline RenderStyle *style(void) const { return _style; } + virtual void setStyle(RenderStyle *style); + + inline long eventMask(void) const { return _event_mask; } + void setEventMask(long e); inline EventDispatcher *eventDispatcher(void) { return _event_dispatcher; } @@ -132,13 +136,14 @@ protected: virtual void adjustVert(void); virtual void internalResize(int width, int height); virtual void render(void); + virtual void renderForeground() {} // for overriding Window _window; Widget *_parent; WidgetList _children; - Style *_style; + RenderStyle *_style; Direction _direction; Cursor _cursor; int _bevel_width; @@ -152,11 +157,11 @@ protected: bool _stretchable_vert; bool _stretchable_horz; - Texture *_texture; + RenderTexture *_texture; Pixmap _bg_pixmap; unsigned int _bg_pixel; - const Color *_bcolor; + const RenderColor *_bcolor; unsigned int _bwidth; Rect _rect; @@ -165,6 +170,10 @@ protected: bool _fixed_width; bool _fixed_height; + long _event_mask; + + Surface *_surface; + EventDispatcher *_event_dispatcher; };