9
|
1 /*
|
196
|
2 * Geeqie
|
9
|
3 * (C) 2004 John Ellis
|
|
4 *
|
|
5 * Author: John Ellis
|
|
6 *
|
|
7 * This software is released under the GNU General Public License (GNU GPL).
|
|
8 * Please read the included file COPYING for more information.
|
|
9 * This software comes with no warranty of any kind, use at your own risk!
|
|
10 */
|
|
11
|
|
12
|
|
13 #ifndef DUPE_H
|
|
14 #define DUPE_H
|
|
15
|
|
16 #include "similar.h"
|
|
17
|
|
18 /* match methods */
|
|
19 typedef enum
|
|
20 {
|
|
21 DUPE_MATCH_NONE = 0,
|
|
22 DUPE_MATCH_NAME = 1 << 0,
|
|
23 DUPE_MATCH_SIZE = 1 << 1,
|
|
24 DUPE_MATCH_DATE = 1 << 2,
|
|
25 DUPE_MATCH_DIM = 1 << 3, /* image dimensions */
|
|
26 DUPE_MATCH_SUM = 1 << 4, /* simple checksum */
|
|
27 DUPE_MATCH_PATH = 1 << 5,
|
|
28 DUPE_MATCH_SIM_HIGH = 1 << 6, /* similarity */
|
|
29 DUPE_MATCH_SIM_MED = 1 << 7,
|
|
30 DUPE_MATCH_SIM_LOW = 1 << 8,
|
|
31 DUPE_MATCH_SIM_CUSTOM = 1 << 9
|
|
32 } DupeMatchType;
|
|
33
|
|
34 typedef struct _DupeItem DupeItem;
|
|
35 struct _DupeItem
|
|
36 {
|
|
37 CollectionData *collection; /* NULL if from DupeWindow->files */
|
|
38 CollectInfo *info;
|
|
39
|
138
|
40 FileData *fd;
|
9
|
41
|
|
42 long checksum;
|
|
43 gchar *md5sum;
|
|
44 gint width;
|
|
45 gint height;
|
|
46
|
|
47 ImageSimilarityData *simd;
|
|
48
|
|
49 /* thumb */
|
|
50 GdkPixbuf *pixbuf;
|
|
51
|
|
52 GList *group; /* List of match data */
|
|
53 gdouble group_rank;
|
|
54
|
|
55 gint second;
|
|
56 };
|
|
57
|
|
58 typedef struct _DupeMatch DupeMatch;
|
|
59 struct _DupeMatch
|
|
60 {
|
|
61 DupeItem *di;
|
|
62 gdouble rank;
|
|
63 };
|
|
64
|
|
65 typedef struct _DupeWindow DupeWindow;
|
|
66 struct _DupeWindow
|
|
67 {
|
|
68 GList *list; /* dropped files (DupeItem) */
|
|
69 GList *dupes; /* list of dupes (DupeItem, grouping the DupeMatches) */
|
|
70 DupeMatchType match_mask; /* mask of things to check for match */
|
|
71
|
|
72 GtkWidget *window;
|
|
73 GtkWidget *table;
|
|
74 GtkWidget *listview;
|
|
75 GtkWidget *combo;
|
|
76 GtkWidget *status_label;
|
|
77 GtkWidget *extra_label;
|
|
78 GtkWidget *button_thumbs;
|
|
79
|
|
80 gint show_thumbs;
|
|
81
|
|
82 gint idle_id;
|
|
83 GList *working;
|
|
84 gint setup_done;
|
|
85 gint setup_count;
|
|
86 gint setup_n; /* these are merely for speed optimization */
|
|
87 GList *setup_point; /* ditto */
|
|
88 DupeMatchType setup_mask; /* ditto */
|
|
89 guint64 setup_time;
|
|
90 guint64 setup_time_count;
|
|
91
|
|
92 DupeItem *click_item; /* for popup menu */
|
|
93
|
|
94 ThumbLoader *thumb_loader;
|
|
95 DupeItem *thumb_item;
|
|
96
|
|
97 ImageLoader *img_loader;
|
|
98
|
|
99 /* second set comparison stuff */
|
|
100
|
|
101 gint second_set; /* second set enabled ? */
|
|
102 GList *second_list; /* second set dropped files */
|
|
103 gint second_drop; /* drop is on second set */
|
|
104
|
|
105 GtkWidget *second_vbox; /* box of second widgets */
|
|
106 GtkWidget *second_listview;
|
|
107 GtkWidget *second_status_label;
|
|
108
|
|
109 gint color_frozen;
|
|
110 };
|
|
111
|
|
112
|
|
113 DupeWindow *dupe_window_new(DupeMatchType match_mask);
|
|
114
|
|
115 void dupe_window_clear(DupeWindow *dw);
|
|
116 void dupe_window_close(DupeWindow *dw);
|
|
117
|
|
118 void dupe_window_add_collection(DupeWindow *dw, CollectionData *collection);
|
|
119 void dupe_window_add_files(DupeWindow *dw, GList *list, gint recurse);
|
|
120
|
138
|
121 void dupe_maint_removed(FileData *fd);
|
|
122 void dupe_maint_renamed(FileData *fd);
|
9
|
123
|
|
124
|
|
125 /* cell max with/height hack utility */
|
|
126 void cell_renderer_height_override(GtkCellRenderer *renderer);
|
|
127
|
|
128
|
|
129 #endif
|
|
130
|
|
131
|