]> git.lyx.org Git - features.git/commitdiff
Move Color::color enum to ColorCode.h
authorAbdelrazak Younes <younes@lyx.org>
Thu, 25 Oct 2007 12:41:02 +0000 (12:41 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Thu, 25 Oct 2007 12:41:02 +0000 (12:41 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21198 a592a061-630c-0410-9148-cb99ea01b6c8

90 files changed:
src/BranchList.cpp
src/BufferParams.cpp
src/BufferView.cpp
src/Color.cpp
src/Color.h
src/ColorCode.h [new file with mode: 0644]
src/Font.cpp
src/Font.h
src/LaTeXFeatures.cpp
src/LyX.cpp
src/LyXFunc.cpp
src/LyXRC.cpp
src/Makefile.am
src/MetricsInfo.cpp
src/Paragraph.cpp
src/Text.cpp
src/Text.h
src/Text2.cpp
src/TextClass.cpp
src/TextClass.h
src/TextMetrics.cpp
src/factory.cpp
src/frontends/Application.h
src/frontends/Painter.cpp
src/frontends/Painter.h
src/frontends/WorkArea.cpp
src/frontends/qt4/ColorCache.cpp
src/frontends/qt4/ColorCache.h
src/frontends/qt4/GuiApplication.cpp
src/frontends/qt4/GuiApplication.h
src/frontends/qt4/GuiCharacter.cpp
src/frontends/qt4/GuiCharacter.h
src/frontends/qt4/GuiDocument.cpp
src/frontends/qt4/GuiFontLoader.h
src/frontends/qt4/GuiPainter.cpp
src/frontends/qt4/GuiPainter.h
src/frontends/qt4/GuiPrefs.cpp
src/frontends/qt4/GuiPrefs.h
src/frontends/qt4/GuiWorkArea.cpp
src/graphics/PreviewLoader.cpp
src/insets/Inset.cpp
src/insets/Inset.h
src/insets/InsetBox.cpp
src/insets/InsetBranch.cpp
src/insets/InsetBranch.h
src/insets/InsetCaption.cpp
src/insets/InsetCollapsable.cpp
src/insets/InsetCollapsable.h
src/insets/InsetERT.cpp
src/insets/InsetFlex.cpp
src/insets/InsetFloat.cpp
src/insets/InsetLine.cpp
src/insets/InsetListings.cpp
src/insets/InsetNewline.cpp
src/insets/InsetOptArg.cpp
src/insets/InsetPagebreak.cpp
src/insets/InsetSpace.cpp
src/insets/InsetSpecialChar.cpp
src/insets/InsetTabular.cpp
src/insets/InsetText.cpp
src/insets/InsetText.h
src/insets/InsetTheorem.cpp
src/insets/InsetVSpace.cpp
src/insets/InsetWrap.cpp
src/insets/RenderButton.cpp
src/insets/RenderGraphic.cpp
src/insets/RenderPreview.cpp
src/mathed/InsetFormulaMacro.cpp
src/mathed/InsetMath.cpp
src/mathed/InsetMathBoxed.cpp
src/mathed/InsetMathBrace.cpp
src/mathed/InsetMathColor.cpp
src/mathed/InsetMathColor.h
src/mathed/InsetMathDFrac.cpp
src/mathed/InsetMathFBox.cpp
src/mathed/InsetMathFrac.cpp
src/mathed/InsetMathFrameBox.cpp
src/mathed/InsetMathGrid.cpp
src/mathed/InsetMathHull.cpp
src/mathed/InsetMathNest.cpp
src/mathed/InsetMathPhantom.cpp
src/mathed/InsetMathRoot.cpp
src/mathed/InsetMathSpace.cpp
src/mathed/InsetMathSqrt.cpp
src/mathed/InsetMathTFrac.cpp
src/mathed/InsetMathXYArrow.cpp
src/mathed/MathData.cpp
src/mathed/MathMacroTemplate.cpp
src/mathed/MathSupport.cpp
src/rowpainter.cpp

index 86cb6021d1b582917be1c7e1bfea22680530cd17..89884e60a2e11e77332dadd67c92e3906dcf0439 100644 (file)
@@ -11,7 +11,6 @@
 #include <config.h>
 
 #include "BranchList.h"
-#include "Color.h"
 
 #include "frontends/Application.h"
 
@@ -26,7 +25,7 @@ Branch::Branch() : selected_(false)
 {
        // no theApp() with command line export
        if (theApp())
-               theApp()->getRgbColor(Color::background, color_);
+               theApp()->getRgbColor(Color_background, color_);
 }
 
 
@@ -75,7 +74,7 @@ void Branch::setColor(string const & c)
                color_ = RGBColor(c);
        else
                // no color set or invalid color - use normal background
-               theApp()->getRgbColor(Color::background, color_);
+               theApp()->getRgbColor(Color_background, color_);
 }
 
 
index 8d6c4d770be0c175b5dbec22f09bc84aa95ed32e..80724d6cbcaeb1171168323302d506600528b621 100644 (file)
@@ -28,7 +28,6 @@
 #include "LaTeXFeatures.h"
 #include "Messages.h"
 #include "ModuleList.h"
-#include "Color.h"
 #include "Font.h"
 #include "Lexer.h"
 #include "LyXRC.h"
@@ -584,7 +583,7 @@ string const BufferParams::readToken(Lexer & lex, string const & token)
                                        branch_ptr->setColor(color);
                                // Update also the Color table:
                                if (color == "none")
-                                       color = lcolor.getX11Name(Color::background);
+                                       color = lcolor.getX11Name(Color_background);
                                // FIXME UNICODE
                                lcolor.setColor(to_utf8(branch), color);
 
index f3ec599b2ac5a48b03e2507741f4907b2ff88f1c..066789a69b62afb270834d45385c2af0d778b3f7 100644 (file)
@@ -2128,14 +2128,14 @@ void BufferView::draw(frontend::Painter & pain)
 //     lyxerr << "par ascent: " << text.getPar(d->metrics_info_.p1).ascent() << endl;
        if (d->metrics_info_.y1 > 0
                && d->metrics_info_.update_strategy == FullScreenUpdate)
-               pain.fillRectangle(0, 0, width_, d->metrics_info_.y1, Color::bottomarea);
+               pain.fillRectangle(0, 0, width_, d->metrics_info_.y1, Color_bottomarea);
 
        // and possibly grey out below
 //     lyxerr << "par descent: " << text.getPar(d->metrics_info_.p1).ascent() << endl;
        if (d->metrics_info_.y2 < height_
                && d->metrics_info_.update_strategy == FullScreenUpdate)
                pain.fillRectangle(0, d->metrics_info_.y2, width_,
-                       height_ - d->metrics_info_.y2, Color::bottomarea);
+                       height_ - d->metrics_info_.y2, Color_bottomarea);
 }
 
 
index daaa0aacd69c5b45036ac19fe7702650c27ed98f..03f4f6c97aa1b0dafa183e19408b70304b4e3140 100644 (file)
@@ -19,6 +19,7 @@
 #include "debug.h"
 #include "gettext.h"
 #include "Color.h"
+
 #include "support/lstrings.h"
 
 #include <map>
@@ -40,14 +41,15 @@ using std::ostringstream;
 using std::string;
 using std::endl;
 
