Mercurial > geeqie.yaz
annotate src/cache.h @ 454:57459cf0952c
Prefix editor entries in the main menu with numbers.
It allows Alt+E+number as shortcut to start an editor.
author | zas_ |
---|---|
date | Sun, 20 Apr 2008 22:29:23 +0000 |
parents | ddabc4873a3f |
children | 48c8e49b571c |
rev | line source |
---|---|
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 CACHE_H | |
14 #define CACHE_H | |
15 | |
16 | |
17 #include "similar.h" | |
18 | |
19 | |
283 | 20 #define GQ_CACHE_RC_THUMB GQ_RC_DIR"/thumbnails" |
21 #define GQ_CACHE_RC_METADATA GQ_RC_DIR"/metadata" | |
9 | 22 |
283 | 23 #define GQ_CACHE_LOCAL_THUMB ".thumbnails" |
24 #define GQ_CACHE_LOCAL_METADATA ".metadata" | |
9 | 25 |
283 | 26 #define GQ_CACHE_EXT_THUMB ".png" |
27 #define GQ_CACHE_EXT_SIM ".sim" | |
28 #define GQ_CACHE_EXT_METADATA ".meta" | |
9 | 29 |
30 | |
31 typedef enum { | |
32 CACHE_TYPE_THUMB, | |
33 CACHE_TYPE_SIM, | |
34 CACHE_TYPE_METADATA | |
35 } CacheType; | |
36 | |
37 typedef struct _CacheData CacheData; | |
38 struct _CacheData | |
39 { | |
40 gchar *path; | |
41 gint width; | |
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 | 44 long checksum; |
45 guchar md5sum[16]; | |
46 ImageSimilarityData *sim; | |
47 | |
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 | 50 gint have_checksum; |
51 gint have_md5sum; | |
52 gint similarity; | |
53 }; | |
54 | |
55 gint cache_time_valid(const gchar *cache, const gchar *path); | |
56 | |
57 | |
58 CacheData *cache_sim_data_new(void); | |
59 void cache_sim_data_free(CacheData *cd); | |
60 | |
61 gint cache_sim_data_save(CacheData *cd); | |
62 CacheData *cache_sim_data_load(const gchar *path); | |
63 | |
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 | 66 void cache_sim_data_set_checksum(CacheData *cd, long checksum); |
67 void cache_sim_data_set_md5sum(CacheData *cd, guchar digest[16]); | |
68 void cache_sim_data_set_similarity(CacheData *cd, ImageSimilarityData *sd); | |
69 gint cache_sim_data_filled(ImageSimilarityData *sd); | |
70 | |
71 | |
72 gint cache_ensure_dir_exists(gchar *path, mode_t mode); | |
73 gchar *cache_get_location(CacheType type, const gchar *source, gint include_name, mode_t *mode); | |
74 gchar *cache_find_location(CacheType type, const gchar *source); | |
75 | |
76 | |
77 #endif |