25 #ifndef __SYNFIG_STUDIO_LAYERTREESTORE_H
26 #define __SYNFIG_STUDIO_LAYERTREESTORE_H
30 #include <gtkmm/treestore.h>
32 #include <synfig/value.h>
33 #include <synfig/valuenode.h>
34 #include <gtkmm/treeview.h>
52 class Model :
public Gtk::TreeModel::ColumnRecord
55 Gtk::TreeModelColumn<Glib::RefPtr<Gdk::Pixbuf> >
icon;
56 Gtk::TreeModelColumn<Glib::ustring>
label;
57 Gtk::TreeModelColumn<Glib::ustring>
name;
58 Gtk::TreeModelColumn<Glib::ustring>
id;
60 Gtk::TreeModelColumn<synfig::Canvas::Handle>
canvas;
62 Gtk::TreeModelColumn<Glib::ustring>
tooltip;
67 Gtk::TreeModelColumn<Pango::Style>
style;
68 Gtk::TreeModelColumn<Pango::Weight>
weight;
69 Gtk::TreeModelColumn<synfig::Layer::Handle>
layer;
75 Gtk::TreeModelColumn<int>
index;
114 sigc::connection queue_connection;
116 std::map<synfig::Layer::Handle, sigc::connection> subcanvas_changed_connections;
118 etl::loose_handle<synfigapp::CanvasInterface> canvas_interface_;
120 Glib::RefPtr<Gdk::Pixbuf> layer_icon;
133 virtual void set_value_impl (
const Gtk::TreeModel::iterator& row,
int column,
const Glib::ValueBase& value);
134 virtual void get_value_vfunc (
const Gtk::TreeModel::iterator& iter,
int column, Glib::ValueBase& value)
const;
136 virtual bool row_draggable_vfunc (
const TreeModel::Path& path)
const;
137 virtual bool drag_data_get_vfunc (
const TreeModel::Path& path, Gtk::SelectionData& selection_data)
const;
138 virtual bool drag_data_delete_vfunc (
const TreeModel::Path& path);
139 virtual bool drag_data_received_vfunc (
const TreeModel::Path& dest,
const Gtk::SelectionData& selection_data);
140 virtual bool row_drop_possible_vfunc (
const TreeModel::Path& dest,
const Gtk::SelectionData& selection_data)
const;
148 bool on_layer_tree_event(GdkEvent *event);
190 LayerTreeStore(etl::loose_handle<synfigapp::CanvasInterface> canvas_interface_);
193 etl::loose_handle<synfigapp::CanvasInterface>
canvas_interface() {
return canvas_interface_; }
194 etl::loose_handle<const synfigapp::CanvasInterface>
canvas_interface()
const {
return canvas_interface_; }
213 static int z_sorter(
const Gtk::TreeModel::iterator &rhs,
const Gtk::TreeModel::iterator &lhs);
214 static int index_sorter(
const Gtk::TreeModel::iterator &rhs,
const Gtk::TreeModel::iterator &lhs);
219 static bool search_func(
const Glib::RefPtr<TreeModel>&,
int,
const Glib::ustring&,
const TreeModel::iterator&);
227 static Glib::RefPtr<LayerTreeStore>
create(etl::loose_handle<synfigapp::CanvasInterface> canvas_interface_);