1 /* === S Y N F I G ========================================================= */
2 /*! \file childrentree.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_CHILDRENTREE_H
26 #define __SYNFIG_STUDIO_CHILDRENTREE_H
28 /* === H E A D E R S ======================================================= */
30 #include <gtkmm/treeview.h>
31 #include <gtkmm/treestore.h>
32 #include <gtkmm/tooltips.h>
33 #include <gtkmm/table.h>
34 #include <gtkmm/box.h>
35 #include <gtkmm/adjustment.h>
36 #include <gtkmm/scale.h>
37 #include <gtkmm/button.h>
39 #include <synfigapp/canvasinterface.h>
40 #include <synfigapp/value_desc.h>
41 #include "childrentreestore.h"
42 #include <synfig/valuenode_animated.h>
44 #include "widget_value.h"
46 /* === M A C R O S ========================================================= */
48 /* === T Y P E D E F S ===================================================== */
50 /* === C L A S S E S & S T R U C T S ======================================= */
54 class CellRenderer_TimeTrack;
55 class CellRenderer_ValueBase;
57 class ChildrenTree : public Gtk::Table
60 -- ** -- P U B L I C T Y P E S ---------------------------------------------
65 typedef studio::ColumnID ColumnID;
68 -- ** -- P U B L I C D A T A ------------------------------------------------
73 ChildrenTreeStore::Model model;
76 -- ** -- P R I V A T E D A T A ---------------------------------------------
81 Gtk::Tooltips tooltips_;
83 Gtk::TreePath last_tooltip_path;
85 Gtk::TreeView tree_view;
89 Glib::RefPtr<ChildrenTreeStore> children_tree_store_;
91 CellRenderer_TimeTrack *cellrenderer_time_track;
93 Gtk::TreeView::Column* column_time_track;
95 CellRenderer_ValueBase *cellrenderer_value;
97 sigc::signal<void,synfigapp::ValueDesc,synfig::ValueBase> signal_edited_value_;
99 sigc::signal<bool, int, Gtk::TreeRow, ColumnID> signal_user_click_;
101 sigc::signal<void,synfigapp::ValueDesc,synfig::Waypoint, int> signal_waypoint_clicked_;
103 Gtk::Button *button_raise;
104 Gtk::Button *button_lower;
105 Gtk::Button *button_duplicate;
106 Gtk::Button *button_delete;
108 Widget_ValueBase blend_method_widget;
111 -- ** -- P R I V A T E M E T H O D S ---------------------------------------
117 -- ** -- S I G N A L T E R M I N A L S -------------------------------------
122 void on_edited_value(const Glib::ustring&path_string,synfig::ValueBase value);
124 void on_waypoint_clicked(const Glib::ustring &, synfig::Waypoint,int button);
126 bool on_tree_event(GdkEvent *event);
128 void on_selection_changed();
130 void on_dirty_preview();
132 void on_raise_pressed();
134 void on_lower_pressed();
136 void on_duplicate_pressed();
138 void on_delete_pressed();
141 -- ** -- P U B L I C M E T H O D S -----------------------------------------
146 Gtk::HBox& get_hbox() { return *hbox; }
148 Gtk::TreeView& get_tree_view() { return tree_view; }
150 Glib::RefPtr<Gtk::TreeSelection> get_selection() { return tree_view.get_selection(); }
151 Glib::SignalProxy1< bool,GdkEvent* > signal_event () { return tree_view.signal_event(); }
156 void set_model(Glib::RefPtr<ChildrenTreeStore> children_tree_store_);
158 void set_time_adjustment(Gtk::Adjustment &adjustment);
160 void set_show_timetrack(bool x=true);
162 //! Signal called with a value has been edited.
163 sigc::signal<void,synfigapp::ValueDesc,synfig::ValueBase>& signal_edited_value() { return signal_edited_value_; }
165 sigc::signal<bool,int, Gtk::TreeRow, ColumnID>& signal_user_click() { return signal_user_click_; }
167 sigc::signal<void,synfigapp::ValueDesc,synfig::Waypoint, int>& signal_waypoint_clicked() { return signal_waypoint_clicked_; }
169 etl::handle<synfigapp::SelectionManager> get_selection_manager() { return children_tree_store_->canvas_interface()->get_selection_manager(); }
171 }; // END of ChildrenTree
173 }; // END of namespace studio
175 /* === E N D =============================================================== */