From: André Pönitz Date: Thu, 26 Apr 2007 17:34:20 +0000 (+0000) Subject: rename LColor into Color X-Git-Tag: 1.6.10~10032 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=5008ee540f84715cd10e87f3fa0cd5dc7b974784;hp=06baeac0646a2d63145ff3b18a3180ca69c6b288;p=features.git rename LColor into Color git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18046 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/BranchList.cpp b/src/BranchList.cpp index 128d27c590..5c1a2076fa 100644 --- a/src/BranchList.cpp +++ b/src/BranchList.cpp @@ -11,7 +11,7 @@ #include #include "BranchList.h" -#include "LColor.h" +#include "Color.h" #include "frontends/Application.h" @@ -25,7 +25,7 @@ using std::string; Branch::Branch() { - theApp()->getRgbColor(LColor::background, color_); + theApp()->getRgbColor(Color::background, color_); } @@ -74,7 +74,7 @@ void Branch::setColor(string const & c) color_ = RGBColor(c); else // no color set or invalid color - use normal background - theApp()->getRgbColor(LColor::background, color_); + theApp()->getRgbColor(Color::background, color_); } diff --git a/src/BranchList.h b/src/BranchList.h index 3f2978acee..550887a85a 100644 --- a/src/BranchList.h +++ b/src/BranchList.h @@ -60,9 +60,9 @@ public: void setColor(RGBColor const &); /** * Set color from a string "#rrggbb". - * Use LColor:background if the string is no valid color. + * Use Color:background if the string is no valid color. * This ensures compatibility with LyX 1.4.0 that had the symbolic - * color "none" that was displayed as LColor:background. + * color "none" that was displayed as Color:background. */ void setColor(std::string const &); diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp index a4c324ed72..f9b037f35d 100644 --- a/src/BufferParams.cpp +++ b/src/BufferParams.cpp @@ -25,7 +25,7 @@ #include "gettext.h" #include "Language.h" #include "LaTeXFeatures.h" -#include "LColor.h" +#include "Color.h" #include "LyXFont.h" #include "Lexer.h" #include "LyXRC.h" @@ -527,9 +527,9 @@ string const BufferParams::readToken(Lexer & lex, string const & token) string color = lex.getString(); if (branch_ptr) branch_ptr->setColor(color); - // Update also the LColor table: + // Update also the Color table: if (color == "none") - color = lcolor.getX11Name(LColor::background); + color = lcolor.getX11Name(Color::background); // FIXME UNICODE lcolor.setColor(to_utf8(branch), color); diff --git a/src/Color.cpp b/src/Color.cpp new file mode 100644 index 0000000000..125321c1de --- /dev/null +++ b/src/Color.cpp @@ -0,0 +1,291 @@ +/** + * \file Color.cpp + * This file is part of LyX, the document processor. + * Licence details can be found in the file COPYING. + * + * \author Asger Alstrup + * \author Lars Gullik Bjønnes + * \author Matthias Ettrich + * \author Jean-Marc Lasgouttes + * \author John Levon + * \author André Pönitz + * \author Martin Vermeer + * + * Full author contact details are available in file CREDITS. + */ + +#include + +#include "debug.h" +#include "gettext.h" +#include "Color.h" +#include "support/lstrings.h" + +#include + + +namespace lyx { + +using support::compare_ascii_no_case; +using support::ascii_lowercase; + +using std::endl; +using std::string; + + +namespace { + +struct ColorEntry { + Color::color lcolor; + char const * guiname; + char const * latexname; + char const * x11name; + char const * lyxname; +}; + +} + +class Color::Pimpl { +public: + /// + class information { + public: + /// the name as it appears in the GUI + string guiname; + /// the name used in LaTeX + string latexname; + /// the name for X11 + string x11name; + /// the name for LyX + string lyxname; + }; + + /// initialise a color entry + void fill(ColorEntry const & entry) + { + information in; + in.lyxname = entry.lyxname; + in.latexname = entry.latexname; + in.x11name = entry.x11name; + in.guiname = entry.guiname; + infotab[entry.lcolor] = in; + lyxcolors[entry.lyxname] = entry.lcolor; + latexcolors[entry.latexname] = entry.lcolor; + } + + /// + typedef std::map InfoTab; + /// the table of color information + InfoTab infotab; + + typedef std::map Transform; + /// the transform between LyX color name string and integer code. + Transform lyxcolors; + /// the transform between LaTeX color name string and integer code. + Transform latexcolors; + +}; + + +Color::Color() + : pimpl_(new Pimpl) +{ + // Color::color, 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" }, + { 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" }, + { strikeout, N_("Deleted text"), "strikeout", "Red", "strikeout" }, + { newtext, N_("Added text"), "newtext", "Blue", "newtext" }, + { 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", + "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 } + }; + + for (int i = 0; items[i].guiname; ++i) + pimpl_->fill(items[i]); +} + + +Color::Color(Color const & c) + : pimpl_(new Pimpl(*c.pimpl_)) +{} + + +Color::~Color() +{} + + +Color & Color::operator=(Color tmp) +{ + boost::swap(pimpl_, tmp.pimpl_); + return *this; +} + + +docstring const Color::getGUIName(Color::color c) const +{ + Pimpl::InfoTab::const_iterator it = pimpl_->infotab.find(c); + if (it != pimpl_->infotab.end()) + return _(it->second.guiname); + return from_ascii("none"); +} + + +string const Color::getX11Name(Color::color c) const +{ + Pimpl::InfoTab::const_iterator it = pimpl_->infotab.find(c); + if (it != pimpl_->infotab.end()) + return it->second.x11name; + + lyxerr << "LyX internal error: Missing color" + " entry in Color.cpp for " << c << '\n' + << "Using black." << endl; + return "black"; +} + + +string const Color::getLaTeXName(Color::color c) const +{ + Pimpl::InfoTab::const_iterator it = pimpl_->infotab.find(c); + if (it != pimpl_->infotab.end()) + return it->second.latexname; + return "black"; +} + + +string const Color::getLyXName(Color::color c) const +{ + Pimpl::InfoTab::const_iterator it = pimpl_->infotab.find(c); + if (it != pimpl_->infotab.end()) + return it->second.lyxname; + return "black"; +} + + +bool Color::setColor(Color::color col, string const & x11name) +{ + Pimpl::InfoTab::iterator it = pimpl_->infotab.find(col); + if (it == pimpl_->infotab.end()) { + lyxerr << "Color " << col << " not found in database." + << std::endl; + return false; + } + + // "inherit" is returned for colors not in the database + // (and anyway should not be redefined) + if (col == none || col == inherit || col == ignore) { + lyxerr << "Color " << getLyXName(col) + << " may not be redefined" << endl; + return false; + } + + it->second.x11name = x11name; + return true; +} + + +bool Color::setColor(string const & lyxname, string const &x11name) +{ + string const lcname = ascii_lowercase(lyxname); + if (pimpl_->lyxcolors.find(lcname) == pimpl_->lyxcolors.end()) { + LYXERR(Debug::GUI) + << "Color::setColor: Unknown color \"" + << lyxname << '"' << endl; + addColor(static_cast(pimpl_->infotab.size()), lcname); + } + + return setColor(pimpl_->lyxcolors[lcname], x11name); +} + + +void Color::addColor(Color::color c, string const & lyxname) const +{ + ColorEntry ce = { c, "", "", "", lyxname.c_str() }; + pimpl_->fill(ce); +} + + +Color::color 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 pimpl_->lyxcolors[lcname]; +} + + +Color::color Color::getFromLaTeXName(string const & latexname) const +{ + if (pimpl_->latexcolors.find(latexname) == pimpl_->latexcolors.end()) { + lyxerr << "Color::getFromLaTeXName: Unknown color \"" + << latexname << '"' << endl; + return none; + } + + return pimpl_->latexcolors[latexname]; +} + + +// The evil global Color instance +Color lcolor; +// An equally evil global system Color instance +Color system_lcolor; + + +} // namespace lyx diff --git a/src/Color.h b/src/Color.h new file mode 100644 index 0000000000..c64ba16566 --- /dev/null +++ b/src/Color.h @@ -0,0 +1,256 @@ +// -*- C++ -*- +/** + * \file Color.h + * This file is part of LyX, the document processor. + * Licence details can be found in the file COPYING. + * + * \author Asger Alstrup + * \author Lars Gullik Bjønnes + * \author Matthias Ettrich + * \author Jean-Marc Lasgouttes + * \author Angus Leeming + * \author John Levon + * \author André Pönitz + * \author Martin Vermeer + * + * Full author contact details are available in file CREDITS. + */ + +#ifndef LCOLOR_H +#define LCOLOR_H + +#include "support/docstring.h" + +#include + + +namespace lyx { + +/** + * This is a stateless class. + * + * It has one basic purposes: + * To serve as a color-namespace container (the Color enum). + */ +/** + * \class Color + * + * A class holding color definitions and associated names for + * LaTeX, X11, the GUI, and LyX internally. + * + * A color can be one of the following kinds: + * + * - A real, predefined color, such as black, white, red or green. + * - A logical color, such as no color, inherit, math + */ + +class Color +// made copyable for same reasons as LyXRC was made copyable. See there for +// 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 + mathframe, + /// 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, + /// strike-out color + strikeout, + /// added text color + newtext, + /// 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(); + /// + Color(Color const &); + /// + ~Color(); + /// + Color & operator=(Color); + + /** 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); + + /** set the given LyX color to the color defined by the X11 + * name given \returns true if successful. A new color entry + * is created if the color is unknown + */ + bool setColor(std::string const & lyxname, std::string const & x11name); + + /// Get the GUI name of \c color. + docstring const getGUIName(Color::color c) const; + + /// Get the X11 name of \c color. + std::string const getX11Name(Color::color c) const; + + /// Get the LaTeX name of \c color. + std::string const getLaTeXName(Color::color c) const; + + /// Get the LyX name of \c color. + std::string const getLyXName(Color::color 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; +private: + /// + void addColor(Color::color c, std::string const & lyxname) const; + /// + class Pimpl; + /// + boost::scoped_ptr pimpl_; +}; + + +/** \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(-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 +extern Color system_lcolor; + + +} // namespace lyx + +#endif diff --git a/src/LColor.cpp b/src/LColor.cpp deleted file mode 100644 index 9af35b0f00..0000000000 --- a/src/LColor.cpp +++ /dev/null @@ -1,291 +0,0 @@ -/** - * \file LColor.cpp - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author Asger Alstrup - * \author Lars Gullik Bjønnes - * \author Matthias Ettrich - * \author Jean-Marc Lasgouttes - * \author John Levon - * \author André Pönitz - * \author Martin Vermeer - * - * Full author contact details are available in file CREDITS. - */ - -#include - -#include "debug.h" -#include "gettext.h" -#include "LColor.h" -#include "support/lstrings.h" - -#include - - -namespace lyx { - -using support::compare_ascii_no_case; -using support::ascii_lowercase; - -using std::endl; -using std::string; - - -namespace { - -struct ColorEntry { - LColor::color lcolor; - char const * guiname; - char const * latexname; - char const * x11name; - char const * lyxname; -}; - -} - -class LColor::Pimpl { -public: - /// - class information { - public: - /// the name as it appears in the GUI - string guiname; - /// the name used in LaTeX - string latexname; - /// the name for X11 - string x11name; - /// the name for LyX - string lyxname; - }; - - /// initialise a color entry - void fill(ColorEntry const & entry) - { - information in; - in.lyxname = entry.lyxname; - in.latexname = entry.latexname; - in.x11name = entry.x11name; - in.guiname = entry.guiname; - infotab[entry.lcolor] = in; - lyxcolors[entry.lyxname] = entry.lcolor; - latexcolors[entry.latexname] = entry.lcolor; - } - - /// - typedef std::map InfoTab; - /// the table of color information - InfoTab infotab; - - typedef std::map Transform; - /// the transform between LyX color name string and integer code. - Transform lyxcolors; - /// the transform between LaTeX color name string and integer code. - Transform latexcolors; - -}; - - -LColor::LColor() - : pimpl_(new Pimpl) -{ - // LColor::color, 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" }, - { 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" }, - { strikeout, N_("Deleted text"), "strikeout", "Red", "strikeout" }, - { newtext, N_("Added text"), "newtext", "Blue", "newtext" }, - { 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", - "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 } - }; - - for (int i = 0; items[i].guiname; ++i) - pimpl_->fill(items[i]); -} - - -LColor::LColor(LColor const & c) - : pimpl_(new Pimpl(*c.pimpl_)) -{} - - -LColor::~LColor() -{} - - -LColor & LColor::operator=(LColor tmp) -{ - boost::swap(pimpl_, tmp.pimpl_); - return *this; -} - - -docstring const LColor::getGUIName(LColor::color c) const -{ - Pimpl::InfoTab::const_iterator it = pimpl_->infotab.find(c); - if (it != pimpl_->infotab.end()) - return _(it->second.guiname); - return from_ascii("none"); -} - - -string const LColor::getX11Name(LColor::color c) const -{ - Pimpl::InfoTab::const_iterator it = pimpl_->infotab.find(c); - if (it != pimpl_->infotab.end()) - return it->second.x11name; - - lyxerr << "LyX internal error: Missing color" - " entry in LColor.cpp for " << c << '\n' - << "Using black." << endl; - return "black"; -} - - -string const LColor::getLaTeXName(LColor::color c) const -{ - Pimpl::InfoTab::const_iterator it = pimpl_->infotab.find(c); - if (it != pimpl_->infotab.end()) - return it->second.latexname; - return "black"; -} - - -string const LColor::getLyXName(LColor::color c) const -{ - Pimpl::InfoTab::const_iterator it = pimpl_->infotab.find(c); - if (it != pimpl_->infotab.end()) - return it->second.lyxname; - return "black"; -} - - -bool LColor::setColor(LColor::color col, string const & x11name) -{ - Pimpl::InfoTab::iterator it = pimpl_->infotab.find(col); - if (it == pimpl_->infotab.end()) { - lyxerr << "Color " << col << " not found in database." - << std::endl; - return false; - } - - // "inherit" is returned for colors not in the database - // (and anyway should not be redefined) - if (col == none || col == inherit || col == ignore) { - lyxerr << "Color " << getLyXName(col) - << " may not be redefined" << endl; - return false; - } - - it->second.x11name = x11name; - return true; -} - - -bool LColor::setColor(string const & lyxname, string const &x11name) -{ - string const lcname = ascii_lowercase(lyxname); - if (pimpl_->lyxcolors.find(lcname) == pimpl_->lyxcolors.end()) { - LYXERR(Debug::GUI) - << "LColor::setColor: Unknown color \"" - << lyxname << '"' << endl; - addColor(static_cast(pimpl_->infotab.size()), lcname); - } - - return setColor(pimpl_->lyxcolors[lcname], x11name); -} - - -void LColor::addColor(LColor::color c, string const & lyxname) const -{ - ColorEntry ce = { c, "", "", "", lyxname.c_str() }; - pimpl_->fill(ce); -} - - -LColor::color LColor::getFromLyXName(string const & lyxname) const -{ - string const lcname = ascii_lowercase(lyxname); - if (pimpl_->lyxcolors.find(lcname) == pimpl_->lyxcolors.end()) { - lyxerr << "LColor::getFromLyXName: Unknown color \"" - << lyxname << '"' << endl; - return none; - } - - return pimpl_->lyxcolors[lcname]; -} - - -LColor::color LColor::getFromLaTeXName(string const & latexname) const -{ - if (pimpl_->latexcolors.find(latexname) == pimpl_->latexcolors.end()) { - lyxerr << "LColor::getFromLaTeXName: Unknown color \"" - << latexname << '"' << endl; - return none; - } - - return pimpl_->latexcolors[latexname]; -} - - -// The evil global LColor instance -LColor lcolor; -// An equally evil global system LColor instance -LColor system_lcolor; - - -} // namespace lyx diff --git a/src/LColor.h b/src/LColor.h deleted file mode 100644 index d7ca132759..0000000000 --- a/src/LColor.h +++ /dev/null @@ -1,256 +0,0 @@ -// -*- C++ -*- -/** - * \file LColor.h - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author Asger Alstrup - * \author Lars Gullik Bjønnes - * \author Matthias Ettrich - * \author Jean-Marc Lasgouttes - * \author Angus Leeming - * \author John Levon - * \author André Pönitz - * \author Martin Vermeer - * - * Full author contact details are available in file CREDITS. - */ - -#ifndef LCOLOR_H -#define LCOLOR_H - -#include "support/docstring.h" - -#include - - -namespace lyx { - -/** - * This is a stateless class. - * - * It has one basic purposes: - * To serve as a color-namespace container (the Color enum). - */ -/** - * \class LColor - * - * A class holding color definitions and associated names for - * LaTeX, X11, the GUI, and LyX internally. - * - * A color can be one of the following kinds: - * - * - A real, predefined color, such as black, white, red or green. - * - A logical color, such as no color, inherit, math - */ - -class LColor -// made copyable for same reasons as LyXRC was made copyable. See there for -// 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 - mathframe, - /// 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, - /// strike-out color - strikeout, - /// added text color - newtext, - /// 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 - }; - - - /// - LColor(); - /// - LColor(LColor const &); - /// - ~LColor(); - /// - LColor & operator=(LColor); - - /** set the given LyX color to the color defined by the X11 name given - * \returns true if successful. - */ - bool setColor(LColor::color 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 - * is created if the color is unknown - */ - bool setColor(std::string const & lyxname, std::string const & x11name); - - /// Get the GUI name of \c color. - docstring const getGUIName(LColor::color c) const; - - /// Get the X11 name of \c color. - std::string const getX11Name(LColor::color c) const; - - /// Get the LaTeX name of \c color. - std::string const getLaTeXName(LColor::color c) const; - - /// Get the LyX name of \c color. - std::string const getLyXName(LColor::color c) const; - - /// \returns the LColor::color associated with the LyX name. - LColor::color getFromLyXName(std::string const & lyxname) const; - /// \returns the LColor::color associated with the LaTeX name. - LColor::color getFromLaTeXName(std::string const & latexname) const; -private: - /// - void addColor(LColor::color c, std::string const & lyxname) const; - /// - class Pimpl; - /// - boost::scoped_ptr pimpl_; -}; - - -/** \c LColor_color is a wrapper for LColor::color. It can be forward-declared and - * passed as a function argument without having to expose LColor.h. - */ -class LColor_color { - LColor::color val_; -public: - /** The default constructor is nasty, - * but allows us to use LColor_color in STL containers. - */ - LColor_color() : val_(static_cast(-1)) {} - - LColor_color(LColor::color val) : val_(val) {} - operator LColor::color() const{ return val_; } -}; - - -/// the current color definitions -extern LColor lcolor; -/// the system color definitions -extern LColor system_lcolor; - - -} // namespace lyx - -#endif diff --git a/src/LaTeXFeatures.cpp b/src/LaTeXFeatures.cpp index 5daf5d6a2a..5dc426eecc 100644 --- a/src/LaTeXFeatures.cpp +++ b/src/LaTeXFeatures.cpp @@ -22,7 +22,7 @@ #include "Encoding.h" #include "Floating.h" #include "FloatList.h" -#include "LColor.h" +#include "Color.h" #include "Language.h" #include "Lexer.h" #include "lyx_sty.h" @@ -328,7 +328,7 @@ string const LaTeXFeatures::getPackages() const } // shadecolor for shaded if (mustProvide("framed")) { - RGBColor c = RGBColor(lcolor.getX11Name(LColor::shadedbg)); + RGBColor c = RGBColor(lcolor.getX11Name(Color::shadedbg)); packages << "\\definecolor{shadecolor}{rgb}{" << c.r/255 << ',' << c.g/255 << ',' << c.b/255 << "}\n"; } diff --git a/src/LyX.cpp b/src/LyX.cpp index 4e486c9d67..233fe40a01 100644 --- a/src/LyX.cpp +++ b/src/LyX.cpp @@ -30,7 +30,7 @@ #include "kb_keymap.h" #include "Language.h" #include "Session.h" -#include "LColor.h" +#include "Color.h" #include "lyx_cb.h" #include "LyXAction.h" #include "LyXFunc.h" diff --git a/src/LyXFont.cpp b/src/LyXFont.cpp index dd8dbb4d78..58cff9cbeb 100644 --- a/src/LyXFont.cpp +++ b/src/LyXFont.cpp @@ -20,7 +20,7 @@ #include "debug.h" #include "gettext.h" #include "Language.h" -#include "LColor.h" +#include "Color.h" #include "Lexer.h" #include "LyXRC.h" @@ -116,7 +116,7 @@ LyXFont::FontBits LyXFont::sane = { MEDIUM_SERIES, UP_SHAPE, SIZE_NORMAL, - LColor::none, + Color::none, OFF, OFF, OFF, @@ -128,7 +128,7 @@ LyXFont::FontBits LyXFont::inherit = { INHERIT_SERIES, INHERIT_SHAPE, INHERIT_SIZE, - LColor::inherit, + Color::inherit, INHERIT, INHERIT, INHERIT, @@ -140,7 +140,7 @@ LyXFont::FontBits LyXFont::ignore = { IGNORE_SERIES, IGNORE_SHAPE, IGNORE_SIZE, - LColor::ignore, + Color::ignore, IGNORE, IGNORE, IGNORE, @@ -198,9 +198,9 @@ LyXFont::LyXFont(LyXFont::FONT_INIT3, Language const * l) -LColor_color LyXFont::color() const +Color_color LyXFont::color() const { - return LColor::color(bits.color); + return Color::color(bits.color); } @@ -259,7 +259,7 @@ void LyXFont::setNoun(LyXFont::FONT_MISC_STATE n) } -void LyXFont::setColor(LColor_color c) +void LyXFont::setColor(Color_color c) { bits.color = int(c); } @@ -417,8 +417,8 @@ void LyXFont::update(LyXFont const & newfont, setLanguage(newfont.language()); if (newfont.color() == color() && toggleall) - setColor(LColor::inherit); // toggle 'back' - else if (newfont.color() != LColor::ignore) + setColor(Color::inherit); // toggle 'back' + else if (newfont.color() != Color::ignore) setColor(newfont.color()); } @@ -441,7 +441,7 @@ void LyXFont::reduce(LyXFont const & tmplt) if (noun() == tmplt.noun()) setNoun(INHERIT); if (color() == tmplt.color()) - setColor(LColor::inherit); + setColor(Color::inherit); } @@ -474,7 +474,7 @@ LyXFont & LyXFont::realize(LyXFont const & tmplt) if (bits.noun == INHERIT) bits.noun = tmplt.bits.noun; - if (bits.color == LColor::inherit) + if (bits.color == Color::inherit) bits.color = tmplt.bits.color; return *this; @@ -488,7 +488,7 @@ bool LyXFont::resolved() const shape() != INHERIT_SHAPE && size() != INHERIT_SIZE && emph() != INHERIT && underbar() != INHERIT && noun() != INHERIT && - color() != LColor::inherit); + color() != Color::inherit); } @@ -503,7 +503,7 @@ docstring const LyXFont::stateText(BufferParams * params) const os << _(GUIShapeNames[shape()]) << ", "; if (size() != INHERIT_SIZE) os << _(GUISizeNames[size()]) << ", "; - if (color() != LColor::inherit) + if (color() != Color::inherit) os << lcolor.getGUIName(color()) << ", "; if (emph() != INHERIT) os << bformat(_("Emphasis %1$s, "), @@ -791,7 +791,7 @@ int LyXFont::latexWriteStartChanges(odocstream & os, LyXFont const & base, count += strlen(LaTeXShapeNames[f.shape()]) + 2; env = true; //We have opened a new environment } - if (f.color() != LColor::inherit && f.color() != LColor::ignore) { + if (f.color() != Color::inherit && f.color() != Color::ignore) { os << "\\textcolor{" << from_ascii(lcolor.getLaTeXName(f.color())) << "}{"; @@ -859,7 +859,7 @@ int LyXFont::latexWriteEndChanges(odocstream & os, LyXFont const & base, ++count; env = true; // Size change need not bother about closing env. } - if (f.color() != LColor::inherit && f.color() != LColor::ignore) { + if (f.color() != Color::inherit && f.color() != Color::ignore) { os << '}'; ++count; env = true; // Size change need not bother about closing env. @@ -902,10 +902,10 @@ int LyXFont::latexWriteEndChanges(odocstream & os, LyXFont const & base, } -LColor_color LyXFont::realColor() const +Color_color LyXFont::realColor() const { - if (color() == LColor::none) - return LColor::foreground; + if (color() == Color::none) + return Color::foreground; return color(); } diff --git a/src/LyXFont.h b/src/LyXFont.h index 0ee54cf853..af9eed5a7c 100644 --- a/src/LyXFont.h +++ b/src/LyXFont.h @@ -15,7 +15,7 @@ #ifndef LYXFONT_H #define LYXFONT_H -#include "LColor.h" +#include "Color.h" #include "support/docstream.h" @@ -170,7 +170,7 @@ public: FONT_SHAPE shape; /// FONT_SIZE size; - /** We store the LColor::color value as an int to get LColor.h out + /** We store the Color::color value as an int to get Color.h out * of the header file. */ int color; @@ -223,7 +223,7 @@ public: /// FONT_MISC_STATE number() const { return bits.number; } /// - LColor_color color() const; + Color_color color() const; /// Language const * language() const { return lang; } /// @@ -242,7 +242,7 @@ public: void setUnderbar(LyXFont::FONT_MISC_STATE u); void setNoun(LyXFont::FONT_MISC_STATE n); void setNumber(LyXFont::FONT_MISC_STATE n); - void setColor(LColor_color c); + void setColor(Color_color c); void setLanguage(Language const * l); /// Set family after LyX text format @@ -314,7 +314,7 @@ public: docstring const stateText(BufferParams * params) const; /// - LColor_color realColor() const; + Color_color realColor() const; /// friend diff --git a/src/LyXFunc.cpp b/src/LyXFunc.cpp index c0386a2504..db3f8e2fc0 100644 --- a/src/LyXFunc.cpp +++ b/src/LyXFunc.cpp @@ -44,7 +44,7 @@ #include "Intl.h" #include "kb_keymap.h" #include "Language.h" -#include "LColor.h" +#include "Color.h" #include "Session.h" #include "LyX.h" #include "lyx_cb.h" @@ -1489,8 +1489,8 @@ void LyXFunc::dispatch(FuncRequest const & cmd) } bool const graphicsbg_changed = - (lyx_name == lcolor.getLyXName(LColor::graphicsbg) && - x11_name != lcolor.getX11Name(LColor::graphicsbg)); + (lyx_name == lcolor.getLyXName(Color::graphicsbg) && + x11_name != lcolor.getX11Name(Color::graphicsbg)); if (!lcolor.setColor(lyx_name, x11_name)) { setErrorMessage( diff --git a/src/LyXRC.cpp b/src/LyXRC.cpp index 307fd3f7d8..292d126d60 100644 --- a/src/LyXRC.cpp +++ b/src/LyXRC.cpp @@ -26,7 +26,7 @@ #include "Format.h" #include "gettext.h" #include "Session.h" -#include "LColor.h" +#include "Color.h" #include "Lexer.h" #include "LyXFont.h" #include "Mover.h" @@ -812,11 +812,11 @@ int LyXRC::read(Lexer & lexrc) break; } - LColor::color const col = + Color::color const col = lcolor.getFromLyXName(lyx_name); - if (col == LColor::none || - col == LColor::inherit || - col == LColor::ignore) + if (col == Color::none || + col == Color::inherit || + col == Color::ignore) break; if (!lcolor.setColor(col, x11_name)) { @@ -1586,8 +1586,8 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc) const << "#\n\n"; case RC_SET_COLOR: - for (int i = 0; i < LColor::ignore; ++i) { - LColor::color lc = static_cast(i); + for (int i = 0; i < Color::ignore; ++i) { + Color::color lc = static_cast(i); string const col(lcolor.getX11Name(lc)); if (ignore_system_lyxrc || diff --git a/src/LyXText.h b/src/LyXText.h index 9b861bc9f5..aeb8ed6a92 100644 --- a/src/LyXText.h +++ b/src/LyXText.h @@ -35,7 +35,7 @@ class ErrorList; class FuncRequest; class FuncStatus; class InsetBase; -class LColor_color; +class Color_color; class Cursor; class PainterInfo; class Row; @@ -296,7 +296,7 @@ public: LyXFont const & Font) const; /// return the color of the canvas - LColor_color backgroundColor() const; + Color_color backgroundColor() const; /** * Returns the left beginning of the text. diff --git a/src/Makefile.am b/src/Makefile.am index 016a3de6c1..9751daab06 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -88,8 +88,8 @@ lyx_SOURCES = \ FuncStatus.h \ InsetList.cpp \ InsetList.h \ - LColor.cpp \ - LColor.h \ + Color.cpp \ + Color.h \ LaTeX.cpp \ LaTeX.h \ LaTeXFeatures.cpp \ diff --git a/src/MetricsInfo.cpp b/src/MetricsInfo.cpp index 679dd91904..aa02dee9a6 100644 --- a/src/MetricsInfo.cpp +++ b/src/MetricsInfo.cpp @@ -11,7 +11,7 @@ #include #include "BufferView.h" -#include "LColor.h" +#include "Color.h" #include "MetricsInfo.h" #include "mathed/MathSupport.h" diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp index 4c16a4fdb1..d661e6ea0c 100644 --- a/src/Paragraph.cpp +++ b/src/Paragraph.cpp @@ -27,7 +27,7 @@ #include "gettext.h" #include "Language.h" #include "LaTeXFeatures.h" -#include "LColor.h" +#include "Color.h" #include "LyXLength.h" #include "LyXFont.h" #include "LyXRC.h" @@ -969,13 +969,13 @@ void Paragraph::Pimpl::validate(LaTeXFeatures & features, << endl; } switch (fcit->font().color()) { - case LColor::none: - case LColor::inherit: - case LColor::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 LColor::latex: - case LColor::note: + case Color::latex: + case Color::note: break; default: features.require("color"); diff --git a/src/TextMetrics.cpp b/src/TextMetrics.cpp index 97f7fbab88..6720555da3 100644 --- a/src/TextMetrics.cpp +++ b/src/TextMetrics.cpp @@ -28,7 +28,7 @@ #include "debug.h" #include "FuncRequest.h" #include "FontIterator.h" -#include "LColor.h" +#include "Color.h" #include "LyXLength.h" #include "LyXRC.h" #include "LyXText.h" diff --git a/src/bufferview_funcs.cpp b/src/bufferview_funcs.cpp index 2dda2498e4..86a1f17b97 100644 --- a/src/bufferview_funcs.cpp +++ b/src/bufferview_funcs.cpp @@ -24,7 +24,7 @@ #include "CoordCache.h" #include "gettext.h" #include "Language.h" -#include "LColor.h" +#include "Color.h" #include "Lexer.h" #include "Row.h" #include "Paragraph.h" @@ -130,7 +130,7 @@ bool string2font(string const & data, LyXFont & font, bool & toggle) } else if (token == "color") { int const next = lex.getInteger(); - font.setColor(LColor::color(next)); + font.setColor(Color::color(next)); } else if (token == "language") { string const next = lex.getString(); diff --git a/src/color.cpp b/src/color.cpp index 125de64fad..1722b8b5b1 100644 --- a/src/color.cpp +++ b/src/color.cpp @@ -12,7 +12,7 @@ #include "color.h" -#include "LColor.h" +#include "Color.h" #include #include diff --git a/src/factory.cpp b/src/factory.cpp index 242a4fd2fa..3337399431 100644 --- a/src/factory.cpp +++ b/src/factory.cpp @@ -18,7 +18,7 @@ #include "debug.h" #include "FloatList.h" #include "FuncRequest.h" -#include "LColor.h" +#include "Color.h" #include "Lexer.h" #include "LyX.h" #include "Paragraph.h" @@ -211,7 +211,7 @@ InsetBase * createInset(BufferView * bv, FuncRequest const & cmd) auto_ptr inset(new InsetCaption(params)); inset->setAutoBreakRows(true); inset->setDrawFrame(true); - inset->setFrameColor(LColor::captionframe); + inset->setFrameColor(Color::captionframe); return inset.release(); } diff --git a/src/frontends/Application.h b/src/frontends/Application.h index 779542f34f..f64ee45fc4 100644 --- a/src/frontends/Application.h +++ b/src/frontends/Application.h @@ -19,7 +19,7 @@ namespace lyx { class BufferView; class LyXView; -class LColor_color; +class Color_color; struct RGBColor; namespace frontend { @@ -145,17 +145,17 @@ public: * The function returns true if successful. * It returns false on failure and sets r, g, b to 0. */ - virtual bool getRgbColor(LColor_color col, RGBColor & rgbcol) = 0; + virtual bool getRgbColor(Color_color col, RGBColor & rgbcol) = 0; - /** Eg, passing LColor::black returns "000000", - * passing LColor::white returns "ffffff". + /** Eg, passing Color::black returns "000000", + * passing Color::white returns "ffffff". */ - virtual std::string const hexName(LColor_color col) = 0; + virtual std::string const hexName(Color_color col) = 0; /** * update an altered GUI color */ - virtual void updateColor(LColor_color col) = 0; + virtual void updateColor(Color_color col) = 0; /** * add a callback for socket read notification diff --git a/src/frontends/Painter.cpp b/src/frontends/Painter.cpp index 772eada114..06f46e2d3e 100644 --- a/src/frontends/Painter.cpp +++ b/src/frontends/Painter.cpp @@ -15,7 +15,7 @@ #include "frontends/FontMetrics.h" -#include "LColor.h" +#include "Color.h" #include "LyXFont.h" using lyx::docstring; @@ -29,27 +29,27 @@ namespace frontend { void Painter::button(int x, int y, int w, int h, bool mouseHover) { if (mouseHover) - fillRectangle(x, y, w, h, LColor::buttonhoverbg); + fillRectangle(x, y, w, h, Color::buttonhoverbg); else - fillRectangle(x, y, w, h, LColor::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, LColor::buttonframe); - line(x - 1 + w, y, x - 1 + w, y + h - 1, LColor::buttonframe); - line(x, y - 1, x - 1 + w, y - 1, LColor::buttonframe); - line(x, y + h - 1, x - 1 + w, y + h - 1, LColor::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, LyXFont const & font, - LColor_color back, - LColor_color frame) + Color_color back, + Color_color frame) { int width; int ascent; @@ -58,11 +58,11 @@ void Painter::rectText(int x, int y, FontMetrics const & fm = theFontMetrics(font); fm.rectText(str, width, ascent, descent); - if (back != LColor::none) + if (back != Color::none) fillRectangle(x + 1, y - ascent + 1, width - 1, ascent + descent - 1, back); - if (frame != LColor::none) + if (frame != Color::none) rectangle(x, y - ascent, width, ascent + descent, frame); text(x + 3, y, str, font); @@ -97,17 +97,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, LColor::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, LColor::black); - temp_font.setColor(LColor::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, LColor::background); + fillRectangle(x, y - height + 1, width, height, Color::background); underline(font, x, y - descent + 1, width); break; } diff --git a/src/frontends/Painter.h b/src/frontends/Painter.h index 0ac00c4715..bc67d27ff6 100644 --- a/src/frontends/Painter.h +++ b/src/frontends/Painter.h @@ -17,7 +17,7 @@ namespace lyx { -class LColor_color; +class Color_color; class LyXFont; namespace graphics { class Image; } @@ -80,7 +80,7 @@ public: virtual void line( int x1, int y1, int x2, int y2, - LColor_color, + Color_color, line_style = line_solid, line_width = line_thin) = 0; @@ -94,7 +94,7 @@ public: int const * xp, int const * yp, int np, - LColor_color, + Color_color, line_style = line_solid, line_width = line_thin) = 0; @@ -102,7 +102,7 @@ public: virtual void rectangle( int x, int y, int w, int h, - LColor_color, + Color_color, line_style = line_solid, line_width = line_thin) = 0; @@ -110,19 +110,19 @@ public: virtual void fillRectangle( int x, int y, int w, int h, - LColor_color) = 0; + Color_color) = 0; /// draw an arc virtual void arc( int x, int y, unsigned int w, unsigned int h, int a1, int a2, - LColor_color) = 0; + Color_color) = 0; /// draw a pixel virtual void point( int x, int y, - LColor_color) = 0; + Color_color) = 0; /// draw a filled rectangle with the shape of a 3D button virtual void button(int x, int y, @@ -158,8 +158,8 @@ public: void rectText(int x, int baseline, docstring const & str, LyXFont const & font, - LColor_color back, - LColor_color frame); + Color_color back, + Color_color frame); /// draw a string and enclose it inside a button frame void buttonText(int x, int baseline, docstring const & s, diff --git a/src/frontends/WorkArea.cpp b/src/frontends/WorkArea.cpp index d9040e493d..c428821135 100644 --- a/src/frontends/WorkArea.cpp +++ b/src/frontends/WorkArea.cpp @@ -29,7 +29,7 @@ #include "Cursor.h" #include "debug.h" #include "Language.h" -#include "LColor.h" +#include "Color.h" #include "LyXFont.h" #include "LyXRC.h" #include "Row.h" diff --git a/src/frontends/controllers/ChangeLog b/src/frontends/controllers/ChangeLog index 47ccd4d1da..9060c41502 100644 --- a/src/frontends/controllers/ChangeLog +++ b/src/frontends/controllers/ChangeLog @@ -572,7 +572,7 @@ * ControlBranch.[Ch] (branchlist): new member function. * ControlDocument.C (setBranchColor): removed. - (apply): update LColor to accommodate the new BranchList colors. + (apply): update Color to accommodate the new BranchList colors. 2003-12-14 Jürgen Spitzmüller @@ -720,28 +720,28 @@ * ControlCharacter.h: * ControlPrefs.C: * ControlPrefs.h: - * character.h: rename EnumLColor as LColor_color. + * character.h: rename EnumColor as Color_color. 2003-09-16 Angus Leeming - * ControlCharacter.C: add #include "LColor.h". + * ControlCharacter.C: add #include "Color.h". 2003-09-16 Angus Leeming - * character.C: add #include "LColor.h". + * character.C: add #include "Color.h". 2003-09-15 Angus Leeming * ControlCharacter.C (setColor, getColor): - pass EnumLColor args, rather than LColor::color ones. + pass EnumColor args, rather than Color::color ones. - * ControlPrefs.C: add #include "LColor.h". - * ControlPrefs.h:remove #include "LColor.h". + * ControlPrefs.C: add #include "Color.h". + * ControlPrefs.h:remove #include "Color.h". - * ControlPrefs.[Ch] (setColor): pass EnumLColor arg, not than LColor::color one. + * ControlPrefs.[Ch] (setColor): pass EnumColor arg, not than Color::color one. - * character.h:remove #include "LColor.h". - typedef ColorPair as a std::pair. + * character.h:remove #include "Color.h". + typedef ColorPair as a std::pair. 2003-09-15 Lars Gullik Bjønnes @@ -808,7 +808,7 @@ and have a "display colour" to distinguish them on-screen. ColorHandler was somewhat cleaned up. - (1) make possible a dynamically growing LColor list by allowing + (1) make possible a dynamically growing Color list by allowing the graphic context cache to grow along (vector); (2) eliminate an IMHO unnecessary step in colour allocation. diff --git a/src/frontends/controllers/ControlCharacter.cpp b/src/frontends/controllers/ControlCharacter.cpp index 76fe57ec07..b5dd7fe67a 100644 --- a/src/frontends/controllers/ControlCharacter.cpp +++ b/src/frontends/controllers/ControlCharacter.cpp @@ -18,7 +18,7 @@ #include "bufferview_funcs.h" #include "FuncRequest.h" #include "Language.h" -#include "LColor.h" +#include "Color.h" using lyx::bv_funcs::font2string; using std::string; @@ -44,7 +44,7 @@ bool ControlCharacter::initialiseParams(string const &) getShape() != LyXFont::IGNORE_SHAPE || getSize() != LyXFont::IGNORE_SIZE || getBar() != IGNORE || - getColor() != LColor::ignore || + getColor() != Color::ignore || font_->language() != ignore_language) dialog().bc().valid(); @@ -178,29 +178,29 @@ void ControlCharacter::setBar(FONT_STATE val) } -LColor_color ControlCharacter::getColor() const +Color_color ControlCharacter::getColor() const { if (!font_.get()) - return LColor::ignore; + return Color::ignore; return font_->color(); } -void ControlCharacter::setColor(LColor_color val) +void ControlCharacter::setColor(Color_color val) { switch (val) { - case LColor::ignore: - case LColor::none: - case LColor::black: - case LColor::white: - case LColor::red: - case LColor::green: - case LColor::blue: - case LColor::cyan: - case LColor::magenta: - case LColor::yellow: - case LColor::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: diff --git a/src/frontends/controllers/ControlCharacter.h b/src/frontends/controllers/ControlCharacter.h index 66313459b8..fa40fccd4a 100644 --- a/src/frontends/controllers/ControlCharacter.h +++ b/src/frontends/controllers/ControlCharacter.h @@ -19,7 +19,7 @@ namespace lyx { -class LColor_color; +class Color_color; namespace frontend { @@ -49,7 +49,7 @@ public: /// void setBar(FONT_STATE); /// - void setColor(LColor_color); + void setColor(Color_color); /// void setLanguage(std::string const &); /// @@ -66,7 +66,7 @@ public: /// FONT_STATE getBar() const; /// - LColor_color getColor() const; + Color_color getColor() const; /// std::string getLanguage() const; /// diff --git a/src/frontends/controllers/ControlDocument.cpp b/src/frontends/controllers/ControlDocument.cpp index c25b84809f..cbffe910ba 100644 --- a/src/frontends/controllers/ControlDocument.cpp +++ b/src/frontends/controllers/ControlDocument.cpp @@ -22,7 +22,7 @@ #include "gettext.h" #include "Language.h" #include "LaTeXFeatures.h" -#include "LColor.h" +#include "Color.h" #include "OutputParams.h" #include "LyXTextClassList.h" #include "tex-strings.h" diff --git a/src/frontends/controllers/ControlPrefs.cpp b/src/frontends/controllers/ControlPrefs.cpp index ddc76f7c0d..7a20255e35 100644 --- a/src/frontends/controllers/ControlPrefs.cpp +++ b/src/frontends/controllers/ControlPrefs.cpp @@ -19,7 +19,7 @@ #include "gettext.h" #include "FuncRequest.h" #include "paper.h" -#include "LColor.h" +#include "Color.h" #include "support/FileFilterList.h" @@ -92,7 +92,7 @@ void ControlPrefs::dispatchParams() } -void ControlPrefs::setColor(LColor_color col, string const & hex) +void ControlPrefs::setColor(Color_color col, string const & hex) { colors_.push_back(lcolor.getLyXName(col) + ' ' + hex); } diff --git a/src/frontends/controllers/ControlPrefs.h b/src/frontends/controllers/ControlPrefs.h index 2deabd74f9..205fa0be3f 100644 --- a/src/frontends/controllers/ControlPrefs.h +++ b/src/frontends/controllers/ControlPrefs.h @@ -23,7 +23,7 @@ namespace lyx { -class LColor_color; +class Color_color; namespace frontend { @@ -66,7 +66,7 @@ public: docstring const & title) const; /// set a color - void setColor(LColor_color col, std::string const & hex); + void setColor(Color_color col, std::string const & hex); /// update the screen fonts after change void updateScreenFonts(); diff --git a/src/frontends/controllers/frontend_helpers.cpp b/src/frontends/controllers/frontend_helpers.cpp index 352701a6ee..3034cddc81 100644 --- a/src/frontends/controllers/frontend_helpers.cpp +++ b/src/frontends/controllers/frontend_helpers.cpp @@ -25,7 +25,7 @@ #include #include -#include "LColor.h" +#include "Color.h" #include "frontends/FileDialog.h" #include "frontends/Alert.h" @@ -1050,47 +1050,47 @@ vector const getColorData() ColorPair pr; pr.first = _("No change"); - pr.second = LColor::ignore; + pr.second = Color::ignore; color[0] = pr; pr.first = _("No color"); - pr.second = LColor::none; + pr.second = Color::none; color[1] = pr; pr.first = _("Black"); - pr.second = LColor::black; + pr.second = Color::black; color[2] = pr; pr.first = _("White"); - pr.second = LColor::white; + pr.second = Color::white; color[3] = pr; pr.first = _("Red"); - pr.second = LColor::red; + pr.second = Color::red; color[4] = pr; pr.first = _("Green"); - pr.second = LColor::green; + pr.second = Color::green; color[5] = pr; pr.first = _("Blue"); - pr.second = LColor::blue; + pr.second = Color::blue; color[6] = pr; pr.first = _("Cyan"); - pr.second = LColor::cyan; + pr.second = Color::cyan; color[7] = pr; pr.first = _("Magenta"); - pr.second = LColor::magenta; + pr.second = Color::magenta; color[8] = pr; pr.first = _("Yellow"); - pr.second = LColor::yellow; + pr.second = Color::yellow; color[9] = pr; pr.first = _("Reset"); - pr.second = LColor::inherit; + pr.second = Color::inherit; color[10] = pr; return color; diff --git a/src/frontends/controllers/frontend_helpers.h b/src/frontends/controllers/frontend_helpers.h index 8a835bc1c4..886061f8ee 100644 --- a/src/frontends/controllers/frontend_helpers.h +++ b/src/frontends/controllers/frontend_helpers.h @@ -174,7 +174,7 @@ getAuthorYearStrings(std::string const & key, } // namespace lyx -class LColor_color; +class Color_color; /** Functions of use to the character GUI controller and view */ @@ -206,7 +206,7 @@ typedef std::pair SizePair; /// typedef std::pair BarPair; /// -typedef std::pair ColorPair; +typedef std::pair ColorPair; /// std::vector const getFamilyData(); diff --git a/src/frontends/qt4/ChangeLog b/src/frontends/qt4/ChangeLog index a7244d0e09..534eb13f0b 100644 --- a/src/frontends/qt4/ChangeLog +++ b/src/frontends/qt4/ChangeLog @@ -759,7 +759,7 @@ 2004-11-17 Lars Gullik Bjønnes - * QPrefsDialog.h: include LColor.h to satisfy concept checks. + * QPrefsDialog.h: include Color.h to satisfy concept checks. * lcolorcache.h: ditto 2004-11-15 Jean-Marc Lasgouttes @@ -1034,7 +1034,7 @@ 2004-05-02 Angus Leeming * QLPainter.C (image): set the background colour to - LColor::graphicsbg. + Color::graphicsbg. * QLImage.C (setPixmap_impl): remove commented out xforms code to set pixmap background colour. @@ -1658,7 +1658,7 @@ * QPrefsDialog.h: * lcolorcache.C: * lcolorcache.h: - * lyx_gui.C: rename EnumLColor as LColor_color. + * lyx_gui.C: rename EnumColor as Color_color. 2003-09-16 Angus Leeming @@ -1667,27 +1667,27 @@ 2003-09-16 Angus Leeming - * QCharacter.C, QPrefs.C, lyx_gui.C: add #include "LColor.h". + * QCharacter.C, QPrefs.C, lyx_gui.C: add #include "Color.h". 2003-09-15 Angus Leeming - * QLPainter.C: add #include "LColor.h". + * QLPainter.C: add #include "Color.h". * QLPainter.[Ch] (setPen, point, line, lines, rectangle, fillPolygon, arc): - pass EnumLColor args, rather than LColor::color ones. + pass EnumColor args, rather than Color::color ones. - * QPrefsDialog.C: add #include "LColor.h". - * QPrefsDialog.h: remove #include "LColor.h". Store a vector colors_; + * QPrefsDialog.C: add #include "Color.h". + * QPrefsDialog.h: remove #include "Color.h". Store a vector colors_; - * QWorkArea.C: add #include "LColor.h". + * QWorkArea.C: add #include "Color.h". - * lcolorcache.C: add #include "LColor.h". - * lcolorcache.h: store a map. - * lcolorcache.[Ch] (get):pass EnumLColor args, rather than LColor::color ones. + * lcolorcache.C: add #include "Color.h". + * lcolorcache.h: store a map. + * lcolorcache.[Ch] (get):pass EnumColor args, rather than Color::color ones. - * qscreen.C: add #include "LColor.h". + * qscreen.C: add #include "Color.h". - * lyx_gui.C (hexname, update_color): pass EnumLColor args, rather - than LColor::color ones. + * lyx_gui.C (hexname, update_color): pass EnumColor args, rather + than Color::color ones. 2003-09-15 Angus Leeming @@ -2129,7 +2129,7 @@ * Makefile.am: * lcolorcache.h: - * lcolorcache.C: add LColor::color -> QColor cache + * lcolorcache.C: add Color::color -> QColor cache * QLPainter.C: * QPrefs.C: @@ -3394,7 +3394,7 @@ 2002-11-25 John Levon - * qscreen.C: use LColor::cursor properly + * qscreen.C: use Color::cursor properly * QPrefs.C: * ui/QPrefKeyboardModule.ui: diff --git a/src/frontends/qt4/ColorCache.cpp b/src/frontends/qt4/ColorCache.cpp index dca532b868..7c5127d9f2 100644 --- a/src/frontends/qt4/ColorCache.cpp +++ b/src/frontends/qt4/ColorCache.cpp @@ -13,7 +13,7 @@ #include "color.h" #include "ColorCache.h" -#include "LColor.h" +#include "Color.h" namespace lyx { @@ -24,7 +24,7 @@ const QColor grey80(0xcc, 0xcc, 0xcc); const QColor grey90(0xe5, 0xe5, 0xe5); const QColor none = Qt::black; -QColor const & ColorCache::get(LColor_color col) const +QColor const & ColorCache::get(Color_color col) const { lcolor_map::const_iterator cit = colormap.find(col); if (cit != colormap.end()) diff --git a/src/frontends/qt4/ColorCache.h b/src/frontends/qt4/ColorCache.h index 0604061537..05dabea4b0 100644 --- a/src/frontends/qt4/ColorCache.h +++ b/src/frontends/qt4/ColorCache.h @@ -12,7 +12,7 @@ #ifndef COLORCACHE_H #define COLORCACHE_H -#include "LColor.h" +#include "Color.h" #include @@ -26,20 +26,20 @@ struct RGBColor; // FIXME: use a fixed-size array not a map ? /** - * Cache from LColor to QColor. + * Cache from Color to QColor. */ class ColorCache { public: ColorCache() {} /// get the given color - QColor const & get(LColor_color color) const; + QColor const & get(Color_color color) const; /// clear all colors void clear(); private: - typedef std::map lcolor_map; + typedef std::map lcolor_map; mutable lcolor_map colormap; }; diff --git a/src/frontends/qt4/GuiApplication.cpp b/src/frontends/qt4/GuiApplication.cpp index c6749688f1..971cf53e9e 100644 --- a/src/frontends/qt4/GuiApplication.cpp +++ b/src/frontends/qt4/GuiApplication.cpp @@ -248,7 +248,7 @@ void GuiApplication::syncEvents() } -bool GuiApplication::getRgbColor(LColor_color col, +bool GuiApplication::getRgbColor(Color_color col, RGBColor & rgbcol) { QColor const & qcol = color_cache_.get(col); @@ -265,13 +265,13 @@ bool GuiApplication::getRgbColor(LColor_color col, } -string const GuiApplication::hexName(LColor_color col) +string const GuiApplication::hexName(Color_color col) { return lyx::support::ltrim(fromqstr(color_cache_.get(col).name()), "#"); } -void GuiApplication::updateColor(LColor_color) +void GuiApplication::updateColor(Color_color) { // FIXME: Bleh, can't we just clear them all at once ? color_cache_.clear(); diff --git a/src/frontends/qt4/GuiApplication.h b/src/frontends/qt4/GuiApplication.h index ab2f1583ef..10711794ec 100644 --- a/src/frontends/qt4/GuiApplication.h +++ b/src/frontends/qt4/GuiApplication.h @@ -63,9 +63,9 @@ public: virtual std::string const romanFontName(); virtual std::string const sansFontName(); virtual std::string const typewriterFontName(); - virtual bool getRgbColor(LColor_color col, RGBColor & rgbcol); - virtual std::string const hexName(LColor_color col); - virtual void updateColor(LColor_color col); + virtual bool getRgbColor(Color_color col, RGBColor & rgbcol); + virtual std::string const hexName(Color_color col); + virtual void updateColor(Color_color col); virtual void registerSocketCallback( int fd, boost::function func); void unregisterSocketCallback(int fd); diff --git a/src/frontends/qt4/GuiWorkArea.cpp b/src/frontends/qt4/GuiWorkArea.cpp index 0b383c7bd6..ff6764ec60 100644 --- a/src/frontends/qt4/GuiWorkArea.cpp +++ b/src/frontends/qt4/GuiWorkArea.cpp @@ -24,7 +24,7 @@ #include "rowpainter.h" #include "debug.h" #include "FuncRequest.h" -#include "LColor.h" +#include "Color.h" #include "version.h" #include "LyXRC.h" @@ -129,7 +129,7 @@ public: void update(int x, int y, int h, CursorShape shape) { - color_ = guiApp->colorCache().get(LColor::cursor); + color_ = guiApp->colorCache().get(Color::cursor); rect_ = QRect(x, y, CursorWidth, h); shape_ = shape; } @@ -458,7 +458,7 @@ void GuiWorkArea::update(int x, int y, int w, int h) void GuiWorkArea::doGreyOut(QLPainter & pain) { pain.fillRectangle(0, 0, width(), height(), - LColor::bottomarea); + Color::bottomarea); //if (!lyxrc.show_banner) // return; diff --git a/src/frontends/qt4/QCharacter.cpp b/src/frontends/qt4/QCharacter.cpp index 86eb85f306..44cb05889c 100644 --- a/src/frontends/qt4/QCharacter.cpp +++ b/src/frontends/qt4/QCharacter.cpp @@ -16,7 +16,7 @@ #include "Qt2BC.h" #include "qt_helpers.h" -#include "LColor.h" +#include "Color.h" #include diff --git a/src/frontends/qt4/QLPainter.cpp b/src/frontends/qt4/QLPainter.cpp index 91f9571a0f..3c26f71c60 100644 --- a/src/frontends/qt4/QLPainter.cpp +++ b/src/frontends/qt4/QLPainter.cpp @@ -24,7 +24,7 @@ #include "debug.h" #include "Language.h" -#include "LColor.h" +#include "Color.h" #include "support/unicode.h" @@ -38,7 +38,7 @@ QLPainter::QLPainter(QPaintDevice * device) : QPainter(device), Painter() { // new QPainter has default QPen: - current_color_ = LColor::black; + current_color_ = Color::black; current_ls_ = line_solid; current_lw_ = line_thin; } @@ -51,7 +51,7 @@ QLPainter::~QLPainter() } -void QLPainter::setQPainterPen(LColor_color col, +void QLPainter::setQPainterPen(Color_color col, Painter::line_style ls, Painter::line_width lw) { if (col == current_color_ && ls == current_ls_ && lw == current_lw_) @@ -79,7 +79,7 @@ void QLPainter::setQPainterPen(LColor_color col, } -void QLPainter::point(int x, int y, LColor_color col) +void QLPainter::point(int x, int y, Color_color col) { if (!isDrawingEnabled()) return; @@ -90,7 +90,7 @@ void QLPainter::point(int x, int y, LColor_color col) void QLPainter::line(int x1, int y1, int x2, int y2, - LColor_color col, + Color_color col, line_style ls, line_width lw) { @@ -105,7 +105,7 @@ void QLPainter::line(int x1, int y1, int x2, int y2, void QLPainter::lines(int const * xp, int const * yp, int np, - LColor_color col, + Color_color col, line_style ls, line_width lw) { @@ -133,7 +133,7 @@ void QLPainter::lines(int const * xp, int const * yp, int np, void QLPainter::rectangle(int x, int y, int w, int h, - LColor_color col, + Color_color col, line_style ls, line_width lw) { @@ -145,14 +145,14 @@ void QLPainter::rectangle(int x, int y, int w, int h, } -void QLPainter::fillRectangle(int x, int y, int w, int h, LColor_color col) +void QLPainter::fillRectangle(int x, int y, int w, int h, Color_color col) { fillRect(x, y, w, h, guiApp->colorCache().get(col)); } void QLPainter::arc(int x, int y, unsigned int w, unsigned int h, - int a1, int a2, LColor_color col) + int a1, int a2, Color_color col) { if (!isDrawingEnabled()) return; @@ -170,7 +170,7 @@ void QLPainter::image(int x, int y, int w, int h, graphics::Image const & i) graphics::QLImage const & qlimage = static_cast(i); - fillRectangle(x, y, w, h, LColor::graphicsbg); + fillRectangle(x, y, w, h, Color::graphicsbg); if (!isDrawingEnabled()) return; diff --git a/src/frontends/qt4/QLPainter.h b/src/frontends/qt4/QLPainter.h index 5a5c72d814..d86f3fa429 100644 --- a/src/frontends/qt4/QLPainter.h +++ b/src/frontends/qt4/QLPainter.h @@ -15,7 +15,7 @@ #include "frontends/Painter.h" -#include "LColor.h" +#include "Color.h" #include @@ -39,7 +39,7 @@ public: virtual void line( int x1, int y1, int x2, int y2, - LColor_color, + Color_color, line_style = line_solid, line_width = line_thin); @@ -53,7 +53,7 @@ public: int const * xp, int const * yp, int np, - LColor_color, + Color_color, line_style = line_solid, line_width = line_thin); @@ -61,7 +61,7 @@ public: virtual void rectangle( int x, int y, int w, int h, - LColor_color, + Color_color, line_style = line_solid, line_width = line_thin); @@ -69,19 +69,19 @@ public: virtual void fillRectangle( int x, int y, int w, int h, - LColor_color); + Color_color); /// draw an arc virtual void arc( int x, int y, unsigned int w, unsigned int h, int a1, int a2, - LColor_color); + Color_color); /// draw a pixel virtual void point( int x, int y, - LColor_color); + Color_color); /// draw an image from the image cache virtual void image(int x, int y, @@ -104,11 +104,11 @@ private: QString const & str, LyXFont const & f); /// set pen parameters - void setQPainterPen(LColor_color col, + void setQPainterPen(Color_color col, line_style ls = line_solid, line_width lw = line_thin); - LColor::color current_color_; + Color::color current_color_; Painter::line_style current_ls_; Painter::line_width current_lw_; }; diff --git a/src/frontends/qt4/QPrefs.cpp b/src/frontends/qt4/QPrefs.cpp index 50879fdc83..3ebc19e20b 100644 --- a/src/frontends/qt4/QPrefs.cpp +++ b/src/frontends/qt4/QPrefs.cpp @@ -18,7 +18,7 @@ #include "Session.h" #include "debug.h" -#include "LColor.h" +#include "Color.h" #include "LyXFont.h" #include "PanelStack.h" #include "QFontExample.h" @@ -517,19 +517,19 @@ PrefColors::PrefColors(QPrefs * form, QWidget * parent) // FIXME: all of this initialization should be put into the controller. // See http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg113301.html // for some discussion of why that is not trivial. - for (int i = 0; i < LColor::ignore; ++i) { - LColor::color lc = static_cast(i); - if (lc == LColor::none - || lc == LColor::black - || lc == LColor::white - || lc == LColor::red - || lc == LColor::green - || lc == LColor::blue - || lc == LColor::cyan - || lc == LColor::magenta - || lc == LColor::yellow - || lc == LColor::inherit - || lc == LColor::ignore) continue; + for (int i = 0; i < Color::ignore; ++i) { + Color::color lc = static_cast(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); QColor color = QColor(guiApp->colorCache().get(lc)); diff --git a/src/frontends/qt4/QPrefs.h b/src/frontends/qt4/QPrefs.h index 126ca986aa..6efdcadbdc 100644 --- a/src/frontends/qt4/QPrefs.h +++ b/src/frontends/qt4/QPrefs.h @@ -14,7 +14,7 @@ #include "QDialogView.h" -#include "LColor.h" +#include "Color.h" #include "LyXRC.h" #include "ui/PrefsUi.h" @@ -158,7 +158,7 @@ private Q_SLOTS: void change_color(); private: - std::vector lcolors_; + std::vector 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. diff --git a/src/graphics/PreviewLoader.cpp b/src/graphics/PreviewLoader.cpp index b0995aa159..d80df9d825 100644 --- a/src/graphics/PreviewLoader.cpp +++ b/src/graphics/PreviewLoader.cpp @@ -19,7 +19,7 @@ #include "debug.h" #include "Format.h" #include "InsetIterator.h" -#include "LColor.h" +#include "Color.h" #include "LyXRC.h" #include "OutputParams.h" #include "Paragraph.h" @@ -592,8 +592,8 @@ void PreviewLoader::Impl::startLoading() cs << pconverter_->command << ' ' << pconverter_->to << ' ' << support::quoteName(latexfile.toFilesystemEncoding()) << ' ' << int(font_scaling_factor_) << ' ' - << theApp()->hexName(LColor::preview) << ' ' - << theApp()->hexName(LColor::background); + << theApp()->hexName(Color::preview) << ' ' + << theApp()->hexName(Color::background); string const command = support::libScriptSearch(cs.str()); diff --git a/src/insets/InsetBase.cpp b/src/insets/InsetBase.cpp index 47ca76f198..8512c49585 100644 --- a/src/insets/InsetBase.cpp +++ b/src/insets/InsetBase.cpp @@ -15,7 +15,7 @@ #include "Buffer.h" #include "CoordCache.h" #include "BufferView.h" -#include "LColor.h" +#include "Color.h" #include "Cursor.h" #include "debug.h" #include "Dimension.h" @@ -109,7 +109,7 @@ static TranslatorMap const build_translator() /// pretty arbitrary dimensions -InsetBase::InsetBase(): dim_(10, 10, 10), background_color_(LColor::background) +InsetBase::InsetBase(): dim_(10, 10, 10), background_color_(Color::background) {} @@ -286,8 +286,8 @@ void InsetBase::metricsMarkers2(Dimension & dim, int framesize) const void InsetBase::drawMarkers(PainterInfo & pi, int x, int y) const { - LColor::color pen_color = editing(pi.base.bv)? - LColor::mathframe : LColor::background; + Color::color pen_color = editing(pi.base.bv)? + Color::mathframe : Color::background; int const t = x + width() - 1; int const d = y + descent(); @@ -301,8 +301,8 @@ void InsetBase::drawMarkers(PainterInfo & pi, int x, int y) const void InsetBase::drawMarkers2(PainterInfo & pi, int x, int y) const { - LColor::color pen_color = editing(pi.base.bv)? - LColor::mathframe : LColor::background; + Color::color pen_color = editing(pi.base.bv)? + Color::mathframe : Color::background; drawMarkers(pi, x, y); int const t = x + width() - 1; @@ -355,15 +355,15 @@ void InsetBase::dump() const } -void InsetBase::setBackgroundColor(LColor_color color) +void InsetBase::setBackgroundColor(Color_color color) { background_color_ = color; } -LColor_color InsetBase::backgroundColor() const +Color_color InsetBase::backgroundColor() const { - return LColor::color(background_color_); + return Color::color(background_color_); } diff --git a/src/insets/InsetBase.h b/src/insets/InsetBase.h index 7aa01806ab..27083cdee8 100644 --- a/src/insets/InsetBase.h +++ b/src/insets/InsetBase.h @@ -31,7 +31,7 @@ class FuncStatus; class InsetMath; class InsetText; class LaTeXFeatures; -class LColor_color; +class Color_color; class Cursor; class Lexer; class LyXText; @@ -446,9 +446,9 @@ public: /// int scroll() const { return 0; } /// - void setBackgroundColor(LColor_color); + void setBackgroundColor(Color_color); /// - LColor_color backgroundColor() const; + Color_color backgroundColor() const; /// enum CollapseStatus { Collapsed, @@ -477,7 +477,7 @@ protected: mutable Dimension dim_; private: virtual std::auto_ptr doClone() const = 0; - /** We store the LColor::color value as an int to get LColor.h out + /** We store the Color::color value as an int to get Color.h out * of the header file. */ int background_color_; diff --git a/src/insets/InsetBox.cpp b/src/insets/InsetBox.cpp index 91fccc3948..cec9123660 100644 --- a/src/insets/InsetBox.cpp +++ b/src/insets/InsetBox.cpp @@ -22,7 +22,7 @@ #include "FuncRequest.h" #include "gettext.h" #include "LaTeXFeatures.h" -#include "LColor.h" +#include "Color.h" #include "Lexer.h" #include "MetricsInfo.h" #include "Paragraph.h" @@ -164,8 +164,8 @@ void InsetBox::setButtonLabel() setLabel(label); - font.setColor(LColor::foreground); - setBackgroundColor(LColor::background); + font.setColor(Color::foreground); + setBackgroundColor(Color::background); setLabelFont(font); } diff --git a/src/insets/InsetBranch.cpp b/src/insets/InsetBranch.cpp index 29f19e9ba7..38e32e4bce 100644 --- a/src/insets/InsetBranch.cpp +++ b/src/insets/InsetBranch.cpp @@ -20,7 +20,7 @@ #include "FuncRequest.h" #include "FuncStatus.h" #include "gettext.h" -#include "LColor.h" +#include "Color.h" #include "Lexer.h" #include "Paragraph.h" #include "OutputParams.h" @@ -99,17 +99,17 @@ void InsetBranch::setButtonLabel() font.decSize(); docstring s = _("Branch: ") + params_.branch; - font.setColor(LColor::foreground); + font.setColor(Color::foreground); if (!params_.branch.empty()) { // FIXME UNICODE - LColor_color c = lcolor.getFromLyXName(to_utf8(params_.branch)); - if (c == LColor::none) { - c = LColor::error; + Color_color c = lcolor.getFromLyXName(to_utf8(params_.branch)); + if (c == Color::none) { + c = Color::error; s = _("Undef: ") + s; } setBackgroundColor(c); } else - setBackgroundColor(LColor::background); + setBackgroundColor(Color::background); setLabel(isOpen() ? s : getNewLabel(s) ); setLabelFont(font); } diff --git a/src/insets/InsetCaption.cpp b/src/insets/InsetCaption.cpp index 6e53edf7c0..be9d77efd7 100644 --- a/src/insets/InsetCaption.cpp +++ b/src/insets/InsetCaption.cpp @@ -24,7 +24,7 @@ #include "FuncRequest.h" #include "FuncStatus.h" #include "gettext.h" -#include "LColor.h" +#include "Color.h" #include "MetricsInfo.h" #include "output_latex.h" #include "OutputParams.h" @@ -56,7 +56,7 @@ InsetCaption::InsetCaption(BufferParams const & bp) { setAutoBreakRows(true); setDrawFrame(true); - setFrameColor(LColor::captionframe); + setFrameColor(Color::captionframe); } diff --git a/src/insets/InsetCharStyle.cpp b/src/insets/InsetCharStyle.cpp index 2b1450d718..57e7709073 100644 --- a/src/insets/InsetCharStyle.cpp +++ b/src/insets/InsetCharStyle.cpp @@ -23,7 +23,7 @@ #include "Cursor.h" #include "gettext.h" #include "LaTeXFeatures.h" -#include "LColor.h" +#include "Color.h" #include "Lexer.h" #include "LyXText.h" #include "MetricsInfo.h" @@ -102,7 +102,7 @@ void InsetCharStyle::setUndefined() params_.latexparam.clear(); params_.font = LyXFont(LyXFont::ALL_INHERIT); params_.labelfont = LyXFont(LyXFont::ALL_INHERIT); - params_.labelfont.setColor(LColor::error); + params_.labelfont.setColor(Color::error); params_.show_label = true; } @@ -212,7 +212,7 @@ void InsetCharStyle::draw(PainterInfo & pi, int x, int y) const s = _("Undef: ") + s; theFontMetrics(font).rectText(s, w, a, d); pi.pain.rectText(x + (dim_.wid - w) / 2, y + desc + a, - s, font, LColor::none, LColor::none); + s, font, Color::none, Color::none); } // a visual clue when the cursor is inside the inset diff --git a/src/insets/InsetCollapsable.cpp b/src/insets/InsetCollapsable.cpp index 5b5515ff6b..ad8e892d49 100644 --- a/src/insets/InsetCollapsable.cpp +++ b/src/insets/InsetCollapsable.cpp @@ -23,7 +23,7 @@ #include "FloatList.h" #include "FuncStatus.h" #include "gettext.h" -#include "LColor.h" +#include "Color.h" #include "Lexer.h" #include "FuncRequest.h" #include "MetricsInfo.h" @@ -57,7 +57,7 @@ InsetCollapsable::InsetCollapsable { setAutoBreakRows(true); setDrawFrame(true); - setFrameColor(LColor::collapsableframe); + setFrameColor(Color::collapsableframe); setInsetName(from_ascii("Collapsable")); setButtonLabel(); } diff --git a/src/insets/InsetERT.cpp b/src/insets/InsetERT.cpp index 1ed5ae91b9..f87b1c7b35 100644 --- a/src/insets/InsetERT.cpp +++ b/src/insets/InsetERT.cpp @@ -23,7 +23,7 @@ #include "FuncStatus.h" #include "gettext.h" #include "Language.h" -#include "LColor.h" +#include "Color.h" #include "LyXAction.h" #include "Lexer.h" #include "LyXTextClass.h" @@ -57,7 +57,7 @@ void InsetERT::init() LyXFont font(LyXFont::ALL_SANE); font.decSize(); font.decSize(); - font.setColor(LColor::latex); + font.setColor(Color::latex); setLabelFont(font); text_.current_font.setLanguage(latex_language); text_.real_current_font.setLanguage(latex_language); @@ -431,7 +431,7 @@ void InsetERT::getDrawFont(LyXFont & font) const { font = LyXFont(LyXFont::ALL_INHERIT, latex_language); font.setFamily(LyXFont::TYPEWRITER_FAMILY); - font.setColor(LColor::latex); + font.setColor(Color::latex); } diff --git a/src/insets/InsetFloat.cpp b/src/insets/InsetFloat.cpp index 5a5e2e2366..e7126066a6 100644 --- a/src/insets/InsetFloat.cpp +++ b/src/insets/InsetFloat.cpp @@ -25,7 +25,7 @@ #include "FuncStatus.h" #include "gettext.h" #include "LaTeXFeatures.h" -#include "LColor.h" +#include "Color.h" #include "Lexer.h" #include "OutputParams.h" #include "Paragraph.h" @@ -122,7 +122,7 @@ InsetFloat::InsetFloat(BufferParams const & bp, string const & type) LyXFont font(LyXFont::ALL_SANE); font.decSize(); font.decSize(); - font.setColor(LColor::collapsable); + font.setColor(Color::collapsable); setLabelFont(font); params_.type = type; setInsetName(from_utf8(type)); diff --git a/src/insets/InsetFootlike.cpp b/src/insets/InsetFootlike.cpp index a34b3f1e88..eee2c8c693 100644 --- a/src/insets/InsetFootlike.cpp +++ b/src/insets/InsetFootlike.cpp @@ -15,7 +15,7 @@ #include "Buffer.h" #include "BufferView.h" #include "BufferParams.h" -#include "LColor.h" +#include "Color.h" #include "MetricsInfo.h" #include "Paragraph.h" @@ -28,7 +28,7 @@ InsetFootlike::InsetFootlike(BufferParams const & bp) LyXFont font(LyXFont::ALL_SANE); font.decSize(); font.decSize(); - font.setColor(LColor::collapsable); + font.setColor(Color::collapsable); setLabelFont(font); } @@ -39,7 +39,7 @@ InsetFootlike::InsetFootlike(InsetFootlike const & in) LyXFont font(LyXFont::ALL_SANE); font.decSize(); font.decSize(); - font.setColor(LColor::collapsable); + font.setColor(Color::collapsable); setLabelFont(font); } diff --git a/src/insets/InsetLine.cpp b/src/insets/InsetLine.cpp index 73e8fc216c..1b5966aaee 100644 --- a/src/insets/InsetLine.cpp +++ b/src/insets/InsetLine.cpp @@ -13,7 +13,7 @@ #include "InsetLine.h" #include "debug.h" -#include "LColor.h" +#include "Color.h" #include "LyXText.h" #include "MetricsInfo.h" #include "LaTeXFeatures.h" @@ -55,7 +55,7 @@ bool InsetLine::metrics(MetricsInfo & mi, Dimension & dim) const void InsetLine::draw(PainterInfo & pi, int x, int y) const { - pi.pain.line(x, y, x + dim_.wid, y, LColor::topline, Painter::line_solid, + pi.pain.line(x, y, x + dim_.wid, y, Color::topline, Painter::line_solid, Painter::line_thick); } diff --git a/src/insets/InsetNewline.cpp b/src/insets/InsetNewline.cpp index 51874b64f6..a2f555a53e 100644 --- a/src/insets/InsetNewline.cpp +++ b/src/insets/InsetNewline.cpp @@ -13,7 +13,7 @@ #include "InsetNewline.h" #include "debug.h" -#include "LColor.h" +#include "Color.h" #include "LyXText.h" #include "MetricsInfo.h" #include "OutputParams.h" @@ -101,7 +101,7 @@ void InsetNewline::draw(PainterInfo & pi, int x, int y) const xp[2] = int(x + wid * 0.625); } - pi.pain.lines(xp, yp, 3, LColor::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); @@ -117,7 +117,7 @@ void InsetNewline::draw(PainterInfo & pi, int x, int y) const xp[2] = int(x); } - pi.pain.lines(xp, yp, 3, LColor::eolmarker); + pi.pain.lines(xp, yp, 3, Color::eolmarker); } diff --git a/src/insets/InsetNote.cpp b/src/insets/InsetNote.cpp index 6c35dd4545..c93ee6da0a 100644 --- a/src/insets/InsetNote.cpp +++ b/src/insets/InsetNote.cpp @@ -23,7 +23,7 @@ #include "FuncStatus.h" #include "gettext.h" #include "LaTeXFeatures.h" -#include "LColor.h" +#include "Color.h" #include "Lexer.h" #include "MetricsInfo.h" #include "OutputParams.h" @@ -176,24 +176,24 @@ void InsetNote::setButtonLabel() switch (params_.type) { case InsetNoteParams::Note: - font.setColor(LColor::note); - setBackgroundColor(LColor::notebg); + font.setColor(Color::note); + setBackgroundColor(Color::notebg); break; case InsetNoteParams::Comment: - font.setColor(LColor::comment); - setBackgroundColor(LColor::commentbg); + font.setColor(Color::comment); + setBackgroundColor(Color::commentbg); break; case InsetNoteParams::Greyedout: - font.setColor(LColor::greyedout); - setBackgroundColor(LColor::greyedoutbg); + font.setColor(Color::greyedout); + setBackgroundColor(Color::greyedoutbg); break; case InsetNoteParams::Framed: - font.setColor(LColor::greyedout); - setBackgroundColor(LColor::greyedoutbg); + font.setColor(Color::greyedout); + setBackgroundColor(Color::greyedoutbg); break; case InsetNoteParams::Shaded: - font.setColor(LColor::greyedout); - setBackgroundColor(LColor::shadedbg); + font.setColor(Color::greyedout); + setBackgroundColor(Color::shadedbg); break; } setLabelFont(font); diff --git a/src/insets/InsetOptArg.cpp b/src/insets/InsetOptArg.cpp index 64bf9fa3f1..d6a85574bb 100644 --- a/src/insets/InsetOptArg.cpp +++ b/src/insets/InsetOptArg.cpp @@ -14,7 +14,7 @@ #include "debug.h" #include "gettext.h" -#include "LColor.h" +#include "Color.h" #include "Paragraph.h" #include @@ -32,7 +32,7 @@ InsetOptArg::InsetOptArg(BufferParams const & ins) : InsetCollapsable(ins) { LyXFont font(LyXFont::ALL_SANE); - font.setColor(LColor::collapsable); + font.setColor(Color::collapsable); setLabelFont(font); setLabel(_("opt")); } @@ -42,7 +42,7 @@ InsetOptArg::InsetOptArg(InsetOptArg const & in) : InsetCollapsable(in) { LyXFont font(LyXFont::ALL_SANE); - font.setColor(LColor::collapsable); + font.setColor(Color::collapsable); setLabelFont(font); setLabel(_("opt")); } diff --git a/src/insets/InsetPagebreak.cpp b/src/insets/InsetPagebreak.cpp index e7152f7650..2334a13723 100644 --- a/src/insets/InsetPagebreak.cpp +++ b/src/insets/InsetPagebreak.cpp @@ -14,7 +14,7 @@ #include "debug.h" #include "gettext.h" -#include "LColor.h" +#include "Color.h" #include "LyXText.h" #include "MetricsInfo.h" #include "OutputParams.h" @@ -58,7 +58,7 @@ bool InsetPagebreak::metrics(MetricsInfo & mi, Dimension & dim) const void InsetPagebreak::draw(PainterInfo & pi, int x, int y) const { LyXFont font; - font.setColor(LColor::pagebreak); + font.setColor(Color::pagebreak); font.decSize(); int w = 0; @@ -70,12 +70,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, - LColor::none, LColor::none); + Color::none, Color::none); pi.pain.line(x, y, text_start, y, - LColor::pagebreak, Painter::line_onoffdash); + Color::pagebreak, Painter::line_onoffdash); pi.pain.line(text_end, y, int(x + dim_.wid), y, - LColor::pagebreak, Painter::line_onoffdash); + Color::pagebreak, Painter::line_onoffdash); } diff --git a/src/insets/InsetSpace.cpp b/src/insets/InsetSpace.cpp index 60bd79fdb0..bdfdbe0beb 100644 --- a/src/insets/InsetSpace.cpp +++ b/src/insets/InsetSpace.cpp @@ -16,7 +16,7 @@ #include "InsetSpace.h" #include "debug.h" -#include "LColor.h" +#include "Color.h" #include "Lexer.h" #include "MetricsInfo.h" #include "OutputParams.h" @@ -101,9 +101,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, LColor::latex); + pi.pain.lines(xp, yp, 4, Color::latex); else - pi.pain.lines(xp, yp, 4, LColor::special); + pi.pain.lines(xp, yp, 4, Color::special); } diff --git a/src/insets/InsetSpecialChar.cpp b/src/insets/InsetSpecialChar.cpp index ac52798239..f863b27bc2 100644 --- a/src/insets/InsetSpecialChar.cpp +++ b/src/insets/InsetSpecialChar.cpp @@ -16,7 +16,7 @@ #include "debug.h" #include "LaTeXFeatures.h" -#include "LColor.h" +#include "Color.h" #include "Lexer.h" #include "MetricsInfo.h" @@ -74,25 +74,25 @@ void InsetSpecialChar::draw(PainterInfo & pi, int x, int y) const switch (kind_) { case HYPHENATION: { - font.setColor(LColor::special); + font.setColor(Color::special); pi.pain.text(x, y, char_type('-'), font); break; } case LIGATURE_BREAK: { - font.setColor(LColor::special); + font.setColor(Color::special); pi.pain.text(x, y, char_type('|'), font); break; } case END_OF_SENTENCE: { - font.setColor(LColor::special); + font.setColor(Color::special); pi.pain.text(x, y, char_type('.'), font); break; } case LDOTS: { - font.setColor(LColor::special); + font.setColor(Color::special); string ell = ". . . "; docstring dell(ell.begin(), ell.end()); pi.pain.text(x, y, dell, font); @@ -114,7 +114,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, LColor::special); + pi.pain.lines(xp, yp, 4, Color::special); break; } } diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp index 92ba102555..6596396c35 100644 --- a/src/insets/InsetTabular.cpp +++ b/src/insets/InsetTabular.cpp @@ -33,7 +33,7 @@ #include "gettext.h" #include "Language.h" #include "LaTeXFeatures.h" -#include "LColor.h" +#include "Color.h" #include "lyx_cb.h" #include "Lexer.h" #include "MetricsInfo.h" @@ -3096,7 +3096,7 @@ void InsetTabular::drawSelection(PainterInfo & pi, int x, int y) const int const w = tabular.getWidthOfColumn(cell); if (i >= cs && i <= ce && j >= rs && j <= re) pi.pain.fillRectangle(xx, y, w, h, - LColor::selection); + Color::selection); xx += w; } y += h; @@ -3113,12 +3113,12 @@ void InsetTabular::drawCellLines(Painter & pain, int x, int y, { int x2 = x + tabular.getWidthOfColumn(cell); bool on_off = false; - LColor::color col = LColor::tabularline; - LColor::color onoffcol = LColor::tabularonoffline; + Color::color col = Color::tabularline; + Color::color onoffcol = Color::tabularonoffline; if (erased) { - col = LColor::strikeout; - onoffcol = LColor::strikeout; + col = Color::strikeout; + onoffcol = Color::strikeout; } if (!tabular.topAlreadyDrawn(cell)) { diff --git a/src/insets/InsetText.cpp b/src/insets/InsetText.cpp index 4aa3088c38..f9b90bc682 100644 --- a/src/insets/InsetText.cpp +++ b/src/insets/InsetText.cpp @@ -25,7 +25,7 @@ #include "FuncRequest.h" #include "gettext.h" #include "Intl.h" -#include "LColor.h" +#include "Color.h" #include "lyxfind.h" #include "Lexer.h" #include "LyXRC.h" @@ -77,7 +77,7 @@ int InsetText::border_ = 2; InsetText::InsetText(BufferParams const & bp) - : drawFrame_(false), frame_color_(LColor::insetframe) + : drawFrame_(false), frame_color_(Color::insetframe) { paragraphs().push_back(Paragraph()); paragraphs().back().layout(bp.getLyXTextClass().defaultLayout()); @@ -393,13 +393,13 @@ void InsetText::setDrawFrame(bool flag) } -LColor_color InsetText::frameColor() const +Color_color InsetText::frameColor() const { - return LColor::color(frame_color_); + return Color::color(frame_color_); } -void InsetText::setFrameColor(LColor_color col) +void InsetText::setFrameColor(Color_color col) { frame_color_ = col; } diff --git a/src/insets/InsetText.h b/src/insets/InsetText.h index cac2851396..83eef5c8e6 100644 --- a/src/insets/InsetText.h +++ b/src/insets/InsetText.h @@ -29,7 +29,7 @@ class BufferParams; class BufferView; class CursorSlice; class Dimension; -class LColor_color; +class Color_color; class ParagraphList; @@ -89,9 +89,9 @@ public: /// void setDrawFrame(bool); /// - LColor_color frameColor() const; + Color_color frameColor() const; /// - void setFrameColor(LColor_color); + void setFrameColor(Color_color); /// bool showInsetDialog(BufferView *) const; /// @@ -150,7 +150,7 @@ private: /// bool drawFrame_; - /** We store the LColor::color value as an int to get LColor.h out + /** We store the Color::color value as an int to get Color.h out * of the header file. */ int frame_color_; diff --git a/src/insets/InsetTheorem.cpp b/src/insets/InsetTheorem.cpp index 04acc8a6f7..face6fab36 100644 --- a/src/insets/InsetTheorem.cpp +++ b/src/insets/InsetTheorem.cpp @@ -42,7 +42,7 @@ InsetTheorem::InsetTheorem() LyXFont font(LyXFont::ALL_SANE); font.decSize(); font.decSize(); - font.setColor(LColor::collapsable); + font.setColor(Color::collapsable); setLabelFont(font); #if 0 setAutoCollapse(false); diff --git a/src/insets/InsetVSpace.cpp b/src/insets/InsetVSpace.cpp index a1134fcbc9..fb0c8dbe87 100644 --- a/src/insets/InsetVSpace.cpp +++ b/src/insets/InsetVSpace.cpp @@ -18,7 +18,7 @@ #include "DispatchResult.h" #include "FuncRequest.h" #include "gettext.h" -#include "LColor.h" +#include "Color.h" #include "Lexer.h" #include "LyXText.h" #include "MetricsInfo.h" @@ -179,7 +179,7 @@ void InsetVSpace::draw(PainterInfo & pi, int x, int y) const int d = 0; LyXFont font; - font.setColor(LColor::added_space); + font.setColor(Color::added_space); font.decSize(); font.decSize(); docstring const lab = label(); @@ -187,18 +187,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, LColor::none, LColor::none); + lab, font, Color::none, Color::none); // top arrow - pi.pain.line(x, ty1, midx, ty2, LColor::added_space); - pi.pain.line(midx, ty2, rightx, ty1, LColor::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, LColor::added_space); - pi.pain.line(midx, by2, rightx, by1, LColor::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, LColor::added_space); + pi.pain.line(midx, ty2, midx, by2, Color::added_space); } diff --git a/src/insets/InsetWrap.cpp b/src/insets/InsetWrap.cpp index b70f08b866..263c290e11 100644 --- a/src/insets/InsetWrap.cpp +++ b/src/insets/InsetWrap.cpp @@ -24,7 +24,7 @@ #include "FuncStatus.h" #include "gettext.h" #include "LaTeXFeatures.h" -#include "LColor.h" +#include "Color.h" #include "Lexer.h" #include "OutputParams.h" #include "Paragraph.h" @@ -50,7 +50,7 @@ InsetWrap::InsetWrap(BufferParams const & bp, string const & type) LyXFont font(LyXFont::ALL_SANE); font.decSize(); font.decSize(); - font.setColor(LColor::collapsable); + font.setColor(Color::collapsable); setLabelFont(font); params_.type = type; params_.width = LyXLength(50, LyXLength::PCW); diff --git a/src/insets/RenderButton.cpp b/src/insets/RenderButton.cpp index b13afada17..cce32e334f 100644 --- a/src/insets/RenderButton.cpp +++ b/src/insets/RenderButton.cpp @@ -12,7 +12,7 @@ #include "RenderButton.h" -#include "LColor.h" +#include "Color.h" #include "MetricsInfo.h" #include "frontends/FontMetrics.h" @@ -67,14 +67,14 @@ void RenderButton::draw(PainterInfo & pi, int x, int y) const { // Draw it as a box with the LaTeX text LyXFont font(LyXFont::ALL_SANE); - font.setColor(LColor::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, - LColor::commandbg, LColor::commandframe); + Color::commandbg, Color::commandframe); } } diff --git a/src/insets/RenderGraphic.cpp b/src/insets/RenderGraphic.cpp index 99f1d34023..3a5bc405c3 100644 --- a/src/insets/RenderGraphic.cpp +++ b/src/insets/RenderGraphic.cpp @@ -15,7 +15,7 @@ #include "insets/Inset.h" #include "gettext.h" -#include "LColor.h" +#include "Color.h" #include "LyX.h" #include "LyXRC.h" #include "MetricsInfo.h" @@ -205,7 +205,7 @@ void RenderGraphic::draw(PainterInfo & pi, int x, int y) const y - dim_.asc, dim_.wid - 2 * InsetOld::TEXT_TO_INSET_OFFSET, dim_.asc + dim_.des, - LColor::foreground); + Color::foreground); // Print the file name. LyXFont msgFont = pi.base.font; diff --git a/src/insets/RenderPreview.cpp b/src/insets/RenderPreview.cpp index 9a1836e9ae..a7ecdbfcda 100644 --- a/src/insets/RenderPreview.cpp +++ b/src/insets/RenderPreview.cpp @@ -16,7 +16,7 @@ #include "BufferView.h" #include "Dimension.h" #include "gettext.h" -#include "LColor.h" +#include "Color.h" #include "LyX.h" #include "LyXRC.h" #include "MetricsInfo.h" @@ -160,7 +160,7 @@ void RenderPreview::draw(PainterInfo & pi, int x, int y) const y - dim_.asc, dim_.wid - 2 * offset, dim_.asc + dim_.des, - LColor::foreground); + Color::foreground); LyXFont font(pi.base.font); font.setFamily(LyXFont::SANS_FAMILY); diff --git a/src/mathed/InsetFormulaMacro.cpp b/src/mathed/InsetFormulaMacro.cpp index 912bb258ba..91195646f1 100644 --- a/src/mathed/InsetFormulaMacro.cpp +++ b/src/mathed/InsetFormulaMacro.cpp @@ -19,7 +19,7 @@ #include "Cursor.h" #include "debug.h" #include "gettext.h" -#include "LColor.h" +#include "Color.h" #include "Lexer.h" #include "OutputParams.h" @@ -145,7 +145,7 @@ void InsetFormulaMacro::draw(PainterInfo & p, int x, int y) const { // label LyXFont font = p.base.font; - font.setColor(LColor::math); + font.setColor(Color::math); PainterInfo pi(p.base.bv, p.pain); pi.base.style = LM_ST_TEXT; @@ -155,9 +155,9 @@ void InsetFormulaMacro::draw(PainterInfo & p, int x, int y) const int const w = dim_.wid - 2; int const h = dim_.height() - 2; - // LColor::mathbg used to be "AntiqueWhite" but is "linen" now, too - pi.pain.fillRectangle(x, a, w, h, LColor::mathmacrobg); - pi.pain.rectangle(x, a, w, h, LColor::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); #ifdef WITH_WARNINGS #warning FIXME diff --git a/src/mathed/InsetMathBoxed.cpp b/src/mathed/InsetMathBoxed.cpp index 2ff48888f7..cac33db435 100644 --- a/src/mathed/InsetMathBoxed.cpp +++ b/src/mathed/InsetMathBoxed.cpp @@ -14,7 +14,7 @@ #include "MathData.h" #include "MathStream.h" #include "LaTeXFeatures.h" -#include "LColor.h" +#include "Color.h" #include "support/std_ostream.h" #include "frontends/Painter.h" @@ -50,7 +50,7 @@ bool InsetMathBoxed::metrics(MetricsInfo & mi, Dimension & dim) const void InsetMathBoxed::draw(PainterInfo & pi, int x, int y) const { pi.pain.rectangle(x + 1, y - dim_.ascent() + 1, - dim_.width() - 2, dim_.height() - 2, LColor::foreground); + dim_.width() - 2, dim_.height() - 2, Color::foreground); cell(0).draw(pi, x + 3, y); setPosCache(pi, x, y); } diff --git a/src/mathed/InsetMathBrace.cpp b/src/mathed/InsetMathBrace.cpp index e096c7a3ce..f7b18cdc3a 100644 --- a/src/mathed/InsetMathBrace.cpp +++ b/src/mathed/InsetMathBrace.cpp @@ -14,7 +14,7 @@ #include "MathData.h" #include "MathStream.h" #include "MathSupport.h" -#include "LColor.h" +#include "Color.h" #include "frontends/FontMetrics.h" #include "frontends/Painter.h" @@ -63,7 +63,7 @@ bool InsetMathBrace::metrics(MetricsInfo & mi, Dimension & dim) const void InsetMathBrace::draw(PainterInfo & pi, int x, int y) const { LyXFont font = pi.base.font; - font.setColor(LColor::latex); + font.setColor(Color::latex); Dimension t = theFontMetrics(font).dimension('{'); pi.pain.text(x, y, '{', font); cell(0).draw(pi, x + t.wid, y); diff --git a/src/mathed/InsetMathColor.cpp b/src/mathed/InsetMathColor.cpp index c3358bfe34..f237eb9c4f 100644 --- a/src/mathed/InsetMathColor.cpp +++ b/src/mathed/InsetMathColor.cpp @@ -24,7 +24,7 @@ namespace lyx { using std::auto_ptr; using std::string; -InsetMathColor::InsetMathColor(bool oldstyle, LColor_color const & color) +InsetMathColor::InsetMathColor(bool oldstyle, Color_color const & color) : InsetMathNest(1), oldstyle_(oldstyle), color_(from_utf8(lcolor.getLaTeXName(color))) {} @@ -54,7 +54,7 @@ bool InsetMathColor::metrics(MetricsInfo & mi, Dimension & dim) const void InsetMathColor::draw(PainterInfo & pi, int x, int y) const { - LColor_color origcol = pi.base.font.color(); + Color_color 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); diff --git a/src/mathed/InsetMathColor.h b/src/mathed/InsetMathColor.h index 5d23261a07..1c15c8e07d 100644 --- a/src/mathed/InsetMathColor.h +++ b/src/mathed/InsetMathColor.h @@ -12,7 +12,7 @@ #ifndef MATH_COLORINSET_H #define MATH_COLORINSET_H -#include "LColor.h" +#include "Color.h" #include "InsetMathNest.h" @@ -25,7 +25,7 @@ class InsetMathColor : public InsetMathNest { public: /// Create a color inset from LyX color number explicit InsetMathColor(bool oldstyle, - LColor_color const & color = LColor::none); + Color_color const & color = Color::none); /// Create a color inset from LaTeX color name explicit InsetMathColor(bool oldstyle, docstring const & color); /// diff --git a/src/mathed/InsetMathDFrac.cpp b/src/mathed/InsetMathDFrac.cpp index 5dded132b6..70da736cf9 100644 --- a/src/mathed/InsetMathDFrac.cpp +++ b/src/mathed/InsetMathDFrac.cpp @@ -14,7 +14,7 @@ #include "MathData.h" #include "MathStream.h" #include "LaTeXFeatures.h" -#include "LColor.h" +#include "Color.h" #include "frontends/Painter.h" @@ -56,7 +56,7 @@ void InsetMathDFrac::draw(PainterInfo & pi, int x, int y) const int m = x + dim_.wid / 2; cell(0).draw(pi, m - cell(0).width() / 2, y - cell(0).descent() - 2 - 5); cell(1).draw(pi, m - cell(1).width() / 2, y + cell(1).ascent() + 2 - 5); - pi.pain.line(x + 1, y - 5, x + dim_.wid - 2, y - 5, LColor::math); + pi.pain.line(x + 1, y - 5, x + dim_.wid - 2, y - 5, Color::math); setPosCache(pi, x, y); } diff --git a/src/mathed/InsetMathFBox.cpp b/src/mathed/InsetMathFBox.cpp index 4eb91a8b97..642c9cd64a 100644 --- a/src/mathed/InsetMathFBox.cpp +++ b/src/mathed/InsetMathFBox.cpp @@ -13,7 +13,7 @@ #include "InsetMathFBox.h" #include "MathData.h" #include "MathStream.h" -#include "LColor.h" +#include "Color.h" #include "support/std_ostream.h" #include "frontends/Painter.h" @@ -56,7 +56,7 @@ bool InsetMathFBox::metrics(MetricsInfo & mi, Dimension & dim) const void InsetMathFBox::draw(PainterInfo & pi, int x, int y) const { pi.pain.rectangle(x + 1, y - dim_.ascent() + 1, - dim_.width() - 2, dim_.height() - 2, LColor::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); diff --git a/src/mathed/InsetMathFrac.cpp b/src/mathed/InsetMathFrac.cpp index 924cebe79c..0237227f8e 100644 --- a/src/mathed/InsetMathFrac.cpp +++ b/src/mathed/InsetMathFrac.cpp @@ -16,7 +16,7 @@ #include "MathStream.h" #include "TextPainter.h" #include "LaTeXFeatures.h" -#include "LColor.h" +#include "Color.h" #include "frontends/Painter.h" @@ -86,7 +86,7 @@ void InsetMathFrac::draw(PainterInfo & pi, int x, int y) const pi.pain.line(x + cell(0).width(), y + dim_.des - 2, x + cell(0).width() + 5, - y - dim_.asc + 2, LColor::math); + y - dim_.asc + 2, Color::math); } else { cell(0).draw(pi, m - cell(0).width() / 2, y - cell(0).descent() - 2 - 5); @@ -95,7 +95,7 @@ void InsetMathFrac::draw(PainterInfo & pi, int x, int y) const } if (kind_ == FRAC || kind_ == OVER) pi.pain.line(x + 1, y - 5, - x + dim_.wid - 2, y - 5, LColor::math); + x + dim_.wid - 2, y - 5, Color::math); drawMarkers(pi, x, y); } diff --git a/src/mathed/InsetMathFrameBox.cpp b/src/mathed/InsetMathFrameBox.cpp index e77fe38fc6..5bd9b9302e 100644 --- a/src/mathed/InsetMathFrameBox.cpp +++ b/src/mathed/InsetMathFrameBox.cpp @@ -14,7 +14,7 @@ #include "MathData.h" #include "MathStream.h" #include "MathSupport.h" -#include "LColor.h" +#include "Color.h" #include "frontends/Painter.h" @@ -54,7 +54,7 @@ void InsetMathFrameBox::draw(PainterInfo & pi, int x, int y) const { FontSetChanger dummy(pi.base, "textnormal"); pi.pain.rectangle(x + 1, y - dim_.ascent() + 1, - dim_.width() - 2, dim_.height() - 2, LColor::foreground); + dim_.width() - 2, dim_.height() - 2, Color::foreground); x += 5; drawStrBlack(pi, x, y, from_ascii("[")); diff --git a/src/mathed/InsetMathGrid.cpp b/src/mathed/InsetMathGrid.cpp index afcf0cfa48..2d23ab4a20 100644 --- a/src/mathed/InsetMathGrid.cpp +++ b/src/mathed/InsetMathGrid.cpp @@ -18,7 +18,7 @@ #include "BufferView.h" #include "CutAndPaste.h" #include "FuncStatus.h" -#include "LColor.h" +#include "Color.h" #include "Cursor.h" #include "debug.h" #include "FuncRequest.h" @@ -492,7 +492,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, - LColor::foreground); + Color::foreground); } for (col_type col = 0; col <= ncols(); ++col) @@ -501,7 +501,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, - LColor::foreground); + Color::foreground); } drawMarkers2(pi, x, y); } diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp index 1b963ac068..612e08d352 100644 --- a/src/mathed/InsetMathHull.cpp +++ b/src/mathed/InsetMathHull.cpp @@ -33,7 +33,7 @@ #include "BufferView.h" #include "CutAndPaste.h" #include "FuncStatus.h" -#include "LColor.h" +#include "Color.h" #include "LaTeXFeatures.h" #include "Cursor.h" #include "debug.h" @@ -1307,7 +1307,7 @@ void InsetMathHull::handleFont2(Cursor & cur, docstring const & arg) LyXFont font; bool b; bv_funcs::string2font(to_utf8(arg), font, b); - if (font.color() != LColor::inherit) { + if (font.color() != Color::inherit) { MathAtom at = MathAtom(new InsetMathColor(true, font.color())); cur.handleNest(at, 0); } diff --git a/src/mathed/InsetMathNest.cpp b/src/mathed/InsetMathNest.cpp index 154af01e49..ddafc5c270 100644 --- a/src/mathed/InsetMathNest.cpp +++ b/src/mathed/InsetMathNest.cpp @@ -36,7 +36,7 @@ #include "BufferView.h" #include "CutAndPaste.h" #include "FuncStatus.h" -#include "LColor.h" +#include "Color.h" #include "bufferview_funcs.h" #include "CoordCache.h" #include "Cursor.h" @@ -213,7 +213,7 @@ void InsetMathNest::draw(PainterInfo & pi, int x, int y) const #if 0 if (lock_) pi.pain.fillRectangle(x, y - ascent(), width(), height(), - LColor::mathlockbg); + Color::mathlockbg); #endif setPosCache(pi, x, y); } @@ -245,7 +245,7 @@ void InsetMathNest::drawSelection(PainterInfo & pi, int x, int y) const int y1 = c.yo(bv) - c.ascent(); int x2 = c.xo(bv) + c.pos2x(s2.pos()); int y2 = c.yo(bv) + c.descent(); - pi.pain.fillRectangle(x1, y1, x2 - x1, y2 - y1, LColor::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; @@ -257,7 +257,7 @@ void InsetMathNest::drawSelection(PainterInfo & pi, int x, int y) const int y1 = c.yo(bv) - c.ascent(); int x2 = c.xo(bv) + c.width(); int y2 = c.yo(bv) + c.descent(); - pi.pain.fillRectangle(x1, y1, x2 - x1, y2 - y1, LColor::selection); + pi.pain.fillRectangle(x1, y1, x2 - x1, y2 - y1, Color::selection); } } } @@ -409,7 +409,7 @@ void InsetMathNest::handleFont2(Cursor & cur, docstring const & arg) LyXFont font; bool b; bv_funcs::string2font(to_utf8(arg), font, b); - if (font.color() != LColor::inherit) { + if (font.color() != Color::inherit) { MathAtom at = MathAtom(new InsetMathColor(true, font.color())); cur.handleNest(at, 0); } diff --git a/src/mathed/InsetMathPhantom.cpp b/src/mathed/InsetMathPhantom.cpp index e4374dce2e..21ecfe9e50 100644 --- a/src/mathed/InsetMathPhantom.cpp +++ b/src/mathed/InsetMathPhantom.cpp @@ -14,7 +14,7 @@ #include "MathStream.h" #include "MathStream.h" -#include "LColor.h" +#include "Color.h" #include "frontends/Painter.h" @@ -51,8 +51,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 - LColor_color const origcol = pi.base.font.color(); - pi.base.font.setColor(LColor::special); + Color_color const origcol = pi.base.font.color(); + pi.base.font.setColor(Color::special); cell(0).draw(pi, x + 1, y); pi.base.font.setColor(origcol); @@ -79,15 +79,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, LColor::added_space); - pi.pain.line(x2, y1, x3, y2, LColor::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, LColor::added_space); - pi.pain.line(x2, y4, x3, y3, LColor::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, LColor::added_space); + pi.pain.line(x2, y1, x2, y4, Color::added_space); } if (kind_ == phantom || kind_ == hphantom) { @@ -109,15 +109,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, LColor::added_space); - pi.pain.line(x1, y2, x2, y1, LColor::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, LColor::added_space); - pi.pain.line(x4, y2, x3, y1, LColor::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, LColor::added_space); + pi.pain.line(x1, y2, x4, y2, Color::added_space); } drawMarkers(pi, x, y); diff --git a/src/mathed/InsetMathRoot.cpp b/src/mathed/InsetMathRoot.cpp index 324d804f6b..9da52c7e65 100644 --- a/src/mathed/InsetMathRoot.cpp +++ b/src/mathed/InsetMathRoot.cpp @@ -15,7 +15,7 @@ #include "MathData.h" #include "MathStream.h" #include "Cursor.h" -#include "LColor.h" +#include "Color.h" #include "frontends/Painter.h" @@ -68,7 +68,7 @@ void InsetMathRoot::draw(PainterInfo & pi, int x, int y) const xp[2] = x + w; yp[2] = y + d; xp[3] = x + w - 2; yp[3] = y + (d - a)/2 + 2; xp[4] = x + w - 5; yp[4] = y + (d - a)/2 + 4; - pi.pain.lines(xp, yp, 5, LColor::math); + pi.pain.lines(xp, yp, 5, Color::math); drawMarkers(pi, x, y); } diff --git a/src/mathed/InsetMathSpace.cpp b/src/mathed/InsetMathSpace.cpp index 8d3df0930b..144a6c534e 100644 --- a/src/mathed/InsetMathSpace.cpp +++ b/src/mathed/InsetMathSpace.cpp @@ -15,7 +15,7 @@ #include "MathStream.h" #include "LaTeXFeatures.h" -#include "LColor.h" +#include "Color.h" #include "frontends/Painter.h" @@ -109,7 +109,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) ? LColor::latex : LColor::math); + pi.pain.lines(xp, yp, 4, (space_ < 3) ? Color::latex : Color::math); } diff --git a/src/mathed/InsetMathSqrt.cpp b/src/mathed/InsetMathSqrt.cpp index 55d773c946..9df6fca71b 100644 --- a/src/mathed/InsetMathSqrt.cpp +++ b/src/mathed/InsetMathSqrt.cpp @@ -14,7 +14,7 @@ #include "MathData.h" #include "MathStream.h" #include "TextPainter.h" -#include "LColor.h" +#include "Color.h" #include "frontends/Painter.h" @@ -59,7 +59,7 @@ void InsetMathSqrt::draw(PainterInfo & pi, int x, int y) const xp[1] = x + 8; yp[1] = y - a + 1; xp[2] = x + 5; yp[2] = y + d - 1; xp[3] = x; yp[3] = y + (d - a)/2; - pi.pain.lines(xp, yp, 4, LColor::math); + pi.pain.lines(xp, yp, 4, Color::math); drawMarkers(pi, x, y); } diff --git a/src/mathed/InsetMathTFrac.cpp b/src/mathed/InsetMathTFrac.cpp index 84ed2b8157..92019717a7 100644 --- a/src/mathed/InsetMathTFrac.cpp +++ b/src/mathed/InsetMathTFrac.cpp @@ -16,7 +16,7 @@ #include "MathStream.h" #include "LaTeXFeatures.h" -#include "LColor.h" +#include "Color.h" #include "frontends/Painter.h" @@ -61,7 +61,7 @@ void InsetMathTFrac::draw(PainterInfo & pi, int x, int y) const int m = x + dim_.wid / 2; cell(0).draw(pi, m - cell(0).width() / 2, y - cell(0).descent() - 2 - 5); cell(1).draw(pi, m - cell(1).width() / 2, y + cell(1).ascent() + 2 - 5); - pi.pain.line(x + 1, y - 5, x + dim_.wid - 2, y - 5, LColor::math); + pi.pain.line(x + 1, y - 5, x + dim_.wid - 2, y - 5, Color::math); setPosCache(pi, x, y); } diff --git a/src/mathed/InsetMathXYArrow.cpp b/src/mathed/InsetMathXYArrow.cpp index 1853c2e4d9..5520ca47d5 100644 --- a/src/mathed/InsetMathXYArrow.cpp +++ b/src/mathed/InsetMathXYArrow.cpp @@ -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(), LColor::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); } diff --git a/src/mathed/MathData.cpp b/src/mathed/MathData.cpp index a0e9222c82..806e61e89d 100644 --- a/src/mathed/MathData.cpp +++ b/src/mathed/MathData.cpp @@ -23,7 +23,7 @@ #include "Buffer.h" #include "Cursor.h" #include "debug.h" -#include "LColor.h" +#include "Color.h" #include "frontends/FontMetrics.h" #include "frontends/Painter.h" @@ -299,7 +299,7 @@ void MathData::draw(PainterInfo & pi, int x, int y) const setXY(bv, x, y); if (empty()) { - pi.pain.rectangle(x, y - ascent(), width(), height(), LColor::mathline); + pi.pain.rectangle(x, y - ascent(), width(), height(), Color::mathline); return; } diff --git a/src/mathed/MathMacroTemplate.cpp b/src/mathed/MathMacroTemplate.cpp index 024c5d4f12..5650b4012f 100644 --- a/src/mathed/MathMacroTemplate.cpp +++ b/src/mathed/MathMacroTemplate.cpp @@ -19,7 +19,7 @@ #include "debug.h" #include "gettext.h" #include "Lexer.h" -#include "LColor.h" +#include "Color.h" #include "frontends/FontMetrics.h" #include "frontends/Painter.h" @@ -143,7 +143,7 @@ void MathMacroTemplate::draw(PainterInfo & p, int x, int y) const // label LyXFont font = p.base.font; - font.setColor(LColor::math); + font.setColor(Color::math); PainterInfo pi(p.base.bv, p.pain); pi.base.style = LM_ST_TEXT; @@ -153,10 +153,10 @@ void MathMacroTemplate::draw(PainterInfo & p, int x, int y) const int const w = dim_.wid - 2; int const h = dim_.height() - 2; - // LColor::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, LColor::mathmacrobg); - pi.pain.rectangle(x, a, w, h, LColor::mathframe); + //pi.pain.fillRectangle(x, a, w, h, Color::mathmacrobg); + pi.pain.rectangle(x, a, w, h, Color::mathframe); #ifdef WITH_WARNINGS #warning FIXME @@ -175,10 +175,10 @@ void MathMacroTemplate::draw(PainterInfo & p, int x, int y) const int const w1 = cell(1).width(); cell(0).draw(pi, x + 2, y + 1); pi.pain.rectangle(x, y - dim_.ascent() + 3, - w0 + 4, dim_.height() - 6, LColor::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, LColor::mathline); + w1 + 4, dim_.height() - 6, Color::mathline); if (lockMacro) MacroTable::globalMacros().get(name_).unlock(); diff --git a/src/mathed/MathSupport.cpp b/src/mathed/MathSupport.cpp index a381d66304..61030d8953 100644 --- a/src/mathed/MathSupport.cpp +++ b/src/mathed/MathSupport.cpp @@ -18,7 +18,7 @@ #include "MathParser.h" #include "debug.h" -#include "LColor.h" +#include "Color.h" #include "frontends/FontLoader.h" #include "frontends/FontMetrics.h" @@ -410,7 +410,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, - LColor::cursor, Painter::line_onoffdash); + Color::cursor, Painter::line_onoffdash); return; } @@ -452,7 +452,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), - LColor::math); + Color::math); } else { int xp[32]; int yp[32]; @@ -469,7 +469,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, LColor::math); + pi.pain.lines(xp, yp, n, Color::math); } } } @@ -478,7 +478,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) { LyXFont f = pi.base.font; - f.setColor(LColor::latex); + f.setColor(Color::latex); pi.pain.text(x, y, str, f); } @@ -486,7 +486,7 @@ void drawStrRed(PainterInfo & pi, int x, int y, docstring const & str) void drawStrBlack(PainterInfo & pi, int x, int y, docstring const & str) { LyXFont f = pi.base.font; - f.setColor(LColor::foreground); + f.setColor(Color::foreground); pi.pain.text(x, y, str, f); } @@ -504,7 +504,7 @@ struct fontinfo { LyXFont::FONT_FAMILY family_; LyXFont::FONT_SERIES series_; LyXFont::FONT_SHAPE shape_; - LColor::color color_; + Color::color color_; }; @@ -518,87 +518,87 @@ LyXFont::FONT_SHAPE const inh_shape = LyXFont::INHERIT_SHAPE; fontinfo fontinfos[] = { // math fonts {"mathnormal", LyXFont::ROMAN_FAMILY, LyXFont::MEDIUM_SERIES, - LyXFont::ITALIC_SHAPE, LColor::math}, + LyXFont::ITALIC_SHAPE, Color::math}, {"mathbf", inh_family, LyXFont::BOLD_SERIES, - inh_shape, LColor::math}, + inh_shape, Color::math}, {"mathcal", LyXFont::CMSY_FAMILY, inh_series, - inh_shape, LColor::math}, + inh_shape, Color::math}, {"mathfrak", LyXFont::EUFRAK_FAMILY, inh_series, - inh_shape, LColor::math}, + inh_shape, Color::math}, {"mathrm", LyXFont::ROMAN_FAMILY, inh_series, - LyXFont::UP_SHAPE, LColor::math}, + LyXFont::UP_SHAPE, Color::math}, {"mathsf", LyXFont::SANS_FAMILY, inh_series, - inh_shape, LColor::math}, + inh_shape, Color::math}, {"mathbb", LyXFont::MSB_FAMILY, inh_series, - inh_shape, LColor::math}, + inh_shape, Color::math}, {"mathtt", LyXFont::TYPEWRITER_FAMILY, inh_series, - inh_shape, LColor::math}, + inh_shape, Color::math}, {"mathit", inh_family, inh_series, - LyXFont::ITALIC_SHAPE, LColor::math}, + LyXFont::ITALIC_SHAPE, Color::math}, {"cmex", LyXFont::CMEX_FAMILY, inh_series, - inh_shape, LColor::math}, + inh_shape, Color::math}, {"cmm", LyXFont::CMM_FAMILY, inh_series, - inh_shape, LColor::math}, + inh_shape, Color::math}, {"cmr", LyXFont::CMR_FAMILY, inh_series, - inh_shape, LColor::math}, + inh_shape, Color::math}, {"cmsy", LyXFont::CMSY_FAMILY, inh_series, - inh_shape, LColor::math}, + inh_shape, Color::math}, {"eufrak", LyXFont::EUFRAK_FAMILY, inh_series, - inh_shape, LColor::math}, + inh_shape, Color::math}, {"msa", LyXFont::MSA_FAMILY, inh_series, - inh_shape, LColor::math}, + inh_shape, Color::math}, {"msb", LyXFont::MSB_FAMILY, inh_series, - inh_shape, LColor::math}, + inh_shape, Color::math}, {"wasy", LyXFont::WASY_FAMILY, inh_series, - inh_shape, LColor::none}, + inh_shape, Color::none}, {"esint", LyXFont::ESINT_FAMILY, inh_series, - inh_shape, LColor::none}, + inh_shape, Color::none}, // Text fonts {"text", inh_family, inh_series, - inh_shape, LColor::foreground}, + inh_shape, Color::foreground}, {"textbf", inh_family, LyXFont::BOLD_SERIES, - inh_shape, LColor::foreground}, + inh_shape, Color::foreground}, {"textit", inh_family, inh_series, - LyXFont::ITALIC_SHAPE, LColor::foreground}, + LyXFont::ITALIC_SHAPE, Color::foreground}, {"textmd", inh_family, LyXFont::MEDIUM_SERIES, - inh_shape, LColor::foreground}, + inh_shape, Color::foreground}, {"textnormal", inh_family, inh_series, - LyXFont::UP_SHAPE, LColor::foreground}, + LyXFont::UP_SHAPE, Color::foreground}, {"textrm", LyXFont::ROMAN_FAMILY, - inh_series, LyXFont::UP_SHAPE,LColor::foreground}, + inh_series, LyXFont::UP_SHAPE,Color::foreground}, {"textsc", inh_family, inh_series, - LyXFont::SMALLCAPS_SHAPE, LColor::foreground}, + LyXFont::SMALLCAPS_SHAPE, Color::foreground}, {"textsf", LyXFont::SANS_FAMILY, inh_series, - inh_shape, LColor::foreground}, + inh_shape, Color::foreground}, {"textsl", inh_family, inh_series, - LyXFont::SLANTED_SHAPE, LColor::foreground}, + LyXFont::SLANTED_SHAPE, Color::foreground}, {"texttt", LyXFont::TYPEWRITER_FAMILY, inh_series, - inh_shape, LColor::foreground}, + inh_shape, Color::foreground}, {"textup", inh_family, inh_series, - LyXFont::UP_SHAPE, LColor::foreground}, + LyXFont::UP_SHAPE, Color::foreground}, // TIPA support {"textipa", inh_family, inh_series, - inh_shape, LColor::foreground}, + inh_shape, Color::foreground}, // LyX internal usage {"lyxtex", inh_family, inh_series, - LyXFont::UP_SHAPE, LColor::latex}, + LyXFont::UP_SHAPE, Color::latex}, {"lyxsymbol", LyXFont::SYMBOL_FAMILY, inh_series, - inh_shape, LColor::math}, + inh_shape, Color::math}, {"lyxboldsymbol", LyXFont::SYMBOL_FAMILY, LyXFont::BOLD_SERIES, - inh_shape, LColor::math}, + inh_shape, Color::math}, {"lyxblacktext", LyXFont::ROMAN_FAMILY, LyXFont::MEDIUM_SERIES, - LyXFont::UP_SHAPE, LColor::foreground}, + LyXFont::UP_SHAPE, Color::foreground}, {"lyxnochange", inh_family, inh_series, - inh_shape, LColor::foreground}, + inh_shape, Color::foreground}, {"lyxfakebb", LyXFont::TYPEWRITER_FAMILY, LyXFont::BOLD_SERIES, - LyXFont::UP_SHAPE, LColor::math}, + LyXFont::UP_SHAPE, Color::math}, {"lyxfakecal", LyXFont::SANS_FAMILY, LyXFont::MEDIUM_SERIES, - LyXFont::ITALIC_SHAPE, LColor::math}, + LyXFont::ITALIC_SHAPE, Color::math}, {"lyxfakefrak", LyXFont::ROMAN_FAMILY, LyXFont::BOLD_SERIES, - LyXFont::ITALIC_SHAPE, LColor::math} + LyXFont::ITALIC_SHAPE, Color::math} }; @@ -673,7 +673,7 @@ void augmentFont(LyXFont & font, docstring const & name) font.setSeries(info->series_); if (info->shape_ != inh_shape) font.setShape(info->shape_); - if (info->color_ != LColor::none) + if (info->color_ != Color::none) font.setColor(info->color_); } diff --git a/src/rowpainter.cpp b/src/rowpainter.cpp index 8b7df5fad0..ba4c120586 100644 --- a/src/rowpainter.cpp +++ b/src/rowpainter.cpp @@ -22,7 +22,7 @@ #include "Encoding.h" #include "gettext.h" #include "Language.h" -#include "LColor.h" +#include "Color.h" #include "LyXRC.h" #include "Row.h" #include "MetricsInfo.h" @@ -223,10 +223,10 @@ void RowPainter::paintInset(pos_type const pos, LyXFont const & font) 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, LColor::green); - pi.pain.line(x1, y1, x2, y1, LColor::green); - pi.pain.line(x2, y1, x2, y2, LColor::green); - pi.pain.line(x1, y2, x2, y2, LColor::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 } @@ -368,9 +368,9 @@ void RowPainter::paintChars(pos_type & vpos, LyXFont const & font, if (prev_change != Change::UNCHANGED) { LyXFont copy(font); if (prev_change == Change::DELETED) { - copy.setColor(LColor::strikeout); + copy.setColor(Color::strikeout); } else if (prev_change == Change::INSERTED) { - copy.setColor(LColor::newtext); + copy.setColor(Color::newtext); } x_ += pain_.text(int(x_), yo_, s, copy); } else { @@ -389,7 +389,7 @@ void RowPainter::paintForeignMark(double orig_x, LyXFont const & font, int desc) return; int const y = yo_ + 1 + desc; - pain_.line(int(orig_x), y, int(x_), y, LColor::language); + pain_.line(int(orig_x), y, int(x_), y, Color::language); } @@ -449,7 +449,7 @@ void RowPainter::paintChangeBar() ? row_.ascent() : row_.height(); - pain_.fillRectangle(5, yo_ - row_.ascent(), 3, height, LColor::changebar); + pain_.fillRectangle(5, yo_ - row_.ascent(), 3, height, Color::changebar); } @@ -463,8 +463,8 @@ void RowPainter::paintAppendix() if (par_.params().startOfAppendix()) y += 2 * defaultRowHeight(); - pain_.line(1, y, 1, yo_ + row_.height(), LColor::appendix); - pain_.line(width_ - 2, y, width_ - 2, yo_ + row_.height(), LColor::appendix); + pain_.line(1, y, 1, yo_ + row_.height(), Color::appendix); + pain_.line(width_ - 2, y, width_ - 2, yo_ + row_.height(), Color::appendix); } @@ -501,12 +501,12 @@ void RowPainter::paintDepthBar() int const starty = yo_ - row_.ascent(); int const h = row_.height() - 1 - (i - next_depth - 1) * 3; - pain_.line(x, starty, x, starty + h, LColor::depthbar); + pain_.line(x, starty, x, starty + h, Color::depthbar); if (i > prev_depth) - pain_.fillRectangle(x, starty, w, 2, LColor::depthbar); + pain_.fillRectangle(x, starty, w, 2, Color::depthbar); if (i > next_depth) - pain_.fillRectangle(x, starty + h, w, 2, LColor::depthbar); + pain_.fillRectangle(x, starty + h, w, 2, Color::depthbar); } } @@ -514,7 +514,7 @@ void RowPainter::paintDepthBar() int RowPainter::paintAppendixStart(int y) { LyXFont pb_font; - pb_font.setColor(LColor::appendix); + pb_font.setColor(Color::appendix); pb_font.decSize(); int w = 0; @@ -527,10 +527,10 @@ int RowPainter::paintAppendixStart(int y) int const text_start = int(xo_ + (width_ - w) / 2); int const text_end = text_start + w; - pain_.rectText(text_start, y + d, label, pb_font, LColor::none, LColor::none); + pain_.rectText(text_start, y + d, label, pb_font, Color::none, Color::none); - pain_.line(int(xo_ + 1), y, text_start, y, LColor::appendix); - pain_.line(text_end, y, int(xo_ + width_ - 2), y, LColor::appendix); + pain_.line(int(xo_ + 1), y, text_start, y, Color::appendix); + pain_.line(text_end, y, int(xo_ + width_ - 2), y, Color::appendix); return 3 * defaultRowHeight(); } @@ -669,7 +669,7 @@ void RowPainter::paintLast() if (par_.isInserted(par_.size()) || par_.isDeleted(par_.size())) { FontMetrics const & fm = theFontMetrics(bv_.buffer()->params().getFont()); int const length = fm.maxAscent() / 2; - LColor::color col = par_.isInserted(par_.size()) ? LColor::newtext : LColor::strikeout; + Color::color col = par_.isInserted(par_.size()) ? Color::newtext : Color::strikeout; pain_.line(int(x_) + 1, yo_ + 2, int(x_) + 1, yo_ + 2 - length, col, Painter::line_solid, Painter::line_thick); @@ -692,9 +692,9 @@ void RowPainter::paintLast() x += (size - width_ + row_.width() + 1) * (is_rtl ? -1 : 1); if (endlabel == END_LABEL_BOX) - pain_.rectangle(x, y, size, size, LColor::eolmarker); + pain_.rectangle(x, y, size, size, Color::eolmarker); else - pain_.fillRectangle(x, y, size, size, LColor::eolmarker); + pain_.fillRectangle(x, y, size, size, Color::eolmarker); break; } @@ -779,7 +779,7 @@ void RowPainter::paintText() = theFontMetrics(bv_.buffer()->params().getFont()); int const middle = yo_ - fm.maxAscent() / 3; pain_.line(last_strikeout_x, middle, int(x_), middle, - LColor::strikeout, Painter::line_solid, Painter::line_thin); + Color::strikeout, Painter::line_solid, Painter::line_thin); running_strikeout = false; } @@ -797,23 +797,23 @@ void RowPainter::paintText() int const y0 = yo_; int const y1 = y0 - defaultRowHeight() / 2; - pain_.line(int(x_), y1, int(x_), y0, LColor::added_space); + pain_.line(int(x_), y1, int(x_), y0, Color::added_space); if (par_.hfillExpansion(row_, pos)) { int const y2 = (y0 + y1) / 2; if (pos >= body_pos) { pain_.line(int(x_), y2, int(x_ + hfill_), y2, - LColor::added_space, + Color::added_space, Painter::line_onoffdash); x_ += hfill_; } else { pain_.line(int(x_), y2, int(x_ + label_hfill_), y2, - LColor::added_space, + Color::added_space, Painter::line_onoffdash); x_ += label_hfill_; } - pain_.line(int(x_), y1, int(x_), y0, LColor::added_space); + pain_.line(int(x_), y1, int(x_), y0, Color::added_space); } x_ += 2; ++vpos; @@ -834,7 +834,7 @@ void RowPainter::paintText() = theFontMetrics(bv_.buffer()->params().getFont()); int const middle = yo_ - fm.maxAscent() / 3; pain_.line(last_strikeout_x, middle, int(x_), middle, - LColor::strikeout, Painter::line_solid, Painter::line_thin); + Color::strikeout, Painter::line_solid, Painter::line_thin); running_strikeout = false; } } @@ -1042,12 +1042,12 @@ void paintText(BufferView & bv, // and grey out above (should not happen later) // lyxerr << "par ascent: " << text.getPar(vi.p1).ascent() << endl; if (vi.y1 > 0 && vi.update_strategy != SingleParUpdate) - pain.fillRectangle(0, 0, bv.workWidth(), vi.y1, LColor::bottomarea); + pain.fillRectangle(0, 0, bv.workWidth(), vi.y1, Color::bottomarea); // and possibly grey out below // lyxerr << "par descent: " << text.getPar(vi.p1).ascent() << endl; if (vi.y2 < bv.workHeight() && vi.update_strategy != SingleParUpdate) - pain.fillRectangle(0, vi.y2, bv.workWidth(), bv.workHeight() - vi.y2, LColor::bottomarea); + pain.fillRectangle(0, vi.y2, bv.workWidth(), bv.workHeight() - vi.y2, Color::bottomarea); } diff --git a/src/text.cpp b/src/text.cpp index 3b54a25a05..9a5471054d 100644 --- a/src/text.cpp +++ b/src/text.cpp @@ -37,7 +37,7 @@ #include "FontIterator.h" #include "gettext.h" #include "Language.h" -#include "LColor.h" +#include "Color.h" #include "LyXLength.h" #include "Lexer.h" #include "LyXRC.h" @@ -573,9 +573,9 @@ int LyXText::leftMargin(Buffer const & buffer, int max_width, } -LColor_color LyXText::backgroundColor() const +Color_color LyXText::backgroundColor() const { - return LColor_color(LColor::color(background_color_)); + return Color_color(Color::color(background_color_)); } @@ -1440,7 +1440,7 @@ void LyXText::drawSelection(PainterInfo & pi, int x, int) const // paint only one rectangle int const b( !isRTL(*bv.buffer(), par1) ? x + x1 : x + X1 ); int const w( !isRTL(*bv.buffer(), par1) ? X2 - x1 : x2 - X1 ); - pi.pain.fillRectangle(b, y1, w, y2 - y1, LColor::selection); + pi.pain.fillRectangle(b, y1, w, y2 - y1, Color::selection); return; } @@ -1450,13 +1450,13 @@ void LyXText::drawSelection(PainterInfo & pi, int x, int) const // paint upper rectangle pi.pain.fillRectangle(x + x1, y1, x2 - x1, y2 - y1, - LColor::selection); + Color::selection); // paint bottom rectangle pi.pain.fillRectangle(x + X1, Y1, X2 - X1, Y2 - Y1, - LColor::selection); + Color::selection); // paint center rectangle pi.pain.fillRectangle(x, y2, tm.width(), - Y1 - y2, LColor::selection); + Y1 - y2, Color::selection); } diff --git a/src/text2.cpp b/src/text2.cpp index 32de7f8a6e..8ee99e8c7c 100644 --- a/src/text2.cpp +++ b/src/text2.cpp @@ -37,7 +37,7 @@ #include "FuncRequest.h" #include "gettext.h" #include "Language.h" -#include "LColor.h" +#include "Color.h" #include "LyXFunc.h" #include "LyXRC.h" #include "Row.h" @@ -75,7 +75,7 @@ using std::min; LyXText::LyXText() : current_font(LyXFont::ALL_INHERIT), - background_color_(LColor::background), + background_color_(Color::background), autoBreakRows_(false) {}