Fix bugs in previous commit that caused FTBFS in synfig and ETL FTBFS with older...
[synfig.git] / synfig-studio / tags / 0.61.09 / src / gtkmm / cellrenderer_time.h
1 /* === S Y N F I G ========================================================= */
2 /*!     \file cellrenderer_time.h
3 **      \brief Template Header
4 **
5 **      $Id$
6 **
7 **      \legal
8 **      Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
9 **
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.
14 **
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.
19 **      \endlegal
20 */
21 /* ========================================================================= */
22
23 /* === S T A R T =========================================================== */
24
25 #ifndef __SYNFIG_STUDIO_CELLRENDERER_TIME_H
26 #define __SYNFIG_STUDIO_CELLRENDERER_TIME_H
27
28 /* === H E A D E R S ======================================================= */
29
30 #include <gtkmm/entry.h>
31 #include <gtkmm/cellrenderertext.h>
32
33 #include <sigc++/signal.h>
34 #include <sigc++/slot.h>
35
36 #include <synfig/time.h>
37
38 /* === M A C R O S ========================================================= */
39
40 /* === T Y P E D E F S ===================================================== */
41
42 /* === C L A S S E S & S T R U C T S ======================================= */
43
44 namespace Gtk { class Entry; class Button; };
45
46 namespace studio {
47
48 class CellRenderer_Time : public Gtk::CellRendererText
49 {
50         sigc::signal<void, const Glib::ustring&> signal_secondary_click_;
51         sigc::signal<void, const Glib::ustring&, synfig::Time> signal_edited_;
52
53         Glib::Property<synfig::Time> property_time_;
54         Glib::Property<synfig::Time> property_fps_;
55
56         void string_edited_(const Glib::ustring&,const Glib::ustring&);
57
58         void on_value_editing_done();
59
60 public:
61         sigc::signal<void, const Glib::ustring&, synfig::Time> &signal_edited()
62         {return signal_edited_; }
63
64         Glib::PropertyProxy<synfig::Time> property_time() { return property_time_.get_proxy();}
65         Glib::PropertyProxy<synfig::Time> property_fps() { return property_fps_.get_proxy();}
66
67         CellRenderer_Time();
68         ~CellRenderer_Time();
69
70 protected:
71
72         virtual void
73         render_vfunc(
74                 const Glib::RefPtr<Gdk::Drawable>& window,
75                 Gtk::Widget& widget,
76                 const Gdk::Rectangle& background_area,
77                 const Gdk::Rectangle& ca,
78                 const Gdk::Rectangle& expose_area,
79                 Gtk::CellRendererState flags);
80
81         virtual Gtk::CellEditable* start_editing_vfunc(GdkEvent* event,
82                                                  Gtk::Widget& widget,
83                                                  const Glib::ustring& path,
84                                                  const Gdk::Rectangle& background_area,
85                                                  const Gdk::Rectangle& cell_area,
86                                                  Gtk::CellRendererState flags);
87
88 }; // END of class CellRenderer_Time
89
90 }; // END of namespace studio
91
92 /* === E N D =============================================================== */
93
94 #endif