00001
00021
00022
00023
00024
00025 #ifndef __SYNFIG_STUDIO_METADATATREESTORE_H
00026 #define __SYNFIG_STUDIO_METADATATREESTORE_H
00027
00028
00029
00030 #include <gtkmm/treestore.h>
00031 #include <synfigapp/canvasinterface.h>
00032 #include <gdkmm/pixbuf.h>
00033 #include <synfigapp/action.h>
00034
00035
00036
00037
00038
00039
00040
00041 namespace synfigapp { class CanvasInterface; }
00042
00043 namespace studio {
00044
00045 class MetaDataTreeStore : virtual public Gtk::TreeStore
00046 {
00047
00048
00049
00050
00051 public:
00052
00053 class Model : public Gtk::TreeModel::ColumnRecord
00054 {
00055 public:
00056 public:
00057 Gtk::TreeModelColumn<Glib::ustring> key;
00058 Gtk::TreeModelColumn<Glib::ustring> data;
00059
00060 Model()
00061 {
00062 add(key);
00063 add(data);
00064 }
00065 };
00066
00067
00068
00069
00070
00071 public:
00072
00073 const Model model;
00074
00075
00076
00077
00078
00079 private:
00080
00081 etl::loose_handle<synfigapp::CanvasInterface> canvas_interface_;
00082
00083
00084
00085
00086
00087 private:
00088
00089
00090
00091
00092
00093 private:
00094
00095 void meta_data_changed(synfig::String key);
00096
00097
00098
00099
00100
00101 public:
00102
00103 ~MetaDataTreeStore();
00104
00105 etl::loose_handle<synfigapp::CanvasInterface> get_canvas_interface() { return canvas_interface_; }
00106 etl::loose_handle<const synfigapp::CanvasInterface> get_canvas_interface()const { return canvas_interface_; }
00107 synfig::Canvas::Handle get_canvas()const { return canvas_interface_->get_canvas(); }
00108 synfig::Canvas::Handle get_canvas() { return canvas_interface_->get_canvas(); }
00109
00110 void rebuild();
00111
00112 void refresh() { rebuild(); }
00113
00114
00115
00116
00117
00118 protected:
00119 MetaDataTreeStore(etl::loose_handle<synfigapp::CanvasInterface>);
00120 void get_value_vfunc (const Gtk::TreeModel::iterator& iter, int column, Glib::ValueBase& value)const;
00121 void set_value_impl(const Gtk::TreeModel::iterator& iter, int column, const Glib::ValueBase& value);
00122
00123 public:
00124
00125 static Glib::RefPtr<MetaDataTreeStore> create(etl::loose_handle<synfigapp::CanvasInterface>);
00126
00127 };
00128
00129 };
00130
00131
00132
00133 #endif