25 #ifndef __SYNFIG_STUDIO_LAYERGROUPTREESTORE_H
26 #define __SYNFIG_STUDIO_LAYERGROUPTREESTORE_H
30 #include <gtkmm/treestore.h>
32 #include <synfig/value.h>
33 #include <synfig/valuenode.h>
34 #include <gtkmm/treeview.h>
53 class Model :
public Gtk::TreeModel::ColumnRecord
56 Gtk::TreeModelColumn<Glib::RefPtr<Gdk::Pixbuf> >
icon;
57 Gtk::TreeModelColumn<Glib::ustring>
label;
58 Gtk::TreeModelColumn<Glib::ustring>
tooltip;
63 Gtk::TreeModelColumn<synfig::Canvas::Handle>
canvas;
68 Gtk::TreeModelColumn<synfig::Layer::Handle>
layer;
107 etl::loose_handle<synfigapp::CanvasInterface> canvas_interface_;
109 Glib::RefPtr<Gdk::Pixbuf> layer_icon;
110 Glib::RefPtr<Gdk::Pixbuf> group_icon;
124 virtual void set_value_impl (
const Gtk::TreeModel::iterator& row,
int column,
const Glib::ValueBase& value);
125 virtual void get_value_vfunc (
const Gtk::TreeModel::iterator& iter,
int column, Glib::ValueBase& value)
const;
127 virtual bool row_draggable_vfunc (
const TreeModel::Path& path)
const;
128 virtual bool drag_data_get_vfunc (
const TreeModel::Path& path, Gtk::SelectionData& selection_data)
const;
129 virtual bool drag_data_delete_vfunc (
const TreeModel::Path& path);
130 virtual bool drag_data_received_vfunc (
const TreeModel::Path& dest,
const Gtk::SelectionData& selection_data);
131 virtual bool row_drop_possible_vfunc (
const TreeModel::Path& dest,
const Gtk::SelectionData& selection_data)
const;
134 void on_group_pair_added(synfig::String group, etl::handle<synfig::Layer> layer);
135 void on_group_pair_removed(synfig::String group, etl::handle<synfig::Layer> layer);
145 bool on_layer_tree_event(GdkEvent *event);
153 bool find_group_row_(
const synfig::String &group, Gtk::TreeModel::Children layers, Gtk::TreeModel::Children::iterator &iter, Gtk::TreeModel::Children::iterator &prev);
155 bool on_group_removed(synfig::String group);
156 bool on_group_changed(synfig::String group);
168 etl::loose_handle<synfigapp::CanvasInterface>
canvas_interface() {
return canvas_interface_; }
169 etl::loose_handle<const synfigapp::CanvasInterface>
canvas_interface()
const {
return canvas_interface_; }
174 bool find_group_row(
const synfig::String &group, Gtk::TreeModel::Children::iterator &iter);
186 static bool search_func(
const Glib::RefPtr<TreeModel>&,
int,
const Glib::ustring&,
const TreeModel::iterator&);
194 static Glib::RefPtr<LayerGroupTreeStore>
create(etl::loose_handle<synfigapp::CanvasInterface> canvas_interface_);