Remove structs and some enums from typedefs.h
authorArkadiy Illarionov <qarkai@gmail.com>
Sat, 26 Aug 2023 18:25:56 +0000 (21:25 +0300)
committerColin Clark <colin.clark@cclark.uk>
Tue, 29 Aug 2023 08:54:40 +0000 (09:54 +0100)
Move them to appropriate files.

77 files changed:
src/advanced-exif.h
src/bar-keywords.h
src/bar-sort.h
src/bar.cc
src/bar.h
src/cache-loader.cc
src/cache-loader.h
src/cache-maint.h
src/collect-io.h
src/collect-table.h
src/collect.h
src/color-man.cc
src/color-man.h
src/dupe.h
src/editors.h
src/exif.h
src/exiv2.cc
src/filedata.h
src/fullscreen.h
src/glua.h
src/histogram.h
src/image-load-collection.cc
src/image-load-external.cc
src/image-load-ffmpegthumbnailer.cc
src/image-load-gdk.cc
src/image-load-libraw.cc
src/image-load.h
src/image-overlay.cc
src/image-overlay.h
src/image.h
src/img-view.h
src/layout-image.cc
src/layout-image.h
src/layout-util.cc
src/layout.cc
src/layout.h
src/logwindow.cc
src/logwindow.h
src/lua.cc
src/metadata.h
src/misc.cc
src/misc.h
src/options.h
src/osd.h
src/pan-view/pan-types.h
src/pan-view/pan-view-filter.cc
src/pixbuf-util.cc
src/pixbuf-util.h
src/preferences.h
src/print.h
src/rcfile.h
src/remote.cc
src/remote.h
src/search-and-run.cc
src/search-and-run.h
src/search.h
src/secure-save.h
src/shortcuts.h
src/slideshow.h
src/thumb-standard.cc
src/thumb-standard.h
src/thumb.cc
src/thumb.h
src/toolbar.h
src/typedefs.h
src/ui-menu.h
src/ui-misc.h
src/ui-utildlg.h
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.h
src/view-file.h
src/view-file/view-file-icon.h
src/view-file/view-file-list.h

index 97cf948..f094ec7 100644 (file)
@@ -22,6 +22,8 @@
 #ifndef ADVANCED_EXIF_H
 #define ADVANCED_EXIF_H
 
+struct FileData;
+struct LayoutWindow;
 
 GtkWidget *advanced_exif_new(LayoutWindow *lw);
 
index 00c9b5a..fb582d4 100644 (file)
@@ -22,6 +22,8 @@
 #ifndef BAR_KEYWORDS_H
 #define BAR_KEYWORDS_H
 
+struct LayoutWindow;
+
 GtkWidget *bar_pane_keywords_new_from_config(const gchar **attribute_names, const gchar **attribute_values);
 void bar_pane_keywords_update_from_config(GtkWidget *pane, const gchar **attribute_names, const gchar **attribute_values);
 void bar_pane_keywords_entry_add_from_config(GtkWidget *pane, const gchar **attribute_names, const gchar **attribute_values);
index d26d257..d96146b 100644 (file)
@@ -22,6 +22,7 @@
 #ifndef BAR_SORT_H
 #define BAR_SORT_H
 
+struct LayoutWindow;
 
 GtkWidget *bar_sort_new_default(LayoutWindow *lw);
 GtkWidget *bar_sort_new_from_config(LayoutWindow *lw, const gchar **attribute_names, const gchar **attribute_values);
index 188ea7c..d1d6a38 100644 (file)
@@ -24,6 +24,7 @@
 
 #include "bar-histogram.h"
 #include "filedata.h"
+#include "layout.h"
 #include "metadata.h"
 #include "rcfile.h"
 #include "ui-menu.h"
index 2c4c6f2..30ce6e6 100644 (file)
--- a/src/bar.h
+++ b/src/bar.h
@@ -22,6 +22,9 @@
 #ifndef BAR_H
 #define BAR_H
 
