<refentry id="gobject-GType">
<refmeta>
<refentrytitle>GType</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GOBJECT Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>GType</refname><refpurpose>The GLib Runtime type identification and management system</refpurpose>
</refnamediv>

<refsynopsisdiv><title>Synopsis</title>
<synopsis>

#include &lt;gobject.h&gt;


typedef     <link linkend="GType">GType</link>;
#define     <link linkend="G-TYPE-FUNDAMENTAL-CAPS">G_TYPE_FUNDAMENTAL</link>              (type)
#define     <link linkend="G-TYPE-FUNDAMENTAL-MAX-CAPS">G_TYPE_FUNDAMENTAL_MAX</link>
#define     <link linkend="G-TYPE-MAKE-FUNDAMENTAL-CAPS">G_TYPE_MAKE_FUNDAMENTAL</link>         (x)
#define     <link linkend="G-TYPE-IS-ABSTRACT-CAPS">G_TYPE_IS_ABSTRACT</link>              (type)
#define     <link linkend="G-TYPE-IS-DERIVED-CAPS">G_TYPE_IS_DERIVED</link>               (type)
#define     <link linkend="G-TYPE-IS-FUNDAMENTAL-CAPS">G_TYPE_IS_FUNDAMENTAL</link>           (type)
#define     <link linkend="G-TYPE-IS-VALUE-TYPE-CAPS">G_TYPE_IS_VALUE_TYPE</link>            (type)
#define     <link linkend="G-TYPE-HAS-VALUE-TABLE-CAPS">G_TYPE_HAS_VALUE_TABLE</link>          (type)
#define     <link linkend="G-TYPE-IS-CLASSED-CAPS">G_TYPE_IS_CLASSED</link>               (type)
#define     <link linkend="G-TYPE-IS-INSTANTIATABLE-CAPS">G_TYPE_IS_INSTANTIATABLE</link>        (type)
#define     <link linkend="G-TYPE-IS-DERIVABLE-CAPS">G_TYPE_IS_DERIVABLE</link>             (type)
#define     <link linkend="G-TYPE-IS-DEEP-DERIVABLE-CAPS">G_TYPE_IS_DEEP_DERIVABLE</link>        (type)
#define     <link linkend="G-TYPE-IS-INTERFACE-CAPS">G_TYPE_IS_INTERFACE</link>             (type)
struct      <link linkend="GTypeInterface">GTypeInterface</link>;
struct      <link linkend="GTypeInstance">GTypeInstance</link>;
struct      <link linkend="GTypeInfo">GTypeInfo</link>;
struct      <link linkend="GTypeFundamentalInfo">GTypeFundamentalInfo</link>;
struct      <link linkend="GInterfaceInfo">GInterfaceInfo</link>;
struct      <link linkend="GTypeValueTable">GTypeValueTable</link>;
#define     <link linkend="G-TYPE-FROM-INSTANCE-CAPS">G_TYPE_FROM_INSTANCE</link>            (instance)
#define     <link linkend="G-TYPE-FROM-CLASS-CAPS">G_TYPE_FROM_CLASS</link>               (g_class)
#define     <link linkend="G-TYPE-FROM-INTERFACE-CAPS">G_TYPE_FROM_INTERFACE</link>           (g_iface)
#define     <link linkend="G-TYPE-INSTANCE-GET-CLASS-CAPS">G_TYPE_INSTANCE_GET_CLASS</link>       (instance, g_type, c_type)
#define     <link linkend="G-TYPE-INSTANCE-GET-INTERFACE-CAPS">G_TYPE_INSTANCE_GET_INTERFACE</link>   (instance, g_type, c_type)
#define     <link linkend="G-TYPE-CHECK-INSTANCE-CAPS">G_TYPE_CHECK_INSTANCE</link>           (instance)
#define     <link linkend="G-TYPE-CHECK-INSTANCE-CAST-CAPS">G_TYPE_CHECK_INSTANCE_CAST</link>      (instance, g_type, c_type)
#define     <link linkend="G-TYPE-CHECK-INSTANCE-TYPE-CAPS">G_TYPE_CHECK_INSTANCE_TYPE</link>      (instance, g_type)
#define     <link linkend="G-TYPE-CHECK-CLASS-CAST-CAPS">G_TYPE_CHECK_CLASS_CAST</link>         (g_class, g_type, c_type)
#define     <link linkend="G-TYPE-CHECK-CLASS-TYPE-CAPS">G_TYPE_CHECK_CLASS_TYPE</link>         (g_class, g_type)
#define     <link linkend="G-TYPE-CHECK-VALUE-CAPS">G_TYPE_CHECK_VALUE</link>              (value)
#define     <link linkend="G-TYPE-CHECK-VALUE-TYPE-CAPS">G_TYPE_CHECK_VALUE_TYPE</link>         (value, g_type)
#define     <link linkend="G-TYPE-FLAG-RESERVED-ID-BIT-CAPS">G_TYPE_FLAG_RESERVED_ID_BIT</link>
void        <link linkend="g-type-init">g_type_init</link>                     (void);
enum        <link linkend="GTypeDebugFlags">GTypeDebugFlags</link>;
void        <link linkend="g-type-init-with-debug-flags">g_type_init_with_debug_flags</link>    (<link linkend="GTypeDebugFlags">GTypeDebugFlags</link> debug_flags);
G_CONST_RETURN <link linkend="gchar">gchar</link>* <link linkend="g-type-name">g_type_name</link>           (<link linkend="GType">GType</link> type);
<link linkend="GQuark">GQuark</link>      <link linkend="g-type-qname">g_type_qname</link>                    (<link linkend="GType">GType</link> type);
<link linkend="GType">GType</link>       <link linkend="g-type-from-name">g_type_from_name</link>                (const <link linkend="gchar">gchar</link> *name);
<link linkend="GType">GType</link>       <link linkend="g-type-parent">g_type_parent</link>                   (<link linkend="GType">GType</link> type);
<link linkend="guint">guint</link>       <link linkend="g-type-depth">g_type_depth</link>                    (<link linkend="GType">GType</link> type);
<link linkend="GType">GType</link>       <link linkend="g-type-next-base">g_type_next_base</link>                (<link linkend="GType">GType</link> leaf_type,
                                             <link linkend="GType">GType</link> root_type);
<link linkend="gboolean">gboolean</link>    <link linkend="g-type-is-a">g_type_is_a</link>                     (<link linkend="GType">GType</link> type,
                                             <link linkend="GType">GType</link> is_a_type);
<link linkend="gpointer">gpointer</link>    <link linkend="g-type-class-ref">g_type_class_ref</link>                (<link linkend="GType">GType</link> type);
<link linkend="gpointer">gpointer</link>    <link linkend="g-type-class-peek">g_type_class_peek</link>               (<link linkend="GType">GType</link> type);
void        <link linkend="g-type-class-unref">g_type_class_unref</link>              (<link linkend="gpointer">gpointer</link> g_class);
<link linkend="gpointer">gpointer</link>    <link linkend="g-type-class-peek-parent">g_type_class_peek_parent</link>        (<link linkend="gpointer">gpointer</link> g_class);
<link linkend="gpointer">gpointer</link>    <link linkend="g-type-interface-peek">g_type_interface_peek</link>           (<link linkend="gpointer">gpointer</link> instance_class,
                                             <link linkend="GType">GType</link> iface_type);
<link linkend="gpointer">gpointer</link>    <link linkend="g-type-interface-peek-parent">g_type_interface_peek_parent</link>    (<link linkend="gpointer">gpointer</link> g_iface);
<link linkend="GType">GType</link>*      <link linkend="g-type-children">g_type_children</link>                 (<link linkend="GType">GType</link> type,
                                             <link linkend="guint">guint</link> *n_children);
<link linkend="GType">GType</link>*      <link linkend="g-type-interfaces">g_type_interfaces</link>               (<link linkend="GType">GType</link> type,
                                             <link linkend="guint">guint</link> *n_interfaces);
void        <link linkend="g-type-set-qdata">g_type_set_qdata</link>                (<link linkend="GType">GType</link> type,
                                             <link linkend="GQuark">GQuark</link> quark,
                                             <link linkend="gpointer">gpointer</link> data);
<link linkend="gpointer">gpointer</link>    <link linkend="g-type-get-qdata">g_type_get_qdata</link>                (<link linkend="GType">GType</link> type,
                                             <link linkend="GQuark">GQuark</link> quark);
void        <link linkend="g-type-query">g_type_query</link>                    (<link linkend="GType">GType</link> type,
                                             <link linkend="GTypeQuery">GTypeQuery</link> *query);
struct      <link linkend="GTypeQuery">GTypeQuery</link>;
void        (<link linkend="GBaseInitFunc">*GBaseInitFunc</link>)                (<link linkend="gpointer">gpointer</link> g_class);
void        (<link linkend="GBaseFinalizeFunc">*GBaseFinalizeFunc</link>)            (<link linkend="gpointer">gpointer</link> g_class);
void        (<link linkend="GClassInitFunc">*GClassInitFunc</link>)               (<link linkend="gpointer">gpointer</link> g_class,
                                             <link linkend="gpointer">gpointer</link> class_data);
void        (<link linkend="GClassFinalizeFunc">*GClassFinalizeFunc</link>)           (<link linkend="gpointer">gpointer</link> g_class,
                                             <link linkend="gpointer">gpointer</link> class_data);
void        (<link linkend="GInstanceInitFunc">*GInstanceInitFunc</link>)            (<link linkend="GTypeInstance">GTypeInstance</link> *instance,
                                             <link linkend="gpointer">gpointer</link> g_class);
void        (<link linkend="GInterfaceInitFunc">*GInterfaceInitFunc</link>)           (<link linkend="gpointer">gpointer</link> g_iface,
                                             <link linkend="gpointer">gpointer</link> iface_data);
void        (<link linkend="GInterfaceFinalizeFunc">*GInterfaceFinalizeFunc</link>)       (<link linkend="gpointer">gpointer</link> g_iface,
                                             <link linkend="gpointer">gpointer</link> iface_data);
<link linkend="gboolean">gboolean</link>    (<link linkend="GTypeClassCacheFunc">*GTypeClassCacheFunc</link>)          (<link linkend="gpointer">gpointer</link> cache_data,
                                             <link linkend="GTypeClass">GTypeClass</link> *g_class);
enum        <link linkend="GTypeFlags">GTypeFlags</link>;
enum        <link linkend="GTypeFundamentalFlags">GTypeFundamentalFlags</link>;
<link linkend="GType">GType</link>       <link linkend="g-type-register-static">g_type_register_static</link>          (<link linkend="GType">GType</link> parent_type,
                                             const <link linkend="gchar">gchar</link> *type_name,
                                             const <link linkend="GTypeInfo">GTypeInfo</link> *info,
                                             <link linkend="GTypeFlags">GTypeFlags</link> flags);
<link linkend="GType">GType</link>       <link linkend="g-type-register-dynamic">g_type_register_dynamic</link>         (<link linkend="GType">GType</link> parent_type,
                                             const <link linkend="gchar">gchar</link> *type_name,
                                             <link linkend="GTypePlugin">GTypePlugin</link> *plugin,
                                             <link linkend="GTypeFlags">GTypeFlags</link> flags);
<link linkend="GType">GType</link>       <link linkend="g-type-register-fundamental">g_type_register_fundamental</link>     (<link linkend="GType">GType</link> type_id,
                                             const <link linkend="gchar">gchar</link> *type_name,
                                             const <link linkend="GTypeInfo">GTypeInfo</link> *info,
                                             const <link linkend="GTypeFundamentalInfo">GTypeFundamentalInfo</link> *finfo,
                                             <link linkend="GTypeFlags">GTypeFlags</link> flags);
void        <link linkend="g-type-add-interface-static">g_type_add_interface_static</link>     (<link linkend="GType">GType</link> instance_type,
                                             <link linkend="GType">GType</link> interface_type,
                                             const <link linkend="GInterfaceInfo">GInterfaceInfo</link> *info);
