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