1 /* === S Y N F I G ========================================================= */
2 /*! \file cellrenderer_value.h
3 ** \brief Template File
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_GTKMM_CELLRENDERER_VALUE_H
26 #define __SYNFIG_GTKMM_CELLRENDERER_VALUE_H
28 /* === H E A D E R S ======================================================= */
31 #include <gtkmm/ruler.h>
32 #include <gtkmm/arrow.h>
33 #include <gtkmm/image.h>
34 #include <gdkmm/pixbufloader.h>
35 #include <gtkmm/viewport.h>
36 #include <gtkmm/adjustment.h>
37 #include <gtkmm/scrolledwindow.h>
38 #include <gtkmm/table.h>
39 #include <gtkmm/statusbar.h>
40 #include <gtkmm/button.h>
41 #include <gtkmm/label.h>
42 #include <gtkmm/paned.h>
43 #include <gtkmm/treeview.h>
44 #include <gtkmm/treestore.h>
45 #include <gtkmm/adjustment.h>
46 #include <gtkmm/box.h>
47 #include <gtkmm/spinbutton.h>
48 #include <gtkmm/cellrenderer.h>
49 #include <gtkmm/checkbutton.h>
51 #include <gtkmm/colorselection.h>
52 #include <gtkmm/optionmenu.h>
54 //#include <synfig/synfig.h>
55 #include <synfig/paramdesc.h>
56 #include <synfig/value.h>
59 /* === M A C R O S ========================================================= */
61 /* === T Y P E D E F S ===================================================== */
63 /* === C L A S S E S & S T R U C T S ======================================= */
68 class Widget_CanvasChooser;
70 class Widget_Filename;
74 class ValueBase_Entry;
76 class CellRenderer_ValueBase : public Gtk::CellRendererText
78 sigc::signal<void, const Glib::ustring&> signal_secondary_click_;
79 sigc::signal<void, const Glib::ustring&, synfig::ValueBase> signal_edited_;
81 Glib::Property<synfig::ValueBase> property_value_;
82 Glib::Property<etl::handle<synfig::Canvas> > property_canvas_;
83 Glib::Property<synfig::ParamDesc> property_param_desc_;
85 void string_edited_(const Glib::ustring&,const Glib::ustring&);
87 void gradient_edited(synfig::Gradient gradient, Glib::ustring path);
88 void color_edited(synfig::Color color, Glib::ustring path);
90 bool edit_value_done_called;
92 sigc::signal<void, const Glib::ustring&> &signal_secondary_click()
93 {return signal_secondary_click_; }
95 sigc::signal<void, const Glib::ustring&, synfig::ValueBase> &signal_edited()
96 {return signal_edited_; }
98 Glib::PropertyProxy<synfig::ValueBase> property_value() { return property_value_.get_proxy();}
99 Glib::PropertyProxy<etl::handle<synfig::Canvas> > property_canvas() { return property_canvas_.get_proxy();}
100 Glib::PropertyProxy<synfig::ParamDesc> property_param_desc() { return property_param_desc_.get_proxy(); }
101 Glib::PropertyProxy<bool> property_inconsistent() { return property_foreground_set(); }
103 etl::handle<synfig::Canvas> get_canvas()const { return property_canvas_; }
104 synfig::ParamDesc get_param_desc()const { return property_param_desc_; }
106 CellRenderer_ValueBase();
107 ~CellRenderer_ValueBase();
109 ValueBase_Entry *value_entry;
111 void on_value_editing_done();
115 const Glib::RefPtr<Gdk::Drawable>& window,
117 const Gdk::Rectangle& background_area,
118 const Gdk::Rectangle& ca,
119 const Gdk::Rectangle& expose_area,
120 Gtk::CellRendererState flags);
122 virtual Gtk::CellEditable* start_editing_vfunc(GdkEvent* event,
124 const Glib::ustring& path,
125 const Gdk::Rectangle& background_area,
126 const Gdk::Rectangle& cell_area,
127 Gtk::CellRendererState flags);
129 }; // END of class CellRenderer_ValueBase
131 }; // END of namespace studio
133 /* === E N D =============================================================== */