void        <link linkend="g-type-add-interface-dynamic">g_type_add_interface_dynamic</link>    (<link linkend="GType">GType</link> instance_type,
                                             <link linkend="GType">GType</link> interface_type,
                                             <link linkend="GTypePlugin">GTypePlugin</link> *plugin);
void        <link linkend="g-type-interface-add-prerequisite">g_type_interface_add_prerequisite</link>
                                            (<link linkend="GType">GType</link> interface_type,
                                             <link linkend="GType">GType</link> prerequisite_type);
<link linkend="GTypePlugin">GTypePlugin</link>* <link linkend="g-type-get-plugin">g_type_get_plugin</link>              (<link linkend="GType">GType</link> type);
<link linkend="GTypePlugin">GTypePlugin</link>* <link linkend="g-type-interface-get-plugin">g_type_interface_get_plugin</link>    (<link linkend="GType">GType</link> instance_type,
                                             <link linkend="GType">GType</link> implementation_type);
<link linkend="GType">GType</link>       <link linkend="g-type-fundamental-next">g_type_fundamental_next</link>         (void);
<link linkend="GType">GType</link>       <link linkend="g-type-fundamental">g_type_fundamental</link>              (<link linkend="GType">GType</link> type_id);
<link linkend="GTypeInstance">GTypeInstance</link>* <link linkend="g-type-create-instance">g_type_create_instance</link>       (<link linkend="GType">GType</link> type);
void        <link linkend="g-type-free-instance">g_type_free_instance</link>            (<link linkend="GTypeInstance">GTypeInstance</link> *instance);
void        <link linkend="g-type-add-class-cache-func">g_type_add_class_cache_func</link>     (<link linkend="gpointer">gpointer</link> cache_data,
                                             <link linkend="GTypeClassCacheFunc">GTypeClassCacheFunc</link> cache_func);
void        <link linkend="g-type-remove-class-cache-func">g_type_remove_class_cache_func</link>  (<link linkend="gpointer">gpointer</link> cache_data,
                                             <link linkend="GTypeClassCacheFunc">GTypeClassCacheFunc</link> cache_func);
void        <link linkend="g-type-class-unref-uncached">g_type_class_unref_uncached</link>     (<link linkend="gpointer">gpointer</link> g_class);
<link linkend="GTypeValueTable">GTypeValueTable</link>* <link linkend="g-type-value-table-peek">g_type_value_table_peek</link>    (<link linkend="GType">GType</link> type);


#define     <link linkend="G-TYPE-INVALID-CAPS">G_TYPE_INVALID</link>
#define     <link linkend="G-TYPE-NONE-CAPS">G_TYPE_NONE</link>
#define     <link linkend="G-TYPE-INTERFACE-CAPS">G_TYPE_INTERFACE</link>
#define     <link linkend="G-TYPE-CHAR-CAPS">G_TYPE_CHAR</link>
#define     <link linkend="G-TYPE-UCHAR-CAPS">G_TYPE_UCHAR</link>
#define     <link linkend="G-TYPE-BOOLEAN-CAPS">G_TYPE_BOOLEAN</link>
#define     <link linkend="G-TYPE-INT-CAPS">G_TYPE_INT</link>
#define     <link linkend="G-TYPE-UINT-CAPS">G_TYPE_UINT</link>
#define     <link linkend="G-TYPE-LONG-CAPS">G_TYPE_LONG</link>
#define     <link linkend="G-TYPE-ULONG-CAPS">G_TYPE_ULONG</link>
#define     <link linkend="G-TYPE-INT64-CAPS">G_TYPE_INT64</link>
#define     <link linkend="G-TYPE-UINT64-CAPS">G_TYPE_UINT64</link>
#define     <link linkend="G-TYPE-ENUM-CAPS">G_TYPE_ENUM</link>
#define     <link linkend="G-TYPE-FLAGS-CAPS">G_TYPE_FLAGS</link>
#define     <link linkend="G-TYPE-FLOAT-CAPS">G_TYPE_FLOAT</link>
#define     <link linkend="G-TYPE-DOUBLE-CAPS">G_TYPE_DOUBLE</link>
#define     <link linkend="G-TYPE-STRING-CAPS">G_TYPE_STRING</link>
#define     <link linkend="G-TYPE-POINTER-CAPS">G_TYPE_POINTER</link>
#define     <link linkend="G-TYPE-BOXED-CAPS">G_TYPE_BOXED</link>
#define     <link linkend="G-TYPE-PARAM-CAPS">G_TYPE_PARAM</link>
#define     <link linkend="G-TYPE-OBJECT-CAPS">G_TYPE_OBJECT</link>

#define     <link linkend="G-TYPE-RESERVED-GLIB-FIRST-CAPS">G_TYPE_RESERVED_GLIB_FIRST</link>
#define     <link linkend="G-TYPE-RESERVED-GLIB-LAST-CAPS">G_TYPE_RESERVED_GLIB_LAST</link>
#define     <link linkend="G-TYPE-RESERVED-BSE-FIRST-CAPS">G_TYPE_RESERVED_BSE_FIRST</link>
#define     <link linkend="G-TYPE-RESERVED-BSE-LAST-CAPS">G_TYPE_RESERVED_BSE_LAST</link>
#define     <link linkend="G-TYPE-RESERVED-USER-FIRST-CAPS">G_TYPE_RESERVED_USER_FIRST</link>

</synopsis>
</refsynopsisdiv>





<refsect1>
<title>Description</title>
<para>
The GType API is the foundation of the GObject system.  It provides the
facilities for registering and managing all fundamental data types,
user-defined object and interface types.  Before using any GType
or GObject functions, <link linkend="g-type-init">g_type_init</link>() must be called to initialize the
type system.
</para>
<para>
For type creation and registration purposes, all types fall into one of
two categories: static or dynamic.  Static types are never loaded or
unloaded at run-time as dynamic types may be.  Static types are created
with <link linkend="g-type-register-static">g_type_register_static</link>() that gets type specific information passed
in via a <link linkend="GTypeInfo">GTypeInfo</link> structure.
Dynamic types are created with <link linkend="g-type-register-dynamic">g_type_register_dynamic</link>() which takes a
<link linkend="GTypePlugin">GTypePlugin</link> structure instead. The remaining type information (the
<link linkend="GTypeInfo">GTypeInfo</link> structure) is retrieved during runtime through <link linkend="GTypePlugin">GTypePlugin</link>
and the g_type_plugin_*() API.
These registration functions are usually called only once from a 
function whose only purpose is to return the type identifier for a 
specific class.  Once the type (or class or interface) is registered,
it may be instantiated, inherited, or implemented depending on exactly
what sort of type it is.
There is also a third registration function for registering fundamental
types called <link linkend="g-type-register-fundamental">g_type_register_fundamental</link>() which requires both a <link linkend="GTypeInfo">GTypeInfo</link>
structure and a GTypeFundamentalInfo structure but it is seldom used
since most fundamental types are predefined rather than user-defined.
</para>
</refsect1>

