X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=otk%2Fgccache.hh;h=f0b316aaaae70c537be5c9ba98279066af522588;hb=70eb03ad50e1a71fd64c8cb1ebabbff311850553;hp=499ed8a4007f264c72b5158373494fc0ff2d86a4;hpb=85c41a1aec90b8daefc425596ea34b6f9d0e643c;p=chaz%2Fopenbox 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 } -#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