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


4.13.4 define-g-flags

— Macro: define-g-flags
     (define-g-flags g-name name (&key (export t) type-initializer) &body value*)
     
     value ::= :keyword
     value ::= (:keyword integer)
g-name
A string naming the GFlags type
name
A symbol naming the CFFI flags type
export
A boolean indicating whether to export name
type-initializer
A string naming the foreign type initializer function. Usually named flags_get_type.

Macro that defines CFFI bitfield, registers it with GValue, and calls the type initializer.

Example:

     (define-g-flags "GtkAttachOptions" attach-options
       (:export t :type-initializer "gtk_attach_options_get_type")
       (:expand 1) (:shrink 2) (:fill 4))
     
     (define-g-flags "GtkButtonAction" button-action
       (:export t :type-initializer "gtk_button_action_get_type")
       :ignored :selects :drags :expands)