1 ! Copyright (C) 2009 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 ;
11 { [ os winnt? ] [ "libgdk_pixbuf-2.0-0.dll" cdecl add-library ] }
12 { [ os macosx? ] [ drop ] }
13 { [ os unix? ] [ "libgdk_pixbuf-2.0.so" cdecl add-library ] }
17 GIR: vocab:gdk/pixbuf/GdkPixbuf-2.0.gir
19 : data>GInputStream ( data -- GInputStream )
20 [ malloc-byte-array &free ] [ length ] bi
21 f g_memory_input_stream_new_from_data ;
23 : GInputStream>GdkPixbuf ( GInputStream -- GdkPixbuf )
24 f { { pointer: GError initial: f } }
25 [ gdk_pixbuf_new_from_stream ] with-out-parameters