+struct FileData;
+struct LayoutWindow;
+
 enum PaneType {
        PANE_UNDEF = 0,
        PANE_COMMENT,
index 08a9c57..d5d9bc4 100644 (file)
@@ -217,7 +217,7 @@ static gboolean cache_loader_phase2_idle_cb(gpointer data)
 }
 
 CacheLoader *cache_loader_new(FileData *fd, CacheDataType load_mask,
-                             CacheLoaderDoneFunc done_func, gpointer done_data)
+                             CacheLoader::DoneFunc done_func, gpointer done_data)
 {
        CacheLoader *cl;
        gchar *found;
index e800350..949d3a1 100644 (file)
 #include "cache.h"
 #include "image-load.h"
 
-
-struct CacheLoader;
-
-using CacheLoaderDoneFunc = void (*)(CacheLoader *, gint, gpointer);
-
+struct FileData;
 
 enum CacheDataType {
        CACHE_LOADER_NONE       = 0,
@@ -47,7 +43,8 @@ struct CacheLoader {
        CacheDataType todo_mask;
        CacheDataType done_mask;
 
-       CacheLoaderDoneFunc done_func;
+       using DoneFunc = void (*)(CacheLoader *, gint, gpointer);
+       DoneFunc done_func;
        gpointer done_data;
 
        gboolean error;
@@ -58,7 +55,7 @@ struct CacheLoader {
 
 
 CacheLoader *cache_loader_new(FileData *fd, CacheDataType load_mask,
-                             CacheLoaderDoneFunc done_func, gpointer done_data);
+                             CacheLoader::DoneFunc done_func, gpointer done_data);
 
 void cache_loader_free(CacheLoader *cl);
 
index 3cf1550..bcd5da5 100644 (file)
@@ -22,6 +22,7 @@
 #ifndef CACHE_MAINT_H
 #define CACHE_MAINT_H
 
+struct FileData;
 
 void cache_maintain_home(gboolean metadata, gboolean clear, GtkWidget *parent);
 void cache_notify_cb(FileData *fd, NotifyType type, gpointer data);
index 9a90e2e..ea760b4 100644 (file)
@@ -22,6 +22,9 @@
 #ifndef COLLECT_IO_H
 #define COLLECT_IO_H
 
+struct CollectionData;
+struct FileData;
+
 enum CollectionLoadFlags {
        COLLECTION_LOAD_NONE    = 0,
        COLLECTION_LOAD_APPEND  = 1 << 0,
index 17b23e5..14c77f5 100644 (file)
 
 #include "collect.h"
 
+struct CollectTable
+{
+       GtkWidget *scrolled;
+       GtkWidget *listview;
+       gint columns;
+       gint rows;
+
+       CollectionData *cd;
+
+       GList *selection;
+       CollectInfo *prev_selection;
+
+       CollectInfo *click_info;
+
+       GtkWidget *tip_window;
+       guint tip_delay_id; /**< event source id */
+       CollectInfo *tip_info;
+
+       GdkWindow *marker_window;
+       CollectInfo *marker_info;
+
+       GtkWidget *status_label;
+       GtkWidget *extra_label;
+
+       gint focus_row;
+       gint focus_column;
+       CollectInfo *focus_info;
+
+       GtkWidget *popup;
+       CollectInfo *drop_info;
+       GList *drop_list;
+
+       guint sync_idle_id; /**< event source id */
+       guint drop_idle_id; /**< event source id */
+
+       gboolean show_text;
+       gboolean show_stars;
+
+       GList *editmenu_fd_list; /**< file list for edit menu */
+};
+
 void collection_table_select_all(CollectTable *ct);
 void collection_table_unselect_all(CollectTable *ct);
 
index b0e4881..bf72f49 100644 (file)
 #ifndef COLLECT_H
 #define COLLECT_H
 
+struct CollectTable;
+struct FileData;
+struct ThumbLoader;
+
+struct CollectInfo
+{
+       FileData *fd;
+       GdkPixbuf *pixbuf;
+       guint flag_mask;
+};
 
 CollectInfo *collection_info_new(FileData *fd, struct stat *st, GdkPixbuf *pixbuf);
 
@@ -37,6 +47,37 @@ GList *collection_list_remove(GList *list, CollectInfo *ci);
 CollectInfo *collection_list_find_fd(GList *list, FileData *fd);
 GList *collection_list_to_filelist(GList *list);
 
+struct CollectionData
+{
+       gchar *path;
+       gchar *name;
+       GList *list;
+       SortType sort_method;
+
+       ThumbLoader *thumb_loader;
+       CollectInfo *thumb_info;
+
+       void (*info_updated_func)(CollectionData *, CollectInfo *, gpointer);
+       gpointer info_updated_data;
+
+       gint ref;
+
+       /* geometry */
+       gint window_read;
+       gint window_x;
+       gint window_y;
+       gint window_w;
+       gint window_h;
+
+       gboolean changed; /**< contents changed since save flag */
+
+       GHashTable *existence;
+
+       GtkWidget *dialog_name_entry;
+       gchar *collection_path; /**< Full path to collection including extension */
+       gint collection_append_index;
+};
+
 CollectionData *collection_new(const gchar *path);
 void collection_free(CollectionData *cd);
 
@@ -79,6 +120,17 @@ gboolean collection_rename(CollectionData *cd, FileData *fd);
 
 void collection_update_geometry(CollectionData *cd);
 
+struct CollectWindow
+{
+       GtkWidget *window;
+       CollectTable *table;
+       GtkWidget *status_box;
+
+       GtkWidget *close_dialog;
+
+       CollectionData *cd;
+};
+
 CollectWindow *collection_window_new(const gchar *path);
 void collection_window_close_by_collection(CollectionData *cd);
 CollectWindow *collection_window_find(CollectionData *cd);
index 16005ff..5efea3d 100644 (file)
@@ -22,6 +22,7 @@
 #include "main.h"
 #include "color-man.h"
 
+#include "filedata.h"
 #include "image.h"
 #include "ui-fileops.h"
 
@@ -421,7 +422,7 @@ ColorMan *color_man_new(ImageWindow *imd, GdkPixbuf *pixbuf,
 
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wunused-function"
-void color_man_start_bg_unused(ColorMan *cm, ColorManDoneFunc done_func, gpointer done_data)
+void color_man_start_bg_unused(ColorMan *cm, ColorMan::DoneFunc done_func, gpointer done_data)
 {
        cm->func_done = done_func;
        cm->func_done_data = done_data;
index 1c2dad7..f1f5eee 100644 (file)
@@ -22,6 +22,9 @@
 #ifndef COLOR_MAN_H
 #define COLOR_MAN_H
 
+struct FileData;
+struct ImageWindow;
+
 enum ColorManProfileType {
        COLOR_PROFILE_NONE = -1,
        COLOR_PROFILE_MEM = -2,
@@ -36,9 +39,6 @@ enum ColorManReturnType {
        COLOR_RETURN_IMAGE_CHANGED
 };
 
-struct ColorMan;
-using ColorManDoneFunc = void (*)(ColorMan *, ColorManReturnType, gpointer);
-
 
 struct ColorMan {
        ImageWindow *imd;
@@ -50,7 +50,8 @@ struct ColorMan {
 
        guint idle_id; /* event source id */
 
-       ColorManDoneFunc func_done;
+       using DoneFunc = void (*)(ColorMan *, ColorManReturnType, gpointer);
+       DoneFunc func_done;
        gpointer func_done_data;
 };
 
index c894d1c..58ce2e1 100644 (file)
 
 #include "similar.h"
 
+struct CollectInfo;
+struct CollectionData;
+struct FileData;
+struct ImageLoader;
+struct ThumbLoader;
+
 /** @enum DupeMatchType
  *  match methods
  */
index 5ee0d4b..8f197f7 100644 (file)
@@ -22,6 +22,7 @@
 #ifndef EDITORS_H
 #define EDITORS_H
 
+struct FileData;
 
 enum EditorFlags {
        EDITOR_KEEP_FS            = 0x00000001,
index 4b03c20..56e4e1b 100644 (file)
 #ifndef __EXIF_H
 #define __EXIF_H
 
+struct ExifData;
+struct ExifItem;
+struct FileData;
+
 #define EXIF_FORMATTED() "formatted."
 #define EXIF_FORMATTED_LEN (sizeof(EXIF_FORMATTED()) - 1)
 
@@ -56,8 +60,6 @@ enum ExifFormatType {
  *-----------------------------------------------------------------------------
  */
 
-struct ExifItem;
-
 struct ExifRational
 {
        guint32 num;
index e720e2e..a8ff73d 100644 (file)
 #include "main.h"
 #include "exif.h"
 
+#include "filedata.h"
 #include "filefilter.h"
-#include "ui-fileops.h"
-
 #include "misc.h"
+#include "ui-fileops.h"
 
 #if EXIV2_TEST_VERSION(0,28,0)
 #define AnyError Error
index e1bc7fa..189915d 100644 (file)
@@ -22,6 +22,9 @@
 #ifndef FILEDATA_H
 #define FILEDATA_H
 
+struct ExifData;
+struct HistMap;
+
 #ifdef DEBUG
 #define DEBUG_FILEDATA
 #endif
@@ -32,6 +35,96 @@ gchar *text_from_size(gint64 size);
 gchar *text_from_size_abrev(gint64 size);
 const gchar *text_from_time(time_t t);
 
+enum FileDataChangeType {
+       FILEDATA_CHANGE_DELETE,
+       FILEDATA_CHANGE_MOVE,
+       FILEDATA_CHANGE_RENAME,
+       FILEDATA_CHANGE_COPY,
+       FILEDATA_CHANGE_UNSPECIFIED,
+       FILEDATA_CHANGE_WRITE_METADATA
+};
+
+enum NotifyPriority {
+       NOTIFY_PRIORITY_HIGH = 0,
+       NOTIFY_PRIORITY_MEDIUM,
+       NOTIFY_PRIORITY_LOW
+};
+
+enum SelectionType {
+       SELECTION_NONE          = 0,
+       SELECTION_SELECTED      = 1 << 0,
+       SELECTION_PRELIGHT      = 1 << 1,
+       SELECTION_FOCUS         = 1 << 2
+};
+
+struct FileDataChangeInfo {
+       FileDataChangeType type;
+       gchar *source;
+       gchar *dest;
+       gint error;
+       gboolean regroup_when_finished;
+};
+
+struct FileData {
+       guint magick;
+       gint type;
+       gchar *original_path; /**< key to file_data_pool hash table */
+       gchar *path;
+       const gchar *name;
+       const gchar *extension;
+       gchar *extended_extension;
+       FileFormatClass format_class;
+       gchar *format_name; /**< set by the image loader */
+       gchar *collate_key_name;
+       gchar *collate_key_name_nocase;
+       gchar *collate_key_name_natural;
+       gchar *collate_key_name_nocase_natural;
+       gint64 size;
+       time_t date;
+       time_t cdate;
+       mode_t mode; /**< this is needed at least for notification in view_dir because it is preserved after the file/directory is deleted */
+       gint sidecar_priority;
+
+       guint marks; /**< each bit represents one mark */
+       guint valid_marks; /**< zero bit means that the corresponding mark needs to be reread */
+
+
+       GList *sidecar_files;
+       FileData *parent; /**< parent file if this is a sidecar file, NULL otherwise */
+       FileDataChangeInfo *change; /**< for rename, move ... */
+       GdkPixbuf *thumb_pixbuf;
+
+       GdkPixbuf *pixbuf; /**< full-size image, only complete images, NULL during loading
+                             all FileData with non-NULL pixbuf are referenced by image_cache */
+
+       HistMap *histmap;
+
+       gboolean locked;
+       gint ref;
+       gint version; /**< increased when any field in this structure is changed */
+       gboolean disable_grouping;
+
+       gint user_orientation;
+       gint exif_orientation;
+
+       ExifData *exif;
+       time_t exifdate;
+       time_t exifdate_digitized;
+       GHashTable *modified_xmp; /**< hash table which contains unwritten xmp metadata in format: key->list of string values */
+       GList *cached_metadata;
+       gint rating;
+       gboolean metadata_in_idle_loaded;
+
+       gchar *owner;
+       gchar *group;
+       gchar *sym_link;
+
+       SelectionType selected;  /**< Used by view-file-icon. */
+
+       gint page_num;
+       gint page_total;
+};
+
 /**
  * @headerfile file_data_new_group
  * scan for sidecar files - expensive
index 6bd291d..4a38f0f 100644 (file)
 #ifndef FULLSCREEN_H
 #define FULLSCREEN_H
 
+struct ImageWindow;
+
 #define FULL_SCREEN_HIDE_MOUSE_DELAY 3000
 #define FULL_SCREEN_BUSY_MOUSE_DELAY 200
 
+struct FullScreenData
+{
+       GtkWidget *window;
+       ImageWindow *imd;
+
+       GtkWidget *normal_window;
+       ImageWindow *normal_imd;
+
+       guint hide_mouse_id; /**< event source id */
+       guint busy_mouse_id; /**< event source id */
+
+       gint cursor_state;
+
+       guint saver_block_id; /**< event source id */
+
+       void (*stop_func)(FullScreenData *, gpointer);
+       gpointer stop_data;
+
+       gboolean same_region; /**< the returned region will overlap the current location of widget. */
+};
+
 FullScreenData *fullscreen_start(GtkWidget *window, ImageWindow *imd,
                                 void (*stop_func)(FullScreenData *, gpointer), gpointer stop_data);
 void fullscreen_stop(FullScreenData *fs);
index 1223ad7..ff292d0 100644 (file)
@@ -26,6 +26,8 @@
 #include <glib.h>
 #include "main.h"
 
+struct FileData;
+
 void lua_init();
 
 gchar *lua_callvalue(FileData *fd, const gchar *file, const gchar *function);
index 045b0ed..a4f19d7 100644 (file)
@@ -21,6 +21,9 @@
 #ifndef HISTOGRAM_H
 #define HISTOGRAM_H
 
+struct FileData;
+struct HistMap;
+
 /* Note: The order is important */
 #define HCHAN_R 0
 #define HCHAN_G 1
 #define HCHAN_COUNT 5
 #define HCHAN_DEFAULT HCHAN_RGB
 
+struct Histogram {
+       gint histogram_channel; /**< drawing mode for histogram */
+       gint histogram_mode;     /**< logarithmical or not */
+       guint vgrid; /**< number of vertical divisions, 0 for none */
+       guint hgrid; /**< number of horizontal divisions, 0 for none */
+       struct {
+               int R; /**< red */
+               int G; /**< green */
+               int B; /**< blue */
+               int A; /**< alpha */
+       } grid_color;  /**< grid color */
+};
+
 
 Histogram *histogram_new();
 void histogram_free(Histogram *histogram);
index 5ab918a..ad1af91 100644 (file)
@@ -23,6 +23,7 @@
 #include "image-load-collection.h"
 
 #include "cache.h"
+#include "filedata.h"
 #include "misc.h"
 #include "ui-fileops.h"
 
index 2bccf03..70e06b0 100644 (file)
@@ -23,6 +23,7 @@
 #include "image-load.h"
 #include "image-load-external.h"
 
+#include "filedata.h"
 #include "misc.h"
 #include "ui-fileops.h"
 
index dc608ba..f65d86e 100644 (file)
@@ -23,6 +23,8 @@
 #include "image-load.h"
 #include "image-load-ffmpegthumbnailer.h"
 
+#include "filedata.h"
+
 #ifdef HAVE_FFMPEGTHUMBNAILER
 #include <libffmpegthumbnailer/videothumbnailerc.h>
 
index d00ba2a..62e0f33 100644 (file)
@@ -23,6 +23,8 @@
 #include "image-load.h"
 #include "image-load-gdk.h"
 
+#include "filedata.h"
+
 
 static gchar* image_loader_gdk_get_format_name(gpointer loader)
 {
index 6e1510d..ab14e0f 100644 (file)
@@ -27,6 +27,7 @@
 
 #include "main.h"
 
+#include "filedata.h"
 #include "filefilter.h"
 #include "image-load.h"
 #include "image-load-libraw.h"
index 0c976af..7c909db 100644 (file)
@@ -22,6 +22,8 @@
 #ifndef IMAGE_LOAD_H
 #define IMAGE_LOAD_H
 
+struct FileData;
+
 #define TYPE_IMAGE_LOADER              (image_loader_get_type())
 
 using ImageLoaderBackendCbAreaPrepared = void (*)(gpointer, gpointer);
index d63976e..bded760 100644 (file)
 #include "main.h"
 #include "image-overlay.h"
 
+#include "collect.h"
 #include "filedata.h"
 #include "histogram.h"
 #include "image.h"
+#include "image-load.h"
 #include "img-view.h"
 #include "layout.h"
 #include "osd.h"
 #include "pixbuf-renderer.h"
 #include "pixbuf-util.h"
+#include "slideshow.h"
 #include "ui-fileops.h"
-#include "image-load.h"
 
 /*
  *----------------------------------------------------------------------------
index d0ea12b..9ed7d54 100644 (file)
@@ -22,6 +22,9 @@
 #ifndef IMAGE_OVERLAY_H
 #define IMAGE_OVERLAY_H
 
+struct Histogram;
+struct ImageWindow;
+
 enum ImageOSDFlag {
        IMAGE_OSD_NONE = 0,
        IMAGE_OSD_ROTATE_USER,
index d02ceda..9614d45 100644 (file)
 #ifndef IMAGE_H
 #define IMAGE_H
 
+struct CollectInfo;
+struct CollectionData;
+struct FileData;
+struct ImageLoader;
+
+enum ImageState {
+       IMAGE_STATE_NONE        = 0,
+       IMAGE_STATE_IMAGE       = 1 << 0,
+       IMAGE_STATE_LOADING     = 1 << 1,
+       IMAGE_STATE_ERROR       = 1 << 2,
+       IMAGE_STATE_COLOR_ADJ   = 1 << 3,
+       IMAGE_STATE_ROTATE_AUTO = 1 << 4,
+       IMAGE_STATE_ROTATE_USER = 1 << 5,
+       IMAGE_STATE_DELAY_FLIP  = 1 << 6
+};
+
+struct ImageWindow
+{
+       GtkWidget *widget;      /**< use this to add it and show it */
+       GtkWidget *pr;
+       GtkWidget *frame;
+
+       FileData *image_fd;
+
+       gboolean unknown;               /**< failed to load image */
+
+       ImageLoader *il;        /**< @FIXME image loader should probably go to FileData, but it must first support
+                                  sending callbacks to multiple ImageWindows in parallel */
+
+       gint has_frame;  /**< not boolean, see image_new() */
+
+       /* top level (not necessarily parent) window */
+       gboolean top_window_sync;       /**< resize top_window when image dimensions change */
+       GtkWidget *top_window;  /**< window that gets title, and window to resize when 'fitting' */
+       gchar *title;           /**< window title to display left of file name */
+       gchar *title_right;     /**< window title to display right of file name */
+       gboolean title_show_zoom;       /**< option to include zoom in window title */
+
+       gboolean completed;
+       ImageState state;       /**< mask of IMAGE_STATE_* flags about current image */
+
+       void (*func_update)(ImageWindow *imd, gpointer data);
+       void (*func_complete)(ImageWindow *imd, gint preload, gpointer data);
+       void (*func_state)(ImageWindow *imd, ImageState state, gpointer data);
+
+       using TileRequestFunc = gint (*)(ImageWindow *, gint, gint, gint, gint, GdkPixbuf *, gpointer);
+       TileRequestFunc func_tile_request;
+
+       using TileDisposeFunc = void (*)(ImageWindow *, gint, gint, gint, gint, GdkPixbuf *, gpointer);
+       TileDisposeFunc func_tile_dispose;
+
+       gpointer data_update;
+       gpointer data_complete;
+       gpointer data_state;
+       gpointer data_tile;
+
+       /* button, scroll functions */
+       void (*func_button)(ImageWindow *, GdkEventButton *event, gpointer);
+       void (*func_drag)(ImageWindow *, GdkEventMotion *event, gdouble dx, gdouble dy, gpointer);
+       void (*func_scroll)(ImageWindow *, GdkEventScroll *event, gpointer);
+       void (*func_focus_in)(ImageWindow *, gpointer);
+
+       gpointer data_button;
+       gpointer data_drag;
+       gpointer data_scroll;
+       gpointer data_focus_in;
+
+       /**
+        * @headerfile func_scroll_notify
+        * scroll notification (for scroll bar implementation)
+        */
+       void (*func_scroll_notify)(ImageWindow *, gint x, gint y, gint width, gint height, gpointer);
+
+       gpointer data_scroll_notify;
+
+       /* collection info */
+       CollectionData *collection;
+       CollectInfo *collection_info;
+
+       /* color profiles */
+       gboolean color_profile_enable;
+       gint color_profile_input;
+       gboolean color_profile_use_image;
+       gint color_profile_from_image;
+       gpointer cm;
+
+       AlterType delay_alter_type;
+
+       FileData *read_ahead_fd;
+       ImageLoader *read_ahead_il;
+
+       gint prev_color_row;
+
+       gboolean auto_refresh;
+
+       gboolean delay_flip;
+       gint orientation;
+       gboolean desaturate;
+       gboolean overunderexposed;
+       gint user_stereo;
+
+       gboolean mouse_wheel_mode;
+};
 
 void image_set_frame(ImageWindow *imd, gboolean frame);
 ImageWindow *image_new(gboolean frame);
@@ -157,8 +260,8 @@ void image_to_root_window(ImageWindow *imd, gboolean scaled);
 
 void image_set_image_as_tiles(ImageWindow *imd, gint width, gint height,
                              gint tile_width, gint tile_height, gint cache_size,
-                             ImageTileRequestFunc func_tile_request,
-                             ImageTileDisposeFunc func_tile_dispose,
+                             ImageWindow::TileRequestFunc func_tile_request,
+                             ImageWindow::TileDisposeFunc func_tile_dispose,
                              gpointer data,
                              gdouble zoom);
 
index 90a539a..f16eef0 100644 (file)
 #ifndef IMG_VIEW_H
 #define IMG_VIEW_H
 
+struct CollectInfo;
+struct CollectionData;
+struct FileData;
+struct ImageWindow;
 
 void view_window_new(FileData *fd);
 void view_window_new_from_list(GList *list);
index c3815ff..e992f75 100644 (file)
@@ -284,6 +284,21 @@ static gboolean layout_image_slideshow_continue_check(LayoutWindow *lw)
  *----------------------------------------------------------------------------
  */
 
+struct AnimationData
+{
+       ImageWindow *iw;
+       LayoutWindow *lw;
+       GdkPixbufAnimation *gpa;
+       GdkPixbufAnimationIter *iter;
+       GdkPixbuf *gpb;
+       FileData *data_adr;
+       gint delay;
+       gboolean valid;
+       GCancellable *cancellable;
+       GFile *in_file;
+       GFileInputStream *gfstream;
+};
+
 static void image_animation_data_free(AnimationData *fd)
 {
        if(!fd) return;
index 820857f..c9592ea 100644 (file)
 #ifndef LAYOUT_IMAGE_H
 #define LAYOUT_IMAGE_H
 
+struct CollectInfo;
+struct CollectionData;
+struct FileData;
+struct LayoutWindow;
 
 GtkWidget *layout_image_new(LayoutWindow *lw, gint i);
 void layout_image_activate(LayoutWindow *lw, gint i, gboolean force);
index a55bf0f..4404118 100644 (file)
 #include "collect-dlg.h"
 #include "collect-io.h"
 #include "color-man.h"
+#include "desktop-file.h"
 #include "dupe.h"
 #include "editors.h"
+#include "fullscreen.h"
+#include "histogram.h"
 #include "history-list.h"
 #include "image.h"
 #include "image-overlay.h"
-#include "histogram.h"
 #include "img-view.h"
 #include "layout-image.h"
 #include "logwindow.h"
+#include "metadata.h"
 #include "misc.h"
 #include "pan-view.h"
 #include "pixbuf-util.h"
@@ -56,8 +59,6 @@
 #include "view-dir.h"
 #include "view-file.h"
 #include "window.h"
-#include "metadata.h"
-#include "desktop-file.h"
 
 #include <sys/wait.h>
 #include "keymap-template.h"
index 9966828..0dc3ab8 100644 (file)
@@ -23,6 +23,7 @@
 #include "layout.h"
 
 #include "filedata.h"
+#include "histogram.h"
 #include "history-list.h"
 #include "image.h"
 #include "image-overlay.h"
index 3229b6a..a0d72aa 100644 (file)
 #ifndef LAYOUT_H
 #define LAYOUT_H
 
+struct AnimationData;
+struct FileData;
+struct FullScreenData;
+struct ImageWindow;
+struct SlideShowData;
+struct ViewDir;
+struct ViewFile;
+
 #define LAYOUT_ID_CURRENT "_current_"
+#define MAX_SPLIT_IMAGES 4
 
 extern GList *layout_window_list;
 
 
+enum LayoutLocation {
+       LAYOUT_HIDE   = 0,
+       LAYOUT_LEFT   = 1 << 0,
+       LAYOUT_RIGHT  = 1 << 1,
+       LAYOUT_TOP    = 1 << 2,
+       LAYOUT_BOTTOM = 1 << 3
+};
+
+struct LayoutWindow
+{
+       LayoutOptions options;
+
+       FileData *dir_fd;
+
+       /* base */
+
+       GtkWidget *window;
+
+       GtkWidget *main_box;
+
+       GtkWidget *group_box;
+       GtkWidget *h_pane;
+       GtkWidget *v_pane;
+
+       /* menus, path selector */
+
+       GtkActionGroup *action_group;
+       GtkActionGroup *action_group_editors;
+       guint ui_editors_id;
+       GtkUIManager *ui_manager;
+       guint toolbar_merge_id[TOOLBAR_COUNT];
+       GList *toolbar_actions[TOOLBAR_COUNT];
+
+       GtkWidget *path_entry;
+
+       /* image */
+
+       LayoutLocation image_location;
+
+       ImageWindow *image;
+
+       ImageWindow *split_images[MAX_SPLIT_IMAGES];
+       ImageSplitMode split_mode;
+       gint active_split_image;
+
+       GtkWidget *split_image_widget;
+       GtkSizeGroup *split_image_sizegroup;
+
+       /* tools window (float) */
+
+       GtkWidget *tools;
+       GtkWidget *tools_pane;
+
+       GtkWidget *menu_tool_bar; /**< Combined menu and toolbar box */
+       GtkWidget *menu_bar; /**< referenced by lw, exist during whole lw lifetime */
+       /* toolbar */
+
+       GtkWidget *toolbar[TOOLBAR_COUNT]; /**< referenced by lw, exist during whole lw lifetime */
+
+       GtkWidget *back_button;
+
+       /* dir view */
+
+       LayoutLocation dir_location;
+
+       ViewDir *vd;
+       GtkWidget *dir_view;
+
+       /* file view */
+
+       LayoutLocation file_location;
+
+       ViewFile *vf;
+
+       GtkWidget *file_view;
+
+       GtkWidget *info_box; /**< status bar */
+       GtkWidget *info_progress_bar; /**< status bar */
+       GtkWidget *info_sort; /**< status bar */
+       GtkWidget *info_status; /**< status bar */
+       GtkWidget *info_details; /**< status bar */
+       GtkWidget *info_zoom; /**< status bar */
+       GtkWidget *info_pixel; /**< status bar */
+
+       /* slide show */
+
+       SlideShowData *slideshow;
+
+       /* full screen */
+
+       FullScreenData *full_screen;
+
+       /* misc */
+
+       GtkWidget *utility_box; /**< referenced by lw, exist during whole lw lifetime */
+       GtkWidget *utility_paned; /**< between image and bar */
+       GtkWidget *bar_sort;
+       GtkWidget *bar;
+
+       gboolean bar_sort_enabled; /**< Set during start-up, and checked when the editors have loaded */
+
+       GtkWidget *exif_window;
+       GtkWidget *sar_window; /**< Search and Run window */
+
+       AnimationData *animation;
+
+       GtkWidget *log_window;
+};
+
 LayoutWindow *layout_new(FileData *dir_fd, LayoutOptions *lop);
 LayoutWindow *layout_new_with_geometry(FileData *dir_fd, LayoutOptions *lop,
                                       const gchar *geometry);
index 3af30b8..8a63bc4 100644 (file)
@@ -25,6 +25,7 @@
 #include <deque>
 #include <string>
 
+#include "layout.h"
 #include "misc.h"
 #include "ui-misc.h"
 #include "window.h"
index 1dd5681..1e91a97 100644 (file)
@@ -21,6 +21,8 @@
 #ifndef LOGWINDOW_H
 #define LOGWINDOW_H
 
+struct LayoutWindow;
+
 enum LogType
 {
        LOG_NORMAL = 0,
index f0b0add..059b285 100644 (file)
@@ -34,8 +34,9 @@
 
 #include "main.h"
 #include "glua.h"
-#include "ui-fileops.h"
 #include "exif.h"
+#include "filedata.h"
+#include "ui-fileops.h"
 
 /**
  * @file
index f51b65c..157b183 100644 (file)
@@ -22,6 +22,8 @@
 #ifndef METADATA_H
 #define METADATA_H
 
+struct FileData;
+
 #define COMMENT_KEY "Xmp.dc.description"
 #define KEYWORD_KEY "Xmp.dc.subject"
 #define ORIENTATION_KEY "Xmp.tiff.Orientation"
index 8ad2e56..79de866 100644 (file)
@@ -24,6 +24,7 @@
 #include "main.h"
 #include "misc.h"
 
+#include "filedata.h"
 #include "ui-fileops.h"
 
 #include <langinfo.h>
index 00259ea..8b11ecf 100644 (file)
@@ -21,6 +21,8 @@
 #ifndef MISC_H
 #define MISC_H
 
+struct FileData;
+
 gdouble get_zoom_increment();
 gchar *utf8_validate_or_convert(const gchar *text);
 gint utf8_compare(const gchar *s1, const gchar *s2, gboolean case_sensitive);
index c626598..67553d4 100644 (file)
 #ifndef OPTIONS_H
 #define OPTIONS_H
 
+struct SecureSaveInfo;
+
+/**
+ * @enum DnDAction
+ * drag and drop default action
+ */
+enum DnDAction {
+       DND_ACTION_ASK,
+       DND_ACTION_COPY,
+       DND_ACTION_MOVE
+};
+
+enum ZoomStyle {
+       ZOOM_GEOMETRIC  = 0,
+       ZOOM_ARITHMETIC = 1
+};
+
 struct ConfOptions
 {
        /* ui */
@@ -381,6 +398,28 @@ struct ConfOptions
        GList *disabled_plugins;
 };
 
+struct CommandLine
+{
+       int argc;
+       gchar **argv;
+       gboolean startup_blank;
+       gboolean startup_full_screen;
+       gboolean startup_in_slideshow;
+       gboolean startup_command_line_collection;
+       gboolean tools_hide;
+       gboolean tools_show;
+       gboolean log_window_show;
+       gchar *path;
+       gchar *file;
+       GList *cmd_list;
+       GList *collection_list;
+       gchar *geometry;
+       gchar *regexp;
+       gchar *log_file;
+       SecureSaveInfo *ssi;
+       gboolean new_instance;
+};
+
 extern ConfOptions *options;
 extern CommandLine *command_line;
 
@@ -389,6 +428,157 @@ void setup_default_options(ConfOptions *options);
 void save_options(ConfOptions *options);
 gboolean load_options(ConfOptions *options);
 
+
+enum StartUpPath {
+       STARTUP_PATH_CURRENT    = 0,
+       STARTUP_PATH_LAST,
+       STARTUP_PATH_HOME,
+};
+
+enum SortActionType {
+       BAR_SORT_COPY = 0,
+       BAR_SORT_MOVE,
+       BAR_SORT_FILTER,
+       BAR_SORT_ACTION_COUNT
+};
+
+enum SortModeType {
+       BAR_SORT_MODE_FOLDER = 0,
+       BAR_SORT_MODE_COLLECTION,
+       BAR_SORT_MODE_COUNT
+};
+
+enum SortSelectionType {
+       BAR_SORT_SELECTION_IMAGE = 0,
+       BAR_SORT_SELECTION_SELECTED,
+       BAR_SORT_SELECTION_COUNT
+};
+
+struct LayoutOptions
+{
+       gchar *id;
+
+       gchar *order;
+       gint style;
+
+       DirViewType dir_view_type;
+       FileViewType file_view_type;
+
+       struct {
+               SortType method;
+               gboolean ascend;
+               gboolean case_sensitive;
+       } dir_view_list_sort;
+
+       struct {
+               SortType method;
+               gboolean ascend;
+               gboolean case_sensitive;
+       } file_view_list_sort;
+
+       gboolean show_thumbnails;
+       gboolean show_marks;
+       gboolean show_file_filter;
+       gboolean show_directory_date;
+       gboolean show_info_pixel;
+       gboolean split_pane_sync;
+       gboolean ignore_alpha;
+
+       struct {
+               gint w;
+               gint h;
+               gint x;
+               gint y;
+               gboolean maximized;
+               gint hdivider_pos;
+               gint vdivider_pos;
+       } main_window;
+
+       struct {
+               gint w;
+               gint h;
+               gint x;
+               gint y;
+               gint vdivider_pos;
+       } float_window;
+
+       struct {
+               gint vdivider_pos;
+       } folder_window;
+
+       struct {
+               gint w;
+               gint h;
+       } properties_window;
+
+       struct {
+               guint state;
+               gint histogram_channel;
+               gint histogram_mode;
+       } image_overlay;
+
+       struct {
+               gint w;
+               gint h;
+               gint x;
+               gint y;
+       } log_window;
+
+       struct {
+               gint w;
+               gint h;
+               gint x;
+               gint y;
+               gint page_number;
+       } preferences_window;
+
+       struct {
+               gint w;
+               gint h;
+               gint x;
+               gint y;
+       } search_window;
+
+       struct {
+               gint w;
+               gint h;
+               gint x;
+               gint y;
+       } dupe_window;
+
+       struct {
+               gint w;
+               gint h;
+               gint x;
+               gint y;
+       } advanced_exif_window;
+
+       gboolean tools_float;
+       gboolean tools_hidden;
+       gboolean toolbar_hidden;
+
+       struct {
+               gboolean info;
+               gboolean sort;
+               gboolean tools_float;
+               gboolean tools_hidden;
+               gboolean hidden;
+       } bars_state;
+
+       gchar *home_path;
+       gchar *last_path;
+
+       StartUpPath startup_path;
+
+       gboolean animate;
+       gint workspace;
+
+       SortActionType action;
+       SortModeType mode;
+       SortSelectionType selection;
+       gchar *filter_key;
+};
+
 void copy_layout_options(LayoutOptions *dest, const LayoutOptions *src);
 void free_layout_options_content(LayoutOptions *dest);
 LayoutOptions *init_layout_options(LayoutOptions *options);
index 980a70e..93499e6 100644 (file)
--- a/src/osd.h
+++ b/src/osd.h
@@ -21,6 +21,8 @@
 #ifndef OSD_H
 #define OSD_H
 
+struct FileData;
+
 enum OsdTemplateFlags {
        OSDT_NONE       = 0,
        OSDT_FREE       = 1 << 0,
index 1af098e..12d5b81 100644 (file)
 #include "cache-loader.h"
 #include "filedata.h"
 
+struct FullScreenData;
+struct ImageWindow;
+struct ThumbLoader;
+
 /* thumbnail sizes and spacing */
 
 #define PAN_THUMB_SIZE_DOTS 4
index 7bba497..d63eb35 100644 (file)
@@ -21,6 +21,7 @@
 
 #include "pan-view-filter.h"
 
+#include "image.h"
 #include "metadata.h"
 #include "pan-view.h"
 #include "ui-fileops.h"
index 10501ed..6ba1e28 100644 (file)
@@ -21,7 +21,9 @@
 
 #include "main.h"
 #include "pixbuf-util.h"
+
 #include "exif.h"
+#include "filedata.h"
 #include "ui-fileops.h"
 
 #include <cmath>
index 74eb252..da8a4c3 100644 (file)
@@ -22,6 +22,7 @@
 #ifndef PIXBUF_UTIL_H
 #define PIXBUF_UTIL_H
 
+struct FileData;
 
 gboolean pixbuf_to_file_as_png (GdkPixbuf *pixbuf, const gchar *filename);
 
index 840d5dd..55d5caa 100644 (file)
@@ -22,6 +22,7 @@
 #ifndef PREFERENCES_H
 #define PREFERENCES_H
 
+struct LayoutWindow;
 
 void show_config_window(LayoutWindow *lw);
 void show_about_window(LayoutWindow *lw);
index eab778d..dc924ce 100644 (file)
@@ -22,6 +22,7 @@
 #ifndef PRINT_H
 #define PRINT_H
 
+struct FileData;
 
 /**
  * @headerfile print_window_new
@@ -29,6 +30,5 @@
  */
 void print_window_new(FileData *fd, GList *selection, GList *list, GtkWidget *parent);
 
-
 #endif
 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
index 66cc69a..be39f74 100644 (file)
@@ -22,6 +22,7 @@
 #ifndef RCFILE_H
 #define RCFILE_H
 
+struct LayoutWindow;
 
 void write_indent(GString *str, gint indent);
 void write_char_option(GString *str, gint indent, const gchar *label, const gchar *text);
@@ -90,6 +91,5 @@ gboolean save_default_layout_options_to_file(const gchar *utf8_path, ConfOptions
 gboolean load_config_from_buf(const gchar *buf, gsize size, gboolean startup);
 gboolean load_config_from_file(const gchar *utf8_path, gboolean startup);
 
-
 #endif
 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
index 2925ee2..86c3fb4 100644 (file)
@@ -286,7 +286,7 @@ static RemoteConnection *remote_server_open(const gchar *path)
        return rc;
 }
 
-static void remote_server_subscribe(RemoteConnection *rc, RemoteReadFunc *func, gpointer data)
+static void remote_server_subscribe(RemoteConnection *rc, RemoteConnection::ReadFunc *func, gpointer data)
 {
        if (!rc || !rc->server) return;
 
index 5e72b19..8647031 100644 (file)
 #ifndef REMOTE_H
 #define REMOTE_H
 
-
-struct RemoteConnection;
-
-using RemoteReadFunc = void (RemoteConnection *, const gchar *, GIOChannel *, gpointer);
+struct CollectionData;
 
 struct RemoteConnection {
        gint server;
@@ -33,7 +30,9 @@ struct RemoteConnection {
        gchar *path;
 
        gint channel_id;
-       RemoteReadFunc *read_func;
+
+       using ReadFunc = void (RemoteConnection *, const gchar *, GIOChannel *, gpointer);
+       ReadFunc *read_func;
        gpointer read_data;
 
        GList *clients;
index df7bb0f..4a2d62d 100644 (file)
@@ -21,6 +21,7 @@
 #include "main.h"
 #include "search-and-run.h"
 
+#include "layout.h"
 #include "ui-misc.h"
 #include "window.h"
 
index 4bfc37a..380719d 100644 (file)
@@ -21,6 +21,7 @@
 #ifndef SEARCH_AND_RUN_H
 #define SEARCH_AND_RUN_H
 
+struct LayoutWindow;
 
 GtkWidget *search_and_run_new(LayoutWindow *lw);
 
index f45388e..f550971 100644 (file)
@@ -22,9 +22,9 @@
 #ifndef SEARCH_H
 #define SEARCH_H
 
+struct FileData;
 
 void search_new(FileData *dir_fd, FileData *example_file);
 
-
 #endif
 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
index 063e316..46d708f 100644 (file)
 #ifndef SECURE_SAVE_H
 #define SECURE_SAVE_H
 
+/**
+ * @enum SecureSaveErrno
+ * see err field in #SecureSaveInfo
+ */
+enum SecureSaveErrno {
+       SS_ERR_NONE = 0,
+       SS_ERR_DISABLED, /**< secsave is disabled. */
+       SS_ERR_OUT_OF_MEM, /**< memory allocation failure */
+
+       SS_ERR_OPEN_READ,
+       SS_ERR_OPEN_WRITE,
+       SS_ERR_STAT,
+       SS_ERR_ACCESS,
+       SS_ERR_MKSTEMP,
+       SS_ERR_RENAME,
+       SS_ERR_OTHER,
+};
+
 extern SecureSaveErrno secsave_errno; /**< internal secsave error number */
 
+struct SecureSaveInfo {
+       FILE *fp; /**< file stream pointer */
+       gchar *file_name; /**< final file name */
+       gchar *tmp_file_name; /**< temporary file name */
+       gint err; /**< set to non-zero value in case of error */
+       gboolean secure_save; /**< use secure save for this file, internal use only */
+       gboolean preserve_perms; /**< whether to preserve perms, TRUE by default */
+       gboolean preserve_mtime; /**< whether to preserve mtime, FALSE by default */
+       gboolean unlink_on_error; /**< whether to remove temporary file on save failure, TRUE by default */
+};
+
 SecureSaveInfo *secure_open(const gchar *);
 
 gint secure_close(SecureSaveInfo *);
index 3176905..c83bf78 100644 (file)
@@ -22,6 +22,8 @@
 #ifndef SHORTCUTS_H
 #define SHORTCUTS_H
 
+struct LayoutWindow;
+
 GtkWidget *shortcuts_new_default(LayoutWindow *lw);
 
 #endif
index 1ee17cb..15f8e47 100644 (file)
 #ifndef SLIDESHOW_H
 #define SLIDESHOW_H
 
+struct CollectInfo;
+struct CollectionData;
+struct ImageWindow;
+struct LayoutWindow;
 
 #define SLIDESHOW_SUBSECOND_PRECISION 10
 #define SLIDESHOW_MIN_SECONDS    0.1
  * CollectionData, then finally falls back to the layout listing.
  */
 
+struct SlideShowData
+{
+       LayoutWindow *lw;        /**< use this window to display the slideshow */
+       ImageWindow *imd;        /**< use this window only if lw is not available,
+                                   @FIXME it is probably required only by img-view.cc and should be dropped with it */
+
+       GList *filelist;
+       CollectionData *cd;
+       FileData *dir_fd;
+
+       GList *list;
+       GList *list_done;
+
+       FileData *slide_fd;
+
+       guint slide_count;
+       guint timeout_id; /**< event source id */
+
+       gboolean from_selection;
+
+       void (*stop_func)(SlideShowData *, gpointer);
+       gpointer stop_data;
+
+       gboolean paused;
+};
+
 void slideshow_free(SlideShowData *ss);
 
 gboolean slideshow_should_continue(SlideShowData *ss);
index b0ae69c..ef803d4 100644 (file)
@@ -94,9 +94,9 @@ ThumbLoaderStd *thumb_loader_std_new(gint width, gint height)
 }
 
 void thumb_loader_std_set_callbacks(ThumbLoaderStd *tl,
-                                   ThumbLoaderStdFunc func_done,
-                                   ThumbLoaderStdFunc func_error,
-                                   ThumbLoaderStdFunc func_progress,
+                                   ThumbLoaderStd::Func func_done,
+                                   ThumbLoaderStd::Func func_error,
+                                   ThumbLoaderStd::Func func_progress,
                                    gpointer data)
 {
        if (!tl) return;
index 9fd8fed..0c31ab7 100644 (file)
@@ -22,6 +22,8 @@
 #ifndef THUMB_STANDARD_H
 #define THUMB_STANDARD_H
 
+struct FileData;
+struct ImageLoader;
 
 #if GLIB_CHECK_VERSION (2, 34, 0)
 #define THUMB_FOLDER_GLOBAL "thumbnails"
@@ -35,9 +37,6 @@
 #define THUMB_NAME_EXTENSION ".png"
 
 
-struct ThumbLoaderStd;
-using ThumbLoaderStdFunc = void (*)(ThumbLoaderStd *, gpointer);
-
 struct ThumbLoaderStd
 {
        gboolean standard_loader;
@@ -65,9 +64,10 @@ struct ThumbLoaderStd
 
        gdouble progress;
 
-       ThumbLoaderStdFunc func_done;
-       ThumbLoaderStdFunc func_error;
-       ThumbLoaderStdFunc func_progress;
+       using Func = void (*)(ThumbLoaderStd *, gpointer);
+       Func func_done;
+       Func func_error;
+       Func func_progress;
 
        gpointer data;
 };
@@ -75,9 +75,9 @@ struct ThumbLoaderStd
 
 ThumbLoaderStd *thumb_loader_std_new(gint width, gint height);
 void thumb_loader_std_set_callbacks(ThumbLoaderStd *tl,
-                                   ThumbLoaderStdFunc func_done,
-                                   ThumbLoaderStdFunc func_error,
-                                   ThumbLoaderStdFunc func_progress,
+                                   ThumbLoaderStd::Func func_done,
+                                   ThumbLoaderStd::Func func_error,
+                                   ThumbLoaderStd::Func func_progress,
                                    gpointer data);
 void thumb_loader_std_set_cache(ThumbLoaderStd *tl, gboolean enable_cache, gboolean local, gboolean retry_failed);
 gboolean thumb_loader_std_start(ThumbLoaderStd *tl, FileData *fd);
index ffa5139..061d492 100644 (file)
@@ -296,9 +296,9 @@ static void thumb_loader_setup(ThumbLoader *tl, FileData *fd)
 }
 
 void thumb_loader_set_callbacks(ThumbLoader *tl,
-                               ThumbLoaderFunc func_done,
-                               ThumbLoaderFunc func_error,
-                               ThumbLoaderFunc func_progress,
+                               ThumbLoader::Func func_done,
+                               ThumbLoader::Func func_error,
+                               ThumbLoader::Func func_progress,
                                gpointer data)
 {
        if (!tl) return;
@@ -306,9 +306,9 @@ void thumb_loader_set_callbacks(ThumbLoader *tl,
        if (tl->standard_loader)
                {
                thumb_loader_std_set_callbacks(reinterpret_cast<ThumbLoaderStd *>(tl),
-                                              reinterpret_cast<ThumbLoaderStdFunc>(func_done),
-                                              reinterpret_cast<ThumbLoaderStdFunc>(func_error),
-                                              reinterpret_cast<ThumbLoaderStdFunc>(func_progress),
+                                              reinterpret_cast<ThumbLoaderStd::Func>(func_done),
+                                              reinterpret_cast<ThumbLoaderStd::Func>(func_error),
+                                              reinterpret_cast<ThumbLoaderStd::Func>(func_progress),
                                               data);
                return;
                }
index b82fa45..8ff8fa2 100644 (file)
 #ifndef THUMB_H
 #define THUMB_H
 
+struct FileData;
+struct ImageLoader;
+
+struct ThumbLoader
+{
+       gboolean standard_loader;
+
+       ImageLoader *il;
+       FileData *fd;           /**< fd->pixbuf contains final (scaled) image when done */
+
+       gboolean cache_enable;
+       gboolean cache_hit;
+       gdouble percent_done;
+
+       gint max_w;
+       gint max_h;
+
+       using Func = void (*)(ThumbLoader *, gpointer);
+       Func func_done;
+       Func func_error;
+       Func func_progress;
+
+       gpointer data;
+
+       guint idle_done_id; /**< event source id */
+};
+
 
 ThumbLoader *thumb_loader_new(gint width, gint height);
 void thumb_loader_set_callbacks(ThumbLoader *tl,
-                               ThumbLoaderFunc func_done,
-                               ThumbLoaderFunc func_error,
-                               ThumbLoaderFunc func_progress,
+                               ThumbLoader::Func func_done,
+                               ThumbLoader::Func func_error,
+                               ThumbLoader::Func func_progress,
                                gpointer data);
 void thumb_loader_set_cache(ThumbLoader *tl, gboolean enable_cache, gboolean local, gboolean retry_failed);
 
index 703d847..82eea52 100644 (file)
 #ifndef TOOLBAR_H
 #define TOOLBAR_H
 
+struct LayoutWindow;
+
 GtkWidget *toolbar_select_new(LayoutWindow *lw, ToolbarType bar);
 void toolbar_apply(ToolbarType bar);
+
 #endif
 
 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
index 3af878e..1b2e8aa 100644 (file)
@@ -28,11 +28,6 @@ enum ZoomMode {
        ZOOM_RESET_NONE         = 2
 };
 
-enum ZoomStyle {
-       ZOOM_GEOMETRIC  = 0,
-       ZOOM_ARITHMETIC = 1
-};
-
 enum ClipboardDestination {
        CLIPBOARD_TEXT_PLAIN    = 0,
        CLIPBOARD_TEXT_URI_LIST = 1,
@@ -90,16 +85,6 @@ enum SortType {
        SORT_CLASS
 };
 
-/**
- * @enum DnDAction
- * drag and drop default action
- */
-enum DnDAction {
-       DND_ACTION_ASK,
-       DND_ACTION_COPY,
-       DND_ACTION_MOVE
-};
-
 enum AlterType {
        ALTER_NONE,             /**< do nothing */
        ALTER_ROTATE_90,
@@ -109,25 +94,6 @@ enum AlterType {
        ALTER_FLIP,
 };
 
-enum LayoutLocation {
-       LAYOUT_HIDE   = 0,
-       LAYOUT_LEFT   = 1 << 0,
-       LAYOUT_RIGHT  = 1 << 1,
-       LAYOUT_TOP    = 1 << 2,
-       LAYOUT_BOTTOM = 1 << 3
-};
-
-
-enum ImageState {
-       IMAGE_STATE_NONE        = 0,
-       IMAGE_STATE_IMAGE       = 1 << 0,
-       IMAGE_STATE_LOADING     = 1 << 1,
-       IMAGE_STATE_ERROR       = 1 << 2,
-       IMAGE_STATE_COLOR_ADJ   = 1 << 3,
-       IMAGE_STATE_ROTATE_AUTO = 1 << 4,
-       IMAGE_STATE_ROTATE_USER = 1 << 5,
-       IMAGE_STATE_DELAY_FLIP  = 1 << 6
-};
 
 enum ImageSplitMode {
        SPLIT_NONE = 0,
@@ -137,15 +103,6 @@ enum ImageSplitMode {
        SPLIT_QUAD,
 };
 
-enum FileDataChangeType {
-       FILEDATA_CHANGE_DELETE,
-       FILEDATA_CHANGE_MOVE,
-       FILEDATA_CHANGE_RENAME,
-       FILEDATA_CHANGE_COPY,
-       FILEDATA_CHANGE_UNSPECIFIED,
-       FILEDATA_CHANGE_WRITE_METADATA
-};
-
 enum MarkToSelectionMode {
        MTS_MODE_MINUS,
        MTS_MODE_SET,
@@ -173,30 +130,6 @@ enum FileFormatClass {
 
 extern const gchar *format_class_list[]; /**< defined in preferences.cc */
 
-/**
- * @enum SecureSaveErrno
- * see err field in #SecureSaveInfo
- */
-enum SecureSaveErrno {
-       SS_ERR_NONE = 0,
-       SS_ERR_DISABLED, /**< secsave is disabled. */
-       SS_ERR_OUT_OF_MEM, /**< memory allocation failure */
-
-       SS_ERR_OPEN_READ,
-       SS_ERR_OPEN_WRITE,
-       SS_ERR_STAT,
-       SS_ERR_ACCESS,
-       SS_ERR_MKSTEMP,
-       SS_ERR_RENAME,
-       SS_ERR_OTHER,
-};
-
-enum NotifyPriority {
-       NOTIFY_PRIORITY_HIGH = 0,
-       NOTIFY_PRIORITY_MEDIUM,
-       NOTIFY_PRIORITY_LOW
-};
-
 enum NotifyType {
        NOTIFY_MARKS            = 1 << 1, /**< changed marks */
        NOTIFY_PIXBUF           = 1 << 2, /**< image was read into fd->pixbuf */
@@ -232,12 +165,6 @@ enum MetadataFormat {
        METADATA_FORMATTED      = 1  /**< for display only */
 };
 
-enum StartUpPath {
-       STARTUP_PATH_CURRENT    = 0,
-       STARTUP_PATH_LAST,
-       STARTUP_PATH_HOME,
-};
-
 enum ToolbarType {
        TOOLBAR_MAIN,
        TOOLBAR_STATUS,
@@ -290,854 +217,9 @@ enum StereoPixbufData {
        STEREO_PIXBUF_NONE     = 3
 };
 
-enum SortModeType {
-       BAR_SORT_MODE_FOLDER = 0,
-       BAR_SORT_MODE_COLLECTION,
-       BAR_SORT_MODE_COUNT
-};
-
-enum SortActionType {
-       BAR_SORT_COPY = 0,
-       BAR_SORT_MOVE,
-       BAR_SORT_FILTER,
-       BAR_SORT_ACTION_COUNT
-};
-
-enum SortSelectionType {
-       BAR_SORT_SELECTION_IMAGE = 0,
-       BAR_SORT_SELECTION_SELECTED,
-       BAR_SORT_SELECTION_COUNT
-};
-
-#define MAX_SPLIT_IMAGES 4
-
-enum SelectionType {
-       SELECTION_NONE          = 0,
-       SELECTION_SELECTED      = 1 << 0,
-       SELECTION_PRELIGHT      = 1 << 1,
-       SELECTION_FOCUS         = 1 << 2
-};
-
-struct ImageLoader;
-struct ThumbLoader;
-
-struct AnimationData;
-
-struct CollectInfo;
-struct CollectionData;
-struct CollectTable;
-struct CollectWindow;
-
-struct ImageWindow;
-
-struct FileData;
-struct FileDataChangeInfo;
-
-struct LayoutWindow;
-struct LayoutOptions;
-
-struct ViewDir;
-struct ViewDirInfoList;
-struct ViewDirInfoTree;
-
-struct ViewFile;
-struct ViewFileInfoList;
-struct ViewFileInfoIcon;
-
-struct SlideShowData;
-struct FullScreenData;
-
-struct PixmapFolders;
-struct Histogram;
-struct HistMap;
-
-struct SecureSaveInfo;
-
-struct ExifData;
-
-struct EditorDescription;
-
-struct CommandLine;
-
-struct Histogram {
-       gint histogram_channel; /**< drawing mode for histogram */
-       gint histogram_mode;     /**< logarithmical or not */
-       guint vgrid; /**< number of vertical divisions, 0 for none */
-       guint hgrid; /**< number of horizontal divisions, 0 for none */
-       struct {
-               int R; /**< red */
-               int G; /**< green */
-               int B; /**< blue */
-               int A; /**< alpha */
-       } grid_color;  /**< grid color */
-
-};
-
-
-
-struct ImageLoader;
-
-using ThumbLoaderFunc = void (*)(ThumbLoader *, gpointer);
-
 using FileUtilDoneFunc = void (*)(gboolean, const gchar *, gpointer);
 
-struct ThumbLoader
-{
-       gboolean standard_loader;
-
-       ImageLoader *il;
-       FileData *fd;           /**< fd->pixbuf contains final (scaled) image when done */
-
-       gboolean cache_enable;
-       gboolean cache_hit;
-       gdouble percent_done;
-
-       gint max_w;
-       gint max_h;
-
-       ThumbLoaderFunc func_done;
-       ThumbLoaderFunc func_error;
-       ThumbLoaderFunc func_progress;
-
-       gpointer data;
-
-       guint idle_done_id; /**< event source id */
-};
-
-struct ActionItem
-{
-       const gchar *name; /* GtkActionEntry terminology */
-       const gchar *label;
-       const gchar *icon_name;
-};
-
-struct AnimationData
-{
-       ImageWindow *iw;
-       LayoutWindow *lw;
-       GdkPixbufAnimation *gpa;
-       GdkPixbufAnimationIter *iter;
-       GdkPixbuf *gpb;
-       FileData *data_adr;
-       gint delay;
-       gboolean valid;
-       GCancellable *cancellable;
-       GFile *in_file;
-       GFileInputStream *gfstream;
-};
-
-struct CollectInfo
-{
-       FileData *fd;
-       GdkPixbuf *pixbuf;
-       guint flag_mask;
-};
-
-struct CollectionData
-{
-       gchar *path;
-       gchar *name;
-       GList *list;
-       SortType sort_method;
-
-       ThumbLoader *thumb_loader;
-       CollectInfo *thumb_info;
-
-       void (*info_updated_func)(CollectionData *, CollectInfo *, gpointer);
-       gpointer info_updated_data;
-
-       gint ref;
-
-       /* geometry */
-       gint window_read;
-       gint window_x;
-       gint window_y;
-       gint window_w;
-       gint window_h;
-
-       gboolean changed; /**< contents changed since save flag */
-
-       GHashTable *existence;
-
-       GtkWidget *dialog_name_entry;
-       gchar *collection_path; /**< Full path to collection including extension */
-       gint collection_append_index;
-};
-
-struct CollectTable
-{
-       GtkWidget *scrolled;
-       GtkWidget *listview;
-       gint columns;
-       gint rows;
-
-       CollectionData *cd;
-
-       GList *selection;
-       CollectInfo *prev_selection;
-
-       CollectInfo *click_info;
-
-       GtkWidget *tip_window;
-       guint tip_delay_id; /**< event source id */
-       CollectInfo *tip_info;
-
-       GdkWindow *marker_window;
-       CollectInfo *marker_info;
-
-       GtkWidget *status_label;
-       GtkWidget *extra_label;
-
-       gint focus_row;
-       gint focus_column;
-       CollectInfo *focus_info;
-
-       GtkWidget *popup;
-       CollectInfo *drop_info;
-       GList *drop_list;
-
-       guint sync_idle_id; /**< event source id */
-       guint drop_idle_id; /**< event source id */
-
-       gboolean show_text;
-       gboolean show_stars;
-
-       GList *editmenu_fd_list; /**< file list for edit menu */
-};
-
-struct CollectWindow
-{
-       GtkWidget *window;
-       CollectTable *table;
-       GtkWidget *status_box;
-
-       GtkWidget *close_dialog;
-
-       CollectionData *cd;
-};
-
-using ImageTileRequestFunc = gint (*)(ImageWindow *, gint, gint, gint, gint, GdkPixbuf *, gpointer);
-using ImageTileDisposeFunc = void (*)(ImageWindow *, gint, gint, gint, gint, GdkPixbuf *, gpointer);
-
-struct ImageWindow
-{
-       GtkWidget *widget;      /**< use this to add it and show it */
-       GtkWidget *pr;
-       GtkWidget *frame;
-
-       FileData *image_fd;
-
-       gboolean unknown;               /**< failed to load image */
-
-       ImageLoader *il;        /**< @FIXME image loader should probably go to FileData, but it must first support
-                                  sending callbacks to multiple ImageWindows in parallel */
-
-       gint has_frame;  /**< not boolean, see image_new() */
-
-       /* top level (not necessarily parent) window */
-       gboolean top_window_sync;       /**< resize top_window when image dimensions change */
-       GtkWidget *top_window;  /**< window that gets title, and window to resize when 'fitting' */
-       gchar *title;           /**< window title to display left of file name */
-       gchar *title_right;     /**< window title to display right of file name */
-       gboolean title_show_zoom;       /**< option to include zoom in window title */
-
-       gboolean completed;
-       ImageState state;       /**< mask of IMAGE_STATE_* flags about current image */
-
-       void (*func_update)(ImageWindow *imd, gpointer data);
-       void (*func_complete)(ImageWindow *imd, gint preload, gpointer data);
-       void (*func_state)(ImageWindow *imd, ImageState state, gpointer data);
-       ImageTileRequestFunc func_tile_request;
-       ImageTileDisposeFunc func_tile_dispose;
-
-       gpointer data_update;
-       gpointer data_complete;
-       gpointer data_state;
-       gpointer data_tile;
-
-       /* button, scroll functions */
-       void (*func_button)(ImageWindow *, GdkEventButton *event, gpointer);
-       void (*func_drag)(ImageWindow *, GdkEventMotion *event, gdouble dx, gdouble dy, gpointer);
-       void (*func_scroll)(ImageWindow *, GdkEventScroll *event, gpointer);
-       void (*func_focus_in)(ImageWindow *, gpointer);
-
-       gpointer data_button;
-       gpointer data_drag;
-       gpointer data_scroll;
-       gpointer data_focus_in;
-
-       /**
-        * @headerfile func_scroll_notify
-        * scroll notification (for scroll bar implementation)
-        */
-       void (*func_scroll_notify)(ImageWindow *, gint x, gint y, gint width, gint height, gpointer);
-
-       gpointer data_scroll_notify;
-
-       /* collection info */
-       CollectionData *collection;
-       CollectInfo *collection_info;
-
-       /* color profiles */
-       gboolean color_profile_enable;
-       gint color_profile_input;
-       gboolean color_profile_use_image;
-       gint color_profile_from_image;
-       gpointer cm;
-
-       AlterType delay_alter_type;
-
-       FileData *read_ahead_fd;
-       ImageLoader *read_ahead_il;
-
-       gint prev_color_row;
-
-       gboolean auto_refresh;
-
-       gboolean delay_flip;
-       gint orientation;
-       gboolean desaturate;
-       gboolean overunderexposed;
-       gint user_stereo;
-
-       gboolean mouse_wheel_mode;
-};
-
 #define FILEDATA_MARKS_SIZE 10
 
-struct FileDataChangeInfo {
-       FileDataChangeType type;
-       gchar *source;
-       gchar *dest;
-       gint error;
-       gboolean regroup_when_finished;
-};
-
-struct FileData {
-       guint magick;
-       gint type;
-       gchar *original_path; /**< key to file_data_pool hash table */
-       gchar *path;
-       const gchar *name;
-       const gchar *extension;
-       gchar *extended_extension;
-       FileFormatClass format_class;
-       gchar *format_name; /**< set by the image loader */
-       gchar *collate_key_name;
-       gchar *collate_key_name_nocase;
-       gchar *collate_key_name_natural;
-       gchar *collate_key_name_nocase_natural;
-       gint64 size;
-       time_t date;
-       time_t cdate;
-       mode_t mode; /**< this is needed at least for notification in view_dir because it is preserved after the file/directory is deleted */
-       gint sidecar_priority;
-
-       guint marks; /**< each bit represents one mark */
-       guint valid_marks; /**< zero bit means that the corresponding mark needs to be reread */
-
-
-       GList *sidecar_files;
-       FileData *parent; /**< parent file if this is a sidecar file, NULL otherwise */
-       FileDataChangeInfo *change; /**< for rename, move ... */
-       GdkPixbuf *thumb_pixbuf;
-
-       GdkPixbuf *pixbuf; /**< full-size image, only complete images, NULL during loading
-                             all FileData with non-NULL pixbuf are referenced by image_cache */
-
-       HistMap *histmap;
-
-       gboolean locked;
-       gint ref;
-       gint version; /**< increased when any field in this structure is changed */
-       gboolean disable_grouping;
-
-       gint user_orientation;
-       gint exif_orientation;
-
-       ExifData *exif;
-       time_t exifdate;
-       time_t exifdate_digitized;
-       GHashTable *modified_xmp; /**< hash table which contains unwritten xmp metadata in format: key->list of string values */
-       GList *cached_metadata;
-       gint rating;
-       gboolean metadata_in_idle_loaded;
-
-       gchar *owner;
-       gchar *group;
-       gchar *sym_link;
-
-       SelectionType selected;  /**< Used by view-file-icon. */
-
-       gint page_num;
-       gint page_total;
-};
-
-struct LayoutOptions
-{
-       gchar *id;
-
-       gchar *order;
-       gint style;
-
-       DirViewType dir_view_type;
-       FileViewType file_view_type;
-
-       struct {
-               SortType method;
-               gboolean ascend;
-               gboolean case_sensitive;
-       } dir_view_list_sort;
-
-       struct {
-               SortType method;
-               gboolean ascend;
-               gboolean case_sensitive;
-       } file_view_list_sort;
-
-       gboolean show_thumbnails;
-       gboolean show_marks;
-       gboolean show_file_filter;
-       gboolean show_directory_date;
-       gboolean show_info_pixel;
-       gboolean split_pane_sync;
-       gboolean ignore_alpha;
-
-       struct {
-               gint w;
-               gint h;
-               gint x;
-               gint y;
-               gboolean maximized;
-               gint hdivider_pos;
-               gint vdivider_pos;
-       } main_window;
-
-       struct {
-               gint w;
-               gint h;
-               gint x;
-               gint y;
-               gint vdivider_pos;
-       } float_window;
-
-       struct {
-               gint vdivider_pos;
-       } folder_window;
-
-       struct {
-               gint w;
-               gint h;
-       } properties_window;
-
-       struct {
-               guint state;
-               gint histogram_channel;
-               gint histogram_mode;
-       } image_overlay;
-
-       struct {
-               gint w;
-               gint h;
-               gint x;
-               gint y;
-       } log_window;
-
-       struct {
-               gint w;
-               gint h;
-               gint x;
-               gint y;
-               gint page_number;
-       } preferences_window;
-
-       struct {
-               gint w;
-               gint h;
-               gint x;
-               gint y;
-       } search_window;
-
-       struct {
-               gint w;
-               gint h;
-               gint x;
-               gint y;
-       } dupe_window;
-
-       struct {
-               gint w;
-               gint h;
-               gint x;
-               gint y;
-       } advanced_exif_window;
-
-       gboolean tools_float;
-       gboolean tools_hidden;
-       gboolean toolbar_hidden;
-
-       struct {
-               gboolean info;
-               gboolean sort;
-               gboolean tools_float;
-               gboolean tools_hidden;
-               gboolean hidden;
-       } bars_state;
-
-       gchar *home_path;
-       gchar *last_path;
-
-       StartUpPath startup_path;
-
-       gboolean animate;
-       gint workspace;
-
-       SortActionType action;
-       SortModeType mode;
-       SortSelectionType selection;
-       gchar *filter_key;
-};
-
-struct LayoutWindow
-{
-       LayoutOptions options;
-
-       FileData *dir_fd;
-
-       /* base */
-
-       GtkWidget *window;
-
-       GtkWidget *main_box;
-
-       GtkWidget *group_box;
-       GtkWidget *h_pane;
-       GtkWidget *v_pane;
-
-       /* menus, path selector */
-
-       GtkActionGroup *action_group;
-       GtkActionGroup *action_group_editors;
-       guint ui_editors_id;
-       GtkUIManager *ui_manager;
-       guint toolbar_merge_id[TOOLBAR_COUNT];
-       GList *toolbar_actions[TOOLBAR_COUNT];
-
-       GtkWidget *path_entry;
-
-       /* image */
-
-       LayoutLocation image_location;
-
-       ImageWindow *image;
-
-       ImageWindow *split_images[MAX_SPLIT_IMAGES];
-       ImageSplitMode split_mode;
-       gint active_split_image;
-
-       GtkWidget *split_image_widget;
-       GtkSizeGroup *split_image_sizegroup;
-
-       /* tools window (float) */
-
-       GtkWidget *tools;
-       GtkWidget *tools_pane;
-
-       GtkWidget *menu_tool_bar; /**< Combined menu and toolbar box */
-       GtkWidget *menu_bar; /**< referenced by lw, exist during whole lw lifetime */
-       /* toolbar */
-
-       GtkWidget *toolbar[TOOLBAR_COUNT]; /**< referenced by lw, exist during whole lw lifetime */
-
-       GtkWidget *back_button;
-
-       /* dir view */
-
-       LayoutLocation dir_location;
-
-       ViewDir *vd;
-       GtkWidget *dir_view;
-
-       /* file view */
-
-       LayoutLocation file_location;
-
-       ViewFile *vf;
-
-       GtkWidget *file_view;
-
-       GtkWidget *info_box; /**< status bar */
-       GtkWidget *info_progress_bar; /**< status bar */
-       GtkWidget *info_sort; /**< status bar */
-       GtkWidget *info_status; /**< status bar */
-       GtkWidget *info_details; /**< status bar */
-       GtkWidget *info_zoom; /**< status bar */
-       GtkWidget *info_pixel; /**< status bar */
-
-       /* slide show */
-
-       SlideShowData *slideshow;
-
-       /* full screen */
-
-       FullScreenData *full_screen;
-
-       /* misc */
-
-       GtkWidget *utility_box; /**< referenced by lw, exist during whole lw lifetime */
-       GtkWidget *utility_paned; /**< between image and bar */
-       GtkWidget *bar_sort;
-       GtkWidget *bar;
-
-       gboolean bar_sort_enabled; /**< Set during start-up, and checked when the editors have loaded */
-
-       GtkWidget *exif_window;
-       GtkWidget *sar_window; /**< Search and Run window */
-
-       AnimationData *animation;
-
-       GtkWidget *log_window;
-};
-
-struct ViewDir
-{
-       DirViewType type;
-       gpointer info;
-
-       GtkWidget *widget;
-       GtkWidget *view;
-
-       FileData *dir_fd;
-
-       FileData *click_fd;
-
-       FileData *drop_fd;
-       GList *drop_list;
-       guint drop_scroll_id; /**< event source id */
-
-       /* func list */
-       void (*select_func)(ViewDir *vd, FileData *fd, gpointer data);
-       gpointer select_data;
-
-       void (*dnd_drop_update_func)(ViewDir *vd);
-       void (*dnd_drop_leave_func)(ViewDir *vd);
-
-       LayoutWindow *layout;
-
-       GtkWidget *popup;
-
-       PixmapFolders *pf;
-};
-
-struct ViewDirInfoList
-{
-       GList *list;
-};
-
-struct ViewDirInfoTree
-{
-       guint drop_expand_id; /**< event source id */
-       gint busy_ref;
-};
-
-
-struct ViewFile
-{
-       FileViewType type;      /**< @todo (xsdg): Turn this into a union (see VFLIST and VFICON from view-file.h). */
-
-       gpointer info;
-
-       GtkWidget *widget;
-       GtkWidget *listview;
-       GtkWidget *scrolled;
-       GtkWidget *filter;
-       GtkWidget *filter_check[FILEDATA_MARKS_SIZE];
-
-       struct {
-               GtkWidget *combo;
-               GtkWidget *frame;
-               gint count;
-               gint last_selected;
-               gboolean case_sensitive;
-       } file_filter;
-
-       FileData *dir_fd;
-       GList *list;
-
-       SortType sort_method;
-       gboolean sort_ascend;
-       gboolean sort_case;
-
-       /* func list */
-       void (*func_thumb_status)(ViewFile *vf, gdouble val, const gchar *text, gpointer data);
-       gpointer data_thumb_status;
-
-       void (*func_status)(ViewFile *vf, gpointer data);
-       gpointer data_status;
-
-       LayoutWindow *layout;
-
-       GtkWidget *popup;
-
-       /* thumbs updates*/
-       gboolean thumbs_running;
-       ThumbLoader *thumbs_loader;
-       FileData *thumbs_filedata;
-
-       /* marks */
-       gboolean marks_enabled;
-       gint active_mark;
-       gint clicked_mark;
-
-       /* stars */
-       FileData *stars_filedata;
-       guint stars_id;
-
-       /* refresh */
-       guint refresh_idle_id; /**< event source id */
-       time_t time_refresh_set; /**< time when refresh_idle_id was set */
-
-       GList *editmenu_fd_list; /**< file list for edit menu */
-
-       guint read_metadata_in_idle_id;
-};
-
-struct ViewFileInfoList
-{
-       FileData *click_fd;
-       FileData *select_fd;
-
-       gboolean thumbs_enabled;
-
-       guint select_idle_id; /**< event source id */
-};
-
-struct ViewFileInfoIcon
-{
-       /* table stuff */
-       gint columns;
-       gint rows;
-
-       GList *selection;
-       FileData *prev_selection;
-
-       GtkWidget *tip_window;
-       guint tip_delay_id; /**< event source id */
-       FileData *tip_fd;
-
-       FileData *click_fd;
-
-       FileData *focus_fd;
-       gint focus_row;
-       gint focus_column;
-
-       gboolean show_text;
-};
-
-struct SlideShowData
-{
-       LayoutWindow *lw;        /**< use this window to display the slideshow */
-       ImageWindow *imd;        /**< use this window only if lw is not available,
-                                   @FIXME it is probably required only by img-view.cc and should be dropped with it */
-
-       GList *filelist;
-       CollectionData *cd;
-       FileData *dir_fd;
-
-       GList *list;
-       GList *list_done;
-
-       FileData *slide_fd;
-
-       guint slide_count;
-       guint timeout_id; /**< event source id */
-
-       gboolean from_selection;
-
-       void (*stop_func)(SlideShowData *, gpointer);
-       gpointer stop_data;
-
-       gboolean paused;
-};
-
-struct FullScreenData
-{
-       GtkWidget *window;
-       ImageWindow *imd;
-
-       GtkWidget *normal_window;
-       ImageWindow *normal_imd;
-
-       guint hide_mouse_id; /**< event source id */
-       guint busy_mouse_id; /**< event source id */
-
-       gint cursor_state;
-
-       guint saver_block_id; /**< event source id */
-
-       void (*stop_func)(FullScreenData *, gpointer);
-       gpointer stop_data;
-
-       gboolean same_region; /**< the returned region will overlap the current location of widget. */
-};
-
-struct PixmapFolders
-{
-       GdkPixbuf *close;
-       GdkPixbuf *open;
-       GdkPixbuf *deny;
-       GdkPixbuf *parent;
-       GdkPixbuf *link;
-       GdkPixbuf *read_only;
-};
-
-struct SecureSaveInfo {
-       FILE *fp; /**< file stream pointer */
-       gchar *file_name; /**< final file name */
-       gchar *tmp_file_name; /**< temporary file name */
-       gint err; /**< set to non-zero value in case of error */
-       gboolean secure_save; /**< use secure save for this file, internal use only */
-       gboolean preserve_perms; /**< whether to preserve perms, TRUE by default */
-       gboolean preserve_mtime; /**< whether to preserve mtime, FALSE by default */
-       gboolean unlink_on_error; /**< whether to remove temporary file on save failure, TRUE by default */
-};
-
-struct CommandLine
-{
-       int argc;
-       gchar **argv;
-       gboolean startup_blank;
-       gboolean startup_full_screen;
-       gboolean startup_in_slideshow;
-       gboolean startup_command_line_collection;
-       gboolean tools_hide;
-       gboolean tools_show;
-       gboolean log_window_show;
-       gchar *path;
-       gchar *file;
-       GList *cmd_list;
-       GList *collection_list;
-       gchar *geometry;
-       gchar *regexp;
-       gchar *log_file;
-       SecureSaveInfo *ssi;
-       gboolean new_instance;
-};
-
-/**
- * @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
- *
- */
-struct hard_coded_window_keys {
-       GdkModifierType mask; /**< modifier key mask */
-       guint key_value;  /**< GDK_keyval */
-       const gchar *text;  /**< menu item label - NULL if end of list */
-};
-
 #endif
 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
index 4783d33..c638722 100644 (file)
 #define UI_MENU_H
 
 
+/**
+ * @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
+ *
+ */
+struct hard_coded_window_keys {
+       GdkModifierType mask; /**< modifier key mask */
+       guint key_value;  /**< GDK_keyval */
+       const gchar *text;  /**< menu item label - NULL if end of list */
+};
+
 GtkWidget *menu_item_add(GtkWidget *menu, const gchar *label,
                         GCallback func, gpointer data);
 GtkWidget *menu_item_add_stock(GtkWidget *menu, const gchar *label, const gchar *stock_id,
index ad8d9a1..bae5418 100644 (file)
@@ -228,6 +228,13 @@ GtkWidget *pref_color_button_new(GtkWidget *parent_box,
 gchar *text_widget_text_pull(GtkWidget *text_widget);
 gchar *text_widget_text_pull_selected(GtkWidget *text_widget);
 
+struct ActionItem
+{
+       const gchar *name; /* GtkActionEntry terminology */
+       const gchar *label;
+       const gchar *icon_name;
+};
+
 GList* get_action_items();
 void action_items_free(GList *list);
 
index fe97e5b..f6588cc 100644 (file)
@@ -22,6 +22,7 @@
 #ifndef UI_UTILDLG_H
 #define UI_UTILDLG_H
 
+struct FileData;
 
 #define GENERIC_DIALOG(gd) ((GenericDialog *)gd)
 
index 04424dc..5195a6f 100644 (file)
@@ -25,6 +25,8 @@
 
 #include "ui-utildlg.h"
 
+struct FileData;
+
 void file_maint_renamed(FileData *fd);
 void file_maint_moved(FileData *fd, GList *ignore_list);
 void file_maint_copied(FileData *fd);
index 61ebab0..1cb86d6 100644 (file)
 #include "view-dir-list.h"
 
 #include "filedata.h"
+#include "layout.h"
 #include "ui-fileops.h"
 #include "ui-tree-edit.h"
 #include "view-dir.h"
 
+struct ViewDirInfoList
+{
+       GList *list;
+};
+
 #define VDLIST(_vd_) ((ViewDirInfoList *)(_vd_->info))
 
 
index db41c0c..fad98c5 100644 (file)
@@ -22,6 +22,8 @@
 #ifndef VIEW_DIR_LIST_H
 #define VIEW_DIR_LIST_H
 
+struct FileData;
+struct ViewDir;
 
 ViewDir *vdlist_new(ViewDir *vd, FileData *dir_fd);
 
index a7b58e8..8cbd73f 100644 (file)
 #include "view-dir-tree.h"
 
 #include "filedata.h"
+#include "layout.h"
 #include "ui-fileops.h"
 #include "ui-tree-edit.h"
 #include "view-dir.h"
 
+struct ViewDirInfoTree
+{
+       guint drop_expand_id; /**< event source id */
+       gint busy_ref;
+};
+
 #define VDTREE(_vd_) ((ViewDirInfoTree *)(_vd_->info))
 
 
index e6e12e0..9b784f5 100644 (file)
@@ -22,6 +22,9 @@
 #ifndef VIEW_DIR_TREE_H
 #define VIEW_DIR_TREE_H
 
+struct FileData;
+struct ViewDir;
+
 struct NodeData
 {
        FileData *fd;
index f099872..bcf2bfa 100644 (file)
@@ -21,6 +21,9 @@
 #ifndef VIEW_DIR_H
 #define VIEW_DIR_H
 
+struct FileData;
+struct LayoutWindow;
+
 enum {
        DIR_COLUMN_POINTER = 0,
        DIR_COLUMN_ICON,
@@ -31,6 +34,46 @@ enum {
        DIR_COLUMN_COUNT
 };
 
+struct PixmapFolders
+{
+       GdkPixbuf *close;
+       GdkPixbuf *open;
+       GdkPixbuf *deny;
+       GdkPixbuf *parent;
+       GdkPixbuf *link;
+       GdkPixbuf *read_only;
+};
+
+struct ViewDir
+{
+       DirViewType type;
+       gpointer info;
+
+       GtkWidget *widget;
+       GtkWidget *view;
+
+       FileData *dir_fd;
+
+       FileData *click_fd;
+
+       FileData *drop_fd;
+       GList *drop_list;
+       guint drop_scroll_id; /**< event source id */
+
+       /* func list */
+       void (*select_func)(ViewDir *vd, FileData *fd, gpointer data);
+       gpointer select_data;
+
+       void (*dnd_drop_update_func)(ViewDir *vd);
+       void (*dnd_drop_leave_func)(ViewDir *vd);
+
+       LayoutWindow *layout;
+
+       GtkWidget *popup;
+
+       PixmapFolders *pf;
+};
+
 ViewDir *vd_new(LayoutWindow *lw);
 
 void vd_set_select_func(ViewDir *vdl, void (*func)(ViewDir *vdl, FileData *fd, gpointer data), gpointer data);
index 39bd0c8..eeea7da 100644 (file)
 #ifndef VIEW_FILE_H
 #define VIEW_FILE_H
 
+struct FileData;
+struct LayoutWindow;
+struct ThumbLoader;
+
+struct ViewFile
+{
+       FileViewType type;      /**< @todo (xsdg): Turn this into a union (see VFLIST and VFICON). */
+
+       gpointer info;
+
+       GtkWidget *widget;
+       GtkWidget *listview;
+       GtkWidget *scrolled;
+       GtkWidget *filter;
+       GtkWidget *filter_check[FILEDATA_MARKS_SIZE];
+
+       struct {
+               GtkWidget *combo;
+               GtkWidget *frame;
+               gint count;
+               gint last_selected;
+               gboolean case_sensitive;
+       } file_filter;
+
+       FileData *dir_fd;
+       GList *list;
+
+       SortType sort_method;
+       gboolean sort_ascend;
+       gboolean sort_case;
+
+       /* func list */
+       void (*func_thumb_status)(ViewFile *vf, gdouble val, const gchar *text, gpointer data);
+       gpointer data_thumb_status;
+
+       void (*func_status)(ViewFile *vf, gpointer data);
+       gpointer data_status;
+
+       LayoutWindow *layout;
+
+       GtkWidget *popup;
+
+       /* thumbs updates*/
+       gboolean thumbs_running;
+       ThumbLoader *thumbs_loader;
+       FileData *thumbs_filedata;
+
+       /* marks */
+       gboolean marks_enabled;
+       gint active_mark;
+       gint clicked_mark;
+
+       /* stars */
+       FileData *stars_filedata;
+       guint stars_id;
+
+       /* refresh */
+       guint refresh_idle_id; /**< event source id */
+       time_t time_refresh_set; /**< time when refresh_idle_id was set */
+
+       GList *editmenu_fd_list; /**< file list for edit menu */
+
+       guint read_metadata_in_idle_id;
+};
+
+struct ViewFileInfoList
+{
+       FileData *click_fd;
+       FileData *select_fd;
+
+       gboolean thumbs_enabled;
+
+       guint select_idle_id; /**< event source id */
+};
+
+struct ViewFileInfoIcon
+{
+       /* table stuff */
+       gint columns;
+       gint rows;
+
+       GList *selection;
+       FileData *prev_selection;
+
+       GtkWidget *tip_window;
+       guint tip_delay_id; /**< event source id */
+       FileData *tip_fd;
+
+       FileData *click_fd;
+
+       FileData *focus_fd;
+       gint focus_row;
+       gint focus_column;
+
+       gboolean show_text;
+};
+
 #define VFLIST(_vf_) ((ViewFileInfoList *)(_vf_->info))
 #define VFICON(_vf_) ((ViewFileInfoIcon *)(_vf_->info))
 
index 2eea08f..14fa652 100644 (file)
@@ -24,6 +24,8 @@
 
 #include "filedata.h"
 
+struct ViewFile;
+
 gboolean vficon_press_key_cb(GtkWidget *widget, GdkEventKey *event, gpointer data);
 gboolean vficon_press_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data);
 gboolean vficon_release_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data);
index 394fab8..22f0e0c 100644 (file)
@@ -24,6 +24,8 @@
 
 #include "filedata.h"
 
+struct ViewFile;
+
 gboolean vflist_press_key_cb(GtkWidget *widget, GdkEventKey *event, gpointer data);
 gboolean vflist_press_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data);
 gboolean vflist_release_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data);