1 /* === S Y N F I G ========================================================= */
2 /*! \file canvastreestore.h
3 ** \brief Template Header
5 ** $Id: canvastreestore.h,v 1.1.1.1 2005/01/07 03:34:35 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_CANVASTREESTORE_H
26 #define __SYNFIG_STUDIO_CANVASTREESTORE_H
28 /* === H E A D E R S ======================================================= */
30 #include <gtkmm/treestore.h>
31 #include <synfigapp/canvasinterface.h>
32 #include <gdkmm/pixbuf.h>
33 #include <synfigapp/value_desc.h>
34 #include <gtkmm/treeview.h>
36 /* === M A C R O S ========================================================= */
38 /* === T Y P E D E F S ===================================================== */
40 /* === C L A S S E S & S T R U C T S ======================================= */
44 class CellRenderer_TimeTrack;
45 class CellRenderer_ValueBase;
54 COLUMNID_END //!< \internal
56 #define COLUMNID_NAME COLUMNID_ID
58 class CanvasTreeStore : virtual public Gtk::TreeStore
61 -- ** -- P U B L I C T Y P E S ---------------------------------------------
66 class Model : public Gtk::TreeModel::ColumnRecord
69 Gtk::TreeModelColumn<Glib::RefPtr<Gdk::Pixbuf> > icon;
70 Gtk::TreeModelColumn<Glib::ustring> label;
71 Gtk::TreeModelColumn<Glib::ustring> name;
72 Gtk::TreeModelColumn<Glib::ustring> id;
74 Gtk::TreeModelColumn<synfig::Canvas::Handle> canvas;
75 Gtk::TreeModelColumn<bool> is_canvas;
77 Gtk::TreeModelColumn<synfig::ValueNode::Handle> value_node;
78 Gtk::TreeModelColumn<bool> is_value_node;
79 Gtk::TreeModelColumn<synfig::ValueBase> value;
80 Gtk::TreeModelColumn<Glib::ustring> type;
81 Gtk::TreeModelColumn<int> link_id;
82 Gtk::TreeModelColumn<int> link_count;
84 Gtk::TreeModelColumn<bool> is_editable;
86 Gtk::TreeModelColumn<bool> is_shared;
87 Gtk::TreeModelColumn<bool> is_exported;
89 Gtk::TreeModelColumn<synfigapp::ValueDesc> value_desc;
91 Gtk::TreeModelColumn<Glib::ustring> tooltip;
118 -- ** -- P U B L I C D A T A ------------------------------------------------
125 //std::multimap<etl::handle<ValueNode>, sigc::connection> connection_map;
128 -- ** -- P R I V A T E D A T A ---------------------------------------------
133 etl::loose_handle<synfigapp::CanvasInterface> canvas_interface_;
136 -- ** -- P R I V A T E M E T H O D S ---------------------------------------
142 virtual void get_value_vfunc (const Gtk::TreeModel::iterator& iter, int column, Glib::ValueBase& value)const;
145 -- ** -- S I G N A L T E R M I N A L S -------------------------------------
151 -- ** -- P U B L I C M E T H O D S -----------------------------------------
156 CanvasTreeStore(etl::loose_handle<synfigapp::CanvasInterface> canvas_interface_);
159 etl::loose_handle<synfigapp::CanvasInterface> canvas_interface() { return canvas_interface_; }
160 etl::loose_handle<const synfigapp::CanvasInterface> canvas_interface()const { return canvas_interface_; }
162 virtual void rebuild_row(Gtk::TreeModel::Row &row, bool do_children=true);
164 virtual void refresh_row(Gtk::TreeModel::Row &row, bool do_children=true);
166 virtual void set_row(Gtk::TreeRow row,synfigapp::ValueDesc value_desc, bool do_children=true);
168 bool find_first_value_desc(const synfigapp::ValueDesc& value_desc, Gtk::TreeIter& iter);
169 bool find_next_value_desc(const synfigapp::ValueDesc& value_desc, Gtk::TreeIter& iter);
171 bool find_first_value_node(const synfig::ValueNode::Handle& value_node, Gtk::TreeIter& iter);
172 bool find_next_value_node(const synfig::ValueNode::Handle& value_node, Gtk::TreeIter& iter);
175 static CellRenderer_ValueBase* add_cell_renderer_value(Gtk::TreeView::Column* column);
177 static CellRenderer_TimeTrack* add_cell_renderer_value_node(Gtk::TreeView::Column* column);
179 etl::loose_handle<synfigapp::CanvasInterface> get_canvas_interface()const { return canvas_interface_; }
181 virtual void on_value_node_changed(synfig::ValueNode::Handle value_node)=0;
184 -- ** -- P R O T E C T E D M E T H O D S -----------------------------------
189 }; // END of class CanvasTreeStore
191 }; // END of namespace studio
193 /* === E N D =============================================================== */