2 * Copyright (C) 2006 John Ellis
3 * Copyright (C) 2008 - 2016 The Geeqie Team
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 #ifndef THUMB_STANDARD_H
23 #define THUMB_STANDARD_H
26 #define THUMB_FOLDER_GLOBAL ".thumbnails"
27 #define THUMB_FOLDER_LOCAL ".thumblocal"
28 #define THUMB_FOLDER_NORMAL "normal"
29 #define THUMB_FOLDER_LARGE "large"
30 #define THUMB_FOLDER_FAIL "fail" G_DIR_SEPARATOR_S GQ_APPNAME_LC "-" VERSION
31 #define THUMB_NAME_EXTENSION ".png"
34 typedef struct _ThumbLoaderStd ThumbLoaderStd;
35 typedef void (* ThumbLoaderStdFunc)(ThumbLoaderStd *tl, gpointer data);
37 struct _ThumbLoaderStd
39 gboolean standard_loader;
50 const gchar *local_uri;
52 gboolean thumb_path_local;
55 gint requested_height;
57 gboolean cache_enable;
64 ThumbLoaderStdFunc func_done;
65 ThumbLoaderStdFunc func_error;
66 ThumbLoaderStdFunc func_progress;
72 ThumbLoaderStd *thumb_loader_std_new(gint width, gint height);
73 void thumb_loader_std_set_callbacks(ThumbLoaderStd *tl,
74 ThumbLoaderStdFunc func_done,
75 ThumbLoaderStdFunc func_error,
76 ThumbLoaderStdFunc func_progress,
78 void thumb_loader_std_set_cache(ThumbLoaderStd *tl, gboolean enable_cache, gboolean local, gboolean retry_failed);
79 gboolean thumb_loader_std_start(ThumbLoaderStd *tl, FileData *fd);
80 void thumb_loader_std_free(ThumbLoaderStd *tl);
82 GdkPixbuf *thumb_loader_std_get_pixbuf(ThumbLoaderStd *tl);
85 /* validates a non local thumbnail file,
86 * calling func_valid with the information when app is idle
87 * for thumbnail's without a file: uri, validates against allowed_age in days
89 ThumbLoaderStd *thumb_loader_std_thumb_file_validate(const gchar *thumb_path, gint allowed_age,
90 void (*func_valid)(const gchar *path, gboolean valid, gpointer data),
92 void thumb_loader_std_thumb_file_validate_cancel(ThumbLoaderStd *tl);
95 void thumb_std_maint_removed(const gchar *source);
96 void thumb_std_maint_moved(const gchar *source, const gchar *dest);
100 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */