Mercurial > hg > forks > geeqie
annotate src/cache.h @ 2916:ae6cdcd69d9f default tip
Merge with upstream/master.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 14 May 2019 11:46:50 +0300 |
parents | 034d8772d6d8 |
children |
rev | line source |
---|---|
9 | 1 /* |
2350
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2331
diff
changeset
|
2 * Copyright (C) 2004 John Ellis |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2331
diff
changeset
|
3 * Copyright (C) 2008 - 2016 The Geeqie Team |
9 | 4 * |
5 * Author: John Ellis | |
6 * | |
2350
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2331
diff
changeset
|
7 * This program is free software; you can redistribute it and/or modify |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2331
diff
changeset
|
8 * it under the terms of the GNU General Public License as published by |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2331
diff
changeset
|
9 * the Free Software Foundation; either version 2 of the License, or |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2331
diff
changeset
|
10 * (at your option) any later version. |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2331
diff
changeset
|
11 * |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2331
diff
changeset
|
12 * This program is distributed in the hope that it will be useful, |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2331
diff
changeset
|
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2331
diff
changeset
|
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2331
diff
changeset
|
15 * GNU General Public License for more details. |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2331
diff
changeset
|
16 * |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2331
diff
changeset
|
17 * You should have received a copy of the GNU General Public License along |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2331
diff
changeset
|
18 * with this program; if not, write to the Free Software Foundation, Inc., |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2331
diff
changeset
|
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
9 | 20 */ |
21 | |
22 #ifndef CACHE_H | |
23 #define CACHE_H | |
24 | |
25 | |
26 #include "similar.h" | |
27 | |
28 | |
1145
94adf34fe826
Use functions to return directories instead of constants.
Laurent Monin <geeqie@norz.org>
parents:
1055
diff
changeset
|
29 #define GQ_CACHE_THUMB "thumbnails" |
94adf34fe826
Use functions to return directories instead of constants.
Laurent Monin <geeqie@norz.org>
parents:
1055
diff
changeset
|
30 #define GQ_CACHE_METADATA "metadata" |
9 | 31 |
283 | 32 #define GQ_CACHE_LOCAL_THUMB ".thumbnails" |
33 #define GQ_CACHE_LOCAL_METADATA ".metadata" | |
9 | 34 |
283 | 35 #define GQ_CACHE_EXT_THUMB ".png" |
36 #define GQ_CACHE_EXT_SIM ".sim" | |
37 #define GQ_CACHE_EXT_METADATA ".meta" | |
1224
8caed680d86f
improved sidecar writting
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1148
diff
changeset
|
38 #define GQ_CACHE_EXT_XMP_METADATA ".gq.xmp" |
9 | 39 |
40 | |
41 typedef enum { | |
42 CACHE_TYPE_THUMB, | |
43 CACHE_TYPE_SIM, | |
1224
8caed680d86f
improved sidecar writting
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1148
diff
changeset
|
44 CACHE_TYPE_METADATA, |
8caed680d86f
improved sidecar writting
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1148
diff
changeset
|
45 CACHE_TYPE_XMP_METADATA |
9 | 46 } CacheType; |
47 | |
48 typedef struct _CacheData CacheData; | |
49 struct _CacheData | |
50 { | |
51 gchar *path; | |
52 gint width; | |
53 gint height; | |
37
8cea1cfe5875
Wed Apr 13 18:16:14 2005 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
9
diff
changeset
|
54 time_t date; |
9 | 55 guchar md5sum[16]; |
56 ImageSimilarityData *sim; | |
57 | |
1420
6cda3d9d6a7b
Use gboolean where applicable, for the sake of consistency.
Laurent Monin <geeqie@norz.org>
parents:
1284
diff
changeset
|
58 gboolean dimensions; |
6cda3d9d6a7b
Use gboolean where applicable, for the sake of consistency.
Laurent Monin <geeqie@norz.org>
parents:
1284
diff
changeset
|
59 gboolean have_date; |
6cda3d9d6a7b
Use gboolean where applicable, for the sake of consistency.
Laurent Monin <geeqie@norz.org>
parents:
1284
diff
changeset
|
60 gboolean have_md5sum; |
6cda3d9d6a7b
Use gboolean where applicable, for the sake of consistency.
Laurent Monin <geeqie@norz.org>
parents:
1284
diff
changeset
|
61 gboolean similarity; |
9 | 62 }; |
63 | |
1420
6cda3d9d6a7b
Use gboolean where applicable, for the sake of consistency.
Laurent Monin <geeqie@norz.org>
parents:
1284
diff
changeset
|
64 gboolean cache_time_valid(const gchar *cache, const gchar *path); |
9 | 65 |
66 | |
67 CacheData *cache_sim_data_new(void); | |
68 void cache_sim_data_free(CacheData *cd); | |
69 | |
1420
6cda3d9d6a7b
Use gboolean where applicable, for the sake of consistency.
Laurent Monin <geeqie@norz.org>
parents:
1284
diff
changeset
|
70 gboolean cache_sim_data_save(CacheData *cd); |
9 | 71 CacheData *cache_sim_data_load(const gchar *path); |
72 | |
73 void cache_sim_data_set_dimensions(CacheData *cd, gint w, gint h); | |
37
8cea1cfe5875
Wed Apr 13 18:16:14 2005 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
9
diff
changeset
|
74 void cache_sim_data_set_date(CacheData *cd, time_t date); |
9 | 75 void cache_sim_data_set_md5sum(CacheData *cd, guchar digest[16]); |
76 void cache_sim_data_set_similarity(CacheData *cd, ImageSimilarityData *sd); | |
77 gint cache_sim_data_filled(ImageSimilarityData *sd); | |
78 | |
79 gchar *cache_get_location(CacheType type, const gchar *source, gint include_name, mode_t *mode); | |
80 gchar *cache_find_location(CacheType type, const gchar *source); | |
81 | |
1145
94adf34fe826
Use functions to return directories instead of constants.
Laurent Monin <geeqie@norz.org>
parents:
1055
diff
changeset
|
82 const gchar *get_thumbnails_cache_dir(void); |
2566
034d8772d6d8
Fix #500: Geeqie doesn’t use shared thumbnail folder
Colin Clark <colin.clark@cclark.uk>
parents:
2350
diff
changeset
|
83 const gchar *get_thumbnails_standard_cache_dir(void); |
1145
94adf34fe826
Use functions to return directories instead of constants.
Laurent Monin <geeqie@norz.org>
parents:
1055
diff
changeset
|
84 const gchar *get_metadata_cache_dir(void); |
9 | 85 |
86 #endif | |
1055
4bbdfab3c89a
Adding a vim modeline to all files - patch by Klaus Ethgen
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1000
diff
changeset
|
87 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */ |