]> Dogcows Code - chaz/openbox/blobdiff - otk/widget.hh
ignore the latex dir
[chaz/openbox] / otk / widget.hh
index 5583faca87717338c3a0e9b9e9cb63236ebebd02..3427e6814942d5a6ee8092ddb973f29fdb5d55db 100644 (file)
@@ -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 <assert.h>
@@ -27,13 +28,13 @@ public:
   typedef std::list<Widget *> 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;
 };
 
This page took 0.028382 seconds and 4 git commands to generate.