clang-tidy: use using
authorRosen Penev <rosenp@gmail.com>
Thu, 8 Jun 2023 20:44:33 +0000 (13:44 -0700)
committerColin Clark <colin.clark@cclark.uk>
Sun, 11 Jun 2023 09:19:46 +0000 (10:19 +0100)
Found with modernize-use-using

Signed-off-by: Rosen Penev <rosenp@gmail.com>
106 files changed:
src/advanced-exif.cc
src/bar-comment.cc
src/bar-exif.cc
src/bar-histogram.cc
src/bar-keywords.cc
src/bar-rating.cc
src/bar-sort.cc
src/bar.cc
src/bar.h
src/cache-loader.h
src/cache-maint.cc
src/cache.h
src/cellrenderericon.h
src/collect-io.cc
src/collect-io.h
src/collect-table.cc
src/color-man.h
src/desktop-file.cc
src/dupe.cc
src/dupe.h
src/editors.cc
src/editors.h
src/exif-int.h
src/exif.cc
src/exif.h
src/exiv2.cc
src/filecache.cc
src/filecache.h
src/filedata.cc
src/filedata.h
src/filefilter.h
src/format-canon.cc
src/format-fuji.cc
src/format-nikon.cc
src/format-olympus.cc
src/format-raw.cc
src/format-raw.h
src/fullscreen.h
src/history-list.cc
src/image-load-collection.cc
src/image-load-cr3.cc
src/image-load-dds.cc
src/image-load-external.cc
src/image-load-ffmpegthumbnailer.cc
src/image-load-jpeg.cc
src/image-load-psd.cc
src/image-load-zxscr.cc
src/image-load.cc
src/image-load.h
src/image-overlay.cc
src/image-overlay.h
src/img-view.cc
src/jpeg-parser.cc
src/jpeg-parser.h
src/layout-config.cc
src/layout-util.cc
src/layout.cc
src/logwindow.cc
src/logwindow.h
src/lua.cc
src/md5-util.h
src/metadata.cc
src/options.h
src/osd.cc
src/osd.h
src/pan-view/pan-folder.cc
src/pan-view/pan-item.h
src/pan-view/pan-types.h
src/pan-view/pan-util.h
src/pan-view/pan-view-filter.h
src/pixbuf-renderer.cc
src/pixbuf-renderer.h
src/pixbuf-util.cc
src/preferences.cc
src/print.cc
src/rcfile.h
src/remote.cc
src/remote.h
src/renderer-tiles.cc
src/search-and-run.cc
src/search.cc
src/shortcuts.cc
src/similar.h
src/thumb-standard.cc
src/thumb-standard.h
src/toolbar.cc
src/typedefs.h
src/ui-bookmark.cc
src/ui-fileops.cc
src/ui-misc.cc
src/ui-misc.h
src/ui-pathsel.cc
src/ui-spinner.cc
src/ui-tabcomp.cc
src/ui-tree-edit.cc
src/ui-tree-edit.h
src/ui-utildlg.cc
src/ui-utildlg.h
src/utilops.cc
src/view-dir-tree.cc
src/view-dir-tree.h
src/view-file/view-file-icon.cc
src/view-file/view-file-list.cc
src/view-file/view-file.cc
src/window.cc
src/zonedetect.h

index eeeb812..79a54b1 100644 (file)
@@ -39,8 +39,7 @@
  *-------------------------------------------------------------------
  */
 
