Remove all occurences of the old Widget_ColorEdit.
[synfig.git] / synfig-studio / src / gtkmm / mod_palette / dock_paledit.h
1 /* === S Y N F I G ========================================================= */
2 /*!     \file dock_paledit.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_DOCK_PAL_EDIT_H
26 #define __SYNFIG_STUDIO_DOCK_PAL_EDIT_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
39 #include <synfig/gamma.h>
40 #include <synfig/time.h>
41
42 #include <synfigapp/value_desc.h>
43 #include <synfig/time.h>
44
45 #include "../dockable.h"
46 #include <vector>
47 #include <gtkmm/actiongroup.h>
48
49 #include <synfig/palette.h>
50
51 /* === M A C R O S ========================================================= */
52
53 /* === T Y P E D E F S ===================================================== */
54
55 /* === C L A S S E S & S T R U C T S ======================================= */
56
57 namespace synfigapp {
58 class CanvasInterface;
59 };
60
61 namespace studio {
62
63 class Widget_Color;
64 class PaletteSettings;
65
66 class Dock_PalEdit : public Dockable
67 {
68         friend class PaletteSettings;
69
70         Glib::RefPtr<Gtk::ActionGroup> action_group;
71
72         synfig::Palette palette_;
73
74         Gtk::Table table;
75
76         void on_add_pressed();
77
78         void show_menu(int i);
79
80         sigc::signal<void> signal_changed_;
81
82
83 private:
84         int add_color(const synfig::Color& x);
85         void set_color(synfig::Color x, int i);
86         void erase_color(int i);
87
88         void select_color(int i);
89         synfig::Color get_color(int i)const;
90         void edit_color(int i);
91 public:
92         void set_palette(const synfig::Palette& x);
93         const synfig::Palette& get_palette()const { return palette_; }
94
95         int size()const;
96
97         void set_default_palette();
98
99         void refresh();
100
101         const sigc::signal<void>& signal_changed() { return signal_changed_; }
102
103         Dock_PalEdit();
104         ~Dock_PalEdit();
105 }; // END of Dock_PalEdit
106
107 }; // END of namespace studio
108
109 /* === E N D =============================================================== */
110
111 #endif