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"
20 #include <boost/scoped_ptr.hpp>
22 // This is only included to provide stuff for the non-public sections
29 * This is a factory class that can produce GCs with a specific
30 * color. It will cache GCs for performance.
32 class LyXColorHandler {
39 unsigned long colorPixel(LColor_color c);
41 GC getGCForeground(LColor_color c);
43 GC getGCLinepars(Painter::line_style,
44 Painter::line_width, LColor_color c);
45 /// update the cache after a color definition change
46 void updateColor(LColor_color c);
54 std::vector<GC> colorGCcache;
56 GC getGCForeground(string const & s);
58 typedef std::map<int, GC> LineGCCache;
60 LineGCCache lineGCcache;
66 extern boost::scoped_ptr<LyXColorHandler> lyxColorHandler;