-using lyx::support::compare_ascii_no_case;
-using lyx::support::ascii_lowercase;
+namespace lyx {
 
+using support::compare_ascii_no_case;
+using support::ascii_lowercase;
 
 namespace {
 
 struct ColorEntry {
-       lyx::Color::color lcolor;
+       ColorCode lcolor;
        char const * guiname;
        char const * latexname;
        char const * x11name;
@@ -67,10 +69,6 @@ int hexstrToInt(string const & str)
 } // namespace anon
 
 
-
-namespace lyx {
-
-
 /////////////////////////////////////////////////////////////////////
 //
 // RGBColor
@@ -136,11 +134,11 @@ public:
        }
 
        ///
-       typedef std::map<Color::color, information> InfoTab;
+       typedef std::map<ColorCode, information> InfoTab;
        /// the table of color information
        InfoTab infotab;
 
-       typedef std::map<string, Color::color> Transform;
+       typedef std::map<string, ColorCode> Transform;
        /// the transform between LyX color name string and integer code.
        Transform lyxcolors;
        /// the transform between LaTeX color name string and integer code.
@@ -152,67 +150,67 @@ public:
 Color::Color()
        : pimpl_(new Pimpl)
 {
-       //  Color::color, gui, latex, x11, lyx
+       //  ColorCode, gui, latex, x11, lyx
        static ColorEntry const items[] = {
-       { none, N_("none"), "none", "black", "none" },
-       { black, N_("black"), "black", "black", "black" },
-       { white, N_("white"), "white", "white", "white" },
-       { red, N_("red"), "red", "red", "red" },
-       { green, N_("green"), "green", "green", "green" },
-       { blue, N_("blue"), "blue", "blue", "blue" },
-       { cyan, N_("cyan"), "cyan", "cyan", "cyan" },
-       { magenta, N_("magenta"), "magenta", "magenta", "magenta" },
-       { yellow, N_("yellow"), "yellow", "yellow", "yellow" },
-       { cursor, N_("cursor"), "cursor", "black", "cursor" },
-       { background, N_("background"), "background", "linen", "background" },
-       { foreground, N_("text"), "foreground", "black", "foreground" },
-       { selection, N_("selection"), "selection", "LightBlue", "selection" },
-       { latex, N_("LaTeX text"), "latex", "DarkRed", "latex" },
-       { preview, N_("previewed snippet"), "preview", "black", "preview" },
-       { note, N_("note"), "note", "blue", "note" },
-       { notebg, N_("note background"), "notebg", "yellow", "notebg" },
-       { comment, N_("comment"), "comment", "magenta", "comment" },
-       { commentbg, N_("comment background"), "commentbg", "linen", "commentbg" },
-       { greyedout, N_("greyedout inset"), "greyedout", "red", "greyedout" },
-       { greyedoutbg, N_("greyedout inset background"), "greyedoutbg", "linen", "greyedoutbg" },
-       { shadedbg, N_("shaded box"), "shaded", "#ff0000", "shaded" },
-       { depthbar, N_("depth bar"), "depthbar", "IndianRed", "depthbar" },
-       { language, N_("language"), "language", "Blue", "language" },
-       { command, N_("command inset"), "command", "black", "command" },
-       { commandbg, N_("command inset background"), "commandbg", "azure", "commandbg" },
-       { commandframe, N_("command inset frame"), "commandframe", "black", "commandframe" },
-       { special, N_("special character"), "special", "RoyalBlue", "special" },
-       { math, N_("math"), "math", "DarkBlue", "math" },
-       { mathbg, N_("math background"), "mathbg", "linen", "mathbg" },
-       { graphicsbg, N_("graphics background"), "graphicsbg", "linen", "graphicsbg" },
-       { mathmacrobg, N_("Math macro background"), "mathmacrobg", "linen", "mathmacrobg" },
-       { mathframe, N_("math frame"), "mathframe", "Magenta", "mathframe" },
-       { mathcorners, N_("math corners"), "mathcorners", "linen", "mathcorners" },
-       { mathline, N_("math line"), "mathline", "Blue", "mathline" },
-       { captionframe, N_("caption frame"), "captionframe", "DarkRed", "captionframe" },
-       { collapsable, N_("collapsable inset text"), "collapsable", "DarkRed", "collapsable" },
-       { collapsableframe, N_("collapsable inset frame"), "collapsableframe", "IndianRed", "collapsableframe" },
-       { insetbg, N_("inset background"), "insetbg", "grey80", "insetbg" },
-       { insetframe, N_("inset frame"), "insetframe", "IndianRed", "insetframe" },
-       { error, N_("LaTeX error"), "error", "Red", "error" },
-       { eolmarker, N_("end-of-line marker"), "eolmarker", "Brown", "eolmarker" },
-       { appendix, N_("appendix marker"), "appendix", "Brown", "appendix" },
-       { changebar, N_("change bar"), "changebar", "Blue", "changebar" },
-       { deletedtext, N_("Deleted text"), "deletedtext", "#ff0000", "deletedtext" },
-       { addedtext, N_("Added text"), "addedtext", "#0000ff", "addedtext" },
-       { added_space, N_("added space markers"), "added_space", "Brown", "added_space" },
-       { topline, N_("top/bottom line"), "topline", "Brown", "topline" },
-       { tabularline, N_("table line"), "tabularline", "black", "tabularline" },
-       { tabularonoffline, N_("table on/off line"), "tabularonoffline",
+       { Color_none, N_("none"), "none", "black", "none" },
+       { Color_black, N_("black"), "black", "black", "black" },
+       { Color_white, N_("white"), "white", "white", "white" },
+       { Color_red, N_("red"), "red", "red", "red" },
+       { Color_green, N_("green"), "green", "green", "green" },
+       { Color_blue, N_("blue"), "blue", "blue", "blue" },
+       { Color_cyan, N_("cyan"), "cyan", "cyan", "cyan" },
+       { Color_magenta, N_("magenta"), "magenta", "magenta", "magenta" },
+       { Color_yellow, N_("yellow"), "yellow", "yellow", "yellow" },
+       { Color_cursor, N_("cursor"), "cursor", "black", "cursor" },
+       { Color_background, N_("background"), "background", "linen", "background" },
+       { Color_foreground, N_("text"), "foreground", "black", "foreground" },
+       { Color_selection, N_("selection"), "selection", "LightBlue", "selection" },
+       { Color_latex, N_("LaTeX text"), "latex", "DarkRed", "latex" },
+       { Color_preview, N_("previewed snippet"), "preview", "black", "preview" },
+       { Color_note, N_("note"), "note", "blue", "note" },
+       { Color_notebg, N_("note background"), "notebg", "yellow", "notebg" },
+       { Color_comment, N_("comment"), "comment", "magenta", "comment" },
+       { Color_commentbg, N_("comment background"), "commentbg", "linen", "commentbg" },
+       { Color_greyedout, N_("greyedout inset"), "greyedout", "red", "greyedout" },
+       { Color_greyedoutbg, N_("greyedout inset background"), "greyedoutbg", "linen", "greyedoutbg" },
+       { Color_shadedbg, N_("shaded box"), "shaded", "#ff0000", "shaded" },
+       { Color_depthbar, N_("depth bar"), "depthbar", "IndianRed", "depthbar" },
+       { Color_language, N_("language"), "language", "Blue", "language" },
+       { Color_command, N_("command inset"), "command", "black", "command" },
+       { Color_commandbg, N_("command inset background"), "commandbg", "azure", "commandbg" },
+       { Color_commandframe, N_("command inset frame"), "commandframe", "black", "commandframe" },
+       { Color_special, N_("special character"), "special", "RoyalBlue", "special" },
+       { Color_math, N_("math"), "math", "DarkBlue", "math" },
+       { Color_mathbg, N_("math background"), "mathbg", "linen", "mathbg" },
+       { Color_graphicsbg, N_("graphics background"), "graphicsbg", "linen", "graphicsbg" },
+       { Color_mathmacrobg, N_("Math macro background"), "mathmacrobg", "linen", "mathmacrobg" },
+       { Color_mathframe, N_("math frame"), "mathframe", "Magenta", "mathframe" },
+       { Color_mathcorners, N_("math corners"), "mathcorners", "linen", "mathcorners" },
+       { Color_mathline, N_("math line"), "mathline", "Blue", "mathline" },
+       { Color_captionframe, N_("caption frame"), "captionframe", "DarkRed", "captionframe" },
+       { Color_collapsable, N_("collapsable inset text"), "collapsable", "DarkRed", "collapsable" },
+       { Color_collapsableframe, N_("collapsable inset frame"), "collapsableframe", "IndianRed", "collapsableframe" },
+       { Color_insetbg, N_("inset background"), "insetbg", "grey80", "insetbg" },
+       { Color_insetframe, N_("inset frame"), "insetframe", "IndianRed", "insetframe" },
+       { Color_error, N_("LaTeX error"), "error", "Red", "error" },
+       { Color_eolmarker, N_("end-of-line marker"), "eolmarker", "Brown", "eolmarker" },
+       { Color_appendix, N_("appendix marker"), "appendix", "Brown", "appendix" },
+       { Color_changebar, N_("change bar"), "changebar", "Blue", "changebar" },
+       { Color_deletedtext, N_("Deleted text"), "deletedtext", "#ff0000", "deletedtext" },
+       { Color_addedtext, N_("Added text"), "addedtext", "#0000ff", "addedtext" },
+       { Color_added_space, N_("added space markers"), "added_space", "Brown", "added_space" },
+       { Color_topline, N_("top/bottom line"), "topline", "Brown", "topline" },
+       { Color_tabularline, N_("table line"), "tabularline", "black", "tabularline" },
+       { Color_tabularonoffline, N_("table on/off line"), "tabularonoffline",
             "LightSteelBlue", "tabularonoffline" },
-       { bottomarea, N_("bottom area"), "bottomarea", "grey40", "bottomarea" },
-       { pagebreak, N_("page break"), "pagebreak", "RoyalBlue", "pagebreak" },
-       { buttonframe, N_("frame of button"), "buttonframe", "#dcd2c8", "buttonframe" },
-       { buttonbg, N_("button background"), "buttonbg", "#dcd2c8", "buttonbg" },
-       { buttonhoverbg, N_("button background under focus"), "buttonhoverbg", "#C7C7CA", "buttonhoverbg" },
-       { inherit, N_("inherit"), "inherit", "black", "inherit" },
-       { ignore, N_("ignore"), "ignore", "black", "ignore" },
-       { ignore, 0, 0, 0, 0 }
+       { Color_bottomarea, N_("bottom area"), "bottomarea", "grey40", "bottomarea" },
+       { Color_pagebreak, N_("page break"), "pagebreak", "RoyalBlue", "pagebreak" },
+       { Color_buttonframe, N_("frame of button"), "buttonframe", "#dcd2c8", "buttonframe" },
+       { Color_buttonbg, N_("button background"), "buttonbg", "#dcd2c8", "buttonbg" },
+       { Color_buttonhoverbg, N_("button background under focus"), "buttonhoverbg", "#C7C7CA", "buttonhoverbg" },
+       { Color_inherit, N_("inherit"), "inherit", "black", "inherit" },
+       { Color_ignore, N_("ignore"), "ignore", "black", "ignore" },
+       { Color_ignore, 0, 0, 0, 0 }
        };
 
        for (int i = 0; items[i].guiname; ++i)
@@ -236,7 +234,7 @@ Color & Color::operator=(Color tmp)
 }
 
 
-docstring const Color::getGUIName(Color::color c) const
+docstring const Color::getGUIName(ColorCode c) const
 {
        Pimpl::InfoTab::const_iterator it = pimpl_->infotab.find(c);
        if (it != pimpl_->infotab.end())
@@ -245,7 +243,7 @@ docstring const Color::getGUIName(Color::color c) const
 }
 
 
-string const Color::getX11Name(Color::color c) const
+string const Color::getX11Name(ColorCode c) const
 {
        Pimpl::InfoTab::const_iterator it = pimpl_->infotab.find(c);
        if (it != pimpl_->infotab.end())
@@ -258,7 +256,7 @@ string const Color::getX11Name(Color::color c) const
 }
 
 
-string const Color::getLaTeXName(Color::color c) const
+string const Color::getLaTeXName(ColorCode c) const
 {
        Pimpl::InfoTab::const_iterator it = pimpl_->infotab.find(c);
        if (it != pimpl_->infotab.end())
@@ -267,7 +265,7 @@ string const Color::getLaTeXName(Color::color c) const
 }
 
 
-string const Color::getLyXName(Color::color c) const
+string const Color::getLyXName(ColorCode c) const
 {
        Pimpl::InfoTab::const_iterator it = pimpl_->infotab.find(c);
        if (it != pimpl_->infotab.end())
@@ -276,7 +274,7 @@ string const Color::getLyXName(Color::color c) const
 }
 
 
-bool Color::setColor(Color::color col, string const & x11name)
+bool Color::setColor(ColorCode col, string const & x11name)
 {
        Pimpl::InfoTab::iterator it = pimpl_->infotab.find(col);
        if (it == pimpl_->infotab.end()) {
@@ -287,7 +285,7 @@ bool Color::setColor(Color::color col, string const & x11name)
 
        // "inherit" is returned for colors not in the database
        // (and anyway should not be redefined)
-       if (col == none || col == inherit || col == ignore) {
+       if (col == Color_none || col == Color_inherit || col == Color_ignore) {
                lyxerr << "Color " << getLyXName(col)
                       << " may not be redefined" << endl;
                return false;
@@ -305,39 +303,39 @@ bool Color::setColor(string const & lyxname, string const &x11name)
                LYXERR(Debug::GUI)
                        << "Color::setColor: Unknown color \""
                       << lyxname << '"' << endl;
-               addColor(static_cast<color>(pimpl_->infotab.size()), lcname);
+               addColor(static_cast<ColorCode>(pimpl_->infotab.size()), lcname);
        }
 
        return setColor(pimpl_->lyxcolors[lcname], x11name);
 }
 
 
-void Color::addColor(Color::color c, string const & lyxname) const
+void Color::addColor(ColorCode c, string const & lyxname) const
 {
        ColorEntry ce = { c, "", "", "", lyxname.c_str() };
        pimpl_->fill(ce);
 }
 
 
-Color::color Color::getFromLyXName(string const & lyxname) const
+ColorCode Color::getFromLyXName(string const & lyxname) const
 {
        string const lcname = ascii_lowercase(lyxname);
        if (pimpl_->lyxcolors.find(lcname) == pimpl_->lyxcolors.end()) {
                lyxerr << "Color::getFromLyXName: Unknown color \""
                       << lyxname << '"' << endl;
-               return none;
+               return Color_none;
        }
 
        return pimpl_->lyxcolors[lcname];
 }
 
 
-Color::color Color::getFromLaTeXName(string const & latexname) const
+ColorCode Color::getFromLaTeXName(string const & latexname) const
 {
        if (pimpl_->latexcolors.find(latexname) == pimpl_->latexcolors.end()) {
                lyxerr << "Color::getFromLaTeXName: Unknown color \""
                       << latexname << '"' << endl;
-               return none;
+               return Color_none;
        }
 
        return pimpl_->latexcolors[latexname];
index d9be348ac8fa53591463e4739bd529a0b61b9bde..05e670806ef6ea587d69b8b0aca33e542591aba1 100644 (file)
@@ -19,6 +19,8 @@
 #ifndef LCOLOR_H
 #define LCOLOR_H
 
+#include "ColorCode.h"
+
 #include "support/docstring.h"
 
 #include <boost/scoped_ptr.hpp>
@@ -49,142 +51,6 @@ class Color
 // explanation.
 {
 public:
-       /// Names of colors, including all logical colors
-       enum color {
-               /// No particular color---clear or default
-               none,
-               /// The different text colors
-               black,
-               ///
-               white,
-               ///
-               red,
-               ///
-               green,
-               ///
-               blue,
-               ///
-               cyan,
-               ///
-               magenta,
-               ///
-               yellow,
-
-               // Needed interface colors
-
-               /// Cursor color
-               cursor,
-               /// Background color
-               background,
-               /// Foreground color
-               foreground,
-               /// Background color of selected text
-               selection,
-               /// Text color in LaTeX mode
-               latex,
-               /// The color used for previews
-               preview,
-
-               /// Text color for notes
-               note,
-               /// Background color of notes
-               notebg,
-               /// Text color for comments
-               comment,
-               /// Background color of comments
-               commentbg,
-               /// Text color for greyedout inset
-               greyedout,
-               /// Background color of greyedout inset
-               greyedoutbg,
-               /// Shaded box background
-               shadedbg,
-
-               /// Color for the depth bars in the margin
-               depthbar,
-               /// Color for marking foreign language words
-               language,
-
-               /// Text color for command insets
-               command,
-               /// Background color for command insets
-               commandbg,
-               /// Frame color for command insets
-               commandframe,
-
-               /// Special chars text color
-               special,
-
-               /// Graphics inset background color
-               graphicsbg,
-               /// Math inset text color
-               math,
-               /// Math inset background color
-               mathbg,
-               /// Macro math inset background color
-               mathmacrobg,
-               /// Math inset frame color under focus
-               mathframe,
-               /// Math inset frame color not under focus
-               mathcorners,
-               /// Math line color
-               mathline,
-
-               /// caption frame color
-               captionframe,
-
-               /// collapsable insets text
-               collapsable,
-               /// collapsable insets frame
-               collapsableframe,
-
-               /// Inset marker background color
-               insetbg,
-               /// Inset marker frame color
-               insetframe,
-
-               /// Error box text color
-               error,
-               /// EOL marker color
-               eolmarker,
-               /// Added space colour
-               added_space,
-               /// Appendix marker color
-               appendix,
-               /// changebar color
-               changebar,
-               /// deleted text color
-               deletedtext,
-               /// added text color
-               addedtext,
-               /// Top and bottom line color
-               topline,
-               /// Table line color
-               tabularline,
-               /// Table line color
-               tabularonoffline,
-               /// Bottom area color
-               bottomarea,
-               /// Page break color
-               pagebreak,
-
-               // FIXME: why are the next four separate ??
-               /// Color used for button frame
-               buttonframe,
-               /// Color used for bottom background
-               buttonbg,
-               /// Color used for buttom under focus
-               buttonhoverbg,
-
-               // Logical attributes
-
-               /// Color is inherited
-               inherit,
-               /// For ignoring updates of a color
-               ignore
-       };
-
-
        ///
        Color();
        ///
@@ -197,7 +63,7 @@ public:
        /** set the given LyX color to the color defined by the X11 name given
         *  \returns true if successful.
         */
-       bool setColor(Color::color col, std::string const & x11name);
+       bool setColor(ColorCode col, std::string const & x11name);
 
        /** set the given LyX color to the color defined by the X11
         *  name given \returns true if successful. A new color entry
@@ -206,24 +72,24 @@ public:
        bool setColor(std::string const & lyxname, std::string const & x11name);
 
        /// Get the GUI name of \c color.
-       docstring const getGUIName(Color::color c) const;
+       docstring const getGUIName(ColorCode c) const;
 
        /// Get the X11 name of \c color.
-       std::string const getX11Name(Color::color c) const;
+       std::string const getX11Name(ColorCode c) const;
 
        /// Get the LaTeX name of \c color.
-       std::string const getLaTeXName(Color::color c) const;
+       std::string const getLaTeXName(ColorCode c) const;
 
        /// Get the LyX name of \c color.
-       std::string const getLyXName(Color::color c) const;
+       std::string const getLyXName(ColorCode c) const;
 
-       /// \returns the Color::color associated with the LyX name.
-       Color::color getFromLyXName(std::string const & lyxname) const;
-       /// \returns the Color::color associated with the LaTeX name.
-       Color::color getFromLaTeXName(std::string const & latexname) const;
+       /// \returns the ColorCode associated with the LyX name.
+       ColorCode getFromLyXName(std::string const & lyxname) const;
+       /// \returns the ColorCode associated with the LaTeX name.
+       ColorCode getFromLaTeXName(std::string const & latexname) const;
 private:
        ///
-       void addColor(Color::color c, std::string const & lyxname) const;
+       void addColor(ColorCode c, std::string const & lyxname) const;
        ///
        class Pimpl;
        ///
@@ -231,22 +97,6 @@ private:
 };
 
 
-/** \c Color_color is a wrapper for Color::color. It can be forward-declared and
- *  passed as a function argument without having to expose Color.h.
- */
-class Color_color {
-       Color::color val_;
-public:
-       /** The default constructor is nasty,
-        *  but allows us to use Color_color in STL containers.
-        */
-       Color_color() : val_(static_cast<Color::color>(-1)) {}
-
-       Color_color(Color::color val) : val_(val) {}
-       operator Color::color() const{ return val_; }
-};
-
-
 /// the current color definitions
 extern Color lcolor;
 /// the system color definitions
diff --git a/src/ColorCode.h b/src/ColorCode.h
new file mode 100644 (file)
index 0000000..8df8ff4
--- /dev/null
@@ -0,0 +1,153 @@
+// -*- C++ -*-
+/**
+ * \file ColorCode.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * Full author contact details are available in file CREDITS.
+ */
+
+#ifndef COLOR_CODE_H
+#define COLOR_CODE_H
+
+namespace lyx {
+
+/// Names of colors, including all logical colors
+enum ColorCode
+{
+       /// No particular color---clear or default
+       Color_none,
+       /// The different text colors
+       Color_black,
+       ///
+       Color_white,
+       ///
+       Color_red,
+       ///
+       Color_green,
+       ///
+       Color_blue,
+       ///
+       Color_cyan,
+       ///
+       Color_magenta,
+       ///
+       Color_yellow,
+
+       // Needed interface colors
+
+       /// Cursor color
+       Color_cursor,
+       /// Background color
+       Color_background,
+       /// Foreground color
+       Color_foreground,
+       /// Background color of selected text
+       Color_selection,
+       /// Text color in LaTeX mode
+       Color_latex,
+       /// The color used for previews
+       Color_preview,
+
+       /// Text color for notes
+       Color_note,
+       /// Background color of notes
+       Color_notebg,
+       /// Text color for comments
+       Color_comment,
+       /// Background color of comments
+       Color_commentbg,
+       /// Text color for greyedout inset
+       Color_greyedout,
+       /// Background color of greyedout inset
+       Color_greyedoutbg,
+       /// Shaded box background
+       Color_shadedbg,
+
+       /// Color for the depth bars in the margin
+       Color_depthbar,
+       /// Color for marking foreign language words
+       Color_language,
+
+       /// Text color for command insets
+       Color_command,
+       /// Background color for command insets
+       Color_commandbg,
+       /// Frame color for command insets
+       Color_commandframe,
+
+       /// Special chars text color
+       Color_special,
+
+       /// Graphics inset background color
+       Color_graphicsbg,
+       /// Math inset text color
+       Color_math,
+       /// Math inset background color
+       Color_mathbg,
+       /// Macro math inset background color
+       Color_mathmacrobg,
+       /// Math inset frame color under focus
+       Color_mathframe,
+       /// Math inset frame color not under focus
+       Color_mathcorners,
+       /// Math line color
+       Color_mathline,
+
+       /// caption frame color
+       Color_captionframe,
+
+       /// collapsable insets text
+       Color_collapsable,
+       /// collapsable insets frame
+       Color_collapsableframe,
+
+       /// Inset marker background color
+       Color_insetbg,
+       /// Inset marker frame color
+       Color_insetframe,
+
+       /// Error box text color
+       Color_error,
+       /// EOL marker color
+       Color_eolmarker,
+       /// Added space colour
+       Color_added_space,
+       /// Appendix marker color
+       Color_appendix,
+       /// changebar color
+       Color_changebar,
+       /// deleted text color
+       Color_deletedtext,
+       /// added text color
+       Color_addedtext,
+       /// Top and bottom line color
+       Color_topline,
+       /// Table line color
+       Color_tabularline,
+       /// Table line color
+       Color_tabularonoffline,
+       /// Bottom area color
+       Color_bottomarea,
+       /// Page break color
+       Color_pagebreak,
+
+       // FIXME: why are the next four separate ??
+       /// Color used for button frame
+       Color_buttonframe,
+       /// Color used for bottom background
+       Color_buttonbg,
+       /// Color used for buttom under focus
+       Color_buttonhoverbg,
+
+       // Logical attributes
+
+       /// Color is inherited
+       Color_inherit,
+       /// For ignoring updates of a color
+       Color_ignore
+};
+
+} // namespace lyx
+
+#endif
index 5826b34fb15413020615167b0b251cc267e8575e..6dbe00c63417ea36582cd719ee82e8f83f87ed2a 100644 (file)
@@ -124,7 +124,7 @@ Font::FontBits Font::sane = {
        MEDIUM_SERIES,
        UP_SHAPE,
        SIZE_NORMAL,
-       Color::none,
+       Color_none,
        OFF,
        OFF,
        OFF,
@@ -136,7 +136,7 @@ Font::FontBits Font::inherit = {
        INHERIT_SERIES,
        INHERIT_SHAPE,
        INHERIT_SIZE,
-       Color::inherit,
+       Color_inherit,
        INHERIT,
        INHERIT,
        INHERIT,
@@ -148,7 +148,7 @@ Font::FontBits Font::ignore = {
        IGNORE_SERIES,
        IGNORE_SHAPE,
        IGNORE_SIZE,
-       Color::ignore,
+       Color_ignore,
        IGNORE,
        IGNORE,
        IGNORE,
@@ -206,9 +206,9 @@ Font::Font(Font::FONT_INIT3, Language const * l)
 
 
 
-Color_color Font::color() const
+ColorCode Font::color() const
 {
-       return Color::color(bits.color);
+       return ColorCode(bits.color);
 }
 
 
@@ -267,9 +267,9 @@ void Font::setNoun(Font::FONT_MISC_STATE n)
 }
 
 
-void Font::setColor(Color_color c)
+void Font::setColor(ColorCode c)
 {
-       bits.color = int(c);
+       bits.color = c;
 }
 
 
@@ -425,8 +425,8 @@ void Font::update(Font const & newfont,
                setLanguage(newfont.language());
 
        if (newfont.color() == color() && toggleall)
-               setColor(Color::inherit); // toggle 'back'
-       else if (newfont.color() != Color::ignore)
+               setColor(Color_inherit); // toggle 'back'
+       else if (newfont.color() != Color_ignore)
                setColor(newfont.color());
 }
 
@@ -449,7 +449,7 @@ void Font::reduce(Font const & tmplt)
        if (noun() == tmplt.noun())
                setNoun(INHERIT);
        if (color() == tmplt.color())
-               setColor(Color::inherit);
+               setColor(Color_inherit);
 }
 
 
@@ -482,7 +482,7 @@ Font & Font::realize(Font const & tmplt)
        if (bits.noun == INHERIT)
                bits.noun = tmplt.bits.noun;
 
-       if (bits.color == Color::inherit)
+       if (bits.color == Color_inherit)
                bits.color = tmplt.bits.color;
 
        return *this;
@@ -496,7 +496,7 @@ bool Font::resolved() const
                shape() != INHERIT_SHAPE && size() != INHERIT_SIZE &&
                emph() != INHERIT && underbar() != INHERIT &&
                noun() != INHERIT &&
-               color() != Color::inherit);
+               color() != Color_inherit);
 }
 
 
@@ -511,7 +511,7 @@ docstring const Font::stateText(BufferParams * params) const
                os << _(GUIShapeNames[shape()]) << ", ";
        if (size() != INHERIT_SIZE)
                os << _(GUISizeNames[size()]) << ", ";
-       if (color() != Color::inherit)
+       if (color() != Color_inherit)
                os << lcolor.getGUIName(color()) << ", ";
        if (emph() != INHERIT)
                os << bformat(_("Emphasis %1$s, "),
@@ -836,7 +836,7 @@ int Font::latexWriteStartChanges(odocstream & os, BufferParams const & bparams,
                count += strlen(LaTeXShapeNames[f.shape()]) + 2;
                env = true; //We have opened a new environment
        }
-       if (f.color() != Color::inherit && f.color() != Color::ignore) {
+       if (f.color() != Color_inherit && f.color() != Color_ignore) {
                os << "\\textcolor{"
                   << from_ascii(lcolor.getLaTeXName(f.color()))
                   << "}{";
@@ -907,7 +907,7 @@ int Font::latexWriteEndChanges(odocstream & os, BufferParams const & bparams,
                ++count;
                env = true; // Size change need not bother about closing env.
        }
-       if (f.color() != Color::inherit && f.color() != Color::ignore) {
+       if (f.color() != Color_inherit && f.color() != Color_ignore) {
                os << '}';
                ++count;
                env = true; // Size change need not bother about closing env.
@@ -970,10 +970,10 @@ int Font::latexWriteEndChanges(odocstream & os, BufferParams const & bparams,
 }
 
 
-Color_color Font::realColor() const
+ColorCode Font::realColor() const
 {
-       if (color() == Color::none)
-               return Color::foreground;
+       if (color() == Color_none)
+               return Color_foreground;
        return color();
 }
 
@@ -1048,7 +1048,7 @@ bool Font::fromString(string const & data, bool & toggle)
 
                } else if (token == "color") {
                        int const next = lex.getInteger();
-                       setColor(Color::color(next));
+                       setColor(ColorCode(next));
 
                } else if (token == "language") {
                        string const next = lex.getString();
@@ -1086,13 +1086,13 @@ void Font::validate(LaTeXFeatures & features) const
                        << endl;
        }
        switch (color()) {
-               case Color::none:
-               case Color::inherit:
-               case Color::ignore:
+               case Color_none:
+               case Color_inherit:
+               case Color_ignore:
                        // probably we should put here all interface colors used for
                        // font displaying! For now I just add this ones I know of (Jug)
-               case Color::latex:
-               case Color::note:
+               case Color_latex:
+               case Color_note:
                        break;
                default:
                        features.require("color");
index 6cd84e53b92147360438329b78536285741e7a15..c2b9f405de7a4615fc50b9cb6e3b0b86c0c16073 100644 (file)
@@ -19,7 +19,8 @@
 #include "tex2lyx/Font.h"
 #else
 
-#include "Color.h"
+#include "ColorCode.h"
+
 #include "support/docstream.h"
 
 
@@ -174,10 +175,8 @@ public:
                FONT_SHAPE shape;
                ///
                FONT_SIZE size;
-               /** We store the Color::color value as an int to get Color.h out
-                *  of the header file.
-                */
-               int color;
+               ///
+               ColorCode color;
                ///
                FONT_MISC_STATE emph;
                ///
@@ -224,7 +223,7 @@ public:
        ///
        FONT_MISC_STATE number() const { return bits.number; }
        ///
-       Color_color color() const;
+       ColorCode color() const;
        ///
        Language const * language() const { return lang; }
        ///
@@ -243,7 +242,7 @@ public:
        void setUnderbar(Font::FONT_MISC_STATE u);
        void setNoun(Font::FONT_MISC_STATE n);
        void setNumber(Font::FONT_MISC_STATE n);
-       void setColor(Color_color c);
+       void setColor(ColorCode c);
        void setLanguage(Language const * l);
 
        /// Set family after LyX text format
@@ -320,7 +319,7 @@ public:
        docstring const stateText(BufferParams * params) const;
 
        ///
-       Color_color realColor() const;
+       ColorCode realColor() const;
 
        ///
        void validate(LaTeXFeatures & features) const;
index 25be2c1866f151e24906f6dc61875d846780519a..245267c9b2df4d1e72321b669853bac6f6a715e3 100644 (file)
@@ -16,8 +16,8 @@
 
 #include "LaTeXFeatures.h"
 
-#include "BufferParams.h"
 #include "Color.h"
+#include "BufferParams.h"
 #include "debug.h"
 #include "Encoding.h"
 #include "Floating.h"
@@ -512,7 +512,7 @@ string const LaTeXFeatures::getPackages() const
        }
        // shadecolor for shaded
        if (mustProvide("framed") && mustProvide("color")) {
-               RGBColor c = RGBColor(lcolor.getX11Name(Color::shadedbg));
+               RGBColor c = RGBColor(lcolor.getX11Name(Color_shadedbg));
                //255.0 to force conversion to double
                //NOTE As Jürgen Spitzmüller pointed out, an alternative would be
                //to use the xcolor package instead, and then we can do
@@ -687,11 +687,11 @@ string const LaTeXFeatures::getMacros() const
        if (mustProvide("ct-xcolor-soul")) {
                int const prec = macros.precision(2);
        
-               RGBColor cadd = RGBColor(lcolor.getX11Name(Color::addedtext));
+               RGBColor cadd = RGBColor(lcolor.getX11Name(Color_addedtext));
                macros << "\\providecolor{lyxadded}{rgb}{"
                       << cadd.r / 255.0 << ',' << cadd.g / 255.0 << ',' << cadd.b / 255.0 << "}\n";
 
-               RGBColor cdel = RGBColor(lcolor.getX11Name(Color::deletedtext));
+               RGBColor cdel = RGBColor(lcolor.getX11Name(Color_deletedtext));
                macros << "\\providecolor{lyxdeleted}{rgb}{"
                       << cdel.r / 255.0 << ',' << cdel.g / 255.0 << ',' << cdel.b / 255.0 << "}\n";
 
index f6d513da3fc67ce82bf8f8a9775abeb3d6630678..4bdf4434ca394a7c82fabc88ef0d694581f95247 100644 (file)
@@ -17,6 +17,7 @@
 
 #include "LyX.h"
 
+#include "Color.h"
 #include "ConverterCache.h"
 #include "Buffer.h"
 #include "buffer_funcs.h"
@@ -32,7 +33,6 @@
 #include "CmdDef.h"
 #include "Language.h"
 #include "Session.h"
-#include "Color.h"
 #include "LyXAction.h"
 #include "LyXFunc.h"
 #include "Lexer.h"
index 87e6b031e4502249fe40b7094e979763d37b9a15..1324199bcbedabe4de3e173f526515652dba2744 100644 (file)
@@ -29,7 +29,6 @@
 #include "BufferParams.h"
 #include "BufferView.h"
 #include "CmdDef.h"
-#include "Color.h"
 #include "Converter.h"
 #include "Cursor.h"
 #include "CutAndPaste.h"
@@ -1769,8 +1768,8 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                        }
 
                        bool const graphicsbg_changed =
-                               (lyx_name == lcolor.getLyXName(Color::graphicsbg) &&
-                                x11_name != lcolor.getX11Name(Color::graphicsbg));
+                               (lyx_name == lcolor.getLyXName(Color_graphicsbg) &&
+                                x11_name != lcolor.getX11Name(Color_graphicsbg));
 
                        if (!lcolor.setColor(lyx_name, x11_name)) {
                                setErrorMessage(
index 698a8f294b8b846ed15e5f4f9f78538a5c64f774..f415aecce6aa2d1e64f6b77d4f61355c6f6f0c11 100644 (file)
 #include "LyXRC.h"
 
 #include "debug.h"
+#include "Color.h"
 #include "Converter.h"
 #include "Format.h"
 #include "gettext.h"
 #include "Session.h"
-#include "Color.h"
 #include "Lexer.h"
 #include "Font.h"
 #include "Mover.h"
@@ -820,11 +820,11 @@ int LyXRC::read(Lexer & lexrc)
                                break;
                        }
 
-                       Color::color const col =
+                       ColorCode const col =
                                lcolor.getFromLyXName(lyx_name);
-                       if (col == Color::none ||
-                           col == Color::inherit ||
-                           col == Color::ignore)
+                       if (col == Color_none ||
+                           col == Color_inherit ||
+                           col == Color_ignore)
                                break;
 
                        if (!lcolor.setColor(col, x11_name)) {
@@ -1696,8 +1696,8 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) c
                   << "#\n\n";
 
        case RC_SET_COLOR:
-               for (int i = 0; i < Color::ignore; ++i) {
-                       Color::color lc = static_cast<Color::color>(i);
+               for (int i = 0; i < Color_ignore; ++i) {
+                       ColorCode lc = static_cast<ColorCode>(i);
 
                        string const col(lcolor.getX11Name(lc));
                        if (ignore_system_lyxrc ||
index ec58f7268a2595179abf484db75cae88d551db72..3bd2e29e8ac66eb7ee049c144c2d3231ce539c76 100644 (file)
@@ -102,6 +102,7 @@ liblyxcore_la_SOURCES = \
        Chktex.h \
        CmdDef.cpp \
        CmdDef.h \
+       ColorCode.h \
        Color.cpp \
        Color.h \
        config.h.in \
index 0ddf21ca17ec11b5d930ae5b8adff6b72629354c..514693e4a686f01a85d4c001c840be3e068c5ed5 100644 (file)
@@ -51,7 +51,7 @@ MetricsInfo::MetricsInfo(BufferView * bv, Font const & font, int textwidth)
 
 PainterInfo::PainterInfo(BufferView * bv, lyx::frontend::Painter & painter)
        : pain(painter), ltr_pos(false), erased_(false), full_repaint(true),
-       background_color(Color::background)
+       background_color(Color_background)
 {
        base.bv = bv;
 }
index 779c60f989cf04496506199b46fa2fa264a12bad..c6844e22608fca663c9419b7c5db2ebcdf46880f 100644 (file)
@@ -29,7 +29,6 @@
 #include "InsetList.h"
 #include "Language.h"
 #include "LaTeXFeatures.h"
-#include "Color.h"
 #include "Layout.h"
 #include "Length.h"
 #include "Font.h"
index 3950d6ebc5e41662498aab049173c422b29c8228..44f14e185dcebb7fccfd38d3d9c5906fe76c3fab 100644 (file)
@@ -38,7 +38,6 @@
 #include "FontIterator.h"
 #include "gettext.h"
 #include "Language.h"
-#include "Color.h"
 #include "Length.h"
 #include "Lexer.h"
 #include "LyXRC.h"
index 6c7c6946adba3daadb93b2d0360926bcc27c3122..27434c955d4b72c24054b95220f130f91b6996ac 100644 (file)
@@ -28,7 +28,6 @@ class Font;
 class FuncRequest;
 class FuncStatus;
 class Inset;
-class Color_color;
 class Cursor;
 class Lexer;
 class PainterInfo;
index b21999fe51cb74d27831bb1d2cc5b9ef9f8e6660..05dc7f18fd64b6e9b20ddf5eb56365415766436d 100644 (file)
@@ -29,7 +29,6 @@
 #include "BufferView.h"
 #include "Bullet.h"
 #include "Changes.h"
-#include "Color.h"
 #include "Cursor.h"
 #include "CutAndPaste.h"
 #include "debug.h"
index e2e63d569713f66c303fdc356aeb1922ff9d27f7..1066c081e45f13e43ddd2527e8a2ad1acdb0fbc1 100644 (file)
 #include <config.h>
 
 #include "TextClass.h"
-#include "debug.h"
-#include "Layout.h"
-#include "Lexer.h"
+
+#include "Color.h"
 #include "Counters.h"
+#include "debug.h"
 #include "gettext.h"
 #include "Floating.h"
 #include "FloatList.h"
+#include "Layout.h"
+#include "Lexer.h"
 
 #include "frontends/alert.h"
 
@@ -657,7 +659,7 @@ void TextClass::readInsetLayout(Lexer & lexrc, docstring const & name)
        string latexparam;
        Font font(defaultfont());
        Font labelfont(defaultfont());
-       Color::color bgcolor(Color::background);
+       ColorCode bgcolor(Color_background);
        string preamble;
        bool multipar(false);
        bool passthru(false);
@@ -1096,7 +1098,7 @@ InsetLayout const & TextClass::insetlayout(docstring const & name) const
        }
        static InsetLayout empty;
        empty.labelstring = from_utf8("UNDEFINED");
-       empty.bgcolor = Color::error;
+       empty.bgcolor = Color_error;
        return empty;
 }
 
index d8aa0f17ef4802dd980e77ea5312ffd779c5b0b3..4fcc1e8ea604d5de6d70c5a503b2a2cfa90f0b28 100644 (file)
 #ifndef LYXTEXTCLASS_H
 #define LYXTEXTCLASS_H
 
-#include "Color.h"
+#include "ColorCode.h"
 #include "Font.h"
 #include "LayoutEnums.h"
 #include "LayoutPtr.h"
 
+#include "support/docstring.h"
+
 #include <boost/shared_ptr.hpp>
 
 #include <vector>
@@ -43,7 +45,7 @@ public:
        std::string latexparam;
        Font font;
        Font labelfont;
-       Color::color bgcolor;
+       ColorCode bgcolor;
        std::string preamble;
        bool multipar;
        bool passthru;
index 39fddf750290c3d1b46bfe48dc17b45282bbb96a..3b871f7dfbba0e7d444b2547956a9b177415bda2 100644 (file)
@@ -24,7 +24,6 @@
 #include "buffer_funcs.h"
 #include "BufferParams.h"
 #include "BufferView.h"
-#include "Color.h"
 #include "CutAndPaste.h"
 #include "debug.h"
 #include "FontIterator.h"
@@ -1935,7 +1934,7 @@ void TextMetrics::drawParagraph(PainterInfo & pi, pit_type pit, int x, int y) co
                if (row_selection || (!pi.full_repaint && row_has_changed)) {
                        pi.pain.fillRectangle(x, y - rit->ascent(),
                                width(), rit->height(),
-                               Color_color(Color::color(pi.background_color)));
+                               ColorCode(ColorCode(pi.background_color)));
                }
                if (row_selection) {
                        DocIterator beg = bv_->cursor().selectionBegin();
@@ -2028,7 +2027,7 @@ void TextMetrics::drawSelection(PainterInfo & pi,
                if (middleTop < middleBottom) {
                        // draw middle rectangle
                        pi.pain.fillRectangle(x, middleTop, width(), middleBottom - middleTop,
-                               Color::selection);
+                               Color_selection);
                }
 
                if (!clipBelow) {
@@ -2058,16 +2057,16 @@ void TextMetrics::drawRowSelection(PainterInfo & pi, int x, Row const & row,
        // draw the margins
        if (drawOnBegMargin) {
                if (text_->isRTL(buffer, beg.paragraph()))
-                       pi.pain.fillRectangle(x + x1, y1, width() - x1, y2 - y1, Color::selection);
+                       pi.pain.fillRectangle(x + x1, y1, width() - x1, y2 - y1, Color_selection);
                else
-                       pi.pain.fillRectangle(x, y1, x1, y2 - y1, Color::selection);
+                       pi.pain.fillRectangle(x, y1, x1, y2 - y1, Color_selection);
        }
        
        if (drawOnEndMargin) {
                if (text_->isRTL(buffer, beg.paragraph()))
-                       pi.pain.fillRectangle(x, y1, x2, y2 - y1, Color::selection);
+                       pi.pain.fillRectangle(x, y1, x2, y2 - y1, Color_selection);
                else
-                       pi.pain.fillRectangle(x + x2, y1, width() - x2, y2 - y1, Color::selection);
+                       pi.pain.fillRectangle(x + x2, y1, width() - x2, y2 - y1, Color_selection);
        }
        
        // if we are on a boundary from the beginning, it's probably
@@ -2111,7 +2110,7 @@ void TextMetrics::drawRowSelection(PainterInfo & pi, int x, Row const & row,
                if (!(cur < end) || drawNow) {
                        x2 = cursorX(cur.top(), cur.boundary());
                        pi.pain.fillRectangle(x + min(x1,x2), y1, abs(x2 - x1), y2 - y1,
-                               Color::selection);
+                               Color_selection);
                        
                        // reset x1, so it is set again next round (which will be on the 
                        // right side of a boundary or at the selection end)
index 347493a75039f9323ce75157df8ce4c178c38592..6ad657d3f34a7293f5d2f43b401d1952101a4086 100644 (file)
@@ -18,7 +18,6 @@
 #include "debug.h"
 #include "FloatList.h"
 #include "FuncRequest.h"
-#include "Color.h"
 #include "Lexer.h"
 #include "LyX.h"
 
@@ -206,7 +205,7 @@ Inset * createInset(BufferView * bv, FuncRequest const & cmd)
                        auto_ptr<InsetCaption> inset(new InsetCaption(params));
                        inset->setAutoBreakRows(true);
                        inset->setDrawFrame(true);
-                       inset->setFrameColor(Color::captionframe);
+                       inset->setFrameColor(Color_captionframe);
                        return inset.release();
                }
 
index a682207c0581976a797f540628f48ed6aa006580..6c11007bbb15fb23ca7cdf76cbcb315742ea8a1e 100644 (file)
@@ -11,6 +11,8 @@
 #ifndef LYX_APPLICATION_H
 #define LYX_APPLICATION_H
 
+#include "ColorCode.h"
+
 #include <boost/function.hpp>
 
 #include <string>
@@ -18,7 +20,6 @@
 namespace lyx {
 
 class BufferView;
-class Color_color;
 struct RGBColor;
 
 namespace frontend {
@@ -187,17 +188,17 @@ public:
        * The function returns true if successful.
        * It returns false on failure and sets r, g, b to 0.
        */
-       virtual bool getRgbColor(Color_color col, RGBColor & rgbcol) = 0;
+       virtual bool getRgbColor(ColorCode col, RGBColor & rgbcol) = 0;
 
-       /** Eg, passing Color::black returns "000000",
-       *      passing Color::white returns "ffffff".
+       /** Eg, passing Color_black returns "000000",
+       *      passing Color_white returns "ffffff".
        */
-       virtual std::string const hexName(Color_color col) = 0;
+       virtual std::string const hexName(ColorCode col) = 0;
 
        /**
        * update an altered GUI color
        */
-       virtual void updateColor(Color_color col) = 0;
+       virtual void updateColor(ColorCode col) = 0;
 
        /**
        * add a callback for socket read notification
index b5a6b48f04a33050aa549e5117a14c63e7a0999d..40930134c19cdf4cc1bda6893f6932c68f58d049 100644 (file)
@@ -15,7 +15,6 @@
 
 #include "frontends/FontMetrics.h"
 
-#include "Color.h"
 #include "Font.h"
 
 using lyx::docstring;
@@ -29,27 +28,27 @@ namespace frontend {
 void Painter::button(int x, int y, int w, int h, bool mouseHover)
 {
        if (mouseHover)
-               fillRectangle(x, y, w, h, Color::buttonhoverbg);
+               fillRectangle(x, y, w, h, Color_buttonhoverbg);
        else
-               fillRectangle(x, y, w, h, Color::buttonbg);
+               fillRectangle(x, y, w, h, Color_buttonbg);
        buttonFrame(x, y, w, h);
 }
 
 
 void Painter::buttonFrame(int x, int y, int w, int h)
 {
-       line(x, y, x, y + h - 1, Color::buttonframe);
-       line(x - 1 + w, y, x - 1 + w, y + h - 1, Color::buttonframe);
-       line(x, y - 1, x - 1 + w, y - 1, Color::buttonframe);
-       line(x, y + h - 1, x - 1 + w, y + h - 1, Color::buttonframe);
+       line(x, y, x, y + h - 1, Color_buttonframe);
+       line(x - 1 + w, y, x - 1 + w, y + h - 1, Color_buttonframe);
+       line(x, y - 1, x - 1 + w, y - 1, Color_buttonframe);
+       line(x, y + h - 1, x - 1 + w, y + h - 1, Color_buttonframe);
 }
 
 
 void Painter::rectText(int x, int y,
        docstring const & str,
        Font const & font,
-       Color_color back,
-       Color_color frame)
+       ColorCode back,
+       ColorCode frame)
 {
        int width;
        int ascent;
@@ -58,11 +57,11 @@ void Painter::rectText(int x, int y,
        FontMetrics const & fm = theFontMetrics(font);
        fm.rectText(str, width, ascent, descent);
 
-       if (back != Color::none)
+       if (back != Color_none)
                fillRectangle(x + 1, y - ascent + 1, width - 1,
                              ascent + descent - 1, back);
 
-       if (frame != Color::none)
+       if (frame != Color_none)
                rectangle(x, y - ascent, width, ascent + descent, frame);
 
        text(x + 3, y, str, font);
@@ -97,17 +96,17 @@ int Painter::preeditText(int x, int y, char_type c,
        switch (style) {
                case preedit_default:
                        // default unselecting mode.
-                       fillRectangle(x, y - height + 1, width, height, Color::background);
+                       fillRectangle(x, y - height + 1, width, height, Color_background);
                        dashedUnderline(font, x, y - descent + 1, width);
                        break;
                case preedit_selecting:
                        // We are in selecting mode: white text on black background.
-                       fillRectangle(x, y - height + 1, width, height, Color::black);
-                       temp_font.setColor(Color::white);
+                       fillRectangle(x, y - height + 1, width, height, Color_black);
+                       temp_font.setColor(Color_white);
                        break;
                case preedit_cursor:
                        // The character comes with a cursor.
-                       fillRectangle(x, y - height + 1, width, height, Color::background);
+                       fillRectangle(x, y - height + 1, width, height, Color_background);
                        underline(font, x, y - descent + 1, width);
                        break;
        }
index ef6c9818ea5397f4b92ae9093adff878ac8d703f..9fc31a57e761934d2859b04fb9eee97699b1e7b4 100644 (file)
 #ifndef PAINTER_H
 #define PAINTER_H
 
+#include "ColorCode.h"
+
 #include "support/docstring.h"
 
 namespace lyx {
 
-class Color_color;
 class Font;
 
 namespace graphics { class Image; }
@@ -80,7 +81,7 @@ public:
        virtual void line(
                int x1, int y1,
                int x2, int y2,
-               Color_color,
+               ColorCode,
                line_style = line_solid,
                line_width = line_thin) = 0;
 
@@ -94,7 +95,7 @@ public:
                int const * xp,
                int const * yp,
                int np,
-               Color_color,
+               ColorCode,
                line_style = line_solid,
                line_width = line_thin) = 0;
 
@@ -102,7 +103,7 @@ public:
        virtual void rectangle(
                int x, int y,
                int w, int h,
-               Color_color,
+               ColorCode,
                line_style = line_solid,
                line_width = line_thin) = 0;
 
@@ -110,19 +111,19 @@ public:
        virtual void fillRectangle(
                int x, int y,
                int w, int h,
-               Color_color) = 0;
+               ColorCode) = 0;
 
        /// draw an arc
        virtual void arc(
                int x, int y,
                unsigned int w, unsigned int h,
                int a1, int a2,
-               Color_color) = 0;
+               ColorCode) = 0;
 
        /// draw a pixel
        virtual void point(
                int x, int y,
-               Color_color) = 0;
+               ColorCode) = 0;
 
        /// draw a filled rectangle with the shape of a 3D button
        virtual void button(int x, int y,
@@ -158,8 +159,8 @@ public:
        void rectText(int x, int baseline,
                docstring const & str,
                Font const & font,
-               Color_color back,
-               Color_color frame);
+               ColorCode back,
+               ColorCode frame);
 
        /// draw a string and enclose it inside a button frame
        void buttonText(int x, int baseline, docstring const & s,
index bcc14932bfd01a2f762dfe342c17736932d4932a..c3abe443b29ae6c145b40c42b85d71c30769936a 100644 (file)
@@ -23,7 +23,6 @@
 #include "BufferView.h"
 #include "Buffer.h"
 #include "BufferParams.h"
-#include "Color.h"
 #include "CoordCache.h"
 #include "Cursor.h"
 #include "debug.h"
index 4a77f0ff63eb3a1be43d48e3328ab3dab6374ac3..514246a18fe459982848198e12c91dd146d72813 100644 (file)
@@ -11,8 +11,8 @@
 #include <config.h>
 
 #include "ColorCache.h"
-#include "Color.h"
 
+#include "Color.h"
 
 namespace lyx {
 
@@ -22,7 +22,7 @@ const QColor grey80(0xcc, 0xcc, 0xcc);
 const QColor grey90(0xe5, 0xe5, 0xe5);
 const QColor none = Qt::black;
 
-QColor const & ColorCache::get(Color_color col) const
+QColor const & ColorCache::get(ColorCode col) const
 {
        lcolor_map::const_iterator cit = colormap.find(col);
        if (cit != colormap.end())
index 05dabea4b04e9c0b7316ba61f3ae3de2101dcaa5..4ac490501160c2f244a2a67167ee2235245d2593 100644 (file)
@@ -12,7 +12,7 @@
 #ifndef COLORCACHE_H
 #define COLORCACHE_H
 
-#include "Color.h"
+#include "ColorCode.h"
 
 #include <QColor>
 
@@ -33,13 +33,13 @@ public:
        ColorCache() {}
 
        /// get the given color
-       QColor const & get(Color_color color) const;
+       QColor const & get(ColorCode color) const;
 
        /// clear all colors
        void clear();
 
 private:
-       typedef std::map<Color_color, QColor> lcolor_map;
+       typedef std::map<ColorCode, QColor> lcolor_map;
 
        mutable lcolor_map colormap;
 };
index d764c574af539e2a24f386a4481743b40c99222f..c604af671b96c0ff25d48414521e7def91dce09d 100644 (file)
@@ -330,7 +330,7 @@ void GuiApplication::syncEvents()
 }
 
 
-bool GuiApplication::getRgbColor(Color_color col,
+bool GuiApplication::getRgbColor(ColorCode col,
        RGBColor & rgbcol)
 {
        QColor const & qcol = color_cache_.get(col);
@@ -347,13 +347,13 @@ bool GuiApplication::getRgbColor(Color_color col,
 }
 
 
-string const GuiApplication::hexName(Color_color col)
+string const GuiApplication::hexName(ColorCode col)
 {
        return support::ltrim(fromqstr(color_cache_.get(col).name()), "#");
 }
 
 
-void GuiApplication::updateColor(Color_color)
+void GuiApplication::updateColor(ColorCode)
 {
        // FIXME: Bleh, can't we just clear them all at once ?
        color_cache_.clear();
index c2f2551bbe6a8df4964ea6f7f13ec8fe364b1fb9..3ba4800f885aae21918044d24d7572d4f9e850d2 100644 (file)
@@ -65,9 +65,9 @@ public:
        virtual std::string const romanFontName();
        virtual std::string const sansFontName();
        virtual std::string const typewriterFontName();
-       virtual bool getRgbColor(Color_color col, RGBColor & rgbcol);
-       virtual std::string const hexName(Color_color col);
-       virtual void updateColor(Color_color col);
+       virtual bool getRgbColor(ColorCode col, RGBColor & rgbcol);
+       virtual std::string const hexName(ColorCode col);
+       virtual void updateColor(ColorCode col);
        virtual void registerSocketCallback(int fd, SocketCallback func);
        void unregisterSocketCallback(int fd);
        //@}
index 266880592e31bbd39d7bf1527c1f1365b1067aee..d8ee45ca44e4d39cad1c8c1821bf3ce45accb914 100644 (file)
 #include "GuiCharacter.h"
 
 #include "qt_helpers.h"
-#include "Color.h"
 #include "Font.h"
 #include "Buffer.h"
 #include "BufferParams.h"
 #include "FuncRequest.h"
 #include "Language.h"
-#include "Color.h"
 
 #include <QCloseEvent>
 
@@ -169,47 +167,47 @@ static vector<ColorPair> const getColorData()
        ColorPair pr;
 
        pr.first = qt_("No change");
-       pr.second = Color::ignore;
+       pr.second = Color_ignore;
        color[0] = pr;
 
        pr.first = qt_("No color");
-       pr.second = Color::none;
+       pr.second = Color_none;
        color[1] = pr;
 
        pr.first = qt_("Black");
-       pr.second = Color::black;
+       pr.second = Color_black;
        color[2] = pr;
 
        pr.first = qt_("White");
-       pr.second = Color::white;
+       pr.second = Color_white;
        color[3] = pr;
 
        pr.first = qt_("Red");
-       pr.second = Color::red;
+       pr.second = Color_red;
        color[4] = pr;
 
        pr.first = qt_("Green");
-       pr.second = Color::green;
+       pr.second = Color_green;
        color[5] = pr;
 
        pr.first = qt_("Blue");
-       pr.second = Color::blue;
+       pr.second = Color_blue;
        color[6] = pr;
 
        pr.first = qt_("Cyan");
-       pr.second = Color::cyan;
+       pr.second = Color_cyan;
        color[7] = pr;
 
        pr.first = qt_("Magenta");
-       pr.second = Color::magenta;
+       pr.second = Color_magenta;
        color[8] = pr;
 
        pr.first = qt_("Yellow");
-       pr.second = Color::yellow;
+       pr.second = Color_yellow;
        color[9] = pr;
 
        pr.first = qt_("Reset");
-       pr.second = Color::inherit;
+       pr.second = Color_inherit;
        color[10] = pr;
 
        return color;
@@ -432,7 +430,7 @@ bool GuiCharacter::initialiseParams(string const &)
            || getShape()  != Font::IGNORE_SHAPE
            || getSize()   != Font::IGNORE_SIZE
            || getBar()    != IGNORE
-           || getColor()  != Color::ignore
+           || getColor()  != Color_ignore
            || font_.language() != ignore_language)
                setButtonsValid(true);
 
@@ -544,26 +542,26 @@ void GuiCharacter::setBar(FontState val)
 }
 
 
-Color_color GuiCharacter::getColor() const
+ColorCode GuiCharacter::getColor() const
 {
        return font_.color();
 }
 
 
-void GuiCharacter::setColor(Color_color val)
+void GuiCharacter::setColor(ColorCode val)
 {
        switch (val) {
-       case Color::ignore:
-       case Color::none:
-       case Color::black:
-       case Color::white:
-       case Color::red:
-       case Color::green:
-       case Color::blue:
-       case Color::cyan:
-       case Color::magenta:
-       case Color::yellow:
-       case Color::inherit:
+       case Color_ignore:
+       case Color_none:
+       case Color_black:
+       case Color_white:
+       case Color_red:
+       case Color_green:
+       case Color_blue:
+       case Color_cyan:
+       case Color_magenta:
+       case Color_yellow:
+       case Color_inherit:
                font_.setColor(val);
                break;
        default:
index 18473d0fef6259a871f8afbd12fb8b169dacaa32..e2d87b96e962d156d9887b396328304d7410d95f 100644 (file)
@@ -24,8 +24,6 @@
 
 namespace lyx {
 
-class Color_color;
-
 namespace frontend {
 
 enum FontState {
@@ -46,7 +44,7 @@ typedef std::pair<QString, Font::FONT_SERIES> SeriesPair;
 typedef std::pair<QString, Font::FONT_SHAPE>  ShapePair;
 typedef std::pair<QString, Font::FONT_SIZE>   SizePair;
 typedef std::pair<QString, FontState> BarPair;
-typedef std::pair<QString, Color_color> ColorPair;
+typedef std::pair<QString, ColorCode> ColorPair;
 
 class GuiCharacter : public GuiDialog, public Ui::CharacterUi
 {
@@ -95,7 +93,7 @@ private:
        ///
        void setBar(FontState);
        ///
-       void setColor(Color_color);
+       void setColor(ColorCode);
        ///
        void setLanguage(std::string const &);
 
@@ -110,7 +108,7 @@ private:
        ///
        FontState getBar() const;
        ///
-       Color_color getColor() const;
+       ColorCode getColor() const;
        ///
        std::string getLanguage() const;
 
index d551c22bd85fde1765752fc30187a91cfd3a163d..48629ccc6f089231ef2b764b657fb934ac69e538 100644 (file)
@@ -18,7 +18,6 @@
 #include "Buffer.h"
 #include "BufferParams.h"
 #include "BufferView.h"
-#include "Color.h"
 #include "Encoding.h"
 #include "FloatPlacement.h"
 #include "frontend_helpers.h"
index c85e8c6f8073d8a4190063f3a21ad56df19c73c3..b3128361a38fbe4deeaace0bc4ef7953fd11c8da 100644 (file)
@@ -21,6 +21,8 @@
 
 #include <QFont>
 
+#include <boost/scoped_ptr.hpp>
+
 namespace lyx {
 namespace frontend {
 
index c59edddb0269452d26ba73978381594e3011b696..a3c2b6ccacba1438286b9f6e78c89a2ea834b031 100644 (file)
@@ -22,7 +22,6 @@
 
 #include "debug.h"
 #include "Language.h"
-#include "Color.h"
 
 #include "support/unicode.h"
 
@@ -64,7 +63,7 @@ GuiPainter::GuiPainter(QPaintDevice * device)
        : QPainter(device), Painter()
 {
        // new QPainter has default QPen:
-       current_color_ = Color::black;
+       current_color_ = Color_black;
        current_ls_ = line_solid;
        current_lw_ = line_thin;
 }
@@ -77,7 +76,7 @@ GuiPainter::~GuiPainter()
 }
 
 
-void GuiPainter::setQPainterPen(Color_color col,
+void GuiPainter::setQPainterPen(ColorCode col,
        Painter::line_style ls, Painter::line_width lw)
 {
        if (col == current_color_ && ls == current_ls_ && lw == current_lw_)
@@ -105,7 +104,7 @@ void GuiPainter::setQPainterPen(Color_color col,
 }
 
 
-void GuiPainter::point(int x, int y, Color_color col)
+void GuiPainter::point(int x, int y, ColorCode col)
 {
        if (!isDrawingEnabled())
                return;
@@ -116,7 +115,7 @@ void GuiPainter::point(int x, int y, Color_color col)
 
 
 void GuiPainter::line(int x1, int y1, int x2, int y2,
-       Color_color col,
+       ColorCode col,
        line_style ls,
        line_width lw)
 {
@@ -133,7 +132,7 @@ void GuiPainter::line(int x1, int y1, int x2, int y2,
 
 
 void GuiPainter::lines(int const * xp, int const * yp, int np,
-       Color_color col,
+       ColorCode col,
        line_style ls,
        line_width lw)
 {
@@ -161,7 +160,7 @@ void GuiPainter::lines(int const * xp, int const * yp, int np,
 
 
 void GuiPainter::rectangle(int x, int y, int w, int h,
-       Color_color col,
+       ColorCode col,
        line_style ls,
        line_width lw)
 {
@@ -173,14 +172,14 @@ void GuiPainter::rectangle(int x, int y, int w, int h,
 }
 
 
-void GuiPainter::fillRectangle(int x, int y, int w, int h, Color_color col)
+void GuiPainter::fillRectangle(int x, int y, int w, int h, ColorCode col)
 {
        fillRect(x, y, w, h, guiApp->colorCache().get(col));
 }
 
 
 void GuiPainter::arc(int x, int y, unsigned int w, unsigned int h,
-       int a1, int a2, Color_color col)
+       int a1, int a2, ColorCode col)
 {
        if (!isDrawingEnabled())
                return;
@@ -199,7 +198,7 @@ void GuiPainter::image(int x, int y, int w, int h, graphics::Image const & i)
        graphics::GuiImage const & qlimage =
                static_cast<graphics::GuiImage const &>(i);
 
-       fillRectangle(x, y, w, h, Color::graphicsbg);
+       fillRectangle(x, y, w, h, Color_graphicsbg);
 
        if (!isDrawingEnabled())
                return;
index 2f47d616af07411e0bd4e41332d797e729d53753..942a65dc941ff04145a55d9018b077d61d1d2920 100644 (file)
@@ -15,8 +15,6 @@
 
 #include "frontends/Painter.h"
 
-#include "Color.h"
-
 #include <QPainter>
 
 class QString;
@@ -39,7 +37,7 @@ public:
        virtual void line(
                int x1, int y1,
                int x2, int y2,
-               Color_color,
+               ColorCode,
                line_style = line_solid,
                line_width = line_thin);
 
@@ -53,7 +51,7 @@ public:
                int const * xp,
                int const * yp,
                int np,
-               Color_color,
+               ColorCode,
                line_style = line_solid,
                line_width = line_thin);
 
@@ -61,7 +59,7 @@ public:
        virtual void rectangle(
                int x, int y,
                int w, int h,
-               Color_color,
+               ColorCode,
                line_style = line_solid,
                line_width = line_thin);
 
@@ -69,19 +67,19 @@ public:
        virtual void fillRectangle(
                int x, int y,
                int w, int h,
-               Color_color);
+               ColorCode);
 
        /// draw an arc
        virtual void arc(
                int x, int y,
                unsigned int w, unsigned int h,
                int a1, int a2,
-               Color_color);
+               ColorCode);
 
        /// draw a pixel
        virtual void point(
                int x, int y,
-               Color_color);
+               ColorCode);
 
        /// draw an image from the image cache
        virtual void image(int x, int y,
@@ -104,11 +102,11 @@ private:
                QString const & str, Font const & f);
 
        /// set pen parameters
-       void setQPainterPen(Color_color col,
+       void setQPainterPen(ColorCode col,
                line_style ls = line_solid,
                line_width lw = line_thin);
 
-       Color::color current_color_;
+       ColorCode current_color_;
        Painter::line_style current_ls_;
        Painter::line_width current_lw_;
 };
index 51d52dd5f8717b818192e04bf0b43f0cd921c461..a8242ad656426ae74bf120463bbe19d19fa8ca5d 100644 (file)
@@ -553,7 +553,7 @@ namespace {
 
 struct ColorSorter
 {
-       bool operator()(Color::color const & lhs, Color::color const & rhs) const {
+       bool operator()(ColorCode lhs, ColorCode rhs) const {
                return lcolor.getGUIName(lhs) < lcolor.getGUIName(rhs);
        }
 };
@@ -569,25 +569,25 @@ PrefColors::PrefColors(GuiPreferences * form, QWidget * parent)
        // See http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg113301.html
        // for some discussion of why that is not trivial.
        QPixmap icon(32, 32);
-       for (int i = 0; i < Color::ignore; ++i) {
-               Color::color lc = static_cast<Color::color>(i);
-               if (lc == Color::none
-                       || lc == Color::black
-                       || lc == Color::white
-                       || lc == Color::red
-                       || lc == Color::green
-                       || lc == Color::blue
-                       || lc == Color::cyan
-                       || lc == Color::magenta
-                       || lc == Color::yellow
-                       || lc == Color::inherit
-                       || lc == Color::ignore) continue;
+       for (int i = 0; i < Color_ignore; ++i) {
+               ColorCode lc = static_cast<ColorCode>(i);
+               if (lc == Color_none
+                       || lc == Color_black
+                       || lc == Color_white
+                       || lc == Color_red
+                       || lc == Color_green
+                       || lc == Color_blue
+                       || lc == Color_cyan
+                       || lc == Color_magenta
+                       || lc == Color_yellow
+                       || lc == Color_inherit
+                       || lc == Color_ignore) continue;
 
                lcolors_.push_back(lc);
        }
        std::sort(lcolors_.begin(), lcolors_.end(), ColorSorter());
-       vector<Color_color>::const_iterator cit = lcolors_.begin();
-       vector<Color_color>::const_iterator const end = lcolors_.end();
+       vector<ColorCode>::const_iterator cit = lcolors_.begin();
+       vector<ColorCode>::const_iterator const end = lcolors_.end();
        for (; cit != end; ++cit) {
                        (void) new QListWidgetItem(QIcon(icon),
                        toqstr(lcolor.getGUIName(*cit)), lyxObjectsLW);
@@ -2279,7 +2279,7 @@ void GuiPreferences::dispatchParams()
 }
 
 
-void GuiPreferences::setColor(Color_color col, string const & hex)
+void GuiPreferences::setColor(ColorCode col, string const & hex)
 {
        colors_.push_back(lcolor.getLyXName(col) + ' ' + hex);
 }
index d80af4d8adaab00ecf4b345a7f7ad61fcf2f0ada..9a8520e44732f0802b382e545e1e569665073b14 100644 (file)
@@ -16,7 +16,7 @@
 
 #include "GuiDialog.h"
 
-#include "Color.h"
+#include "ColorCode.h"
 #include "Converter.h"
 #include "Format.h"
 #include "KeyMap.h"
@@ -53,7 +53,6 @@
 
 namespace lyx {
 
-class Color_color;
 class Converters;
 class Formats;
 class Movers;
@@ -167,7 +166,7 @@ private Q_SLOTS:
        void change_lyxObjects_selection();
 
 private:
-       std::vector<Color_color> lcolors_;
+       std::vector<ColorCode> lcolors_;
        // FIXME the use of mutable here is required due to the
        // fact that initialization is not done in the controller
        // but in the constructor.
@@ -473,7 +472,7 @@ public:
                                    docstring const & title) const;
 
        /// set a color
-       void setColor(Color_color col, std::string const & hex);
+       void setColor(ColorCode col, std::string const & hex);
 
        /// update the screen fonts after change
        void updateScreenFonts();
index 9c99508c6d03a54d36a932b2703b7a795dc6aeb2..3bd5484f64d5c5b126f4edecdc4b1f084107d74d 100644 (file)
@@ -22,7 +22,6 @@
 
 #include "Buffer.h"
 #include "BufferView.h"
-#include "Color.h"
 #include "Cursor.h"
 #include "debug.h"
 #include "FuncRequest.h"
@@ -135,7 +134,7 @@ public:
 
        void update(int x, int y, int h, CursorShape shape)
        {
-               color_ = guiApp->colorCache().get(Color::cursor);
+               color_ = guiApp->colorCache().get(Color_cursor);
                shape_ = shape;
                switch (shape) {
                case L_SHAPE:
index 610a2419628cea2be55defbb6dcccd8fa5250b89..0c66048806e20edc82ae85a40509970fbd21a88f 100644 (file)
@@ -21,7 +21,6 @@
 #include "Encoding.h"
 #include "Format.h"
 #include "InsetIterator.h"
-#include "Color.h"
 #include "LaTeXFeatures.h"
 #include "LyXRC.h"
 #include "output.h"
@@ -610,8 +609,8 @@ void PreviewLoader::Impl::startLoading()
        cs << pconverter_->command << ' ' << pconverter_->to << ' '
           << support::quoteName(latexfile.toFilesystemEncoding()) << ' '
           << int(font_scaling_factor_) << ' '
-          << theApp()->hexName(Color::preview) << ' '
-          << theApp()->hexName(Color::background);
+          << theApp()->hexName(Color_preview) << ' '
+          << theApp()->hexName(Color_background);
 
        string const command = support::libScriptSearch(cs.str());
 
index a3f93bd88ea62dafdde48eabc35d6ce73e8a12a7..cc2f6d6e18f560b77f43a4f715b9a6211d838227 100644 (file)
@@ -19,7 +19,6 @@
 #include "Buffer.h"
 #include "BufferParams.h"
 #include "BufferView.h"
-#include "Color.h"
 #include "CoordCache.h"
 #include "Cursor.h"
 #include "debug.h"
@@ -297,8 +296,8 @@ void Inset::metricsMarkers2(Dimension & dim, int framesize) const
 
 void Inset::drawMarkers(PainterInfo & pi, int x, int y) const
 {
-       Color::color pen_color = mouseHovered() || editing(pi.base.bv)?
-               Color::mathframe : Color::mathcorners;
+       ColorCode pen_color = mouseHovered() || editing(pi.base.bv)?
+               Color_mathframe : Color_mathcorners;
 
        Dimension const dim = dimension(*pi.base.bv);
 
@@ -314,8 +313,8 @@ void Inset::drawMarkers(PainterInfo & pi, int x, int y) const
 
 void Inset::drawMarkers2(PainterInfo & pi, int x, int y) const
 {
-       Color::color pen_color = mouseHovered() || editing(pi.base.bv)?
-               Color::mathframe : Color::mathcorners;
+       ColorCode pen_color = mouseHovered() || editing(pi.base.bv)?
+               Color_mathframe : Color_mathcorners;
 
        drawMarkers(pi, x, y);
        Dimension const dim = dimension(*pi.base.bv);
@@ -366,9 +365,9 @@ void Inset::dump() const
 }
 
 
-Color_color Inset::backgroundColor() const
+ColorCode Inset::backgroundColor() const
 {
-       return Color::background;
+       return Color_background;
 }
 
 
index e8e0f9ef0e4504026c80960f42c16f9288b2bef2..2486d09115bf597817ecd34f92bdd6062dd8fe2e 100644 (file)
@@ -15,6 +15,7 @@
 #ifndef INSETBASE_H
 #define INSETBASE_H
 
+#include "ColorCode.h"
 #include "InsetCode.h"
 
 #include "Dimension.h"
@@ -31,7 +32,6 @@ class Buffer;
 class BufferParams;
 class BufferView;
 class Change;
-class Color_color;
 class Cursor;
 class CursorSlice;
 class FuncRequest;
@@ -381,7 +381,7 @@ public:
        ///
        int scroll() const { return 0; }
        ///
-       virtual Color_color backgroundColor() const;
+       virtual ColorCode backgroundColor() const;
        ///
        enum CollapseStatus {
                Collapsed,
index 8939f0eacdeb1859362bb1a5fe764736eb3c3479..ec4dd6a0756b4d92a0a681c3bedc1fa14b97fe5a 100644 (file)
@@ -23,7 +23,6 @@
 #include "FuncRequest.h"
 #include "gettext.h"
 #include "LaTeXFeatures.h"
-#include "Color.h"
 #include "Lexer.h"
 #include "MetricsInfo.h"
 
@@ -163,7 +162,7 @@ void InsetBox::setButtonLabel()
 
        setLabel(label);
 
-       font.setColor(Color::foreground);
+       font.setColor(Color_foreground);
        setLabelFont(font);
 }
 
index 4931c184bb1f76a5bed50dd8866177edc745d313..126c8e5a168d66e2f2c7af06e104efdf437335f3 100644 (file)
@@ -21,7 +21,6 @@
 #include "FuncRequest.h"
 #include "FuncStatus.h"
 #include "gettext.h"
-#include "Color.h"
 #include "Lexer.h"
 #include "OutputParams.h"
 
@@ -97,8 +96,8 @@ void InsetBranch::setButtonLabel()
        docstring s = _("Branch: ") + params_.branch;
        if (!params_.branch.empty()) {
                // FIXME UNICODE
-               Color_color c = lcolor.getFromLyXName(to_utf8(params_.branch));
-               if (c == Color::none) {
+               ColorCode c = lcolor.getFromLyXName(to_utf8(params_.branch));
+               if (c == Color_none) {
                        s = _("Undef: ") + s;
                }
        }
@@ -109,13 +108,13 @@ void InsetBranch::setButtonLabel()
 }
 
 
-Color_color InsetBranch::backgroundColor() const
+ColorCode InsetBranch::backgroundColor() const
 {
        if (!params_.branch.empty()) {
                // FIXME UNICODE
-               Color_color c = lcolor.getFromLyXName(to_utf8(params_.branch));
-               if (c == Color::none) {
-                       c = Color::error;
+               ColorCode c = lcolor.getFromLyXName(to_utf8(params_.branch));
+               if (c == Color_none) {
+                       c = Color_error;
                }
                return c;
        } else
index 2dcb87da5f7e4962de2836ec57db9655c89647b6..206bd64b66c1b19f90fbd179a586f5ad6b3c8612 100644 (file)
@@ -53,7 +53,7 @@ public:
        ///
        void setButtonLabel();
        ///
-       virtual Color_color backgroundColor() const;
+       virtual ColorCode backgroundColor() const;
        ///
        bool showInsetDialog(BufferView *) const;
        ///
index 9447583ccf2223730ad06261139cfb3877176457..5fd181a834affffaa94a23a373542a4179d12a81 100644 (file)
@@ -16,7 +16,6 @@
 
 #include "Buffer.h"
 #include "BufferParams.h"
-#include "Color.h"
 #include "Counters.h"
 #include "Cursor.h"
 #include "BufferView.h"
@@ -54,7 +53,7 @@ InsetCaption::InsetCaption(InsetCaption const & ic)
 {
        setAutoBreakRows(true);
        setDrawFrame(true);
-       setFrameColor(Color::captionframe);
+       setFrameColor(Color_captionframe);
 }
 
 InsetCaption::InsetCaption(BufferParams const & bp)
@@ -62,7 +61,7 @@ InsetCaption::InsetCaption(BufferParams const & bp)
 {
        setAutoBreakRows(true);
        setDrawFrame(true);
-       setFrameColor(Color::captionframe);
+       setFrameColor(Color_captionframe);
 }
 
 
index 17a0fbe8c69585d3f427dd565b7d52e9fdb5c1ed..248dc155de3097674bcabee8326ddede7f161d7e 100644 (file)
@@ -23,7 +23,6 @@
 #include "FloatList.h"
 #include "FuncStatus.h"
 #include "gettext.h"
-#include "Color.h"
 #include "LaTeXFeatures.h"
 #include "Lexer.h"
 #include "FuncRequest.h"
@@ -79,10 +78,10 @@ InsetCollapsable::InsetCollapsable
 {
        setAutoBreakRows(true);
        setDrawFrame(true);
-       setFrameColor(Color::collapsableframe);
+       setFrameColor(Color_collapsableframe);
        setButtonLabel();
        // Fallback for lacking inset layout item
-       layout_.bgcolor = Color::background;
+       layout_.bgcolor = Color_background;
 }
 
 
@@ -321,7 +320,7 @@ void InsetCollapsable::draw(PainterInfo & pi, int x, int y) const
                        theFontMetrics(font).rectText(s, w, a, d);
                        int const ww = max(textdim.wid, w);
                        pi.pain.rectText(x + (ww - w) / 2, y + desc + a,
-                               s, font, Color::none, Color::none);
+                               s, font, Color_none, Color_none);
                        desc += d;
                }
 
index 2aaa609e2b6693584fee9198f88496bc4e296836..9949469f79d594744baa2e2b26fde5895dcec60f 100644 (file)
@@ -130,7 +130,7 @@ public:
        ///
        bool setMouseHover(bool mouse_hover);
        ///
-       virtual Color_color backgroundColor() const {return layout_.bgcolor; }
+       virtual ColorCode backgroundColor() const {return layout_.bgcolor; }
 
        int latex(Buffer const &, odocstream &,
                  OutputParams const &) const;
index a30d609d7cbf419ef8e6c824aedfee076263395f..43efcb22d4b28172f2cb1b851e9288b7acdd8df5 100644 (file)
@@ -24,7 +24,6 @@
 #include "gettext.h"
 #include "Language.h"
 #include "Layout.h"
-#include "Color.h"
 #include "LyXAction.h"
 #include "Lexer.h"
 #include "TextClass.h"
index 4a4b3856a36d83fe408014ef372a3d12d9efe164..b8a9ec0949b544d90d8cd8b6f7b696e63f992c20 100644 (file)
@@ -22,7 +22,6 @@
 #include "FuncStatus.h"
 #include "Cursor.h"
 #include "gettext.h"
-#include "Color.h"
 #include "Lexer.h"
 #include "Text.h"
 #include "MetricsInfo.h"
index 37333406604a3e2043b813c0c2e383ed29274d9d..cdaa590c380d191783e1d396105687c4b092174c 100644 (file)
@@ -117,7 +117,7 @@ InsetFloat::InsetFloat(BufferParams const & bp, string const & type)
        Font font(Font::ALL_SANE);
        font.decSize();
        font.decSize();
-       font.setColor(Color::collapsable);
+       font.setColor(Color_collapsable);
        setLabelFont(font);
        params_.type = type;
 }
index 316c9e5d8daed236620e09b59d32a1afb452befc..cada18c22d20c544e92f5098e9dbafb8fa04cc40 100644 (file)
@@ -13,7 +13,6 @@
 #include "InsetLine.h"
 
 #include "debug.h"
-#include "Color.h"
 #include "Text.h"
 #include "MetricsInfo.h"
 #include "LaTeXFeatures.h"
@@ -54,7 +53,7 @@ void InsetLine::metrics(MetricsInfo & mi, Dimension & dim) const
 void InsetLine::draw(PainterInfo & pi, int x, int y) const
 {
        Dimension const dim = dimension(*pi.base.bv);
-       pi.pain.line(x, y, x + dim.wid, y, Color::topline,
+       pi.pain.line(x, y, x + dim.wid, y, Color_topline,
                Painter::line_solid, Painter::line_thick);
 }
 
index e9007fa14df732d1c878077975fea60dd7842d98..02f5556fd8e043dd8601f43c4df1543c2efc0ea2 100644 (file)
@@ -50,7 +50,7 @@ void InsetListings::init()
        Font font(Font::ALL_SANE);
        font.decSize();
        font.decSize();
-       font.setColor(Color::none);
+       font.setColor(Color_none);
        setLabelFont(font);
        // FIXME: what to do with those?
        //text_.current_font.setLanguage(latex_language);
@@ -315,8 +315,8 @@ void InsetListings::getDrawFont(Font & font) const
 {
        font = Font(Font::ALL_INHERIT, latex_language);
        font.setFamily(Font::TYPEWRITER_FAMILY);
-       // FIXME: define Color::listing?
-       font.setColor(Color::foreground);
+       // FIXME: define Color_listing?
+       font.setColor(Color_foreground);
 }
 
 
index b016ed3447d53c80b62eb661c243d65612944422..77978bcf96d5787b569f600c31042f2130111b57 100644 (file)
@@ -94,7 +94,7 @@ void InsetNewline::draw(PainterInfo & pi, int x, int y) const
                xp[2] = int(x + wid * 0.625);
        }
 
-       pi.pain.lines(xp, yp, 3, Color::eolmarker);
+       pi.pain.lines(xp, yp, 3, Color_eolmarker);
 
        yp[0] = int(y - 0.500 * asc * 0.75);
        yp[1] = int(y - 0.500 * asc * 0.75);
@@ -110,7 +110,7 @@ void InsetNewline::draw(PainterInfo & pi, int x, int y) const
                xp[2] = int(x);
        }
 
-       pi.pain.lines(xp, yp, 3, Color::eolmarker);
+       pi.pain.lines(xp, yp, 3, Color_eolmarker);
 }
 
 
index 6150bc8bdbc4dfcdd9220a98a83004ad281b422e..37eaaa5af0a09f4cdef586654ea2e59a967d90ff 100644 (file)
@@ -23,7 +23,7 @@ InsetOptArg::InsetOptArg(BufferParams const & ins)
        : InsetCollapsable(ins)
 {
        Font font(Font::ALL_SANE);
-       font.setColor(Color::collapsable);
+       font.setColor(Color_collapsable);
        setLabelFont(font);
        setLabel(_("opt"));
 }
@@ -33,7 +33,7 @@ InsetOptArg::InsetOptArg(InsetOptArg const & in)
        : InsetCollapsable(in)
 {
        Font font(Font::ALL_SANE);
-       font.setColor(Color::collapsable);
+       font.setColor(Color_collapsable);
        setLabelFont(font);
        setLabel(_("opt"));
 }
index 0ee79aa6c2bc611b2d4ff701d415ef73b7ff56d7..764358688d02effa2a1cc40050f7262389c752e2 100644 (file)
@@ -14,7 +14,6 @@
 
 #include "debug.h"
 #include "gettext.h"
-#include "Color.h"
 #include "Text.h"
 #include "MetricsInfo.h"
 #include "OutputParams.h"
@@ -54,7 +53,7 @@ void InsetPagebreak::metrics(MetricsInfo & mi, Dimension & dim) const
 void InsetPagebreak::draw(PainterInfo & pi, int x, int y) const
 {
        Font font;
-       font.setColor(Color::pagebreak);
+       font.setColor(Color_pagebreak);
        font.decSize();
 
        Dimension const dim = dimension(*pi.base.bv);
@@ -68,12 +67,12 @@ void InsetPagebreak::draw(PainterInfo & pi, int x, int y) const
        int const text_end = text_start + w;
 
        pi.pain.rectText(text_start, y + d, insetLabel(), font,
-               Color::none, Color::none);
+               Color_none, Color_none);
 
        pi.pain.line(x, y, text_start, y,
-                  Color::pagebreak, Painter::line_onoffdash);
+                  Color_pagebreak, Painter::line_onoffdash);
        pi.pain.line(text_end, y, int(x + dim.wid), y,
-                  Color::pagebreak, Painter::line_onoffdash);
+                  Color_pagebreak, Painter::line_onoffdash);
 }
 
 
index bbab7f278e73cabf0b3c9a2d37abd0bb44973516..55aa3fd3faf71669df7effa24a07d12e815b5535 100644 (file)
@@ -16,7 +16,6 @@
 #include "InsetSpace.h"
 
 #include "debug.h"
-#include "Color.h"
 #include "Lexer.h"
 #include "MetricsInfo.h"
 #include "OutputParams.h"
@@ -100,9 +99,9 @@ void InsetSpace::draw(PainterInfo & pi, int x, int y) const
        yp[3] = y - max(h / 4, 1);
 
        if (kind_ == PROTECTED || kind_ == ENSPACE || kind_ == NEGTHIN)
-               pi.pain.lines(xp, yp, 4, Color::latex);
+               pi.pain.lines(xp, yp, 4, Color_latex);
        else
-               pi.pain.lines(xp, yp, 4, Color::special);
+               pi.pain.lines(xp, yp, 4, Color_special);
 }
 
 
index e1d176638f172d8adfa0ebad4432243ddbcfae82..db365de0fff732de1ddf8c2e5e511530d1c3b865 100644 (file)
@@ -16,7 +16,6 @@
 
 #include "debug.h"
 #include "LaTeXFeatures.h"
-#include "Color.h"
 #include "Lexer.h"
 #include "MetricsInfo.h"
 
@@ -72,25 +71,25 @@ void InsetSpecialChar::draw(PainterInfo & pi, int x, int y) const
        switch (kind_) {
        case HYPHENATION:
        {
-               font.setColor(Color::special);
+               font.setColor(Color_special);
                pi.pain.text(x, y, char_type('-'), font);
                break;
        }
        case LIGATURE_BREAK:
        {
-               font.setColor(Color::special);
+               font.setColor(Color_special);
                pi.pain.text(x, y, char_type('|'), font);
                break;
        }
        case END_OF_SENTENCE:
        {
-               font.setColor(Color::special);
+               font.setColor(Color_special);
                pi.pain.text(x, y, char_type('.'), font);
                break;
        }
        case LDOTS:
        {
-               font.setColor(Color::special);
+               font.setColor(Color_special);
                string ell = ". . . ";
                docstring dell(ell.begin(), ell.end());
                pi.pain.text(x, y, dell, font);
@@ -112,7 +111,7 @@ void InsetSpecialChar::draw(PainterInfo & pi, int x, int y) const
                xp[2] = ox + w; yp[2] = y - h/2;
                xp[3] = ox;     yp[3] = y;
 
-               pi.pain.lines(xp, yp, 4, Color::special);
+               pi.pain.lines(xp, yp, 4, Color_special);
                break;
        }
        }
index 559ba7201d19311c4b864121891453a6e012de61..25e6a0f8ed4061713deb810167a9957d1bdf6a2c 100644 (file)
@@ -24,7 +24,6 @@
 #include "Buffer.h"
 #include "BufferParams.h"
 #include "BufferView.h"
-#include "Color.h"
 #include "CoordCache.h"
 #include "Counters.h"
 #include "Cursor.h"
@@ -54,6 +53,8 @@
 #include "frontends/Painter.h"
 #include "frontends/Selection.h"
 
+#include <boost/scoped_ptr.hpp>
+
 #include <sstream>
 #include <iostream>
 #include <limits>
@@ -3089,7 +3090,7 @@ void InsetTabular::drawSelection(PainterInfo & pi, int x, int y) const
                                int const w = tabular.columnWidth(cell);
                                if (i >= cs && i <= ce && j >= rs && j <= re)
                                        pi.pain.fillRectangle(xx, y, w, h,
-                                                             Color::selection);
+                                                             Color_selection);
                                xx += w;
                        }
                        y += h;
@@ -3108,12 +3109,12 @@ void InsetTabular::drawCellLines(Painter & pain, int x, int y,
 {
        int x2 = x + tabular.columnWidth(cell);
        bool on_off = false;
-       Color::color col = Color::tabularline;
-       Color::color onoffcol = Color::tabularonoffline;
+       ColorCode col = Color_tabularline;
+       ColorCode onoffcol = Color_tabularonoffline;
 
        if (erased) {
-               col = Color::deletedtext;
-               onoffcol = Color::deletedtext;
+               col = Color_deletedtext;
+               onoffcol = Color_deletedtext;
        }
 
        if (!tabular.topAlreadyDrawn(cell)) {
index 52e9e4970d241a16aa7d3b8c552dd98bc2d01cca..981eea01a92ac232199879724eae64d2821f6db8 100644 (file)
@@ -27,7 +27,6 @@
 #include "gettext.h"
 #include "InsetList.h"
 #include "Intl.h"
-#include "Color.h"
 #include "lyxfind.h"
 #include "Lexer.h"
 #include "LyXRC.h"
@@ -76,7 +75,7 @@ using std::vector;
 
 
 InsetText::InsetText(BufferParams const & bp)
-       : drawFrame_(false), frame_color_(Color::insetframe)
+       : drawFrame_(false), frame_color_(Color_insetframe)
 {
        paragraphs().push_back(Paragraph());
        paragraphs().back().layout(bp.getTextClass().defaultLayout());
@@ -366,13 +365,13 @@ void InsetText::setDrawFrame(bool flag)
 }
 
 
-Color_color InsetText::frameColor() const
+ColorCode InsetText::frameColor() const
 {
-       return Color::color(frame_color_);
+       return ColorCode(frame_color_);
 }
 
 
-void InsetText::setFrameColor(Color_color col)
+void InsetText::setFrameColor(ColorCode col)
 {
        frame_color_ = col;
 }
index 2e0aa579febf38feac7633d644372e8c4c3e60f2..0c70080fcebc1d06ae4d91eda47911bb9ecfc550 100644 (file)
@@ -25,7 +25,6 @@ class BufferParams;
 class BufferView;
 class CursorSlice;
 class Dimension;
-class Color_color;
 class ParagraphList;
 class InsetTabular;
 
@@ -87,9 +86,9 @@ public:
        ///
        void setDrawFrame(bool);
        ///
-       Color_color frameColor() const;
+       ColorCode frameColor() const;
        ///
-       void setFrameColor(Color_color);
+       void setFrameColor(ColorCode);
        ///
        bool showInsetDialog(BufferView *) const;
        ///
@@ -149,7 +148,7 @@ private:
 
        ///
        bool drawFrame_;
-       /** We store the Color::color value as an int to get Color.h out
+       /** We store the ColorCode value as an int to get Color.h out
         *  of the header file.
         */
        int frame_color_;
index 312f60b0ecf0f9e659e9158c0d7ff0ae9ad80b47..9c9536d8bfda70e735403487d721ed17cbaa9dd1 100644 (file)
@@ -43,7 +43,7 @@ Inset.heorem::InsetTheorem()
        Font font(Font::ALL_SANE);
        font.decSize();
        font.decSize();
-       font.setColor(Color::collapsable);
+       font.setColor(Color_collapsable);
        setLabelFont(font);
 #if 0
        setAutoCollapse(false);
index 0d630b5cdbf2bdfc3167e5c71862ef6833a8f901..b35a46cfc054f072e6a674dc052d6abe96f88d38 100644 (file)
@@ -18,7 +18,6 @@
 #include "DispatchResult.h"
 #include "FuncRequest.h"
 #include "gettext.h"
-#include "Color.h"
 #include "Lexer.h"
 #include "Text.h"
 #include "MetricsInfo.h"
@@ -177,7 +176,7 @@ void InsetVSpace::draw(PainterInfo & pi, int x, int y) const
        int d = 0;
 
        Font font;
-       font.setColor(Color::added_space);
+       font.setColor(Color_added_space);
        font.decSize();
        font.decSize();
        docstring const lab = label();
@@ -185,18 +184,18 @@ void InsetVSpace::draw(PainterInfo & pi, int x, int y) const
 
        pi.pain.rectText(x + 2 * arrow_size + 5,
                         start + (end - start) / 2 + (a - d) / 2,
-                        lab, font, Color::none, Color::none);
+                        lab, font, Color_none, Color_none);
 
        // top arrow
-       pi.pain.line(x, ty1, midx, ty2, Color::added_space);
-       pi.pain.line(midx, ty2, rightx, ty1, Color::added_space);
+       pi.pain.line(x, ty1, midx, ty2, Color_added_space);
+       pi.pain.line(midx, ty2, rightx, ty1, Color_added_space);
 
        // bottom arrow
-       pi.pain.line(x, by1, midx, by2, Color::added_space);
-       pi.pain.line(midx, by2, rightx, by1, Color::added_space);
+       pi.pain.line(x, by1, midx, by2, Color_added_space);
+       pi.pain.line(midx, by2, rightx, by1, Color_added_space);
 
        // joining line
-       pi.pain.line(midx, ty2, midx, by2, Color::added_space);
+       pi.pain.line(midx, ty2, midx, by2, Color_added_space);
 }
 
 
index ac8319a65f38caa678511ac7c81928274d03aa9d..adfec340bb40273ad27cf96f7edd200d34e64685 100644 (file)
@@ -26,7 +26,6 @@
 #include "FuncStatus.h"
 #include "gettext.h"
 #include "LaTeXFeatures.h"
-#include "Color.h"
 #include "Lexer.h"
 #include "OutputParams.h"
 #include "TocBackend.h"
@@ -50,7 +49,7 @@ InsetWrap::InsetWrap(BufferParams const & bp, string const & type)
        Font font(Font::ALL_SANE);
        font.decSize();
        font.decSize();
-       font.setColor(Color::collapsable);
+       font.setColor(Color_collapsable);
        setLabelFont(font);
        params_.type = type;
        params_.lines = 0;
index 2656bd453da578c310d1b3aa41ba535f8521688a..434f44e1085b1bac58544bb5ca87fe9a6fe0ab31 100644 (file)
@@ -12,7 +12,6 @@
 
 #include "RenderButton.h"
 
-#include "Color.h"
 #include "MetricsInfo.h"
 
 #include "frontends/FontMetrics.h"
@@ -61,14 +60,14 @@ void RenderButton::draw(PainterInfo & pi, int x, int y) const
 {
        // Draw it as a box with the LaTeX text
        Font font(Font::ALL_SANE);
-       font.setColor(Color::command);
+       font.setColor(Color_command);
        font.decSize();
 
        if (editable_) {
                pi.pain.buttonText(x + 2, y, text_, font, renderState());
        } else {
                pi.pain.rectText(x + 2, y, text_, font,
-                                Color::commandbg, Color::commandframe);
+                                Color_commandbg, Color_commandframe);
        }
 }
 
index 42d2d776a4f68b53121468fad8049df88c13087e..b5c44ff265013fb4865102b91be1d394b0d4cb13 100644 (file)
@@ -15,7 +15,6 @@
 #include "insets/Inset.h"
 
 #include "gettext.h"
-#include "Color.h"
 #include "LyX.h"
 #include "LyXRC.h"
 #include "MetricsInfo.h"
@@ -202,7 +201,7 @@ void RenderGraphic::draw(PainterInfo & pi, int x, int y) const
                                  y - dim_.asc,
                                  dim_.wid - 2 * Inset::TEXT_TO_INSET_OFFSET,
                                  dim_.asc + dim_.des,
-                                 Color::foreground);
+                                 Color_foreground);
 
                // Print the file name.
                Font msgFont = pi.base.font;
index 763ab7c972d517d6f56d0d14337747fc1c66497c..b272f9e8fabce7d347095df4329c3eff1c6662d1 100644 (file)
@@ -14,7 +14,6 @@
 #include "insets/Inset.h"
 
 #include "BufferView.h"
-#include "Color.h"
 #include "Dimension.h"
 #include "gettext.h"
 #include "LyX.h"
@@ -164,7 +163,7 @@ void RenderPreview::draw(PainterInfo & pi, int x, int y) const
                                  y - dim_.asc,
                                  dim_.wid - 2 * offset,
                                  dim_.asc + dim_.des,
-                                 Color::foreground);
+                                 Color_foreground);
 
                Font font(pi.base.font);
                font.setFamily(Font::SANS_FAMILY);
index 93f7e94bad907ae5884fbdbb9fcbed17431b786b..d3c4183ce654e471f828fbf0f27e224a77d9a182 100644 (file)
@@ -19,7 +19,6 @@
 #include "Cursor.h"
 #include "debug.h"
 #include "gettext.h"
-#include "Color.h"
 #include "Lexer.h"
 #include "OutputParams.h"
 
@@ -139,7 +138,7 @@ void InsetFormulaMacro::draw(PainterInfo & p, int x, int y) const
 {
        // label
        Font font = p.base.font;
-       font.setColor(Color::math);
+       font.setColor(Color_math);
 
        PainterInfo pi(p.base.bv, p.pain);
        pi.base.style = LM_ST_TEXT;
@@ -149,9 +148,9 @@ void InsetFormulaMacro::draw(PainterInfo & p, int x, int y) const
        int const w = dim_.wid - 2;
        int const h = dim_.height() - 2;
 
-       // Color::mathbg used to be "AntiqueWhite" but is "linen" now, too
-       pi.pain.fillRectangle(x, a, w, h, Color::mathmacrobg);
-       pi.pain.rectangle(x, a, w, h, Color::mathframe);
+       // Color_mathbg used to be "AntiqueWhite" but is "linen" now, too
+       pi.pain.fillRectangle(x, a, w, h, Color_mathmacrobg);
+       pi.pain.rectangle(x, a, w, h, Color_mathframe);
 
        // FIXME
 #if 0
index 855b4902e97d02f69b1faeb828beec585f245da0..5147dd1e8ca5be0d73c95ca986ebff9d598a0ca7 100644 (file)
@@ -21,6 +21,7 @@
 #include "support/textutils.h"
 
 #include <boost/current_function.hpp>
+#include <boost/assert.hpp>
 
 using std::endl;
 
index d9e52c3e1fe4047178274676a162a9b474642870..b2394a737c1b0c0119b0f801fdcfb89c4d91a02b 100644 (file)
@@ -14,7 +14,6 @@
 #include "MathData.h"
 #include "MathStream.h"
 #include "LaTeXFeatures.h"
-#include "Color.h"
 
 #include "support/std_ostream.h"
 #include "frontends/Painter.h"
@@ -46,7 +45,7 @@ void InsetMathBoxed::draw(PainterInfo & pi, int x, int y) const
 {
        Dimension const dim = dimension(*pi.base.bv);
        pi.pain.rectangle(x + 1, y - dim.ascent() + 1,
-               dim.width() - 2, dim.height() - 2, Color::foreground);
+               dim.width() - 2, dim.height() - 2, Color_foreground);
        cell(0).draw(pi, x + 3, y);
        setPosCache(pi, x, y);
 }
index 1acc85517d657e5f302f02354730093a020e1c72..f100e383d027f22c4135cde3985ab1afe57e05ec 100644 (file)
@@ -14,7 +14,6 @@
 #include "MathData.h"
 #include "MathStream.h"
 #include "MathSupport.h"
-#include "Color.h"
 
 #include "frontends/FontMetrics.h"
 #include "frontends/Painter.h"
@@ -58,7 +57,7 @@ void InsetMathBrace::metrics(MetricsInfo & mi, Dimension & dim) const
 void InsetMathBrace::draw(PainterInfo & pi, int x, int y) const
 {
        Font font = pi.base.font;
-       font.setColor(Color::latex);
+       font.setColor(Color_latex);
        Dimension t = theFontMetrics(font).dimension('{');
        pi.pain.text(x, y, '{', font);
        cell(0).draw(pi, x + t.wid, y);
index 6f75c5b86a19bc93514172c3982669952be5e952..e69b690db8386771c64f3c5bebdc3c894afa773d 100644 (file)
@@ -10,6 +10,7 @@
 
 #include <config.h>
 
+#include "Color.h"
 #include "InsetMathColor.h"
 #include "MathData.h"
 #include "MathStream.h"
@@ -21,7 +22,7 @@
 
 namespace lyx {
 
-InsetMathColor::InsetMathColor(bool oldstyle, Color_color const & color)
+InsetMathColor::InsetMathColor(bool oldstyle, ColorCode color)
        : InsetMathNest(1), oldstyle_(oldstyle),
          color_(from_utf8(lcolor.getLaTeXName(color)))
 {}
@@ -49,7 +50,7 @@ void InsetMathColor::metrics(MetricsInfo & mi, Dimension & dim) const
 
 void InsetMathColor::draw(PainterInfo & pi, int x, int y) const
 {
-       Color_color origcol = pi.base.font.color();
+       ColorCode origcol = pi.base.font.color();
        pi.base.font.setColor(lcolor.getFromLaTeXName(to_utf8(color_)));
        cell(0).draw(pi, x + 1, y);
        pi.base.font.setColor(origcol);
index 7bda1581f03ab2b88e7c5a3b1ad44d216fdfafa3..9f8419b63307ce966832f3d0bbf79cf820cea634 100644 (file)
@@ -12,8 +12,6 @@
 #ifndef MATH_COLORINSET_H
 #define MATH_COLORINSET_H
 
-#include "Color.h"
-
 #include "InsetMathNest.h"
 
 
@@ -25,7 +23,7 @@ class InsetMathColor : public InsetMathNest {
 public:
        /// Create a color inset from LyX color number
        explicit InsetMathColor(bool oldstyle,
-               Color_color const & color = Color::none);
+               ColorCode color = Color_none);
        /// Create a color inset from LaTeX color name
        explicit InsetMathColor(bool oldstyle, docstring const & color);
        ///
index 280a6dfef20abd530f99e68e7d43ea7edb5a1467..e1f7ce727f33a6a1edaba06fe0d179df87fe8791 100644 (file)
@@ -14,7 +14,6 @@
 #include "MathData.h"
 #include "MathStream.h"
 #include "LaTeXFeatures.h"
-#include "Color.h"
 #include "frontends/Painter.h"
 
 
@@ -52,7 +51,7 @@ void InsetMathDFrac::draw(PainterInfo & pi, int x, int y) const
        int m = x + dim.wid / 2;
        cell(0).draw(pi, m - dim0.wid / 2, y - dim0.des - 2 - 5);
        cell(1).draw(pi, m - dim1.wid / 2, y + dim1.asc  + 2 - 5);
-       pi.pain.line(x + 1, y - 5, x + dim.wid - 2, y - 5, Color::math);
+       pi.pain.line(x + 1, y - 5, x + dim.wid - 2, y - 5, Color_math);
        setPosCache(pi, x, y);
 }
 
index 7533778f953a9f6ee7eb6757af44ec223fb8ac6b..c8d939d5ec1c10acc4491ac15ffe8287da589781 100644 (file)
@@ -13,7 +13,6 @@
 #include "InsetMathFBox.h"
 #include "MathData.h"
 #include "MathStream.h"
-#include "Color.h"
 
 #include "support/std_ostream.h"
 #include "frontends/Painter.h"
@@ -52,7 +51,7 @@ void InsetMathFBox::draw(PainterInfo & pi, int x, int y) const
 {
        Dimension const dim = dimension(*pi.base.bv);
        pi.pain.rectangle(x + 1, y - dim.ascent() + 1,
-               dim.width() - 2, dim.height() - 2, Color::foreground);
+               dim.width() - 2, dim.height() - 2, Color_foreground);
        FontSetChanger dummy(pi.base, "textnormal");
        cell(0).draw(pi, x + 3, y);
        setPosCache(pi, x, y);
index 5ae8189facbef5731d56a4dce538d3fc73485085..b2f55f56a2a84eb722539f86ecfc0eb39d83e1d0 100644 (file)
@@ -16,7 +16,6 @@
 #include "MathStream.h"
 #include "TextPainter.h"
 #include "LaTeXFeatures.h"
-#include "Color.h"
 #include "Cursor.h"
 #include "frontends/Painter.h"
 
@@ -195,11 +194,11 @@ void InsetMathFrac::draw(PainterInfo & pi, int x, int y) const
                pi.pain.line(xx + dim0.wid,
                                y + dim.des - 2,
                                xx + dim0.wid + 5,
-                               y - dim.asc + 2, Color::math);
+                               y - dim.asc + 2, Color_math);
        }
        if (kind_ == FRAC || kind_ == OVER)
                pi.pain.line(x + 1, y - 5,
-                               x + dim.wid - 2, y - 5, Color::math);
+                               x + dim.wid - 2, y - 5, Color_math);
        drawMarkers(pi, x, y);
 }
 
index 90bcacdc5ee34165f5cc48ce57e20abb9e653ade..f05da83d87088407a0104002a6cb95dc3b019780 100644 (file)
@@ -14,7 +14,6 @@
 #include "MathData.h"
 #include "MathStream.h"
 #include "MathSupport.h"
-#include "Color.h"
 #include "frontends/Painter.h"
 
 
@@ -50,7 +49,7 @@ void InsetMathFrameBox::draw(PainterInfo & pi, int x, int y) const
        FontSetChanger dummy(pi.base, "textnormal");
        Dimension const dim = dimension(*pi.base.bv);
        pi.pain.rectangle(x + 1, y - dim.ascent() + 1,
-               dim.width() - 2, dim.height() - 2, Color::foreground);
+               dim.width() - 2, dim.height() - 2, Color_foreground);
        x += 5;
        BufferView const & bv = *pi.base.bv;
 
index bd4e655c372343c27ff29c3a5f56f9cd99961a2e..f95fdf40b60cb9d31fdb4f1da86e8d68c184ff78 100644 (file)
@@ -18,7 +18,6 @@
 #include "BufferView.h"
 #include "CutAndPaste.h"
 #include "FuncStatus.h"
-#include "Color.h"
 #include "Cursor.h"
 #include "debug.h"
 #include "FuncRequest.h"
@@ -530,7 +529,7 @@ void InsetMathGrid::drawWithMargin(PainterInfo & pi, int x, int y,
                                - i * hlinesep() - hlinesep()/2 - rowsep()/2;
                        pi.pain.line(x + lmargin + 1, yy,
                                     x + dim.width() - rmargin - 1, yy,
-                                    Color::foreground);
+                                    Color_foreground);
                }
 
        for (col_type col = 0; col <= ncols(); ++col)
@@ -539,7 +538,7 @@ void InsetMathGrid::drawWithMargin(PainterInfo & pi, int x, int y,
                                - i * vlinesep() - vlinesep()/2 - colsep()/2;
                        pi.pain.line(xx, y - dim.ascent() + 1,
                                     xx, y + dim.descent() - 1,
-                                    Color::foreground);
+                                    Color_foreground);
                }
        drawMarkers2(pi, x, y);
 }
index e6e4f31b0a3e1778c46a607a3bae7dade0fcf00b..bc74c6ebed4087a7517bdef21d44ec1cee02b76f 100644 (file)
@@ -30,7 +30,6 @@
 #include "BufferView.h"
 #include "CutAndPaste.h"
 #include "FuncStatus.h"
-#include "Color.h"
 #include "LaTeXFeatures.h"
 #include "Cursor.h"
 #include "debug.h"
@@ -334,7 +333,7 @@ void InsetMathHull::draw(PainterInfo & pi, int x, int y) const
        // selection at the top level of nested inset is difficult to handle.
        if (!editing(pi.base.bv))
                pi.pain.fillRectangle(x + 1, y - dim.asc + 1, dim.wid - 2,
-                               dim.asc + dim.des - 1, Color::mathbg);
+                               dim.asc + dim.des - 1, Color_mathbg);
 
        if (use_preview_) {
                // one pixel gap in front
@@ -1302,7 +1301,7 @@ void InsetMathHull::handleFont2(Cursor & cur, docstring const & arg)
        Font font;
        bool b;
        font.fromString(to_utf8(arg), b);
-       if (font.color() != Color::inherit) {
+       if (font.color() != Color_inherit) {
                MathAtom at = MathAtom(new InsetMathColor(true, font.color()));
                cur.handleNest(at, 0);
        }
index 2c2c8a67208eacf89a336c21a40bb2d6235c352a..9b30e4ed6aa3cc2eb249398497d92fa372ffb35b 100644 (file)
@@ -35,7 +35,6 @@
 
 #include "Bidi.h"
 #include "BufferView.h"
-#include "Color.h"
 #include "CoordCache.h"
 #include "Cursor.h"
 #include "CutAndPaste.h"
@@ -229,7 +228,7 @@ void InsetMathNest::draw(PainterInfo & pi, int x, int y) const
 #if 0
        if (lock_)
                pi.pain.fillRectangle(x, y - ascent(), width(), height(),
-                                       Color::mathlockbg);
+                                       Color_mathlockbg);
 #endif
        setPosCache(pi, x, y);
 }
@@ -262,7 +261,7 @@ void InsetMathNest::drawSelection(PainterInfo & pi, int x, int y) const
                int y1 = g.pos.y_ - g.dim.ascent();
                int x2 = g.pos.x_ + c.pos2x(s2.pos());
                int y2 = g.pos.y_ + g.dim.descent();
-               pi.pain.fillRectangle(x1, y1, x2 - x1, y2 - y1, Color::selection);
+               pi.pain.fillRectangle(x1, y1, x2 - x1, y2 - y1, Color_selection);
        //lyxerr << "InsetMathNest::drawing selection 3: "
        //      << " x1: " << x1 << " x2: " << x2
        //      << " y1: " << y1 << " y2: " << y2 << endl;
@@ -275,7 +274,7 @@ void InsetMathNest::drawSelection(PainterInfo & pi, int x, int y) const
                                int y1 = g.pos.y_ - g.dim.ascent();
                                int x2 = g.pos.x_ + g.dim.width();
                                int y2 = g.pos.y_ + g.dim.descent();
-                               pi.pain.fillRectangle(x1, y1, x2 - x1, y2 - y1, Color::selection);
+                               pi.pain.fillRectangle(x1, y1, x2 - x1, y2 - y1, Color_selection);
                        }
                }
        }
