Proper check for rawzor libraries.
[rawtherapee-fixes.git] / rtgui / editorpanel.h
blobe8c3e01a9831cb7a2eda9e04bf260efb457064e2
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 _EDITORPANEL_
20 #define _EDITORPANEL_
22 #include <gtkmm.h>
23 #include <imageareapanel.h>
24 #include <toolpanelcoord.h>
25 #include <profilepanel.h>
26 #include <rtengine.h>
27 #include <history.h>
28 #include <histogrampanel.h>
29 #include <thumbnail.h>
30 #include <saveasdlg.h>
31 #include <batchqueueentry.h>
32 #include <thumbnaillistener.h>
33 #include <navigator.h>
35 class EditorPanel;
36 struct EditorPanelIdleHelper {
37 EditorPanel* epanel;
38 bool destroyed;
39 int pending;
42 class RTWindow;
43 class EditorPanel : public Gtk::VBox,
44 public PParamsChangeListener,
45 public rtengine::ProgressListener,
46 public ThumbnailListener,
47 public HistoryBeforeLineListener {
49 protected:
50 Gtk::Label *progressLabel;
51 Gtk::ToggleButton* info;
52 Gtk::ToggleButton* hidehp;
53 Gtk::ToggleButton* beforeAfter;
54 Gtk::HPaned* hpanedl;
55 Gtk::HPaned* hpanedr;
56 Gtk::HBox* statusBox;
57 Gtk::Image* red;
58 Gtk::Image* green;
59 Gtk::VBox* leftbox, *vboxright;
61 Gtk::Button* queueimg;
62 Gtk::Button* saveimgas;
63 Gtk::Button* sendtogimp;
65 ImageAreaPanel* iarea;
66 PreviewHandler* previewHandler;
67 PreviewHandler* beforePreviewHandler; // for the before-after view
68 Navigator* navigator;
69 ImageAreaPanel* beforeIarea; // for the before-after view
70 Gtk::VBox* beforeBox;
71 Gtk::VBox* afterBox;
72 Gtk::Label* beforeLabel;
73 Gtk::Label* afterLabel;
74 Gtk::HBox* beforeAfterBox;
76 ProfilePanel* profilep;
77 History* history;
78 HistogramPanel* histogramPanel;
79 ToolPanelCoordinator* tpc;
80 RTWindow* parent;
81 SaveAsDialog* saveAsDialog;
83 Thumbnail* openThm;
84 rtengine::InitialImage* isrc;
85 rtengine::StagedImageProcessor* ipc;
86 rtengine::StagedImageProcessor* beforeIpc; // for the before-after view
88 EditorPanelIdleHelper* epih;
90 void open (Thumbnail* tmb, rtengine::InitialImage* isrc);
91 void close ();
93 rtengine::IImage16* processImage ();
94 BatchQueueEntry* createBatchQueueEntry ();
95 int saveImage (rtengine::IImage16* img, Glib::ustring& fname, SaveFormat sf, bool findNewNameIfNeeded);
97 public:
99 static rtengine::InitialImage* loadImage (Thumbnail* tmb);
101 EditorPanel (Thumbnail* tmb, rtengine::InitialImage* isrc);
102 virtual ~EditorPanel ();
104 bool beforeClosing ();
105 void on_realize ();
107 void setParent (RTWindow* p) { parent = p; }
109 // progresslistener interface
110 void setProgressState (int state);
111 void error (Glib::ustring descr);
112 void refreshProcessingState (bool state); // this is called by setProcessingState in the gtk thread
113 void displayError (Glib::ustring descr); // this is called by error in the gtk thread
115 // PParamsChangeListener interface
116 void procParamsChanged (rtengine::procparams::ProcParams* params, rtengine::ProcEvent ev, Glib::ustring descr, ParamsEdited* paramsEdited=NULL);
118 // thumbnaillistener interface
119 void procParamsChanged (Thumbnail* thm, int whoChangedIt);
121 // HistoryBeforeLineListener
122 void historyBeforeLineChanged (const rtengine::procparams::ProcParams& params);
124 // event handlers
125 void info_toggled ();
126 void hideHistoryActivated ();
127 void beforeAfterToggled ();
128 void saveAsPressed ();
129 void queueImgPressed ();
130 void sendToGimpPressed ();
132 void saveProfile ();
133 Glib::ustring getShortName ();
134 Glib::ustring getFileName ();
135 bool handleShortcutKey (GdkEventKey* event);
137 void saveOptions ();
140 #endif