@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
