<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC '-//OASIS//DTD DocBook XML V4.5//EN'
                      'http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd' [

<!ENTITY % local.common.attrib "xmlns:xi  CDATA  #FIXED 'http://www.w3.org/2003/XInclude'">
<!ENTITY version SYSTEM "version.xml">
]>
<refentry id="gobject-Enumeration-and-Flag-Types">
<refmeta>
<refentrytitle role="top_of_page" id="gobject-Enumeration-and-Flag-Types.top_of_page">Enumeration and Flag Types</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GOBJECT Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>Enumeration and Flag Types</refname>
<refpurpose>Enumeration and flags types</refpurpose>
</refnamediv>

<refsect1 id="gobject-Enumeration-and-Flag-Types.functions" role="functions_proto">
<title role="functions_proto.title">Functions</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="functions_proto_type" colwidth="150px"/>
<colspec colname="functions_proto_name"/>
<tbody>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-ENUM-CLASS-TYPE:CAPS">G_ENUM_CLASS_TYPE</link><phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-ENUM-CLASS-TYPE-NAME:CAPS">G_ENUM_CLASS_TYPE_NAME</link><phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-TYPE-IS-ENUM:CAPS">G_TYPE_IS_ENUM</link><phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-ENUM-CLASS:CAPS">G_ENUM_CLASS</link><phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-IS-ENUM-CLASS:CAPS">G_IS_ENUM_CLASS</link><phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-TYPE-IS-FLAGS:CAPS">G_TYPE_IS_FLAGS</link><phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-FLAGS-CLASS:CAPS">G_FLAGS_CLASS</link><phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-IS-FLAGS-CLASS:CAPS">G_IS_FLAGS_CLASS</link><phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-FLAGS-CLASS-TYPE:CAPS">G_FLAGS_CLASS_TYPE</link><phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-FLAGS-CLASS-TYPE-NAME:CAPS">G_FLAGS_CLASS_TYPE_NAME</link><phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GEnumValue"><returnvalue>GEnumValue</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="g-enum-get-value">g_enum_get_value</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GEnumValue"><returnvalue>GEnumValue</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="g-enum-get-value-by-name">g_enum_get_value_by_name</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GEnumValue"><returnvalue>GEnumValue</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="g-enum-get-value-by-nick">g_enum_get_value_by_nick</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="g-enum-to-string">g_enum_to_string</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GFlagsValue"><returnvalue>GFlagsValue</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="g-flags-get-first-value">g_flags_get_first_value</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GFlagsValue"><returnvalue>GFlagsValue</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="g-flags-get-value-by-name">g_flags_get_value_by_name</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GFlagsValue"><returnvalue>GFlagsValue</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="g-flags-get-value-by-nick">g_flags_get_value_by_nick</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="g-flags-to-string">g_flags_to_string</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GType"><returnvalue>GType</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-enum-register-static">g_enum_register_static</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GType"><returnvalue>GType</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-flags-register-static">g_flags_register_static</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-enum-complete-type-info">g_enum_complete_type_info</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-flags-complete-type-info">g_flags_complete_type_info</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="gobject-Enumeration-and-Flag-Types.other" role="other_proto">
<title role="other_proto.title">Types and Values</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="other_proto_type" colwidth="150px"/>
<colspec colname="other_proto_name"/>
<tbody>
<row><entry role="datatype_keyword">struct</entry><entry role="function_name"><link linkend="GEnumClass">GEnumClass</link></entry></row>
<row><entry role="datatype_keyword">struct</entry><entry role="function_name"><link linkend="GFlagsClass">GFlagsClass</link></entry></row>
<row><entry role="datatype_keyword">struct</entry><entry role="function_name"><link linkend="GEnumValue">GEnumValue</link></entry></row>
<row><entry role="datatype_keyword">struct</entry><entry role="function_name"><link linkend="GFlagsValue">GFlagsValue</link></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>

<refsect1 id="gobject-Enumeration-and-Flag-Types.includes"><title>Includes</title><synopsis>#include &lt;glib-object.h&gt;
</synopsis></refsect1>

<refsect1 id="gobject-Enumeration-and-Flag-Types.description" role="desc">
<title role="desc.title">Description</title>
<para>The GLib type system provides fundamental types for enumeration and
flags types. (Flags types are like enumerations, but allow their
values to be combined by bitwise or). A registered enumeration or
flags type associates a name and a nickname with each allowed
value, and the methods <link linkend="g-enum-get-value-by-name"><function>g_enum_get_value_by_name()</function></link>,
<link linkend="g-enum-get-value-by-nick"><function>g_enum_get_value_by_nick()</function></link>, <link linkend="g-flags-get-value-by-name"><function>g_flags_get_value_by_name()</function></link> and
<link linkend="g-flags-get-value-by-nick"><function>g_flags_get_value_by_nick()</function></link> can look up values by their name or
nickname.  When an enumeration or flags type is registered with the
GLib type system, it can be used as value type for object
properties, using <link linkend="g-param-spec-enum"><function>g_param_spec_enum()</function></link> or <link linkend="g-param-spec-flags"><function>g_param_spec_flags()</function></link>.</para>
<para>GObject ships with a utility called <link linkend="glib-mkenums">glib-mkenums</link>,
that can construct suitable type registration functions from C enumeration
definitions.</para>
<para>Example of how to get a string representation of an enum value:</para>
<informalexample><programlisting role="example"><![CDATA[
GEnumClass *enum_class;
GEnumValue *enum_value;

enum_class = g_type_class_ref (MAMAN_TYPE_MY_ENUM);
enum_value = g_enum_get_value (enum_class, MAMAN_MY_ENUM_FOO);

g_print ("Name: %s\n", enum_value->value_name);

g_type_class_unref (enum_class);
]]></programlisting></informalexample>
<para></para>

