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/>.
23 #include <imageareapanel.h>
24 #include <toolpanelcoord.h>
25 #include <profilepanel.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>
36 struct EditorPanelIdleHelper
{
43 class EditorPanel
: public Gtk::VBox
,
44 public PParamsChangeListener
,
45 public rtengine::ProgressListener
,
46 public ThumbnailListener
,
47 public HistoryBeforeLineListener
{
50 Gtk::Label
*progressLabel
;
51 Gtk::ToggleButton
* info
;
52 Gtk::ToggleButton
* hidehp
;
53 Gtk::ToggleButton
* beforeAfter
;
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
69 ImageAreaPanel
* beforeIarea
; // for the before-after view
72 Gtk::Label
* beforeLabel
;
73 Gtk::Label
* afterLabel
;
74 Gtk::HBox
* beforeAfterBox
;
76 ProfilePanel
* profilep
;
78 HistogramPanel
* histogramPanel
;
79 ToolPanelCoordinator
* tpc
;
81 SaveAsDialog
* saveAsDialog
;
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
);
93 rtengine::IImage16
* processImage ();
94 BatchQueueEntry
* createBatchQueueEntry ();
95 int saveImage (rtengine::IImage16
* img
, Glib::ustring
& fname
, SaveFormat sf
, bool findNewNameIfNeeded
);
99 static rtengine::InitialImage
* loadImage (Thumbnail
* tmb
);
101 EditorPanel (Thumbnail
* tmb
, rtengine::InitialImage
* isrc
);
102 virtual ~EditorPanel ();
104 bool beforeClosing ();
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
);
125 void info_toggled ();
126 void hideHistoryActivated ();
127 void beforeAfterToggled ();
128 void saveAsPressed ();
129 void queueImgPressed ();
130 void sendToGimpPressed ();
133 Glib::ustring
getShortName ();
134 Glib::ustring
getFileName ();
135 bool handleShortcutKey (GdkEventKey
* event
);