Mercurial > geeqie
annotate src/cache.h @ 636:2ea7af1fbfe0
Make vf_pop_menu_toggle_view_type_cb() independent of FILEVIEW_LIST/FILEVIEW_ICON real values.
author | zas_ |
---|---|
date | Sun, 11 May 2008 23:56:40 +0000 |
parents | 48c8e49b571c |
children | 444705451f3a |
rev | line source |
---|---|
9 | 1 /* |
196 | 2 * Geeqie |
9 | 3 * (C) 2004 John Ellis |
475 | 4 * Copyright (C) 2008 The Geeqie Team |
9 | 5 * |
6 * Author: John Ellis | |
7 * | |
8 * This software is released under the GNU General Public License (GNU GPL). | |
9 * Please read the included file COPYING for more information. | |
10 * This software comes with no warranty of any kind, use at your own risk! | |
11 */ | |
12 | |
13 | |
14 #ifndef CACHE_H | |
15 #define CACHE_H | |
16 | |
17 | |
18 #include "similar.h" | |
19 | |
20 | |
283 | 21 #define GQ_CACHE_RC_THUMB GQ_RC_DIR"/thumbnails" |
22 #define GQ_CACHE_RC_METADATA GQ_RC_DIR"/metadata" | |
9 | 23 |
283 | 24 #define GQ_CACHE_LOCAL_THUMB ".thumbnails" |
25 #define GQ_CACHE_LOCAL_METADATA ".metadata" | |
9 | 26 |
283 | 27 #define GQ_CACHE_EXT_THUMB ".png" |
28 #define GQ_CACHE_EXT_SIM ".sim" | |
29 #define GQ_CACHE_EXT_METADATA ".meta" | |
9 | 30 |
31 | |
32 typedef enum { | |
33 CACHE_TYPE_THUMB, | |
34 CACHE_TYPE_SIM, | |
35 CACHE_TYPE_METADATA | |
36 } CacheType; | |
37 | |
38 typedef struct _CacheData CacheData; | |
39 struct _CacheData | |
40 { | |
41 gchar *path; | |
42 gint width; | |
43 gint height; | |
37
67ba4381497e
Wed Apr 13 18:16:14 2005 John Ellis <johne@verizon.net>
gqview
parents:
9
diff
changeset
|
44 time_t date; |
9 | 45 long checksum; |
46 guchar md5sum[16]; | |
47 ImageSimilarityData *sim; | |
48 | |
49 gint dimensions; | |
37
67ba4381497e
Wed Apr 13 18:16:14 2005 John Ellis <johne@verizon.net>
gqview
parents:
9
diff
changeset
|
50 gint have_date; |
9 | 51 gint have_checksum; |
52 gint have_md5sum; | |
53 gint similarity; | |
54 }; | |
55 | |
56 gint cache_time_valid(const gchar *cache, const gchar *path); | |
57 | |
58 | |
59 CacheData *cache_sim_data_new(void); | |
60 void cache_sim_data_free(CacheData *cd); | |
61 | |
62 gint cache_sim_data_save(CacheData *cd); | |
63 CacheData *cache_sim_data_load(const gchar *path); | |
64 | |
65 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
|
66 void cache_sim_data_set_date(CacheData *cd, time_t date); |
9 | 67 void cache_sim_data_set_checksum(CacheData *cd, long checksum); |
68 void cache_sim_data_set_md5sum(CacheData *cd, guchar digest[16]); | |
69 void cache_sim_data_set_similarity(CacheData *cd, ImageSimilarityData *sd); | |
70 gint cache_sim_data_filled(ImageSimilarityData *sd); | |
71 | |
72 | |
73 gint cache_ensure_dir_exists(gchar *path, mode_t mode); | |
74 gchar *cache_get_location(CacheType type, const gchar *source, gint include_name, mode_t *mode); | |
75 gchar *cache_find_location(CacheType type, const gchar *source); | |
76 | |
77 | |
78 #endif |