@@ -432,7 +431,7 @@ void InsetMathNest::handleFont2(Cursor & cur, docstring const & arg)
        Font font;
        bool b;
        font.fromString(to_utf8(arg), b);
-       if (font.color() != Color::inherit) {
+       if (font.color() != Color_inherit) {
                MathAtom at = MathAtom(new InsetMathColor(true, font.color()));
                cur.handleNest(at, 0);
        }
index 8448ff724663af6e27a396d119c6a87189e515e8..e0ed1a6dd0c4bd912a63fcf4fa401a88543a314e 100644 (file)
@@ -14,7 +14,6 @@
 #include "MathStream.h"
 #include "MathStream.h"
 
-#include "Color.h"
 
 #include "frontends/Painter.h"
 
@@ -49,8 +48,8 @@ void InsetMathPhantom::draw(PainterInfo & pi, int x, int y) const
        static int const arrow_size = 4;
 
        // We first draw the text and then an arrow
-       Color_color const origcol = pi.base.font.color();
-       pi.base.font.setColor(Color::special);
+       ColorCode const origcol = pi.base.font.color();
+       pi.base.font.setColor(Color_special);
        cell(0).draw(pi, x + 1, y);
        pi.base.font.setColor(origcol);
        Dimension const dim = dimension(*pi.base.bv);
@@ -78,15 +77,15 @@ void InsetMathPhantom::draw(PainterInfo & pi, int x, int y) const
                int const y3 = y4 - arrow_size;
 
                // top arrow
-               pi.pain.line(x2, y1, x1, y2, Color::added_space);
-               pi.pain.line(x2, y1, x3, y2, Color::added_space);
+               pi.pain.line(x2, y1, x1, y2, Color_added_space);
+               pi.pain.line(x2, y1, x3, y2, Color_added_space);
 
                // bottom arrow
-               pi.pain.line(x2, y4, x1, y3, Color::added_space);
-               pi.pain.line(x2, y4, x3, y3, Color::added_space);
+               pi.pain.line(x2, y4, x1, y3, Color_added_space);
+               pi.pain.line(x2, y4, x3, y3, Color_added_space);
 
                // joining line
-               pi.pain.line(x2, y1, x2, y4, Color::added_space);
+               pi.pain.line(x2, y1, x2, y4, Color_added_space);
        }
 
        if (kind_ == phantom || kind_ == hphantom) {
@@ -108,15 +107,15 @@ void InsetMathPhantom::draw(PainterInfo & pi, int x, int y) const
                int const y3 = y2 + arrow_size;
 
                // left arrow
-               pi.pain.line(x1, y2, x2, y3, Color::added_space);
-               pi.pain.line(x1, y2, x2, y1, Color::added_space);
+               pi.pain.line(x1, y2, x2, y3, Color_added_space);
+               pi.pain.line(x1, y2, x2, y1, Color_added_space);
 
                // right arrow
-               pi.pain.line(x4, y2, x3, y3, Color::added_space);
-               pi.pain.line(x4, y2, x3, y1, Color::added_space);
+               pi.pain.line(x4, y2, x3, y3, Color_added_space);
+               pi.pain.line(x4, y2, x3, y1, Color_added_space);
 
                // joining line
-               pi.pain.line(x1, y2, x4, y2, Color::added_space);
+               pi.pain.line(x1, y2, x4, y2, Color_added_space);
        }
 
        drawMarkers(pi, x, y);