</refsect1>
<refsect1 id="gobject-Enumeration-and-Flag-Types.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="G-ENUM-CLASS-TYPE:CAPS" role="macro">
<title>G_ENUM_CLASS_TYPE()</title>
<indexterm zone="G-ENUM-CLASS-TYPE:CAPS"><primary sortas="ENUM_CLASS_TYPE">G_ENUM_CLASS_TYPE</primary></indexterm>
<programlisting language="C">#define G_ENUM_CLASS_TYPE(class)       (G_TYPE_FROM_CLASS (class))
</programlisting>
<para>Get the type identifier from a given <link linkend="GEnumClass"><type>GEnumClass</type></link> structure.</para>
<refsect3 id="G-ENUM-CLASS-TYPE.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>class</para></entry>
<entry role="parameter_description"><para>a <link linkend="GEnumClass"><type>GEnumClass</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="G-ENUM-CLASS-TYPE.returns" role="returns">
<title>Returns</title>
<para> the <link linkend="GType"><type>GType</type></link></para>
</refsect3></refsect2>
<refsect2 id="G-ENUM-CLASS-TYPE-NAME:CAPS" role="macro">
<title>G_ENUM_CLASS_TYPE_NAME()</title>
<indexterm zone="G-ENUM-CLASS-TYPE-NAME:CAPS"><primary sortas="ENUM_CLASS_TYPE_NAME">G_ENUM_CLASS_TYPE_NAME</primary></indexterm>
<programlisting language="C">#define G_ENUM_CLASS_TYPE_NAME(class)  (g_type_name (G_ENUM_CLASS_TYPE (class)))
</programlisting>
<para>Get the static type name from a given <link linkend="GEnumClass"><type>GEnumClass</type></link> structure.</para>
<refsect3 id="G-ENUM-CLASS-TYPE-NAME.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>class</para></entry>
<entry role="parameter_description"><para>a <link linkend="GEnumClass"><type>GEnumClass</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="G-ENUM-CLASS-TYPE-NAME.returns" role="returns">
<title>Returns</title>
<para> the type name.</para>
</refsect3></refsect2>
<refsect2 id="G-TYPE-IS-ENUM:CAPS" role="macro">
<title>G_TYPE_IS_ENUM()</title>
<indexterm zone="G-TYPE-IS-ENUM:CAPS"><primary sortas="TYPE_IS_ENUM">G_TYPE_IS_ENUM</primary></indexterm>
<programlisting language="C">#define G_TYPE_IS_ENUM(type)	       (G_TYPE_FUNDAMENTAL (type) == G_TYPE_ENUM)
</programlisting>
<para>Checks whether <parameter>type</parameter>
 "is a" <link linkend="G-TYPE-ENUM:CAPS"><literal>G_TYPE_ENUM</literal></link>.</para>
<refsect3 id="G-TYPE-IS-ENUM.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>type</para></entry>
<entry role="parameter_description"><para>a <link linkend="GType"><type>GType</type></link> ID.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="G-TYPE-IS-ENUM.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if <parameter>type</parameter>
"is a" <link linkend="G-TYPE-ENUM:CAPS"><literal>G_TYPE_ENUM</literal></link>.</para>
</refsect3></refsect2>
<refsect2 id="G-ENUM-CLASS:CAPS" role="macro">
<title>G_ENUM_CLASS()</title>
<indexterm zone="G-ENUM-CLASS:CAPS"><primary sortas="ENUM_CLASS">G_ENUM_CLASS</primary></indexterm>
<programlisting language="C">#define G_ENUM_CLASS(class)	       (G_TYPE_CHECK_CLASS_CAST ((class), G_TYPE_ENUM, GEnumClass))
</programlisting>
<para>Casts a derived <link linkend="GEnumClass"><type>GEnumClass</type></link> structure into a <link linkend="GEnumClass"><type>GEnumClass</type></link> structure.</para>
<refsect3 id="G-ENUM-CLASS.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>class</para></entry>
<entry role="parameter_description"><para>a valid <link linkend="GEnumClass"><type>GEnumClass</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="G-IS-ENUM-CLASS:CAPS" role="macro">
<title>G_IS_ENUM_CLASS()</title>
<indexterm zone="G-IS-ENUM-CLASS:CAPS"><primary sortas="IS_ENUM_CLASS">G_IS_ENUM_CLASS</primary></indexterm>
<programlisting language="C">#define G_IS_ENUM_CLASS(class)	       (G_TYPE_CHECK_CLASS_TYPE ((class), G_TYPE_ENUM))
</programlisting>
<para>Checks whether <parameter>class</parameter>
 "is a" valid <link linkend="GEnumClass"><type>GEnumClass</type></link> structure of type <link linkend="G-TYPE-ENUM:CAPS"><literal>G_TYPE_ENUM</literal></link>
