Allow the user to set the default foreground and background color
[synfig.git] / synfig-studio / trunk / 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/adjustment.h>
32 #include <gtkmm/table.h>
33 #include <gtkmm/button.h>
34 #include <gtkmm/dialog.h>
35 #include <gtkmm/drawingarea.h>
36 #include <gtkmm/optionmenu.h>
37 #include <gtkmm/checkbutton.h>
38 #include <gtkmm/tooltips.h>
39
40 #include <synfig/gamma.h>
41 #include <synfig/time.h>
42
43 #include "widget_coloredit.h"
44
45 #include <synfigapp/value_desc.h>
46 #include <synfig/time.h>
47
48 #include "dialogsettings.h"
49
50 /* === M A C R O S ========================================================= */
51
52 /* === T Y P E D E F S ===================================================== */
53
54 /* === C L A S S E S & S T R U C T S ======================================= */
55
56 namespace Gtk { class Menu; class SpinButton; class Adjustment; };
57
58 namespace synfigapp {
59 class CanvasInterface;
60 };
61
62 namespace studio {
63
64 class Widget_Color;
65
66 class Dialog_Color : public Gtk::Dialog
67 {
68         DialogSettings dialog_settings;
69         Gtk::Tooltips tooltips;
70
71         sigc::signal<void,synfig::Color> signal_edited_;
72         //sigc::signal<void,synfig::Color> signal_apply_;
73
74         bool on_close_pressed();
75         void on_apply_pressed();
76         void on_set_fg_pressed();
77         void on_set_bg_pressed();
78         void on_color_changed();
79
80         Widget_ColorEdit* widget_color;
81
82         bool busy_;
83
84 public:
85         bool busy()const { return busy_; }
86
87         sigc::signal<void,synfig::Color>& signal_edited() { return signal_edited_; }
88
89         //sigc::signal<void,synfig::Color>& signal_apply() { return signal_apply_; }
90
91         void set_color(const synfig::Color& x) { widget_color->set_value(x); }
92
93         synfig::Color get_color()const { return widget_color->get_value(); }
94
95         void reset();
96
97
98         Dialog_Color();
99         ~Dialog_Color();
100
101 //      void edit(const synfigapp::ValueDesc &x, etl::handle<synfigapp::CanvasInterface> canvas_interface, synfig::Time x=0);
102 }; // END of Dialog_Color
103
104 }; // END of namespace studio
105
106 /* === E N D =============================================================== */
107
108 #endif