]> git.lyx.org Git - lyx.git/blobdiff - src/Color.cpp
Revert 23154.
[lyx.git] / src / Color.cpp
index 93f142399c4e9e956fc61731ea2af39ee8961e92..a1fab2aed2acf2167473b2b07f3535838dc2c933 100644 (file)
@@ -18,9 +18,8 @@
 
 #include "Color.h"
 
-#include "debug.h"
-#include "gettext.h"
-
+#include "support/debug.h"
+#include "support/gettext.h"
 #include "support/lstrings.h"
 
 #include <boost/assert.hpp>
 #include <iomanip>
 
 
-#ifndef CXX_GLOBAL_CSTD
-using std::floor;
-#endif
-
-using std::max;
-using std::min;
-using std::setw;
-
-using std::istringstream;
-using std::ostringstream;
-using std::string;
-using std::endl;
+using namespace std;
+using namespace lyx::support;
 
 namespace lyx {
 
-using support::compare_ascii_no_case;
-using support::ascii_lowercase;
 
 struct ColorSet::ColorEntry {
        ColorCode lcolor;
@@ -62,7 +49,7 @@ static int hexstrToInt(string const & str)
 {
        int val = 0;
        istringstream is(str);
-       is >> std::setbase(16) >> val;
+       is >> setbase(16) >> val;
        return val;
 }
 
@@ -78,7 +65,7 @@ string const X11hexname(RGBColor const & col)
 {
        ostringstream ostr;
 
-       ostr << '#' << std::setbase(16) << std::setfill('0')
+       ostr << '#' << setbase(16) << setfill('0')
             << setw(2) << col.r
             << setw(2) << col.g
             << setw(2) << col.b;
@@ -116,14 +103,24 @@ ColorSet::ColorSet()
        { Color_foreground, N_("text"), "foreground", "black", "foreground" },
        { Color_selection, N_("selection"), "selection", "LightBlue", "selection" },
        { Color_latex, N_("LaTeX text"), "latex", "DarkRed", "latex" },
+       { Color_inlinecompletion, N_("inline completion"),
+               "inlinecompletion", "grey70", "inlinecompletion" },
+       { Color_nonunique_inlinecompletion, N_("non-unique inline completion"),
+               "nonuniqueinlinecompletion", "grey80", "nonuniqueinlinecompletion" },
        { Color_preview, N_("previewed snippet"), "preview", "black", "preview" },
-       { Color_note, N_("note"), "note", "blue", "note" },
+       { Color_note, N_("note"), "note", "yellow", "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_shadedbg, N_("shaded box"), "shaded", "red", "shaded" },
+       { Color_branchlabel, N_("branch label"), "branchlabel", "#c88000", "branchlabel" },
+       { Color_footlabel, N_("footnote label"), "footlabel", "#00aaff", "footlabel" },
+       { Color_indexlabel, N_("index label"), "indexlabel", "green", "indexlabel" },
+       { Color_marginlabel, N_("margin note label"), "marginlabel", "#aa55ff", "marginlabel" },
+       { Color_urllabel, N_("URL label"), "urllabel", "blue", "urllabel" },
+       { Color_urltext, N_("URL text"), "urltext", "blue", "urltext" },
        { Color_depthbar, N_("depth bar"), "depthbar", "IndianRed", "depthbar" },
        { Color_language, N_("language"), "language", "Blue", "language" },
        { Color_command, N_("command inset"), "command", "black", "command" },
@@ -141,7 +138,7 @@ ColorSet::ColorSet()
        { Color_mathmacrohoverbg, N_("Math macro hovered background"), "mathmacrohoverbg", "#cdc3b8", "mathmacrohoverbg" },
        { Color_mathmacrolabel, N_("Math macro label"), "mathmacrolabel", "#a19992", "mathmacrolabel" },
        { Color_mathmacroframe, N_("Math macro frame"), "mathmacroframe", "#ede2d8", "mathmacroframe" },
-       { Color_mathmacroblend, N_("Math macro blended out"), "mathmacroblend", "#000000", "mathmacroblend" },
+       { Color_mathmacroblend, N_("Math macro blended out"), "mathmacroblend", "black", "mathmacroblend" },
        { 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" },
@@ -151,15 +148,16 @@ ColorSet::ColorSet()
        { 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_deletedtext, N_("Deleted text"), "deletedtext", "red", "deletedtext" },
+       { Color_addedtext, N_("Added text"), "addedtext", "blue", "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" },
        { Color_bottomarea, N_("bottom area"), "bottomarea", "grey40", "bottomarea" },
-       { Color_pagebreak, N_("page break"), "pagebreak", "RoyalBlue", "pagebreak" },
+       { Color_newpage, N_("new page"), "newpage", "Blue", "newpage" },
+       { Color_pagebreak, N_("page break / line 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" },
@@ -232,7 +230,7 @@ bool ColorSet::setColor(ColorCode col, string const & x11name)
        InfoTab::iterator it = infotab.find(col);
        if (it == infotab.end()) {
                lyxerr << "Color " << col << " not found in database."
-                      << std::endl;
+                      << endl;
                return false;
        }
 
@@ -253,9 +251,8 @@ bool ColorSet::setColor(string const & lyxname, string const &x11name)
 {
        string const lcname = ascii_lowercase(lyxname);
        if (lyxcolors.find(lcname) == lyxcolors.end()) {
-               LYXERR(Debug::GUI)
-                       << "ColorSet::setColor: Unknown color \""
-                      << lyxname << '"' << endl;
+               LYXERR(Debug::GUI, "ColorSet::setColor: Unknown color \""
+                      << lyxname << '"');
                addColor(static_cast<ColorCode>(infotab.size()), lcname);
        }