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
28 * This is a factory class that can produce GCs with a specific
29 * color. It will cache GCs for performance.
31 class LyXColorHandler {
38 unsigned long colorPixel(LColor::color c);
40 GC getGCForeground(LColor::color c);
42 GC getGCLinepars(Painter::line_style,
43 Painter::line_width, LColor::color c);
44 /// update the cache after a color definition change
45 void updateColor(LColor::color c);
53 std::vector<GC> colorGCcache;
55 GC getGCForeground(string const & s);
57 typedef std::map<int, GC> LineGCCache;
59 LineGCCache lineGCcache;
65 extern boost::scoped_ptr<LyXColorHandler> lyxColorHandler;