]> Dogcows Code - chaz/openbox/commitdiff
add pseudorendercontrol
authorDana Jansens <danakj@orodu.net>
Mon, 3 Feb 2003 07:06:45 +0000 (07:06 +0000)
committerDana Jansens <danakj@orodu.net>
Mon, 3 Feb 2003 07:06:45 +0000 (07:06 +0000)
otk/.cvsignore
otk/Makefile.am
otk/pseudorendercontrol.cc [new file with mode: 0644]
otk/pseudorendercontrol.hh [new file with mode: 0644]
otk/rendercontrol.cc
otk/surface.hh
otk/truerendercontrol.hh

index 217aecc79ee61296f545766ed8c3ed8aa8fbf9ad..8be6a1742a8ef9a508d1ea90cd2f821f0947d118 100644 (file)
@@ -29,6 +29,7 @@ texture.lo
 timer.lo
 timerqueuemanager.lo
 truerendercontrol.lo
+pseudorendercontrol.lo
 util.lo
 widget.lo
 ustring.lo
index 1e81276501e35323c6f8e1af79b38ae5eb8df132..794d18e8c26b78bdde207ccfbaf44992cd08c5b5 100644 (file)
@@ -12,7 +12,7 @@ CXXFLAGS=$(XFT_CFLAGS) $(PYTHON_CFLAGS) @CXXFLAGS@ \
 lib_LTLIBRARIES=libotk.la
 
 libotk_la_SOURCES=rendercontrol.cc truerendercontrol.cc surface.cc \
-                  renderstyle.cc rendercolor.cc  \
+                  renderstyle.cc rendercolor.cc pseudorendercontrol.cc \
                   display.cc font.cc \
                   property.cc rect.cc screeninfo.cc \
                   timer.cc \
diff --git a/otk/pseudorendercontrol.cc b/otk/pseudorendercontrol.cc
new file mode 100644 (file)
index 0000000..9759dc7
--- /dev/null
@@ -0,0 +1,58 @@
+// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
+
+#ifdef    HAVE_CONFIG_H
+#  include "../config.h"
+#endif // HAVE_CONFIG_H
+
+#include "pseudorendercontrol.hh"
+#include "display.hh"
+#include "screeninfo.hh"
+#include "surface.hh"
+#include "rendertexture.hh"
+
+extern "C" {
+#ifdef    HAVE_STDLIB_H
+#  include <stdlib.h>
+#endif // HAVE_STDLIB_H
+
+#include "../src/gettext.h"
+#define _(str) gettext(str)
+}
+
+namespace otk {
+
+PseudoRenderControl::PseudoRenderControl(int screen)
+  : RenderControl(screen)
+{
+  const ScreenInfo *info = display->screenInfo(_screen);
+
+  printf("Initializing PseudoColor RenderControl\n");
+
+}
+
+PseudoRenderControl::~PseudoRenderControl()
+{
+  printf("Destroying PseudoColor RenderControl\n");
+
+
+}
+
+void PseudoRenderControl::drawGradientBackground(
+     Surface &sf, const RenderTexture &texture) const
+{
+}
+
+void PseudoRenderControl::drawBackground(Surface& sf,
+                                      const RenderTexture &texture) const
+{
+  assert(_screen == sf._screen);
+  assert(_screen == texture.color().screen());
+
+  if (texture.gradient() == RenderTexture::Solid) {
+    drawSolidBackground(sf, texture);
+  } else {
+    drawGradientBackground(sf, texture);
+  }
+}
+
+}
diff --git a/otk/pseudorendercontrol.hh b/otk/pseudorendercontrol.hh
new file mode 100644 (file)
index 0000000..6d3255e
--- /dev/null
@@ -0,0 +1,38 @@
+// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
+#ifndef __pseudorendercontrol_hh
+#define __pseudorendercontrol_hh
+
+#include "rendercontrol.hh"
+
+extern "C" {
+
+#ifdef HAVE_STDINT_H
+#  include <stdint.h>
+#else
+#  ifdef HAVE_SYS_TYPES_H
+#    include <sys/types.h>
+#  endif
+#endif
+
+}
+
+#include <vector>
+
+namespace otk {
+
+class PseudoRenderControl : public RenderControl {
+private:
+
+  virtual void drawGradientBackground(Surface &sf,
+                                      const RenderTexture &texture) const;
+public:
+  PseudoRenderControl(int screen);
+  virtual ~PseudoRenderControl();
+
+  virtual void drawBackground(Surface& sf, const RenderTexture &texture) const;
+};
+
+}
+
+#endif // __pseudorendercontrol_hh
index 8046398e304fa7dad3ca5cefeaed4ae44be20675..ebd2cfc84b12711b8fbde0fcd21fbfccef9c3401 100644 (file)
@@ -6,6 +6,7 @@
 
 #include "rendercontrol.hh"
 #include "truerendercontrol.hh"
+#include "pseudorendercontrol.hh"
 #include "rendertexture.hh"
 #include "rendercolor.hh"
 #include "display.hh"
@@ -34,7 +35,7 @@ RenderControl *RenderControl::getRenderControl(int screen)
     return new TrueRenderControl(screen);
   case PseudoColor:
   case StaticColor:
-//    return new PseudoRenderControl(screen);
+    return new PseudoRenderControl(screen);
   case GrayScale:
   case StaticGray:
 //    return new GrayRenderControl(screen);
index 18733517aaefc52a10fdb493fea5a7081f41e87e..112bb39233f74ba30b50403b69239357e910c8f8 100644 (file)
@@ -4,6 +4,7 @@
 
 #include "point.hh"
 #include "truerendercontrol.hh"
+#include "pseudorendercontrol.hh"
 
 extern "C" {
 #include <X11/Xlib.h>
@@ -45,6 +46,7 @@ public:
   // to it. Noone else needs them tho, so they are private.
   friend class RenderControl;
   friend class TrueRenderControl;
+  friend class PseudoRenderControl;
 };
 
 }
index b44969aa2ff0489dbf43251c489d12d778a33e38..e733a148f7ac4ea3186a3d24326deeeb74757c5d 100644 (file)
@@ -53,14 +53,6 @@ private:
   int _green_offset;
   int _blue_offset;
 
-public:
-  TrueRenderControl(int screen);
-  virtual ~TrueRenderControl();
-
-  virtual void drawBackground(Surface& sf, const RenderTexture &texture) const;
-  virtual void drawGradientBackground(Surface &sf,
-                                      const RenderTexture &texture) const;
-
   inline void highlight(pixel32 *x, pixel32 *y, bool raised) const;
   void reduceDepth(XImage *im, pixel32 *data) const;
   void verticalGradient(Surface &sf, const RenderTexture &texture,
@@ -69,6 +61,14 @@ public:
                         pixel32 *data) const;
   void crossDiagonalGradient(Surface &sf, const RenderTexture &texture,
                         pixel32 *data) const;
+  virtual void drawGradientBackground(Surface &sf,
+                                      const RenderTexture &texture) const;
+  
+public:
+  TrueRenderControl(int screen);
+  virtual ~TrueRenderControl();
+
+  virtual void drawBackground(Surface& sf, const RenderTexture &texture) const;
 };
 
 }
This page took 0.030449 seconds and 4 git commands to generate.