| 
									
										
										
										
											2010-09-29 05:08:31 -04:00
										 |  |  | ! Copyright (C) 2010 Anton Gorenko. | 
					
						
							| 
									
										
										
										
											2010-05-26 14:17:14 -04:00
										 |  |  | ! See http://factorcode.org/license.txt for BSD license. | 
					
						
							| 
									
										
										
										
											2014-11-13 16:05:14 -05:00
										 |  |  | USING: alien alien.c-types alien.data alien.libraries | 
					
						
							|  |  |  | alien.syntax combinators gio.ffi glib.ffi gobject-introspection | 
					
						
							|  |  |  | gobject-introspection.standard-types kernel libc sequences | 
					
						
							|  |  |  | system vocabs ;
 | 
					
						
							| 
									
										
										
										
											2010-05-26 14:17:14 -04:00
										 |  |  | IN: gdk.pixbuf.ffi | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-11-13 16:05:14 -05:00
										 |  |  | << "gio.ffi" require >> | 
					
						
							| 
									
										
										
										
											2010-09-29 05:08:31 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | LIBRARY: gdk.pixbuf | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-11-13 16:05:14 -05:00
										 |  |  | << "gdk.pixbuf" { | 
					
						
							|  |  |  |     { [ os windows? ] [ "libgdk_pixbuf-2.0-0.dll" ] } | 
					
						
							|  |  |  |     { [ os macosx? ] [ "libgdk_pixbuf-2.0.dylib" ] } | 
					
						
							|  |  |  |     { [ os unix? ] [ "libgdk_pixbuf-2.0.so" ] } | 
					
						
							|  |  |  | } cond cdecl add-library >> | 
					
						
							| 
									
										
										
										
											2010-05-26 14:17:14 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | GIR: vocab:gdk/pixbuf/GdkPixbuf-2.0.gir | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-03-07 17:42:51 -05:00
										 |  |  | ! <workaround incorrect return-values in gir | 
					
						
							| 
									
										
										
										
											2011-08-30 12:12:42 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | FORGET: gdk_pixbuf_get_pixels | 
					
						
							| 
									
										
										
										
											2015-07-19 19:25:30 -04:00
										 |  |  | FUNCTION: guint8* gdk_pixbuf_get_pixels ( GdkPixbuf* pixbuf ) | 
					
						
							| 
									
										
										
										
											2011-08-30 12:12:42 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-03-07 17:42:51 -05:00
										 |  |  | FORGET: gdk_pixbuf_new_from_data | 
					
						
							|  |  |  | FUNCTION: GdkPixbuf* gdk_pixbuf_new_from_data ( guint8* data, | 
					
						
							|  |  |  |                                                 GdkColorspace colorspace, | 
					
						
							|  |  |  |                                                 gboolean has_alpha, | 
					
						
							|  |  |  |                                                 int bits_per_sample, | 
					
						
							|  |  |  |                                                 int width, | 
					
						
							|  |  |  |                                                 int height, | 
					
						
							|  |  |  |                                                 int rowstride, | 
					
						
							|  |  |  |                                                 GdkPixbufDestroyNotify destroy_fn, | 
					
						
							| 
									
										
										
										
											2015-07-19 19:25:30 -04:00
										 |  |  |                                                 gpointer destroy_fn_data ) | 
					
						
							| 
									
										
										
										
											2014-03-07 17:42:51 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | FORGET: gdk_pixbuf_save_to_bufferv | 
					
						
							|  |  |  | FUNCTION: gboolean gdk_pixbuf_save_to_bufferv ( GdkPixbuf* pixbuf, | 
					
						
							|  |  |  |                                                 guint8** data, | 
					
						
							|  |  |  |                                                 gsize* buffer_size, | 
					
						
							|  |  |  |                                                 c-string type, | 
					
						
							|  |  |  |                                                 char **option_keys, | 
					
						
							|  |  |  |                                                 char **option_values, | 
					
						
							| 
									
										
										
										
											2015-07-19 19:25:30 -04:00
										 |  |  |                                                 GError **error ) | 
					
						
							| 
									
										
										
										
											2014-03-07 17:42:51 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-08-30 12:12:42 -04:00
										 |  |  | ! workaround> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-07-26 15:11:53 -04:00
										 |  |  | : data>GInputStream ( data -- GInputStream )
 | 
					
						
							|  |  |  |     [ malloc-byte-array &free ] [ length ] bi
 | 
					
						
							|  |  |  |     f g_memory_input_stream_new_from_data ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | : GInputStream>GdkPixbuf ( GInputStream -- GdkPixbuf )
 | 
					
						
							|  |  |  |     f { { pointer: GError initial: f } } | 
					
						
							|  |  |  |     [ gdk_pixbuf_new_from_stream ] with-out-parameters | 
					
						
							|  |  |  |     handle-GError ;
 |