1 /* === S Y N F I G ========================================================= */
2 /*! \file dialogs/dialog_gradient.h
3 ** \brief Template Header
8 ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
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.
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.
21 /* ========================================================================= */
23 /* === S T A R T =========================================================== */
25 #ifndef __SYNFIG_STUDIO_DIALOG_GRADIENT_H
26 #define __SYNFIG_STUDIO_DIALOG_GRADIENT_H
28 /* === H E A D E R S ======================================================= */
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>
39 #include <synfig/gamma.h>
40 #include <synfig/time.h>
42 #include "widgets/widget_gradient.h"
43 #include "widgets/widget_coloredit.h"
45 #include <synfigapp/value_desc.h>
46 #include <synfig/time.h>
48 #include "dialogsettings.h"
50 /* === M A C R O S ========================================================= */
52 /* === T Y P E D E F S ===================================================== */
54 /* === C L A S S E S & S T R U C T S ======================================= */
56 namespace Gtk { class Menu; class SpinButton; class Adjustment; };
59 class CanvasInterface;
64 class Widget_Gradient;
65 class Widget_ColorEdit;
67 class Dialog_Gradient : public Gtk::Dialog
69 DialogSettings dialog_settings;
71 Gtk::SpinButton *spinbutton_pos;
73 Gtk::Adjustment adjustment_pos;
76 sigc::signal<void,synfig::Gradient> signal_edited_;
78 sigc::connection value_changed_connection;
80 void on_set_default_pressed();
82 void on_cpoint_selected(synfig::Gradient::CPoint x);
83 void on_values_adjusted();
85 Widget_Gradient* widget_gradient;
86 Widget_ColorEdit* widget_color;
87 Gtk::Button *set_default_button;
93 sigc::signal<void,synfig::Gradient>& signal_edited() { return signal_edited_; }
95 void set_gradient(const synfig::Gradient& x);
97 const synfig::Gradient& get_gradient()const { return widget_gradient->get_value(); }
99 void set_default_button_set_sensitive(bool sensitive) { set_default_button->set_sensitive(sensitive); }
106 //! Interface to external calls to fill in the Gradient Editor Dialog
107 //! when a Constant ValueNode or a Animated ValueNode is double cliked.
108 void edit(const synfigapp::ValueDesc &x, etl::handle<synfigapp::CanvasInterface> canvas_interface, synfig::Time time=0);
109 }; // END of Dialog_Gradient
111 }; // END of namespace studio
113 /* === E N D =============================================================== */