initial version
[synfig.git] / synfig-studio / trunk / src / gtkmm / dialog_gradient.h
1 /* === S I N F G =========================================================== */
2 /*!     \file dialog_gradient.h
3 **      \brief Template Header
4 **
5 **      $Id: dialog_gradient.h,v 1.1.1.1 2005/01/07 03:34:36 darco Exp $
6 **
7 **      \legal
8 **      Copyright (c) 2002 Robert B. Quattlebaum Jr.
9 **
10 **      This software and associated documentation
11 **      are CONFIDENTIAL and PROPRIETARY property of
12 **      the above-mentioned copyright holder.
13 **
14 **      You may not copy, print, publish, or in any
15 **      other way distribute this software without
16 **      a prior written agreement with
17 **      the copyright holder.
18 **      \endlegal
19 */
20 /* ========================================================================= */
21
22 /* === S T A R T =========================================================== */
23
24 #ifndef __SINFG_STUDIO_DIALOG_GRADIENT_H
25 #define __SINFG_STUDIO_DIALOG_GRADIENT_H
26
27 /* === H E A D E R S ======================================================= */
28
29 #include <gtk/gtk.h>
30 #include <gtkmm/adjustment.h>
31 #include <gtkmm/table.h>
32 #include <gtkmm/button.h>
33 #include <gtkmm/dialog.h>
34 #include <gtkmm/drawingarea.h>
35 #include <gtkmm/optionmenu.h>
36 #include <gtkmm/checkbutton.h>
37
38 #include <sinfg/gamma.h>
39 #include <sinfg/time.h>
40
41 #include "widget_gradient.h"
42 #include "widget_coloredit.h"
43
44 #include <sinfgapp/value_desc.h>
45 #include <sinfg/time.h>
46
47 #include "dialogsettings.h"
48
49 /* === M A C R O S ========================================================= */
50
51 /* === T Y P E D E F S ===================================================== */
52
53 /* === C L A S S E S & S T R U C T S ======================================= */
54
55 namespace Gtk { class Menu; class SpinButton; class Adjustment; };
56
57 namespace sinfgapp {
58 class CanvasInterface;
59 };
60
61 namespace studio {
62
63 class Widget_Gradient;
64 class Widget_ColorEdit;
65         
66 class Dialog_Gradient : public Gtk::Dialog
67 {
68         DialogSettings dialog_settings;
69         
70         Gtk::SpinButton *spinbutton_pos;
71
72         Gtk::Adjustment adjustment_pos;
73
74
75         sigc::signal<void,sinfg::Gradient> signal_edited_;
76
77         sigc::connection value_changed_connection;
78         
79         void on_ok_pressed();
80         void on_apply_pressed();
81         void on_grab_pressed();
82         
83         void on_cpoint_selected(sinfg::Gradient::CPoint x);
84         void on_values_adjusted();
85
86         Widget_Gradient* widget_gradient;
87         Widget_ColorEdit* widget_color;
88
89         void on_changed();
90         
91 public:
92
93         sigc::signal<void,sinfg::Gradient>& signal_edited() { return signal_edited_; }
94         
95         void set_gradient(const sinfg::Gradient& x);
96
97         const sinfg::Gradient& get_gradient()const { return widget_gradient->get_value(); }
98                 
99         void reset();
100
101         
102         Dialog_Gradient();
103         ~Dialog_Gradient();
104
105         void edit(const sinfgapp::ValueDesc &x, etl::handle<sinfgapp::CanvasInterface> canvas_interface, sinfg::Time x=0);
106 }; // END of Dialog_Gradient
107
108 }; // END of namespace studio
109
110 /* === E N D =============================================================== */
111
112 #endif