]> Dogcows Code - chaz/openbox/blobdiff - otk/widget.hh
add rendercolor class, with a cache of gcs for the colors
[chaz/openbox] / otk / widget.hh
index 5583faca87717338c3a0e9b9e9cb63236ebebd02..7d183c28963571b2e69cb1e48049275d27505388 100644 (file)
@@ -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 <assert.h>
@@ -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;
 };
 
This page took 0.02241 seconds and 4 git commands to generate.