<refsect1>
<title>Details</title>
<refsect2>
<title><anchor id="GType">GType</title>
<para>
A numerical value which represents the unique identifier of a registered
type.
</para></refsect2>
<refsect2>
<title><anchor id="G-TYPE-FUNDAMENTAL-CAPS">G_TYPE_FUNDAMENTAL()</title>
<programlisting>#define G_TYPE_FUNDAMENTAL(type)	(g_type_fundamental (type))
</programlisting>
<para>
Returns <literal>TRUE</literal> if <parameter>type</parameter> is a fundamental data type such as <link linkend="G-TYPE-INT-CAPS">G_TYPE_INT</link> or
<link linkend="G-TYPE-POINTER-CAPS">G_TYPE_POINTER</link>. Fundamental types are types that serve as fundaments for
the derived types, thus they are the roots of distinct inheritance hierarchies.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>type</parameter>&nbsp;:</entry>
<entry>A <link linkend="GType">GType</link> value.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="G-TYPE-FUNDAMENTAL-MAX-CAPS">G_TYPE_FUNDAMENTAL_MAX</title>
<programlisting>#define	G_TYPE_FUNDAMENTAL_MAX		(255 &lt;&lt; G_TYPE_FUNDAMENTAL_SHIFT)
</programlisting>
<para>
An integer constant that represents the number of identifiers reserved
for types that are assigned at compile-time.
</para></refsect2>
<refsect2>
<title><anchor id="G-TYPE-MAKE-FUNDAMENTAL-CAPS">G_TYPE_MAKE_FUNDAMENTAL()</title>
<programlisting>#define	G_TYPE_MAKE_FUNDAMENTAL(x)	((GType) ((x) &lt;&lt; G_TYPE_FUNDAMENTAL_SHIFT))
</programlisting>
<para>
Returns the type ID for the fundamental type number <parameter>x</parameter>.
Use <link linkend="g-type-fundamental-next">g_type_fundamental_next</link>() instead of this macro to create new fundamental 
types.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>x</parameter>&nbsp;:</entry>
<entry>the fundamental type number.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="G-TYPE-IS-ABSTRACT-CAPS">G_TYPE_IS_ABSTRACT()</title>
<programlisting>#define G_TYPE_IS_ABSTRACT(type)                (g_type_test_flags ((type), G_TYPE_FLAG_ABSTRACT))
</programlisting>
<para>
Returns <literal>TRUE</literal> if <parameter>type</parameter> is an abstract type.  An abstract type can not be
instantiated and is normally used as an abstract base class for
derived classes.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>type</parameter>&nbsp;:</entry>
<entry>A <link linkend="GType">GType</link> value.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="G-TYPE-IS-DERIVED-CAPS">G_TYPE_IS_DERIVED()</title>
<programlisting>#define G_TYPE_IS_DERIVED(type)                 ((type) &gt; G_TYPE_FUNDAMENTAL_MAX)
</programlisting>
<para>
Returns <literal>TRUE</literal> if <parameter>type</parameter> is derived (or in object-oriented terminology:
inherited) from another type (this holds true for all non-fundamental
types).
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>type</parameter>&nbsp;:</entry>
<entry>A <link linkend="GType">GType</link> value.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="G-TYPE-IS-FUNDAMENTAL-CAPS">G_TYPE_IS_FUNDAMENTAL()</title>
<programlisting>#define G_TYPE_IS_FUNDAMENTAL(type)             ((type) &lt;= G_TYPE_FUNDAMENTAL_MAX)
</programlisting>
<para>
Returns <literal>TRUE</literal> if <parameter>type</parameter> is a fundamental type.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>type</parameter>&nbsp;:</entry>
<entry>A <link linkend="GType">GType</link> value.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="G-TYPE-IS-VALUE-TYPE-CAPS">G_TYPE_IS_VALUE_TYPE()</title>
<programlisting>#define G_TYPE_IS_VALUE_TYPE(type)              (g_type_check_is_value_type (type))
</programlisting>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>type</parameter>&nbsp;:</entry>
<entry>A <link linkend="GType">GType</link> value.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="G-TYPE-HAS-VALUE-TABLE-CAPS">G_TYPE_HAS_VALUE_TABLE()</title>
<programlisting>#define G_TYPE_HAS_VALUE_TABLE(type)            (g_type_value_table_peek (type) != NULL)
</programlisting>
<para>
Returns <literal>TRUE</literal> if <parameter>type</parameter> has a <link linkend="GTypeValueTable">GTypeValueTable</link>.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>type</parameter>&nbsp;:</entry>
<entry>A <link linkend="GType">GType</link> value.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="G-TYPE-IS-CLASSED-CAPS">G_TYPE_IS_CLASSED()</title>
<programlisting>#define G_TYPE_IS_CLASSED(type)                 (g_type_test_flags ((type), G_TYPE_FLAG_CLASSED))
</programlisting>
<para>
Returns <literal>TRUE</literal> if <parameter>type</parameter> is a classed type.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>type</parameter>&nbsp;:</entry>
<entry>A <link linkend="GType">GType</link> value.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="G-TYPE-IS-INSTANTIATABLE-CAPS">G_TYPE_IS_INSTANTIATABLE()</title>
<programlisting>#define G_TYPE_IS_INSTANTIATABLE(type)          (g_type_test_flags ((type), G_TYPE_FLAG_INSTANTIATABLE))
</programlisting>
<para>
Returns <literal>TRUE</literal> if <parameter>type</parameter> can be instantiated.  Instantiation is the
process of creating an instance (object) of this type.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>type</parameter>&nbsp;:</entry>
<entry>A <link linkend="GType">GType</link> value.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="G-TYPE-IS-DERIVABLE-CAPS">G_TYPE_IS_DERIVABLE()</title>
<programlisting>#define G_TYPE_IS_DERIVABLE(type)               (g_type_test_flags ((type), G_TYPE_FLAG_DERIVABLE))
</programlisting>
<para>
Returns <literal>TRUE</literal> if <parameter>type</parameter> is a derivable type.  A derivable type can
be used as the base class of a flat (single-level) class hierarchy.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>type</parameter>&nbsp;:</entry>
<entry>A <link linkend="GType">GType</link> value.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="G-TYPE-IS-DEEP-DERIVABLE-CAPS">G_TYPE_IS_DEEP_DERIVABLE()</title>
<programlisting>#define G_TYPE_IS_DEEP_DERIVABLE(type)          (g_type_test_flags ((type), G_TYPE_FLAG_DEEP_DERIVABLE))
</programlisting>
<para>
Returns <literal>TRUE</literal> if <parameter>type</parameter> is a deep derivable type.  A deep derivable type
can be used as the base class of a deep (multi-level) class hierarchy.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>type</parameter>&nbsp;:</entry>
<entry>A <link linkend="GType">GType</link> value.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="G-TYPE-IS-INTERFACE-CAPS">G_TYPE_IS_INTERFACE()</title>
<programlisting>#define G_TYPE_IS_INTERFACE(type)               (G_TYPE_FUNDAMENTAL (type) == G_TYPE_INTERFACE)
</programlisting>
<para>
Returns <literal>TRUE</literal> if <parameter>type</parameter> is an interface type.
Interface types are types that provide pure APIs, the implementation
of which is provided by another type (which is then said to conform
to the interface).  GLib interfaces are somewhat analogous to Java
interfaces and C++ classes containing only pure virtual functions, 
with the difference that GType interfaces are not derivable (but see
<link linkend="g-type-interface-add-prerequisite">g_type_interface_add_prerequisite</link>() for an alternative).
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>type</parameter>&nbsp;:</entry>
<entry>A <link linkend="GType">GType</link> value.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="GTypeInterface">struct GTypeInterface</title>
<programlisting>struct GTypeInterface
{
  /*&lt; private &gt;*/
  GType g_type;         /* iface type */
  GType g_instance_type;
};
</programlisting>
<para>
An opaque structure used as the base of all interface types.
</para></refsect2>
<refsect2>
<title><anchor id="GTypeInstance">struct GTypeInstance</title>
<programlisting>struct GTypeInstance
{
  /*&lt; private &gt;*/
  GTypeClass *g_class;
};
</programlisting>
<para>
An opaque structure used as the base of all type instances.
</para></refsect2>
<refsect2>
<title><anchor id="GTypeInfo">struct GTypeInfo</title>
<programlisting>struct GTypeInfo
{
  /* interface types, classed types, instantiated types */
  guint16                class_size;
  
  GBaseInitFunc          base_init;
  GBaseFinalizeFunc      base_finalize;
  
  /* classed types, instantiated types */
  GClassInitFunc         class_init;
  GClassFinalizeFunc     class_finalize;
  gconstpointer          class_data;
  
  /* instantiated types */
  guint16                instance_size;
  guint16                n_preallocs;
  GInstanceInitFunc      instance_init;
  
  /* value handling */
  const GTypeValueTable	*value_table;
};
</programlisting>
<para>
This structure is used to provide the type system with the information
required to initialize and destruct (finalize) a type's class and
instances thereof.
The initialized structure is passed to the <link linkend="g-type-register-static">g_type_register_static</link>() function
(or is copied into the provided <link linkend="GTypeInfo">GTypeInfo</link> structure in the
<link linkend="g-type-plugin-complete-type-info">g_type_plugin_complete_type_info</link>()). The type system will perform a deep
copy of this structure, so it's memory does not need to be persistent
across invocation of <link linkend="g-type-register-static">g_type_register_static</link>().
</para><informaltable pgwide="1" frame="none" role="struct">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row>
<entry><link linkend="guint16">guint16</link> <structfield>class_size</structfield></entry>
<entry>	 Size of the class structure (required for interface, classed and instantiatable types).
</entry>
</row>
<row>
<entry><link linkend="GBaseInitFunc">GBaseInitFunc</link> <structfield>base_init</structfield></entry>
<entry>	 Location of the base initialization function (optional).
</entry>
</row>
<row>
<entry><link linkend="GBaseFinalizeFunc">GBaseFinalizeFunc</link> <structfield>base_finalize</structfield></entry>
<entry> Location of the base finalization function (optional).
</entry>
</row>
<row>
<entry><link linkend="GClassInitFunc">GClassInitFunc</link> <structfield>class_init</structfield></entry>
<entry>	 Location of the class initialization function (optional, for classed and instantiatable types only).
</entry>
</row>
<row>
<entry><link linkend="GClassFinalizeFunc">GClassFinalizeFunc</link> <structfield>class_finalize</structfield></entry>
<entry>Location of the class finalization function (optional).
</entry>
</row>
<row>
<entry><link linkend="gconstpointer">gconstpointer</link> <structfield>class_data</structfield></entry>
<entry>	 User-supplied data passed to the class init/finalize functions.
</entry>
</row>
<row>
<entry><link linkend="guint16">guint16</link> <structfield>instance_size</structfield></entry>
<entry> Size of the instance (object) structure (required for instantiatable types only).
</entry>
</row>
<row>
<entry><link linkend="guint16">guint16</link> <structfield>n_preallocs</structfield></entry>
<entry>	 Number of pre-allocated (cached) instances to reserve memory for (0 indicates no caching).
</entry>
</row>
<row>
<entry><link linkend="GInstanceInitFunc">GInstanceInitFunc</link> <structfield>instance_init</structfield></entry>
<entry> Location of the instance initialization function (optional, for instantiatable types only).
</entry>
</row>
<row>
<entry>const <link linkend="GTypeValueTable">GTypeValueTable</link> *<structfield>value_table</structfield></entry>
<entry>	 A <link linkend="GTypeValueTable">GTypeValueTable</link> function table for generic handling of GValues of this type (usually only
		 useful for fundamental types).

</entry>
</row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="GTypeFundamentalInfo">struct GTypeFundamentalInfo</title>
<programlisting>struct GTypeFundamentalInfo
{
  GTypeFundamentalFlags  type_flags;
};
</programlisting>
<para>
A structure that provides information to the type system which is
used specifically for managing fundamental types.  
</para></refsect2>
<refsect2>
<title><anchor id="GInterfaceInfo">struct GInterfaceInfo</title>
<programlisting>struct GInterfaceInfo
{
  GInterfaceInitFunc     interface_init;
  GInterfaceFinalizeFunc interface_finalize;
  gpointer               interface_data;
};
</programlisting>
<para>
A structure that provides information to the type system which is
used specifically for managing interface types.
</para><informaltable pgwide="1" frame="none" role="struct">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row>
<entry><link linkend="GInterfaceInitFunc">GInterfaceInitFunc</link> <structfield>interface_init</structfield></entry>
<entry>	Location of the function that initializes the interface.
</entry>
</row>
<row>
<entry><link linkend="GInterfaceFinalizeFunc">GInterfaceFinalizeFunc</link> <structfield>interface_finalize</structfield></entry>
<entry>	Location of the function that finalizes the interface.
</entry>
</row>
<row>
<entry><link linkend="gpointer">gpointer</link> <structfield>interface_data</structfield></entry>
<entry>	Location of user data passed to the <parameter>interface_init</parameter> and
	 		<parameter>interface_finalize</parameter> functions (optional).

</entry>
</row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="GTypeValueTable">struct GTypeValueTable</title>
<programlisting>struct GTypeValueTable
{
  void     (*value_init)         (GValue       *value);
  void     (*value_free)         (GValue       *value);
  void     (*value_copy)         (const GValue *src_value,
				  GValue       *dest_value);
  /* varargs functionality (optional) */
  gpointer (*value_peek_pointer) (const GValue *value);
  gchar	    *collect_format;
  gchar*   (*collect_value)      (GValue       *value,
				  guint         n_collect_values,
				  GTypeCValue  *collect_values,
				  guint		collect_flags);
  gchar	    *lcopy_format;
  gchar*   (*lcopy_value)        (const GValue *value,
				  guint         n_collect_values,
				  GTypeCValue  *collect_values,
				  guint		collect_flags);
};
</programlisting>
<para>
The <link linkend="GTypeValueTable">GTypeValueTable</link> provides the functions required by the <link linkend="GValue">GValue</link> implementation,
to serve as a container for values of a type.
</para><informaltable pgwide="1" frame="none" role="struct">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row>
<entry>void (*<structfield>value_init</structfield>) (GValue       *value)</entry>
<entry>		Default initialize <parameter>values</parameter> contents by poking values
			directly into the value-&gt;data array. The data array of
			the <link linkend="GValue">GValue</link> passed into this function was zero-filled
			with <function><link linkend="memset">memset</link>()</function>, so no care has to
                        be taken to free any
			old contents. E.g. for the implementation of a string
			value that may never be <literal>NULL</literal>, the implementation might
			look like:
<msgtext><programlisting>
{
  value-&gt;data[0].v_pointer = g_strdup ("");
}
</programlisting></msgtext>
</entry>
</row>
<row>
<entry>void (*<structfield>value_free</structfield>) (GValue       *value)</entry>
<entry>		Free any old contents that might be left in the
			data array of the passed in <parameter>value</parameter>. No resources may
			remain allocated through the <link linkend="GValue">GValue</link> contents after
			this function returns. E.g. for our above string type:
<msgtext><programlisting>
{
  /* only free strings without a specific flag for static storage */
  if (!(value-&gt;data[1].v_uint & G_VALUE_NOCOPY_CONTENTS))
    g_free (value-&gt;data[0].v_pointer);
}
</programlisting></msgtext>
</entry>
</row>
<row>
<entry>void (*<structfield>value_copy</structfield>) (const GValue *src_value,
				  GValue       *dest_value)</entry>
<entry>		<parameter>dest_value</parameter> is a <link linkend="GValue">GValue</link> with zero-filled data section
			and <parameter>src_value</parameter> is a properly setup <link linkend="GValue">GValue</link> of same or
			derived type.
			The purpose of this function is to copy the contents of
			<parameter>src_value</parameter> into <parameter>dest_value</parameter> in a way, that even after
			<parameter>src_value</parameter> has been freed, the contents of <parameter>dest_value</parameter>
			remain valid. String type example:
<msgtext><programlisting>
{
  dest_value-&gt;data[0].v_pointer = g_strdup (src_value-&gt;data[0].v_pointer);
}
</programlisting></msgtext>
</entry>
</row>
<row>
<entry><link linkend="gpointer">gpointer</link> (*<structfield>value_peek_pointer</structfield>) (const GValue *value)</entry>
<entry>	If the value contents fit into a pointer, such as objects
			or strings, return this pointer, so the caller can peek at
			the current contents. To extend on our above string example:
<msgtext><programlisting>
{
  return value-&gt;data[0].v_pointer;
}
</programlisting></msgtext>
</entry>
</row>
<row>
<entry><link linkend="gchar">gchar</link> *<structfield>collect_format</structfield></entry>
<entry>	A string format describing how to collect the contents of
			this value, bit-by-bit. Each character in the format represents
			an argument to be collected, the characters themselves indicate
			the type of the argument. Currently supported arguments are:
