1 /* === S Y N F I G ========================================================= */
2 /*! \file keyframetree.h
3 ** \brief Template Header
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_STUDIO_KEYFRAMETREE_H
26 #define __SYNFIG_STUDIO_KEYFRAMETREE_H
28 /* === H E A D E R S ======================================================= */
30 #include <gtkmm/treeview.h>
31 #include <gtkmm/treestore.h>
32 #include <synfigapp/canvasinterface.h>
33 #include <synfigapp/value_desc.h>
34 #include "keyframetreestore.h"
35 #include <synfig/keyframe.h>
37 /* === M A C R O S ========================================================= */
39 /* === T Y P E D E F S ===================================================== */
41 /* === C L A S S E S & S T R U C T S ======================================= */
45 class CellRenderer_Time;
47 class KeyframeTree : public Gtk::TreeView
50 -- ** -- P U B L I C T Y P E S ---------------------------------------------
61 COLUMNID_END //!< \internal
65 -- ** -- P U B L I C D A T A ------------------------------------------------
70 KeyframeTreeStore::Model model;
73 -- ** -- P R I V A T E D A T A ---------------------------------------------
78 Glib::RefPtr<KeyframeTreeStore> keyframe_tree_store_;
80 CellRenderer_Time *cell_renderer_time;
82 CellRenderer_Time *cell_renderer_time_delta;
84 Gtk::CellRendererText *cell_renderer_description;
86 sigc::signal<void,synfig::Keyframe> signal_edited_;
88 sigc::signal<void,synfig::Keyframe,synfig::Time> signal_edited_time_;
90 sigc::signal<void,synfig::Keyframe,synfig::String> signal_edited_description_;
92 sigc::signal<void, int, Gtk::TreeRow, ColumnID> signal_user_click_;
97 -- ** -- P R I V A T E M E T H O D S ---------------------------------------
103 -- ** -- S I G N A L T E R M I N A L S -------------------------------------
108 void on_edited_time(const Glib::ustring&path_string,synfig::Time time);
110 void on_edited_time_delta(const Glib::ustring&path_string,synfig::Time time);
112 void on_edited_description(const Glib::ustring&path_string,const Glib::ustring &description);
114 bool on_event(GdkEvent *event);
116 void on_rend_desc_changed();
119 -- ** -- P U B L I C M E T H O D S -----------------------------------------
127 void set_model(Glib::RefPtr<KeyframeTreeStore> keyframe_tree_store_);
129 void set_editable(bool x=true);
131 bool get_editable()const { return editable_; }
133 //! Signal called when a keyframe has been edited in any way
134 sigc::signal<void,synfig::Keyframe>& signal_edited() { return signal_edited_; }
136 //! Signal called when a time has been edited.
137 sigc::signal<void,synfig::Keyframe,synfig::Time>& signal_edited_time() { return signal_edited_time_; }
139 //! Signal called when a description has been edited.
140 sigc::signal<void,synfig::Keyframe,synfig::String>& signal_edited_description() { return signal_edited_description_; }
142 sigc::signal<void,int, Gtk::TreeRow, ColumnID>& signal_user_click() { return signal_user_click_; }
143 }; // END of KeyframeTree
145 }; // END of namespace studio
147 /* === E N D =============================================================== */