Fix #715: / for action search
[geeqie.git] / src / typedefs.h
index 93880ef..d9d0007 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
 
@@ -20,22 +28,35 @@ typedef enum {
        ZOOM_RESET_NONE         = 2
 } ZoomMode;
 
+typedef enum {
+       PRIMARY = 0,
+       CLIPBOARD = 1,
+} ClipboardSelection;
+
 typedef enum {
        MOUSE_BUTTON_LEFT       = 1,
        MOUSE_BUTTON_MIDDLE     = 2,
        MOUSE_BUTTON_RIGHT      = 3,
        MOUSE_BUTTON_WHEEL_UP   = 4,
-       MOUSE_BUTTON_WHEEL_DOWN = 5
+       MOUSE_BUTTON_WHEEL_DOWN = 5,
+       MOUSE_BUTTON_8  = 8,
+       MOUSE_BUTTON_9  = 9
 } MouseButton;
 
 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"
@@ -52,7 +73,10 @@ typedef enum {
        SORT_CTIME,
        SORT_PATH,
        SORT_NUMBER,
-       SORT_EXIFTIME
+       SORT_EXIFTIME,
+       SORT_EXIFTIMEDIGITIZED,
+       SORT_RATING,
+       SORT_CLASS
 } SortType;
 
 typedef enum {
@@ -118,9 +142,15 @@ typedef enum {
        FORMAT_CLASS_IMAGE,
        FORMAT_CLASS_RAWIMAGE,
        FORMAT_CLASS_META,
+       FORMAT_CLASS_VIDEO,
+       FORMAT_CLASS_COLLECTION,
+       FORMAT_CLASS_DOCUMENT,
        FILE_FORMAT_CLASSES
 } FileFormatClass;
 
+/* defined in preferences.c */
+extern gchar *format_class_list[];
+
 typedef enum {
        SS_ERR_NONE = 0,
        SS_ERR_DISABLED, /**< secsave is disabled. */
@@ -235,11 +265,39 @@ typedef enum {
        STEREO_PIXBUF_NONE     = 3
 } StereoPixbufData;
 
+typedef enum {
+       BAR_SORT_MODE_FOLDER = 0,
+       BAR_SORT_MODE_COLLECTION,
+       BAR_SORT_MODE_COUNT
+} SortModeType;
+
+typedef enum {
+       BAR_SORT_COPY = 0,
+       BAR_SORT_MOVE,
+       BAR_SORT_FILTER,
+       BAR_SORT_ACTION_COUNT
+} SortActionType;
+
+typedef enum {
+       BAR_SORT_SELECTION_IMAGE = 0,
+       BAR_SORT_SELECTION_SELECTED,
+       BAR_SORT_SELECTION_COUNT
+} SortSelectionType;
+
 #define MAX_SPLIT_IMAGES 4
 
+typedef enum {
+       SELECTION_NONE          = 0,
+       SELECTION_SELECTED      = 1 << 0,
+       SELECTION_PRELIGHT      = 1 << 1,
+       SELECTION_FOCUS         = 1 << 2
+} SelectionType;
+
 typedef struct _ImageLoader ImageLoader;
 typedef struct _ThumbLoader ThumbLoader;
 
+typedef struct _AnimationData AnimationData;
+
 typedef struct _CollectInfo CollectInfo;
 typedef struct _CollectionData CollectionData;
 typedef struct _CollectTable CollectTable;
@@ -321,6 +379,21 @@ struct _ThumbLoader
        guint idle_done_id; /* event source id */
 };
 
+struct _AnimationData
+{
+       ImageWindow *iw;
+       LayoutWindow *lw;
+       GdkPixbufAnimation *gpa;
+       GdkPixbufAnimationIter *iter;
+       GdkPixbuf *gpb;
+       FileData *data_adr;
+       guint delay;
+       gboolean valid;
+       GCancellable *cancellable;
+       GFile *in_file;
+       GFileInputStream *gfstream;
+};
+
 struct _CollectInfo
 {
        FileData *fd;
@@ -392,6 +465,7 @@ struct _CollectTable
        guint drop_idle_id; /* event source id */
 
        gboolean show_text;
+       gboolean show_stars;
 
        /* file list for edit menu */
        GList *editmenu_fd_list;
@@ -402,7 +476,6 @@ struct _CollectWindow
        GtkWidget *window;
        CollectTable *table;
        GtkWidget *status_box;
-       GList *list;
 
        GtkWidget *close_dialog;
 
@@ -452,7 +525,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);
 
@@ -489,10 +562,13 @@ struct _ImageWindow
        gboolean delay_flip;
        gint orientation;
        gboolean desaturate;
+       gboolean overunderexposed;
        gint user_stereo;
+
+       gboolean mouse_wheel_mode;
 };
 