or derived.</para>
<refsect3 id="G-IS-ENUM-CLASS.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>class</para></entry>
<entry role="parameter_description"><para>a <link linkend="GEnumClass"><type>GEnumClass</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="G-TYPE-IS-FLAGS:CAPS" role="macro">
<title>G_TYPE_IS_FLAGS()</title>
<indexterm zone="G-TYPE-IS-FLAGS:CAPS"><primary sortas="TYPE_IS_FLAGS">G_TYPE_IS_FLAGS</primary></indexterm>
<programlisting language="C">#define G_TYPE_IS_FLAGS(type)	       (G_TYPE_FUNDAMENTAL (type) == G_TYPE_FLAGS)
</programlisting>
<para>Checks whether <parameter>type</parameter>
 "is a" <link linkend="G-TYPE-FLAGS:CAPS"><literal>G_TYPE_FLAGS</literal></link>.</para>
<refsect3 id="G-TYPE-IS-FLAGS.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>type</para></entry>
<entry role="parameter_description"><para>a <link linkend="GType"><type>GType</type></link> ID.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="G-TYPE-IS-FLAGS.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if <parameter>type</parameter>
"is a" <link linkend="G-TYPE-FLAGS:CAPS"><literal>G_TYPE_FLAGS</literal></link>.</para>
</refsect3></refsect2>
<refsect2 id="G-FLAGS-CLASS:CAPS" role="macro">
<title>G_FLAGS_CLASS()</title>
<indexterm zone="G-FLAGS-CLASS:CAPS"><primary sortas="FLAGS_CLASS">G_FLAGS_CLASS</primary></indexterm>
<programlisting language="C">#define G_FLAGS_CLASS(class)	       (G_TYPE_CHECK_CLASS_CAST ((class), G_TYPE_FLAGS, GFlagsClass))
</programlisting>
<para>Casts a derived <link linkend="GFlagsClass"><type>GFlagsClass</type></link> structure into a <link linkend="GFlagsClass"><type>GFlagsClass</type></link> structure.</para>
<refsect3 id="G-FLAGS-CLASS.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>class</para></entry>
<entry role="parameter_description"><para>a valid <link linkend="GFlagsClass"><type>GFlagsClass</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="G-IS-FLAGS-CLASS:CAPS" role="macro">
<title>G_IS_FLAGS_CLASS()</title>
<indexterm zone="G-IS-FLAGS-CLASS:CAPS"><primary sortas="IS_FLAGS_CLASS">G_IS_FLAGS_CLASS</primary></indexterm>
<programlisting language="C">#define G_IS_FLAGS_CLASS(class)        (G_TYPE_CHECK_CLASS_TYPE ((class), G_TYPE_FLAGS))
</programlisting>
<para>Checks whether <parameter>class</parameter>
 "is a" valid <link linkend="GFlagsClass"><type>GFlagsClass</type></link> structure of type <link linkend="G-TYPE-FLAGS:CAPS"><literal>G_TYPE_FLAGS</literal></link>
or derived.</para>
<refsect3 id="G-IS-FLAGS-CLASS.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>class</para></entry>
<entry role="parameter_description"><para>a <link linkend="GFlagsClass"><type>GFlagsClass</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="G-FLAGS-CLASS-TYPE:CAPS" role="macro">
<title>G_FLAGS_CLASS_TYPE()</title>
<indexterm zone="G-FLAGS-CLASS-TYPE:CAPS"><primary sortas="FLAGS_CLASS_TYPE">G_FLAGS_CLASS_TYPE</primary></indexterm>
<programlisting language="C">#define G_FLAGS_CLASS_TYPE(class)      (G_TYPE_FROM_CLASS (class))
</programlisting>
<para>Get the type identifier from a given <link linkend="GFlagsClass"><type>GFlagsClass</type></link> structure.</para>
<refsect3 id="G-FLAGS-CLASS-TYPE.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>class</para></entry>
<entry role="parameter_description"><para>a <link linkend="GFlagsClass"><type>GFlagsClass</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="G-FLAGS-CLASS-TYPE.returns" role="returns">
<title>Returns</title>
<para> the <link linkend="GType"><type>GType</type></link></para>
</refsect3></refsect2>
<refsect2 id="G-FLAGS-CLASS-TYPE-NAME:CAPS" role="macro">
<title>G_FLAGS_CLASS_TYPE_NAME()</title>
<indexterm zone="G-FLAGS-CLASS-TYPE-NAME:CAPS"><primary sortas="FLAGS_CLASS_TYPE_NAME">G_FLAGS_CLASS_TYPE_NAME</primary></indexterm>
<programlisting language="C">#define G_FLAGS_CLASS_TYPE_NAME(class) (g_type_name (G_FLAGS_CLASS_TYPE (class)))
</programlisting>
<para>Get the static type name from a given <link linkend="GFlagsClass"><type>GFlagsClass</type></link> structure.</para>
<refsect3 id="G-FLAGS-CLASS-TYPE-NAME.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>class</para></entry>
<entry role="parameter_description"><para>a <link linkend="GFlagsClass"><type>GFlagsClass</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="G-FLAGS-CLASS-TYPE-NAME.returns" role="returns">
<title>Returns</title>
<para> the type name.</para>
</refsect3></refsect2>
<refsect2 id="g-enum-get-value" role="function">
<title>g_enum_get_value&#160;()</title>
<indexterm zone="g-enum-get-value"><primary sortas="enum_get_value">g_enum_get_value</primary></indexterm>
<programlisting language="C"><link linkend="GEnumValue"><returnvalue>GEnumValue</returnvalue></link>&#160;*
g_enum_get_value (<parameter><link linkend="GEnumClass"><type>GEnumClass</type></link> *enum_class</parameter>,
                  <parameter><link linkend="gint"><type>gint</type></link> value</parameter>);</programlisting>