<msgtext><variablelist>
  <varlistentry><term></term><listitem><para>
        'i' - Integers. passed as collect_values[].v_int.
  </para></listitem></varlistentry>
  <varlistentry><term></term><listitem><para>
        'l' - Longs. passed as collect_values[].v_long.
  </para></listitem></varlistentry>
  <varlistentry><term></term><listitem><para>
        'd' - Doubles. passed as collect_values[].v_double.
  </para></listitem></varlistentry>
  <varlistentry><term></term><listitem><para>
        'p' - Pointers. passed as collect_values[].v_pointer.
  </para></listitem></varlistentry>
</variablelist></msgtext>
			It should be noted, that for variable argument list construction,
			ANSI C promotes every type smaller than an integer to an int, and
			floats to doubles. So for collection of short int or char, 'i'
			needs to be used, and for collection of floats 'd'.
</entry>
</row>
<row>
<entry><link linkend="gchar">gchar</link>* (*<structfield>collect_value</structfield>) (GValue       *value,
				  guint         n_collect_values,
				  GTypeCValue  *collect_values,
				  guint		collect_flags)</entry>
<entry>	The <link linkend="collect-value">collect_value</link>() function is responsible for converting the
			values collected from a variable argument list into contents
			suitable for storage in a GValue. This function should setup
			<parameter>value</parameter> similar to <link linkend="value-init">value_init</link>(), e.g. for a string value that
			does not allow <literal>NULL</literal> pointers, it needs to either spew an error,
			or do an implicit conversion by storing an empty string.
			The <parameter>value</parameter> passed in to this function has a zero-filled data
			array, so just like for <link linkend="value-init">value_init</link>() it is guaranteed to not
			contain any old contents that might need freeing.
			<parameter>n_collect_values</parameter> is exactly the string length of <parameter>collect_format</parameter>,
			and <parameter>collect_values</parameter> is an array of unions <link linkend="GTypeCValue">GTypeCValue</link> with
			length <parameter>n_collect_values</parameter>, containing the collected values
			according to <parameter>collect_format</parameter>.
			<parameter>collect_flags</parameter> is an argument provided as a hint by the caller,
			which may contain the flag <link linkend="G-VALUE-NOCOPY-CONTENTS-CAPS">G_VALUE_NOCOPY_CONTENTS</link> indicating,
			that the collected value contents may be considered "static"
			for the duration of the <parameter>value</parameter> lifetime.
			Thus an extra copy of the contents stored in <parameter>collect_values</parameter> is
			not required for assignment to <parameter>value</parameter>.
			For our above string example, we continue with:
<msgtext><programlisting>
{
  if (!collect_values[0].v_pointer)
    value->data[0].v_pointer = g_strdup ("");
  else if (collect_flags & G_VALUE_NOCOPY_CONTENTS)
    {
      value-&gt;data[0].v_pointer = collect_values[0].v_pointer;
      /* keep a flag for the <link linkend="value-free">value_free</link>() implementation to not free this string */
      value-&gt;data[1].v_uint = G_VALUE_NOCOPY_CONTENTS;
    }
  else
    value-&gt;data[0].v_pointer = g_strdup (collect_values[0].v_pointer);

  return NULL;
}
</programlisting></msgtext>
			It should be noted, that it is generally a bad idea to follow the
			<link linkend="G-VALUE-NOCOPY-CONTENTS-CAPS">G_VALUE_NOCOPY_CONTENTS</link> hint for reference counted types. Due to
			reentrancy requirements and reference count assertions performed
			by the <link linkend="GSignal">GSignal</link> code, reference counts should always be incremented
			for reference counted contents stored in the value-&gt;data array.
			To deviate from our string example for a moment, and taking a look
			at an exemplary implementation for <link linkend="collect-value">collect_value</link>() of <link linkend="GObject">GObject</link>:
<msgtext><programlisting>
{
  if (collect_values[0].v_pointer)
    {
      GObject *object = G_OBJECT (collect_values[0].v_pointer);

      /* never honour G_VALUE_NOCOPY_CONTENTS for ref-counted types */
      value-&gt;data[0].v_pointer = g_object_ref (object);
      return NULL;
    }
  else
    return g_strdup_printf ("Object passed as invalid NULL pointer");
}
</programlisting></msgtext>
			The reference count for valid objects is always incremented,
			regardless of <parameter>collect_flags</parameter>. For invalid objects, the example
			returns a newly allocated string without altering <parameter>value</parameter>.
			Upon success, <link linkend="collect-value">collect_value</link>() needs to return <literal>NULL</literal>, if however
			a malicious condition occurred, <link linkend="collect-value">collect_value</link>() may spew an
			error by returning a newly allocated non-<literal>NULL</literal> string, giving
			a suitable description of the error condition.
			The calling code makes no assumptions about the <parameter>value</parameter>
			contents being valid upon error returns, <parameter>value</parameter>
			is simply thrown away without further freeing. As such, it is
			a good idea to not allocate <link linkend="GValue">GValue</link> contents, prior to returning
			an error, however, <link linkend="collect-values">collect_values</link>() is not obliged to return
			a correctly setup <parameter>value</parameter> for error returns, simply because
			any non-<literal>NULL</literal> return is considered a fatal condition so further
			program behaviour is undefined.
</entry>
</row>
<row>
<entry><link linkend="gchar">gchar</link> *<structfield>lcopy_format</structfield></entry>
<entry>		Format description of the arguments to collect for <parameter>lcopy_value</parameter>,
			analogous to <parameter>collect_format</parameter>. Usually, <parameter>lcopy_format</parameter> string consists
			only of 'p's to provide <link linkend="lcopy-value">lcopy_value</link>() with pointers to storage locations.
</entry>
</row>
<row>
<entry><link linkend="gchar">gchar</link>* (*<structfield>lcopy_value</structfield>) (const GValue *value,
				  guint         n_collect_values,
				  GTypeCValue  *collect_values,
				  guint		collect_flags)</entry>
<entry>		This function is responsible for storing the <parameter>value</parameter> contents into
			arguments passed through a variable argument list which got
			collected into <parameter>collect_values</parameter> according to <parameter>lcopy_format</parameter>.
			<parameter>n_collect_values</parameter> equals the string length of <parameter>lcopy_format</parameter>,
			and <parameter>collect_flags</parameter> may contain <link linkend="G-VALUE-NOCOPY-CONTENTS-CAPS">G_VALUE_NOCOPY_CONTENTS</link>.
			In contrast to <link linkend="collect-value">collect_value</link>(), <link linkend="lcopy-value">lcopy_value</link>() is obliged to
			always properly support <link linkend="G-VALUE-NOCOPY-CONTENTS-CAPS">G_VALUE_NOCOPY_CONTENTS</link>.
			Similar to <link linkend="collect-value">collect_value</link>() the function may prematurely abort
			by returning a newly allocated string describing an error condition.
			To complete the string example:
<msgtext><programlisting>
{
  gchar **string_p = collect_values[0].v_pointer;

  if (!string_p)
    return g_strdup_printf ("string location passed as NULL");

  if (collect_flags & G_VALUE_NOCOPY_CONTENTS)
    *string_p = value-&gt;data[0].v_pointer;
  else
    *string_p = g_strdup (value-&gt;data[0].v_pointer);

}
</programlisting></msgtext>
			And an exemplary version of <link linkend="lcopy-value">lcopy_value</link>() for
			reference-counted types:
<msgtext><programlisting>
{
  GObject **object_p = collect_values[0].v_pointer;

  if (!object_p)
    return g_strdup_printf ("object location passed as NULL");
  if (!value-&gt;data[0].v_pointer)
    *object_p = NULL;
  else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) /* always honour */
    *object_p = value-&gt;data[0].v_pointer;
  else
    *object_p = g_object_ref (value-&gt;data[0].v_pointer);
  return NULL;
}
</programlisting></msgtext>

</entry>
</row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="G-TYPE-FROM-INSTANCE-CAPS">G_TYPE_FROM_INSTANCE()</title>
<programlisting>#define G_TYPE_FROM_INSTANCE(instance)                          (G_TYPE_FROM_CLASS (((GTypeInstance*) (instance))-&gt;g_class))
</programlisting>
<para>
Returns the type identifier from a given <parameter>instance</parameter> structure.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>instance</parameter>&nbsp;:</entry>
<entry>Location of a valid <link linkend="GTypeInstance">GTypeInstance</link> structure.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="G-TYPE-FROM-CLASS-CAPS">G_TYPE_FROM_CLASS()</title>
<programlisting>#define G_TYPE_FROM_CLASS(g_class)                              (((GTypeClass*) (g_class))-&gt;g_type)
</programlisting>
<para>
Returns the type identifier from a given <parameter>class</parameter> structure.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>g_class</parameter>&nbsp;:</entry>
<entry>Location of a valid <link linkend="GTypeClass">GTypeClass</link> structure.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="G-TYPE-FROM-INTERFACE-CAPS">G_TYPE_FROM_INTERFACE()</title>
<programlisting>#define G_TYPE_FROM_INTERFACE(g_iface)                          (((GTypeInterface*) (g_iface))-&gt;g_type)
</programlisting>
<para>
Returns the type identifier from a given <parameter>interface</parameter> structure.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>g_iface</parameter>&nbsp;:</entry>
<entry>Location of a valid <link linkend="GTypeInterface">GTypeInterface</link> structure.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="G-TYPE-INSTANCE-GET-CLASS-CAPS">G_TYPE_INSTANCE_GET_CLASS()</title>
<programlisting>#define G_TYPE_INSTANCE_GET_CLASS(instance, g_type, c_type)     (_G_TYPE_IGC ((instance), (g_type), c_type))
</programlisting>
<para>
Returns the class structure of a given <parameter>instance</parameter>, casted
to a specified anchestor type <parameter>g_type</parameter> of the instance.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>instance</parameter>&nbsp;:</entry>
<entry>	Location of the <link linkend="GTypeInstance">GTypeInstance</link> structure.
</entry></row>
<row><entry align="right"><parameter>g_type</parameter>&nbsp;:</entry>
<entry>	The anchestor type of the class to be returned.
</entry></row>
<row><entry align="right"><parameter>c_type</parameter>&nbsp;:</entry>
<entry>	The corresponding C type of <parameter>g_Type</parameter>.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="G-TYPE-INSTANCE-GET-INTERFACE-CAPS">G_TYPE_INSTANCE_GET_INTERFACE()</title>
<programlisting>#define G_TYPE_INSTANCE_GET_INTERFACE(instance, g_type, c_type) (_G_TYPE_IGI ((instance), (g_type), c_type))
</programlisting>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>instance</parameter>&nbsp;:</entry>
<entry>
</entry></row>
<row><entry align="right"><parameter>g_type</parameter>&nbsp;:</entry>
<entry>
</entry></row>
<row><entry align="right"><parameter>c_type</parameter>&nbsp;:</entry>
<entry>


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="G-TYPE-CHECK-INSTANCE-CAPS">G_TYPE_CHECK_INSTANCE()</title>
<programlisting>#define G_TYPE_CHECK_INSTANCE(instance)				(_G_TYPE_CHI ((GTypeInstance*) (instance)))
</programlisting>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>instance</parameter>&nbsp;:</entry>
<entry>


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="G-TYPE-CHECK-INSTANCE-CAST-CAPS">G_TYPE_CHECK_INSTANCE_CAST()</title>
<programlisting>#define G_TYPE_CHECK_INSTANCE_CAST(instance, g_type, c_type)    (_G_TYPE_CIC ((instance), (g_type), c_type))
</programlisting>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>instance</parameter>&nbsp;:</entry>
<entry>
</entry></row>
<row><entry align="right"><parameter>g_type</parameter>&nbsp;:</entry>
<entry>
</entry></row>
<row><entry align="right"><parameter>c_type</parameter>&nbsp;:</entry>
<entry>


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="G-TYPE-CHECK-INSTANCE-TYPE-CAPS">G_TYPE_CHECK_INSTANCE_TYPE()</title>
<programlisting>#define G_TYPE_CHECK_INSTANCE_TYPE(instance, g_type)            (_G_TYPE_CIT ((instance), (g_type)))
</programlisting>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>instance</parameter>&nbsp;:</entry>
<entry>
</entry></row>
<row><entry align="right"><parameter>g_type</parameter>&nbsp;:</entry>
<entry>


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="G-TYPE-CHECK-CLASS-CAST-CAPS">G_TYPE_CHECK_CLASS_CAST()</title>
<programlisting>#define G_TYPE_CHECK_CLASS_CAST(g_class, g_type, c_type)        (_G_TYPE_CCC ((g_class), (g_type), c_type))
</programlisting>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>g_class</parameter>&nbsp;:</entry>
<entry>
</entry></row>
<row><entry align="right"><parameter>g_type</parameter>&nbsp;:</entry>
<entry>
</entry></row>
<row><entry align="right"><parameter>c_type</parameter>&nbsp;:</entry>
<entry>


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="G-TYPE-CHECK-CLASS-TYPE-CAPS">G_TYPE_CHECK_CLASS_TYPE()</title>
<programlisting>#define G_TYPE_CHECK_CLASS_TYPE(g_class, g_type)                (_G_TYPE_CCT ((g_class), (g_type)))
</programlisting>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>g_class</parameter>&nbsp;:</entry>
<entry>
</entry></row>
<row><entry align="right"><parameter>g_type</parameter>&nbsp;:</entry>
<entry>


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="G-TYPE-CHECK-VALUE-CAPS">G_TYPE_CHECK_VALUE()</title>
<programlisting>#define G_TYPE_CHECK_VALUE(value)				(_G_TYPE_CHV ((value)))
</programlisting>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>value</parameter>&nbsp;:</entry>
<entry>


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="G-TYPE-CHECK-VALUE-TYPE-CAPS">G_TYPE_CHECK_VALUE_TYPE()</title>
<programlisting>#define G_TYPE_CHECK_VALUE_TYPE(value, g_type)			(_G_TYPE_CVH ((value), (g_type)))
</programlisting>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>value</parameter>&nbsp;:</entry>
<entry>
</entry></row>
<row><entry align="right"><parameter>g_type</parameter>&nbsp;:</entry>
<entry>


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="G-TYPE-FLAG-RESERVED-ID-BIT-CAPS">G_TYPE_FLAG_RESERVED_ID_BIT</title>
<programlisting>#define	G_TYPE_FLAG_RESERVED_ID_BIT	((GType) (1 &lt;&lt; 0))
</programlisting>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="g-type-init">g_type_init ()</title>
<programlisting>void        g_type_init                     (void);</programlisting>
<para>
Prior to any use of the type system, <link linkend="g-type-init">g_type_init</link>() has to be called to initialize
the type system and assorted other code portions (such as the various fundamental
type implementations or the signal system).
</para></refsect2>
<refsect2>
<title><anchor id="GTypeDebugFlags">enum GTypeDebugFlags</title>
<programlisting>typedef enum	/*&lt; skip &gt;*/
{
  G_TYPE_DEBUG_NONE	= 0,
  G_TYPE_DEBUG_OBJECTS	= 1 &lt;&lt; 0,
  G_TYPE_DEBUG_SIGNALS	= 1 &lt;&lt; 1,
  G_TYPE_DEBUG_MASK	= 0x03
} GTypeDebugFlags;
</programlisting>
<para>
The <type>GTypeDebugFlags</type> enumeration values can be passed to
<link linkend="g-type-init-with-debug-flags">g_type_init_with_debug_flags</link>() to trigger debugging messages during runtime.
Note that the messages can also be triggered by setting the
<envar>GOBJECT_DEBUG</envar> environment variable to a ':'-separated list of 
"objects" and "signals".

