Next: , Previous: get-g-interface-definition, Up: Generating type definitions by introspection


4.13.8 get-g-class-definition

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

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

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

Example:

     (get-g-class-definition "GtkButton")
     =>
     (DEFINE-G-OBJECT-CLASS "GtkButton" GTK-BUTTON
                            (:SUPERCLASS GTK-BIN :EXPORT T :INTERFACES
                             ("AtkImplementorIface" "GtkActivatable" "GtkBuildable")
                             :TYPE-INITIALIZER "gtk_button_get_type")
                            ((LABEL GTK-BUTTON-LABEL "label" "gchararray" T T)
                             (IMAGE GTK-BUTTON-IMAGE "image" "GtkWidget" T T)
                             (RELIEF GTK-BUTTON-RELIEF "relief" "GtkReliefStyle" T
                              T)
                             (USE-UNDERLINE GTK-BUTTON-USE-UNDERLINE "use-underline"
                              "gboolean" T T)
                             (USE-STOCK GTK-BUTTON-USE-STOCK "use-stock" "gboolean"
                              T T)
                             (FOCUS-ON-CLICK GTK-BUTTON-FOCUS-ON-CLICK
                              "focus-on-click" "gboolean" T T)
                             (XALIGN GTK-BUTTON-XALIGN "xalign" "gfloat" T T)
                             (YALIGN GTK-BUTTON-YALIGN "yalign" "gfloat" T T)
                             (IMAGE-POSITION GTK-BUTTON-IMAGE-POSITION
                              "image-position" "GtkPositionType" T T)))