-typedef struct _ExifWin ExifWin;
-struct _ExifWin
+struct ExifWin
 {
        GtkWidget *window;
        GtkWidget *vbox;
index dc9c1fb..0d1186b 100644 (file)
@@ -44,8 +44,7 @@ static void bar_pane_comment_changed(GtkTextBuffer *buffer, gpointer data);
 
 
 
-typedef struct _PaneCommentData PaneCommentData;
-struct _PaneCommentData
+struct PaneCommentData
 {
        PaneData pane;
        GtkWidget *widget;
index 29dbba6..433fa61 100644 (file)
  *-------------------------------------------------------------------
  */
 
-typedef struct _ExifEntry ExifEntry;
-typedef struct _PaneExifData PaneExifData;
+struct PaneExifData;
 
-struct _ExifEntry
+struct ExifEntry
 {
        GtkWidget *ebox;
        GtkWidget *box;
@@ -60,7 +59,7 @@ struct _ExifEntry
 };
 
 
-struct _PaneExifData
+struct PaneExifData
 {
        PaneData pane;
        GtkWidget *vbox;
@@ -75,8 +74,7 @@ struct _PaneExifData
        FileData *fd;
 };
 
-typedef struct _ConfDialogData ConfDialogData;
-struct _ConfDialogData
+struct ConfDialogData
 {
        GtkWidget *widget; /* pane or entry, devidet by presenceof "pane_data" or "entry_data" */
 
index c5bd586..439d7e2 100644 (file)
@@ -37,8 +37,7 @@
 
 
 
-typedef struct _PaneHistogramData PaneHistogramData;
-struct _PaneHistogramData
+struct PaneHistogramData
 {
        PaneData pane;
        GtkWidget *widget;
index b6c41b8..de535f5 100644 (file)
@@ -118,8 +118,7 @@ enum {
 
 static GType filter_keyword_column_types[] = {G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN};
 
-typedef struct _PaneKeywordsData PaneKeywordsData;
-struct _PaneKeywordsData
+struct PaneKeywordsData
 {
        PaneData pane;
        GtkWidget *widget;
@@ -143,8 +142,7 @@ struct _PaneKeywordsData
        GtkWidget *autocomplete;
 };
 
-typedef struct _ConfDialogData ConfDialogData;
-struct _ConfDialogData
+struct ConfDialogData
 {
        PaneKeywordsData *pkd;
        GtkTreePath *click_tpath;
index 6dbf5c1..c340010 100644 (file)
@@ -37,8 +37,7 @@
  * 1 to 5 Rating value
  */
 
-typedef struct _PaneRatingData PaneRatingData;
-struct _PaneRatingData
+struct PaneRatingData
 {
        PaneData pane;
        GtkWidget *widget;
index 9f72108..ca247ef 100644 (file)
@@ -43,8 +43,7 @@
   *-------------------------------------------------------------------
   */
 
-typedef struct _SortData SortData;
-struct _SortData
+struct SortData
 {
        GtkWidget *vbox;
        GtkWidget *bookmarks;
@@ -773,10 +772,10 @@ GtkWidget *bar_sort_new_from_config(LayoutWindow *lw, const gchar **UNUSED(attri
 
 /**
  * @brief Sets the bar_sort_enabled flag
- * @param lw 
- * @param attribute_names 
- * @param attribute_values 
- * 
+ * @param lw
+ * @param attribute_names
+ * @param attribute_values
+ *
  * Called from rcfile when processing geeqierc.xml on start-up.
  * It is necessary to set the bar_sort_enabled flag because
  * the sort manager and desktop files are set up in the idle loop, and
index 45d45ea..eeab790 100644 (file)
@@ -29,8 +29,7 @@
 #include "ui-menu.h"
 #include "ui-misc.h"
 
-typedef struct _KnownPanes KnownPanes;
-struct _KnownPanes
+struct KnownPanes
 {
        PaneType type;
        const gchar *id;
@@ -205,8 +204,7 @@ static const KnownPanes known_panes[] = {
        {PANE_UNDEF,            nullptr,                nullptr,                        nullptr}
 };
 
-typedef struct _BarData BarData;
-struct _BarData
+struct BarData
 {
        GtkWidget *widget;
        GtkWidget *vbox;
index 551eac4..8e612d0 100644 (file)
--- a/src/bar.h
+++ b/src/bar.h
@@ -22,7 +22,7 @@
 #ifndef BAR_H
 #define BAR_H
 
-typedef enum {
+enum PaneType {
        PANE_UNDEF = 0,
        PANE_COMMENT,
        PANE_EXIF,
@@ -30,11 +30,9 @@ typedef enum {
        PANE_KEYWORDS,
        PANE_GPS,
        PANE_RATING
-} PaneType;
-
-typedef struct _PaneData PaneData;
+};
 
-struct _PaneData {
+struct PaneData {
        void (*pane_set_fd)(GtkWidget *pane, FileData *fd); /**< filled in by pane */
        void (*pane_notify_selection)(GtkWidget *pane, gint count); /**< filled in by pane */
        gint (*pane_event)(GtkWidget *pane, GdkEvent *event); /**< filled in by pane */
index 3d87630..e800350 100644 (file)
 #include "image-load.h"
 
 
-typedef struct _CacheLoader CacheLoader;
+struct CacheLoader;
 
-typedef void (* CacheLoaderDoneFunc)(CacheLoader *cl, gint error, gpointer data);
+using CacheLoaderDoneFunc = void (*)(CacheLoader *, gint, gpointer);
 
 
-typedef enum {
-       CACHE_LOADER_NONE       = 0,
-       CACHE_LOADER_DIMENSIONS = 1 << 0,
-       CACHE_LOADER_DATE       = 1 << 1,
-       CACHE_LOADER_MD5SUM     = 1 << 2,
-       CACHE_LOADER_SIMILARITY = 1 << 3
-} CacheDataType;
+enum CacheDataType {
+       CACHE_LOADER_NONE       = 0,
+       CACHE_LOADER_DIMENSIONS = 1 << 0,
+       CACHE_LOADER_DATE       = 1 << 1,
+       CACHE_LOADER_MD5SUM     = 1 << 2,
+       CACHE_LOADER_SIMILARITY = 1 << 3
+};
 
-struct _CacheLoader {
+struct CacheLoader {
        FileData *fd;
        CacheData *cd;
 
index 1fa9c65..6326bd0 100644 (file)
@@ -36,8 +36,7 @@
 #include "window.h"
 
 
-typedef struct _CMData CMData;
-struct _CMData
+struct CMData
 {
        GList *list;
        GList *done_list;
@@ -419,8 +418,8 @@ void cache_maintain_home(gboolean metadata, gboolean clear, GtkWidget *parent)
  * @param metadata TRUE - work on metadata cache, FALSE - work on thumbnail cache
  * @param clear TRUE - clear cache, FALSE - delete orphaned cached items
  * @param func Function called when idle loop function terminates
- * 
- * 
+ *
+ *
  */
 void cache_maintain_home_remote(gboolean metadata, gboolean clear, GDestroyNotify *func)
 {
@@ -604,8 +603,7 @@ void cache_notify_cb(FileData *fd, NotifyType type, gpointer UNUSED(data))
  *-------------------------------------------------------------------
  */
 
-typedef struct _CacheManager CacheManager;
-struct _CacheManager
+struct CacheManager
 {
        GenericDialog *dialog;
        GtkWidget *folder_entry;
@@ -617,8 +615,7 @@ struct _CacheManager
        gint count_done;
 };
 
-typedef struct _CacheOpsData CacheOpsData;
-struct _CacheOpsData
+struct CacheOpsData
 {
        GenericDialog *gd;
        ThumbLoaderStd *tl;
@@ -940,11 +937,11 @@ static void cache_manager_render_dialog(GtkWidget *widget, const gchar *path)
 /**
  * @brief Create thumbnails
  * @param path Path to image folder
- * @param recurse 
+ * @param recurse
  * @param local Create thumbnails in same folder as images
  * @param func Function called when idle loop function terminates
- * 
- * 
+ *
+ *
  */
 void cache_manager_render_remote(const gchar *path, gboolean recurse, gboolean local, GDestroyNotify *func)
 {
@@ -1392,10 +1389,10 @@ static void cache_manager_sim_start_sim_remote(CacheOpsData *cd, const gchar *us
 /**
  * @brief Generate .sim files
  * @param path Path to image folder
- * @param recurse 
+ * @param recurse
  * @param func Function called when idle loop function terminates
- * 
- * 
+ *
+ *
  */
 void cache_manager_sim_remote(const gchar *path, gboolean recurse, GDestroyNotify *func)
 {
index 005733d..bb15231 100644 (file)
 #define GQ_CACHE_EXT_XMP_METADATA   ".gq.xmp"
 
 
-typedef enum {
+enum CacheType {
        CACHE_TYPE_THUMB,
        CACHE_TYPE_SIM,
        CACHE_TYPE_METADATA,
        CACHE_TYPE_XMP_METADATA
-} CacheType;
+};
 
-typedef struct _CacheData CacheData;
-struct _CacheData
+struct CacheData
 {
        gchar *path;
        gint width;
index 71ad610..e93abe4 100644 (file)
 #define GQV_IS_CELL_RENDERER_ICON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GQV_TYPE_CELL_RENDERER_ICON))
 #define GQV_CELL_RENDERER_ICON_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), GQV_TYPE_CELL_RENDERER_ICON, GQvCellRendererIconClass))
 
-typedef struct _GQvCellRendererIcon GQvCellRendererIcon;
-typedef struct _GQvCellRendererIconClass GQvCellRendererIconClass;
-
-struct _GQvCellRendererIcon
+struct GQvCellRendererIcon
 {
        GtkCellRenderer parent;
 
@@ -61,7 +58,7 @@ struct _GQvCellRendererIcon
 
 };
 
-struct _GQvCellRendererIconClass
+struct GQvCellRendererIconClass
 {
        GtkCellRendererClass parent_class;
 
index b996f94..e2dcc9e 100644 (file)
@@ -35,7 +35,7 @@
 #define GQ_COLLECTION_FAIL_PERCENT 98
 #define GQ_COLLECTION_READ_BUFSIZE 4096
 
-typedef struct _CollectManagerEntry CollectManagerEntry;
+struct CollectManagerEntry;
 
 static void collection_load_thumb_step(CollectionData *cd);
 static gboolean collection_save_private(CollectionData *cd, const gchar *path);
@@ -476,7 +476,7 @@ gboolean collection_load_only_geometry(CollectionData *cd, const gchar *path)
 #define COLLECT_MANAGER_ACTIONS_PER_IDLE 1000
 #define COLLECT_MANAGER_FLUSH_DELAY      10000
 
-struct _CollectManagerEntry
+struct CollectManagerEntry
 {
        gchar *path;
        GList *add_list;
@@ -485,14 +485,13 @@ struct _CollectManagerEntry
        gboolean empty;
 };
 
-typedef enum {
+enum CollectManagerType {
        COLLECTION_MANAGER_UPDATE,
        COLLECTION_MANAGER_ADD,
        COLLECTION_MANAGER_REMOVE
-} CollectManagerType;
+};
 
-typedef struct _CollectManagerAction CollectManagerAction;
-struct _CollectManagerAction
+struct CollectManagerAction
 {
        gchar *oldpath;
        gchar *newpath;
index 8bf5158..b4017de 100644 (file)
 #ifndef COLLECT_IO_H
 #define COLLECT_IO_H
 
-typedef enum {
+enum CollectionLoadFlags {
        COLLECTION_LOAD_NONE    = 0,
        COLLECTION_LOAD_APPEND  = 1 << 0,
        COLLECTION_LOAD_FLUSH   = 1 << 1,
        COLLECTION_LOAD_GEOMETRY= 1 << 2,
-} CollectionLoadFlags;
+};
 
 gboolean collection_load(CollectionData *cd, const gchar *path, CollectionLoadFlags flags);
 
index 0bdc636..99def0d 100644 (file)
@@ -2471,8 +2471,7 @@ static void collection_table_dnd_init(CollectTable *ct)
  *-----------------------------------------------------------------------------
  */
 
-typedef struct _ColumnData ColumnData;
-struct _ColumnData
+struct ColumnData
 {
        CollectTable *ct;
        gint number;
index 22d5161..ec369a0 100644 (file)
 #ifndef COLOR_MAN_H
 #define COLOR_MAN_H
 
-typedef enum {
+enum ColorManProfileType {
        COLOR_PROFILE_NONE = -1,
        COLOR_PROFILE_MEM = -2,
        COLOR_PROFILE_SRGB = 0,
        COLOR_PROFILE_ADOBERGB,
        COLOR_PROFILE_FILE,
-} ColorManProfileType;
+};
 
-typedef enum {
+enum ColorManReturnType {
        COLOR_RETURN_SUCCESS = 0,
        COLOR_RETURN_ERROR,
        COLOR_RETURN_IMAGE_CHANGED
-} ColorManReturnType;
+};
 
-typedef struct _ColorMan ColorMan;
-typedef void (* ColorManDoneFunc)(ColorMan *cm, ColorManReturnType success, gpointer data);
+struct ColorMan;
+using ColorManDoneFunc = void (*)(ColorMan *, ColorManReturnType, gpointer);
 
 
-struct _ColorMan {
+struct ColorMan {
        ImageWindow *imd;
        GdkPixbuf *pixbuf;
        gint incremental_sync;
index 0fa34a5..256d736 100644 (file)
@@ -35,8 +35,7 @@
 
 
 
-typedef struct _EditorWindow EditorWindow;
-struct _EditorWindow
+struct EditorWindow
 {
        GtkWidget *window;
        GtkWidget *entry;
@@ -46,8 +45,7 @@ struct _EditorWindow
        gboolean modified;
 };
 
-typedef struct _EditorListWindow EditorListWindow;
-struct _EditorListWindow
+struct EditorListWindow
 {
        GtkWidget *window;
        GtkWidget *view;
@@ -56,8 +54,7 @@ struct _EditorListWindow
        GtkWidget *edit_button;
 };
 
-typedef struct _EditorWindowDel_Data EditorWindowDel_Data;
-struct _EditorWindowDel_Data
+struct EditorWindowDel_Data
 {
        EditorListWindow *ewl;
        gchar *path;
index d513fc7..647df3e 100644 (file)
@@ -70,17 +70,16 @@ enum {
        DUPE_COLUMN_COUNT       /**< total columns */
 };
 
-typedef enum {
+enum DUPE_CHECK_RESULT {
        DUPE_MATCH = 0,
        DUPE_NO_MATCH,
        DUPE_NAME_MATCH
-} DUPE_CHECK_RESULT;
+};
 
-typedef struct _DupeQueueItem DupeQueueItem;
 /** Used for similarity checks. One for each item pushed
  * onto the thread pool.
  */
-struct _DupeQueueItem
+struct DupeQueueItem
 {
        DupeItem *needle;
        DupeWindow *dw;
@@ -88,10 +87,9 @@ struct _DupeQueueItem
        gint index; /**< The order items pushed onto thread pool. Used to sort returned matches */
 };
 
-typedef struct _DupeSearchMatch DupeSearchMatch;
 /** Used for similarity checks thread. One for each pair match found.
  */
-struct _DupeSearchMatch
+struct DupeSearchMatch
 {
        DupeItem *a; /**< \a a / \a b matched pair found */
        DupeItem *b; /**< \a a / \a b matched pair found */
@@ -4859,10 +4857,10 @@ DupeWindow *dupe_window_new()
  *-------------------------------------------------------------------
  */
 
-typedef struct {
+struct CDupeConfirmD {
        DupeWindow *dw;
        GList *list;
-} CDupeConfirmD;
+};
 
 static void confirm_dir_list_cancel(GtkWidget *UNUSED(widget), gpointer UNUSED(data))
 {
@@ -5187,13 +5185,12 @@ static void delete_finished_cb(gboolean success, const gchar *UNUSED(dest_path),
  *-------------------------------------------------------------------
  */
 
- typedef enum {
+enum SeparatorType {
        EXPORT_CSV = 0,
        EXPORT_TSV
-} SeparatorType;
+};
 
-typedef struct _ExportDupesData ExportDupesData;
-struct _ExportDupesData
+struct ExportDupesData
 {
        FileDialog *dialog;
        SeparatorType separator;
index d60d00b..f29bf93 100644 (file)
@@ -27,7 +27,7 @@
 /** @typedef DupeMatchType
  *  match methods
  */
-typedef enum
+enum DupeMatchType
 {
        DUPE_MATCH_NONE = 0,
        DUPE_MATCH_NAME = 1 << 0,
@@ -44,17 +44,16 @@ typedef enum
        DUPE_MATCH_NAME_CONTENT = 1 << 11,      /**< same name, but different content */
        DUPE_MATCH_NAME_CI_CONTENT = 1 << 12,   /**< same name - case insensitive, but different content */
        DUPE_MATCH_ALL = 1 << 13 /**< N.B. this is used as a clamp value in rcfile.cc */
-} DupeMatchType;
+};
 
-typedef enum
+enum DupeSelectType
 {
        DUPE_SELECT_NONE,
        DUPE_SELECT_GROUP1,
        DUPE_SELECT_GROUP2
-} DupeSelectType;
+};
 
-typedef struct _DupeItem DupeItem;
-struct _DupeItem
+struct DupeItem
 {
        CollectionData *collection;     /**< NULL if from #DupeWindow->files */
        CollectInfo *info;
@@ -76,15 +75,13 @@ struct _DupeItem
        gint second;
 };
 
-typedef struct _DupeMatch DupeMatch;
-struct _DupeMatch
+struct DupeMatch
 {
        DupeItem *di;
        gdouble rank;
 };
 
-typedef struct _DupeWindow DupeWindow;
-struct _DupeWindow
+struct DupeWindow
 {
        GList *list;    /**< one entry for each dropped file in 1st set window (#DupeItem) */
        GList *dupes;                   /**< list of dupes (#DupeItem, grouping the #DupeMatch-es) */
index 8c6ab77..0503d2d 100644 (file)
@@ -34,8 +34,7 @@
 
 
 
-typedef struct _EditorVerboseData EditorVerboseData;
-struct _EditorVerboseData {
+struct EditorVerboseData {
        GenericDialog *gd;
        GtkWidget *button_close;
        GtkWidget *button_stop;
@@ -44,8 +43,7 @@ struct _EditorVerboseData {
        GtkWidget *spinner;
 };
 
-typedef struct _EditorData EditorData;
-struct _EditorData {
+struct EditorData {
        EditorFlags flags;
        GPid pid;
        GList *list;
@@ -696,11 +694,11 @@ static gboolean editor_verbose_io_cb(GIOChannel *source, GIOCondition condition,
        return TRUE;
 }
 
-typedef enum {
+enum PathType {
        PATH_FILE,
        PATH_FILE_URL,
        PATH_DEST
-} PathType;
+};
 
 
 static gchar *editor_command_path_parse(const FileData *fd, gboolean consider_sidecars, PathType type, const EditorDescription *editor)
index 1d7b58b..85519dd 100644 (file)
@@ -23,7 +23,7 @@
 #define EDITORS_H
 
 
-typedef enum {
+enum EditorFlags {
        EDITOR_KEEP_FS            = 0x00000001,
        EDITOR_VERBOSE            = 0x00000002,
        EDITOR_VERBOSE_MULTI      = 0x00000004,
@@ -43,7 +43,7 @@ typedef enum {
        EDITOR_ERROR_SKIPPED      = 0x00800000,
        /**< mask to match errors only */
        EDITOR_ERROR_MASK         = ~0xffff,
-} EditorFlags;
+};
 
 struct _EditorDescription {
        gchar *key;             /**< desktop file name, not including path, including extension */
@@ -110,7 +110,7 @@ GList *editor_list_get(void);
  * @param list - list of processed #FileData structures, typically single file or whole list passed to start_editor_* @n
  * @param data - generic pointer
 */
-typedef gint (*EditorCallback) (gpointer ed, EditorFlags flags, GList *list, gpointer data);
+using EditorCallback = gint (*)(gpointer, EditorFlags, GList *, gpointer);
 
 
 void editor_resume(gpointer ed);
index 38f4725..bd0b114 100644 (file)
  *-----------------------------------------------------------------------------
  */
 
-typedef enum {
+enum ExifByteOrder {
        EXIF_BYTE_ORDER_INTEL,
        EXIF_BYTE_ORDER_MOTOROLA
-} ExifByteOrder;
+};
 
-typedef struct _ExifFormatAttrib ExifFormatAttrib;
-struct _ExifFormatAttrib
+struct ExifFormatAttrib
 {
        ExifFormatType type;
        guint size;
@@ -53,28 +52,20 @@ extern ExifFormatAttrib ExifFormatList[]; /**< the list of known tag data format
  *-----------------------------------------------------------------------------
  */
 
-typedef struct _ExifMarker ExifMarker;
-typedef struct _ExifTextList ExifTextList;
-
-struct _ExifData
+struct ExifData
 {
        gchar *path;
        GList *items;   /**< list of (ExifItem *) */
        GList *current; /**< for exif_get_next_item */
 };
 
-
-struct _ExifItem
+struct ExifTextList
 {
-       ExifFormatType format;
-       guint tag;
-       const ExifMarker *marker;
-       guint elements;
-       gpointer data;
-       guint data_len;
+       gint value;
+       const gchar *description;
 };
 
-struct _ExifMarker
+struct ExifMarker
 {
        guint           tag;
        ExifFormatType  format;
@@ -84,14 +75,18 @@ struct _ExifMarker
        ExifTextList    *list;
 };
 
-#define EXIF_MARKER_LIST_END { 0x0000, EXIF_FORMAT_UNKNOWN, 0, NULL, NULL, NULL }
-
-struct _ExifTextList
+struct ExifItem
 {
-       gint value;
-       const gchar *description;
+       ExifFormatType format;
+       guint tag;
+       const ExifMarker *marker;
+       guint elements;
+       gpointer data;
+       guint data_len;
 };
 
+#define EXIF_MARKER_LIST_END { 0x0000, EXIF_FORMAT_UNKNOWN, 0, NULL, NULL, NULL }
+
 #define EXIF_TEXT_LIST_END { -1, NULL }
 
 
index 72eb389..8708ff5 100644 (file)
@@ -1630,8 +1630,7 @@ GList *exif_get_metadata(ExifData *exif, const gchar *key, MetadataFormat format
        return g_list_append(NULL, str);
 }
 
-typedef struct _UnmapData UnmapData;
-struct _UnmapData
+struct UnmapData
 {
        guchar *ptr;
        guchar *map_data;
@@ -1717,7 +1716,7 @@ void exif_init(void)
 {
 }
 #else
-typedef int dummy_variable;
+using dummy_variable = int;
 #endif
 /* not HAVE_EXIV2 */
 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
index b23d2fa..9132921 100644 (file)
@@ -33,7 +33,7 @@
 
 #define EXIF_FORMAT_COUNT 13
 
-typedef enum {
+enum ExifFormatType {
        EXIF_FORMAT_UNKNOWN             = 0,
        EXIF_FORMAT_BYTE_UNSIGNED       = 1,
        EXIF_FORMAT_STRING              = 2,
@@ -47,7 +47,7 @@ typedef enum {
        EXIF_FORMAT_RATIONAL            = 10,
        EXIF_FORMAT_FLOAT               = 11,
        EXIF_FORMAT_DOUBLE              = 12
-} ExifFormatType;
+};
 
 
 /*
@@ -56,10 +56,9 @@ typedef enum {
  *-----------------------------------------------------------------------------
  */
 
-typedef struct _ExifItem ExifItem;
+struct ExifItem;
 
-typedef struct _ExifRational ExifRational;
-struct _ExifRational
+struct ExifRational
 {
        guint32 num;
        guint32 den;
@@ -68,7 +67,7 @@ struct _ExifRational
 
 /* enums useful for image manipulation */
 
-typedef enum {
+enum ExifOrientationType {
        EXIF_ORIENTATION_UNKNOWN        = 0,
        EXIF_ORIENTATION_TOP_LEFT       = 1,
        EXIF_ORIENTATION_TOP_RIGHT      = 2,
@@ -78,17 +77,16 @@ typedef enum {
        EXIF_ORIENTATION_RIGHT_TOP      = 6,
        EXIF_ORIENTATION_RIGHT_BOTTOM   = 7,
        EXIF_ORIENTATION_LEFT_BOTTOM    = 8
-} ExifOrientationType;
+};
 
-typedef enum {
+enum ExifUnitType {
        EXIF_UNIT_UNKNOWN       = 0,
        EXIF_UNIT_NOUNIT        = 1,
        EXIF_UNIT_INCH          = 2,
        EXIF_UNIT_CENTIMETER    = 3
-} ExifUnitType;
+};
 
-typedef struct _ExifFormattedText ExifFormattedText;
-struct _ExifFormattedText
+struct ExifFormattedText
 {
        const gchar *key;
        const gchar *description;
index bea8db0..fa7425c 100644 (file)
@@ -67,9 +67,7 @@
 #define AutoPtr UniquePtr
 #endif
 
-typedef struct _AltKey AltKey;
-
-struct _AltKey
+struct AltKey
 {
        const gchar *xmp_key;
        const gchar *exif_key;
@@ -115,7 +113,7 @@ static void _debug_exception(const char* file,
 
 #define debug_exception(e) _debug_exception(__FILE__, __LINE__, __func__, e)
 
-struct _ExifData
+struct ExifData
 {
        Exiv2::ExifData::const_iterator exifIter; /* for exif_get_next_item */
        Exiv2::IptcData::const_iterator iptcIter; /* for exif_get_next_item */
@@ -123,7 +121,7 @@ struct _ExifData
        Exiv2::XmpData::const_iterator xmpIter; /* for exif_get_next_item */
 #endif
 
-       virtual ~_ExifData() = default;
+       virtual ~ExifData() = default;
 
        virtual void writeMetadata(gchar *UNUSED(path) = nullptr)
        {
@@ -155,7 +153,7 @@ struct _ExifData
 };
 
 // This allows read-only access to the original metadata
-struct _ExifDataOriginal : public _ExifData
+struct ExifDataOriginal : public ExifData
 {
 protected:
        Exiv2::Image::AutoPtr image_;
@@ -173,7 +171,7 @@ protected:
 #endif
 
 public:
-       _ExifDataOriginal(Exiv2::Image::AutoPtr image)
+       ExifDataOriginal(Exiv2::Image::AutoPtr image)
        {
                cp_data_ = nullptr;
                cp_length_ = 0;
@@ -181,7 +179,7 @@ public:
                valid_ = TRUE;
        }
 
-       _ExifDataOriginal(gchar *path)
+       ExifDataOriginal(gchar *path)
        {
                cp_data_ = nullptr;
                cp_length_ = 0;
@@ -226,7 +224,7 @@ public:
                        }
        }
 
-       ~_ExifDataOriginal() override
+       ~ExifDataOriginal() override
        {
                if (cp_data_) g_free(cp_data_);
                if (pathl_) g_free(pathl_);
@@ -294,11 +292,11 @@ public:
 static void _ExifDataProcessed_update_xmp(gpointer key, gpointer value, gpointer data);
 
 // This allows read-write access to the metadata
-struct _ExifDataProcessed : public _ExifData
+struct ExifDataProcessed : public ExifData
 {
 protected:
-       std::unique_ptr<_ExifDataOriginal> imageData_;
-       std::unique_ptr<_ExifDataOriginal> sidecarData_;
+       std::unique_ptr<ExifDataOriginal> imageData_;
+       std::unique_ptr<ExifDataOriginal> sidecarData_;
 
        Exiv2::ExifData exifData_;
        Exiv2::IptcData iptcData_;
@@ -307,14 +305,14 @@ protected:
 #endif
 
 public:
-       _ExifDataProcessed(gchar *path, gchar *sidecar_path, GHashTable *modified_xmp)
+       ExifDataProcessed(gchar *path, gchar *sidecar_path, GHashTable *modified_xmp)
        {
-               imageData_ = std::make_unique<_ExifDataOriginal>(path);
+               imageData_ = std::make_unique<ExifDataOriginal>(path);
                sidecarData_ = nullptr;
 #if EXIV2_TEST_VERSION(0,16,0)
                if (sidecar_path)
                        {
-                       sidecarData_ = std::make_unique<_ExifDataOriginal>(sidecar_path);
+                       sidecarData_ = std::make_unique<ExifDataOriginal>(sidecar_path);
                        xmpData_ = sidecarData_->xmpData();
                        }
                else
@@ -467,7 +465,7 @@ ExifData *exif_read(gchar *path, gchar *sidecar_path, GHashTable *modified_xmp)
 {
        DEBUG_1("exif read %s, sidecar: %s", path, sidecar_path ? sidecar_path : "-");
        try {
-               return new _ExifDataProcessed(path, sidecar_path, modified_xmp);
+               return new ExifDataProcessed(path, sidecar_path, modified_xmp);
        }
        catch (Exiv2::AnyError& e) {
                debug_exception(e);
@@ -505,7 +503,7 @@ gboolean exif_write_sidecar(ExifData *exif, gchar *path)
 void exif_free(ExifData *exif)
 {
        if (!exif) return;
-       g_assert(dynamic_cast<_ExifDataProcessed *>(exif)); // this should not be called on ExifDataOriginal
+       g_assert(dynamic_cast<ExifDataProcessed *>(exif)); // this should not be called on ExifDataOriginal
        delete exif;
 }
 
@@ -1281,8 +1279,7 @@ class RawFile {
        unsigned long offset;
 };
 
-typedef struct _UnmapData UnmapData;
-struct _UnmapData
+struct UnmapData
 {
        guchar *ptr;
        guchar *map_data;
index 30a27c8..1644561 100644 (file)
@@ -33,8 +33,7 @@ struct _FileCacheData {
        gulong size;
 };
 
-typedef struct _FileCacheEntry FileCacheEntry;
-struct _FileCacheEntry {
+struct FileCacheEntry {
        FileData *fd;
        gulong size;
 };
index 8358a2b..572f24b 100644 (file)
@@ -24,8 +24,8 @@
 #include "main.h"
 #include "filedata.h"
 
-typedef struct _FileCacheData FileCacheData;
-typedef void (*FileCacheReleaseFunc)(FileData *fd);
+using FileCacheData = struct _FileCacheData;
+using FileCacheReleaseFunc = void (*)(FileData *);
 
 
 FileCacheData *file_cache_new(FileCacheReleaseFunc release, gulong max_size);
index 52d348a..8aff93d 100644 (file)
@@ -3152,17 +3152,13 @@ GList *file_data_process_groups_in_selection(GList *list, gboolean ungroup, GLis
    implementation in view-file-list.cc */
 
 
-typedef struct _NotifyIdleData NotifyIdleData;
-
-struct _NotifyIdleData {
+struct NotifyIdleData {
        FileData *fd;
        NotifyType type;
 };
 
 
-typedef struct _NotifyData NotifyData;
-
-struct _NotifyData {
+struct NotifyData {
        FileDataNotifyFunc func;
        gpointer data;
        NotifyPriority priority;
index 49a1476..11c665f 100644 (file)
@@ -97,8 +97,8 @@ GList *filelist_sort_path(GList *list);
 GList *filelist_recursive(FileData *dir_fd);
 GList *filelist_recursive_full(FileData *dir_fd, SortType method, gboolean ascend);
 
-typedef gboolean (* FileDataGetMarkFunc)(FileData *fd, gint n, gpointer data);
-typedef gboolean (* FileDataSetMarkFunc)(FileData *fd, gint n, gboolean value, gpointer data);
+using FileDataGetMarkFunc = gboolean (*)(FileData *, gint, gpointer);
+using FileDataSetMarkFunc = gboolean (*)(FileData *, gint, gboolean, gpointer);
 gboolean file_data_register_mark_func(gint n, FileDataGetMarkFunc get_mark_func, FileDataSetMarkFunc set_mark_func, gpointer data, GDestroyNotify notify);
 void file_data_get_registered_mark_func(gint n, FileDataGetMarkFunc *get_mark_func, FileDataSetMarkFunc *set_mark_func, gpointer *data);
 
@@ -168,7 +168,7 @@ void file_data_sc_free_ci_list(GList *fd_list);
 GList *file_data_process_groups_in_selection(GList *list, gboolean ungroup, GList **ungrouped);
 
 
-typedef void (*FileDataNotifyFunc)(FileData *fd, NotifyType type, gpointer data);
+using FileDataNotifyFunc = void (*)(FileData *, NotifyType, gpointer);
 gboolean file_data_register_notify_func(FileDataNotifyFunc func, gpointer data, NotifyPriority priority);
 gboolean file_data_unregister_notify_func(FileDataNotifyFunc func, gpointer data);
 void file_data_send_notification(FileData *fd, NotifyType type);
index 8395957..ec4b5ac 100644 (file)
@@ -23,8 +23,7 @@
 #define FILEFILTER_H
 
 
-typedef struct _FilterEntry FilterEntry;
-struct _FilterEntry {
+struct FilterEntry {
        gchar *key;
        gchar *description;
        gchar *extensions;
index 57b7173..7b69462 100644 (file)
@@ -529,7 +529,7 @@ gboolean format_canon_makernote(ExifData *exif, guchar *tiff, guint offset,
 }
 
 #else
-typedef int dummy_variable;
+using dummy_variable = int;
 #endif
 /* not HAVE_EXIV2 */
 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
index 4ede9b7..f654db0 100644 (file)
@@ -202,7 +202,7 @@ gboolean format_fuji_makernote(ExifData *exif, guchar *tiff, guint offset,
        return TRUE;
 }
 #else
-typedef int dummy_variable;
+using dummy_variable = int;
 #endif
 /* not HAVE_EXIV2 */
 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
index a39b08e..851a772 100644 (file)
@@ -432,7 +432,7 @@ gboolean format_nikon_makernote(ExifData *exif, guchar *tiff, guint offset,
 }
 
 #else
-typedef int dummy_variable;
+using dummy_variable = int;
 #endif
 /* not HAVE_EXIV2 */
 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
index d9b0139..da4af22 100644 (file)
@@ -381,7 +381,7 @@ gboolean format_olympus_makernote(ExifData *exif, guchar *tiff, guint offset,
 }
 
 #else
-typedef int dummy_variable;
+using dummy_variable = int;
 #endif
 /* not HAVE_EXIV2 */
 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
index a902432..66570b0 100644 (file)
@@ -569,7 +569,7 @@ gboolean format_debug_tiff_raw(guchar *data, const guint len,
 }
 #endif
 #else
-typedef int dummy_variable;
+using dummy_variable = int;
 #endif
 /* not HAVE_EXIV2 */
 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
index a1300bc..1635acc 100644 (file)
 #include "exif-int.h"
 
 
-typedef enum {
+enum FormatRawMatchType {
        FORMAT_RAW_MATCH_MAGIC,
        FORMAT_RAW_MATCH_TIFF_MAKE
-} FormatRawMatchType;
+};
 
-typedef enum {
+enum FormatRawExifType {
        FORMAT_RAW_EXIF_NONE,
        FORMAT_RAW_EXIF_TIFF,
        FORMAT_RAW_EXIF_JPEG,
        FORMAT_RAW_EXIF_IFD_II,
        FORMAT_RAW_EXIF_IFD_MM,
        FORMAT_RAW_EXIF_PROPRIETARY
-} FormatRawExifType;
+};
 
 typedef gboolean (* FormatRawParseFunc)(guchar *data, const guint len,
                                        guint *image_offset, guint *exif_offset);
@@ -55,10 +55,10 @@ FormatRawExifType format_raw_exif_offset(guchar *data, const guint len, guint *e
                                         FormatRawExifParseFunc *exif_parse_func);
 
 
-typedef enum {
+enum FormatExifMatchType {
        FORMAT_EXIF_MATCH_MAKE,
        FORMAT_EXIF_MATCH_MAKERNOTE
-} FormatExifMatchType;
+};
 
 typedef gint (* FormatExifParseFunc)(ExifData *exif, guchar *tiff, guint offset,
                                     guint size, ExifByteOrder bo);
index fa3be26..55ca94f 100644 (file)
@@ -38,8 +38,7 @@ void fullscreen_stop(FullScreenData *fs);
  * 102  screen 0, monitor 1 \n
  * 201  screen 1, monitor 0 \n
  */
-typedef struct _ScreenData ScreenData;
-struct _ScreenData {
+struct ScreenData {
        gint number;
        gchar *description;
        gint x;
index df4f530..bd3517d 100644 (file)
@@ -34,7 +34,7 @@ static void update_recent_viewed_folder_image_list(const gchar *path);
  * Pressing the Back and Forward buttons moves along the chain, but does
  * not make additions to the chain.
  * The chain always increases and is deleted at the end of the session
- * 
+ *
  *-----------------------------------------------------------------------------
  */
 
@@ -64,7 +64,7 @@ const gchar *history_chain_forward()
 /**
  * @brief Appends a path to the history chain
  * @param path Path selected
- * 
+ *
  * Each time the user selects a new path it is appended to the chain
  * except when it is identical to the current last entry
  * The pointer is always moved to the end of the chain
@@ -109,7 +109,7 @@ void history_chain_append_end(const gchar *path)
  * Pressing the Image Back and Image Forward buttons moves along the chain,
  * but does not make additions to the chain.
  * The chain always increases and is deleted at the end of the session
- * 
+ *
  *-----------------------------------------------------------------------------
  */
 static GList *image_chain = nullptr;
@@ -137,7 +137,7 @@ const gchar *image_chain_forward()
 /**
  * @brief Appends a path to the image history chain
  * @param path Image path selected
- * 
+ *
  * Each time the user selects a new image it is appended to the chain
  * except when it is identical to the current last entry
  * The pointer is always moved to the end of the chain
@@ -184,8 +184,7 @@ void image_chain_append_end(const gchar *path)
  *-----------------------------------------------------------------------------
  */
 
-typedef struct _HistoryData HistoryData;
-struct _HistoryData
+struct HistoryData
 {
        gchar *key;
        GList *list;
index c114215..30f0c24 100644 (file)
@@ -26,8 +26,7 @@
 #include "misc.h"
 #include "ui-fileops.h"
 
-typedef struct _ImageLoaderCOLLECTION ImageLoaderCOLLECTION;
-struct _ImageLoaderCOLLECTION {
+struct ImageLoaderCOLLECTION {
        ImageLoaderBackendCbAreaUpdated area_updated_cb;
        ImageLoaderBackendCbSize size_cb;
        ImageLoaderBackendCbAreaPrepared area_prepared_cb;
index 4bc65b9..14be327 100644 (file)
@@ -33,8 +33,7 @@
 #include <jpeglib.h>
 #include <jerror.h>
 
-typedef struct _ImageLoaderJpeg ImageLoaderJpeg;
-struct _ImageLoaderJpeg {
+struct ImageLoaderJpeg {
        ImageLoaderBackendCbAreaUpdated area_updated_cb;
        ImageLoaderBackendCbSize size_cb;
        ImageLoaderBackendCbAreaPrepared area_prepared_cb;
index 288448f..17ebc5a 100644 (file)
@@ -29,8 +29,7 @@
 #include "image-load.h"
 #include "image-load-dds.h"
 
-typedef struct _ImageLoaderDDS ImageLoaderDDS;
-struct _ImageLoaderDDS {
+struct ImageLoaderDDS {
        ImageLoaderBackendCbAreaUpdated area_updated_cb;
        ImageLoaderBackendCbSize size_cb;
        ImageLoaderBackendCbAreaPrepared area_prepared_cb;
index 03c6f06..256cbbc 100644 (file)
@@ -26,8 +26,7 @@
 #include "misc.h"
 #include "ui-fileops.h"
 
-typedef struct _ImageLoaderExternal ImageLoaderExternal;
-struct _ImageLoaderExternal {
+struct ImageLoaderExternal {
        ImageLoaderBackendCbAreaUpdated area_updated_cb;
        ImageLoaderBackendCbSize size_cb;
        ImageLoaderBackendCbAreaPrepared area_prepared_cb;
index 453a8ca..aa2f873 100644 (file)
@@ -26,8 +26,7 @@
 #ifdef HAVE_FFMPEGTHUMBNAILER
 #include <libffmpegthumbnailer/videothumbnailerc.h>
 
-typedef struct _ImageLoaderFT ImageLoaderFT;
-struct _ImageLoaderFT {
+struct ImageLoaderFT {
        ImageLoaderBackendCbAreaUpdated area_updated_cb;
        ImageLoaderBackendCbSize size_cb;
        ImageLoaderBackendCbAreaPrepared area_prepared_cb;
index d82c498..b446cbd 100644 (file)
@@ -36,8 +36,7 @@
 #include <jpeglib.h>
 #include <jerror.h>
 
-typedef struct _ImageLoaderJpeg ImageLoaderJpeg;
-struct _ImageLoaderJpeg {
+struct ImageLoaderJpeg {
        ImageLoaderBackendCbAreaUpdated area_updated_cb;
        ImageLoaderBackendCbSize size_cb;
        ImageLoaderBackendCbAreaPrepared area_prepared_cb;
index 5b4b0e0..64ff97d 100644 (file)
@@ -53,8 +53,7 @@
 #include "image-load.h"
 #include "image-load-psd.h"
 
-typedef struct _ImageLoaderPSD ImageLoaderPSD;
-struct _ImageLoaderPSD {
+struct ImageLoaderPSD {
        ImageLoaderBackendCbAreaUpdated area_updated_cb;
        ImageLoaderBackendCbSize size_cb;
        ImageLoaderBackendCbAreaPrepared area_prepared_cb;
@@ -65,7 +64,7 @@ struct _ImageLoaderPSD {
        gboolean abort;
 };
 
-typedef struct
+struct PsdHeader
 {
        guchar  signature[4];  /* file ID, always "8BPS" */
        guint16 version;       /* version number, always 1 */
@@ -75,11 +74,11 @@ typedef struct
        guint32 columns;       /* width of image in pixels (1-30000) */
        guint16 depth;         /* number of bits per channel (1, 8, 16 or 32) */
        guint16 color_mode;    /* color mode as defined below */
-} PsdHeader;
+};
 
 #define PSD_HEADER_SIZE 26
 
-typedef enum
+enum PsdColorMode
 {
        PSD_MODE_MONO = 0,
        PSD_MODE_GRAYSCALE = 1,
@@ -89,15 +88,15 @@ typedef enum
        PSD_MODE_MULTICHANNEL = 7,
        PSD_MODE_DUOTONE = 8,
        PSD_MODE_LAB = 9,
-} PsdColorMode;
+};
 
-typedef enum
+enum PsdCompressionType
 {
        PSD_COMPRESSION_NONE = 0,
        PSD_COMPRESSION_RLE = 1
-} PsdCompressionType;
+};
 
-typedef enum
+enum PsdReadState
 {
        PSD_STATE_HEADER,
        PSD_STATE_COLOR_MODE_BLOCK,
@@ -107,9 +106,9 @@ typedef enum
        PSD_STATE_LINES_LENGTHS,
        PSD_STATE_CHANNEL_DATA,
        PSD_STATE_DONE
-} PsdReadState;
+};
 
-typedef struct
+struct PsdContext
 {
        PsdReadState       state;
 
@@ -135,7 +134,7 @@ typedef struct
        guint              pos;
        guint16*           lines_lengths;
        gboolean           finalized;
-} PsdContext;
+};
 
 
 static guint16
index af838ef..bc6ab93 100644 (file)
@@ -23,8 +23,7 @@
 #include "image-load.h"
 #include "image-load-zxscr.h"
 
-typedef struct _ImageLoaderZXSCR ImageLoaderZXSCR;
-struct _ImageLoaderZXSCR {
+struct ImageLoaderZXSCR {
        ImageLoaderBackendCbAreaUpdated area_updated_cb;
        ImageLoaderBackendCbSize size_cb;
        ImageLoaderBackendCbAreaPrepared area_prepared_cb;
index 7f743ec..2695c93 100644 (file)
@@ -268,8 +268,7 @@ ImageLoader *image_loader_new(FileData *fd)
 /**************************************************************************************/
 /* send signals via idle calbacks - the callback are executed in the main thread */
 
-typedef struct _ImageLoaderAreaParam ImageLoaderAreaParam;
-struct _ImageLoaderAreaParam {
+struct ImageLoaderAreaParam {
        ImageLoader *il;
        guint x;
        guint y;
index 4c00583..9304578 100644 (file)
 
 #define TYPE_IMAGE_LOADER              (image_loader_get_type())
 
-typedef void (*ImageLoaderBackendCbAreaPrepared)(gpointer loader, gpointer data);
-typedef void (*ImageLoaderBackendCbSize)(gpointer loader, gint width, gint height, gpointer data);
-typedef void (*ImageLoaderBackendCbAreaUpdated)(gpointer loader, guint x, guint y, guint w, guint h, gpointer data);
-
-typedef gpointer (*ImageLoaderBackendFuncLoaderNew)(ImageLoaderBackendCbAreaUpdated, ImageLoaderBackendCbSize, ImageLoaderBackendCbAreaPrepared, gpointer data);
-typedef void (*ImageLoaderBackendFuncSetSize)(gpointer loader, int width, int height);
-typedef gboolean (*ImageLoaderBackendFuncLoad)(gpointer loader, const guchar *buf, gsize count, GError **error); /* optional, load whole image at once */
-typedef gboolean (*ImageLoaderBackendFuncWrite)(gpointer loader, const guchar *buf, gsize count, GError **error);
-typedef GdkPixbuf* (*ImageLoaderBackendFuncGetPixbuf)(gpointer loader);
-typedef gboolean (*ImageLoaderBackendFuncClose)(gpointer loader, GError **error);
-typedef void (*ImageLoaderBackendFuncAbort)(gpointer loader);
-typedef void (*ImageLoaderBackendFuncFree)(gpointer loader);
-typedef gchar* (*ImageLoaderBackendFuncGetFormatName)(gpointer loader);
-typedef gchar** (*ImageLoaderBackendFuncGetFormatMimeTypes)(gpointer loader);
-typedef void (*ImageLoaderBackendFuncSetPageNum)(gpointer loader, gint page_num);
-typedef gint (*ImageLoaderBackendFuncGetPageTotal)(gpointer loader);
-
-typedef struct _ImageLoaderBackend ImageLoaderBackend;
+using ImageLoaderBackendCbAreaPrepared = void (*)(gpointer, gpointer);
+using ImageLoaderBackendCbSize = void (*)(gpointer, gint, gint, gpointer);
+using ImageLoaderBackendCbAreaUpdated = void (*)(gpointer, guint, guint, guint, guint, gpointer);
+
+using ImageLoaderBackendFuncLoaderNew = gpointer (*)(ImageLoaderBackendCbAreaUpdated, ImageLoaderBackendCbSize, ImageLoaderBackendCbAreaPrepared, gpointer);
+using ImageLoaderBackendFuncSetSize = void (*)(gpointer, int, int);
+using ImageLoaderBackendFuncLoad = gboolean (*)(gpointer, const guchar *, gsize, GError **); /* optional, load whole image at once */
+using ImageLoaderBackendFuncWrite = gboolean (*)(gpointer, const guchar *, gsize, GError **);
+using ImageLoaderBackendFuncGetPixbuf = GdkPixbuf *(*)(gpointer);
+using ImageLoaderBackendFuncClose = gboolean (*)(gpointer, GError **);
+using ImageLoaderBackendFuncAbort = void (*)(gpointer);
+using ImageLoaderBackendFuncFree = void (*)(gpointer);
+using ImageLoaderBackendFuncGetFormatName = gchar *(*)(gpointer);
+using ImageLoaderBackendFuncGetFormatMimeTypes = gchar **(*)(gpointer);
+using ImageLoaderBackendFuncSetPageNum = void (*)(gpointer, gint);
+using ImageLoaderBackendFuncGetPageTotal = gint (*)(gpointer);
+
+using ImageLoaderBackend = struct _ImageLoaderBackend;
 struct _ImageLoaderBackend
 {
        ImageLoaderBackendFuncLoaderNew loader_new;
@@ -58,15 +58,15 @@ struct _ImageLoaderBackend
        ImageLoaderBackendFuncGetPageTotal get_page_total;
 };
 
-typedef enum {
+enum ImageLoaderPreview {
        IMAGE_LOADER_PREVIEW_NONE = 0,
        IMAGE_LOADER_PREVIEW_EXIF = 1,
        IMAGE_LOADER_PREVIEW_LIBRAW = 2
-} ImageLoaderPreview;
+};
 
 
 //typedef struct _ImageLoader ImageLoader;
-typedef struct _ImageLoaderClass ImageLoaderClass;
+using ImageLoaderClass = struct _ImageLoaderClass;
 
 struct _ImageLoader
 {
index 3892b75..f729483 100644 (file)
@@ -40,8 +40,7 @@
  */
 
 
-typedef struct _OverlayStateData OverlayStateData;
-struct _OverlayStateData {
+struct OverlayStateData {
        ImageWindow *imd;
        ImageState changed_states;
        NotifyType notify;
@@ -65,8 +64,7 @@ struct _OverlayStateData {
 };
 
 
-typedef struct _OSDIcon OSDIcon;
-struct _OSDIcon {
+struct OSDIcon {
        gboolean reset; /* reset on new image */
        gint x;         /* x, y offset */
        gint y;
index ae72dca..d0ea12b 100644 (file)
@@ -22,7 +22,7 @@
 #ifndef IMAGE_OVERLAY_H
 #define IMAGE_OVERLAY_H
 
-typedef enum {
+enum ImageOSDFlag {
        IMAGE_OSD_NONE = 0,
        IMAGE_OSD_ROTATE_USER,
        IMAGE_OSD_ROTATE_AUTO,
@@ -31,14 +31,14 @@ typedef enum {
        IMAGE_OSD_LAST,
        IMAGE_OSD_ICON,
        IMAGE_OSD_COUNT
-} ImageOSDFlag;
+};
 
-typedef enum {
+enum OsdShowFlags {
        OSD_SHOW_NOTHING        = 0,
        OSD_SHOW_INFO           = 1 << 0,
        OSD_SHOW_STATUS         = 1 << 1,
        OSD_SHOW_HISTOGRAM      = 1 << 2
-} OsdShowFlags;
+};
 
 void set_image_overlay_template_string(gchar **template_string, const gchar *value);
 void set_default_image_overlay_template_string(gchar **template_string);
index 7c5f547..dfeb643 100644 (file)
@@ -43,8 +43,7 @@
 #include "utilops.h"
 #include "window.h"
 
-typedef struct _ViewWindow ViewWindow;
-struct _ViewWindow
+struct ViewWindow
 {
        GtkWidget *window;
        ImageWindow *imd;
@@ -1488,10 +1487,10 @@ static GtkWidget *view_popup_menu(ViewWindow *vw)
  *-------------------------------------------------------------------
  */
 
-typedef struct {
+struct CViewConfirmD {
        ViewWindow *vw;
        GList *list;
-} CViewConfirmD;
+};
 
 static void view_dir_list_cancel(GtkWidget *UNUSED(widget), gpointer UNUSED(data))
 {
index 48d7506..ee1e1b2 100644 (file)
@@ -60,10 +60,10 @@ gboolean jpeg_segment_find(const guchar *data, guint size,
 }
 
 
-typedef enum {
+enum TiffByteOrder {
        TIFF_BYTE_ORDER_INTEL,
        TIFF_BYTE_ORDER_MOTOROLA
-} TiffByteOrder;
+};
 
 #define TIFF_TIFD_OFFSET_TAG 0
 #define TIFF_TIFD_OFFSET_FORMAT 2
@@ -157,9 +157,7 @@ gint tiff_directory_offset(const guchar *data, const guint len,
        return (*offset < len);
 }
 
-typedef gint (* FuncParseIFDEntry)(const guchar *tiff, guint offset,
-                                guint size, TiffByteOrder bo,
-                                gpointer data);
+using FuncParseIFDEntry = gint (*)(const guchar *, guint, guint, TiffByteOrder, gpointer);
 
 
 gint tiff_parse_IFD_table(const guchar *tiff, guint offset,
index 68181c0..dc29019 100644 (file)
@@ -45,10 +45,7 @@ gboolean jpeg_segment_find(const guchar *data, guint size,
                            guint *seg_offset, guint *seg_length);
 
 
-typedef struct _MPOData MPOData;
-typedef struct _MPOEntry MPOEntry;
-
-struct _MPOEntry {
+struct MPOEntry {
        guint type_code;
        gboolean representative;
        gboolean dependent_child;
@@ -73,11 +70,10 @@ struct _MPOEntry {
        double YawAngle;
        double PitchAngle;
        double RollAngle;
-
 };
 
 
-struct _MPOData {
+struct MPOData {
         guint mpo_offset;
 
        guint version;
index f8b80ff..20bce29 100644 (file)
@@ -31,14 +31,12 @@ enum {
 };
 
 
-typedef struct _LayoutStyle LayoutStyle;
-struct _LayoutStyle
+struct LayoutStyle
 {
        LayoutLocation a, b, c;
 };
 
-typedef struct _LayoutConfig LayoutConfig;
-struct _LayoutConfig
+struct LayoutConfig
 {
        GtkWidget *box;
 
index 21f4abc..dea7ec8 100644 (file)
@@ -1965,16 +1965,14 @@ void layout_recent_add_path(const gchar *path)
  * window layout menu
  *-----------------------------------------------------------------------------
  */
-typedef struct _WindowNames WindowNames;
-struct _WindowNames
+struct WindowNames
 {
        gboolean displayed;
        gchar *name;
        gchar *path;
 };
 
-typedef struct _RenameWindow RenameWindow;
-struct _RenameWindow
+struct RenameWindow
 {
        GenericDialog *gd;
        LayoutWindow *lw;
@@ -1983,8 +1981,7 @@ struct _RenameWindow
        GtkWidget *window_name_entry;
 };
 
-typedef struct _DeleteWindow DeleteWindow;
-struct _DeleteWindow
+struct DeleteWindow
 {
        GenericDialog *gd;
        LayoutWindow *lw;
index 8578468..5f53337 100644 (file)
@@ -1945,7 +1945,7 @@ void layout_style_set(LayoutWindow *lw, gint style, const gchar *order)
                {
                if (lw->menu_bar) gtk_container_remove(GTK_CONTAINER(gtk_widget_get_parent(lw->menu_bar)), lw->menu_bar);
                        for (i = 0; i < TOOLBAR_COUNT; i++)
-                               if (lw->toolbar[i]) gtk_container_remove(GTK_CONTAINER(gtk_widget_get_parent(lw->toolbar[i])), lw->toolbar[i]); 
+                               if (lw->toolbar[i]) gtk_container_remove(GTK_CONTAINER(gtk_widget_get_parent(lw->toolbar[i])), lw->toolbar[i]);
                }
 
        /* clear it all */
@@ -2147,8 +2147,7 @@ void layout_info_pixel_set(LayoutWindow *lw, gboolean show)
 #define CONFIG_WINDOW_DEF_WIDTH                600
 #define CONFIG_WINDOW_DEF_HEIGHT       400
 
-typedef struct _LayoutConfig LayoutConfig;
-struct _LayoutConfig
+struct LayoutConfig
 {
        LayoutWindow *lw;
 
index 372bbf3..1a783a1 100644 (file)
@@ -25,9 +25,7 @@
 #include "ui-misc.h"
 #include "window.h"
 
-typedef struct _LogWindow LogWindow;
-
-struct _LogWindow
+struct LogWindow
 {
        GtkWidget *window;
        GtkWidget *scrolledwin;
@@ -45,10 +43,10 @@ struct _LogWindow
        gboolean highlight_all;
 };
 
-typedef enum {
+enum LogWindowSearchDirection {
        LOGWINDOW_SEARCH_BACKWARDS,
        LOGWINDOW_SEARCH_FORWARDS
-} LogWindowSearchDirection;
+};
 
 static LogWindow *logwindow = nullptr;
 
@@ -74,17 +72,17 @@ static gboolean iter_char_search_cb(gunichar ch, gpointer data)
 
 /**
  * @brief Handle escape and F1 keys
- * @param UNUSED 
- * @param event 
- * @param logwin 
- * @returns 
- * 
+ * @param UNUSED
+ * @param event
+ * @param logwin
+ * @returns
+ *
  * If escape key pressed, hide log window. \n
  * If no text selected, form a selection bounded by space characters or
  * start and end of line. \n
  * If F1 pressed, execute command line program: \n
  * <options->log_window.action> <selected text>
- * 
+ *
 */
 static gboolean key_pressed(GtkWidget *UNUSED(widget), GdkEventKey *event, LogWindow *logwin)
 {
@@ -604,9 +602,7 @@ void log_window_new(LayoutWindow *lw)
        log_window_show(logwindow);
 }
 
-typedef struct _LogMsg LogMsg;
-
-struct _LogMsg {
+struct LogMsg {
        gchar *text;
        LogType type;
 };
index a29cd7b..1dd5681 100644 (file)
 #ifndef LOGWINDOW_H
 #define LOGWINDOW_H
 
-typedef enum
+enum LogType
 {
        LOG_NORMAL = 0,
        LOG_MSG,
        LOG_WARN,
        LOG_ERROR,
        LOG_COUNT
-} LogType;
+};
 
 void log_window_new(LayoutWindow *lw);
 
index 26a9003..c3abcd9 100644 (file)
@@ -426,6 +426,6 @@ gchar *lua_callvalue(FileData *fd, const gchar *file, const gchar *function)
        return data;
 }
 #else
-typedef int dummy_variable;
+using dummy_variable = int;
 #endif
 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
index 9f1d858..924bcb0 100644 (file)
 #include <glib.h>
 
 
-typedef struct _MD5Context {
+struct MD5Context {
        guint32 buf[4];
        guint32 bits[2];
        guchar in[64];
        gint doByteReverse;
-} MD5Context;
+};
 
 
 /* raw routines */
index f4653b8..88912bb 100644 (file)
 #include "layout-util.h"
 #include "rcfile.h"
 
-typedef enum {
+enum MetadataKey {
        MK_NONE,
        MK_KEYWORDS,
        MK_COMMENT
-} MetadataKey;
+};
 
 /* If contents change, keep GuideOptionsMetadata.xml up to date */
 /**
index 60003ef..1bb1934 100644 (file)
@@ -21,9 +21,7 @@
 #ifndef OPTIONS_H
 #define OPTIONS_H
 
-typedef struct _ConfOptions ConfOptions;
-
-struct _ConfOptions
+struct ConfOptions
 {
        /* ui */
        gboolean progressive_key_scrolling;
index cb7181d..568abbf 100644 (file)
@@ -84,8 +84,7 @@ static GtkTargetEntry osd_drag_types[] = {
        { const_cast<gchar *>("text/plain"), GTK_TARGET_SAME_APP, TARGET_TEXT_PLAIN }
 };
 
-typedef struct _TagData TagData;
-struct _TagData
+struct TagData
 {
        gchar *key;
        gchar *title;
index 249e8e6..980a70e 100644 (file)
--- a/src/osd.h
+++ b/src/osd.h
 #ifndef OSD_H
 #define OSD_H
 
-typedef enum {
+enum OsdTemplateFlags {
        OSDT_NONE       = 0,
        OSDT_FREE       = 1 << 0,
        OSDT_NO_DUP     = 1 << 1
-} OsdTemplateFlags;
+};
 
 GtkWidget *osd_new(gint max_cols, GtkWidget *template_view);
 gchar *image_osd_mkinfo(const gchar *str, FileData *fd, GHashTable *vars);
index c1f2d6b..3a8de9b 100644 (file)
@@ -85,8 +85,7 @@ static void pan_flower_size(PanWindow *pw, gint *width, gint *height)
        if (height) *height = y2 - y1;
 }
 
-typedef struct _FlowerGroup FlowerGroup;
-struct _FlowerGroup {
+struct FlowerGroup {
        GList *items;
        GList *children;
        gint x;
index 2b72f0b..5621bff 100644 (file)
@@ -81,8 +81,7 @@ gint pan_item_image_draw(PanWindow *pw, PanItem *pi, GdkPixbuf *pixbuf, PixbufRe
                         gint x, gint y, gint width, gint height);
 
 // Alignment
-typedef struct _PanTextAlignment PanTextAlignment;
-struct _PanTextAlignment {
+struct PanTextAlignment {
        PanWindow *pw;
 
        GList *column1;
index 8f6f7e2..ef3be75 100644 (file)
 
 
 
-typedef enum {
+enum PanLayoutType {
        PAN_LAYOUT_TIMELINE = 0,
        PAN_LAYOUT_CALENDAR,
        PAN_LAYOUT_FOLDERS_LINEAR,
        PAN_LAYOUT_FOLDERS_FLOWER,
        PAN_LAYOUT_GRID,
        PAN_LAYOUT_COUNT
-} PanLayoutType;
+};
 
-typedef enum {
+enum PanImageSize {
        PAN_IMAGE_SIZE_THUMB_DOTS = 0,
        PAN_IMAGE_SIZE_THUMB_NONE,
        PAN_IMAGE_SIZE_THUMB_SMALL,
@@ -104,31 +104,31 @@ typedef enum {
        PAN_IMAGE_SIZE_50,
        PAN_IMAGE_SIZE_100,
        PAN_IMAGE_SIZE_COUNT
-} PanImageSize;
+};
 
-typedef enum {
+enum PanItemType {
        PAN_ITEM_NONE,
        PAN_ITEM_THUMB,
        PAN_ITEM_BOX,
        PAN_ITEM_TRIANGLE,
        PAN_ITEM_TEXT,
        PAN_ITEM_IMAGE
-} PanItemType;
+};
 
-typedef enum {
+enum PanTextAttrType {
        PAN_TEXT_ATTR_NONE = 0,
        PAN_TEXT_ATTR_BOLD = 1 << 0,
        PAN_TEXT_ATTR_HEADING = 1 << 1,
        PAN_TEXT_ATTR_MARKUP = 1 << 2
-} PanTextAttrType;
+};
 
-typedef enum {
+enum PanBorderType {
        PAN_BORDER_NONE = 0,
        PAN_BORDER_1 = 1 << 0,
        PAN_BORDER_2 = 1 << 1,
        PAN_BORDER_3 = 1 << 2,
        PAN_BORDER_4 = 1 << 3
-} PanBorderType;
+};
 
 #define PAN_BORDER_TOP         PAN_BORDER_1
 #define PAN_BORDER_RIGHT               PAN_BORDER_2
@@ -136,8 +136,7 @@ typedef enum {
 #define PAN_BORDER_LEFT                PAN_BORDER_4
 
 
-typedef struct _PanItem PanItem;
-struct _PanItem {
+struct PanItem {
        PanItemType type;
        gint x;
        gint y;
@@ -169,8 +168,7 @@ struct _PanItem {
        gboolean queued;
 };
 
-typedef struct _PanViewSearchUi PanViewSearchUi;
-struct _PanViewSearchUi
+struct PanViewSearchUi
 {
        GtkWidget *search_box;
        GtkWidget *search_entry;
@@ -183,10 +181,9 @@ struct _PanViewSearchUi
  * @typedef _PanViewFilterUi
  * Defined in pan-view-filter.h
  */
-typedef struct _PanViewFilterUi PanViewFilterUi;
+using PanViewFilterUi = struct _PanViewFilterUi;
 
-typedef struct _PanWindow PanWindow;
-struct _PanWindow
+struct PanWindow
 {
        GtkWidget *window;
        ImageWindow *imd;
@@ -241,8 +238,7 @@ struct _PanWindow
        gint idle_id;
 };
 
-typedef struct _PanGrid PanGrid;
-struct _PanGrid {
+struct PanGrid {
        gint x;
        gint y;
        gint w;
@@ -250,8 +246,7 @@ struct _PanGrid {
        GList *list;
 };
 
-typedef struct _PanCacheData PanCacheData;
-struct _PanCacheData {
+struct PanCacheData {
        FileData *fd;
        CacheData *cd;
 };
index b700c81..969df95 100644 (file)
 #include "main.h"
 #include "pan-types.h"
 
-typedef enum {
+enum PanDateLengthType {
        PAN_DATE_LENGTH_EXACT,
        PAN_DATE_LENGTH_HOUR,
        PAN_DATE_LENGTH_DAY,
        PAN_DATE_LENGTH_WEEK,
        PAN_DATE_LENGTH_MONTH,
        PAN_DATE_LENGTH_YEAR
-} PanDateLengthType;
+};
 
 gboolean pan_date_compare(time_t a, time_t b, PanDateLengthType length);
 gint pan_date_value(time_t d, PanDateLengthType length);
index e9f5f2a..bce3327 100644 (file)
 #include "main.h"
 #include "pan-types.h"
 
-typedef enum {
+enum PanViewFilterMode {
        PAN_VIEW_FILTER_REQUIRE,
        PAN_VIEW_FILTER_EXCLUDE,
        PAN_VIEW_FILTER_INCLUDE,
        PAN_VIEW_FILTER_GROUP
-} PanViewFilterMode;
+};
 
-typedef struct _PanViewFilterElement PanViewFilterElement;
-struct _PanViewFilterElement
+struct PanViewFilterElement
 {
        PanViewFilterMode mode;
        gchar *keyword;
        GRegex *kw_regex;
 };
 
-typedef struct _PanFilterCallbackState PanFilterCallbackState;
-struct _PanFilterCallbackState
+struct PanFilterCallbackState
 {
        PanWindow *pw;
        GList *filter_element;
index 5af1aec..a46b254 100644 (file)
@@ -39,7 +39,7 @@
 #include "pixbuf-util.h"
 #include "exif.h"
 #else
-typedef enum {
+enum ExifOrientationType {
        EXIF_ORIENTATION_UNKNOWN        = 0,
        EXIF_ORIENTATION_TOP_LEFT       = 1,
        EXIF_ORIENTATION_TOP_RIGHT      = 2,
@@ -49,7 +49,7 @@ typedef enum {
        EXIF_ORIENTATION_RIGHT_TOP      = 6,
        EXIF_ORIENTATION_RIGHT_BOTTOM   = 7,
        EXIF_ORIENTATION_LEFT_BOTTOM    = 8
-} ExifOrientationType;
+};
 #endif
 
 
@@ -103,14 +103,14 @@ enum {
        PROP_ENLARGEMENT_LIMIT_VALUE
 };
 
-typedef enum {
+enum PrZoomFlags {
        PR_ZOOM_NONE            = 0,
        PR_ZOOM_FORCE           = 1 << 0,
        PR_ZOOM_NEW             = 1 << 1,
        PR_ZOOM_CENTER          = 1 << 2,
        PR_ZOOM_INVALIDATE      = 1 << 3,
        PR_ZOOM_LAZY            = 1 << 4  /* wait with redraw for pixbuf_renderer_area_changed */
-} PrZoomFlags;
+};
 
 static guint signals[SIGNAL_COUNT] = { 0 };
 static GtkEventBoxClass *parent_class = nullptr;
index 136f1f0..a4a5c97 100644 (file)
 #define ROUND_DOWN(A,B) ((gint)(((A))/(B))*(B))
 
 
-typedef struct _RendererFuncs RendererFuncs;
+using RendererFuncs = struct _RendererFuncs;
 
-typedef struct _PixbufRenderer PixbufRenderer;
-typedef struct _PixbufRendererClass PixbufRendererClass;
+using PixbufRenderer = struct _PixbufRenderer;
+using PixbufRendererClass = struct _PixbufRendererClass;
 
 
-typedef gint (* PixbufRendererTileRequestFunc)(PixbufRenderer *pr, gint x, gint y,
-                                              gint width, gint height, GdkPixbuf *pixbuf, gpointer user_data);
-typedef void (* PixbufRendererTileDisposeFunc)(PixbufRenderer *pr, gint x, gint y,
-                                              gint width, gint height, GdkPixbuf *pixbuf, gpointer user_data);
+using PixbufRendererTileRequestFunc = gint (*)(PixbufRenderer *, gint, gint, gint, gint, GdkPixbuf *, gpointer);
+using PixbufRendererTileDisposeFunc = void (*)(PixbufRenderer *, gint, gint, gint, gint, GdkPixbuf *, gpointer);
 
-typedef void (* PixbufRendererPostProcessFunc)(PixbufRenderer *pr, GdkPixbuf **pixbuf, gint x, gint y,
-                                              gint width, gint height, gpointer user_data);
+using PixbufRendererPostProcessFunc = void (*)(PixbufRenderer *, GdkPixbuf **, gint, gint, gint, gint, gpointer);
 
-typedef enum {
+enum PixbufRendererScrollResetType {
        PR_SCROLL_RESET_TOPLEFT = 0,
        PR_SCROLL_RESET_CENTER,
        PR_SCROLL_RESET_NOCHANGE,
        PR_SCROLL_RESET_COUNT,
-} PixbufRendererScrollResetType;
+};
 
-typedef enum {
+enum ImageRenderType {
        TILE_RENDER_NONE = 0, /**< do nothing */
        TILE_RENDER_AREA, /**< render an area of the tile */
        TILE_RENDER_ALL /**< render the whole tile */
-} ImageRenderType;
+};
 
-typedef enum {
+enum OverlayRendererFlags {
        OVL_NORMAL      = 0,
        OVL_RELATIVE    = 1 << 0, /**< x,y coordinates are relative, negative values start bottom right */
        /* OVL_HIDE_ON_SCROLL = 1 << 1*/ /**< hide temporarily when scrolling (not yet implemented) */
-} OverlayRendererFlags;
+};
 
 struct _RendererFuncs
 {
@@ -379,7 +376,7 @@ void pixbuf_renderer_stereo_fixed_set(PixbufRenderer *pr, gint width, gint heigh
  * @struct _SourceTile
  * protected - for renderer use only
  */
-typedef struct _SourceTile SourceTile;
+using SourceTile = struct _SourceTile;
 struct _SourceTile
 {
        gint x;
index bab7ffb..3baac7d 100644 (file)
@@ -92,8 +92,7 @@ gboolean pixbuf_to_file_as_png(GdkPixbuf *pixbuf, const gchar *filename)
  *-----------------------------------------------------------------------------
  */
 
-typedef struct _PixbufInline PixbufInline;
-struct _PixbufInline
+struct PixbufInline
 {
        const gchar *key;
        const gchar *data;
index ee3cf72..89547b2 100644 (file)
@@ -73,8 +73,7 @@ static void image_overlay_set_text_colours();
 GtkWidget *keyword_text;
 static void config_tab_keywords_save();
 
-typedef struct _ThumbSize ThumbSize;
-struct _ThumbSize
+struct ThumbSize
 {
        gint w;
        gint h;
@@ -773,8 +772,7 @@ static void add_zoom_style_selection_menu(GtkWidget *table, gint column, gint ro
        gtk_widget_show(combo);
 }
 
-typedef struct _UseableMouseItems UseableMouseItems;
-struct _UseableMouseItems
+struct UseableMouseItems
 {
        const gchar *name; /* GtkActionEntry terminology */
        const gchar *label;
@@ -1941,8 +1939,7 @@ static void star_rating_rejected_test_cb(GtkWidget *widget, gpointer data)
 
 /* general options tab */
 static void timezone_database_install_cb(GtkWidget *widget, gpointer data);
-typedef struct _TZData TZData;
-struct _TZData
+struct TZData
 {
        GenericDialog *gd;
        GCancellable *cancellable;
@@ -2991,8 +2988,7 @@ static void config_tab_metadata(GtkWidget *notebook)
 
 /* keywords tab */
 
-typedef struct _KeywordFindData KeywordFindData;
-struct _KeywordFindData
+struct KeywordFindData
 {
        GenericDialog *gd;
 
index a3d3c4a..94c1483 100644 (file)
 #define PRINT_MAX_INTERP GDK_INTERP_BILINEAR
 
 /* reverse order is important */
-typedef enum {
+enum TextPosition {
        FOOTER_2,
        FOOTER_1,
        HEADER_2,
        HEADER_1
-} TextPosition;
+};
 
-typedef struct _PrintWindow PrintWindow;
-struct _PrintWindow
+struct PrintWindow
 {
        GtkWidget *vbox;
        GList *source_selection;
index 6aa8f60..e5d8574 100644 (file)
@@ -75,10 +75,10 @@ gboolean read_bool_option(const gchar *option, const gchar *label, const gchar *
 
 #define READ_DUMMY(_target_, _name_, _msg_) read_dummy_option(option, #_name_, _msg_)
 
-typedef struct _GQParserFuncData GQParserFuncData;
-typedef struct _GQParserData GQParserData;
-typedef        void (* GQParserStartFunc)(GQParserData *parser_data, GMarkupParseContext *context, const gchar *element_name, const gchar **attribute_names, const gchar **attribute_values, gpointer data, GError **error);
-typedef        void (* GQParserEndFunc)(GQParserData *parser_data, GMarkupParseContext *context, const gchar *element_name, gpointer data, GError **error);
+using GQParserFuncData = struct _GQParserFuncData;
+using GQParserData = struct _GQParserData;
+using GQParserStartFunc = void (*)(GQParserData *, GMarkupParseContext *, const gchar *, const gchar **, const gchar **, gpointer, GError **);
+using GQParserEndFunc = void (*)(GQParserData *, GMarkupParseContext *, const gchar *, gpointer, GError **);
 
 void options_parse_func_push(GQParserData *parser_data, GQParserStartFunc start_func, GQParserEndFunc end_func, gpointer data);
 void options_parse_func_pop(GQParserData *parser_data);
index 28609c9..5d6211e 100644 (file)
@@ -61,15 +61,13 @@ static void gr_raise(const gchar *text, GIOChannel *channel, gpointer data);
 
 static LayoutWindow *lw_id = nullptr; /* points to the window set by the --id option */
 
-typedef struct _RemoteClient RemoteClient;
-struct _RemoteClient {
+struct RemoteClient {
        gint fd;
        guint channel_id; /* event source id */
        RemoteConnection *rc;
 };
 
-typedef struct _RemoteData RemoteData;
-struct _RemoteData {
+struct RemoteData {
        CollectionData *command_collection;
        GList *file_list;
        gboolean single_dir;
@@ -1583,8 +1581,7 @@ static void gr_lua(const gchar *text, GIOChannel *channel, gpointer UNUSED(data)
 }
 #endif
 
-typedef struct _RemoteCommandEntry RemoteCommandEntry;
-struct _RemoteCommandEntry {
+struct RemoteCommandEntry {
        const gchar *opt_s;
        const gchar *opt_l;
        void (*func)(const gchar *text, GIOChannel *channel, gpointer data);
index b37799b..2f4114a 100644 (file)
 #define REMOTE_H
 
 
-typedef struct _RemoteConnection RemoteConnection;
+struct RemoteConnection;
 
-typedef void RemoteReadFunc(RemoteConnection *rc, const gchar *text, GIOChannel *channel, gpointer data);
+using RemoteReadFunc = void (RemoteConnection *, const gchar *, GIOChannel *, gpointer);
 
-struct _RemoteConnection {
+struct RemoteConnection {
        gint server;
        gint fd;
        gchar *path;
index b69217f..524352e 100644 (file)
@@ -37,7 +37,7 @@
 #include "pixbuf-util.h"
 #include "exif.h"
 #else
-typedef enum {
+enum ExifOrientationType {
        EXIF_ORIENTATION_UNKNOWN        = 0,
        EXIF_ORIENTATION_TOP_LEFT       = 1,
        EXIF_ORIENTATION_TOP_RIGHT      = 2,
@@ -47,13 +47,12 @@ typedef enum {
        EXIF_ORIENTATION_RIGHT_TOP      = 6,
        EXIF_ORIENTATION_RIGHT_BOTTOM   = 7,
        EXIF_ORIENTATION_LEFT_BOTTOM    = 8
-} ExifOrientationType;
+};
 #endif
 
-typedef struct _ImageTile ImageTile;
-typedef struct _QueueData QueueData;
+using QueueData = struct _QueueData;
 
-struct _ImageTile
+struct ImageTile
 {
        cairo_surface_t *surface;       /* off screen buffer */
        GdkPixbuf *pixbuf;      /* pixbuf area for zooming */
@@ -90,8 +89,7 @@ struct _QueueData
        gboolean new_data;
 };
 
-typedef struct _OverlayData OverlayData;
-struct _OverlayData
+struct OverlayData
 {
        gint id;
 
@@ -104,9 +102,7 @@ struct _OverlayData
        OverlayRendererFlags flags;
 };
 
-typedef struct _RendererTiles RendererTiles;
-
-struct _RendererTiles
+struct RendererTiles
 {
        RendererFuncs f;
        PixbufRenderer *pr;
@@ -1230,25 +1226,25 @@ static gboolean rt_source_tile_render(RendererTiles *rt, ImageTile *it,
 }
 
 /**
- * @brief 
- * @param has_alpha 
- * @param ignore_alpha 
- * @param src 
- * @param dest 
- * @param pb_x 
- * @param pb_y 
- * @param pb_w 
- * @param pb_h 
- * @param offset_x 
- * @param offset_y 
- * @param scale_x 
- * @param scale_y 
- * @param interp_type 
- * @param check_x 
- * @param check_y 
+ * @brief
+ * @param has_alpha
+ * @param ignore_alpha
+ * @param src
+ * @param dest
+ * @param pb_x
+ * @param pb_y
+ * @param pb_w
+ * @param pb_h
+ * @param offset_x
+ * @param offset_y
+ * @param scale_x
+ * @param scale_y
+ * @param interp_type
+ * @param check_x
+ * @param check_y
  * @param wide_image Used as a work-around for a GdkPixbuf problem. Set when image width is > 32767. Problem exhibited with gdk_pixbuf_copy_area() and GDK_INTERP_NEAREST. See #772 on GitHub Geeqie
- * 
- * 
+ *
+ *
  */
 static void rt_tile_get_region(gboolean has_alpha, gboolean ignore_alpha,
                                const GdkPixbuf *src, GdkPixbuf *dest,
@@ -2080,7 +2076,7 @@ static void renderer_update_zoom(void *renderer, gboolean lazy)
        rt_tile_invalidate_all(static_cast<RendererTiles *>(renderer));
        if (!lazy)
                {
-               renderer_redraw(static_cast<_RendererTiles *>(renderer), 0, 0, pr->width, pr->height, TRUE, TILE_RENDER_ALL, TRUE, FALSE);
+               renderer_redraw(static_cast<RendererTiles *>(renderer), 0, 0, pr->width, pr->height, TRUE, TILE_RENDER_ALL, TRUE, FALSE);
                }
        rt_border_clear(rt);
 }
index f13bdc2..613443d 100644 (file)
@@ -30,8 +30,7 @@ enum {
        SAR_COUNT
 };
 
-typedef struct _SarData SarData;
-struct _SarData
+struct SarData
 {
        GtkWidget *window;
        GtkWidget *vbox;
index 1bbe97d..917cc24 100644 (file)
@@ -60,7 +60,7 @@
 
 #define FORMAT_CLASS_BROKEN static_cast<FileFormatClass>(FILE_FORMAT_CLASSES + 1)
 
-typedef enum {
+enum MatchType {
        SEARCH_MATCH_NONE,
        SEARCH_MATCH_EQUAL,
        SEARCH_MATCH_CONTAINS,
@@ -73,7 +73,7 @@ typedef enum {
        SEARCH_MATCH_ALL,
        SEARCH_MATCH_ANY,
        SEARCH_MATCH_COLLECTION
-} MatchType;
+};
 
 enum {
        SEARCH_COLUMN_POINTER = 0,
@@ -87,8 +87,7 @@ enum {
        SEARCH_COLUMN_COUNT     /* total columns */
 };
 
-typedef struct _SearchData SearchData;
-struct _SearchData
+struct SearchData
 {
        GtkWidget *window;
 
@@ -245,8 +244,7 @@ struct _SearchData
 
 };
 
-typedef struct _MatchFileData MatchFileData;
-struct _MatchFileData
+struct MatchFileData
 {
        FileData *fd;
        gint width;
@@ -254,8 +252,7 @@ struct _MatchFileData
        gint rank;
 };
 
-typedef struct _MatchList MatchList;
-struct _MatchList
+struct MatchList
 {
        const gchar *text;
        const MatchType type;
index 0ef9ba4..0d95e6d 100644 (file)
@@ -29,8 +29,7 @@
 #include "ui-fileops.h"
 #include "ui-misc.h"
 
-typedef struct _ShortcutsData ShortcutsData;
-struct _ShortcutsData
+struct ShortcutsData
 {
        GtkWidget *vbox;
        GtkWidget *bookmarks;
index 617a8ed..e65ce5a 100644 (file)
@@ -23,8 +23,7 @@
 #define SIMILAR_H
 
 
-typedef struct _ImageSimilarityData ImageSimilarityData;
-struct _ImageSimilarityData
+struct ImageSimilarityData
 {
        guint8 avg_r[1024];
        guint8 avg_g[1024];
index fa0c5bd..1ce4ab8 100644 (file)
@@ -874,8 +874,7 @@ GdkPixbuf *thumb_loader_std_get_pixbuf(ThumbLoaderStd *tl)
 }
 
 
-typedef struct _ThumbValidate ThumbValidate;
-struct _ThumbValidate
+struct ThumbValidate
 {
        ThumbLoaderStd *tl;
        gchar *path;
@@ -1065,8 +1064,7 @@ void thumb_std_maint_removed(const gchar *source)
        g_free(uri);
 }
 
-typedef struct _TMaintMove TMaintMove;
-struct _TMaintMove
+struct TMaintMove
 {
        gchar *source;
        gchar *dest;
index b6741d7..3723dfb 100644 (file)
@@ -35,8 +35,8 @@
 #define THUMB_NAME_EXTENSION ".png"
 
 
-typedef struct _ThumbLoaderStd ThumbLoaderStd;
-typedef void (* ThumbLoaderStdFunc)(ThumbLoaderStd *tl, gpointer data);
+using ThumbLoaderStd = struct _ThumbLoaderStd;
+using ThumbLoaderStdFunc = void (*)(ThumbLoaderStd *, gpointer);
 
 struct _ThumbLoaderStd
 {
index 1ebf3e3..50300ef 100644 (file)
@@ -33,8 +33,7 @@
  * Called from the Preferences/toolbar tab
  **/
 
-typedef struct _ToolbarData ToolbarData;
-struct _ToolbarData
+struct ToolbarData
 {
        GtkWidget *widget;
        GtkWidget *vbox;
@@ -43,8 +42,7 @@ struct _ToolbarData
        LayoutWindow *lw;
 };
 
-typedef struct _ToolbarButtonData ToolbarButtonData;
-struct _ToolbarButtonData
+struct ToolbarButtonData
 {
        GtkWidget *button;
        GtkWidget *button_label;
@@ -56,8 +54,7 @@ struct _ToolbarButtonData
 
 static ToolbarData *toolbarlist[2];
 
-typedef struct _UseableToolbarItems UseableToolbarItems;
-struct _UseableToolbarItems
+struct UseableToolbarItems
 {
        const gchar *name; /* GtkActionEntry terminology */
        const gchar *label;
index 2494fa6..3c6879e 100644 (file)
 #ifndef TYPEDEFS_H
 #define TYPEDEFS_H
 
-typedef enum {
+enum ZoomMode {
        ZOOM_RESET_ORIGINAL     = 0,
        ZOOM_RESET_FIT_WINDOW   = 1,
        ZOOM_RESET_NONE         = 2
-} ZoomMode;
+};
 
-typedef enum {
+enum ZoomStyle {
        ZOOM_GEOMETRIC  = 0,
        ZOOM_ARITHMETIC = 1
-} ZoomStyle;
+};
 
-typedef enum {
+enum ClipboardDestination {
        CLIPBOARD_TEXT_PLAIN    = 0,
        CLIPBOARD_TEXT_URI_LIST = 1,
        CLIPBOARD_X_SPECIAL_GNOME_COPIED_FILES  = 2,
        CLIPBOARD_UTF8_STRING   = 3
-} ClipboardDestination;
+};
 
-typedef enum {
+enum ClipboardSelection {
        CLIPBOARD_PRIMARY       = 0,
        CLIPBOARD_CLIPBOARD = 1,
        CLIPBOARD_BOTH = 2
-} ClipboardSelection;
+};
 
-typedef enum {
+enum MouseButton {
        MOUSE_BUTTON_LEFT       = 1,
        MOUSE_BUTTON_MIDDLE     = 2,
        MOUSE_BUTTON_RIGHT      = 3,
@@ -54,21 +54,21 @@ typedef enum {
        MOUSE_BUTTON_WHEEL_DOWN = 5,
        MOUSE_BUTTON_8  = 8,
        MOUSE_BUTTON_9  = 9
-} MouseButton;
+};
 
-typedef enum {
+enum DirViewType {
        DIRVIEW_LIST,
        DIRVIEW_TREE,
 
        DIRVIEW_LAST = DIRVIEW_TREE /**< Keep this up to date! */
-} DirViewType;
+};
 
-typedef enum {
+enum FileViewType {
        FILEVIEW_LIST,
        FILEVIEW_ICON,
 
        FILEVIEW_LAST = FILEVIEW_ICON /**< Keep this up to date! */
-} FileViewType;
+};
 
 #define        CMD_COPY     "geeqie-copy-command.desktop"
 #define        CMD_MOVE     "geeqie-move-command.desktop"
@@ -76,7 +76,7 @@ typedef enum {
 #define        CMD_DELETE   "geeqie-delete-command.desktop"
 #define        CMD_FOLDER   "geeqie-folder-command.desktop"
 
-typedef enum {
+enum SortType {
        SORT_NONE,
        SORT_NAME,
        SORT_SIZE,
@@ -87,37 +87,37 @@ typedef enum {
        SORT_EXIFTIMEDIGITIZED,
        SORT_RATING,
        SORT_CLASS
-} SortType;
+};
 
 /**
  * @typedef DnDAction
  * drag and drop default action
  */
-typedef enum {
+enum DnDAction {
        DND_ACTION_ASK,
        DND_ACTION_COPY,
        DND_ACTION_MOVE
-} DnDAction;
+};
 
-typedef enum {
+enum AlterType {
        ALTER_NONE,             /**< do nothing */
        ALTER_ROTATE_90,
        ALTER_ROTATE_90_CC,     /**< counterclockwise */
        ALTER_ROTATE_180,
        ALTER_MIRROR,
        ALTER_FLIP,
-} AlterType;
+};
 
-typedef enum {
+enum LayoutLocation {
        LAYOUT_HIDE   = 0,
        LAYOUT_LEFT   = 1 << 0,
        LAYOUT_RIGHT  = 1 << 1,
        LAYOUT_TOP    = 1 << 2,
        LAYOUT_BOTTOM = 1 << 3
-} LayoutLocation;
+};
 
 
-typedef enum {
+enum ImageState {
        IMAGE_STATE_NONE        = 0,
        IMAGE_STATE_IMAGE       = 1 << 0,
        IMAGE_STATE_LOADING     = 1 << 1,
@@ -126,39 +126,39 @@ typedef enum {
        IMAGE_STATE_ROTATE_AUTO = 1 << 4,
        IMAGE_STATE_ROTATE_USER = 1 << 5,
        IMAGE_STATE_DELAY_FLIP  = 1 << 6
-} ImageState;
+};
 
-typedef enum {
+enum ImageSplitMode {
        SPLIT_NONE = 0,
        SPLIT_VERT,
        SPLIT_HOR,
        SPLIT_TRIPLE,
        SPLIT_QUAD,
-} ImageSplitMode;
+};
 
-typedef enum {
+enum FileDataChangeType {
        FILEDATA_CHANGE_DELETE,
        FILEDATA_CHANGE_MOVE,
        FILEDATA_CHANGE_RENAME,
        FILEDATA_CHANGE_COPY,
        FILEDATA_CHANGE_UNSPECIFIED,
        FILEDATA_CHANGE_WRITE_METADATA
-} FileDataChangeType;
+};
 
-typedef enum {
+enum MarkToSelectionMode {
        MTS_MODE_MINUS,
        MTS_MODE_SET,
        MTS_MODE_OR,
        MTS_MODE_AND
-} MarkToSelectionMode;
+};
 
-typedef enum {
+enum SelectionToMarkMode {
        STM_MODE_RESET,
        STM_MODE_SET,
        STM_MODE_TOGGLE
-} SelectionToMarkMode;
+};
 
-typedef enum {
+enum FileFormatClass {
        FORMAT_CLASS_UNKNOWN,
        FORMAT_CLASS_IMAGE,
        FORMAT_CLASS_RAWIMAGE,
@@ -168,7 +168,7 @@ typedef enum {
        FORMAT_CLASS_DOCUMENT,
        FORMAT_CLASS_ARCHIVE,
        FILE_FORMAT_CLASSES
-} FileFormatClass;
+};
 
 extern const gchar *format_class_list[]; /**< defined in preferences.cc */
 
@@ -176,7 +176,7 @@ extern const gchar *format_class_list[]; /**< defined in preferences.cc */
  * @typedef SecureSaveErrno
  * see err field in #SecureSaveInfo
  */
-typedef enum {
+enum SecureSaveErrno {
        SS_ERR_NONE = 0,
        SS_ERR_DISABLED, /**< secsave is disabled. */
        SS_ERR_OUT_OF_MEM, /**< memory allocation failure */
@@ -188,15 +188,15 @@ typedef enum {
        SS_ERR_MKSTEMP,
        SS_ERR_RENAME,
        SS_ERR_OTHER,
-} SecureSaveErrno;
+};
 
-typedef enum {
+enum NotifyPriority {
        NOTIFY_PRIORITY_HIGH = 0,
        NOTIFY_PRIORITY_MEDIUM,
        NOTIFY_PRIORITY_LOW
-} NotifyPriority;
+};
 
-typedef enum {
+enum NotifyType {
        NOTIFY_MARKS            = 1 << 1, /**< changed marks */
        NOTIFY_PIXBUF           = 1 << 2, /**< image was read into fd->pixbuf */
        NOTIFY_HISTMAP          = 1 << 3, /**< histmap was read into fd->histmap */
@@ -205,9 +205,9 @@ typedef enum {
        NOTIFY_GROUPING         = 1 << 6, /**< change in fd->sidecar_files or fd->parent */
        NOTIFY_REREAD           = 1 << 7, /**< changed file size, date, etc., file name remains unchanged */
        NOTIFY_CHANGE           = 1 << 8  /**< generic change described by fd->change */
-} NotifyType;
+};
 
-typedef enum {
+enum ChangeError {
        CHANGE_OK                      = 0,
        CHANGE_WARN_DEST_EXISTS        = 1 << 0,
        CHANGE_WARN_NO_WRITE_PERM      = 1 << 1,
@@ -224,26 +224,26 @@ typedef enum {
        CHANGE_DEST_EXISTS             = 1 << 13,
        CHANGE_NO_SRC                  = 1 << 14,
        CHANGE_GENERIC_ERROR           = 1 << 16
-} ChangeError;
+};
 
-typedef enum {
+enum MetadataFormat {
        METADATA_PLAIN          = 0, /**< format that can be edited and written back */
        METADATA_FORMATTED      = 1  /**< for display only */
-} MetadataFormat;
+};
 
-typedef enum {
+enum StartUpPath {
        STARTUP_PATH_CURRENT    = 0,
        STARTUP_PATH_LAST,
        STARTUP_PATH_HOME,
-} StartUpPath;
+};
 
-typedef enum {
+enum ToolbarType {
        TOOLBAR_MAIN,
        TOOLBAR_STATUS,
        TOOLBAR_COUNT
-} ToolbarType;
+};
 
-typedef enum {
+enum PixbufRendererStereoMode {
        PR_STEREO_NONE             = 0,   /**< do nothing */
        PR_STEREO_DUAL             = 1 << 0, /**< independent stereo buffers, for example nvidia opengl */
        PR_STEREO_FIXED            = 1 << 1,  /**< custom position */
@@ -280,83 +280,83 @@ typedef enum {
        PR_STEREO_SWAP             = 1 << 18,  /**< swap left and right buffers */
        PR_STEREO_TEMP_DISABLE     = 1 << 19,  /**< temporarily disable stereo mode if source image is not stereo */
        PR_STEREO_HALF             = 1 << 20
-} PixbufRendererStereoMode;
+};
 
-typedef enum {
+enum StereoPixbufData {
        STEREO_PIXBUF_DEFAULT  = 0,
        STEREO_PIXBUF_SBS      = 1,
        STEREO_PIXBUF_CROSS    = 2,
        STEREO_PIXBUF_NONE     = 3
-} StereoPixbufData;
+};
 
-typedef enum {
+enum SortModeType {
        BAR_SORT_MODE_FOLDER = 0,
        BAR_SORT_MODE_COLLECTION,
        BAR_SORT_MODE_COUNT
-} SortModeType;
+};
 
-typedef enum {
+enum SortActionType {
        BAR_SORT_COPY = 0,
        BAR_SORT_MOVE,
        BAR_SORT_FILTER,
        BAR_SORT_ACTION_COUNT
-} SortActionType;
+};
 
-typedef enum {
+enum SortSelectionType {
        BAR_SORT_SELECTION_IMAGE = 0,
        BAR_SORT_SELECTION_SELECTED,
        BAR_SORT_SELECTION_COUNT
-} SortSelectionType;
+};
 
 #define MAX_SPLIT_IMAGES 4
 
-typedef enum {
+enum SelectionType {
        SELECTION_NONE          = 0,
        SELECTION_SELECTED      = 1 << 0,
        SELECTION_PRELIGHT      = 1 << 1,
        SELECTION_FOCUS         = 1 << 2
-} SelectionType;
+};
 
-typedef struct _ImageLoader ImageLoader;
-typedef struct _ThumbLoader ThumbLoader;
+using ImageLoader = struct _ImageLoader;
+using ThumbLoader = struct _ThumbLoader;
 
-typedef struct _AnimationData AnimationData;
+using AnimationData = struct _AnimationData;
 
-typedef struct _CollectInfo CollectInfo;
-typedef struct _CollectionData CollectionData;
-typedef struct _CollectTable CollectTable;
-typedef struct _CollectWindow CollectWindow;
+using CollectInfo = struct _CollectInfo;
+using CollectionData = struct _CollectionData;
+using CollectTable = struct _CollectTable;
+using CollectWindow = struct _CollectWindow;
 
-typedef struct _ImageWindow ImageWindow;
+using ImageWindow = struct _ImageWindow;
 
-typedef struct _FileData FileData;
-typedef struct _FileDataChangeInfo FileDataChangeInfo;
+using FileData = struct _FileData;
+using FileDataChangeInfo = struct _FileDataChangeInfo;
 
-typedef struct _LayoutWindow LayoutWindow;
-typedef struct _LayoutOptions LayoutOptions;
+using LayoutWindow = struct _LayoutWindow;
+using LayoutOptions = struct _LayoutOptions;
 
-typedef struct _ViewDir ViewDir;
-typedef struct _ViewDirInfoList ViewDirInfoList;
-typedef struct _ViewDirInfoTree ViewDirInfoTree;
+using ViewDir = struct _ViewDir;
+using ViewDirInfoList = struct _ViewDirInfoList;
+using ViewDirInfoTree = struct _ViewDirInfoTree;
 
-typedef struct _ViewFile ViewFile;
-typedef struct _ViewFileInfoList ViewFileInfoList;
-typedef struct _ViewFileInfoIcon ViewFileInfoIcon;
+using ViewFile = struct _ViewFile;
+using ViewFileInfoList = struct _ViewFileInfoList;
+using ViewFileInfoIcon = struct _ViewFileInfoIcon;
 
-typedef struct _SlideShowData SlideShowData;
-typedef struct _FullScreenData FullScreenData;
+using SlideShowData = struct _SlideShowData;
+using FullScreenData = struct _FullScreenData;
 
-typedef struct _PixmapFolders PixmapFolders;
-typedef struct _Histogram Histogram;
-typedef struct _HistMap HistMap;
+using PixmapFolders = struct _PixmapFolders;
+using Histogram = struct _Histogram;
+using HistMap = struct _HistMap;
 
-typedef struct _SecureSaveInfo SecureSaveInfo;
+using SecureSaveInfo = struct _SecureSaveInfo;
 
-typedef struct _ExifData ExifData;
+struct ExifData;
 
-typedef struct _EditorDescription EditorDescription;
+using EditorDescription = struct _EditorDescription;
 
-typedef struct _CommandLine CommandLine;
+using CommandLine = struct _CommandLine;
 
 struct _Histogram {
        gint histogram_channel; /**< drawing mode for histogram */
@@ -376,9 +376,9 @@ struct _Histogram {
 
 struct _ImageLoader;
 
-typedef void (* ThumbLoaderFunc)(ThumbLoader *tl, gpointer data);
+using ThumbLoaderFunc = void (*)(ThumbLoader *, gpointer);
 
-typedef void (* FileUtilDoneFunc)(gboolean success, const gchar *done_path, gpointer data);
+using FileUtilDoneFunc = void (*)(gboolean, const gchar *, gpointer);
 
 struct _ThumbLoader
 {
@@ -504,10 +504,8 @@ struct _CollectWindow
        CollectionData *cd;
 };
 
-typedef gint (* ImageTileRequestFunc)(ImageWindow *imd, gint x, gint y,
-                                     gint width, gint height, GdkPixbuf *pixbuf, gpointer);
-typedef void (* ImageTileDisposeFunc)(ImageWindow *imd, gint x, gint y,
-                                     gint width, gint height, GdkPixbuf *pixbuf, gpointer);
+using ImageTileRequestFunc = gint (*)(ImageWindow *, gint, gint, gint, gint, GdkPixbuf *, gpointer);
+using ImageTileDisposeFunc = void (*)(ImageWindow *, gint, gint, gint, gint, GdkPixbuf *, gpointer);
 
 struct _ImageWindow
 {
@@ -1129,13 +1127,13 @@ struct _CommandLine
 /**
  * @struct _hard_coded_window_keys
  * @brief hard coded window shortcut keys
- * 
+ *
  * Used for two purposes:\n
  * to display the shortcuts keys in popup menus\n
  * used by ./doc/create-shortcuts-xml.sh to generate shortcut documentation in the Help files
- * 
+ *
  */
-typedef struct _hard_coded_window_keys hard_coded_window_keys;
+using hard_coded_window_keys = struct _hard_coded_window_keys;
 struct _hard_coded_window_keys {
        GdkModifierType mask; /**< modifier key mask */
        guint key_value;  /**< GDK_keyval */
index 7685452..3448d5a 100644 (file)
 #define MARKER_PATH "[path]"
 #define MARKER_ICON "[icon]"
 
-typedef struct _BookMarkData BookMarkData;
-typedef struct _BookButtonData BookButtonData;
-typedef struct _BookPropData BookPropData;
+struct BookButtonData;
 
-struct _BookMarkData
+struct BookMarkData
 {
        GtkWidget *widget;
        GtkWidget *box;
@@ -64,7 +62,7 @@ struct _BookMarkData
        BookButtonData *active_button;
 };
 
-struct _BookButtonData
+struct BookButtonData
 {
        GtkWidget *button;
        GtkWidget *image;
@@ -77,7 +75,7 @@ struct _BookButtonData
        gchar *parent;
 };
 
-struct _BookPropData
+struct BookPropData
 {
        GtkWidget *name_entry;
        GtkWidget *path_entry;
@@ -935,8 +933,7 @@ void bookmark_add_default(const gchar *name, const gchar *path)
  *-----------------------------------------------------------------------------
  */
 
-typedef struct _HistoryComboData HistoryComboData;
-struct _HistoryComboData
+struct HistoryComboData
 {
        GtkWidget *combo;
        GtkWidget *entry;
index 5a07366..617dc0d 100644 (file)
@@ -1003,8 +1003,7 @@ gchar *md5_text_from_file_utf8(const gchar *path, const gchar *error_text)
 
 /* Download web file
  */
-typedef struct _WebData WebData;
-struct _WebData
+struct WebData
 {
        GenericDialog *gd;
        GCancellable *cancellable;
@@ -1155,8 +1154,8 @@ gboolean rmdir_recursive(GFile *file, GCancellable *cancellable, GError **error)
  * @brief Retrieves the internal scale factor that maps from window coordinates to the actual device pixels
  * @param  -
  * @returns scale factor
- * 
- * 
+ *
+ *
  */
 gint scale_factor()
 {
index 2011cbc..8c05a3c 100644 (file)
@@ -809,8 +809,7 @@ GtkWidget *pref_toolbar_button(GtkWidget *toolbar,
 #define DATE_SELECION_KEY "date_selection_data"
 
 
-typedef struct _DateSelection DateSelection;
-struct _DateSelection
+struct DateSelection
 {
        GtkWidget *box;
 
index c1bcb57..c7a36d3 100644 (file)
@@ -199,12 +199,12 @@ void date_selection_time_set(GtkWidget *widget, time_t t);
 time_t date_selection_time_get(GtkWidget *widget);
 
 
-typedef enum {
+enum SizerPositionType {
        SIZER_POS_LEFT   = 1 << 0,
        SIZER_POS_RIGHT  = 1 << 1,
        SIZER_POS_TOP    = 1 << 2,
        SIZER_POS_BOTTOM = 1 << 3
-} SizerPositionType;
+};
 
 void sizer_set_limits(GtkWidget *sizer,
                      gint hsize_min, gint hsize_max,
index f4a7324..8b391d1 100644 (file)
@@ -50,8 +50,7 @@ enum {
        FILTER_COLUMN_FILTER
 };
 
-typedef struct _Dest_Data Dest_Data;
-struct _Dest_Data
+struct Dest_Data
 {
        GtkWidget *d_view;
        GtkWidget *f_view;
@@ -76,8 +75,7 @@ struct _Dest_Data
        GenericDialog *gd;      /* any open confirm dialogs ? */
 };
 
-typedef struct _DestDel_Data DestDel_Data;
-struct _DestDel_Data
+struct DestDel_Data
 {
        Dest_Data *dd;
        gchar *path;
index a346ca7..40183d6 100644 (file)
@@ -35,8 +35,7 @@
  *-----------------------------------------------------------------------------
  */
 
-typedef struct _SpinnerData SpinnerData;
-struct _SpinnerData {
+struct SpinnerData {
        GtkWidget *image;
        GList *list;            /* list of pixbufs */
        guint frame;
index b0a9dbb..b85621a 100644 (file)
@@ -54,8 +54,7 @@
  * ----------------------------------------------------------------
  */
 
-typedef struct _TabCompData TabCompData;
-struct _TabCompData
+struct TabCompData
 {
        GtkWidget *entry;
        gchar *dir_path;
index 9db584a..a8be7e4 100644 (file)
@@ -528,8 +528,7 @@ void shift_color(GdkColor *src, gshort val, gint direction)
 #define AUTO_SCROLL_DEFAULT_SPEED 100
 #define AUTO_SCROLL_DEFAULT_REGION 20
 
-typedef struct _AutoScrollData AutoScrollData;
-struct _AutoScrollData
+struct AutoScrollData
 {
        guint timer_id; /* event source id */
        gint region_size;
index bd21643..89f2d14 100644 (file)
@@ -23,8 +23,7 @@
 #define UI_TREE_EDIT_H
 
 
-typedef struct _TreeEditData TreeEditData;
-struct _TreeEditData
+struct TreeEditData
 {
        GtkWidget *window;
        GtkWidget *entry;
index 0ef0111..a1fb5f2 100644 (file)
@@ -38,8 +38,7 @@
  *-----------------------------------------------------------------------------
  */
 
-typedef struct _DialogWindow DialogWindow;
-struct _DialogWindow
+struct DialogWindow
 {
        gint x;
        gint y;
@@ -519,8 +518,7 @@ GenericDialog *warning_dialog(const gchar *heading, const gchar *text,
  * 2. arm AppImage - e.g. Geeqie-v2.0+20221025-aarch64.AppImage
  */
 
-typedef struct _AppImageData AppImageData;
-struct _AppImageData
+struct AppImageData
 {
        GFile *version_file;
        GDataInputStream *data_input_stream;
index fd3fa3d..01f154a 100644 (file)
@@ -25,8 +25,7 @@
 
 #define GENERIC_DIALOG(gd) ((GenericDialog *)gd)
 
-typedef struct _GenericDialog GenericDialog;
-struct _GenericDialog
+struct GenericDialog
 {
        GtkWidget *dialog;      /**< window */
        GtkWidget *vbox;        /**< place to add widgets */
@@ -43,8 +42,7 @@ struct _GenericDialog
 
 };
 
-typedef struct _FileDialog FileDialog;
-struct _FileDialog
+struct FileDialog
 {
        GenericDialog gd;
 
index a3e32cb..d903712 100644 (file)
@@ -48,8 +48,7 @@ static GtkTargetEntry target_types[] =
 };
 static gint target_types_n = 4;
 
-typedef struct _ClipboardData ClipboardData;
-struct _ClipboardData
+struct ClipboardData
 {
        GList *path_list; /**< g_strdup(fd->path) */
        gboolean quoted;
@@ -246,7 +245,7 @@ static gint filename_base_length(const gchar *name)
 
 
 
-typedef enum {
+enum UtilityType {
        UTILITY_TYPE_COPY,
        UTILITY_TYPE_MOVE,
        UTILITY_TYPE_RENAME,
@@ -258,9 +257,9 @@ typedef enum {
        UTILITY_TYPE_DELETE_FOLDER,
        UTILITY_TYPE_CREATE_FOLDER,
        UTILITY_TYPE_WRITE_METADATA
-} UtilityType;
+};
 
-typedef enum {
+enum UtilityPhase {
        UTILITY_PHASE_START = 0,
        UTILITY_PHASE_INTERMEDIATE,
        UTILITY_PHASE_ENTERING,
@@ -268,7 +267,7 @@ typedef enum {
        UTILITY_PHASE_DONE,
        UTILITY_PHASE_CANCEL,
        UTILITY_PHASE_DISCARD
-} UtilityPhase;
+};
 
 enum {
        UTILITY_RENAME = 0,
@@ -276,8 +275,7 @@ enum {
        UTILITY_RENAME_FORMATTED
 };
 
-typedef struct _UtilityDataMessages UtilityDataMessages;
-struct _UtilityDataMessages {
+struct UtilityDataMessages {
        const gchar *title;
        const gchar *question;
        const gchar *desc_flist;
@@ -285,9 +283,7 @@ struct _UtilityDataMessages {
        const gchar *fail;
 };
 
-typedef struct _UtilityData UtilityData;
-
-struct _UtilityData {
+struct UtilityData {
        UtilityType type;
        UtilityPhase phase;
 
@@ -350,9 +346,7 @@ enum {
        UTILITY_COLUMN_COUNT
 };
 
-typedef struct _UtilityDelayData UtilityDelayData;
-
-struct _UtilityDelayData {
+struct UtilityDelayData {
        UtilityType type;
        UtilityPhase phase;
        GList *flist;
index fb1ad92..fc74f88 100644 (file)
@@ -30,8 +30,7 @@
 #define VDTREE(_vd_) ((ViewDirInfoTree *)(_vd_->info))
 
 
-typedef struct _PathData PathData;
-struct _PathData
+struct PathData
 {
        gchar *name;
        FileData *node;
index d7898df..e6e12e0 100644 (file)
@@ -22,8 +22,7 @@
 #ifndef VIEW_DIR_TREE_H
 #define VIEW_DIR_TREE_H
 
-typedef struct _NodeData NodeData;
-struct _NodeData
+struct NodeData
 {
        FileData *fd;
        gboolean expanded;
index 59c699f..609552b 100644 (file)
@@ -2057,8 +2057,7 @@ gboolean vficon_refresh(ViewFile *vf)
  *-----------------------------------------------------------------------------
  */
 
-typedef struct _ColumnData ColumnData;
-struct _ColumnData
+struct ColumnData
 {
        ViewFile *vf;
        gint number;
index edd1e02..daa502e 100644 (file)
@@ -83,12 +83,12 @@ static void vflist_set_expanded(ViewFile *vf, GtkTreeIter *iter, gboolean expand
  * misc
  *-----------------------------------------------------------------------------
  */
-typedef struct {
+struct ViewFileFindRowData {
        FileData *fd;
        GtkTreeIter *iter;
        gboolean found;
        gint row;
-} ViewFileFindRowData;
+};
 
 static gboolean vflist_find_row_cb(GtkTreeModel *model, GtkTreePath *UNUSED(path), GtkTreeIter *iter, gpointer data)
 {
index c2e87aa..3dbd9aa 100644 (file)
@@ -838,8 +838,7 @@ static void vf_marks_filter_toggle_cb(GtkWidget *UNUSED(widget), gpointer data)
        vf_refresh_idle(vf);
 }
 
-typedef struct _MarksTextEntry MarksTextEntry;
-struct _MarksTextEntry {
+struct MarksTextEntry {
        GenericDialog *gd;
        gint mark_no;
        GtkWidget *edit_widget;
index 9f8e8cc..cc96f0a 100644 (file)
@@ -321,8 +321,7 @@ void help_window_show(const gchar *key)
  *-----------------------------------------------------------------------------
  */
 
-typedef struct _HelpSearchData HelpSearchData;
-struct _HelpSearchData {
+struct HelpSearchData {
        GenericDialog *gd;
        GtkWidget *edit_widget;
        gchar *text_entry;
index 710cb5a..c5b2f7e 100644 (file)
@@ -38,7 +38,7 @@
 #endif
 #endif
 
-typedef enum {
+enum ZDLookupResult {
     ZD_LOOKUP_IGNORE = -3,
     ZD_LOOKUP_END = -2,
     ZD_LOOKUP_PARSE_ERROR = -1,
@@ -47,9 +47,9 @@ typedef enum {
     ZD_LOOKUP_IN_EXCLUDED_ZONE = 2,
     ZD_LOOKUP_ON_BORDER_VERTEX = 3,
     ZD_LOOKUP_ON_BORDER_SEGMENT = 4
-} ZDLookupResult;
+};
 
-typedef struct {
+struct ZoneDetectResult {
     ZDLookupResult lookupResult;
 
     uint32_t polygonId;
@@ -57,10 +57,10 @@ typedef struct {
     uint8_t numFields;
     char **fieldNames;
     char **data;
-} ZoneDetectResult;
+};
 
 struct ZoneDetectOpaque;
-typedef struct ZoneDetectOpaque ZoneDetect;
+using ZoneDetect = struct ZoneDetectOpaque;
 
 #ifdef __cplusplus
 extern "C" {