Mercurial > hg > forks > geeqie
annotate src/thumb_standard.h @ 2566:034d8772d6d8
Fix #500: Geeqie doesn’t use shared thumbnail folder
https://github.com/BestImageViewer/geeqie/issues/500
author | Colin Clark <colin.clark@cclark.uk> |
---|---|
date | Mon, 31 Jul 2017 14:36:29 +0100 |
parents | 07ed545403ea |
children |
rev | line source |
---|---|
9 | 1 /* |
2350
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2021
diff
changeset
|
2 * Copyright (C) 2006 John Ellis |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2021
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:
2021
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:
2021
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:
2021
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:
2021
diff
changeset
|
10 * (at your option) any later version. |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2021
diff
changeset
|
11 * |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2021
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:
2021
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:
2021
diff
changeset
|
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2021
diff
changeset
|
15 * GNU General Public License for more details. |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2021
diff
changeset
|
16 * |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2021
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:
2021
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:
2021
diff
changeset
|
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
9 | 20 */ |
21 | |
22 #ifndef THUMB_STANDARD_H | |
23 #define THUMB_STANDARD_H | |
24 | |
25 | |
2394 | 26 #if GLIB_CHECK_VERSION (2, 34, 0) |
2566
034d8772d6d8
Fix #500: Geeqie doesn’t use shared thumbnail folder
Colin Clark <colin.clark@cclark.uk>
parents:
2394
diff
changeset
|
27 #define THUMB_FOLDER_GLOBAL "thumbnails" |
2394 | 28 #else |
79
5c92448632fa
Thu Oct 19 07:23:37 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
9
diff
changeset
|
29 #define THUMB_FOLDER_GLOBAL ".thumbnails" |
2394 | 30 #endif |
79
5c92448632fa
Thu Oct 19 07:23:37 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
9
diff
changeset
|
31 #define THUMB_FOLDER_LOCAL ".thumblocal" |
9 | 32 #define THUMB_FOLDER_NORMAL "normal" |
33 #define THUMB_FOLDER_LARGE "large" | |
728
45b046463e22
Replace hardcoded "/" by G_DIR_SEPARATOR_S where applicable.
Laurent Monin <geeqie@norz.org>
parents:
475
diff
changeset
|
34 #define THUMB_FOLDER_FAIL "fail" G_DIR_SEPARATOR_S GQ_APPNAME_LC "-" VERSION |
9 | 35 #define THUMB_NAME_EXTENSION ".png" |
36 | |
37 | |
38 typedef struct _ThumbLoaderStd ThumbLoaderStd; | |
39 typedef void (* ThumbLoaderStdFunc)(ThumbLoaderStd *tl, gpointer data); | |
40 | |
41 struct _ThumbLoaderStd | |
42 { | |
1446 | 43 gboolean standard_loader; |
9 | 44 |
45 ImageLoader *il; | |
838
fd3a200281f6
use FileData in thumb_loader
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
728
diff
changeset
|
46 FileData *fd; |
9 | 47 |
48 time_t source_mtime; | |
49 off_t source_size; | |
50 mode_t source_mode; | |
51 | |
52 gchar *thumb_path; | |
53 gchar *thumb_uri; | |
54 const gchar *local_uri; | |
55 | |
1446 | 56 gboolean thumb_path_local; |
9 | 57 |
58 gint requested_width; | |
59 gint requested_height; | |
60 | |
1446 | 61 gboolean cache_enable; |
62 gboolean cache_local; | |
63 gboolean cache_hit; | |
64 gboolean cache_retry; | |
9 | 65 |
66 gdouble progress; | |
67 | |
68 ThumbLoaderStdFunc func_done; | |
69 ThumbLoaderStdFunc func_error; | |
70 ThumbLoaderStdFunc func_progress; | |
71 | |
72 gpointer data; | |
73 }; | |
74 | |
75 | |
76 ThumbLoaderStd *thumb_loader_std_new(gint width, gint height); | |
77 void thumb_loader_std_set_callbacks(ThumbLoaderStd *tl, | |
78 ThumbLoaderStdFunc func_done, | |
79 ThumbLoaderStdFunc func_error, | |
80 ThumbLoaderStdFunc func_progress, | |
81 gpointer data); | |
1446 | 82 void thumb_loader_std_set_cache(ThumbLoaderStd *tl, gboolean enable_cache, gboolean local, gboolean retry_failed); |
83 gboolean thumb_loader_std_start(ThumbLoaderStd *tl, FileData *fd); | |
9 | 84 void thumb_loader_std_free(ThumbLoaderStd *tl); |
85 | |
864
83be8234df2d
added pixbuf_fallback function
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
838
diff
changeset
|
86 GdkPixbuf *thumb_loader_std_get_pixbuf(ThumbLoaderStd *tl); |
9 | 87 |
88 | |
89 /* validates a non local thumbnail file, | |
90 * calling func_valid with the information when app is idle | |
91 * for thumbnail's without a file: uri, validates against allowed_age in days | |
92 */ | |
93 ThumbLoaderStd *thumb_loader_std_thumb_file_validate(const gchar *thumb_path, gint allowed_age, | |
1446 | 94 void (*func_valid)(const gchar *path, gboolean valid, gpointer data), |
9 | 95 gpointer data); |
96 void thumb_loader_std_thumb_file_validate_cancel(ThumbLoaderStd *tl); | |
97 | |
98 | |
99 void thumb_std_maint_removed(const gchar *source); | |
100 void thumb_std_maint_moved(const gchar *source, const gchar *dest); | |
101 | |
102 | |
103 #endif | |
1055
4bbdfab3c89a
Adding a vim modeline to all files - patch by Klaus Ethgen
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
864
diff
changeset
|
104 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */ |