synfig-studio  1.0.3
layerparamtreestore.h
Go to the documentation of this file.
1 /* === S Y N F I G ========================================================= */
22 /* ========================================================================= */
23 
24 /* === S T A R T =========================================================== */
25 
26 #ifndef __SYNFIG_STUDIO_LAYERPARAMTREESTORE_H
27 #define __SYNFIG_STUDIO_LAYERPARAMTREESTORE_H
28 
29 /* === H E A D E R S ======================================================= */
30 
31 #include <gtkmm/treestore.h>
33 #include "trees/canvastreestore.h"
34 #include <synfig/value.h>
35 #include <synfig/valuenode.h>
36 #include <synfig/paramdesc.h>
37 
38 /* === M A C R O S ========================================================= */
39 
40 /* === T Y P E D E F S ===================================================== */
41 
42 /* === C L A S S E S & S T R U C T S ======================================= */
43 
44 namespace studio {
45 
46 class LayerTree;
47 
49 {
50  /*
51  -- ** -- P U B L I C T Y P E S ---------------------------------------------
52  */
53 
54 public:
55  typedef std::list<synfig::Layer::Handle> LayerList;
56 
57  /*
58  -- ** -- P U B L I C D A T A ------------------------------------------------
59  */
60 
61 public:
62 
65  {
66  public:
67 
68  Gtk::TreeModelColumn<synfig::ParamDesc> param_desc;
69 
70  Gtk::TreeModelColumn<bool> is_inconsistent;
71  Gtk::TreeModelColumn<bool> is_toplevel;
72 
74  {
75  add(param_desc);
76  add(is_inconsistent);
77  add(is_toplevel);
78  }
79  };
80 
82 
83 
84  /*
85  -- ** -- P R I V A T E D A T A ---------------------------------------------
86  */
87 
88 private:
89 
90  int queued;
91 
92  LayerTree* layer_tree;
93 
94  LayerList layer_list;
95 
96  sigc::connection queue_connection;
97 
98  std::list<sigc::connection> changed_connection_list;
99 
100  sigc::signal<void> signal_changed_;
101 
102  /*
103  -- ** -- P R I V A T E M E T H O D S ---------------------------------------
104  */
105 
106 private:
107 
108 protected:
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);
112  virtual void set_row(Gtk::TreeRow row,synfigapp::ValueDesc value_desc);
113 
114  /*
115  -- ** -- S I G N A L T E R M I N A L S -------------------------------------
116  */
117 
118 private:
119 
120  void on_value_node_child_added(synfig::ValueNode::Handle value_node,synfig::ValueNode::Handle child);
121  void on_value_node_child_removed(synfig::ValueNode::Handle value_node,synfig::ValueNode::Handle child);
122 
123  void on_value_node_added(synfig::ValueNode::Handle value_node);
124  void on_value_node_deleted(synfig::ValueNode::Handle value_node);
125  virtual void on_value_node_changed(synfig::ValueNode::Handle value_node);
126  virtual void on_value_node_renamed(synfig::ValueNode::Handle value_node);
127  void on_value_node_replaced(synfig::ValueNode::Handle replaced_value_node,synfig::ValueNode::Handle new_value_node);
128  void on_layer_param_changed(synfig::Layer::Handle handle,synfig::String param_name);
129 
130  /*
131  -- ** -- P U B L I C M E T H O D S -----------------------------------------
132  */
133 
134 public:
135 
136  LayerParamTreeStore(etl::loose_handle<synfigapp::CanvasInterface> canvas_interface_,
137  LayerTree* layer_tree);
139 
140  void rebuild();
141 
142  void refresh();
143 
144  void queue_refresh();
145 
146  void queue_rebuild();
147 
148  void refresh_row(Gtk::TreeModel::Row &row);
149 
150  sigc::signal<void>& signal_changed() { return signal_changed_; }
151 
152  void changed() { signal_changed_(); }
153 
154  /*
155  -- ** -- S T A T I C P U B L I C M E T H O D S ---------------------------
156  */
157 
158 public:
159 
160  static Glib::RefPtr<LayerParamTreeStore> create(etl::loose_handle<synfigapp::CanvasInterface> canvas_interface_, LayerTree*layer_tree);
161 }; // END of class LayerParamTreeStore
162 
163 }; // END of namespace studio
164 
165 /* === E N D =============================================================== */
166 
167 #endif