diff options
| author | Dana Jansens <danakj@orodu.net> | 2003-03-21 18:42:39 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2003-03-21 18:42:39 +0000 |
| commit | a52a6d96d701c993896f276e4198003317632aaf (patch) | |
| tree | be2f51e6a433d1fdf9a7c8248b343cb3f6297212 /otk/rendercolor.hh | |
| parent | a36c7543d4eedaa9e10bfd9f4d9b81279b1bb7e6 (diff) | |
rm the old code including the .pys and the c++ shit
Diffstat (limited to 'otk/rendercolor.hh')
| -rw-r--r-- | otk/rendercolor.hh | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/otk/rendercolor.hh b/otk/rendercolor.hh deleted file mode 100644 index 5076167f..00000000 --- a/otk/rendercolor.hh +++ /dev/null @@ -1,64 +0,0 @@ -// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*- -#ifndef __rendercolor_hh -#define __rendercolor_hh - -extern "C" { -#include <X11/Xlib.h> -} - -#include <map> - -namespace otk { - -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, unsigned long p) : gc(g), pixel(p), count(0) {} - }; - static std::map<unsigned long, CacheItem*> *_cache; - - int _screen; - unsigned char _red; - unsigned char _green; - unsigned char _blue; - - unsigned long _pixel; - GC _gc; - - void create(); - -public: - static void initialize(); - static void destroy(); - - RenderColor(int screen, unsigned char red, - unsigned char green, unsigned char blue); - RenderColor(int screen, RGB rgb); - virtual ~RenderColor(); - - inline int screen() const { return _screen; } - inline unsigned char red() const { return _red; } - inline unsigned char green() const { return _green; } - inline unsigned char blue() const { return _blue; } - unsigned long pixel() const { return _pixel; } - GC gc() const { return _gc; } -}; - -} - -#endif // __rendercolor_hh |
