4 "A structure describing a single enumeration item.
6 See accessor functions:
8 @item{@fun{enum-item-name}}
9 @item{@fun{enum-item-value}}
10 @item{@fun{enum-item-nick}}
14 (setf (documentation 'enum-item-name
'function
)
15 "The C name of enum item, e.g. \"GTK_WINDOW_TOPLEVEL\".
18 (setf (documentation 'enum-item-value
'function
)
19 "The numeric value of enum item.
22 (setf (documentation 'enum-item-nick
'function
)
23 "The \"nickname\" of enum item. Nickname is a short name of enum item. E.g., \"toplevel\".
26 (defun get-enum-items (type)
27 "Gets the list of enum items that belong to GEnum type @code{type}
28 @arg[type]{a string or an integer specifying GEnum type}
29 @return{a list of @class{enum-item} objects}"
30 (assert (g-type-is-a type
+g-type-enum
+))
31 (let ((g-class (g-type-class-ref type
)))
34 with n
= (foreign-slot-value g-class
'g-enum-class
:n-values
)
35 with values
= (foreign-slot-value g-class
'g-enum-class
:values
)
37 for enum-value
= (mem-aref values
'g-enum-value i
)
38 collect
(make-enum-item
39 :name
(foreign-slot-value enum-value
'g-enum-value
41 :value
(foreign-slot-value enum-value
'g-enum-value
43 :nick
(foreign-slot-value enum-value
'g-enum-value
45 (g-type-class-unref g-class
))))
48 "A structure describing a single flags item.
50 See accessor functions:
52 @item{@fun{flags-item-name}}
53 @item{@fun{flags-item-value}}
54 @item{@fun{flags-item-nick}}
58 (setf (documentation 'flags-item-name
'function
)
59 "The C name of flags item, e.g. \"GDK_PROPERTY_CHANGE_MASK\".
62 (setf (documentation 'flags-item-value
'function
)
63 "The numeric value of flags item.
66 (setf (documentation 'flags-item-nick
'function
)
67 "The \"nickname\" of flags item. Nickname is a short name of flags item. E.g., \"property-change-mask\".
70 (defun get-flags-items (type)
71 "Gets the list of flags items that belong to GFlags type @code{type}
72 @arg[type]{a string or an integer specifying GFlags type}
73 @return{a list of @class{flags-item} objects}"
74 (assert (g-type-is-a type
+g-type-flags
+))
75 (let ((g-class (g-type-class-ref type
)))
78 with n
= (foreign-slot-value g-class
'g-flags-class
:n-values
)
79 with values
= (foreign-slot-value g-class
'g-flags-class
:values
)
81 for flags-value
= (mem-aref values
'g-flags-value i
)
82 collect
(make-flags-item
83 :name
(foreign-slot-value flags-value
'g-flags-value
85 :value
(foreign-slot-value flags-value
'g-flags-value
87 :nick
(foreign-slot-value flags-value
'g-flags-value
89 (g-type-class-unref g-class
))))