Guile Gnome Gobject

download Guile Gnome Gobject

of 39

Transcript of Guile Gnome Gobject

  • 8/3/2019 Guile Gnome Gobject

    1/39

    Guile-GNOME: GObjectversion 2.15.98, updated 24 April 2008

    Andy Wingo (wingo at pobox.com)Martin Baulig (baulig at suse.de)

    mailto:wingo%20at%20pobox.commailto:baulig%20at%20suse.demailto:baulig%20at%20suse.demailto:wingo%20at%20pobox.com
  • 8/3/2019 Guile Gnome Gobject

    2/39

    This manual is or Guile-GNOME: GObject (version 2.15.98, updated 24 April 2008)

    Copyright 2003,2004,2005,2006,2007,2008 Free Sotware Foundation

    Permission is granted to copy, distribute and/or modiy this document underthe terms o the GNU General Public License, Version 2 or any later versionpublished by the Free Sotware Foundation.

  • 8/3/2019 Guile Gnome Gobject

    3/39

    i

    Short Contents

    1 (gnome-2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

    2 (gnome gobject). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    33 (gnome gobject gtype) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

    4 (gnome gobject gvalue) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

    5 (gnome gobject gparameter) . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

    6 (gnome gobject gclosure) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

    7 (gnome gobject gsignal) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

    8 (gnome gobject gobject) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

    9 (gnome gobject generics) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

    10 (gnome gobject utils) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

    11 (gnome gw generics). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    2312 (gnome gw support gobject) . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

    13 (gnome gw support defs) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

    14 (gnome gw support gtk-doc) . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

    15 (gnome gw support modules). . . . . . . . . . . . . . . . . . . . . . . . . . . 33

    Type Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

    Function Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

  • 8/3/2019 Guile Gnome Gobject

    4/39

    Chapter 1: (gnome-2) 1

    1 (gnome-2)

    1.1 Overview

    Selects version 2 o the Guile-GNOME libraries. This module is used or its side efects; itexports no procedures.

    1.2 Rationale

    Early in the development o guile-gnome, we realized that at some point we might needto make incompatible changes. O course, we would not want to orce a correctly-writtenprogram to break when guile-gnome gets upgraded. For this reason, we decided to makeguile-gnome parallel-installable. A program is completely specied when it indicates whichversion o guile-gnome it should use.

    Guile-gnome has the concept o an API version, which indicates a stable API series. For

    example, a program written against API version 2 o guile-gnome will continue to workagainst all uture releases o that API version. It is permitted to add interaces within astable series, but never to remove or change them incompatibly.

    Changing the API version is expected to be a relatively inrequent operation. The currentAPI version is 2.

    There are two manners or a program to speciy the guile-gnome version:

    1. Via importing the (gnome-version ) module.

    This special module alters guiles load path to include the path o the specied APIversion o guile-gnome. For example:

    (use-modules (gnome-2))

    2. Via invoking guile as guile-gnome-version.

    This shell script is installed when building a particular version o guile-gnome, andserves to automatically load the (gnome-apiversion ) module. For example, to get arepl ready or guile-gnome:

    $ guile-gnome-2

    To load a script with a particular version o guile-gnome:

    $ guile-gnome-2 -s script args...

    To speciy the guile-gnome version in a script, you might begin the le with:

    #! /bin/sh

    # -*- scheme -*-exec guile-gnome-2 -s $0

    !#

    ;; scheme code here...

    A program must select the guile-gnome version beore importing any guile-gnome mod-ules. Indeed, one cannot even import (gnome gobject) beore doing so.

    For a urther rationale on parallel installability, see http://ometer.com/parallel.html.

    http://ometer.com/parallel.htmlhttp://ometer.com/parallel.html
  • 8/3/2019 Guile Gnome Gobject

    5/39

    Chapter 1: (gnome-2) 2

    1.3 Usage

  • 8/3/2019 Guile Gnome Gobject

    6/39

    Chapter 2: (gnome gobject) 3

    2 (gnome gobject)

    2.1 OverviewThis is the Guile wrapper o libgobject, an implementation o a runtime, dynamic typesystem or C. Besides providing an object system to C, libgobjects main design goal wasto increase the ease with which C code can be wrapped by interpreted languages, such asGuile or Perl.

    This module, (gnome gobject), just re-exports procedures rom other modules, so itsdocumentation seems an opportune spot or a more tutorial-like introduction. So open upa Guile session and lets begin.

    First, i you havent done it, load the appropriate version o Guile-GNOME:

    guile> (use-modules (gnome-2))

    (gnome gobject) is based heavily on GOOPS, Guiles object system, so go ahead andload up that too:

    guile> (use-modules (oop goops))

    We will leave of the guile> prompt in the rest o this tutorial. When we want to showthe value o an expression, we use :

    (+ 3 5) 8

    2.2 Basic typesWhen communicating with libgobject, most values need to be strictly-typed. Thereis a type class corresponding to each basic type in C: , , ,, , , , , , , , and.

    You can make instances o these class with make:

    (make #:value #f) #

    (make #:value 85) #

    (make #:value 3.1415) #

    (make #:value "Hello World!") #

    You can get the normal Scheme values back with gvalue->scm:

  • 8/3/2019 Guile Gnome Gobject

    7/39

    Chapter 2: (gnome gobject) 4

    (gvalue->scm (make #:value "Hello World!")) "Hello World!"

    2.3 Enums and fagsEnumerated values and bitags are an essential part o many C APIs, and so they arespecially wrapped in the GLib type system. You can create new enumerated types inScheme by subclassing :

    (define-class ()

    #:vtable #((hello "Hello World" 1) (test "Test" 2)))

    Instances are created with make, just like with the other types:

    (make #:value hello)

    (make #:value "Hello World")

    (make #:value 1)

    ;; These three all do the same thing #

    I there is an already existing enum or ags class, you can get inormation about it:

    (genum-class->value-table ) #((hello "Hello World" 1) (test "Test" 2))

    Enums and ags have a special representation on the Scheme side. You can convertthem to Scheme values as symbols, names, or as a numeric value.

    (define foo (make #:value hello))(genum->symbol foo) hello

    (genum->name foo) "Hello World"

    (genum->value foo) 1

    2.4 GType

    All o the types that GLib knows about are available to Guile, regardless o which language

    dened them. GLib implements this via a type system, where every type has a name. So iyou make a type called Foo in C, you can get to it in Scheme via gtype-name->class:

    ;; Retrieve the type for the foo enum we made earlier in the tutorial

    (define copy-of- (gtype-name->class "Foo"))

    (eq? copy-of-) #t

    (make copy-of- #:value 2)

  • 8/3/2019 Guile Gnome Gobject

    8/39

    Chapter 2: (gnome gobject) 5

    #

    2.5 GObject

    (GObject in C) is the basic object type in libgobject. (gnome gobject) allowsyou to access existing GObject types, as well as to create new GObject types in Scheme.

    Beore we start, lets pull in some generic unctions that reduce the amount o typing wehave to do:

    (use-modules (gnome gobject generics))

    Lets assume we start with rom (gnome gtk). The keyword argumentsto make are interpreted as GObject properties to set:

    (define window (make

    #:type toplevel #:title "Hello, World!"))

    You can connect to signals on the new instance:

    (connect window delete-event

    (lambda (window event)

    ;; Returns #t to ignore this event

    #t))

    ;; connect is a generic function implemented by

    ;; gtype-instance-signal-connect

    And get and set properties...

    (get window title) "Hello, World!"

    (set window resizable #f)

    ;; get and set are also generics, implemented by gobject-get-property

    ;; and gobject-set-property

    2.6 Deriving your own GObject types

    You can create new GObject types directly rom Scheme, deriving either rom a C objecttype or one you made in Scheme.

    ;; deriving from

    (define-class ()

    ;; a normal object slot

    my-data

    ;; an object slot exported as a gobject property

    (pub-data #:gparam (list #:name test))

  • 8/3/2019 Guile Gnome Gobject

    9/39

    Chapter 2: (gnome gobject) 6

    ;; a signal with no arguments and no return value

    #:gsignal (frobate #f))

    ;; deriving from -- also inherits properties and signals

    (define-class ())

    Adding a signal automatically denes the deault method:

    ;; This is the default handler for this signal.

    (define-method (test:frobate (object ))

    (format #t "Frobating ~A\n" object))

    ;; We can override it for subclasses

    (define-method (test:frobate (object ))

    (next-method) ;; chain up

    (format #t "Im hungry\n"))

    (emit (make ) frobate)

    ;; Try it!

    You can override the initialize, gobject:get-property, and gobject:set-propertymethods. For an extended example, see tic-tac-toe.scm in the gtk/examples/gtk direc-tory o the distribution.

    2.7 Usage

  • 8/3/2019 Guile Gnome Gobject

    10/39

    Chapter 3: (gnome gobject gtype) 7

    3 (gnome gobject gtype)

    3.1 Overview

    Base support or the GLib type system.

    The GLib runtime type system is broken into a number o modules, o which GType isthe base. A GType is a simply a named type. Some types are undamental and cannot besubclassed, such as integers. Others can orm the root o complicated ob ject hierarchies,such as .

    One can obtain the class or a type i you know its name. For example,

    (gtype-name->class "guint64") #

    A more detailed reerence on the GLib type system may be had athttp://library.gnome.org/devel/gobject/stable/ .

    3.2 Usage

    [Class]The metaclass o all GType classes. Ensures that GType classes have a gtype slot,which records the primitive GType inormation or this class.

    [Class]The root class o all instantiatable GType classes. Adds a slot, gtype-instance, toinstances, which holds a pointer to the C value.

    [Primitive]gtype-name->class name

    Return the associated with the GType, name.

    [Function]class-name->gtype-name class-nameConvert the name o a class into a suitable name or a GType. For example:

    (class-name->gtype-name ) "FooBar"

    [Function]gruntime-error ormat-string . argsSignal a runtime error. The error will be thrown to the key gruntime-error.

    [Primitive]gtype-instance-destroy! instanceRelease all reerences that the Scheme wrapper instance has on the underlying Cvalue, and release pointers associated with the C value that point back to Scheme.

    Normally, you dont need to call this unction, because garbage collection will take careo resource management. However some instances have semanticsthat require this unction. The canonical example is that when a emits the destroy signal, all code should drop their reerences to the object. This is,o course, handled internally in the (gnome gtk) module.

    http://library.gnome.org/devel/gobject/stable/http://library.gnome.org/devel/gobject/stable/
  • 8/3/2019 Guile Gnome Gobject

    11/39

    Chapter 4: (gnome gobject gvalue) 8

    4 (gnome gobject gvalue)

    4.1 Overview

    GLib supports generic typed values via its GValue module. These values are wrapped inScheme as instances o classes, such as , , etc.

    In most cases, use o is transparent to the Scheme user. Values which can berepresented directly as Scheme values are normally given to the user in their Scheme orm,e.g. #\a instead o #. However, when dealing with low-levelroutines it is sometimes necessary to have values in orm. The conversion betweenthe two is perormed via the scm->gvalue and gvalue->scm unctions.

    The other set o useul procedures exported by this module are those dealing with enu-merated values and ags. These objects are normally represented on the C side withintegers, but they have symbolic representations registered in the GLib type system.

    On the Scheme side, enumerated and ags values are canonically expressed as objects. They can be converted to integers or symbols using the conversion proceduresexported by this module. It is conventional or Scheme procedures that take enumeratedvalues to accept any orm or the values, which can be canonicalized using (make #:value value ), where value can be an integer, a symbol (or symbol list inthe case o ags), or the string nickname (or string list) o the enumerated/ags value.

    4.2 Usage

    [Class]

    [Class]

    A class or boolean values.

    [Class]A class or signed 8-bit values.

    [Class]A class or unsigned 8-bit values.

    [Class]A class or signed 32-bit values.

    [Class]A class or unsigned 32-bit values.

    [Class]A class or signed long (32- or 64-bit) values.

    [Class]A class or unsigned long (32- or 64-bit) values.

    [Class]A class or signed 64-bit values.

  • 8/3/2019 Guile Gnome Gobject

    12/39

    Chapter 4: (gnome gobject gvalue) 9

    [Class]A class or unsigned 64-bit values.

    [Class]

    A class or 32-bit oating-point values.

    [Class]A class or 64-bit oating-point values.

    [Class]A class or arrays o 8-bit values (C strings).

    [Class]A class or boxed types, a way o wrapping generic C structures. Youwont see instances o this class, only o its subclasses.

    [Class]A class or holding arbitrary Scheme objects.

    [Class]A class or arrays o .

    [Class]A class or opaque pointers.

    [Class]A base class or enumerated values. Users may dene new enumerated valuetypes via subclssing rom , passing #:vtable table as an initarg, where tableshould be in a ormat suitable or passing to genum-register-static.

    [Class]A base class or ag values. Users may dene new ag value types viasubclssing rom , passing #:vtable table as an initarg, where table shouldbe in a ormat suitable or passing to gflags-register-static.

    [Primitive]genum-register-static name vtableCreates and registers a new enumerated type with name name with the C runtime.There must be no type with name name when this unction is called.

    The new type can be accessed by using gtype-name->class.

    vtable is a vector describing the new enum type. Each vector element describes oneenum element and must be a list o 3 elements: the elements nick name as a symbol,

    its name as a string, and its integer value.

    (genum-register-static "Test"

    #((foo "Foo" 1) (bar "Bar" 2) (baz "Long name of baz" 4)))

    [Primitive]gflags-register-static name vtableCreates and registers a new ags with name name with the C runtime.

    The vtable should be in the ormat described in the documentation or genum-register-static.

  • 8/3/2019 Guile Gnome Gobject

    13/39

    Chapter 4: (gnome gobject gvalue) 10

    [Primitive]genum-class->value-table classReturn a table o the values supported by the enumerated class. Thereturn value will be in the ormat described in genum-register-static.

    [Primitive]gflags-class->value-table classReturn a table o the values supported by the ag class. The returnvalue will be in the ormat described in gflags-register-static.

    [Primitive]scm->gvalue class scmConvert a Scheme value into a o type class. I the conversion is not possible,raise a gruntime-error.

    [Primitive]gvalue->scm valueConvert a into it normal scheme representation, or example unboxingcharacters into Scheme characters. Note that the Scheme orm or some values is the orm, or example with boxed or enumerated values.

    [Function]genum->symbol objConvert the enumerated value obj rom a to its symbol representation (itsnickname).

    [Function]genum->name objConvert the enumerated value obj rom a to its representation as a string(its name).

    [Primitive]genum->value valueConvert the enumerated value obj rom a to its representation as an integer.

    [Primitive]gflags->value value

    Convert the ags value obj rom a to its representation as an integer.

    [Function]gflags->symbol-list objConvert the ags value obj rom a to a list o the symbols that it represents.

    [Function]gflags->name-list objConvert the ags value obj rom a to a list o strings, the names o thevalues it represents.

    [Function]gflags->value-list objConvert the ags value obj rom a to a list o integers, which when loganddtogether yield the ags value.

  • 8/3/2019 Guile Gnome Gobject

    14/39

    Chapter 5: (gnome gobject gparameter) 11

    5 (gnome gobject gparameter)

    5.1 Overview

    Parameters are constraints or values, both in type and in range. This module wraps theparameters code o the GLib type system, allowing parameters to be manipulated andcreated rom Scheme.

    There is a parameter class or each type o parameter: , ,etc.

    5.2 Usage

    [Class]The base class or GLib parameter objects. (Doc slots)

    [Class]Parameter or values.

    [Class]Parameter or values.

    [Class]Parameter or values.

    [Class]Parameter or values.

    [Class]

    Parameter or values.

    [Class]Parameter or values.

    [Class]Parameter or values.

    [Class]Parameter or values.

    [Class]Parameter or values.

    [Class]Parameter or values.

    [Class]Parameter or values.

    [Class]Parameter or Unicode codepoints, represented as values.

  • 8/3/2019 Guile Gnome Gobject

    15/39

    Chapter 5: (gnome gobject gparameter) 12

    [Class]Parameter or values.

    [Class]

    Parameter or values.

    [Class]Parameter or values.

    [Class]Parameter or values.

    [Class]Parameter or values.

    [Class]A type or the ags allowable on a : read, write, construct,

    construct-only, and lax-validation.

    [Variable]gparameter:uint-max

    [Variable]gparameter:int-min

    [Variable]gparameter:int-max

    [Variable]gparameter:ulong-max

    [Variable]gparameter:long-min

    [Variable]gparameter:long-max

    [Variable]gparameter:uint64-max

    [Variable]gparameter:int64-min

    [Variable]gparameter:int64-max

    [Variable]gparameter:float-max

    [Variable]gparameter:float-min

    [Variable]gparameter:double-max

    [Variable]gparameter:double-min

    [Variable]gparameter:byte-order

  • 8/3/2019 Guile Gnome Gobject

    16/39

    Chapter 6: (gnome gobject gclosure) 13

    6 (gnome gobject gclosure)

    6.1 Overview

    The GLib type system supports the creation and invocation o closures, objects whichcan be invoked like procedures. Its inrastructure allows one to pass a Scheme unction toC, and have C call into Scheme, and vice versa. In Scheme, holds a Schemeprocedure, the o its return value, and a list o the s o its arguments.Closures can be invoked with gclosure-invoke.

    However since on the C level, closures do not carry a description o their argument andreturn types, when we invoke a closure we have to be very explicit about the types involved.For example:

    (gclosure-invoke (make

    #:return-type

    #:param-types (list )#:func (lambda (x) (* x x)))

    (scm->gvalue 10)) 100

    6.2 Usage

    [Class]The Scheme representation o a GLib closure: a typed procedure object that can bepassed to other languages.

    [Primitive]gclosure-invoke closure return type argsInvoke a closure.

    A in GLibs abstraction or a callable object. This abstraction carries notype inormation, so the caller must supply all arguments as typed instances,which may be obtained by the scheme procedure, scm->gvalue.

    As you can see, this is a low-level unction. In act, it is not used internally by theguile-gobject bindings.

  • 8/3/2019 Guile Gnome Gobject

    17/39

    Chapter 7: (gnome gobject gsignal) 14

    7 (gnome gobject gsignal)

    7.1 OverviewGSignal is a mechanism by which code, normally written in C, may expose extension pointsto which closures can be connected, much like Guiles hooks. Instantiatable types can havesignals associated with them; or example, has an expose signal that will bered at certain well-documented points.

    Signals are typed. They speciy the types o their return value, and the types o theirarguments.

    This module denes routines or introspecting, emitting, connecting to, disconnectingrom, blocking, and unblocking signals. Additionally it denes routines to dene new signaltypes on instantiatable types.

    7.2 Usage[Class]

    A describes a signal on a : its name, and how it shouldbe called.

    [Primitive]gtype-class-get-signals class tailReturns a list o signals belonging to class and all parent types.

    [Function]gtype-class-get-signal-names classReturns a vector o signal names belonging to class and all parent classes.

    [Primitive]gtype-instance-signal-emit object name args[Function]gtype-instance-signal-connect object name unc . ater?

    Connects unc as handler or the objects signal name.

    name should be a symbol. ater is boolean speciying whether the handler is runbeore (#f) or ater (#t) the signals deault handler.

    Returns an integer number which can be used as arugment o gsignal-handler-block, gsignal-handler-unblock, gsignal-handler-disconnect and gsignal-handler-connected?.

    [Function]gtype-instance-signal-connect-after object name uncConvenience unction or calling gtype-instance-signal-connect with ater = #t.

    [Primitive]gsignal-handler-block instance handler id

    [Primitive]gsignal-handler-unblock instance handler id

    [Primitive]gsignal-handler-disconnect instance handler id

    [Primitive]gsignal-handler-connected? instance handler id

    [Function]gtype-class-create-signal class name return-type param-typesCreate a new signal associated with the class.

  • 8/3/2019 Guile Gnome Gobject

    18/39

    Chapter 7: (gnome gobject gsignal) 15

    name should be a symbol, the name o the signal. return-type should be a object. param-types should be a list o objects.

    In a bit o an odd interace, this unction will return a new generic unction, which

    will be run as the signals deault handler, whose deault method will silently returnan unspecied value. The user may dene new methods on this generic to providealternative deault handler implementations.

  • 8/3/2019 Guile Gnome Gobject

    19/39

    Chapter 8: (gnome gobject gobject) 16

    8 (gnome gobject gobject)

    8.1 Overview

    GObject is what is commonly understood as the object system or GLib. This is not strictlytrue. GObject is one implementation o an object system, built on the other modules:GType, GValue, GParameter, GClosure, and GSignal.

    Similarly, this Guile module provides integration with the GObject object system, builton the Guile modules that support GType, GValue, GParameter, GClosure, and GSignal.

    The main class exported by this module is . classes can be sub-classed by the user, which will register new subtypes with the GType runtime type system. classes are are also created as needed when wrapping GObjects that come romC, or example rom a unctions return value.

    Besides supporting derivation, and signals like other implementa-

    tions, has the concept o properties, which are s associated with theobject. The values are constrained by s, which are associated with the objectsclass. This module exports the necessary routines to query, get, and set prop-erties.

    In addition, this module denes the base class, whose subclasses may bepresent as mixins o classes. For example:

    (use-modules (gnome gtk) (oop goops))

    (class-direct-supers )

    (#

    #)

    In this example, we see that has two superclasses, and. The second is an interace implemented by the class. See gtype-interfaces or more details.

    8.2 Usage

    [Class]The base class or GLibs deault object system.

    s metaclass understands a new slot option, #:gparam, which will exporta slot as a property. The deault implementation will set and access thevalue rom the slot, but you can customize this by writing your own methods or

    gobject:set-property and gobject:get-property.In addition, the metaclass also understands #:gsignal arguments, which dene sig-nals on the class, and dene the generics or the deault signal handler. See gtype-class-define-signal or more inormation.

    For example:

    ;; deriving from

    (define-class ()

    ;; a normal object slot

  • 8/3/2019 Guile Gnome Gobject

    20/39

    Chapter 8: (gnome gobject gobject) 17

    my-data

    ;; an object slot exported as a gobject property

    (pub-data #:gparam (list #:name test))

    ;; likewise, using non-default parameter settings

    (foo-data #:gparam (list #:name foo

    #:minimum -3 #:maximum 1000

    #:default-value 42))

    ;; a signal with no arguments and no return value

    #:gsignal (frobate #f)

    ;; a signal with arguments and a return value

    #:gsignal (list frobate ))

    ;; deriving from -- also inherits properties and signals

    (define-class ())

    classes also expose a slot or each GObject property dened on the class,i such a slot is not already dened.

    [Class]The base class or GLibs interace types. Not derivable in Scheme.

    [Class]Parameter or values.

    [Primitive]gtype-register-static name parent classDerive a new type named name rom parent class. Returns the new .This unction is called when deriving rom ; users do not normally call thisunction directly.

    [Generic]gobject:get-propertyCalled to get a gobject property. Only properties directly belonging to the objectsclass will come through this unction; superclasses handle their own properties.

    Takes two arguments: the object and the property name.

    Call (next-method) in your methods to invoke the deault handler

    [Method]gobject:get-property (object ) (name )

    The deault implementation o gobject:get-property, which calls (slot-ref objname).

    [Generic]gobject:set-propertyCalled to set a gobject property. Only properties directly belonging to the objectsclass will come through this unction; superclasses handle their own properties.

    Takes three arguments: the object, the property name, and the value.

    Call (next-method) in your methods to invoke the deault handler.

  • 8/3/2019 Guile Gnome Gobject

    21/39

    Chapter 8: (gnome gobject gobject) 18

    [Method]gobject:set-property (object ) (name ) (value)

    The deault implementation ogobject:set-property, which sets slots on the object.

    [Primitive]gobject-class-get-properties class

    [Function]gobject-class-find-property class nameReturns a property named name (a symbol), belonging to class or one o its parentclasses, or #f i not ound.

    [Primitive]gobject-class-get-property-names class

    [Primitive]gobject-get-property object nameGets a the property named name (a symbol) rom object.

    [Primitive]gobject-set-property object name valueSets the property named name (a symbol) on object to init-value.

  • 8/3/2019 Guile Gnome Gobject

    22/39

    Chapter 9: (gnome gobject generics) 19

    9 (gnome gobject generics)

    9.1 OverviewGeneric unctions or procedures in the (gnome gobject) module.

    9.1.1 Mapping class libraries to Scheme

    Guile-GNOME exists to wrap a C library, libgobject, its types, and the set o librariesthat based themselves on the GLib types.

    Procedure invocation eels very similar in Scheme and in C. For example, the C gtk_widget_show (widget) transliterates almost exactly to the Scheme (gtk-widget-showwidget).

    GLib-based libraries are not random collections o unctions, however. GLib-based li-

    braries also implement classes and methods, insoar that it is possible in C. For example,in the above example, show may be seen to be a method on instances o the class.

    Indeed, other object-oriented languages such as Python express this pattern directly,translating the show operation as the pleasantly brie widget.show(). However this repre-sentation o methods as being bound to instances, while common, has a number o draw-backs.

    The largest drawback is that the method itsel is not bound to a generic operation.For example, mapping the show operation across a set o widgets cannot be done withthe straightorward map(show, set), because there is no object or the show operation.Instead the user must locally bind each widget to a variable in order to access a method o

    the abstract show operation: map(lambda widget: widget.show(), set).Additionally, most languages which express methods as bound to instances only select the

    method via the type o the rst (implicit) argument. The rule or these lanugages is, gtk-widget-show is an applicable method o the show operation when the rst argument to showis a . Note the lack o specication or other arguments; the same objectcannot have two applicable methods o the show operation. A more complete specicationwould be, gtk-widget-show is an applicable method o the show operation when appliedto one argument, a . It is a ne diference, but sometimes important.

    For these and other reasons, the conventional way to implement generic operations inLisp has been to dene generic unctions, and then associate specic methods with thoseunctions. For example, one would write the ollowing:

    ;; defining a generic function, and one method implementation

    (define-generic show)

    (define-method (show (widget ))

    (gtk-widget-show widget))

    ;; invoking the generic function

    (show my-widget)

  • 8/3/2019 Guile Gnome Gobject

    23/39

    Chapter 9: (gnome gobject generics) 20

    One benet o this approach is that method denitions can be made ar away in space andtime rom type denitions. This leads to a more dynamic environment, in which methodscan be added to existing types at runtime, which then can apply to existing instances.

    9.1.2 The semantics o generic unctions in Guile-GNOMENaturally, there is an impedance mismatch between the conventions used in the C librariesand their Scheme equivalents. Operations in GLib-based libraries do not orm a coherentwhole, in the sense that there is no place that denes the meaning o an abstract showoperation. For example, gtk-widget-set-state, which can make a widget become uned-itable, and gst-element-set-state, which can start a video player, would both map to thegeneric unction set-state, even though they have nothing to do with each other besidestheir name.

    There is no conict here; the methods apply on disjoint types. However there is aproblem o modularity, in that both methods must be defned on the same generic unction,so that (set-state foo bar) picks the correct method, depending on the types o oo and

    bar.

    This point leads to the conclusion that generic unctions in Guile-GNOME have noabstract meaning, apart rom their names. Semantically, generics in Guile-GNOME areabbreviations to save typing, not abstract operations with dened meanings.

    9.1.3 Practicalities

    This module denes a number o abbreviations, in the orm o generic unctions, or oper-ations on types dened in the (gnome gobject) modules. Generic unctions or generatedbindings like (gnome gtk) are dened in another module, (gnome gw generics), whichre-exports the public bindings rom this module.

    9.2 Usage

    [Generic]get

    [Method]get (object ) (name )A shorthand or gobject-get-property.

    [Generic]set

    [Method]set (object ) (name ) (value )A shorthand or gobject-set-property.

    [Generic]emit[Method]emit (object ) (name ) (args )...

    A shorthand or gtype-instance-signal-emit.

    [Generic]connect

    [Method]connect (object ) (name ) (func)

    A shorthand or gtype-instance-signal-connect.

  • 8/3/2019 Guile Gnome Gobject

    24/39

    Chapter 9: (gnome gobject generics) 21

    [Method]connect (args )...The core Guile implementation o the connect(2) POSIX call

    [Generic]connect-after

    [Method]connect-after (object ) (name ) (func)

    A shorthand or gtype-instance-signal-connect-after .

    [Generic]block

    [Method]block (object ) (id )A shorthand or gsignal-handler-block.

    [Generic]unblock

    [Method]unblock (object ) (id )A shorthand or gsignal-handler-unblock.

    [Generic]disconnect[Method]disconnect (object ) (id )

    A shorthand or gsignal-handler-disconnect.

    [Generic]connected?

    [Method]connected? (object ) (id )A shorthand or gsignal-handler-connected?.

    [Generic]invoke

    [Method]invoke (closure ) (args )...A shorthand or gclosure-invoke.

    [Generic]create-signal[Method]create-signal (class ) (name )

    (return-type ) (param-types )A shorthand or gtype-class-create-signal.

    [Generic]get-signals

    [Method]get-signals (class )A shorthand or gtype-class-get-signals.

    [Generic]get-properties

    [Method]get-properties (class )A shorthand or gobject-class-get-properties.

    [Generic]get-property-names

    [Method]get-property-names (class )A shorthand or gobject-class-get-property-names.

    [Generic]find-property

    [Method]find-property (class ) (name )A shorthand or gobject-class-find-property.

  • 8/3/2019 Guile Gnome Gobject

    25/39

    Chapter 10: (gnome gobject utils) 22

    10 (gnome gobject utils)

    10.1 Overview

    Common utility routines.

    10.2 Usage

    [Function]GStudlyCapsExpand nstrExpand the StudlyCaps nstr to a more schemey-orm, according to the conventionso GLib libraries. For example:

    (GStudlyCapsExpand "GSource") g-source

    (GStudlyCapsExpand "GtkIMContext") gtk-im-context

    (GStudlyCapsExpand "GtkHBox") gtk-hbox

    [Variable]gtype-name->scheme-name-alistAn alist o exceptions to the name transormation algorithm implemented inGStudlyCapsExpand.

    [Function]gtype-name->scheme-name type-nameTransorm a name o a , such as "GtkWindow", to a scheme orm, suchas gtk-window, taking into account the exceptions in gtype-name->scheme-name-alist, and trimming trailing dashes i any.

    [Function]gtype-name->class-name type-nameTransorm a name o a , such as "GtkWindow", to a suitable name o aScheme class, such as . Uses gtype-name->scheme-name.

    [Function]gtype-class-name->method-name class-name nameGenerate the name o a method given the name o a and the name o theoperation. For example:

    (gtype-name->method-name "GtkFoo" "bar") gtk-foo:bar

    Uses gtype-name->scheme-name.

    [Special Form]re-export-modules . argsRe-export the public interace o a module or modules. Invoked as (re-export-

    modules (mod1) (mod2)...).

    [Special Form]define-macro-with-docs orm docs . body

    [Special Form]define-with-docs name docs valDene name as val, documenting the value with docs.

    [Special Form]define-generic-with-docs name documentationDene a generic named name, with documentation documentation.

    [Special Form]define-class-with-docs name supers docs . restDene a class named name, with superclasses supers, with documentation docs.

    [Special Form]unless test . body

    [Special Form]with-accessors names . body

  • 8/3/2019 Guile Gnome Gobject

    26/39

    Chapter 11: (gnome gw generics) 23

    11 (gnome gw generics)

    11.1 Overview

    This module exists so that all (gnome gw) modules have a common place to put their genericunctions. Whenever a wrapset is loaded, it adds method denitions to generics dened inthis module.

    See the documentation or (gnome gobject generics) or more notes about genericunctions in Guile-GNOME. This module re-exports bindings rom (gnome gobjectgenerics), so there is no need to import them both.

    11.2 Usage

  • 8/3/2019 Guile Gnome Gobject

    27/39

    Chapter 12: (gnome gw support gobject) 24

    12 (gnome gw support gobject)

    12.1 OverviewG-Wrap support or (gnome gobject) types. Code in this module is only loaded whengenerating wrapsets; as such, it is not or end users.

    12.2 Usage

    [Class]The base class or G-Wrap wrapsets that use types.

    [Generic]add-type-alias!

    [Method]add-type-alias! (wrapset ) (alias

    ) (name )Add a type alias to wrapset, that the string alias is associated with the type namedsymbol. For example, "GtkWindow*" might be associated with a type named . See lookup-type-by-alias.

    [Generic]lookup-type-by-alias

    [Method]lookup-type-by-alias (wrapset ) (name)

    Lookup a type aliased name in wrapset, and all wrapsets on which wrapset depends.This interace is used by load-defs to associate G-Wrap types with the strings parsedout o the C header les.

    [Generic]add-type-rule!

    [Method]add-type-rule! (self ) (param-type) (typespec )

    Add a type rule to wrapset, that the string param-type maps directly to the g-wraptypespec typespec. For example, "int*" might map to the typespec (int out). Seefind-type-rule.

    [Generic]find-type-rule

    [Method]find-type-rule (self ) (param-type)

    See i the parameter type param-type has a type rule present in wrapset or in anywrapset on which wrapset depends. This interace is used by load-defs to associateG-Wrap typespecs with the strings parsed out o the C header les.

    [Class]A base G-Wrap type class or GLib types.

    [Class]A base G-Wrap type class or classed GLib types (see gtype-classed?).

  • 8/3/2019 Guile Gnome Gobject

    28/39

    Chapter 12: (gnome gw support gobject) 25

    [Generic]gtype-id

    [Method]gtype-id (o )

    [Method]gtype-id (o )

    [Method]gtype-id (o )

    [Method]gtype-id (o )

    [Method]gtype-id (o )

    [Method]gtype-id (o )

    [Method]gtype-id (o )

    [Method]gtype-id (o )

    [Method]gtype-id (o )

    [Method]gtype-id (o )

    [Method]gtype-id (o )

    [Class]A base G-Wrap type class or or classed GLib types whose values are pointers.

    [Generic]unwrap-null-checked

    [Method]unwrap-null-checked (value ) (status-var )(code )

    Unwrap a value into a C pointer, optionally unwrapping #f as NULL.

    This unction checks the typespec options on value, which should be a .I the null-ok option is set (which is only the case or value classes with null-ok inits #:allowed-options), this unction generates code that unwraps #f as NULL. Inull-ok is unset, or the value is not #f, code is run instead.

    [Generic]wrap-instance!

    [Method]wrap-instance! (ws ) (args )...Dene a wrapper or a specic instantiatable (-derived) type inws. Required keyword arguments are #:ctype and #:gtype-id. For example,

    (wrap-instance! ws #:ctype "GtkWidget"

    #:gtype-id "GTK_TYPE_WIDGET")

    Normally only called rom load-defs.

    [Generic]wrap-boxed!

    [Method]wrap-boxed! (ws ) (args )...Dene a wrapper or a specic boxed type in ws. Required keyword arguments are#:ctype and #:gtype-id, as in wrap-instance!.

    [Generic]wrap-pointer!

    [Method]wrap-pointer! (ws ) (args )...Dene a wrapper or a specic pointer type in ws. Required keyword arguments are#:ctype and #:gtype-id, as in wrap-instance!.

  • 8/3/2019 Guile Gnome Gobject

    29/39

    Chapter 12: (gnome gw support gobject) 26

    [Function]wrap-opaque-pointer! ws ctypeDene a wrapper or an opaque pointer with the C type ctype. It will not be possibleto create these types rom Scheme, but they can be received rom a library, and passedas arguments to other calls into the library.

    [Function]wrap-freeable-pointer! ws ctype reeoo

    [Function]wrap-refcounted-pointer! ws ctype re unreoo

    [Function]wrap-structure! ws ctype wrap unwrapDene a wrapper or structure values o type ctype.

    wrap and unwrap are the names o C unctions to convert a C structure to Schemeand vice versa, respectively. When in a unction call, parameters o this type o theorm StructName* are interpreted as out parameters, while const-StructName*are treated as in parameters.

    Note that ctype should be the type o the structure, not a pointer to the structure.

    [Generic]wrap-interface!

    [Method]wrap-interface! (ws ) (args )...Dene a wrapper or an interace type in ws. Required keyword arguments are#:ctype and #:gtype-id, as in wrap-instance!.

    [Generic]wrap-flags!

    [Method]wrap-flags! (ws ) (args )...Dene a wrapper or a ags type in ws. Required keyword arguments are #:ctypeand #:gtype-id or #:values, as in wrap-enum!.

    [Generic]wrap-gobject-class![Method]wrap-gobject-class! (ws ) (args )...

    Dene a wrapper or GObject class values ws. Required keyword arguments are#:ctype and #:gtype-id, as in wrap-instance!.

    #:ctype should reer to the type o the class and not the instance; e.g."GtkWidgetClass" and not "GtkWidget". This unction will not be called byload-defs, and should be invoked manually in a wrapset as needed.

    [Special Form]wrap-custom-boxed! ctype gtype wrap unwrapWrap a boxed type using custom wrappers and unwrappers.

    FIXME: missing a wrapset argument!

    ctype and gtype are as #:ctype and #:gtype-id in wrap-instance!. wrap andunwrap are G-Wrap orms in which scm-var and c-var will be bound to the nameso 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 ");"))

  • 8/3/2019 Guile Gnome Gobject

    30/39

    Chapter 12: (gnome gw support gobject) 27

    [Special Form]wrap-custom-gvalue! ctype gtype wrap-unc unwrap-uncWrap a GValue type using custom wrap and unwrap unctions.

    FIXME: missing a wrapset argument!

    ctype and gtype are as #:ctype and #:gtype-id in wrap-instance!. wrap-unc andunwrap-unc are names o unctions to convert to and rom Scheme values, respec-tively. For example:

    (wrap-custom-gvalue! "GstFraction" "GST_TYPE_FRACTION"

    "scm_from_gst_fraction"

    "scm_to_gst_fraction")

  • 8/3/2019 Guile Gnome Gobject

    31/39

    Chapter 13: (gnome gw support des) 28

    13 (gnome gw support des)

    13.1 Overview

    This module serves as a way to automatically populate G-Wrap wrapsets using inormationparsed out o C header les.

    First, the C header les are parsed into S-expression API description orms and writteninto .defs les. These les are typically included in the distribution, and regeneratedinrequently. Then, the binding author includes a call to load-defs in their G-Wrap wrapsetdenition, which loads those API denitions into the wrapset.

    The .defs les are usually produced using the API scanner script, h2defs.py, includedin the Guile-GNOME source distribution.

    Code in this module is only loaded when generating wrapsets; as such, it is not or endusers.

    As an example, ATK is wrapped with the ollowing code, rom atk/gnome/gw/atk-spec.scm:

    (define-module (gnome gw atk-spec)

    #:use-module (oop goops)

    #:use-module (gnome gw support g-wrap)

    #:use-module (gnome gw gobject-spec)

    #:use-module (gnome gw support gobject)

    #:use-module (gnome gw support defs))

    (define-class ()

    #:id gnome-atk

    #:dependencies (standard gnome-glib gnome-gobject))

    (define-method (global-declarations-cg (self ))

    (list

    (next-method)

    "#include \n"

    "#include \n"))

    (define-method (initialize (ws ) initargs)

    (next-method ws (append (#:module (gnome gw atk)) initargs))

    ;; manually wrap AtkState as a 64 bit uint

    (add-type-alias! ws "AtkState" unsigned-int64)

    (load-defs-with-overrides ws "gnome/defs/atk.defs"))

    The wrapper-speciction modules are actually installed, along with the .des les, sothat other wrappers which use ATKs types, such as GTK+, can have them available.

    A ull discussion o the Makele mechanics o how to generate and compile the C le,or how to interact with the wrapset objects, is probably prone to bitrot here. Your bestbet is to poke at Guile-GNOMEs source, or especially the source o a module distributedindependently o guile-gnome-platform, such as guile-gnome-libwnck.

  • 8/3/2019 Guile Gnome Gobject

    32/39

    Chapter 13: (gnome gw support des) 29

    Further details about the procedural API available or use e.g. within the wrapsetsinitialize unction can be ound in the documentation or (gnome gw support gobject),and in G-Wraps documentation.

    13.2 Usage

    [Function]load-defs ws fle [overrides = #]Load G-Wrap type and unction inormation rom fle into the G-Wrap wrapset ws.

    fle should be a relative path, which will be searched in the vicinity o Guiles %load-path. include directives in the le will be searched relative to the absolute path othe le.

    The ollowing orms are understood: define-enum, define-flags, define-object,define-interface, define-pointer, define-boxed, define-function, define-

    method, ignore, ignore-glob, and ignore-types.

    The optional argument, overrides, species the location o an overrides le that willbe spliced into the .defs le at the point o an (include overrides) orm.

    [Function]load-defs-with-overrides ws desEquivalent to:

    (load-defs ws defs

    (string-append "gnome/overrides/"

    (basename defs)))

  • 8/3/2019 Guile Gnome Gobject

    33/39

    Chapter 14: (gnome gw support gtk-doc) 30

    14 (gnome gw support gtk-doc)

    14.1 Overview

    This module exports two high-level procedures to transorm the Docbook les generated byGTK-Doc into texino.

    GTK-Doc is commonly used to document GObject-based libraries, such as those thatGuile-GNOME wraps. In a typical build setup, GTK-Doc generates a reerence manual withone XML le per section. The routines in this module attempt to recreate those sections,but in Texino instead o Docbook, and which document the Scheme modules instead o theupstream C libraries.

    The tricky part o translating GTK-Docs documentation is not the vocabulary (Doc-book), but that it documents C unctions which have diferent calling conventions thanScheme. For example, a C unction might take our double* arguments, but in Scheme the

    unction would return our rational values. Given only the C prototype, the code in thismodule will make an attempt to determine what the Scheme unctions arguments will bebased on some heuristics.

    In most cases, however, we can do better than heuristics, because we have the G-Wrapinormation that describes the relationship between the C unction and the Scheme wrapper.In that way we can know exactly what the input and output arguments are or a particularunction.

    The gtk-doc->texi-stubs unction is straightorward. It extracts the "header" in aset o GTK-Doc les, translates them into texino, writing them out one by one to lesnamed section-foo.texi, where oo is the name o the XML le. It is unclear whether itis best to continously generate these sections when updating the manuals, or whether this"stub" generation should be run only once when the documentation is initially generated,and thereater maintained by hand. Your call!

    gtk-doc->texi-defuns is slightly more complicated, because you have the choice as towhether to use heuristics or the g-wrap method or determining the arguments. See itsdocumentation or more inormation.

    Both o these unctions are designed to be directly callable rom the shell. Here is amakele snippet suitable or using the heuristics method or deuns generation:

    GTK_DOC_TO_TEXI_STUBS = \

    ((@ (gnome gw support gtk-doc) gtk-doc->texi-stubs) \

    (cdr (program-arguments)))

    GTK_DOC_DEFUN_METHOD = heuristics

    GTK_DOC_DEFUN_ARGS = (your-module-here)

    GTK_DOC_TO_TEXI_DEFUNS = "(apply (@ (gnome gw support gtk-doc) \

    gtk-doc->texi-defuns) (cadr (program-arguments)) \

    $(GTK_DOC_DEFUN_METHOD) ($(GTK_DOC_DEFUN_ARGS)) \

    (cddr (program-arguments)))"

    GUILE = $(top_builddir)/dev-environ guile

    generate-stubs:

    $(GUILE) $(GUILE_FLAGS) -c $(GTK_DOC_TO_TEXI_STUBS) \

    http://www.gtk.org/gtk-doc/http://www.gtk.org/gtk-doc/
  • 8/3/2019 Guile Gnome Gobject

    34/39

    Chapter 14: (gnome gw support gtk-doc) 31

    $(docbook_xml_files)

    generate-defuns:

    $(GUILE) $(GUILE_FLAGS) -c $(GTK_DOC_TO_TEXI_DEFUNS) \

    ./overrides.texi $(docbook_xml_files)

    To make the above snippet work, you will have to dene $(docbook_xml_files) as theset o docbook XML les to transorm. To use the G-Wrap method, try the ollowing:

    wrapset_module = (gnome gw $(wrapset_stem)-spec)

    wrapset_name = gnome-$(wrapset_stem)

    GTK_DOC_DEFUN_METHOD = g-wrap

    GTK_DOC_DEFUN_ARGS = $(wrapset_module) $(wrapset_name)

    Set $(wrapset_stem) to the stem o the wrapset name, e.g. pango, and there you are.

    14.2 Usage

    [Function]gtk-doc->texi-stubs flesGenerate a section overview texino le or each docbook XML le in fles.

    The les will be created in the current directory, as described in the documentationor (gnome gw support gtk-doc). They will include a le named defuns-file.texi,which should probably be created using gtk-doc->texi-defuns.

    [Function]gtk-doc->texi-defuns overrides method args . flesGenerate documentation or the types and unctions dened in a set o docbook lesgenearted by GTK-Doc.

    overrides should be a path to a texino le rom which @deffn overrides will betaken. method should be either g-wrap or heuristics, as discussed in the (gnomegw support gtk-doc) documentation. fles is the list o docbook XML les romwhich to pull unction documentation.

    args should be a list, whose orm depends on the method. For g-wrap, it shouldbe two elements, the rst the name o a module that, when loaded, will load thenecessary wrapset into the g-wrap runtime. For example, (gnome gw glib-spec).The second argument should be the name o the wrapset, e.g. gnome-glib.

    Imethod is heuristics, args should have only one element, the name o the moduleto load to check the existence o procedures, e.g. (cairo).

    [Function]check-documentation-coverage modules texi

    Check the coverage o generated documentation.modules is a list o module names, and texi is a path to a texino le. The set o ex-ports omodules is checked against the set o procedures dened in texi, resulting in acalculation o documentation coverage, and the output o any missing documentationto the current output port.

    [Function]generate-undocumented-texi modules texiVeriy the bindings exported by modules against the documentation in texi, writingdocumentation or any undocumented symbol to undocumented.texi.

  • 8/3/2019 Guile Gnome Gobject

    35/39

    Chapter 14: (gnome gw support gtk-doc) 32

    modules is a list o module names, and texi is a path to a texino le.

  • 8/3/2019 Guile Gnome Gobject

    36/39

    Chapter 15: (gnome gw support modules) 33

    15 (gnome gw support modules)

    15.1 Overview

    Support routines or automatically-generated scheme G-Wrap modules.

    15.2 Usage

    [Function]export-all-lazy! symbolsExport the symbols rom the current module.

    Most generic unctions and classes that G-Wrap denes are bound lazily, as neededin evaluation. This is done by placing module binder procedures on the generatedmodules. However, i we export all symbols by name, this will orce the bindingeagerly or all values, which is slow.

    This procedure exports all bindings named in symbols that are already bound in thecurrent module, and then installs a module binder procedure on the public interace,which allows lazy binding to work.

    [Special Form]re-export-modules . argsRe-export the public interace o a module; used like use-modules.

  • 8/3/2019 Guile Gnome Gobject

    37/39

    Type Index 34

    Type Index

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    9

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

    . . . . . . . . . . . . . 25

    . . . . . . . . . . . . . . . . . . . . . .

    24 . . . . . . . . . . . . . . . . . . . . . . . . . 24

    . . . . . . . . . . . . . . . . . . . . . . 24

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    11

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

    . . . . . . . . . . . . . . . . . . . . . . . . . 12

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    14

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

  • 8/3/2019 Guile Gnome Gobject

    38/39

    Function Index 35

    Function Index

    Aadd-type-alias!

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    24

    add-type-rule! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

    Bblock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

    Ccheck-documentation-coverage. . . . . . . . . . . . . . . 31

    class-name->gtype-name. . . . . . . . . . . . . . . . . . . . . . . 7

    connect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20, 21

    connect-after . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

    connected?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

    create-signal. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    21

    Ddefine-class-with-docs. . . . . . . . . . . . . . . . . . . . . . 22

    define-generic-with-docs . . . . . . . . . . . . . . . . . . . 22

    define-macro-with-docs. . . . . . . . . . . . . . . . . . . . . . 22

    define-with-docs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

    disconnect. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

    Eemit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

    export-all-lazy!. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

    Ffind-property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

    find-type-rule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

    Ggclosure-invoke. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

    generate-undocumented-texi . . . . . . . . . . . . . . . . . 31

    genum->name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

    genum->symbol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

    genum->value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

    genum-class->value-table . . . . . . . . . . . . . . . . . . . 10

    genum-register-static . . . . . . . . . . . . . . . . . . . . . . . . 9

    get. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    20

    get-properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

    get-property-names . . . . . . . . . . . . . . . . . . . . . . . . . . 21

    get-signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

    gflags->name-list. . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

    gflags->symbol-list . . . . . . . . . . . . . . . . . . . . . . . . . 10

    gflags->value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

    gflags->value-list . . . . . . . . . . . . . . . . . . . . . . . . . . 10

    gflags-class->value-table . . . . . . . . . . . . . . . . . . 10

    gflags-register-static. . . . . . . . . . . . . . . . . . . . . . . 9

    gobject-class-find-property. . . . . . . . . . . . . . . . 18

    gobject-class-get-properties. . . . . . . . . . . . . . .

    18gobject-class-get-property-names . . . . . . . . . . 18

    gobject-get-property . . . . . . . . . . . . . . . . . . . . . . . . 18

    gobject-set-property . . . . . . . . . . . . . . . . . . . . . . . . 18

    gobject:get-property . . . . . . . . . . . . . . . . . . . . . . . . 17

    gobject:set-property . . . . . . . . . . . . . . . . . . . . 17, 18

    gruntime-error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

    gsignal-handler-block. . . . . . . . . . . . . . . . . . . . . . . 14

    gsignal-handler-connected? . . . . . . . . . . . . . . . . . 14

    gsignal-handler-disconnect . . . . . . . . . . . . . . . . . 14

    gsignal-handler-unblock. . . . . . . . . . . . . . . . . . . . . 14

    GStudlyCapsExpand. . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

    gtk-doc->texi-defuns . . . . . . . . . . . . . . . . . . . . . . . . 31

    gtk-doc->texi-stubs . . . . . . . . . . . . . . . . . . . . . . . . . 31

    gtype-class-create-signal . . . . . . . . . . . . . . . . . . 14

    gtype-class-get-signal-names. . . . . . . . . . . . . . .

    14

    gtype-class-get-signals. . . . . . . . . . . . . . . . . . . . . 14

    gtype-class-name->method-name. . . . . . . . . . . . . . 22

    gtype-id . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

    gtype-instance-destroy!. . . . . . . . . . . . . . . . . . . . . . 7

    gtype-instance-signal-connect. . . . . . . . . . . . . . 14

    gtype-instance-signal-connect-after. . . . . . . 14

    gtype-instance-signal-emit . . . . . . . . . . . . . . . . . 14

    gtype-name->class. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

    gtype-name->class-name. . . . . . . . . . . . . . . . . . . . . . 22

    gtype-name->scheme-name. . . . . . . . . . . . . . . . . . . . . 22

    gtype-register-static. . . . . . . . . . . . . . . . . . . . . . . 17

    gvalue->scm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

    Iinvoke . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

    Lload-defs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

    load-defs-with-overrides . . . . . . . . . . . . . . . . . . . 29

    lookup-type-by-alias . . . . . . . . . . . . . . . . . . . . . . . . 24

    Rre-export-modules . . . . . . . . . . . . . . . . . . . . . . . . 22, 33

    Sscm->gvalue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

    set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

    Uunblock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

    unless . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

    unwrap-null-checked . . . . . . . . . . . . . . . . . . . . . . . . . 25

  • 8/3/2019 Guile Gnome Gobject

    39/39

    Function Index 36

    Wwith-accessors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

    wrap-boxed! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

    wrap-custom-boxed! . . . . . . . . . . . . . . . . . . . . . . . . . . 26

    wrap-custom-gvalue!. . . . . . . . . . . . . . . . . . . . . . . . .

    27wrap-flags! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

    wrap-freeable-pointer!. . . . . . . . . . . . . . . . . . . . . . 26

    wrap-gobject-class! . . . . . . . . . . . . . . . . . . . . . . . . . 26

    wrap-instance! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

    wrap-interface!. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

    wrap-opaque-pointer! . . . . . . . . . . . . . . . . . . . . . . . . 26

    wrap-pointer!. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    25wrap-refcounted-pointer! . . . . . . . . . . . . . . . . . . . 26

    wrap-structure!. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26