Next: , Previous: , Up: Categories of Typelib Bindings   [Contents][Index]


2.3.2 Flags and Enums

When a typelib file contains a set of flags or enums, Guile-GI creates a class for that set. That class contains an association map between symbols and values.

For example, when Guile-GI encounters the G_APPLICATION_FLAGS flags collection, it creates a GOOPS type <GApplicationFlags>. Its association map can be queried two ways.

;; In C, (G_APPLICATION_HANDLES_OPEN | G_APPLICATION_NON_UNIQUE)
(list->flags <GApplicationFlags> '(handles-open non-unique))
(list->application-flags '(handles-open non-unique))

Enums are similar, except not accessed as lists.

;; In C, the enum G_BUS_TYPE_SYSTEM
(symbol->enum <GBusType> 'system)
(symbol->bus-type 'system)