2 * Copyright (C) 2004 John Ellis
3 * Copyright (C) 2008 - 2016 The Geeqie Team
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
28 struct CollectionData;
33 /** @enum DupeMatchType
39 DUPE_MATCH_NAME = 1 << 0,
40 DUPE_MATCH_SIZE = 1 << 1,
41 DUPE_MATCH_DATE = 1 << 2,
42 DUPE_MATCH_DIM = 1 << 3, /**< image dimensions */
43 DUPE_MATCH_SUM = 1 << 4, /**< MD5sum */
44 DUPE_MATCH_PATH = 1 << 5,
45 DUPE_MATCH_SIM_HIGH = 1 << 6, /**< similarity */
46 DUPE_MATCH_SIM_MED = 1 << 7,
47 DUPE_MATCH_SIM_LOW = 1 << 8,
48 DUPE_MATCH_SIM_CUSTOM = 1 << 9,
49 DUPE_MATCH_NAME_CI = 1 << 10, /**< same as name, but case insensitive */
50 DUPE_MATCH_NAME_CONTENT = 1 << 11, /**< same name, but different content */
51 DUPE_MATCH_NAME_CI_CONTENT = 1 << 12, /**< same name - case insensitive, but different content */
52 DUPE_MATCH_ALL = 1 << 13 /**< N.B. this is used as a clamp value in rcfile.cc */
64 CollectionData *collection; /**< NULL if from #DupeWindow->files */
72 gint dimensions; /**< Computed as (#DupeItem->width << 16) + #DupeItem->height */
74 ImageSimilarityData *simd;
76 GdkPixbuf *pixbuf; /**< thumb */
78 GList *group; /**< List of match data (#DupeMatch) */
79 gdouble group_rank; /**< (sum of all child ranks) / n */
92 GList *list; /**< one entry for each dropped file in 1st set window (#DupeItem) */
93 GList *dupes; /**< list of dupes (#DupeItem, grouping the #DupeMatch-es) */
94 DupeMatchType match_mask; /**< mask of things to check for match */
100 GtkWidget *status_label;
101 GtkWidget *extra_label; /**< Progress bar widget */
102 GtkWidget *button_thumbs;
103 GtkWidget *button_rotation_invariant;
104 GtkWidget *custom_threshold;
105 GList *add_files_queue;
106 guint add_files_queue_id;
107 GHashTable *list_cache; /**< Caches the #DupeItem-s of all items in list. Used when ensuring #FileData-s are unique */
108 GHashTable *second_list_cache; /**< Caches the #DupeItem-s of all items in second_list. Used when ensuring #FileData-s are unique */
109 GtkWidget *controls_box;
111 gboolean show_thumbs;
113 guint idle_id; /**< event source id */
115 gint setup_done; /**< Boolean. Set TRUE when all checksums/dimensions/similarity data have been read or created */
116 gint setup_count; /**< length of set1 or if 2 sets, total length of both */
117 gint setup_n; /**< Set to zero on start/reset. These are merely for speed optimization */
118 GList *setup_point; /**< these are merely for speed optimization */
119 DupeMatchType setup_mask; /**< these are merely for speed optimization */
120 guint64 setup_time; /**< Time in µsec since Epoch, restored at each phase of operation */
121 guint64 setup_time_count; /**< Time in µsec since time-to-go status display was updated */
123 DupeItem *click_item; /**< for popup menu */
125 ThumbLoader *thumb_loader;
126 DupeItem *thumb_item;
128 ImageLoader *img_loader;
130 GtkTreeSortable *sortable;
131 gint set_count; /**< Index/counter for number of duplicate sets found */
133 /* second set comparison stuff */
135 gboolean second_set; /**< second set enabled ? */
136 GList *second_list; /**< second set dropped files */
137 gboolean second_drop; /**< drop is on second set */
139 GtkWidget *second_vbox; /**< box of second widgets */
140 GtkWidget *second_listview;
141 GtkWidget *second_status_label;
143 gboolean color_frozen;
145 /* required for similarity threads */
146 GThreadPool *dupe_comparison_thread_pool;
147 GList *search_matches; /**< List of similarity matches (#DupeSearchMatch) */
148 GMutex search_matches_mutex;
149 GList *search_matches_sorted; /**< \a search_matches sorted by order of entry into thread pool */
150 gint queue_count; /**< Incremented each time an item is pushed onto the similarity thread pool */
151 gint thread_count; /**< Incremented each time a similarity check thread item is completed */
152 GMutex thread_count_mutex;
153 gboolean abort; /**< Stop the similarity check thread queue */
157 DupeWindow *dupe_window_new();
159 void dupe_window_clear(DupeWindow *dw);
160 void dupe_window_close(DupeWindow *dw);
162 void dupe_window_add_collection(DupeWindow *dw, CollectionData *collection);
163 void dupe_window_add_files(DupeWindow *dw, GList *list, gboolean recurse);
165 void cell_renderer_height_override(GtkCellRenderer *renderer); /**< cell max with/height hack utility */
168 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */