Uses custom hash/equals functions so that we can actually fetch equivalent FileDatas...
[geeqie.git] / src / typedefs.h
index d3c5bcc..fcf2d69 100644 (file)
@@ -252,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;
 
@@ -264,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;
 
@@ -522,6 +534,20 @@ struct _ImageWindow
        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
 
 struct _FileDataChangeInfo {
@@ -836,6 +862,7 @@ struct _ViewFile
 
        FileData *dir_fd;
        GList *list;
+       FileClusterList *cluster_list;
 
        SortType sort_method;
        gboolean sort_ascend;
@@ -879,13 +906,6 @@ struct _ViewFileInfoList
        guint select_idle_id; /* event source id */
 };
 
-typedef enum {
-       SELECTION_NONE          = 0,
-       SELECTION_SELECTED      = 1 << 0,
-       SELECTION_PRELIGHT      = 1 << 1,
-       SELECTION_FOCUS         = 1 << 2
-} SelectionType;
-
 struct _ViewFileInfoIcon
 {
        /* table stuff */