synfig-studio  1.0.3
widget_value.h
Go to the documentation of this file.
1 /* === S Y N F I G ========================================================= */
21 /* ========================================================================= */
22 
23 /* === S T A R T =========================================================== */
24 
25 #ifndef __SYNFIG_GTKMM_VALUE_H
26 #define __SYNFIG_GTKMM_VALUE_H
27 
28 /* === H E A D E R S ======================================================= */
29 
30 //#include <gtk/gtk.h>
31 //#include <gtkmm/arrow.h>
32 //#include <gtkmm/image.h>
33 //#include <gdkmm/pixbufloader.h>
34 //#include <gtkmm/viewport.h>
35 #include <gtkmm/adjustment.h>
36 //#include <gtkmm/scrolledwindow.h>
37 #include <gtkmm/table.h>
38 //#include <gtkmm/statusbar.h>
39 #include <gtkmm/button.h>
40 #include <gtkmm/label.h>
41 //#include <gtkmm/paned.h>
42 //#include <gtkmm/treeview.h>
43 //#include <gtkmm/treestore.h>
44 #include <gtkmm/box.h>
45 #include <gtkmm/spinbutton.h>
46 //#include <gtkmm/cellrenderer/cellrenderer.h>
47 #include <gtkmm/checkbutton.h>
48 
49 //#include <gtkmm/colorselection.h>
50 #include <gtkmm/combobox.h>
51 
52 //#include <synfig/synfig.h>
53 #include <synfig/paramdesc.h>
54 #include <synfigapp/value_desc.h>
55 #include <synfig/value.h>
56 #include <synfig/canvas.h>
57 
58 
59 /* === M A C R O S ========================================================= */
60 
61 /* === T Y P E D E F S ===================================================== */
62 
63 /* === C L A S S E S & S T R U C T S ======================================= */
64 
65 namespace studio {
66 
67 class Widget_BoneChooser;
68 class Widget_Color;
69 class Widget_ColorEdit;
70 class Widget_CanvasChooser;
71 class Widget_Enum;
72 class Widget_Sublayer;
73 class Widget_Filename;
74 class Widget_Vector;
75 class Widget_Time;
76 class Widget_Distance;
77 
78 class Widget_ValueBase : public Gtk::HBox
79 {
80  Gtk::Label *label;
81  synfig::ValueBase value;
82 
83  Widget_Vector *vector_widget;
84  Gtk::SpinButton *real_widget;
85  Glib::RefPtr<Gtk::Adjustment> real_adjustment;
86  Gtk::SpinButton *integer_widget;
87  Glib::RefPtr<Gtk::Adjustment> integer_adjustment;
88  Gtk::SpinButton *angle_widget;
89  Glib::RefPtr<Gtk::Adjustment> angle_adjustment;
90 
91  Gtk::CheckButton *bool_widget;
92  //Gtk::ColorSelection *color_widget;
93  Widget_BoneChooser *bone_widget;
94  Widget_ColorEdit *color_widget;
95  Widget_CanvasChooser *canvas_widget;
96  Widget_Enum *enum_widget;
97  Widget_Sublayer *sublayer_widget;
98  Widget_Filename *filename_widget;
99  Widget_Time *time_widget;
100  Gtk::Entry *string_widget;
101  Widget_Distance *distance_widget;
102 
103 // std::string hint;
104 
105  synfig::ParamDesc param_desc;
106  synfigapp::ValueDesc value_desc;
107  synfig::ParamDesc child_param_desc;
108  etl::handle<synfig::Canvas> canvas;
109  sigc::signal<void> signal_value_changed_;
110  sigc::signal<void> signal_activate_;
111 
112 public:
113  sigc::signal<void> &signal_value_changed() { return signal_value_changed_; }
114 
115  void activate();
116 
117  sigc::signal<void>& signal_activate() { return signal_activate_; }
118 
119  void set_value(const synfig::ValueBase &data);
120  const synfig::ValueBase &get_value();
121 
122  void on_grab_focus();
123 
124  void set_param_desc(const synfig::ParamDesc &x) { param_desc=x; }
125  const synfig::ParamDesc &get_param_desc() { return param_desc; }
126 
127  void set_value_desc(const synfigapp::ValueDesc &x) { value_desc=x; }
128  const synfigapp::ValueDesc &get_value_desc() { return value_desc; }
129 
130  void set_child_param_desc(const synfig::ParamDesc &x) { child_param_desc=x; }
131  const synfig::ParamDesc &get_child_param_desc() { return child_param_desc; }
132 
133  void set_sensitive(bool x);
134 
135  //void set_hint(std::string x) { hint=x; }
136 // std::string get_hint() { return hint; }
137 
138  void set_canvas(etl::handle<synfig::Canvas> x) { canvas=x; assert(canvas); }
139  void inside_cellrenderer();
142 };
143 
144 }; // END of namespace studio
145 
146 /* === E N D =============================================================== */
147 
148 #endif