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 gobject-introspection
5 gobject-introspection.standard-types kernel libc
6 sequences system vocabs.loader ;
17 { [ os windows? ] [ "libgdk_pixbuf-2.0-0.dll" cdecl add-library ] }
18 { [ os unix? ] [ drop ] }
22 GIR: vocab:gdk/pixbuf/GdkPixbuf-2.0.gir
24 ! <workaround incorrect return-value in gir
26 FORGET: gdk_pixbuf_get_pixels
27 FUNCTION: guint8* gdk_pixbuf_get_pixels ( GdkPixbuf* pixbuf ) ;
31 : data>GInputStream ( data -- GInputStream )
32 [ malloc-byte-array &free ] [ length ] bi
33 f g_memory_input_stream_new_from_data ;
35 : GInputStream>GdkPixbuf ( GInputStream -- GdkPixbuf )
36 f { { pointer: GError initial: f } }
37 [ gdk_pixbuf_new_from_stream ] with-out-parameters