]> Dogcows Code - chaz/openbox/commitdiff
change the render() interface
authorDana Jansens <danakj@orodu.net>
Sat, 18 Jan 2003 02:38:29 +0000 (02:38 +0000)
committerDana Jansens <danakj@orodu.net>
Sat, 18 Jan 2003 02:38:29 +0000 (02:38 +0000)
otk/rendercontrol.hh
otk/rendertest.cc
otk/truerendercontrol.cc
otk/truerendercontrol.hh

index e8dcca449ac744dc54e1f5083adf07c8abad9b54..f48f70576ac68180c9d09b18236f3e608374a890 100644 (file)
@@ -10,6 +10,7 @@ extern "C" {
 namespace otk {
 
 class ScreenInfo;
+class Widget;
 
 class RenderControl {
 protected:
@@ -67,7 +68,7 @@ public:
 
   static RenderControl *getRenderControl(int screen);
 
-  virtual void render(::Window w) = 0;
+  virtual void render(Widget *wi) = 0;
 };
 
 }
index c9226b1f5560b5c094c423ee803cd69b3c19d902..d3e38ae802fadcfdbe9544fb633558d2a5f3d3c3 100644 (file)
@@ -14,7 +14,7 @@ int main(int argc, char **argv)
   
   otk::RenderControl *rc = otk::RenderControl::getRenderControl(0);
 
-  rc->render(foo.window());
+  rc->render(&foo);
 
   app.run();
 
index 0cfa293e1da3e656032ca454799ebb8393dfb39d..0b033955e0775a5e2f70907ed82795017391ac1d 100644 (file)
@@ -7,6 +7,7 @@
 #include "truerendercontrol.hh"
 #include "display.hh"
 #include "screeninfo.hh"
+#include "widget.hh"
 
 extern "C" {
 #ifdef    HAVE_STDLIB_H
@@ -145,13 +146,15 @@ void renderPixel(XImage *im, unsigned char *dp, unsigned long pixel)
   }
 }
 
-void TrueRenderControl::render(::Window win)
+void TrueRenderControl::render(Widget *wi)
 {
+  assert(wi);
+  
   XGCValues gcv;
   gcv.cap_style = CapProjecting;
 
-  int w = 255, h = 32;
-  Pixmap p = XCreatePixmap(**display, win, w, h, _screen->depth());
+  int w = 255, h = 31;
+  Pixmap p = XCreatePixmap(**display, wi->window(), w, h, _screen->depth());
   XImage *im = XCreateImage(**display, _screen->visual(), _screen->depth(),
                            ZPixmap, 0, NULL, w, h, 32, 0);
   //GC gc = XCreateGC(**display, _screen->rootWindow(), GCCapStyle, &gcv);
@@ -171,8 +174,6 @@ void TrueRenderControl::render(::Window win)
   for (int y = 0; y < 10; ++y)
     for (int x = 0; x < w; ++x, dp += im->bits_per_pixel/8)
       renderPixel(im, dp, _blue_color_table[x] << _blue_offset);
-  for (int x = 0; x < w; ++x, dp += im->bits_per_pixel/8)
-    renderPixel(im, dp, 0);
 
   printf("\nDone\n");
 
@@ -185,8 +186,8 @@ void TrueRenderControl::render(::Window win)
   //image->data = NULL;
   XDestroyImage(im);
 
-  XSetWindowBackgroundPixmap(**display, win, p);
-  XClearWindow(**display, win);
+  XSetWindowBackgroundPixmap(**display, wi->window(), p);
+  XClearWindow(**display, wi->window());
 
   XFreePixmap(**display, p);
 }
index f4057355d816a2e39384ea9bb5dc958b8e8d3695..574b5272c8accd90698c29062d489d88f6c5ada5 100644 (file)
@@ -17,7 +17,7 @@ public:
   TrueRenderControl(const ScreenInfo *screen);
   virtual ~TrueRenderControl();
 
-  virtual void render(::Window w);
+  virtual void render(Widget *wi);
 };
 
 }
This page took 0.026308 seconds and 4 git commands to generate.