index d48eeece0e3beb40c1b7442aa639109376447a26..2c453bafa1fcb6335ddf70a630fc546ae419b0f4 100644 (file)
@@ -15,7 +15,6 @@
 #include "MathData.h"
 #include "MathStream.h"
 #include "Cursor.h"
-#include "Color.h"
 
 #include "frontends/Painter.h"
 
@@ -63,12 +62,12 @@ void InsetMathRoot::draw(PainterInfo & pi, int x, int y) const
        int xp[4];
        int yp[4];
        pi.pain.line(x + dim.width(), y - a + 1,
-                                                        x + w + 4, y - a + 1, Color::math);
+                                                        x + w + 4, y - a + 1, Color_math);
        xp[0] = x + w + 4;         yp[0] = y - a + 1;
        xp[1] = x + w;             yp[1] = y + d;
        xp[2] = x + w - 2;         yp[2] = y + (d - a)/2 + 2;
        xp[3] = x + w - 5;         yp[3] = y + (d - a)/2 + 4;
-       pi.pain.lines(xp, yp, 4, Color::math);
+       pi.pain.lines(xp, yp, 4, Color_math);
        drawMarkers(pi, x, y);
 }
 
index af8b77ea3ee2cfdcb59c3513b18d4270b883d801..88701f2f5643d0928d784c5280335cf24042e3a8 100644 (file)
@@ -15,7 +15,6 @@
 #include "MathStream.h"
 
 #include "LaTeXFeatures.h"
