1 /* === S Y N F I G ========================================================= */
2 /*! \file trees/childrentree.h
3 ** \brief Template Header
8 ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
9 ** Copyright (c) 2008 Chris Moore
11 ** This package is free software; you can redistribute it and/or
12 ** modify it under the terms of the GNU General Public License as
13 ** published by the Free Software Foundation; either version 2 of
14 ** the License, or (at your option) any later version.
16 ** This package is distributed in the hope that it will be useful,
17 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 ** General Public License for more details.
22 /* ========================================================================= */
24 /* === S T A R T =========================================================== */
26 #ifndef __SYNFIG_STUDIO_CHILDRENTREE_H
27 #define __SYNFIG_STUDIO_CHILDRENTREE_H
29 /* === H E A D E R S ======================================================= */
31 #include <gtkmm/treeview.h>
32 #include <gtkmm/treestore.h>
33 #include <gtkmm/tooltips.h>
34 #include <gtkmm/table.h>
35 #include <gtkmm/box.h>
36 #include <gtkmm/adjustment.h>
37 #include <gtkmm/scale.h>
38 #include <gtkmm/button.h>
40 #include <synfigapp/canvasinterface.h>
41 #include <synfigapp/value_desc.h>
42 #include "trees/childrentreestore.h"
43 #include <synfig/valuenode_animated.h>
45 #include "widgets/widget_value.h"
47 /* === M A C R O S ========================================================= */
49 /* === T Y P E D E F S ===================================================== */
51 /* === C L A S S E S & S T R U C T S ======================================= */
55 class CellRenderer_TimeTrack;
56 class CellRenderer_ValueBase;
58 class ChildrenTree : public Gtk::Table
61 -- ** -- P U B L I C T Y P E S ---------------------------------------------
66 typedef studio::ColumnID ColumnID;
69 -- ** -- P U B L I C D A T A ------------------------------------------------
74 ChildrenTreeStore::Model model;
77 -- ** -- P R I V A T E D A T A ---------------------------------------------
82 Gtk::Tooltips tooltips_;
84 Gtk::TreePath last_tooltip_path;
86 Gtk::TreeView tree_view;
90 Glib::RefPtr<ChildrenTreeStore> children_tree_store_;
92 CellRenderer_TimeTrack *cellrenderer_time_track;
94 Gtk::TreeView::Column* column_time_track;
96 CellRenderer_ValueBase *cellrenderer_value;
98 sigc::signal<void,synfigapp::ValueDesc,synfig::ValueBase> signal_edited_value_;
100 sigc::signal<bool, int, Gtk::TreeRow, ColumnID> signal_user_click_;
102 sigc::signal<void,synfigapp::ValueDesc,std::set<synfig::Waypoint,std::less<synfig::UniqueID> >,int> signal_waypoint_clicked_childrentree_;
104 Gtk::Button *button_raise;
105 Gtk::Button *button_lower;
106 Gtk::Button *button_duplicate;
107 Gtk::Button *button_delete;
109 Widget_ValueBase blend_method_widget;
112 -- ** -- P R I V A T E M E T H O D S ---------------------------------------
118 -- ** -- S I G N A L T E R M I N A L S -------------------------------------
123 void on_edited_value(const Glib::ustring&path_string,synfig::ValueBase value);
125 void on_waypoint_clicked_childrentree(const etl::handle<synfig::Node>& node,const synfig::Time&,const synfig::Time&,int button);
127 bool on_tree_event(GdkEvent *event);
129 void on_selection_changed();
131 void on_dirty_preview();
133 //! \todo Implement raise/lower/duplicate/delete functions
134 void on_raise_pressed();
136 void on_lower_pressed();
138 void on_duplicate_pressed();
140 void on_delete_pressed();
143 -- ** -- P U B L I C M E T H O D S -----------------------------------------
148 Gtk::HBox& get_hbox() { return *hbox; }
150 Gtk::TreeView& get_tree_view() { return tree_view; }
152 Glib::RefPtr<Gtk::TreeSelection> get_selection() { return tree_view.get_selection(); }
153 Glib::SignalProxy1< bool,GdkEvent* > signal_event () { return tree_view.signal_event(); }
158 void set_model(Glib::RefPtr<ChildrenTreeStore> children_tree_store_);
160 void set_time_adjustment(Gtk::Adjustment &adjustment);
162 void set_show_timetrack(bool x=true);
164 //! Signal called with a value has been edited.
165 sigc::signal<void,synfigapp::ValueDesc,synfig::ValueBase>& signal_edited_value() { return signal_edited_value_; }
167 sigc::signal<bool,int, Gtk::TreeRow, ColumnID>& signal_user_click() { return signal_user_click_; }
169 sigc::signal<void,synfigapp::ValueDesc,std::set<synfig::Waypoint,std::less<synfig::UniqueID> >,int>& signal_waypoint_clicked_childrentree() { return signal_waypoint_clicked_childrentree_; }
171 etl::handle<synfigapp::SelectionManager> get_selection_manager() { return children_tree_store_->canvas_interface()->get_selection_manager(); }
173 }; // END of ChildrenTree
175 }; // END of namespace studio
177 /* === E N D =============================================================== */