</para><informaltable pgwide="1" frame="none" role="enum">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row>
<entry><literal>G_TYPE_DEBUG_NONE</literal></entry>
<entry>Print no messages.
</entry>
</row>
<row>
<entry><literal>G_TYPE_DEBUG_OBJECTS</literal></entry>
<entry>Print messages about object bookkeeping.
</entry>
</row>
<row>
<entry><literal>G_TYPE_DEBUG_SIGNALS</literal></entry>
<entry>Print messages about signal emissions.
</entry>
</row>
<row>
<entry><literal>G_TYPE_DEBUG_MASK</literal></entry>
<entry>

</entry>
</row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-type-init-with-debug-flags">g_type_init_with_debug_flags ()</title>
<programlisting>void        g_type_init_with_debug_flags    (<link linkend="GTypeDebugFlags">GTypeDebugFlags</link> debug_flags);</programlisting>
<para>
Similar to <link linkend="g-type-init">g_type_init</link>(), but additionally sets debug flags.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>debug_flags</parameter>&nbsp;:</entry>
<entry>Bitwise combination of <link linkend="GTypeDebugFlags">GTypeDebugFlags</link> values for debugging purposes.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-type-name">g_type_name ()</title>
<programlisting>G_CONST_RETURN <link linkend="gchar">gchar</link>* g_type_name           (<link linkend="GType">GType</link> type);</programlisting>
<para>
Return the unique name that is assigned to a type ID (this is the preferred method
to find out whether a specific type has been registered for the passed in ID yet).
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>type</parameter>&nbsp;:</entry>
<entry>		Type to return name for.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>	Static type name or <literal>NULL</literal>.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-type-qname">g_type_qname ()</title>
<programlisting><link linkend="GQuark">GQuark</link>      g_type_qname                    (<link linkend="GType">GType</link> type);</programlisting>
<para>
Return the corresponding quark of the type IDs name.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>type</parameter>&nbsp;:</entry>
<entry>   Type to return quark of type name for.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>The type names quark or 0.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-type-from-name">g_type_from_name ()</title>
<programlisting><link linkend="GType">GType</link>       g_type_from_name                (const <link linkend="gchar">gchar</link> *name);</programlisting>
<para>
Lookup the type ID from a given type name, returns 0 if no type has been registered under this name
(this is the preferred method to find out by name whether a specific type has been registered yet).
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>name</parameter>&nbsp;:</entry>
<entry>   Type name to lookup.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>Corresponding type ID or 0.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-type-parent">g_type_parent ()</title>
<programlisting><link linkend="GType">GType</link>       g_type_parent                   (<link linkend="GType">GType</link> type);</programlisting>
<para>
Return the direct parent type of the passed in type.
If the passed in type has no parent, i.e. is a fundamental type, 0 is returned.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>type</parameter>&nbsp;:</entry>
<entry>   The derived type.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>The parent type.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-type-depth">g_type_depth ()</title>
<programlisting><link linkend="guint">guint</link>       g_type_depth                    (<link linkend="GType">GType</link> type);</programlisting>
<para>
Returns the length of the ancestry of the passed in type. This includes the
type itself, so that e.g. a fundamental type has depth 1.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>type</parameter>&nbsp;:</entry>
<entry>   A <link linkend="GType">GType</link> value.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>The depth of <parameter>type</parameter>.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-type-next-base">g_type_next_base ()</title>
<programlisting><link linkend="GType">GType</link>       g_type_next_base                (<link linkend="GType">GType</link> leaf_type,
                                             <link linkend="GType">GType</link> root_type);</programlisting>
<para>
Given a <parameter>leaf_type</parameter> and a <parameter>root_type</parameter> which is contained in its anchestry, return
the type that <parameter>root_type</parameter> is the immediate parent of.
In other words, this function determines the type that is derived directly from
<parameter>root_type</parameter> which is also a base class of <parameter>leaf_type</parameter>.  Given a root type and a
leaf type, this function can be used to determine the types and order in which
the leaf type is descended from the root type.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>leaf_type</parameter>&nbsp;:</entry>
<entry>	Descendant of <parameter>root_type</parameter> and the type to be returned.
</entry></row>
<row><entry align="right"><parameter>root_type</parameter>&nbsp;:</entry>
<entry>	Immediate parent of the returned type.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>	Immediate child of <parameter>root_type</parameter> and anchestor of <parameter>leaf_type</parameter>.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-type-is-a">g_type_is_a ()</title>
<programlisting><link linkend="gboolean">gboolean</link>    g_type_is_a                     (<link linkend="GType">GType</link> type,
                                             <link linkend="GType">GType</link> is_a_type);</programlisting>
