1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 
3 /*
4  *  GThumb
5  *
6  *  Copyright (C) 2001-2009 The Free Software Foundation, Inc.
7  *
8  *  This program is free software; you can redistribute it and/or modify
9  *  it under the terms of the GNU General Public License as published by
10  *  the Free Software Foundation; either version 2 of the License, or
11  *  (at your option) any later version.
12  *
13  *  This program is distributed in the hope that it will be useful,
14  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  *  GNU General Public License for more details.
17  *
18  *  You should have received a copy of the GNU General Public License
19  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
20  */
21 
22 #ifndef GTH_IMAGE_PRELOADER_H
23 #define GTH_IMAGE_PRELOADER_H
24 
25 #include "gth-image-loader.h"
26 #include "gth-file-data.h"
27 
28 #define GTH_ORIGINAL_SIZE -1
29 #define GTH_NO_PRELOADERS 0
30 #define GTH_MODIFIED_IMAGE NULL
31 
32 #define GTH_TYPE_IMAGE_PRELOADER            (gth_image_preloader_get_type ())
33 #define GTH_IMAGE_PRELOADER(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTH_TYPE_IMAGE_PRELOADER, GthImagePreloader))
34 #define GTH_IMAGE_PRELOADER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GTH_TYPE_IMAGE_PRELOADER, GthImagePreloaderClass))
35 #define GTH_IS_IMAGE_PRELOADER(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTH_TYPE_IMAGE_PRELOADER))
36 #define GTH_IS_IMAGE_PRELOADER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTH_TYPE_IMAGE_PRELOADER))
37 #define GTH_IMAGE_PRELOADER_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj), GTH_TYPE_IMAGE_PRELOADER, GthImagePreloaderClass))
38 
39 typedef struct _GthImagePreloader        GthImagePreloader;
40 typedef struct _GthImagePreloaderClass   GthImagePreloaderClass;
41 typedef struct _GthImagePreloaderPrivate GthImagePreloaderPrivate;
42 
43 struct _GthImagePreloader {
44 	GObject __parent;
45 	GthImagePreloaderPrivate *priv;
46 };
47 
48 struct _GthImagePreloaderClass {
49 	GObjectClass __parent_class;
50 };
51 
52 GType               gth_image_preloader_get_type		 (void) G_GNUC_CONST;
53 GthImagePreloader * gth_image_preloader_new			 (void);
54 void                gth_image_preloader_set_out_profile		 (GthImagePreloader		 *loader,
55 								  GthICCProfile			 *profile);
56 void                gth_image_preloader_load			 (GthImagePreloader		 *self,
57 								  GthFileData			 *requested,
58 								  int				  requested_size,
59 								  GCancellable			 *cancellable,
60 								  GAsyncReadyCallback		  callback,
61 								  gpointer			  user_data,
62 								  int				  n_files,
63 								  ...);
64 gboolean            gth_image_preloader_load_finish    		 (GthImagePreloader		 *self,
65 							  	  GAsyncResult			 *result,
66 							  	  GthFileData			**requested,
67 							  	  GthImage			**image,
68 							  	  int				 *requested_size,
69 							  	  int				 *original_width,
70 							  	  int				 *original_height,
71 							  	  GError			**error);
72 void                gth_image_preloader_set_modified_image	 (GthImagePreloader		 *self,
73 								  GthImage		 	 *image);
74 cairo_surface_t *   gth_image_preloader_get_modified_image	 (GthImagePreloader		 *self);
75 void		    gth_image_preloader_clear_cache		 (GthImagePreloader		 *self);
76 
77 #endif /* GTH_IMAGE_PRELOADER_H */
78