synfig-studio  1.0.3
childrentree.h
Go to the documentation of this file.
1 /* === S Y N F I G ========================================================= */
22 /* ========================================================================= */
23 
24 /* === S T A R T =========================================================== */
25 
26 #ifndef __SYNFIG_STUDIO_CHILDRENTREE_H
27 #define __SYNFIG_STUDIO_CHILDRENTREE_H
28 
29 /* === H E A D E R S ======================================================= */
30 
31 #include <gtkmm/treeview.h>
32 #include <gtkmm/treestore.h>
33 #include <gtkmm/tooltip.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>
39 
41 #include <synfigapp/value_desc.h>
43 #include <synfig/valuenodes/valuenode_animated.h>
44 
45 #include "widgets/widget_value.h"
46 
47 /* === M A C R O S ========================================================= */
48 
49 /* === T Y P E D E F S ===================================================== */
50 
51 /* === C L A S S E S & S T R U C T S ======================================= */
52 
53 namespace studio {
54 
55 class CellRenderer_TimeTrack;
56 class CellRenderer_ValueBase;
57 
58 class ChildrenTree : public Gtk::Table
59 {
60  /*
61  -- ** -- P U B L I C T Y P E S ---------------------------------------------
62  */
63 
64 public:
65 
67 
68  /*
69  -- ** -- P U B L I C D A T A ------------------------------------------------
70  */
71 
72 public:
73 
74  ChildrenTreeStore::Model model;
75 
76  /*
77  -- ** -- P R I V A T E D A T A ---------------------------------------------
78  */
79 
80 private:
81 
82  Gtk::TreeView tree_view;
83 
84  Gtk::HBox *hbox;
85 
86  Glib::RefPtr<ChildrenTreeStore> children_tree_store_;
87 
88  CellRenderer_TimeTrack *cellrenderer_time_track;
89 
90  Gtk::TreeView::Column* column_time_track;
91 
92  CellRenderer_ValueBase *cellrenderer_value;
93 
94  sigc::signal<void,synfigapp::ValueDesc,synfig::ValueBase> signal_edited_value_;
95 
96  sigc::signal<bool, int, Gtk::TreeRow, ColumnID> signal_user_click_;
97 
98  sigc::signal<void,synfigapp::ValueDesc,std::set<synfig::Waypoint,std::less<synfig::UniqueID> >,int> signal_waypoint_clicked_childrentree_;
99 
100  Gtk::Button *button_raise;
101  Gtk::Button *button_lower;
102  Gtk::Button *button_duplicate;
103  Gtk::Button *button_delete;
104 
105  Widget_ValueBase blend_method_widget;
106 
107  /*
108  -- ** -- P R I V A T E M E T H O D S ---------------------------------------
109  */
110 
111 private:
112 
113  /*
114  -- ** -- S I G N A L T E R M I N A L S -------------------------------------
115  */
116 
117 private:
118 
119  void on_edited_value(const Glib::ustring&path_string,synfig::ValueBase value);
120 
121  void on_waypoint_clicked_childrentree(const etl::handle<synfig::Node>& node,const synfig::Time&,const synfig::Time&, const synfig::Time&,int button);
122 
123  bool on_tree_view_query_tooltip(int x, int y, bool keyboard_tooltip, const Glib::RefPtr<Gtk::Tooltip>& tooltip);
124 
125  bool on_tree_event(GdkEvent *event);
126 
127  void on_selection_changed();
128 
129  void on_dirty_preview();
130 
132  void on_raise_pressed();
133 
134  void on_lower_pressed();
135 
136  void on_duplicate_pressed();
137 
138  void on_delete_pressed();
139 
140  /*
141  -- ** -- P U B L I C M E T H O D S -----------------------------------------
142  */
143 
144 public:
145 
146  Gtk::HBox& get_hbox() { return *hbox; }
147 
148  Gtk::TreeView& get_tree_view() { return tree_view; }
149 
150  Glib::RefPtr<Gtk::TreeSelection> get_selection() { return tree_view.get_selection(); }
151  Glib::SignalProxy1< bool,GdkEvent* > signal_event () { return tree_view.signal_event(); }
152 
153  ChildrenTree();
154  ~ChildrenTree();
155 
156  void set_model(Glib::RefPtr<ChildrenTreeStore> children_tree_store_);
157 
158  void set_time_adjustment(const Glib::RefPtr<Gtk::Adjustment> &adjustment);
159 
160  void set_show_timetrack(bool x=true);
161 
163  sigc::signal<void,synfigapp::ValueDesc,synfig::ValueBase>& signal_edited_value() { return signal_edited_value_; }
164 
165  sigc::signal<bool,int, Gtk::TreeRow, ColumnID>& signal_user_click() { return signal_user_click_; }
166 
167  sigc::signal<void,synfigapp::ValueDesc,std::set<synfig::Waypoint,std::less<synfig::UniqueID> >,int>& signal_waypoint_clicked_childrentree() { return signal_waypoint_clicked_childrentree_; }
168 
169  etl::handle<synfigapp::SelectionManager> get_selection_manager() { return children_tree_store_->canvas_interface()->get_selection_manager(); }
170 
171 }; // END of ChildrenTree
172 
173 }; // END of namespace studio
174 
175 /* === E N D =============================================================== */
176 
177 #endif