]> git.lyx.org Git - features.git/commitdiff
The EnumLColor patch, free of macros.
authorAngus Leeming <leeming@lyx.org>
Mon, 15 Sep 2003 15:20:22 +0000 (15:20 +0000)
committerAngus Leeming <leeming@lyx.org>
Mon, 15 Sep 2003 15:20:22 +0000 (15:20 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7759 a592a061-630c-0410-9148-cb99ea01b6c8

50 files changed:
src/ChangeLog
src/LColor.h
src/frontends/ChangeLog
src/frontends/Painter.C
src/frontends/Painter.h
src/frontends/controllers/ChangeLog
src/frontends/controllers/ControlCharacter.C
src/frontends/controllers/ControlCharacter.h
src/frontends/controllers/ControlPrefs.C
src/frontends/controllers/ControlPrefs.h
src/frontends/controllers/character.h
src/frontends/gtk/ChangeLog
src/frontends/gtk/GPainter.C
src/frontends/gtk/GPainter.h
src/frontends/gtk/GScreen.C
src/frontends/gtk/GWorkArea.C
src/frontends/gtk/GWorkArea.h
src/frontends/gtk/lyx_gui.C
src/frontends/lyx_gui.h
src/frontends/qt2/ChangeLog
src/frontends/qt2/QLPainter.C
src/frontends/qt2/QLPainter.h
src/frontends/qt2/QPrefsDialog.C
src/frontends/qt2/QPrefsDialog.h
src/frontends/qt2/QWorkArea.C
src/frontends/qt2/lcolorcache.C
src/frontends/qt2/lcolorcache.h
src/frontends/qt2/lyx_gui.C
src/frontends/qt2/qscreen.C
src/frontends/xforms/ChangeLog
src/frontends/xforms/Color.C
src/frontends/xforms/Color.h
src/frontends/xforms/ColorHandler.C
src/frontends/xforms/ColorHandler.h
src/frontends/xforms/FormCharacter.h
src/frontends/xforms/XPainter.C
src/frontends/xforms/XPainter.h
src/frontends/xforms/lyx_gui.C
src/frontends/xforms/xformsImage.C
src/frontends/xforms/xscreen.C
src/insets/ChangeLog
src/insets/inset.C
src/insets/inset.h
src/insets/insettext.C
src/insets/insettext.h
src/lyx_main.C
src/lyxfont.C
src/lyxfont.h
src/lyxtext.h
src/text.C

index af2e4651ae460b8bc49e560574550943d4b7c1d6..2fa672ff7d950afcc212131975992af7d6515297 100644 (file)
@@ -1,3 +1,16 @@
+2003-09-15  Angus Leeming  <leeming@lyx.org>
+
+       * LColor.h: add an EnumLColor wrapper for LColor::color.
+
+       * lyxfont.[Ch] (color, setColor, realColor):
+       * lyxtext.h, text.C (backgroundColor):
+       pass EnumLColor args to/from the functions, rather than LColor::color ones.
+
+       * lyxfont.h:
+       * lyxtext.h: forward declare EnumLColor.
+
+       * lyx_main.C: add #include "LColor.h".
+
 2003-09-15  Angus Leeming  <leeming@lyx.org>
 
        * .cvsignore: add lyx-gtk.
index 1cb2f8322a951e7d7d8d7d81cafff434318a8115..6e481cf6744272c0031bc82f7b69441902431e50 100644 (file)
@@ -238,6 +238,23 @@ private:
        boost::scoped_ptr<Pimpl> pimpl_;
 };
 
+
+/** \c EnumLColor is a wrapper for LColor::color. It can be forward-declared and
+ *  passed as a function argument without having to expose LColor.h.
+ */
+class EnumLColor {
+        LColor::color val_;
+public:
+        /** The default constructor is nasty,
+        *  but allows us to use EnumLColor in STL containers.
+        */
+       EnumLColor() : val_(static_cast<LColor::color>(-1)) {}
+
+       EnumLColor(LColor::color val) : val_(val) {}
+        operator LColor::color() const{ return val_; }
+};
+
+
 /// the current color definitions
 extern LColor lcolor;
 /// the system color definitions
index 8b136aec5c2470308e0706144440dd9593cebd00..e9eeb4bcf078d9a7809dc92dc104cfdcdc207bb4 100644 (file)
@@ -1,3 +1,16 @@
+2003-09-15  Angus Leeming  <leeming@lyx.org>
+
+       * Painter.C: add #include "LColor.h".
+       (rectText): pass EnumLColor args, rather than LColor::color ones.
+
+       * Painter.h:
+       * lyx_gui.h: remove #include "LColor.h". Forward declare EnumLColor.
+
+       * Painter.h (line, lines, rectangle, fillRectangle, fillPolygon, arc,
+       point, rectText):
+       * lyx_gui.h (hexname, update_color):
+       pass EnumLColor args, rather than LColor::color ones.
+
 2003-09-09  Lars Gullik Bjønnes  <larsbj@lyx.org>
 
        * Timeout.C: change Assert to BOOST_ASSERT
index 6fd9fd166f50083b322053f30263bb699305ecbd..2e0c56249fb6a0ddab84cda072e6326557a58c55 100644 (file)
 
 #include "Painter.h"
 #include "font_metrics.h"
-#include "lyxfont.h"
 #include "WorkArea.h"
 
+#include "LColor.h"
+#include "lyxfont.h"
+
 using std::max;
 
 