<para>
If <parameter>is_a_type</parameter> is a derivable type, check whether <parameter>type</parameter> is a descendant of <parameter>is_a_type</parameter>.
If <parameter>is_a_type</parameter> is an interface, check whether <parameter>type</parameter> conforms to it.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>type</parameter>&nbsp;:</entry>
<entry>     Type to check anchestry for.
</entry></row>
<row><entry align="right"><parameter>is_a_type</parameter>&nbsp;:</entry>
<entry>Possible anchestor of <parameter>type</parameter> or interface <parameter>type</parameter> could conform to.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>  <literal>TRUE</literal> if <parameter>type</parameter> is_a <parameter>is_a_type</parameter> holds true.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-type-class-ref">g_type_class_ref ()</title>
<programlisting><link linkend="gpointer">gpointer</link>    g_type_class_ref                (<link linkend="GType">GType</link> type);</programlisting>
<para>
Increments the reference count of the class structure belonging to
<parameter>type</parameter>. This function will demand-create the class if it doesn't
exist already.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>type</parameter>&nbsp;:</entry>
<entry>	  Type ID of a classed type.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>The <link linkend="GTypeClass">GTypeClass</link> structure for the given type ID.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-type-class-peek">g_type_class_peek ()</title>
<programlisting><link linkend="gpointer">gpointer</link>    g_type_class_peek               (<link linkend="GType">GType</link> type);</programlisting>
<para>
This function is essentially the same as <link linkend="g-type-class-ref">g_type_class_ref</link>(), except that
the classes reference count isn't incremented. Therefore, this function
may return <literal>NULL</literal> if the class of the type passed in does not currently
exist (hasn't been referenced before).
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>type</parameter>&nbsp;:</entry>
<entry>		Type ID of a classed type.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>	The <link linkend="GTypeClass">GTypeClass</link> structure for the given type ID or <literal>NULL</literal>
		if the class does not currently exist.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-type-class-unref">g_type_class_unref ()</title>
<programlisting>void        g_type_class_unref              (<link linkend="gpointer">gpointer</link> g_class);</programlisting>
<para>
Decrements the reference count of the class structure being passed in.
Once the last reference count of a class has been released, classes
may be finalized by the type system, so further dereferencing of a
class pointer after <link linkend="g-type-class-unref">g_type_class_unref</link>() are invalid.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>g_class</parameter>&nbsp;:</entry>
<entry>	The <link linkend="GTypeClass">GTypeClass</link> structure to unreference.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-type-class-peek-parent">g_type_class_peek_parent ()</title>
<programlisting><link linkend="gpointer">gpointer</link>    g_type_class_peek_parent        (<link linkend="gpointer">gpointer</link> g_class);</programlisting>
<para>
This is a convenience function, often needed in class initializers.
It essentially takes the immediate parent type of the class passed in,
and returns the class structure thereof. Since derived classes hold
a reference count on their parent classes as long as they are instantiated,
the returned class will always exist. This function is essentially
equivalent to:

<msgtext><programlisting>
g_type_class_peek (g_type_parent (G_TYPE_FROM_CLASS (g_class)));
</programlisting></msgtext>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>g_class</parameter>&nbsp;:</entry>
<entry>The <link linkend="GTypeClass">GTypeClass</link> structure to retrieve the parent class for.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>The parent class of <parameter>g_class</parameter>.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-type-interface-peek">g_type_interface_peek ()</title>
<programlisting><link linkend="gpointer">gpointer</link>    g_type_interface_peek           (<link linkend="gpointer">gpointer</link> instance_class,
                                             <link linkend="GType">GType</link> iface_type);</programlisting>
<para>
Returns the <link linkend="GTypeInterface">GTypeInterface</link> structure of an interface to which the passed in 
class conforms.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>instance_class</parameter>&nbsp;:</entry>
<entry>A <link linkend="GTypeClass">GTypeClass</link> structure.
</entry></row>
<row><entry align="right"><parameter>iface_type</parameter>&nbsp;:</entry>
<entry>    An interface ID which this class conforms to.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>       The <link linkend="GTypeInterface">GTypeInterface</link> structure of <parameter>iface_type</parameter>, or <literal>NULL</literal> if the
                 class is not instantiated.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-type-interface-peek-parent">g_type_interface_peek_parent ()</title>
<programlisting><link linkend="gpointer">gpointer</link>    g_type_interface_peek_parent    (<link linkend="gpointer">gpointer</link> g_iface);</programlisting>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>g_iface</parameter>&nbsp;:</entry>
<entry>
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-type-children">g_type_children ()</title>
<programlisting><link linkend="GType">GType</link>*      g_type_children                 (<link linkend="GType">GType</link> type,
                                             <link linkend="guint">guint</link> *n_children);</programlisting>
<para>
Return a newly allocated and 0-terminated array of type IDs, listing the
child types of <parameter>type</parameter>. The return value has to be <link linkend="g-free">g_free</link>()ed after use.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>type</parameter>&nbsp;:</entry>
<entry>      The parent type.
</entry></row>
<row><entry align="right"><parameter>n_children</parameter>&nbsp;:</entry>
<entry>Optional <link linkend="guint">guint</link> pointer to contain the number of child types.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>   Newly allocated and 0-terminated array of child types.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-type-interfaces">g_type_interfaces ()</title>
<programlisting><link linkend="GType">GType</link>*      g_type_interfaces               (<link linkend="GType">GType</link> type,
                                             <link linkend="guint">guint</link> *n_interfaces);</programlisting>
<para>
Return a newly allocated and 0-terminated array of type IDs, listing the
interface types that <parameter>type</parameter> conforms to. The return value has to be
<link linkend="g-free">g_free</link>()ed after use.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>type</parameter>&nbsp;:</entry>
<entry>        The type to list interface types for.
</entry></row>
<row><entry align="right"><parameter>n_interfaces</parameter>&nbsp;:</entry>
<entry>Optional <link linkend="guint">guint</link> pointer to contain the number of interface types.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>     Newly allocated and 0-terminated array of interface types.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-type-set-qdata">g_type_set_qdata ()</title>
<programlisting>void        g_type_set_qdata                (<link linkend="GType">GType</link> type,
                                             <link linkend="GQuark">GQuark</link> quark,
                                             <link linkend="gpointer">gpointer</link> data);</programlisting>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>type</parameter>&nbsp;:</entry>
<entry>
</entry></row>
<row><entry align="right"><parameter>quark</parameter>&nbsp;:</entry>
<entry>
</entry></row>
<row><entry align="right"><parameter>data</parameter>&nbsp;:</entry>
<entry>


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-type-get-qdata">g_type_get_qdata ()</title>
<programlisting><link linkend="gpointer">gpointer</link>    g_type_get_qdata                (<link linkend="GType">GType</link> type,
                                             <link linkend="GQuark">GQuark</link> quark);</programlisting>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>type</parameter>&nbsp;:</entry>
<entry>
</entry></row>
<row><entry align="right"><parameter>quark</parameter>&nbsp;:</entry>
<entry>
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-type-query">g_type_query ()</title>
<programlisting>void        g_type_query                    (<link linkend="GType">GType</link> type,
                                             <link linkend="GTypeQuery">GTypeQuery</link> *query);</programlisting>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>type</parameter>&nbsp;:</entry>
<entry>
</entry></row>
<row><entry align="right"><parameter>query</parameter>&nbsp;:</entry>
<entry>


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="GTypeQuery">struct GTypeQuery</title>
<programlisting>struct GTypeQuery
{
  GType		type;
  const gchar  *type_name;
  guint		class_size;
  guint		instance_size;
};
</programlisting>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="GBaseInitFunc">GBaseInitFunc ()</title>
<programlisting>void        (*GBaseInitFunc)                (<link linkend="gpointer">gpointer</link> g_class);</programlisting>
<para>
A callback function used by the type system to do base initialization
of the class structures of derived types. It is called as part of the
initialization process of all derived classes and should reallocate
or reset all dynamic class members copied over from the parent class.
Therefore class members, e.g. strings, that are not sufficiently
handled by a plain memory copy of the parent class into the derived class
have to be altered. See <link linkend="GClassInitFunc">GClassInitFunc</link>() for a discussion of the class
intialization process.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>g_class</parameter>&nbsp;:</entry>
<entry>The <link linkend="GTypeClass">GTypeClass</link> structure to initialize.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="GBaseFinalizeFunc">GBaseFinalizeFunc ()</title>
<programlisting>void        (*GBaseFinalizeFunc)            (<link linkend="gpointer">gpointer</link> g_class);</programlisting>
<para>
A callback function used by the type system to finalize those portions
of a derived types class structure that were setup from the corresponding
<link linkend="GBaseInitFunc">GBaseInitFunc</link>() function. Class finalization basically works the inverse
way in which class intialization is performed.
See <link linkend="GClassInitFunc">GClassInitFunc</link>() for a discussion of the class intialization process.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>g_class</parameter>&nbsp;:</entry>
<entry>The <link linkend="GTypeClass">GTypeClass</link> structure to finalize.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="GClassInitFunc">GClassInitFunc ()</title>
<programlisting>void        (*GClassInitFunc)               (<link linkend="gpointer">gpointer</link> g_class,
                                             <link linkend="gpointer">gpointer</link> class_data);</programlisting>
<para>
A callback function used by the type system to initialize the class
of a specific type. This function should initialize all static class
members.
The initialization process of a class involves:
<variablelist>
  <varlistentry><term></term><listitem><para>
	1 - Copying common members from the parent class over to the
	derived class structure.
  </para></listitem></varlistentry>
  <varlistentry><term></term><listitem><para>
	2 -  Zero initialization of the remaining members not copied
	over from the parent class.
  </para></listitem></varlistentry>
  <varlistentry><term></term><listitem><para>
	3 - Invocation of the <link linkend="GBaseInitFunc">GBaseInitFunc</link>() initializers of all parent
	types and the class' type.
  </para></listitem></varlistentry>
  <varlistentry><term></term><listitem><para>
	4 - Invocation of the class' <link linkend="GClassInitFunc">GClassInitFunc</link>() initializer.
  </para></listitem></varlistentry>
</variablelist>
Since derived classes are partially initialized through a memory copy
of the parent class, the general rule is that <link linkend="GBaseInitFunc">GBaseInitFunc</link>() and
<link linkend="GBaseFinalizeFunc">GBaseFinalizeFunc</link>() should take care of necessary reinitialization
and release of those class members that were introduced by the type
that specified these <link linkend="GBaseInitFunc">GBaseInitFunc</link>()/<link linkend="GBaseFinalizeFunc">GBaseFinalizeFunc</link>().
<link linkend="GClassInitFunc">GClassInitFunc</link>() should only care about initializing static
class members, while dynamic class members (such as allocated strings
or reference counted resources) are better handled by a <link linkend="GBaseInitFunc">GBaseInitFunc</link>()
for this type, so proper initialization of the dynamic class members
is performed for class initialization of derived types as well.
An example may help to correspond the intend of the different class
initializers:

<msgtext><programlisting>
typedef struct {
  GObjectClass parent_class;
  gint         static_integer;
  gchar       *dynamic_string;
} TypeAClass;
static void
type_a_base_class_init (TypeAClass *class)
{
  class->dynamic_string = g_strdup ("some string");
}
static void
type_a_base_class_finalize (TypeAClass *class)
{
  g_free (class->dynamic_string);
}
static void
type_a_class_init (TypeAClass *class)
{
  class->static_integer = 42;
}

typedef struct {
  TypeAClass   parent_class;
  gfloat       static_float;
  GString     *dynamic_gstring;
} TypeBClass;
static void
type_b_base_class_init (TypeBClass *class)
{
  class->dynamic_gstring = g_string_new ("some other string");
}
static void
type_b_base_class_finalize (TypeBClass *class)
{
  g_string_free (class->dynamic_gstring);
}
static void
type_b_class_init (TypeBClass *class)
{
  class->static_float = 3.14159265358979323846;
}
</programlisting></msgtext>
Initialization of TypeBClass will first cause initialization of
TypeAClass (derived classes reference their parent classes, see
<link linkend="g-type-class-ref">g_type_class_ref</link>() on this).
Initialization of TypeAClass roughly involves zero-initializing its fields,
then calling its <link linkend="GBaseInitFunc">GBaseInitFunc</link>() <link linkend="type-a-base-class-init">type_a_base_class_init</link>() that allocates
its dynamic members (dynamic_string) and finally calling its <link linkend="GClassInitFunc">GClassInitFunc</link>()
<link linkend="type-a-class-init">type_a_class_init</link>() to initialize its static members (static_integer).
The first step in the initialization process of TypeBClass is then
a plain memory copy of the contents of TypeAClass into TypeBClass and 
zero-initialization of the remaining fields in TypeBClass.
The dynamic members of TypeAClass within TypeBClass now need
reinitialization which is performed by calling <link linkend="type-a-base-class-init">type_a_base_class_init</link>()
with an argument of TypeBClass.
After that, the <link linkend="GBaseInitFunc">GBaseInitFunc</link>() of TypeBClass, <link linkend="type-b-base-class-init">type_b_base_class_init</link>()
is called to allocate the dynamic members of TypeBClass (dynamic_gstring),
and finally the <link linkend="GClassInitFunc">GClassInitFunc</link>() of TypeBClass, <link linkend="type-b-class-init">type_b_class_init</link>(),
is called to complete the initialization process with the static members
(static_float).
Corresponding finalization counter parts to the <link linkend="GBaseInitFunc">GBaseInitFunc</link>() functions
have to be provided to release allocated resources at class finalization
time.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>g_class</parameter>&nbsp;:</entry>
<entry>	The <link linkend="GTypeClass">GTypeClass</link> structure to initialize.
</entry></row>
<row><entry align="right"><parameter>class_data</parameter>&nbsp;:</entry>
<entry>	The <parameter>class_data</parameter> member supplied via the <link linkend="GTypeInfo">GTypeInfo</link> structure.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="GClassFinalizeFunc">GClassFinalizeFunc ()</title>
<programlisting>void        (*GClassFinalizeFunc)           (<link linkend="gpointer">gpointer</link> g_class,
                                             <link linkend="gpointer">gpointer</link> class_data);</programlisting>
<para>
A callback function used by the type system to finalize a class.
This function is rarely needed, as dynamically allocated class resources
should be handled by <link linkend="GBaseInitFunc">GBaseInitFunc</link>() and <link linkend="GBaseFinalizeFunc">GBaseFinalizeFunc</link>().
Also, specification of a <link linkend="GClassFinalizeFunc">GClassFinalizeFunc</link>() in the <link linkend="GTypeInfo">GTypeInfo</link>
structure of a static type is invalid, because classes of static types
will never be finalized (they are artificially kept alive when their
reference count drops to zero).
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>g_class</parameter>&nbsp;:</entry>
<entry>	The <link linkend="GTypeClass">GTypeClass</link> structure to finalize.
</entry></row>
<row><entry align="right"><parameter>class_data</parameter>&nbsp;:</entry>
<entry>	The <parameter>class_data</parameter> member supplied via the <link linkend="GTypeInfo">GTypeInfo</link> structure.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="GInstanceInitFunc">GInstanceInitFunc ()</title>
<programlisting>void        (*GInstanceInitFunc)            (<link linkend="GTypeInstance">GTypeInstance</link> *instance,
                                             <link linkend="gpointer">gpointer</link> g_class);</programlisting>
<para>
A callback function used by the type system to initialize a new
instance of a type. This function initializes all instance members and
allocates any resources required by it.
Initialization of a derived instance involves calling all its parent
types instance initializers, therefore the class member of the instance
is altered during its initialization to always point to the class that
belongs to the type the current initializer was introduced for.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>instance</parameter>&nbsp;:</entry>
<entry>	The instance to initialize.
</entry></row>
<row><entry align="right"><parameter>g_class</parameter>&nbsp;:</entry>
<entry>	The class of the type the instance is created for.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="GInterfaceInitFunc">GInterfaceInitFunc ()</title>
<programlisting>void        (*GInterfaceInitFunc)           (<link linkend="gpointer">gpointer</link> g_iface,
                                             <link linkend="gpointer">gpointer</link> iface_data);</programlisting>
<para>
A callback function used by the type system to initialize a new
interface.  This function should initialize all internal data and
allocate any resources required by the interface.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>g_iface</parameter>&nbsp;:</entry>
<entry>	The interface structure to initialize.
</entry></row>
<row><entry align="right"><parameter>iface_data</parameter>&nbsp;:</entry>
<entry>	The <parameter>class_data</parameter> supplied via the <link linkend="GTypeInfo">GTypeInfo</link> structure.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="GInterfaceFinalizeFunc">GInterfaceFinalizeFunc ()</title>
<programlisting>void        (*GInterfaceFinalizeFunc)       (<link linkend="gpointer">gpointer</link> g_iface,
                                             <link linkend="gpointer">gpointer</link> iface_data);</programlisting>
<para>
A callback function used by the type system to finalize an interface.
This function should destroy any internal data and release any resources
allocated by the corresponding <link linkend="GInterfaceInitFunc">GInterfaceInitFunc</link>() function.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>g_iface</parameter>&nbsp;:</entry>
<entry>	The interface structure to finalize.
</entry></row>
<row><entry align="right"><parameter>iface_data</parameter>&nbsp;:</entry>
<entry>	The <parameter>class_data</parameter> supplied via the <link linkend="GTypeInfo">GTypeInfo</link> structure.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="GTypeClassCacheFunc">GTypeClassCacheFunc ()</title>
<programlisting><link linkend="gboolean">gboolean</link>    (*GTypeClassCacheFunc)          (<link linkend="gpointer">gpointer</link> cache_data,
                                             <link linkend="GTypeClass">GTypeClass</link> *g_class);</programlisting>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>cache_data</parameter>&nbsp;:</entry>
<entry>
</entry></row>
<row><entry align="right"><parameter>g_class</parameter>&nbsp;:</entry>
<entry>
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="GTypeFlags">enum GTypeFlags</title>
<programlisting>typedef enum    /*&lt; skip &gt;*/
{
  G_TYPE_FLAG_ABSTRACT		= (1 &lt;&lt; 4),
  G_TYPE_FLAG_VALUE_ABSTRACT	= (1 &lt;&lt; 5)
} GTypeFlags;
</programlisting>
<para>
Bit masks used to check or determine characteristics of a type.
</para><informaltable pgwide="1" frame="none" role="enum">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row>
<entry><literal>G_TYPE_FLAG_ABSTRACT</literal></entry>
<entry>	Indicates an abstract type. No instances can be
			created for an abstract type.
</entry>
</row>
<row>
<entry><literal>G_TYPE_FLAG_VALUE_ABSTRACT</literal></entry>
<entry>

</entry>
</row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="GTypeFundamentalFlags">enum GTypeFundamentalFlags</title>
<programlisting>typedef enum    /*&lt; skip &gt;*/
{
  G_TYPE_FLAG_CLASSED           = (1 &lt;&lt; 0),
  G_TYPE_FLAG_INSTANTIATABLE    = (1 &lt;&lt; 1),
  G_TYPE_FLAG_DERIVABLE         = (1 &lt;&lt; 2),
  G_TYPE_FLAG_DEEP_DERIVABLE    = (1 &lt;&lt; 3)
} GTypeFundamentalFlags;
</programlisting>
<para>
Bit masks used to check or determine specific characteristics of a
fundamental type.
</para><informaltable pgwide="1" frame="none" role="enum">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row>
<entry><literal>G_TYPE_FLAG_CLASSED</literal></entry>
<entry>		Indicates a classed type.
</entry>
</row>
<row>
<entry><literal>G_TYPE_FLAG_INSTANTIATABLE</literal></entry>
<entry>	Indicates an instantiable type (implies classed).
</entry>
</row>
<row>
<entry><literal>G_TYPE_FLAG_DERIVABLE</literal></entry>
<entry>		Indicates a flat derivable type.
</entry>
</row>
<row>
<entry><literal>G_TYPE_FLAG_DEEP_DERIVABLE</literal></entry>
<entry>	Indicates a deep derivable type (implies derivable).

</entry>
</row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-type-register-static">g_type_register_static ()</title>
<programlisting><link linkend="GType">GType</link>       g_type_register_static          (<link linkend="GType">GType</link> parent_type,
                                             const <link linkend="gchar">gchar</link> *type_name,
                                             const <link linkend="GTypeInfo">GTypeInfo</link> *info,
                                             <link linkend="GTypeFlags">GTypeFlags</link> flags);</programlisting>
<para>
Registers <parameter>type_name</parameter> as the name of a new static type derived from
<parameter>parent_type</parameter>.  The type system uses the information contained in the
<link linkend="GTypeInfo">GTypeInfo</link> structure pointed to by <parameter>info</parameter> to manage the type and its
instances (if not abstract).  The value of <parameter>flags</parameter> determines the nature
(e.g. abstract or not) of the type.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>parent_type</parameter>&nbsp;:</entry>
<entry>	Type which this type will be derived from.
</entry></row>
<row><entry align="right"><parameter>type_name</parameter>&nbsp;:</entry>
<entry>	0-terminated string used as the name of the new type.
</entry></row>
<row><entry align="right"><parameter>info</parameter>&nbsp;:</entry>
<entry>		The <link linkend="GTypeInfo">GTypeInfo</link> structure for this type.
</entry></row>
<row><entry align="right"><parameter>flags</parameter>&nbsp;:</entry>
<entry>		Bitwise combination of <link linkend="GTypeFlags">GTypeFlags</link> values.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>	The new type identifier.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-type-register-dynamic">g_type_register_dynamic ()</title>
<programlisting><link linkend="GType">GType</link>       g_type_register_dynamic         (<link linkend="GType">GType</link> parent_type,
                                             const <link linkend="gchar">gchar</link> *type_name,
                                             <link linkend="GTypePlugin">GTypePlugin</link> *plugin,
                                             <link linkend="GTypeFlags">GTypeFlags</link> flags);</programlisting>
<para>
Registers <parameter>type_name</parameter> as the name of a new dynamic type derived from
<parameter>parent_type</parameter>.  The type system uses the information contained in the
<link linkend="GTypePlugin">GTypePlugin</link> structure pointed to by <parameter>plugin</parameter> to manage the type and its
instances (if not abstract).  The value of <parameter>flags</parameter> determines the nature
(e.g. abstract or not) of the type.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>parent_type</parameter>&nbsp;:</entry>
<entry>	Type which this type will be derived from.
</entry></row>
<row><entry align="right"><parameter>type_name</parameter>&nbsp;:</entry>
<entry>	0-terminated string used as the name of the new type.
</entry></row>
<row><entry align="right"><parameter>plugin</parameter>&nbsp;:</entry>
<entry>	The <link linkend="GTypePlugin">GTypePlugin</link> structure to retrieve the <link linkend="GTypeInfo">GTypeInfo</link> from.
</entry></row>
<row><entry align="right"><parameter>flags</parameter>&nbsp;:</entry>
<entry>		Bitwise combination of <link linkend="GTypeFlags">GTypeFlags</link> values.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>	The new type identifier or <link linkend="G-TYPE-INVALID-CAPS">G_TYPE_INVALID</link> if registration failed.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-type-register-fundamental">g_type_register_fundamental ()</title>
<programlisting><link linkend="GType">GType</link>       g_type_register_fundamental     (<link linkend="GType">GType</link> type_id,
                                             const <link linkend="gchar">gchar</link> *type_name,
                                             const <link linkend="GTypeInfo">GTypeInfo</link> *info,
                                             const <link linkend="GTypeFundamentalInfo">GTypeFundamentalInfo</link> *finfo,
                                             <link linkend="GTypeFlags">GTypeFlags</link> flags);</programlisting>
<para>
Registers <parameter>type_id</parameter> as the predefined identifier and <parameter>type_name</parameter> as the
name of a fundamental type.  The type system uses the information
contained in the <link linkend="GTypeInfo">GTypeInfo</link> structure pointed to by <parameter>info</parameter> and the 
<link linkend="GTypeFundamentalInfo">GTypeFundamentalInfo</link> structure pointed to by <parameter>finfo</parameter> to manage the
type and its instances.  The value of <parameter>flags</parameter> determines additional
characteristics of the fundamental type.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>type_id</parameter>&nbsp;:</entry>
<entry>	A predefined <link linkend="GTypeFundamentals">GTypeFundamentals</link> value.
</entry></row>
<row><entry align="right"><parameter>type_name</parameter>&nbsp;:</entry>
<entry>	0-terminated string used as the name of the new type.
</entry></row>
<row><entry align="right"><parameter>info</parameter>&nbsp;:</entry>
<entry>		The <link linkend="GTypeInfo">GTypeInfo</link> structure for this type.
</entry></row>
<row><entry align="right"><parameter>finfo</parameter>&nbsp;:</entry>
<entry>		The <link linkend="GTypeFundamentalInfo">GTypeFundamentalInfo</link> structure for this type.
</entry></row>
<row><entry align="right"><parameter>flags</parameter>&nbsp;:</entry>
<entry>		Bitwise combination of <link linkend="GTypeFlags">GTypeFlags</link> values.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>	The predefined type identifier.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-type-add-interface-static">g_type_add_interface_static ()</title>
<programlisting>void        g_type_add_interface_static     (<link linkend="GType">GType</link> instance_type,
                                             <link linkend="GType">GType</link> interface_type,
                                             const <link linkend="GInterfaceInfo">GInterfaceInfo</link> *info);</programlisting>
<para>
Adds the static <parameter>interface_type</parameter> to <parameter>instantiable_type</parameter>.  The information
contained in the <link linkend="GTypeInterfaceInfo">GTypeInterfaceInfo</link> structure pointed to by <parameter>info</parameter>
is used to manage the relationship.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>instance_type</parameter>&nbsp;:</entry>
<entry>	 <link linkend="GType">GType</link> value of an instantiable type.
</entry></row>
<row><entry align="right"><parameter>interface_type</parameter>&nbsp;:</entry>
<entry><link linkend="GType">GType</link> value of an interface type.
</entry></row>
<row><entry align="right"><parameter>info</parameter>&nbsp;:</entry>
<entry>		 The <link linkend="GInterfaceInfo">GInterfaceInfo</link> structure for this
		 (<parameter>instance_type</parameter>, <parameter>interface_type</parameter>) combination.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-type-add-interface-dynamic">g_type_add_interface_dynamic ()</title>
<programlisting>void        g_type_add_interface_dynamic    (<link linkend="GType">GType</link> instance_type,
                                             <link linkend="GType">GType</link> interface_type,
                                             <link linkend="GTypePlugin">GTypePlugin</link> *plugin);</programlisting>
<para>
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>instance_type</parameter>&nbsp;:</entry>
<entry>
</entry></row>
<row><entry align="right"><parameter>interface_type</parameter>&nbsp;:</entry>
<entry>
</entry></row>
<row><entry align="right"><parameter>plugin</parameter>&nbsp;:</entry>
<entry>


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-type-interface-add-prerequisite">g_type_interface_add_prerequisite ()</title>
<programlisting>void        g_type_interface_add_prerequisite
                                            (<link linkend="GType">GType</link> interface_type,
                                             <link linkend="GType">GType</link> prerequisite_type);</programlisting>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>interface_type</parameter>&nbsp;:</entry>
<entry>
</entry></row>
<row><entry align="right"><parameter>prerequisite_type</parameter>&nbsp;:</entry>
<entry>


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-type-get-plugin">g_type_get_plugin ()</title>
<programlisting><link linkend="GTypePlugin">GTypePlugin</link>* g_type_get_plugin              (<link linkend="GType">GType</link> type);</programlisting>
<para>
Returns the <link linkend="GTypePlugin">GTypePlugin</link> structure for <parameter>type</parameter> or
<literal>NULL</literal> if <parameter>type</parameter> does not have a <link linkend="GTypePlugin">GTypePlugin</link> structure.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>type</parameter>&nbsp;:</entry>
<entry>		The <link linkend="GType">GType</link> to retrieve the plugin for.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>	The corresponding plugin if <parameter>type</parameter> is a dynamic type,
		<literal>NULL</literal> otherwise.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-type-interface-get-plugin">g_type_interface_get_plugin ()</title>
<programlisting><link linkend="GTypePlugin">GTypePlugin</link>* g_type_interface_get_plugin    (<link linkend="GType">GType</link> instance_type,
                                             <link linkend="GType">GType</link> implementation_type);</programlisting>
<para>
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>instance_type</parameter>&nbsp;:</entry>
<entry>
</entry></row>
<row><entry align="right"><parameter>implementation_type</parameter>&nbsp;:</entry>
<entry>
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-type-fundamental-next">g_type_fundamental_next ()</title>
<programlisting><link linkend="GType">GType</link>       g_type_fundamental_next         (void);</programlisting>
<para>
Returns the next free fundamental type id which can be used to
register a new fundamental type with <link linkend="g-type-register-fundamental">g_type_register_fundamental</link>().
The returned type ID represents the highest currently registered
fundamental type identifier.

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>The nextmost fundamental type ID to be registered,
          or 0 if the type system ran out of fundamental type IDs.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-type-fundamental">g_type_fundamental ()</title>
<programlisting><link linkend="GType">GType</link>       g_type_fundamental              (<link linkend="GType">GType</link> type_id);</programlisting>
<para>
Internal function, used to extract the fundamental type ID portion.
use <link linkend="G-TYPE-FUNDAMENTAL-CAPS">G_TYPE_FUNDAMENTAL</link>() instead.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>type_id</parameter>&nbsp;:</entry>
<entry>valid type ID
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>fundamental type ID


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-type-create-instance">g_type_create_instance ()</title>
<programlisting><link linkend="GTypeInstance">GTypeInstance</link>* g_type_create_instance       (<link linkend="GType">GType</link> type);</programlisting>
<para>
Creates and initializes an instance of <parameter>type</parameter> if <parameter>type</parameter> is valid and can
be instantiated. The type system only performs basic allocation and
structure setups for instances, actual instance creation should happen
through functions supplied by the type's fundamental type implementation.
So use of <link linkend="g-type-create-instance">g_type_create_instance</link>() is reserved for implementators of
fundamental types only. E.g. instances of the <link linkend="GObject">GObject</link> hierarchy
should be created via <link linkend="g-object-new">g_object_new</link>() and <emphasis>never</emphasis>
directly through <link linkend="g-type-create-instance">g_type_create_instance</link>() which doesn't handle
things like singleton objects or object construction.
Note: Do <emphasis>not</emphasis> use this function, unless you're
implementing a fundamental type. Also language bindings should <emphasis>not</emphasis>
use this function but <link linkend="g-object-new">g_object_new</link>() instead.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>type</parameter>&nbsp;:</entry>
<entry>	  An instantiabtable type to create an instance for.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>An allocated and initialized instance, subject to further
	  treatment by the fundamental type implementation.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-type-free-instance">g_type_free_instance ()</title>
<programlisting>void        g_type_free_instance            (<link linkend="GTypeInstance">GTypeInstance</link> *instance);</programlisting>
<para>
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>instance</parameter>&nbsp;:</entry>
<entry>


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-type-add-class-cache-func">g_type_add_class_cache_func ()</title>
<programlisting>void        g_type_add_class_cache_func     (<link linkend="gpointer">gpointer</link> cache_data,
                                             <link linkend="GTypeClassCacheFunc">GTypeClassCacheFunc</link> cache_func);</programlisting>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>cache_data</parameter>&nbsp;:</entry>
<entry>
</entry></row>
<row><entry align="right"><parameter>cache_func</parameter>&nbsp;:</entry>
<entry>


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-type-remove-class-cache-func">g_type_remove_class_cache_func ()</title>
<programlisting>void        g_type_remove_class_cache_func  (<link linkend="gpointer">gpointer</link> cache_data,
                                             <link linkend="GTypeClassCacheFunc">GTypeClassCacheFunc</link> cache_func);</programlisting>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>cache_data</parameter>&nbsp;:</entry>
<entry>
</entry></row>
<row><entry align="right"><parameter>cache_func</parameter>&nbsp;:</entry>
<entry>


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-type-class-unref-uncached">g_type_class_unref_uncached ()</title>
<programlisting>void        g_type_class_unref_uncached     (<link linkend="gpointer">gpointer</link> g_class);</programlisting>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>g_class</parameter>&nbsp;:</entry>
<entry>


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-type-value-table-peek">g_type_value_table_peek ()</title>
<programlisting><link linkend="GTypeValueTable">GTypeValueTable</link>* g_type_value_table_peek    (<link linkend="GType">GType</link> type);</programlisting>
<para>
Returns the location of the <link linkend="GTypeValueTable">GTypeValueTable</link> associated with <parameter>type</parameter>.
<emphasis>Note, this function should only be used from source code
that implements or has internal knowledge of the implementation of
<parameter>type</parameter>.</emphasis>
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>type</parameter>&nbsp;:</entry>
<entry>   A <link linkend="GType">GType</link> value.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>Location of the <link linkend="GTypeValueTable">GTypeValueTable</link> associated with <parameter>type</parameter> or
          <literal>NULL</literal> if there is no <link linkend="GTypeValueTable">GTypeValueTable</link> associated with <parameter>type</parameter>.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="G-TYPE-INVALID-CAPS">G_TYPE_INVALID</title>
<programlisting>#define G_TYPE_INVALID			G_TYPE_MAKE_FUNDAMENTAL (0)
</programlisting>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="G-TYPE-NONE-CAPS">G_TYPE_NONE</title>
<programlisting>#define G_TYPE_NONE			G_TYPE_MAKE_FUNDAMENTAL (1)
</programlisting>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="G-TYPE-INTERFACE-CAPS">G_TYPE_INTERFACE</title>
<programlisting>#define G_TYPE_INTERFACE		G_TYPE_MAKE_FUNDAMENTAL (2)
</programlisting>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="G-TYPE-CHAR-CAPS">G_TYPE_CHAR</title>
<programlisting>#define G_TYPE_CHAR			G_TYPE_MAKE_FUNDAMENTAL (3)
</programlisting>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="G-TYPE-UCHAR-CAPS">G_TYPE_UCHAR</title>
<programlisting>#define G_TYPE_UCHAR			G_TYPE_MAKE_FUNDAMENTAL (4)
</programlisting>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="G-TYPE-BOOLEAN-CAPS">G_TYPE_BOOLEAN</title>
<programlisting>#define G_TYPE_BOOLEAN			G_TYPE_MAKE_FUNDAMENTAL (5)
</programlisting>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="G-TYPE-INT-CAPS">G_TYPE_INT</title>
<programlisting>#define G_TYPE_INT			G_TYPE_MAKE_FUNDAMENTAL (6)
</programlisting>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="G-TYPE-UINT-CAPS">G_TYPE_UINT</title>
<programlisting>#define G_TYPE_UINT			G_TYPE_MAKE_FUNDAMENTAL (7)
</programlisting>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="G-TYPE-LONG-CAPS">G_TYPE_LONG</title>
<programlisting>#define G_TYPE_LONG			G_TYPE_MAKE_FUNDAMENTAL (8)
</programlisting>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="G-TYPE-ULONG-CAPS">G_TYPE_ULONG</title>
<programlisting>#define G_TYPE_ULONG			G_TYPE_MAKE_FUNDAMENTAL (9)
</programlisting>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="G-TYPE-INT64-CAPS">G_TYPE_INT64</title>
<programlisting>#define G_TYPE_INT64			G_TYPE_MAKE_FUNDAMENTAL (10)
</programlisting>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="G-TYPE-UINT64-CAPS">G_TYPE_UINT64</title>
<programlisting>#define G_TYPE_UINT64			G_TYPE_MAKE_FUNDAMENTAL (11)
</programlisting>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="G-TYPE-ENUM-CAPS">G_TYPE_ENUM</title>
<programlisting>#define G_TYPE_ENUM			G_TYPE_MAKE_FUNDAMENTAL (12)
</programlisting>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="G-TYPE-FLAGS-CAPS">G_TYPE_FLAGS</title>
<programlisting>#define G_TYPE_FLAGS			G_TYPE_MAKE_FUNDAMENTAL (13)
</programlisting>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="G-TYPE-FLOAT-CAPS">G_TYPE_FLOAT</title>
<programlisting>#define G_TYPE_FLOAT			G_TYPE_MAKE_FUNDAMENTAL (14)
</programlisting>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="G-TYPE-DOUBLE-CAPS">G_TYPE_DOUBLE</title>
<programlisting>#define G_TYPE_DOUBLE			G_TYPE_MAKE_FUNDAMENTAL (15)
</programlisting>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="G-TYPE-STRING-CAPS">G_TYPE_STRING</title>
<programlisting>#define G_TYPE_STRING			G_TYPE_MAKE_FUNDAMENTAL (16)
</programlisting>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="G-TYPE-POINTER-CAPS">G_TYPE_POINTER</title>
<programlisting>#define G_TYPE_POINTER			G_TYPE_MAKE_FUNDAMENTAL (17)
</programlisting>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="G-TYPE-BOXED-CAPS">G_TYPE_BOXED</title>
<programlisting>#define G_TYPE_BOXED			G_TYPE_MAKE_FUNDAMENTAL (18)
</programlisting>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="G-TYPE-PARAM-CAPS">G_TYPE_PARAM</title>
<programlisting>#define G_TYPE_PARAM			G_TYPE_MAKE_FUNDAMENTAL (19)
</programlisting>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="G-TYPE-OBJECT-CAPS">G_TYPE_OBJECT</title>
<programlisting>#define G_TYPE_OBJECT			G_TYPE_MAKE_FUNDAMENTAL (20)
</programlisting>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="G-TYPE-RESERVED-GLIB-FIRST-CAPS">G_TYPE_RESERVED_GLIB_FIRST</title>
<programlisting>#define G_TYPE_RESERVED_GLIB_FIRST	(21)
</programlisting>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="G-TYPE-RESERVED-GLIB-LAST-CAPS">G_TYPE_RESERVED_GLIB_LAST</title>
<programlisting>#define G_TYPE_RESERVED_GLIB_LAST	(31)
</programlisting>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="G-TYPE-RESERVED-BSE-FIRST-CAPS">G_TYPE_RESERVED_BSE_FIRST</title>
<programlisting>#define G_TYPE_RESERVED_BSE_FIRST	(32)
</programlisting>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="G-TYPE-RESERVED-BSE-LAST-CAPS">G_TYPE_RESERVED_BSE_LAST</title>
<programlisting>#define G_TYPE_RESERVED_BSE_LAST	(48)
</programlisting>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="G-TYPE-RESERVED-USER-FIRST-CAPS">G_TYPE_RESERVED_USER_FIRST</title>
<programlisting>#define G_TYPE_RESERVED_USER_FIRST	(49)
</programlisting>
<para>

</para></refsect2>

</refsect1>




</refentry>
