Uses custom hash/equals functions so that we can actually fetch equivalent FileDatas...
[geeqie.git] / src / typedefs.h
index e2642a2..fcf2d69 100644 (file)
@@ -66,7 +66,8 @@ typedef enum {
        SORT_CTIME,
        SORT_PATH,
        SORT_NUMBER,
-       SORT_EXIFTIME
+       SORT_EXIFTIME,
+       SORT_RATING
 } SortType;
 
 typedef enum {
@@ -251,6 +252,15 @@ typedef enum {
 
 #define MAX_SPLIT_IMAGES 4
 
+typedef enum {
+       SELECTION_NONE          = 0,
+       SELECTION_SELECTED      = 1 << 0,
+       SELECTION_PRELIGHT      = 1 << 1,
+       SELECTION_FOCUS         = 1 << 2,
+       SELECTION_CLUSTER_HEAD  = 1 << 3,
+       SELECTION_CLUSTER_CHILD = 1 << 4
+} SelectionType;
+
 typedef struct _ImageLoader ImageLoader;
 typedef struct _ThumbLoader ThumbLoader;
 
@@ -263,6 +273,9 @@ typedef struct _CollectWindow CollectWindow;
 
 typedef struct _ImageWindow ImageWindow;
 
+typedef struct _FileCluster FileCluster;
+typedef struct _FileClusterList FileClusterList;
+
 typedef struct _FileData FileData;
 typedef struct _FileDataChangeInfo FileDataChangeInfo;
 
@@ -479,7 +492,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);
 
@@ -517,6 +530,22 @@ struct _ImageWindow
        gint orientation;
        gboolean desaturate;
        gint user_stereo;
+
+       gboolean mouse_wheel_mode;
+};
+
+// A FileCluster is a GList with HashTable access to each node (to perform contains() checks quickly).
+struct _FileCluster
+{
+       GList *head;
+       GList *items;
+       gboolean show_children;
+};
+
+struct _FileClusterList
+{
+       // A map from any clustered FileData to the FileCluster object that describes the cluster.
+       GHashTable *clusters;
 };
 
 #define FILEDATA_MARKS_SIZE 6
@@ -536,6 +565,7 @@ struct _FileData {
        gchar *path;
        const gchar *name;
        const gchar *extension;
+       gchar *extended_extension;
        gchar *collate_key_name;
        gchar *collate_key_name_nocase;
        gint64 size;
@@ -570,6 +600,9 @@ 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;
+
+       SelectionType selected;  // Used by view_file_icon.
 };
 
 struct _LayoutOptions
@@ -605,6 +638,10 @@ struct _LayoutOptions
                gint vdivider_pos;
        } float_window;
 
+       struct {
+               gint vdivider_pos;
+       } folder_window;
+
        struct {
                gint w;
                gint h;
@@ -616,10 +653,26 @@ 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;
 
@@ -749,6 +802,8 @@ struct _LayoutWindow
        GtkWidget *exif_window;
 
        AnimationData *animation;
+
+       GtkWidget *log_window;
 };
 
 struct _ViewDir
@@ -796,6 +851,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;
@@ -806,6 +862,7 @@ struct _ViewFile
 
        FileData *dir_fd;
        GList *list;
+       FileClusterList *cluster_list;
 
        SortType sort_method;
        gboolean sort_ascend;
@@ -849,8 +906,6 @@ struct _ViewFileInfoList
        guint select_idle_id; /* event source id */
 };
 
-struct _IconData;
-
 struct _ViewFileInfoIcon
 {
        /* table stuff */
@@ -858,15 +913,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;
 
@@ -949,11 +1004,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