Simplify vflist_get_formatted()
[geeqie.git] / src / cache-loader.h
1 /*
2  * Copyright (C) 2004 John Ellis
3  * Copyright (C) 2008 - 2016 The Geeqie Team
4  *
5  * Author: John Ellis
6  *
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.
11  *
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.
16  *
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.
20  */
21
22 #ifndef CACHE_LOADER_H
23 #define CACHE_LOADER_H
24
25
26 #include "cache.h"
27 #include "image-load.h"
28
29
30 typedef struct _CacheLoader CacheLoader;
31
32 typedef void (* CacheLoaderDoneFunc)(CacheLoader *cl, gint error, gpointer data);
33
34
35 typedef enum {
36         CACHE_LOADER_NONE       = 0,
37         CACHE_LOADER_DIMENSIONS = 1 << 0,
38         CACHE_LOADER_DATE       = 1 << 1,
39         CACHE_LOADER_MD5SUM     = 1 << 2,
40         CACHE_LOADER_SIMILARITY = 1 << 3
41 } CacheDataType;
42
43 struct _CacheLoader {
44         FileData *fd;
45         CacheData *cd;
46
47         CacheDataType todo_mask;
48         CacheDataType done_mask;
49
50         CacheLoaderDoneFunc done_func;
51         gpointer done_data;
52
53         gboolean error;
54
55         ImageLoader *il;
56         guint idle_id; /**< event source id */
57 };
58
59
60 CacheLoader *cache_loader_new(FileData *fd, CacheDataType load_mask,
61                               CacheLoaderDoneFunc done_func, gpointer done_data);
62
63 void cache_loader_free(CacheLoader *cl);
64
65
66 #endif
67 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */