File: cr-gi-enum-info.texi

package info (click to toggle)
g-golf 0.8.0-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 4,108 kB
  • sloc: lisp: 23,960; sh: 1,213; ansic: 964; makefile: 469; xml: 7
file content (143 lines) | stat: -rw-r--r-- 3,414 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
@c -*-texinfo-*-
@c This is part of the GNU G-Golf Reference Manual.
@c Copyright (C) 2016 - 2019 Free Software Foundation, Inc.
@c See the file g-golf.texi for copying conditions.


@c @defindex ei


@node Enum Info
@subsection Enum Info

G-Golf Enum Info low level API.@*
GIEnumInfo — Structs representing an enumeration and its values.


@subheading Procedures

@indentedblock
@table @code
@item @ref{gi-enum-import}
@item @ref{gi-enum-value-values}

@item @ref{g-enum-info-get-n-values}
@item @ref{g-enum-info-get-value}
@item @ref{g-enum-info-get-n-methods}
@item @ref{g-enum-info-get-method}

@item @ref{g-value-info-get-value}
@end table
@end indentedblock


@c @subheading Types and Values

@c @indentedblock
@c @table @code
@c @item @ref{%g-arg-info-transfer}
@c @end table
@c @end indentedblock


@subheading Struct Hierarchy

@indentedblock
GIBaseInfo           	       		@*
@ @ +--- GIRegisteredTypeInfo  		@*
@ @ @ @ @ @ @ @ @ @ @  +--- GIEnumInfo
@end indentedblock


@subheading Description

@code{GIEnumInfo} represents an argument. An argument is always part of a
@code{GICallableInfo}.


@subheading Procedures

Note: in this section, unless otherwise specified, the @var{info}
argument is [must be] a pointer to a @code{GIEumInfo}.


@anchor{gi-enum-import}
@deffn Procedure gi-enum-import info

Returns a @code{<gi-enum>} instance.

Obtains the values this enumeration contains, then makes and returns a
@code{<gi-enum>} instance.
@end deffn


@anchor{gi-enum-value-values}
@deffn Procedure gi-enum-value-values info

Returns an alist.

Obtains and returns the list pairs @code{(symbol . id)} the enum GI
definition pointed by @var{info} contains. If you think the name is
strange, compare it with, for example @ref{gi-struct-field-types}: just
like a @code{GIStructInfo} holds a list of pointers to
@code{GIFieldInfo} from which we get the (field) type,
a@code{GIEnumInfo} holds a list of pointers to @code{GIValueInfo} from
which we get the (enum) value - which in the GI world is a name (a
string) that we transform, in the scheme world, to a symbol.
@end deffn


@anchor{g-enum-info-get-n-values}
@deffn Procedure g-enum-info-get-n-values info

Returns the number of values.

Obtains the number of values this enumeration contains.
@end deffn


@anchor{g-enum-info-get-value}
@deffn Procedure g-enum-info-get-value info index

Returns a pointer to a @code{GIValueInfo} or #f if type tag is wrong.

Obtains a value for this enumeration.  The @code{GIValueInfo} must be
free'd using @code{g-base-info-unref} when done.

@var{index} is a 0-based offset into @var{info} for a value.
@end deffn


@anchor{g-enum-info-get-n-methods}
@deffn Procedure g-enum-info-get-n-methods info

Returns the number of methods.

Obtains the number of methods this enumeration has.
@end deffn


@anchor{g-enum-info-get-method}
@deffn Procedure g-enum-info-get-method info index

Returns a pointer to a @code{GIFunctionInfo} or #f if type tag is wrong.

Obtains a method for this enumeration.  The @code{GIFunctionInfo} must be
free'd using @code{g-base-info-unref} when done.

@var{index} is a 0-based offset into @var{info} for a method.
@end deffn


@anchor{g-value-info-get-value}
@deffn Procedure g-value-info-get-value info

Returns the enumeration value.

Obtains a value of the @code{GIValueInfo}.

@var{info} is [must be] a pointer to a @code{GIValueInfo}.
@end deffn


@c @subheading Types and Values