-#include "Color.h"
 
 #include "frontends/Painter.h"
 
@@ -101,7 +100,7 @@ void InsetMathSpace::draw(PainterInfo & pi, int x, int y) const
        xp[2] = x + w - 2;  yp[2] = y;
        xp[3] = x + w - 2;  yp[3] = y - 3;
 
-       pi.pain.lines(xp, yp, 4, (space_ < 3) ? Color::latex : Color::math);
+       pi.pain.lines(xp, yp, 4, (space_ < 3) ? Color_latex : Color_math);
 }
 
 
index 81d88cee1dd0ca988fd06d0e56a5e2d2c5fedf0c..23ded20156eb97e9c6d9dea34901d8e8f860a21c 100644 (file)
@@ -14,7 +14,6 @@
 #include "MathData.h"
 #include "MathStream.h"
 #include "TextPainter.h"
-#include "Color.h"
 #include "frontends/Painter.h"
 
 
@@ -52,11 +51,11 @@ void InsetMathSqrt::draw(PainterInfo & pi, int x, int y) const
        int xp[3];
        int yp[3];
        pi.pain.line(x + dim.width(), y - a + 1,
-               x + 8, y - a + 1, Color::math);
+               x + 8, y - a + 1, Color_math);
        xp[0] = x + 8;            yp[0] = y - a + 1;
        xp[1] = x + 5;            yp[1] = y + d - 1;
        xp[2] = x;                yp[2] = y + (d - a)/2;
