1 /* === S I N F 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 Robert B. Quattlebaum Jr.
10 ** This software and associated documentation
11 ** are CONFIDENTIAL and PROPRIETARY property of
12 ** the above-mentioned copyright holder.
14 ** You may not copy, print, publish, or in any
15 ** other way distribute this software without
16 ** a prior written agreement with
17 ** the copyright holder.
20 /* ========================================================================= */
22 /* === S T A R T =========================================================== */
24 #ifndef __SINFG_STUDIO_CANVASTREESTORE_H
25 #define __SINFG_STUDIO_CANVASTREESTORE_H
27 /* === H E A D E R S ======================================================= */
29 #include <gtkmm/treestore.h>
30 #include <sinfgapp/canvasinterface.h>
31 #include <gdkmm/pixbuf.h>
32 #include <sinfgapp/value_desc.h>
33 #include <gtkmm/treeview.h>
35 /* === M A C R O S ========================================================= */
37 /* === T Y P E D E F S ===================================================== */
39 /* === C L A S S E S & S T R U C T S ======================================= */
43 class CellRenderer_TimeTrack;
44 class CellRenderer_ValueBase;
53 COLUMNID_END //!< \internal
55 #define COLUMNID_NAME COLUMNID_ID
57 class CanvasTreeStore : virtual public Gtk::TreeStore
60 -- ** -- P U B L I C T Y P E S ---------------------------------------------
65 class Model : public Gtk::TreeModel::ColumnRecord
68 Gtk::TreeModelColumn<Glib::RefPtr<Gdk::Pixbuf> > icon;
69 Gtk::TreeModelColumn<Glib::ustring> label;
70 Gtk::TreeModelColumn<Glib::ustring> name;
71 Gtk::TreeModelColumn<Glib::ustring> id;
73 Gtk::TreeModelColumn<sinfg::Canvas::Handle> canvas;
74 Gtk::TreeModelColumn<bool> is_canvas;
76 Gtk::TreeModelColumn<sinfg::ValueNode::Handle> value_node;
77 Gtk::TreeModelColumn<bool> is_value_node;
78 Gtk::TreeModelColumn<sinfg::ValueBase> value;
79 Gtk::TreeModelColumn<Glib::ustring> type;
80 Gtk::TreeModelColumn<int> link_id;
81 Gtk::TreeModelColumn<int> link_count;
83 Gtk::TreeModelColumn<bool> is_editable;
85 Gtk::TreeModelColumn<bool> is_shared;
86 Gtk::TreeModelColumn<bool> is_exported;
88 Gtk::TreeModelColumn<sinfgapp::ValueDesc> value_desc;
90 Gtk::TreeModelColumn<Glib::ustring> tooltip;
117 -- ** -- P U B L I C D A T A ------------------------------------------------
124 //std::multimap<etl::handle<ValueNode>, sigc::connection> connection_map;
127 -- ** -- P R I V A T E D A T A ---------------------------------------------
132 etl::loose_handle<sinfgapp::CanvasInterface> canvas_interface_;
135 -- ** -- P R I V A T E M E T H O D S ---------------------------------------
141 virtual void get_value_vfunc (const Gtk::TreeModel::iterator& iter, int column, Glib::ValueBase& value)const;
144 -- ** -- S I G N A L T E R M I N A L S -------------------------------------
150 -- ** -- P U B L I C M E T H O D S -----------------------------------------
155 CanvasTreeStore(etl::loose_handle<sinfgapp::CanvasInterface> canvas_interface_);
158 etl::loose_handle<sinfgapp::CanvasInterface> canvas_interface() { return canvas_interface_; }
159 etl::loose_handle<const sinfgapp::CanvasInterface> canvas_interface()const { return canvas_interface_; }
161 virtual void rebuild_row(Gtk::TreeModel::Row &row, bool do_children=true);
163 virtual void refresh_row(Gtk::TreeModel::Row &row, bool do_children=true);
165 virtual void set_row(Gtk::TreeRow row,sinfgapp::ValueDesc value_desc, bool do_children=true);
167 bool find_first_value_desc(const sinfgapp::ValueDesc& value_desc, Gtk::TreeIter& iter);
168 bool find_next_value_desc(const sinfgapp::ValueDesc& value_desc, Gtk::TreeIter& iter);
170 bool find_first_value_node(const sinfg::ValueNode::Handle& value_node, Gtk::TreeIter& iter);
171 bool find_next_value_node(const sinfg::ValueNode::Handle& value_node, Gtk::TreeIter& iter);
174 static CellRenderer_ValueBase* add_cell_renderer_value(Gtk::TreeView::Column* column);
176 static CellRenderer_TimeTrack* add_cell_renderer_value_node(Gtk::TreeView::Column* column);
178 etl::loose_handle<sinfgapp::CanvasInterface> get_canvas_interface()const { return canvas_interface_; }
180 virtual void on_value_node_changed(sinfg::ValueNode::Handle value_node)=0;
183 -- ** -- P R O T E C T E D M E T H O D S -----------------------------------
188 }; // END of class CanvasTreeStore
190 }; // END of namespace studio
192 /* === E N D =============================================================== */