Next: , Previous: define-g-flags, Up: Generating type definitions by introspection


4.13.5 get-g-enum-definition

— Function: get-g-enum-definition
     (get-g-enum-definition type &optional lisp-name-package) => definition
type
A string naming the GEnum type
lisp-name-package
A package that will be used as a package for generated symbols (enum name). If not specified, symbols are interned in *package*
definition
A Lisp form that when evaluated defines the GEnum.

Uses GObject introspection capabilities to automatically produce the definition of GEnum. The foreign library that defines the enum type should be loaded.

See Generating names for CLOS classes and accessors for information about used method for generating names.

Example:

     (get-g-enum-definition "GtkDirectionType")
     =>
     (DEFINE-G-ENUM "GtkDirectionType" GTK-DIRECTION-TYPE
                    (:EXPORT T :TYPE-INITIALIZER "gtk_direction_type_get_type")
                    (:TAB-FORWARD 0) (:TAB-BACKWARD 1) (:UP 2) (:DOWN 3) (:LEFT 4)
                    (:RIGHT 5))