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.
|
2010-07-26 15:11:53 -04:00
|
|
|
USING: alien alien.data alien.libraries alien.syntax
|
|
|
|
|
combinators gio.ffi glib.ffi gmodule.ffi gobject-introspection
|
2011-08-27 21:26:21 -04:00
|
|
|
gobject.ffi kernel libc sequences system vocabs.loader ;
|
2010-05-26 14:17:14 -04:00
|
|
|
EXCLUDE: alien.c-types => pointer ;
|
|
|
|
|
IN: gdk.pixbuf.ffi
|
|
|
|
|
|
2010-09-29 05:08:31 -04:00
|
|
|
"gio.ffi" require
|
|
|
|
|
|
|
|
|
|
LIBRARY: gdk.pixbuf
|
|
|
|
|
|
2010-05-26 14:17:14 -04:00
|
|
|
<<
|
|
|
|
|
"gdk.pixbuf" {
|
|
|
|
|
{ [ os winnt? ] [ "libgdk_pixbuf-2.0-0.dll" cdecl add-library ] }
|
2011-02-27 17:36:01 -05:00
|
|
|
{ [ os unix? ] [ drop ] }
|
2010-05-26 14:17:14 -04:00
|
|
|
} cond
|
|
|
|
|
>>
|
|
|
|
|
|
|
|
|
|
GIR: vocab:gdk/pixbuf/GdkPixbuf-2.0.gir
|
|
|
|
|
|
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 ;
|