Additional debug features
[geeqie.git] / src / typedefs.h
index 76f3e12..f7725f2 100644 (file)
@@ -1,16 +1,24 @@
 /*
- * Geeqie
- * (C) 2006 John Ellis
- * Copyright (C) 2008 - 2009 The Geeqie Team
+ * Copyright (C) 2006 John Ellis
+ * Copyright (C) 2008 - 2016 The Geeqie Team
  *
  * Author: John Ellis
  *
- * This software is released under the GNU General Public License (GNU GPL).
- * Please read the included file COPYING for more information.
- * This software comes with no warranty of any kind, use at your own risk!
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-
 #ifndef TYPEDEFS_H
 #define TYPEDEFS_H
 
@@ -30,12 +38,18 @@ typedef enum {
 
 typedef enum {
        DIRVIEW_LIST,
-       DIRVIEW_TREE
+       DIRVIEW_TREE,
+
+       // Keep this up to date!
+       DIRVIEW_LAST = DIRVIEW_TREE
 } DirViewType;
 
 typedef enum {
        FILEVIEW_LIST,
-       FILEVIEW_ICON
+       FILEVIEW_ICON,
+
+       // Keep this up to date!
+       FILEVIEW_LAST = FILEVIEW_ICON
 } FileViewType;
 
 #define        CMD_COPY     "geeqie-copy-command.desktop"
@@ -49,8 +63,11 @@ typedef enum {
        SORT_NAME,
        SORT_SIZE,
        SORT_TIME,
+       SORT_CTIME,
        SORT_PATH,
-       SORT_NUMBER
+       SORT_NUMBER,
+       SORT_EXIFTIME,
+       SORT_RATING
 } SortType;
 
 typedef enum {
@@ -60,7 +77,6 @@ typedef enum {
        ALTER_ROTATE_180,
        ALTER_MIRROR,
        ALTER_FLIP,
-       ALTER_DESATURATE
 } AlterType;
 
 typedef enum {
@@ -140,11 +156,16 @@ typedef enum {
        NOTIFY_PRIORITY_MEDIUM,
        NOTIFY_PRIORITY_LOW
 } NotifyPriority;
-       
+
 typedef enum {
-       NOTIFY_TYPE_INTERNAL = 0, /* changed internal data only, like marks */
-       NOTIFY_TYPE_REREAD,       /* changed file size, date, etc., file name remains unchanged */
-       NOTIFY_TYPE_CHANGE        /* generic change described by fd->change */
+       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 */
+       NOTIFY_ORIENTATION      = 1 << 4, /* image was rotated */
+       NOTIFY_METADATA         = 1 << 5, /* changed image metadata, not yet written */
+       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 {
@@ -153,22 +174,89 @@ typedef enum {
        CHANGE_WARN_NO_WRITE_PERM      = 1 << 1,
        CHANGE_WARN_SAME               = 1 << 2,
        CHANGE_WARN_CHANGED_EXT        = 1 << 3,
-       CHANGE_ERROR_MASK              = (~0) << 4, /* the values below are fatal errors */
-       CHANGE_NO_READ_PERM            = 1 << 4,
-       CHANGE_NO_WRITE_PERM_DIR       = 1 << 5,
-       CHANGE_NO_DEST_DIR             = 1 << 6,
-       CHANGE_NO_WRITE_PERM_DEST_DIR  = 1 << 7,
-       CHANGE_NO_WRITE_PERM_DEST      = 1 << 8,
-       CHANGE_DEST_EXISTS             = 1 << 9,
-       CHANGE_NO_SRC                  = 1 << 10,
+       CHANGE_WARN_UNSAVED_META       = 1 << 4,
+       CHANGE_WARN_NO_WRITE_PERM_DEST_DIR  = 1 << 5,
+       CHANGE_ERROR_MASK              = (~0U) << 8, /* the values below are fatal errors */
+       CHANGE_NO_READ_PERM            = 1 << 8,
+       CHANGE_NO_WRITE_PERM_DIR       = 1 << 9,
+       CHANGE_NO_DEST_DIR             = 1 << 10,
+       CHANGE_DUPLICATE_DEST          = 1 << 11,
+       CHANGE_NO_WRITE_PERM_DEST      = 1 << 12,
+       CHANGE_DEST_EXISTS             = 1 << 13,
+       CHANGE_NO_SRC                  = 1 << 14,
        CHANGE_GENERIC_ERROR           = 1 << 16
 } ChangeError;
 
+typedef enum {
+       METADATA_PLAIN          = 0, /* format that can be edited and written back */
+       METADATA_FORMATTED      = 1  /* for display only */
+} MetadataFormat;
+
+typedef enum {
+       STARTUP_PATH_CURRENT    = 0,
+       STARTUP_PATH_LAST,
+       STARTUP_PATH_HOME,
+} StartUpPath;
+
+typedef enum {
+       TOOLBAR_MAIN,
+       TOOLBAR_STATUS,
+       TOOLBAR_COUNT
+} ToolbarType;
+
+typedef enum {
+       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 */
+       PR_STEREO_HORIZ            = 1 << 2,  /* side by side */
+       PR_STEREO_VERT             = 1 << 3,  /* above below */
+       PR_STEREO_RIGHT            = 1 << 4,  /* render right buffer */
+       PR_STEREO_ANAGLYPH_RC      = 1 << 5,  /* anaglyph red-cyan */
+       PR_STEREO_ANAGLYPH_GM      = 1 << 6,  /* anaglyph green-magenta */
+       PR_STEREO_ANAGLYPH_YB      = 1 << 7,  /* anaglyph yellow-blue */
+       PR_STEREO_ANAGLYPH_GRAY_RC = 1 << 8,  /* anaglyph gray red-cyan*/
+       PR_STEREO_ANAGLYPH_GRAY_GM = 1 << 9,  /* anaglyph gray green-magenta */
+       PR_STEREO_ANAGLYPH_GRAY_YB = 1 << 10, /* anaglyph gray yellow-blue */
+       PR_STEREO_ANAGLYPH_DB_RC   = 1 << 11, /* anaglyph dubois red-cyan */
+       PR_STEREO_ANAGLYPH_DB_GM   = 1 << 12, /* anaglyph dubois green-magenta */
+       PR_STEREO_ANAGLYPH_DB_YB   = 1 << 13, /* anaglyph dubois yellow-blue */
+       PR_STEREO_ANAGLYPH         = PR_STEREO_ANAGLYPH_RC |
+                                    PR_STEREO_ANAGLYPH_GM |
+                                    PR_STEREO_ANAGLYPH_YB |
+                                    PR_STEREO_ANAGLYPH_GRAY_RC |
+                                    PR_STEREO_ANAGLYPH_GRAY_GM |
+                                    PR_STEREO_ANAGLYPH_GRAY_YB |
+                                    PR_STEREO_ANAGLYPH_DB_RC |
+                                    PR_STEREO_ANAGLYPH_DB_GM |
+                                    PR_STEREO_ANAGLYPH_DB_YB, /* anaglyph mask */
+
+       PR_STEREO_MIRROR_LEFT      = 1 << 14, /* mirror */
+       PR_STEREO_FLIP_LEFT        = 1 << 15, /* flip */
+
+       PR_STEREO_MIRROR_RIGHT     = 1 << 16, /* mirror */
+       PR_STEREO_FLIP_RIGHT       = 1 << 17, /* flip */
+
+       PR_STEREO_MIRROR           = PR_STEREO_MIRROR_LEFT | PR_STEREO_MIRROR_RIGHT, /* mirror mask*/
+       PR_STEREO_FLIP             = PR_STEREO_FLIP_LEFT | PR_STEREO_FLIP_RIGHT, /* flip mask*/
+       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 {
+       STEREO_PIXBUF_DEFAULT  = 0,
+       STEREO_PIXBUF_SBS      = 1,
+       STEREO_PIXBUF_CROSS    = 2,
+       STEREO_PIXBUF_NONE     = 3
+} StereoPixbufData;
+
 #define MAX_SPLIT_IMAGES 4
 
 typedef struct _ImageLoader ImageLoader;
 typedef struct _ThumbLoader ThumbLoader;
 
+typedef struct _AnimationData AnimationData;
+
 typedef struct _CollectInfo CollectInfo;
 typedef struct _CollectionData CollectionData;
 typedef struct _CollectTable CollectTable;
@@ -180,6 +268,7 @@ typedef struct _FileData FileData;
 typedef struct _FileDataChangeInfo FileDataChangeInfo;
 
 typedef struct _LayoutWindow LayoutWindow;
+typedef struct _LayoutOptions LayoutOptions;
 
 typedef struct _ViewDir ViewDir;
 typedef struct _ViewDirInfoList ViewDirInfoList;
@@ -194,6 +283,7 @@ typedef struct _FullScreenData FullScreenData;
 
 typedef struct _PixmapFolders PixmapFolders;
 typedef struct _Histogram Histogram;
+typedef struct _HistMap HistMap;
 
 typedef struct _SecureSaveInfo SecureSaveInfo;
 
@@ -201,20 +291,24 @@ typedef struct _ExifData ExifData;
 
 typedef struct _EditorDescription EditorDescription;
 
-struct _EditorDescription {
-       gchar *key;             /* desktop file name, not including path, including extension */
-       gchar *name;            /* Name, localized name presented to user */
-       gchar *icon;            /* Icon */
-       gchar *exec;            /* Exec */
-       gchar *menu_path;       
-       gchar *hotkey;
-       GList *ext_list;
-       gchar *file;
-       guint flags;
-       gboolean hidden;
+typedef struct _CommandLine 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;
 
 typedef void (* ThumbLoaderFunc)(ThumbLoader *tl, gpointer data);
@@ -223,13 +317,13 @@ typedef void (* FileUtilDoneFunc)(gboolean success, const gchar *done_path, gpoi
 
 struct _ThumbLoader
 {
-       gint standard_loader;
+       gboolean standard_loader;
 
        ImageLoader *il;
        FileData *fd;           /* fd->pixbuf contains final (scaled) image when done */
 
-       gint cache_enable;
-       gint cache_hit;
+       gboolean cache_enable;
+       gboolean cache_hit;
        gdouble percent_done;
 
        gint max_w;
@@ -241,7 +335,18 @@ struct _ThumbLoader
 
        gpointer data;
 
-       gint idle_done_id;
+       guint idle_done_id; /* event source id */
+};
+
+struct _AnimationData
+{
+       ImageWindow *iw;
+       GdkPixbufAnimation *gpa;
+       GdkPixbufAnimationIter *iter;
+       GdkPixbuf *gpb;
+       FileData *data_adr;
+       guint delay;
+       gboolean valid;
 };
 
 struct _CollectInfo
@@ -274,7 +379,7 @@ struct _CollectionData
        gint window_h;
 
        /* contents changed since save flag */
-       gint changed;
+       gboolean changed;
 
        GHashTable *existence;
 };
@@ -294,7 +399,7 @@ struct _CollectTable
        CollectInfo *click_info;
 
        GtkWidget *tip_window;
-       gint tip_delay_id;
+       guint tip_delay_id; /* event source id */
        CollectInfo *tip_info;
 
        GdkWindow *marker_window;
@@ -311,10 +416,13 @@ struct _CollectTable
        CollectInfo *drop_info;
        GList *drop_list;
 
-       gint sync_idle_id;
-       gint drop_idle_id;
+       guint sync_idle_id; /* event source id */
+       guint drop_idle_id; /* event source id */
 
-       gint show_text;
+       gboolean show_text;
+
+       /* file list for edit menu */
+       GList *editmenu_fd_list;
 };
 
 struct _CollectWindow
@@ -342,21 +450,21 @@ struct _ImageWindow
 
        FileData *image_fd;
 
-       gint unknown;           /* failed to load image */
+       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;
+       gint has_frame;  /* not boolean, see image_new() */
 
        /* top level (not necessarily parent) window */
-       gint top_window_sync;   /* resize top_window when image dimensions change */
+       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 */
-       gint title_show_zoom;   /* option to include zoom in window title */
+       gboolean title_show_zoom;       /* option to include zoom in window title */
 
-       gint completed;
+       gboolean completed;
        ImageState state;       /* mask of IMAGE_STATE_* flags about current image */
 
        void (*func_update)(ImageWindow *imd, gpointer data);
@@ -372,12 +480,14 @@ struct _ImageWindow
 
        /* button, scroll functions */
        void (*func_button)(ImageWindow *, GdkEventButton *event, gpointer);
-       void (*func_drag)(ImageWindow *, GdkEventButton *event, gdouble dx, gdouble dy, 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;
 
        /* scroll notification (for scroll bar implementation) */
        void (*func_scroll_notify)(ImageWindow *, gint x, gint y, gint width, gint height, gpointer);
@@ -389,10 +499,9 @@ struct _ImageWindow
        CollectInfo *collection_info;
 
        /* color profiles */
-       gint color_profile_enable;
+       gboolean color_profile_enable;
        gint color_profile_input;
-       gint color_profile_screen;
-       gint color_profile_use_image;
+       gboolean color_profile_use_image;
        gint color_profile_from_image;
        gpointer cm;
 
@@ -403,13 +512,14 @@ struct _ImageWindow
 
        gint prev_color_row;
 
-       gint auto_refresh;
+       gboolean auto_refresh;
 
-       gint delay_flip;
+       gboolean delay_flip;
        gint orientation;
-       gint desaturate;
+       gboolean desaturate;
+       gint user_stereo;
 
-       gint overlay_show_zoom; /* set to true if overlay is showing zoom ratio */
+       gboolean mouse_wheel_mode;
 };
 
 #define FILEDATA_MARKS_SIZE 6
@@ -419,21 +529,25 @@ struct _FileDataChangeInfo {
        gchar *source;
        gchar *dest;
        gint error;
+       gboolean regroup_when_finished;
 };
 
 struct _FileData {
-       gint magick;
+       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;
        gchar *collate_key_name;
        gchar *collate_key_name_nocase;
        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 */
 
@@ -446,19 +560,105 @@ struct _FileData {
        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 */
-       gint disable_grouping;
+       gboolean disable_grouping;
 
        gint user_orientation;
        gint exif_orientation;
-       
+
        ExifData *exif;
+       time_t exifdate;
        GHashTable *modified_xmp; // hash table which contains unwritten xmp metadata in format: key->list of string values
+       GList *cached_metadata;
+       gint rating;
+};
+
+struct _LayoutOptions
+{
+       gchar *id;
+
+       gchar *order;
+       gint style;
+
+       DirViewType dir_view_type;
+       FileViewType file_view_type;
+
+       gboolean show_thumbnails;
+       gboolean show_marks;
+       gboolean show_directory_date;
+       gboolean show_info_pixel;
+
+       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;
+               gboolean paused;
+       } log_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 exit_on_close;
+
+       gboolean animate;
 };
 
 struct _LayoutWindow
 {
+       LayoutOptions options;
+
        FileData *dir_fd;
 
        /* base */
@@ -474,8 +674,10 @@ struct _LayoutWindow
        /* menus, path selector */
 
        GtkActionGroup *action_group;
-       GtkActionGroup *action_group_external;
+       GtkActionGroup *action_group_editors;
+       guint ui_editors_id;
        GtkUIManager *ui_manager;
+       GList *toolbar_actions[TOOLBAR_COUNT];
 
        GtkWidget *path_entry;
 
@@ -497,17 +699,18 @@ struct _LayoutWindow
        GtkWidget *tools;
        GtkWidget *tools_pane;
 
-       gint tools_float;
-       gint tools_hidden;
+//     gint tools_float;
+//     gint tools_hidden;
 
+       GtkWidget *menu_bar; /* referenced by lw, exist during whole lw lifetime */
        /* toolbar */
 
-       GtkWidget *toolbar;
-       gint toolbar_hidden;
+       GtkWidget *toolbar[TOOLBAR_COUNT]; /* referenced by lw, exist during whole lw lifetime */
+//     gint toolbar_hidden;
 
-       GtkWidget *thumb_button;
-       gint thumbs_enabled;
-       gint marks_enabled;
+//     GtkWidget *thumb_button;
+//     gint thumbs_enabled;
+//     gint marks_enabled;
 
        GtkWidget *back_button;
 
@@ -518,30 +721,29 @@ struct _LayoutWindow
        ViewDir *vd;
        GtkWidget *dir_view;
 
-       DirViewType dir_view_type;
+//     DirViewType dir_view_type;
 
        /* file view */
 
        LayoutLocation file_location;
 
        ViewFile *vf;
-       FileViewType file_view_type;
+//     FileViewType file_view_type;
 
        GtkWidget *file_view;
 
        SortType sort_method;
-       gint sort_ascend;
+       gboolean sort_ascend;
 
        /* status bar */
 
        GtkWidget *info_box;
        GtkWidget *info_progress_bar;
        GtkWidget *info_sort;
-       GtkWidget *info_color;
        GtkWidget *info_status;
        GtkWidget *info_details;
        GtkWidget *info_zoom;
-       GtkWidget *info_write;
+       GtkWidget *info_pixel;
 
        /* slide show */
 
@@ -553,24 +755,27 @@ struct _LayoutWindow
 
        /* dividers */
 
-       gint div_h;
-       gint div_v;
-       gint div_float;
+//     gint div_h;
+//     gint div_v;
+//     gint div_float;
 
        /* misc */
 
-       GtkWidget *utility_box;
+       GtkWidget *utility_box; /* referenced by lw, exist during whole lw lifetime */
+       GtkWidget *utility_paned; /* between image and bar */
        GtkWidget *bar_sort;
-       GtkWidget *bar_exif;
-       GtkWidget *bar_info;
+       GtkWidget *bar;
+
+//     gint bar_sort_enabled;
+//     gint bar_enabled;
 
-       gint bar_sort_enabled;
-       gint bar_exif_enabled;
-       gint bar_info_enabled;
+//     gint bar_width;
 
-       gint bar_exif_width;
-       gint bar_exif_advanced;
-       gint bar_info_width;
+       GtkWidget *exif_window;
+
+       AnimationData *animation;
+
+       GtkWidget *log_window;
 };
 
 struct _ViewDir
@@ -587,10 +792,10 @@ struct _ViewDir
 
        FileData *drop_fd;
        GList *drop_list;
-       gint drop_scroll_id;
+       guint drop_scroll_id; /* event source id */
 
        /* func list */
-       void (*select_func)(ViewDir *vd, const gchar *path, gpointer data);
+       void (*select_func)(ViewDir *vd, FileData *fd, gpointer data);
        gpointer select_data;
 
        void (*dnd_drop_update_func)(ViewDir *vd);
@@ -610,7 +815,7 @@ struct _ViewDirInfoList
 
 struct _ViewDirInfoTree
 {
-       gint drop_expand_id;
+       guint drop_expand_id; /* event source id */
        gint busy_ref;
 };
 
@@ -630,7 +835,7 @@ struct _ViewFile
        GList *list;
 
        SortType sort_method;
-       gint sort_ascend;
+       gboolean sort_ascend;
 
        /* func list */
        void (*func_thumb_status)(ViewFile *vf, gdouble val, const gchar *text, gpointer data);
@@ -644,17 +849,21 @@ struct _ViewFile
        GtkWidget *popup;
 
        /* thumbs updates*/
-       gint thumbs_running;
+       gboolean thumbs_running;
        ThumbLoader *thumbs_loader;
        FileData *thumbs_filedata;
 
        /* marks */
-       gint marks_enabled;
+       gboolean marks_enabled;
        gint active_mark;
        gint clicked_mark;
-       
+
        /* refresh */
-       gint refresh_idle_id;
+       guint refresh_idle_id; /* event source id */
+       time_t time_refresh_set; /* time when refresh_idle_id was set */
+
+       /* file list for edit menu */
+       GList *editmenu_fd_list;
 };
 
 struct _ViewFileInfoList
@@ -662,12 +871,24 @@ struct _ViewFileInfoList
        FileData *click_fd;
        FileData *select_fd;
 
-       gint thumbs_enabled;
+       gboolean thumbs_enabled;
 
-       gint select_idle_id;
+       guint select_idle_id; /* event source id */
 };
 
