X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FLColor.h;h=c6bf6cebf7c47a754bd67411c3643b61157cd712;hb=a617e0d978b460f5529737da1f1c73088e45a6eb;hp=8c84cd6956a7af0d7236a7c32d96570e348bfecd;hpb=1cad117882dc393b2d55174c6f2ab67920a54ce1;p=lyx.git diff --git a/src/LColor.h b/src/LColor.h index 8c84cd6956..c6bf6cebf7 100644 --- a/src/LColor.h +++ b/src/LColor.h @@ -22,14 +22,15 @@ #include #include -/** - This is a stateless class. - - It has one basic purposes: - To serve as a color-namespace container (the Color enum). +namespace lyx { - */ +/** + * This is a stateless class. + * + * It has one basic purposes: + * To serve as a color-namespace container (the Color enum). + */ /** * \class LColor * @@ -95,7 +96,8 @@ public: greyedout, /// Background color of greyedout inset greyedoutbg, - + /// Shaded box background + shadedbg, /// Color for the depth bars in the margin depthbar, @@ -191,13 +193,19 @@ public: /// ~LColor(); /// - void operator=(LColor const &); + 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. std::string const getGUIName(LColor::color c) const; @@ -214,11 +222,13 @@ public: LColor::color getFromGUIName(std::string const & guiname) 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; /// - struct Pimpl; + class Pimpl; /// boost::scoped_ptr pimpl_; }; @@ -228,15 +238,15 @@ private: * passed as a function argument without having to expose LColor.h. */ class LColor_color { - LColor::color val_; + LColor::color val_; public: - /** The default constructor is nasty, + /** The default constructor is nasty, * but allows us to use LColor_color in STL containers. */ LColor_color() : val_(static_cast(-1)) {} LColor_color(LColor::color val) : val_(val) {} - operator LColor::color() const{ return val_; } + operator LColor::color() const{ return val_; } }; @@ -245,4 +255,7 @@ extern LColor lcolor; /// the system color definitions extern LColor system_lcolor; + +} // namespace lyx + #endif