00001
00022
00023
00024
00025
00026 #ifndef __SYNFIG_STUDIO_CHILDRENTREESTORE_H
00027 #define __SYNFIG_STUDIO_CHILDRENTREESTORE_H
00028
00029
00030
00031 #include <gtkmm/treestore.h>
00032 #include <synfigapp/canvasinterface.h>
00033 #include "canvastreestore.h"
00034 #include <synfig/value.h>
00035 #include <synfig/valuenode.h>
00036 #include <set>
00037
00038
00039
00040
00041
00042
00043
00044 namespace studio {
00045
00046 class ChildrenTreeStore : public CanvasTreeStore
00047 {
00048
00049
00050
00051
00052 public:
00053
00054
00055
00056
00057
00058 public:
00059
00061 const Model model;
00062
00063
00064
00065
00066
00067 private:
00068
00069 Gtk::TreeModel::Row value_node_row;
00070 Gtk::TreeModel::Row canvas_row;
00071
00072 std::set<synfig::ValueNode::Handle> changed_set_;
00073
00074 std::set<synfig::ValueNode::Handle> replaced_set_;
00075
00076
00077
00078
00079
00080 private:
00081
00082 sigc::connection changed_connection;
00083 bool execute_changed_queued()const { return !changed_set_.empty() || !replaced_set_.empty(); }
00084 bool execute_changed_value_nodes();
00085 void clear_changed_queue() { changed_set_.clear(); replaced_set_.clear(); }
00086
00087
00088
00089
00090
00091 private:
00092
00093 void on_value_node_added(synfig::ValueNode::Handle value_node);
00094 void on_value_node_deleted(synfig::ValueNode::Handle value_node);
00095 void on_value_node_changed(synfig::ValueNode::Handle value_node);
00096 void on_value_node_renamed(synfig::ValueNode::Handle value_node);
00097 void on_value_node_replaced(synfig::ValueNode::Handle replaced_value_node,synfig::ValueNode::Handle new_value_node);
00098 void on_canvas_added(synfig::Canvas::Handle canvas);
00099 void on_canvas_removed(synfig::Canvas::Handle canvas);
00100
00101 void set_value_impl(const Gtk::TreeModel::iterator& iter, int column, const Glib::ValueBase& value);
00102
00103
00104
00105
00106
00107 public:
00108
00109 ChildrenTreeStore(etl::loose_handle<synfigapp::CanvasInterface> canvas_interface_);
00110 ~ChildrenTreeStore();
00111
00112 void rebuild();
00113
00114 void refresh();
00115
00116 void rebuild_value_nodes();
00117
00118 void refresh_value_nodes();
00119
00120 void rebuild_canvases();
00121
00122 void refresh_canvases();
00123
00124 void refresh_row(Gtk::TreeModel::Row &row, bool do_children=false);
00125
00126 Gtk::TreeModel::Row get_canvas_row()const { return canvas_row; }
00127
00128 Gtk::TreeModel::Row get_value_node_row()const { return value_node_row; }
00129
00130
00131
00132
00133
00134 public:
00135
00136 static Glib::RefPtr<ChildrenTreeStore> create(etl::loose_handle<synfigapp::CanvasInterface> canvas_interface_);
00137 };
00138
00139 };
00140
00141
00142
00143 #endif