@@ -57,8 +59,8 @@ Painter & Painter::buttonFrame(int x, int y, int w, int h)
 Painter & Painter::rectText(int x, int baseline,
        string const & str,
        LyXFont const & font,
-       LColor::color back,
-       LColor::color frame)
+       EnumLColor back,
+       EnumLColor frame)
 {
        int width;
        int ascent;
index 95abeb23fa6d85b6366c3bf5c064ece7a7c3e5b1..5560689c6e46ee16330dbd3f5d9f242412097336 100644 (file)
@@ -15,8 +15,9 @@
 
 
 #include "support/std_string.h"
-#include "LColor.h"
 
+
+class EnumLColor;
 class LyXFont;
 
 namespace lyx {
@@ -77,7 +78,7 @@ public:
        virtual Painter & line(
                int x1, int y1,
                int x2, int y2,
-               LColor::color = LColor::foreground,
+               EnumLColor,
                line_style = line_solid,
                line_width = line_thin) = 0;
 
@@ -91,7 +92,7 @@ public:
                int const * xp,
                int const * yp,
                int np,
-               LColor::color = LColor::foreground,
+               EnumLColor,
                line_style = line_solid,
                line_width = line_thin) = 0;
 
@@ -99,7 +100,7 @@ public:
        virtual Painter & rectangle(
                int x, int y,
                int w, int h,
-               LColor::color = LColor::foreground,
+               EnumLColor,
                line_style = line_solid,
                line_width = line_thin) = 0;
 
@@ -107,26 +108,26 @@ public:
        virtual Painter & fillRectangle(
                int x, int y,
                int w, int h,
-               LColor::color) = 0;
+               EnumLColor) = 0;
 
        /// draw a filled (irregular) polygon
        virtual Painter & fillPolygon(
                int const * xp,
                int const * yp,
                int np,
-               LColor::color = LColor::foreground) = 0;
+               EnumLColor) = 0;
 
        /// draw an arc
        virtual Painter & arc(
                int x, int y,
                unsigned int w, unsigned int h,
                int a1, int a2,
-               LColor::color = LColor::foreground) = 0;
+               EnumLColor) = 0;
 
        /// draw a pixel
        virtual Painter & point(
                int x, int y,
-               LColor::color = LColor::foreground) = 0;
+               EnumLColor) = 0;
 
        /// draw a filled rectangle with the shape of a 3D button
        virtual Painter & button(int x, int y,
@@ -162,8 +163,8 @@ public:
        Painter & rectText(int x, int baseline,
                string const & string,
                LyXFont const & font,
-               LColor::color back = LColor::none,
-               LColor::color frame = LColor::none);
+               EnumLColor back,
+               EnumLColor frame);
 
        /// draw a string and enclose it inside a button frame
        Painter & buttonText(int x,
index d6a5099e8c66b59a4e9e1170e6b7583e47a3c309..d8248e26ed82d2f60901590d7b36ad94a9b543fe 100644 (file)
@@ -1,3 +1,16 @@
+2003-09-15  Angus Leeming  <leeming@lyx.org>
+
+       * ControlCharacter.C (setColor, getColor):
+       pass EnumLColor args, rather than LColor::color ones.
+
+       * ControlPrefs.C: add #include "LColor.h".
+       * ControlPrefs.h:remove #include "LColor.h".
+
+       * ControlPrefs.[Ch] (setColor): pass EnumLColor arg, not than LColor::color one.
+
+       * character.h:remove #include "LColor.h".
+       typedef ColorPair as a std::pair<string, EnumLColor>.
+
 2003-09-15  Lars Gullik Bjønnes  <larsbj@gullik.net>
 
        * ControlAboutlyx.C
index ddce11cf1fe390cc465987d6df9cd706181015c8..759b72969ec35ac755ce1f2852aadf2956f0aef0 100644 (file)
@@ -174,7 +174,7 @@ void ControlCharacter::setBar(frnt::FONT_STATE val)
 }
 
 
-LColor::color ControlCharacter::getColor() const
+EnumLColor ControlCharacter::getColor() const
 {
        if (!font_.get())
                return LColor::ignore;
@@ -183,7 +183,7 @@ LColor::color ControlCharacter::getColor() const
 }
 
 
