1 /* === S Y N F I G ========================================================= */
2 /*! \file childrentreestore.h
3 ** \brief Template Header
8 ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
10 ** This package is free software; you can redistribute it and/or
11 ** modify it under the terms of the GNU General Public License as
12 ** published by the Free Software Foundation; either version 2 of
13 ** the License, or (at your option) any later version.
15 ** This package is distributed in the hope that it will be useful,
16 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 ** General Public License for more details.
21 /* ========================================================================= */
23 /* === S T A R T =========================================================== */
25 #ifndef __SYNFIG_STUDIO_CHILDRENTREESTORE_H
26 #define __SYNFIG_STUDIO_CHILDRENTREESTORE_H
28 /* === H E A D E R S ======================================================= */
30 #include <gtkmm/treestore.h>
31 #include <synfigapp/canvasinterface.h>
32 #include "canvastreestore.h"
33 #include <synfig/value.h>
34 #include <synfig/valuenode.h>
37 /* === M A C R O S ========================================================= */
39 /* === T Y P E D E F S ===================================================== */
41 /* === C L A S S E S & S T R U C T S ======================================= */
45 class ChildrenTreeStore : public CanvasTreeStore
48 -- ** -- P U B L I C T Y P E S ---------------------------------------------
54 -- ** -- P U B L I C D A T A ------------------------------------------------
59 //! TreeModel for the layers
63 -- ** -- P R I V A T E D A T A ---------------------------------------------
68 Gtk::TreeModel::Row value_node_row;
69 Gtk::TreeModel::Row canvas_row;
71 std::set<synfig::ValueNode::Handle> changed_set_;
73 std::set<synfig::ValueNode::Handle> replaced_set_;
76 -- ** -- P R I V A T E M E T H O D S ---------------------------------------
81 sigc::connection changed_connection;
82 bool execute_changed_queued()const { return !changed_set_.empty() || !replaced_set_.empty(); }
83 bool execute_changed_value_nodes();
84 void clear_changed_queue() { changed_set_.clear(); replaced_set_.clear(); }
87 -- ** -- S I G N A L T E R M I N A L S -------------------------------------
92 void on_value_node_added(synfig::ValueNode::Handle value_node);
93 void on_value_node_deleted(synfig::ValueNode::Handle value_node);
94 void on_value_node_changed(synfig::ValueNode::Handle value_node);
95 void on_value_node_renamed(synfig::ValueNode::Handle value_node);
96 void on_value_node_replaced(synfig::ValueNode::Handle replaced_value_node,synfig::ValueNode::Handle new_value_node);
97 void on_canvas_added(synfig::Canvas::Handle canvas);
98 void on_canvas_removed(synfig::Canvas::Handle canvas);
100 void set_value_impl(const Gtk::TreeModel::iterator& iter, int column, const Glib::ValueBase& value);
103 -- ** -- P U B L I C M E T H O D S -----------------------------------------
108 ChildrenTreeStore(etl::loose_handle<synfigapp::CanvasInterface> canvas_interface_);
109 ~ChildrenTreeStore();
115 void rebuild_value_nodes();
117 void refresh_value_nodes();
119 void rebuild_canvases();
121 void refresh_canvases();
123 void refresh_row(Gtk::TreeModel::Row &row, bool do_children=false);
125 Gtk::TreeModel::Row get_canvas_row()const { return canvas_row; }
127 Gtk::TreeModel::Row get_value_node_row()const { return value_node_row; }
130 -- ** -- S T A T I C P U B L I C M E T H O D S ---------------------------
135 static Glib::RefPtr<ChildrenTreeStore> create(etl::loose_handle<synfigapp::CanvasInterface> canvas_interface_);
136 }; // END of class ChildrenTreeStore
138 }; // END of namespace studio
140 /* === E N D =============================================================== */