-#define FILEDATA_MARKS_SIZE 6
+#define FILEDATA_MARKS_SIZE 10
 
 struct _FileDataChangeInfo {
        FileDataChangeType type;
@@ -509,6 +585,8 @@ struct _FileData {
        gchar *path;
        const gchar *name;
        const gchar *extension;
+       gchar *extended_extension;
+       FileFormatClass format_class;
        gchar *collate_key_name;
        gchar *collate_key_name_nocase;
        gint64 size;
@@ -541,8 +619,20 @@ struct _FileData {
 
        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
@@ -557,6 +647,7 @@ struct _LayoutOptions
 
        gboolean show_thumbnails;
        gboolean show_marks;
+       gboolean show_file_filter;
        gboolean show_directory_date;
        gboolean show_info_pixel;
 
@@ -578,6 +669,10 @@ struct _LayoutOptions
                gint vdivider_pos;
        } float_window;
 
+       struct {
+               gint vdivider_pos;
+       } folder_window;
+
        struct {
                gint w;
                gint h;
@@ -589,16 +684,38 @@ struct _LayoutOptions
                gint histogram_mode;
        } image_overlay;
 
+       struct {
+               gint w;
+               gint h;
+               gint x;
+               gint y;
+       } 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;
+
+       SortActionType action;
+       SortModeType mode;
+       SortSelectionType selection;
+       gchar *filter_key;
 };
 
 struct _LayoutWindow
@@ -623,6 +740,7 @@ 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;
@@ -647,7 +765,7 @@ struct _LayoutWindow
 
 //     gint tools_float;
 //     gint tools_hidden;
-
+       GtkWidget *menu_tool_bar; /*Combined menu and toolbar box */
        GtkWidget *menu_bar; /* referenced by lw, exist during whole lw lifetime */
        /* toolbar */
 
@@ -712,12 +830,17 @@ struct _LayoutWindow
        GtkWidget *bar_sort;
        GtkWidget *bar;
 
-//     gint bar_sort_enabled;
+       gboolean bar_sort_enabled; /* Set during start-up, and checked when the editors have loaded */
 //     gint bar_enabled;
 
 //     gint bar_width;
 
        GtkWidget *exif_window;
+       GtkWidget *sar_window; /* Search and Run window */
+
+       AnimationData *animation;
+
+       GtkWidget *log_window;
 };
 
 struct _ViewDir
@@ -765,6 +888,7 @@ struct _ViewDirInfoTree
 struct _ViewFile
 {
        FileViewType type;
+       // TODO(xsdg): Turn this into a union (see VFLIST and VFICON from view_file.h).
        gpointer info;
 
        GtkWidget *widget;
@@ -773,6 +897,14 @@ struct _ViewFile
        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;
 
@@ -806,6 +938,8 @@ struct _ViewFile
 
        /* file list for edit menu */
        GList *editmenu_fd_list;
+
+       guint read_metadata_in_idle_id;
 };
 
 struct _ViewFileInfoList
@@ -818,8 +952,6 @@ struct _ViewFileInfoList
        guint select_idle_id; /* event source id */
 };
 
-struct _IconData;
-
 struct _ViewFileInfoIcon
 {
        /* table stuff */
@@ -827,15 +959,15 @@ struct _ViewFileInfoIcon
        gint rows;
 
        GList *selection;
-       struct _IconData *prev_selection;
+       FileData *prev_selection;
 
        GtkWidget *tip_window;
        guint tip_delay_id; /* event source id */
-       struct _IconData *tip_id;
+       FileData *tip_fd;
 
-       struct _IconData *click_id;
+       FileData *click_fd;
 
-       struct _IconData *focus_id;
+       FileData *focus_fd;
        gint focus_row;
        gint focus_column;
 
@@ -895,6 +1027,7 @@ struct _PixmapFolders
        GdkPixbuf *open;
        GdkPixbuf *deny;
        GdkPixbuf *parent;
+       GdkPixbuf *link;
 };
 
 struct _SecureSaveInfo {
@@ -918,11 +1051,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