1 /* === S Y N F I G ========================================================= */
2 /*! \file layerparamtreestore.h
3 ** \brief Template Header
5 ** $Id: layerparamtreestore.h,v 1.1.1.1 2005/01/07 03:34:36 darco Exp $
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_LAYERPARAMTREESTORE_H
26 #define __SYNFIG_STUDIO_LAYERPARAMTREESTORE_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>
35 #include <synfig/paramdesc.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 ======================================= */
47 class LayerParamTreeStore : public CanvasTreeStore
50 -- ** -- P U B L I C T Y P E S ---------------------------------------------
54 typedef std::list<synfig::Layer::Handle> LayerList;
57 -- ** -- P U B L I C D A T A ------------------------------------------------
62 //! TreeModel for the layer parameters
63 class Model : public CanvasTreeStore::Model
67 Gtk::TreeModelColumn<synfig::ParamDesc> param_desc;
69 Gtk::TreeModelColumn<bool> is_inconsistent;
70 Gtk::TreeModelColumn<bool> is_toplevel;
84 -- ** -- P R I V A T E D A T A ---------------------------------------------
91 LayerTree* layer_tree;
95 sigc::connection queue_connection;
97 std::list<sigc::connection> changed_connection_list;
99 sigc::signal<void> signal_changed_;
102 -- ** -- P R I V A T E M E T H O D S ---------------------------------------
108 virtual void get_value_vfunc (const Gtk::TreeModel::iterator& iter, int column, Glib::ValueBase& value)const;
109 virtual void set_value_impl (const Gtk::TreeModel::iterator& row, int column, const Glib::ValueBase& value);
110 virtual void set_row(Gtk::TreeRow row,synfigapp::ValueDesc value_desc);
113 -- ** -- S I G N A L T E R M I N A L S -------------------------------------
118 void on_value_node_child_added(synfig::ValueNode::Handle value_node,synfig::ValueNode::Handle child);
119 void on_value_node_child_removed(synfig::ValueNode::Handle value_node,synfig::ValueNode::Handle child);
121 void on_value_node_added(synfig::ValueNode::Handle value_node);
122 void on_value_node_deleted(synfig::ValueNode::Handle value_node);
123 virtual void on_value_node_changed(synfig::ValueNode::Handle value_node);
124 void on_value_node_replaced(synfig::ValueNode::Handle replaced_value_node,synfig::ValueNode::Handle new_value_node);
125 void on_layer_param_changed(synfig::Layer::Handle handle,synfig::String param_name);
128 -- ** -- P U B L I C M E T H O D S -----------------------------------------
133 LayerParamTreeStore(etl::loose_handle<synfigapp::CanvasInterface> canvas_interface_,
134 LayerTree* layer_tree);
135 ~LayerParamTreeStore();
141 void queue_refresh();
143 void queue_rebuild();
145 void refresh_row(Gtk::TreeModel::Row &row);
147 sigc::signal<void>& signal_changed() { return signal_changed_; }
149 void changed() { signal_changed_(); }
152 -- ** -- S T A T I C P U B L I C M E T H O D S ---------------------------
157 static Glib::RefPtr<LayerParamTreeStore> create(etl::loose_handle<synfigapp::CanvasInterface> canvas_interface_, LayerTree*layer_tree);
158 }; // END of class LayerParamTreeStore
160 }; // END of namespace studio
162 /* === E N D =============================================================== */