1 ! Copyright (C) 2010 Anton Gorenko.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: alien alien.data alien.libraries alien.syntax
4 combinators gio.ffi glib.ffi gmodule.ffi gobject-introspection
5 gobject.ffi kernel libc sequences system ;
6 EXCLUDE: alien.c-types => pointer ;
15 { [ os winnt? ] [ "libgdk_pixbuf-2.0-0.dll" cdecl add-library ] }
16 { [ os unix? ] [ drop ] }
20 GIR: vocab:gdk/pixbuf/GdkPixbuf-2.0.gir
22 : data>GInputStream ( data -- GInputStream )
23 [ malloc-byte-array &free ] [ length ] bi
24 f g_memory_input_stream_new_from_data ;
26 : GInputStream>GdkPixbuf ( GInputStream -- GdkPixbuf )
27 f { { pointer: GError initial: f } }
28 [ gdk_pixbuf_new_from_stream ] with-out-parameters