Proper check for rawzor libraries.
[rawtherapee-fixes.git] / rtgui / history.h
blob58d0a76c9861b4b4a61515e7a5eb60c77c199050
1 /*
2 * This file is part of RawTherapee.
4 * Copyright (c) 2004-2010 Gabor Horvath <hgabor@rawtherapee.com>
6 * RawTherapee is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * RawTherapee is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with RawTherapee. If not, see <http://www.gnu.org/licenses/>.
19 #ifndef _HISTORY_
20 #define _HISTORY_
22 #include <gtkmm.h>
23 #include <rtengine.h>
24 #include <pparamschangelistener.h>
25 #include <profilechangelistener.h>
26 #include <paramsedited.h>
28 class HistoryBeforeLineListener {
30 public:
31 virtual void historyBeforeLineChanged (const rtengine::procparams::ProcParams& params) {}
34 class History : public Gtk::VBox, public PParamsChangeListener {
36 public:
38 class HistoryColumns : public Gtk::TreeModel::ColumnRecord {
39 public:
40 Gtk::TreeModelColumn<Glib::ustring> realText;
41 Gtk::TreeModelColumn<Glib::ustring> text;
42 Gtk::TreeModelColumn<Glib::ustring> value;
43 Gtk::TreeModelColumn<rtengine::procparams::ProcParams> params;
44 Gtk::TreeModelColumn<rtengine::ProcEvent> chev;
45 Gtk::TreeModelColumn<ParamsEdited> paramsEdited;
46 HistoryColumns() { add(text); add(realText); add(value); add(chev); add(params); add(paramsEdited); }
48 HistoryColumns historyColumns;
49 class BookmarkColumns : public Gtk::TreeModel::ColumnRecord {
50 public:
51 Gtk::TreeModelColumn<Glib::ustring> text;
52 Gtk::TreeModelColumn<rtengine::procparams::ProcParams> params;
53 Gtk::TreeModelColumn<ParamsEdited> paramsEdited;
54 BookmarkColumns() { add(text); add(params); add(paramsEdited); }
56 BookmarkColumns bookmarkColumns;
58 protected:
59 Gtk::ScrolledWindow* hscrollw;
60 Gtk::TreeView* hTreeView;
61 Glib::RefPtr<Gtk::ListStore> historyModel;
63 Gtk::ScrolledWindow* bscrollw;
64 Gtk::TreeView* bTreeView;
65 Glib::RefPtr<Gtk::ListStore> bookmarkModel;
67 Gtk::Button* addBookmark;
68 Gtk::Button* delBookmark;
70 sigc::connection selchangehist;
71 sigc::connection selchangebm;
73 HistoryBeforeLineListener * blistener;
74 ProfileChangeListener* tpc;
75 ParamsEdited defParamsEdited;
76 int bmnum;
78 public:
80 History (bool bookmarkSupport = true);
82 void setProfileChangeListener (ProfileChangeListener* tpc_) { tpc = tpc_; }
83 void setHistoryBeforeLineListener (HistoryBeforeLineListener* bll) { blistener = bll; }
85 // pparamschangelistener interface
86 void procParamsChanged (rtengine::procparams::ProcParams* params, rtengine::ProcEvent ev, Glib::ustring descr, ParamsEdited* paramsEdited=NULL);
87 void clearParamChanges ();
89 void historySelectionChanged ();
90 void bookmarkSelectionChanged ();
91 void initHistory ();
93 bool getBeforeLineParams (rtengine::procparams::ProcParams& params);
95 void addBookmarkWithText (Glib::ustring text);
96 void addBookmarkPressed ();
97 void delBookmarkPressed ();
99 void resized (Gtk::Allocation& req);
101 void undo ();
102 void redo ();
105 #endif