1 /*
2  *      fm-thumbnail.h
3  *
4  *      Copyright 2010 Hong Jen Yee (PCMan) <pcman.tw@gmail.com>
5  *
6  *      This program is free software; you can redistribute it and/or modify
7  *      it under the terms of the GNU General Public License as published by
8  *      the Free Software Foundation; either version 2 of the License, or
9  *      (at your option) any later version.
10  *
11  *      This program is distributed in the hope that it will be useful,
12  *      but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  *      GNU General Public License for more details.
15  *
16  *      You should have received a copy of the GNU General Public License
17  *      along with this program; if not, write to the Free Software
18  *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19  *      MA 02110-1301, USA.
20  */
21 
22 
23 #ifndef __FM_THUMBNAIL_H__
24 #define __FM_THUMBNAIL_H__
25 
26 #include <gdk-pixbuf/gdk-pixbuf.h>
27 #include "fm-file-info.h"
28 #include "fm-thumbnail-loader.h"
29 
30 G_BEGIN_DECLS
31 
32 #define FmThumbnailRequest FmThumbnailLoader
33 
34 /**
35  * FmThumbnailReadyCallback:
36  * @req: request descriptor
37  * @data: user data provided when request was made
38  *
39  * The callback to requestor when thumbnail is ready.
40  * Note that this call is done outside of GTK loop so if the callback
41  * wants to use any GTK API it should call gdk_threads_enter() and
42  * gdk_threads_leave() for safety.
43  *
44  * Since: 0.1.0
45  */
46 typedef void (*FmThumbnailReadyCallback)(FmThumbnailRequest*req, gpointer data);
47 
48 void _fm_thumbnail_init();
49 
50 void _fm_thumbnail_finalize();
51 
52 FmThumbnailRequest* fm_thumbnail_request(FmFileInfo* src_file,
53                                     guint size,
54                                     FmThumbnailReadyCallback callback,
55                                     gpointer user_data);
56 
57 void fm_thumbnail_request_cancel(FmThumbnailRequest* req);
58 
59 GdkPixbuf* fm_thumbnail_request_get_pixbuf(FmThumbnailRequest* req);
60 
61 FmFileInfo* fm_thumbnail_request_get_file_info(FmThumbnailRequest* req);
62 
63 guint fm_thumbnail_request_get_size(FmThumbnailRequest* req);
64 
65 G_END_DECLS
66 
67 #endif /* __FM_THUMBNAIL_H__ */
68