26 #ifndef __SYNFIG_STUDIO_LAYERTREE_H
27 #define __SYNFIG_STUDIO_LAYERTREE_H
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>
44 #include <synfig/valuenodes/valuenode_animated.h>
52 #define TIMETRACK_IN_PARAMS_PANEL
58 namespace Gtk {
class TreeModelSort; };
62 class CellRenderer_TimeTrack;
63 class CellRenderer_ValueBase;
105 Gtk::TreeView* layer_tree_view_;
107 Gtk::TreeView* param_tree_view_;
111 Glib::RefPtr<Gtk::Adjustment> layer_amount_adjustment_;
113 Gtk::HScale *layer_amount_hscale;
117 Glib::RefPtr<LayerTreeStore> layer_tree_store_;
119 Glib::RefPtr<LayerParamTreeStore> param_tree_store_;
121 Glib::RefPtr<Gtk::TreeModelSort> sorted_layer_tree_store_;
123 #ifdef TIMETRACK_IN_PARAMS_PANEL
125 #endif // TIMETRACK_IN_PARAMS_PANEL
127 Gtk::TreeView::Column* column_time_track;
129 Gtk::TreeView::Column* column_z_depth;
133 sigc::signal<void,synfig::Layer::Handle> signal_layer_toggle_;
135 sigc::signal<void,synfigapp::ValueDesc,synfig::ValueBase> signal_edited_value_;
137 sigc::signal<bool, int, Gtk::TreeRow, ColumnID> signal_layer_user_click_;
139 sigc::signal<bool, int, Gtk::TreeRow, ColumnID> signal_param_user_click_;
141 sigc::signal<void,synfigapp::ValueDesc,std::set<synfig::Waypoint,std::less<synfig::UniqueID> >,
int> signal_waypoint_clicked_layertree_;
143 sigc::signal<void,int> signal_param_tree_header_height_changed_;
145 bool disable_amount_changed_signal;
147 Gtk::Button *button_raise;
148 Gtk::Button *button_lower;
149 Gtk::Button *button_duplicate;
150 Gtk::Button *button_encapsulate;
151 Gtk::Button *button_delete;
155 bool param_tree_style_changed;
157 int param_tree_header_height;
165 Gtk::Widget* create_layer_tree();
166 Gtk::Widget* create_param_tree();
170 bool update_param_tree_header_height();
178 void on_edited_value(
const Glib::ustring&path_string,synfig::ValueBase value);
180 void on_layer_renamed(
const Glib::ustring&path_string,
const Glib::ustring& value);
182 void on_layer_toggle(
const Glib::ustring& path_string);
184 void on_waypoint_clicked_layertree(
const etl::handle<synfig::Node>& node,
const synfig::Time&,
const synfig::Time&,
const synfig::Time&,
int button);
188 bool on_layer_tree_event(GdkEvent *event);
190 bool on_param_tree_event(GdkEvent *event);
192 bool on_param_tree_view_query_tooltip(
int x,
int y,
bool keyboard_tooltip,
const Glib::RefPtr<Gtk::Tooltip>& tooltip);
194 bool on_layer_tree_view_query_tooltip(
int x,
int y,
bool keyboard_tooltip,
const Glib::RefPtr<Gtk::Tooltip>& tooltip);
196 void on_selection_changed();
198 void on_dirty_preview();
200 void on_amount_value_changed();
202 void on_blend_method_changed();
204 void on_param_column_label_tree_style_updated();
205 bool on_param_column_label_tree_draw(const ::Cairo::RefPtr< ::Cairo::Context>& cr);
241 void set_model(Glib::RefPtr<LayerTreeStore> layer_tree_store_);
251 sigc::signal<void,synfigapp::ValueDesc,synfig::ValueBase>&
signal_edited_value() {
return signal_edited_value_; }
257 sigc::signal<void,synfigapp::ValueDesc,std::set<synfig::Waypoint,std::less<synfig::UniqueID> >,
int>&
signal_waypoint_clicked_layertree() {
return signal_waypoint_clicked_layertree_; }
263 etl::handle<synfigapp::SelectionManager>
get_selection_manager() {
return layer_tree_store_->canvas_interface()->get_selection_manager(); }