Additional debug features
[geeqie.git] / src / typedefs.h
index 482c05a..f7725f2 100644 (file)
@@ -1,16 +1,24 @@
 /*
- * Geeqie
- * (C) 2006 John Ellis
- * Copyright (C) 2008 - 2012 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,9 +63,11 @@ typedef enum {
        SORT_NAME,
        SORT_SIZE,
        SORT_TIME,
+       SORT_CTIME,
        SORT_PATH,
        SORT_NUMBER,
-       SORT_EXIFTIME
+       SORT_EXIFTIME,
+       SORT_RATING
 } SortType;
 
 typedef enum {
@@ -160,10 +176,11 @@ typedef enum {
        CHANGE_WARN_CHANGED_EXT        = 1 << 3,
        CHANGE_WARN_UNSAVED_META       = 1 << 4,
        CHANGE_WARN_NO_WRITE_PERM_DEST_DIR  = 1 << 5,
-       CHANGE_ERROR_MASK              = (~0) << 8, /* the values below are fatal errors */
+       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,
@@ -188,28 +205,42 @@ typedef enum {
 } 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_GRAY  = 1 << 6, /* anaglyph gray red-cyan*/
-       PR_STEREO_ANAGLYPH_DB    = 1 << 7, /* anaglyph dubois*/
-       PR_STEREO_ANAGLYPH       = PR_STEREO_ANAGLYPH_RC | PR_STEREO_ANAGLYPH_GRAY | PR_STEREO_ANAGLYPH_DB, /* anaglyph mask */
-
-       PR_STEREO_MIRROR_LEFT    = 1 << 8, /* mirror */
-       PR_STEREO_FLIP_LEFT      = 1 << 9, /* flip */
-
-       PR_STEREO_MIRROR_RIGHT   = 1 << 10, /* mirror */
-       PR_STEREO_FLIP_RIGHT     = 1 << 11, /* 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 << 12,  /* swap left and right buffers */
-       PR_STEREO_TEMP_DISABLE   = 1 << 13,  /* temporarily disable stereo mode if source image is not stereo */
-       PR_STEREO_HALF           = 1 << 14
+       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 {
@@ -224,6 +255,8 @@ typedef enum {
 typedef struct _ImageLoader ImageLoader;
 typedef struct _ThumbLoader ThumbLoader;
 
+typedef struct _AnimationData AnimationData;
+
 typedef struct _CollectInfo CollectInfo;
 typedef struct _CollectionData CollectionData;
 typedef struct _CollectTable CollectTable;
@@ -305,6 +338,17 @@ struct _ThumbLoader
        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
 {
        FileData *fd;
@@ -436,7 +480,7 @@ 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);
 
@@ -474,6 +518,8 @@ struct _ImageWindow
        gint orientation;
        gboolean desaturate;
        gint user_stereo;
+
+       gboolean mouse_wheel_mode;
 };
 
 #define FILEDATA_MARKS_SIZE 6
@@ -493,10 +539,12 @@ struct _FileData {
        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;
 
@@ -514,6 +562,7 @@ struct _FileData {
 
        HistMap *histmap;
 
+       gboolean locked;
        gint ref;
        gint version; /* increased when any field in this structure is changed */
        gboolean disable_grouping;
@@ -525,6 +574,7 @@ struct _FileData {
        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
@@ -560,6 +610,10 @@ struct _LayoutOptions
                gint vdivider_pos;
        } float_window;
 
+       struct {
+               gint vdivider_pos;
+       } folder_window;
+
        struct {
                gint w;
                gint h;
@@ -571,16 +625,34 @@ struct _LayoutOptions
                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
@@ -605,7 +677,6 @@ struct _LayoutWindow
        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;
@@ -701,6 +772,10 @@ struct _LayoutWindow
 //     gint bar_width;
 
        GtkWidget *exif_window;
+
+       AnimationData *animation;
+
+       GtkWidget *log_window;
 };
 
 struct _ViewDir
@@ -801,7 +876,19 @@ struct _ViewFileInfoList
        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
 {
@@ -901,11 +988,15 @@ struct _CommandLine
        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