- Main Page
- Related Pages
- Namespaces
- Classes
- Files

# canvastreestore.h

Go to the documentation of this file.

    00001 /* === S Y N F I G ========================================================= */
    00021 /* ========================================================================= */
    00022
    00023 /* === S T A R T =========================================================== */
    00024
    00025 #ifndef __SYNFIG_STUDIO_CANVASTREESTORE_H
    00026 #define __SYNFIG_STUDIO_CANVASTREESTORE_H
    00027
    00028 /* === H E A D E R S ======================================================= */
    00029
    00030 #include <gtkmm/treestore.h>
    00031 #include <synfigapp/canvasinterface.h>
    00032 #include <gdkmm/pixbuf.h>
    00033 #include <synfigapp/value_desc.h>
    00034 #include <gtkmm/treeview.h>
    00035
    00036 /* === M A C R O S ========================================================= */
    00037
    00038 /* === T Y P E D E F S ===================================================== */
    00039
    00040 /* === C L A S S E S & S T R U C T S ======================================= */
    00041
    00042 namespace studio {
    00043
    00044 class CellRenderer_TimeTrack;
    00045 class CellRenderer_ValueBase;
    00046
    00047     enum ColumnID
    00048     {
    00049         COLUMNID_ID,
    00050         COLUMNID_VALUE,
    00051         COLUMNID_TIME_TRACK,
    00052         COLUMNID_TYPE,
    00053
    00054         COLUMNID_END
    00055     };
    00056 #define COLUMNID_NAME COLUMNID_ID
    00057
    00058 class CanvasTreeStore : virtual public Gtk::TreeStore
    00059 {
    00060     /*
    00061  -- ** -- P U B L I C   T Y P E S ---------------------------------------------
    00062     */
    00063
    00064 public:
    00065
    00066     class Model : public Gtk::TreeModel::ColumnRecord
    00067     {
    00068     public:
    00069         Gtk::TreeModelColumn<Glib::RefPtr<Gdk::Pixbuf> > icon;
    00070         Gtk::TreeModelColumn<Glib::ustring> label;
    00071         Gtk::TreeModelColumn<Glib::ustring> name;
    00072         Gtk::TreeModelColumn<Glib::ustring> id;
    00073
    00074         Gtk::TreeModelColumn<synfig::Canvas::Handle> canvas;
    00075         Gtk::TreeModelColumn<bool> is_canvas;
    00076
    00077         Gtk::TreeModelColumn<synfig::ValueNode::Handle> value_node;
    00078         Gtk::TreeModelColumn<bool> is_value_node;
    00079         Gtk::TreeModelColumn<synfig::ValueBase> value;
    00080         Gtk::TreeModelColumn<Glib::ustring> type;
    00081         Gtk::TreeModelColumn<int> link_id;
    00082         Gtk::TreeModelColumn<int> link_count;
    00083
    00084         Gtk::TreeModelColumn<bool> is_editable;
    00085
    00086         Gtk::TreeModelColumn<bool> is_shared;
    00087         Gtk::TreeModelColumn<bool> is_exported;
    00088
    00089         Gtk::TreeModelColumn<synfigapp::ValueDesc> value_desc;
    00090
    00091         Gtk::TreeModelColumn<Glib::ustring> tooltip;
    00092
    00093         Model()
    00094         {
    00095             add(value);
    00096             add(name);
    00097             add(label);
    00098             add(icon);
    00099             add(type);
    00100             add(id);
    00101             add(canvas);
    00102             add(value_node);
    00103             add(is_canvas);
    00104             add(is_value_node);
    00105
    00106             add(is_shared);
    00107             add(is_exported);
    00108             add(is_editable);
    00109             add(value_desc);
    00110             add(link_count);
    00111             add(link_id);
    00112
    00113             add(tooltip);
    00114         }
    00115     };
    00116
    00117     /*
    00118  -- ** -- P U B L I C  D A T A ------------------------------------------------
    00119     */
    00120
    00121 public:
    00122
    00123     const Model model;
    00124
    00125     //std::multimap<etl::handle<ValueNode>, sigc::connection> connection_map;
    00126
    00127     /*
    00128  -- ** -- P R I V A T E   D A T A ---------------------------------------------
    00129     */
    00130
    00131 private:
    00132
    00133     etl::loose_handle<synfigapp::CanvasInterface> canvas_interface_;
    00134
    00135     /*
    00136  -- ** -- P R I V A T E   M E T H O D S ---------------------------------------
    00137     */
    00138
    00139 private:
    00140
    00141 protected:
    00142     virtual void  get_value_vfunc (const Gtk::TreeModel::iterator& iter, int column, Glib::ValueBase& value)const;
    00143
    00144     /*
    00145  -- ** -- S I G N A L   T E R M I N A L S -------------------------------------
    00146     */
    00147
    00148 private:
    00149
    00150     /*
    00151  -- ** -- P U B L I C   M E T H O D S -----------------------------------------
    00152     */
    00153
    00154 public:
    00155
    00156     CanvasTreeStore(etl::loose_handle<synfigapp::CanvasInterface> canvas_interface_);
    00157     ~CanvasTreeStore();
    00158
    00159     etl::loose_handle<synfigapp::CanvasInterface> canvas_interface() { return canvas_interface_; }
    00160     etl::loose_handle<const synfigapp::CanvasInterface> canvas_interface()const { return canvas_interface_; }
    00161
    00162     virtual void rebuild_row(Gtk::TreeModel::Row &row, bool do_children=true);
    00163
    00164     virtual void refresh_row(Gtk::TreeModel::Row &row, bool do_children=true);
    00165
    00166     virtual void set_row(Gtk::TreeRow row,synfigapp::ValueDesc value_desc, bool do_children=true);
    00167
    00168     bool find_first_value_desc(const synfigapp::ValueDesc& value_desc, Gtk::TreeIter& iter);
    00169     bool find_next_value_desc(const synfigapp::ValueDesc& value_desc, Gtk::TreeIter& iter);
    00170
    00171     bool find_first_value_node(const synfig::ValueNode::Handle& value_node, Gtk::TreeIter& iter);
    00172     bool find_next_value_node(const synfig::ValueNode::Handle& value_node, Gtk::TreeIter& iter);
    00173
    00174
    00175     static CellRenderer_ValueBase* add_cell_renderer_value(Gtk::TreeView::Column* column);
    00176
    00177     static CellRenderer_TimeTrack* add_cell_renderer_value_node(Gtk::TreeView::Column* column);
    00178
    00179     etl::loose_handle<synfigapp::CanvasInterface> get_canvas_interface()const { return canvas_interface_; }
    00180
    00181     virtual void on_value_node_changed(synfig::ValueNode::Handle value_node)=0;
    00182
    00183     /*
    00184  -- ** -- P R O T E C T E D   M E T H O D S -----------------------------------
    00185     */
    00186
    00187 public:
    00188
    00189 }; // END of class CanvasTreeStore
    00190
    00191 }; // END of namespace studio
    00192
    00193 /* === E N D =============================================================== */
    00194
    00195 #endif