annotate src/cache.h @ 102:73443803ea59

Tue Nov 7 19:54:44 2006 John Ellis <johne@verizon.net> * pan-view.c: For calendar view only show months that contain an image. Allow choice of size when displaying an image with the info popup.
author gqview
date Wed, 08 Nov 2006 00:57:04 +0000
parents 67ba4381497e
children f6e307c7bad6
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 CACHE_H
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
14 #define CACHE_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
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
20 #define GQVIEW_CACHE_RC_THUMB GQVIEW_RC_DIR"/thumbnails"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
21 #define GQVIEW_CACHE_RC_METADATA GQVIEW_RC_DIR"/metadata"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
22
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
23 #define GQVIEW_CACHE_LOCAL_THUMB ".thumbnails"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
24 #define GQVIEW_CACHE_LOCAL_METADATA ".metadata"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
25
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
26 #define GQVIEW_CACHE_EXT_THUMB ".png"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
27 #define GQVIEW_CACHE_EXT_SIM ".sim"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
28 #define GQVIEW_CACHE_EXT_METADATA ".meta"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
29
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
30
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
31 typedef enum {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
32 CACHE_TYPE_THUMB,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
33 CACHE_TYPE_SIM,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
34 CACHE_TYPE_METADATA
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
35 } CacheType;
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 typedef struct _CacheData CacheData;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
38 struct _CacheData
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 gint width;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
42 gint height;
37
67ba4381497e Wed Apr 13 18:16:14 2005 John Ellis <johne@verizon.net>
gqview
parents: 9
diff changeset
43 time_t date;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
44 long checksum;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
45 guchar md5sum[16];
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
46 ImageSimilarityData *sim;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
47
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
48 gint dimensions;
37
67ba4381497e Wed Apr 13 18:16:14 2005 John Ellis <johne@verizon.net>
gqview
parents: 9
diff changeset
49 gint have_date;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
50 gint have_checksum;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
51 gint have_md5sum;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
52 gint similarity;
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
55 gint cache_time_valid(const gchar *cache, const gchar *path);
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
58 CacheData *cache_sim_data_new(void);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
59 void cache_sim_data_free(CacheData *cd);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
60
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
61 gint cache_sim_data_save(CacheData *cd);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
62 CacheData *cache_sim_data_load(const gchar *path);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
63
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
64 void cache_sim_data_set_dimensions(CacheData *cd, gint w, gint h);
37
67ba4381497e Wed Apr 13 18:16:14 2005 John Ellis <johne@verizon.net>
gqview
parents: 9
diff changeset
65 void cache_sim_data_set_date(CacheData *cd, time_t date);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
66 void cache_sim_data_set_checksum(CacheData *cd, long checksum);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
67 void cache_sim_data_set_md5sum(CacheData *cd, guchar digest[16]);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
68 void cache_sim_data_set_similarity(CacheData *cd, ImageSimilarityData *sd);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
69 gint cache_sim_data_filled(ImageSimilarityData *sd);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
70
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
71
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
72 gint cache_ensure_dir_exists(gchar *path, mode_t mode);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
73 gchar *cache_get_location(CacheType type, const gchar *source, gint include_name, mode_t *mode);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
74 gchar *cache_find_location(CacheType type, const gchar *source);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
75
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 #endif
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
78
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
79