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