Fix bugs in previous commit that caused FTBFS in synfig and ETL FTBFS with older...
[synfig.git] / synfig-studio / tags / synfigstudio_0_61_03 / synfig-studio / src / gtkmm / mod_palette / dock_paledit.h
1 /* === S Y N F I G ========================================================= */
2 /*!     \file dialog_palette.h
3 **      \brief Template Header
4 **
5 **      $Id: dock_paledit.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
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 "../widget_coloredit.h"
43
44 #include <synfigapp/value_desc.h>
45 #include <synfig/time.h>
46
47 #include "../dockable.h"
48 #include <vector>
49 #include <gtkmm/actiongroup.h>
50
51 #include <synfig/palette.h>
52
53 /* === M A C R O S ========================================================= */
54
55 /* === T Y P E D E F S ===================================================== */
56
57 /* === C L A S S E S & S T R U C T S ======================================= */
58
59 namespace synfigapp {
60 class CanvasInterface;
61 };
62
63 namespace studio {
64
65 class Widget_Color;
66 class PaletteSettings;
67         
68 class Dock_PalEdit : public Dockable
69 {
70         friend class PaletteSettings;
71
72         Glib::RefPtr<Gtk::ActionGroup> action_group;
73
74         synfig::Palette palette_;
75         
76         Gtk::Table table;
77         
78         void on_add_pressed();
79         
80         void show_menu(int i);
81
82         sigc::signal<void> signal_changed_;
83
84
85 private:
86         int add_color(const synfig::Color& x);
87         void set_color(synfig::Color x, int i);
88         void erase_color(int i);
89
90         void select_color(int i);
91         synfig::Color get_color(int i)const;
92         void edit_color(int i);
93 public:
94         void set_palette(const synfig::Palette& x);
95         const synfig::Palette& get_palette()const { return palette_; }
96
97         int size()const;
98
99         void set_default_palette();
100         
101         void refresh();
102
103         const sigc::signal<void>& signal_changed() { return signal_changed_; }
104                 
105         Dock_PalEdit();
106         ~Dock_PalEdit();
107 }; // END of Dock_PalEdit
108
109 }; // END of namespace studio
110
111 /* === E N D =============================================================== */
112
113 #endif