]> Dogcows Code - chaz/openbox/blobdiff - otk/rendercolor.hh
use otk objects in the ob scripts by importing otk
[chaz/openbox] / otk / rendercolor.hh
index 1152e767d5259a6e43fb0291cc1117670addd234..8ed8ce5802e24eda0dd1031b5e7fd66d96a1d04a 100644 (file)
@@ -10,25 +10,25 @@ extern "C" {
 
 namespace otk {
 
-class RenderColor {
-public:
-  struct RGB {
-    int r;
-    int g;
-    int b;
-    RGB(int red, int green, int blue) : r(red), g(green), b(blue) {}
-    // color is in ARGB format
-    RGB(unsigned long color)
-      : r((color >> 16) & 0xff),
-        g((color >> 8) & 0xff),
-        b((color) & 0xff) {}
-  };
+struct RGB {
+  int r;
+  int g;
+  int b;
+  RGB(int red, int green, int blue) : r(red), g(green), b(blue) {}
+  // color is in ARGB format
+  RGB(unsigned long color)
+    : r((color >> 16) & 0xff),
+      g((color >> 8) & 0xff),
+      b((color) & 0xff) {}
+};
 
+class RenderColor {
 private:
   struct CacheItem {
     GC gc;
+    unsigned long pixel;
     int count;
-    CacheItem(GC g) : gc(g), count(0) {}
+    CacheItem(GC g, unsigned long p) : gc(g), pixel(p), count(0) {}
   };
   static std::map<unsigned long, CacheItem*> *_cache;
 
@@ -36,6 +36,7 @@ private:
   unsigned char _red;
   unsigned char _green;
   unsigned char _blue;
+  unsigned long _pixel;
 
   GC _gc;
 
@@ -54,6 +55,7 @@ public:
   inline unsigned char red() const { return _red; }
   inline unsigned char green() const { return _green; }
   inline unsigned char blue() const { return _blue; }
+  inline unsigned long pixel() const { return _pixel; }
   inline GC gc() const { return _gc; }
 };
 
This page took 0.023248 seconds and 4 git commands to generate.