#include <config.h>
#include "BranchList.h"
-#include "Color.h"
#include "frontends/Application.h"
{
// no theApp() with command line export
if (theApp())
- theApp()->getRgbColor(Color::background, color_);
+ theApp()->getRgbColor(Color_background, color_);
}
color_ = RGBColor(c);
else
// no color set or invalid color - use normal background
- theApp()->getRgbColor(Color::background, color_);
+ theApp()->getRgbColor(Color_background, color_);
}
#include "LaTeXFeatures.h"
#include "Messages.h"
#include "ModuleList.h"
-#include "Color.h"
#include "Font.h"
#include "Lexer.h"
#include "LyXRC.h"
branch_ptr->setColor(color);
// Update also the Color table:
if (color == "none")
- color = lcolor.getX11Name(Color::background);
+ color = lcolor.getX11Name(Color_background);
// FIXME UNICODE
lcolor.setColor(to_utf8(branch), color);
// lyxerr << "par ascent: " << text.getPar(d->metrics_info_.p1).ascent() << endl;
if (d->metrics_info_.y1 > 0
&& d->metrics_info_.update_strategy == FullScreenUpdate)
- pain.fillRectangle(0, 0, width_, d->metrics_info_.y1, Color::bottomarea);
+ pain.fillRectangle(0, 0, width_, d->metrics_info_.y1, Color_bottomarea);
// and possibly grey out below
// lyxerr << "par descent: " << text.getPar(d->metrics_info_.p1).ascent() << endl;
if (d->metrics_info_.y2 < height_
&& d->metrics_info_.update_strategy == FullScreenUpdate)
pain.fillRectangle(0, d->metrics_info_.y2, width_,
- height_ - d->metrics_info_.y2, Color::bottomarea);
+ height_ - d->metrics_info_.y2, Color_bottomarea);
}
#include "debug.h"
#include "gettext.h"
#include "Color.h"
+
#include "support/lstrings.h"
#include <map>
using std::string;
using std::endl;
-using lyx::support::compare_ascii_no_case;
-using lyx::support::ascii_lowercase;
+namespace lyx {
+using support::compare_ascii_no_case;
+using support::ascii_lowercase;
namespace {
struct ColorEntry {
- lyx::Color::color lcolor;
+ ColorCode lcolor;
char const * guiname;
char const * latexname;
char const * x11name;
} // namespace anon
-
-namespace lyx {
-
-
/////////////////////////////////////////////////////////////////////
//
// RGBColor
}
///
- typedef std::map<Color::color, information> InfoTab;
+ typedef std::map<ColorCode, information> InfoTab;
/// the table of color information
InfoTab infotab;
- typedef std::map<string, Color::color> Transform;
+ typedef std::map<string, ColorCode> Transform;
/// the transform between LyX color name string and integer code.
Transform lyxcolors;
/// the transform between LaTeX color name string and integer code.
Color::Color()
: pimpl_(new Pimpl)
{
- // Color::color, gui, latex, x11, lyx
+ // ColorCode, gui, latex, x11, lyx
static ColorEntry const items[] = {
- { none, N_("none"), "none", "black", "none" },
- { black, N_("black"), "black", "black", "black" },
- { white, N_("white"), "white", "white", "white" },
- { red, N_("red"), "red", "red", "red" },
- { green, N_("green"), "green", "green", "green" },
- { blue, N_("blue"), "blue", "blue", "blue" },
- { cyan, N_("cyan"), "cyan", "cyan", "cyan" },
- { magenta, N_("magenta"), "magenta", "magenta", "magenta" },
- { yellow, N_("yellow"), "yellow", "yellow", "yellow" },
- { cursor, N_("cursor"), "cursor", "black", "cursor" },
- { background, N_("background"), "background", "linen", "background" },
- { foreground, N_("text"), "foreground", "black", "foreground" },
- { selection, N_("selection"), "selection", "LightBlue", "selection" },
- { latex, N_("LaTeX text"), "latex", "DarkRed", "latex" },
- { preview, N_("previewed snippet"), "preview", "black", "preview" },
- { note, N_("note"), "note", "blue", "note" },
- { notebg, N_("note background"), "notebg", "yellow", "notebg" },
- { comment, N_("comment"), "comment", "magenta", "comment" },
- { commentbg, N_("comment background"), "commentbg", "linen", "commentbg" },
- { greyedout, N_("greyedout inset"), "greyedout", "red", "greyedout" },
- { greyedoutbg, N_("greyedout inset background"), "greyedoutbg", "linen", "greyedoutbg" },
- { shadedbg, N_("shaded box"), "shaded", "#ff0000", "shaded" },
- { depthbar, N_("depth bar"), "depthbar", "IndianRed", "depthbar" },
- { language, N_("language"), "language", "Blue", "language" },
- { command, N_("command inset"), "command", "black", "command" },
- { commandbg, N_("command inset background"), "commandbg", "azure", "commandbg" },
- { commandframe, N_("command inset frame"), "commandframe", "black", "commandframe" },
- { special, N_("special character"), "special", "RoyalBlue", "special" },
- { math, N_("math"), "math", "DarkBlue", "math" },
- { mathbg, N_("math background"), "mathbg", "linen", "mathbg" },
- { graphicsbg, N_("graphics background"), "graphicsbg", "linen", "graphicsbg" },
- { mathmacrobg, N_("Math macro background"), "mathmacrobg", "linen", "mathmacrobg" },
- { mathframe, N_("math frame"), "mathframe", "Magenta", "mathframe" },
- { mathcorners, N_("math corners"), "mathcorners", "linen", "mathcorners" },
- { mathline, N_("math line"), "mathline", "Blue", "mathline" },
- { captionframe, N_("caption frame"), "captionframe", "DarkRed", "captionframe" },
- { collapsable, N_("collapsable inset text"), "collapsable", "DarkRed", "collapsable" },
- { collapsableframe, N_("collapsable inset frame"), "collapsableframe", "IndianRed", "collapsableframe" },
- { insetbg, N_("inset background"), "insetbg", "grey80", "insetbg" },
- { insetframe, N_("inset frame"), "insetframe", "IndianRed", "insetframe" },
- { error, N_("LaTeX error"), "error", "Red", "error" },
- { eolmarker, N_("end-of-line marker"), "eolmarker", "Brown", "eolmarker" },
- { appendix, N_("appendix marker"), "appendix", "Brown", "appendix" },
- { changebar, N_("change bar"), "changebar", "Blue", "changebar" },
- { deletedtext, N_("Deleted text"), "deletedtext", "#ff0000", "deletedtext" },
- { addedtext, N_("Added text"), "addedtext", "#0000ff", "addedtext" },
- { added_space, N_("added space markers"), "added_space", "Brown", "added_space" },
- { topline, N_("top/bottom line"), "topline", "Brown", "topline" },
- { tabularline, N_("table line"), "tabularline", "black", "tabularline" },
- { tabularonoffline, N_("table on/off line"), "tabularonoffline",
+ { Color_none, N_("none"), "none", "black", "none" },
+ { Color_black, N_("black"), "black", "black", "black" },
+ { Color_white, N_("white"), "white", "white", "white" },
+ { Color_red, N_("red"), "red", "red", "red" },
+ { Color_green, N_("green"), "green", "green", "green" },
+ { Color_blue, N_("blue"), "blue", "blue", "blue" },
+ { Color_cyan, N_("cyan"), "cyan", "cyan", "cyan" },
+ { Color_magenta, N_("magenta"), "magenta", "magenta", "magenta" },
+ { Color_yellow, N_("yellow"), "yellow", "yellow", "yellow" },
+ { Color_cursor, N_("cursor"), "cursor", "black", "cursor" },
+ { Color_background, N_("background"), "background", "linen", "background" },
+ { Color_foreground, N_("text"), "foreground", "black", "foreground" },
+ { Color_selection, N_("selection"), "selection", "LightBlue", "selection" },
+ { Color_latex, N_("LaTeX text"), "latex", "DarkRed", "latex" },
+ { Color_preview, N_("previewed snippet"), "preview", "black", "preview" },
+ { Color_note, N_("note"), "note", "blue", "note" },
+ { Color_notebg, N_("note background"), "notebg", "yellow", "notebg" },
+ { Color_comment, N_("comment"), "comment", "magenta", "comment" },
+ { Color_commentbg, N_("comment background"), "commentbg", "linen", "commentbg" },
+ { Color_greyedout, N_("greyedout inset"), "greyedout", "red", "greyedout" },
+ { Color_greyedoutbg, N_("greyedout inset background"), "greyedoutbg", "linen", "greyedoutbg" },
+ { Color_shadedbg, N_("shaded box"), "shaded", "#ff0000", "shaded" },
+ { Color_depthbar, N_("depth bar"), "depthbar", "IndianRed", "depthbar" },
+ { Color_language, N_("language"), "language", "Blue", "language" },
+ { Color_command, N_("command inset"), "command", "black", "command" },
+ { Color_commandbg, N_("command inset background"), "commandbg", "azure", "commandbg" },
+ { Color_commandframe, N_("command inset frame"), "commandframe", "black", "commandframe" },
+ { Color_special, N_("special character"), "special", "RoyalBlue", "special" },
+ { Color_math, N_("math"), "math", "DarkBlue", "math" },
+ { Color_mathbg, N_("math background"), "mathbg", "linen", "mathbg" },
+ { Color_graphicsbg, N_("graphics background"), "graphicsbg", "linen", "graphicsbg" },
+ { Color_mathmacrobg, N_("Math macro background"), "mathmacrobg", "linen", "mathmacrobg" },
+ { Color_mathframe, N_("math frame"), "mathframe", "Magenta", "mathframe" },
+ { Color_mathcorners, N_("math corners"), "mathcorners", "linen", "mathcorners" },
+ { Color_mathline, N_("math line"), "mathline", "Blue", "mathline" },
+ { Color_captionframe, N_("caption frame"), "captionframe", "DarkRed", "captionframe" },
+ { Color_collapsable, N_("collapsable inset text"), "collapsable", "DarkRed", "collapsable" },
+ { Color_collapsableframe, N_("collapsable inset frame"), "collapsableframe", "IndianRed", "collapsableframe" },
+ { Color_insetbg, N_("inset background"), "insetbg", "grey80", "insetbg" },
+ { Color_insetframe, N_("inset frame"), "insetframe", "IndianRed", "insetframe" },
+ { Color_error, N_("LaTeX error"), "error", "Red", "error" },
+ { Color_eolmarker, N_("end-of-line marker"), "eolmarker", "Brown", "eolmarker" },
+ { Color_appendix, N_("appendix marker"), "appendix", "Brown", "appendix" },
+ { Color_changebar, N_("change bar"), "changebar", "Blue", "changebar" },
+ { Color_deletedtext, N_("Deleted text"), "deletedtext", "#ff0000", "deletedtext" },
+ { Color_addedtext, N_("Added text"), "addedtext", "#0000ff", "addedtext" },
+ { Color_added_space, N_("added space markers"), "added_space", "Brown", "added_space" },
+ { Color_topline, N_("top/bottom line"), "topline", "Brown", "topline" },
+ { Color_tabularline, N_("table line"), "tabularline", "black", "tabularline" },
+ { Color_tabularonoffline, N_("table on/off line"), "tabularonoffline",
"LightSteelBlue", "tabularonoffline" },
- { bottomarea, N_("bottom area"), "bottomarea", "grey40", "bottomarea" },
- { pagebreak, N_("page break"), "pagebreak", "RoyalBlue", "pagebreak" },
- { buttonframe, N_("frame of button"), "buttonframe", "#dcd2c8", "buttonframe" },
- { buttonbg, N_("button background"), "buttonbg", "#dcd2c8", "buttonbg" },
- { buttonhoverbg, N_("button background under focus"), "buttonhoverbg", "#C7C7CA", "buttonhoverbg" },
- { inherit, N_("inherit"), "inherit", "black", "inherit" },
- { ignore, N_("ignore"), "ignore", "black", "ignore" },
- { ignore, 0, 0, 0, 0 }
+ { Color_bottomarea, N_("bottom area"), "bottomarea", "grey40", "bottomarea" },
+ { Color_pagebreak, N_("page break"), "pagebreak", "RoyalBlue", "pagebreak" },
+ { Color_buttonframe, N_("frame of button"), "buttonframe", "#dcd2c8", "buttonframe" },
+ { Color_buttonbg, N_("button background"), "buttonbg", "#dcd2c8", "buttonbg" },
+ { Color_buttonhoverbg, N_("button background under focus"), "buttonhoverbg", "#C7C7CA", "buttonhoverbg" },
+ { Color_inherit, N_("inherit"), "inherit", "black", "inherit" },
+ { Color_ignore, N_("ignore"), "ignore", "black", "ignore" },
+ { Color_ignore, 0, 0, 0, 0 }
};
for (int i = 0; items[i].guiname; ++i)
}
-docstring const Color::getGUIName(Color::color c) const
+docstring const Color::getGUIName(ColorCode c) const
{
Pimpl::InfoTab::const_iterator it = pimpl_->infotab.find(c);
if (it != pimpl_->infotab.end())
}
-string const Color::getX11Name(Color::color c) const
+string const Color::getX11Name(ColorCode c) const
{
Pimpl::InfoTab::const_iterator it = pimpl_->infotab.find(c);
if (it != pimpl_->infotab.end())
}
-string const Color::getLaTeXName(Color::color c) const
+string const Color::getLaTeXName(ColorCode c) const
{
Pimpl::InfoTab::const_iterator it = pimpl_->infotab.find(c);
if (it != pimpl_->infotab.end())
}
-string const Color::getLyXName(Color::color c) const
+string const Color::getLyXName(ColorCode c) const
{
Pimpl::InfoTab::const_iterator it = pimpl_->infotab.find(c);
if (it != pimpl_->infotab.end())
}
-bool Color::setColor(Color::color col, string const & x11name)
+bool Color::setColor(ColorCode col, string const & x11name)
{
Pimpl::InfoTab::iterator it = pimpl_->infotab.find(col);
if (it == pimpl_->infotab.end()) {
// "inherit" is returned for colors not in the database
// (and anyway should not be redefined)
- if (col == none || col == inherit || col == ignore) {
+ if (col == Color_none || col == Color_inherit || col == Color_ignore) {
lyxerr << "Color " << getLyXName(col)
<< " may not be redefined" << endl;
return false;
LYXERR(Debug::GUI)
<< "Color::setColor: Unknown color \""
<< lyxname << '"' << endl;
- addColor(static_cast<color>(pimpl_->infotab.size()), lcname);
+ addColor(static_cast<ColorCode>(pimpl_->infotab.size()), lcname);
}
return setColor(pimpl_->lyxcolors[lcname], x11name);
}
-void Color::addColor(Color::color c, string const & lyxname) const
+void Color::addColor(ColorCode c, string const & lyxname) const
{
ColorEntry ce = { c, "", "", "", lyxname.c_str() };
pimpl_->fill(ce);
}
-Color::color Color::getFromLyXName(string const & lyxname) const
+ColorCode Color::getFromLyXName(string const & lyxname) const
{
string const lcname = ascii_lowercase(lyxname);
if (pimpl_->lyxcolors.find(lcname) == pimpl_->lyxcolors.end()) {
lyxerr << "Color::getFromLyXName: Unknown color \""
<< lyxname << '"' << endl;
- return none;
+ return Color_none;
}
return pimpl_->lyxcolors[lcname];
}
-Color::color Color::getFromLaTeXName(string const & latexname) const
+ColorCode Color::getFromLaTeXName(string const & latexname) const
{
if (pimpl_->latexcolors.find(latexname) == pimpl_->latexcolors.end()) {
lyxerr << "Color::getFromLaTeXName: Unknown color \""
<< latexname << '"' << endl;
- return none;
+ return Color_none;
}
return pimpl_->latexcolors[latexname];
#ifndef LCOLOR_H
#define LCOLOR_H
+#include "ColorCode.h"
+
#include "support/docstring.h"
#include <boost/scoped_ptr.hpp>
// explanation.
{
public:
- /// Names of colors, including all logical colors
- enum color {
- /// No particular color---clear or default
- none,
- /// The different text colors
- black,
- ///
- white,
- ///
- red,
- ///
- green,
- ///
- blue,
- ///
- cyan,
- ///
- magenta,
- ///
- yellow,
-
- // Needed interface colors
-
- /// Cursor color
- cursor,
- /// Background color
- background,
- /// Foreground color
- foreground,
- /// Background color of selected text
- selection,
- /// Text color in LaTeX mode
- latex,
- /// The color used for previews
- preview,
-
- /// Text color for notes
- note,
- /// Background color of notes
- notebg,
- /// Text color for comments
- comment,
- /// Background color of comments
- commentbg,
- /// Text color for greyedout inset
- greyedout,
- /// Background color of greyedout inset
- greyedoutbg,
- /// Shaded box background
- shadedbg,
-
- /// Color for the depth bars in the margin
- depthbar,
- /// Color for marking foreign language words
- language,
-
- /// Text color for command insets
- command,
- /// Background color for command insets
- commandbg,
- /// Frame color for command insets
- commandframe,
-
- /// Special chars text color
- special,
-
- /// Graphics inset background color
- graphicsbg,
- /// Math inset text color
- math,
- /// Math inset background color
- mathbg,
- /// Macro math inset background color
- mathmacrobg,
- /// Math inset frame color under focus
- mathframe,
- /// Math inset frame color not under focus
- mathcorners,
- /// Math line color
- mathline,
-
- /// caption frame color
- captionframe,
-
- /// collapsable insets text
- collapsable,
- /// collapsable insets frame
- collapsableframe,
-
- /// Inset marker background color
- insetbg,
- /// Inset marker frame color
- insetframe,
-
- /// Error box text color
- error,
- /// EOL marker color
- eolmarker,
- /// Added space colour
- added_space,
- /// Appendix marker color
- appendix,
- /// changebar color
- changebar,
- /// deleted text color
- deletedtext,
- /// added text color
- addedtext,
- /// Top and bottom line color
- topline,
- /// Table line color
- tabularline,
- /// Table line color
- tabularonoffline,
- /// Bottom area color
- bottomarea,
- /// Page break color
- pagebreak,
-
- // FIXME: why are the next four separate ??
- /// Color used for button frame
- buttonframe,
- /// Color used for bottom background
- buttonbg,
- /// Color used for buttom under focus
- buttonhoverbg,
-
- // Logical attributes
-
- /// Color is inherited
- inherit,
- /// For ignoring updates of a color
- ignore
- };
-
-
///
Color();
///
/** set the given LyX color to the color defined by the X11 name given
* \returns true if successful.
*/
- bool setColor(Color::color col, std::string const & x11name);
+ bool setColor(ColorCode col, std::string const & x11name);
/** set the given LyX color to the color defined by the X11
* name given \returns true if successful. A new color entry
bool setColor(std::string const & lyxname, std::string const & x11name);
/// Get the GUI name of \c color.
- docstring const getGUIName(Color::color c) const;
+ docstring const getGUIName(ColorCode c) const;
/// Get the X11 name of \c color.
- std::string const getX11Name(Color::color c) const;
+ std::string const getX11Name(ColorCode c) const;
/// Get the LaTeX name of \c color.
- std::string const getLaTeXName(Color::color c) const;
+ std::string const getLaTeXName(ColorCode c) const;
/// Get the LyX name of \c color.
- std::string const getLyXName(Color::color c) const;
+ std::string const getLyXName(ColorCode c) const;
- /// \returns the Color::color associated with the LyX name.
- Color::color getFromLyXName(std::string const & lyxname) const;
- /// \returns the Color::color associated with the LaTeX name.
- Color::color getFromLaTeXName(std::string const & latexname) const;
+ /// \returns the ColorCode associated with the LyX name.
+ ColorCode getFromLyXName(std::string const & lyxname) const;
+ /// \returns the ColorCode associated with the LaTeX name.
+ ColorCode getFromLaTeXName(std::string const & latexname) const;
private:
///
- void addColor(Color::color c, std::string const & lyxname) const;
+ void addColor(ColorCode c, std::string const & lyxname) const;
///
class Pimpl;
///
};
-/** \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
--- /dev/null
+// -*- C++ -*-
+/**
+ * \file ColorCode.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * Full author contact details are available in file CREDITS.
+ */
+
+#ifndef COLOR_CODE_H
+#define COLOR_CODE_H
+
+namespace lyx {
+
+/// Names of colors, including all logical colors
+enum ColorCode
+{
+ /// No particular color---clear or default
+ Color_none,
+ /// The different text colors
+ Color_black,
+ ///
+ Color_white,
+ ///
+ Color_red,
+ ///
+ Color_green,
+ ///
+ Color_blue,
+ ///
+ Color_cyan,
+ ///
+ Color_magenta,
+ ///
+ Color_yellow,
+
+ // Needed interface colors
+
+ /// Cursor color
+ Color_cursor,
+ /// Background color
+ Color_background,
+ /// Foreground color
+ Color_foreground,
+ /// Background color of selected text
+ Color_selection,
+ /// Text color in LaTeX mode
+ Color_latex,
+ /// The color used for previews
+ Color_preview,
+
+ /// Text color for notes
+ Color_note,
+ /// Background color of notes
+ Color_notebg,
+ /// Text color for comments
+ Color_comment,
+ /// Background color of comments
+ Color_commentbg,
+ /// Text color for greyedout inset
+ Color_greyedout,
+ /// Background color of greyedout inset
+ Color_greyedoutbg,
+ /// Shaded box background
+ Color_shadedbg,
+
+ /// Color for the depth bars in the margin
+ Color_depthbar,
+ /// Color for marking foreign language words
+ Color_language,
+
+ /// Text color for command insets
+ Color_command,
+ /// Background color for command insets
+ Color_commandbg,
+ /// Frame color for command insets
+ Color_commandframe,
+
+ /// Special chars text color
+ Color_special,
+
+ /// Graphics inset background color
+ Color_graphicsbg,
+ /// Math inset text color
+ Color_math,
+ /// Math inset background color
+ Color_mathbg,
+ /// Macro math inset background color
+ Color_mathmacrobg,
+ /// Math inset frame color under focus
+ Color_mathframe,
+ /// Math inset frame color not under focus
+ Color_mathcorners,
+ /// Math line color
+ Color_mathline,
+
+ /// caption frame color
+ Color_captionframe,
+
+ /// collapsable insets text
+ Color_collapsable,
+ /// collapsable insets frame
+ Color_collapsableframe,
+
+ /// Inset marker background color
+ Color_insetbg,
+ /// Inset marker frame color
+ Color_insetframe,
+
+ /// Error box text color
+ Color_error,
+ /// EOL marker color
+ Color_eolmarker,
+ /// Added space colour
+ Color_added_space,
+ /// Appendix marker color
+ Color_appendix,
+ /// changebar color
+ Color_changebar,
+ /// deleted text color
+ Color_deletedtext,
+ /// added text color
+ Color_addedtext,
+ /// Top and bottom line color
+ Color_topline,
+ /// Table line color
+ Color_tabularline,
+ /// Table line color
+ Color_tabularonoffline,
+ /// Bottom area color
+ Color_bottomarea,
+ /// Page break color
+ Color_pagebreak,
+
+ // FIXME: why are the next four separate ??
+ /// Color used for button frame
+ Color_buttonframe,
+ /// Color used for bottom background
+ Color_buttonbg,
+ /// Color used for buttom under focus
+ Color_buttonhoverbg,
+
+ // Logical attributes
+
+ /// Color is inherited
+ Color_inherit,
+ /// For ignoring updates of a color
+ Color_ignore
+};
+
+} // namespace lyx
+
+#endif
MEDIUM_SERIES,
UP_SHAPE,
SIZE_NORMAL,
- Color::none,
+ Color_none,
OFF,
OFF,
OFF,
INHERIT_SERIES,
INHERIT_SHAPE,
INHERIT_SIZE,
- Color::inherit,
+ Color_inherit,
INHERIT,
INHERIT,
INHERIT,
IGNORE_SERIES,
IGNORE_SHAPE,
IGNORE_SIZE,
- Color::ignore,
+ Color_ignore,
IGNORE,
IGNORE,
IGNORE,
-Color_color Font::color() const
+ColorCode Font::color() const
{
- return Color::color(bits.color);
+ return ColorCode(bits.color);
}
}
-void Font::setColor(Color_color c)
+void Font::setColor(ColorCode c)
{
- bits.color = int(c);
+ bits.color = c;
}
setLanguage(newfont.language());
if (newfont.color() == color() && toggleall)
- setColor(Color::inherit); // toggle 'back'
- else if (newfont.color() != Color::ignore)
+ setColor(Color_inherit); // toggle 'back'
+ else if (newfont.color() != Color_ignore)
setColor(newfont.color());
}
if (noun() == tmplt.noun())
setNoun(INHERIT);
if (color() == tmplt.color())
- setColor(Color::inherit);
+ setColor(Color_inherit);
}
if (bits.noun == INHERIT)
bits.noun = tmplt.bits.noun;
- if (bits.color == Color::inherit)
+ if (bits.color == Color_inherit)
bits.color = tmplt.bits.color;
return *this;
shape() != INHERIT_SHAPE && size() != INHERIT_SIZE &&
emph() != INHERIT && underbar() != INHERIT &&
noun() != INHERIT &&
- color() != Color::inherit);
+ color() != Color_inherit);
}
os << _(GUIShapeNames[shape()]) << ", ";
if (size() != INHERIT_SIZE)
os << _(GUISizeNames[size()]) << ", ";
- if (color() != Color::inherit)
+ if (color() != Color_inherit)
os << lcolor.getGUIName(color()) << ", ";
if (emph() != INHERIT)
os << bformat(_("Emphasis %1$s, "),
count += strlen(LaTeXShapeNames[f.shape()]) + 2;
env = true; //We have opened a new environment
}
- if (f.color() != Color::inherit && f.color() != Color::ignore) {
+ if (f.color() != Color_inherit && f.color() != Color_ignore) {
os << "\\textcolor{"
<< from_ascii(lcolor.getLaTeXName(f.color()))
<< "}{";
++count;
env = true; // Size change need not bother about closing env.
}
- if (f.color() != Color::inherit && f.color() != Color::ignore) {
+ if (f.color() != Color_inherit && f.color() != Color_ignore) {
os << '}';
++count;
env = true; // Size change need not bother about closing env.
}
-Color_color Font::realColor() const
+ColorCode Font::realColor() const
{
- if (color() == Color::none)
- return Color::foreground;
+ if (color() == Color_none)
+ return Color_foreground;
return color();
}
} else if (token == "color") {
int const next = lex.getInteger();
- setColor(Color::color(next));
+ setColor(ColorCode(next));
} else if (token == "language") {
string const next = lex.getString();
<< endl;
}
switch (color()) {
- case Color::none:
- case Color::inherit:
- case Color::ignore:
+ case Color_none:
+ case Color_inherit:
+ case Color_ignore:
// probably we should put here all interface colors used for
// font displaying! For now I just add this ones I know of (Jug)
- case Color::latex:
- case Color::note:
+ case Color_latex:
+ case Color_note:
break;
default:
features.require("color");
#include "tex2lyx/Font.h"
#else
-#include "Color.h"
+#include "ColorCode.h"
+
#include "support/docstream.h"
FONT_SHAPE shape;
///
FONT_SIZE size;
- /** We store the Color::color value as an int to get Color.h out
- * of the header file.
- */
- int color;
+ ///
+ ColorCode color;
///
FONT_MISC_STATE emph;
///
///
FONT_MISC_STATE number() const { return bits.number; }
///
- Color_color color() const;
+ ColorCode color() const;
///
Language const * language() const { return lang; }
///
void setUnderbar(Font::FONT_MISC_STATE u);
void setNoun(Font::FONT_MISC_STATE n);
void setNumber(Font::FONT_MISC_STATE n);
- void setColor(Color_color c);
+ void setColor(ColorCode c);
void setLanguage(Language const * l);
/// Set family after LyX text format
docstring const stateText(BufferParams * params) const;
///
- Color_color realColor() const;
+ ColorCode realColor() const;
///
void validate(LaTeXFeatures & features) const;
#include "LaTeXFeatures.h"
-#include "BufferParams.h"
#include "Color.h"
+#include "BufferParams.h"
#include "debug.h"
#include "Encoding.h"
#include "Floating.h"
}
// shadecolor for shaded
if (mustProvide("framed") && mustProvide("color")) {
- RGBColor c = RGBColor(lcolor.getX11Name(Color::shadedbg));
+ RGBColor c = RGBColor(lcolor.getX11Name(Color_shadedbg));
//255.0 to force conversion to double
//NOTE As Jürgen Spitzmüller pointed out, an alternative would be
//to use the xcolor package instead, and then we can do
if (mustProvide("ct-xcolor-soul")) {
int const prec = macros.precision(2);
- RGBColor cadd = RGBColor(lcolor.getX11Name(Color::addedtext));
+ RGBColor cadd = RGBColor(lcolor.getX11Name(Color_addedtext));
macros << "\\providecolor{lyxadded}{rgb}{"
<< cadd.r / 255.0 << ',' << cadd.g / 255.0 << ',' << cadd.b / 255.0 << "}\n";
- RGBColor cdel = RGBColor(lcolor.getX11Name(Color::deletedtext));
+ RGBColor cdel = RGBColor(lcolor.getX11Name(Color_deletedtext));
macros << "\\providecolor{lyxdeleted}{rgb}{"
<< cdel.r / 255.0 << ',' << cdel.g / 255.0 << ',' << cdel.b / 255.0 << "}\n";
#include "LyX.h"
+#include "Color.h"
#include "ConverterCache.h"
#include "Buffer.h"
#include "buffer_funcs.h"
#include "CmdDef.h"
#include "Language.h"
#include "Session.h"
-#include "Color.h"
#include "LyXAction.h"
#include "LyXFunc.h"
#include "Lexer.h"
#include "BufferParams.h"
#include "BufferView.h"
#include "CmdDef.h"
-#include "Color.h"
#include "Converter.h"
#include "Cursor.h"
#include "CutAndPaste.h"
}
bool const graphicsbg_changed =
- (lyx_name == lcolor.getLyXName(Color::graphicsbg) &&
- x11_name != lcolor.getX11Name(Color::graphicsbg));
+ (lyx_name == lcolor.getLyXName(Color_graphicsbg) &&
+ x11_name != lcolor.getX11Name(Color_graphicsbg));
if (!lcolor.setColor(lyx_name, x11_name)) {
setErrorMessage(
#include "LyXRC.h"
#include "debug.h"
+#include "Color.h"
#include "Converter.h"
#include "Format.h"
#include "gettext.h"
#include "Session.h"
-#include "Color.h"
#include "Lexer.h"
#include "Font.h"
#include "Mover.h"
break;
}
- Color::color const col =
+ ColorCode const col =
lcolor.getFromLyXName(lyx_name);
- if (col == Color::none ||
- col == Color::inherit ||
- col == Color::ignore)
+ if (col == Color_none ||
+ col == Color_inherit ||
+ col == Color_ignore)
break;
if (!lcolor.setColor(col, x11_name)) {
<< "#\n\n";
case RC_SET_COLOR:
- for (int i = 0; i < Color::ignore; ++i) {
- Color::color lc = static_cast<Color::color>(i);
+ for (int i = 0; i < Color_ignore; ++i) {
+ ColorCode lc = static_cast<ColorCode>(i);
string const col(lcolor.getX11Name(lc));
if (ignore_system_lyxrc ||
Chktex.h \
CmdDef.cpp \
CmdDef.h \
+ ColorCode.h \
Color.cpp \
Color.h \
config.h.in \
PainterInfo::PainterInfo(BufferView * bv, lyx::frontend::Painter & painter)
: pain(painter), ltr_pos(false), erased_(false), full_repaint(true),
- background_color(Color::background)
+ background_color(Color_background)
{
base.bv = bv;
}
#include "InsetList.h"
#include "Language.h"
#include "LaTeXFeatures.h"
-#include "Color.h"
#include "Layout.h"
#include "Length.h"
#include "Font.h"
#include "FontIterator.h"
#include "gettext.h"
#include "Language.h"
-#include "Color.h"
#include "Length.h"
#include "Lexer.h"
#include "LyXRC.h"
class FuncRequest;
class FuncStatus;
class Inset;
-class Color_color;
class Cursor;
class Lexer;
class PainterInfo;
#include "BufferView.h"
#include "Bullet.h"
#include "Changes.h"
-#include "Color.h"
#include "Cursor.h"
#include "CutAndPaste.h"
#include "debug.h"
#include <config.h>
#include "TextClass.h"
-#include "debug.h"
-#include "Layout.h"
-#include "Lexer.h"
+
+#include "Color.h"
#include "Counters.h"
+#include "debug.h"
#include "gettext.h"
#include "Floating.h"
#include "FloatList.h"
+#include "Layout.h"
+#include "Lexer.h"
#include "frontends/alert.h"
string latexparam;
Font font(defaultfont());
Font labelfont(defaultfont());
- Color::color bgcolor(Color::background);
+ ColorCode bgcolor(Color_background);
string preamble;
bool multipar(false);
bool passthru(false);
}
static InsetLayout empty;
empty.labelstring = from_utf8("UNDEFINED");
- empty.bgcolor = Color::error;
+ empty.bgcolor = Color_error;
return empty;
}
#ifndef LYXTEXTCLASS_H
#define LYXTEXTCLASS_H
-#include "Color.h"
+#include "ColorCode.h"
#include "Font.h"
#include "LayoutEnums.h"
#include "LayoutPtr.h"
+#include "support/docstring.h"
+
#include <boost/shared_ptr.hpp>
#include <vector>
std::string latexparam;
Font font;
Font labelfont;
- Color::color bgcolor;
+ ColorCode bgcolor;
std::string preamble;
bool multipar;
bool passthru;
#include "buffer_funcs.h"
#include "BufferParams.h"
#include "BufferView.h"
-#include "Color.h"
#include "CutAndPaste.h"
#include "debug.h"
#include "FontIterator.h"
if (row_selection || (!pi.full_repaint && row_has_changed)) {
pi.pain.fillRectangle(x, y - rit->ascent(),
width(), rit->height(),
- Color_color(Color::color(pi.background_color)));
+ ColorCode(ColorCode(pi.background_color)));
}
if (row_selection) {
DocIterator beg = bv_->cursor().selectionBegin();
if (middleTop < middleBottom) {
// draw middle rectangle
pi.pain.fillRectangle(x, middleTop, width(), middleBottom - middleTop,
- Color::selection);
+ Color_selection);
}
if (!clipBelow) {
// draw the margins
if (drawOnBegMargin) {
if (text_->isRTL(buffer, beg.paragraph()))
- pi.pain.fillRectangle(x + x1, y1, width() - x1, y2 - y1, Color::selection);
+ pi.pain.fillRectangle(x + x1, y1, width() - x1, y2 - y1, Color_selection);
else
- pi.pain.fillRectangle(x, y1, x1, y2 - y1, Color::selection);
+ pi.pain.fillRectangle(x, y1, x1, y2 - y1, Color_selection);
}
if (drawOnEndMargin) {
if (text_->isRTL(buffer, beg.paragraph()))
- pi.pain.fillRectangle(x, y1, x2, y2 - y1, Color::selection);
+ pi.pain.fillRectangle(x, y1, x2, y2 - y1, Color_selection);
else
- pi.pain.fillRectangle(x + x2, y1, width() - x2, y2 - y1, Color::selection);
+ pi.pain.fillRectangle(x + x2, y1, width() - x2, y2 - y1, Color_selection);
}
// if we are on a boundary from the beginning, it's probably
if (!(cur < end) || drawNow) {
x2 = cursorX(cur.top(), cur.boundary());
pi.pain.fillRectangle(x + min(x1,x2), y1, abs(x2 - x1), y2 - y1,
- Color::selection);
+ Color_selection);
// reset x1, so it is set again next round (which will be on the
// right side of a boundary or at the selection end)
#include "debug.h"
#include "FloatList.h"
#include "FuncRequest.h"
-#include "Color.h"
#include "Lexer.h"
#include "LyX.h"
auto_ptr<InsetCaption> inset(new InsetCaption(params));
inset->setAutoBreakRows(true);
inset->setDrawFrame(true);
- inset->setFrameColor(Color::captionframe);
+ inset->setFrameColor(Color_captionframe);
return inset.release();
}
#ifndef LYX_APPLICATION_H
#define LYX_APPLICATION_H
+#include "ColorCode.h"
+
#include <boost/function.hpp>
#include <string>
namespace lyx {
class BufferView;
-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(Color_color col, RGBColor & rgbcol) = 0;
+ virtual bool getRgbColor(ColorCode col, RGBColor & rgbcol) = 0;
- /** Eg, passing Color::black returns "000000",
- * passing Color::white returns "ffffff".
+ /** Eg, passing Color_black returns "000000",
+ * passing Color_white returns "ffffff".
*/
- virtual std::string const hexName(Color_color col) = 0;
+ virtual std::string const hexName(ColorCode col) = 0;
/**
* update an altered GUI color
*/
- virtual void updateColor(Color_color col) = 0;
+ virtual void updateColor(ColorCode col) = 0;
/**
* add a callback for socket read notification
#include "frontends/FontMetrics.h"
-#include "Color.h"
#include "Font.h"
using lyx::docstring;
void Painter::button(int x, int y, int w, int h, bool mouseHover)
{
if (mouseHover)
- fillRectangle(x, y, w, h, Color::buttonhoverbg);
+ fillRectangle(x, y, w, h, Color_buttonhoverbg);
else
- fillRectangle(x, y, w, h, Color::buttonbg);
+ fillRectangle(x, y, w, h, Color_buttonbg);
buttonFrame(x, y, w, h);
}
void Painter::buttonFrame(int x, int y, int w, int h)
{
- line(x, y, x, y + h - 1, Color::buttonframe);
- line(x - 1 + w, y, x - 1 + w, y + h - 1, Color::buttonframe);
- line(x, y - 1, x - 1 + w, y - 1, Color::buttonframe);
- line(x, y + h - 1, x - 1 + w, y + h - 1, Color::buttonframe);
+ line(x, y, x, y + h - 1, Color_buttonframe);
+ line(x - 1 + w, y, x - 1 + w, y + h - 1, Color_buttonframe);
+ line(x, y - 1, x - 1 + w, y - 1, Color_buttonframe);
+ line(x, y + h - 1, x - 1 + w, y + h - 1, Color_buttonframe);
}
void Painter::rectText(int x, int y,
docstring const & str,
Font const & font,
- Color_color back,
- Color_color frame)
+ ColorCode back,
+ ColorCode frame)
{
int width;
int ascent;
FontMetrics const & fm = theFontMetrics(font);
fm.rectText(str, width, ascent, descent);
- if (back != Color::none)
+ if (back != Color_none)
fillRectangle(x + 1, y - ascent + 1, width - 1,
ascent + descent - 1, back);
- if (frame != Color::none)
+ if (frame != Color_none)
rectangle(x, y - ascent, width, ascent + descent, frame);
text(x + 3, y, str, font);
switch (style) {
case preedit_default:
// default unselecting mode.
- fillRectangle(x, y - height + 1, width, height, Color::background);
+ fillRectangle(x, y - height + 1, width, height, Color_background);
dashedUnderline(font, x, y - descent + 1, width);
break;
case preedit_selecting:
// We are in selecting mode: white text on black background.
- fillRectangle(x, y - height + 1, width, height, Color::black);
- temp_font.setColor(Color::white);
+ fillRectangle(x, y - height + 1, width, height, Color_black);
+ temp_font.setColor(Color_white);
break;
case preedit_cursor:
// The character comes with a cursor.
- fillRectangle(x, y - height + 1, width, height, Color::background);
+ fillRectangle(x, y - height + 1, width, height, Color_background);
underline(font, x, y - descent + 1, width);
break;
}
#ifndef PAINTER_H
#define PAINTER_H
+#include "ColorCode.h"
+
#include "support/docstring.h"
namespace lyx {
-class Color_color;
class Font;
namespace graphics { class Image; }
virtual void line(
int x1, int y1,
int x2, int y2,
- Color_color,
+ ColorCode,
line_style = line_solid,
line_width = line_thin) = 0;
int const * xp,
int const * yp,
int np,
- Color_color,
+ ColorCode,
line_style = line_solid,
line_width = line_thin) = 0;
virtual void rectangle(
int x, int y,
int w, int h,
- Color_color,
+ ColorCode,
line_style = line_solid,
line_width = line_thin) = 0;
virtual void fillRectangle(
int x, int y,
int w, int h,
- Color_color) = 0;
+ ColorCode) = 0;
/// draw an arc
virtual void arc(
int x, int y,
unsigned int w, unsigned int h,
int a1, int a2,
- Color_color) = 0;
+ ColorCode) = 0;
/// draw a pixel
virtual void point(
int x, int y,
- Color_color) = 0;
+ ColorCode) = 0;
/// draw a filled rectangle with the shape of a 3D button
virtual void button(int x, int y,
void rectText(int x, int baseline,
docstring const & str,
Font const & font,
- Color_color back,
- Color_color frame);
+ ColorCode back,
+ ColorCode frame);
/// draw a string and enclose it inside a button frame
void buttonText(int x, int baseline, docstring const & s,
#include "BufferView.h"
#include "Buffer.h"
#include "BufferParams.h"
-#include "Color.h"
#include "CoordCache.h"
#include "Cursor.h"
#include "debug.h"
#include <config.h>
#include "ColorCache.h"
-#include "Color.h"
+#include "Color.h"
namespace lyx {
const QColor grey90(0xe5, 0xe5, 0xe5);
const QColor none = Qt::black;
-QColor const & ColorCache::get(Color_color col) const
+QColor const & ColorCache::get(ColorCode col) const
{
lcolor_map::const_iterator cit = colormap.find(col);
if (cit != colormap.end())
#ifndef COLORCACHE_H
#define COLORCACHE_H
-#include "Color.h"
+#include "ColorCode.h"
#include <QColor>
ColorCache() {}
/// get the given color
- QColor const & get(Color_color color) const;
+ QColor const & get(ColorCode color) const;
/// clear all colors
void clear();
private:
- typedef std::map<Color_color, QColor> lcolor_map;
+ typedef std::map<ColorCode, QColor> lcolor_map;
mutable lcolor_map colormap;
};
}
-bool GuiApplication::getRgbColor(Color_color col,
+bool GuiApplication::getRgbColor(ColorCode col,
RGBColor & rgbcol)
{
QColor const & qcol = color_cache_.get(col);
}
-string const GuiApplication::hexName(Color_color col)
+string const GuiApplication::hexName(ColorCode col)
{
return support::ltrim(fromqstr(color_cache_.get(col).name()), "#");
}
-void GuiApplication::updateColor(Color_color)
+void GuiApplication::updateColor(ColorCode)
{
// FIXME: Bleh, can't we just clear them all at once ?
color_cache_.clear();
virtual std::string const romanFontName();
virtual std::string const sansFontName();
virtual std::string const typewriterFontName();
- virtual bool getRgbColor(Color_color col, RGBColor & rgbcol);
- virtual std::string const hexName(Color_color col);
- virtual void updateColor(Color_color col);
+ virtual bool getRgbColor(ColorCode col, RGBColor & rgbcol);
+ virtual std::string const hexName(ColorCode col);
+ virtual void updateColor(ColorCode col);
virtual void registerSocketCallback(int fd, SocketCallback func);
void unregisterSocketCallback(int fd);
//@}
#include "GuiCharacter.h"
#include "qt_helpers.h"
-#include "Color.h"
#include "Font.h"
#include "Buffer.h"
#include "BufferParams.h"
#include "FuncRequest.h"
#include "Language.h"
-#include "Color.h"
#include <QCloseEvent>
ColorPair pr;
pr.first = qt_("No change");
- pr.second = Color::ignore;
+ pr.second = Color_ignore;
color[0] = pr;
pr.first = qt_("No color");
- pr.second = Color::none;
+ pr.second = Color_none;
color[1] = pr;
pr.first = qt_("Black");
- pr.second = Color::black;
+ pr.second = Color_black;
color[2] = pr;
pr.first = qt_("White");
- pr.second = Color::white;
+ pr.second = Color_white;
color[3] = pr;
pr.first = qt_("Red");
- pr.second = Color::red;
+ pr.second = Color_red;
color[4] = pr;
pr.first = qt_("Green");
- pr.second = Color::green;
+ pr.second = Color_green;
color[5] = pr;
pr.first = qt_("Blue");
- pr.second = Color::blue;
+ pr.second = Color_blue;
color[6] = pr;
pr.first = qt_("Cyan");
- pr.second = Color::cyan;
+ pr.second = Color_cyan;
color[7] = pr;
pr.first = qt_("Magenta");
- pr.second = Color::magenta;
+ pr.second = Color_magenta;
color[8] = pr;
pr.first = qt_("Yellow");
- pr.second = Color::yellow;
+ pr.second = Color_yellow;
color[9] = pr;
pr.first = qt_("Reset");
- pr.second = Color::inherit;
+ pr.second = Color_inherit;
color[10] = pr;
return color;
|| getShape() != Font::IGNORE_SHAPE
|| getSize() != Font::IGNORE_SIZE
|| getBar() != IGNORE
- || getColor() != Color::ignore
+ || getColor() != Color_ignore
|| font_.language() != ignore_language)
setButtonsValid(true);
}
-Color_color GuiCharacter::getColor() const
+ColorCode GuiCharacter::getColor() const
{
return font_.color();
}
-void GuiCharacter::setColor(Color_color val)
+void GuiCharacter::setColor(ColorCode val)
{
switch (val) {
- case Color::ignore:
- case Color::none:
- case Color::black:
- case Color::white:
- case Color::red:
- case Color::green:
- case Color::blue:
- case Color::cyan:
- case Color::magenta:
- case Color::yellow:
- case Color::inherit:
+ case Color_ignore:
+ case Color_none:
+ case Color_black:
+ case Color_white:
+ case Color_red:
+ case Color_green:
+ case Color_blue:
+ case Color_cyan:
+ case Color_magenta:
+ case Color_yellow:
+ case Color_inherit:
font_.setColor(val);
break;
default:
namespace lyx {
-class Color_color;
-
namespace frontend {
enum FontState {
typedef std::pair<QString, Font::FONT_SHAPE> ShapePair;
typedef std::pair<QString, Font::FONT_SIZE> SizePair;
typedef std::pair<QString, FontState> BarPair;
-typedef std::pair<QString, Color_color> ColorPair;
+typedef std::pair<QString, ColorCode> ColorPair;
class GuiCharacter : public GuiDialog, public Ui::CharacterUi
{
///
void setBar(FontState);
///
- void setColor(Color_color);
+ void setColor(ColorCode);
///
void setLanguage(std::string const &);
///
FontState getBar() const;
///
- Color_color getColor() const;
+ ColorCode getColor() const;
///
std::string getLanguage() const;
#include "Buffer.h"
#include "BufferParams.h"
#include "BufferView.h"
-#include "Color.h"
#include "Encoding.h"
#include "FloatPlacement.h"
#include "frontend_helpers.h"
#include <QFont>
+#include <boost/scoped_ptr.hpp>
+
namespace lyx {
namespace frontend {
#include "debug.h"
#include "Language.h"
-#include "Color.h"
#include "support/unicode.h"
: QPainter(device), Painter()
{
// new QPainter has default QPen:
- current_color_ = Color::black;
+ current_color_ = Color_black;
current_ls_ = line_solid;
current_lw_ = line_thin;
}
}
-void GuiPainter::setQPainterPen(Color_color col,
+void GuiPainter::setQPainterPen(ColorCode col,
Painter::line_style ls, Painter::line_width lw)
{
if (col == current_color_ && ls == current_ls_ && lw == current_lw_)
}
-void GuiPainter::point(int x, int y, Color_color col)
+void GuiPainter::point(int x, int y, ColorCode col)
{
if (!isDrawingEnabled())
return;
void GuiPainter::line(int x1, int y1, int x2, int y2,
- Color_color col,
+ ColorCode col,
line_style ls,
line_width lw)
{
void GuiPainter::lines(int const * xp, int const * yp, int np,
- Color_color col,
+ ColorCode col,
line_style ls,
line_width lw)
{
void GuiPainter::rectangle(int x, int y, int w, int h,
- Color_color col,
+ ColorCode col,
line_style ls,
line_width lw)
{
}
-void GuiPainter::fillRectangle(int x, int y, int w, int h, Color_color col)
+void GuiPainter::fillRectangle(int x, int y, int w, int h, ColorCode col)
{
fillRect(x, y, w, h, guiApp->colorCache().get(col));
}
void GuiPainter::arc(int x, int y, unsigned int w, unsigned int h,
- int a1, int a2, Color_color col)
+ int a1, int a2, ColorCode col)
{
if (!isDrawingEnabled())
return;
graphics::GuiImage const & qlimage =
static_cast<graphics::GuiImage const &>(i);
- fillRectangle(x, y, w, h, Color::graphicsbg);
+ fillRectangle(x, y, w, h, Color_graphicsbg);
if (!isDrawingEnabled())
return;
#include "frontends/Painter.h"
-#include "Color.h"
-
#include <QPainter>
class QString;
virtual void line(
int x1, int y1,
int x2, int y2,
- Color_color,
+ ColorCode,
line_style = line_solid,
line_width = line_thin);
int const * xp,
int const * yp,
int np,
- Color_color,
+ ColorCode,
line_style = line_solid,
line_width = line_thin);
virtual void rectangle(
int x, int y,
int w, int h,
- Color_color,
+ ColorCode,
line_style = line_solid,
line_width = line_thin);
virtual void fillRectangle(
int x, int y,
int w, int h,
- Color_color);
+ ColorCode);
/// draw an arc
virtual void arc(
int x, int y,
unsigned int w, unsigned int h,
int a1, int a2,
- Color_color);
+ ColorCode);
/// draw a pixel
virtual void point(
int x, int y,
- Color_color);
+ ColorCode);
/// draw an image from the image cache
virtual void image(int x, int y,
QString const & str, Font const & f);
/// set pen parameters
- void setQPainterPen(Color_color col,
+ void setQPainterPen(ColorCode col,
line_style ls = line_solid,
line_width lw = line_thin);
- Color::color current_color_;
+ ColorCode current_color_;
Painter::line_style current_ls_;
Painter::line_width current_lw_;
};
struct ColorSorter
{
- bool operator()(Color::color const & lhs, Color::color const & rhs) const {
+ bool operator()(ColorCode lhs, ColorCode rhs) const {
return lcolor.getGUIName(lhs) < lcolor.getGUIName(rhs);
}
};
// See http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg113301.html
// for some discussion of why that is not trivial.
QPixmap icon(32, 32);
- for (int i = 0; i < Color::ignore; ++i) {
- Color::color lc = static_cast<Color::color>(i);
- if (lc == Color::none
- || lc == Color::black
- || lc == Color::white
- || lc == Color::red
- || lc == Color::green
- || lc == Color::blue
- || lc == Color::cyan
- || lc == Color::magenta
- || lc == Color::yellow
- || lc == Color::inherit
- || lc == Color::ignore) continue;
+ for (int i = 0; i < Color_ignore; ++i) {
+ ColorCode lc = static_cast<ColorCode>(i);
+ if (lc == Color_none
+ || lc == Color_black
+ || lc == Color_white
+ || lc == Color_red
+ || lc == Color_green
+ || lc == Color_blue
+ || lc == Color_cyan
+ || lc == Color_magenta
+ || lc == Color_yellow
+ || lc == Color_inherit
+ || lc == Color_ignore) continue;
lcolors_.push_back(lc);
}
std::sort(lcolors_.begin(), lcolors_.end(), ColorSorter());
- vector<Color_color>::const_iterator cit = lcolors_.begin();
- vector<Color_color>::const_iterator const end = lcolors_.end();
+ vector<ColorCode>::const_iterator cit = lcolors_.begin();
+ vector<ColorCode>::const_iterator const end = lcolors_.end();
for (; cit != end; ++cit) {
(void) new QListWidgetItem(QIcon(icon),
toqstr(lcolor.getGUIName(*cit)), lyxObjectsLW);
}
-void GuiPreferences::setColor(Color_color col, string const & hex)
+void GuiPreferences::setColor(ColorCode col, string const & hex)
{
colors_.push_back(lcolor.getLyXName(col) + ' ' + hex);
}
#include "GuiDialog.h"
-#include "Color.h"
+#include "ColorCode.h"
#include "Converter.h"
#include "Format.h"
#include "KeyMap.h"
namespace lyx {
-class Color_color;
class Converters;
class Formats;
class Movers;
void change_lyxObjects_selection();
private:
- std::vector<Color_color> lcolors_;
+ std::vector<ColorCode> lcolors_;
// FIXME the use of mutable here is required due to the
// fact that initialization is not done in the controller
// but in the constructor.
docstring const & title) const;
/// set a color
- void setColor(Color_color col, std::string const & hex);
+ void setColor(ColorCode col, std::string const & hex);
/// update the screen fonts after change
void updateScreenFonts();
#include "Buffer.h"
#include "BufferView.h"
-#include "Color.h"
#include "Cursor.h"
#include "debug.h"
#include "FuncRequest.h"
void update(int x, int y, int h, CursorShape shape)
{
- color_ = guiApp->colorCache().get(Color::cursor);
+ color_ = guiApp->colorCache().get(Color_cursor);
shape_ = shape;
switch (shape) {
case L_SHAPE:
#include "Encoding.h"
#include "Format.h"
#include "InsetIterator.h"
-#include "Color.h"
#include "LaTeXFeatures.h"
#include "LyXRC.h"
#include "output.h"
cs << pconverter_->command << ' ' << pconverter_->to << ' '
<< support::quoteName(latexfile.toFilesystemEncoding()) << ' '
<< int(font_scaling_factor_) << ' '
- << theApp()->hexName(Color::preview) << ' '
- << theApp()->hexName(Color::background);
+ << theApp()->hexName(Color_preview) << ' '
+ << theApp()->hexName(Color_background);
string const command = support::libScriptSearch(cs.str());
#include "Buffer.h"
#include "BufferParams.h"
#include "BufferView.h"
-#include "Color.h"
#include "CoordCache.h"
#include "Cursor.h"
#include "debug.h"
void Inset::drawMarkers(PainterInfo & pi, int x, int y) const
{
- Color::color pen_color = mouseHovered() || editing(pi.base.bv)?
- Color::mathframe : Color::mathcorners;
+ ColorCode pen_color = mouseHovered() || editing(pi.base.bv)?
+ Color_mathframe : Color_mathcorners;
Dimension const dim = dimension(*pi.base.bv);
void Inset::drawMarkers2(PainterInfo & pi, int x, int y) const
{
- Color::color pen_color = mouseHovered() || editing(pi.base.bv)?
- Color::mathframe : Color::mathcorners;
+ ColorCode pen_color = mouseHovered() || editing(pi.base.bv)?
+ Color_mathframe : Color_mathcorners;
drawMarkers(pi, x, y);
Dimension const dim = dimension(*pi.base.bv);
}
-Color_color Inset::backgroundColor() const
+ColorCode Inset::backgroundColor() const
{
- return Color::background;
+ return Color_background;
}
#ifndef INSETBASE_H
#define INSETBASE_H
+#include "ColorCode.h"
#include "InsetCode.h"
#include "Dimension.h"
class BufferParams;
class BufferView;
class Change;
-class Color_color;
class Cursor;
class CursorSlice;
class FuncRequest;
///
int scroll() const { return 0; }
///
- virtual Color_color backgroundColor() const;
+ virtual ColorCode backgroundColor() const;
///
enum CollapseStatus {
Collapsed,
#include "FuncRequest.h"
#include "gettext.h"
#include "LaTeXFeatures.h"
-#include "Color.h"
#include "Lexer.h"
#include "MetricsInfo.h"
setLabel(label);
- font.setColor(Color::foreground);
+ font.setColor(Color_foreground);
setLabelFont(font);
}
#include "FuncRequest.h"
#include "FuncStatus.h"
#include "gettext.h"
-#include "Color.h"
#include "Lexer.h"
#include "OutputParams.h"
docstring s = _("Branch: ") + params_.branch;
if (!params_.branch.empty()) {
// FIXME UNICODE
- Color_color c = lcolor.getFromLyXName(to_utf8(params_.branch));
- if (c == Color::none) {
+ ColorCode c = lcolor.getFromLyXName(to_utf8(params_.branch));
+ if (c == Color_none) {
s = _("Undef: ") + s;
}
}
}
-Color_color InsetBranch::backgroundColor() const
+ColorCode InsetBranch::backgroundColor() const
{
if (!params_.branch.empty()) {
// FIXME UNICODE
- Color_color c = lcolor.getFromLyXName(to_utf8(params_.branch));
- if (c == Color::none) {
- c = Color::error;
+ ColorCode c = lcolor.getFromLyXName(to_utf8(params_.branch));
+ if (c == Color_none) {
+ c = Color_error;
}
return c;
} else
///
void setButtonLabel();
///
- virtual Color_color backgroundColor() const;
+ virtual ColorCode backgroundColor() const;
///
bool showInsetDialog(BufferView *) const;
///
#include "Buffer.h"
#include "BufferParams.h"
-#include "Color.h"
#include "Counters.h"
#include "Cursor.h"
#include "BufferView.h"
{
setAutoBreakRows(true);
setDrawFrame(true);
- setFrameColor(Color::captionframe);
+ setFrameColor(Color_captionframe);
}
InsetCaption::InsetCaption(BufferParams const & bp)
{
setAutoBreakRows(true);
setDrawFrame(true);
- setFrameColor(Color::captionframe);
+ setFrameColor(Color_captionframe);
}
#include "FloatList.h"
#include "FuncStatus.h"
#include "gettext.h"
-#include "Color.h"
#include "LaTeXFeatures.h"
#include "Lexer.h"
#include "FuncRequest.h"
{
setAutoBreakRows(true);
setDrawFrame(true);
- setFrameColor(Color::collapsableframe);
+ setFrameColor(Color_collapsableframe);
setButtonLabel();
// Fallback for lacking inset layout item
- layout_.bgcolor = Color::background;
+ layout_.bgcolor = Color_background;
}
theFontMetrics(font).rectText(s, w, a, d);
int const ww = max(textdim.wid, w);
pi.pain.rectText(x + (ww - w) / 2, y + desc + a,
- s, font, Color::none, Color::none);
+ s, font, Color_none, Color_none);
desc += d;
}
///
bool setMouseHover(bool mouse_hover);
///
- virtual Color_color backgroundColor() const {return layout_.bgcolor; }
+ virtual ColorCode backgroundColor() const {return layout_.bgcolor; }
int latex(Buffer const &, odocstream &,
OutputParams const &) const;
#include "gettext.h"
#include "Language.h"
#include "Layout.h"
-#include "Color.h"
#include "LyXAction.h"
#include "Lexer.h"
#include "TextClass.h"
#include "FuncStatus.h"
#include "Cursor.h"
#include "gettext.h"
-#include "Color.h"
#include "Lexer.h"
#include "Text.h"
#include "MetricsInfo.h"
Font font(Font::ALL_SANE);
font.decSize();
font.decSize();
- font.setColor(Color::collapsable);
+ font.setColor(Color_collapsable);
setLabelFont(font);
params_.type = type;
}
#include "InsetLine.h"
#include "debug.h"
-#include "Color.h"
#include "Text.h"
#include "MetricsInfo.h"
#include "LaTeXFeatures.h"
void InsetLine::draw(PainterInfo & pi, int x, int y) const
{
Dimension const dim = dimension(*pi.base.bv);
- pi.pain.line(x, y, x + dim.wid, y, Color::topline,
+ pi.pain.line(x, y, x + dim.wid, y, Color_topline,
Painter::line_solid, Painter::line_thick);
}
Font font(Font::ALL_SANE);
font.decSize();
font.decSize();
- font.setColor(Color::none);
+ font.setColor(Color_none);
setLabelFont(font);
// FIXME: what to do with those?
//text_.current_font.setLanguage(latex_language);
{
font = Font(Font::ALL_INHERIT, latex_language);
font.setFamily(Font::TYPEWRITER_FAMILY);
- // FIXME: define Color::listing?
- font.setColor(Color::foreground);
+ // FIXME: define Color_listing?
+ font.setColor(Color_foreground);
}
xp[2] = int(x + wid * 0.625);
}
- pi.pain.lines(xp, yp, 3, Color::eolmarker);
+ pi.pain.lines(xp, yp, 3, Color_eolmarker);
yp[0] = int(y - 0.500 * asc * 0.75);
yp[1] = int(y - 0.500 * asc * 0.75);
xp[2] = int(x);
}
- pi.pain.lines(xp, yp, 3, Color::eolmarker);
+ pi.pain.lines(xp, yp, 3, Color_eolmarker);
}
: InsetCollapsable(ins)
{
Font font(Font::ALL_SANE);
- font.setColor(Color::collapsable);
+ font.setColor(Color_collapsable);
setLabelFont(font);
setLabel(_("opt"));
}
: InsetCollapsable(in)
{
Font font(Font::ALL_SANE);
- font.setColor(Color::collapsable);
+ font.setColor(Color_collapsable);
setLabelFont(font);
setLabel(_("opt"));
}
#include "debug.h"
#include "gettext.h"
-#include "Color.h"
#include "Text.h"
#include "MetricsInfo.h"
#include "OutputParams.h"
void InsetPagebreak::draw(PainterInfo & pi, int x, int y) const
{
Font font;
- font.setColor(Color::pagebreak);
+ font.setColor(Color_pagebreak);
font.decSize();
Dimension const dim = dimension(*pi.base.bv);
int const text_end = text_start + w;
pi.pain.rectText(text_start, y + d, insetLabel(), font,
- Color::none, Color::none);
+ Color_none, Color_none);
pi.pain.line(x, y, text_start, y,
- Color::pagebreak, Painter::line_onoffdash);
+ Color_pagebreak, Painter::line_onoffdash);
pi.pain.line(text_end, y, int(x + dim.wid), y,
- Color::pagebreak, Painter::line_onoffdash);
+ Color_pagebreak, Painter::line_onoffdash);
}
#include "InsetSpace.h"
#include "debug.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, Color::latex);
+ pi.pain.lines(xp, yp, 4, Color_latex);
else
- pi.pain.lines(xp, yp, 4, Color::special);
+ pi.pain.lines(xp, yp, 4, Color_special);
}
#include "debug.h"
#include "LaTeXFeatures.h"
-#include "Color.h"
#include "Lexer.h"
#include "MetricsInfo.h"
switch (kind_) {
case HYPHENATION:
{
- font.setColor(Color::special);
+ font.setColor(Color_special);
pi.pain.text(x, y, char_type('-'), font);
break;
}
case LIGATURE_BREAK:
{
- font.setColor(Color::special);
+ font.setColor(Color_special);
pi.pain.text(x, y, char_type('|'), font);
break;
}
case END_OF_SENTENCE:
{
- font.setColor(Color::special);
+ font.setColor(Color_special);
pi.pain.text(x, y, char_type('.'), font);
break;
}
case LDOTS:
{
- font.setColor(Color::special);
+ font.setColor(Color_special);
string ell = ". . . ";
docstring dell(ell.begin(), ell.end());
pi.pain.text(x, y, dell, font);
xp[2] = ox + w; yp[2] = y - h/2;
xp[3] = ox; yp[3] = y;
- pi.pain.lines(xp, yp, 4, Color::special);
+ pi.pain.lines(xp, yp, 4, Color_special);
break;
}
}
#include "Buffer.h"
#include "BufferParams.h"
#include "BufferView.h"
-#include "Color.h"
#include "CoordCache.h"
#include "Counters.h"
#include "Cursor.h"
#include "frontends/Painter.h"
#include "frontends/Selection.h"
+#include <boost/scoped_ptr.hpp>
+
#include <sstream>
#include <iostream>
#include <limits>
int const w = tabular.columnWidth(cell);
if (i >= cs && i <= ce && j >= rs && j <= re)
pi.pain.fillRectangle(xx, y, w, h,
- Color::selection);
+ Color_selection);
xx += w;
}
y += h;
{
int x2 = x + tabular.columnWidth(cell);
bool on_off = false;
- Color::color col = Color::tabularline;
- Color::color onoffcol = Color::tabularonoffline;
+ ColorCode col = Color_tabularline;
+ ColorCode onoffcol = Color_tabularonoffline;
if (erased) {
- col = Color::deletedtext;
- onoffcol = Color::deletedtext;
+ col = Color_deletedtext;
+ onoffcol = Color_deletedtext;
}
if (!tabular.topAlreadyDrawn(cell)) {
#include "gettext.h"
#include "InsetList.h"
#include "Intl.h"
-#include "Color.h"
#include "lyxfind.h"
#include "Lexer.h"
#include "LyXRC.h"
InsetText::InsetText(BufferParams const & bp)
- : drawFrame_(false), frame_color_(Color::insetframe)
+ : drawFrame_(false), frame_color_(Color_insetframe)
{
paragraphs().push_back(Paragraph());
paragraphs().back().layout(bp.getTextClass().defaultLayout());
}
-Color_color InsetText::frameColor() const
+ColorCode InsetText::frameColor() const
{
- return Color::color(frame_color_);
+ return ColorCode(frame_color_);
}
-void InsetText::setFrameColor(Color_color col)
+void InsetText::setFrameColor(ColorCode col)
{
frame_color_ = col;
}
class BufferView;
class CursorSlice;
class Dimension;
-class Color_color;
class ParagraphList;
class InsetTabular;
///
void setDrawFrame(bool);
///
- Color_color frameColor() const;
+ ColorCode frameColor() const;
///
- void setFrameColor(Color_color);
+ void setFrameColor(ColorCode);
///
bool showInsetDialog(BufferView *) const;
///
///
bool drawFrame_;
- /** We store the Color::color value as an int to get Color.h out
+ /** We store the ColorCode value as an int to get Color.h out
* of the header file.
*/
int frame_color_;
Font font(Font::ALL_SANE);
font.decSize();
font.decSize();
- font.setColor(Color::collapsable);
+ font.setColor(Color_collapsable);
setLabelFont(font);
#if 0
setAutoCollapse(false);
#include "DispatchResult.h"
#include "FuncRequest.h"
#include "gettext.h"
-#include "Color.h"
#include "Lexer.h"
#include "Text.h"
#include "MetricsInfo.h"
int d = 0;
Font font;
- font.setColor(Color::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, Color::none, Color::none);
+ lab, font, Color_none, Color_none);
// top arrow
- pi.pain.line(x, ty1, midx, ty2, Color::added_space);
- pi.pain.line(midx, ty2, rightx, ty1, Color::added_space);
+ pi.pain.line(x, ty1, midx, ty2, Color_added_space);
+ pi.pain.line(midx, ty2, rightx, ty1, Color_added_space);
// bottom arrow
- pi.pain.line(x, by1, midx, by2, Color::added_space);
- pi.pain.line(midx, by2, rightx, by1, Color::added_space);
+ pi.pain.line(x, by1, midx, by2, Color_added_space);
+ pi.pain.line(midx, by2, rightx, by1, Color_added_space);
// joining line
- pi.pain.line(midx, ty2, midx, by2, Color::added_space);
+ pi.pain.line(midx, ty2, midx, by2, Color_added_space);
}
#include "FuncStatus.h"
#include "gettext.h"
#include "LaTeXFeatures.h"
-#include "Color.h"
#include "Lexer.h"
#include "OutputParams.h"
#include "TocBackend.h"
Font font(Font::ALL_SANE);
font.decSize();
font.decSize();
- font.setColor(Color::collapsable);
+ font.setColor(Color_collapsable);
setLabelFont(font);
params_.type = type;
params_.lines = 0;
#include "RenderButton.h"
-#include "Color.h"
#include "MetricsInfo.h"
#include "frontends/FontMetrics.h"
{
// Draw it as a box with the LaTeX text
Font font(Font::ALL_SANE);
- font.setColor(Color::command);
+ font.setColor(Color_command);
font.decSize();
if (editable_) {
pi.pain.buttonText(x + 2, y, text_, font, renderState());
} else {
pi.pain.rectText(x + 2, y, text_, font,
- Color::commandbg, Color::commandframe);
+ Color_commandbg, Color_commandframe);
}
}
#include "insets/Inset.h"
#include "gettext.h"
-#include "Color.h"
#include "LyX.h"
#include "LyXRC.h"
#include "MetricsInfo.h"
y - dim_.asc,
dim_.wid - 2 * Inset::TEXT_TO_INSET_OFFSET,
dim_.asc + dim_.des,
- Color::foreground);
+ Color_foreground);
// Print the file name.
Font msgFont = pi.base.font;
#include "insets/Inset.h"
#include "BufferView.h"
-#include "Color.h"
#include "Dimension.h"
#include "gettext.h"
#include "LyX.h"
y - dim_.asc,
dim_.wid - 2 * offset,
dim_.asc + dim_.des,
- Color::foreground);
+ Color_foreground);
Font font(pi.base.font);
font.setFamily(Font::SANS_FAMILY);
#include "Cursor.h"
#include "debug.h"
#include "gettext.h"
-#include "Color.h"
#include "Lexer.h"
#include "OutputParams.h"
{
// label
Font font = p.base.font;
- font.setColor(Color::math);
+ font.setColor(Color_math);
PainterInfo pi(p.base.bv, p.pain);
pi.base.style = LM_ST_TEXT;
int const w = dim_.wid - 2;
int const h = dim_.height() - 2;
- // Color::mathbg used to be "AntiqueWhite" but is "linen" now, too
- pi.pain.fillRectangle(x, a, w, h, Color::mathmacrobg);
- pi.pain.rectangle(x, a, w, h, Color::mathframe);
+ // Color_mathbg used to be "AntiqueWhite" but is "linen" now, too
+ pi.pain.fillRectangle(x, a, w, h, Color_mathmacrobg);
+ pi.pain.rectangle(x, a, w, h, Color_mathframe);
// FIXME
#if 0
#include "support/textutils.h"
#include <boost/current_function.hpp>
+#include <boost/assert.hpp>
using std::endl;
#include "MathData.h"
#include "MathStream.h"
#include "LaTeXFeatures.h"
-#include "Color.h"
#include "support/std_ostream.h"
#include "frontends/Painter.h"
{
Dimension const dim = dimension(*pi.base.bv);
pi.pain.rectangle(x + 1, y - dim.ascent() + 1,
- dim.width() - 2, dim.height() - 2, Color::foreground);
+ dim.width() - 2, dim.height() - 2, Color_foreground);
cell(0).draw(pi, x + 3, y);
setPosCache(pi, x, y);
}
#include "MathData.h"
#include "MathStream.h"
#include "MathSupport.h"
-#include "Color.h"
#include "frontends/FontMetrics.h"
#include "frontends/Painter.h"
void InsetMathBrace::draw(PainterInfo & pi, int x, int y) const
{
Font font = pi.base.font;
- font.setColor(Color::latex);
+ font.setColor(Color_latex);
Dimension t = theFontMetrics(font).dimension('{');
pi.pain.text(x, y, '{', font);
cell(0).draw(pi, x + t.wid, y);
#include <config.h>
+#include "Color.h"
#include "InsetMathColor.h"
#include "MathData.h"
#include "MathStream.h"
namespace lyx {
-InsetMathColor::InsetMathColor(bool oldstyle, Color_color const & color)
+InsetMathColor::InsetMathColor(bool oldstyle, ColorCode color)
: InsetMathNest(1), oldstyle_(oldstyle),
color_(from_utf8(lcolor.getLaTeXName(color)))
{}
void InsetMathColor::draw(PainterInfo & pi, int x, int y) const
{
- Color_color origcol = pi.base.font.color();
+ ColorCode origcol = pi.base.font.color();
pi.base.font.setColor(lcolor.getFromLaTeXName(to_utf8(color_)));
cell(0).draw(pi, x + 1, y);
pi.base.font.setColor(origcol);
#ifndef MATH_COLORINSET_H
#define MATH_COLORINSET_H
-#include "Color.h"
-
#include "InsetMathNest.h"
public:
/// Create a color inset from LyX color number
explicit InsetMathColor(bool oldstyle,
- Color_color const & color = Color::none);
+ ColorCode color = Color_none);
/// Create a color inset from LaTeX color name
explicit InsetMathColor(bool oldstyle, docstring const & color);
///
#include "MathData.h"
#include "MathStream.h"
#include "LaTeXFeatures.h"
-#include "Color.h"
#include "frontends/Painter.h"
int m = x + dim.wid / 2;
cell(0).draw(pi, m - dim0.wid / 2, y - dim0.des - 2 - 5);
cell(1).draw(pi, m - dim1.wid / 2, y + dim1.asc + 2 - 5);
- pi.pain.line(x + 1, y - 5, x + dim.wid - 2, y - 5, Color::math);
+ pi.pain.line(x + 1, y - 5, x + dim.wid - 2, y - 5, Color_math);
setPosCache(pi, x, y);
}
#include "InsetMathFBox.h"
#include "MathData.h"
#include "MathStream.h"
-#include "Color.h"
#include "support/std_ostream.h"
#include "frontends/Painter.h"
{
Dimension const dim = dimension(*pi.base.bv);
pi.pain.rectangle(x + 1, y - dim.ascent() + 1,
- dim.width() - 2, dim.height() - 2, Color::foreground);
+ dim.width() - 2, dim.height() - 2, Color_foreground);
FontSetChanger dummy(pi.base, "textnormal");
cell(0).draw(pi, x + 3, y);
setPosCache(pi, x, y);
#include "MathStream.h"
#include "TextPainter.h"
#include "LaTeXFeatures.h"
-#include "Color.h"
#include "Cursor.h"
#include "frontends/Painter.h"
pi.pain.line(xx + dim0.wid,
y + dim.des - 2,
xx + dim0.wid + 5,
- y - dim.asc + 2, Color::math);
+ y - dim.asc + 2, Color_math);
}
if (kind_ == FRAC || kind_ == OVER)
pi.pain.line(x + 1, y - 5,
- x + dim.wid - 2, y - 5, Color::math);
+ x + dim.wid - 2, y - 5, Color_math);
drawMarkers(pi, x, y);
}
#include "MathData.h"
#include "MathStream.h"
#include "MathSupport.h"
-#include "Color.h"
#include "frontends/Painter.h"
FontSetChanger dummy(pi.base, "textnormal");
Dimension const dim = dimension(*pi.base.bv);
pi.pain.rectangle(x + 1, y - dim.ascent() + 1,
- dim.width() - 2, dim.height() - 2, Color::foreground);
+ dim.width() - 2, dim.height() - 2, Color_foreground);
x += 5;
BufferView const & bv = *pi.base.bv;
#include "BufferView.h"
#include "CutAndPaste.h"
#include "FuncStatus.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,
- Color::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,
- Color::foreground);
+ Color_foreground);
}
drawMarkers2(pi, x, y);
}
#include "BufferView.h"
#include "CutAndPaste.h"
#include "FuncStatus.h"
-#include "Color.h"
#include "LaTeXFeatures.h"
#include "Cursor.h"
#include "debug.h"
// selection at the top level of nested inset is difficult to handle.
if (!editing(pi.base.bv))
pi.pain.fillRectangle(x + 1, y - dim.asc + 1, dim.wid - 2,
- dim.asc + dim.des - 1, Color::mathbg);
+ dim.asc + dim.des - 1, Color_mathbg);
if (use_preview_) {
// one pixel gap in front
Font font;
bool b;
font.fromString(to_utf8(arg), b);
- if (font.color() != Color::inherit) {
+ if (font.color() != Color_inherit) {
MathAtom at = MathAtom(new InsetMathColor(true, font.color()));
cur.handleNest(at, 0);
}
#include "Bidi.h"
#include "BufferView.h"
-#include "Color.h"
#include "CoordCache.h"
#include "Cursor.h"
#include "CutAndPaste.h"
#if 0
if (lock_)
pi.pain.fillRectangle(x, y - ascent(), width(), height(),
- Color::mathlockbg);
+ Color_mathlockbg);
#endif
setPosCache(pi, x, y);
}
int y1 = g.pos.y_ - g.dim.ascent();
int x2 = g.pos.x_ + c.pos2x(s2.pos());
int y2 = g.pos.y_ + g.dim.descent();
- pi.pain.fillRectangle(x1, y1, x2 - x1, y2 - y1, Color::selection);
+ pi.pain.fillRectangle(x1, y1, x2 - x1, y2 - y1, Color_selection);
//lyxerr << "InsetMathNest::drawing selection 3: "
// << " x1: " << x1 << " x2: " << x2
// << " y1: " << y1 << " y2: " << y2 << endl;
int y1 = g.pos.y_ - g.dim.ascent();
int x2 = g.pos.x_ + g.dim.width();
int y2 = g.pos.y_ + g.dim.descent();
- pi.pain.fillRectangle(x1, y1, x2 - x1, y2 - y1, Color::selection);
+ pi.pain.fillRectangle(x1, y1, x2 - x1, y2 - y1, Color_selection);
}
}
}
Font font;
bool b;
font.fromString(to_utf8(arg), b);
- if (font.color() != Color::inherit) {
+ if (font.color() != Color_inherit) {
MathAtom at = MathAtom(new InsetMathColor(true, font.color()));
cur.handleNest(at, 0);
}
#include "MathStream.h"
#include "MathStream.h"
-#include "Color.h"
#include "frontends/Painter.h"
static int const arrow_size = 4;
// We first draw the text and then an arrow
- Color_color const origcol = pi.base.font.color();
- pi.base.font.setColor(Color::special);
+ ColorCode const origcol = pi.base.font.color();
+ pi.base.font.setColor(Color_special);
cell(0).draw(pi, x + 1, y);
pi.base.font.setColor(origcol);
Dimension const dim = dimension(*pi.base.bv);
int const y3 = y4 - arrow_size;
// top arrow
- pi.pain.line(x2, y1, x1, y2, Color::added_space);
- pi.pain.line(x2, y1, x3, y2, Color::added_space);
+ pi.pain.line(x2, y1, x1, y2, Color_added_space);
+ pi.pain.line(x2, y1, x3, y2, Color_added_space);
// bottom arrow
- pi.pain.line(x2, y4, x1, y3, Color::added_space);
- pi.pain.line(x2, y4, x3, y3, Color::added_space);
+ pi.pain.line(x2, y4, x1, y3, Color_added_space);
+ pi.pain.line(x2, y4, x3, y3, Color_added_space);
// joining line
- pi.pain.line(x2, y1, x2, y4, Color::added_space);
+ pi.pain.line(x2, y1, x2, y4, Color_added_space);
}
if (kind_ == phantom || kind_ == hphantom) {
int const y3 = y2 + arrow_size;
// left arrow
- pi.pain.line(x1, y2, x2, y3, Color::added_space);
- pi.pain.line(x1, y2, x2, y1, Color::added_space);
+ pi.pain.line(x1, y2, x2, y3, Color_added_space);
+ pi.pain.line(x1, y2, x2, y1, Color_added_space);
// right arrow
- pi.pain.line(x4, y2, x3, y3, Color::added_space);
- pi.pain.line(x4, y2, x3, y1, Color::added_space);
+ pi.pain.line(x4, y2, x3, y3, Color_added_space);
+ pi.pain.line(x4, y2, x3, y1, Color_added_space);
// joining line
- pi.pain.line(x1, y2, x4, y2, Color::added_space);
+ pi.pain.line(x1, y2, x4, y2, Color_added_space);
}
drawMarkers(pi, x, y);
#include "MathData.h"
#include "MathStream.h"
#include "Cursor.h"
-#include "Color.h"
#include "frontends/Painter.h"
int xp[4];
int yp[4];
pi.pain.line(x + dim.width(), y - a + 1,
- x + w + 4, y - a + 1, Color::math);
+ x + w + 4, y - a + 1, Color_math);
xp[0] = x + w + 4; yp[0] = y - a + 1;
xp[1] = x + w; yp[1] = y + d;
xp[2] = x + w - 2; yp[2] = y + (d - a)/2 + 2;
xp[3] = x + w - 5; yp[3] = y + (d - a)/2 + 4;
- pi.pain.lines(xp, yp, 4, Color::math);
+ pi.pain.lines(xp, yp, 4, Color_math);
drawMarkers(pi, x, y);
}
#include "MathStream.h"
#include "LaTeXFeatures.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) ? Color::latex : Color::math);
+ pi.pain.lines(xp, yp, 4, (space_ < 3) ? Color_latex : Color_math);
}
#include "MathData.h"
#include "MathStream.h"
#include "TextPainter.h"
-#include "Color.h"
#include "frontends/Painter.h"
int xp[3];
int yp[3];
pi.pain.line(x + dim.width(), y - a + 1,
- x + 8, y - a + 1, Color::math);
+ x + 8, y - a + 1, Color_math);
xp[0] = x + 8; yp[0] = y - a + 1;
xp[1] = x + 5; yp[1] = y + d - 1;
xp[2] = x; yp[2] = y + (d - a)/2;
- pi.pain.lines(xp, yp, 3, Color::math);
+ pi.pain.lines(xp, yp, 3, Color_math);
drawMarkers(pi, x, y);
}
#include "MathStream.h"
#include "LaTeXFeatures.h"
-#include "Color.h"
#include "frontends/Painter.h"
int m = x + dim.wid / 2;
cell(0).draw(pi, m - dim0.width() / 2, y - dim0.descent() - 2 - 5);
cell(1).draw(pi, m - dim1.width() / 2, y + dim1.ascent() + 2 - 5);
- pi.pain.line(x + 1, y - 5, x + dim.wid - 2, y - 5, Color::math);
+ pi.pain.line(x + 1, y - 5, x + dim.wid - 2, y - 5, Color_math);
setPosCache(pi, x, y);
}
pi.pain.text(x, y, "X");
MathData const & s = sourceCell();
MathData const & t = targetCell();
- pi.pain.line(s.xm(), s.ym(), t.xm(), t.ym(), Color::math);
+ pi.pain.line(s.xm(), s.ym(), t.xm(), t.ym(), Color_math);
cell(1).draw(pi, (s.xm() + t.xm())/2, (s.ym() + t.ym())/2);
}
#include "Buffer.h"
#include "BufferView.h"
#include "CoordCache.h"
-#include "Color.h"
#include "Cursor.h"
#include "debug.h"
Dimension const & dim = bv.coordCache().getArrays().dim(this);
if (empty()) {
- pi.pain.rectangle(x, y - dim.ascent(), dim.width(), dim.height(), Color::mathline);
+ pi.pain.rectangle(x, y - dim.ascent(), dim.width(), dim.height(), Color_mathline);
return;
}
#include "debug.h"
#include "gettext.h"
#include "Lexer.h"
-#include "Color.h"
#include "frontends/FontMetrics.h"
#include "frontends/Painter.h"
// label
Font font = p.base.font;
- font.setColor(Color::math);
+ font.setColor(Color_math);
PainterInfo pi(p.base.bv, p.pain);
pi.base.style = LM_ST_TEXT;
int const w = dim.wid - 2;
int const h = dim.height() - 2;
- // Color::mathbg used to be "AntiqueWhite" but is "linen" now, too
+ // Color_mathbg used to be "AntiqueWhite" but is "linen" now, too
// the next line would overwrite the selection!
- //pi.pain.fillRectangle(x, a, w, h, Color::mathmacrobg);
- pi.pain.rectangle(x, a, w, h, Color::mathframe);
+ //pi.pain.fillRectangle(x, a, w, h, Color_mathmacrobg);
+ pi.pain.rectangle(x, a, w, h, Color_mathframe);
// FIXME:
#if 0
int const w1 = cell(1).dimension(*pi.base.bv).width();
cell(0).draw(pi, x + 2, y + 1);
pi.pain.rectangle(x, y - dim.ascent() + 3,
- w0 + 4, dim.height() - 6, Color::mathline);
+ w0 + 4, dim.height() - 6, Color_mathline);
cell(1).draw(pi, x + 8 + w0, y + 1);
pi.pain.rectangle(x + w0 + 6, y - dim.ascent() + 3,
- w1 + 4, dim.height() - 6, Color::mathline);
+ w1 + 4, dim.height() - 6, Color_mathline);
if (lockMacro)
MacroTable::globalMacros().get(name_).unlock();
#include <config.h>
-#include "MathSupport.h"
-#include "MathData.h"
#include "InsetMath.h"
-#include "MathStream.h"
+#include "MathData.h"
#include "MathParser.h"
+#include "MathStream.h"
+#include "MathSupport.h"
#include "debug.h"
-#include "Color.h"
#include "frontends/FontLoader.h"
#include "frontends/FontMetrics.h"
{
if (name == ".") {
pi.pain.line(x + w/2, y, x + w/2, y + h,
- Color::cursor, Painter::line_onoffdash);
+ Color_cursor, Painter::line_onoffdash);
return;
}
pi.pain.line(
int(x + xx + 0.5), int(y + yy + 0.5),
int(x + x2 + 0.5), int(y + y2 + 0.5),
- Color::math);
+ Color_math);
} else {
int xp[32];
int yp[32];
yp[j] = int(y + yy + 0.5);
// lyxerr << "P[" << j ' ' << xx << ' ' << yy << ' ' << x << ' ' << y << ']';
}
- pi.pain.lines(xp, yp, n, Color::math);
+ pi.pain.lines(xp, yp, n, Color_math);
}
}
}
void drawStrRed(PainterInfo & pi, int x, int y, docstring const & str)
{
Font f = pi.base.font;
- f.setColor(Color::latex);
+ f.setColor(Color_latex);
pi.pain.text(x, y, str, f);
}
void drawStrBlack(PainterInfo & pi, int x, int y, docstring const & str)
{
Font f = pi.base.font;
- f.setColor(Color::foreground);
+ f.setColor(Color_foreground);
pi.pain.text(x, y, str, f);
}
Font::FONT_FAMILY family_;
Font::FONT_SERIES series_;
Font::FONT_SHAPE shape_;
- Color::color color_;
+ ColorCode color_;
};
fontinfo fontinfos[] = {
// math fonts
{"mathnormal", Font::ROMAN_FAMILY, Font::MEDIUM_SERIES,
- Font::ITALIC_SHAPE, Color::math},
+ Font::ITALIC_SHAPE, Color_math},
{"mathbf", inh_family, Font::BOLD_SERIES,
- inh_shape, Color::math},
+ inh_shape, Color_math},
{"mathcal", Font::CMSY_FAMILY, inh_series,
- inh_shape, Color::math},
+ inh_shape, Color_math},
{"mathfrak", Font::EUFRAK_FAMILY, inh_series,
- inh_shape, Color::math},
+ inh_shape, Color_math},
{"mathrm", Font::ROMAN_FAMILY, inh_series,
- Font::UP_SHAPE, Color::math},
+ Font::UP_SHAPE, Color_math},
{"mathsf", Font::SANS_FAMILY, inh_series,
- inh_shape, Color::math},
+ inh_shape, Color_math},
{"mathbb", Font::MSB_FAMILY, inh_series,
- inh_shape, Color::math},
+ inh_shape, Color_math},
{"mathtt", Font::TYPEWRITER_FAMILY, inh_series,
- inh_shape, Color::math},
+ inh_shape, Color_math},
{"mathit", inh_family, inh_series,
- Font::ITALIC_SHAPE, Color::math},
+ Font::ITALIC_SHAPE, Color_math},
{"cmex", Font::CMEX_FAMILY, inh_series,
- inh_shape, Color::math},
+ inh_shape, Color_math},
{"cmm", Font::CMM_FAMILY, inh_series,
- inh_shape, Color::math},
+ inh_shape, Color_math},
{"cmr", Font::CMR_FAMILY, inh_series,
- inh_shape, Color::math},
+ inh_shape, Color_math},
{"cmsy", Font::CMSY_FAMILY, inh_series,
- inh_shape, Color::math},
+ inh_shape, Color_math},
{"eufrak", Font::EUFRAK_FAMILY, inh_series,
- inh_shape, Color::math},
+ inh_shape, Color_math},
{"msa", Font::MSA_FAMILY, inh_series,
- inh_shape, Color::math},
+ inh_shape, Color_math},
{"msb", Font::MSB_FAMILY, inh_series,
- inh_shape, Color::math},
+ inh_shape, Color_math},
{"wasy", Font::WASY_FAMILY, inh_series,
- inh_shape, Color::math},
+ inh_shape, Color_math},
{"esint", Font::ESINT_FAMILY, inh_series,
- inh_shape, Color::math},
+ inh_shape, Color_math},
// Text fonts
{"text", inh_family, inh_series,
- inh_shape, Color::foreground},
+ inh_shape, Color_foreground},
{"textbf", inh_family, Font::BOLD_SERIES,
- inh_shape, Color::foreground},
+ inh_shape, Color_foreground},
{"textit", inh_family, inh_series,
- Font::ITALIC_SHAPE, Color::foreground},
+ Font::ITALIC_SHAPE, Color_foreground},
{"textmd", inh_family, Font::MEDIUM_SERIES,
- inh_shape, Color::foreground},
+ inh_shape, Color_foreground},
{"textnormal", inh_family, inh_series,
- Font::UP_SHAPE, Color::foreground},
+ Font::UP_SHAPE, Color_foreground},
{"textrm", Font::ROMAN_FAMILY,
- inh_series, Font::UP_SHAPE,Color::foreground},
+ inh_series, Font::UP_SHAPE,Color_foreground},
{"textsc", inh_family, inh_series,
- Font::SMALLCAPS_SHAPE, Color::foreground},
+ Font::SMALLCAPS_SHAPE, Color_foreground},
{"textsf", Font::SANS_FAMILY, inh_series,
- inh_shape, Color::foreground},
+ inh_shape, Color_foreground},
{"textsl", inh_family, inh_series,
- Font::SLANTED_SHAPE, Color::foreground},
+ Font::SLANTED_SHAPE, Color_foreground},
{"texttt", Font::TYPEWRITER_FAMILY, inh_series,
- inh_shape, Color::foreground},
+ inh_shape, Color_foreground},
{"textup", inh_family, inh_series,
- Font::UP_SHAPE, Color::foreground},
+ Font::UP_SHAPE, Color_foreground},
// TIPA support
{"textipa", inh_family, inh_series,
- inh_shape, Color::foreground},
+ inh_shape, Color_foreground},
// LyX internal usage
{"lyxtex", inh_family, inh_series,
- Font::UP_SHAPE, Color::latex},
+ Font::UP_SHAPE, Color_latex},
{"lyxsymbol", Font::SYMBOL_FAMILY, inh_series,
- inh_shape, Color::math},
+ inh_shape, Color_math},
{"lyxboldsymbol", Font::SYMBOL_FAMILY, Font::BOLD_SERIES,
- inh_shape, Color::math},
+ inh_shape, Color_math},
{"lyxblacktext", Font::ROMAN_FAMILY, Font::MEDIUM_SERIES,
- Font::UP_SHAPE, Color::foreground},
+ Font::UP_SHAPE, Color_foreground},
{"lyxnochange", inh_family, inh_series,
- inh_shape, Color::foreground},
+ inh_shape, Color_foreground},
{"lyxfakebb", Font::TYPEWRITER_FAMILY, Font::BOLD_SERIES,
- Font::UP_SHAPE, Color::math},
+ Font::UP_SHAPE, Color_math},
{"lyxfakecal", Font::SANS_FAMILY, Font::MEDIUM_SERIES,
- Font::ITALIC_SHAPE, Color::math},
+ Font::ITALIC_SHAPE, Color_math},
{"lyxfakefrak", Font::ROMAN_FAMILY, Font::BOLD_SERIES,
- Font::ITALIC_SHAPE, Color::math}
+ Font::ITALIC_SHAPE, Color_math}
};
font.setSeries(info->series_);
if (info->shape_ != inh_shape)
font.setShape(info->shape_);
- if (info->color_ != Color::none)
+ if (info->color_ != Color_none)
font.setColor(info->color_);
}
#include "Bidi.h"
#include "Buffer.h"
#include "CoordCache.h"
-#include "Color.h"
#include "Cursor.h"
#include "debug.h"
#include "BufferParams.h"
int const y0 = yo_;
int const y1 = y0 - defaultRowHeight() / 2;
- pi_.pain.line(int(x_), y1, int(x_), y0, Color::added_space);
+ pi_.pain.line(int(x_), y1, int(x_), y0, Color_added_space);
if (pm_.hfillExpansion(row_, pos)) {
int const y2 = (y0 + y1) / 2;
if (pos >= body_pos) {
pi_.pain.line(int(x_), y2, int(x_ + row_.hfill), y2,
- Color::added_space,
+ Color_added_space,
Painter::line_onoffdash);
x_ += row_.hfill;
} else {
pi_.pain.line(int(x_), y2, int(x_ + row_.label_hfill), y2,
- Color::added_space,
+ Color_added_space,
Painter::line_onoffdash);
x_ += row_.label_hfill;
}
- pi_.pain.line(int(x_), y1, int(x_), y0, Color::added_space);
+ pi_.pain.line(int(x_), y1, int(x_), y0, Color_added_space);
}
x_ += 2;
}
int const x2 = x1 + dim.wid;
int const y1 = yo_ + dim.des;
int const y2 = yo_ - dim.asc;
- pi_.pain.line(x1, y1, x1, y2, Color::green);
- pi_.pain.line(x1, y1, x2, y1, Color::green);
- pi_.pain.line(x2, y1, x2, y2, Color::green);
- pi_.pain.line(x1, y2, x2, y2, Color::green);
+ pi_.pain.line(x1, y1, x1, y2, Color_green);
+ pi_.pain.line(x1, y1, x2, y1, Color_green);
+ pi_.pain.line(x2, y1, x2, y2, Color_green);
+ pi_.pain.line(x1, y2, x2, y2, Color_green);
#endif
}
if (prev_change != Change::UNCHANGED) {
Font copy(font);
if (prev_change == Change::DELETED) {
- copy.setColor(Color::deletedtext);
+ copy.setColor(Color_deletedtext);
} else if (prev_change == Change::INSERTED) {
- copy.setColor(Color::addedtext);
+ copy.setColor(Color_addedtext);
}
x_ += pi_.pain.text(int(x_), yo_, s, copy);
} else {
return;
int const y = yo_ + 1 + desc;
- pi_.pain.line(int(orig_x), y, int(x_), y, Color::language);
+ pi_.pain.line(int(orig_x), y, int(x_), y, Color_language);
}
? row_.ascent()
: row_.height();
- pi_.pain.fillRectangle(5, yo_ - row_.ascent(), 3, height, Color::changebar);
+ pi_.pain.fillRectangle(5, yo_ - row_.ascent(), 3, height, Color_changebar);
}
if (par_.params().startOfAppendix())
y += 2 * defaultRowHeight();
- pi_.pain.line(1, y, 1, yo_ + row_.height(), Color::appendix);
- pi_.pain.line(width_ - 2, y, width_ - 2, yo_ + row_.height(), Color::appendix);
+ pi_.pain.line(1, y, 1, yo_ + row_.height(), Color_appendix);
+ pi_.pain.line(width_ - 2, y, width_ - 2, yo_ + row_.height(), Color_appendix);
}
int const starty = yo_ - row_.ascent();
int const h = row_.height() - 1 - (i - next_depth - 1) * 3;
- pi_.pain.line(x, starty, x, starty + h, Color::depthbar);
+ pi_.pain.line(x, starty, x, starty + h, Color_depthbar);
if (i > prev_depth)
- pi_.pain.fillRectangle(x, starty, w, 2, Color::depthbar);
+ pi_.pain.fillRectangle(x, starty, w, 2, Color_depthbar);
if (i > next_depth)
- pi_.pain.fillRectangle(x, starty + h, w, 2, Color::depthbar);
+ pi_.pain.fillRectangle(x, starty + h, w, 2, Color_depthbar);
}
}
int RowPainter::paintAppendixStart(int y)
{
Font pb_font;
- pb_font.setColor(Color::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;
- pi_.pain.rectText(text_start, y + d, label, pb_font, Color::none, Color::none);
+ pi_.pain.rectText(text_start, y + d, label, pb_font, Color_none, Color_none);
- pi_.pain.line(int(xo_ + 1), y, text_start, y, Color::appendix);
- pi_.pain.line(text_end, y, int(xo_ + width_ - 2), y, Color::appendix);
+ pi_.pain.line(int(xo_ + 1), y, text_start, y, Color_appendix);
+ pi_.pain.line(text_end, y, int(xo_ + width_ - 2), y, Color_appendix);
return 3 * defaultRowHeight();
}
if (par_.isInserted(par_.size()) || par_.isDeleted(par_.size())) {
FontMetrics const & fm = theFontMetrics(pi_.base.bv->buffer().params().getFont());
int const length = fm.maxAscent() / 2;
- Color::color col = par_.isInserted(par_.size()) ? Color::addedtext : Color::deletedtext;
+ ColorCode col = par_.isInserted(par_.size()) ? Color_addedtext : Color_deletedtext;
pi_.pain.line(int(x_) + 1, yo_ + 2, int(x_) + 1, yo_ + 2 - length, col,
Painter::line_solid, Painter::line_thick);
x += (size - width_ + row_.width() + 1) * (is_rtl ? -1 : 1);
if (endlabel == END_LABEL_BOX)
- pi_.pain.rectangle(x, y, size, size, Color::eolmarker);
+ pi_.pain.rectangle(x, y, size, size, Color_eolmarker);
else
- pi_.pain.fillRectangle(x, y, size, size, Color::eolmarker);
+ pi_.pain.fillRectangle(x, y, size, size, Color_eolmarker);
break;
}
= theFontMetrics(pi_.base.bv->buffer().params().getFont());
int const middle = yo_ - fm.maxAscent() / 3;
pi_.pain.line(last_strikeout_x, middle, int(x_), middle,
- Color::deletedtext, Painter::line_solid, Painter::line_thin);
+ Color_deletedtext, Painter::line_solid, Painter::line_thin);
running_strikeout = false;
}
= theFontMetrics(pi_.base.bv->buffer().params().getFont());
int const middle = yo_ - fm.maxAscent() / 3;
pi_.pain.line(last_strikeout_x, middle, int(x_), middle,
- Color::deletedtext, Painter::line_solid, Painter::line_thin);
+ Color_deletedtext, Painter::line_solid, Painter::line_thin);
running_strikeout = false;
}
}