7 * This software is released under the GNU General Public License (GNU GPL).
8 * Please read the included file COPYING for more information.
9 * This software comes with no warranty of any kind, use at your own risk!
13 #ifndef THUMB_STANDARD_H
14 #define THUMB_STANDARD_H
17 #define THUMB_FOLDER_GLOBAL ".thumbnails"
18 #define THUMB_FOLDER_LOCAL ".thumblocal"
19 #define THUMB_FOLDER_NORMAL "normal"
20 #define THUMB_FOLDER_LARGE "large"
21 #define THUMB_FOLDER_FAIL "fail/" GQ_APPNAME_LC "-" VERSION
22 #define THUMB_NAME_EXTENSION ".png"
25 typedef struct _ThumbLoaderStd ThumbLoaderStd;
26 typedef void (* ThumbLoaderStdFunc)(ThumbLoaderStd *tl, gpointer data);
28 struct _ThumbLoaderStd
43 const gchar *local_uri;
45 gint thumb_path_local;
48 gint requested_height;
57 ThumbLoaderStdFunc func_done;
58 ThumbLoaderStdFunc func_error;
59 ThumbLoaderStdFunc func_progress;
65 ThumbLoaderStd *thumb_loader_std_new(gint width, gint height);
66 void thumb_loader_std_set_callbacks(ThumbLoaderStd *tl,
67 ThumbLoaderStdFunc func_done,
68 ThumbLoaderStdFunc func_error,
69 ThumbLoaderStdFunc func_progress,
71 void thumb_loader_std_set_cache(ThumbLoaderStd *tl, gint enable_cache, gint local, gint retry_failed);
72 gint thumb_loader_std_start(ThumbLoaderStd *tl, const gchar *path);
73 void thumb_loader_std_free(ThumbLoaderStd *tl);
75 GdkPixbuf *thumb_loader_std_get_pixbuf(ThumbLoaderStd *tl, gint with_fallback);
78 /* validates a non local thumbnail file,
79 * calling func_valid with the information when app is idle
80 * for thumbnail's without a file: uri, validates against allowed_age in days
82 ThumbLoaderStd *thumb_loader_std_thumb_file_validate(const gchar *thumb_path, gint allowed_age,
83 void (*func_valid)(const gchar *path, gint valid, gpointer data),
85 void thumb_loader_std_thumb_file_validate_cancel(ThumbLoaderStd *tl);
88 void thumb_std_maint_removed(const gchar *source);
89 void thumb_std_maint_moved(const gchar *source, const gchar *dest);