synfig-studio  1.0.3
cellrenderer_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_CELLRENDERER_VALUE_H
26 #define __SYNFIG_GTKMM_CELLRENDERER_VALUE_H
27 
28 /* === H E A D E R S ======================================================= */
29 
30 #include <gtk/gtk.h>
31 
32 #include <glibmm/property.h>
33 
34 #include <gtkmm/arrow.h>
35 #include <gtkmm/image.h>
36 #include <gdkmm/pixbufloader.h>
37 #include <gtkmm/viewport.h>
38 #include <gtkmm/adjustment.h>
39 #include <gtkmm/scrolledwindow.h>
40 #include <gtkmm/table.h>
41 #include <gtkmm/statusbar.h>
42 #include <gtkmm/button.h>
43 #include <gtkmm/label.h>
44 #include <gtkmm/paned.h>
45 #include <gtkmm/treeview.h>
46 #include <gtkmm/treestore.h>
47 #include <gtkmm/box.h>
48 #include <gtkmm/spinbutton.h>
49 #include <gtkmm/cellrenderer.h>
50 #include <gtkmm/checkbutton.h>
51 
52 #include <gtkmm/colorselection.h>
53 
54 //#include <synfig/synfig.h>
55 #include <synfig/paramdesc.h>
56 #include <synfig/value.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 ValueBase_Entry;
68 
69 class CellRenderer_ValueBase : public Gtk::CellRendererText
70 {
71  sigc::signal<void, const Glib::ustring&> signal_secondary_click_;
72  sigc::signal<void, const Glib::ustring&, synfig::ValueBase> signal_edited_;
73 
74  Glib::Property<synfig::ValueBase> property_value_;
75  Glib::Property<etl::handle<synfig::Canvas> > property_canvas_;
76  Glib::Property<synfig::ParamDesc> property_param_desc_;
77  Glib::Property<synfigapp::ValueDesc> property_value_desc_;
78  Glib::Property<synfig::ParamDesc> property_child_param_desc_;
79 
80  void string_edited_(const Glib::ustring&,const Glib::ustring&);
81 
82  void gradient_edited(synfig::Gradient gradient, Glib::ustring path);
83  void color_edited(synfig::Color color, Glib::ustring path);
84 
85  bool edit_value_done_called;
86 public:
87  sigc::signal<void, const Glib::ustring&> &signal_secondary_click()
88  {return signal_secondary_click_; }
89 
90  sigc::signal<void, const Glib::ustring&, synfig::ValueBase> &signal_edited()
91  {return signal_edited_; }
92 
93  Glib::PropertyProxy<synfig::ValueBase> property_value() { return property_value_.get_proxy();}
94  Glib::PropertyProxy<etl::handle<synfig::Canvas> > property_canvas() { return property_canvas_.get_proxy();}
95  Glib::PropertyProxy<synfig::ParamDesc> property_param_desc() { return property_param_desc_.get_proxy(); }
96  Glib::PropertyProxy<synfigapp::ValueDesc> property_value_desc() { return property_value_desc_.get_proxy(); }
97  Glib::PropertyProxy<synfig::ParamDesc> property_child_param_desc() { return property_child_param_desc_.get_proxy(); }
98  Glib::PropertyProxy<bool> property_inconsistent() { return property_foreground_set(); }
99 
100  etl::handle<synfig::Canvas> get_canvas()const { return property_canvas_; }
101  synfig::ParamDesc get_param_desc()const { return property_param_desc_; }
102  synfigapp::ValueDesc get_value_desc()const { return property_value_desc_; }
103  synfig::ParamDesc get_child_param_desc()const { return property_child_param_desc_; }
104 
107 
108  ValueBase_Entry *value_entry;
109 
110  void on_value_editing_done();
111 
112  virtual void
113  render_vfunc(
114  const ::Cairo::RefPtr< ::Cairo::Context>& cr,
115  Gtk::Widget& widget,
116  const Gdk::Rectangle& background_area,
117  const Gdk::Rectangle& cell_area,
118  Gtk::CellRendererState flags);
119 
120  virtual Gtk::CellEditable* start_editing_vfunc(GdkEvent* event,
121  Gtk::Widget& widget,
122  const Glib::ustring& path,
123  const Gdk::Rectangle& background_area,
124  const Gdk::Rectangle& cell_area,
125  Gtk::CellRendererState flags);
126 
127 }; // END of class CellRenderer_ValueBase
128 
129 }; // END of namespace studio
130 
131 /* === E N D =============================================================== */
132 
133 #endif