diff options
| author | Dana Jansens <danakj@orodu.net> | 2002-08-23 05:12:07 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2002-08-23 05:12:07 +0000 |
| commit | 469b9b3087062efdaed6e404a6a6e8de31f59788 (patch) | |
| tree | 63d90ee89ab71d915901b832e076439094b43b65 /src/GCCache.hh | |
| parent | 7cac1f19acf894aaf4470460732574abc158fd78 (diff) | |
give gc's/BPen's a width
Diffstat (limited to 'src/GCCache.hh')
| -rw-r--r-- | src/GCCache.hh | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/GCCache.hh b/src/GCCache.hh index 56f234a3..536a4746 100644 --- a/src/GCCache.hh +++ b/src/GCCache.hh @@ -36,7 +36,7 @@ class BGCCacheItem; class BGCCacheContext { public: void set(const BColor &_color, const XFontStruct * const _font, - const int _function, const int _subwindow); + const int _function, const int _subwindow, const int _linewidth); void set(const XFontStruct * const _font); ~BGCCacheContext(void); @@ -44,7 +44,7 @@ public: private: BGCCacheContext(const BaseDisplay * const _display) : display(_display), gc(0), pixel(0ul), fontid(0ul), - function(0), subwindow(0), used(false), screen(~(0u)) {} + function(0), subwindow(0), used(false), screen(~(0u)), _linewidth(0) {} const BaseDisplay *display; GC gc; @@ -54,6 +54,7 @@ private: int subwindow; bool used; unsigned int screen; + int linewidth; BGCCacheContext(const BGCCacheContext &_nocopy); BGCCacheContext &operator=(const BGCCacheContext &_nocopy); @@ -89,7 +90,8 @@ public: void purge(void); BGCCacheItem *find(const BColor &_color, const XFontStruct * const _font = 0, - int _function = GXcopy, int _subwindow = ClipByChildren); + int _function = GXcopy, int _subwindow = ClipByChildren, + int _linewidth = 0); void release(BGCCacheItem *_item); private: @@ -111,13 +113,16 @@ private: class BPen { public: inline BPen(const BColor &_color, const XFontStruct * const _font = 0, - int _function = GXcopy, int _subwindow = ClipByChildren) + int _function = GXcopy, int _subwindow = ClipByChildren, + int _linewidth = 0) : color(_color), font(_font), function(_function), subwindow(_subwindow), - cache(_color.display()->gcCache()), item(0) { } + cache(_color.display()->gcCache()), item(0), linewidth(_linewidth) { } + inline ~BPen(void) { if (item) cache->release(item); } inline const GC &gc(void) const { - if (! item) item = cache->find(color, font, function, subwindow); + if (! item) item = cache->find(color, font, function, subwindow, + linewidth); return item->gc(); } @@ -126,6 +131,7 @@ private: const XFontStruct *font; int function; int subwindow; + int linewidth; mutable BGCCache *cache; mutable BGCCacheItem *item; |