-void ControlCharacter::setColor(LColor::color val)
+void ControlCharacter::setColor(EnumLColor val)
 {
        switch (val) {
        case LColor::ignore:
index b2d0fe2f4abd6e9b792369aa30726fe764426ed8..e22ecbefc0b1f9e1a5ce76ea03f122c2ee0878df 100644 (file)
@@ -17,6 +17,9 @@
 #include "character.h"
 
 
+class EnumLColor;
+
+
 class ControlCharacter : public Dialog::Controller {
 public:
        ///
@@ -41,7 +44,7 @@ public:
        ///
        void setBar(frnt::FONT_STATE);
        ///
-       void setColor(LColor::color);
+       void setColor(EnumLColor);
        ///
        void setLanguage(string const &);
        ///
@@ -58,7 +61,7 @@ public:
        ///
        frnt::FONT_STATE getBar() const;
        ///
-       LColor::color getColor() const;
+       EnumLColor getColor() const;
        ///
        string getLanguage() const;
        ///
index 547cc742b4c9b91cc888f23ca6629d13dbc20dec..7c60b949fd4e57b8c02d079867232ceaa7f5252f 100644 (file)
@@ -20,6 +20,7 @@
 #include "format.h"
 #include "gettext.h"
 #include "funcrequest.h"
+#include "LColor.h"
 #include "lfuns.h"
 
 #include "frontends/Dialogs.h"
@@ -133,7 +134,7 @@ void ControlPrefs::redrawGUI()
 }
 
 
-void ControlPrefs::setColor(LColor::color col, string const & hex)
+void ControlPrefs::setColor(EnumLColor col, string const & hex)
 {
        string const s = lcolor.getLyXName(col) + ' ' + hex;
        lv_.dispatch(FuncRequest(LFUN_SET_COLOR, s));
index 0452bbca4a3ef41ca3cf05b2dbc8cba20f2e897d..c5f1a4b3017d14b51778aea181bf3260b7614daa 100644 (file)
 #include "ControlDialog_impl.h"
 #include "support/std_string.h"
 #include "lyxrc.h"
-#include "LColor.h"
 
 
 class Converters;
+class EnumLColor;
 class Formats;
 
 class ControlPrefs : public ControlDialogBI {
@@ -50,7 +50,7 @@ public:
        void redrawGUI();
 
        /// set a color
-       void setColor(LColor::color col, string const & hex);
+       void setColor(EnumLColor col, string const & hex);
 
        /// update the screen fonts after change
        void updateScreenFonts();
index 732d4f59da2b7a6e2eddf77cde99ed952c055b4b..ae12385820240cf4440125deae95ebf59ef7ad36 100644 (file)
 
 
 #include "lyxfont.h"
-#include "LColor.h"
 
 #include <utility>
 #include <vector>
 
+
+class EnumLColor;
+
+
 /** Functions of use to the character GUI controller and view */
 namespace frnt {
 
@@ -47,7 +50,7 @@ typedef std::pair<string, LyXFont::FONT_SIZE>   SizePair;
 ///
 typedef std::pair<string, FONT_STATE> BarPair;
 ///
-typedef std::pair<string, LColor::color> ColorPair;
+typedef std::pair<string, EnumLColor> ColorPair;
 
 ///
 std::vector<FamilyPair>   const getFamilyData();
index e414752541d11cf2576f43756acb4b776bc42963..127438579c0df9d863ea8167ab504b368f07644b 100644 (file)
@@ -1,3 +1,22 @@
+2003-09-15  Angus Leeming  <leeming@lyx.org>
+
+       * GPainter.C: add #include "LColor.h".
+       * GPainter.[Ch] (setForeground, point, line, lines, rectangle, fillRectangle,
+       fillPolygon, arc): pass EnumLColor args, rather than LColor::color ones.
+
+       * GScreen.C:
+       * GWorkArea.C: add #include "LColor.h".
+
+       * GWorkArea.h: remove #include "LColor.h".
+       change typedefs to take an EnumLColor arg rather than an LColor::color one.
+
+       * GWorkArea.h (getColor, getXftColor, cacheColor, cacheXftColor):
+       * GWorkArea.[Ch] (getXftColor, getGdkColor): pass EnumLColor args, rather
+       than LColor::color ones.
+
+       * lyx_gui.C (hexname, update_color): pass EnumLColor args, rather
+       than LColor::color ones.
+
 2003-09-10  Angus Leeming  <leeming@lyx.org>
 
        * GToolbar.C (onLayoutSelected): missed a change from a call to the
index e3eac76778576dcc6474bd85238c9ee1386c8384..f5357cec9d260bbb131b097f19765fe52615defd 100644 (file)
@@ -18,6 +18,7 @@
 #include "lyxrc.h"
 #include "encoding.h"
 #include "language.h"
+#include "LColor.h"
 #include "xftFontLoader.h"
 #include "xformsImage.h"
 #include "frontends/font_metrics.h"
@@ -50,7 +51,7 @@ int GPainter::paperHeight() const
 }
 
 
-void GPainter::setForeground(Glib::RefPtr<Gdk::GC> gc, LColor::color clr)
+void GPainter::setForeground(Glib::RefPtr<Gdk::GC> gc, EnumLColor clr)
 {
        Gdk::Color * gclr = owner_.getColorHandler().getGdkColor(clr);
        gc->set_foreground(*gclr);
@@ -84,7 +85,7 @@ void GPainter::setLineParam(Glib::RefPtr<Gdk::GC> gc,
 }
 
 
-Painter & GPainter::point(int x, int y, LColor::color c)
+Painter & GPainter::point(int x, int y, EnumLColor c)
 {
        setForeground(owner_.getGC(), c);
        owner_.getPixmap()->draw_point(owner_.getGC(), x, y);
@@ -94,7 +95,7 @@ Painter & GPainter::point(int x, int y, LColor::color c)
 
 Painter & GPainter::line(int x1, int y1,
        int x2, int y2,
-       LColor::color col,
+       EnumLColor col,
        line_style ls,
        line_width lw)
 {
@@ -107,7 +108,7 @@ Painter & GPainter::line(int x1, int y1,
 
 Painter & GPainter::lines(int const * xp, int const * yp,
        int np,
-       LColor::color col,
+       EnumLColor col,
        line_style ls,
        line_width lw)
 {
@@ -126,7 +127,7 @@ Painter & GPainter::lines(int const * xp, int const * yp,
 
 Painter & GPainter::rectangle(int x, int y,
        int w, int h,
-       LColor::color col,
+       EnumLColor col,
        line_style ls,
        line_width lw)
 {
@@ -139,7 +140,7 @@ Painter & GPainter::rectangle(int x, int y,
 
 Painter & GPainter::fillRectangle(int x, int y,
        int w, int h,
-       LColor::color col)
+       EnumLColor col)
 {
        setForeground(owner_.getGC(), col);
        owner_.getPixmap()->draw_rectangle(owner_.getGC(), true, x, y, w, h);
@@ -148,7 +149,7 @@ Painter & GPainter::fillRectangle(int x, int y,
 
 
 Painter & GPainter::fillPolygon(int const * xp, int const * yp,
-       int np, LColor::color col)
+       int np, EnumLColor col)
 {
        setForeground(owner_.getGC(), col);
        std::vector<Gdk::Point> points(np);
@@ -164,7 +165,7 @@ Painter & GPainter::fillPolygon(int const * xp, int const * yp,
 
 Painter & GPainter::arc(int x, int y,
        unsigned int w, unsigned int h,
-       int a1, int a2, LColor::color col)
+       int a1, int a2, EnumLColor col)
 {
        setForeground(owner_.getGC(), col);
        owner_.getPixmap()->draw_arc(owner_.getGC(),
index 396bf1f9fb95c44b67c4e340af2ef9ce3d3aae83..8d20826bb9811531aad97ef531524d4d315e0dca 100644 (file)
@@ -33,15 +33,15 @@ public:
        /// return the height of the work area in pixels
        virtual int paperHeight() const;
 
-       void setForeground(Glib::RefPtr<Gdk::GC> gc, LColor::color clr);
+       void setForeground(Glib::RefPtr<Gdk::GC> gc, EnumLColor clr);
        void setLineParam(Glib::RefPtr<Gdk::GC> gc,
                          line_style ls, line_width lw);
-       XftColor * getXftColor(LColor::color clr);
+       XftColor * getXftColor(EnumLColor clr);
        /// draw a line from point to point
        virtual Painter & line(
                int x1, int y1,
                int x2, int y2,
-               LColor::color = LColor::foreground,
+               EnumLColor,
                line_style = line_solid,
                line_width = line_thin);
 
@@ -55,7 +55,7 @@ public:
                int const * xp,
                int const * yp,
                int np,
-               LColor::color = LColor::foreground,
+               EnumLColor,
                line_style = line_solid,
                line_width = line_thin);
 
@@ -63,7 +63,7 @@ public:
        virtual Painter & rectangle(
                int x, int y,
                int w, int h,
-               LColor::color = LColor::foreground,
+               EnumLColor,
                line_style = line_solid,
                line_width = line_thin);
 
@@ -71,26 +71,26 @@ public:
        virtual Painter & fillRectangle(
                int x, int y,
                int w, int h,
-               LColor::color);
+               EnumLColor);
 
        /// draw a filled (irregular) polygon
        virtual Painter & fillPolygon(
                int const * xp,
                int const * yp,
                int np,
-               LColor::color = LColor::foreground);
+               EnumLColor);
 
        /// draw an arc
        virtual Painter & arc(
                int x, int y,
                unsigned int w, unsigned int h,
                int a1, int a2,
-               LColor::color = LColor::foreground);
+               EnumLColor);
 
        /// draw a pixel
        virtual Painter & point(
                int x, int y,
-               LColor::color = LColor::foreground);
+               EnumLColor);
 
        /// draw an image from the image cache
        virtual Painter & image(int x, int y,
index 212361f489aa8d010eabbf1dc2f0bade60a9fa29..55ae48aefc2410f91846eec1081d298df3400f69 100644 (file)
 #include <config.h>
 #include <gtkmm.h>
 
-#include <algorithm>
+#include "GScreen.h"
 
-#include "frontends/screen.h"
-#include "frontends/font_metrics.h"
 #include "GWorkArea.h"
-#include "GScreen.h"
-#include "lyxtext.h"
-#include "lyxrow.h"
-#include "Painter.h"
-#include "WorkArea.h"
+
 #include "buffer.h"
 #include "BufferView.h"
-#include "insets/insettext.h"
-#include "language.h"
 #include "debug.h"
+#include "language.h"
+#include "LColor.h"
+#include "lyxtext.h"
+#include "lyxrow.h"
+
+#include "frontends/screen.h"
+#include "frontends/font_metrics.h"
+#include "frontends/Painter.h"
+#include "frontends/WorkArea.h"
+
+#include "insets/insettext.h"
+
+#include <algorithm>
 
 
 GScreen::GScreen(GWorkArea & o)
index a407f549f8251392c810794677dcfc643d5e6b17..225f6a2849412242f9c15f6608454dd8ff0b7886 100644 (file)
 #include <X11/Xft/Xft.h>
 
 #include "GWorkArea.h"
-#include "debug.h"
-#include "funcrequest.h"
 #include "GView.h"
 #include "GtkmmX.h"
 #include "GLyXKeySym.h"
 
+#include "debug.h"
+#include "funcrequest.h"
+#include "LColor.h"
+
 ColorCache colorCache;
 
 
@@ -35,7 +37,7 @@ void ColorCache::clear()
 }
 
 
-XftColor * ColorHandler::getXftColor(LColor::color clr)
+XftColor * ColorHandler::getXftColor(EnumLColor clr)
 {
        XftColor * xclr = colorCache.getXftColor(clr);
        if (!xclr) {
@@ -52,7 +54,7 @@ XftColor * ColorHandler::getXftColor(LColor::color clr)
 }
 
 
-Gdk::Color * ColorHandler::getGdkColor(LColor::color clr)
+Gdk::Color * ColorHandler::getGdkColor(EnumLColor clr)
 {
        Gdk::Color * gclr = colorCache.getColor(clr);
        if (!gclr) {
index 63d45d4110ead5eea886a3b155d3664273ff3b1b..e6a47eb981768d0bc4f3a97f1f5b4cac1871c7fb 100644 (file)
 #include <gdk/gdkx.h>
 #include "frontends/WorkArea.h"
 #include "GPainter.h"
-#include "LColor.h"
 #include <gtk/gtk.h>
 #include <X11/Xft/Xft.h>
 
+class EnumLColor;
+
 class ColorCache
 {
-       typedef std::map<LColor::color, Gdk::Color *> Map;
+       typedef std::map<EnumLColor, Gdk::Color *> Map;
        typedef Map::iterator MapIt;
-       typedef std::map<LColor::color, XftColor *> Map2;
+       typedef std::map<EnumLColor, XftColor *> Map2;
        typedef Map2::iterator MapIt2;
 public:
        ~ColorCache() { clear(); }
-       Gdk::Color * getColor(LColor::color clr)
+       Gdk::Color * getColor(EnumLColor clr)
        {
                MapIt it = cache_.find(clr);
                return it == cache_.end() ? 0 : it->second;
        }
-       XftColor * getXftColor(LColor::color clr)
+       XftColor * getXftColor(EnumLColor clr)
        {
                MapIt2 it = cache2_.find(clr);
                return it == cache2_.end() ? 0 : it->second;
        }
-       void cacheColor(LColor::color clr, Gdk::Color * gclr)
+       void cacheColor(EnumLColor clr, Gdk::Color * gclr)
        {
                cache_[clr] = gclr;
        }
-       void cacheXftColor(LColor::color clr, XftColor * xclr)
+       void cacheXftColor(EnumLColor clr, XftColor * xclr)
        {
                cache2_[clr] = xclr;
        }
@@ -57,8 +58,8 @@ class ColorHandler
 {
 public:
        ColorHandler(GWorkArea& owner) : owner_(owner) {}
-       XftColor * getXftColor(LColor::color clr);
-       Gdk::Color * getGdkColor(LColor::color clr);
+       XftColor * getXftColor(EnumLColor clr);
+       Gdk::Color * getGdkColor(EnumLColor clr);
 private:
        GWorkArea & owner_;
 };
index f23e7232698fa453b6ed012b0a9e250d9c1a5b5c..750e040037a36c8c64fd629e2504540afb8f243e 100644 (file)
@@ -362,7 +362,7 @@ FuncStatus lyx_gui::getStatus(FuncRequest const & /*ev*/)
 }
 
 
-string const lyx_gui::hexname(LColor::color col)
+string const lyx_gui::hexname(EnumLColor col)
 {
        Gdk::Color gdkColor;
        Gdk::Color * gclr = colorCache.getColor(col);
@@ -384,7 +384,7 @@ string const lyx_gui::hexname(LColor::color col)
 }
 
 
-void lyx_gui::update_color(LColor::color /*col*/)
+void lyx_gui::update_color(EnumLColor /*col*/)
 {
        colorCache.clear();
 }
index 2e768400b68627f4767de5a538bdc69c6f0db520..e27e2ffccfce747fcf8d069de26a17b3056e3798 100644 (file)
 #ifndef LYX_GUI_H
 #define LYX_GUI_H
 
-#include "LColor.h"
 #include "support/std_string.h"
 #include "FuncStatus.h"
 
 #include <vector>
 
 class Dialogs;
+class EnumLColor;
 class LyXFont;
 class LyXComm;
 class FuncRequest;
@@ -72,12 +72,12 @@ FuncStatus getStatus(FuncRequest const & ev);
 /** Eg, passing LColor::black returns "000000",
  *      passing LColor::white returns "ffffff".
  */
-string const hexname(LColor::color col);
+string const hexname(EnumLColor col);
 
 /**
  * update an altered GUI color
  */
-void update_color(LColor::color col);
+void update_color(EnumLColor col);
 
 /**
  * update the font cache
index 2583cf406fbcfbd0bd841dadbbc563024b76de9a..57556defebd7d725c07d7e67c961cb753f9201f0 100644 (file)
@@ -1,3 +1,23 @@
+2003-09-15  Angus Leeming  <leeming@lyx.org>
+
+       * QLPainter.C: add #include "LColor.h".
+       * QLPainter.[Ch] (setPen, point, line, lines, rectangle, fillPolygon, arc):
+       pass EnumLColor args, rather than LColor::color ones.
+
+       * QPrefsDialog.C: add #include "LColor.h".
+       * QPrefsDialog.h: remove #include "LColor.h". Store a vector<EnumLColor> colors_;
+
+       * QWorkArea.C: add #include "LColor.h".
+
+       * lcolorcache.C: add #include "LColor.h".
+       * lcolorcache.h: store a map<EnumLColor, QColor>.
+       * lcolorcache.[Ch] (get):pass EnumLColor args, rather than LColor::color ones.
+
+       * qscreen.C: add #include "LColor.h".
+
+       * lyx_gui.C (hexname, update_color): pass EnumLColor args, rather
+       than LColor::color ones.
+
 2003-09-15  Angus Leeming  <leeming@lyx.org>
 
        * QAbout.C (build_dialog): 
index 2ffc7ddf5e1ddb6b81934cbfcc67da5c3e7d2364..8de17fae2a1e1778dabd37ec5cae96ed4332c6fa 100644 (file)
@@ -14,6 +14,7 @@
 #include "font_metrics.h"
 #include "debug.h"
 #include "language.h"
+#include "LColor.h"
 
 #include "QWorkArea.h"
 #include "qfont_loader.h"
@@ -62,7 +63,7 @@ int QLPainter::paperHeight() const
 }
 
 
-QPainter & QLPainter::setPen(LColor::color c,
+QPainter & QLPainter::setPen(EnumLColor c,
        Painter::line_style ls, Painter::line_width lw)
 {
        QPen pen = qp_->pen();
@@ -84,7 +85,7 @@ QPainter & QLPainter::setPen(LColor::color c,
 }
 
 
-Painter & QLPainter::point(int x, int y, LColor::color c)
+Painter & QLPainter::point(int x, int y, EnumLColor c)
 {
        setPen(c).drawPoint(x, y);
        return *this;
@@ -93,7 +94,7 @@ Painter & QLPainter::point(int x, int y, LColor::color c)
 
 Painter & QLPainter::line(int x1, int y1,
        int x2, int y2,
-       LColor::color col,
+       EnumLColor col,
        line_style ls,
        line_width lw)
 {
@@ -104,7 +105,7 @@ Painter & QLPainter::line(int x1, int y1,
 
 Painter & QLPainter::lines(int const * xp, int const * yp,
        int np,
-       LColor::color col,
+       EnumLColor col,
        line_style ls,
        line_width lw)
 {
@@ -126,7 +127,7 @@ Painter & QLPainter::lines(int const * xp, int const * yp,
 
 Painter & QLPainter::rectangle(int x, int y,
        int w, int h,
-       LColor::color col,
+       EnumLColor col,
        line_style ls,
        line_width lw)
 {
@@ -137,7 +138,7 @@ Painter & QLPainter::rectangle(int x, int y,
 
 Painter & QLPainter::fillRectangle(int x, int y,
        int w, int h,
-       LColor::color col)
+       EnumLColor col)
 {
        qp_->fillRect(x, y, w, h, lcolorcache.get(col));
        return *this;
@@ -145,7 +146,7 @@ Painter & QLPainter::fillRectangle(int x, int y,
 
 
 Painter & QLPainter::fillPolygon(int const * xp, int const * yp,
-       int np, LColor::color col)
+       int np, EnumLColor col)
 {
        // Must use new as np is not known at compile time.
        boost::scoped_array<QCOORD> points(new QCOORD[np * 2]);
@@ -168,7 +169,7 @@ Painter & QLPainter::fillPolygon(int const * xp, int const * yp,
 
 Painter & QLPainter::arc(int x, int y,
        unsigned int w, unsigned int h,
-       int a1, int a2, LColor::color col)
+       int a1, int a2, EnumLColor col)
 {
        // LyX usings 1/64ths degree, Qt usings 1/16th
        setPen(col).drawArc(x, y, w, h, a1 / 4, a2 / 4);
index 45afb461c100601434b0f2b6745184bd5e191409..ff3fc3d4fb0d117850f262a521dcf25f48af6e1d 100644 (file)
@@ -15,7 +15,6 @@
 
 #include "Painter.h"
 #include "support/std_string.h"
-#include "LColor.h"
 
 #include <boost/scoped_ptr.hpp>
 
@@ -46,7 +45,7 @@ public:
        virtual Painter & line(
                int x1, int y1,
                int x2, int y2,
-               LColor::color = LColor::foreground,
+               EnumLColor,
                line_style = line_solid,
                line_width = line_thin);
 
@@ -60,7 +59,7 @@ public:
                int const * xp,
                int const * yp,
                int np,
-               LColor::color = LColor::foreground,
+               EnumLColor,
                line_style = line_solid,
                line_width = line_thin);
 
@@ -68,7 +67,7 @@ public:
        virtual Painter & rectangle(
                int x, int y,
                int w, int h,
-               LColor::color = LColor::foreground,
+               EnumLColor,
                line_style = line_solid,
                line_width = line_thin);
 
@@ -76,26 +75,26 @@ public:
        virtual Painter & fillRectangle(
                int x, int y,
                int w, int h,
-               LColor::color);
+               EnumLColor);
 
        /// draw a filled (irregular) polygon
        virtual Painter & fillPolygon(
                int const * xp,
                int const * yp,
                int np,
-               LColor::color = LColor::foreground);
+               EnumLColor);
 
        /// draw an arc
        virtual Painter & arc(
                int x, int y,
                unsigned int w, unsigned int h,
                int a1, int a2,
-               LColor::color = LColor::foreground);
+               EnumLColor);
 
        /// draw a pixel
        virtual Painter & point(
                int x, int y,
-               LColor::color = LColor::foreground);
+               EnumLColor);
 
        /// draw an image from the image cache
        virtual Painter & image(int x, int y,
@@ -122,7 +121,7 @@ private:
                QString const & str, LyXFont const & f);
 
        /// set pen parameters
-       QPainter & setPen(LColor::color c,
+       QPainter & setPen(EnumLColor c,
                line_style ls = line_solid,
                line_width lw = line_thin);
 
index f1ed5b091431f5f8bd2166542b01fe39b5b367b7..1d470e704ec60798afce735d2140197d8027c614 100644 (file)
@@ -34,6 +34,7 @@
 #include "ui/QPrefIdentityModule.h"
 
 #include "gettext.h"
+#include "LColor.h"
 
 #include "panelstack.h"
 #include <qpushbutton.h>
index 72e98c43bc812e549d52d55c22e4277c6ad2b321..a99dfd58a9cdf282be1afb59cbf95bfb8643752e 100644 (file)
 #define QPREFSDIALOG_H
 
 
-#include "LColor.h"
-
 #include "ui/QPrefsDialogBase.h"
 
 #include <vector>
 
+class EnumLColor;
 class QPrefs;
 class QPrefAsciiModule;
 class QPrefDateModule;
@@ -84,7 +83,7 @@ protected:
 
 private:
 
-       std::vector<LColor::color> colors_;
+       std::vector<EnumLColor> colors_;
 
        QPrefAsciiModule * asciiModule;
        QPrefDateModule * dateModule;
index bbfec7d53339fef606d0994e1e7029bea52ea7ba..2110423cdeb0a2f8c9aa0d99cfb449129eef96d0 100644 (file)
@@ -12,6 +12,7 @@
 
 #include "QWorkArea.h"
 #include "debug.h"
+#include "LColor.h"
 #include "qt_helpers.h"
 #include "lcolorcache.h"
 #include "funcrequest.h"
index 70bbc6517fe5e8dde1c710c217f393b328aa73cd..9e128ad04bbaaa2e435cc9ef8fc1f9f7f96c9b2f 100644 (file)
@@ -12,6 +12,8 @@
 
 #include "lcolorcache.h"
 
+#include "LColor.h"
+
 LColorCache lcolorcache;
 
 
@@ -20,7 +22,7 @@ LColorCache::LColorCache()
 }
 
 
-QColor const & LColorCache::get(LColor::color col) const
+QColor const & LColorCache::get(EnumLColor col) const
 {
        lcolor_map::const_iterator cit = colormap.find(col);
        if (cit != colormap.end())
index 05e045610f9c3de5fb9db003b3cc2155aec90c17..60ee45ff305ae64f5e81d0df3e71c65626218d9e 100644 (file)
 
 #include <map>
 
-#include "LColor.h"
-
 #include <qcolor.h>
 
+
+class EnumLColor;
+
+
 // FIXME: use a fixed-size array not a map ?
 
 /**
@@ -28,13 +30,13 @@ public:
        LColorCache();
 
        /// get the given color
-       QColor const & get(LColor::color color) const;
+       QColor const & get(EnumLColor color) const;
 
        /// clear all colors
        void clear();
 
 private:
-       typedef std::map<LColor::color, QColor> lcolor_map;
+       typedef std::map<EnumLColor, QColor> lcolor_map;
 
        mutable lcolor_map colormap;
 };
index 6f40e75d9327d0aca319cfc96d5b68f6e9a9953a..3d21b59fc39e0aa21d776f920c197e9af1e31c7a 100644 (file)
@@ -192,13 +192,13 @@ FuncStatus getStatus(FuncRequest const & ev)
 }
 
 
-string const hexname(LColor::color col)
+string const hexname(EnumLColor col)
 {
        return ltrim(fromqstr(lcolorcache.get(col).name()), "#");
 }
 
 
-void update_color(LColor::color)
+void update_color(EnumLColor)
 {
        // FIXME: Bleh, can't we just clear them all at once ?
        lcolorcache.clear();
index 1225a89cfe87eee8e196e95b67b8729f9146c432..beac468056a47a574ba7c97bff0e1d002b0795ff 100644 (file)
@@ -13,6 +13,7 @@
 #include "QWorkArea.h"
 #include "qscreen.h"
 #include "debug.h"
+#include "LColor.h"
 
 #include <qapplication.h>
 
index 69ff1b0d7cf12c4892836305e55f57968715085e..e0649d8775e82b90f077090b83bef404f70fc2b8 100644 (file)
@@ -1,3 +1,26 @@
+2003-09-15  Angus Leeming  <leeming@lyx.org>
+
+       * Color.C:
+       * ColorHandler.C:
+       * XPainter.C:
+       * xformsImage.C
+       * xscreen.C: add #include "LColor.h".
+
+       * Color.h: remove #include "LColor.h".
+
+       * Color.[Ch] (getRGBColor):
+       * ColorHandler.[Ch] (colorPixel, getGCForeground, getGCLinepars, updateColor):
+       pass EnumLColor args, rather than LColor::color ones.
+
+       * FormCharacter.h: store vector<EnumLColor> color_.
+
+       * XPainter.[Ch] (point, line, lines, rectangle, fillPolygon):
+
+       * lyx_gui.C (hexname, update_color): pass EnumLColor args, rather
+       than LColor::color ones.
+
+       * xformsImage.C:
+
 2003-09-15  Lars Gullik Bjønnes  <larsbj@gullik.net>
 
        * Color.C
index 7b1bd7a6062f009b7c99e537415df8404e5fea01..8b688d47344e596a3c98e7164e3389af8d684fbf 100644 (file)
@@ -14,6 +14,8 @@
 
 #include "lyx_forms.h"
 
+#include "LColor.h"
+
 #include "support/std_sstream.h"
 
 #include <cmath>
@@ -48,7 +50,7 @@ int hexstrToInt(string const & str)
 
 
 
-bool getRGBColor(LColor::color col,
+bool getRGBColor(EnumLColor col,
                 unsigned int & r, unsigned int & g, unsigned int & b)
 {
        string const name = lcolor.getX11Name(col);
index 86a8de28813ae3dee25b420fc52efb8e521ab274..6216e5cefd127f18d69eae46b04a351745e55211 100644 (file)
 
 
 #include "support/std_string.h"
-#include "LColor.h"
+
+
+class EnumLColor;
+
 
 /** Given col, fills r, g, b in the range 0-255.
     The function returns true if successful.
     It returns false on failure and sets r, g, b to 0. */
-bool getRGBColor(LColor::color col,
+bool getRGBColor(EnumLColor col,
                 unsigned int & r, unsigned int & g, unsigned int & b);
 
 struct RGBColor;
index 96600a1816c1b85dcbbc143716ec102d830649a7..846792886089077880b89a17683bec6ea9ddb671 100644 (file)
@@ -14,6 +14,7 @@
 
 #include "debug.h"
 #include "gettext.h"
+#include "LColor.h"
 
 #include "support/lstrings.h"
 #include "support/tostr.h"
@@ -76,7 +77,7 @@ LyXColorHandler::~LyXColorHandler()
 }
 
 
-unsigned long LyXColorHandler::colorPixel(LColor::color c)
+unsigned long LyXColorHandler::colorPixel(EnumLColor c)
 {
        XGCValues val;
        XGetGCValues(display, getGCForeground(c), GCForeground, &val);
@@ -162,7 +163,7 @@ GC LyXColorHandler::getGCForeground(string const & s)
 
 // Gets GC according to color
 // Uses caching
-GC LyXColorHandler::getGCForeground(LColor::color c)
+GC LyXColorHandler::getGCForeground(EnumLColor c)
 {
        if (static_cast<unsigned>(c) >= colorGCcache.size()) {
                colorGCcache.resize(c + 1, 0);
@@ -187,7 +188,7 @@ GC LyXColorHandler::getGCForeground(LColor::color c)
 
 // Gets GC for line
 GC LyXColorHandler::getGCLinepars(Painter::line_style ls,
-                                 Painter::line_width lw, LColor::color c)
+                                 Painter::line_width lw, EnumLColor c)
 {
        //if (lyxerr.debugging()) {
        //      lyxerr << "Painter drawable: " << drawable() << endl;
@@ -233,7 +234,7 @@ GC LyXColorHandler::getGCLinepars(Painter::line_style ls,
 
 
 // update GC cache after color redefinition
-void LyXColorHandler::updateColor (LColor::color c)
+void LyXColorHandler::updateColor (EnumLColor c)
 {
        // color GC cache
        GC gc = colorGCcache[c];
index ba2304373d73a1297fe86986de609aa89e41d757..f1acce0b473150372811c931ee8361b554b69a61 100644 (file)
@@ -22,6 +22,7 @@
 // This is only included to provide stuff for the non-public sections
 #include <X11/Xlib.h>
 
+class EnumLColor;
 class LyXFont;
 
 /**
@@ -35,14 +36,14 @@ public:
        ///
        ~LyXColorHandler();
        ///
-       unsigned long colorPixel(LColor::color c);
+       unsigned long colorPixel(EnumLColor c);
        ///
-       GC getGCForeground(LColor::color c);
+       GC getGCForeground(EnumLColor c);
        ///
        GC getGCLinepars(Painter::line_style,
-                        Painter::line_width, LColor::color c);
+                        Painter::line_width, EnumLColor c);
        /// update the cache after a color definition change
-       void updateColor(LColor::color c);
+       void updateColor(EnumLColor c);
 
 private:
        ///
index fc125656d94a59d5fcddf3823c1a67c93d06de39..a66c85d2a1e0f6b86e23907a0f02ad591ca74927 100644 (file)
@@ -16,6 +16,7 @@
 #include "FormDialogView.h"
 #include "ControlCharacter.h" // for ControlCharacter enum
 
+struct EnumLColor;
 struct FD_character;
 
 /**
@@ -53,7 +54,7 @@ private:
        ///
        std::vector<frnt::FONT_STATE>      bar_;
        ///
-       std::vector<LColor::color>         color_;
+       std::vector<EnumLColor>            color_;
        ///
        std::vector<string>                lang_;
 };
index 912e4bdb12cd8b989a890e09bbf04f0df3d52691..dc762f7cfed950312a6ac6afed7a8a93f670afc5 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "encoding.h"
 #include "language.h"
+#include "LColor.h"
 #include "lyxfont.h"
 #include "lyxrc.h"
 
@@ -48,7 +49,7 @@ int XPainter::paperHeight() const
 }
 
 
-Painter & XPainter::point(int x, int y, LColor::color c)
+Painter & XPainter::point(int x, int y, EnumLColor c)
 {
        XDrawPoint(fl_get_display(), owner_.getPixmap(),
                lyxColorHandler->getGCForeground(c), x, y);
@@ -58,7 +59,7 @@ Painter & XPainter::point(int x, int y, LColor::color c)
 
 Painter & XPainter::line(int x1, int y1,
        int x2, int y2,
-       LColor::color col,
+       EnumLColor col,
        line_style ls,
        line_width lw)
 {
@@ -71,7 +72,7 @@ Painter & XPainter::line(int x1, int y1,
 
 Painter & XPainter::lines(int const * xp, int const * yp,
        int np,
-       LColor::color col,
+       EnumLColor col,
        line_style ls,
        line_width lw)
 {
@@ -92,7 +93,7 @@ Painter & XPainter::lines(int const * xp, int const * yp,
 
 Painter & XPainter::rectangle(int x, int y,
        int w, int h,
-       LColor::color col,
+       EnumLColor col,
        line_style ls,
        line_width lw)
 {
@@ -105,7 +106,7 @@ Painter & XPainter::rectangle(int x, int y,
 
 Painter & XPainter::fillRectangle(int x, int y,
        int w, int h,
-       LColor::color col)
+       EnumLColor col)
 {
        XFillRectangle(fl_get_display(), owner_.getPixmap(),
                lyxColorHandler->getGCForeground(col), x, y, w, h);
@@ -114,7 +115,7 @@ Painter & XPainter::fillRectangle(int x, int y,
 
 
 Painter & XPainter::fillPolygon(int const * xp, int const * yp,
-       int np, LColor::color col)
+       int np, EnumLColor col)
 {
        boost::scoped_array<XPoint> points(new XPoint[np]);
 
@@ -133,7 +134,7 @@ Painter & XPainter::fillPolygon(int const * xp, int const * yp,
 
 Painter & XPainter::arc(int x, int y,
        unsigned int w, unsigned int h,
-       int a1, int a2, LColor::color col)
+       int a1, int a2, EnumLColor col)
 {
        XDrawArc(fl_get_display(), owner_.getPixmap(),
                lyxColorHandler->getGCForeground(col),
index c98bb757722d0c83330a2814525ec8d29c9bc9f3..ba1d8e602b2631a676b408fb07e4d1665b010fbc 100644 (file)
@@ -38,7 +38,7 @@ public:
        virtual Painter & line(
                int x1, int y1,
                int x2, int y2,
-               LColor::color = LColor::foreground,
+               EnumLColor,
                line_style = line_solid,
                line_width = line_thin);
 
@@ -52,7 +52,7 @@ public:
                int const * xp,
                int const * yp,
                int np,
-               LColor::color = LColor::foreground,
+               EnumLColor,
                line_style = line_solid,
                line_width = line_thin);
 
@@ -60,7 +60,7 @@ public:
        virtual Painter & rectangle(
                int x, int y,
                int w, int h,
-               LColor::color = LColor::foreground,
+               EnumLColor,
                line_style = line_solid,
                line_width = line_thin);
 
@@ -68,26 +68,26 @@ public:
        virtual Painter & fillRectangle(
                int x, int y,
                int w, int h,
-               LColor::color);
+               EnumLColor);
 
        /// draw a filled (irregular) polygon
        virtual Painter & fillPolygon(
                int const * xp,
                int const * yp,
                int np,
-               LColor::color = LColor::foreground);
+               EnumLColor);
 
        /// draw an arc
        virtual Painter & arc(
                int x, int y,
                unsigned int w, unsigned int h,
                int a1, int a2,
-               LColor::color = LColor::foreground);
+               EnumLColor);
 
        /// draw a pixel
        virtual Painter & point(
                int x, int y,
-               LColor::color = LColor::foreground);
+               EnumLColor);
 
        /// draw an image from the image cache
        virtual Painter & image(int x, int y,
index d702fbfd1b69a1ccb5bde1cc5d8cbf87018c99b1..45c0f91707fc997c048ce5ae505b45da6c2d2c94 100644 (file)
@@ -330,7 +330,7 @@ FuncStatus getStatus(FuncRequest const & /*ev*/)
        return FuncStatus();
 }
 
-string const hexname(LColor::color col)
+string const hexname(EnumLColor col)
 {
        unsigned int r, g, b;
        bool const success = getRGBColor(col, r, g, b);
@@ -351,7 +351,7 @@ string const hexname(LColor::color col)
 }
 
 
-void update_color(LColor::color col)
+void update_color(EnumLColor col)
 {
        lyxColorHandler->updateColor(col);
 }
index fe6eec97d387c7ce114a4e56f22f15b07d7770ce..fb24938330e05c5716221fa3af4ce98de14d5ce5 100644 (file)
 #include <config.h>
 
 #include "xformsImage.h"
-#include "graphics/GraphicsParams.h"
 #include "Color.h"
-#include "format.h"
+
 #include "debug.h"
+#include "format.h"
+#include "LColor.h"
+
+#include "graphics/GraphicsParams.h"
+
 #include "support/lstrings.h"
 #include "support/lyxfunctional.h"  // compare_memfun
 #include "support/lyxlib.h"
index a00b187de091f48ac9973c6b44128fe01bc239ba..4375e57a423fd6d78da22d50014a5784f739fa1f 100644 (file)
@@ -17,6 +17,7 @@
 #include "XWorkArea.h"
 
 #include "debug.h"
+#include "LColor.h"
 
 using std::endl;
 
index bd9ab90d8559223ac11d8ee28f7ed1238f29a77f..8988e47c4a0d1cd8cb575e277427634c477a9a17 100644 (file)
@@ -1,3 +1,9 @@
+2003-09-15  Angus Leeming  <leeming@lyx.org>
+
+       * inset.[Ch] (setBackgroundColor, backgroundColor):
+       * insettext.[Ch] (setFrameColor):
+       pass EnumLColor args, rather than LColor::color ones.
+
 2003-09-15  Lars Gullik Bjønnes  <larsbj@gullik.net>
 
        * insetcommand.C
index 6f7fc7d1c73236e198b85b15ba312e182b8a902c..0b19aebd874a40e89b0925daa639ecaffcd992f9 100644 (file)
@@ -84,13 +84,13 @@ LyXText * InsetOld::getLyXText(BufferView const * bv, bool /*recursive*/) const
 }
 
 
-void InsetOld::setBackgroundColor(LColor::color color)
+void InsetOld::setBackgroundColor(EnumLColor color)
 {
        background_color_ = color;
 }
 
 
-LColor::color InsetOld::backgroundColor() const
+EnumLColor InsetOld::backgroundColor() const
 {
        if (background_color_ == LColor::inherit) {
                if (owner())
index 9d38ab9d046845b1c52297f85903aaf192b08d83..987a00aa210a16b1c3e58765a2247ba8bbdfa5e5 100644 (file)
@@ -21,6 +21,7 @@
 #include "ParagraphList_fwd.h"
 
 class Buffer;
+class EnumLColor;
 class FuncRequest;
 class LatexRunParams;
 class LyXCursor;
@@ -204,9 +205,9 @@ public:
        ///
        UpdatableInset * owner() const { return owner_; }
        ///
-       void setBackgroundColor(LColor::color);
+       void setBackgroundColor(EnumLColor);
        ///
-       LColor::color backgroundColor() const;
+       EnumLColor backgroundColor() const;
        ///
        int x() const { return top_x; }
        ///
index 0811d0b5249837583e93978221e00ef197381901..9a01659a9f275fae04b6312cc917764ebcb182bc 100644 (file)
@@ -1451,7 +1451,7 @@ void InsetText::setDrawFrame(DrawFrame how)
 }
 
 
-void InsetText::setFrameColor(LColor::color col)
+void InsetText::setFrameColor(EnumLColor col)
 {
        frame_color = col;
 }
index 853c2d34cd655c2b678675d5d4f53affb97ff667..60a8ca6d02582b7bb4a2a99935851113f4705381 100644 (file)
@@ -28,6 +28,7 @@ class Buffer;
 class BufferParams;
 class BufferView;
 class Dimension;
+class EnumLColor;
 class LyXCursor;
 class Painter;
 class Paragraph;
@@ -128,7 +129,7 @@ public:
        ///
        void setDrawFrame(DrawFrame);
        ///
-       void setFrameColor(LColor::color);
+       void setFrameColor(EnumLColor);
        ///
        LyXText * getLyXText(BufferView const *,
                             bool const recursive = false) const;
index 24db8b03af8b9e76cace115543579cb5be8e32eb..f82b70bd7c0f90142c41a376525fe068519fb649 100644 (file)
@@ -29,6 +29,7 @@
 #include "kbmap.h"
 #include "language.h"
 #include "lastfiles.h"
+#include "LColor.h"
 #include "lyxfunc.h"
 #include "lyxlex.h"
 #include "lyxrc.h"
index af8803dec55c8adffbfdba0a13893e8839f80b99..9c4f2f529718af18db127d741cf4abaaaaf463f4 100644 (file)
@@ -202,7 +202,7 @@ LyXFont::FONT_MISC_STATE LyXFont::underbar() const
 }
 
 
-LColor::color LyXFont::color() const
+EnumLColor LyXFont::color() const
 {
        return bits.color;
 }
@@ -282,7 +282,7 @@ LyXFont & LyXFont::setNoun(LyXFont::FONT_MISC_STATE n)
 }
 
 
-LyXFont & LyXFont::setColor(LColor::color c)
+LyXFont & LyXFont::setColor(EnumLColor c)
 {
        bits.color = c;
        return *this;
@@ -930,7 +930,7 @@ int LyXFont::latexWriteEndChanges(ostream & os, LyXFont const & base,
 }
 
 
-LColor::color LyXFont::realColor() const
+EnumLColor LyXFont::realColor() const
 {
        if (color() == LColor::none)
                return LColor::foreground;
index 69fa775b652728f51b2283d37e272530c5f40cc0..19d66120c8e8f58137a39bcf28b8096a0b540c1f 100644 (file)
@@ -20,6 +20,7 @@
 #include "support/std_string.h"
 #include <iosfwd>
 
+class EnumLColor;
 class LyXLex;
 class BufferParams;
 class Language;
@@ -207,7 +208,7 @@ public:
        FONT_MISC_STATE number() const;
 
        ///
-       LColor::color color() const;
+       EnumLColor color() const;
 
        ///
        Language const * language() const;
@@ -238,7 +239,7 @@ public:
        ///
        LyXFont & setNumber(LyXFont::FONT_MISC_STATE n);
        ///
-       LyXFont & setColor(LColor::color c);
+       LyXFont & setColor(EnumLColor c);
        ///
        LyXFont & setLanguage(Language const * l);
 
@@ -310,7 +311,7 @@ public:
        string const stateText(BufferParams * params) const;
 
        ///
-       LColor::color realColor() const;
+       EnumLColor realColor() const;
 
        ///
        friend
index 8da530766c24e15d3c92a814eb7d91cbc05e7ca1..e536a1aefb5eda73956050954270930813b9b787 100644 (file)
@@ -27,6 +27,7 @@ class Buffer;
 class BufferParams;
 class BufferView;
 class Dimension;
+class EnumLColor;
 class InsetText;
 class LyXCursor;
 class MetricsInfo;
@@ -398,7 +399,7 @@ public:
                lyx::pos_type pos, char c, LyXFont const & Font) const;
 
        /// return the color of the canvas
-       LColor::color backgroundColor() const;
+       EnumLColor backgroundColor() const;
 
        ///
        mutable bool bidi_same_direction;
index 4018dda7033ceb8b5fa2fc0ff67430011fe1ca71..934c7a7b5b2ed564c67c7af38cdbc1fb81e1d384 100644 (file)
@@ -876,7 +876,7 @@ int LyXText::labelFill(ParagraphList::iterator pit, Row const & row) const
 }
 
 
-LColor::color LyXText::backgroundColor() const
+EnumLColor LyXText::backgroundColor() const
 {
        if (inset_owner)
                return inset_owner->backgroundColor();