annotate src/dupe.h @ 40:dcc04a6a58bf

Sat Apr 16 12:29:42 2005 John Ellis <johne@verizon.net> * pan-view.c: Add option to ignore symbolic links to folders when creating file list (no gui control yet), and do not allow listing the root folder as this introduces too many issues (for instance how do we ignore special filesystems such as /proc using only stat attributes?). Add fix to not show empty folders in the flower view. * thumb_standard.c (thumb_loader_std_finish): Fix logic that caused thumbnails to be saved for images with a size between normal and large when using large thumbnails. * ui_fileops.[ch]: Add utilities lstat_utf8 and islink. ##### Note: GQview CVS on sourceforge is not always up to date, please use ##### ##### an offical release when making enhancements and translation updates. #####
author gqview
date Sat, 16 Apr 2005 16:26:49 +0000
parents d907d608745f
children 71e1ebee420e
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 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2 * GQview
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
3 * (C) 2004 John Ellis
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
4 *
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
5 * Author: John Ellis
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
6 *
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
7 * This software is released under the GNU General Public License (GNU GPL).
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
8 * Please read the included file COPYING for more information.
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
9 * 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
10 */
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 #ifndef DUPE_H
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
14 #define DUPE_H
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
15
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
16 #include "similar.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
17
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
18 /* match methods */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
19 typedef enum
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
20 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
21 DUPE_MATCH_NONE = 0,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
22 DUPE_MATCH_NAME = 1 << 0,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
23 DUPE_MATCH_SIZE = 1 << 1,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
24 DUPE_MATCH_DATE = 1 << 2,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
25 DUPE_MATCH_DIM = 1 << 3, /* image dimensions */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
26 DUPE_MATCH_SUM = 1 << 4, /* simple checksum */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
27 DUPE_MATCH_PATH = 1 << 5,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
28 DUPE_MATCH_SIM_HIGH = 1 << 6, /* similarity */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
29 DUPE_MATCH_SIM_MED = 1 << 7,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
30 DUPE_MATCH_SIM_LOW = 1 << 8,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
31 DUPE_MATCH_SIM_CUSTOM = 1 << 9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
32 } DupeMatchType;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
33
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
34 typedef struct _DupeItem DupeItem;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
35 struct _DupeItem
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
36 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
37 CollectionData *collection; /* NULL if from DupeWindow->files */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
38 CollectInfo *info;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
39
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
40 gchar *path;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
41 const gchar *name; /* we store the pointer into path for the name,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
42 * so that we only need to calculate this once,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
43 * which significantly speeds up comparing names */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
44 gint64 size;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
45 time_t date;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
46
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
47 long checksum;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
48 gchar *md5sum;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
49 gint width;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
50 gint height;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
51
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
52 ImageSimilarityData *simd;
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 /* thumb */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
55 GdkPixbuf *pixbuf;
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 GList *group; /* List of match data */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
58 gdouble group_rank;
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 gint second;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
61 };
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 typedef struct _DupeMatch DupeMatch;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
64 struct _DupeMatch
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 DupeItem *di;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
67 gdouble rank;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
68 };
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 typedef struct _DupeWindow DupeWindow;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
71 struct _DupeWindow
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
72 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
73 GList *list; /* dropped files (DupeItem) */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
74 GList *dupes; /* list of dupes (DupeItem, grouping the DupeMatches) */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
75 DupeMatchType match_mask; /* mask of things to check for match */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
76
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
77 GtkWidget *window;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
78 GtkWidget *table;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
79 GtkWidget *listview;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
80 GtkWidget *combo;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
81 GtkWidget *status_label;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
82 GtkWidget *extra_label;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
83 GtkWidget *button_thumbs;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
84
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
85 gint show_thumbs;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
86
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
87 gint idle_id;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
88 GList *working;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
89 gint setup_done;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
90 gint setup_count;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
91 gint setup_n; /* these are merely for speed optimization */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
92 GList *setup_point; /* ditto */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
93 DupeMatchType setup_mask; /* ditto */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
94 guint64 setup_time;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
95 guint64 setup_time_count;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
96
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
97 DupeItem *click_item; /* for popup menu */
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 ThumbLoader *thumb_loader;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
100 DupeItem *thumb_item;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
101
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
102 ImageLoader *img_loader;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
103
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
104 /* second set comparison stuff */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
105
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
106 gint second_set; /* second set enabled ? */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
107 GList *second_list; /* second set dropped files */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
108 gint second_drop; /* drop is on second set */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
109
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
110 GtkWidget *second_vbox; /* box of second widgets */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
111 GtkWidget *second_listview;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
112 GtkWidget *second_status_label;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
113
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
114 gint color_frozen;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
115 };
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 DupeWindow *dupe_window_new(DupeMatchType match_mask);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
119
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
120 void dupe_window_clear(DupeWindow *dw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
121 void dupe_window_close(DupeWindow *dw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
122
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
123 void dupe_window_add_collection(DupeWindow *dw, CollectionData *collection);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
124 void dupe_window_add_files(DupeWindow *dw, GList *list, gint recurse);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
125
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
126 void dupe_maint_removed(const gchar *path);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
127 void dupe_maint_renamed(const gchar *source, const gchar *dest);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
128
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 /* cell max with/height hack utility */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
131 void cell_renderer_height_override(GtkCellRenderer *renderer);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
132
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
133
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
134 #endif
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
135
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
136