summaryrefslogtreecommitdiff
path: root/otk/gccache.hh
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2002-11-03 10:07:16 +0000
committerDana Jansens <danakj@orodu.net>2002-11-03 10:07:16 +0000
commitfa8cefef63feb1d559c40db3cf9407e5bd1ac4df (patch)
treec5f4e1d4229fe39d1c13526a32a52d555ccf3494 /otk/gccache.hh
parentfcfb532d30f4f0cee5192376145867ec1eada8ad (diff)
add an OBDisplay class and the old ScreenInfo class to the toolkit.
wrap the toolkit in the 'otk' namespace it compiles. broke the timer cache tho.
Diffstat (limited to 'otk/gccache.hh')
-rw-r--r--otk/gccache.hh16
1 files changed, 8 insertions, 8 deletions
diff --git a/otk/gccache.hh b/otk/gccache.hh
index 499ed8a4..f0b316aa 100644
--- a/otk/gccache.hh
+++ b/otk/gccache.hh
@@ -6,9 +6,11 @@ extern "C" {
#include <X11/Xlib.h>
}
-#include "basedisplay.hh"
+#include "display.hh"
#include "color.hh"
+namespace otk {
+
class BGCCacheItem;
class BGCCacheContext {
@@ -20,11 +22,10 @@ public:
~BGCCacheContext(void);
private:
- BGCCacheContext(const BaseDisplay * const _display)
- : display(_display), gc(0), pixel(0ul), fontid(0ul),
+ BGCCacheContext()
+ : gc(0), pixel(0ul), fontid(0ul),
function(0), subwindow(0), used(false), screen(~(0u)), linewidth(0) {}
- const BaseDisplay *display;
GC gc;
unsigned long pixel;
unsigned long fontid;
@@ -61,7 +62,7 @@ private:
class BGCCache {
public:
- BGCCache(const BaseDisplay * const _display, unsigned int screen_count);
+ BGCCache(unsigned int screen_count);
~BGCCache(void);
// cleans up the cache
@@ -78,8 +79,6 @@ private:
// this is closely modelled after the Qt GC cache, but with some of the
// complexity stripped out
- const BaseDisplay *display;
-
const unsigned int context_count;
const unsigned int cache_size;
const unsigned int cache_buckets;
@@ -94,7 +93,7 @@ public:
int _linewidth = 0, int _function = GXcopy,
int _subwindow = ClipByChildren)
: color(_color), font(_font), linewidth(_linewidth), function(_function),
- subwindow(_subwindow), cache(_color.display()->gcCache()), item(0) { }
+ subwindow(_subwindow), cache(OBDisplay::gcCache()), item(0) { }
inline ~BPen(void) { if (item) cache->release(item); }
@@ -115,5 +114,6 @@ private:
mutable BGCCacheItem *item;
};
+}
#endif // GCCACHE_HH