+ class Colors {
+ public:
+ ///
+ enum GuiColors {
+ GUI_COLOR_CHOICE = FL_FREE_COL1,
+ GUI_COLOR_HUE_DIAL = FL_FREE_COL2,
+ GUI_COLOR_CURSOR = FL_FREE_COL3
+ };
+ ///
+ Colors(FormPreferences & p);
+ ///
+ FD_form_colors const * dialog();
+ ///
+ void apply(); // not const as modifies modifiedXformsPrefs.
+ ///
+ void build();
+ ///
+ string const feedback(FL_OBJECT const * const) const;
+ ///
+ void input(FL_OBJECT const * const);
+ ///
+ void update() { LoadBrowserLyX(); }
+
+ /// Flag whether Xforms colors have changed since last file save
+ bool modifiedXformsPrefs;
+
+ private:
+ ///
+ void AdjustVal(int, int, double) const;
+ ///
+ void InputBrowserLyX() const;
+ ///
+ void InputHSV();
+ ///
+ void InputRGB();
+ ///
+ void LoadBrowserLyX();
+ ///
+ void Modify();
+ ///
+ void SwitchColorSpace() const;
+ ///
+ string const X11hexname(RGBColor const &) const;
+
+ ///
+ FormPreferences & parent_;
+ ///
+ boost::scoped_ptr<FD_form_colors> dialog_;
+
+ /// A vector of LyX LColor GUI name and associated RGB color.
+ std::vector<NamedColor> lyxColorDB;
+ /// A vector of xforms color ID, RGB colors and associated name.
+ std::vector<XformsColor> xformsColorDB;
+ };