#include <config.h>
#include "BranchList.h"
-#include "LColor.h"
+#include "Color.h"
#include "frontends/Application.h"
Branch::Branch()
{
- theApp()->getRgbColor(LColor::background, color_);
+ theApp()->getRgbColor(Color::background, color_);
}
color_ = RGBColor(c);
else
// no color set or invalid color - use normal background
- theApp()->getRgbColor(LColor::background, color_);
+ theApp()->getRgbColor(Color::background, color_);
}
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 &);
#include "gettext.h"
#include "Language.h"
#include "LaTeXFeatures.h"
-#include "LColor.h"
+#include "Color.h"
#include "LyXFont.h"
#include "Lexer.h"
#include "LyXRC.h"
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);
--- /dev/null
+/**
+ * \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 <config.h>
+
+#include "debug.h"
+#include "gettext.h"
+#include "Color.h"
+#include "support/lstrings.h"
+
+#include <map>
+
+
+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<Color::color, information> InfoTab;
+ /// the table of color information
+ InfoTab infotab;
+
+ typedef std::map<string, Color::color> 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<color>(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
--- /dev/null
+// -*- 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 <boost/scoped_ptr.hpp>
+
+
+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> 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<Color::color>(-1)) {}
+
+ Color_color(Color::color val) : val_(val) {}
+ operator Color::color() const{ return val_; }
+};
+
+
+/// the current color definitions
+extern Color lcolor;
+/// the system color definitions
+extern Color system_lcolor;
+
+
+} // namespace lyx
+
+#endif
+++ /dev/null
-/**
- * \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 <config.h>
-
-#include "debug.h"
-#include "gettext.h"
-#include "LColor.h"
-#include "support/lstrings.h"
-
-#include <map>
-
-
-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<LColor::color, information> InfoTab;
- /// the table of color information
- InfoTab infotab;
-
- typedef std::map<string, LColor::color> 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<color>(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
+++ /dev/null
-// -*- 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 <boost/scoped_ptr.hpp>
-
-
-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> 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<LColor::color>(-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
#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"
}
// 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";
}
#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"
#include "debug.h"
#include "gettext.h"
#include "Language.h"
-#include "LColor.h"
+#include "Color.h"
#include "Lexer.h"
#include "LyXRC.h"
MEDIUM_SERIES,
UP_SHAPE,
SIZE_NORMAL,
- LColor::none,
+ Color::none,
OFF,
OFF,
OFF,
INHERIT_SERIES,
INHERIT_SHAPE,
INHERIT_SIZE,
- LColor::inherit,
+ Color::inherit,
INHERIT,
INHERIT,
INHERIT,
IGNORE_SERIES,
IGNORE_SHAPE,
IGNORE_SIZE,
- LColor::ignore,
+ Color::ignore,
IGNORE,
IGNORE,
IGNORE,
-LColor_color LyXFont::color() const
+Color_color LyXFont::color() const
{
- return LColor::color(bits.color);
+ return Color::color(bits.color);
}
}
-void LyXFont::setColor(LColor_color c)
+void LyXFont::setColor(Color_color c)
{
bits.color = int(c);
}
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());
}
if (noun() == tmplt.noun())
setNoun(INHERIT);
if (color() == tmplt.color())
- setColor(LColor::inherit);
+ setColor(Color::inherit);
}
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;
shape() != INHERIT_SHAPE && size() != INHERIT_SIZE &&
emph() != INHERIT && underbar() != INHERIT &&
noun() != INHERIT &&
- color() != LColor::inherit);
+ color() != Color::inherit);
}
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, "),
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()))
<< "}{";
++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.
}
-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();
}
#ifndef LYXFONT_H
#define LYXFONT_H
-#include "LColor.h"
+#include "Color.h"
#include "support/docstream.h"
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;
///
FONT_MISC_STATE number() const { return bits.number; }
///
- LColor_color color() const;
+ Color_color color() const;
///
Language const * language() const { return lang; }
///
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
docstring const stateText(BufferParams * params) const;
///
- LColor_color realColor() const;
+ Color_color realColor() const;
///
friend
#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"
}
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(
#include "Format.h"
#include "gettext.h"
#include "Session.h"
-#include "LColor.h"
+#include "Color.h"
#include "Lexer.h"
#include "LyXFont.h"
#include "Mover.h"
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)) {
<< "#\n\n";
case RC_SET_COLOR:
- for (int i = 0; i < LColor::ignore; ++i) {
- LColor::color lc = static_cast<LColor::color>(i);
+ for (int i = 0; i < Color::ignore; ++i) {
+ Color::color lc = static_cast<Color::color>(i);
string const col(lcolor.getX11Name(lc));
if (ignore_system_lyxrc ||
class FuncRequest;
class FuncStatus;
class InsetBase;
-class LColor_color;
+class Color_color;
class Cursor;
class PainterInfo;
class Row;
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.
FuncStatus.h \
InsetList.cpp \
InsetList.h \
- LColor.cpp \
- LColor.h \
+ Color.cpp \
+ Color.h \
LaTeX.cpp \
LaTeX.h \
LaTeXFeatures.cpp \
#include <config.h>
#include "BufferView.h"
-#include "LColor.h"
+#include "Color.h"
#include "MetricsInfo.h"
#include "mathed/MathSupport.h"
#include "gettext.h"
#include "Language.h"
#include "LaTeXFeatures.h"
-#include "LColor.h"
+#include "Color.h"
#include "LyXLength.h"
#include "LyXFont.h"
#include "LyXRC.h"
<< 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");
#include "debug.h"
#include "FuncRequest.h"
#include "FontIterator.h"
-#include "LColor.h"
+#include "Color.h"
#include "LyXLength.h"
#include "LyXRC.h"
#include "LyXText.h"
#include "CoordCache.h"
#include "gettext.h"
#include "Language.h"
-#include "LColor.h"
+#include "Color.h"
#include "Lexer.h"
#include "Row.h"
#include "Paragraph.h"
} 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();
#include "color.h"
-#include "LColor.h"
+#include "Color.h"
#include <cmath>
#include <sstream>
#include "debug.h"
#include "FloatList.h"
#include "FuncRequest.h"
-#include "LColor.h"
+#include "Color.h"
#include "Lexer.h"
#include "LyX.h"
#include "Paragraph.h"
auto_ptr<InsetCaption> inset(new InsetCaption(params));
inset->setAutoBreakRows(true);
inset->setDrawFrame(true);
- inset->setFrameColor(LColor::captionframe);
+ inset->setFrameColor(Color::captionframe);
return inset.release();
}
class BufferView;
class LyXView;
-class LColor_color;
+class Color_color;
struct RGBColor;
namespace frontend {
* 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
#include "frontends/FontMetrics.h"
-#include "LColor.h"
+#include "Color.h"
#include "LyXFont.h"
using lyx::docstring;
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;
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);
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;
}
namespace lyx {
-class LColor_color;
+class Color_color;
class LyXFont;
namespace graphics { class Image; }
virtual void line(
int x1, int y1,
int x2, int y2,
- LColor_color,
+ Color_color,
line_style = line_solid,
line_width = line_thin) = 0;
int const * xp,
int const * yp,
int np,
- LColor_color,
+ Color_color,
line_style = line_solid,
line_width = line_thin) = 0;
virtual void rectangle(
int x, int y,
int w, int h,
- LColor_color,
+ Color_color,
line_style = line_solid,
line_width = line_thin) = 0;
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,
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,
#include "Cursor.h"
#include "debug.h"
#include "Language.h"
-#include "LColor.h"
+#include "Color.h"
#include "LyXFont.h"
#include "LyXRC.h"
#include "Row.h"
* 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 <j.spitzmueller@gmx.de>
* 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 <leeming@lyx.org>
- * ControlCharacter.C: add #include "LColor.h".
+ * ControlCharacter.C: add #include "Color.h".
2003-09-16 Angus Leeming <leeming@lyx.org>
- * character.C: add #include "LColor.h".
+ * character.C: add #include "Color.h".
2003-09-15 Angus Leeming <leeming@lyx.org>
* 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<string, EnumLColor>.
+ * character.h:remove #include "Color.h".
+ typedef ColorPair as a std::pair<string, EnumColor>.
2003-09-15 Lars Gullik Bjønnes <larsbj@gullik.net>
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.
#include "bufferview_funcs.h"
#include "FuncRequest.h"
#include "Language.h"
-#include "LColor.h"
+#include "Color.h"
using lyx::bv_funcs::font2string;
using std::string;
getShape() != LyXFont::IGNORE_SHAPE ||
getSize() != LyXFont::IGNORE_SIZE ||
getBar() != IGNORE ||
- getColor() != LColor::ignore ||
+ getColor() != Color::ignore ||
font_->language() != ignore_language)
dialog().bc().valid();
}
-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:
namespace lyx {
-class LColor_color;
+class Color_color;
namespace frontend {
///
void setBar(FONT_STATE);
///
- void setColor(LColor_color);
+ void setColor(Color_color);
///
void setLanguage(std::string const &);
///
///
FONT_STATE getBar() const;
///
- LColor_color getColor() const;
+ Color_color getColor() const;
///
std::string getLanguage() const;
///
#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"
#include "gettext.h"
#include "FuncRequest.h"
#include "paper.h"
-#include "LColor.h"
+#include "Color.h"
#include "support/FileFilterList.h"
}
-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);
}
namespace lyx {
-class LColor_color;
+class Color_color;
namespace frontend {
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();
#include <algorithm>
#include <config.h>
-#include "LColor.h"
+#include "Color.h"
#include "frontends/FileDialog.h"
#include "frontends/Alert.h"
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;
} // namespace lyx
-class LColor_color;
+class Color_color;
/** Functions of use to the character GUI controller and view */
///
typedef std::pair<docstring, FONT_STATE> BarPair;
///
-typedef std::pair<docstring, LColor_color> ColorPair;
+typedef std::pair<docstring, Color_color> ColorPair;
///
std::vector<FamilyPair> const getFamilyData();
2004-11-17 Lars Gullik Bjønnes <larsbj@gullik.net>
- * 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 <lasgouttes@lyx.org>
2004-05-02 Angus Leeming <leeming@lyx.org>
* 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.
* 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 <leeming@lyx.org>
2003-09-16 Angus Leeming <leeming@lyx.org>
- * 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 <leeming@lyx.org>
- * 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<EnumLColor> colors_;
+ * QPrefsDialog.C: add #include "Color.h".
+ * QPrefsDialog.h: remove #include "Color.h". Store a vector<EnumColor> colors_;
- * QWorkArea.C: add #include "LColor.h".
+ * QWorkArea.C: add #include "Color.h".
- * lcolorcache.C: add #include "LColor.h".
- * lcolorcache.h: store a map<EnumLColor, QColor>.
- * lcolorcache.[Ch] (get):pass EnumLColor args, rather than LColor::color ones.
+ * lcolorcache.C: add #include "Color.h".
+ * lcolorcache.h: store a map<EnumColor, QColor>.
+ * 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 <leeming@lyx.org>
* Makefile.am:
* lcolorcache.h:
- * lcolorcache.C: add LColor::color -> QColor cache
+ * lcolorcache.C: add Color::color -> QColor cache
* QLPainter.C:
* QPrefs.C:
2002-11-25 John Levon <levon@movementarian.org>
- * qscreen.C: use LColor::cursor properly
+ * qscreen.C: use Color::cursor properly
* QPrefs.C:
* ui/QPrefKeyboardModule.ui:
#include "color.h"
#include "ColorCache.h"
-#include "LColor.h"
+#include "Color.h"
namespace lyx {
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())
#ifndef COLORCACHE_H
#define COLORCACHE_H
-#include "LColor.h"
+#include "Color.h"
#include <QColor>
// 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_color, QColor> lcolor_map;
+ typedef std::map<Color_color, QColor> lcolor_map;
mutable lcolor_map colormap;
};
}
-bool GuiApplication::getRgbColor(LColor_color col,
+bool GuiApplication::getRgbColor(Color_color col,
RGBColor & rgbcol)
{
QColor const & qcol = color_cache_.get(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();
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<void()> func);
void unregisterSocketCallback(int fd);
#include "rowpainter.h"
#include "debug.h"
#include "FuncRequest.h"
-#include "LColor.h"
+#include "Color.h"
#include "version.h"
#include "LyXRC.h"
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;
}
void GuiWorkArea::doGreyOut(QLPainter & pain)
{
pain.fillRectangle(0, 0, width(), height(),
- LColor::bottomarea);
+ Color::bottomarea);
//if (!lyxrc.show_banner)
// return;
#include "Qt2BC.h"
#include "qt_helpers.h"
-#include "LColor.h"
+#include "Color.h"
#include <QCloseEvent>
#include "debug.h"
#include "Language.h"
-#include "LColor.h"
+#include "Color.h"
#include "support/unicode.h"
: QPainter(device), Painter()
{
// new QPainter has default QPen:
- current_color_ = LColor::black;
+ current_color_ = Color::black;
current_ls_ = line_solid;
current_lw_ = line_thin;
}
}
-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_)
}
-void QLPainter::point(int x, int y, LColor_color col)
+void QLPainter::point(int x, int y, Color_color col)
{
if (!isDrawingEnabled())
return;
void QLPainter::line(int x1, int y1, int x2, int y2,
- LColor_color col,
+ Color_color col,
line_style ls,
line_width lw)
{
void QLPainter::lines(int const * xp, int const * yp, int np,
- LColor_color col,
+ Color_color col,
line_style ls,
line_width lw)
{
void QLPainter::rectangle(int x, int y, int w, int h,
- LColor_color col,
+ Color_color col,
line_style ls,
line_width lw)
{
}
-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;
graphics::QLImage const & qlimage =
static_cast<graphics::QLImage const &>(i);
- fillRectangle(x, y, w, h, LColor::graphicsbg);
+ fillRectangle(x, y, w, h, Color::graphicsbg);
if (!isDrawingEnabled())
return;
#include "frontends/Painter.h"
-#include "LColor.h"
+#include "Color.h"
#include <QPainter>
virtual void line(
int x1, int y1,
int x2, int y2,
- LColor_color,
+ Color_color,
line_style = line_solid,
line_width = line_thin);
int const * xp,
int const * yp,
int np,
- LColor_color,
+ Color_color,
line_style = line_solid,
line_width = line_thin);
virtual void rectangle(
int x, int y,
int w, int h,
- LColor_color,
+ Color_color,
line_style = line_solid,
line_width = line_thin);
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,
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_;
};
#include "Session.h"
#include "debug.h"
-#include "LColor.h"
+#include "Color.h"
#include "LyXFont.h"
#include "PanelStack.h"
#include "QFontExample.h"
// 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<LColor::color>(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<Color::color>(i);
+ if (lc == Color::none
+ || lc == Color::black
+ || lc == Color::white
+ || lc == Color::red
+ || lc == Color::green
+ || lc == Color::blue
+ || lc == Color::cyan
+ || lc == Color::magenta
+ || lc == Color::yellow
+ || lc == Color::inherit
+ || lc == Color::ignore) continue;
lcolors_.push_back(lc);
QColor color = QColor(guiApp->colorCache().get(lc));
#include "QDialogView.h"
-#include "LColor.h"
+#include "Color.h"
#include "LyXRC.h"
#include "ui/PrefsUi.h"
void change_color();
private:
- std::vector<LColor_color> lcolors_;
+ std::vector<Color_color> 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.
#include "debug.h"
#include "Format.h"
#include "InsetIterator.h"
-#include "LColor.h"
+#include "Color.h"
#include "LyXRC.h"
#include "OutputParams.h"
#include "Paragraph.h"
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());
#include "Buffer.h"
#include "CoordCache.h"
#include "BufferView.h"
-#include "LColor.h"
+#include "Color.h"
#include "Cursor.h"
#include "debug.h"
#include "Dimension.h"
/// pretty arbitrary dimensions
-InsetBase::InsetBase(): dim_(10, 10, 10), background_color_(LColor::background)
+InsetBase::InsetBase(): dim_(10, 10, 10), background_color_(Color::background)
{}
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();
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;
}
-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_);
}
class InsetMath;
class InsetText;
class LaTeXFeatures;
-class LColor_color;
+class Color_color;
class Cursor;
class Lexer;
class LyXText;
///
int scroll() const { return 0; }
///
- void setBackgroundColor(LColor_color);
+ void setBackgroundColor(Color_color);
///
- LColor_color backgroundColor() const;
+ Color_color backgroundColor() const;
///
enum CollapseStatus {
Collapsed,
mutable Dimension dim_;
private:
virtual std::auto_ptr<InsetBase> 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_;
#include "FuncRequest.h"
#include "gettext.h"
#include "LaTeXFeatures.h"
-#include "LColor.h"
+#include "Color.h"
#include "Lexer.h"
#include "MetricsInfo.h"
#include "Paragraph.h"
setLabel(label);
- font.setColor(LColor::foreground);
- setBackgroundColor(LColor::background);
+ font.setColor(Color::foreground);
+ setBackgroundColor(Color::background);
setLabelFont(font);
}
#include "FuncRequest.h"
#include "FuncStatus.h"
#include "gettext.h"
-#include "LColor.h"
+#include "Color.h"
#include "Lexer.h"
#include "Paragraph.h"
#include "OutputParams.h"
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);
}
#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"
{
setAutoBreakRows(true);
setDrawFrame(true);
- setFrameColor(LColor::captionframe);
+ setFrameColor(Color::captionframe);
}
#include "Cursor.h"
#include "gettext.h"
#include "LaTeXFeatures.h"
-#include "LColor.h"
+#include "Color.h"
#include "Lexer.h"
#include "LyXText.h"
#include "MetricsInfo.h"
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;
}
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
#include "FloatList.h"
#include "FuncStatus.h"
#include "gettext.h"
-#include "LColor.h"
+#include "Color.h"
#include "Lexer.h"
#include "FuncRequest.h"
#include "MetricsInfo.h"
{
setAutoBreakRows(true);
setDrawFrame(true);
- setFrameColor(LColor::collapsableframe);
+ setFrameColor(Color::collapsableframe);
setInsetName(from_ascii("Collapsable"));
setButtonLabel();
}
#include "FuncStatus.h"
#include "gettext.h"
#include "Language.h"
-#include "LColor.h"
+#include "Color.h"
#include "LyXAction.h"
#include "Lexer.h"
#include "LyXTextClass.h"
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);
{
font = LyXFont(LyXFont::ALL_INHERIT, latex_language);
font.setFamily(LyXFont::TYPEWRITER_FAMILY);
- font.setColor(LColor::latex);
+ font.setColor(Color::latex);
}
#include "FuncStatus.h"
#include "gettext.h"
#include "LaTeXFeatures.h"
-#include "LColor.h"
+#include "Color.h"
#include "Lexer.h"
#include "OutputParams.h"
#include "Paragraph.h"
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));
#include "Buffer.h"
#include "BufferView.h"
#include "BufferParams.h"
-#include "LColor.h"
+#include "Color.h"
#include "MetricsInfo.h"
#include "Paragraph.h"
LyXFont font(LyXFont::ALL_SANE);
font.decSize();
font.decSize();
- font.setColor(LColor::collapsable);
+ font.setColor(Color::collapsable);
setLabelFont(font);
}
LyXFont font(LyXFont::ALL_SANE);
font.decSize();
font.decSize();
- font.setColor(LColor::collapsable);
+ font.setColor(Color::collapsable);
setLabelFont(font);
}
#include "InsetLine.h"
#include "debug.h"
-#include "LColor.h"
+#include "Color.h"
#include "LyXText.h"
#include "MetricsInfo.h"
#include "LaTeXFeatures.h"
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);
}
#include "InsetNewline.h"
#include "debug.h"
-#include "LColor.h"
+#include "Color.h"
#include "LyXText.h"
#include "MetricsInfo.h"
#include "OutputParams.h"
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);
xp[2] = int(x);
}
- pi.pain.lines(xp, yp, 3, LColor::eolmarker);
+ pi.pain.lines(xp, yp, 3, Color::eolmarker);
}
#include "FuncStatus.h"
#include "gettext.h"
#include "LaTeXFeatures.h"
-#include "LColor.h"
+#include "Color.h"
#include "Lexer.h"
#include "MetricsInfo.h"
#include "OutputParams.h"
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);
#include "debug.h"
#include "gettext.h"
-#include "LColor.h"
+#include "Color.h"
#include "Paragraph.h"
#include <sstream>
: InsetCollapsable(ins)
{
LyXFont font(LyXFont::ALL_SANE);
- font.setColor(LColor::collapsable);
+ font.setColor(Color::collapsable);
setLabelFont(font);
setLabel(_("opt"));
}
: InsetCollapsable(in)
{
LyXFont font(LyXFont::ALL_SANE);
- font.setColor(LColor::collapsable);
+ font.setColor(Color::collapsable);
setLabelFont(font);
setLabel(_("opt"));
}
#include "debug.h"
#include "gettext.h"
-#include "LColor.h"
+#include "Color.h"
#include "LyXText.h"
#include "MetricsInfo.h"
#include "OutputParams.h"
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;
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);
}
#include "InsetSpace.h"
#include "debug.h"
-#include "LColor.h"
+#include "Color.h"
#include "Lexer.h"
#include "MetricsInfo.h"
#include "OutputParams.h"
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);
}
#include "debug.h"
#include "LaTeXFeatures.h"
-#include "LColor.h"
+#include "Color.h"
#include "Lexer.h"
#include "MetricsInfo.h"
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);
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;
}
}
#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"
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;
{
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)) {
#include "FuncRequest.h"
#include "gettext.h"
#include "Intl.h"
-#include "LColor.h"
+#include "Color.h"
#include "lyxfind.h"
#include "Lexer.h"
#include "LyXRC.h"
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());
}
-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;
}
class BufferView;
class CursorSlice;
class Dimension;
-class LColor_color;
+class Color_color;
class ParagraphList;
///
void setDrawFrame(bool);
///
- LColor_color frameColor() const;
+ Color_color frameColor() const;
///
- void setFrameColor(LColor_color);
+ void setFrameColor(Color_color);
///
bool showInsetDialog(BufferView *) const;
///
///
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_;
LyXFont font(LyXFont::ALL_SANE);
font.decSize();
font.decSize();
- font.setColor(LColor::collapsable);
+ font.setColor(Color::collapsable);
setLabelFont(font);
#if 0
setAutoCollapse(false);
#include "DispatchResult.h"
#include "FuncRequest.h"
#include "gettext.h"
-#include "LColor.h"
+#include "Color.h"
#include "Lexer.h"
#include "LyXText.h"
#include "MetricsInfo.h"
int d = 0;
LyXFont font;
- font.setColor(LColor::added_space);
+ font.setColor(Color::added_space);
font.decSize();
font.decSize();
docstring const lab = label();
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);
}
#include "FuncStatus.h"
#include "gettext.h"
#include "LaTeXFeatures.h"
-#include "LColor.h"
+#include "Color.h"
#include "Lexer.h"
#include "OutputParams.h"
#include "Paragraph.h"
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);
#include "RenderButton.h"
-#include "LColor.h"
+#include "Color.h"
#include "MetricsInfo.h"
#include "frontends/FontMetrics.h"
{
// 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);
}
}
#include "insets/Inset.h"
#include "gettext.h"
-#include "LColor.h"
+#include "Color.h"
#include "LyX.h"
#include "LyXRC.h"
#include "MetricsInfo.h"
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;
#include "BufferView.h"
#include "Dimension.h"
#include "gettext.h"
-#include "LColor.h"
+#include "Color.h"
#include "LyX.h"
#include "LyXRC.h"
#include "MetricsInfo.h"
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);
#include "Cursor.h"
#include "debug.h"
#include "gettext.h"
-#include "LColor.h"
+#include "Color.h"
#include "Lexer.h"
#include "OutputParams.h"
{
// 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;
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
#include "MathData.h"
#include "MathStream.h"
#include "LaTeXFeatures.h"
-#include "LColor.h"
+#include "Color.h"
#include "support/std_ostream.h"
#include "frontends/Painter.h"
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);
}
#include "MathData.h"
#include "MathStream.h"
#include "MathSupport.h"
-#include "LColor.h"
+#include "Color.h"
#include "frontends/FontMetrics.h"
#include "frontends/Painter.h"
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);
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)))
{}
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);
#ifndef MATH_COLORINSET_H
#define MATH_COLORINSET_H
-#include "LColor.h"
+#include "Color.h"
#include "InsetMathNest.h"
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);
///
#include "MathData.h"
#include "MathStream.h"
#include "LaTeXFeatures.h"
-#include "LColor.h"
+#include "Color.h"
#include "frontends/Painter.h"
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);
}
#include "InsetMathFBox.h"
#include "MathData.h"
#include "MathStream.h"
-#include "LColor.h"
+#include "Color.h"
#include "support/std_ostream.h"
#include "frontends/Painter.h"
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);
#include "MathStream.h"
#include "TextPainter.h"
#include "LaTeXFeatures.h"
-#include "LColor.h"
+#include "Color.h"
#include "frontends/Painter.h"
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);
}
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);
}
#include "MathData.h"
#include "MathStream.h"
#include "MathSupport.h"
-#include "LColor.h"
+#include "Color.h"
#include "frontends/Painter.h"
{
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("["));
#include "BufferView.h"
#include "CutAndPaste.h"
#include "FuncStatus.h"
-#include "LColor.h"
+#include "Color.h"
#include "Cursor.h"
#include "debug.h"
#include "FuncRequest.h"
- 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)
- 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);
}
#include "BufferView.h"
#include "CutAndPaste.h"
#include "FuncStatus.h"
-#include "LColor.h"
+#include "Color.h"
#include "LaTeXFeatures.h"
#include "Cursor.h"
#include "debug.h"
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);
}
#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"
#if 0
if (lock_)
pi.pain.fillRectangle(x, y - ascent(), width(), height(),
- LColor::mathlockbg);
+ Color::mathlockbg);
#endif
setPosCache(pi, x, y);
}
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;
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);
}
}
}
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);
}
#include "MathStream.h"
#include "MathStream.h"
-#include "LColor.h"
+#include "Color.h"
#include "frontends/Painter.h"
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);
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) {
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);
#include "MathData.h"
#include "MathStream.h"
#include "Cursor.h"
-#include "LColor.h"
+#include "Color.h"
#include "frontends/Painter.h"
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);
}
#include "MathStream.h"
#include "LaTeXFeatures.h"
-#include "LColor.h"
+#include "Color.h"
#include "frontends/Painter.h"
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);
}
#include "MathData.h"
#include "MathStream.h"
#include "TextPainter.h"
-#include "LColor.h"
+#include "Color.h"
#include "frontends/Painter.h"
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);
}
#include "MathStream.h"
#include "LaTeXFeatures.h"
-#include "LColor.h"
+#include "Color.h"
#include "frontends/Painter.h"
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);
}
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);
}
#include "Buffer.h"
#include "Cursor.h"
#include "debug.h"
-#include "LColor.h"
+#include "Color.h"
#include "frontends/FontMetrics.h"
#include "frontends/Painter.h"
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;
}
#include "debug.h"
#include "gettext.h"
#include "Lexer.h"
-#include "LColor.h"
+#include "Color.h"
#include "frontends/FontMetrics.h"
#include "frontends/Painter.h"
// 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;
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
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();
#include "MathParser.h"
#include "debug.h"
-#include "LColor.h"
+#include "Color.h"
#include "frontends/FontLoader.h"
#include "frontends/FontMetrics.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;
}
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];
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);
}
}
}
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);
}
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);
}
LyXFont::FONT_FAMILY family_;
LyXFont::FONT_SERIES series_;
LyXFont::FONT_SHAPE shape_;
- LColor::color color_;
+ Color::color color_;
};
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}
};
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_);
}
#include "Encoding.h"
#include "gettext.h"
#include "Language.h"
-#include "LColor.h"
+#include "Color.h"
#include "LyXRC.h"
#include "Row.h"
#include "MetricsInfo.h"
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
}
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 {
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);
}
? row_.ascent()
: row_.height();
- pain_.fillRectangle(5, yo_ - row_.ascent(), 3, height, LColor::changebar);
+ pain_.fillRectangle(5, yo_ - row_.ascent(), 3, height, Color::changebar);
}
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);
}
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);
}
}
int RowPainter::paintAppendixStart(int y)
{
LyXFont pb_font;
- pb_font.setColor(LColor::appendix);
+ pb_font.setColor(Color::appendix);
pb_font.decSize();
int w = 0;
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();
}
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);
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;
}
= 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;
}
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;
= 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;
}
}
// 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);
}
#include "FontIterator.h"
#include "gettext.h"
#include "Language.h"
-#include "LColor.h"
+#include "Color.h"
#include "LyXLength.h"
#include "Lexer.h"
#include "LyXRC.h"
}
-LColor_color LyXText::backgroundColor() const
+Color_color LyXText::backgroundColor() const
{
- return LColor_color(LColor::color(background_color_));
+ return Color_color(Color::color(background_color_));
}
// 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;
}
// 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);
}
#include "FuncRequest.h"
#include "gettext.h"
#include "Language.h"
-#include "LColor.h"
+#include "Color.h"
#include "LyXFunc.h"
#include "LyXRC.h"
#include "Row.h"
LyXText::LyXText()
: current_font(LyXFont::ALL_INHERIT),
- background_color_(LColor::background),
+ background_color_(Color::background),
autoBreakRows_(false)
{}