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
15 #include "frontends/Painter.h"
19 #include <boost/scoped_ptr.hpp>
21 // This is only included to provide stuff for the non-public sections
31 * This is a factory class that can produce GCs with a specific
32 * color. It will cache GCs for performance.
34 class LyXColorHandler {
41 unsigned long colorPixel(LColor_color c);
43 GC getGCForeground(LColor_color c);
45 GC getGCLinepars(Painter::line_style,
46 Painter::line_width, LColor_color c);
47 /// update the cache after a color definition change
48 void updateColor(LColor_color c);
56 std::vector<GC> colorGCcache;
58 GC getGCForeground(std::string const & s);
60 typedef std::map<int, GC> LineGCCache;
62 LineGCCache lineGCcache;
68 extern boost::scoped_ptr<LyXColorHandler> lyxColorHandler;
70 } // namespace frontend