-       pi.pain.lines(xp, yp, 3, Color::math);
+       pi.pain.lines(xp, yp, 3, Color_math);
        drawMarkers(pi, x, y);
 }
 
index ee6085434ca3062f114e1271c37709d71a23780d..2a08b207662160d4e53b8beee84727d710704dcc 100644 (file)
@@ -16,7 +16,6 @@
 #include "MathStream.h"
 
 #include "LaTeXFeatures.h"
-#include "Color.h"
 
 #include "frontends/Painter.h"
 
@@ -58,7 +57,7 @@ void InsetMathTFrac::draw(PainterInfo & pi, int x, int y) const
        int m = x + dim.wid / 2;
        cell(0).draw(pi, m - dim0.width() / 2, y - dim0.descent() - 2 - 5);
        cell(1).draw(pi, m - dim1.width() / 2, y + dim1.ascent()  + 2 - 5);
-       pi.pain.line(x + 1, y - 5, x + dim.wid - 2, y - 5, Color::math);
+       pi.pain.line(x + 1, y - 5, x + dim.wid - 2, y - 5, Color_math);
        setPosCache(pi, x, y);
 }
 
index 38841b9577a18cc895a0c033f5180d315cf7d14e..cddc17fa900990dd06fb1baf2a88fe01a25d8dce 100644 (file)
@@ -133,7 +133,7 @@ void InsetMathXYArrow::draw(PainterInfo & pi, int x, int y) const
                pi.pain.text(x, y, "X");
                MathData const & s = sourceCell();
                MathData const & t = targetCell();
