Use Gtk::ColorSelectionDialog instead of custom color edit widget.
[synfig.git] / synfig-studio / src / gtkmm / dialog_color.h
1 /* === S Y N F I G ========================================================= */
2 /*!     \file dialog_color.h
3 **      \brief Template Header
4 **
5 **      $Id$
6 **
7 **      \legal
8 **      Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
9 **
10 **      This package is free software; you can redistribute it and/or
11 **      modify it under the terms of the GNU General Public License as
12 **      published by the Free Software Foundation; either version 2 of
13 **      the License, or (at your option) any later version.
14 **
15 **      This package is distributed in the hope that it will be useful,
16 **      but WITHOUT ANY WARRANTY; without even the implied warranty of
17 **      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 **      General Public License for more details.
19 **      \endlegal
20 */
21 /* ========================================================================= */
22
23 /* === S T A R T =========================================================== */
24
25 #ifndef __SYNFIG_STUDIO_DIALOG_COLOR_H
26 #define __SYNFIG_STUDIO_DIALOG_COLOR_H
27
28 /* === H E A D E R S ======================================================= */
29
30 #include <gtk/gtk.h>
31 #include <gtkmm/colorselection.h>
32 #include <gtkmm/dialog.h>
33 #include <gtkmm/tooltips.h>
34 #include <sigc++/functors/slot.h>
35
36 #include "widget_coloredit.h"
37 #include "dialogsettings.h"
38
39 /* === M A C R O S ========================================================= */
40
41 /* === T Y P E D E F S ===================================================== */
42
43 /* === C L A S S E S & S T R U C T S ======================================= */
44
45 namespace studio {
46
47 class Widget_Color;
48
49 class Dialog_Color : public Gtk::Dialog
50 {
51         DialogSettings dialog_settings;
52         Gtk::Tooltips tooltips;
53
54         Gtk::ColorSelection* color_edit_widget;
55
56         sigc::signal<void,synfig::Color> signal_edited_;
57
58         bool busy_;
59
60         void create_color_edit_widget();
61         void create_set_color_button(const char *stock_id,
62                         const Glib::ustring& tip_text, int index,
63                         const sigc::slot0<void>& callback);
64         void create_close_button();
65
66         void on_color_changed();
67         void on_set_oc_pressed();
68         void on_set_fc_pressed();
69         bool on_close_pressed();
70
71 public:
72         Dialog_Color();
73         ~Dialog_Color();
74
75         sigc::signal<void,synfig::Color>& signal_edited() { return signal_edited_; }
76
77         void set_color(const synfig::Color& x);
78         synfig::Color get_color() const;
79         void reset();
80
81         bool busy() const { return busy_; }
82
83 }; // END of Dialog_Color
84
85 }; // END of namespace studio
86
87 /* === E N D =============================================================== */
88
89 #endif