TYPEDEF: guint32 GdkWChar
C-TYPE: GdkXEvent
+REPLACE-C-TYPE: any gpointer
+
IMPLEMENT-STRUCTS: GdkEventAny GdkEventKey GdkEventButton
GdkEventScroll GdkEventMotion GdkEventExpose GdkEventVisibility
GdkEventCrossing GdkEventFocus GdkEventConfigure GdkEventProperty
} cond
>>
-<< double "long double" current-vocab create typedef >>
-
TYPEDEF: char gchar
TYPEDEF: uchar guchar
TYPEDEF: short gshort
TYPEDEF: guint16 gunichar2
TYPEDEF: gpointer pointer
-TYPEDEF: gpointer any
+
+REPLACE-C-TYPE: long\sdouble double
+REPLACE-C-TYPE: any gpointer
IMPLEMENT-STRUCTS: GPollFD GSource GSourceFuncs ;
aliases [ H{ } ] initialize
SYMBOL: implement-structs
+implement-structs [ V{ } ] initialize
+
+SYMBOL: replaced-c-types
+replaced-c-types [ H{ } ] initialize
! Copyright (C) 2009 Anton Gorenko.
! See http://factorcode.org/license.txt for BSD license.
-USING: accessors alien alien.c-types alien.parser arrays
+USING: accessors alien alien.c-types alien.parser arrays assocs
classes.parser classes.struct combinators
combinators.short-circuit definitions effects fry
gobject-introspection.common gobject-introspection.types kernel
IN: gobject-introspection.ffi
: string>c-type ( str -- c-type )
- parse-c-type ;
+ dup CHAR: * swap index [ cut ] [ "" ] if*
+ [ replaced-c-types get-global ?at drop ] dip
+ append parse-c-type ;
: define-each ( nodes quot -- )
'[ dup @ >>ffi drop ] each ; inline
! Copyright (C) 2009 Anton Gorenko.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors assocs combinators gobject-introspection.common
-gobject-introspection.ffi gobject-introspection.loader
-kernel lexer locals math namespaces sequences vocabs.parser xml ;
+gobject-introspection.ffi gobject-introspection.loader kernel lexer
+locals math namespaces sequences strings.parser vocabs.parser xml ;
IN: gobject-introspection
: with-child-vocab ( name quot -- )
{
[ define-ffi-repository ]
} cleave
- f implement-structs set-global ;
+ V{ } clone implement-structs set-global
+ H{ } clone replaced-c-types set-global ;
SYNTAX: GIR: scan define-gir-vocab ;
SYNTAX: IMPLEMENT-STRUCTS:
- ";" parse-tokens implement-structs set-global ;
+ ";" parse-tokens
+ implement-structs [ swap append! ] change-global ;
+
+SYNTAX: REPLACE-C-TYPE:
+ scan unescape-string scan swap
+ replaced-c-types get-global set-at ;
! Copyright (C) 2009 Anton Gorenko.
! See http://factorcode.org/license.txt for BSD license.
USING: alien alien.syntax alien.destructors alien.libraries
-combinators kernel literals math system
+classes.struct combinators kernel literals math system
gobject-introspection glib.ffi ;
EXCLUDE: alien.c-types => pointer ;
IN: gobject.ffi
TYPEDEF: void GStrv
TYPEDEF: gchar* gchararray
-IMPLEMENT-STRUCTS: GValue ;
-
GIR: vocab:gobject/GObject-2.0.gir
IN: gobject.ffi
+FORGET: GValue
+STRUCT: GValue { g_type GType } { data guint64[2] } ;
+
FORGET: GIOCondition
FORGET: G_IO_IN
FORGET: G_IO_OUT
} cond
>>
+REPLACE-C-TYPE: any gpointer
+
GIR: vocab:gstreamer/net/GstNet-0.10.gir