-               pi.pain.line(s.xm(), s.ym(), t.xm(), t.ym(), Color::math);
+               pi.pain.line(s.xm(), s.ym(), t.xm(), t.ym(), Color_math);
                cell(1).draw(pi, (s.xm() + t.xm())/2, (s.ym() + t.ym())/2);
 
        }
index a7013b0529b65c0d5af10710244be4cb7574bf62..e30fb3c4652455cde73add332851dd8f4476595d 100644 (file)
@@ -22,7 +22,6 @@
 #include "Buffer.h"
 #include "BufferView.h"
 #include "CoordCache.h"
-#include "Color.h"
 #include "Cursor.h"
 #include "debug.h"
 
@@ -297,7 +296,7 @@ void MathData::draw(PainterInfo & pi, int x, int y) const
        Dimension const & dim = bv.coordCache().getArrays().dim(this);
 
        if (empty()) {
-               pi.pain.rectangle(x, y - dim.ascent(), dim.width(), dim.height(), Color::mathline);
+               pi.pain.rectangle(x, y - dim.ascent(), dim.width(), dim.height(), Color_mathline);
                return;
        }
 
index 490333bf2ae5433199055290a9002f7d3ed160d9..14dae62192886f2127714646a958f1abd25046e6 100644 (file)
@@ -20,7 +20,6 @@
 #include "debug.h"
 #include "gettext.h"
 #include "Lexer.h"
-#include "Color.h"
 
 #include "frontends/FontMetrics.h"
 #include "frontends/Painter.h"
@@ -145,7 +144,7 @@ void MathMacroTemplate::draw(PainterInfo & p, int x, int y) const
 
        // label
        Font font = p.base.font;
-       font.setColor(Color::math);
+       font.setColor(Color_math);
 
        PainterInfo pi(p.base.bv, p.pain);
        pi.base.style = LM_ST_TEXT;
@@ -155,10 +154,10 @@ void MathMacroTemplate::draw(PainterInfo & p, int x, int y) const
        int const w = dim.wid - 2;
        int const h = dim.height() - 2;
 
-       // Color::mathbg used to be "AntiqueWhite" but is "linen" now, too
+       // Color_mathbg used to be "AntiqueWhite" but is "linen" now, too
        // the next line would overwrite the selection!
-       //pi.pain.fillRectangle(x, a, w, h, Color::mathmacrobg);
-       pi.pain.rectangle(x, a, w, h, Color::mathframe);
+       //pi.pain.fillRectangle(x, a, w, h, Color_mathmacrobg);
+       pi.pain.rectangle(x, a, w, h, Color_mathframe);
 
        // FIXME:
 #if 0
@@ -175,10 +174,10 @@ void MathMacroTemplate::draw(PainterInfo & p, int x, int y) const
        int const w1 = cell(1).dimension(*pi.base.bv).width();
        cell(0).draw(pi, x + 2, y + 1);
        pi.pain.rectangle(x, y - dim.ascent() + 3,
-               w0 + 4, dim.height() - 6, Color::mathline);
+               w0 + 4, dim.height() - 6, Color_mathline);
        cell(1).draw(pi, x + 8 + w0, y + 1);
        pi.pain.rectangle(x + w0 + 6, y - dim.ascent() + 3,
-               w1 + 4, dim.height() - 6, Color::mathline);
+               w1 + 4, dim.height() - 6, Color_mathline);
 
        if (lockMacro)
                MacroTable::globalMacros().get(name_).unlock();
