annotate src/dupe.h @ 1560:dd0a89cdb021

differentiate between "Cancel" and "Discard changes"
author nadvornik
date Thu, 23 Apr 2009 20:48:03 +0000
parents 24a12aa0cb54
children 717374fb1bbd
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1 /*
196
f6e307c7bad6 rename GQview -> Geeqie over the code
nadvornik
parents: 138
diff changeset
2 * Geeqie
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
3 * (C) 2004 John Ellis
1284
8b89e3ff286b Add year 2009 to copyright info everywhere.
zas_
parents: 1055
diff changeset
4 * Copyright (C) 2008 - 2009 The Geeqie Team
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
5 *
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
6 * Author: John Ellis
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
7 *
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
8 * This software is released under the GNU General Public License (GNU GPL).
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
9 * Please read the included file COPYING for more information.
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
10 * This software comes with no warranty of any kind, use at your own risk!
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
11 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
12
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
13
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
14 #ifndef DUPE_H
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
15 #define DUPE_H
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
16
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
17 #include "similar.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
18
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
19 /* match methods */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
20 typedef enum
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
21 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
22 DUPE_MATCH_NONE = 0,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
23 DUPE_MATCH_NAME = 1 << 0,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
24 DUPE_MATCH_SIZE = 1 << 1,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
25 DUPE_MATCH_DATE = 1 << 2,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
26 DUPE_MATCH_DIM = 1 << 3, /* image dimensions */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
27 DUPE_MATCH_SUM = 1 << 4, /* simple checksum */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
28 DUPE_MATCH_PATH = 1 << 5,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
29 DUPE_MATCH_SIM_HIGH = 1 << 6, /* similarity */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
30 DUPE_MATCH_SIM_MED = 1 << 7,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
31 DUPE_MATCH_SIM_LOW = 1 << 8,
264
1015282898fe Add the possibility to match duplicates on the name but ignoring the case.
zas_
parents: 196
diff changeset
32 DUPE_MATCH_SIM_CUSTOM = 1 << 9,
1015282898fe Add the possibility to match duplicates on the name but ignoring the case.
zas_
parents: 196
diff changeset
33 DUPE_MATCH_NAME_CI = 1 << 10 /* same as name, but case insensitive */
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
34 } DupeMatchType;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
35
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
36 typedef struct _DupeItem DupeItem;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
37 struct _DupeItem
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
38 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
39 CollectionData *collection; /* NULL if from DupeWindow->files */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
40 CollectInfo *info;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
41
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 9
diff changeset
42 FileData *fd;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
43
1000
4fe8f9656107 For the sake of consistency, use glib basic types everywhere.
zas_
parents: 794
diff changeset
44 glong checksum;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
45 gchar *md5sum;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
46 gint width;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
47 gint height;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
48
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
49 ImageSimilarityData *simd;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
50
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
51 /* thumb */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
52 GdkPixbuf *pixbuf;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
53
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
54 GList *group; /* List of match data */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
55 gdouble group_rank;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
56
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
57 gint second;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
58 };
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
59
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
60 typedef struct _DupeMatch DupeMatch;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
61 struct _DupeMatch
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
62 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
63 DupeItem *di;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
64 gdouble rank;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
65 };
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
66
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
67 typedef struct _DupeWindow DupeWindow;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
68 struct _DupeWindow
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
69 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
70 GList *list; /* dropped files (DupeItem) */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
71 GList *dupes; /* list of dupes (DupeItem, grouping the DupeMatches) */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
72 DupeMatchType match_mask; /* mask of things to check for match */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
73
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
74 GtkWidget *window;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
75 GtkWidget *table;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
76 GtkWidget *listview;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
77 GtkWidget *combo;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
78 GtkWidget *status_label;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
79 GtkWidget *extra_label;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
80 GtkWidget *button_thumbs;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
81
1420
3a9fb1b52559 Use gboolean where applicable, for the sake of consistency.
zas_
parents: 1397
diff changeset
82 gboolean show_thumbs;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
83
1523
24a12aa0cb54 Fix up event source ids type: gint -> guint.
zas_
parents: 1420
diff changeset
84 guint idle_id; /* event source id */
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
85 GList *working;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
86 gint setup_done;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
87 gint setup_count;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
88 gint setup_n; /* these are merely for speed optimization */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
89 GList *setup_point; /* ditto */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
90 DupeMatchType setup_mask; /* ditto */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
91 guint64 setup_time;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
92 guint64 setup_time_count;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
93
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
94 DupeItem *click_item; /* for popup menu */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
95
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
96 ThumbLoader *thumb_loader;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
97 DupeItem *thumb_item;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
98
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
99 ImageLoader *img_loader;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
100
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
101 /* second set comparison stuff */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
102
1420
3a9fb1b52559 Use gboolean where applicable, for the sake of consistency.
zas_
parents: 1397
diff changeset
103 gboolean second_set; /* second set enabled ? */
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
104 GList *second_list; /* second set dropped files */
1420
3a9fb1b52559 Use gboolean where applicable, for the sake of consistency.
zas_
parents: 1397
diff changeset
105 gboolean second_drop; /* drop is on second set */
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
106
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
107 GtkWidget *second_vbox; /* box of second widgets */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
108 GtkWidget *second_listview;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
109 GtkWidget *second_status_label;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
110
1420
3a9fb1b52559 Use gboolean where applicable, for the sake of consistency.
zas_
parents: 1397
diff changeset
111 gboolean color_frozen;
1397
a0bd58a6535f In various Edit context menus, only display editors that match the file types in the selection.
zas_
parents: 1284
diff changeset
112
a0bd58a6535f In various Edit context menus, only display editors that match the file types in the selection.
zas_
parents: 1284
diff changeset
113 /* file list for edit menu */
a0bd58a6535f In various Edit context menus, only display editors that match the file types in the selection.
zas_
parents: 1284
diff changeset
114 GList *editmenu_fd_list;
a0bd58a6535f In various Edit context menus, only display editors that match the file types in the selection.
zas_
parents: 1284
diff changeset
115
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
116 };
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
117
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
118
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
119 DupeWindow *dupe_window_new(DupeMatchType match_mask);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
120
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
121 void dupe_window_clear(DupeWindow *dw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
122 void dupe_window_close(DupeWindow *dw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
123
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
124 void dupe_window_add_collection(DupeWindow *dw, CollectionData *collection);
1420
3a9fb1b52559 Use gboolean where applicable, for the sake of consistency.
zas_
parents: 1397
diff changeset
125 void dupe_window_add_files(DupeWindow *dw, GList *list, gboolean recurse);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
126
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
127 /* cell max with/height hack utility */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
128 void cell_renderer_height_override(GtkCellRenderer *renderer);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
129
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
130
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
131 #endif
1055
1646720364cf Adding a vim modeline to all files - patch by Klaus Ethgen
nadvornik
parents: 1000
diff changeset
132 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */