]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/ColorHandler.h
merge booktabs branch
[lyx.git] / src / frontends / xforms / ColorHandler.h
index a402f22f3e0853b62ff5c7a345699be9a4120a5a..d4086ae9a6f1e80ffe87e54b7e8f9d915845a0cc 100644 (file)
@@ -6,23 +6,27 @@
  *
  * \author unknown
  *
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
  */
 
 #ifndef COLOR_HANDLER_H
 #define COLOR_HANDLER_H
 
-
 #include "frontends/Painter.h"
 
 #include <map>
+#include <vector>
 #include <boost/scoped_ptr.hpp>
 
 // This is only included to provide stuff for the non-public sections
 #include <X11/Xlib.h>
 
+class LColor_color;
 class LyXFont;
 
+namespace lyx {
+namespace frontend {
+
 /**
  * This is a factory class that can produce GCs with a specific
  * color. It will cache GCs for performance.
@@ -34,14 +38,14 @@ public:
        ///
        ~LyXColorHandler();
        ///
-       unsigned long colorPixel(LColor::color c);
+       unsigned long colorPixel(LColor_color c);
        ///
-       GC getGCForeground(LColor::color c);
+       GC getGCForeground(LColor_color c);
        ///
        GC getGCLinepars(Painter::line_style,
-                        Painter::line_width, LColor::color c);
+                        Painter::line_width, LColor_color c);
        /// update the cache after a color definition change
-       void updateColor(LColor::color c);
+       void updateColor(LColor_color c);
 
 private:
        ///
@@ -49,7 +53,9 @@ private:
        ///
        Colormap colormap;
        ///
-       GC colorGCcache[LColor::ignore + 1];
+       std::vector<GC> colorGCcache;
+       ///
+       GC getGCForeground(std::string const & s);
        ///
        typedef std::map<int, GC> LineGCCache;
        ///
@@ -61,4 +67,7 @@ private:
 ///
 extern boost::scoped_ptr<LyXColorHandler> lyxColorHandler;
 
+} // namespace frontend
+} // namespace lyx
+
 #endif