From a6ccea4f21c3da972fb3577ab07404da83f0a223 Mon Sep 17 00:00:00 2001 From: Angus Leeming Date: Mon, 15 Sep 2003 15:20:22 +0000 Subject: [PATCH] The EnumLColor patch, free of macros. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7759 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 13 ++++++++++ src/LColor.h | 17 +++++++++++++ src/frontends/ChangeLog | 13 ++++++++++ src/frontends/Painter.C | 8 ++++--- src/frontends/Painter.h | 21 ++++++++-------- src/frontends/controllers/ChangeLog | 13 ++++++++++ src/frontends/controllers/ControlCharacter.C | 4 ++-- src/frontends/controllers/ControlCharacter.h | 7 ++++-- src/frontends/controllers/ControlPrefs.C | 3 ++- src/frontends/controllers/ControlPrefs.h | 4 ++-- src/frontends/controllers/character.h | 7 ++++-- src/frontends/gtk/ChangeLog | 19 +++++++++++++++ src/frontends/gtk/GPainter.C | 17 ++++++------- src/frontends/gtk/GPainter.h | 18 +++++++------- src/frontends/gtk/GScreen.C | 25 ++++++++++++-------- src/frontends/gtk/GWorkArea.C | 10 ++++---- src/frontends/gtk/GWorkArea.h | 19 ++++++++------- src/frontends/gtk/lyx_gui.C | 4 ++-- src/frontends/lyx_gui.h | 6 ++--- src/frontends/qt2/ChangeLog | 20 ++++++++++++++++ src/frontends/qt2/QLPainter.C | 17 ++++++------- src/frontends/qt2/QLPainter.h | 17 +++++++------ src/frontends/qt2/QPrefsDialog.C | 1 + src/frontends/qt2/QPrefsDialog.h | 5 ++-- src/frontends/qt2/QWorkArea.C | 1 + src/frontends/qt2/lcolorcache.C | 4 +++- src/frontends/qt2/lcolorcache.h | 10 ++++---- src/frontends/qt2/lyx_gui.C | 4 ++-- src/frontends/qt2/qscreen.C | 1 + src/frontends/xforms/ChangeLog | 23 ++++++++++++++++++ src/frontends/xforms/Color.C | 4 +++- src/frontends/xforms/Color.h | 7 ++++-- src/frontends/xforms/ColorHandler.C | 9 +++---- src/frontends/xforms/ColorHandler.h | 9 +++---- src/frontends/xforms/FormCharacter.h | 3 ++- src/frontends/xforms/XPainter.C | 15 ++++++------ src/frontends/xforms/XPainter.h | 14 +++++------ src/frontends/xforms/lyx_gui.C | 4 ++-- src/frontends/xforms/xformsImage.C | 8 +++++-- src/frontends/xforms/xscreen.C | 1 + src/insets/ChangeLog | 6 +++++ src/insets/inset.C | 4 ++-- src/insets/inset.h | 5 ++-- src/insets/insettext.C | 2 +- src/insets/insettext.h | 3 ++- src/lyx_main.C | 1 + src/lyxfont.C | 6 ++--- src/lyxfont.h | 7 +++--- src/lyxtext.h | 3 ++- src/text.C | 2 +- 50 files changed, 306 insertions(+), 138 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index af2e4651ae..2fa672ff7d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,16 @@ +2003-09-15 Angus Leeming + + * 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 * .cvsignore: add lyx-gtk. diff --git a/src/LColor.h b/src/LColor.h index 1cb2f8322a..6e481cf674 100644 --- a/src/LColor.h +++ b/src/LColor.h @@ -238,6 +238,23 @@ private: boost::scoped_ptr 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(-1)) {} + + EnumLColor(LColor::color val) : val_(val) {} + operator LColor::color() const{ return val_; } +}; + + /// the current color definitions extern LColor lcolor; /// the system color definitions diff --git a/src/frontends/ChangeLog b/src/frontends/ChangeLog index 8b136aec5c..e9eeb4bcf0 100644 --- a/src/frontends/ChangeLog +++ b/src/frontends/ChangeLog @@ -1,3 +1,16 @@ +2003-09-15 Angus Leeming + + * 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 * Timeout.C: change Assert to BOOST_ASSERT diff --git a/src/frontends/Painter.C b/src/frontends/Painter.C index 6fd9fd166f..2e0c56249f 100644 --- a/src/frontends/Painter.C +++ b/src/frontends/Painter.C @@ -13,9 +13,11 @@ #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; diff --git a/src/frontends/Painter.h b/src/frontends/Painter.h index 95abeb23fa..5560689c6e 100644 --- a/src/frontends/Painter.h +++ b/src/frontends/Painter.h @@ -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, diff --git a/src/frontends/controllers/ChangeLog b/src/frontends/controllers/ChangeLog index d6a5099e8c..d8248e26ed 100644 --- a/src/frontends/controllers/ChangeLog +++ b/src/frontends/controllers/ChangeLog @@ -1,3 +1,16 @@ +2003-09-15 Angus Leeming + + * 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. + 2003-09-15 Lars Gullik Bjønnes * ControlAboutlyx.C diff --git a/src/frontends/controllers/ControlCharacter.C b/src/frontends/controllers/ControlCharacter.C index ddce11cf1f..759b72969e 100644 --- a/src/frontends/controllers/ControlCharacter.C +++ b/src/frontends/controllers/ControlCharacter.C @@ -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: diff --git a/src/frontends/controllers/ControlCharacter.h b/src/frontends/controllers/ControlCharacter.h index b2d0fe2f4a..e22ecbefc0 100644 --- a/src/frontends/controllers/ControlCharacter.h +++ b/src/frontends/controllers/ControlCharacter.h @@ -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; /// diff --git a/src/frontends/controllers/ControlPrefs.C b/src/frontends/controllers/ControlPrefs.C index 547cc742b4..7c60b949fd 100644 --- a/src/frontends/controllers/ControlPrefs.C +++ b/src/frontends/controllers/ControlPrefs.C @@ -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)); diff --git a/src/frontends/controllers/ControlPrefs.h b/src/frontends/controllers/ControlPrefs.h index 0452bbca4a..c5f1a4b301 100644 --- a/src/frontends/controllers/ControlPrefs.h +++ b/src/frontends/controllers/ControlPrefs.h @@ -16,10 +16,10 @@ #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(); diff --git a/src/frontends/controllers/character.h b/src/frontends/controllers/character.h index 732d4f59da..ae12385820 100644 --- a/src/frontends/controllers/character.h +++ b/src/frontends/controllers/character.h @@ -14,11 +14,14 @@ #include "lyxfont.h" -#include "LColor.h" #include #include + +class EnumLColor; + + /** Functions of use to the character GUI controller and view */ namespace frnt { @@ -47,7 +50,7 @@ typedef std::pair SizePair; /// typedef std::pair BarPair; /// -typedef std::pair ColorPair; +typedef std::pair ColorPair; /// std::vector const getFamilyData(); diff --git a/src/frontends/gtk/ChangeLog b/src/frontends/gtk/ChangeLog index e414752541..127438579c 100644 --- a/src/frontends/gtk/ChangeLog +++ b/src/frontends/gtk/ChangeLog @@ -1,3 +1,22 @@ +2003-09-15 Angus Leeming + + * 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 * GToolbar.C (onLayoutSelected): missed a change from a call to the diff --git a/src/frontends/gtk/GPainter.C b/src/frontends/gtk/GPainter.C index e3eac76778..f5357cec9d 100644 --- a/src/frontends/gtk/GPainter.C +++ b/src/frontends/gtk/GPainter.C @@ -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 gc, LColor::color clr) +void GPainter::setForeground(Glib::RefPtr gc, EnumLColor clr) { Gdk::Color * gclr = owner_.getColorHandler().getGdkColor(clr); gc->set_foreground(*gclr); @@ -84,7 +85,7 @@ void GPainter::setLineParam(Glib::RefPtr 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 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(), diff --git a/src/frontends/gtk/GPainter.h b/src/frontends/gtk/GPainter.h index 396bf1f9fb..8d20826bb9 100644 --- a/src/frontends/gtk/GPainter.h +++ b/src/frontends/gtk/GPainter.h @@ -33,15 +33,15 @@ public: /// return the height of the work area in pixels virtual int paperHeight() const; - void setForeground(Glib::RefPtr gc, LColor::color clr); + void setForeground(Glib::RefPtr gc, EnumLColor clr); void setLineParam(Glib::RefPtr 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, diff --git a/src/frontends/gtk/GScreen.C b/src/frontends/gtk/GScreen.C index 212361f489..55ae48aefc 100644 --- a/src/frontends/gtk/GScreen.C +++ b/src/frontends/gtk/GScreen.C @@ -11,21 +11,26 @@ #include #include -#include +#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 GScreen::GScreen(GWorkArea & o) diff --git a/src/frontends/gtk/GWorkArea.C b/src/frontends/gtk/GWorkArea.C index a407f549f8..225f6a2849 100644 --- a/src/frontends/gtk/GWorkArea.C +++ b/src/frontends/gtk/GWorkArea.C @@ -13,12 +13,14 @@ #include #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) { diff --git a/src/frontends/gtk/GWorkArea.h b/src/frontends/gtk/GWorkArea.h index 63d45d4110..e6a47eb981 100644 --- a/src/frontends/gtk/GWorkArea.h +++ b/src/frontends/gtk/GWorkArea.h @@ -15,33 +15,34 @@ #include #include "frontends/WorkArea.h" #include "GPainter.h" -#include "LColor.h" #include #include +class EnumLColor; + class ColorCache { - typedef std::map Map; + typedef std::map Map; typedef Map::iterator MapIt; - typedef std::map Map2; + typedef std::map 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_; }; diff --git a/src/frontends/gtk/lyx_gui.C b/src/frontends/gtk/lyx_gui.C index f23e723269..750e040037 100644 --- a/src/frontends/gtk/lyx_gui.C +++ b/src/frontends/gtk/lyx_gui.C @@ -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(); } diff --git a/src/frontends/lyx_gui.h b/src/frontends/lyx_gui.h index 2e768400b6..e27e2ffccf 100644 --- a/src/frontends/lyx_gui.h +++ b/src/frontends/lyx_gui.h @@ -12,13 +12,13 @@ #ifndef LYX_GUI_H #define LYX_GUI_H -#include "LColor.h" #include "support/std_string.h" #include "FuncStatus.h" #include 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 diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index 2583cf406f..57556defeb 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,23 @@ +2003-09-15 Angus Leeming + + * 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 colors_; + + * QWorkArea.C: add #include "LColor.h". + + * lcolorcache.C: add #include "LColor.h". + * lcolorcache.h: store a map. + * 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 * QAbout.C (build_dialog): diff --git a/src/frontends/qt2/QLPainter.C b/src/frontends/qt2/QLPainter.C index 2ffc7ddf5e..8de17fae2a 100644 --- a/src/frontends/qt2/QLPainter.C +++ b/src/frontends/qt2/QLPainter.C @@ -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 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); diff --git a/src/frontends/qt2/QLPainter.h b/src/frontends/qt2/QLPainter.h index 45afb461c1..ff3fc3d4fb 100644 --- a/src/frontends/qt2/QLPainter.h +++ b/src/frontends/qt2/QLPainter.h @@ -15,7 +15,6 @@ #include "Painter.h" #include "support/std_string.h" -#include "LColor.h" #include @@ -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); diff --git a/src/frontends/qt2/QPrefsDialog.C b/src/frontends/qt2/QPrefsDialog.C index f1ed5b0914..1d470e704e 100644 --- a/src/frontends/qt2/QPrefsDialog.C +++ b/src/frontends/qt2/QPrefsDialog.C @@ -34,6 +34,7 @@ #include "ui/QPrefIdentityModule.h" #include "gettext.h" +#include "LColor.h" #include "panelstack.h" #include diff --git a/src/frontends/qt2/QPrefsDialog.h b/src/frontends/qt2/QPrefsDialog.h index 72e98c43bc..a99dfd58a9 100644 --- a/src/frontends/qt2/QPrefsDialog.h +++ b/src/frontends/qt2/QPrefsDialog.h @@ -13,12 +13,11 @@ #define QPREFSDIALOG_H -#include "LColor.h" - #include "ui/QPrefsDialogBase.h" #include +class EnumLColor; class QPrefs; class QPrefAsciiModule; class QPrefDateModule; @@ -84,7 +83,7 @@ protected: private: - std::vector colors_; + std::vector colors_; QPrefAsciiModule * asciiModule; QPrefDateModule * dateModule; diff --git a/src/frontends/qt2/QWorkArea.C b/src/frontends/qt2/QWorkArea.C index bbfec7d533..2110423cde 100644 --- a/src/frontends/qt2/QWorkArea.C +++ b/src/frontends/qt2/QWorkArea.C @@ -12,6 +12,7 @@ #include "QWorkArea.h" #include "debug.h" +#include "LColor.h" #include "qt_helpers.h" #include "lcolorcache.h" #include "funcrequest.h" diff --git a/src/frontends/qt2/lcolorcache.C b/src/frontends/qt2/lcolorcache.C index 70bbc6517f..9e128ad04b 100644 --- a/src/frontends/qt2/lcolorcache.C +++ b/src/frontends/qt2/lcolorcache.C @@ -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()) diff --git a/src/frontends/qt2/lcolorcache.h b/src/frontends/qt2/lcolorcache.h index 05e045610f..60ee45ff30 100644 --- a/src/frontends/qt2/lcolorcache.h +++ b/src/frontends/qt2/lcolorcache.h @@ -14,10 +14,12 @@ #include -#include "LColor.h" - #include + +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_map; + typedef std::map lcolor_map; mutable lcolor_map colormap; }; diff --git a/src/frontends/qt2/lyx_gui.C b/src/frontends/qt2/lyx_gui.C index 6f40e75d93..3d21b59fc3 100644 --- a/src/frontends/qt2/lyx_gui.C +++ b/src/frontends/qt2/lyx_gui.C @@ -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(); diff --git a/src/frontends/qt2/qscreen.C b/src/frontends/qt2/qscreen.C index 1225a89cfe..beac468056 100644 --- a/src/frontends/qt2/qscreen.C +++ b/src/frontends/qt2/qscreen.C @@ -13,6 +13,7 @@ #include "QWorkArea.h" #include "qscreen.h" #include "debug.h" +#include "LColor.h" #include diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index 69ff1b0d7c..e0649d8775 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,3 +1,26 @@ +2003-09-15 Angus Leeming + + * 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 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 * Color.C diff --git a/src/frontends/xforms/Color.C b/src/frontends/xforms/Color.C index 7b1bd7a606..8b688d4734 100644 --- a/src/frontends/xforms/Color.C +++ b/src/frontends/xforms/Color.C @@ -14,6 +14,8 @@ #include "lyx_forms.h" +#include "LColor.h" + #include "support/std_sstream.h" #include @@ -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); diff --git a/src/frontends/xforms/Color.h b/src/frontends/xforms/Color.h index 86a8de2881..6216e5cefd 100644 --- a/src/frontends/xforms/Color.h +++ b/src/frontends/xforms/Color.h @@ -18,12 +18,15 @@ #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; diff --git a/src/frontends/xforms/ColorHandler.C b/src/frontends/xforms/ColorHandler.C index 96600a1816..8467928860 100644 --- a/src/frontends/xforms/ColorHandler.C +++ b/src/frontends/xforms/ColorHandler.C @@ -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(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]; diff --git a/src/frontends/xforms/ColorHandler.h b/src/frontends/xforms/ColorHandler.h index ba2304373d..f1acce0b47 100644 --- a/src/frontends/xforms/ColorHandler.h +++ b/src/frontends/xforms/ColorHandler.h @@ -22,6 +22,7 @@ // This is only included to provide stuff for the non-public sections #include +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: /// diff --git a/src/frontends/xforms/FormCharacter.h b/src/frontends/xforms/FormCharacter.h index fc125656d9..a66c85d2a1 100644 --- a/src/frontends/xforms/FormCharacter.h +++ b/src/frontends/xforms/FormCharacter.h @@ -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 bar_; /// - std::vector color_; + std::vector color_; /// std::vector lang_; }; diff --git a/src/frontends/xforms/XPainter.C b/src/frontends/xforms/XPainter.C index 912e4bdb12..dc762f7cfe 100644 --- a/src/frontends/xforms/XPainter.C +++ b/src/frontends/xforms/XPainter.C @@ -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 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), diff --git a/src/frontends/xforms/XPainter.h b/src/frontends/xforms/XPainter.h index c98bb75772..ba1d8e602b 100644 --- a/src/frontends/xforms/XPainter.h +++ b/src/frontends/xforms/XPainter.h @@ -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, diff --git a/src/frontends/xforms/lyx_gui.C b/src/frontends/xforms/lyx_gui.C index d702fbfd1b..45c0f91707 100644 --- a/src/frontends/xforms/lyx_gui.C +++ b/src/frontends/xforms/lyx_gui.C @@ -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); } diff --git a/src/frontends/xforms/xformsImage.C b/src/frontends/xforms/xformsImage.C index fe6eec97d3..fb24938330 100644 --- a/src/frontends/xforms/xformsImage.C +++ b/src/frontends/xforms/xformsImage.C @@ -11,10 +11,14 @@ #include #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" diff --git a/src/frontends/xforms/xscreen.C b/src/frontends/xforms/xscreen.C index a00b187de0..4375e57a42 100644 --- a/src/frontends/xforms/xscreen.C +++ b/src/frontends/xforms/xscreen.C @@ -17,6 +17,7 @@ #include "XWorkArea.h" #include "debug.h" +#include "LColor.h" using std::endl; diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index bd9ab90d85..8988e47c4a 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,9 @@ +2003-09-15 Angus Leeming + + * inset.[Ch] (setBackgroundColor, backgroundColor): + * insettext.[Ch] (setFrameColor): + pass EnumLColor args, rather than LColor::color ones. + 2003-09-15 Lars Gullik Bjønnes * insetcommand.C diff --git a/src/insets/inset.C b/src/insets/inset.C index 6f7fc7d1c7..0b19aebd87 100644 --- a/src/insets/inset.C +++ b/src/insets/inset.C @@ -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()) diff --git a/src/insets/inset.h b/src/insets/inset.h index 9d38ab9d04..987a00aa21 100644 --- a/src/insets/inset.h +++ b/src/insets/inset.h @@ -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; } /// diff --git a/src/insets/insettext.C b/src/insets/insettext.C index 0811d0b524..9a01659a9f 100644 --- a/src/insets/insettext.C +++ b/src/insets/insettext.C @@ -1451,7 +1451,7 @@ void InsetText::setDrawFrame(DrawFrame how) } -void InsetText::setFrameColor(LColor::color col) +void InsetText::setFrameColor(EnumLColor col) { frame_color = col; } diff --git a/src/insets/insettext.h b/src/insets/insettext.h index 853c2d34cd..60a8ca6d02 100644 --- a/src/insets/insettext.h +++ b/src/insets/insettext.h @@ -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; diff --git a/src/lyx_main.C b/src/lyx_main.C index 24db8b03af..f82b70bd7c 100644 --- a/src/lyx_main.C +++ b/src/lyx_main.C @@ -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" diff --git a/src/lyxfont.C b/src/lyxfont.C index af8803dec5..9c4f2f5297 100644 --- a/src/lyxfont.C +++ b/src/lyxfont.C @@ -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; diff --git a/src/lyxfont.h b/src/lyxfont.h index 69fa775b65..19d66120c8 100644 --- a/src/lyxfont.h +++ b/src/lyxfont.h @@ -20,6 +20,7 @@ #include "support/std_string.h" #include +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 diff --git a/src/lyxtext.h b/src/lyxtext.h index 8da530766c..e536a1aefb 100644 --- a/src/lyxtext.h +++ b/src/lyxtext.h @@ -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; diff --git a/src/text.C b/src/text.C index 4018dda703..934c7a7b5b 100644 --- a/src/text.C +++ b/src/text.C @@ -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(); -- 2.39.2