4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
9 * Full author contact details are available in file CREDITS
12 #ifndef COLOR_HANDLER_H
13 #define COLOR_HANDLER_H
16 #include "frontends/Painter.h"
18 #include <boost/scoped_ptr.hpp>
20 // This is only included to provide stuff for the non-public sections
26 * This is a factory class that can produce GCs with a specific
27 * color. It will cache GCs for performance.
29 class LyXColorHandler {
36 unsigned long colorPixel(LColor::color c);
38 GC getGCForeground(LColor::color c);
40 GC getGCLinepars(Painter::line_style,
41 Painter::line_width, LColor::color c);
42 /// update the cache after a color definition change
43 void updateColor(LColor::color c);
51 GC colorGCcache[LColor::ignore + 1];
53 typedef std::map<int, GC> LineGCCache;
55 LineGCCache lineGCcache;
61 extern boost::scoped_ptr<LyXColorHandler> lyxColorHandler;