Fix include-what-you-use warnings
authorArkadiy Illarionov <qarkai@gmail.com>
Sat, 22 Jul 2023 22:26:31 +0000 (01:26 +0300)
committerColin Clark <colin.clark@cclark.uk>
Mon, 19 Feb 2024 15:29:14 +0000 (15:29 +0000)
Use #if to check 0/1 config value

206 files changed:
geeqie.imp [new file with mode: 0644]
meson.build
src/advanced-exif.cc
src/bar-comment.cc
src/bar-comment.h
src/bar-exif.cc
src/bar-exif.h
src/bar-gps.cc
src/bar-gps.h
src/bar-histogram.cc
src/bar-histogram.h
src/bar-keywords.cc
src/bar-keywords.h
src/bar-rating.cc
src/bar-rating.h
src/bar-sort.cc
src/bar-sort.h
src/bar.cc
src/bar.h
src/cache-loader.cc
src/cache-loader.h
src/cache-maint.cc
src/cache-maint.h
src/cache.cc
src/cache.h
src/cellrenderericon.cc
src/cellrenderericon.h
src/collect-dlg.cc
src/collect-io.cc
src/collect-io.h
src/collect-table.cc
src/collect-table.h
src/collect.cc
src/collect.h
src/color-man.cc
src/color-man.h
src/compat.cc
src/compat.h
src/debug.cc
src/desktop-file.cc
src/dnd.cc
src/dnd.h
src/dupe.cc
src/dupe.h
src/editors.cc
src/editors.h
src/exif-common.cc
src/exif.cc
src/exiv2.cc
src/filecache.cc
src/filecache.h
src/filedata.cc
src/filedata.h
src/filefilter.cc
src/filefilter.h
src/format-canon.cc
src/format-fuji.cc
src/format-nikon.cc
src/format-olympus.cc
src/format-raw.cc
src/fullscreen.cc
src/fullscreen.h
src/glua.h
src/histogram.cc
src/histogram.h
src/history-list.cc
src/image-load-collection.cc
src/image-load-cr3.cc
src/image-load-cr3.h
src/image-load-dds.cc
src/image-load-djvu.cc
src/image-load-djvu.h
src/image-load-external.cc
src/image-load-ffmpegthumbnailer.cc
src/image-load-ffmpegthumbnailer.h
src/image-load-gdk.cc
src/image-load-heif.cc
src/image-load-heif.h
src/image-load-j2k.cc
src/image-load-j2k.h
src/image-load-jpeg.cc
src/image-load-jpeg.h
src/image-load-jpegxl.cc
src/image-load-jpegxl.h
src/image-load-libraw.cc
src/image-load-pdf.cc
src/image-load-pdf.h
src/image-load-psd.cc
src/image-load-svgz.cc
src/image-load-tiff.cc
src/image-load-tiff.h
src/image-load-webp.cc
src/image-load-webp.h
src/image-load-zxscr.cc
src/image-load.cc
src/image-load.h
src/image-overlay.cc
src/image.cc
src/image.h
src/img-view.cc
src/jpeg-parser.cc
src/keymap-template.cc
src/layout-config.cc
src/layout-config.h
src/layout-image.cc
src/layout-image.h
src/layout-util.cc
src/layout-util.h
src/layout.cc
src/layout.h
src/logwindow.cc
src/lua.cc
src/main.cc
src/main.h
src/md5-util.cc
src/menu.cc
src/menu.h
src/meson.build
src/metadata.cc
src/metadata.h
src/misc.cc
src/misc.h
src/options.cc
src/options.h
src/osd.cc
src/osd.h
src/pan-view/pan-calendar.cc
src/pan-view/pan-calendar.h
src/pan-view/pan-folder.cc
src/pan-view/pan-folder.h
src/pan-view/pan-grid.cc
src/pan-view/pan-grid.h
src/pan-view/pan-item.cc
src/pan-view/pan-item.h
src/pan-view/pan-timeline.cc
src/pan-view/pan-timeline.h
src/pan-view/pan-util.cc
src/pan-view/pan-util.h
src/pan-view/pan-view-filter.cc
src/pan-view/pan-view-filter.h
src/pan-view/pan-view-search.cc
src/pan-view/pan-view-search.h
src/pan-view/pan-view.cc
src/pan-view/pan-view.h
src/pixbuf-renderer.cc
src/pixbuf-renderer.h
src/pixbuf-util.cc
src/pixbuf-util.h
src/preferences.cc
src/preferences.h
src/print.cc
src/print.h
src/rcfile.cc
src/rcfile.h
src/remote.cc
src/renderer-tiles.cc
src/renderer-tiles.h
src/search-and-run.cc
src/search.cc
src/secure-save.cc
src/shortcuts.cc
src/similar.cc
src/similar.h
src/slideshow.cc
src/thumb-standard.cc
src/thumb-standard.h
src/thumb.cc
src/thumb.h
src/toolbar.cc
src/trash.cc
src/ui-bookmark.cc
src/ui-bookmark.h
src/ui-fileops.cc
src/ui-fileops.h
src/ui-help.cc
src/ui-help.h
src/ui-menu.cc
src/ui-menu.h
src/ui-misc.cc
src/ui-misc.h
src/ui-pathsel.cc
src/ui-pathsel.h
src/ui-tabcomp.cc
src/ui-tabcomp.h
src/ui-tree-edit.cc
src/ui-tree-edit.h
src/ui-utildlg.cc
src/ui-utildlg.h
src/uri-utils.cc
src/uri-utils.h
src/utilops.cc
src/utilops.h
src/view-dir-list.cc
src/view-dir-list.h
src/view-dir-tree.cc
src/view-dir-tree.h
src/view-dir.cc
src/view-dir.h
src/view-file.h
src/view-file/view-file-icon.cc
src/view-file/view-file-icon.h
src/view-file/view-file-list.cc
src/view-file/view-file-list.h
src/view-file/view-file.cc
src/window.cc
src/window.h

