From b3b1008270d92fff3b29f1da7351623f836f5107 Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Sat, 2 Nov 2019 17:29:26 +0100 Subject: [PATCH] Further reduction of include dependencies --- CMakeLists.txt | 1 + rtgui/CMakeLists.txt | 1 - rtgui/batchqueue.h | 1 + rtgui/batchqueuebuttonset.cc | 2 + rtgui/batchqueuebuttonset.h | 3 +- rtgui/batchtoolpanelcoord.cc | 4 ++ rtgui/cropwindow.cc | 1 + rtgui/editbuffer.h | 4 -- rtgui/editorpanel.cc | 2 + rtgui/editorpanel.h | 2 +- rtgui/editwidgets.cc | 2 + rtgui/editwidgets.h | 4 +- rtgui/editwindow.cc | 1 + rtgui/filebrowser.h | 1 + rtgui/filecatalog.cc | 1 + rtgui/filepanel.cc | 2 + rtgui/filepanel.h | 2 +- rtgui/filethumbnailbuttonset.cc | 2 + rtgui/filethumbnailbuttonset.h | 2 +- rtgui/iccprofilecreator.cc | 10 +++-- rtgui/iccprofilecreator.h | 5 ++- rtgui/ilabel.cc | 66 --------------------------------- rtgui/ilabel.h | 34 ----------------- rtgui/imagearea.cc | 1 + rtgui/lwbutton.cc | 1 + rtgui/lwbutton.h | 2 - rtgui/lwbuttonset.cc | 2 + rtgui/lwbuttonset.h | 3 +- rtgui/main.cc | 4 ++ rtgui/preferences.cc | 2 + rtgui/preferences.h | 5 ++- rtgui/previewwindow.cc | 1 + rtgui/progressconnector.h | 2 +- rtgui/renamedlg.cc | 1 + rtgui/renamedlg.h | 3 +- rtgui/rtwindow.cc | 10 +++++ rtgui/rtwindow.h | 13 +++---- rtgui/thumbbrowserbase.cc | 1 + 38 files changed, 75 insertions(+), 129 deletions(-) delete mode 100644 rtgui/ilabel.cc delete mode 100644 rtgui/ilabel.h diff --git a/CMakeLists.txt b/CMakeLists.txt index b5626512a..d7368f115 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -89,6 +89,7 @@ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PROC_FLAGS}") # Stop compilation on typos such as std:swap (missing colon will be detected as unused label): set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=unused-label") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=delete-incomplete") # Special treatment for x87 and x86-32 SSE (see GitHub issue #4324) include(FindX87Math) diff --git a/rtgui/CMakeLists.txt b/rtgui/CMakeLists.txt index edc2b8202..4b21ce421 100644 --- a/rtgui/CMakeLists.txt +++ b/rtgui/CMakeLists.txt @@ -79,7 +79,6 @@ set(NONCLISOURCEFILES hsvequalizer.cc iccprofilecreator.cc icmpanel.cc - ilabel.cc imagearea.cc imageareapanel.cc impulsedenoise.cc diff --git a/rtgui/batchqueue.h b/rtgui/batchqueue.h index a0c04abee..9ae615965 100644 --- a/rtgui/batchqueue.h +++ b/rtgui/batchqueue.h @@ -22,6 +22,7 @@ #include #include "batchqueueentry.h" +#include "lwbutton.h" #include "lwbuttonset.h" #include "threadutils.h" #include "thumbbrowserbase.h" diff --git a/rtgui/batchqueuebuttonset.cc b/rtgui/batchqueuebuttonset.cc index a8be9eedf..969a55079 100644 --- a/rtgui/batchqueuebuttonset.cc +++ b/rtgui/batchqueuebuttonset.cc @@ -18,8 +18,10 @@ */ #include "batchqueuebuttonset.h" +#include "lwbutton.h" #include "multilangmgr.h" #include "rtimage.h" +#include "rtsurface.h" bool BatchQueueButtonSet::iconsLoaded = false; diff --git a/rtgui/batchqueuebuttonset.h b/rtgui/batchqueuebuttonset.h index 17f582168..fb45df518 100644 --- a/rtgui/batchqueuebuttonset.h +++ b/rtgui/batchqueuebuttonset.h @@ -21,9 +21,10 @@ #include #include "lwbuttonset.h" -#include "rtsurface.h" class BatchQueueEntry; +class RTSurface; + class BatchQueueButtonSet : public LWButtonSet { diff --git a/rtgui/batchtoolpanelcoord.cc b/rtgui/batchtoolpanelcoord.cc index 760614d5e..8aed3e96f 100644 --- a/rtgui/batchtoolpanelcoord.cc +++ b/rtgui/batchtoolpanelcoord.cc @@ -16,6 +16,10 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ + +#include "bayerpreprocess.h" +#include "bayerprocess.h" + #include "multilangmgr.h" #include "batchtoolpanelcoord.h" #include "options.h" diff --git a/rtgui/cropwindow.cc b/rtgui/cropwindow.cc index f0f4cbcba..f44e78a56 100644 --- a/rtgui/cropwindow.cc +++ b/rtgui/cropwindow.cc @@ -33,6 +33,7 @@ #include "editcallbacks.h" #include "editbuffer.h" #include "editwidgets.h" +#include "rtsurface.h" #include "../rtengine/dcrop.h" #include "../rtengine/procparams.h" diff --git a/rtgui/editbuffer.h b/rtgui/editbuffer.h index 77afb6449..046ab7364 100644 --- a/rtgui/editbuffer.h +++ b/rtgui/editbuffer.h @@ -22,10 +22,6 @@ #include "../rtengine/coord.h" #include -#ifdef GUIVERSION -#include "rtsurface.h" -#endif - class EditDataProvider; class EditSubscriber; diff --git a/rtgui/editorpanel.cc b/rtgui/editorpanel.cc index 3328dcd65..108b11ea3 100644 --- a/rtgui/editorpanel.cc +++ b/rtgui/editorpanel.cc @@ -23,6 +23,7 @@ #include "../rtengine/imagesource.h" #include "../rtengine/iccstore.h" +#include "batchqueue.h" #include "soundman.h" #include "rtimage.h" #include "rtwindow.h" @@ -34,6 +35,7 @@ #include "placesbrowser.h" #include "pathutils.h" #include "thumbnail.h" +#include "toolpanelcoord.h" using namespace rtengine::procparams; diff --git a/rtgui/editorpanel.h b/rtgui/editorpanel.h index 2f6c01a31..b577b858f 100644 --- a/rtgui/editorpanel.h +++ b/rtgui/editorpanel.h @@ -31,7 +31,6 @@ #include "progressconnector.h" #include "saveasdlg.h" #include "thumbnaillistener.h" -#include "toolpanelcoord.h" #include "../rtengine/noncopyable.h" #include "../rtengine/rtengine.h" @@ -39,6 +38,7 @@ class EditorPanel; class MyProgressBar; class Thumbnail; +class ToolPanelCoordinator; struct EditorPanelIdleHelper { EditorPanel* epanel; diff --git a/rtgui/editwidgets.cc b/rtgui/editwidgets.cc index a7996ee42..f7c748744 100644 --- a/rtgui/editwidgets.cc +++ b/rtgui/editwidgets.cc @@ -18,8 +18,10 @@ */ #include "editwidgets.h" + #include "editbuffer.h" #include "editcallbacks.h" +#include "rtsurface.h" #include "../rtengine/rt_math.h" RGBColor Geometry::getInnerLineColor () diff --git a/rtgui/editwidgets.h b/rtgui/editwidgets.h index 9154db31f..d31451ecb 100644 --- a/rtgui/editwidgets.h +++ b/rtgui/editwidgets.h @@ -20,12 +20,14 @@ #ifdef GUIVERSION -#include "rtsurface.h" +#include + #include "editbuffer.h" #include "editcoordsys.h" #include "../rtengine/coord.h" class ObjectMOBuffer; +class RTSurface; /** @file * diff --git a/rtgui/editwindow.cc b/rtgui/editwindow.cc index 50a1484cf..11c0be4e2 100644 --- a/rtgui/editwindow.cc +++ b/rtgui/editwindow.cc @@ -16,6 +16,7 @@ */ #include "editwindow.h" +#include "../rtengine/procparams.h" #include "options.h" #include "preferences.h" #include "cursormanager.h" diff --git a/rtgui/filebrowser.h b/rtgui/filebrowser.h index dc671fe85..b941ea9df 100644 --- a/rtgui/filebrowser.h +++ b/rtgui/filebrowser.h @@ -27,6 +27,7 @@ #include "exportpanel.h" #include "extprog.h" #include "filebrowserentry.h" +#include "lwbutton.h" #include "partialpastedlg.h" #include "pparamschangelistener.h" #include "../rtengine/profilestore.h" diff --git a/rtgui/filecatalog.cc b/rtgui/filecatalog.cc index 923a15e8d..5e93631e5 100644 --- a/rtgui/filecatalog.cc +++ b/rtgui/filecatalog.cc @@ -25,6 +25,7 @@ #include #include "../rtengine/rt_math.h" +#include "../rtengine/procparams.h" #include "guiutils.h" #include "options.h" diff --git a/rtgui/filepanel.cc b/rtgui/filepanel.cc index 0c401a701..8f45343de 100644 --- a/rtgui/filepanel.cc +++ b/rtgui/filepanel.cc @@ -18,6 +18,8 @@ */ #include "filepanel.h" +#include "batchtoolpanelcoord.h" +#include "editorpanel.h" #include "rtwindow.h" #include "inspector.h" #include "placesbrowser.h" diff --git a/rtgui/filepanel.h b/rtgui/filepanel.h index 9ae91be4d..9db9d99b7 100644 --- a/rtgui/filepanel.h +++ b/rtgui/filepanel.h @@ -20,7 +20,6 @@ #include -#include "batchtoolpanelcoord.h" #include "dirbrowser.h" #include "exportpanel.h" #include "filecatalog.h" @@ -34,6 +33,7 @@ #include "../rtengine/noncopyable.h" +class BatchToolPanelCoordinator; class RTWindow; class FilePanel final : diff --git a/rtgui/filethumbnailbuttonset.cc b/rtgui/filethumbnailbuttonset.cc index ef497a535..bb64675a1 100644 --- a/rtgui/filethumbnailbuttonset.cc +++ b/rtgui/filethumbnailbuttonset.cc @@ -20,6 +20,8 @@ #include "rtimage.h" #include "multilangmgr.h" +#include "lwbutton.h" +#include "rtsurface.h" bool FileThumbnailButtonSet::iconsLoaded = false; diff --git a/rtgui/filethumbnailbuttonset.h b/rtgui/filethumbnailbuttonset.h index f4fbc97ed..66d5b5f67 100644 --- a/rtgui/filethumbnailbuttonset.h +++ b/rtgui/filethumbnailbuttonset.h @@ -24,9 +24,9 @@ #include "filebrowserentry.h" #include "lwbuttonset.h" -#include "rtsurface.h" class FileBrowserEntry; +class RTSurface; class FileThumbnailButtonSet : public LWButtonSet diff --git a/rtgui/iccprofilecreator.cc b/rtgui/iccprofilecreator.cc index d7f9499f6..a8f9be007 100644 --- a/rtgui/iccprofilecreator.cc +++ b/rtgui/iccprofilecreator.cc @@ -17,18 +17,20 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ + +#include +#include + #include #include "iccprofilecreator.h" #include "../rtengine/iccstore.h" #include "multilangmgr.h" #include "cachemanager.h" -#include "addsetids.h" #include "../rtengine/color.h" +#include "options.h" #include "pathutils.h" #include "rtimage.h" -#ifdef _OPENMP -#include -#endif +#include "rtwindow.h" const char* sTRCPreset[] = {"BT709_g2.2_s4.5", "sRGB_g2.4_s12.92", "linear_g1.0", "standard_g2.2", "standard_g1.8", "High_g1.3_s3.35", "Low_g2.6_s6.9", "Lab_g3.0s9.03296"}; //gamma free diff --git a/rtgui/iccprofilecreator.h b/rtgui/iccprofilecreator.h index 950fcc01f..2cd19e14f 100644 --- a/rtgui/iccprofilecreator.h +++ b/rtgui/iccprofilecreator.h @@ -19,10 +19,13 @@ */ #pragma once +#include + #include #include "adjuster.h" #include -#include "rtwindow.h" + +class RTWindow; class ICCProfileCreator : public Gtk::Dialog, public AdjusterListener { diff --git a/rtgui/ilabel.cc b/rtgui/ilabel.cc deleted file mode 100644 index 9dfd50b89..000000000 --- a/rtgui/ilabel.cc +++ /dev/null @@ -1,66 +0,0 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#include "ilabel.h" - -ILabel::ILabel (const Glib::ustring &lab) : label(lab) {} - -void ILabel::on_realize() -{ - - Gtk::DrawingArea::on_realize(); - add_events(Gdk::EXPOSURE_MASK); - - Glib::RefPtr fn = create_pango_layout(label); - fn->set_markup (label); - int labw, labh; - fn->get_pixel_size (labw, labh); - set_size_request (2 + labw, 2 + labh); -} - -bool ILabel::on_draw(const ::Cairo::RefPtr< Cairo::Context> &cr) -{ - - Glib::RefPtr style = get_style_context (); - - Gtk::StateFlags state = get_state_flags(); - Gdk::RGBA c = style->get_background_color(state); - cr->set_source_rgb (c.get_red(), c.get_green(), c.get_blue()); - cr->rectangle (0, 0, get_width (), get_height()); - cr->fill (); - - Glib::RefPtr fn = create_pango_layout (label); - fn->set_markup (label); - cr->move_to(1., 1.); - fn->add_to_cairo_context(cr); - c = style->get_color (state); - cr->set_source_rgb (c.get_red(), c.get_green(), c.get_blue()); - cr->fill(); - - return true; -} - -void ILabel::on_style_updated () -{ - - Glib::RefPtr fn = create_pango_layout(label); - fn->set_markup (label); - int labw, labh; - fn->get_pixel_size (labw, labh); - set_size_request (2 + labw, 2 + labh); -} diff --git a/rtgui/ilabel.h b/rtgui/ilabel.h deleted file mode 100644 index cb9ca00be..000000000 --- a/rtgui/ilabel.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#pragma once - -#include - -class ILabel : - public Gtk::DrawingArea -{ - - Glib::ustring label; - -public: - explicit ILabel (const Glib::ustring &lab); - bool on_draw(const ::Cairo::RefPtr< Cairo::Context> &cr) override; - void on_realize() override; - void on_style_updated () override; -}; diff --git a/rtgui/imagearea.cc b/rtgui/imagearea.cc index b086f8baf..0be6982f9 100644 --- a/rtgui/imagearea.cc +++ b/rtgui/imagearea.cc @@ -25,6 +25,7 @@ #include "../rtengine/refreshmap.h" #include "../rtengine/procparams.h" #include "options.h" +#include "rtscalable.h" ImageArea::ImageArea (ImageAreaPanel* p) : parent(p), fullImageWidth(0), fullImageHeight(0) { diff --git a/rtgui/lwbutton.cc b/rtgui/lwbutton.cc index b5c10c532..c6c75584d 100644 --- a/rtgui/lwbutton.cc +++ b/rtgui/lwbutton.cc @@ -18,6 +18,7 @@ */ #include "lwbutton.h" #include "guiutils.h" +#include "rtsurface.h" LWButton::LWButton (Cairo::RefPtr i, int aCode, void* aData, Alignment ha, Alignment va, Glib::ustring* tooltip) : xpos(0), ypos(0), halign(ha), valign(va), icon(i), bgr(0.0), bgg(0.0), bgb(0.0), fgr(0.0), fgg(0.0), fgb(0.0), state(Normal), listener(nullptr), actionCode(aCode), actionData(aData), toolTip(tooltip) diff --git a/rtgui/lwbutton.h b/rtgui/lwbutton.h index 7a784e693..a98f1fe46 100644 --- a/rtgui/lwbutton.h +++ b/rtgui/lwbutton.h @@ -19,9 +19,7 @@ #pragma once #include - #include "rtsurface.h" - class LWButton; class LWButtonListener diff --git a/rtgui/lwbuttonset.cc b/rtgui/lwbuttonset.cc index a03b3064b..f475cf0b3 100644 --- a/rtgui/lwbuttonset.cc +++ b/rtgui/lwbuttonset.cc @@ -17,6 +17,8 @@ * along with RawTherapee. If not, see . */ #include "lwbuttonset.h" +#include "lwbutton.h" +#include "rtscalable.h" LWButtonSet::LWButtonSet () : aw(0), ah(0), ax(-1), ay(-1) { diff --git a/rtgui/lwbuttonset.h b/rtgui/lwbuttonset.h index 07d17a135..63bc5a01b 100644 --- a/rtgui/lwbuttonset.h +++ b/rtgui/lwbuttonset.h @@ -19,9 +19,10 @@ #pragma once #include -#include "lwbutton.h" #include +class LWButton; +class LWButtonListener; class LWButtonSet { diff --git a/rtgui/main.cc b/rtgui/main.cc index 1bb840e1e..ae34fc8d0 100644 --- a/rtgui/main.cc +++ b/rtgui/main.cc @@ -34,12 +34,16 @@ #include #include #include "cachemanager.h" +#include "editorpanel.h" +#include "filecatalog.h" +#include "filepanel.h" #include "options.h" #include "soundman.h" #include "rtimage.h" #include "version.h" #include "extprog.h" #include "../rtengine/dynamicprofile.h" +#include "../rtengine/procparams.h" #ifndef WIN32 #include diff --git a/rtgui/preferences.cc b/rtgui/preferences.cc index 2676e0940..0bce37af2 100644 --- a/rtgui/preferences.cc +++ b/rtgui/preferences.cc @@ -25,8 +25,10 @@ #include "../rtengine/dfmanager.h" #include "../rtengine/ffmanager.h" #include "../rtengine/iccstore.h" +#include "../rtengine/procparams.h" #include #include "rtimage.h" +#include "rtwindow.h" #ifdef _OPENMP #include #endif diff --git a/rtgui/preferences.h b/rtgui/preferences.h index 62f7c53c1..b4b90e669 100644 --- a/rtgui/preferences.h +++ b/rtgui/preferences.h @@ -25,7 +25,10 @@ #include "adjuster.h" #include "dynamicprofilepanel.h" #include "options.h" -#include "rtwindow.h" +#include "../rtengine/profilestore.h" + +class RTWindow; +class Splash; class Preferences : public Gtk::Dialog, diff --git a/rtgui/previewwindow.cc b/rtgui/previewwindow.cc index 3f787a16b..6268fe3d2 100644 --- a/rtgui/previewwindow.cc +++ b/rtgui/previewwindow.cc @@ -21,6 +21,7 @@ #include "imagearea.h" #include "cursormanager.h" #include "options.h" +#include "rtscalable.h" #include "../rtengine/procparams.h" diff --git a/rtgui/progressconnector.h b/rtgui/progressconnector.h index 32a48473f..eb6eb3a66 100644 --- a/rtgui/progressconnector.h +++ b/rtgui/progressconnector.h @@ -23,7 +23,7 @@ #include #include "guiutils.h" - +#include "multilangmgr.h" #include "../rtengine/rtengine.h" #undef THREAD_PRIORITY_NORMAL diff --git a/rtgui/renamedlg.cc b/rtgui/renamedlg.cc index 81bcd86e5..8908d3419 100644 --- a/rtgui/renamedlg.cc +++ b/rtgui/renamedlg.cc @@ -17,6 +17,7 @@ * along with RawTherapee. If not, see . */ #include "renamedlg.h" +#include "cacheimagedata.h" #include "multilangmgr.h" #include "rtimage.h" diff --git a/rtgui/renamedlg.h b/rtgui/renamedlg.h index 23f69391f..f9447fbac 100644 --- a/rtgui/renamedlg.h +++ b/rtgui/renamedlg.h @@ -20,11 +20,12 @@ #include -#include "cacheimagedata.h" #include "guiutils.h" #define RESPONSE_ALL 100 +class CacheImageData; + class RenameDialog : public Gtk::Dialog { diff --git a/rtgui/rtwindow.cc b/rtgui/rtwindow.cc index ed1ae8d6c..c3d735e8f 100644 --- a/rtgui/rtwindow.cc +++ b/rtgui/rtwindow.cc @@ -23,10 +23,15 @@ #include "preferences.h" #include "iccprofilecreator.h" #include "cursormanager.h" +#include "editwindow.h" #include "rtimage.h" #include "thumbnail.h" #include "whitebalance.h" #include "../rtengine/settings.h" +#include "batchqueuepanel.h" +#include "editorpanel.h" +#include "filepanel.h" +#include "filmsimulation.h" float fontScale = 1.f; Glib::RefPtr cssForced; @@ -1163,3 +1168,8 @@ void RTWindow::createSetmEditor() mainNB->append_page (*epanel, *editorLabelGrid); } + +bool RTWindow::isSingleTabMode() const +{ + return !options.tabbedUI && ! (options.multiDisplayMode > 0); +} diff --git a/rtgui/rtwindow.h b/rtgui/rtwindow.h index 05d0cc231..39e1581e3 100644 --- a/rtgui/rtwindow.h +++ b/rtgui/rtwindow.h @@ -25,15 +25,15 @@ #include #endif -#include "batchqueuepanel.h" -#include "editorpanel.h" -#include "editwindow.h" -#include "filepanel.h" #include "progressconnector.h" #include "splash.h" #include "../rtengine/noncopyable.h" +class BatchQueueEntry; +class BatchQueuePanel; +class EditorPanel; +class FilePanel; class RTWindow : public Gtk::Window, public rtengine::ProgressListener, @@ -55,10 +55,7 @@ private: Gtk::Image *iFullscreen, *iFullscreen_exit; - bool isSingleTabMode() - { - return !options.tabbedUI && ! (options.multiDisplayMode > 0); - }; + bool isSingleTabMode() const; bool on_expose_event_epanel (GdkEventExpose* event); bool on_expose_event_fpanel (GdkEventExpose* event); diff --git a/rtgui/thumbbrowserbase.cc b/rtgui/thumbbrowserbase.cc index b660afc61..9832b5730 100644 --- a/rtgui/thumbbrowserbase.cc +++ b/rtgui/thumbbrowserbase.cc @@ -20,6 +20,7 @@ #include "multilangmgr.h" #include "options.h" +#include "rtscalable.h" #include "thumbbrowserbase.h" #include "../rtengine/rt_math.h"