1 /* === S Y N F I G ========================================================= */
2 /*! \file layerparamtreestore.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_LAYERPARAMTREESTORE_H
27 #define __SYNFIG_STUDIO_LAYERPARAMTREESTORE_H
29 /* === H E A D E R S ======================================================= */
31 #include <gtkmm/treestore.h>
32 #include <synfigapp/canvasinterface.h>
33 #include "canvastreestore.h"
34 #include <synfig/value.h>
35 #include <synfig/valuenode.h>
36 #include <synfig/paramdesc.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 ======================================= */
48 class LayerParamTreeStore : public CanvasTreeStore
51 -- ** -- P U B L I C T Y P E S ---------------------------------------------
55 typedef std::list<synfig::Layer::Handle> LayerList;
58 -- ** -- P U B L I C D A T A ------------------------------------------------
63 //! TreeModel for the layer parameters
64 class Model : public CanvasTreeStore::Model
68 Gtk::TreeModelColumn<synfig::ParamDesc> param_desc;
70 Gtk::TreeModelColumn<bool> is_inconsistent;
71 Gtk::TreeModelColumn<bool> is_toplevel;
85 -- ** -- P R I V A T E D A T A ---------------------------------------------
92 LayerTree* layer_tree;
96 sigc::connection queue_connection;
98 std::list<sigc::connection> changed_connection_list;
100 sigc::signal<void> signal_changed_;
103 -- ** -- P R I V A T E M E T H O D S ---------------------------------------
109 virtual void get_value_vfunc (const Gtk::TreeModel::iterator& iter, int column, Glib::ValueBase& value)const;
110 virtual void set_value_impl (const Gtk::TreeModel::iterator& row, int column, const Glib::ValueBase& value);
111 virtual void set_row(Gtk::TreeRow row,synfigapp::ValueDesc value_desc);
114 -- ** -- S I G N A L T E R M I N A L S -------------------------------------
119 void on_value_node_child_added(synfig::ValueNode::Handle value_node,synfig::ValueNode::Handle child);
120 void on_value_node_child_removed(synfig::ValueNode::Handle value_node,synfig::ValueNode::Handle child);
122 void on_value_node_added(synfig::ValueNode::Handle value_node);
123 void on_value_node_deleted(synfig::ValueNode::Handle value_node);
124 virtual void on_value_node_changed(synfig::ValueNode::Handle value_node);
125 virtual void on_value_node_renamed(synfig::ValueNode::Handle value_node);
126 void on_value_node_replaced(synfig::ValueNode::Handle replaced_value_node,synfig::ValueNode::Handle new_value_node);
127 void on_layer_param_changed(synfig::Layer::Handle handle,synfig::String param_name);
130 -- ** -- P U B L I C M E T H O D S -----------------------------------------
135 LayerParamTreeStore(etl::loose_handle<synfigapp::CanvasInterface> canvas_interface_,
136 LayerTree* layer_tree);
137 ~LayerParamTreeStore();
143 void queue_refresh();
145 void queue_rebuild();
147 void refresh_row(Gtk::TreeModel::Row &row);
149 sigc::signal<void>& signal_changed() { return signal_changed_; }
151 void changed() { signal_changed_(); }
154 -- ** -- S T A T I C P U B L I C M E T H O D S ---------------------------
159 static Glib::RefPtr<LayerParamTreeStore> create(etl::loose_handle<synfigapp::CanvasInterface> canvas_interface_, LayerTree*layer_tree);
160 }; // END of class LayerParamTreeStore
162 }; // END of namespace studio
164 /* === E N D =============================================================== */