-
Notifications
You must be signed in to change notification settings - Fork 83
/
Copy paththumb-standard.h
110 lines (83 loc) · 2.97 KB
/
thumb-standard.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
/*
* Copyright (C) 2006 John Ellis
* Copyright (C) 2008 - 2016 The Geeqie Team
*
* Author: John Ellis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef THUMB_STANDARD_H
#define THUMB_STANDARD_H
#include <sys/types.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <glib.h>
#include <config.h>
#include "main-defines.h"
class FileData;
struct ImageLoader;
#if GLIB_CHECK_VERSION (2, 34, 0)
#define THUMB_FOLDER_GLOBAL "thumbnails"
#else
#define THUMB_FOLDER_GLOBAL ".thumbnails"
#endif
#define THUMB_FOLDER_LOCAL ".thumblocal"
#define THUMB_FOLDER_NORMAL "normal"
#define THUMB_FOLDER_LARGE "large"
#define THUMB_FOLDER_FAIL "fail" G_DIR_SEPARATOR_S GQ_APPNAME_LC "-" VERSION
#define THUMB_NAME_EXTENSION ".png"
struct ThumbLoaderStd
{
gboolean standard_loader;
ImageLoader *il;
FileData *fd;
time_t source_mtime;
off_t source_size;
mode_t source_mode;
gchar *thumb_path;
gchar *thumb_uri;
const gchar *local_uri;
gboolean thumb_path_local;
gint requested_width;
gint requested_height;
gboolean cache_enable;
gboolean cache_local;
gboolean cache_hit;
gboolean cache_retry;
gdouble progress;
using Func = void (*)(ThumbLoaderStd *, gpointer);
Func func_done;
Func func_error;
Func func_progress;
gpointer data;
};
ThumbLoaderStd *thumb_loader_std_new(gint width, gint height);
void thumb_loader_std_set_callbacks(ThumbLoaderStd *tl,
ThumbLoaderStd::Func func_done,
ThumbLoaderStd::Func func_error,
ThumbLoaderStd::Func func_progress,
gpointer data);
void thumb_loader_std_set_cache(ThumbLoaderStd *tl, gboolean enable_cache, gboolean local, gboolean retry_failed);
gboolean thumb_loader_std_start(ThumbLoaderStd *tl, FileData *fd);
void thumb_loader_std_free(ThumbLoaderStd *tl);
GdkPixbuf *thumb_loader_std_get_pixbuf(ThumbLoaderStd *tl);
void thumb_loader_std_calibrate_pixbuf(FileData *fd, GdkPixbuf *pixbuf);
ThumbLoaderStd *thumb_loader_std_thumb_file_validate(const gchar *thumb_path, gint allowed_days,
void (*func_valid)(const gchar *path, gboolean valid, gpointer data),
gpointer data);
void thumb_loader_std_thumb_file_validate_cancel(ThumbLoaderStd *tl);
void thumb_std_maint_removed(const gchar *source);
void thumb_std_maint_moved(const gchar *source, const gchar *dest);
#endif
/* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */