1 /* === S Y N F I G ========================================================= */
2 /*! \file historytreestore.h
3 ** \brief Template Header
5 ** $Id: historytreestore.h,v 1.1.1.1 2005/01/07 03:34:36 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_HISTORYTREESTORE_H
26 #define __SYNFIG_STUDIO_HISTORYTREESTORE_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/action.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 ======================================= */
45 class HistoryTreeStore : virtual public Gtk::TreeStore
48 -- ** -- P U B L I C T Y P E S ---------------------------------------------
53 class Model : public Gtk::TreeModel::ColumnRecord
57 Gtk::TreeModelColumn<etl::handle<synfigapp::Action::Undoable> > action;
58 Gtk::TreeModelColumn<Glib::ustring> name;
59 Gtk::TreeModelColumn<Glib::RefPtr<Gdk::Pixbuf> > icon;
60 Gtk::TreeModelColumn<bool> is_active;
61 Gtk::TreeModelColumn<bool> is_undo;
62 Gtk::TreeModelColumn<bool> is_redo;
64 Gtk::TreeModelColumn<Glib::ustring> canvas_id;
65 Gtk::TreeModelColumn<synfig::Canvas::Handle> canvas;
81 -- ** -- P U B L I C D A T A ------------------------------------------------
89 -- ** -- P R I V A T E D A T A ---------------------------------------------
94 etl::loose_handle<studio::Instance> instance_;
95 Gtk::TreeIter curr_row;
98 -- ** -- P R I V A T E M E T H O D S ---------------------------------------
104 -- ** -- S I G N A L T E R M I N A L S -------------------------------------
113 void on_undo_stack_cleared();
115 void on_redo_stack_cleared();
117 void on_new_action(etl::handle<synfigapp::Action::Undoable> action);
119 void on_action_status_changed(etl::handle<synfigapp::Action::Undoable> action);
122 -- ** -- P U B L I C M E T H O D S -----------------------------------------
127 HistoryTreeStore(etl::loose_handle<studio::Instance> instance_);
130 etl::loose_handle<studio::Instance> instance() { return instance_; }
131 etl::loose_handle<const studio::Instance> instance()const { return instance_; }
135 void refresh() { rebuild(); }
137 void insert_action(Gtk::TreeRow row,etl::handle<synfigapp::Action::Undoable> action, bool is_active=true, bool is_undo=true, bool is_redo=false);
140 -- ** -- P R O T E C T E D M E T H O D S -----------------------------------
145 static Glib::RefPtr<HistoryTreeStore> create(etl::loose_handle<studio::Instance> instance);
147 }; // END of class HistoryTreeStore
149 }; // END of namespace studio
151 /* === E N D =============================================================== */