diff --git a/geeqie.imp b/geeqie.imp
new file mode 100644 (file)
index 0000000..08f494b
--- /dev/null
@@ -0,0 +1,32 @@
+[
+    { include: [ "<bits/types/sig_atomic_t.h>",        private, "<csignal>",               public ] },
+
+    { include: [ "\"cairo.h\"",                        private, "<cairo.h>",               public ] },
+
+    { include: [ "@\"champlain/champlain-[a-z-]+.h\"", private, "<champlain/champlain.h>", public ] },
+
+    { include: [ "@<exiv2/[a-z_]+.hpp>",               private, "<exiv2/exiv2.hpp>",       public ] },
+    { include: [ "<exiv2/exv_conf.h>",                 private, "<exiv2/exiv2.hpp>",       public ] },
+    { include: [ "<exiv2/xmp_exiv2.hpp>",              private, "<exiv2/exiv2.hpp>",       public ] },
+
+    { include: [ "\"gdk/gdkkeysyms.h\"",               private, "<gdk/gdk.h>",             public ] },
+
+    { include: [ "@\"gobject/.*\"",                    private, "<glib-object.h>",         public ] },
+
+    { include: [ "<glib/gtypes.h>",                    private, "<glib.h>",                public ] },
+
+    { include: [ "\"gtk/gtkcssprovider.h\"",           private, "<gtk/gtk.h>",             public ] },
+
+    { include: [ "<jmorecfg.h>",                       private, "<jpeglib.h>",             public ] },
+
+    { include: [ "\"libraw_types.h\"",                 private, "<libraw/libraw.h>",       public ] },
+
+    { include: [ "<lauxlib.h>",                        private, "<lua.hpp>",               public ] },
+    { include: [ "<lua.h>",                            private, "<lua.hpp>",               public ] },
+    { include: [ "<lualib.h>",                         private, "<lua.hpp>",               public ] },
+
+    { include: [ "@\"pango/pango-[a-z]+.h\"",          private, "<pango/pango.h>",         public ] },
+    { include: [ "\"pango/pangocairo.h\"",             private, "<pango/pangocairo.h>",    public ] },
+
+    { include: [ "@\"poppler-[a-z]+.h\"",              private, "<poppler.h>",             public ] },
+]
index b942823..b0d2138 100644 (file)
@@ -147,9 +147,9 @@ summary({'gq_appdir': gq_appdir,
 
 # Create the define constants used in the sources. Set via config.h.in
 conf_data = configuration_data()
-conf_data.set_quoted('VERSION', meson.project_version())
 conf_data.set('DEBUG', debug)
 
+conf_data.set('HAVE_GTK4', 0)
 option = get_option('gtk4')
 if option.enabled()
     gtk_dep = dependency('gtk4', required: true)
@@ -160,6 +160,7 @@ endif
 glib_dep = dependency('glib-2.0', version : '>=2.52', required: true)
 
 # Required only when backward-cpp is used
+conf_data.set('HAVE_DEVELOPER', 0)
 libdw_dep = []
 libunwind_dep = []
 option = get_option('devel')
@@ -181,6 +182,7 @@ else
 endif
 
 # Required only for seg. fault stacktrace and backtrace debugging
+conf_data.set('HAVE_EXECINFO_H', 0)
 option = get_option('execinfo')
 libexecinfo_dep = []
 if not option.disabled()
@@ -197,6 +199,7 @@ else
     summary({'execinfo' : ['stacktrace supported:', false]}, section : 'Debugging', bool_yn : true)
 endif
 
+conf_data.set('HAVE_ARCHIVE', 0)
 libarchive_dep = []
 req_version = '>=3.4.0'
 option = get_option('archive')
@@ -212,6 +215,8 @@ else
     summary({'archive' : ['disabled - archive files e.g. .zip supported:', false]}, section : 'Configuration', bool_yn : true)
 endif
 
+conf_data.set('HAVE_LCMS', 0)
+conf_data.set('HAVE_LCMS2', 0)
 lcms_dep = []
 req_version = '>=2.0'
 option = get_option('cms')
@@ -233,6 +238,7 @@ else
     summary({'cms' : ['disabled - color management supported:', false]}, section : 'Configuration', bool_yn : true)
 endif
 
+conf_data.set('HAVE_DJVU', 0)
 ddjvuapi_dep = []
 req_version = '>=2.5.27'
 option = get_option('djvu')
@@ -261,6 +267,7 @@ else
 endif
 
 # Required only for seg. fault stacktrace and backtrace debugging
+conf_data.set('HAVE_EXECINFO_H', 0)
 option = get_option('execinfo')
 if not option.disabled()
     result = cc.check_header('execinfo.h')
@@ -274,6 +281,7 @@ else
     summary({'execinfo' : ['stacktrace supported:', false]}, section : 'Configuration', bool_yn : true)
 endif
 
+conf_data.set('HAVE_EXIV2', 0)
 exiv2_dep = []
 req_version = '>=0.18'
 option = get_option('exiv2')
@@ -289,6 +297,9 @@ else
     summary({'exiv2' : ['disabled - image data processed by exiv2:', false]}, section : 'Configuration', bool_yn : true)
 endif
 
+conf_data.set('HAVE_CLUTTER', 0)
+conf_data.set('HAVE_LIBCHAMPLAIN', 0)
+conf_data.set('HAVE_LIBCHAMPLAIN_GTK', 0)
 champlain_dep = []
 champlain_gtk_dep = []
 clutter_dep = []
@@ -329,6 +340,7 @@ else
     summary({'gps-map' : ['disabled - GPS map displayed:', false]}, section : 'Configuration', bool_yn : true)
 endif
 
+conf_data.set('HAVE_HEIF', 0)
 libheif_dep = []
 req_version = '>=1.3.2'
 option = get_option('heif')
@@ -344,6 +356,7 @@ else
     summary({'heif' : ['disabled - heif files supported:', false]}, section : 'Configuration', bool_yn : true)
 endif
 
+conf_data.set('HAVE_J2K', 0)
 libopenjp2_dep = []
 req_version = '>=2.3.0'
 option = get_option('j2k')
@@ -359,10 +372,11 @@ else
     summary({'j2k' : ['disabled - j2k files supported:', false]}, section : 'Configuration', bool_yn : true)
 endif
 
+conf_data.set('HAVE_JPEG', 0)
 libjpeg_dep = []
 option = get_option('jpeg')
 if not option.disabled()
-libjpeg_dep = dependency('libjpeg', required : get_option('jpeg'))
+    libjpeg_dep = dependency('libjpeg', required : get_option('jpeg'))
     if libjpeg_dep.found()
         if cc.has_function('jpeg_destroy_decompress', dependencies : libjpeg_dep)
             conf_data.set('HAVE_JPEG', 1)
@@ -377,6 +391,7 @@ else
     summary({'jpeg' : ['disabled - jpeg files supported:', false]}, section : 'Configuration', bool_yn : true)
 endif
 
+conf_data.set('HAVE_JPEGXL', 0)
 libjxl_dep = []
 req_version = '>=0.3.7'
 option = get_option('jpegxl')
@@ -392,6 +407,7 @@ else
     summary({'jpegxl' : ['disabled - jpegxl files supported:', false]}, section : 'Configuration', bool_yn : true)
 endif
 
+conf_data.set('HAVE_RAW', 0)
 libraw_dep = []
 req_version = '>=0.20'
 option = get_option('libraw')
@@ -407,6 +423,7 @@ else
     summary({'libraw' : ['disabled - .cr3 files supported:', false]}, section : 'Configuration', bool_yn : true)
 endif
 
+conf_data.set('HAVE_LUA', 0)
 lua_dep = []
 req_version = '>=5.3'
 option = get_option('lua')
@@ -444,6 +461,7 @@ else
 endif
 install_data('README.md', 'COPYING', 'TODO', install_dir : helpdir)
 
+conf_data.set('HAVE_PDF', 0)
 poppler_glib_dep = []
 req_version = '>=0.62'
 option = get_option('pdf')
@@ -459,6 +477,7 @@ else
     summary({'pdf' : ['disabled - pdf files supported:', false]}, section : 'Configuration', bool_yn : true)
 endif
 
+conf_data.set('HAVE_SPELL', 0)
 gspell_dep = []
 req_version = '>=1.6'
 option = get_option('spell')
@@ -474,6 +493,7 @@ else
     summary({'spell' : ['disabled - spelling checks enabled', false]}, section : 'Configuration', bool_yn : true)
 endif
 
+conf_data.set('HAVE_TIFF', 0)
 tiff_dep = []
 option = get_option('tiff')
 if not option.disabled()
@@ -492,6 +512,10 @@ else
     summary({'tiff' : ['disabled - tiff files supported:', false]}, section : 'Configuration', bool_yn : true)
 endif
 
+conf_data.set('HAVE_FFMPEGTHUMBNAILER', 0)
+conf_data.set('HAVE_FFMPEGTHUMBNAILER_METADATA', 0)
+conf_data.set('HAVE_FFMPEGTHUMBNAILER_RGB', 0)
+conf_data.set('HAVE_FFMPEGTHUMBNAILER_WH', 0)
 libffmpegthumbnailer_dep = []
 req_version = '>=2.1.0'
 option = get_option('videothumbnailer')
@@ -528,6 +552,7 @@ else
     summary({'videothumbnailer' : ['disabled -thumbnails of video files supported', false]}, section : 'Configuration', bool_yn : true)
 endif
 
+conf_data.set('HAVE_WEBP', 0)
 libwebp_dep = []
 req_version = '>=0.6.1'
 option = get_option('webp')
@@ -544,6 +569,7 @@ else
 endif
 
 # Check for nl_langinfo and _NL_TIME_FIRST_WEEKDAY
+conf_data.set('HAVE__NL_TIME_FIRST_WEEKDAY', 0)
 code = '''#include <langinfo.h>
 #include<stdio.h>
 int main (int argc, char ** argv) {
index 099c5c5..e271c42 100644 (file)
 
 #include "advanced-exif.h"
 
+#include <cstring>
+
+#include <gdk/gdk.h>
+#include <glib-object.h>
+#include <glib.h>
+#include <pango/pango.h>
+
 #include <config.h>
 
 #include "compat.h"
 #include "history-list.h"
 #include "intl.h"
 #include "layout-util.h"
+#include "layout.h"
 #include "misc.h"
+#include "options.h"
 #include "ui-misc.h"
 #include "window.h"
 
+struct ExifData;
+struct ExifItem;
+
 enum {
        ADVANCED_EXIF_DATA_COLUMN_WIDTH = 200
 };
@@ -337,7 +349,7 @@ static gint advanced_exif_sort_cb(GtkTreeModel *model, GtkTreeIter *a, GtkTreeIt
        return ret;
 }
 
-#ifdef HAVE_GTK4
+#if HAVE_GTK4
 static gboolean advanced_exif_mouseclick(GtkWidget *, GdkEventButton *, gpointer data)
 {
 /* @FIXME GTK4 stub */
index 28c9a54..ca724a9 100644 (file)
 
 #include "bar-comment.h"
 
+#include <cstring>
+
 #include <config.h>
 
+#include <gdk/gdk.h>
+#include <glib-object.h>
+#if HAVE_SPELL
+#  include <gspell/gspell.h>
+#endif
+
 #include "bar.h"
 #include "compat.h"
 #include "debug.h"
 #include "layout.h"
 #include "main-defines.h"
 #include "metadata.h"
+#include "options.h"
 #include "rcfile.h"
+#include "typedefs.h"
 #include "ui-menu.h"
 #include "ui-misc.h"
 
-#ifdef HAVE_SPELL
-#include <gspell/gspell.h>
-#endif
-
 static void bar_pane_comment_changed(GtkTextBuffer *buffer, gpointer data);
 
 /*
@@ -57,7 +63,7 @@ struct PaneCommentData
        FileData *fd;
        gchar *key;
        gint height;
-#ifdef HAVE_SPELL
+#if HAVE_SPELL
        GspellTextView *gspell_view;
 #endif
 };
@@ -250,7 +256,7 @@ static void bar_pane_comment_destroy(GtkWidget *, gpointer data)
        auto pcd = static_cast<PaneCommentData *>(data);
 
        file_data_unregister_notify_func(bar_pane_comment_notify_cb, pcd);
-#ifdef HAVE_SPELL
+#if HAVE_SPELL
        g_object_unref(pcd->gspell_view);
 #endif
        file_data_unref(pcd->fd);
@@ -276,7 +282,7 @@ static GtkWidget *bar_pane_comment_new(const gchar *id, const gchar *title, cons
        pcd->pane.title = bar_pane_expander_title(title);
        pcd->pane.id = g_strdup(id);
        pcd->pane.type = PANE_COMMENT;
-#ifdef HAVE_SPELL
+#if HAVE_SPELL
        pcd->gspell_view = nullptr;
 #endif
        pcd->pane.expanded = expanded;
@@ -305,7 +311,7 @@ static GtkWidget *bar_pane_comment_new(const gchar *id, const gchar *title, cons
                         G_CALLBACK(bar_pane_comment_populate_popup), pcd);
        gtk_widget_show(pcd->comment_view);
 
-#ifdef HAVE_SPELL
+#if HAVE_SPELL
        if (g_strcmp0(key, "Xmp.xmp.Rating") != 0)
                {
                if (options->metadata.check_spelling)
index 9ce1932..64fe840 100644 (file)
@@ -22,6 +22,7 @@
 #ifndef BAR_COMMENT_H
 #define BAR_COMMENT_H
 
+#include <glib.h>
 #include <gtk/gtk.h>
 
 GtkWidget *bar_pane_comment_new_from_config(const gchar **attribute_names, const gchar **attribute_values);
index dca90da..795d6bf 100644 (file)
 
 #include "bar-exif.h"
 
+#include <cstring>
+
+#include <gdk/gdk.h>
+#include <glib-object.h>
+#include <pango/pango.h>
+
 #include <config.h>
 
 #include "bar.h"
@@ -35,6 +41,7 @@
 #include "metadata.h"
 #include "misc.h"
 #include "rcfile.h"
+#include "typedefs.h"
 #include "ui-menu.h"
 #include "ui-misc.h"
 #include "ui-utildlg.h"
@@ -614,7 +621,7 @@ static void bar_pane_exif_delete_entry_cb(GtkWidget *, gpointer data)
        g_object_unref(entry);
 }
 
-#ifdef HAVE_GTK4
+#if HAVE_GTK4
 static void bar_pane_exif_copy_entry_cb(GtkWidget *, gpointer data)
 {
 /* @FIXME GTK4 stub */
@@ -684,7 +691,7 @@ static gboolean bar_pane_exif_menu_cb(GtkWidget *widget, GdkEventButton *bevent,
        return FALSE;
 }
 
-#ifdef HAVE_GTK4
+#if HAVE_GTK4
 static gboolean bar_pane_exif_copy_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer)
 {
 /* @FIXME GTK4 stub */
index 3bacd8e..6efb987 100644 (file)
@@ -22,6 +22,7 @@
 #ifndef BAR_EXIF_H
 #define BAR_EXIF_H
 
+#include <glib.h>
 #include <gtk/gtk.h>
 
 GtkWidget *bar_pane_exif_new_from_config(const gchar **attribute_names, const gchar **attribute_values);
index b17e006..dc6781a 100644 (file)
 
 #include <config.h>
 
-#ifdef HAVE_LIBCHAMPLAIN
-#ifdef HAVE_LIBCHAMPLAIN_GTK
+#if HAVE_LIBCHAMPLAIN
+#if HAVE_LIBCHAMPLAIN_GTK
 
 #include "bar-gps.h"
 
+#include <cstring>
+
+#include <cairo.h>
+#include <champlain-gtk/champlain-gtk.h>
+#include <champlain/champlain.h>
+#include <clutter-gtk/clutter-gtk.h>
+#include <clutter/clutter.h>
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <gdk/gdk.h>
+#include <glib-object.h>
+#include <pango/pango.h>
+
 #include "bar.h"
 #include "compat.h"
 #include "debug.h"
 #include "intl.h"
 #include "layout.h"
 #include "main-defines.h"
-#include "menu.h"
 #include "metadata.h"
 #include "misc.h"
 #include "rcfile.h"
 #include "thumb.h"
+#include "typedefs.h"
 #include "ui-menu.h"
 #include "ui-utildlg.h"
 #include "uri-utils.h"
 
-#include <champlain-gtk/champlain-gtk.h>
-#include <champlain/champlain.h>
-#include <clutter-gtk/clutter-gtk.h>
-
 #define MARKER_COLOUR 0x00, 0x00, 0xff, 0xff
 #define TEXT_COLOUR 0x00, 0x00, 0x00, 0xff
 #define THUMB_COLOUR 0xff, 0xff, 0xff, 0xff
@@ -866,7 +874,7 @@ static void bar_pane_gps_map_centreing(PaneGPSData *pgd)
        g_string_free(message, TRUE);
 }
 
-#ifdef HAVE_GTK4
+#if HAVE_GTK4
 static gboolean bar_pane_gps_map_keypress_cb(GtkWidget *, GdkEventButton *bevent, gpointer data)
 {
 /* @FIXME GTK4 stub */
@@ -971,7 +979,7 @@ GtkWidget *bar_pane_gps_new(const gchar *id, const gchar *title, const gchar *ma
        gtk_container_add(GTK_CONTAINER(frame), vbox);
 
        status = gtk_box_new(GTK_ORIENTATION_HORIZONTAL,0);
-#ifdef HAVE_GTK4
+#if HAVE_GTK4
        slider = gtk_scale_button_new(1, 17, 1, slider_icons);
 #else
        slider = gtk_scale_button_new(GTK_ICON_SIZE_SMALL_TOOLBAR, 1, 17, 1, slider_icons);
@@ -1152,7 +1160,7 @@ void bar_pane_gps_update_from_config(GtkWidget *pane, const gchar **attribute_na
        bar_update_expander(pane);
 }
 
-#endif
-#endif
+#endif // HAVE_LIBCHAMPLAIN_GTK
+#endif // HAVE_LIBCHAMPLAIN
 
 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
index 65ab94e..033dff2 100644 (file)
@@ -22,6 +22,7 @@
 #ifndef BAR_GPS_H
 #define BAR_GPS_H
 
+#include <glib.h>
 #include <gtk/gtk.h>
 
 GtkWidget *bar_pane_gps_new(const gchar *id, const gchar *title, const gchar *map_id, gint zoom,
index 4193443..703c1e4 100644 (file)
 
 #include "bar-histogram.h"
 
+#include <cairo.h>
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <gdk/gdk.h>
+#include <glib-object.h>
+
 #include <config.h>
 
 #include "bar.h"
 #include "histogram.h"
 #include "intl.h"
 #include "rcfile.h"
+#include "typedefs.h"
 #include "ui-menu.h"
 #include "ui-misc.h"
 
+struct HistMap;
+
 /*
  *-------------------------------------------------------------------
  * keyword / comment utils
@@ -299,7 +307,7 @@ static GtkWidget *bar_pane_histogram_new(const gchar *id, const gchar *title, gi
        gtk_widget_add_events(phd->drawing_area, GDK_BUTTON_PRESS_MASK);
 
 
-#ifdef HAVE_GTK4
+#if HAVE_GTK4
        gesture = gtk_gesture_click_new();
        gtk_widget_add_controller(phd->drawing_area, GTK_EVENT_CONTROLLER(gesture));
 #else
index dd500a4..dd896a3 100644 (file)
@@ -22,6 +22,7 @@
 #ifndef BAR_HISTOGRAM_H
 #define BAR_HISTOGRAM_H
 
+#include <glib.h>
 #include <gtk/gtk.h>
 
 GtkWidget *bar_pane_histogram_new_from_config(const gchar **attribute_names, const gchar **attribute_values);
index 4719110..2262b20 100644 (file)
 
 #include "bar-keywords.h"
 
-#include <config.h>
+#include <cstdio>
+#include <cstring>
+
+#include <gdk/gdk.h>
+#include <glib-object.h>
 
 #include "bar.h"
 #include "compat.h"
 #include "main-defines.h"
 #include "metadata.h"
 #include "misc.h"
+#include "options.h"
 #include "rcfile.h"
 #include "secure-save.h"
+#include "typedefs.h"
 #include "ui-fileops.h"
 #include "ui-menu.h"
 #include "ui-misc.h"
index a445b71..d9fc7c6 100644 (file)
@@ -22,6 +22,7 @@
 #ifndef BAR_KEYWORDS_H
 #define BAR_KEYWORDS_H
 
+#include <glib.h>
 #include <gtk/gtk.h>
 
 struct LayoutWindow;
index 558f121..e42791a 100644 (file)
@@ -21,6 +21,8 @@
 
 #include "bar-rating.h"
 
+#include <glib-object.h>
+
 #include <config.h>
 
 #include "bar.h"
@@ -30,6 +32,7 @@
 #include "intl.h"
 #include "metadata.h"
 #include "rcfile.h"
+#include "typedefs.h"
 #include "ui-misc.h"
 
 /**
@@ -113,7 +116,7 @@ static void bar_pane_rating_selected_cb(GtkCheckButton *checkbutton, gpointer da
        auto prd = static_cast<PaneRatingData *>(data);
        gchar *rating;
 
-#ifdef HAVE_GTK4
+#if HAVE_GTK4
        const gchar *rating_label;
 
        rating_label = gtk_check_button_get_label(checkbutton);
@@ -185,7 +188,7 @@ static GtkWidget *bar_pane_rating_new(const gchar *id, const gchar *title, gbool
        row_1 = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, PREF_PAD_GAP);
        gq_gtk_box_pack_start(GTK_BOX(prd->widget), row_1, FALSE, FALSE, 0);
 
-#ifdef HAVE_GTK4
+#if HAVE_GTK4
        radio_rejected = gtk_check_button_new_with_label(_("Rejected"));
 #else
        radio_rejected = gtk_radio_button_new_with_label(nullptr, _("Rejected"));
@@ -194,7 +197,7 @@ static GtkWidget *bar_pane_rating_new(const gchar *id, const gchar *title, gbool
        g_signal_connect(radio_rejected, "released", G_CALLBACK(bar_pane_rating_selected_cb), prd);
        prd->rating_buttons[0] = GTK_CHECK_BUTTON(radio_rejected);
 
-#ifdef HAVE_GTK4
+#if HAVE_GTK4
        radio_unrated = gtk_check_button_new_with_label(_("Unrated"));
        gtk_check_button_set_group(GTK_CHECK_BUTTON(radio_unrated), GTK_CHECK_BUTTON(radio_rejected));
 #else
@@ -212,7 +215,7 @@ static GtkWidget *bar_pane_rating_new(const gchar *id, const gchar *title, gbool
                {
                i_str = g_strdup_printf("%d", i - 1);
 
-#ifdef HAVE_GTK4
+#if HAVE_GTK4
                radio_rating = gtk_check_button_new_with_label(i_str);
                gtk_check_button_set_group(GTK_CHECK_BUTTON(radio_rating), GTK_CHECK_BUTTON(radio_rejected));
 #else
index 2eda1cd..f58a199 100644 (file)
@@ -22,6 +22,7 @@
 #ifndef BAR_RATING_H
 #define BAR_RATING_H
 
+#include <glib.h>
 #include <gtk/gtk.h>
 
 GtkWidget *bar_pane_rating_new_from_config(const gchar **attribute_names, const gchar **attribute_values);
index 730f382..5079071 100644 (file)
 
 #include "bar-sort.h"
 
-#include <config.h>
+#include <cstring>
+
+#include <gdk/gdk.h>
+#include <glib-object.h>
 
 #include "collect-io.h"
 #include "collect.h"
 #include "layout.h"
 #include "main-defines.h"
 #include "misc.h"
+#include "options.h"
 #include "rcfile.h"
+#include "typedefs.h"
 #include "ui-bookmark.h"
 #include "ui-fileops.h"
 #include "ui-misc.h"
+#include "ui-utildlg.h"
 #include "utilops.h"
 #include "window.h"
 
index 0b75e6e..beb5887 100644 (file)
@@ -22,6 +22,7 @@
 #ifndef BAR_SORT_H
 #define BAR_SORT_H
 
+#include <glib.h>
 #include <gtk/gtk.h>
 
 struct LayoutWindow;
index d21c8e9..a44bc78 100644 (file)
 
 #include "bar.h"
 
+#include <cstring>
+
+#include <glib-object.h>
+#include <pango/pango.h>
+
 #include <config.h>
 
-#include "bar-histogram.h"
 #include "compat.h"
 #include "debug.h"
 #include "filedata.h"
@@ -32,6 +36,7 @@
 #include "main-defines.h"
 #include "metadata.h"
 #include "rcfile.h"
+#include "typedefs.h"
 #include "ui-menu.h"
 #include "ui-misc.h"
 
@@ -172,8 +177,8 @@ static const gchar default_config_copyright[] =
 "    </layout>"
 "</gq>";
 
-#ifdef HAVE_LIBCHAMPLAIN
-#ifdef HAVE_LIBCHAMPLAIN_GTK
+#if HAVE_LIBCHAMPLAIN
+#if HAVE_LIBCHAMPLAIN_GTK
 static const gchar default_config_gps[] =
 "<gq>"
 "    <layout id = '_current_'>"
@@ -202,8 +207,8 @@ static const KnownPanes known_panes[] = {
        {PANE_EXIF,             "file_info",    N_("File info"),        default_config_file_info},
        {PANE_EXIF,             "location",     N_("Location and GPS"), default_config_location},
        {PANE_EXIF,             "copyright",    N_("Copyright"),        default_config_copyright},
-#ifdef HAVE_LIBCHAMPLAIN
-#ifdef HAVE_LIBCHAMPLAIN_GTK
+#if HAVE_LIBCHAMPLAIN
+#if HAVE_LIBCHAMPLAIN_GTK
        {PANE_GPS,              "gps",  N_("GPS Map"),  default_config_gps},
 #endif
 #endif
@@ -313,7 +318,7 @@ static void bar_expander_height_cb(GtkWidget *, gpointer data)
        list = gtk_container_get_children(GTK_CONTAINER(expander));
        data_box = static_cast<GtkWidget *>(list->data);
 
-#ifdef HAVE_GTK4
+#if HAVE_GTK4
        window = gtk_window_new();
 #else
        window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
@@ -735,7 +740,7 @@ static void bar_destroy(GtkWidget *, gpointer data)
        g_free(bd);
 }
 
-#ifdef HAVE_LIBCHAMPLAIN_GTK
+#if HAVE_LIBCHAMPLAIN_GTK
 /**
    @FIXME this is an ugly hack that works around this bug:
    https://bugzilla.gnome.org/show_bug.cgi?id=590692
@@ -810,7 +815,7 @@ GtkWidget *bar_new(LayoutWindow *lw)
                                             _("Add Pane"), G_CALLBACK(bar_menu_add_cb), bd);
        gtk_widget_show(add_box);
 
-#ifdef HAVE_LIBCHAMPLAIN_GTK
+#if HAVE_LIBCHAMPLAIN_GTK
        g_signal_connect(G_OBJECT(gtk_bin_get_child(GTK_BIN(scrolled))), "unrealize", G_CALLBACK(bar_unrealize_clutter_fix_cb), NULL);
 #endif
 
index 5cd8466..bfa6350 100644 (file)
--- a/src/bar.h
+++ b/src/bar.h
@@ -22,6 +22,8 @@
 #ifndef BAR_H
 #define BAR_H
 
+#include <gdk/gdk.h>
+#include <glib.h>
 #include <gtk/gtk.h>
 
 struct FileData;
index 30f58d8..d6800dc 100644 (file)
 
 #include "cache-loader.h"
 
-#include <config.h>
+#include <sys/types.h>
 
+#include <cstdio>
+#include <cstring>
+#include <ctime>
+
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <glib-object.h>
+
+#include "cache.h"
 #include "filedata.h"
+#include "image-load.h"
 #include "metadata.h"
 #include "options.h"
+#include "similar.h"
+#include "typedefs.h"
 #include "ui-fileops.h"
 
 
index 949d3a1..1db8b74 100644 (file)
 #ifndef CACHE_LOADER_H
 #define CACHE_LOADER_H
 
+#include <glib.h>
 
-#include "cache.h"
-#include "image-load.h"
-
+struct CacheData;
 struct FileData;
+struct ImageLoader;
 
 enum CacheDataType {
        CACHE_LOADER_NONE       = 0,
index 642bae5..227fae1 100644 (file)
 
 #include "cache-maint.h"
 
-#include <config.h>
+#include <dirent.h>
+#include <sys/types.h>
+
+#include <cstdlib>
+#include <cstring>
+
+#include <glib-object.h>
 
 #include "cache-loader.h"
+#include "cache.h"
 #include "compat.h"
 #include "debug.h"
 #include "filedata.h"
@@ -32,6 +39,7 @@
 #include "main-defines.h"
 #include "main.h"
 #include "misc.h"
+#include "options.h"
 #include "pixbuf-util.h"
 #include "thumb-standard.h"
 #include "thumb.h"
index 760864d..84f0586 100644 (file)
@@ -22,6 +22,7 @@
 #ifndef CACHE_MAINT_H
 #define CACHE_MAINT_H
 
+#include <glib.h>
 #include <gtk/gtk.h>
 
 #include "typedefs.h"
index 9796461..22b8949 100644 (file)
 
 #include "cache.h"
 
+#include <sys/stat.h>
+#include <unistd.h>
+#include <utime.h>
+
+#include <cerrno>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+
 #include <config.h>
 
 #include "debug.h"
 #include "md5-util.h"
 #include "options.h"
 #include "secure-save.h"
+#include "similar.h"
 #include "thumb-standard.h"
 #include "ui-fileops.h"
 
-#include <utime.h>
-
 
 /**
  * @file
index 27de211..94f7148 100644 (file)
 #ifndef CACHE_H
 #define CACHE_H
 
+#include <sys/types.h>
 
-#include "similar.h"
+#include <glib.h>
 
+struct ImageSimilarityData;
 
 #define GQ_CACHE_THUMB         "thumbnails"
 #define GQ_CACHE_METADATA      "metadata"
index 399b033..6064e11 100644 (file)
 
 #include "cellrenderericon.h"
 
-#include <config.h>
+#include <cstddef>
+
+#include <cairo.h>
+#include <gdk/gdk.h>
 
 enum {
        FIXED_ICON_SIZE_MAX = 512
index cb94952..4ed8378 100644 (file)
 #ifndef __GQV_CELL_RENDERER_ICON_H__
 #define __GQV_CELL_RENDERER_ICON_H__
 
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <glib-object.h>
+#include <glib.h>
 #include <gtk/gtk.h>
+#include <pango/pango.h>
+
+struct GQvCellRendererIcon;
 
 #define TOGGLE_WIDTH 13
 #define TOGGLE_SPACING 16
index ba492e3..d1ed42d 100644 (file)
@@ -21,9 +21,9 @@
 
 #include "collect-dlg.h"
 
-#include <memory>
-
-#include <config.h>
+#include <glib-object.h>
+#include <glib.h>
+#include <gtk/gtk.h>
 
 #include "collect-io.h"
 #include "collect.h"
@@ -32,6 +32,7 @@
 #include "main-defines.h"
 #include "misc.h"
 #include "ui-fileops.h"
+#include "ui-utildlg.h"
 #include "utilops.h"
 
 enum {
index 4532642..31d4496 100644 (file)
 
 #include "collect-io.h"
 
+#include <cstdio>
+#include <cstring>
+
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <gdk/gdk.h>
+#include <glib-object.h>
+
 #include <config.h>
 
 #include "collect.h"
@@ -29,6 +36,7 @@
 #include "intl.h"
 #include "layout-util.h"
 #include "main-defines.h"
+#include "options.h"
 #include "secure-save.h"
 #include "thumb.h"
 #include "ui-fileops.h"
index 80dd94f..6021fbf 100644 (file)
@@ -22,6 +22,8 @@
 #ifndef COLLECT_IO_H
 #define COLLECT_IO_H
 
+#include <glib.h>
+
 #include "typedefs.h"
 
 struct CollectionData;
index dda4dc7..8176629 100644 (file)
 
 #include "collect-table.h"
 
-#include <config.h>
+#include <cstddef>
+
+#include <cairo.h>
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <gio/gio.h>
+#include <glib-object.h>
 
 #include "cellrenderericon.h"
 #include "collect-dlg.h"
 #include "collect-io.h"
+#include "collect.h"
 #include "compat.h"
 #include "debug.h"
 #include "dnd.h"
@@ -39,8 +45,9 @@
 #include "menu.h"
 #include "metadata.h"
 #include "misc.h"
-#include "pixbuf-util.h"
+#include "options.h"
 #include "print.h"
+#include "typedefs.h"
 #include "ui-fileops.h"
 #include "ui-menu.h"
 #include "ui-tree-edit.h"
index 14c77f5..627768b 100644 (file)
 #ifndef COLLECT_TABLE_H
 #define COLLECT_TABLE_H
 
-#include "collect.h"
+#include <gdk/gdk.h>
+#include <glib.h>
+#include <gtk/gtk.h>
+
+struct CollectInfo;
+struct CollectionData;
 
 struct CollectTable
 {
index ba00f88..2f7ca47 100644 (file)
 
 #include "collect.h"
 
-#include <config.h>
+#include <sys/stat.h>
+
+#include <cstdlib>
+#include <cstring>
+#include <ctime>
+
+#include <glib-object.h>
 
 #include "collect-dlg.h"
 #include "collect-io.h"
 #include "intl.h"
 #include "layout-image.h"
 #include "layout-util.h"
+#include "layout.h"
 #include "main-defines.h"
 #include "misc.h"
+#include "options.h"
 #include "pixbuf-util.h"
 #include "print.h"
 #include "ui-fileops.h"
 #include "ui-tree-edit.h"
+#include "ui-utildlg.h"
 #include "utilops.h"
 #include "window.h"
 
index 44c7bb4..b55bed0 100644 (file)
@@ -22,6 +22,9 @@
 #ifndef COLLECT_H
 #define COLLECT_H
 
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <gdk/gdk.h>
+#include <glib.h>
 #include <gtk/gtk.h>
 
 #include "typedefs.h"
index dd94977..f73080c 100644 (file)
 
 #include <config.h>
 
-#ifdef HAVE_LCMS
+#if HAVE_LCMS
 /*** color support enabled ***/
 
+#include <cstdint>
+#include <cstring>
 #include <vector>
 
-#ifdef HAVE_LCMS2
-#include <lcms2.h>
+#include <glib-object.h>
+
+#if HAVE_LCMS2
+#  include <lcms2.h>
 #else
-#include <lcms.h>
+#  include <lcms.h>
 #endif
 
 #include "debug.h"
@@ -68,7 +72,7 @@ static void color_man_lib_init()
        if (init_done) return;
        init_done = TRUE;
 
-#ifndef HAVE_LCMS2
+#if !HAVE_LCMS2
        cmsErrorAction(LCMS_ERROR_IGNORE);
 #endif
 }
@@ -76,7 +80,7 @@ static void color_man_lib_init()
 static cmsHPROFILE color_man_create_adobe_comp()
 {
        /* ClayRGB1998 is AdobeRGB compatible */
-#include "ClayRGB1998_icc.h"
+#include "ClayRGB1998_icc.h" // IWYU pragma: keep
        return cmsOpenProfileFromMem(ClayRGB1998_icc, ClayRGB1998_icc_len);
 }
 
@@ -458,7 +462,7 @@ static gchar *color_man_get_profile_name(ColorManProfileType type, cmsHPROFILE p
                case COLOR_PROFILE_FILE:
                        if (profile)
                                {
-#ifdef HAVE_LCMS2
+#if HAVE_LCMS2
                                char buffer[20];
                                buffer[0] = '\0';
                                cmsGetProfileInfoASCII(profile, cmsInfoDescription, "en", "US", buffer, 20);
@@ -505,7 +509,7 @@ void color_man_update()
        color_man_cache_reset();
 }
 
-#ifdef HAVE_HEIF
+#if HAVE_HEIF
 #include <cmath>
 #include <libheif/heif.h>
 
index d023a07..55ff086 100644 (file)
@@ -23,6 +23,7 @@
 #define COLOR_MAN_H
 
 #include <gdk-pixbuf/gdk-pixbuf.h>
+#include <glib.h>
 
 struct FileData;
 struct ImageWindow;
index 4fa51b1..4d3789e 100644 (file)
@@ -22,7 +22,7 @@
 
 #include <config.h>
 
-#ifdef HAVE_GTK4
+#if HAVE_GTK4
 void gq_gtk_container_add(GtkWidget *container, GtkWidget *widget)
 {
        if (GTK_IS_BUTTON(container))
index f413e73..1147133 100644 (file)
@@ -32,7 +32,7 @@
 #define        MAP_ANON        MAP_ANONYMOUS
 #endif
 
-#ifdef HAVE_GTK4
+#if HAVE_GTK4
        #define gq_gtk_box_pack_end(box, child, expand, fill, padding) gtk_box_append(box, child)
        #define gq_gtk_box_pack_start(box, child, expand, fill, padding) gtk_box_prepend(box, child)
        #define gq_gtk_frame_set_shadow_type(frame, type) ;
index 3e4fe55..1e7c110 100644 (file)
 
 #include "debug.h"
 
+#include <regex.h>
+#include <sys/time.h>
+
+#include <cstdarg>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+
 #include <config.h>
 
+#if HAVE_EXECINFO_H
+#  include <execinfo.h>
+#endif
+
 #include "filedata.h"
 #include "intl.h"
 #include "logwindow.h"
 #include "options.h"
 #include "ui-fileops.h"
 
-#ifdef HAVE_EXECINFO_H
-#include <execinfo.h>
-#endif
-
-#include <regex.h>
-
 /*
  * Logging functions
  */
@@ -260,7 +266,7 @@ gchar *get_regexp()
        return g_strdup(regexp);
 }
 
-#ifdef HAVE_EXECINFO_H
+#if HAVE_EXECINFO_H
 /**
  * @brief Backtrace of geeqie files
  * @param file
index 911428d..a84efa1 100644 (file)
 
 #include "desktop-file.h"
 
-#include <config.h>
+#include <unistd.h>
+
+#include <cstring>
+
+#include <gdk/gdk.h>
+#include <glib-object.h>
+#include <glib.h>
+#include <gtk/gtk.h>
 
 #include "compat.h"
 #include "debug.h"
 #include "main-defines.h"
 #include "main.h"
 #include "misc.h"
+#include "options.h"
 #include "pixbuf-util.h"
 #include "ui-fileops.h"
 #include "ui-misc.h"
+#include "ui-utildlg.h"
 #include "utilops.h"
 #include "window.h"
 
index f2b318e..600745e 100644 (file)
 
 #include "dnd.h"
 
-#include <config.h>
+#include <glib-object.h>
+#include <pango/pango.h>
 
 #include "compat.h"
-#include "main-defines.h"
 #include "options.h"
 #include "pixbuf-util.h"
 
index 703acb6..1c2a101 100644 (file)
--- a/src/dnd.h
+++ b/src/dnd.h
 #ifndef DND_H
 #define DND_H
 
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <gdk/gdk.h>
+#include <glib.h>
 #include <gtk/gtk.h>
 
+#include "main-defines.h"
+
 #define TARGET_APP_COLLECTION_MEMBER_STRING "application/x-" GQ_APPNAME_LC "-collection-member"
 #define TARGET_APP_EXIF_ENTRY_STRING "application/x-" GQ_APPNAME_LC "-exif-entry"
 #define TARGET_APP_KEYWORD_PATH_STRING "application/x-" GQ_APPNAME_LC "-keyword-path"
index 4eb5b66..e84ca94 100644 (file)
 
 #include "dupe.h"
 
+#include <sys/time.h>
+#include <sys/types.h>
+
 #include <cinttypes>
 #include <cmath>
+#include <cstdlib>
+#include <cstring>
 
-#include <config.h>
+#include <gdk/gdk.h>
+#include <gio/gio.h>
+#include <glib-object.h>
 
 #include "cache.h"
 #include "collect-table.h"
+#include "collect.h"
 #include "compat.h"
 #include "debug.h"
 #include "dnd.h"
 #include "intl.h"
 #include "layout-image.h"
 #include "layout-util.h"
+#include "layout.h"
 #include "main-defines.h"
 #include "md5-util.h"
 #include "menu.h"
 #include "misc.h"
-#include "pixbuf-util.h"
+#include "options.h"
 #include "print.h"
+#include "similar.h"
 #include "thumb.h"
+#include "typedefs.h"
 #include "ui-fileops.h"
 #include "ui-menu.h"
 #include "ui-misc.h"
 #include "ui-tree-edit.h"
+#include "ui-utildlg.h"
 #include "uri-utils.h"
 #include "utilops.h"
 #include "window.h"
index 5f3b26e..791e66c 100644 (file)
 #ifndef DUPE_H
 #define DUPE_H
 
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <glib.h>
 #include <gtk/gtk.h>
 
-#include "similar.h"
-
 struct CollectInfo;
 struct CollectionData;
 struct FileData;
 struct ImageLoader;
+struct ImageSimilarityData;
 struct ThumbLoader;
 
 /** @enum DupeMatchType
index a074d56..9daeaa3 100644 (file)
 
 #include "editors.h"
 
-#include <config.h>
+#include <dirent.h>
+#include <unistd.h>
+
+#include <cstdlib>
+#include <cstring>
+
+#include <glib-object.h>
 
 #include "compat.h"
 #include "debug.h"
@@ -32,7 +38,9 @@
 #include "main.h"
 #include "options.h"
 #include "pixbuf-util.h"
+#include "typedefs.h"
 #include "ui-fileops.h"
+#include "ui-utildlg.h"
 #include "utilops.h"
 
 enum {
index 40df147..2418de3 100644 (file)
@@ -22,6 +22,7 @@
 #ifndef EDITORS_H
 #define EDITORS_H
 
+#include <glib.h>
 #include <gtk/gtk.h>
 
 struct FileData;
index edb7a47..7155d12 100644 (file)
 #define _XOPEN_SOURCE
 #endif
 
+#include <sys/stat.h>
+
 #include <cmath>
 #include <cstdlib>
 #include <cstring>
+#include <ctime>
 
-#ifdef HAVE_LCMS
-/*** color support enabled ***/
+#include <glib.h>
 
-#ifdef HAVE_LCMS2
-#include <lcms2.h>
-#else
-#include <lcms.h>
-#endif
+#if HAVE_LCMS
+/*** color support enabled ***/
+#  if HAVE_LCMS2
+#    include <lcms2.h>
+#  else
+#    include <lcms.h>
+#  endif
 #endif
 
 #include "cache.h"
 #include "debug.h"
 #include "exif.h"
 #include "filecache.h"
+#include "filedata.h"
 #include "glua.h"
 #include "intl.h"
 #include "jpeg-parser.h"
 #include "main-defines.h"
 #include "misc.h"
+#include "typedefs.h"
 #include "ui-fileops.h"
 #include "zonedetect.h"
 
+struct ExifData;
+struct ExifItem;
+struct FileCacheData;
+struct ZoneDetect;
+
 
 static gdouble exif_rational_to_double(ExifRational *r, gint sign)
 {
@@ -473,7 +484,7 @@ static gchar *exif_build_formatted_Resolution(ExifData *exif)
 
 static gchar *exif_build_formatted_ColorProfile(ExifData *exif)
 {
-#ifdef HAVE_LCMS2
+#if HAVE_LCMS2
        cmsUInt8Number profileID[17];
 #endif
        const gchar *name = "";
@@ -507,7 +518,7 @@ static gchar *exif_build_formatted_ColorProfile(ExifData *exif)
        else
                {
                source = _("embedded");
-#ifdef HAVE_LCMS
+#if HAVE_LCMS
 
                        {
                        cmsHPROFILE profile;
@@ -515,7 +526,7 @@ static gchar *exif_build_formatted_ColorProfile(ExifData *exif)
                        profile = cmsOpenProfileFromMem(profile_data, profile_len);
                        if (profile)
                                {
-#ifdef HAVE_LCMS2
+#if HAVE_LCMS2
                                profileID[16] = '\0';
                                cmsGetHeaderProfileID(profile, profileID);
                                name = reinterpret_cast<gchar *>(profileID);
@@ -1035,7 +1046,7 @@ ExifData *exif_read_fd(FileData *fd)
         * not writable directly, thus it should contain the most up-to-date version */
        sidecar_path = nullptr;
 
-#ifdef HAVE_EXIV2
+#if HAVE_EXIV2
        /* we are not able to handle XMP sidecars without exiv2 */
        sidecar_path = cache_find_location(CACHE_TYPE_XMP_METADATA, fd->path);
 
@@ -1232,7 +1243,7 @@ gchar *metadata_file_info(FileData *fd, const gchar *key, MetadataFormat)
        return g_strdup("");
 }
 
-#ifdef HAVE_LUA
+#if HAVE_LUA
 gchar *metadata_lua_info(FileData *fd, const gchar *key, MetadataFormat)
 {
        gchar *script_name;
index e1ace2c..cf47622 100644 (file)
@@ -47,7 +47,7 @@
 
 #include <config.h>
 
-#ifndef HAVE_EXIV2
+#if !HAVE_EXIV2
 
 #include <cmath>
 #include <cstdio>
index 42ce72d..49e95d0 100644 (file)
 
 #include <config.h>
 
-#ifdef HAVE_EXIV2
+#if HAVE_EXIV2
 
-// Don't include the <exiv2/version.hpp> file directly
-// Early Exiv2 versions didn't have version.hpp and the macros.
-#include <exiv2/exiv2.hpp>
-#include <iostream>
-#include <string>
-
-#if EXIV2_TEST_VERSION(0,27,0)
-#define HAVE_EXIV2_ERROR_CODE
-#endif
-
-#include <fcntl.h>
-#include <sys/mman.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <unistd.h>
+#include "exif.h"
 
-#if EXIV2_TEST_VERSION(0,27,0)
-#define EXV_PACKAGE "exiv2"
-#endif
+#include <algorithm>
+#include <cstdint>
+#include <cstring>
+#include <exception>
+#include <list>
+#include <memory>
+#include <string>
+#include <utility>
+#include <vector>
 
+#include <exiv2/exiv2.hpp>
 #include <glib.h>
-
-#include "exif.h"
+#ifdef ENABLE_NLS
+#  include <libintl.h>
+#endif
 
 #include "debug.h"
 #include "filedata.h"
 #include "filefilter.h"
 #include "misc.h"
 #include "options.h"
+#include "typedefs.h"
 #include "ui-fileops.h"
 
+struct ExifItem;
+
+#if EXIV2_TEST_VERSION(0,27,0)
+#define HAVE_EXIV2_ERROR_CODE
+#endif
+
+#if EXIV2_TEST_VERSION(0,27,0)
+#define EXV_PACKAGE "exiv2"
+#endif
+
 #if EXIV2_TEST_VERSION(0,28,0)
 #define AnyError Error
 #define AutoPtr UniquePtr
index eb81538..3b95841 100644 (file)
@@ -20,9 +20,9 @@
 
 #include "filecache.h"
 
-#include <config.h>
-
 #include "debug.h"
+#include "filedata.h"
+#include "typedefs.h"
 
 /* Set to TRUE to add file cache dumps to the debug output */
 const gboolean debug_file_cache = FALSE;
index 7c975c0..fe76c7d 100644 (file)
 #ifndef FILECACHE_H
 #define FILECACHE_H
 
-#include "filedata.h"
+#include <glib.h>
 
 struct FileCacheData;
-using FileCacheReleaseFunc = void (*)(FileData *);
+struct FileData;
 
+using FileCacheReleaseFunc = void (*)(FileData *);
 
 FileCacheData *file_cache_new(FileCacheReleaseFunc release, gulong max_size);
 gboolean file_cache_get(FileCacheData *fc, FileData *fd);
index 14e7d34..d66e80b 100644 (file)
 
 #include "filedata.h"
 
+#include <dirent.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+#include <cerrno>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <ctime>
+
+#include <glib-object.h>
+#include <grp.h>
+#include <pwd.h>
+
 #include <config.h>
 
 #include "cache.h"
 #include "debug.h"
+#include "exif.h"
 #include "filefilter.h"
 #include "histogram.h"
 #include "intl.h"
 #include "main-defines.h"
 #include "main.h"
 #include "metadata.h"
+#include "misc.h"
 #include "options.h"
 #include "secure-save.h"
 #include "thumb-standard.h"
 #include "trash.h"
 #include "ui-fileops.h"
 
-#include "exif.h"
-#include "misc.h"
-
-#include <grp.h>
-#include <pwd.h>
-
 #ifdef DEBUG_FILEDATA
 gint global_file_data_count = 0;
 #endif
@@ -2653,7 +2663,7 @@ gint file_data_verify_ci(FileData *fd, GList *list)
                         * it's location regardless of the user's preference.
                         */
                        gchar *metadata_path = nullptr;
-#ifdef HAVE_EXIV2
+#if HAVE_EXIV2
                        /* but ignore XMP if we are not able to write it */
                        metadata_path = cache_find_location(CACHE_TYPE_XMP_METADATA, fd->path);
 #endif
index 31cb1d1..d3af8ed 100644 (file)
 #ifndef FILEDATA_H
 #define FILEDATA_H
 
+#include <sys/types.h>
+
 #include <gdk-pixbuf/gdk-pixbuf.h>
+#include <glib.h>
 
 #include <config.h>
 
index 8c5448a..650abb7 100644 (file)
 
 #include "filefilter.h"
 
+#include <cstring>
+
+#include <gdk-pixbuf/gdk-pixbuf.h>
+
 #include <config.h>
 
 #include "cache.h"
 #include "debug.h"
 #include "main-defines.h"
+#include "options.h"
 #include "rcfile.h"
 #include "ui-fileops.h"
 
@@ -171,25 +176,25 @@ void filter_add_defaults()
 {
        /* formats supported by custom loaders */
        filter_add_if_missing("dds", "DirectDraw Surface", ".dds", FORMAT_CLASS_IMAGE, FALSE, FALSE, TRUE);
-#ifdef HAVE_PDF
+#if HAVE_PDF
        filter_add_if_missing("pdf", "Portable Document Format", ".pdf", FORMAT_CLASS_DOCUMENT, FALSE, FALSE, TRUE);
 #endif
-#ifdef HAVE_HEIF
+#if HAVE_HEIF
        filter_add_if_missing("heif/avif", "HEIF/AVIF Image", ".heif;.heic;.avif", FORMAT_CLASS_IMAGE, FALSE, TRUE, TRUE);
 #endif
-#ifdef HAVE_WEBP
+#if HAVE_WEBP
        filter_add_if_missing("webp", "WebP Format", ".webp", FORMAT_CLASS_IMAGE, TRUE, FALSE, TRUE);
 #endif
-#ifdef HAVE_DJVU
+#if HAVE_DJVU
        filter_add_if_missing("djvu", "DjVu Format", ".djvu;.djv", FORMAT_CLASS_DOCUMENT, FALSE, FALSE, TRUE);
 #endif
-#ifdef HAVE_JPEGXL
+#if HAVE_JPEGXL
        filter_add_if_missing("jxl", "JXL", ".jxl", FORMAT_CLASS_IMAGE, FALSE, TRUE, TRUE);
 #endif
-#ifdef HAVE_J2K
+#if HAVE_J2K
        filter_add_if_missing("jp2", "JPEG 2000", ".jp2", FORMAT_CLASS_IMAGE, FALSE, FALSE, TRUE);
 #endif
-#ifdef HAVE_ARCHIVE
+#if HAVE_ARCHIVE
        filter_add_if_missing("zip", "Archive files", ".zip;.rar;.tar;.tar.gz;.tar.bz2;.tar.xz;.tgz;.tbz;.txz;.cbr;.cbz;.gz;.bz2;.xz;.lzh;.lza;.7z", FORMAT_CLASS_ARCHIVE, FALSE, FALSE, TRUE);
 #endif
        filter_add_if_missing("scr", "ZX Spectrum screen Format", ".scr", FORMAT_CLASS_IMAGE, FALSE, FALSE, TRUE);
index 73cb104..200a47b 100644 (file)
@@ -22,6 +22,8 @@
 #ifndef FILEFILTER_H
 #define FILEFILTER_H
 
+#include <glib.h>
+
 #include "typedefs.h"
 
 struct FilterEntry {
index 9eb0d55..805e47c 100644 (file)
@@ -21,7 +21,7 @@
 
 #include <config.h>
 
-#ifndef HAVE_EXIV2
+#if !HAVE_EXIV2
 
 #include "format-canon.h"
 
index 3d41f08..d6a2495 100644 (file)
@@ -22,7 +22,7 @@
 
 #include <config.h>
 
-#ifndef HAVE_EXIV2
+#if !HAVE_EXIV2
 
 #include "format-fuji.h"
 
index 26cdb35..fbb81c3 100644 (file)
@@ -21,7 +21,7 @@
 
 #include <config.h>
 
-#ifndef HAVE_EXIV2
+#if !HAVE_EXIV2
 
 #include "format-nikon.h"
 
index f33497f..00a2aac 100644 (file)
@@ -19,7 +19,7 @@
 
 #include <config.h>
 
-#ifndef HAVE_EXIV2
+#if !HAVE_EXIV2
 
 #include "format-olympus.h"
 
index 70c6ba3..8c6a7f2 100644 (file)
@@ -21,7 +21,7 @@
 
 #include <config.h>
 
-#ifndef HAVE_EXIV2
+#if !HAVE_EXIV2
 
 #include "format-raw.h"
 
index 5caed5a..9f35af3 100644 (file)
 #include "fullscreen.h"
 
 #include <algorithm>
+#include <cstddef>
 #include <string>
 #include <vector>
 
-#include <config.h>
+#include <gdk/gdk.h>
+#include <glib-object.h>
 
 #include "compat.h"
 #include "debug.h"
index 53ab0ea..32b0b91 100644 (file)
@@ -22,6 +22,7 @@
 #ifndef FULLSCREEN_H
 #define FULLSCREEN_H
 
+#include <glib.h>
 #include <gtk/gtk.h>
 
 struct ImageWindow;
index 1c5600a..4be0f06 100644 (file)
@@ -23,7 +23,7 @@
 
 #include <config.h>
 
-#ifdef HAVE_LUA
+#if HAVE_LUA
 
 #include <glib.h>
 
index 013deb4..e8aa293 100644 (file)
 
 #include "histogram.h"
 
-#include <config.h>
+#include <cmath>
+
+#include <glib-object.h>
 
 #include "debug.h"
 #include "filedata.h"
 #include "intl.h"
 #include "pixbuf-util.h"
 
-#include <cmath>
-
 /*
  *----------------------------------------------------------------------------
  * image histogram
index 774556d..6616737 100644 (file)
@@ -22,6 +22,7 @@
 #define HISTOGRAM_H
 
 #include <gdk-pixbuf/gdk-pixbuf.h>
+#include <glib.h>
 
 #include "typedefs.h"
 
index f751992..d65a70e 100644 (file)
@@ -20,7 +20,8 @@
 
 #include "history-list.h"
 
-#include <config.h>
+#include <cstdio>
+#include <cstring>
 
 #include "debug.h"
 #include "intl.h"
index 0c69b09..88da33e 100644 (file)
 
 #include "image-load-collection.h"
 
-#include <config.h>
+#include <unistd.h>
+
+#include <cstdio>
+
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <glib-object.h>
+#include <glib.h>
 
 #include "cache.h"
 #include "filedata.h"
index 1f386e0..59e2f1d 100644 (file)
 /** @FIXME This is just a copy of image-load-jpeg.cc, with an adjusted
  * start address for a .cr3 file
  */
+#include <config.h>
+
+#if HAVE_JPEG
 #include "image-load-cr3.h"
 
-#include <config.h>
+#include <csetjmp>
+#include <cstring>
+
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <glib-object.h>
+#include <glib.h>
+#include <jerror.h>
+#include <jpeglib.h>
 
 #include "debug.h"
 #include "image-load.h"
 #include "jpeg-parser.h"
 #include "typedefs.h"
 
-#ifdef HAVE_JPEG
-
-#include <csetjmp>
-#include <jerror.h>
-#include <jpeglib.h>
-
 struct ImageLoaderJpeg {
        ImageLoaderBackendCbAreaUpdated area_updated_cb;
        ImageLoaderBackendCbSize size_cb;
index 0817310..468a994 100644 (file)
@@ -23,7 +23,7 @@
 
 #include <config.h>
 
-#ifdef HAVE_JPEG
+#if HAVE_JPEG
 struct ImageLoaderBackend;
 
 void image_loader_backend_set_cr3(ImageLoaderBackend *funcs);
index 5267397..1ed14a7 100644 (file)
 
 #include "image-load-dds.h"
 
-#include <config.h>
+#include <sys/types.h>
+
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <glib-object.h>
+#include <glib.h>
 
 #include "image-load.h"
 
index 5f67826..b15391e 100644 (file)
 
 #include <config.h>
 
-#ifdef HAVE_DJVU
+#if HAVE_DJVU
 
 #include <cairo.h>
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <glib-object.h>
+#include <glib.h>
 #include <libdjvu/ddjvuapi.h>
-#include <libdjvu/miniexp.h>
 
 #include "image-load.h"
 
index b071e10..0f125d4 100644 (file)
@@ -23,7 +23,7 @@
 
 #include <config.h>
 
-#ifdef HAVE_DJVU
+#if HAVE_DJVU
 struct ImageLoaderBackend;
 
 void image_loader_backend_set_djvu(ImageLoaderBackend *funcs);
index 6a3bda4..6118e6e 100644 (file)
@@ -20,7 +20,9 @@
 
 #include "image-load-external.h"
 
-#include <config.h>
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <glib-object.h>
+#include <glib.h>
 
 #include "filedata.h"
 #include "image-load.h"
index 6250031..446ec80 100644 (file)
 
 #include <config.h>
 
-#ifdef HAVE_FFMPEGTHUMBNAILER
-#include <libffmpegthumbnailer/videothumbnailerc.h>
+#if HAVE_FFMPEGTHUMBNAILER
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <glib-object.h>
+#include <glib.h>
+#include <libffmpegthumbnailer/ffmpegthumbnailertypes.h>
+#include <libffmpegthumbnailer/imagetypes.h>
+#include <libffmpegthumbnailer/videothumbnailerc.h> //TODO Use videothumbnailer.h?
 
 #include "debug.h"
 #include "filedata.h"
@@ -108,13 +113,13 @@ static gboolean image_loader_ft_load (gpointer loader, const guchar *, gsize, GE
 
        image_data *image = video_thumbnailer_create_image_data();
 
-#ifdef HAVE_FFMPEGTHUMBNAILER_WH
+#if HAVE_FFMPEGTHUMBNAILER_WH
        video_thumbnailer_set_size(lft->vt, lft->requested_width, lft->requested_height);
 #else
        lft->vt->thumbnail_size = MAX(lft->requested_width,lft->requested_height);
 #endif
 
-#ifdef HAVE_FFMPEGTHUMBNAILER_METADATA
+#if HAVE_FFMPEGTHUMBNAILER_METADATA
        lft->vt->prefer_embedded_metadata = options->thumbnails.use_ft_metadata ? 1 : 0;
 #endif
 
index b26ece3..43251af 100644 (file)
@@ -24,7 +24,7 @@
 
 #include <config.h>
 
-#ifdef HAVE_FFMPEGTHUMBNAILER
+#if HAVE_FFMPEGTHUMBNAILER
 struct ImageLoaderBackend;
 
 void image_loader_backend_set_ft(ImageLoaderBackend *funcs);
index ff32b87..802cd1c 100644 (file)
@@ -21,7 +21,9 @@
 
 #include "image-load-gdk.h"
 
-#include <config.h>
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <glib-object.h>
+#include <glib.h>
 
 #include "filedata.h"
 #include "image-load.h"
index 6b3f27d..296a5b8 100644 (file)
 
 #include <config.h>
 
-#ifdef HAVE_HEIF
+#if HAVE_HEIF
 #include <vector>
 
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <glib-object.h>
+#include <glib.h>
 #include <libheif/heif.h>
 
 #include "debug.h"
index 4495d6c..e1e56ba 100644 (file)
@@ -23,7 +23,7 @@
 
 #include <config.h>
 
-#ifdef HAVE_HEIF
+#if HAVE_HEIF
 struct ImageLoaderBackend;
 
 void image_loader_backend_set_heif(ImageLoaderBackend *funcs);
index 72e2518..6689201 100644 (file)
 
 #include <config.h>
 
-#ifdef HAVE_J2K
+#if HAVE_J2K
 
 #include "image-load-j2k.h"
 
+#include <cstdlib>
+#include <cstring>
+
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <glib-object.h>
+#include <glib.h>
 #include <openjpeg.h>
 
 #include "debug.h"
index 025a918..454eaa2 100644 (file)
@@ -23,7 +23,7 @@
 
 #include <config.h>
 
-#ifdef HAVE_J2K
+#if HAVE_J2K
 struct ImageLoaderBackend;
 
 void image_loader_backend_set_j2k(ImageLoaderBackend *funcs);
index ea763e4..7adff05 100644 (file)
 
 #include <config.h>
 
-#ifdef HAVE_JPEG
+#if HAVE_JPEG
 
 #include "image-load-jpeg.h"
 
 #include <csetjmp>
 #include <cstdio> // for FILE and size_t in jpeglib.h
 
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <glib-object.h>
+#include <glib.h>
 #include <jerror.h>
 #include <jpeglib.h>
 
index 5921a86..aac4f7b 100644 (file)
@@ -24,7 +24,7 @@
 
 #include <config.h>
 
-#ifdef HAVE_JPEG
+#if HAVE_JPEG
 struct ImageLoaderBackend;
 
 void image_loader_backend_set_jpeg(ImageLoaderBackend *funcs);
index e1a4c10..e64f939 100644 (file)
 
 #include <config.h>
 
-#ifdef HAVE_JPEGXL
+#if HAVE_JPEGXL
 
 #include "image-load-jpegxl.h"
 
+#include <cstdint>
+#include <cstdlib>
 #include <memory>
 
-#include <jxl/decode.h>
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <glib-object.h>
+#include <glib.h>
+#include <jxl/codestream_header.h>
+#include <jxl/decode.h> //TODO Use decode_cxx.h?
+#include <jxl/types.h>
 
 #include "debug.h"
 #include "image-load.h"
index 3a939c3..b406f5f 100644 (file)
@@ -23,7 +23,7 @@
 
 #include <config.h>
 
-#ifdef HAVE_JPEGXL
+#if HAVE_JPEGXL
 struct ImageLoaderBackend;
 
 void image_loader_backend_set_jpegxl(ImageLoaderBackend *funcs);
index d144e61..08f69d1 100644 (file)
 
 #include "image-load.h"
 
-#ifdef HAVE_RAW
+#if HAVE_RAW
 
 #include <fcntl.h>
 #include <sys/mman.h>
 #include <sys/stat.h>
+#include <unistd.h>
 
 #include <libraw/libraw.h>
 
 #include "debug.h"
 #include "filedata.h"
 #include "filefilter.h"
+#include "typedefs.h"
 
 struct UnmapData
 {
index df8e853..0345f0d 100644 (file)
 
 #include <config.h>
 
-#ifdef HAVE_PDF
+#if HAVE_PDF
 #include "image-load-pdf.h"
 
+#include <cairo.h>
+#include <gdk-pixbuf/gdk-pixbuf.h>
 #include <gdk/gdk.h>
-#include <poppler/glib/poppler.h>
+#include <glib-object.h>
+#include <glib.h>
+#include <poppler.h>
 
 #include "debug.h"
 #include "image-load.h"
index 5aa8629..86f11fa 100644 (file)
@@ -23,7 +23,7 @@
 
 #include <config.h>
 
-#ifdef HAVE_PDF
+#if HAVE_PDF
 struct ImageLoaderBackend;
 
 void image_loader_backend_set_pdf(ImageLoaderBackend *funcs);
index 5582c02..62dfdc9 100644 (file)
 
 #include "image-load-psd.h"
 
-#include <config.h>
+#include <cstring>
+
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <glib-object.h>
+#include <glib.h>
 
 #include "debug.h"
 #include "image-load.h"
index ef3ba15..534eddf 100644 (file)
@@ -20,7 +20,9 @@
 
 #include "image-load-svgz.h"
 
-#include <config.h>
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <glib-object.h>
+#include <glib.h>
 
 #include "image-load.h"
 
index 2e5e2d9..287c5a2 100644 (file)
 
 #include <config.h>
 
-#ifdef HAVE_TIFF
+#if HAVE_TIFF
 
 #include "image-load-tiff.h"
 
+#include <cstddef>
+#include <cstdio>
+#include <cstring>
+
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <glib-object.h>
+#include <glib.h>
+#include <tiff.h>
 #include <tiffio.h>
 
 #include "debug.h"
index d91505a..a2d8b08 100644 (file)
@@ -24,7 +24,7 @@
 
 #include <config.h>
 
-#ifdef HAVE_TIFF
+#if HAVE_TIFF
 struct ImageLoaderBackend;
 
 void image_loader_backend_set_tiff(ImageLoaderBackend *funcs);
index d2fabe5..9951142 100644 (file)
 
 #include <config.h>
 
-#ifdef HAVE_WEBP
+#if HAVE_WEBP
 #include "image-load-webp.h"
 
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <glib-object.h>
+#include <glib.h>
 #include <webp/decode.h>
 
 #include "debug.h"
index 038e7e6..19b5e0f 100644 (file)
@@ -23,7 +23,7 @@
 
 #include <config.h>
 
-#ifdef HAVE_WEBP
+#if HAVE_WEBP
 struct ImageLoaderBackend;
 
 void image_loader_backend_set_webp(ImageLoaderBackend *funcs);
index e1c5026..c3651e6 100644 (file)
@@ -20,7 +20,9 @@
 
 #include "image-load-zxscr.h"
 
-#include <config.h>
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <glib-object.h>
+#include <glib.h>
 
 #include "debug.h"
 #include "image-load.h"
index 1182a64..e06adfe 100644 (file)
 
 #include "image-load.h"
 
+#include <fcntl.h>
+#include <sys/mman.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+#include <cstring>
+
 #include <config.h>
 
 #include "debug.h"
 #include "gq-marshal.h"
 #include "image-load-collection.h"
 #include "image-load-dds.h"
+#if HAVE_DJVU
+#  include "image-load-djvu.h"
+#endif
 #include "image-load-external.h"
+#if HAVE_FFMPEGTHUMBNAILER
+#  include "image-load-ffmpegthumbnailer.h"
+#endif
 #include "image-load-gdk.h"
+#if HAVE_HEIF
+#  include "image-load-heif.h"
+#endif
+#if HAVE_J2K
+#  include "image-load-j2k.h"
+#endif
+#if HAVE_JPEG
+#  if !HAVE_RAW
+#    include "image-load-cr3.h"
+#  endif
+#  include "image-load-jpeg.h"
+#endif
+#if HAVE_JPEGXL
+#  include "image-load-jpegxl.h"
+#endif
 #include "image-load-libraw.h"
+#if HAVE_PDF
+#  include "image-load-pdf.h"
+#endif
 #include "image-load-psd.h"
 #include "image-load-svgz.h"
+#if HAVE_TIFF
+#  include "image-load-tiff.h"
+#endif
 #include "image-load-webp.h"
 #include "image-load-zxscr.h"
 #include "misc.h"
 #include "options.h"
+#include "typedefs.h"
 #include "ui-fileops.h"
 
-#ifdef HAVE_DJVU
-       #include "image-load-djvu.h"
-#endif
-#ifdef HAVE_FFMPEGTHUMBNAILER
-       #include "image-load-ffmpegthumbnailer.h"
-#endif
-#ifdef HAVE_HEIF
-       #include "image-load-heif.h"
-#endif
-#ifdef HAVE_J2K
-       #include "image-load-j2k.h"
-#endif
-#ifdef HAVE_JPEG
-       #include "image-load-cr3.h"
-       #include "image-load-jpeg.h"
-#endif
-#ifdef HAVE_JPEGXL
-       #include "image-load-jpegxl.h"
-#endif
-#ifdef HAVE_PDF
-       #include "image-load-pdf.h"
-#endif
-#ifdef HAVE_TIFF
-       #include "image-load-tiff.h"
-#endif
-
-#include <fcntl.h>
-#include <sys/mman.h>
+struct ExifData;
 
 enum {
        IMAGE_LOADER_READ_BUFFER_SIZE_DEFAULT =         4096,
@@ -571,7 +579,7 @@ static void image_loader_size_cb(gpointer loader,
                }
        g_mutex_unlock(il->data_mutex);
 
-#ifdef HAVE_FFMPEGTHUMBNAILER
+#if HAVE_FFMPEGTHUMBNAILER
        if (il->fd->format_class == FORMAT_CLASS_VIDEO)
                scale = TRUE;
 #endif
@@ -668,7 +676,7 @@ static void image_loader_setup_loader(ImageLoader *il)
                }
        else
                {
-#ifdef HAVE_FFMPEGTHUMBNAILER
+#if HAVE_FFMPEGTHUMBNAILER
                if (il->fd->format_class == FORMAT_CLASS_VIDEO)
                        {
                        DEBUG_1("Using custom ffmpegthumbnailer loader");
@@ -676,7 +684,7 @@ static void image_loader_setup_loader(ImageLoader *il)
                        }
                else
 #endif
-#ifdef HAVE_PDF
+#if HAVE_PDF
                if (il->bytes_total >= 4 &&
                    (memcmp(il->mapped_file + 0, "%PDF", 4) == 0))
                        {
@@ -685,7 +693,7 @@ static void image_loader_setup_loader(ImageLoader *il)
                        }
                else
 #endif
-#ifdef HAVE_HEIF
+#if HAVE_HEIF
                if (il->bytes_total >= 12 &&
                        ((memcmp(il->mapped_file + 4, "ftypheic", 8) == 0) ||
                        (memcmp(il->mapped_file + 4, "ftypheix", 8) == 0) ||
@@ -698,7 +706,7 @@ static void image_loader_setup_loader(ImageLoader *il)
                        }
                else
        #endif
-       #ifdef HAVE_WEBP
+       #if HAVE_WEBP
                if (il->bytes_total >= 12 &&
                        (memcmp(il->mapped_file, "RIFF", 4) == 0) &&
                        (memcmp(il->mapped_file + 8, "WEBP", 4) == 0))
@@ -708,7 +716,7 @@ static void image_loader_setup_loader(ImageLoader *il)
                        }
                else
 #endif
-#ifdef HAVE_DJVU
+#if HAVE_DJVU
                if (il->bytes_total >= 16 &&
                        (memcmp(il->mapped_file, "AT&TFORM", 8) == 0) &&
                        (memcmp(il->mapped_file + 12, "DJV", 3) == 0))
@@ -718,13 +726,13 @@ static void image_loader_setup_loader(ImageLoader *il)
                        }
                else
 #endif
-#ifdef HAVE_JPEG
+#if HAVE_JPEG
                if (il->bytes_total >= 2 && il->mapped_file[0] == 0xff && il->mapped_file[1] == 0xd8)
                        {
                        DEBUG_1("Using custom jpeg loader");
                        image_loader_backend_set_jpeg(&il->backend);
                        }
-#ifndef HAVE_RAW
+#if !HAVE_RAW
                else
                if (il->bytes_total >= 11 &&
                        (memcmp(il->mapped_file + 4, "ftypcrx", 7) == 0) &&
@@ -736,7 +744,7 @@ static void image_loader_setup_loader(ImageLoader *il)
 #endif
                else
 #endif
-#ifdef HAVE_TIFF
+#if HAVE_TIFF
                if (il->bytes_total >= 10 &&
                    (memcmp(il->mapped_file, "MM\0*", 4) == 0 ||
                     memcmp(il->mapped_file, "MM\0+\0\x08\0\0", 8) == 0 ||
@@ -761,7 +769,7 @@ static void image_loader_setup_loader(ImageLoader *il)
                        image_loader_backend_set_psd(&il->backend);
                        }
                else
-#ifdef HAVE_J2K
+#if HAVE_J2K
                if (il->bytes_total >= 12 &&
                        (memcmp(il->mapped_file, "\0\0\0\x0CjP\x20\x20\x0D\x0A\x87\x0A", 12) == 0))
                        {
@@ -770,7 +778,7 @@ static void image_loader_setup_loader(ImageLoader *il)
                        }
                else
 #endif
-#ifdef HAVE_JPEGXL
+#if HAVE_JPEGXL
                if (il->bytes_total >= 12 &&
                        (memcmp(il->mapped_file, "\0\0\0\x0C\x4A\x58\x4C\x20\x0D\x0A\x87\x0A", 12) == 0))
                        {
@@ -810,7 +818,7 @@ static void image_loader_setup_loader(ImageLoader *il)
 
        il->loader = static_cast<void **>(il->backend.loader_new(image_loader_area_updated_cb, image_loader_size_cb, image_loader_area_prepared_cb, il));
 
-#ifdef HAVE_TIFF
+#if HAVE_TIFF
        format = il->backend.get_format_name(il->loader);
        if (g_strcmp0(format, "tiff") == 0)
                {
@@ -819,7 +827,7 @@ static void image_loader_setup_loader(ImageLoader *il)
        g_free(format);
 #endif
 
-#ifdef HAVE_PDF
+#if HAVE_PDF
        format = il->backend.get_format_name(il->loader);
        if (g_strcmp0(format, "pdf") == 0)
                {
@@ -828,7 +836,7 @@ static void image_loader_setup_loader(ImageLoader *il)
        g_free(format);
 #endif
 
-#ifdef HAVE_HEIF
+#if HAVE_HEIF
        format = il->backend.get_format_name(il->loader);
        if (g_strcmp0(format, "heif") == 0)
                {
@@ -837,7 +845,7 @@ static void image_loader_setup_loader(ImageLoader *il)
        g_free(format);
 #endif
 
-#ifdef HAVE_DJVU
+#if HAVE_DJVU
        format = il->backend.get_format_name(il->loader);
        if (g_strcmp0(format, "djvu") == 0)
                {
@@ -934,7 +942,7 @@ static gboolean image_loader_begin(ImageLoader *il)
                return FALSE;
                }
 
-#ifdef HAVE_PDF
+#if HAVE_PDF
        format = il->backend.get_format_name(il->loader);
        if (g_strcmp0(format, "pdf") == 0)
                {
@@ -943,7 +951,7 @@ static gboolean image_loader_begin(ImageLoader *il)
                }
        g_free(format);
 #endif
-#ifdef HAVE_HEIF
+#if HAVE_HEIF
        format = il->backend.get_format_name(il->loader);
        if (g_strcmp0(format, "heif") == 0)
                {
@@ -952,7 +960,7 @@ static gboolean image_loader_begin(ImageLoader *il)
                }
        g_free(format);
 #endif
-#ifdef HAVE_DJVU
+#if HAVE_DJVU
        format = il->backend.get_format_name(il->loader);
        if (g_strcmp0(format, "djvu") == 0)
                {
@@ -961,7 +969,7 @@ static gboolean image_loader_begin(ImageLoader *il)
                }
        g_free(format);
 #endif
-#ifdef HAVE_TIFF
+#if HAVE_TIFF
        format = il->backend.get_format_name(il->loader);
        if (g_strcmp0(format, "tiff") == 0)
                {
index d24902d..b59c4e1 100644 (file)
@@ -23,6 +23,8 @@
 #define IMAGE_LOAD_H
 
 #include <gdk-pixbuf/gdk-pixbuf.h>
+#include <glib-object.h>
+#include <glib.h>
 
 struct FileData;
 
index 7dfd5a7..2dec638 100644 (file)
 
 #include "image-overlay.h"
 
-#include <config.h>
+#include <cstring>
+
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <glib-object.h>
+#include <gtk/gtk.h>
+#include <pango/pango.h>
 
 #include "collect.h"
 #include "debug.h"
 #include "intl.h"
 #include "layout.h"
 #include "main-defines.h"
+#include "options.h"
 #include "osd.h"
 #include "pixbuf-renderer.h"
 #include "pixbuf-util.h"
 #include "slideshow.h"
+#include "typedefs.h"
 #include "ui-fileops.h"
 
+struct HistMap;
+
 /*
  *----------------------------------------------------------------------------
  * image overlay
index 5cd517b..b2a45da 100644 (file)
 
 #include "image.h"
 
-#include <config.h>
+#include <cmath>
+#include <cstring>
+
+#include <cairo.h>
+#include <glib-object.h>
 
 #include "collect-table.h"
+#include "collect.h"
 #include "color-man.h"
 #include "compat.h"
 #include "debug.h"
 #include "exif.h"
 #include "filecache.h"
+#include "filedata.h"
 #include "history-list.h"
 #include "image-load.h"
 #include "intl.h"
 #include "layout-image.h"
 #include "layout.h"
 #include "metadata.h"
+#include "options.h"
 #include "pixbuf-renderer.h"
 #include "pixbuf-util.h"
 #include "ui-fileops.h"
 #include "ui-misc.h"
 
-#include <cmath>
+struct ExifData;
+struct FileCacheData;
 
 static GList *image_list = nullptr;
 
index 6f92c60..eed97a5 100644 (file)
@@ -22,6 +22,9 @@
 #ifndef IMAGE_H
 #define IMAGE_H
 
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <gdk/gdk.h>
+#include <glib.h>
 #include <gtk/gtk.h>
 
 #include "typedefs.h"
index 9a00b94..dc3fb9b 100644 (file)
@@ -21,7 +21,9 @@
 
 #include "img-view.h"
 
-#include <config.h>
+#include <gdk/gdk.h>
+#include <glib-object.h>
+#include <gtk/gtk.h>
 
 #include "collect-io.h"
 #include "collect.h"
 #include "image.h"
 #include "intl.h"
 #include "layout-util.h"
+#include "layout.h"
 #include "main-defines.h"
 #include "main.h"
 #include "menu.h"
 #include "misc.h"
+#include "options.h"
 #include "pixbuf-util.h"
 #include "print.h"
 #include "slideshow.h"
+#include "typedefs.h"
 #include "ui-fileops.h"
 #include "ui-menu.h"
+#include "ui-utildlg.h"
 #include "uri-utils.h"
 #include "utilops.h"
 #include "window.h"
index b979e65..ebde0f0 100644 (file)
@@ -21,7 +21,7 @@
 
 #include "jpeg-parser.h"
 
-#include <config.h>
+#include <cstring>
 
 #include "debug.h"
 
index 9196296..ebd248f 100644 (file)
@@ -19,8 +19,6 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-#include <cstddef>
-
 const char *keymap_template [] = {
 "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>",
 "<!-- Created with Inkscape (http://www.inkscape.org/) -->",
index 409a1b2..46da2f3 100644 (file)
 
 #include "layout-config.h"
 
+#include <cstring>
+
+#include <glib-object.h>
+
 #include <config.h>
 
 #include "compat.h"
@@ -253,7 +257,7 @@ static GtkWidget *layout_config_widget(GtkWidget *group, GtkWidget *box, gint st
 
        if (group)
                {
-#ifdef HAVE_GTK4
+#if HAVE_GTK4
                group = gtk_toggle_button_new();
                gtk_toggle_button_set_group(button, group);
 #else
@@ -262,7 +266,7 @@ static GtkWidget *layout_config_widget(GtkWidget *group, GtkWidget *box, gint st
                }
        else
                {
-#ifdef HAVE_GTK4
+#if HAVE_GTK4
                group = gtk_toggle_button_new();
 #else
                group = gtk_radio_button_new(nullptr);
index 752822d..512ce8e 100644 (file)
@@ -22,7 +22,7 @@
 #ifndef LAYOUT_CONFIG_H
 #define LAYOUT_CONFIG_H
 
-
+#include <glib.h>
 #include <gtk/gtk.h>
 
 #include "layout.h"
index 228fff0..0d4042b 100644 (file)
 
 #include "layout-image.h"
 
+#include <cstring>
+
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <gdk/gdk.h>
+#include <gio/gio.h>
+#include <glib-object.h>
+#include <pango/pango.h>
+
 #include <config.h>
 
 #include "collect.h"
 #include "img-view.h"
 #include "intl.h"
 #include "layout-util.h"
+#include "layout.h"
 #include "main-defines.h"
 #include "menu.h"
 #include "metadata.h"
 #include "misc.h"
+#include "options.h"
 #include "pixbuf-renderer.h"
-#include "pixbuf-util.h"
 #include "slideshow.h"
 #include "ui-fileops.h"
 #include "ui-menu.h"
+#include "ui-utildlg.h"
 #include "uri-utils.h"
 #include "utilops.h"
 #include "view-file.h"
@@ -601,7 +611,7 @@ static void li_pop_menu_copy_path_unquoted_cb(GtkWidget *, gpointer data)
        file_util_copy_path_to_clipboard(layout_image_get_fd(lw), FALSE);
 }
 
-#ifdef HAVE_GTK4
+#if HAVE_GTK4
 static void li_pop_menu_copy_image_cb(GtkWidget *, gpointer data)
 {
 /* @FIXME GTK4 stub */
index 817b746..2c3b59c 100644 (file)
@@ -22,6 +22,7 @@
 #ifndef LAYOUT_IMAGE_H
 #define LAYOUT_IMAGE_H
 
+#include <glib.h>
 #include <gtk/gtk.h>
 
 #include "typedefs.h"
index ee9f68f..b9edc6f 100644 (file)
 
 #include "layout-util.h"
 
-#include <sys/wait.h>
+#include <dirent.h>
+#include <unistd.h>
+
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+
+#include <gio/gio.h>
+#include <glib-object.h>
 
 #include <config.h>
 
@@ -30,7 +38,6 @@
 #include "bar-sort.h"
 #include "bar.h"
 #include "cache-maint.h"
-#include "collect-dlg.h"
 #include "collect-io.h"
 #include "collect.h"
 #include "color-man.h"
 #include "intl.h"
 #include "keymap-template.h"
 #include "layout-image.h"
+#include "layout.h"
 #include "logwindow.h"
 #include "main-defines.h"
 #include "main.h"
 #include "metadata.h"
 #include "misc.h"
+#include "options.h"
 #include "pan-view.h"
 #include "pixbuf-util.h"
 #include "preferences.h"
@@ -65,6 +74,7 @@
 #include "ui-fileops.h"
 #include "ui-menu.h"
 #include "ui-misc.h"
+#include "ui-utildlg.h"
 #include "utilops.h"
 #include "view-dir.h"
 #include "view-file.h"
@@ -1924,7 +1934,7 @@ static void layout_menu_keyword_autocomplete_cb(GtkAction *, gpointer data)
  * color profile button (and menu)
  *-----------------------------------------------------------------------------
  */
-#ifdef HAVE_LCMS
+#if HAVE_LCMS
 static void layout_color_menu_enable_cb(GtkToggleAction *action, gpointer data)
 {
        auto lw = static_cast<LayoutWindow *>(data);
@@ -1941,7 +1951,7 @@ static void layout_color_menu_enable_cb()
 }
 #endif
 
-#ifdef HAVE_LCMS
+#if HAVE_LCMS
 static void layout_color_menu_use_image_cb(GtkToggleAction *action, gpointer data)
 {
        auto lw = static_cast<LayoutWindow *>(data);
@@ -1960,7 +1970,7 @@ static void layout_color_menu_use_image_cb()
 }
 #endif
 
-#ifdef HAVE_LCMS
+#if HAVE_LCMS
 static void layout_color_menu_input_cb(GtkRadioAction *action, GtkRadioAction *, gpointer data)
 {
        auto lw = static_cast<LayoutWindow *>(data);
@@ -3699,7 +3709,7 @@ void layout_util_sync_color(LayoutWindow *lw)
        gboolean use_image = FALSE;
        gint i;
        gchar action_name[15];
-#ifdef HAVE_LCMS
+#if HAVE_LCMS
        gchar *image_profile;
        gchar *screen_profile;
 #endif
@@ -3710,7 +3720,7 @@ void layout_util_sync_color(LayoutWindow *lw)
        use_color = layout_image_color_profile_get_use(lw);
 
        action = gtk_action_group_get_action(lw->action_group, "UseColorProfiles");
-#ifdef HAVE_LCMS
+#if HAVE_LCMS
        gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), use_color);
        if (layout_image_color_profile_get_status(lw, &image_profile, &screen_profile))
                {
index faa7b15..2c7ea04 100644 (file)
 #ifndef LAYOUT_UTIL_H
 #define LAYOUT_UTIL_H
 
+#include <gdk/gdk.h>
+#include <glib.h>
+#include <gtk/gtk.h>
 
-#include "layout.h"
+#include "typedefs.h"
+
+struct LayoutWindow;
 
 gboolean layout_key_press_cb(GtkWidget *widget, GdkEventKey *event, gpointer data);
 
index bcf828f..98776db 100644 (file)
 
 #include "layout.h"
 
-#include <config.h>
+#include <unistd.h>
+
+#include <cstring>
+
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <gdk/gdk.h>
+#include <glib-object.h>
+#include <pango/pango.h>
 
 #include "bar-sort.h"
 #include "bar.h"
index 8f3455a..711c147 100644 (file)
 #ifndef LAYOUT_H
 #define LAYOUT_H
 
+#include <glib.h>
 #include <gtk/gtk.h>
 
 #include "options.h"
+#include "typedefs.h"
 
 struct AnimationData;
 struct FileData;
index dbd1ec4..8ce6f86 100644 (file)
 #include "logwindow.h"
 
 #include <algorithm>
+#include <cstring>
 #include <deque>
 #include <string>
 
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <gdk/gdk.h>
+#include <glib-object.h>
+#include <gtk/gtk.h>
+
 #include <config.h>
 
 #include "compat.h"
@@ -32,6 +38,7 @@
 #include "layout.h"
 #include "main-defines.h"
 #include "misc.h"
+#include "options.h"
 #include "ui-misc.h"
 #include "window.h"
 
index 8319147..51b6f39 100644 (file)
 
 #include <config.h>
 
-#ifdef HAVE_LUA
+#if HAVE_LUA
 
 #define _XOPEN_SOURCE
 
 #include "glua.h"
 
-#include <cstdio>
+#include <unistd.h>
+
 #include <cstring>
 #include <ctime>
 #include <memory>
+#include <utility>
 
 #include <glib.h>
 #include <lua.hpp>
 #include "debug.h"
 #include "exif.h"
 #include "filedata.h"
-#include "main-defines.h"
 #include "main.h"
 #include "ui-fileops.h"
 
+struct ExifData;
+
 /**
  * @file
  * User API consists of the following namespaces:
index 89328fc..4431dc8 100644 (file)
 
 #include "main.h"
 
-#include <sys/mman.h>
+#include <unistd.h>
 
 #include <clocale>
 #include <csignal>
+#include <cstdlib>
+#include <cstring>
+#include <ctime>
 
 #include <config.h>
 
-#ifdef HAVE_CLUTTER
-#include <clutter-gtk/clutter-gtk.h>
+#if HAVE_CLUTTER
+#  include <clutter-gtk/clutter-gtk.h>
+#  include <clutter/clutter.h>
 #endif
 
-#ifdef HAVE_EXECINFO_H
+#if HAVE_EXECINFO_H
 #include <execinfo.h>
 #endif
 
-#ifdef G_OS_UNIX
-#include <pwd.h>
+#include <gio/gio.h>
+#include <glib-object.h>
+
+#ifdef ENABLE_NLS
+#  include <libintl.h>
 #endif
 
-#ifdef HAVE_DEVELOPER
+#if HAVE_DEVELOPER
 #include "backward.h"
 #endif
 
 #include "intl.h"
 #include "layout-image.h"
 #include "layout-util.h"
+#include "layout.h"
 #include "main-defines.h"
 #include "metadata.h"
 #include "misc.h"
+#include "options.h"
 #include "pixbuf-util.h"
 #include "rcfile.h"
 #include "remote.h"
@@ -95,7 +104,7 @@ void sig_handler_cb(int signo, siginfo_t *info, void *)
        guint64 addr;
        guint64 char_index;
        ssize_t len;
-#ifdef HAVE_EXECINFO_H
+#if HAVE_EXECINFO_H
        gint bt_size;
        void *bt[1024];
 #endif
@@ -181,7 +190,7 @@ void sig_handler_cb(int signo, siginfo_t *info, void *)
                len = write(STDERR_FILENO, "\n", 1);
                }
 
-#ifdef HAVE_EXECINFO_H
+#if HAVE_EXECINFO_H
        bt_size = backtrace(bt, 1024);
        backtrace_symbols_fd(bt, bt_size, STDERR_FILENO);
 #endif
@@ -194,7 +203,7 @@ void sig_handler_cb(int signo, siginfo_t *info, void *)
 #else /* defined(SA_SIGINFO) */
 void sig_handler_cb(int)
 {
-#ifdef HAVE_EXECINFO_H
+#if HAVE_EXECINFO_H
        gint bt_size;
        void *bt[1024];
 #endif
@@ -202,7 +211,7 @@ void sig_handler_cb(int)
        write(STDERR_FILENO, "Geeqie fatal error\n", 19);
        write(STDERR_FILENO, "Signal: Segmentation fault\n", 27);
 
-#ifdef HAVE_EXECINFO_H
+#if HAVE_EXECINFO_H
        bt_size = backtrace(bt, 1024);
        backtrace_symbols_fd(bt, bt_size, STDERR_FILENO);
 #endif
@@ -707,7 +716,7 @@ static void parse_command_line_for_debug_option(gint argc, gchar *argv[])
 #endif
 }
 
-#ifdef HAVE_CLUTTER
+#if HAVE_CLUTTER
 static gboolean parse_command_line_for_clutter_option(gint argc, gchar *argv[])
 {
        const gchar *clutter_option = "--disable-clutter";
@@ -1199,7 +1208,7 @@ static void setup_sigbus_handler_unused()
 }
 #pragma GCC diagnostic pop
 
-#ifndef HAVE_DEVELOPER
+#if !HAVE_DEVELOPER
 static void setup_sig_handler()
 {
        struct sigaction sigsegv_action;
@@ -1307,7 +1316,7 @@ gint main(gint argc, gchar *argv[])
        gdk_threads_enter();
 
        /* seg. fault handler */
-#ifdef HAVE_DEVELOPER
+#if HAVE_DEVELOPER
        backward::SignalHandling sh{};
 #else
        setup_sig_handler();
@@ -1329,7 +1338,7 @@ gint main(gint argc, gchar *argv[])
 
        exif_init();
 
-#ifdef HAVE_LUA
+#if HAVE_LUA
        lua_init();
 #endif
 
@@ -1353,7 +1362,7 @@ gint main(gint argc, gchar *argv[])
 
        parse_command_line_for_debug_option(argc, argv);
        DEBUG_1("%s main: gtk_init", get_exec_time());
-#ifdef HAVE_CLUTTER
+#if HAVE_CLUTTER
        if (parse_command_line_for_clutter_option(argc, argv))
                {
                disable_clutter = TRUE;
@@ -1435,7 +1444,7 @@ gint main(gint argc, gchar *argv[])
                        filter_rebuild();
                        }
 
-       #ifdef HAVE_CLUTTER
+       #if HAVE_CLUTTER
        /** @FIXME For the background of this see:
         * https://github.com/BestImageViewer/geeqie/issues/397
         * The feature CLUTTER_FEATURE_SWAP_EVENTS indictates if the
index 006414d..78941b7 100644 (file)
@@ -23,6 +23,7 @@
 #define MAIN_H
 
 #include <gdk/gdk.h>
+#include <glib.h>
 #include <gtk/gtk.h>
 
 extern gboolean thumb_format_changed;
index 5d089f7..496d7dc 100644 (file)
@@ -33,7 +33,6 @@
 #include "md5-util.h"
 
 #include <cstdio>
-#include <cstring>
 #include <memory>
 
 using GQChecksumPtr = std::unique_ptr<GChecksum, decltype(&g_checksum_free)>;
index 72724e0..9ac9994 100644 (file)
 
 #include "menu.h"
 
-#include <config.h>
+#include <gdk/gdk.h>
 
 #include "collect-io.h"
 #include "collect-table.h"
+#include "collect.h"
 #include "editors.h"
 #include "intl.h"
 #include "main-defines.h"
 #include "pixbuf-util.h"
-#include "ui-fileops.h"
 #include "ui-menu.h"
 
 static GtkWidget *real_submenu_add_alter(GtkWidget *menu, GCallback func, gpointer data,
index 1622970..ed991ef 100644 (file)
@@ -22,6 +22,8 @@
 #ifndef MENU_H
 #define MENU_H
 
+#include <glib-object.h>
+#include <glib.h>
 #include <gtk/gtk.h>
 
 #include "typedefs.h"
index 94589c4..d1a00f2 100644 (file)
@@ -256,7 +256,7 @@ gq_marshal_pragma = custom_target('gq-marshal-pragma',
 
 project_sources += gq_marshal_pragma
 
-if conf_data.has('HAVE_LCMS')
+if conf_data.get('HAVE_LCMS', 0) == 1
     xxd_sh = find_program('generate-ClayRGB1998-icc-h.sh', dirs : join_paths(meson.project_source_root(), 'scripts'))
 
     ClayRGB1998_icc_h = custom_target('ClayRGB1998',
index 4bb6731..85b6995 100644 (file)
 
 #include "metadata.h"
 
+#include <unistd.h>
+
 #include <clocale>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+
+#include <glib-object.h>
 
 #include <config.h>
 
 #include "layout-util.h"
 #include "main-defines.h"
 #include "misc.h"
+#include "options.h"
 #include "rcfile.h"
 #include "secure-save.h"
 #include "ui-fileops.h"
 #include "utilops.h"
 
+struct ExifData;
+
 enum MetadataKey {
        MK_NONE,
        MK_KEYWORDS,
@@ -610,7 +620,7 @@ static void metadata_legacy_delete(FileData *fd, const gchar *except)
                g_free(metadata_path);
                }
 
-#ifdef HAVE_EXIV2
+#if HAVE_EXIV2
        /* without exiv2: do not delete xmp metadata because we are not able to convert it,
           just ignore it */
        metadata_path = cache_find_location(CACHE_TYPE_XMP_METADATA, fd->path);
@@ -717,7 +727,7 @@ GList *metadata_read_list(FileData *fd, const gchar *key, MetadataFormat format)
                {
                return g_list_append(nullptr, metadata_file_info(fd, key, format));
                }
-#ifdef HAVE_LUA
+#if HAVE_LUA
        else if (strncmp(key, "lua.", 4) == 0)
                {
                return g_list_append(nullptr, metadata_lua_info(fd, key, format));
index 2740edb..c51823b 100644 (file)
@@ -22,6 +22,7 @@
 #ifndef METADATA_H
 #define METADATA_H
 
+#include <glib.h>
 #include <gtk/gtk.h>
 
 #include "typedefs.h"
index 3d80891..9767e01 100644 (file)
 
 #include "misc.h"
 
-#include <clocale>
+#include <sys/stat.h>
+#include <unistd.h>
+
+#include <cerrno>
+#include <cstdint>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
 #include <memory>
 
+#include <langinfo.h>
+#include <pwd.h>
+
 #include <config.h>
 
 #include "debug.h"
@@ -33,9 +43,6 @@
 #include "options.h"
 #include "ui-fileops.h"
 
-#include <langinfo.h>
-#include <pwd.h>
-
 gdouble get_zoom_increment()
 {
        return ((options->image.zoom_increment != 0) ? static_cast<gdouble>(options->image.zoom_increment) / 100.0 : 1.0);
@@ -268,7 +275,7 @@ int runcmd(const gchar *cmd)
  */
 gint date_get_first_day_of_week()
 {
-#ifdef HAVE__NL_TIME_FIRST_WEEKDAY
+#if HAVE__NL_TIME_FIRST_WEEKDAY
        return nl_langinfo(_NL_TIME_FIRST_WEEKDAY)[0];
 #else
        gchar *dot;
@@ -389,7 +396,7 @@ gint get_cpu_cores()
     return sysconf(_SC_NPROCESSORS_ONLN);
 }
 
-#ifdef HAVE_GTK4
+#if HAVE_GTK4
 void convert_gdkcolor_to_gdkrgba(gpointer data, GdkRGBA *gdk_rgba)
 {
 /* @FIXME GTK4 stub */
@@ -434,7 +441,7 @@ void gq_gtk_grid_attach_default(GtkGrid *grid, GtkWidget *child, guint left_atta
 
 /* Copied from the libarchive .repo. examples */
 
-#ifndef HAVE_ARCHIVE
+#if !HAVE_ARCHIVE
 gchar *open_archive(FileData *)
 {
        log_printf("%s", _("Warning: libarchive not installed"));
index 37f9595..4223bb1 100644 (file)
@@ -21,6 +21,8 @@
 #ifndef MISC_H
 #define MISC_H
 
+#include <gdk/gdk.h>
+#include <glib.h>
 #include <gtk/gtk.h>
 
 #include <config.h>
@@ -43,7 +45,7 @@ void gq_gtk_entry_set_text(GtkEntry *entry, const gchar *text);
 void gq_gtk_grid_attach_default(GtkGrid *grid, GtkWidget *child, guint left_attach, guint right_attach, guint top_attach, guint bottom_attach);
 void gq_gtk_grid_attach(GtkGrid *grid, GtkWidget *child, guint left_attach, guint right_attach, guint top_attach, guint bottom_attach, GtkAttachOptions, GtkAttachOptions, guint, guint);
 
-#ifdef HAVE_GTK4
+#if HAVE_GTK4
 void convert_gdkcolor_to_gdkrgba(gpointer data, GdkRGBA *gdk_rgba);
 #else
 void convert_gdkcolor_to_gdkrgba(gpointer data, GdkRGBA *gdk_rgba);
index 8e64145..6171ed7 100644 (file)
@@ -19,7 +19,9 @@
 
 #include "options.h"
 
-#include <config.h>
+#include <cstring>
+
+#include <gdk-pixbuf/gdk-pixbuf.h>
 
 #include "debug.h"
 #include "histogram.h" /* HCHAN_RGB */
index c980b21..894f25e 100644 (file)
@@ -21,7 +21,9 @@
 #ifndef OPTIONS_H
 #define OPTIONS_H
 
+#include <cairo.h>
 #include <gdk/gdk.h>
+#include <glib.h>
 
 #include "typedefs.h"
 
index 57c68cd..6801e5f 100644 (file)
 
 #include "osd.h"
 
+#include <cmath>
+#include <cstdlib>
+#include <cstring>
+
+#include <gdk/gdk.h>
+#include <glib-object.h>
+
 #include <config.h>
 
 #include "compat.h"
 #include "glua.h"
 #include "intl.h"
 #include "metadata.h"
-#include "ui-fileops.h"
+#include "typedefs.h"
 #include "ui-misc.h"
 
-#include <cmath>
-
 static const gchar *predefined_tags[][2] = {
        {"%name%",                                                      N_("Name")},
        {"%path:60%",                                           N_("Path")},
@@ -321,7 +326,7 @@ gchar *image_osd_mkinfo(const gchar *str, FileData *fd, GHashTable *vars)
                        {
                        data = metadata_read_string(fd, RATING_KEY, METADATA_PLAIN);
                        }
-#ifdef HAVE_LUA
+#if HAVE_LUA
                else if (strncmp(name, "lua/", 4) == 0)
                        {
                        gchar *tmp;
index 97ac457..4552c32 100644 (file)
--- a/src/osd.h
+++ b/src/osd.h
@@ -21,6 +21,7 @@
 #ifndef OSD_H
 #define OSD_H
 
+#include <glib.h>
 #include <gtk/gtk.h>
 
 struct FileData;
index 1b209ec..be9f74e 100644 (file)
 #include "pan-calendar.h"
 
 #include <cmath>
+#include <cstring>
+#include <ctime>
 
 #include "debug.h"
+#include "filedata.h"
 #include "misc.h"
 #include "pan-item.h"
+#include "pan-types.h"
 #include "pan-util.h"
 #include "pan-view-filter.h"
 #include "pan-view.h"
 #include "pixbuf-util.h"
+#include "typedefs.h"
 
 #define PAN_CAL_POPUP_COLOR 220, 220, 220
 enum {
index 91fd8f3..3279303 100644 (file)
 #ifndef PAN_VIEW_PAN_CALENDAR_H
 #define PAN_VIEW_PAN_CALENDAR_H
 
-#include "pan-types.h"
+#include <glib.h>
+
+struct FileData;
+struct PanItem;
+struct PanWindow;
 
 void pan_calendar_update(PanWindow *pw, PanItem *pi_day);
 void pan_calendar_compute(PanWindow *pw, FileData *dir_fd, gint *width, gint *height);
index 7c4e740..31b27fd 100644 (file)
 
 #include <cmath>
 
+#include "filedata.h"
 #include "pan-item.h"
+#include "pan-types.h"
 #include "pan-util.h"
 #include "pan-view-filter.h"
+#include "typedefs.h"
 
 static void pan_flower_size(PanWindow *pw, gint *width, gint *height)
 {
index 1d074c2..525ab66 100644 (file)
 #ifndef PAN_VIEW_PAN_FOLDER_H
 #define PAN_VIEW_PAN_FOLDER_H
 
-#include "pan-types.h"
+#include <glib.h>
+
+struct FileData;
+struct PanWindow;
 
 void pan_flower_compute(PanWindow *pw, FileData *dir_fd,
                        gint *width, gint *height,
index 2839a5d..4d6583d 100644 (file)
 #include <cmath>
 
 #include "pan-item.h"
+#include "pan-types.h"
 #include "pan-util.h"
 #include "pan-view-filter.h"
+#include "typedefs.h"
 
 void pan_grid_compute(PanWindow *pw, FileData *dir_fd, gint *width, gint *height)
 {
index 359c852..b3671bd 100644 (file)
 #ifndef PAN_VIEW_PAN_GRID_H
 #define PAN_VIEW_PAN_GRID_H
 
-#include "pan-types.h"
+#include <glib.h>
+
+struct FileData;
+struct PanWindow;
 
 void pan_grid_compute(PanWindow *pw, FileData *dir_fd, gint *width, gint *height);
 
index a303b13..eda674d 100644 (file)
 
 #include "pan-item.h"
 
+#include <cstring>
+
+#include <glib-object.h>
+#include <gtk/gtk.h>
+#include <pango/pango.h>
+
+#include "cache.h"
+#include "filedata.h"
 #include "image.h"
+#include "pan-types.h"
 #include "pixbuf-util.h"
 #include "ui-misc.h"
 
index aa4f291..6fb5b67 100644 (file)
 #ifndef PAN_VIEW_PAN_ITEM_H
 #define PAN_VIEW_PAN_ITEM_H
 
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <glib.h>
+
 #include "pan-types.h"
-#include "pixbuf-renderer.h"
+
+struct FileData;
+struct PixbufRenderer;
 
 void pan_item_free(PanItem *pi);
 
index 8d9540e..ee93ae9 100644 (file)
 
 #include "pan-timeline.h"
 
+#include <ctime>
+
+#include "filedata.h"
 #include "pan-item.h"
+#include "pan-types.h"
 #include "pan-util.h"
 #include "pan-view-filter.h"
 #include "pan-view.h"
+#include "typedefs.h"
 
 void pan_timeline_compute(PanWindow *pw, FileData *dir_fd, gint *width, gint *height)
 {
index 596721c..f8afd9d 100644 (file)
 #ifndef PAN_VIEW_PAN_TIMELINE_H
 #define PAN_VIEW_PAN_TIMELINE_H
 
-#include "pan-types.h"
+#include <glib.h>
+
+struct FileData;
+struct PanWindow;
 
 void pan_timeline_compute(PanWindow *pw, FileData *dir_fd, gint *width, gint *height);
 
index c24fa71..ed604a1 100644 (file)
 
 #include "pan-util.h"
 
-#include <config.h>
+#include <features.h>
+#include <sys/stat.h>
+#include <unistd.h>
 
+#include <cstring>
+
+#include "filedata.h"
 #include "main-defines.h"
 #include "ui-fileops.h"
 
index 49ea863..64bd514 100644 (file)
 #ifndef PAN_VIEW_PAN_UTIL_H
 #define PAN_VIEW_PAN_UTIL_H
 
-#include "pan-types.h"
+#include <ctime>
+
+#include <glib.h>
+
+#include "typedefs.h"
+
+struct FileData;
 
 enum PanDateLengthType {
        PAN_DATE_LENGTH_EXACT,
index 15b7353..b21954b 100644 (file)
 
 #include "pan-view-filter.h"
 
-#include <config.h>
+#include <cstddef>
+
+#include <glib-object.h>
 
 #include "compat.h"
+#include "filedata.h"
 #include "image.h"
 #include "intl.h"
 #include "main-defines.h"
 #include "metadata.h"
 #include "misc.h"
+#include "pan-types.h"
 #include "pan-view.h"
-#include "ui-fileops.h"
 #include "ui-misc.h"
 #include "ui-tabcomp.h"
 
index 40dbcba..4006018 100644 (file)
 #ifndef PAN_VIEW_PAN_VIEW_FILTER_H
 #define PAN_VIEW_PAN_VIEW_FILTER_H
 
-#include "pan-types.h"
+#include <glib.h>
+#include <gtk/gtk.h>
+
+#include "typedefs.h"
+
+struct PanWindow;
 
 enum PanViewFilterMode {
        PAN_VIEW_FILTER_REQUIRE,
index 8546150..f4f17bd 100644 (file)
 
 #include "pan-view-search.h"
 
-#include <config.h>
+#include <cstdlib>
+#include <cstring>
+#include <ctime>
+
+#include <glib-object.h>
 
 #include "compat.h"
+#include "filedata.h"
 #include "image.h"
 #include "intl.h"
 #include "main-defines.h"
 #include "misc.h"
 #include "pan-calendar.h"
 #include "pan-item.h"
+#include "pan-types.h"
 #include "pan-util.h"
 #include "pan-view.h"
 #include "ui-misc.h"
index 83c10aa..6adc890 100644 (file)
 #ifndef PAN_VIEW_PAN_VIEW_SEARCH_H
 #define PAN_VIEW_PAN_VIEW_SEARCH_H
 
-#include "pan-types.h"
+#include <glib.h>
+#include <gtk/gtk.h>
+
+struct PanViewSearchUi;
+struct PanWindow;
 
 void pan_search_toggle_visible(PanWindow *pw, gboolean enable);
 void pan_search_activate(PanWindow *pw);
index 8db42c2..5535947 100644 (file)
 
 #include "pan-view.h"
 
-#include <config.h>
+#include <cmath>
+#include <cstring>
+
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <gdk/gdk.h>
+#include <glib-object.h>
+#include <gtk/gtk.h>
 
 #include "bar-exif.h"
+#include "cache-loader.h"
+#include "cache.h"
 #include "compat.h"
 #include "debug.h"
 #include "dnd.h"
 #include "editors.h"
 #include "exif.h"
+#include "filedata.h"
 #include "fullscreen.h"
+#include "image-load.h"
 #include "image.h"
 #include "img-view.h"
 #include "intl.h"
 #include "layout-util.h"
+#include "layout.h"
 #include "main-defines.h"
 #include "main.h"
 #include "menu.h"
 #include "metadata.h"
 #include "misc.h"
+#include "options.h"
 #include "pan-calendar.h"
 #include "pan-folder.h"
 #include "pan-grid.h"
 #include "pan-item.h"
 #include "pan-timeline.h"
+#include "pan-types.h"
 #include "pan-util.h"
 #include "pan-view-filter.h"
 #include "pan-view-search.h"
 #include "ui-menu.h"
 #include "ui-misc.h"
 #include "ui-tabcomp.h"
+#include "ui-utildlg.h"
 #include "uri-utils.h"
 #include "utilops.h"
 #include "window.h"
 
-#include <cmath>
-
 
 enum {
        PAN_WINDOW_DEFAULT_WIDTH = 720,
index 27bf693..552ab41 100644 (file)
 #ifndef PAN_VIEW_PAN_VIEW_H
 #define PAN_VIEW_PAN_VIEW_H
 
-#include "pan-types.h"
+#include <glib.h>
+
+#include "typedefs.h"
+
+struct PanItem;
+struct PanWindow;
 
 void pan_layout_update(PanWindow *pw);
 GList *pan_layout_intersect(PanWindow *pw, gint x, gint y, gint width, gint height);
index d0a9440..c3f8786 100644 (file)
@@ -25,8 +25,6 @@
 #include <cstdlib>
 #include <cstring>
 
-#include <config.h>
-
 #include "debug.h"
 #include "main-defines.h"
 #include "options.h"
index af0d67f..b2d3452 100644 (file)
 #ifndef PIXBUF_RENDERER_H
 #define PIXBUF_RENDERER_H
 
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <gdk/gdk.h>
+#include <glib-object.h>
+#include <glib.h>
 #include <gtk/gtk.h>
 
 #include "typedefs.h"
 
+struct PixbufRenderer;
+
 #define TYPE_PIXBUF_RENDERER           (pixbuf_renderer_get_type())
 #define PIXBUF_RENDERER(obj)           (G_TYPE_CHECK_INSTANCE_CAST((obj), TYPE_PIXBUF_RENDERER, PixbufRenderer))
 #define PIXBUF_RENDERER_CLASS(klass)   (G_TYPE_CHECK_CLASS_CAST((klass), TYPE_PIXBUF_RENDERER, PixbufRendererClass))
 #define ROUND_DOWN(A,B) ((gint)(((A))/(B))*(B))
 
 
-struct RendererFuncs;
-
-struct PixbufRenderer;
-struct PixbufRendererClass;
-
-
 using PixbufRendererTileRequestFunc = gint (*)(PixbufRenderer *, gint, gint, gint, gint, GdkPixbuf *, gpointer);
 using PixbufRendererTileDisposeFunc = void (*)(PixbufRenderer *, gint, gint, gint, gint, GdkPixbuf *, gpointer);
 
index bd55b29..1171568 100644 (file)
 
 #include "pixbuf-util.h"
 
+#include <cmath>
+#include <cstdlib>
+#include <cstring>
+
+#include <cairo.h>
+#include <gio/gio.h>
+#include <glib-object.h>
+#include <pango/pangocairo.h>
+
 #include <config.h>
 
 #include "debug.h"
 #include "exif.h"
 #include "filedata.h"
 #include "main-defines.h"
+#include "typedefs.h"
 #include "ui-fileops.h"
 
-#include <cmath>
-
 
 /*
  *-----------------------------------------------------------------------------
index 4df9558..325a840 100644 (file)
 #ifndef PIXBUF_UTIL_H
 #define PIXBUF_UTIL_H
 
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <glib.h>
 #include <gtk/gtk.h>
+#include <pango/pango.h>
 
 struct FileData;
 
index 8b73b6c..96d3c78 100644 (file)
 
 #include <config.h>
 
+#include <cstdlib>
+#include <cstring>
+
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <gdk/gdk.h>
+#include <gio/gio.h>
+#include <glib-object.h>
+
+#if HAVE_SPELL
+#include <gspell/gspell.h>
+#endif
+
+#if HAVE_LCMS
+#if HAVE_LCMS2
+#include <lcms2.h>
+#else
+#include <lcms.h>
+#endif
+#endif
+
+#include <pango/pango.h>
+
 #include "bar-keywords.h"
 #include "cache.h"
 #include "color-man.h"
 #include "img-view.h"
 #include "intl.h"
 #include "layout-util.h"
+#include "layout.h"
 #include "main-defines.h"
 #include "main.h"
 #include "metadata.h"
 #include "misc.h"
+#include "options.h"
 #include "osd.h"
 #include "pixbuf-util.h"
 #include "rcfile.h"
 #include "slideshow.h"
 #include "toolbar.h"
 #include "trash.h"
+#include "typedefs.h"
 #include "ui-fileops.h"
 #include "ui-misc.h"
 #include "ui-tabcomp.h"
+#include "ui-utildlg.h"
 #include "utilops.h"
 #include "window.h"
 #include "zonedetect.h"
 
-#ifdef HAVE_LCMS
-#ifdef HAVE_LCMS2
-#include <lcms2.h>
-#else
-#include <lcms.h>
-#endif
-#endif
-
-#ifdef HAVE_SPELL
-#include <gspell/gspell.h>
-#endif
+struct ZoneDetect;
 
 enum {
        EDITOR_NAME_MAX_LENGTH = 32,
@@ -274,7 +290,7 @@ static gboolean accel_apply_cb(GtkTreeModel *model, GtkTreePath *, GtkTreeIter *
 static void config_window_apply()
 {
        gboolean refresh = FALSE;
-#ifdef HAVE_LCMS2
+#if HAVE_LCMS2
        int i = 0;
 #endif
 
@@ -491,7 +507,7 @@ static void config_window_apply()
        config_entry_to_option(log_window_f1_entry, &options->log_window.action, nullptr);
 #endif
 
-#ifdef HAVE_LCMS
+#if HAVE_LCMS
        for (i = 0; i < COLOR_PROFILE_INPUTS; i++)
                {
                config_entry_to_option(color_profile_input_name_entry[i], &options->color_profile.input_name[i], nullptr);
@@ -2045,7 +2061,7 @@ static void config_tab_general(GtkWidget *notebook)
                                 options->thumbnails.collection_preview, &c_options->thumbnails.collection_preview);
        gtk_widget_set_tooltip_text(spin, _("The maximum number of thumbnails shown in a Collection preview montage"));
 
-#ifdef HAVE_FFMPEGTHUMBNAILER_METADATA
+#if HAVE_FFMPEGTHUMBNAILER_METADATA
        pref_checkbox_new_int(group, _("Use embedded metadata in video files as thumbnails when available"),
                              options->thumbnails.use_ft_metadata, &c_options->thumbnails.use_ft_metadata);
 #endif
@@ -2884,7 +2900,7 @@ static void config_tab_metadata(GtkWidget *notebook)
 
 
        group = pref_group_new(vbox, FALSE, _("Metadata writing sequence"), GTK_ORIENTATION_VERTICAL);
-#ifndef HAVE_EXIV2
+#if !HAVE_EXIV2
        label = pref_label_new(group, _("Warning: Geeqie is built without Exiv2. Some options are disabled."));
 #endif
        label = pref_label_new(group, _("When writing metadata, Geeqie will follow these steps, if selected. This process will stop when the first successful write occurs."));
@@ -2902,7 +2918,7 @@ static void config_tab_metadata(GtkWidget *notebook)
        gtk_widget_set_tooltip_markup(ct_button, markup);
        g_free(markup);
 
-#ifndef HAVE_EXIV2
+#if !HAVE_EXIV2
        gtk_widget_set_sensitive(ct_button, FALSE);
 #endif
 
@@ -2923,7 +2939,7 @@ static void config_tab_metadata(GtkWidget *notebook)
        pref_spacer(group, PREF_PAD_GROUP);
 
        group = pref_group_new(vbox, FALSE, _("Step 1 Options:"), GTK_ORIENTATION_VERTICAL);
-#ifndef HAVE_EXIV2
+#if !HAVE_EXIV2
        gtk_widget_set_sensitive(group, FALSE);
 #endif
 
@@ -2947,7 +2963,7 @@ static void config_tab_metadata(GtkWidget *notebook)
        pref_spacer(group, PREF_PAD_GROUP);
 
        group = pref_group_new(vbox, FALSE, _("Steps 2 and 3 Option:"), GTK_ORIENTATION_VERTICAL);
-#ifndef HAVE_EXIV2
+#if !HAVE_EXIV2
        gtk_widget_set_sensitive(group, FALSE);
 #endif
 
@@ -2965,7 +2981,7 @@ static void config_tab_metadata(GtkWidget *notebook)
        ct_button = pref_checkbox_new_int(group, _("Write altered image orientation to the metadata"), options->metadata.write_orientation, &c_options->metadata.write_orientation);
        gtk_widget_set_tooltip_text(ct_button, _("If checked, the results of orientation commands (Rotate, Mirror and Flip) issued on an image will be written to metadata\nNote: If this option is not checked, the results of orientation commands will be lost when Geeqie closes"));
 
-#ifndef HAVE_EXIV2
+#if !HAVE_EXIV2
        gtk_widget_set_sensitive(ct_button, FALSE);
 #endif
 
@@ -2986,7 +3002,7 @@ static void config_tab_metadata(GtkWidget *notebook)
 
        pref_spacer(group, PREF_PAD_GROUP);
 
-#ifdef HAVE_SPELL
+#if HAVE_SPELL
        group = pref_group_new(vbox, FALSE, _("Spelling checks"), GTK_ORIENTATION_VERTICAL);
 
        ct_button = pref_checkbox_new_int(group, _("Check spelling - Requires restart"), options->metadata.check_spelling, &c_options->metadata.check_spelling);
@@ -3297,7 +3313,7 @@ static void config_tab_keywords(GtkWidget *notebook)
        GtkTextIter iter;
        GtkTextBuffer *buffer;
        gchar *tmp;
-#ifdef HAVE_SPELL
+#if HAVE_SPELL
        GspellTextView *gspell_view;
 #endif
 
@@ -3318,7 +3334,7 @@ static void config_tab_keywords(GtkWidget *notebook)
        gq_gtk_box_pack_start(GTK_BOX(group), scrolled, TRUE, TRUE, 0);
        gtk_widget_show(scrolled);
 
-#ifdef HAVE_SPELL
+#if HAVE_SPELL
        if (options->metadata.check_spelling)
                {
                gspell_view = gspell_text_view_get_from_gtk_text_view(GTK_TEXT_VIEW(keyword_text));
@@ -3359,7 +3375,7 @@ static void config_tab_keywords(GtkWidget *notebook)
 }
 
 /* metadata tab */
-#ifdef HAVE_LCMS
+#if HAVE_LCMS
 static void intent_menu_cb(GtkWidget *combo, gpointer data)
 {
        auto option = static_cast<gint *>(data);
@@ -3427,7 +3443,7 @@ static void config_tab_color(GtkWidget *notebook)
        vbox = scrolled_notebook_page(notebook, _("Color management"));
 
        group =  pref_group_new(vbox, FALSE, _("Input profiles"), GTK_ORIENTATION_VERTICAL);
-#ifndef HAVE_LCMS
+#if !HAVE_LCMS
        gtk_widget_set_sensitive(pref_group_parent(group), FALSE);
 #endif
 
@@ -3471,7 +3487,7 @@ static void config_tab_color(GtkWidget *notebook)
                }
 
        group =  pref_group_new(vbox, FALSE, _("Screen profile"), GTK_ORIENTATION_VERTICAL);
-#ifndef HAVE_LCMS
+#if !HAVE_LCMS
        gtk_widget_set_sensitive(pref_group_parent(group), FALSE);
 #endif
        pref_checkbox_new_int(group, _("Use system screen profile if available"),
@@ -3484,7 +3500,7 @@ static void config_tab_color(GtkWidget *notebook)
                                     options->color_profile.screen_file, nullptr, ".icc", "ICC Files", nullptr);
        tab_completion_add_select_button(color_profile_screen_file_entry, _("Select color profile"), FALSE);
        gtk_widget_set_size_request(color_profile_screen_file_entry, 160, -1);
-#ifdef HAVE_LCMS
+#if HAVE_LCMS
        add_intent_menu(table, 0, 1, _("Render Intent:"), options->color_profile.render_intent, &c_options->color_profile.render_intent);
 #endif
        gq_gtk_grid_attach(GTK_GRID(table), tabcomp, 1, 2, 0, 1, static_cast<GtkAttachOptions>(GTK_FILL | GTK_EXPAND), static_cast<GtkAttachOptions>(0), 0, 0);
index 17fbadd..345854b 100644 (file)
@@ -22,6 +22,7 @@
 #ifndef PREFERENCES_H
 #define PREFERENCES_H
 
+#include <glib.h>
 #include <gtk/gtk.h>
 
 struct LayoutWindow;
index 75d284d..2a3b8eb 100644 (file)
 
 #include "print.h"
 
-#include <config.h>
+#include <cstddef>
+
+#include <cairo.h>
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <gdk/gdk.h>
+#include <glib-object.h>
+#include <pango/pango.h>
+#include <pango/pangocairo.h>
 
 #include "compat.h"
 #include "debug.h"
index d61028f..63a6ecd 100644 (file)
@@ -22,6 +22,7 @@
 #ifndef PRINT_H
 #define PRINT_H
 
+#include <glib.h>
 #include <gtk/gtk.h>
 
 struct FileData;
index b507877..934094d 100644 (file)
 
 #include "rcfile.h"
 
+#include <cstdlib>
+#include <cstring>
+
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <gtk/gtk.h>
+
 #include <config.h>
 
 #include "bar-comment.h"
 #include "filefilter.h"
 #include "intl.h"
 #include "layout-util.h"
+#include "layout.h"
 #include "main-defines.h"
 #include "metadata.h"
+#include "options.h"
 #include "pixbuf-renderer.h"
 #include "secure-save.h"
 #include "slideshow.h"
+#include "typedefs.h"
 #include "ui-fileops.h"
 #include "ui-utildlg.h"
 
@@ -576,7 +585,7 @@ static void write_global_attributes(GString *outstr, gint indent)
 static void write_color_profile(GString *outstr, gint indent)
 {
        gint i;
-#ifndef HAVE_LCMS
+#if !HAVE_LCMS
        g_string_append_printf(outstr, "<!-- NOTICE: %s was not built with support for color profiles,\n"
                                "                color profile options will have no effect.\n-->\n", GQ_APPNAME);
 #endif
@@ -1403,7 +1412,7 @@ static void options_parse_global(GQParserData *parser_data, GMarkupParseContext
 
 static void options_parse_global_end(GQParserData *, GMarkupParseContext *, const gchar *, gpointer, GError **)
 {
-#ifndef HAVE_EXIV2
+#if !HAVE_EXIV2
        /* some options do not work without exiv2 */
        options->metadata.save_in_image_file = FALSE;
        options->metadata.save_legacy_format = TRUE;
@@ -1460,8 +1469,8 @@ static void options_parse_bar(GQParserData *parser_data, GMarkupParseContext *,
                        }
                options_parse_func_push(parser_data, options_parse_leaf, nullptr, nullptr);
                }
-#ifdef HAVE_LIBCHAMPLAIN
-#ifdef HAVE_LIBCHAMPLAIN_GTK
+#if HAVE_LIBCHAMPLAIN
+#if HAVE_LIBCHAMPLAIN_GTK
        else if (g_ascii_strcasecmp(element_name, "pane_gps") == 0)
                {
                /* Use this flag to determine if --disable-clutter has been issued */
index 16a7d64..d3d93a5 100644 (file)
 #ifndef RCFILE_H
 #define RCFILE_H
 
-#include "options.h"
+#include <gdk/gdk.h>
+#include <glib.h>
 
+struct ConfOptions;
+struct GQParserData;
 struct LayoutWindow;
 
 void write_indent(GString *str, gint indent);
@@ -77,8 +80,6 @@ gboolean read_bool_option(const gchar *option, const gchar *label, const gchar *
 
 #define READ_DUMMY(_target_, _name_, _msg_) read_dummy_option(option, #_name_, _msg_)
 
-struct GQParserFuncData;
-struct GQParserData;
 using GQParserStartFunc = void (*)(GQParserData *, GMarkupParseContext *, const gchar *, const gchar **, const gchar **, gpointer, GError **);
 using GQParserEndFunc = void (*)(GQParserData *, GMarkupParseContext *, const gchar *, gpointer, GError **);
 
index 4ece932..c7ce752 100644 (file)
 
 #include "remote.h"
 
+#include <sys/socket.h>
+#include <sys/stat.h>
+#include <sys/un.h>
+#include <unistd.h>
+
+#include <cerrno>
+#include <csignal>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+
 #include <config.h>
 
+#include <gtk/gtk.h>
+
 #include "cache-maint.h"
 #include "collect-io.h"
 #include "collect.h"
 #include "exif.h"
 #include "filedata.h"
 #include "filefilter.h"
+#include "glua.h"
 #include "image.h"
 #include "img-view.h"
 #include "intl.h"
 #include "layout-image.h"
 #include "layout-util.h"
+#include "layout.h"
 #include "main-defines.h"
 #include "main.h"
 #include "misc.h"
+#include "options.h"
 #include "pixbuf-renderer.h"
 #include "rcfile.h"
 #include "slideshow.h"
+#include "typedefs.h"
 #include "ui-fileops.h"
 #include "ui-misc.h"
 #include "utilops.h"
 #include "view-file.h"
 
-#include <csignal>
-#include <sys/socket.h>
-#include <sys/un.h>
-
-#include "glua.h"
-
 enum {
        SERVER_MAX_CLIENTS = 8
 };
@@ -1653,7 +1664,7 @@ static void gr_print0(const gchar *, GIOChannel *channel, gpointer)
        g_io_channel_write_chars(channel, "<gq_end_of_command>", -1, nullptr, nullptr);
 }
 
-#ifdef HAVE_LUA
+#if HAVE_LUA
 static void gr_lua(const gchar *text, GIOChannel *channel, gpointer)
 {
        gchar *result = nullptr;
@@ -1734,7 +1745,7 @@ static RemoteCommandEntry remote_commands[] = {
        { nullptr, "--last",               gr_image_last,          FALSE, FALSE, nullptr, N_("last image") },
        { nullptr, "--list-add:",          gr_list_add,            TRUE,  FALSE, N_("<FILE>"), N_("add FILE to command line collection list") },
        { nullptr, "--list-clear",         gr_list_clear,          FALSE, FALSE, nullptr, N_("clear command line collection list") },
-#ifdef HAVE_LUA
+#if HAVE_LUA
        { nullptr, "--lua:",               gr_lua,                 TRUE, FALSE, N_("<FILE>,<lua script>"), N_("run lua script on FILE") },
 #endif
        { nullptr, "--new-window",         gr_new_window,          FALSE, FALSE, nullptr, N_("new window") },
index 404d1ce..aa364c0 100644 (file)
 #include <cstdlib>
 #include <cstring>
 
-#include <config.h>
+#include <cairo.h>
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <gdk/gdk.h>
+#include <glib-object.h>
+#include <glib.h>
+#include <gtk/gtk.h>
 
 #include "debug.h"
 #include "options.h"
+#include "pixbuf-renderer.h"
+#include "typedefs.h"
 
 /* comment this out if not using this from within Geeqie
  * defining GQ_BUILD does these things:
index f35cac6..de195b8 100644 (file)
@@ -22,8 +22,8 @@
 #ifndef RENDERER_TILES_H
 #define RENDERER_TILES_H
 
-#include <pixbuf-renderer.h>
-
+struct PixbufRenderer;
+struct RendererFuncs;
 
 RendererFuncs *renderer_tiles_new(PixbufRenderer *pr);
 
index bb6a1c4..c23da61 100644 (file)
 
 #include "search-and-run.h"
 
-#include <config.h>
+#include <cstddef>
+
+#include <gdk/gdk.h>
+#include <glib-object.h>
+#include <glib.h>
+#include <pango/pango.h>
 
 #include "compat.h"
 #include "debug.h"
 #include "layout.h"
 #include "main-defines.h"
-#include "ui-misc.h"
-#include "window.h"
 
 enum {
        SAR_LABEL,
index ea0d194..dd49fc9 100644 (file)
 
 #include "search.h"
 
-#include <config.h>
+#include <sys/types.h>
+
+#include <cmath>
+#include <cstdio>
+#include <cstring>
+#include <ctime>
+
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <gdk/gdk.h>
+#include <glib-object.h>
+#include <glib.h>
+#include <gtk/gtk.h>
 
 #include "bar-keywords.h"
 #include "cache.h"
 #include "collect-table.h"
+#include "collect.h"
 #include "compat.h"
 #include "debug.h"
 #include "dnd.h"
 #include "img-view.h"
 #include "intl.h"
 #include "layout-util.h"
+#include "layout.h"
 #include "main-defines.h"
 #include "menu.h"
 #include "metadata.h"
 #include "misc.h"
-#include "pixbuf-util.h"
+#include "options.h"
 #include "print.h"
+#include "similar.h"
 #include "thumb.h"
+#include "typedefs.h"
 #include "ui-bookmark.h"
 #include "ui-fileops.h"
 #include "ui-menu.h"
 #include "ui-misc.h"
 #include "ui-tabcomp.h"
 #include "ui-tree-edit.h"
+#include "ui-utildlg.h"
 #include "uri-utils.h"
 #include "utilops.h"
 #include "window.h"
 
-#include <cmath>
-
 enum {
        DEF_SEARCH_WIDTH =  700,
        DEF_SEARCH_HEIGHT = 650
index 348c680..55a27b7 100644 (file)
 
 #include "secure-save.h"
 
+#include <cerrno>
+#include <cstdarg>
 #include <memory>
 
-#include <glib/gprintf.h>
 #include <sys/stat.h>
+#include <unistd.h>
 #include <utime.h>
 
+#include <glib/gprintf.h>
+
 #include <config.h>
 
 #include "debug.h"
@@ -126,7 +130,7 @@ secure_open_umask(const gchar *file_name)
                        /* Not a regular file, secure_save is disabled. */
                        ssi->secure_save = FALSE;
                } else {
-#ifdef HAVE_ACCESS
+#if HAVE_ACCESS
                        /* XXX: access() do not work with setuid programs. */
                        if (access(ssi->file_name, R_OK | W_OK) < 0) {
                                ssi->err = errno;
@@ -250,11 +254,11 @@ secure_close(SecureSaveInfo *ssi)
        if (ssi->secure_save) {
                gboolean fail = FALSE;
 
-#ifdef HAVE_FFLUSH
+#if HAVE_FFLUSH
                fail = (fflush(ssi->fp) == EOF);
 #endif
 
-#ifdef HAVE_FSYNC
+#if HAVE_FSYNC
                if (!fail) fail = fsync(fileno(ssi->fp));
 #endif
 
index 35c635b..e713a56 100644 (file)
@@ -21,7 +21,8 @@
 
 #include "shortcuts.h"
 
-#include <config.h>
+#include <glib-object.h>
+#include <glib.h>
 
 #include "collect.h"
 #include "compat.h"
@@ -31,6 +32,7 @@
 #include "ui-bookmark.h"
 #include "ui-fileops.h"
 #include "ui-misc.h"
+#include "ui-utildlg.h"
 #include "utilops.h"
 
 struct ShortcutsData
index 67c5468..6b9a641 100644 (file)
@@ -21,7 +21,7 @@
 
 #include "similar.h"
 
-#include <config.h>
+#include <cstdlib>
 
 #include "options.h"
 
index 528c8f8..2fee1f2 100644 (file)
@@ -23,6 +23,7 @@
 #define SIMILAR_H
 
 #include <gdk-pixbuf/gdk-pixbuf.h>
+#include <glib.h>
 
 struct ImageSimilarityData
 {
index ba29f27..65e48f1 100644 (file)
 
 #include "slideshow.h"
 
-#include <config.h>
+#include <cstdlib>
 
 #include "collect.h"
 #include "filedata.h"
 #include "image.h"
 #include "layout-image.h"
 #include "layout.h"
+#include "options.h"
 
 static void slideshow_timer_stop(SlideShowData *ss);
 
index 1ac949b..cc9b97b 100644 (file)
 
 #include "thumb-standard.h"
 
+#include <sys/stat.h>
+
+#include <cstdlib>
+#include <cstring>
+#include <ctime>
+
+#include <glib-object.h>
+
 #include <config.h>
 
 #include "cache.h"
 #include "metadata.h"
 #include "options.h"
 #include "pixbuf-util.h"
+#include "typedefs.h"
 #include "ui-fileops.h"
 
+struct ExifData;
 
 /**
  * @file
index 6752f5f..ccf2d48 100644 (file)
 #ifndef THUMB_STANDARD_H
 #define THUMB_STANDARD_H
 
+#include <sys/types.h>
+
 #include <gdk-pixbuf/gdk-pixbuf.h>
+#include <glib.h>
+
+#include <config.h>
 
 #include "main-defines.h"
 
index 674e241..b7605ea 100644 (file)
 
 #include "thumb.h"
 
-#include <config.h>
+#include <sys/types.h>
+#include <utime.h>
+
+#include <cstdio>
+#include <cstring>
+
+#include <glib-object.h>
 
 #include "cache.h"
 #include "debug.h"
@@ -35,8 +41,6 @@
 #include "thumb-standard.h"
 #include "ui-fileops.h"
 
-#include <utime.h>
-
 
 static void thumb_loader_error_cb(ImageLoader *il, gpointer data);
 static void thumb_loader_setup(ThumbLoader *tl, FileData *fd);
index 29f1c61..ad8fb80 100644 (file)
@@ -23,6 +23,7 @@
 #define THUMB_H
 
 #include <gdk-pixbuf/gdk-pixbuf.h>
+#include <glib.h>
 
 #include "typedefs.h"
 
index df4a4e5..417cf84 100644 (file)
 
 #include "toolbar.h"
 
+#include <cstddef>
+
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <glib-object.h>
+#include <glib.h>
+
 #include <config.h>
 
 #include "compat.h"
 #include "editors.h"
 #include "intl.h"
 #include "layout-util.h"
+#include "layout.h"
 #include "main-defines.h"
-#include "pixbuf-util.h"
 #include "ui-fileops.h"
 #include "ui-menu.h"
 #include "ui-misc.h"
@@ -219,7 +225,7 @@ static void toolbarlist_add_button(const gchar *name, const gchar *label,
        toolbar_entry->name = g_strdup(name);
        toolbar_entry->stock_id = g_strdup(stock_id);
 
-#ifdef HAVE_GTK4
+#if HAVE_GTK4
        gesture = gtk_gesture_click_new();
        gtk_widget_add_controller(toolbar_entry->button, GTK_EVENT_CONTROLLER(gesture));
 #else
index 8e2d60d..7daa656 100644 (file)
 
 #include "trash.h"
 
-#include <config.h>
+#include <unistd.h>
 
-#include "utilops.h"
-#include "window.h"
+#include <cstdlib>
+
+#include <gio/gio.h>
 
 #include "debug.h"
 #include "editors.h"
 #include "intl.h"
 #include "main-defines.h"
 #include "options.h"
+#include "typedefs.h"
 #include "ui-fileops.h"
+#include "ui-utildlg.h"
+#include "utilops.h"
+#include "window.h"
 
 /*
  *--------------------------------------------------------------------------
index e0a620b..ed4fb82 100644 (file)
 
 #include "ui-bookmark.h"
 
+#include <cstdlib>
 #include <cstring>
 #include <memory>
 
-#include <config.h>
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <gdk/gdk.h>
+#include <glib-object.h>
+#include <pango/pango.h>
 
 #include "compat.h"
 #include "debug.h"
index 8e2f1f0..5d971e7 100644 (file)
@@ -22,6 +22,7 @@
 #ifndef UI_BOOKMARK_H
 #define UI_BOOKMARK_H
 
+#include <glib.h>
 #include <gtk/gtk.h>
 
 /* bookmarks */
index 4ddfcad..b5aa87f 100644 (file)
 
 #include "ui-fileops.h"
 
+#include <sys/stat.h>
+#include <unistd.h>
+#include <utime.h>
+
 #include <cstdio>
 #include <cstdlib>
 #include <cstring>
 #include <memory>
 
-#include <unistd.h>
-#include <utime.h>
+#include <glib-object.h>
+#include <gtk/gtk.h>
 
 #include <config.h>
 
 #include "layout.h"
 #include "main-defines.h"
 #include "md5-util.h"
+#include "options.h"
 #include "secure-save.h"
+#include "typedefs.h"
+#include "ui-utildlg.h"
 #include "utilops.h"
 
 /*
index 4026920..a130030 100644 (file)
 #ifndef UI_FILEOPS_H
 #define UI_FILEOPS_H
 
-#include <sys/stat.h>
-#include <sys/time.h>
 #include <sys/types.h>
-#include <time.h>
+
+#include <ctime>
 
 #include <gio/gio.h>
+#include <glib.h>
 
 #include <config.h>
 
+#ifdef DEBUG
+#define GQ_DEBUG_PATH_UTF8 1
+#endif
+
 void print_term(gboolean err, const gchar *text_utf8);
 
 #define printf_term(err, ...) \
index 3bd3d08..89cdef0 100644 (file)
@@ -24,7 +24,8 @@
 #include <cstdio>
 #include <cstring>
 
-#include <config.h>
+#include <gdk/gdk.h>
+#include <glib-object.h>
 
 #include "compat.h"
 #include "debug.h"
index f04d2a2..a85c94a 100644 (file)
@@ -22,6 +22,7 @@
 #ifndef UI_HELP_H
 #define UI_HELP_H
 
+#include <glib.h>
 #include <gtk/gtk.h>
 
 GtkWidget *help_window_new(const gchar *title,
index 66dd93b..7ec7e99 100644 (file)
@@ -21,7 +21,9 @@
 
 #include "ui-menu.h"
 
-#include <config.h>
+#include <cstddef>
+
+#include <pango/pango.h>
 
 #include "layout.h"
 
index 879aae3..b8ee572 100644 (file)
@@ -22,7 +22,9 @@
 #ifndef UI_MENU_H
 #define UI_MENU_H
 
-
+#include <gdk/gdk.h>
+#include <glib-object.h>
+#include <glib.h>
 #include <gtk/gtk.h>
 
 /**
index 8d56e75..6d67343 100644 (file)
 
 #include "ui-misc.h"
 
+#include <langinfo.h>
+
 #include <cstdlib>
 #include <cstring>
 
+#include <pango/pango.h>
+
 #include <config.h>
 
 #include "compat.h"
 #include "layout.h"
 #include "main-defines.h"
 #include "misc.h"
+#include "options.h"
+#include "typedefs.h"
 #include "utilops.h"
 
-#include <langinfo.h>
-
 /*
  *-----------------------------------------------------------------------------
  * widget and layout utilities
@@ -360,7 +364,7 @@ static GtkWidget *real_pref_radiobutton_new(GtkWidget *parent_box, GtkWidget *si
                                            GCallback func, gpointer data)
 {
        GtkWidget *button;
-#ifdef HAVE_GTK4
+#if HAVE_GTK4
        GtkToggleButton *group;;
 #else
        GSList *group;
@@ -368,7 +372,7 @@ static GtkWidget *real_pref_radiobutton_new(GtkWidget *parent_box, GtkWidget *si
 
        if (sibling)
                {
-#ifdef HAVE_GTK4
+#if HAVE_GTK4
                group = sibling;
 #else
                group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(sibling));
@@ -381,7 +385,7 @@ static GtkWidget *real_pref_radiobutton_new(GtkWidget *parent_box, GtkWidget *si
 
        if (mnemonic_text)
                {
-#ifdef HAVE_GTK4
+#if HAVE_GTK4
                button = gtk_toggle_button_new_with_mnemonic(text);
                gtk_toggle_button_set_group(button, group);
 #else
@@ -390,7 +394,7 @@ static GtkWidget *real_pref_radiobutton_new(GtkWidget *parent_box, GtkWidget *si
                }
        else
                {
-#ifdef HAVE_GTK4
+#if HAVE_GTK4
                button = gtk_toggle_button_new_with_label(text);
                gtk_toggle_button_set_group(button, group);
 #else
@@ -936,7 +940,7 @@ static void date_selection_popup(DateSelection *ds)
        gtk_widget_show(ds->calendar);
 
        date = date_selection_get(ds->box);
-#ifdef HAVE_GTK4
+#if HAVE_GTK4
        gtk_calendar_select_day(GTK_CALENDAR(ds->calendar), date);
 #else
        gtk_calendar_select_month(GTK_CALENDAR(ds->calendar), g_date_time_get_month(date), g_date_time_get_year(date));
index b385cc9..881585c 100644 (file)
 #ifndef UI_MISC_H
 #define UI_MISC_H
 
+#include <ctime>
 
-#include <sys/time.h>
-#include <sys/types.h>
-#include <time.h>
-
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <gdk/gdk.h>
+#include <glib-object.h>
+#include <glib.h>
 #include <gtk/gtk.h>
 
 /* these values are per GNOME HIG */
index a0c4ffb..8584959 100644 (file)
@@ -25,9 +25,9 @@
 
 #include <dirent.h>
 #include <sys/stat.h>
-#include <sys/types.h>
 
-#include <config.h>
+#include <gdk/gdk.h>
+#include <glib-object.h>
 
 #include "compat.h"
 #include "debug.h"
 #include "main-defines.h"
 #include "misc.h"
 #include "options.h"
+#include "typedefs.h"
 #include "ui-bookmark.h"
 #include "ui-fileops.h"
 #include "ui-menu.h"
 #include "ui-misc.h"
 #include "ui-tabcomp.h"
 #include "ui-tree-edit.h"
+#include "ui-utildlg.h"
 #include "uri-utils.h"
 #include "utilops.h"
 
index 1dff0c7..9ca9c1b 100644 (file)
@@ -22,7 +22,7 @@
 #ifndef UI_PATHSEL_H
 #define UI_PATHSEL_H
 
-
+#include <glib.h>
 #include <gtk/gtk.h>
 
 GtkWidget *path_selection_new_with_files(GtkWidget *entry, const gchar *path,
index 07797e2..1716e2a 100644 (file)
 
 #include "ui-tabcomp.h"
 
-#include <cstring>
 #include <dirent.h>
-#include <sys/types.h>
 
-#include <config.h>
+#include <cstring>
+
+#include <gdk/gdk.h>
+#include <glib-object.h>
 
 #include "compat.h"
 #include "debug.h"
index 3d665aa..86504e8 100644 (file)
@@ -22,6 +22,7 @@
 #ifndef UI_TABCOMP_H
 #define UI_TABCOMP_H
 
+#include <glib.h>
 #include <gtk/gtk.h>
 
 GtkWidget *tab_completion_new_with_history(GtkWidget **entry, const gchar *text,
index 8da8cb3..b2add4a 100644 (file)
@@ -23,7 +23,7 @@
 
 #include <cstring>
 
-#include <config.h>
+#include <glib-object.h>
 
 #include "compat.h"
 #include "misc.h"
index 9d080fd..41ab50c 100644 (file)
@@ -22,6 +22,8 @@
 #ifndef UI_TREE_EDIT_H
 #define UI_TREE_EDIT_H
 
+#include <gdk/gdk.h>
+#include <glib.h>
 #include <gtk/gtk.h>
 
 struct TreeEditData
index 212bac8..80edddc 100644 (file)
 
 #include "ui-utildlg.h"
 
+#include <cstdint>
+#include <cstdio>
 #include <cstring>
+#include <ctime>
+
+#include <gdk/gdk.h>
+#include <gio/gio.h>
+#include <glib-object.h>
 
 #include <config.h>
 
@@ -31,6 +38,7 @@
 #include "intl.h"
 #include "main-defines.h"
 #include "misc.h"
+#include "options.h"
 #include "rcfile.h"
 #include "ui-fileops.h"
 #include "ui-misc.h"
index f9ea4d6..41dd40f 100644 (file)
 #ifndef UI_UTILDLG_H
 #define UI_UTILDLG_H
 
+#include <glib.h>
 #include <gtk/gtk.h>
 
 struct FileData;
 
-#define GENERIC_DIALOG(gd) ((GenericDialog *)gd)
-
 struct GenericDialog
 {
        GtkWidget *dialog;      /**< window */
@@ -45,6 +44,8 @@ struct GenericDialog
 
 };
 
+#define GENERIC_DIALOG(gd) ((GenericDialog *)gd)
+
 struct FileDialog
 {
        GenericDialog gd;
index 924970a..ef2e26b 100644 (file)
@@ -20,8 +20,6 @@
 
 #include "uri-utils.h"
 
-#include <config.h>
-
 #include "debug.h"
 #include "filedata.h"
 #include "intl.h"
index b85a8d6..1cda9dc 100644 (file)
@@ -21,6 +21,7 @@
 #ifndef URI_UTILS_H
 #define URI_UTILS_H
 
+#include <glib.h>
 #include <gtk/gtk.h>
 
 void warning_dialog_dnd_uri_error(GList *uri_error_list);
index 1703dba..66081f1 100644 (file)
 
 #include "utilops.h"
 
+#include <unistd.h>
+
+#include <cstring>
+
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <gdk/gdk.h>
+#include <glib-object.h>
+
 #include <config.h>
 
 #include "cache.h"
@@ -32,6 +40,7 @@
 #include "filefilter.h"
 #include "image.h"
 #include "intl.h"
+#include "main-defines.h"
 #include "metadata.h"
 #include "misc.h"
 #include "options.h"
@@ -40,6 +49,7 @@
 #include "ui-bookmark.h"
 #include "ui-fileops.h"
 #include "ui-misc.h"
+#include "ui-utildlg.h"
 
 namespace
 {
@@ -51,9 +61,9 @@ struct PixmapErrors
        GdkPixbuf *apply;
 };
 
-GdkPixbuf *file_util_get_error_icon(FileData *fd, GList *list, GtkWidget *widget)
+GdkPixbuf *file_util_get_error_icon(FileData *fd, GList *list, GtkWidget *)
 {
-       static PixmapErrors pe = [widget]() -> PixmapErrors
+       static PixmapErrors pe = []() -> PixmapErrors
        {
                GtkIconTheme *icon_theme = gtk_icon_theme_get_default();
 
@@ -3167,7 +3177,7 @@ void file_util_rename_dir(FileData *source_fd, const gchar *new_path, GtkWidget
  *
  *
  */
-#ifdef HAVE_GTK4
+#if HAVE_GTK4
 static void clipboard_get_func(GtkClipboard *clipboard, GtkSelectionData *selection_data, guint info, gpointer data)
 {
 /* @FIXME GTK4 stub */
index d9096ce..0a0ec6e 100644 (file)
 #ifndef UTILOPS_H
 #define UTILOPS_H
 
+#include <glib.h>
+#include <gtk/gtk.h>
+
 #include "typedefs.h"
-#include "ui-utildlg.h"
 
 struct FileData;
+struct FileDialog;
+struct GenericDialog;
 
 void file_maint_renamed(FileData *fd);
 void file_maint_moved(FileData *fd, GList *ignore_list);
index 170dbe0..5cf69f7 100644 (file)
 
 #include "view-dir-list.h"
 
-#include <config.h>
+#include <unistd.h>
+
+#include <cstdlib>
+#include <cstring>
+
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <glib-object.h>
 
 #include "filedata.h"
 #include "layout.h"
+#include "options.h"
+#include "typedefs.h"
 #include "ui-fileops.h"
 #include "ui-tree-edit.h"
 #include "view-dir.h"
index 03ae9ef..19ae58e 100644 (file)
@@ -22,6 +22,8 @@
 #ifndef VIEW_DIR_LIST_H
 #define VIEW_DIR_LIST_H
 
+#include <gdk/gdk.h>
+#include <glib.h>
 #include <gtk/gtk.h>
 
 struct FileData;
index 9bb762b..de7b133 100644 (file)
 
 #include "view-dir-tree.h"
 
-#include <config.h>
+#include <unistd.h>
+
+#include <cstdlib>
+#include <cstring>
+
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <glib-object.h>
 
 #include "debug.h"
 #include "filedata.h"
 #include "layout.h"
+#include "options.h"
+#include "typedefs.h"
 #include "ui-fileops.h"
 #include "ui-tree-edit.h"
 #include "view-dir.h"
index 755f9bd..f0bb149 100644 (file)
 #ifndef VIEW_DIR_TREE_H
 #define VIEW_DIR_TREE_H
 
+#include <ctime>
+
+#include <gdk/gdk.h>
+#include <glib.h>
 #include <gtk/gtk.h>
 
 struct FileData;
index afdd1b6..8d28126 100644 (file)
 
 #include "view-dir.h"
 
+#include <sys/stat.h>
+#include <unistd.h>
+
+#include <cstring>
+
+#include <glib-object.h>
+
 #include <config.h>
 
 #include "compat.h"
@@ -33,6 +40,7 @@
 #include "layout.h"
 #include "main-defines.h"
 #include "menu.h"
+#include "options.h"
 #include "ui-fileops.h"
 #include "ui-menu.h"
 #include "ui-misc.h"
@@ -1178,7 +1186,7 @@ static GdkRGBA *vd_color_shifted(GtkWidget *widget)
        static GdkRGBA color;
        static GtkWidget *done = nullptr;
 
-#ifdef HAVE_GTK4
+#if HAVE_GTK4
 /* @FIXME GTK4 no background color */
 #else
        if (done != widget)
index f6be5e5..f55dd3d 100644 (file)
@@ -21,6 +21,9 @@
 #ifndef VIEW_DIR_H
 #define VIEW_DIR_H
 
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <gdk/gdk.h>
+#include <glib.h>
 #include <gtk/gtk.h>
 
 #include "typedefs.h"
index 48fe5b4..4039434 100644 (file)
@@ -21,6 +21,9 @@
 #ifndef VIEW_FILE_H
 #define VIEW_FILE_H
 
+#include <ctime>
+
+#include <glib.h>
 #include <gtk/gtk.h>
 
 #include "typedefs.h"
index b22a646..b24b383 100644 (file)
 
 #include "view-file-icon.h"
 
-#include <config.h>
+#include <cstring>
+
+#include <glib-object.h>
 
 #include "cellrenderericon.h"
 #include "collect.h"
 #include "compat.h"
 #include "debug.h"
 #include "dnd.h"
+#include "filedata.h"
 #include "img-view.h"
 #include "intl.h"
 #include "layout-image.h"
index 96840cd..73d0615 100644 (file)
 #ifndef VIEW_FILE_VIEW_FILE_ICON_H
 #define VIEW_FILE_VIEW_FILE_ICON_H
 
+#include <gdk/gdk.h>
+#include <glib.h>
 #include <gtk/gtk.h>
 
-#include "filedata.h"
+#include "typedefs.h"
 
+struct FileData;
 struct ViewFile;
 
 gboolean vficon_press_key_cb(GtkWidget *widget, GdkEventKey *event, gpointer data);
index b802a3b..02b4ce4 100644 (file)
 
 #include "view-file-list.h"
 
-#include <config.h>
+#include <cstring>
+#include <vector>
+
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <glib-object.h>
 
 #include "collect.h"
 #include "debug.h"
 #include "dnd.h"
+#include "filedata.h"
 #include "img-view.h"
 #include "intl.h"
 #include "layout-image.h"
@@ -33,6 +38,7 @@
 #include "main-defines.h"
 #include "metadata.h"
 #include "misc.h"
+#include "options.h"
 #include "ui-fileops.h"
 #include "ui-misc.h"
 #include "ui-tree-edit.h"
@@ -40,8 +46,6 @@
 #include "utilops.h"
 #include "view-file.h"
 
-#include <vector>
-
 /* Index to tree store */
 enum {
        FILE_COLUMN_POINTER = 0,
index 990cce0..7039cfd 100644 (file)
 #ifndef VIEW_FILE_VIEW_FILE_LIST_H
 #define VIEW_FILE_VIEW_FILE_LIST_H
 
+#include <gdk/gdk.h>
+#include <glib.h>
 #include <gtk/gtk.h>
 
-#include "filedata.h"
+#include "typedefs.h"
 
+struct FileData;
 struct ViewFile;
 
 gboolean vflist_press_key_cb(GtkWidget *widget, GdkEventKey *event, gpointer data);
index 89b712c..9639c4d 100644 (file)
 
 #include "view-file.h"
 
-#include <config.h>
+#include <gdk/gdk.h>
+#include <glib-object.h>
 
 #include "compat.h"
 #include "debug.h"
 #include "dupe.h"
+#include "filedata.h"
 #include "history-list.h"
 #include "intl.h"
 #include "layout.h"
 #include "main.h"
 #include "menu.h"
 #include "misc.h"
-#include "pixbuf-util.h"
+#include "options.h"
 #include "thumb.h"
 #include "ui-fileops.h"
 #include "ui-menu.h"
 #include "ui-misc.h"
+#include "ui-utildlg.h"
 #include "utilops.h"
 #include "view-file/view-file-icon.h"
 #include "view-file/view-file-list.h"
index 62bc2ee..d248302 100644 (file)
 
 #include "window.h"
 
+#include <cstdio>
+#include <cstring>
+
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <gdk/gdk.h>
+#include <glib-object.h>
+
 #include <config.h>
 
 #include "debug.h"
@@ -39,7 +46,7 @@ GtkWidget *window_new(const gchar *role, const gchar *icon, const gchar *icon_fi
        gchar *title;
        GtkWidget *window;
 
-#ifdef HAVE_GTK4
+#if HAVE_GTK4
        window = gtk_window_new();
 #else
        window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
index d8ca5e9..5657c3d 100644 (file)
@@ -21,6 +21,7 @@
 #ifndef WINDOW_H
 #define WINDOW_H
 
+#include <glib.h>
 #include <gtk/gtk.h>
 
 GtkWidget *window_new(const gchar *role, const gchar *icon,