-struct _IconData;
+typedef enum {
+       SELECTION_NONE          = 0,
+       SELECTION_SELECTED      = 1 << 0,
+       SELECTION_PRELIGHT      = 1 << 1,
+       SELECTION_FOCUS         = 1 << 2
+} SelectionType;
+
+typedef struct _IconData IconData;
+struct _IconData
+{
+       SelectionType selected;
+       FileData *fd;
+};
 
 struct _ViewFileInfoIcon
 {
@@ -679,7 +900,7 @@ struct _ViewFileInfoIcon
        struct _IconData *prev_selection;
 
        GtkWidget *tip_window;
-       gint tip_delay_id;
+       guint tip_delay_id; /* event source id */
        struct _IconData *tip_id;
 
        struct _IconData *click_id;
@@ -688,17 +909,18 @@ struct _ViewFileInfoIcon
        gint focus_row;
        gint focus_column;
 
-       gint show_text;
+       gboolean show_text;
 };
 
 struct _SlideShowData
 {
-       ImageWindow *imd;
+       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.c and should be dropped with it */
 
        GList *filelist;
        CollectionData *cd;
        FileData *dir_fd;
-       LayoutWindow *layout;
 
        GList *list;
        GList *list_done;
@@ -706,14 +928,14 @@ struct _SlideShowData
        FileData *slide_fd;
 
        guint slide_count;
-       gint timeout_id;
+       guint timeout_id; /* event source id */
 
-       gint from_selection;
+       gboolean from_selection;
 
        void (*stop_func)(SlideShowData *, gpointer);
        gpointer stop_data;
 
-       gint paused;
+       gboolean paused;
 };
 
 struct _FullScreenData
@@ -724,14 +946,17 @@ struct _FullScreenData
        GtkWidget *normal_window;
        ImageWindow *normal_imd;
 
-       gint hide_mouse_id;
-       gint busy_mouse_id;
+       guint hide_mouse_id; /* event source id */
+       guint busy_mouse_id; /* event source id */
+
        gint cursor_state;
 
-       gint saver_block_id;
+       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
@@ -747,10 +972,31 @@ struct _SecureSaveInfo {
        gchar *file_name; /**< final file name */
        gchar *tmp_file_name; /**< temporary file name */
        gint err; /**< set to non-zero value in case of error */
-       gint secure_save; /**< use secure save for this file, internal use only */
-       gint preserve_perms; /**< whether to preserve perms, TRUE by default */
-       gint preserve_mtime; /**< whether to preserve mtime, FALSE by default */
-       gint unlink_on_error; /**< whether to remove temporary file on save failure, TRUE by default */
+       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;
 };
 
 #endif