4 * Copyright (C) 2008 - 2012 The Geeqie Team
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!
14 #ifndef THUMB_STANDARD_H
15 #define THUMB_STANDARD_H
18 #define THUMB_FOLDER_GLOBAL ".thumbnails"
19 #define THUMB_FOLDER_LOCAL ".thumblocal"
20 #define THUMB_FOLDER_NORMAL "normal"
21 #define THUMB_FOLDER_LARGE "large"
22 #define THUMB_FOLDER_FAIL "fail" G_DIR_SEPARATOR_S GQ_APPNAME_LC "-" VERSION
23 #define THUMB_NAME_EXTENSION ".png"
26 typedef struct _ThumbLoaderStd ThumbLoaderStd;
27 typedef void (* ThumbLoaderStdFunc)(ThumbLoaderStd *tl, gpointer data);
29 struct _ThumbLoaderStd
31 gboolean standard_loader;
42 const gchar *local_uri;
44 gboolean thumb_path_local;
47 gint requested_height;
49 gboolean cache_enable;
56 ThumbLoaderStdFunc func_done;
57 ThumbLoaderStdFunc func_error;
58 ThumbLoaderStdFunc func_progress;
64 ThumbLoaderStd *thumb_loader_std_new(gint width, gint height);
65 void thumb_loader_std_set_callbacks(ThumbLoaderStd *tl,
66 ThumbLoaderStdFunc func_done,
67 ThumbLoaderStdFunc func_error,
68 ThumbLoaderStdFunc func_progress,
70 void thumb_loader_std_set_cache(ThumbLoaderStd *tl, gboolean enable_cache, gboolean local, gboolean retry_failed);
71 gboolean thumb_loader_std_start(ThumbLoaderStd *tl, FileData *fd);
72 void thumb_loader_std_free(ThumbLoaderStd *tl);
74 GdkPixbuf *thumb_loader_std_get_pixbuf(ThumbLoaderStd *tl);
77 /* validates a non local thumbnail file,
78 * calling func_valid with the information when app is idle
79 * for thumbnail's without a file: uri, validates against allowed_age in days
81 ThumbLoaderStd *thumb_loader_std_thumb_file_validate(const gchar *thumb_path, gint allowed_age,
82 void (*func_valid)(const gchar *path, gboolean valid, gpointer data),
84 void thumb_loader_std_thumb_file_validate_cancel(ThumbLoaderStd *tl);
87 void thumb_std_maint_removed(const gchar *source);
88 void thumb_std_maint_moved(const gchar *source, const gchar *dest);
92 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */