Code

477aa1c191851f19ac29a6ad149df22952827ab5
[inkscape.git] / src / ui / widget / color-picker.h
1 /** @file
2  * @brief Color picker button and window.
3  */
4 /* Authors:
5  *   Lauris Kaplinski <lauris@kaplinski.com>
6  *   Ralf Stephan <ralf@ark.in-berlin.de>
7  *
8  * Copyright (C) Authors 2000-2005
9  *
10  * Released under GNU GPL, read the file 'COPYING' for more information
11  */
13 #ifndef __COLOR_PICKER_H__
14 #define __COLOR_PICKER_H__
16 #include <sigc++/sigc++.h>
17 #include <gtkmm/button.h>
18 #include <gtkmm/dialog.h>
19 #include <gtkmm/tooltips.h>
20 #include "widgets/sp-color-selector.h"
21 #include "ui/widget/color-preview.h"
22 //#include "ui/dialog/dialog.h"
26 namespace Inkscape
27 {
28 namespace UI
29 {
30 namespace Widget
31 {
34 class ColorPicker : public Gtk::Button {
35 public:
37     ColorPicker (const Glib::ustring& title,
38                  const Glib::ustring& tip,
39                  const guint32 rgba,
40                  bool undo);
42     virtual ~ColorPicker();
44     void setRgba32 (guint32 rgba);
46     void closeWindow();
48     sigc::connection connectChanged (const sigc::slot<void,guint>& slot)
49         { return _changed_signal.connect (slot); }
51 protected:
53     friend void sp_color_picker_color_mod(SPColorSelector *csel, GObject *cp);
54     virtual void on_clicked();
55     virtual void on_changed (guint32);
57     ColorPreview        _preview;
58     Gtk::Tooltips       _tt;
60     /*const*/ Glib::ustring _title;
61     sigc::signal<void,guint32> _changed_signal;
62     guint32             _rgba;
63     bool                _undo;
66     //Dialog
67     void setupDialog(const Glib::ustring &title);
68     //Inkscape::UI::Dialog::Dialog _colorSelectorDialog;
69     Gtk::Dialog _colorSelectorDialog;
70     SPColorSelector *_colorSelector;
72 };
74 }//namespace Widget
75 }//namespace UI
76 }//namespace Inkscape
78 #endif /* !__COLOR_PICKER_H__ */
80 /*
81   Local Variables:
82   mode:c++
83   c-file-style:"stroustrup"
84   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
85   indent-tabs-mode:nil
86   fill-column:99
87   End:
88 */
89 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :