1 /* === S Y N F I G ========================================================= */
2 /*! \file trees/childrentreestore.h
3 ** \brief Template Header
8 ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
9 ** Copyright (c) 2007 Chris Moore
11 ** This package is free software; you can redistribute it and/or
12 ** modify it under the terms of the GNU General Public License as
13 ** published by the Free Software Foundation; either version 2 of
14 ** the License, or (at your option) any later version.
16 ** This package is distributed in the hope that it will be useful,
17 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 ** General Public License for more details.
22 /* ========================================================================= */
24 /* === S T A R T =========================================================== */
26 #ifndef __SYNFIG_STUDIO_CHILDRENTREESTORE_H
27 #define __SYNFIG_STUDIO_CHILDRENTREESTORE_H
29 /* === H E A D E R S ======================================================= */
31 #include <gtkmm/treestore.h>
32 #include <synfigapp/canvasinterface.h>
33 #include "trees/canvastreestore.h"
34 #include <synfig/value.h>
35 #include <synfig/valuenode.h>
38 /* === M A C R O S ========================================================= */
40 /* === T Y P E D E F S ===================================================== */
42 /* === C L A S S E S & S T R U C T S ======================================= */
46 class ChildrenTreeStore : public CanvasTreeStore
49 -- ** -- P U B L I C T Y P E S ---------------------------------------------
55 -- ** -- P U B L I C D A T A ------------------------------------------------
60 //! TreeModel for the layers
64 -- ** -- P R I V A T E D A T A ---------------------------------------------
69 Gtk::TreeModel::Row value_node_row;
70 Gtk::TreeModel::Row canvas_row;
72 std::set<synfig::ValueNode::Handle> changed_set_;
74 std::set<synfig::ValueNode::Handle> replaced_set_;
77 -- ** -- P R I V A T E M E T H O D S ---------------------------------------
82 sigc::connection changed_connection;
83 bool execute_changed_queued()const { return !changed_set_.empty() || !replaced_set_.empty(); }
84 bool execute_changed_value_nodes();
85 void clear_changed_queue() { changed_set_.clear(); replaced_set_.clear(); }
88 -- ** -- S I G N A L T E R M I N A L S -------------------------------------
93 void on_value_node_added(synfig::ValueNode::Handle value_node);
94 void on_value_node_deleted(synfig::ValueNode::Handle value_node);
95 void on_value_node_changed(synfig::ValueNode::Handle value_node);
96 void on_value_node_renamed(synfig::ValueNode::Handle value_node);
97 void on_value_node_replaced(synfig::ValueNode::Handle replaced_value_node,synfig::ValueNode::Handle new_value_node);
98 void on_canvas_added(synfig::Canvas::Handle canvas);
99 void on_canvas_removed(synfig::Canvas::Handle canvas);
101 void set_value_impl(const Gtk::TreeModel::iterator& iter, int column, const Glib::ValueBase& value);
104 -- ** -- P U B L I C M E T H O D S -----------------------------------------
109 ChildrenTreeStore(etl::loose_handle<synfigapp::CanvasInterface> canvas_interface_);
110 ~ChildrenTreeStore();
116 void rebuild_value_nodes();
118 void refresh_value_nodes();
120 void rebuild_canvases();
122 void refresh_canvases();
124 void refresh_row(Gtk::TreeModel::Row &row, bool do_children=false);
126 Gtk::TreeModel::Row get_canvas_row()const { return canvas_row; }
128 Gtk::TreeModel::Row get_value_node_row()const { return value_node_row; }
131 -- ** -- S T A T I C P U B L I C M E T H O D S ---------------------------
136 static Glib::RefPtr<ChildrenTreeStore> create(etl::loose_handle<synfigapp::CanvasInterface> canvas_interface_);
137 }; // END of class ChildrenTreeStore
139 }; // END of namespace studio
141 /* === E N D =============================================================== */