index 905d38b35ae7388d20a822b9d005df4d63a6a6ba..8b9de7640444822857689d8652ab9344d5e6f1bf 100644 (file)
 
 #include <config.h>
 
-#include "MathSupport.h"
-#include "MathData.h"
 #include "InsetMath.h"
-#include "MathStream.h"
+#include "MathData.h"
 #include "MathParser.h"
+#include "MathStream.h"
+#include "MathSupport.h"
 
 #include "debug.h"
-#include "Color.h"
 
 #include "frontends/FontLoader.h"
 #include "frontends/FontMetrics.h"
@@ -410,7 +409,7 @@ void mathed_draw_deco(PainterInfo & pi, int x, int y, int w, int h,
 {
        if (name == ".") {
                pi.pain.line(x + w/2, y, x + w/2, y + h,
-                         Color::cursor, Painter::line_onoffdash);
+                         Color_cursor, Painter::line_onoffdash);
                return;
        }
 
@@ -452,7 +451,7 @@ void mathed_draw_deco(PainterInfo & pi, int x, int y, int w, int h,
                        pi.pain.line(
                                int(x + xx + 0.5), int(y + yy + 0.5),
                                int(x + x2 + 0.5), int(y + y2 + 0.5),
-                               Color::math);
+                               Color_math);
                } else {
                        int xp[32];
                        int yp[32];
@@ -469,7 +468,7 @@ void mathed_draw_deco(PainterInfo & pi, int x, int y, int w, int h,
                                yp[j] = int(y + yy + 0.5);
                                //  lyxerr << "P[" << j ' ' << xx << ' ' << yy << ' ' << x << ' ' << y << ']';
                        }
-                       pi.pain.lines(xp, yp, n, Color::math);
+                       pi.pain.lines(xp, yp, n, Color_math);
                }
        }
 }
@@ -478,7 +477,7 @@ void mathed_draw_deco(PainterInfo & pi, int x, int y, int w, int h,
 void drawStrRed(PainterInfo & pi, int x, int y, docstring const & str)
 {
        Font f = pi.base.font;
-       f.setColor(Color::latex);
+       f.setColor(Color_latex);
        pi.pain.text(x, y, str, f);
 }
 
@@ -486,7 +485,7 @@ void drawStrRed(PainterInfo & pi, int x, int y, docstring const & str)
 void drawStrBlack(PainterInfo & pi, int x, int y, docstring const & str)
 {
        Font f = pi.base.font;
-       f.setColor(Color::foreground);
+       f.setColor(Color_foreground);
        pi.pain.text(x, y, str, f);
 }
 
@@ -504,7 +503,7 @@ struct fontinfo {
        Font::FONT_FAMILY family_;
        Font::FONT_SERIES series_;
        Font::FONT_SHAPE  shape_;
-       Color::color        color_;
+       ColorCode        color_;
 };
 
 
@@ -518,87 +517,87 @@ Font::FONT_SHAPE  const inh_shape  = Font::INHERIT_SHAPE;
 fontinfo fontinfos[] = {
        // math fonts
        {"mathnormal",    Font::ROMAN_FAMILY, Font::MEDIUM_SERIES,
-                         Font::ITALIC_SHAPE, Color::math},
+                         Font::ITALIC_SHAPE, Color_math},
        {"mathbf",        inh_family, Font::BOLD_SERIES,
-                         inh_shape, Color::math},
+                         inh_shape, Color_math},
        {"mathcal",       Font::CMSY_FAMILY, inh_series,
-                         inh_shape, Color::math},
+                         inh_shape, Color_math},
        {"mathfrak",      Font::EUFRAK_FAMILY, inh_series,
-                         inh_shape, Color::math},
+                         inh_shape, Color_math},
        {"mathrm",        Font::ROMAN_FAMILY, inh_series,
-                         Font::UP_SHAPE, Color::math},
+                         Font::UP_SHAPE, Color_math},
        {"mathsf",        Font::SANS_FAMILY, inh_series,
-                         inh_shape, Color::math},
+                         inh_shape, Color_math},
        {"mathbb",        Font::MSB_FAMILY, inh_series,
-                         inh_shape, Color::math},
+                         inh_shape, Color_math},
        {"mathtt",        Font::TYPEWRITER_FAMILY, inh_series,
-                         inh_shape, Color::math},
+                         inh_shape, Color_math},
        {"mathit",        inh_family, inh_series,
-                         Font::ITALIC_SHAPE, Color::math},
+                         Font::ITALIC_SHAPE, Color_math},
        {"cmex",          Font::CMEX_FAMILY, inh_series,
-                         inh_shape, Color::math},
+                         inh_shape, Color_math},
        {"cmm",           Font::CMM_FAMILY, inh_series,
-                         inh_shape, Color::math},
+                         inh_shape, Color_math},
        {"cmr",           Font::CMR_FAMILY, inh_series,
-                         inh_shape, Color::math},
+                         inh_shape, Color_math},
        {"cmsy",          Font::CMSY_FAMILY, inh_series,
-                         inh_shape, Color::math},
+                         inh_shape, Color_math},
        {"eufrak",        Font::EUFRAK_FAMILY, inh_series,
-                         inh_shape, Color::math},
+                         inh_shape, Color_math},
        {"msa",           Font::MSA_FAMILY, inh_series,
-                         inh_shape, Color::math},
+                         inh_shape, Color_math},
        {"msb",           Font::MSB_FAMILY, inh_series,
-                         inh_shape, Color::math},
+                         inh_shape, Color_math},
        {"wasy",          Font::WASY_FAMILY, inh_series,
-                         inh_shape, Color::math},
+                         inh_shape, Color_math},
        {"esint",         Font::ESINT_FAMILY, inh_series,
-                         inh_shape, Color::math},
+                         inh_shape, Color_math},
 
        // Text fonts
        {"text",          inh_family, inh_series,
-                         inh_shape, Color::foreground},
+                         inh_shape, Color_foreground},
        {"textbf",        inh_family, Font::BOLD_SERIES,
-                         inh_shape, Color::foreground},
+                         inh_shape, Color_foreground},
        {"textit",        inh_family, inh_series,
-                         Font::ITALIC_SHAPE, Color::foreground},
+                         Font::ITALIC_SHAPE, Color_foreground},
        {"textmd",        inh_family, Font::MEDIUM_SERIES,
-                         inh_shape, Color::foreground},
+                         inh_shape, Color_foreground},
        {"textnormal",    inh_family, inh_series,
-                         Font::UP_SHAPE, Color::foreground},
+                         Font::UP_SHAPE, Color_foreground},
        {"textrm",        Font::ROMAN_FAMILY,
-                         inh_series, Font::UP_SHAPE,Color::foreground},
+                         inh_series, Font::UP_SHAPE,Color_foreground},
        {"textsc",        inh_family, inh_series,
-                         Font::SMALLCAPS_SHAPE, Color::foreground},
+                         Font::SMALLCAPS_SHAPE, Color_foreground},
        {"textsf",        Font::SANS_FAMILY, inh_series,
-                         inh_shape, Color::foreground},
+                         inh_shape, Color_foreground},
        {"textsl",        inh_family, inh_series,
-                         Font::SLANTED_SHAPE, Color::foreground},
+                         Font::SLANTED_SHAPE, Color_foreground},
        {"texttt",        Font::TYPEWRITER_FAMILY, inh_series,
-                         inh_shape, Color::foreground},
+                         inh_shape, Color_foreground},
        {"textup",        inh_family, inh_series,
-                         Font::UP_SHAPE, Color::foreground},
+                         Font::UP_SHAPE, Color_foreground},
 
        // TIPA support
        {"textipa",       inh_family, inh_series,
-                         inh_shape, Color::foreground},
+                         inh_shape, Color_foreground},
 
        // LyX internal usage
        {"lyxtex",        inh_family, inh_series,
-                         Font::UP_SHAPE, Color::latex},
+                         Font::UP_SHAPE, Color_latex},
        {"lyxsymbol",     Font::SYMBOL_FAMILY, inh_series,
-                         inh_shape, Color::math},
+                         inh_shape, Color_math},
        {"lyxboldsymbol", Font::SYMBOL_FAMILY, Font::BOLD_SERIES,
-                         inh_shape, Color::math},
+                         inh_shape, Color_math},
        {"lyxblacktext",  Font::ROMAN_FAMILY, Font::MEDIUM_SERIES,
-                         Font::UP_SHAPE, Color::foreground},
+                         Font::UP_SHAPE, Color_foreground},
        {"lyxnochange",   inh_family, inh_series,
-                         inh_shape, Color::foreground},
+                         inh_shape, Color_foreground},
        {"lyxfakebb",     Font::TYPEWRITER_FAMILY, Font::BOLD_SERIES,
-                         Font::UP_SHAPE, Color::math},
+                         Font::UP_SHAPE, Color_math},
        {"lyxfakecal",    Font::SANS_FAMILY, Font::MEDIUM_SERIES,
-                         Font::ITALIC_SHAPE, Color::math},
+                         Font::ITALIC_SHAPE, Color_math},
        {"lyxfakefrak",   Font::ROMAN_FAMILY, Font::BOLD_SERIES,
-                         Font::ITALIC_SHAPE, Color::math}
+                         Font::ITALIC_SHAPE, Color_math}
 };
 
 
@@ -673,7 +672,7 @@ void augmentFont(Font & font, docstring const & name)
                font.setSeries(info->series_);
        if (info->shape_ != inh_shape)
                font.setShape(info->shape_);
-       if (info->color_ != Color::none)
+       if (info->color_ != Color_none)
                font.setColor(info->color_);
 }
 
index ee256092592672a486115827b71f339f735f4745..37787e7998d10ba2cee11c36be787a07246b914f 100644 (file)
@@ -16,7 +16,6 @@
 #include "Bidi.h"
 #include "Buffer.h"
 #include "CoordCache.h"
-#include "Color.h"
 #include "Cursor.h"
 #include "debug.h"
 #include "BufferParams.h"
@@ -96,23 +95,23 @@ void RowPainter::paintHfill(pos_type const pos, pos_type const body_pos)
        int const y0 = yo_;
        int const y1 = y0 - defaultRowHeight() / 2;
 
-       pi_.pain.line(int(x_), y1, int(x_), y0, Color::added_space);
+       pi_.pain.line(int(x_), y1, int(x_), y0, Color_added_space);
 
        if (pm_.hfillExpansion(row_, pos)) {
                int const y2 = (y0 + y1) / 2;
 
                if (pos >= body_pos) {
                        pi_.pain.line(int(x_), y2, int(x_ + row_.hfill), y2,
-                               Color::added_space,
+                               Color_added_space,
                                Painter::line_onoffdash);
                        x_ += row_.hfill;
                } else {
                        pi_.pain.line(int(x_), y2, int(x_ + row_.label_hfill), y2,
-                               Color::added_space,
+                               Color_added_space,
                                Painter::line_onoffdash);
                        x_ += row_.label_hfill;
                }
-               pi_.pain.line(int(x_), y1, int(x_), y0, Color::added_space);
+               pi_.pain.line(int(x_), y1, int(x_), y0, Color_added_space);
        }
        x_ += 2;
 }
@@ -172,10 +171,10 @@ void RowPainter::paintInset(Inset const * inset, pos_type const pos)
        int const x2 = x1 + dim.wid;
        int const y1 = yo_ + dim.des;
        int const y2 = yo_ - dim.asc;
-       pi_.pain.line(x1, y1, x1, y2, Color::green);
-       pi_.pain.line(x1, y1, x2, y1, Color::green);
-       pi_.pain.line(x2, y1, x2, y2, Color::green);
-       pi_.pain.line(x1, y2, x2, y2, Color::green);
+       pi_.pain.line(x1, y1, x1, y2, Color_green);
+       pi_.pain.line(x1, y1, x2, y1, Color_green);
+       pi_.pain.line(x2, y1, x2, y2, Color_green);
+       pi_.pain.line(x1, y2, x2, y2, Color_green);
 #endif
 }
 
@@ -325,9 +324,9 @@ void RowPainter::paintChars(pos_type & vpos, Font const & font,
        if (prev_change != Change::UNCHANGED) {
                Font copy(font);
                if (prev_change == Change::DELETED) {
-                       copy.setColor(Color::deletedtext);
+                       copy.setColor(Color_deletedtext);
                } else if (prev_change == Change::INSERTED) {
-                       copy.setColor(Color::addedtext);
+                       copy.setColor(Color_addedtext);
                }
                x_ += pi_.pain.text(int(x_), yo_, s, copy);
        } else {
@@ -346,7 +345,7 @@ void RowPainter::paintForeignMark(double orig_x, Font const & font, int desc)
                return;
 
        int const y = yo_ + 1 + desc;
-       pi_.pain.line(int(orig_x), y, int(x_), y, Color::language);
+       pi_.pain.line(int(orig_x), y, int(x_), y, Color_language);
 }
 
 
@@ -398,7 +397,7 @@ void RowPainter::paintChangeBar()
                ? row_.ascent()
                : row_.height();
 
-       pi_.pain.fillRectangle(5, yo_ - row_.ascent(), 3, height, Color::changebar);
+       pi_.pain.fillRectangle(5, yo_ - row_.ascent(), 3, height, Color_changebar);
 }
 
 
@@ -413,8 +412,8 @@ void RowPainter::paintAppendix()
        if (par_.params().startOfAppendix())
                y += 2 * defaultRowHeight();
 
-       pi_.pain.line(1, y, 1, yo_ + row_.height(), Color::appendix);
-       pi_.pain.line(width_ - 2, y, width_ - 2, yo_ + row_.height(), Color::appendix);
+       pi_.pain.line(1, y, 1, yo_ + row_.height(), Color_appendix);
+       pi_.pain.line(width_ - 2, y, width_ - 2, yo_ + row_.height(), Color_appendix);
 }
 
 
@@ -451,12 +450,12 @@ void RowPainter::paintDepthBar()
                int const starty = yo_ - row_.ascent();
                int const h =  row_.height() - 1 - (i - next_depth - 1) * 3;
 
-               pi_.pain.line(x, starty, x, starty + h, Color::depthbar);
+               pi_.pain.line(x, starty, x, starty + h, Color_depthbar);
 
                if (i > prev_depth)
-                       pi_.pain.fillRectangle(x, starty, w, 2, Color::depthbar);
+                       pi_.pain.fillRectangle(x, starty, w, 2, Color_depthbar);
                if (i > next_depth)
-                       pi_.pain.fillRectangle(x, starty + h, w, 2, Color::depthbar);
+                       pi_.pain.fillRectangle(x, starty + h, w, 2, Color_depthbar);
        }
 }
 
@@ -464,7 +463,7 @@ void RowPainter::paintDepthBar()
 int RowPainter::paintAppendixStart(int y)
 {
        Font pb_font;
-       pb_font.setColor(Color::appendix);
+       pb_font.setColor(Color_appendix);
        pb_font.decSize();
 
        int w = 0;
@@ -477,10 +476,10 @@ int RowPainter::paintAppendixStart(int y)
        int const text_start = int(xo_ + (width_ - w) / 2);
        int const text_end = text_start + w;
 
-       pi_.pain.rectText(text_start, y + d, label, pb_font, Color::none, Color::none);
+       pi_.pain.rectText(text_start, y + d, label, pb_font, Color_none, Color_none);
 
-       pi_.pain.line(int(xo_ + 1), y, text_start, y, Color::appendix);
-       pi_.pain.line(text_end, y, int(xo_ + width_ - 2), y, Color::appendix);
+       pi_.pain.line(int(xo_ + 1), y, text_start, y, Color_appendix);
+       pi_.pain.line(text_end, y, int(xo_ + width_ - 2), y, Color_appendix);
 
        return 3 * defaultRowHeight();
 }
@@ -617,7 +616,7 @@ void RowPainter::paintLast()
        if (par_.isInserted(par_.size()) || par_.isDeleted(par_.size())) {
                FontMetrics const & fm = theFontMetrics(pi_.base.bv->buffer().params().getFont());
                int const length = fm.maxAscent() / 2;
-               Color::color col = par_.isInserted(par_.size()) ? Color::addedtext : Color::deletedtext;
+               ColorCode col = par_.isInserted(par_.size()) ? Color_addedtext : Color_deletedtext;
 
                pi_.pain.line(int(x_) + 1, yo_ + 2, int(x_) + 1, yo_ + 2 - length, col,
                           Painter::line_solid, Painter::line_thick);
@@ -640,9 +639,9 @@ void RowPainter::paintLast()
                        x += (size - width_ + row_.width() + 1) * (is_rtl ? -1 : 1);
 
                if (endlabel == END_LABEL_BOX)
-                       pi_.pain.rectangle(x, y, size, size, Color::eolmarker);
+                       pi_.pain.rectangle(x, y, size, size, Color_eolmarker);
                else
-                       pi_.pain.fillRectangle(x, y, size, size, Color::eolmarker);
+                       pi_.pain.fillRectangle(x, y, size, size, Color_eolmarker);
                break;
        }
 
@@ -761,7 +760,7 @@ void RowPainter::paintText()
                                = theFontMetrics(pi_.base.bv->buffer().params().getFont());
                        int const middle = yo_ - fm.maxAscent() / 3;
                        pi_.pain.line(last_strikeout_x, middle, int(x_), middle,
-                               Color::deletedtext, Painter::line_solid, Painter::line_thin);
+                               Color_deletedtext, Painter::line_solid, Painter::line_thin);
                        running_strikeout = false;
                }
 
@@ -805,7 +804,7 @@ void RowPainter::paintText()
                        = theFontMetrics(pi_.base.bv->buffer().params().getFont());
                int const middle = yo_ - fm.maxAscent() / 3;
                pi_.pain.line(last_strikeout_x, middle, int(x_), middle,
-                       Color::deletedtext, Painter::line_solid, Painter::line_thin);
+                       Color_deletedtext, Painter::line_solid, Painter::line_thin);
                running_strikeout = false;
        }
 }