1 /* === S Y N F I G ========================================================= */
2 /*! \file historytreestore.h
3 ** \brief Template Header
8 ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
9 ** Copyright (c) 2008 Chris Moore
11 ** This package is free software; you can redistribute it and/or
12 ** modify it under the terms of the GNU General Public License as
13 ** published by the Free Software Foundation; either version 2 of
14 ** the License, or (at your option) any later version.
16 ** This package is distributed in the hope that it will be useful,
17 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 ** General Public License for more details.
22 /* ========================================================================= */
24 /* === S T A R T =========================================================== */
26 #ifndef __SYNFIG_STUDIO_HISTORYTREESTORE_H
27 #define __SYNFIG_STUDIO_HISTORYTREESTORE_H
29 /* === H E A D E R S ======================================================= */
31 #include <gtkmm/treestore.h>
32 #include <synfigapp/canvasinterface.h>
33 #include <gdkmm/pixbuf.h>
34 #include <synfigapp/action.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 ======================================= */
46 class HistoryTreeStore : virtual public Gtk::TreeStore
49 -- ** -- P U B L I C T Y P E S ---------------------------------------------
54 class Model : public Gtk::TreeModel::ColumnRecord
58 Gtk::TreeModelColumn<etl::handle<synfigapp::Action::Undoable> > action;
59 Gtk::TreeModelColumn<Glib::ustring> name;
60 Gtk::TreeModelColumn<Glib::RefPtr<Gdk::Pixbuf> > icon;
61 Gtk::TreeModelColumn<bool> is_active;
62 Gtk::TreeModelColumn<bool> is_undo;
63 Gtk::TreeModelColumn<bool> is_redo;
65 Gtk::TreeModelColumn<Glib::ustring> canvas_id;
66 Gtk::TreeModelColumn<synfig::Canvas::Handle> canvas;
82 -- ** -- P U B L I C D A T A ------------------------------------------------
90 -- ** -- P R I V A T E D A T A ---------------------------------------------
95 etl::loose_handle<studio::Instance> instance_;
96 Gtk::TreeIter curr_row;
99 -- ** -- P R I V A T E M E T H O D S ---------------------------------------
105 -- ** -- P R I V A T E D A T A ---------------------------------------------
110 sigc::signal<void> signal_undo_tree_changed_;
113 -- ** -- S I G N A L I N T E R F A C E S -----------------------------------
118 sigc::signal<void>& signal_undo_tree_changed() { return signal_undo_tree_changed_; }
121 -- ** -- S I G N A L T E R M I N A L S -------------------------------------
130 void on_undo_stack_cleared();
132 void on_redo_stack_cleared();
134 void on_new_action(etl::handle<synfigapp::Action::Undoable> action);
136 void on_action_status_changed(etl::handle<synfigapp::Action::Undoable> action);
139 -- ** -- P U B L I C M E T H O D S -----------------------------------------
144 HistoryTreeStore(etl::loose_handle<studio::Instance> instance_);
147 etl::loose_handle<studio::Instance> instance() { return instance_; }
148 etl::loose_handle<const studio::Instance> instance()const { return instance_; }
152 void refresh() { rebuild(); }
154 void insert_action(Gtk::TreeRow row,etl::handle<synfigapp::Action::Undoable> action, bool is_active=true, bool is_undo=true, bool is_redo=false);
156 static bool search_func(const Glib::RefPtr<TreeModel>&,int,const Glib::ustring&,const TreeModel::iterator&);
159 -- ** -- P R O T E C T E D M E T H O D S -----------------------------------
164 static Glib::RefPtr<HistoryTreeStore> create(etl::loose_handle<studio::Instance> instance);
166 }; // END of class HistoryTreeStore
168 }; // END of namespace studio
170 /* === E N D =============================================================== */