<para>Returns the <link linkend="GEnumValue"><type>GEnumValue</type></link> for a value.</para>
<refsect3 id="g-enum-get-value.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>enum_class</para></entry>
<entry role="parameter_description"><para>a <link linkend="GEnumClass"><type>GEnumClass</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>value</para></entry>
<entry role="parameter_description"><para>the value to look up</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-enum-get-value.returns" role="returns">
<title>Returns</title>
<para>the <link linkend="GEnumValue"><type>GEnumValue</type></link> for <parameter>value</parameter>
, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>
if <parameter>value</parameter>
is not a member of the enumeration. </para>
<para><emphasis role="annotation">[<acronym>transfer none</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="g-enum-get-value-by-name" role="function">
<title>g_enum_get_value_by_name&#160;()</title>
<indexterm zone="g-enum-get-value-by-name"><primary sortas="enum_get_value_by_name">g_enum_get_value_by_name</primary></indexterm>
<programlisting language="C"><link linkend="GEnumValue"><returnvalue>GEnumValue</returnvalue></link>&#160;*
g_enum_get_value_by_name (<parameter><link linkend="GEnumClass"><type>GEnumClass</type></link> *enum_class</parameter>,
                          <parameter>const <link linkend="gchar"><type>gchar</type></link> *name</parameter>);</programlisting>
<para>Looks up a <link linkend="GEnumValue"><type>GEnumValue</type></link> by name.</para>
<refsect3 id="g-enum-get-value-by-name.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>enum_class</para></entry>
<entry role="parameter_description"><para>a <link linkend="GEnumClass"><type>GEnumClass</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>name</para></entry>
<entry role="parameter_description"><para>the name to look up</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-enum-get-value-by-name.returns" role="returns">
<title>Returns</title>
<para>the <link linkend="GEnumValue"><type>GEnumValue</type></link> with name <parameter>name</parameter>
,
or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if the enumeration doesn't have a member
with that name. </para>
<para><emphasis role="annotation">[<acronym>transfer none</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="g-enum-get-value-by-nick" role="function">
<title>g_enum_get_value_by_nick&#160;()</title>
<indexterm zone="g-enum-get-value-by-nick"><primary sortas="enum_get_value_by_nick">g_enum_get_value_by_nick</primary></indexterm>
<programlisting language="C"><link linkend="GEnumValue"><returnvalue>GEnumValue</returnvalue></link>&#160;*
g_enum_get_value_by_nick (<parameter><link linkend="GEnumClass"><type>GEnumClass</type></link> *enum_class</parameter>,
                          <parameter>const <link linkend="gchar"><type>gchar</type></link> *nick</parameter>);</programlisting>
<para>Looks up a <link linkend="GEnumValue"><type>GEnumValue</type></link> by nickname.</para>
<refsect3 id="g-enum-get-value-by-nick.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>enum_class</para></entry>
<entry role="parameter_description"><para>a <link linkend="GEnumClass"><type>GEnumClass</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>nick</para></entry>
<entry role="parameter_description"><para>the nickname to look up</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-enum-get-value-by-nick.returns" role="returns">
<title>Returns</title>
<para>the <link linkend="GEnumValue"><type>GEnumValue</type></link> with nickname <parameter>nick</parameter>
,
or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if the enumeration doesn't have a member
with that nickname. </para>
<para><emphasis role="annotation">[<acronym>transfer none</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="g-enum-to-string" role="function" condition="since:2.54">
<title>g_enum_to_string&#160;()</title>
<indexterm zone="g-enum-to-string" role="2.54"><primary sortas="enum_to_string">g_enum_to_string</primary></indexterm>
<programlisting language="C"><link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;*
g_enum_to_string (<parameter><link linkend="GType"><type>GType</type></link> g_enum_type</parameter>,
                  <parameter><link linkend="gint"><type>gint</type></link> value</parameter>);</programlisting>
<para>Pretty-prints <parameter>value</parameter>
 in the form of the enum’s name.</para>
<para>This is intended to be used for debugging purposes. The format of the output
may change in the future.</para>
<refsect3 id="g-enum-to-string.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>g_enum_type</para></entry>
<entry role="parameter_description"><para>the type identifier of a <link linkend="GEnumClass"><type>GEnumClass</type></link> type</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>value</para></entry>
<entry role="parameter_description"><para>the value</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-enum-to-string.returns" role="returns">
<title>Returns</title>
<para>a newly-allocated text string. </para>
<para><emphasis role="annotation">[<acronym>transfer full</acronym>]</emphasis></para>
</refsect3><para role="since">Since: <link linkend="api-index-2.54">2.54</link></para></refsect2>
<refsect2 id="g-flags-get-first-value" role="function">
<title>g_flags_get_first_value&#160;()</title>
<indexterm zone="g-flags-get-first-value"><primary sortas="flags_get_first_value">g_flags_get_first_value</primary></indexterm>
<programlisting language="C"><link linkend="GFlagsValue"><returnvalue>GFlagsValue</returnvalue></link>&#160;*
g_flags_get_first_value (<parameter><link linkend="GFlagsClass"><type>GFlagsClass</type></link> *flags_class</parameter>,
                         <parameter><link linkend="guint"><type>guint</type></link> value</parameter>);</programlisting>
<para>Returns the first <link linkend="GFlagsValue"><type>GFlagsValue</type></link> which is set in <parameter>value</parameter>
.</para>
<refsect3 id="g-flags-get-first-value.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>flags_class</para></entry>
<entry role="parameter_description"><para>a <link linkend="GFlagsClass"><type>GFlagsClass</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>value</para></entry>
<entry role="parameter_description"><para>the value</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-flags-get-first-value.returns" role="returns">
<title>Returns</title>
<para>the first <link linkend="GFlagsValue"><type>GFlagsValue</type></link> which is set in
<parameter>value</parameter>
, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if none is set. </para>
<para><emphasis role="annotation">[<acronym>transfer none</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="g-flags-get-value-by-name" role="function">
<title>g_flags_get_value_by_name&#160;()</title>
<indexterm zone="g-flags-get-value-by-name"><primary sortas="flags_get_value_by_name">g_flags_get_value_by_name</primary></indexterm>
<programlisting language="C"><link linkend="GFlagsValue"><returnvalue>GFlagsValue</returnvalue></link>&#160;*
g_flags_get_value_by_name (<parameter><link linkend="GFlagsClass"><type>GFlagsClass</type></link> *flags_class</parameter>,
                           <parameter>const <link linkend="gchar"><type>gchar</type></link> *name</parameter>);</programlisting>
<para>Looks up a <link linkend="GFlagsValue"><type>GFlagsValue</type></link> by name.</para>
<refsect3 id="g-flags-get-value-by-name.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>flags_class</para></entry>
<entry role="parameter_description"><para>a <link linkend="GFlagsClass"><type>GFlagsClass</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>name</para></entry>
<entry role="parameter_description"><para>the name to look up</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-flags-get-value-by-name.returns" role="returns">
<title>Returns</title>
<para>the <link linkend="GFlagsValue"><type>GFlagsValue</type></link> with name <parameter>name</parameter>
,
or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if there is no flag with that name. </para>
<para><emphasis role="annotation">[<acronym>transfer none</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="g-flags-get-value-by-nick" role="function">
<title>g_flags_get_value_by_nick&#160;()</title>
<indexterm zone="g-flags-get-value-by-nick"><primary sortas="flags_get_value_by_nick">g_flags_get_value_by_nick</primary></indexterm>
<programlisting language="C"><link linkend="GFlagsValue"><returnvalue>GFlagsValue</returnvalue></link>&#160;*
g_flags_get_value_by_nick (<parameter><link linkend="GFlagsClass"><type>GFlagsClass</type></link> *flags_class</parameter>,
                           <parameter>const <link linkend="gchar"><type>gchar</type></link> *nick</parameter>);</programlisting>
<para>Looks up a <link linkend="GFlagsValue"><type>GFlagsValue</type></link> by nickname.</para>
<refsect3 id="g-flags-get-value-by-nick.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>flags_class</para></entry>
<entry role="parameter_description"><para>a <link linkend="GFlagsClass"><type>GFlagsClass</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>nick</para></entry>
<entry role="parameter_description"><para>the nickname to look up</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-flags-get-value-by-nick.returns" role="returns">
<title>Returns</title>
<para>the <link linkend="GFlagsValue"><type>GFlagsValue</type></link> with nickname <parameter>nick</parameter>
,
or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if there is no flag with that nickname. </para>
<para><emphasis role="annotation">[<acronym>transfer none</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="g-flags-to-string" role="function" condition="since:2.54">
<title>g_flags_to_string&#160;()</title>
<indexterm zone="g-flags-to-string" role="2.54"><primary sortas="flags_to_string">g_flags_to_string</primary></indexterm>
<programlisting language="C"><link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;*
g_flags_to_string (<parameter><link linkend="GType"><type>GType</type></link> flags_type</parameter>,
                   <parameter><link linkend="guint"><type>guint</type></link> value</parameter>);</programlisting>
<para>Pretty-prints <parameter>value</parameter>
 in the form of the flag names separated by <literal> | </literal> and
sorted. Any extra bits will be shown at the end as a hexadecimal number.</para>
<para>This is intended to be used for debugging purposes. The format of the output
may change in the future.</para>
<refsect3 id="g-flags-to-string.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>flags_type</para></entry>
<entry role="parameter_description"><para>the type identifier of a <link linkend="GFlagsClass"><type>GFlagsClass</type></link> type</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>value</para></entry>
<entry role="parameter_description"><para>the value</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-flags-to-string.returns" role="returns">
<title>Returns</title>
<para>a newly-allocated text string. </para>
<para><emphasis role="annotation">[<acronym>transfer full</acronym>]</emphasis></para>
</refsect3><para role="since">Since: <link linkend="api-index-2.54">2.54</link></para></refsect2>
<refsect2 id="g-enum-register-static" role="function">
<title>g_enum_register_static&#160;()</title>
<indexterm zone="g-enum-register-static"><primary sortas="enum_register_static">g_enum_register_static</primary></indexterm>
<programlisting language="C"><link linkend="GType"><returnvalue>GType</returnvalue></link>
g_enum_register_static (<parameter>const <link linkend="gchar"><type>gchar</type></link> *name</parameter>,
                        <parameter>const <link linkend="GEnumValue"><type>GEnumValue</type></link> *const_static_values</parameter>);</programlisting>
<para>Registers a new static enumeration type with the name <parameter>name</parameter>
.</para>
<para>It is normally more convenient to let <link linkend="glib-mkenums">glib-mkenums</link>,
generate a <link linkend="my-enum-get-type"><function>my_enum_get_type()</function></link> function from a usual C enumeration
definition  than to write one yourself using <link linkend="g-enum-register-static"><function>g_enum_register_static()</function></link>.</para>
<refsect3 id="g-enum-register-static.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>name</para></entry>
<entry role="parameter_description"><para>A nul-terminated string used as the name of the new type.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>const_static_values</para></entry>
<entry role="parameter_description"><para>An array of <link linkend="GEnumValue"><type>GEnumValue</type></link> structs for the possible
enumeration values. The array is terminated by a struct with all
members being 0. GObject keeps a reference to the data, so it cannot
be stack-allocated.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-enum-register-static.returns" role="returns">
<title>Returns</title>
<para> The new type identifier.</para>
</refsect3></refsect2>
<refsect2 id="g-flags-register-static" role="function">
<title>g_flags_register_static&#160;()</title>
<indexterm zone="g-flags-register-static"><primary sortas="flags_register_static">g_flags_register_static</primary></indexterm>
<programlisting language="C"><link linkend="GType"><returnvalue>GType</returnvalue></link>
g_flags_register_static (<parameter>const <link linkend="gchar"><type>gchar</type></link> *name</parameter>,
                         <parameter>const <link linkend="GFlagsValue"><type>GFlagsValue</type></link> *const_static_values</parameter>);</programlisting>
<para>Registers a new static flags type with the name <parameter>name</parameter>
.</para>
<para>It is normally more convenient to let <link linkend="glib-mkenums">glib-mkenums</link>
generate a <link linkend="my-flags-get-type"><function>my_flags_get_type()</function></link> function from a usual C enumeration
definition than to write one yourself using <link linkend="g-flags-register-static"><function>g_flags_register_static()</function></link>.</para>
<refsect3 id="g-flags-register-static.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>name</para></entry>
<entry role="parameter_description"><para>A nul-terminated string used as the name of the new type.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>const_static_values</para></entry>
<entry role="parameter_description"><para>An array of <link linkend="GFlagsValue"><type>GFlagsValue</type></link> structs for the possible
flags values. The array is terminated by a struct with all members being 0.
GObject keeps a reference to the data, so it cannot be stack-allocated.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-flags-register-static.returns" role="returns">
<title>Returns</title>
<para> The new type identifier.</para>
</refsect3></refsect2>
<refsect2 id="g-enum-complete-type-info" role="function">
<title>g_enum_complete_type_info&#160;()</title>
<indexterm zone="g-enum-complete-type-info"><primary sortas="enum_complete_type_info">g_enum_complete_type_info</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
g_enum_complete_type_info (<parameter><link linkend="GType"><type>GType</type></link> g_enum_type</parameter>,
                           <parameter><link linkend="GTypeInfo"><type>GTypeInfo</type></link> *info</parameter>,
                           <parameter>const <link linkend="GEnumValue"><type>GEnumValue</type></link> *const_values</parameter>);</programlisting>
<para>This function is meant to be called from the <literal>complete_type_info</literal>
function of a <link linkend="GTypePlugin"><type>GTypePlugin</type></link> implementation, as in the following
example:</para>
<informalexample><programlisting role="example"><![CDATA[
static void
my_enum_complete_type_info (GTypePlugin     *plugin,
                            GType            g_type,
                            GTypeInfo       *info,
                            GTypeValueTable *value_table)
{
  static const GEnumValue values[] = {
    { MY_ENUM_FOO, "MY_ENUM_FOO", "foo" },
    { MY_ENUM_BAR, "MY_ENUM_BAR", "bar" },
    { 0, NULL, NULL }
  };

  g_enum_complete_type_info (type, info, values);
}
]]></programlisting></informalexample>
<para></para>
<refsect3 id="g-enum-complete-type-info.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>g_enum_type</para></entry>
<entry role="parameter_description"><para>the type identifier of the type being completed</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>info</para></entry>
<entry role="parameter_description"><para>the <link linkend="GTypeInfo"><type>GTypeInfo</type></link> struct to be filled in. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out callee-allocates</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>const_values</para></entry>
<entry role="parameter_description"><para>An array of <link linkend="GEnumValue"><type>GEnumValue</type></link> structs for the possible
enumeration values. The array is terminated by a struct with all
members being 0.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="g-flags-complete-type-info" role="function">
<title>g_flags_complete_type_info&#160;()</title>
<indexterm zone="g-flags-complete-type-info"><primary sortas="flags_complete_type_info">g_flags_complete_type_info</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
g_flags_complete_type_info (<parameter><link linkend="GType"><type>GType</type></link> g_flags_type</parameter>,
                            <parameter><link linkend="GTypeInfo"><type>GTypeInfo</type></link> *info</parameter>,
                            <parameter>const <link linkend="GFlagsValue"><type>GFlagsValue</type></link> *const_values</parameter>);</programlisting>
<para>This function is meant to be called from the <link linkend="complete-type-info"><function>complete_type_info()</function></link>
function of a <link linkend="GTypePlugin"><type>GTypePlugin</type></link> implementation, see the example for
<link linkend="g-enum-complete-type-info"><function>g_enum_complete_type_info()</function></link> above.</para>
<refsect3 id="g-flags-complete-type-info.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>g_flags_type</para></entry>
<entry role="parameter_description"><para>the type identifier of the type being completed</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>info</para></entry>
<entry role="parameter_description"><para>the <link linkend="GTypeInfo"><type>GTypeInfo</type></link> struct to be filled in. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out callee-allocates</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>const_values</para></entry>
<entry role="parameter_description"><para>An array of <link linkend="GFlagsValue"><type>GFlagsValue</type></link> structs for the possible
enumeration values. The array is terminated by a struct with all
members being 0.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>

</refsect1>
<refsect1 id="gobject-Enumeration-and-Flag-Types.other_details" role="details">
<title role="details.title">Types and Values</title>
<refsect2 id="GEnumClass" role="struct">
<title>struct GEnumClass</title>
<indexterm zone="GEnumClass"><primary sortas="EnumClass">GEnumClass</primary></indexterm>
<programlisting language="C">struct GEnumClass {
  GTypeClass  g_type_class;

  gint	      minimum;
  gint	      maximum;
  guint	      n_values;
  GEnumValue *values;
};
</programlisting>
<para>The class of an enumeration type holds information about its

possible values.</para>
<refsect3 id="GEnumClass.members" role="struct_members">
<title>Members</title>
<informaltable role="struct_members_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="struct_members_name" colwidth="300px"/>
<colspec colname="struct_members_description"/>
<colspec colname="struct_members_annotations" colwidth="200px"/>
<tbody>
<row role="member"><entry role="struct_member_name"><para><link linkend="GTypeClass"><type>GTypeClass</type></link>&#160;<structfield id="GEnumClass.g-type-class">g_type_class</structfield>;</para></entry>
<entry role="struct_member_description"><para>the parent class</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
<row role="member"><entry role="struct_member_name"><para><link linkend="gint"><type>gint</type></link>&#160;<structfield id="GEnumClass.minimum">minimum</structfield>;</para></entry>
<entry role="struct_member_description"><para>the smallest possible value.</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
<row role="member"><entry role="struct_member_name"><para><link linkend="gint"><type>gint</type></link>&#160;<structfield id="GEnumClass.maximum">maximum</structfield>;</para></entry>
<entry role="struct_member_description"><para>the largest possible value.</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
<row role="member"><entry role="struct_member_name"><para><link linkend="guint"><type>guint</type></link>&#160;<structfield id="GEnumClass.n-values">n_values</structfield>;</para></entry>
<entry role="struct_member_description"><para>the number of possible values.</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
<row role="member"><entry role="struct_member_name"><para><link linkend="GEnumValue"><type>GEnumValue</type></link>&#160;*<structfield id="GEnumClass.values">values</structfield>;</para></entry>
<entry role="struct_member_description"><para>an array of <link linkend="GEnumValue"><type>GEnumValue</type></link> structs describing the
individual values.</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
</tbody></tgroup></informaltable>
</refsect3>
</refsect2>
<refsect2 id="GFlagsClass" role="struct">
<title>struct GFlagsClass</title>
<indexterm zone="GFlagsClass"><primary sortas="FlagsClass">GFlagsClass</primary></indexterm>
<programlisting language="C">struct GFlagsClass {
  GTypeClass   g_type_class;

  guint	       mask;
  guint	       n_values;
  GFlagsValue *values;
};
</programlisting>
<para>The class of a flags type holds information about its

possible values.</para>
<refsect3 id="GFlagsClass.members" role="struct_members">
<title>Members</title>
<informaltable role="struct_members_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="struct_members_name" colwidth="300px"/>
<colspec colname="struct_members_description"/>
<colspec colname="struct_members_annotations" colwidth="200px"/>
<tbody>
<row role="member"><entry role="struct_member_name"><para><link linkend="GTypeClass"><type>GTypeClass</type></link>&#160;<structfield id="GFlagsClass.g-type-class">g_type_class</structfield>;</para></entry>
<entry role="struct_member_description"><para>the parent class</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
<row role="member"><entry role="struct_member_name"><para><link linkend="guint"><type>guint</type></link>&#160;<structfield id="GFlagsClass.mask">mask</structfield>;</para></entry>
<entry role="struct_member_description"><para>a mask covering all possible values.</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
<row role="member"><entry role="struct_member_name"><para><link linkend="guint"><type>guint</type></link>&#160;<structfield id="GFlagsClass.n-values">n_values</structfield>;</para></entry>
<entry role="struct_member_description"><para>the number of possible values.</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
<row role="member"><entry role="struct_member_name"><para><link linkend="GFlagsValue"><type>GFlagsValue</type></link>&#160;*<structfield id="GFlagsClass.values">values</structfield>;</para></entry>
<entry role="struct_member_description"><para>an array of <link linkend="GFlagsValue"><type>GFlagsValue</type></link> structs describing the
individual values.</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
</tbody></tgroup></informaltable>
</refsect3>
</refsect2>
<refsect2 id="GEnumValue" role="struct">
<title>struct GEnumValue</title>
<indexterm zone="GEnumValue"><primary sortas="EnumValue">GEnumValue</primary></indexterm>
<programlisting language="C">struct GEnumValue {
  gint	 value;
  const gchar *value_name;
  const gchar *value_nick;
};
</programlisting>
<para>A structure which contains a single enum value, its name, and its
nickname.</para>
<refsect3 id="GEnumValue.members" role="struct_members">
<title>Members</title>
<informaltable role="struct_members_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="struct_members_name" colwidth="300px"/>
<colspec colname="struct_members_description"/>
<colspec colname="struct_members_annotations" colwidth="200px"/>
<tbody>
<row role="member"><entry role="struct_member_name"><para><link linkend="gint"><type>gint</type></link>&#160;<structfield id="GEnumValue.value">value</structfield>;</para></entry>
<entry role="struct_member_description"><para>the enum value</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
<row role="member"><entry role="struct_member_name"><para>const&#160;<link linkend="gchar"><type>gchar</type></link>&#160;*<structfield id="GEnumValue.value-name">value_name</structfield>;</para></entry>
<entry role="struct_member_description"><para>the name of the value</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
<row role="member"><entry role="struct_member_name"><para>const&#160;<link linkend="gchar"><type>gchar</type></link>&#160;*<structfield id="GEnumValue.value-nick">value_nick</structfield>;</para></entry>
<entry role="struct_member_description"><para>the nickname of the value</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
</tbody></tgroup></informaltable>
</refsect3>
</refsect2>
<refsect2 id="GFlagsValue" role="struct">
<title>struct GFlagsValue</title>
<indexterm zone="GFlagsValue"><primary sortas="FlagsValue">GFlagsValue</primary></indexterm>
<programlisting language="C">struct GFlagsValue {
  guint	 value;
  const gchar *value_name;
  const gchar *value_nick;
};
</programlisting>
<para>A structure which contains a single flags value, its name, and its
nickname.</para>
<refsect3 id="GFlagsValue.members" role="struct_members">
<title>Members</title>
<informaltable role="struct_members_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="struct_members_name" colwidth="300px"/>
<colspec colname="struct_members_description"/>
<colspec colname="struct_members_annotations" colwidth="200px"/>
<tbody>
<row role="member"><entry role="struct_member_name"><para><link linkend="guint"><type>guint</type></link>&#160;<structfield id="GFlagsValue.value">value</structfield>;</para></entry>
<entry role="struct_member_description"><para>the flags value</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
<row role="member"><entry role="struct_member_name"><para>const&#160;<link linkend="gchar"><type>gchar</type></link>&#160;*<structfield id="GFlagsValue.value-name">value_name</structfield>;</para></entry>
<entry role="struct_member_description"><para>the name of the value</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
<row role="member"><entry role="struct_member_name"><para>const&#160;<link linkend="gchar"><type>gchar</type></link>&#160;*<structfield id="GFlagsValue.value-nick">value_nick</structfield>;</para></entry>
<entry role="struct_member_description"><para>the nickname of the value</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
</tbody></tgroup></informaltable>
</refsect3>
</refsect2>

</refsect1>
<refsect1 id="gobject-Enumeration-and-Flag-Types.see-also">
<title>See Also</title>
<para><link linkend="GParamSpecEnum"><type>GParamSpecEnum</type></link>, <link linkend="GParamSpecFlags"><type>GParamSpecFlags</type></link>, <link linkend="g-param-spec-enum"><function>g_param_spec_enum()</function></link>,
<link linkend="g-param-spec-flags"><function>g_param_spec_flags()</function></link></para>

</refsect1>

</refentry>
