G-Wrap support for (gnome gobject) types. Code in this module is only
loaded when generating wrapsets; as such, it is not for end users.
<gobject-wrapset-base>) (alias <string>) (name <symbol>)Add a type alias to wrapset, that the string alias is associated with the type named symbol. For example,
"GtkWindow*"might be associated with a type named<gtk-window>. Seelookup-type-by-alias.
<gobject-wrapset-base>) (name <string>)Lookup a type aliased name in wrapset, and all wrapsets on which wrapset depends. This interface is used by
load-defsto associate G-Wrap types with the strings parsed out of the C header files.
<gobject-wrapset-base>) (param-type <string>) (typespec <top>)Add a type rule to wrapset, that the string param-type maps directly to the g-wrap typespec typespec. For example,
"int*"might map to the typespec(int out). Seefind-type-rule.
<gobject-wrapset-base>) (param-type <string>)See if the parameter type param-type has a type rule present in wrapset or in any wrapset on which wrapset depends. This interface is used by
load-defsto associate G-Wrap typespecs with the strings parsed out of the C header files.
A base G-Wrap type class for classed GLib types (see
gtype-classed?).
A base G-Wrap type class for for classed GLib types whose values are pointers.
<gw-value>) (status-var <top>) (code <top>)Unwrap a value into a C pointer, optionally unwrapping
#fasNULL.This function checks the typespec options on value, which should be a
<gw-value>. If thenull-okoption is set (which is only the case for value classes withnull-okin its#:allowed-options), this function generates code that unwraps#fasNULL. Ifnull-okis unset, or the value is not#f, code is run instead.
<gobject-wrapset-base>) (args <top>)...Define a wrapper for a specific instantiatable (
<gtype-instance>-derived) type in ws. Required keyword arguments are#:ctypeand#:gtype-id. For example,(wrap-instance! ws #:ctype "GtkWidget" #:gtype-id "GTK_TYPE_WIDGET")Normally only called from
load-defs.
<gobject-wrapset-base>) (args <top>)...Define a wrapper for a specific boxed type in ws. Required keyword arguments are
#:ctypeand#:gtype-id, as inwrap-instance!.
<gobject-wrapset-base>) (args <top>)...Define a wrapper for a specific pointer type in ws. Required keyword arguments are
#:ctypeand#:gtype-id, as inwrap-instance!.
Define a wrapper for an opaque pointer with the C type ctype. It will not be possible to create these types from Scheme, but they can be received from a library, and passed as arguments to other calls into the library.
Define a wrapper for structure values of type ctype.
wrap and unwrap are the names of C functions to convert a C structure to Scheme and vice versa, respectively. When in a function call, parameters of this type of the form `StructName*' are interpreted as `out' parameters, while `const-StructName*' are treated as `in' parameters.
Note that ctype should be the type of the structure, not a pointer to the structure.
<gobject-wrapset-base>) (args <top>)...Define a wrapper for an interface type in ws. Required keyword arguments are
#:ctypeand#:gtype-id, as inwrap-instance!.
<gobject-wrapset-base>) (args <top>)...Define a wrapper for a flags type in ws. Required keyword arguments are
#:ctypeand#:gtype-idor#:values, as inwrap-enum!.
<gobject-wrapset-base>) (args <top>)...Define a wrapper for GObject class values ws. Required keyword arguments are
#:ctypeand#:gtype-id, as inwrap-instance!.
#:ctypeshould refer to the type of the class and not the instance; e.g."GtkWidgetClass"and not"GtkWidget". This function will not be called byload-defs, and should be invoked manually in a wrapset as needed.
Wrap a boxed type using custom wrappers and unwrappers.
FIXME: missing a wrapset argument!
ctype and gtype are as
#:ctypeand#:gtype-idinwrap-instance!. wrap and unwrap are G-Wrap forms in whichscm-varandc-varwill be bound to the names of the SCM and C values, respectively. For example:(wrap-custom-boxed! "GdkRectangle" "GDK_TYPE_RECTANGLE" (list scm-var " = " c-var " ? scm_gdk_rectangle_to_scm (" c-var ")" " : SCM_BOOL_F;") (list c-var " = scm_scm_to_gdk_rectangle (" scm-var ");"))
Wrap a GValue type using custom wrap and unwrap functions.
FIXME: missing a wrapset argument!
ctype and gtype are as
#:ctypeand#:gtype-idinwrap-instance!. wrap-func and unwrap-func are names of functions to convert to and from Scheme values, respectively. For example:(wrap-custom-gvalue! "GstFraction" "GST_TYPE_FRACTION" "scm_from_gst_fraction" "scm_to_gst_fraction")