Tizen 2.1 base
[platform/upstream/glib2.0.git] / docs / reference / gobject / html / gobject-Type-Information.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <title>Type Information</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
7 <link rel="home" href="index.html" title="GObject Reference Manual">
8 <link rel="up" href="rn01.html" title="API Reference">
9 <link rel="prev" href="rn01.html" title="API Reference">
10 <link rel="next" href="GTypePlugin.html" title="GTypePlugin">
11 <meta name="generator" content="GTK-Doc V1.18 (XML mode)">
12 <link rel="stylesheet" href="style.css" type="text/css">
13 </head>
14 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
16 <tr valign="middle">
17 <td><a accesskey="p" href="rn01.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
18 <td><a accesskey="u" href="rn01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
19 <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
20 <th width="100%" align="center">GObject Reference Manual</th>
21 <td><a accesskey="n" href="GTypePlugin.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
22 </tr>
23 <tr><td colspan="5" class="shortcuts">
24 <a href="#gobject-Type-Information.synopsis" class="shortcut">Top</a>
25                    | 
26                   <a href="#gobject-Type-Information.description" class="shortcut">Description</a>
27 </td></tr>
28 </table>
29 <div class="refentry">
30 <a name="gobject-Type-Information"></a><div class="titlepage"></div>
31 <div class="refnamediv"><table width="100%"><tr>
32 <td valign="top">
33 <h2><span class="refentrytitle"><a name="gobject-Type-Information.top_of_page"></a>Type Information</span></h2>
34 <p>Type Information — The GLib Runtime type identification and
35     management system</p>
36 </td>
37 <td valign="top" align="right"></td>
38 </tr></table></div>
39 <div class="refsynopsisdiv">
40 <a name="gobject-Type-Information.synopsis"></a><h2>Synopsis</h2>
41 <pre class="synopsis">
42 #include &lt;glib-object.h&gt;
43
44 typedef             <a class="link" href="gobject-Type-Information.html#GType" title="GType">GType</a>;
45 #define             <a class="link" href="gobject-Type-Information.html#G-TYPE-FUNDAMENTAL:CAPS" title="G_TYPE_FUNDAMENTAL()">G_TYPE_FUNDAMENTAL</a>                  (type)
46 #define             <a class="link" href="gobject-Type-Information.html#G-TYPE-FUNDAMENTAL-MAX:CAPS" title="G_TYPE_FUNDAMENTAL_MAX">G_TYPE_FUNDAMENTAL_MAX</a>
47 #define             <a class="link" href="gobject-Type-Information.html#G-TYPE-MAKE-FUNDAMENTAL:CAPS" title="G_TYPE_MAKE_FUNDAMENTAL()">G_TYPE_MAKE_FUNDAMENTAL</a>             (x)
48 #define             <a class="link" href="gobject-Type-Information.html#G-TYPE-IS-ABSTRACT:CAPS" title="G_TYPE_IS_ABSTRACT()">G_TYPE_IS_ABSTRACT</a>                  (type)
49 #define             <a class="link" href="gobject-Type-Information.html#G-TYPE-IS-DERIVED:CAPS" title="G_TYPE_IS_DERIVED()">G_TYPE_IS_DERIVED</a>                   (type)
50 #define             <a class="link" href="gobject-Type-Information.html#G-TYPE-IS-FUNDAMENTAL:CAPS" title="G_TYPE_IS_FUNDAMENTAL()">G_TYPE_IS_FUNDAMENTAL</a>               (type)
51 #define             <a class="link" href="gobject-Type-Information.html#G-TYPE-IS-VALUE-TYPE:CAPS" title="G_TYPE_IS_VALUE_TYPE()">G_TYPE_IS_VALUE_TYPE</a>                (type)
52 #define             <a class="link" href="gobject-Type-Information.html#G-TYPE-HAS-VALUE-TABLE:CAPS" title="G_TYPE_HAS_VALUE_TABLE()">G_TYPE_HAS_VALUE_TABLE</a>              (type)
53 #define             <a class="link" href="gobject-Type-Information.html#G-TYPE-IS-CLASSED:CAPS" title="G_TYPE_IS_CLASSED()">G_TYPE_IS_CLASSED</a>                   (type)
54 #define             <a class="link" href="gobject-Type-Information.html#G-TYPE-IS-INSTANTIATABLE:CAPS" title="G_TYPE_IS_INSTANTIATABLE()">G_TYPE_IS_INSTANTIATABLE</a>            (type)
55 #define             <a class="link" href="gobject-Type-Information.html#G-TYPE-IS-DERIVABLE:CAPS" title="G_TYPE_IS_DERIVABLE()">G_TYPE_IS_DERIVABLE</a>                 (type)
56 #define             <a class="link" href="gobject-Type-Information.html#G-TYPE-IS-DEEP-DERIVABLE:CAPS" title="G_TYPE_IS_DEEP_DERIVABLE()">G_TYPE_IS_DEEP_DERIVABLE</a>            (type)
57 #define             <a class="link" href="gobject-Type-Information.html#G-TYPE-IS-INTERFACE:CAPS" title="G_TYPE_IS_INTERFACE()">G_TYPE_IS_INTERFACE</a>                 (type)
58 struct              <a class="link" href="gobject-Type-Information.html#GTypeInterface" title="struct GTypeInterface">GTypeInterface</a>;
59 struct              <a class="link" href="gobject-Type-Information.html#GTypeInstance" title="struct GTypeInstance">GTypeInstance</a>;
60 struct              <a class="link" href="gobject-Type-Information.html#GTypeClass" title="struct GTypeClass">GTypeClass</a>;
61 struct              <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="struct GTypeInfo">GTypeInfo</a>;
62 struct              <a class="link" href="gobject-Type-Information.html#GTypeFundamentalInfo" title="struct GTypeFundamentalInfo">GTypeFundamentalInfo</a>;
63 struct              <a class="link" href="gobject-Type-Information.html#GInterfaceInfo" title="struct GInterfaceInfo">GInterfaceInfo</a>;
64 struct              <a class="link" href="gobject-Type-Information.html#GTypeValueTable" title="struct GTypeValueTable">GTypeValueTable</a>;
65 #define             <a class="link" href="gobject-Type-Information.html#G-TYPE-FROM-INSTANCE:CAPS" title="G_TYPE_FROM_INSTANCE()">G_TYPE_FROM_INSTANCE</a>                (instance)
66 #define             <a class="link" href="gobject-Type-Information.html#G-TYPE-FROM-CLASS:CAPS" title="G_TYPE_FROM_CLASS()">G_TYPE_FROM_CLASS</a>                   (g_class)
67 #define             <a class="link" href="gobject-Type-Information.html#G-TYPE-FROM-INTERFACE:CAPS" title="G_TYPE_FROM_INTERFACE()">G_TYPE_FROM_INTERFACE</a>               (g_iface)
68 #define             <a class="link" href="gobject-Type-Information.html#G-TYPE-INSTANCE-GET-CLASS:CAPS" title="G_TYPE_INSTANCE_GET_CLASS()">G_TYPE_INSTANCE_GET_CLASS</a>           (instance,
69                                                          g_type,
70                                                          c_type)
71 #define             <a class="link" href="gobject-Type-Information.html#G-TYPE-INSTANCE-GET-INTERFACE:CAPS" title="G_TYPE_INSTANCE_GET_INTERFACE()">G_TYPE_INSTANCE_GET_INTERFACE</a>       (instance,
72                                                          g_type,
73                                                          c_type)
74 #define             <a class="link" href="gobject-Type-Information.html#G-TYPE-INSTANCE-GET-PRIVATE:CAPS" title="G_TYPE_INSTANCE_GET_PRIVATE()">G_TYPE_INSTANCE_GET_PRIVATE</a>         (instance,
75                                                          g_type,
76                                                          c_type)
77 #define             <a class="link" href="gobject-Type-Information.html#G-TYPE-CLASS-GET-PRIVATE:CAPS" title="G_TYPE_CLASS_GET_PRIVATE()">G_TYPE_CLASS_GET_PRIVATE</a>            (klass,
78                                                          g_type,
79                                                          c_type)
80 #define             <a class="link" href="gobject-Type-Information.html#G-TYPE-CHECK-INSTANCE:CAPS" title="G_TYPE_CHECK_INSTANCE()">G_TYPE_CHECK_INSTANCE</a>               (instance)
81 #define             <a class="link" href="gobject-Type-Information.html#G-TYPE-CHECK-INSTANCE-CAST:CAPS" title="G_TYPE_CHECK_INSTANCE_CAST()">G_TYPE_CHECK_INSTANCE_CAST</a>          (instance,
82                                                          g_type,
83                                                          c_type)
84 #define             <a class="link" href="gobject-Type-Information.html#G-TYPE-CHECK-INSTANCE-TYPE:CAPS" title="G_TYPE_CHECK_INSTANCE_TYPE()">G_TYPE_CHECK_INSTANCE_TYPE</a>          (instance,
85                                                          g_type)
86 #define             <a class="link" href="gobject-Type-Information.html#G-TYPE-CHECK-CLASS-CAST:CAPS" title="G_TYPE_CHECK_CLASS_CAST()">G_TYPE_CHECK_CLASS_CAST</a>             (g_class,
87                                                          g_type,
88                                                          c_type)
89 #define             <a class="link" href="gobject-Type-Information.html#G-TYPE-CHECK-CLASS-TYPE:CAPS" title="G_TYPE_CHECK_CLASS_TYPE()">G_TYPE_CHECK_CLASS_TYPE</a>             (g_class,
90                                                          g_type)
91 #define             <a class="link" href="gobject-Type-Information.html#G-TYPE-CHECK-VALUE:CAPS" title="G_TYPE_CHECK_VALUE()">G_TYPE_CHECK_VALUE</a>                  (value)
92 #define             <a class="link" href="gobject-Type-Information.html#G-TYPE-CHECK-VALUE-TYPE:CAPS" title="G_TYPE_CHECK_VALUE_TYPE()">G_TYPE_CHECK_VALUE_TYPE</a>             (value,
93                                                          g_type)
94 #define             <a class="link" href="gobject-Type-Information.html#G-TYPE-FLAG-RESERVED-ID-BIT:CAPS" title="G_TYPE_FLAG_RESERVED_ID_BIT">G_TYPE_FLAG_RESERVED_ID_BIT</a>
95 <span class="returnvalue">void</span>                <a class="link" href="gobject-Type-Information.html#g-type-init" title="g_type_init ()">g_type_init</a>                         (<em class="parameter"><code><span class="type">void</span></code></em>);
96 enum                <a class="link" href="gobject-Type-Information.html#GTypeDebugFlags" title="enum GTypeDebugFlags">GTypeDebugFlags</a>;
97 <span class="returnvalue">void</span>                <a class="link" href="gobject-Type-Information.html#g-type-init-with-debug-flags" title="g_type_init_with_debug_flags ()">g_type_init_with_debug_flags</a>        (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GTypeDebugFlags" title="enum GTypeDebugFlags"><span class="type">GTypeDebugFlags</span></a> debug_flags</code></em>);
98 const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *       <a class="link" href="gobject-Type-Information.html#g-type-name" title="g_type_name ()">g_type_name</a>                         (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>);
99 <a href="./../glib/glib/glib-Quarks.html#GQuark"><span class="returnvalue">GQuark</span></a>              <a class="link" href="gobject-Type-Information.html#g-type-qname" title="g_type_qname ()">g_type_qname</a>                        (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>);
100 <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a>               <a class="link" href="gobject-Type-Information.html#g-type-from-name" title="g_type_from_name ()">g_type_from_name</a>                    (<em class="parameter"><code>const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *name</code></em>);
101 <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a>               <a class="link" href="gobject-Type-Information.html#g-type-parent" title="g_type_parent ()">g_type_parent</a>                       (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>);
102 <a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>               <a class="link" href="gobject-Type-Information.html#g-type-depth" title="g_type_depth ()">g_type_depth</a>                        (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>);
103 <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a>               <a class="link" href="gobject-Type-Information.html#g-type-next-base" title="g_type_next_base ()">g_type_next_base</a>                    (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> leaf_type</code></em>,
104                                                          <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> root_type</code></em>);
105 <a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="gobject-Type-Information.html#g-type-is-a" title="g_type_is_a ()">g_type_is_a</a>                         (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>,
106                                                          <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> is_a_type</code></em>);
107 <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a>            <a class="link" href="gobject-Type-Information.html#g-type-class-ref" title="g_type_class_ref ()">g_type_class_ref</a>                    (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>);
108 <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a>            <a class="link" href="gobject-Type-Information.html#g-type-class-peek" title="g_type_class_peek ()">g_type_class_peek</a>                   (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>);
109 <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a>            <a class="link" href="gobject-Type-Information.html#g-type-class-peek-static" title="g_type_class_peek_static ()">g_type_class_peek_static</a>            (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>);
110 <span class="returnvalue">void</span>                <a class="link" href="gobject-Type-Information.html#g-type-class-unref" title="g_type_class_unref ()">g_type_class_unref</a>                  (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> g_class</code></em>);
111 <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a>            <a class="link" href="gobject-Type-Information.html#g-type-class-peek-parent" title="g_type_class_peek_parent ()">g_type_class_peek_parent</a>            (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> g_class</code></em>);
112 <span class="returnvalue">void</span>                <a class="link" href="gobject-Type-Information.html#g-type-class-add-private" title="g_type_class_add_private ()">g_type_class_add_private</a>            (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> g_class</code></em>,
113                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> private_size</code></em>);
114 <span class="returnvalue">void</span>                <a class="link" href="gobject-Type-Information.html#g-type-add-class-private" title="g_type_add_class_private ()">g_type_add_class_private</a>            (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> class_type</code></em>,
115                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> private_size</code></em>);
116 <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a>            <a class="link" href="gobject-Type-Information.html#g-type-interface-peek" title="g_type_interface_peek ()">g_type_interface_peek</a>               (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> instance_class</code></em>,
117                                                          <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> iface_type</code></em>);
118 <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a>            <a class="link" href="gobject-Type-Information.html#g-type-interface-peek-parent" title="g_type_interface_peek_parent ()">g_type_interface_peek_parent</a>        (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> g_iface</code></em>);
119 <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a>            <a class="link" href="gobject-Type-Information.html#g-type-default-interface-ref" title="g_type_default_interface_ref ()">g_type_default_interface_ref</a>        (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> g_type</code></em>);
120 <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a>            <a class="link" href="gobject-Type-Information.html#g-type-default-interface-peek" title="g_type_default_interface_peek ()">g_type_default_interface_peek</a>       (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> g_type</code></em>);
121 <span class="returnvalue">void</span>                <a class="link" href="gobject-Type-Information.html#g-type-default-interface-unref" title="g_type_default_interface_unref ()">g_type_default_interface_unref</a>      (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> g_iface</code></em>);
122 <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a> *             <a class="link" href="gobject-Type-Information.html#g-type-children" title="g_type_children ()">g_type_children</a>                     (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>,
123                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> *n_children</code></em>);
124 <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a> *             <a class="link" href="gobject-Type-Information.html#g-type-interfaces" title="g_type_interfaces ()">g_type_interfaces</a>                   (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>,
125                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> *n_interfaces</code></em>);
126 <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a> *             <a class="link" href="gobject-Type-Information.html#g-type-interface-prerequisites" title="g_type_interface_prerequisites ()">g_type_interface_prerequisites</a>      (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> interface_type</code></em>,
127                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> *n_prerequisites</code></em>);
128 <span class="returnvalue">void</span>                <a class="link" href="gobject-Type-Information.html#g-type-set-qdata" title="g_type_set_qdata ()">g_type_set_qdata</a>                    (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>,
129                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> quark</code></em>,
130                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>);
131 <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a>            <a class="link" href="gobject-Type-Information.html#g-type-get-qdata" title="g_type_get_qdata ()">g_type_get_qdata</a>                    (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>,
132                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> quark</code></em>);
133 <span class="returnvalue">void</span>                <a class="link" href="gobject-Type-Information.html#g-type-query" title="g_type_query ()">g_type_query</a>                        (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>,
134                                                          <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GTypeQuery" title="struct GTypeQuery"><span class="type">GTypeQuery</span></a> *query</code></em>);
135 struct              <a class="link" href="gobject-Type-Information.html#GTypeQuery" title="struct GTypeQuery">GTypeQuery</a>;
136 <span class="returnvalue">void</span>                (<a class="link" href="gobject-Type-Information.html#GBaseInitFunc" title="GBaseInitFunc ()">*GBaseInitFunc</a>)                    (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> g_class</code></em>);
137 <span class="returnvalue">void</span>                (<a class="link" href="gobject-Type-Information.html#GBaseFinalizeFunc" title="GBaseFinalizeFunc ()">*GBaseFinalizeFunc</a>)                (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> g_class</code></em>);
138 <span class="returnvalue">void</span>                (<a class="link" href="gobject-Type-Information.html#GClassInitFunc" title="GClassInitFunc ()">*GClassInitFunc</a>)                   (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> g_class</code></em>,
139                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> class_data</code></em>);
140 <span class="returnvalue">void</span>                (<a class="link" href="gobject-Type-Information.html#GClassFinalizeFunc" title="GClassFinalizeFunc ()">*GClassFinalizeFunc</a>)               (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> g_class</code></em>,
141                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> class_data</code></em>);
142 <span class="returnvalue">void</span>                (<a class="link" href="gobject-Type-Information.html#GInstanceInitFunc" title="GInstanceInitFunc ()">*GInstanceInitFunc</a>)                (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GTypeInstance" title="struct GTypeInstance"><span class="type">GTypeInstance</span></a> *instance</code></em>,
143                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> g_class</code></em>);
144 <span class="returnvalue">void</span>                (<a class="link" href="gobject-Type-Information.html#GInterfaceInitFunc" title="GInterfaceInitFunc ()">*GInterfaceInitFunc</a>)               (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> g_iface</code></em>,
145                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> iface_data</code></em>);
146 <span class="returnvalue">void</span>                (<a class="link" href="gobject-Type-Information.html#GInterfaceFinalizeFunc" title="GInterfaceFinalizeFunc ()">*GInterfaceFinalizeFunc</a>)           (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> g_iface</code></em>,
147                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> iface_data</code></em>);
148 <a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            (<a class="link" href="gobject-Type-Information.html#GTypeClassCacheFunc" title="GTypeClassCacheFunc ()">*GTypeClassCacheFunc</a>)              (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> cache_data</code></em>,
149                                                          <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GTypeClass" title="struct GTypeClass"><span class="type">GTypeClass</span></a> *g_class</code></em>);
150 enum                <a class="link" href="gobject-Type-Information.html#GTypeFlags" title="enum GTypeFlags">GTypeFlags</a>;
151 enum                <a class="link" href="gobject-Type-Information.html#GTypeFundamentalFlags" title="enum GTypeFundamentalFlags">GTypeFundamentalFlags</a>;
152 <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a>               <a class="link" href="gobject-Type-Information.html#g-type-register-static" title="g_type_register_static ()">g_type_register_static</a>              (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> parent_type</code></em>,
153                                                          <em class="parameter"><code>const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *type_name</code></em>,
154                                                          <em class="parameter"><code>const <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="struct GTypeInfo"><span class="type">GTypeInfo</span></a> *info</code></em>,
155                                                          <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GTypeFlags" title="enum GTypeFlags"><span class="type">GTypeFlags</span></a> flags</code></em>);
156 <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a>               <a class="link" href="gobject-Type-Information.html#g-type-register-static-simple" title="g_type_register_static_simple ()">g_type_register_static_simple</a>       (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> parent_type</code></em>,
157                                                          <em class="parameter"><code>const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *type_name</code></em>,
158                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> class_size</code></em>,
159                                                          <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GClassInitFunc" title="GClassInitFunc ()"><span class="type">GClassInitFunc</span></a> class_init</code></em>,
160                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> instance_size</code></em>,
161                                                          <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GInstanceInitFunc" title="GInstanceInitFunc ()"><span class="type">GInstanceInitFunc</span></a> instance_init</code></em>,
162                                                          <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GTypeFlags" title="enum GTypeFlags"><span class="type">GTypeFlags</span></a> flags</code></em>);
163 <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a>               <a class="link" href="gobject-Type-Information.html#g-type-register-dynamic" title="g_type_register_dynamic ()">g_type_register_dynamic</a>             (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> parent_type</code></em>,
164                                                          <em class="parameter"><code>const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *type_name</code></em>,
165                                                          <em class="parameter"><code><a class="link" href="GTypePlugin.html" title="GTypePlugin"><span class="type">GTypePlugin</span></a> *plugin</code></em>,
166                                                          <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GTypeFlags" title="enum GTypeFlags"><span class="type">GTypeFlags</span></a> flags</code></em>);
167 <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a>               <a class="link" href="gobject-Type-Information.html#g-type-register-fundamental" title="g_type_register_fundamental ()">g_type_register_fundamental</a>         (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type_id</code></em>,
168                                                          <em class="parameter"><code>const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *type_name</code></em>,
169                                                          <em class="parameter"><code>const <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="struct GTypeInfo"><span class="type">GTypeInfo</span></a> *info</code></em>,
170                                                          <em class="parameter"><code>const <a class="link" href="gobject-Type-Information.html#GTypeFundamentalInfo" title="struct GTypeFundamentalInfo"><span class="type">GTypeFundamentalInfo</span></a> *finfo</code></em>,
171                                                          <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GTypeFlags" title="enum GTypeFlags"><span class="type">GTypeFlags</span></a> flags</code></em>);
172 <span class="returnvalue">void</span>                <a class="link" href="gobject-Type-Information.html#g-type-add-interface-static" title="g_type_add_interface_static ()">g_type_add_interface_static</a>         (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> instance_type</code></em>,
173                                                          <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> interface_type</code></em>,
174                                                          <em class="parameter"><code>const <a class="link" href="gobject-Type-Information.html#GInterfaceInfo" title="struct GInterfaceInfo"><span class="type">GInterfaceInfo</span></a> *info</code></em>);
175 <span class="returnvalue">void</span>                <a class="link" href="gobject-Type-Information.html#g-type-add-interface-dynamic" title="g_type_add_interface_dynamic ()">g_type_add_interface_dynamic</a>        (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> instance_type</code></em>,
176                                                          <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> interface_type</code></em>,
177                                                          <em class="parameter"><code><a class="link" href="GTypePlugin.html" title="GTypePlugin"><span class="type">GTypePlugin</span></a> *plugin</code></em>);
178 <span class="returnvalue">void</span>                <a class="link" href="gobject-Type-Information.html#g-type-interface-add-prerequisite" title="g_type_interface_add_prerequisite ()">g_type_interface_add_prerequisite</a>   (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> interface_type</code></em>,
179                                                          <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> prerequisite_type</code></em>);
180 <a class="link" href="GTypePlugin.html" title="GTypePlugin"><span class="returnvalue">GTypePlugin</span></a> *       <a class="link" href="gobject-Type-Information.html#g-type-get-plugin" title="g_type_get_plugin ()">g_type_get_plugin</a>                   (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>);
181 <a class="link" href="GTypePlugin.html" title="GTypePlugin"><span class="returnvalue">GTypePlugin</span></a> *       <a class="link" href="gobject-Type-Information.html#g-type-interface-get-plugin" title="g_type_interface_get_plugin ()">g_type_interface_get_plugin</a>         (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> instance_type</code></em>,
182                                                          <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> interface_type</code></em>);
183 <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a>               <a class="link" href="gobject-Type-Information.html#g-type-fundamental-next" title="g_type_fundamental_next ()">g_type_fundamental_next</a>             (<em class="parameter"><code><span class="type">void</span></code></em>);
184 <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a>               <a class="link" href="gobject-Type-Information.html#g-type-fundamental" title="g_type_fundamental ()">g_type_fundamental</a>                  (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type_id</code></em>);
185 <a class="link" href="gobject-Type-Information.html#GTypeInstance" title="struct GTypeInstance"><span class="returnvalue">GTypeInstance</span></a> *     <a class="link" href="gobject-Type-Information.html#g-type-create-instance" title="g_type_create_instance ()">g_type_create_instance</a>              (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>);
186 <span class="returnvalue">void</span>                <a class="link" href="gobject-Type-Information.html#g-type-free-instance" title="g_type_free_instance ()">g_type_free_instance</a>                (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GTypeInstance" title="struct GTypeInstance"><span class="type">GTypeInstance</span></a> *instance</code></em>);
187 <span class="returnvalue">void</span>                <a class="link" href="gobject-Type-Information.html#g-type-add-class-cache-func" title="g_type_add_class_cache_func ()">g_type_add_class_cache_func</a>         (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> cache_data</code></em>,
188                                                          <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GTypeClassCacheFunc" title="GTypeClassCacheFunc ()"><span class="type">GTypeClassCacheFunc</span></a> cache_func</code></em>);
189 <span class="returnvalue">void</span>                <a class="link" href="gobject-Type-Information.html#g-type-remove-class-cache-func" title="g_type_remove_class_cache_func ()">g_type_remove_class_cache_func</a>      (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> cache_data</code></em>,
190                                                          <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GTypeClassCacheFunc" title="GTypeClassCacheFunc ()"><span class="type">GTypeClassCacheFunc</span></a> cache_func</code></em>);
191 <span class="returnvalue">void</span>                <a class="link" href="gobject-Type-Information.html#g-type-class-unref-uncached" title="g_type_class_unref_uncached ()">g_type_class_unref_uncached</a>         (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> g_class</code></em>);
192 <span class="returnvalue">void</span>                <a class="link" href="gobject-Type-Information.html#g-type-add-interface-check" title="g_type_add_interface_check ()">g_type_add_interface_check</a>          (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> check_data</code></em>,
193                                                          <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GTypeInterfaceCheckFunc" title="GTypeInterfaceCheckFunc ()"><span class="type">GTypeInterfaceCheckFunc</span></a> check_func</code></em>);
194 <span class="returnvalue">void</span>                <a class="link" href="gobject-Type-Information.html#g-type-remove-interface-check" title="g_type_remove_interface_check ()">g_type_remove_interface_check</a>       (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> check_data</code></em>,
195                                                          <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GTypeInterfaceCheckFunc" title="GTypeInterfaceCheckFunc ()"><span class="type">GTypeInterfaceCheckFunc</span></a> check_func</code></em>);
196 <span class="returnvalue">void</span>                (<a class="link" href="gobject-Type-Information.html#GTypeInterfaceCheckFunc" title="GTypeInterfaceCheckFunc ()">*GTypeInterfaceCheckFunc</a>)          (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> check_data</code></em>,
197                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> g_iface</code></em>);
198 <a class="link" href="gobject-Type-Information.html#GTypeValueTable" title="struct GTypeValueTable"><span class="returnvalue">GTypeValueTable</span></a> *   <a class="link" href="gobject-Type-Information.html#g-type-value-table-peek" title="g_type_value_table_peek ()">g_type_value_table_peek</a>             (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>);
199 #define             <a class="link" href="gobject-Type-Information.html#G-DEFINE-TYPE:CAPS" title="G_DEFINE_TYPE()">G_DEFINE_TYPE</a>                       (TN,
200                                                          t_n,
201                                                          T_P)
202 #define             <a class="link" href="gobject-Type-Information.html#G-DEFINE-TYPE-WITH-CODE:CAPS" title="G_DEFINE_TYPE_WITH_CODE()">G_DEFINE_TYPE_WITH_CODE</a>             (TN,
203                                                          t_n,
204                                                          T_P,
205                                                          _C_)
206 #define             <a class="link" href="gobject-Type-Information.html#G-DEFINE-ABSTRACT-TYPE:CAPS" title="G_DEFINE_ABSTRACT_TYPE()">G_DEFINE_ABSTRACT_TYPE</a>              (TN,
207                                                          t_n,
208                                                          T_P)
209 #define             <a class="link" href="gobject-Type-Information.html#G-DEFINE-ABSTRACT-TYPE-WITH-CODE:CAPS" title="G_DEFINE_ABSTRACT_TYPE_WITH_CODE()">G_DEFINE_ABSTRACT_TYPE_WITH_CODE</a>    (TN,
210                                                          t_n,
211                                                          T_P,
212                                                          _C_)
213 #define             <a class="link" href="gobject-Type-Information.html#G-DEFINE-INTERFACE:CAPS" title="G_DEFINE_INTERFACE()">G_DEFINE_INTERFACE</a>                  (TN,
214                                                          t_n,
215                                                          T_P)
216 #define             <a class="link" href="gobject-Type-Information.html#G-DEFINE-INTERFACE-WITH-CODE:CAPS" title="G_DEFINE_INTERFACE_WITH_CODE()">G_DEFINE_INTERFACE_WITH_CODE</a>        (TN,
217                                                          t_n,
218                                                          T_P,
219                                                          _C_)
220 #define             <a class="link" href="gobject-Type-Information.html#G-IMPLEMENT-INTERFACE:CAPS" title="G_IMPLEMENT_INTERFACE()">G_IMPLEMENT_INTERFACE</a>               (TYPE_IFACE,
221                                                          iface_init)
222 #define             <a class="link" href="gobject-Type-Information.html#G-DEFINE-TYPE-EXTENDED:CAPS" title="G_DEFINE_TYPE_EXTENDED()">G_DEFINE_TYPE_EXTENDED</a>              (TN,
223                                                          t_n,
224                                                          T_P,
225                                                          _f_,
226                                                          _C_)
227 #define             <a class="link" href="gobject-Type-Information.html#G-DEFINE-BOXED-TYPE:CAPS" title="G_DEFINE_BOXED_TYPE()">G_DEFINE_BOXED_TYPE</a>                 (TypeName,
228                                                          type_name,
229                                                          copy_func,
230                                                          free_func)
231 #define             <a class="link" href="gobject-Type-Information.html#G-DEFINE-BOXED-TYPE-WITH-CODE:CAPS" title="G_DEFINE_BOXED_TYPE_WITH_CODE()">G_DEFINE_BOXED_TYPE_WITH_CODE</a>       (TypeName,
232                                                          type_name,
233                                                          copy_func,
234                                                          free_func,
235                                                          _C_)
236 #define             <a class="link" href="gobject-Type-Information.html#G-DEFINE-POINTER-TYPE:CAPS" title="G_DEFINE_POINTER_TYPE()">G_DEFINE_POINTER_TYPE</a>               (TypeName,
237                                                          type_name)
238 #define             <a class="link" href="gobject-Type-Information.html#G-DEFINE-POINTER-TYPE-WITH-CODE:CAPS" title="G_DEFINE_POINTER_TYPE_WITH_CODE()">G_DEFINE_POINTER_TYPE_WITH_CODE</a>     (TypeName,
239                                                          type_name,
240                                                          _C_)
241
242
243 #define             <a class="link" href="gobject-Type-Information.html#G-TYPE-INVALID:CAPS" title="G_TYPE_INVALID">G_TYPE_INVALID</a>
244 #define             <a class="link" href="gobject-Type-Information.html#G-TYPE-NONE:CAPS" title="G_TYPE_NONE">G_TYPE_NONE</a>
245 #define             <a class="link" href="gobject-Type-Information.html#G-TYPE-INTERFACE:CAPS" title="G_TYPE_INTERFACE">G_TYPE_INTERFACE</a>
246 #define             <a class="link" href="gobject-Type-Information.html#G-TYPE-CHAR:CAPS" title="G_TYPE_CHAR">G_TYPE_CHAR</a>
247 #define             <a class="link" href="gobject-Type-Information.html#G-TYPE-UCHAR:CAPS" title="G_TYPE_UCHAR">G_TYPE_UCHAR</a>
248 #define             <a class="link" href="gobject-Type-Information.html#G-TYPE-BOOLEAN:CAPS" title="G_TYPE_BOOLEAN">G_TYPE_BOOLEAN</a>
249 #define             <a class="link" href="gobject-Type-Information.html#G-TYPE-INT:CAPS" title="G_TYPE_INT">G_TYPE_INT</a>
250 #define             <a class="link" href="gobject-Type-Information.html#G-TYPE-UINT:CAPS" title="G_TYPE_UINT">G_TYPE_UINT</a>
251 #define             <a class="link" href="gobject-Type-Information.html#G-TYPE-LONG:CAPS" title="G_TYPE_LONG">G_TYPE_LONG</a>
252 #define             <a class="link" href="gobject-Type-Information.html#G-TYPE-ULONG:CAPS" title="G_TYPE_ULONG">G_TYPE_ULONG</a>
253 #define             <a class="link" href="gobject-Type-Information.html#G-TYPE-INT64:CAPS" title="G_TYPE_INT64">G_TYPE_INT64</a>
254 #define             <a class="link" href="gobject-Type-Information.html#G-TYPE-UINT64:CAPS" title="G_TYPE_UINT64">G_TYPE_UINT64</a>
255 #define             <a class="link" href="gobject-Type-Information.html#G-TYPE-ENUM:CAPS" title="G_TYPE_ENUM">G_TYPE_ENUM</a>
256 #define             <a class="link" href="gobject-Type-Information.html#G-TYPE-FLAGS:CAPS" title="G_TYPE_FLAGS">G_TYPE_FLAGS</a>
257 #define             <a class="link" href="gobject-Type-Information.html#G-TYPE-FLOAT:CAPS" title="G_TYPE_FLOAT">G_TYPE_FLOAT</a>
258 #define             <a class="link" href="gobject-Type-Information.html#G-TYPE-DOUBLE:CAPS" title="G_TYPE_DOUBLE">G_TYPE_DOUBLE</a>
259 #define             <a class="link" href="gobject-Type-Information.html#G-TYPE-STRING:CAPS" title="G_TYPE_STRING">G_TYPE_STRING</a>
260 #define             <a class="link" href="gobject-Type-Information.html#G-TYPE-POINTER:CAPS" title="G_TYPE_POINTER">G_TYPE_POINTER</a>
261 #define             <a class="link" href="gobject-Type-Information.html#G-TYPE-BOXED:CAPS" title="G_TYPE_BOXED">G_TYPE_BOXED</a>
262 #define             <a class="link" href="gobject-Type-Information.html#G-TYPE-PARAM:CAPS" title="G_TYPE_PARAM">G_TYPE_PARAM</a>
263 #define             <a class="link" href="gobject-Type-Information.html#G-TYPE-OBJECT:CAPS" title="G_TYPE_OBJECT">G_TYPE_OBJECT</a>
264 #define             <a class="link" href="gobject-Type-Information.html#G-TYPE-GTYPE:CAPS" title="G_TYPE_GTYPE">G_TYPE_GTYPE</a>
265 #define             <a class="link" href="gobject-Type-Information.html#G-TYPE-VARIANT:CAPS" title="G_TYPE_VARIANT">G_TYPE_VARIANT</a>
266
267 #define             <a class="link" href="gobject-Type-Information.html#G-TYPE-RESERVED-GLIB-FIRST:CAPS" title="G_TYPE_RESERVED_GLIB_FIRST">G_TYPE_RESERVED_GLIB_FIRST</a>
268 #define             <a class="link" href="gobject-Type-Information.html#G-TYPE-RESERVED-GLIB-LAST:CAPS" title="G_TYPE_RESERVED_GLIB_LAST">G_TYPE_RESERVED_GLIB_LAST</a>
269 #define             <a class="link" href="gobject-Type-Information.html#G-TYPE-RESERVED-BSE-FIRST:CAPS" title="G_TYPE_RESERVED_BSE_FIRST">G_TYPE_RESERVED_BSE_FIRST</a>
270 #define             <a class="link" href="gobject-Type-Information.html#G-TYPE-RESERVED-BSE-LAST:CAPS" title="G_TYPE_RESERVED_BSE_LAST">G_TYPE_RESERVED_BSE_LAST</a>
271 #define             <a class="link" href="gobject-Type-Information.html#G-TYPE-RESERVED-USER-FIRST:CAPS" title="G_TYPE_RESERVED_USER_FIRST">G_TYPE_RESERVED_USER_FIRST</a>
272 </pre>
273 </div>
274 <div class="refsect1">
275 <a name="gobject-Type-Information.description"></a><h2>Description</h2>
276 <p>
277 The GType API is the foundation of the GObject system.  It provides the
278 facilities for registering and managing all fundamental data types,
279 user-defined object and interface types.  Before using any GType
280 or GObject functions, <a class="link" href="gobject-Type-Information.html#g-type-init" title="g_type_init ()"><code class="function">g_type_init()</code></a> must be called to initialize the
281 type system.
282 </p>
283 <p>
284 For type creation and registration purposes, all types fall into one of
285 two categories: static or dynamic.  Static types are never loaded or
286 unloaded at run-time as dynamic types may be.  Static types are created
287 with <a class="link" href="gobject-Type-Information.html#g-type-register-static" title="g_type_register_static ()"><code class="function">g_type_register_static()</code></a> that gets type specific information passed
288 in via a <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="struct GTypeInfo"><span class="type">GTypeInfo</span></a> structure.
289 Dynamic types are created with <a class="link" href="gobject-Type-Information.html#g-type-register-dynamic" title="g_type_register_dynamic ()"><code class="function">g_type_register_dynamic()</code></a> which takes a
290 <a class="link" href="GTypePlugin.html" title="GTypePlugin"><span class="type">GTypePlugin</span></a> structure instead. The remaining type information (the
291 <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="struct GTypeInfo"><span class="type">GTypeInfo</span></a> structure) is retrieved during runtime through <a class="link" href="GTypePlugin.html" title="GTypePlugin"><span class="type">GTypePlugin</span></a>
292 and the g_type_plugin_*() API.
293 These registration functions are usually called only once from a
294 function whose only purpose is to return the type identifier for a
295 specific class.  Once the type (or class or interface) is registered,
296 it may be instantiated, inherited, or implemented depending on exactly
297 what sort of type it is.
298 There is also a third registration function for registering fundamental
299 types called <a class="link" href="gobject-Type-Information.html#g-type-register-fundamental" title="g_type_register_fundamental ()"><code class="function">g_type_register_fundamental()</code></a> which requires both a <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="struct GTypeInfo"><span class="type">GTypeInfo</span></a>
300 structure and a <a class="link" href="gobject-Type-Information.html#GTypeFundamentalInfo" title="struct GTypeFundamentalInfo"><span class="type">GTypeFundamentalInfo</span></a> structure but it is seldom used
301 since most fundamental types are predefined rather than user-defined.
302 </p>
303 <p>
304 Type instance and class structs are limited to a total of 64 KiB,
305 including all parent types. Similarly, type instances' private data
306 (as created by <a class="link" href="gobject-Type-Information.html#g-type-class-add-private" title="g_type_class_add_private ()"><code class="function">g_type_class_add_private()</code></a>) are limited to a total of
307 64 KiB. If a type instance needs a large static buffer, allocate it
308 separately (typically by using <a href="./../glib/glib/glib-Arrays.html#GArray"><span class="type">GArray</span></a> or <a href="./../glib/glib/glib-Pointer-Arrays.html#GPtrArray"><span class="type">GPtrArray</span></a>) and put a pointer
309 to the buffer in the structure.
310 </p>
311 <p>
312 A final word about type names.
313 Such an identifier needs to be at least three characters long. There is no
314 upper length limit. The first character needs to be a letter (a-z or A-Z)
315 or an underscore '_'. Subsequent characters can be letters, numbers or
316 any of '-_+'.
317 </p>
318 </div>
319 <div class="refsect1">
320 <a name="gobject-Type-Information.details"></a><h2>Details</h2>
321 <div class="refsect2">
322 <a name="GType"></a><h3>GType</h3>
323 <p>
324 A numerical value which represents the unique identifier of a registered
325 type.
326 </p>
327 </div>
328 <hr>
329 <div class="refsect2">
330 <a name="G-TYPE-FUNDAMENTAL:CAPS"></a><h3>G_TYPE_FUNDAMENTAL()</h3>
331 <pre class="programlisting">#define G_TYPE_FUNDAMENTAL(type) (g_type_fundamental (type))
332 </pre>
333 <p>
334 The fundamental type which is the ancestor of <em class="parameter"><code>type</code></em>.
335 Fundamental types are types that serve as ultimate bases for the derived types, 
336 thus they are the roots of distinct inheritance hierarchies.
337 </p>
338 <div class="variablelist"><table border="0">
339 <col align="left" valign="top">
340 <tbody><tr>
341 <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
342 <td>A <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value.</td>
343 </tr></tbody>
344 </table></div>
345 </div>
346 <hr>
347 <div class="refsect2">
348 <a name="G-TYPE-FUNDAMENTAL-MAX:CAPS"></a><h3>G_TYPE_FUNDAMENTAL_MAX</h3>
349 <pre class="programlisting">#define G_TYPE_FUNDAMENTAL_MAX             (255 &lt;&lt; G_TYPE_FUNDAMENTAL_SHIFT)
350 </pre>
351 <p>
352 An integer constant that represents the number of identifiers reserved
353 for types that are assigned at compile-time.
354 </p>
355 </div>
356 <hr>
357 <div class="refsect2">
358 <a name="G-TYPE-MAKE-FUNDAMENTAL:CAPS"></a><h3>G_TYPE_MAKE_FUNDAMENTAL()</h3>
359 <pre class="programlisting">#define G_TYPE_MAKE_FUNDAMENTAL(x) ((GType) ((x) &lt;&lt; G_TYPE_FUNDAMENTAL_SHIFT))
360 </pre>
361 <p>
362 Get the type ID for the fundamental type number <em class="parameter"><code>x</code></em>.
363 Use <a class="link" href="gobject-Type-Information.html#g-type-fundamental-next" title="g_type_fundamental_next ()"><code class="function">g_type_fundamental_next()</code></a> instead of this macro to create new fundamental 
364 types.
365 </p>
366 <div class="variablelist"><table border="0">
367 <col align="left" valign="top">
368 <tbody>
369 <tr>
370 <td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
371 <td>the fundamental type number.</td>
372 </tr>
373 <tr>
374 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
375 <td>the GType</td>
376 </tr>
377 </tbody>
378 </table></div>
379 </div>
380 <hr>
381 <div class="refsect2">
382 <a name="G-TYPE-IS-ABSTRACT:CAPS"></a><h3>G_TYPE_IS_ABSTRACT()</h3>
383 <pre class="programlisting">#define G_TYPE_IS_ABSTRACT(type)                (g_type_test_flags ((type), G_TYPE_FLAG_ABSTRACT))
384 </pre>
385 <p>
386 Checks if <em class="parameter"><code>type</code></em> is an abstract type.  An abstract type cannot be
387 instantiated and is normally used as an abstract base class for
388 derived classes.
389 </p>
390 <div class="variablelist"><table border="0">
391 <col align="left" valign="top">
392 <tbody>
393 <tr>
394 <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
395 <td>A <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value.</td>
396 </tr>
397 <tr>
398 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
399 <td>
400 <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success.</td>
401 </tr>
402 </tbody>
403 </table></div>
404 </div>
405 <hr>
406 <div class="refsect2">
407 <a name="G-TYPE-IS-DERIVED:CAPS"></a><h3>G_TYPE_IS_DERIVED()</h3>
408 <pre class="programlisting">#define G_TYPE_IS_DERIVED(type)                 ((type) &gt; G_TYPE_FUNDAMENTAL_MAX)
409 </pre>
410 <p>
411 Checks if <em class="parameter"><code>type</code></em> is derived (or in object-oriented terminology:
412 inherited) from another type (this holds true for all non-fundamental
413 types).
414 </p>
415 <div class="variablelist"><table border="0">
416 <col align="left" valign="top">
417 <tbody>
418 <tr>
419 <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
420 <td>A <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value.</td>
421 </tr>
422 <tr>
423 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
424 <td>
425 <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success.</td>
426 </tr>
427 </tbody>
428 </table></div>
429 </div>
430 <hr>
431 <div class="refsect2">
432 <a name="G-TYPE-IS-FUNDAMENTAL:CAPS"></a><h3>G_TYPE_IS_FUNDAMENTAL()</h3>
433 <pre class="programlisting">#define G_TYPE_IS_FUNDAMENTAL(type)             ((type) &lt;= G_TYPE_FUNDAMENTAL_MAX)
434 </pre>
435 <p>
436 Checks if <em class="parameter"><code>type</code></em> is a fundamental type.
437 </p>
438 <div class="variablelist"><table border="0">
439 <col align="left" valign="top">
440 <tbody>
441 <tr>
442 <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
443 <td>A <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value.</td>
444 </tr>
445 <tr>
446 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
447 <td>
448 <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success.</td>
449 </tr>
450 </tbody>
451 </table></div>
452 </div>
453 <hr>
454 <div class="refsect2">
455 <a name="G-TYPE-IS-VALUE-TYPE:CAPS"></a><h3>G_TYPE_IS_VALUE_TYPE()</h3>
456 <pre class="programlisting">#define G_TYPE_IS_VALUE_TYPE(type)              (g_type_check_is_value_type (type))
457 </pre>
458 <p>
459 Checks if <em class="parameter"><code>type</code></em> is a value type and can be used with <a class="link" href="gobject-Generic-values.html#g-value-init" title="g_value_init ()"><code class="function">g_value_init()</code></a>.
460 </p>
461 <div class="variablelist"><table border="0">
462 <col align="left" valign="top">
463 <tbody>
464 <tr>
465 <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
466 <td>A <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value.</td>
467 </tr>
468 <tr>
469 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
470 <td>
471 <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success.</td>
472 </tr>
473 </tbody>
474 </table></div>
475 </div>
476 <hr>
477 <div class="refsect2">
478 <a name="G-TYPE-HAS-VALUE-TABLE:CAPS"></a><h3>G_TYPE_HAS_VALUE_TABLE()</h3>
479 <pre class="programlisting">#define G_TYPE_HAS_VALUE_TABLE(type)            (g_type_value_table_peek (type) != NULL)
480 </pre>
481 <p>
482 Checks if <em class="parameter"><code>type</code></em> has a <a class="link" href="gobject-Type-Information.html#GTypeValueTable" title="struct GTypeValueTable"><span class="type">GTypeValueTable</span></a>.
483 </p>
484 <div class="variablelist"><table border="0">
485 <col align="left" valign="top">
486 <tbody>
487 <tr>
488 <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
489 <td>A <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value.</td>
490 </tr>
491 <tr>
492 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
493 <td>
494 <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success.</td>
495 </tr>
496 </tbody>
497 </table></div>
498 </div>
499 <hr>
500 <div class="refsect2">
501 <a name="G-TYPE-IS-CLASSED:CAPS"></a><h3>G_TYPE_IS_CLASSED()</h3>
502 <pre class="programlisting">#define G_TYPE_IS_CLASSED(type)                 (g_type_test_flags ((type), G_TYPE_FLAG_CLASSED))
503 </pre>
504 <p>
505 Checks if <em class="parameter"><code>type</code></em> is a classed type.
506 </p>
507 <div class="variablelist"><table border="0">
508 <col align="left" valign="top">
509 <tbody>
510 <tr>
511 <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
512 <td>A <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value.</td>
513 </tr>
514 <tr>
515 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
516 <td>
517 <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success.</td>
518 </tr>
519 </tbody>
520 </table></div>
521 </div>
522 <hr>
523 <div class="refsect2">
524 <a name="G-TYPE-IS-INSTANTIATABLE:CAPS"></a><h3>G_TYPE_IS_INSTANTIATABLE()</h3>
525 <pre class="programlisting">#define G_TYPE_IS_INSTANTIATABLE(type)          (g_type_test_flags ((type), G_TYPE_FLAG_INSTANTIATABLE))
526 </pre>
527 <p>
528 Checks if <em class="parameter"><code>type</code></em> can be instantiated.  Instantiation is the
529 process of creating an instance (object) of this type.
530 </p>
531 <div class="variablelist"><table border="0">
532 <col align="left" valign="top">
533 <tbody>
534 <tr>
535 <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
536 <td>A <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value.</td>
537 </tr>
538 <tr>
539 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
540 <td>
541 <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success.</td>
542 </tr>
543 </tbody>
544 </table></div>
545 </div>
546 <hr>
547 <div class="refsect2">
548 <a name="G-TYPE-IS-DERIVABLE:CAPS"></a><h3>G_TYPE_IS_DERIVABLE()</h3>
549 <pre class="programlisting">#define G_TYPE_IS_DERIVABLE(type)               (g_type_test_flags ((type), G_TYPE_FLAG_DERIVABLE))
550 </pre>
551 <p>
552 Checks if <em class="parameter"><code>type</code></em> is a derivable type.  A derivable type can
553 be used as the base class of a flat (single-level) class hierarchy.
554 </p>
555 <div class="variablelist"><table border="0">
556 <col align="left" valign="top">
557 <tbody>
558 <tr>
559 <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
560 <td>A <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value.</td>
561 </tr>
562 <tr>
563 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
564 <td>
565 <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success.</td>
566 </tr>
567 </tbody>
568 </table></div>
569 </div>
570 <hr>
571 <div class="refsect2">
572 <a name="G-TYPE-IS-DEEP-DERIVABLE:CAPS"></a><h3>G_TYPE_IS_DEEP_DERIVABLE()</h3>
573 <pre class="programlisting">#define G_TYPE_IS_DEEP_DERIVABLE(type)          (g_type_test_flags ((type), G_TYPE_FLAG_DEEP_DERIVABLE))
574 </pre>
575 <p>
576 Checks if <em class="parameter"><code>type</code></em> is a deep derivable type.  A deep derivable type
577 can be used as the base class of a deep (multi-level) class hierarchy.
578 </p>
579 <div class="variablelist"><table border="0">
580 <col align="left" valign="top">
581 <tbody>
582 <tr>
583 <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
584 <td>A <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value.</td>
585 </tr>
586 <tr>
587 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
588 <td>
589 <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success.</td>
590 </tr>
591 </tbody>
592 </table></div>
593 </div>
594 <hr>
595 <div class="refsect2">
596 <a name="G-TYPE-IS-INTERFACE:CAPS"></a><h3>G_TYPE_IS_INTERFACE()</h3>
597 <pre class="programlisting">#define G_TYPE_IS_INTERFACE(type)               (G_TYPE_FUNDAMENTAL (type) == G_TYPE_INTERFACE)
598 </pre>
599 <p>
600 Checks if <em class="parameter"><code>type</code></em> is an interface type.
601 An interface type provides a pure API, the implementation
602 of which is provided by another type (which is then said to conform
603 to the interface).  GLib interfaces are somewhat analogous to Java
604 interfaces and C++ classes containing only pure virtual functions, 
605 with the difference that GType interfaces are not derivable (but see
606 <a class="link" href="gobject-Type-Information.html#g-type-interface-add-prerequisite" title="g_type_interface_add_prerequisite ()"><code class="function">g_type_interface_add_prerequisite()</code></a> for an alternative).
607 </p>
608 <div class="variablelist"><table border="0">
609 <col align="left" valign="top">
610 <tbody>
611 <tr>
612 <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
613 <td>A <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value.</td>
614 </tr>
615 <tr>
616 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
617 <td>
618 <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success.</td>
619 </tr>
620 </tbody>
621 </table></div>
622 </div>
623 <hr>
624 <div class="refsect2">
625 <a name="GTypeInterface"></a><h3>struct GTypeInterface</h3>
626 <pre class="programlisting">struct GTypeInterface {
627 };
628 </pre>
629 <p>
630 An opaque structure used as the base of all interface types.
631 </p>
632 </div>
633 <hr>
634 <div class="refsect2">
635 <a name="GTypeInstance"></a><h3>struct GTypeInstance</h3>
636 <pre class="programlisting">struct GTypeInstance {
637 };
638 </pre>
639 <p>
640 An opaque structure used as the base of all type instances.
641 </p>
642 </div>
643 <hr>
644 <div class="refsect2">
645 <a name="GTypeClass"></a><h3>struct GTypeClass</h3>
646 <pre class="programlisting">struct GTypeClass {
647 };
648 </pre>
649 <p>
650 An opaque structure used as the base of all classes.
651 </p>
652 </div>
653 <hr>
654 <div class="refsect2">
655 <a name="GTypeInfo"></a><h3>struct GTypeInfo</h3>
656 <pre class="programlisting">struct GTypeInfo {
657   /* interface types, classed types, instantiated types */
658   guint16                class_size;
659   
660   GBaseInitFunc          base_init;
661   GBaseFinalizeFunc      base_finalize;
662   
663   /* interface types, classed types, instantiated types */
664   GClassInitFunc         class_init;
665   GClassFinalizeFunc     class_finalize;
666   gconstpointer          class_data;
667   
668   /* instantiated types */
669   guint16                instance_size;
670   guint16                n_preallocs;
671   GInstanceInitFunc      instance_init;
672   
673   /* value handling */
674   const GTypeValueTable *value_table;
675 };
676 </pre>
677 <p>
678 This structure is used to provide the type system with the information
679 required to initialize and destruct (finalize) a type's class and
680 its instances.
681 The initialized structure is passed to the <a class="link" href="gobject-Type-Information.html#g-type-register-static" title="g_type_register_static ()"><code class="function">g_type_register_static()</code></a> function
682 (or is copied into the provided <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="struct GTypeInfo"><span class="type">GTypeInfo</span></a> structure in the
683 <a class="link" href="GTypePlugin.html#g-type-plugin-complete-type-info" title="g_type_plugin_complete_type_info ()"><code class="function">g_type_plugin_complete_type_info()</code></a>). The type system will perform a deep
684 copy of this structure, so its memory does not need to be persistent
685 across invocation of <a class="link" href="gobject-Type-Information.html#g-type-register-static" title="g_type_register_static ()"><code class="function">g_type_register_static()</code></a>.
686 </p>
687 <div class="variablelist"><table border="0">
688 <col align="left" valign="top">
689 <tbody>
690 <tr>
691 <td><p><span class="term"><a href="./../glib/glib/glib-Basic-Types.html#guint16"><span class="type">guint16</span></a> <em class="structfield"><code><a name="GTypeInfo.class-size"></a>class_size</code></em>;</span></p></td>
692 <td>Size of the class structure (required for interface, classed and instantiatable types).</td>
693 </tr>
694 <tr>
695 <td><p><span class="term"><a class="link" href="gobject-Type-Information.html#GBaseInitFunc" title="GBaseInitFunc ()"><span class="type">GBaseInitFunc</span></a> <em class="structfield"><code><a name="GTypeInfo.base-init"></a>base_init</code></em>;</span></p></td>
696 <td>Location of the base initialization function (optional).</td>
697 </tr>
698 <tr>
699 <td><p><span class="term"><a class="link" href="gobject-Type-Information.html#GBaseFinalizeFunc" title="GBaseFinalizeFunc ()"><span class="type">GBaseFinalizeFunc</span></a> <em class="structfield"><code><a name="GTypeInfo.base-finalize"></a>base_finalize</code></em>;</span></p></td>
700 <td>Location of the base finalization function (optional).</td>
701 </tr>
702 <tr>
703 <td><p><span class="term"><a class="link" href="gobject-Type-Information.html#GClassInitFunc" title="GClassInitFunc ()"><span class="type">GClassInitFunc</span></a> <em class="structfield"><code><a name="GTypeInfo.class-init"></a>class_init</code></em>;</span></p></td>
704 <td>Location of the class initialization function for
705 classed and instantiatable types. Location of the default vtable
706 inititalization function for interface types. (optional) This function
707 is used both to fill in virtual functions in the class or default vtable,
708 and to do type-specific setup such as registering signals and object
709 properties.</td>
710 </tr>
711 <tr>
712 <td><p><span class="term"><a class="link" href="gobject-Type-Information.html#GClassFinalizeFunc" title="GClassFinalizeFunc ()"><span class="type">GClassFinalizeFunc</span></a> <em class="structfield"><code><a name="GTypeInfo.class-finalize"></a>class_finalize</code></em>;</span></p></td>
713 <td>Location of the class finalization function for
714 classed and instantiatable types. Location fo the default vtable
715 finalization function for interface types. (optional)</td>
716 </tr>
717 <tr>
718 <td><p><span class="term"><a href="./../glib/glib/glib-Basic-Types.html#gconstpointer"><span class="type">gconstpointer</span></a> <em class="structfield"><code><a name="GTypeInfo.class-data"></a>class_data</code></em>;</span></p></td>
719 <td>User-supplied data passed to the class init/finalize functions.</td>
720 </tr>
721 <tr>
722 <td><p><span class="term"><a href="./../glib/glib/glib-Basic-Types.html#guint16"><span class="type">guint16</span></a> <em class="structfield"><code><a name="GTypeInfo.instance-size"></a>instance_size</code></em>;</span></p></td>
723 <td>Size of the instance (object) structure (required for instantiatable types only).</td>
724 </tr>
725 <tr>
726 <td><p><span class="term"><a href="./../glib/glib/glib-Basic-Types.html#guint16"><span class="type">guint16</span></a> <em class="structfield"><code><a name="GTypeInfo.n-preallocs"></a>n_preallocs</code></em>;</span></p></td>
727 <td>Prior to GLib 2.10, it specified the number of pre-allocated (cached) instances to reserve memory for (0 indicates no caching). Since GLib 2.10, it is ignored, since instances are allocated with the <a href="./../glib/glib/glib-Memory-Slices.html">slice allocator</a> now.</td>
728 </tr>
729 <tr>
730 <td><p><span class="term"><a class="link" href="gobject-Type-Information.html#GInstanceInitFunc" title="GInstanceInitFunc ()"><span class="type">GInstanceInitFunc</span></a> <em class="structfield"><code><a name="GTypeInfo.instance-init"></a>instance_init</code></em>;</span></p></td>
731 <td>Location of the instance initialization function (optional, for instantiatable types only).</td>
732 </tr>
733 <tr>
734 <td><p><span class="term">const <a class="link" href="gobject-Type-Information.html#GTypeValueTable" title="struct GTypeValueTable"><span class="type">GTypeValueTable</span></a> *<em class="structfield"><code><a name="GTypeInfo.value-table"></a>value_table</code></em>;</span></p></td>
735 <td>A <a class="link" href="gobject-Type-Information.html#GTypeValueTable" title="struct GTypeValueTable"><span class="type">GTypeValueTable</span></a> function table for generic handling of GValues of this type (usually only
736 useful for fundamental types).</td>
737 </tr>
738 </tbody>
739 </table></div>
740 </div>
741 <hr>
742 <div class="refsect2">
743 <a name="GTypeFundamentalInfo"></a><h3>struct GTypeFundamentalInfo</h3>
744 <pre class="programlisting">struct GTypeFundamentalInfo {
745   GTypeFundamentalFlags  type_flags;
746 };
747 </pre>
748 <p>
749 A structure that provides information to the type system which is
750 used specifically for managing fundamental types.
751 </p>
752 <div class="variablelist"><table border="0">
753 <col align="left" valign="top">
754 <tbody><tr>
755 <td><p><span class="term"><a class="link" href="gobject-Type-Information.html#GTypeFundamentalFlags" title="enum GTypeFundamentalFlags"><span class="type">GTypeFundamentalFlags</span></a> <em class="structfield"><code><a name="GTypeFundamentalInfo.type-flags"></a>type_flags</code></em>;</span></p></td>
756 <td>
757 <a class="link" href="gobject-Type-Information.html#GTypeFundamentalFlags" title="enum GTypeFundamentalFlags"><span class="type">GTypeFundamentalFlags</span></a> describing the characteristics of the fundamental type</td>
758 </tr></tbody>
759 </table></div>
760 </div>
761 <hr>
762 <div class="refsect2">
763 <a name="GInterfaceInfo"></a><h3>struct GInterfaceInfo</h3>
764 <pre class="programlisting">struct GInterfaceInfo {
765   GInterfaceInitFunc     interface_init;
766   GInterfaceFinalizeFunc interface_finalize;
767   gpointer               interface_data;
768 };
769 </pre>
770 <p>
771 A structure that provides information to the type system which is
772 used specifically for managing interface types.
773 </p>
774 <div class="variablelist"><table border="0">
775 <col align="left" valign="top">
776 <tbody>
777 <tr>
778 <td><p><span class="term"><a class="link" href="gobject-Type-Information.html#GInterfaceInitFunc" title="GInterfaceInitFunc ()"><span class="type">GInterfaceInitFunc</span></a> <em class="structfield"><code><a name="GInterfaceInfo.interface-init"></a>interface_init</code></em>;</span></p></td>
779 <td>location of the interface initialization function</td>
780 </tr>
781 <tr>
782 <td><p><span class="term"><a class="link" href="gobject-Type-Information.html#GInterfaceFinalizeFunc" title="GInterfaceFinalizeFunc ()"><span class="type">GInterfaceFinalizeFunc</span></a> <em class="structfield"><code><a name="GInterfaceInfo.interface-finalize"></a>interface_finalize</code></em>;</span></p></td>
783 <td>location of the interface finalization function</td>
784 </tr>
785 <tr>
786 <td><p><span class="term"><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> <em class="structfield"><code><a name="GInterfaceInfo.interface-data"></a>interface_data</code></em>;</span></p></td>
787 <td>user-supplied data passed to the interface init/finalize functions</td>
788 </tr>
789 </tbody>
790 </table></div>
791 </div>
792 <hr>
793 <div class="refsect2">
794 <a name="GTypeValueTable"></a><h3>struct GTypeValueTable</h3>
795 <pre class="programlisting">struct GTypeValueTable {
796   void     (*value_init)         (GValue       *value);
797   void     (*value_free)         (GValue       *value);
798   void     (*value_copy)         (const GValue *src_value,
799                                   GValue       *dest_value);
800   /* varargs functionality (optional) */
801   gpointer (*value_peek_pointer) (const GValue *value);
802   gchar     *collect_format;
803   gchar*   (*collect_value)      (GValue       *value,
804                                   guint         n_collect_values,
805                                   GTypeCValue  *collect_values,
806                                   guint         collect_flags);
807   gchar     *lcopy_format;
808   gchar*   (*lcopy_value)        (const GValue *value,
809                                   guint         n_collect_values,
810                                   GTypeCValue  *collect_values,
811                                   guint         collect_flags);
812 };
813 </pre>
814 <p>
815 The <a class="link" href="gobject-Type-Information.html#GTypeValueTable" title="struct GTypeValueTable"><span class="type">GTypeValueTable</span></a> provides the functions required by the <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> implementation,
816 to serve as a container for values of a type.
817 </p>
818 <div class="variablelist"><table border="0">
819 <col align="left" valign="top">
820 <tbody>
821 <tr>
822 <td><p><span class="term"><em class="structfield"><code><a name="GTypeValueTable.value-init"></a>value_init</code></em> ()</span></p></td>
823 <td>Default initialize <em class="parameter"><code>values</code></em> contents by poking values
824 directly into the value-&gt;data array. The data array of
825 the <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> passed into this function was zero-filled
826 with <code class="function"><code class="function">memset()</code></code>, so no care has to
827 be taken to free any
828 old contents. E.g. for the implementation of a string
829 value that may never be <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, the implementation might
830 look like:
831 <div class="informalexample">
832   <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
833     <tbody>
834       <tr>
835         <td class="listing_lines" align="right"><pre>1</pre></td>
836         <td class="listing_code"><pre class="programlisting"><span class="normal">value</span><span class="symbol">-&gt;</span><span class="normal">data</span><span class="symbol">[</span><span class="number">0</span><span class="symbol">].</span><span class="normal">v_pointer </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="./../glib/glib/glib-String-Utility-Functions.html#g-strdup">g_strdup</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">""</span><span class="symbol">);</span></pre></td>
837       </tr>
838     </tbody>
839   </table>
840 </div>
841
842 </td>
843 </tr>
844 <tr>
845 <td><p><span class="term"><em class="structfield"><code><a name="GTypeValueTable.value-free"></a>value_free</code></em> ()</span></p></td>
846 <td>Free any old contents that might be left in the
847 data array of the passed in <em class="parameter"><code>value</code></em>. No resources may
848 remain allocated through the <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> contents after
849 this function returns. E.g. for our above string type:
850 <div class="informalexample">
851   <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
852     <tbody>
853       <tr>
854         <td class="listing_lines" align="right"><pre>1
855 2
856 3</pre></td>
857         <td class="listing_code"><pre class="programlisting"><span class="comment">// only free strings without a specific flag for static storage</span>
858 <span class="keyword">if</span><span class="normal"> </span><span class="symbol">(!(</span><span class="normal">value</span><span class="symbol">-&gt;</span><span class="normal">data</span><span class="symbol">[</span><span class="number">1</span><span class="symbol">].</span><span class="normal">v_uint </span><span class="symbol">&amp;</span><span class="normal"> G_VALUE_NOCOPY_CONTENTS</span><span class="symbol">))</span>
859 <span class="function"><a href="./../glib/glib/glib-Memory-Allocation.html#g-free">g_free</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">value</span><span class="symbol">-&gt;</span><span class="normal">data</span><span class="symbol">[</span><span class="number">0</span><span class="symbol">].</span><span class="normal">v_pointer</span><span class="symbol">);</span></pre></td>
860       </tr>
861     </tbody>
862   </table>
863 </div>
864
865 </td>
866 </tr>
867 <tr>
868 <td><p><span class="term"><em class="structfield"><code><a name="GTypeValueTable.value-copy"></a>value_copy</code></em> ()</span></p></td>
869 <td>
870 <em class="parameter"><code>dest_value</code></em> is a <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> with zero-filled data section
871 and <em class="parameter"><code>src_value</code></em> is a properly setup <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> of same or
872 derived type.
873 The purpose of this function is to copy the contents of
874 <em class="parameter"><code>src_value</code></em> into <em class="parameter"><code>dest_value</code></em> in a way, that even after
875 <em class="parameter"><code>src_value</code></em> has been freed, the contents of <em class="parameter"><code>dest_value</code></em>
876 remain valid. String type example:
877 <div class="informalexample">
878   <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
879     <tbody>
880       <tr>
881         <td class="listing_lines" align="right"><pre>1</pre></td>
882         <td class="listing_code"><pre class="programlisting"><span class="normal">dest_value</span><span class="symbol">-&gt;</span><span class="normal">data</span><span class="symbol">[</span><span class="number">0</span><span class="symbol">].</span><span class="normal">v_pointer </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="./../glib/glib/glib-String-Utility-Functions.html#g-strdup">g_strdup</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">src_value</span><span class="symbol">-&gt;</span><span class="normal">data</span><span class="symbol">[</span><span class="number">0</span><span class="symbol">].</span><span class="normal">v_pointer</span><span class="symbol">);</span></pre></td>
883       </tr>
884     </tbody>
885   </table>
886 </div>
887
888 </td>
889 </tr>
890 <tr>
891 <td><p><span class="term"><em class="structfield"><code><a name="GTypeValueTable.value-peek-pointer"></a>value_peek_pointer</code></em> ()</span></p></td>
892 <td>If the value contents fit into a pointer, such as objects
893 or strings, return this pointer, so the caller can peek at
894 the current contents. To extend on our above string example:
895 <div class="informalexample">
896   <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
897     <tbody>
898       <tr>
899         <td class="listing_lines" align="right"><pre>1</pre></td>
900         <td class="listing_code"><pre class="programlisting"><span class="keyword">return</span><span class="normal"> value</span><span class="symbol">-&gt;</span><span class="normal">data</span><span class="symbol">[</span><span class="number">0</span><span class="symbol">].</span><span class="normal">v_pointer</span><span class="symbol">;</span></pre></td>
901       </tr>
902     </tbody>
903   </table>
904 </div>
905
906 </td>
907 </tr>
908 <tr>
909 <td><p><span class="term"><a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *<em class="structfield"><code><a name="GTypeValueTable.collect-format"></a>collect_format</code></em>;</span></p></td>
910 <td>A string format describing how to collect the contents of
911 this value bit-by-bit. Each character in the format represents
912 an argument to be collected, and the characters themselves indicate
913 the type of the argument. Currently supported arguments are:
914 <div class="variablelist"><table border="0">
915 <col align="left" valign="top">
916 <tbody>
917 <tr>
918 <td><p><span class="term"></span></p></td>
919 <td><p>
920 'i' - Integers. passed as collect_values[].v_int.
921 </p></td>
922 </tr>
923 <tr>
924 <td><p><span class="term"></span></p></td>
925 <td><p>
926 'l' - Longs. passed as collect_values[].v_long.
927 </p></td>
928 </tr>
929 <tr>
930 <td><p><span class="term"></span></p></td>
931 <td><p>
932 'd' - Doubles. passed as collect_values[].v_double.
933 </p></td>
934 </tr>
935 <tr>
936 <td><p><span class="term"></span></p></td>
937 <td><p>
938 'p' - Pointers. passed as collect_values[].v_pointer.
939 </p></td>
940 </tr>
941 </tbody>
942 </table></div>
943 It should be noted that for variable argument list construction,
944 ANSI C promotes every type smaller than an integer to an int, and
945 floats to doubles. So for collection of short int or char, 'i'
946 needs to be used, and for collection of floats 'd'.</td>
947 </tr>
948 <tr>
949 <td><p><span class="term"><em class="structfield"><code><a name="GTypeValueTable.collect-value"></a>collect_value</code></em> ()</span></p></td>
950 <td>The <code class="function">collect_value()</code> function is responsible for converting the
951 values collected from a variable argument list into contents
952 suitable for storage in a GValue. This function should setup
953 <em class="parameter"><code>value</code></em> similar to <code class="function">value_init()</code>; e.g. for a string value that
954 does not allow <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> pointers, it needs to either spew an error,
955 or do an implicit conversion by storing an empty string.
956 The <em class="parameter"><code>value</code></em> passed in to this function has a zero-filled data
957 array, so just like for <code class="function">value_init()</code> it is guaranteed to not
958 contain any old contents that might need freeing.
959 <em class="parameter"><code>n_collect_values</code></em> is exactly the string length of <em class="parameter"><code>collect_format</code></em>,
960 and <em class="parameter"><code>collect_values</code></em> is an array of unions <a class="link" href="gobject-Varargs-Value-Collection.html#GTypeCValue" title="union GTypeCValue"><span class="type">GTypeCValue</span></a> with
961 length <em class="parameter"><code>n_collect_values</code></em>, containing the collected values
962 according to <em class="parameter"><code>collect_format</code></em>.
963 <em class="parameter"><code>collect_flags</code></em> is an argument provided as a hint by the caller.
964 It may contain the flag <code class="literal">G_VALUE_NOCOPY_CONTENTS</code> indicating,
965 that the collected value contents may be considered "static"
966 for the duration of the <em class="parameter"><code>value</code></em> lifetime.
967 Thus an extra copy of the contents stored in <em class="parameter"><code>collect_values</code></em> is
968 not required for assignment to <em class="parameter"><code>value</code></em>.
969 For our above string example, we continue with:
970 <div class="informalexample">
971   <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
972     <tbody>
973       <tr>
974         <td class="listing_lines" align="right"><pre>1
975 2
976 3
977 4
978 5
979 6
980 7
981 8
982 9
983 10
984 11</pre></td>
985         <td class="listing_code"><pre class="programlisting"><span class="keyword">if</span><span class="normal"> </span><span class="symbol">(!</span><span class="normal">collect_values</span><span class="symbol">[</span><span class="number">0</span><span class="symbol">].</span><span class="normal">v_pointer</span><span class="symbol">)</span>
986 <span class="normal">value</span><span class="symbol">-&gt;</span><span class="normal">data</span><span class="symbol">[</span><span class="number">0</span><span class="symbol">].</span><span class="normal">v_pointer </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="./../glib/glib/glib-String-Utility-Functions.html#g-strdup">g_strdup</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">""</span><span class="symbol">);</span>
987 <span class="keyword">else</span><span class="normal"> </span><span class="keyword">if</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">collect_flags </span><span class="symbol">&amp;</span><span class="normal"> G_VALUE_NOCOPY_CONTENTS</span><span class="symbol">)</span>
988 <span class="cbracket">{</span>
989 <span class="normal">value</span><span class="symbol">-&gt;</span><span class="normal">data</span><span class="symbol">[</span><span class="number">0</span><span class="symbol">].</span><span class="normal">v_pointer </span><span class="symbol">=</span><span class="normal"> collect_values</span><span class="symbol">[</span><span class="number">0</span><span class="symbol">].</span><span class="normal">v_pointer</span><span class="symbol">;</span>
990 <span class="comment">// keep a flag for the value_free() implementation to not free this string</span>
991 <span class="normal">value</span><span class="symbol">-&gt;</span><span class="normal">data</span><span class="symbol">[</span><span class="number">1</span><span class="symbol">].</span><span class="normal">v_uint </span><span class="symbol">=</span><span class="normal"> G_VALUE_NOCOPY_CONTENTS</span><span class="symbol">;</span>
992 <span class="cbracket">}</span>
993 <span class="keyword">else</span>
994 <span class="normal">value</span><span class="symbol">-&gt;</span><span class="normal">data</span><span class="symbol">[</span><span class="number">0</span><span class="symbol">].</span><span class="normal">v_pointer </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="./../glib/glib/glib-String-Utility-Functions.html#g-strdup">g_strdup</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">collect_values</span><span class="symbol">[</span><span class="number">0</span><span class="symbol">].</span><span class="normal">v_pointer</span><span class="symbol">);</span>
995 <span class="keyword">return</span><span class="normal"> <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">;</span></pre></td>
996       </tr>
997     </tbody>
998   </table>
999 </div>
1000
1001 It should be noted, that it is generally a bad idea to follow the
1002 <span class="type">G_VALUE_NOCOPY_CONTENTS</span> hint for reference counted types. Due to
1003 reentrancy requirements and reference count assertions performed
1004 by the signal emission code, reference counts should always be
1005 incremented for reference counted contents stored in the value-&gt;data
1006 array.  To deviate from our string example for a moment, and taking
1007 a look at an exemplary implementation for <code class="function">collect_value()</code> of
1008 <a class="link" href="gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a>:
1009 <div class="informalexample">
1010   <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
1011     <tbody>
1012       <tr>
1013         <td class="listing_lines" align="right"><pre>1
1014 2
1015 3
1016 4
1017 5
1018 6
1019 7
1020 8
1021 9
1022 10</pre></td>
1023         <td class="listing_code"><pre class="programlisting"><span class="keyword">if</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">collect_values</span><span class="symbol">[</span><span class="number">0</span><span class="symbol">].</span><span class="normal">v_pointer</span><span class="symbol">)</span>
1024 <span class="cbracket">{</span>
1025 <span class="usertype">GObject</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">object </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="gobject-The-Base-Object-Type.html#G-OBJECT:CAPS">G_OBJECT</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">collect_values</span><span class="symbol">[</span><span class="number">0</span><span class="symbol">].</span><span class="normal">v_pointer</span><span class="symbol">);</span>
1026 <span class="comment">// never honour G_VALUE_NOCOPY_CONTENTS for ref-counted types</span>
1027 <span class="normal">value</span><span class="symbol">-&gt;</span><span class="normal">data</span><span class="symbol">[</span><span class="number">0</span><span class="symbol">].</span><span class="normal">v_pointer </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="gobject-The-Base-Object-Type.html#g-object-ref">g_object_ref</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">object</span><span class="symbol">);</span>
1028 <span class="keyword">return</span><span class="normal"> <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">;</span>
1029 <span class="cbracket">}</span>
1030 <span class="keyword">else</span>
1031 <span class="keyword">return</span><span class="normal"> </span><span class="function"><a href="./../glib/glib/glib-String-Utility-Functions.html#g-strdup-printf">g_strdup_printf</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"Object passed as invalid NULL pointer"</span><span class="symbol">);</span>
1032 <span class="cbracket">}</span></pre></td>
1033       </tr>
1034     </tbody>
1035   </table>
1036 </div>
1037
1038 The reference count for valid objects is always incremented,
1039 regardless of <em class="parameter"><code>collect_flags</code></em>. For invalid objects, the example
1040 returns a newly allocated string without altering <em class="parameter"><code>value</code></em>.
1041 Upon success, <code class="function">collect_value()</code> needs to return <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. If, however,
1042 an error condition occurred, <code class="function">collect_value()</code> may spew an
1043 error by returning a newly allocated non-<a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> string, giving
1044 a suitable description of the error condition.
1045 The calling code makes no assumptions about the <em class="parameter"><code>value</code></em>
1046 contents being valid upon error returns, <em class="parameter"><code>value</code></em>
1047 is simply thrown away without further freeing. As such, it is
1048 a good idea to not allocate <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> contents, prior to returning
1049 an error, however, <code class="function">collect_values()</code> is not obliged to return
1050 a correctly setup <em class="parameter"><code>value</code></em> for error returns, simply because
1051 any non-<a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> return is considered a fatal condition so further
1052 program behaviour is undefined.</td>
1053 </tr>
1054 <tr>
1055 <td><p><span class="term"><a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *<em class="structfield"><code><a name="GTypeValueTable.lcopy-format"></a>lcopy_format</code></em>;</span></p></td>
1056 <td>Format description of the arguments to collect for <em class="parameter"><code>lcopy_value</code></em>,
1057 analogous to <em class="parameter"><code>collect_format</code></em>. Usually, <em class="parameter"><code>lcopy_format</code></em> string consists
1058 only of 'p's to provide <code class="function">lcopy_value()</code> with pointers to storage locations.</td>
1059 </tr>
1060 <tr>
1061 <td><p><span class="term"><em class="structfield"><code><a name="GTypeValueTable.lcopy-value"></a>lcopy_value</code></em> ()</span></p></td>
1062 <td>This function is responsible for storing the <em class="parameter"><code>value</code></em> contents into
1063 arguments passed through a variable argument list which got
1064 collected into <em class="parameter"><code>collect_values</code></em> according to <em class="parameter"><code>lcopy_format</code></em>.
1065 <em class="parameter"><code>n_collect_values</code></em> equals the string length of <em class="parameter"><code>lcopy_format</code></em>,
1066 and <em class="parameter"><code>collect_flags</code></em> may contain <code class="literal">G_VALUE_NOCOPY_CONTENTS</code>.
1067 In contrast to <code class="function">collect_value()</code>, <code class="function">lcopy_value()</code> is obliged to
1068 always properly support <code class="literal">G_VALUE_NOCOPY_CONTENTS</code>.
1069 Similar to <code class="function">collect_value()</code> the function may prematurely abort
1070 by returning a newly allocated string describing an error condition.
1071 To complete the string example:
1072 <div class="informalexample">
1073   <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
1074     <tbody>
1075       <tr>
1076         <td class="listing_lines" align="right"><pre>1
1077 2
1078 3
1079 4
1080 5
1081 6
1082 7</pre></td>
1083         <td class="listing_code"><pre class="programlisting"><span class="usertype">gchar</span><span class="normal"> </span><span class="symbol">**</span><span class="normal">string_p </span><span class="symbol">=</span><span class="normal"> collect_values</span><span class="symbol">[</span><span class="number">0</span><span class="symbol">].</span><span class="normal">v_pointer</span><span class="symbol">;</span>
1084 <span class="keyword">if</span><span class="normal"> </span><span class="symbol">(!</span><span class="normal">string_p</span><span class="symbol">)</span>
1085 <span class="keyword">return</span><span class="normal"> </span><span class="function"><a href="./../glib/glib/glib-String-Utility-Functions.html#g-strdup-printf">g_strdup_printf</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"string location passed as NULL"</span><span class="symbol">);</span>
1086 <span class="keyword">if</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">collect_flags </span><span class="symbol">&amp;</span><span class="normal"> G_VALUE_NOCOPY_CONTENTS</span><span class="symbol">)</span>
1087 <span class="symbol">*</span><span class="normal">string_p </span><span class="symbol">=</span><span class="normal"> value</span><span class="symbol">-&gt;</span><span class="normal">data</span><span class="symbol">[</span><span class="number">0</span><span class="symbol">].</span><span class="normal">v_pointer</span><span class="symbol">;</span>
1088 <span class="keyword">else</span>
1089 <span class="symbol">*</span><span class="normal">string_p </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="./../glib/glib/glib-String-Utility-Functions.html#g-strdup">g_strdup</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">value</span><span class="symbol">-&gt;</span><span class="normal">data</span><span class="symbol">[</span><span class="number">0</span><span class="symbol">].</span><span class="normal">v_pointer</span><span class="symbol">);</span></pre></td>
1090       </tr>
1091     </tbody>
1092   </table>
1093 </div>
1094
1095 And an illustrative version of <code class="function">lcopy_value()</code> for
1096 reference-counted types:
1097 <div class="informalexample">
1098   <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
1099     <tbody>
1100       <tr>
1101         <td class="listing_lines" align="right"><pre>1
1102 2
1103 3
1104 4
1105 5
1106 6
1107 7
1108 8
1109 9
1110 10</pre></td>
1111         <td class="listing_code"><pre class="programlisting"><span class="usertype">GObject</span><span class="normal"> </span><span class="symbol">**</span><span class="normal">object_p </span><span class="symbol">=</span><span class="normal"> collect_values</span><span class="symbol">[</span><span class="number">0</span><span class="symbol">].</span><span class="normal">v_pointer</span><span class="symbol">;</span>
1112 <span class="keyword">if</span><span class="normal"> </span><span class="symbol">(!</span><span class="normal">object_p</span><span class="symbol">)</span>
1113 <span class="keyword">return</span><span class="normal"> </span><span class="function"><a href="./../glib/glib/glib-String-Utility-Functions.html#g-strdup-printf">g_strdup_printf</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"object location passed as NULL"</span><span class="symbol">);</span>
1114 <span class="keyword">if</span><span class="normal"> </span><span class="symbol">(!</span><span class="normal">value</span><span class="symbol">-&gt;</span><span class="normal">data</span><span class="symbol">[</span><span class="number">0</span><span class="symbol">].</span><span class="normal">v_pointer</span><span class="symbol">)</span>
1115 <span class="symbol">*</span><span class="normal">object_p </span><span class="symbol">=</span><span class="normal"> <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">;</span>
1116 <span class="keyword">else</span><span class="normal"> </span><span class="keyword">if</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">collect_flags </span><span class="symbol">&amp;</span><span class="normal"> G_VALUE_NOCOPY_CONTENTS</span><span class="symbol">)</span><span class="normal"> </span><span class="comment">/* always honour */</span>
1117 <span class="symbol">*</span><span class="normal">object_p </span><span class="symbol">=</span><span class="normal"> value</span><span class="symbol">-&gt;</span><span class="normal">data</span><span class="symbol">[</span><span class="number">0</span><span class="symbol">].</span><span class="normal">v_pointer</span><span class="symbol">;</span>
1118 <span class="keyword">else</span>
1119 <span class="symbol">*</span><span class="normal">object_p </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="gobject-The-Base-Object-Type.html#g-object-ref">g_object_ref</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">value</span><span class="symbol">-&gt;</span><span class="normal">data</span><span class="symbol">[</span><span class="number">0</span><span class="symbol">].</span><span class="normal">v_pointer</span><span class="symbol">);</span>
1120 <span class="keyword">return</span><span class="normal"> <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">;</span></pre></td>
1121       </tr>
1122     </tbody>
1123   </table>
1124 </div>
1125
1126 </td>
1127 </tr>
1128 </tbody>
1129 </table></div>
1130 </div>
1131 <hr>
1132 <div class="refsect2">
1133 <a name="G-TYPE-FROM-INSTANCE:CAPS"></a><h3>G_TYPE_FROM_INSTANCE()</h3>
1134 <pre class="programlisting">#define G_TYPE_FROM_INSTANCE(instance)                          (G_TYPE_FROM_CLASS (((GTypeInstance*) (instance))-&gt;g_class))
1135 </pre>
1136 <p>
1137 Get the type identifier from a given <em class="parameter"><code>instance</code></em> structure. 
1138 </p>
1139 <p>
1140 This macro should only be used in type implementations.
1141 </p>
1142 <div class="variablelist"><table border="0">
1143 <col align="left" valign="top">
1144 <tbody>
1145 <tr>
1146 <td><p><span class="term"><em class="parameter"><code>instance</code></em> :</span></p></td>
1147 <td>Location of a valid <a class="link" href="gobject-Type-Information.html#GTypeInstance" title="struct GTypeInstance"><span class="type">GTypeInstance</span></a> structure.</td>
1148 </tr>
1149 <tr>
1150 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1151 <td>the <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a>
1152 </td>
1153 </tr>
1154 </tbody>
1155 </table></div>
1156 </div>
1157 <hr>
1158 <div class="refsect2">
1159 <a name="G-TYPE-FROM-CLASS:CAPS"></a><h3>G_TYPE_FROM_CLASS()</h3>
1160 <pre class="programlisting">#define G_TYPE_FROM_CLASS(g_class)                              (((GTypeClass*) (g_class))-&gt;g_type)
1161 </pre>
1162 <p>
1163 Get the type identifier from a given <em class="parameter"><code>class</code></em> structure.
1164 </p>
1165 <p>
1166 This macro should only be used in type implementations.
1167 </p>
1168 <div class="variablelist"><table border="0">
1169 <col align="left" valign="top">
1170 <tbody>
1171 <tr>
1172 <td><p><span class="term"><em class="parameter"><code>g_class</code></em> :</span></p></td>
1173 <td>Location of a valid <a class="link" href="gobject-Type-Information.html#GTypeClass" title="struct GTypeClass"><span class="type">GTypeClass</span></a> structure.</td>
1174 </tr>
1175 <tr>
1176 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1177 <td>the <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a>
1178 </td>
1179 </tr>
1180 </tbody>
1181 </table></div>
1182 </div>
1183 <hr>
1184 <div class="refsect2">
1185 <a name="G-TYPE-FROM-INTERFACE:CAPS"></a><h3>G_TYPE_FROM_INTERFACE()</h3>
1186 <pre class="programlisting">#define G_TYPE_FROM_INTERFACE(g_iface)                          (((GTypeInterface*) (g_iface))-&gt;g_type)
1187 </pre>
1188 <p>
1189 Get the type identifier from a given <em class="parameter"><code>interface</code></em> structure.
1190 </p>
1191 <p>
1192 This macro should only be used in type implementations.
1193 </p>
1194 <div class="variablelist"><table border="0">
1195 <col align="left" valign="top">
1196 <tbody>
1197 <tr>
1198 <td><p><span class="term"><em class="parameter"><code>g_iface</code></em> :</span></p></td>
1199 <td>Location of a valid <a class="link" href="gobject-Type-Information.html#GTypeInterface" title="struct GTypeInterface"><span class="type">GTypeInterface</span></a> structure.</td>
1200 </tr>
1201 <tr>
1202 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1203 <td>the <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a>
1204 </td>
1205 </tr>
1206 </tbody>
1207 </table></div>
1208 </div>
1209 <hr>
1210 <div class="refsect2">
1211 <a name="G-TYPE-INSTANCE-GET-CLASS:CAPS"></a><h3>G_TYPE_INSTANCE_GET_CLASS()</h3>
1212 <pre class="programlisting">#define G_TYPE_INSTANCE_GET_CLASS(instance, g_type, c_type)     (_G_TYPE_IGC ((instance), (g_type), c_type))
1213 </pre>
1214 <p>
1215 Get the class structure of a given <em class="parameter"><code>instance</code></em>, casted
1216 to a specified ancestor type <em class="parameter"><code>g_type</code></em> of the instance.
1217 </p>
1218 <p>
1219 Note that while calling a <a class="link" href="gobject-Type-Information.html#GInstanceInitFunc" title="GInstanceInitFunc ()"><code class="function">GInstanceInitFunc()</code></a>, the class pointer gets
1220 modified, so it might not always return the expected pointer.
1221 </p>
1222 <p>
1223 This macro should only be used in type implementations.
1224 </p>
1225 <div class="variablelist"><table border="0">
1226 <col align="left" valign="top">
1227 <tbody>
1228 <tr>
1229 <td><p><span class="term"><em class="parameter"><code>instance</code></em> :</span></p></td>
1230 <td>Location of the <a class="link" href="gobject-Type-Information.html#GTypeInstance" title="struct GTypeInstance"><span class="type">GTypeInstance</span></a> structure.</td>
1231 </tr>
1232 <tr>
1233 <td><p><span class="term"><em class="parameter"><code>g_type</code></em> :</span></p></td>
1234 <td>The <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> of the class to be returned.</td>
1235 </tr>
1236 <tr>
1237 <td><p><span class="term"><em class="parameter"><code>c_type</code></em> :</span></p></td>
1238 <td>The C type of the class structure.</td>
1239 </tr>
1240 <tr>
1241 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1242 <td>a pointer to the class structure</td>
1243 </tr>
1244 </tbody>
1245 </table></div>
1246 </div>
1247 <hr>
1248 <div class="refsect2">
1249 <a name="G-TYPE-INSTANCE-GET-INTERFACE:CAPS"></a><h3>G_TYPE_INSTANCE_GET_INTERFACE()</h3>
1250 <pre class="programlisting">#define G_TYPE_INSTANCE_GET_INTERFACE(instance, g_type, c_type) (_G_TYPE_IGI ((instance), (g_type), c_type))
1251 </pre>
1252 <p>
1253 Get the interface structure for interface <em class="parameter"><code>g_type</code></em> of a given <em class="parameter"><code>instance</code></em>.
1254 </p>
1255 <p>
1256 This macro should only be used in type implementations.
1257 </p>
1258 <div class="variablelist"><table border="0">
1259 <col align="left" valign="top">
1260 <tbody>
1261 <tr>
1262 <td><p><span class="term"><em class="parameter"><code>instance</code></em> :</span></p></td>
1263 <td>Location of the <a class="link" href="gobject-Type-Information.html#GTypeInstance" title="struct GTypeInstance"><span class="type">GTypeInstance</span></a> structure.</td>
1264 </tr>
1265 <tr>
1266 <td><p><span class="term"><em class="parameter"><code>g_type</code></em> :</span></p></td>
1267 <td>The <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> of the interface to be returned.</td>
1268 </tr>
1269 <tr>
1270 <td><p><span class="term"><em class="parameter"><code>c_type</code></em> :</span></p></td>
1271 <td>The C type of the interface structure.</td>
1272 </tr>
1273 <tr>
1274 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1275 <td>a pointer to the interface structure</td>
1276 </tr>
1277 </tbody>
1278 </table></div>
1279 </div>
1280 <hr>
1281 <div class="refsect2">
1282 <a name="G-TYPE-INSTANCE-GET-PRIVATE:CAPS"></a><h3>G_TYPE_INSTANCE_GET_PRIVATE()</h3>
1283 <pre class="programlisting">#define G_TYPE_INSTANCE_GET_PRIVATE(instance, g_type, c_type)   ((c_type*) g_type_instance_get_private ((GTypeInstance*) (instance), (g_type)))
1284 </pre>
1285 <p>
1286 Gets the private structure for a particular type.
1287 The private structure must have been registered in the
1288 class_init function with <a class="link" href="gobject-Type-Information.html#g-type-class-add-private" title="g_type_class_add_private ()"><code class="function">g_type_class_add_private()</code></a>.
1289 </p>
1290 <p>
1291 This macro should only be used in type implementations.
1292 </p>
1293 <div class="variablelist"><table border="0">
1294 <col align="left" valign="top">
1295 <tbody>
1296 <tr>
1297 <td><p><span class="term"><em class="parameter"><code>instance</code></em> :</span></p></td>
1298 <td>the instance of a type deriving from <em class="parameter"><code>private_type</code></em>.</td>
1299 </tr>
1300 <tr>
1301 <td><p><span class="term"><em class="parameter"><code>g_type</code></em> :</span></p></td>
1302 <td>the type identifying which private data to retrieve.</td>
1303 </tr>
1304 <tr>
1305 <td><p><span class="term"><em class="parameter"><code>c_type</code></em> :</span></p></td>
1306 <td>The C type for the private structure.</td>
1307 </tr>
1308 <tr>
1309 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1310 <td>a pointer to the private data structure.</td>
1311 </tr>
1312 </tbody>
1313 </table></div>
1314 <p class="since">Since 2.4</p>
1315 </div>
1316 <hr>
1317 <div class="refsect2">
1318 <a name="G-TYPE-CLASS-GET-PRIVATE:CAPS"></a><h3>G_TYPE_CLASS_GET_PRIVATE()</h3>
1319 <pre class="programlisting">#define G_TYPE_CLASS_GET_PRIVATE(klass, g_type, c_type)   ((c_type*) g_type_class_get_private ((GTypeClass*) (klass), (g_type)))
1320 </pre>
1321 <p>
1322 Gets the private class structure for a particular type.
1323 The private structure must have been registered in the
1324 <code class="function">get_type()</code> function with <a class="link" href="gobject-Type-Information.html#g-type-add-class-private" title="g_type_add_class_private ()"><code class="function">g_type_add_class_private()</code></a>.
1325 </p>
1326 <p>
1327 This macro should only be used in type implementations.
1328 </p>
1329 <div class="variablelist"><table border="0">
1330 <col align="left" valign="top">
1331 <tbody>
1332 <tr>
1333 <td><p><span class="term"><em class="parameter"><code>klass</code></em> :</span></p></td>
1334 <td>the class of a type deriving from <em class="parameter"><code>private_type</code></em>.</td>
1335 </tr>
1336 <tr>
1337 <td><p><span class="term"><em class="parameter"><code>g_type</code></em> :</span></p></td>
1338 <td>the type identifying which private data to retrieve.</td>
1339 </tr>
1340 <tr>
1341 <td><p><span class="term"><em class="parameter"><code>c_type</code></em> :</span></p></td>
1342 <td>The C type for the private structure.</td>
1343 </tr>
1344 <tr>
1345 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1346 <td>a pointer to the private data structure.</td>
1347 </tr>
1348 </tbody>
1349 </table></div>
1350 <p class="since">Since 2.24</p>
1351 </div>
1352 <hr>
1353 <div class="refsect2">
1354 <a name="G-TYPE-CHECK-INSTANCE:CAPS"></a><h3>G_TYPE_CHECK_INSTANCE()</h3>
1355 <pre class="programlisting">#define G_TYPE_CHECK_INSTANCE(instance)                             (_G_TYPE_CHI ((GTypeInstance*) (instance)))
1356 </pre>
1357 <p>
1358 Checks if <em class="parameter"><code>instance</code></em> is a valid <a class="link" href="gobject-Type-Information.html#GTypeInstance" title="struct GTypeInstance"><span class="type">GTypeInstance</span></a> structure,
1359 otherwise issues a warning and returns <a href="./../glib/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>.
1360 </p>
1361 <p>
1362 This macro should only be used in type implementations.
1363 </p>
1364 <div class="variablelist"><table border="0">
1365 <col align="left" valign="top">
1366 <tbody>
1367 <tr>
1368 <td><p><span class="term"><em class="parameter"><code>instance</code></em> :</span></p></td>
1369 <td>Location of a <a class="link" href="gobject-Type-Information.html#GTypeInstance" title="struct GTypeInstance"><span class="type">GTypeInstance</span></a> structure.</td>
1370 </tr>
1371 <tr>
1372 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1373 <td>
1374 <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success.</td>
1375 </tr>
1376 </tbody>
1377 </table></div>
1378 </div>
1379 <hr>
1380 <div class="refsect2">
1381 <a name="G-TYPE-CHECK-INSTANCE-CAST:CAPS"></a><h3>G_TYPE_CHECK_INSTANCE_CAST()</h3>
1382 <pre class="programlisting">#define G_TYPE_CHECK_INSTANCE_CAST(instance, g_type, c_type)    (_G_TYPE_CIC ((instance), (g_type), c_type))
1383 </pre>
1384 <p>
1385 Checks that <em class="parameter"><code>instance</code></em> is an instance of the type identified by <em class="parameter"><code>g_type</code></em>
1386 and issues a warning if this is not the case. Returns <em class="parameter"><code>instance</code></em> casted 
1387 to a pointer to <em class="parameter"><code>c_type</code></em>.
1388 </p>
1389 <p>
1390 This macro should only be used in type implementations.
1391 </p>
1392 <div class="variablelist"><table border="0">
1393 <col align="left" valign="top">
1394 <tbody>
1395 <tr>
1396 <td><p><span class="term"><em class="parameter"><code>instance</code></em> :</span></p></td>
1397 <td>Location of a <a class="link" href="gobject-Type-Information.html#GTypeInstance" title="struct GTypeInstance"><span class="type">GTypeInstance</span></a> structure.</td>
1398 </tr>
1399 <tr>
1400 <td><p><span class="term"><em class="parameter"><code>g_type</code></em> :</span></p></td>
1401 <td>The type to be returned.</td>
1402 </tr>
1403 <tr>
1404 <td><p><span class="term"><em class="parameter"><code>c_type</code></em> :</span></p></td>
1405 <td>The corresponding C type of <em class="parameter"><code>g_type</code></em>.</td>
1406 </tr>
1407 </tbody>
1408 </table></div>
1409 </div>
1410 <hr>
1411 <div class="refsect2">
1412 <a name="G-TYPE-CHECK-INSTANCE-TYPE:CAPS"></a><h3>G_TYPE_CHECK_INSTANCE_TYPE()</h3>
1413 <pre class="programlisting">#define G_TYPE_CHECK_INSTANCE_TYPE(instance, g_type)            (_G_TYPE_CIT ((instance), (g_type)))
1414 </pre>
1415 <p>
1416 Checks if <em class="parameter"><code>instance</code></em> is an instance of the type identified by <em class="parameter"><code>g_type</code></em>.
1417 </p>
1418 <p>
1419 This macro should only be used in type implementations.
1420 </p>
1421 <div class="variablelist"><table border="0">
1422 <col align="left" valign="top">
1423 <tbody>
1424 <tr>
1425 <td><p><span class="term"><em class="parameter"><code>instance</code></em> :</span></p></td>
1426 <td>Location of a <a class="link" href="gobject-Type-Information.html#GTypeInstance" title="struct GTypeInstance"><span class="type">GTypeInstance</span></a> structure.</td>
1427 </tr>
1428 <tr>
1429 <td><p><span class="term"><em class="parameter"><code>g_type</code></em> :</span></p></td>
1430 <td>The type to be checked</td>
1431 </tr>
1432 <tr>
1433 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1434 <td>
1435 <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success.</td>
1436 </tr>
1437 </tbody>
1438 </table></div>
1439 </div>
1440 <hr>
1441 <div class="refsect2">
1442 <a name="G-TYPE-CHECK-CLASS-CAST:CAPS"></a><h3>G_TYPE_CHECK_CLASS_CAST()</h3>
1443 <pre class="programlisting">#define G_TYPE_CHECK_CLASS_CAST(g_class, g_type, c_type)        (_G_TYPE_CCC ((g_class), (g_type), c_type))
1444 </pre>
1445 <p>
1446 Checks that <em class="parameter"><code>g_class</code></em> is a class structure of the type identified by <em class="parameter"><code>g_type</code></em>
1447 and issues a warning if this is not the case. Returns <em class="parameter"><code>g_class</code></em> casted 
1448 to a pointer to <em class="parameter"><code>c_type</code></em>.
1449 </p>
1450 <p>
1451 This macro should only be used in type implementations.
1452 </p>
1453 <div class="variablelist"><table border="0">
1454 <col align="left" valign="top">
1455 <tbody>
1456 <tr>
1457 <td><p><span class="term"><em class="parameter"><code>g_class</code></em> :</span></p></td>
1458 <td>Location of a <a class="link" href="gobject-Type-Information.html#GTypeClass" title="struct GTypeClass"><span class="type">GTypeClass</span></a> structure.</td>
1459 </tr>
1460 <tr>
1461 <td><p><span class="term"><em class="parameter"><code>g_type</code></em> :</span></p></td>
1462 <td>The type to be returned.</td>
1463 </tr>
1464 <tr>
1465 <td><p><span class="term"><em class="parameter"><code>c_type</code></em> :</span></p></td>
1466 <td>The corresponding C type of class structure of <em class="parameter"><code>g_type</code></em>.</td>
1467 </tr>
1468 </tbody>
1469 </table></div>
1470 </div>
1471 <hr>
1472 <div class="refsect2">
1473 <a name="G-TYPE-CHECK-CLASS-TYPE:CAPS"></a><h3>G_TYPE_CHECK_CLASS_TYPE()</h3>
1474 <pre class="programlisting">#define G_TYPE_CHECK_CLASS_TYPE(g_class, g_type)                (_G_TYPE_CCT ((g_class), (g_type)))
1475 </pre>
1476 <p>
1477 Checks if <em class="parameter"><code>g_class</code></em> is a class structure of the type identified by 
1478 <em class="parameter"><code>g_type</code></em>.
1479 </p>
1480 <p>
1481 This macro should only be used in type implementations.
1482 </p>
1483 <div class="variablelist"><table border="0">
1484 <col align="left" valign="top">
1485 <tbody>
1486 <tr>
1487 <td><p><span class="term"><em class="parameter"><code>g_class</code></em> :</span></p></td>
1488 <td>Location of a <a class="link" href="gobject-Type-Information.html#GTypeClass" title="struct GTypeClass"><span class="type">GTypeClass</span></a> structure.</td>
1489 </tr>
1490 <tr>
1491 <td><p><span class="term"><em class="parameter"><code>g_type</code></em> :</span></p></td>
1492 <td>The type to be checked.</td>
1493 </tr>
1494 <tr>
1495 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1496 <td>
1497 <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success.</td>
1498 </tr>
1499 </tbody>
1500 </table></div>
1501 </div>
1502 <hr>
1503 <div class="refsect2">
1504 <a name="G-TYPE-CHECK-VALUE:CAPS"></a><h3>G_TYPE_CHECK_VALUE()</h3>
1505 <pre class="programlisting">#define G_TYPE_CHECK_VALUE(value)                           (_G_TYPE_CHV ((value)))
1506 </pre>
1507 <p>
1508 Checks if <em class="parameter"><code>value</code></em> has been initialized to hold values
1509 of a value type.
1510 </p>
1511 <p>
1512 This macro should only be used in type implementations.
1513 </p>
1514 <div class="variablelist"><table border="0">
1515 <col align="left" valign="top">
1516 <tbody>
1517 <tr>
1518 <td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
1519 <td>a <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a>
1520 </td>
1521 </tr>
1522 <tr>
1523 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1524 <td>
1525 <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success.</td>
1526 </tr>
1527 </tbody>
1528 </table></div>
1529 </div>
1530 <hr>
1531 <div class="refsect2">
1532 <a name="G-TYPE-CHECK-VALUE-TYPE:CAPS"></a><h3>G_TYPE_CHECK_VALUE_TYPE()</h3>
1533 <pre class="programlisting">#define G_TYPE_CHECK_VALUE_TYPE(value, g_type)                      (_G_TYPE_CVH ((value), (g_type)))
1534 </pre>
1535 <p>
1536 Checks if <em class="parameter"><code>value</code></em> has been initialized to hold values
1537 of type <em class="parameter"><code>g_type</code></em>. 
1538 </p>
1539 <p>
1540 This macro should only be used in type implementations.
1541 </p>
1542 <div class="variablelist"><table border="0">
1543 <col align="left" valign="top">
1544 <tbody>
1545 <tr>
1546 <td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
1547 <td>a <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a>
1548 </td>
1549 </tr>
1550 <tr>
1551 <td><p><span class="term"><em class="parameter"><code>g_type</code></em> :</span></p></td>
1552 <td>The type to be checked.</td>
1553 </tr>
1554 <tr>
1555 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1556 <td>
1557 <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success.</td>
1558 </tr>
1559 </tbody>
1560 </table></div>
1561 </div>
1562 <hr>
1563 <div class="refsect2">
1564 <a name="G-TYPE-FLAG-RESERVED-ID-BIT:CAPS"></a><h3>G_TYPE_FLAG_RESERVED_ID_BIT</h3>
1565 <pre class="programlisting">#define G_TYPE_FLAG_RESERVED_ID_BIT ((GType) (1 &lt;&lt; 0))
1566 </pre>
1567 <p>
1568 A bit in the type number that's supposed to be left untouched.
1569 </p>
1570 </div>
1571 <hr>
1572 <div class="refsect2">
1573 <a name="g-type-init"></a><h3>g_type_init ()</h3>
1574 <pre class="programlisting"><span class="returnvalue">void</span>                g_type_init                         (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
1575 <p>
1576 Prior to any use of the type system, <a class="link" href="gobject-Type-Information.html#g-type-init" title="g_type_init ()"><code class="function">g_type_init()</code></a> has to be called
1577 to initialize the type system and assorted other code portions
1578 (such as the various fundamental type implementations or the signal
1579 system).
1580 </p>
1581 <p>
1582 This function is idempotent.
1583 </p>
1584 <p>
1585 Since version 2.24 this also initializes the thread system
1586 </p>
1587 </div>
1588 <hr>
1589 <div class="refsect2">
1590 <a name="GTypeDebugFlags"></a><h3>enum GTypeDebugFlags</h3>
1591 <pre class="programlisting">typedef enum {
1592   G_TYPE_DEBUG_NONE = 0,
1593   G_TYPE_DEBUG_OBJECTS = 1 &lt;&lt; 0,
1594   G_TYPE_DEBUG_SIGNALS = 1 &lt;&lt; 1,
1595   G_TYPE_DEBUG_MASK = 0x03
1596 } GTypeDebugFlags;
1597 </pre>
1598 <p>
1599 The <span class="type">GTypeDebugFlags</span> enumeration values can be passed to
1600 <a class="link" href="gobject-Type-Information.html#g-type-init-with-debug-flags" title="g_type_init_with_debug_flags ()"><code class="function">g_type_init_with_debug_flags()</code></a> to trigger debugging messages during runtime.
1601 Note that the messages can also be triggered by setting the
1602 <code class="envar">GOBJECT_DEBUG</code> environment variable to a ':'-separated list of 
1603 "objects" and "signals".
1604 </p>
1605 <div class="variablelist"><table border="0">
1606 <col align="left" valign="top">
1607 <tbody>
1608 <tr>
1609 <td><p><a name="G-TYPE-DEBUG-NONE:CAPS"></a><span class="term"><code class="literal">G_TYPE_DEBUG_NONE</code></span></p></td>
1610 <td>Print no messages.
1611 </td>
1612 </tr>
1613 <tr>
1614 <td><p><a name="G-TYPE-DEBUG-OBJECTS:CAPS"></a><span class="term"><code class="literal">G_TYPE_DEBUG_OBJECTS</code></span></p></td>
1615 <td>Print messages about object bookkeeping.
1616 </td>
1617 </tr>
1618 <tr>
1619 <td><p><a name="G-TYPE-DEBUG-SIGNALS:CAPS"></a><span class="term"><code class="literal">G_TYPE_DEBUG_SIGNALS</code></span></p></td>
1620 <td>Print messages about signal emissions.
1621 </td>
1622 </tr>
1623 <tr>
1624 <td><p><a name="G-TYPE-DEBUG-MASK:CAPS"></a><span class="term"><code class="literal">G_TYPE_DEBUG_MASK</code></span></p></td>
1625 <td>Mask covering all debug flags.
1626 </td>
1627 </tr>
1628 </tbody>
1629 </table></div>
1630 </div>
1631 <hr>
1632 <div class="refsect2">
1633 <a name="g-type-init-with-debug-flags"></a><h3>g_type_init_with_debug_flags ()</h3>
1634 <pre class="programlisting"><span class="returnvalue">void</span>                g_type_init_with_debug_flags        (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GTypeDebugFlags" title="enum GTypeDebugFlags"><span class="type">GTypeDebugFlags</span></a> debug_flags</code></em>);</pre>
1635 <p>
1636 Similar to <a class="link" href="gobject-Type-Information.html#g-type-init" title="g_type_init ()"><code class="function">g_type_init()</code></a>, but additionally sets debug flags.
1637 </p>
1638 <p>
1639 This function is idempotent.
1640 </p>
1641 <div class="variablelist"><table border="0">
1642 <col align="left" valign="top">
1643 <tbody><tr>
1644 <td><p><span class="term"><em class="parameter"><code>debug_flags</code></em> :</span></p></td>
1645 <td>Bitwise combination of <a class="link" href="gobject-Type-Information.html#GTypeDebugFlags" title="enum GTypeDebugFlags"><span class="type">GTypeDebugFlags</span></a> values for
1646 debugging purposes.</td>
1647 </tr></tbody>
1648 </table></div>
1649 </div>
1650 <hr>
1651 <div class="refsect2">
1652 <a name="g-type-name"></a><h3>g_type_name ()</h3>
1653 <pre class="programlisting">const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *       g_type_name                         (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>);</pre>
1654 <p>
1655 Get the unique name that is assigned to a type ID.  Note that this
1656 function (like all other GType API) cannot cope with invalid type
1657 IDs. <a class="link" href="gobject-Type-Information.html#G-TYPE-INVALID:CAPS" title="G_TYPE_INVALID"><code class="literal">G_TYPE_INVALID</code></a> may be passed to this function, as may be any
1658 other validly registered type ID, but randomized type IDs should
1659 not be passed in and will most likely lead to a crash.
1660 </p>
1661 <div class="variablelist"><table border="0">
1662 <col align="left" valign="top">
1663 <tbody>
1664 <tr>
1665 <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
1666 <td>Type to return name for.</td>
1667 </tr>
1668 <tr>
1669 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1670 <td>Static type name or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.</td>
1671 </tr>
1672 </tbody>
1673 </table></div>
1674 </div>
1675 <hr>
1676 <div class="refsect2">
1677 <a name="g-type-qname"></a><h3>g_type_qname ()</h3>
1678 <pre class="programlisting"><a href="./../glib/glib/glib-Quarks.html#GQuark"><span class="returnvalue">GQuark</span></a>              g_type_qname                        (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>);</pre>
1679 <p>
1680 Get the corresponding quark of the type IDs name.
1681 </p>
1682 <div class="variablelist"><table border="0">
1683 <col align="left" valign="top">
1684 <tbody>
1685 <tr>
1686 <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
1687 <td>Type to return quark of type name for.</td>
1688 </tr>
1689 <tr>
1690 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1691 <td>The type names quark or 0.</td>
1692 </tr>
1693 </tbody>
1694 </table></div>
1695 </div>
1696 <hr>
1697 <div class="refsect2">
1698 <a name="g-type-from-name"></a><h3>g_type_from_name ()</h3>
1699 <pre class="programlisting"><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a>               g_type_from_name                    (<em class="parameter"><code>const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *name</code></em>);</pre>
1700 <p>
1701 Lookup the type ID from a given type name, returning 0 if no type
1702 has been registered under this name (this is the preferred method
1703 to find out by name whether a specific type has been registered
1704 yet).
1705 </p>
1706 <div class="variablelist"><table border="0">
1707 <col align="left" valign="top">
1708 <tbody>
1709 <tr>
1710 <td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
1711 <td>Type name to lookup.</td>
1712 </tr>
1713 <tr>
1714 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1715 <td>Corresponding type ID or 0.</td>
1716 </tr>
1717 </tbody>
1718 </table></div>
1719 </div>
1720 <hr>
1721 <div class="refsect2">
1722 <a name="g-type-parent"></a><h3>g_type_parent ()</h3>
1723 <pre class="programlisting"><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a>               g_type_parent                       (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>);</pre>
1724 <p>
1725 Return the direct parent type of the passed in type.  If the passed
1726 in type has no parent, i.e. is a fundamental type, 0 is returned.
1727 </p>
1728 <div class="variablelist"><table border="0">
1729 <col align="left" valign="top">
1730 <tbody>
1731 <tr>
1732 <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
1733 <td>The derived type.</td>
1734 </tr>
1735 <tr>
1736 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1737 <td>The parent type.</td>
1738 </tr>
1739 </tbody>
1740 </table></div>
1741 </div>
1742 <hr>
1743 <div class="refsect2">
1744 <a name="g-type-depth"></a><h3>g_type_depth ()</h3>
1745 <pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>               g_type_depth                        (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>);</pre>
1746 <p>
1747 Returns the length of the ancestry of the passed in type. This
1748 includes the type itself, so that e.g. a fundamental type has depth 1.
1749 </p>
1750 <div class="variablelist"><table border="0">
1751 <col align="left" valign="top">
1752 <tbody>
1753 <tr>
1754 <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
1755 <td>A <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value.</td>
1756 </tr>
1757 <tr>
1758 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1759 <td>The depth of <em class="parameter"><code>type</code></em>.</td>
1760 </tr>
1761 </tbody>
1762 </table></div>
1763 </div>
1764 <hr>
1765 <div class="refsect2">
1766 <a name="g-type-next-base"></a><h3>g_type_next_base ()</h3>
1767 <pre class="programlisting"><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a>               g_type_next_base                    (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> leaf_type</code></em>,
1768                                                          <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> root_type</code></em>);</pre>
1769 <p>
1770 Given a <em class="parameter"><code>leaf_type</code></em> and a <em class="parameter"><code>root_type</code></em> which is contained in its
1771 anchestry, return the type that <em class="parameter"><code>root_type</code></em> is the immediate parent
1772 of.  In other words, this function determines the type that is
1773 derived directly from <em class="parameter"><code>root_type</code></em> which is also a base class of
1774 <em class="parameter"><code>leaf_type</code></em>.  Given a root type and a leaf type, this function can
1775 be used to determine the types and order in which the leaf type is
1776 descended from the root type.
1777 </p>
1778 <div class="variablelist"><table border="0">
1779 <col align="left" valign="top">
1780 <tbody>
1781 <tr>
1782 <td><p><span class="term"><em class="parameter"><code>leaf_type</code></em> :</span></p></td>
1783 <td>Descendant of <em class="parameter"><code>root_type</code></em> and the type to be returned.</td>
1784 </tr>
1785 <tr>
1786 <td><p><span class="term"><em class="parameter"><code>root_type</code></em> :</span></p></td>
1787 <td>Immediate parent of the returned type.</td>
1788 </tr>
1789 <tr>
1790 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1791 <td>Immediate child of <em class="parameter"><code>root_type</code></em> and anchestor of <em class="parameter"><code>leaf_type</code></em>.</td>
1792 </tr>
1793 </tbody>
1794 </table></div>
1795 </div>
1796 <hr>
1797 <div class="refsect2">
1798 <a name="g-type-is-a"></a><h3>g_type_is_a ()</h3>
1799 <pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            g_type_is_a                         (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>,
1800                                                          <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> is_a_type</code></em>);</pre>
1801 <p>
1802 If <em class="parameter"><code>is_a_type</code></em> is a derivable type, check whether <em class="parameter"><code>type</code></em> is a
1803 descendant of <em class="parameter"><code>is_a_type</code></em>.  If <em class="parameter"><code>is_a_type</code></em> is an interface, check
1804 whether <em class="parameter"><code>type</code></em> conforms to it.
1805 </p>
1806 <div class="variablelist"><table border="0">
1807 <col align="left" valign="top">
1808 <tbody>
1809 <tr>
1810 <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
1811 <td>Type to check anchestry for.</td>
1812 </tr>
1813 <tr>
1814 <td><p><span class="term"><em class="parameter"><code>is_a_type</code></em> :</span></p></td>
1815 <td>Possible anchestor of <em class="parameter"><code>type</code></em> or interface <em class="parameter"><code>type</code></em> could conform to.</td>
1816 </tr>
1817 <tr>
1818 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1819 <td>
1820 <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if <em class="parameter"><code>type</code></em> is_a <em class="parameter"><code>is_a_type</code></em> holds true.</td>
1821 </tr>
1822 </tbody>
1823 </table></div>
1824 </div>
1825 <hr>
1826 <div class="refsect2">
1827 <a name="g-type-class-ref"></a><h3>g_type_class_ref ()</h3>
1828 <pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a>            g_type_class_ref                    (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>);</pre>
1829 <p>
1830 Increments the reference count of the class structure belonging to
1831 <em class="parameter"><code>type</code></em>. This function will demand-create the class if it doesn't
1832 exist already.
1833 </p>
1834 <div class="variablelist"><table border="0">
1835 <col align="left" valign="top">
1836 <tbody>
1837 <tr>
1838 <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
1839 <td>Type ID of a classed type.</td>
1840 </tr>
1841 <tr>
1842 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1843 <td>The <a class="link" href="gobject-Type-Information.html#GTypeClass" title="struct GTypeClass"><span class="type">GTypeClass</span></a>
1844 structure for the given type ID. <span class="annotation">[<acronym title="Override the parsed C type with given type"><span class="acronym">type</span></acronym> GObject.TypeClass][<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
1845 </td>
1846 </tr>
1847 </tbody>
1848 </table></div>
1849 </div>
1850 <hr>
1851 <div class="refsect2">
1852 <a name="g-type-class-peek"></a><h3>g_type_class_peek ()</h3>
1853 <pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a>            g_type_class_peek                   (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>);</pre>
1854 <p>
1855 This function is essentially the same as <a class="link" href="gobject-Type-Information.html#g-type-class-ref" title="g_type_class_ref ()"><code class="function">g_type_class_ref()</code></a>, except that
1856 the classes reference count isn't incremented. As a consequence, this function
1857 may return <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the class of the type passed in does not currently
1858 exist (hasn't been referenced before).
1859 </p>
1860 <div class="variablelist"><table border="0">
1861 <col align="left" valign="top">
1862 <tbody>
1863 <tr>
1864 <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
1865 <td>Type ID of a classed type.</td>
1866 </tr>
1867 <tr>
1868 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1869 <td>The <a class="link" href="gobject-Type-Information.html#GTypeClass" title="struct GTypeClass"><span class="type">GTypeClass</span></a>
1870 structure for the given type ID or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the class does not
1871 currently exist. <span class="annotation">[<acronym title="Override the parsed C type with given type"><span class="acronym">type</span></acronym> GObject.TypeClass][<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
1872 </td>
1873 </tr>
1874 </tbody>
1875 </table></div>
1876 </div>
1877 <hr>
1878 <div class="refsect2">
1879 <a name="g-type-class-peek-static"></a><h3>g_type_class_peek_static ()</h3>
1880 <pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a>            g_type_class_peek_static            (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>);</pre>
1881 <p>
1882 A more efficient version of <a class="link" href="gobject-Type-Information.html#g-type-class-peek" title="g_type_class_peek ()"><code class="function">g_type_class_peek()</code></a> which works only for
1883 static types.
1884 </p>
1885 <div class="variablelist"><table border="0">
1886 <col align="left" valign="top">
1887 <tbody>
1888 <tr>
1889 <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
1890 <td>Type ID of a classed type.</td>
1891 </tr>
1892 <tr>
1893 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1894 <td>The <a class="link" href="gobject-Type-Information.html#GTypeClass" title="struct GTypeClass"><span class="type">GTypeClass</span></a>
1895 structure for the given type ID or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the class does not
1896 currently exist or is dynamically loaded. <span class="annotation">[<acronym title="Override the parsed C type with given type"><span class="acronym">type</span></acronym> GObject.TypeClass][<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
1897 </td>
1898 </tr>
1899 </tbody>
1900 </table></div>
1901 <p class="since">Since 2.4</p>
1902 </div>
1903 <hr>
1904 <div class="refsect2">
1905 <a name="g-type-class-unref"></a><h3>g_type_class_unref ()</h3>
1906 <pre class="programlisting"><span class="returnvalue">void</span>                g_type_class_unref                  (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> g_class</code></em>);</pre>
1907 <p>
1908 Decrements the reference count of the class structure being passed in.
1909 Once the last reference count of a class has been released, classes
1910 may be finalized by the type system, so further dereferencing of a
1911 class pointer after <a class="link" href="gobject-Type-Information.html#g-type-class-unref" title="g_type_class_unref ()"><code class="function">g_type_class_unref()</code></a> are invalid.
1912 </p>
1913 <div class="variablelist"><table border="0">
1914 <col align="left" valign="top">
1915 <tbody><tr>
1916 <td><p><span class="term"><em class="parameter"><code>g_class</code></em> :</span></p></td>
1917 <td>The <a class="link" href="gobject-Type-Information.html#GTypeClass" title="struct GTypeClass"><span class="type">GTypeClass</span></a> structure to
1918 unreference. <span class="annotation">[<acronym title="Override the parsed C type with given type"><span class="acronym">type</span></acronym> GObject.TypeClass]</span>
1919 </td>
1920 </tr></tbody>
1921 </table></div>
1922 </div>
1923 <hr>
1924 <div class="refsect2">
1925 <a name="g-type-class-peek-parent"></a><h3>g_type_class_peek_parent ()</h3>
1926 <pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a>            g_type_class_peek_parent            (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> g_class</code></em>);</pre>
1927 <p>
1928 This is a convenience function often needed in class initializers.
1929 It returns the class structure of the immediate parent type of the
1930 class passed in.  Since derived classes hold a reference count on
1931 their parent classes as long as they are instantiated, the returned
1932 class will always exist. This function is essentially equivalent
1933 to:
1934 </p>
1935 <p>
1936 </p>
1937 <pre class="programlisting">
1938 g_type_class_peek (g_type_parent (G_TYPE_FROM_CLASS (g_class)));
1939 </pre>
1940 <p>
1941 </p>
1942 <div class="variablelist"><table border="0">
1943 <col align="left" valign="top">
1944 <tbody>
1945 <tr>
1946 <td><p><span class="term"><em class="parameter"><code>g_class</code></em> :</span></p></td>
1947 <td>The <a class="link" href="gobject-Type-Information.html#GTypeClass" title="struct GTypeClass"><span class="type">GTypeClass</span></a> structure to
1948 retrieve the parent class for. <span class="annotation">[<acronym title="Override the parsed C type with given type"><span class="acronym">type</span></acronym> GObject.TypeClass]</span>
1949 </td>
1950 </tr>
1951 <tr>
1952 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1953 <td>The parent class
1954 of <em class="parameter"><code>g_class</code></em>. <span class="annotation">[<acronym title="Override the parsed C type with given type"><span class="acronym">type</span></acronym> GObject.TypeClass][<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
1955 </td>
1956 </tr>
1957 </tbody>
1958 </table></div>
1959 </div>
1960 <hr>
1961 <div class="refsect2">
1962 <a name="g-type-class-add-private"></a><h3>g_type_class_add_private ()</h3>
1963 <pre class="programlisting"><span class="returnvalue">void</span>                g_type_class_add_private            (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> g_class</code></em>,
1964                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> private_size</code></em>);</pre>
1965 <p>
1966 Registers a private structure for an instantiatable type.
1967 </p>
1968 <p>
1969 When an object is allocated, the private structures for
1970 the type and all of its parent types are allocated
1971 sequentially in the same memory block as the public
1972 structures.
1973 </p>
1974 <p>
1975 Note that the accumulated size of the private structures of
1976 a type and all its parent types cannot excced 64 KiB.
1977 </p>
1978 <p>
1979 This function should be called in the type's <code class="function">class_init()</code> function.
1980 The private structure can be retrieved using the
1981 <a class="link" href="gobject-Type-Information.html#G-TYPE-INSTANCE-GET-PRIVATE:CAPS" title="G_TYPE_INSTANCE_GET_PRIVATE()"><code class="function">G_TYPE_INSTANCE_GET_PRIVATE()</code></a> macro.
1982 </p>
1983 <p>
1984 The following example shows attaching a private structure
1985 <span class="structname">MyObjectPrivate</span> to an object
1986 <span class="structname">MyObject</span> defined in the standard GObject
1987 fashion.
1988 type's <code class="function">class_init()</code> function.
1989 Note the use of a structure member "priv" to avoid the overhead
1990 of repeatedly calling <code class="function">MY_OBJECT_GET_PRIVATE()</code>.
1991 </p>
1992 <p>
1993 </p>
1994 <div class="informalexample">
1995   <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
1996     <tbody>
1997       <tr>
1998         <td class="listing_lines" align="right"><pre>1
1999 2
2000 3
2001 4
2002 5
2003 6
2004 7
2005 8
2006 9
2007 10
2008 11
2009 12
2010 13
2011 14
2012 15
2013 16
2014 17
2015 18
2016 19
2017 20
2018 21
2019 22
2020 23
2021 24
2022 25
2023 26
2024 27
2025 28
2026 29
2027 30
2028 31
2029 32
2030 33
2031 34
2032 35
2033 36
2034 37
2035 38</pre></td>
2036         <td class="listing_code"><pre class="programlisting"><span class="keyword">typedef</span><span class="normal"> </span><span class="keyword">struct</span><span class="normal"> </span><span class="classname">_MyObject</span><span class="normal">        MyObject</span><span class="symbol">;</span>
2037 <span class="keyword">typedef</span><span class="normal"> </span><span class="keyword">struct</span><span class="normal"> </span><span class="classname">_MyObjectPrivate</span><span class="normal"> MyObjectPrivate</span><span class="symbol">;</span>
2038
2039 <span class="keyword">struct</span><span class="normal"> </span><span class="classname">_MyObject</span><span class="normal"> </span><span class="cbracket">{</span>
2040 <span class="normal"> </span><span class="usertype">GObject</span><span class="normal"> parent</span><span class="symbol">;</span>
2041
2042 <span class="normal"> </span><span class="usertype">MyObjectPrivate</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">priv</span><span class="symbol">;</span>
2043 <span class="cbracket">}</span><span class="symbol">;</span>
2044
2045 <span class="keyword">struct</span><span class="normal"> </span><span class="classname">_MyObjectPrivate</span><span class="normal"> </span><span class="cbracket">{</span>
2046 <span class="normal">  </span><span class="type">int</span><span class="normal"> some_field</span><span class="symbol">;</span>
2047 <span class="cbracket">}</span><span class="symbol">;</span>
2048
2049 <span class="keyword">static</span><span class="normal"> </span><span class="type">void</span>
2050 <span class="function">my_object_class_init</span><span class="normal"> </span><span class="symbol">(</span><span class="usertype">MyObjectClass</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">klass</span><span class="symbol">)</span>
2051 <span class="cbracket">{</span>
2052 <span class="normal">  </span><span class="function"><a href="gobject-Type-Information.html#g-type-class-add-private">g_type_class_add_private</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">klass</span><span class="symbol">,</span><span class="normal"> </span><span class="keyword">sizeof</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">MyObjectPrivate</span><span class="symbol">));</span>
2053 <span class="cbracket">}</span>
2054
2055 <span class="keyword">static</span><span class="normal"> </span><span class="type">void</span>
2056 <span class="function">my_object_init</span><span class="normal"> </span><span class="symbol">(</span><span class="usertype">MyObject</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">my_object</span><span class="symbol">)</span>
2057 <span class="cbracket">{</span>
2058 <span class="normal">  my_object</span><span class="symbol">-&gt;</span><span class="normal">priv </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="gobject-Type-Information.html#G-TYPE-INSTANCE-GET-PRIVATE:CAPS">G_TYPE_INSTANCE_GET_PRIVATE</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">my_object</span><span class="symbol">,</span>
2059 <span class="normal">                                                 MY_TYPE_OBJECT</span><span class="symbol">,</span>
2060 <span class="normal">                                                 MyObjectPrivate</span><span class="symbol">);</span>
2061 <span class="cbracket">}</span>
2062
2063 <span class="keyword">static</span><span class="normal"> </span><span class="type">int</span>
2064 <span class="function">my_object_get_some_field</span><span class="normal"> </span><span class="symbol">(</span><span class="usertype">MyObject</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">my_object</span><span class="symbol">)</span>
2065 <span class="cbracket">{</span>
2066 <span class="normal">  </span><span class="usertype">MyObjectPrivate</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">priv</span><span class="symbol">;</span>
2067
2068 <span class="normal">  </span><span class="function"><a href="./../glib/glib/glib-Warnings-and-Assertions.html#g-return-val-if-fail">g_return_val_if_fail</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">MY_IS_OBJECT</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">my_object</span><span class="symbol">),</span><span class="normal"> </span><span class="number">0</span><span class="symbol">);</span>
2069
2070 <span class="normal">  priv </span><span class="symbol">=</span><span class="normal"> my_object</span><span class="symbol">-&gt;</span><span class="normal">priv</span><span class="symbol">;</span>
2071
2072 <span class="normal">  </span><span class="keyword">return</span><span class="normal"> priv</span><span class="symbol">-&gt;</span><span class="normal">some_field</span><span class="symbol">;</span>
2073 <span class="cbracket">}</span></pre></td>
2074       </tr>
2075     </tbody>
2076   </table>
2077 </div>
2078
2079 <p>
2080 </p>
2081 <div class="variablelist"><table border="0">
2082 <col align="left" valign="top">
2083 <tbody>
2084 <tr>
2085 <td><p><span class="term"><em class="parameter"><code>g_class</code></em> :</span></p></td>
2086 <td>class structure for an instantiatable type</td>
2087 </tr>
2088 <tr>
2089 <td><p><span class="term"><em class="parameter"><code>private_size</code></em> :</span></p></td>
2090 <td>size of private structure.</td>
2091 </tr>
2092 </tbody>
2093 </table></div>
2094 <p class="since">Since 2.4</p>
2095 </div>
2096 <hr>
2097 <div class="refsect2">
2098 <a name="g-type-add-class-private"></a><h3>g_type_add_class_private ()</h3>
2099 <pre class="programlisting"><span class="returnvalue">void</span>                g_type_add_class_private            (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> class_type</code></em>,
2100                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> private_size</code></em>);</pre>
2101 <p>
2102 Registers a private class structure for a classed type;
2103 when the class is allocated, the private structures for
2104 the class and all of its parent types are allocated
2105 sequentially in the same memory block as the public
2106 structures. This function should be called in the
2107 type's <code class="function">get_type()</code> function after the type is registered.
2108 The private structure can be retrieved using the
2109 <a class="link" href="gobject-Type-Information.html#G-TYPE-CLASS-GET-PRIVATE:CAPS" title="G_TYPE_CLASS_GET_PRIVATE()"><code class="function">G_TYPE_CLASS_GET_PRIVATE()</code></a> macro.
2110 </p>
2111 <div class="variablelist"><table border="0">
2112 <col align="left" valign="top">
2113 <tbody>
2114 <tr>
2115 <td><p><span class="term"><em class="parameter"><code>class_type</code></em> :</span></p></td>
2116 <td>GType of an classed type.</td>
2117 </tr>
2118 <tr>
2119 <td><p><span class="term"><em class="parameter"><code>private_size</code></em> :</span></p></td>
2120 <td>size of private structure.</td>
2121 </tr>
2122 </tbody>
2123 </table></div>
2124 <p class="since">Since 2.24</p>
2125 </div>
2126 <hr>
2127 <div class="refsect2">
2128 <a name="g-type-interface-peek"></a><h3>g_type_interface_peek ()</h3>
2129 <pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a>            g_type_interface_peek               (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> instance_class</code></em>,
2130                                                          <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> iface_type</code></em>);</pre>
2131 <p>
2132 Returns the <a class="link" href="gobject-Type-Information.html#GTypeInterface" title="struct GTypeInterface"><span class="type">GTypeInterface</span></a> structure of an interface to which the
2133 passed in class conforms.
2134 </p>
2135 <div class="variablelist"><table border="0">
2136 <col align="left" valign="top">
2137 <tbody>
2138 <tr>
2139 <td><p><span class="term"><em class="parameter"><code>instance_class</code></em> :</span></p></td>
2140 <td>A <a class="link" href="gobject-Type-Information.html#GTypeClass" title="struct GTypeClass"><span class="type">GTypeClass</span></a> structure. <span class="annotation">[<acronym title="Override the parsed C type with given type"><span class="acronym">type</span></acronym> GObject.TypeClass]</span>
2141 </td>
2142 </tr>
2143 <tr>
2144 <td><p><span class="term"><em class="parameter"><code>iface_type</code></em> :</span></p></td>
2145 <td>An interface ID which this class conforms to.</td>
2146 </tr>
2147 <tr>
2148 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
2149 <td>The GTypeInterface
2150 structure of iface_type if implemented by <em class="parameter"><code>instance_class</code></em>, <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
2151 otherwise. <span class="annotation">[<acronym title="Override the parsed C type with given type"><span class="acronym">type</span></acronym> GObject.TypeInterface][<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
2152 </td>
2153 </tr>
2154 </tbody>
2155 </table></div>
2156 </div>
2157 <hr>
2158 <div class="refsect2">
2159 <a name="g-type-interface-peek-parent"></a><h3>g_type_interface_peek_parent ()</h3>
2160 <pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a>            g_type_interface_peek_parent        (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> g_iface</code></em>);</pre>
2161 <p>
2162 Returns the corresponding <a class="link" href="gobject-Type-Information.html#GTypeInterface" title="struct GTypeInterface"><span class="type">GTypeInterface</span></a> structure of the parent type
2163 of the instance type to which <em class="parameter"><code>g_iface</code></em> belongs. This is useful when
2164 deriving the implementation of an interface from the parent type and
2165 then possibly overriding some methods.
2166 </p>
2167 <div class="variablelist"><table border="0">
2168 <col align="left" valign="top">
2169 <tbody>
2170 <tr>
2171 <td><p><span class="term"><em class="parameter"><code>g_iface</code></em> :</span></p></td>
2172 <td>A <a class="link" href="gobject-Type-Information.html#GTypeInterface" title="struct GTypeInterface"><span class="type">GTypeInterface</span></a> structure. <span class="annotation">[<acronym title="Override the parsed C type with given type"><span class="acronym">type</span></acronym> GObject.TypeInterface]</span>
2173 </td>
2174 </tr>
2175 <tr>
2176 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
2177 <td>The
2178 corresponding <a class="link" href="gobject-Type-Information.html#GTypeInterface" title="struct GTypeInterface"><span class="type">GTypeInterface</span></a> structure of the parent type of the
2179 instance type to which <em class="parameter"><code>g_iface</code></em> belongs, or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the parent
2180 type doesn't conform to the interface. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>][<acronym title="Override the parsed C type with given type"><span class="acronym">type</span></acronym> GObject.TypeInterface]</span>
2181 </td>
2182 </tr>
2183 </tbody>
2184 </table></div>
2185 </div>
2186 <hr>
2187 <div class="refsect2">
2188 <a name="g-type-default-interface-ref"></a><h3>g_type_default_interface_ref ()</h3>
2189 <pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a>            g_type_default_interface_ref        (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> g_type</code></em>);</pre>
2190 <p>
2191 Increments the reference count for the interface type <em class="parameter"><code>g_type</code></em>,
2192 and returns the default interface vtable for the type.
2193 </p>
2194 <p>
2195 If the type is not currently in use, then the default vtable
2196 for the type will be created and initalized by calling
2197 the base interface init and default vtable init functions for
2198 the type (the @<em class="structfield"><code>base_init</code></em>
2199 and <em class="structfield"><code>class_init</code></em> members of <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="struct GTypeInfo"><span class="type">GTypeInfo</span></a>).
2200 Calling <a class="link" href="gobject-Type-Information.html#g-type-default-interface-ref" title="g_type_default_interface_ref ()"><code class="function">g_type_default_interface_ref()</code></a> is useful when you
2201 want to make sure that signals and properties for an interface
2202 have been installed.
2203 </p>
2204 <div class="variablelist"><table border="0">
2205 <col align="left" valign="top">
2206 <tbody>
2207 <tr>
2208 <td><p><span class="term"><em class="parameter"><code>g_type</code></em> :</span></p></td>
2209 <td>an interface type</td>
2210 </tr>
2211 <tr>
2212 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
2213 <td>the default
2214 vtable for the interface; call <a class="link" href="gobject-Type-Information.html#g-type-default-interface-unref" title="g_type_default_interface_unref ()"><code class="function">g_type_default_interface_unref()</code></a>
2215 when you are done using the interface. <span class="annotation">[<acronym title="Override the parsed C type with given type"><span class="acronym">type</span></acronym> GObject.TypeInterface][<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
2216 </td>
2217 </tr>
2218 </tbody>
2219 </table></div>
2220 <p class="since">Since 2.4</p>
2221 </div>
2222 <hr>
2223 <div class="refsect2">
2224 <a name="g-type-default-interface-peek"></a><h3>g_type_default_interface_peek ()</h3>
2225 <pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a>            g_type_default_interface_peek       (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> g_type</code></em>);</pre>
2226 <p>
2227 If the interface type <em class="parameter"><code>g_type</code></em> is currently in use, returns its
2228 default interface vtable.
2229 </p>
2230 <div class="variablelist"><table border="0">
2231 <col align="left" valign="top">
2232 <tbody>
2233 <tr>
2234 <td><p><span class="term"><em class="parameter"><code>g_type</code></em> :</span></p></td>
2235 <td>an interface type</td>
2236 </tr>
2237 <tr>
2238 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
2239 <td>the default
2240 vtable for the interface, or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the type is not currently in
2241 use. <span class="annotation">[<acronym title="Override the parsed C type with given type"><span class="acronym">type</span></acronym> GObject.TypeInterface][<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
2242 </td>
2243 </tr>
2244 </tbody>
2245 </table></div>
2246 <p class="since">Since 2.4</p>
2247 </div>
2248 <hr>
2249 <div class="refsect2">
2250 <a name="g-type-default-interface-unref"></a><h3>g_type_default_interface_unref ()</h3>
2251 <pre class="programlisting"><span class="returnvalue">void</span>                g_type_default_interface_unref      (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> g_iface</code></em>);</pre>
2252 <p>
2253 Decrements the reference count for the type corresponding to the
2254 interface default vtable <em class="parameter"><code>g_iface</code></em>. If the type is dynamic, then
2255 when no one is using the interface and all references have
2256 been released, the finalize function for the interface's default
2257 vtable (the <em class="structfield"><code>class_finalize</code></em> member of
2258 <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="struct GTypeInfo"><span class="type">GTypeInfo</span></a>) will be called.
2259 </p>
2260 <div class="variablelist"><table border="0">
2261 <col align="left" valign="top">
2262 <tbody><tr>
2263 <td><p><span class="term"><em class="parameter"><code>g_iface</code></em> :</span></p></td>
2264 <td>the default vtable
2265 structure for a interface, as returned by
2266 <a class="link" href="gobject-Type-Information.html#g-type-default-interface-ref" title="g_type_default_interface_ref ()"><code class="function">g_type_default_interface_ref()</code></a>. <span class="annotation">[<acronym title="Override the parsed C type with given type"><span class="acronym">type</span></acronym> GObject.TypeInterface]</span>
2267 </td>
2268 </tr></tbody>
2269 </table></div>
2270 <p class="since">Since 2.4</p>
2271 </div>
2272 <hr>
2273 <div class="refsect2">
2274 <a name="g-type-children"></a><h3>g_type_children ()</h3>
2275 <pre class="programlisting"><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a> *             g_type_children                     (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>,
2276                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> *n_children</code></em>);</pre>
2277 <p>
2278 Return a newly allocated and 0-terminated array of type IDs, listing the
2279 child types of <em class="parameter"><code>type</code></em>. The return value has to be <a href="./../glib/glib/glib-Memory-Allocation.html#g-free"><code class="function">g_free()</code></a>ed after use.
2280 </p>
2281 <div class="variablelist"><table border="0">
2282 <col align="left" valign="top">
2283 <tbody>
2284 <tr>
2285 <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
2286 <td>The parent type.</td>
2287 </tr>
2288 <tr>
2289 <td><p><span class="term"><em class="parameter"><code>n_children</code></em> :</span></p></td>
2290 <td>Optional <a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> pointer to contain
2291 the number of child types. <span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
2292 </td>
2293 </tr>
2294 <tr>
2295 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
2296 <td>Newly allocated
2297 and 0-terminated array of child types. <span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=n_children][<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
2298 </td>
2299 </tr>
2300 </tbody>
2301 </table></div>
2302 </div>
2303 <hr>
2304 <div class="refsect2">
2305 <a name="g-type-interfaces"></a><h3>g_type_interfaces ()</h3>
2306 <pre class="programlisting"><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a> *             g_type_interfaces                   (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>,
2307                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> *n_interfaces</code></em>);</pre>
2308 <p>
2309 Return a newly allocated and 0-terminated array of type IDs, listing the
2310 interface types that <em class="parameter"><code>type</code></em> conforms to. The return value has to be
2311 <a href="./../glib/glib/glib-Memory-Allocation.html#g-free"><code class="function">g_free()</code></a>ed after use.
2312 </p>
2313 <div class="variablelist"><table border="0">
2314 <col align="left" valign="top">
2315 <tbody>
2316 <tr>
2317 <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
2318 <td>The type to list interface types for.</td>
2319 </tr>
2320 <tr>
2321 <td><p><span class="term"><em class="parameter"><code>n_interfaces</code></em> :</span></p></td>
2322 <td>Optional <a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> pointer to
2323 contain the number of interface types. <span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
2324 </td>
2325 </tr>
2326 <tr>
2327 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
2328 <td>Newly
2329 allocated and 0-terminated array of interface types. <span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=n_interfaces][<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
2330 </td>
2331 </tr>
2332 </tbody>
2333 </table></div>
2334 </div>
2335 <hr>
2336 <div class="refsect2">
2337 <a name="g-type-interface-prerequisites"></a><h3>g_type_interface_prerequisites ()</h3>
2338 <pre class="programlisting"><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a> *             g_type_interface_prerequisites      (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> interface_type</code></em>,
2339                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> *n_prerequisites</code></em>);</pre>
2340 <p>
2341 Returns the prerequisites of an interfaces type.
2342 </p>
2343 <div class="variablelist"><table border="0">
2344 <col align="left" valign="top">
2345 <tbody>
2346 <tr>
2347 <td><p><span class="term"><em class="parameter"><code>interface_type</code></em> :</span></p></td>
2348 <td>an interface type</td>
2349 </tr>
2350 <tr>
2351 <td><p><span class="term"><em class="parameter"><code>n_prerequisites</code></em> :</span></p></td>
2352 <td>location to return the number
2353 of prerequisites, or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
2354 </td>
2355 </tr>
2356 <tr>
2357 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
2358 <td>a
2359 newly-allocated zero-terminated array of <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> containing
2360 the prerequisites of <em class="parameter"><code>interface_type</code></em>. <span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=n_prerequisites][<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
2361 </td>
2362 </tr>
2363 </tbody>
2364 </table></div>
2365 <p class="since">Since 2.2</p>
2366 </div>
2367 <hr>
2368 <div class="refsect2">
2369 <a name="g-type-set-qdata"></a><h3>g_type_set_qdata ()</h3>
2370 <pre class="programlisting"><span class="returnvalue">void</span>                g_type_set_qdata                    (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>,
2371                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> quark</code></em>,
2372                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>);</pre>
2373 <p>
2374 Attaches arbitrary data to a type.
2375 </p>
2376 <div class="variablelist"><table border="0">
2377 <col align="left" valign="top">
2378 <tbody>
2379 <tr>
2380 <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
2381 <td>a <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a>
2382 </td>
2383 </tr>
2384 <tr>
2385 <td><p><span class="term"><em class="parameter"><code>quark</code></em> :</span></p></td>
2386 <td>a <a href="./../glib/glib/glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> id to identify the data</td>
2387 </tr>
2388 <tr>
2389 <td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
2390 <td>the data</td>
2391 </tr>
2392 </tbody>
2393 </table></div>
2394 </div>
2395 <hr>
2396 <div class="refsect2">
2397 <a name="g-type-get-qdata"></a><h3>g_type_get_qdata ()</h3>
2398 <pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a>            g_type_get_qdata                    (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>,
2399                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> quark</code></em>);</pre>
2400 <p>
2401 Obtains data which has previously been attached to <em class="parameter"><code>type</code></em>
2402 with <a class="link" href="gobject-Type-Information.html#g-type-set-qdata" title="g_type_set_qdata ()"><code class="function">g_type_set_qdata()</code></a>.
2403 </p>
2404 <p>
2405 Note that this does not take subtyping into account; data
2406 attached to one type with <a class="link" href="gobject-Type-Information.html#g-type-set-qdata" title="g_type_set_qdata ()"><code class="function">g_type_set_qdata()</code></a> cannot
2407 be retrieved from a subtype using <a class="link" href="gobject-Type-Information.html#g-type-get-qdata" title="g_type_get_qdata ()"><code class="function">g_type_get_qdata()</code></a>.
2408 </p>
2409 <div class="variablelist"><table border="0">
2410 <col align="left" valign="top">
2411 <tbody>
2412 <tr>
2413 <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
2414 <td>a <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a>
2415 </td>
2416 </tr>
2417 <tr>
2418 <td><p><span class="term"><em class="parameter"><code>quark</code></em> :</span></p></td>
2419 <td>a <a href="./../glib/glib/glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> id to identify the data</td>
2420 </tr>
2421 <tr>
2422 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
2423 <td>the data, or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if no data was found. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
2424 </td>
2425 </tr>
2426 </tbody>
2427 </table></div>
2428 </div>
2429 <hr>
2430 <div class="refsect2">
2431 <a name="g-type-query"></a><h3>g_type_query ()</h3>
2432 <pre class="programlisting"><span class="returnvalue">void</span>                g_type_query                        (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>,
2433                                                          <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GTypeQuery" title="struct GTypeQuery"><span class="type">GTypeQuery</span></a> *query</code></em>);</pre>
2434 <p>
2435 Queries the type system for information about a specific type.
2436 This function will fill in a user-provided structure to hold
2437 type-specific information. If an invalid <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> is passed in, the
2438 <em class="parameter"><code>type</code></em> member of the <a class="link" href="gobject-Type-Information.html#GTypeQuery" title="struct GTypeQuery"><span class="type">GTypeQuery</span></a> is 0. All members filled into the
2439 <a class="link" href="gobject-Type-Information.html#GTypeQuery" title="struct GTypeQuery"><span class="type">GTypeQuery</span></a> structure should be considered constant and have to be
2440 left untouched.
2441 </p>
2442 <div class="variablelist"><table border="0">
2443 <col align="left" valign="top">
2444 <tbody>
2445 <tr>
2446 <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
2447 <td>the <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value of a static, classed type.</td>
2448 </tr>
2449 <tr>
2450 <td><p><span class="term"><em class="parameter"><code>query</code></em> :</span></p></td>
2451 <td>A user provided structure that is
2452 filled in with constant values upon success. <span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym> caller-allocates]</span>
2453 </td>
2454 </tr>
2455 </tbody>
2456 </table></div>
2457 </div>
2458 <hr>
2459 <div class="refsect2">
2460 <a name="GTypeQuery"></a><h3>struct GTypeQuery</h3>
2461 <pre class="programlisting">struct GTypeQuery {
2462   GType         type;
2463   const gchar  *type_name;
2464   guint         class_size;
2465   guint         instance_size;
2466 };
2467 </pre>
2468 <p>
2469 A structure holding information for a specific type. It is
2470 filled in by the <a class="link" href="gobject-Type-Information.html#g-type-query" title="g_type_query ()"><code class="function">g_type_query()</code></a> function.
2471 </p>
2472 <div class="variablelist"><table border="0">
2473 <col align="left" valign="top">
2474 <tbody>
2475 <tr>
2476 <td><p><span class="term"><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> <em class="structfield"><code><a name="GTypeQuery.type"></a>type</code></em>;</span></p></td>
2477 <td>the <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value of the type.</td>
2478 </tr>
2479 <tr>
2480 <td><p><span class="term">const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *<em class="structfield"><code><a name="GTypeQuery.type-name"></a>type_name</code></em>;</span></p></td>
2481 <td>the name of the type.</td>
2482 </tr>
2483 <tr>
2484 <td><p><span class="term"><a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> <em class="structfield"><code><a name="GTypeQuery.class-size"></a>class_size</code></em>;</span></p></td>
2485 <td>the size of the class structure.</td>
2486 </tr>
2487 <tr>
2488 <td><p><span class="term"><a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> <em class="structfield"><code><a name="GTypeQuery.instance-size"></a>instance_size</code></em>;</span></p></td>
2489 <td>the size of the instance structure.</td>
2490 </tr>
2491 </tbody>
2492 </table></div>
2493 </div>
2494 <hr>
2495 <div class="refsect2">
2496 <a name="GBaseInitFunc"></a><h3>GBaseInitFunc ()</h3>
2497 <pre class="programlisting"><span class="returnvalue">void</span>                (*GBaseInitFunc)                    (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> g_class</code></em>);</pre>
2498 <p>
2499 A callback function used by the type system to do base initialization
2500 of the class structures of derived types. It is called as part of the
2501 initialization process of all derived classes and should reallocate
2502 or reset all dynamic class members copied over from the parent class.
2503 For example, class members (such as strings) that are not sufficiently
2504 handled by a plain memory copy of the parent class into the derived class
2505 have to be altered. See <a class="link" href="gobject-Type-Information.html#GClassInitFunc" title="GClassInitFunc ()"><code class="function">GClassInitFunc()</code></a> for a discussion of the class
2506 intialization process.
2507 </p>
2508 <div class="variablelist"><table border="0">
2509 <col align="left" valign="top">
2510 <tbody><tr>
2511 <td><p><span class="term"><em class="parameter"><code>g_class</code></em> :</span></p></td>
2512 <td>The <a class="link" href="gobject-Type-Information.html#GTypeClass" title="struct GTypeClass"><span class="type">GTypeClass</span></a> structure to initialize.</td>
2513 </tr></tbody>
2514 </table></div>
2515 </div>
2516 <hr>
2517 <div class="refsect2">
2518 <a name="GBaseFinalizeFunc"></a><h3>GBaseFinalizeFunc ()</h3>
2519 <pre class="programlisting"><span class="returnvalue">void</span>                (*GBaseFinalizeFunc)                (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> g_class</code></em>);</pre>
2520 <p>
2521 A callback function used by the type system to finalize those portions
2522 of a derived types class structure that were setup from the corresponding
2523 <a class="link" href="gobject-Type-Information.html#GBaseInitFunc" title="GBaseInitFunc ()"><code class="function">GBaseInitFunc()</code></a> function. Class finalization basically works the inverse
2524 way in which class intialization is performed.
2525 See <a class="link" href="gobject-Type-Information.html#GClassInitFunc" title="GClassInitFunc ()"><code class="function">GClassInitFunc()</code></a> for a discussion of the class intialization process.
2526 </p>
2527 <div class="variablelist"><table border="0">
2528 <col align="left" valign="top">
2529 <tbody><tr>
2530 <td><p><span class="term"><em class="parameter"><code>g_class</code></em> :</span></p></td>
2531 <td>The <a class="link" href="gobject-Type-Information.html#GTypeClass" title="struct GTypeClass"><span class="type">GTypeClass</span></a> structure to finalize.</td>
2532 </tr></tbody>
2533 </table></div>
2534 </div>
2535 <hr>
2536 <div class="refsect2">
2537 <a name="GClassInitFunc"></a><h3>GClassInitFunc ()</h3>
2538 <pre class="programlisting"><span class="returnvalue">void</span>                (*GClassInitFunc)                   (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> g_class</code></em>,
2539                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> class_data</code></em>);</pre>
2540 <p>
2541 A callback function used by the type system to initialize the class
2542 of a specific type. This function should initialize all static class
2543 members.
2544 The initialization process of a class involves:
2545 </p>
2546 <div class="itemizedlist"><ul class="itemizedlist" type="disc">
2547 <li class="listitem"><p>
2548         1 - Copying common members from the parent class over to the
2549         derived class structure.
2550 </p></li>
2551 <li class="listitem"><p>
2552         2 -  Zero initialization of the remaining members not copied
2553         over from the parent class.
2554 </p></li>
2555 <li class="listitem"><p>
2556         3 - Invocation of the <a class="link" href="gobject-Type-Information.html#GBaseInitFunc" title="GBaseInitFunc ()"><code class="function">GBaseInitFunc()</code></a> initializers of all parent
2557         types and the class' type.
2558 </p></li>
2559 <li class="listitem"><p>
2560         4 - Invocation of the class' <a class="link" href="gobject-Type-Information.html#GClassInitFunc" title="GClassInitFunc ()"><code class="function">GClassInitFunc()</code></a> initializer.
2561 </p></li>
2562 </ul></div>
2563 <p>
2564 Since derived classes are partially initialized through a memory copy
2565 of the parent class, the general rule is that <a class="link" href="gobject-Type-Information.html#GBaseInitFunc" title="GBaseInitFunc ()"><code class="function">GBaseInitFunc()</code></a> and
2566 <a class="link" href="gobject-Type-Information.html#GBaseFinalizeFunc" title="GBaseFinalizeFunc ()"><code class="function">GBaseFinalizeFunc()</code></a> should take care of necessary reinitialization
2567 and release of those class members that were introduced by the type
2568 that specified these <a class="link" href="gobject-Type-Information.html#GBaseInitFunc" title="GBaseInitFunc ()"><code class="function">GBaseInitFunc()</code></a>/<a class="link" href="gobject-Type-Information.html#GBaseFinalizeFunc" title="GBaseFinalizeFunc ()"><code class="function">GBaseFinalizeFunc()</code></a>.
2569 <a class="link" href="gobject-Type-Information.html#GClassInitFunc" title="GClassInitFunc ()"><code class="function">GClassInitFunc()</code></a> should only care about initializing static
2570 class members, while dynamic class members (such as allocated strings
2571 or reference counted resources) are better handled by a <a class="link" href="gobject-Type-Information.html#GBaseInitFunc" title="GBaseInitFunc ()"><code class="function">GBaseInitFunc()</code></a>
2572 for this type, so proper initialization of the dynamic class members
2573 is performed for class initialization of derived types as well.
2574 An example may help to correspond the intend of the different class
2575 initializers:
2576 </p>
2577 <p>
2578 </p>
2579 <div class="informalexample">
2580   <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
2581     <tbody>
2582       <tr>
2583         <td class="listing_lines" align="right"><pre>1
2584 2
2585 3
2586 4
2587 5
2588 6
2589 7
2590 8
2591 9
2592 10
2593 11
2594 12
2595 13
2596 14
2597 15
2598 16
2599 17
2600 18
2601 19
2602 20
2603 21
2604 22
2605 23
2606 24
2607 25
2608 26
2609 27
2610 28
2611 29
2612 30
2613 31
2614 32
2615 33
2616 34
2617 35
2618 36
2619 37
2620 38
2621 39
2622 40
2623 41</pre></td>
2624         <td class="listing_code"><pre class="programlisting"><span class="keyword">typedef</span><span class="normal"> </span><span class="keyword">struct</span><span class="normal"> </span><span class="cbracket">{</span>
2625 <span class="normal">  </span><span class="usertype">GObjectClass</span><span class="normal"> parent_class</span><span class="symbol">;</span>
2626 <span class="normal">  </span><span class="usertype">gint</span><span class="normal">         static_integer</span><span class="symbol">;</span>
2627 <span class="normal">  </span><span class="usertype">gchar</span><span class="normal">       </span><span class="symbol">*</span><span class="normal">dynamic_string</span><span class="symbol">;</span>
2628 <span class="cbracket">}</span><span class="normal"> TypeAClass</span><span class="symbol">;</span>
2629 <span class="keyword">static</span><span class="normal"> </span><span class="type">void</span>
2630 <span class="function">type_a_base_class_init</span><span class="normal"> </span><span class="symbol">(</span><span class="usertype">TypeAClass</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">class</span><span class="symbol">)</span>
2631 <span class="cbracket">{</span>
2632 <span class="normal">  class</span><span class="symbol">-&gt;</span><span class="normal">dynamic_string </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="./../glib/glib/glib-String-Utility-Functions.html#g-strdup">g_strdup</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"some string"</span><span class="symbol">);</span>
2633 <span class="cbracket">}</span>
2634 <span class="keyword">static</span><span class="normal"> </span><span class="type">void</span>
2635 <span class="function">type_a_base_class_finalize</span><span class="normal"> </span><span class="symbol">(</span><span class="usertype">TypeAClass</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">class</span><span class="symbol">)</span>
2636 <span class="cbracket">{</span>
2637 <span class="normal">  </span><span class="function"><a href="./../glib/glib/glib-Memory-Allocation.html#g-free">g_free</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">class</span><span class="symbol">-&gt;</span><span class="normal">dynamic_string</span><span class="symbol">);</span>
2638 <span class="cbracket">}</span>
2639 <span class="keyword">static</span><span class="normal"> </span><span class="type">void</span>
2640 <span class="function">type_a_class_init</span><span class="normal"> </span><span class="symbol">(</span><span class="usertype">TypeAClass</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">class</span><span class="symbol">)</span>
2641 <span class="cbracket">{</span>
2642 <span class="normal">  class</span><span class="symbol">-&gt;</span><span class="normal">static_integer </span><span class="symbol">=</span><span class="normal"> </span><span class="number">42</span><span class="symbol">;</span>
2643 <span class="cbracket">}</span>
2644
2645 <span class="keyword">typedef</span><span class="normal"> </span><span class="keyword">struct</span><span class="normal"> </span><span class="cbracket">{</span>
2646 <span class="normal">  </span><span class="usertype">TypeAClass</span><span class="normal">   parent_class</span><span class="symbol">;</span>
2647 <span class="normal">  </span><span class="usertype">gfloat</span><span class="normal">       static_float</span><span class="symbol">;</span>
2648 <span class="normal">  </span><span class="usertype">GString</span><span class="normal">     </span><span class="symbol">*</span><span class="normal">dynamic_gstring</span><span class="symbol">;</span>
2649 <span class="cbracket">}</span><span class="normal"> TypeBClass</span><span class="symbol">;</span>
2650 <span class="keyword">static</span><span class="normal"> </span><span class="type">void</span>
2651 <span class="function">type_b_base_class_init</span><span class="normal"> </span><span class="symbol">(</span><span class="usertype">TypeBClass</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">class</span><span class="symbol">)</span>
2652 <span class="cbracket">{</span>
2653 <span class="normal">  class</span><span class="symbol">-&gt;</span><span class="normal">dynamic_gstring </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="./../glib/glib/glib-Strings.html#g-string-new">g_string_new</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"some other string"</span><span class="symbol">);</span>
2654 <span class="cbracket">}</span>
2655 <span class="keyword">static</span><span class="normal"> </span><span class="type">void</span>
2656 <span class="function">type_b_base_class_finalize</span><span class="normal"> </span><span class="symbol">(</span><span class="usertype">TypeBClass</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">class</span><span class="symbol">)</span>
2657 <span class="cbracket">{</span>
2658 <span class="normal">  </span><span class="function"><a href="./../glib/glib/glib-Strings.html#g-string-free">g_string_free</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">class</span><span class="symbol">-&gt;</span><span class="normal">dynamic_gstring</span><span class="symbol">);</span>
2659 <span class="cbracket">}</span>
2660 <span class="keyword">static</span><span class="normal"> </span><span class="type">void</span>
2661 <span class="function">type_b_class_init</span><span class="normal"> </span><span class="symbol">(</span><span class="usertype">TypeBClass</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">class</span><span class="symbol">)</span>
2662 <span class="cbracket">{</span>
2663 <span class="normal">  class</span><span class="symbol">-&gt;</span><span class="normal">static_float </span><span class="symbol">=</span><span class="normal"> </span><span class="number">3.14159265358979323846</span><span class="symbol">;</span>
2664 <span class="cbracket">}</span></pre></td>
2665       </tr>
2666     </tbody>
2667   </table>
2668 </div>
2669
2670 <p>
2671 Initialization of TypeBClass will first cause initialization of
2672 TypeAClass (derived classes reference their parent classes, see
2673 <a class="link" href="gobject-Type-Information.html#g-type-class-ref" title="g_type_class_ref ()"><code class="function">g_type_class_ref()</code></a> on this).
2674 Initialization of TypeAClass roughly involves zero-initializing its fields,
2675 then calling its <a class="link" href="gobject-Type-Information.html#GBaseInitFunc" title="GBaseInitFunc ()"><code class="function">GBaseInitFunc()</code></a> <code class="function">type_a_base_class_init()</code> to allocate
2676 its dynamic members (dynamic_string), and finally calling its <a class="link" href="gobject-Type-Information.html#GClassInitFunc" title="GClassInitFunc ()"><code class="function">GClassInitFunc()</code></a>
2677 <code class="function">type_a_class_init()</code> to initialize its static members (static_integer).
2678 The first step in the initialization process of TypeBClass is then
2679 a plain memory copy of the contents of TypeAClass into TypeBClass and 
2680 zero-initialization of the remaining fields in TypeBClass.
2681 The dynamic members of TypeAClass within TypeBClass now need
2682 reinitialization which is performed by calling <code class="function">type_a_base_class_init()</code>
2683 with an argument of TypeBClass.
2684 After that, the <a class="link" href="gobject-Type-Information.html#GBaseInitFunc" title="GBaseInitFunc ()"><code class="function">GBaseInitFunc()</code></a> of TypeBClass, <code class="function">type_b_base_class_init()</code>
2685 is called to allocate the dynamic members of TypeBClass (dynamic_gstring),
2686 and finally the <a class="link" href="gobject-Type-Information.html#GClassInitFunc" title="GClassInitFunc ()"><code class="function">GClassInitFunc()</code></a> of TypeBClass, <code class="function">type_b_class_init()</code>,
2687 is called to complete the initialization process with the static members
2688 (static_float).
2689 Corresponding finalization counter parts to the <a class="link" href="gobject-Type-Information.html#GBaseInitFunc" title="GBaseInitFunc ()"><code class="function">GBaseInitFunc()</code></a> functions
2690 have to be provided to release allocated resources at class finalization
2691 time.
2692 </p>
2693 <div class="variablelist"><table border="0">
2694 <col align="left" valign="top">
2695 <tbody>
2696 <tr>
2697 <td><p><span class="term"><em class="parameter"><code>g_class</code></em> :</span></p></td>
2698 <td>The <a class="link" href="gobject-Type-Information.html#GTypeClass" title="struct GTypeClass"><span class="type">GTypeClass</span></a> structure to initialize.</td>
2699 </tr>
2700 <tr>
2701 <td><p><span class="term"><em class="parameter"><code>class_data</code></em> :</span></p></td>
2702 <td>The <em class="parameter"><code>class_data</code></em> member supplied via the <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="struct GTypeInfo"><span class="type">GTypeInfo</span></a> structure.</td>
2703 </tr>
2704 </tbody>
2705 </table></div>
2706 </div>
2707 <hr>
2708 <div class="refsect2">
2709 <a name="GClassFinalizeFunc"></a><h3>GClassFinalizeFunc ()</h3>
2710 <pre class="programlisting"><span class="returnvalue">void</span>                (*GClassFinalizeFunc)               (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> g_class</code></em>,
2711                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> class_data</code></em>);</pre>
2712 <p>
2713 A callback function used by the type system to finalize a class.
2714 This function is rarely needed, as dynamically allocated class resources
2715 should be handled by <a class="link" href="gobject-Type-Information.html#GBaseInitFunc" title="GBaseInitFunc ()"><code class="function">GBaseInitFunc()</code></a> and <a class="link" href="gobject-Type-Information.html#GBaseFinalizeFunc" title="GBaseFinalizeFunc ()"><code class="function">GBaseFinalizeFunc()</code></a>.
2716 Also, specification of a <a class="link" href="gobject-Type-Information.html#GClassFinalizeFunc" title="GClassFinalizeFunc ()"><code class="function">GClassFinalizeFunc()</code></a> in the <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="struct GTypeInfo"><span class="type">GTypeInfo</span></a>
2717 structure of a static type is invalid, because classes of static types
2718 will never be finalized (they are artificially kept alive when their
2719 reference count drops to zero).
2720 </p>
2721 <div class="variablelist"><table border="0">
2722 <col align="left" valign="top">
2723 <tbody>
2724 <tr>
2725 <td><p><span class="term"><em class="parameter"><code>g_class</code></em> :</span></p></td>
2726 <td>The <a class="link" href="gobject-Type-Information.html#GTypeClass" title="struct GTypeClass"><span class="type">GTypeClass</span></a> structure to finalize.</td>
2727 </tr>
2728 <tr>
2729 <td><p><span class="term"><em class="parameter"><code>class_data</code></em> :</span></p></td>
2730 <td>The <em class="parameter"><code>class_data</code></em> member supplied via the <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="struct GTypeInfo"><span class="type">GTypeInfo</span></a> structure.</td>
2731 </tr>
2732 </tbody>
2733 </table></div>
2734 </div>
2735 <hr>
2736 <div class="refsect2">
2737 <a name="GInstanceInitFunc"></a><h3>GInstanceInitFunc ()</h3>
2738 <pre class="programlisting"><span class="returnvalue">void</span>                (*GInstanceInitFunc)                (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GTypeInstance" title="struct GTypeInstance"><span class="type">GTypeInstance</span></a> *instance</code></em>,
2739                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> g_class</code></em>);</pre>
2740 <p>
2741 A callback function used by the type system to initialize a new
2742 instance of a type. This function initializes all instance members and
2743 allocates any resources required by it.
2744 Initialization of a derived instance involves calling all its parent
2745 types instance initializers, so the class member of the instance
2746 is altered during its initialization to always point to the class that
2747 belongs to the type the current initializer was introduced for.
2748 </p>
2749 <div class="variablelist"><table border="0">
2750 <col align="left" valign="top">
2751 <tbody>
2752 <tr>
2753 <td><p><span class="term"><em class="parameter"><code>instance</code></em> :</span></p></td>
2754 <td>The instance to initialize.</td>
2755 </tr>
2756 <tr>
2757 <td><p><span class="term"><em class="parameter"><code>g_class</code></em> :</span></p></td>
2758 <td>The class of the type the instance is created for.</td>
2759 </tr>
2760 </tbody>
2761 </table></div>
2762 </div>
2763 <hr>
2764 <div class="refsect2">
2765 <a name="GInterfaceInitFunc"></a><h3>GInterfaceInitFunc ()</h3>
2766 <pre class="programlisting"><span class="returnvalue">void</span>                (*GInterfaceInitFunc)               (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> g_iface</code></em>,
2767                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> iface_data</code></em>);</pre>
2768 <p>
2769 A callback function used by the type system to initialize a new
2770 interface.  This function should initialize all internal data and
2771 allocate any resources required by the interface.
2772 </p>
2773 <div class="variablelist"><table border="0">
2774 <col align="left" valign="top">
2775 <tbody>
2776 <tr>
2777 <td><p><span class="term"><em class="parameter"><code>g_iface</code></em> :</span></p></td>
2778 <td>The interface structure to initialize.</td>
2779 </tr>
2780 <tr>
2781 <td><p><span class="term"><em class="parameter"><code>iface_data</code></em> :</span></p></td>
2782 <td>The <em class="parameter"><code>interface_data</code></em> supplied via the <a class="link" href="gobject-Type-Information.html#GInterfaceInfo" title="struct GInterfaceInfo"><span class="type">GInterfaceInfo</span></a> structure.</td>
2783 </tr>
2784 </tbody>
2785 </table></div>
2786 </div>
2787 <hr>
2788 <div class="refsect2">
2789 <a name="GInterfaceFinalizeFunc"></a><h3>GInterfaceFinalizeFunc ()</h3>
2790 <pre class="programlisting"><span class="returnvalue">void</span>                (*GInterfaceFinalizeFunc)           (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> g_iface</code></em>,
2791                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> iface_data</code></em>);</pre>
2792 <p>
2793 A callback function used by the type system to finalize an interface.
2794 This function should destroy any internal data and release any resources
2795 allocated by the corresponding <a class="link" href="gobject-Type-Information.html#GInterfaceInitFunc" title="GInterfaceInitFunc ()"><code class="function">GInterfaceInitFunc()</code></a> function.
2796 </p>
2797 <div class="variablelist"><table border="0">
2798 <col align="left" valign="top">
2799 <tbody>
2800 <tr>
2801 <td><p><span class="term"><em class="parameter"><code>g_iface</code></em> :</span></p></td>
2802 <td>The interface structure to finalize.</td>
2803 </tr>
2804 <tr>
2805 <td><p><span class="term"><em class="parameter"><code>iface_data</code></em> :</span></p></td>
2806 <td>The <em class="parameter"><code>interface_data</code></em> supplied via the <a class="link" href="gobject-Type-Information.html#GInterfaceInfo" title="struct GInterfaceInfo"><span class="type">GInterfaceInfo</span></a> structure.</td>
2807 </tr>
2808 </tbody>
2809 </table></div>
2810 </div>
2811 <hr>
2812 <div class="refsect2">
2813 <a name="GTypeClassCacheFunc"></a><h3>GTypeClassCacheFunc ()</h3>
2814 <pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            (*GTypeClassCacheFunc)              (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> cache_data</code></em>,
2815                                                          <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GTypeClass" title="struct GTypeClass"><span class="type">GTypeClass</span></a> *g_class</code></em>);</pre>
2816 <p>
2817 A callback function which is called when the reference count of a class 
2818 drops to zero. It may use <a class="link" href="gobject-Type-Information.html#g-type-class-ref" title="g_type_class_ref ()"><code class="function">g_type_class_ref()</code></a> to prevent the class from
2819 being freed. You should not call <a class="link" href="gobject-Type-Information.html#g-type-class-unref" title="g_type_class_unref ()"><code class="function">g_type_class_unref()</code></a> from a 
2820 <a class="link" href="gobject-Type-Information.html#GTypeClassCacheFunc" title="GTypeClassCacheFunc ()"><span class="type">GTypeClassCacheFunc</span></a> function to prevent infinite recursion, use 
2821 <a class="link" href="gobject-Type-Information.html#g-type-class-unref-uncached" title="g_type_class_unref_uncached ()"><code class="function">g_type_class_unref_uncached()</code></a> instead.
2822 </p>
2823 <p>
2824 The functions have to check the class id passed in to figure 
2825 whether they actually want to cache the class of this type, since all
2826 classes are routed through the same <a class="link" href="gobject-Type-Information.html#GTypeClassCacheFunc" title="GTypeClassCacheFunc ()"><span class="type">GTypeClassCacheFunc</span></a> chain.
2827 </p>
2828 <div class="variablelist"><table border="0">
2829 <col align="left" valign="top">
2830 <tbody>
2831 <tr>
2832 <td><p><span class="term"><em class="parameter"><code>cache_data</code></em> :</span></p></td>
2833 <td>data that was given to the <a class="link" href="gobject-Type-Information.html#g-type-add-class-cache-func" title="g_type_add_class_cache_func ()"><code class="function">g_type_add_class_cache_func()</code></a> call</td>
2834 </tr>
2835 <tr>
2836 <td><p><span class="term"><em class="parameter"><code>g_class</code></em> :</span></p></td>
2837 <td>The <a class="link" href="gobject-Type-Information.html#GTypeClass" title="struct GTypeClass"><span class="type">GTypeClass</span></a> structure which is unreferenced</td>
2838 </tr>
2839 <tr>
2840 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
2841 <td>
2842 <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> to stop further <a class="link" href="gobject-Type-Information.html#GTypeClassCacheFunc" title="GTypeClassCacheFunc ()"><span class="type">GTypeClassCacheFunc</span></a>s from being
2843 called, <a href="./../glib/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> to continue.</td>
2844 </tr>
2845 </tbody>
2846 </table></div>
2847 </div>
2848 <hr>
2849 <div class="refsect2">
2850 <a name="GTypeFlags"></a><h3>enum GTypeFlags</h3>
2851 <pre class="programlisting">typedef enum {
2852   G_TYPE_FLAG_ABSTRACT          = (1 &lt;&lt; 4),
2853   G_TYPE_FLAG_VALUE_ABSTRACT = (1 &lt;&lt; 5)
2854 } GTypeFlags;
2855 </pre>
2856 <p>
2857 Bit masks used to check or determine characteristics of a type.
2858 </p>
2859 <div class="variablelist"><table border="0">
2860 <col align="left" valign="top">
2861 <tbody>
2862 <tr>
2863 <td><p><a name="G-TYPE-FLAG-ABSTRACT:CAPS"></a><span class="term"><code class="literal">G_TYPE_FLAG_ABSTRACT</code></span></p></td>
2864 <td>Indicates an abstract type. No instances can be
2865  created for an abstract type.
2866 </td>
2867 </tr>
2868 <tr>
2869 <td><p><a name="G-TYPE-FLAG-VALUE-ABSTRACT:CAPS"></a><span class="term"><code class="literal">G_TYPE_FLAG_VALUE_ABSTRACT</code></span></p></td>
2870 <td>Indicates an abstract value type, i.e. a type
2871  that introduces a value table, but can't be used for
2872  <a class="link" href="gobject-Generic-values.html#g-value-init" title="g_value_init ()"><code class="function">g_value_init()</code></a>.
2873 </td>
2874 </tr>
2875 </tbody>
2876 </table></div>
2877 </div>
2878 <hr>
2879 <div class="refsect2">
2880 <a name="GTypeFundamentalFlags"></a><h3>enum GTypeFundamentalFlags</h3>
2881 <pre class="programlisting">typedef enum {
2882   G_TYPE_FLAG_CLASSED           = (1 &lt;&lt; 0),
2883   G_TYPE_FLAG_INSTANTIATABLE    = (1 &lt;&lt; 1),
2884   G_TYPE_FLAG_DERIVABLE         = (1 &lt;&lt; 2),
2885   G_TYPE_FLAG_DEEP_DERIVABLE    = (1 &lt;&lt; 3)
2886 } GTypeFundamentalFlags;
2887 </pre>
2888 <p>
2889 Bit masks used to check or determine specific characteristics of a
2890 fundamental type.
2891 </p>
2892 <div class="variablelist"><table border="0">
2893 <col align="left" valign="top">
2894 <tbody>
2895 <tr>
2896 <td><p><a name="G-TYPE-FLAG-CLASSED:CAPS"></a><span class="term"><code class="literal">G_TYPE_FLAG_CLASSED</code></span></p></td>
2897 <td>Indicates a classed type.
2898 </td>
2899 </tr>
2900 <tr>
2901 <td><p><a name="G-TYPE-FLAG-INSTANTIATABLE:CAPS"></a><span class="term"><code class="literal">G_TYPE_FLAG_INSTANTIATABLE</code></span></p></td>
2902 <td>Indicates an instantiable type (implies classed).
2903 </td>
2904 </tr>
2905 <tr>
2906 <td><p><a name="G-TYPE-FLAG-DERIVABLE:CAPS"></a><span class="term"><code class="literal">G_TYPE_FLAG_DERIVABLE</code></span></p></td>
2907 <td>Indicates a flat derivable type.
2908 </td>
2909 </tr>
2910 <tr>
2911 <td><p><a name="G-TYPE-FLAG-DEEP-DERIVABLE:CAPS"></a><span class="term"><code class="literal">G_TYPE_FLAG_DEEP_DERIVABLE</code></span></p></td>
2912 <td>Indicates a deep derivable type (implies derivable).
2913 </td>
2914 </tr>
2915 </tbody>
2916 </table></div>
2917 </div>
2918 <hr>
2919 <div class="refsect2">
2920 <a name="g-type-register-static"></a><h3>g_type_register_static ()</h3>
2921 <pre class="programlisting"><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a>               g_type_register_static              (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> parent_type</code></em>,
2922                                                          <em class="parameter"><code>const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *type_name</code></em>,
2923                                                          <em class="parameter"><code>const <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="struct GTypeInfo"><span class="type">GTypeInfo</span></a> *info</code></em>,
2924                                                          <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GTypeFlags" title="enum GTypeFlags"><span class="type">GTypeFlags</span></a> flags</code></em>);</pre>
2925 <p>
2926 Registers <em class="parameter"><code>type_name</code></em> as the name of a new static type derived from
2927 <em class="parameter"><code>parent_type</code></em>.  The type system uses the information contained in the
2928 <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="struct GTypeInfo"><span class="type">GTypeInfo</span></a> structure pointed to by <em class="parameter"><code>info</code></em> to manage the type and its
2929 instances (if not abstract).  The value of <em class="parameter"><code>flags</code></em> determines the nature
2930 (e.g. abstract or not) of the type.
2931 </p>
2932 <div class="variablelist"><table border="0">
2933 <col align="left" valign="top">
2934 <tbody>
2935 <tr>
2936 <td><p><span class="term"><em class="parameter"><code>parent_type</code></em> :</span></p></td>
2937 <td>Type from which this type will be derived.</td>
2938 </tr>
2939 <tr>
2940 <td><p><span class="term"><em class="parameter"><code>type_name</code></em> :</span></p></td>
2941 <td>0-terminated string used as the name of the new type.</td>
2942 </tr>
2943 <tr>
2944 <td><p><span class="term"><em class="parameter"><code>info</code></em> :</span></p></td>
2945 <td>The <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="struct GTypeInfo"><span class="type">GTypeInfo</span></a> structure for this type.</td>
2946 </tr>
2947 <tr>
2948 <td><p><span class="term"><em class="parameter"><code>flags</code></em> :</span></p></td>
2949 <td>Bitwise combination of <a class="link" href="gobject-Type-Information.html#GTypeFlags" title="enum GTypeFlags"><span class="type">GTypeFlags</span></a> values.</td>
2950 </tr>
2951 <tr>
2952 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
2953 <td>The new type identifier.</td>
2954 </tr>
2955 </tbody>
2956 </table></div>
2957 </div>
2958 <hr>
2959 <div class="refsect2">
2960 <a name="g-type-register-static-simple"></a><h3>g_type_register_static_simple ()</h3>
2961 <pre class="programlisting"><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a>               g_type_register_static_simple       (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> parent_type</code></em>,
2962                                                          <em class="parameter"><code>const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *type_name</code></em>,
2963                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> class_size</code></em>,
2964                                                          <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GClassInitFunc" title="GClassInitFunc ()"><span class="type">GClassInitFunc</span></a> class_init</code></em>,
2965                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> instance_size</code></em>,
2966                                                          <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GInstanceInitFunc" title="GInstanceInitFunc ()"><span class="type">GInstanceInitFunc</span></a> instance_init</code></em>,
2967                                                          <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GTypeFlags" title="enum GTypeFlags"><span class="type">GTypeFlags</span></a> flags</code></em>);</pre>
2968 <p>
2969 Registers <em class="parameter"><code>type_name</code></em> as the name of a new static type derived from
2970 <em class="parameter"><code>parent_type</code></em>.  The value of <em class="parameter"><code>flags</code></em> determines the nature (e.g.
2971 abstract or not) of the type. It works by filling a <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="struct GTypeInfo"><span class="type">GTypeInfo</span></a>
2972 struct and calling <a class="link" href="gobject-Type-Information.html#g-type-register-static" title="g_type_register_static ()"><code class="function">g_type_register_static()</code></a>.
2973 </p>
2974 <div class="variablelist"><table border="0">
2975 <col align="left" valign="top">
2976 <tbody>
2977 <tr>
2978 <td><p><span class="term"><em class="parameter"><code>parent_type</code></em> :</span></p></td>
2979 <td>Type from which this type will be derived.</td>
2980 </tr>
2981 <tr>
2982 <td><p><span class="term"><em class="parameter"><code>type_name</code></em> :</span></p></td>
2983 <td>0-terminated string used as the name of the new type.</td>
2984 </tr>
2985 <tr>
2986 <td><p><span class="term"><em class="parameter"><code>class_size</code></em> :</span></p></td>
2987 <td>Size of the class structure (see <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="struct GTypeInfo"><span class="type">GTypeInfo</span></a>)</td>
2988 </tr>
2989 <tr>
2990 <td><p><span class="term"><em class="parameter"><code>class_init</code></em> :</span></p></td>
2991 <td>Location of the class initialization function (see <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="struct GTypeInfo"><span class="type">GTypeInfo</span></a>)</td>
2992 </tr>
2993 <tr>
2994 <td><p><span class="term"><em class="parameter"><code>instance_size</code></em> :</span></p></td>
2995 <td>Size of the instance structure (see <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="struct GTypeInfo"><span class="type">GTypeInfo</span></a>)</td>
2996 </tr>
2997 <tr>
2998 <td><p><span class="term"><em class="parameter"><code>instance_init</code></em> :</span></p></td>
2999 <td>Location of the instance initialization function (see <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="struct GTypeInfo"><span class="type">GTypeInfo</span></a>)</td>
3000 </tr>
3001 <tr>
3002 <td><p><span class="term"><em class="parameter"><code>flags</code></em> :</span></p></td>
3003 <td>Bitwise combination of <a class="link" href="gobject-Type-Information.html#GTypeFlags" title="enum GTypeFlags"><span class="type">GTypeFlags</span></a> values.</td>
3004 </tr>
3005 <tr>
3006 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
3007 <td>The new type identifier.</td>
3008 </tr>
3009 </tbody>
3010 </table></div>
3011 <p class="since">Since 2.12</p>
3012 </div>
3013 <hr>
3014 <div class="refsect2">
3015 <a name="g-type-register-dynamic"></a><h3>g_type_register_dynamic ()</h3>
3016 <pre class="programlisting"><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a>               g_type_register_dynamic             (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> parent_type</code></em>,
3017                                                          <em class="parameter"><code>const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *type_name</code></em>,
3018                                                          <em class="parameter"><code><a class="link" href="GTypePlugin.html" title="GTypePlugin"><span class="type">GTypePlugin</span></a> *plugin</code></em>,
3019                                                          <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GTypeFlags" title="enum GTypeFlags"><span class="type">GTypeFlags</span></a> flags</code></em>);</pre>
3020 <p>
3021 Registers <em class="parameter"><code>type_name</code></em> as the name of a new dynamic type derived from
3022 <em class="parameter"><code>parent_type</code></em>.  The type system uses the information contained in the
3023 <a class="link" href="GTypePlugin.html" title="GTypePlugin"><span class="type">GTypePlugin</span></a> structure pointed to by <em class="parameter"><code>plugin</code></em> to manage the type and its
3024 instances (if not abstract).  The value of <em class="parameter"><code>flags</code></em> determines the nature
3025 (e.g. abstract or not) of the type.
3026 </p>
3027 <div class="variablelist"><table border="0">
3028 <col align="left" valign="top">
3029 <tbody>
3030 <tr>
3031 <td><p><span class="term"><em class="parameter"><code>parent_type</code></em> :</span></p></td>
3032 <td>Type from which this type will be derived.</td>
3033 </tr>
3034 <tr>
3035 <td><p><span class="term"><em class="parameter"><code>type_name</code></em> :</span></p></td>
3036 <td>0-terminated string used as the name of the new type.</td>
3037 </tr>
3038 <tr>
3039 <td><p><span class="term"><em class="parameter"><code>plugin</code></em> :</span></p></td>
3040 <td>The <a class="link" href="GTypePlugin.html" title="GTypePlugin"><span class="type">GTypePlugin</span></a> structure to retrieve the <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="struct GTypeInfo"><span class="type">GTypeInfo</span></a> from.</td>
3041 </tr>
3042 <tr>
3043 <td><p><span class="term"><em class="parameter"><code>flags</code></em> :</span></p></td>
3044 <td>Bitwise combination of <a class="link" href="gobject-Type-Information.html#GTypeFlags" title="enum GTypeFlags"><span class="type">GTypeFlags</span></a> values.</td>
3045 </tr>
3046 <tr>
3047 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
3048 <td>The new type identifier or <a class="link" href="gobject-Type-Information.html#G-TYPE-INVALID:CAPS" title="G_TYPE_INVALID"><span class="type">G_TYPE_INVALID</span></a> if registration failed.</td>
3049 </tr>
3050 </tbody>
3051 </table></div>
3052 </div>
3053 <hr>
3054 <div class="refsect2">
3055 <a name="g-type-register-fundamental"></a><h3>g_type_register_fundamental ()</h3>
3056 <pre class="programlisting"><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a>               g_type_register_fundamental         (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type_id</code></em>,
3057                                                          <em class="parameter"><code>const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *type_name</code></em>,
3058                                                          <em class="parameter"><code>const <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="struct GTypeInfo"><span class="type">GTypeInfo</span></a> *info</code></em>,
3059                                                          <em class="parameter"><code>const <a class="link" href="gobject-Type-Information.html#GTypeFundamentalInfo" title="struct GTypeFundamentalInfo"><span class="type">GTypeFundamentalInfo</span></a> *finfo</code></em>,
3060                                                          <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GTypeFlags" title="enum GTypeFlags"><span class="type">GTypeFlags</span></a> flags</code></em>);</pre>
3061 <p>
3062 Registers <em class="parameter"><code>type_id</code></em> as the predefined identifier and <em class="parameter"><code>type_name</code></em> as the
3063 name of a fundamental type. If <em class="parameter"><code>type_id</code></em> is already registered, or a type
3064 named <em class="parameter"><code>type_name</code></em> is already registered, the behaviour is undefined. The type
3065 system uses the information contained in the <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="struct GTypeInfo"><span class="type">GTypeInfo</span></a> structure pointed to
3066 by <em class="parameter"><code>info</code></em> and the <a class="link" href="gobject-Type-Information.html#GTypeFundamentalInfo" title="struct GTypeFundamentalInfo"><span class="type">GTypeFundamentalInfo</span></a> structure pointed to by <em class="parameter"><code>finfo</code></em> to
3067 manage the type and its instances. The value of <em class="parameter"><code>flags</code></em> determines additional
3068 characteristics of the fundamental type.
3069 </p>
3070 <div class="variablelist"><table border="0">
3071 <col align="left" valign="top">
3072 <tbody>
3073 <tr>
3074 <td><p><span class="term"><em class="parameter"><code>type_id</code></em> :</span></p></td>
3075 <td>A predefined type identifier.</td>
3076 </tr>
3077 <tr>
3078 <td><p><span class="term"><em class="parameter"><code>type_name</code></em> :</span></p></td>
3079 <td>0-terminated string used as the name of the new type.</td>
3080 </tr>
3081 <tr>
3082 <td><p><span class="term"><em class="parameter"><code>info</code></em> :</span></p></td>
3083 <td>The <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="struct GTypeInfo"><span class="type">GTypeInfo</span></a> structure for this type.</td>
3084 </tr>
3085 <tr>
3086 <td><p><span class="term"><em class="parameter"><code>finfo</code></em> :</span></p></td>
3087 <td>The <a class="link" href="gobject-Type-Information.html#GTypeFundamentalInfo" title="struct GTypeFundamentalInfo"><span class="type">GTypeFundamentalInfo</span></a> structure for this type.</td>
3088 </tr>
3089 <tr>
3090 <td><p><span class="term"><em class="parameter"><code>flags</code></em> :</span></p></td>
3091 <td>Bitwise combination of <a class="link" href="gobject-Type-Information.html#GTypeFlags" title="enum GTypeFlags"><span class="type">GTypeFlags</span></a> values.</td>
3092 </tr>
3093 <tr>
3094 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
3095 <td>The predefined type identifier.</td>
3096 </tr>
3097 </tbody>
3098 </table></div>
3099 </div>
3100 <hr>
3101 <div class="refsect2">
3102 <a name="g-type-add-interface-static"></a><h3>g_type_add_interface_static ()</h3>
3103 <pre class="programlisting"><span class="returnvalue">void</span>                g_type_add_interface_static         (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> instance_type</code></em>,
3104                                                          <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> interface_type</code></em>,
3105                                                          <em class="parameter"><code>const <a class="link" href="gobject-Type-Information.html#GInterfaceInfo" title="struct GInterfaceInfo"><span class="type">GInterfaceInfo</span></a> *info</code></em>);</pre>
3106 <p>
3107 Adds the static <em class="parameter"><code>interface_type</code></em> to <em class="parameter"><code>instantiable_type</code></em>.  The
3108 information contained in the <a class="link" href="gobject-Type-Information.html#GInterfaceInfo" title="struct GInterfaceInfo"><span class="type">GInterfaceInfo</span></a> structure pointed to by
3109 <em class="parameter"><code>info</code></em> is used to manage the relationship.
3110 </p>
3111 <div class="variablelist"><table border="0">
3112 <col align="left" valign="top">
3113 <tbody>
3114 <tr>
3115 <td><p><span class="term"><em class="parameter"><code>instance_type</code></em> :</span></p></td>
3116 <td>
3117 <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value of an instantiable type.</td>
3118 </tr>
3119 <tr>
3120 <td><p><span class="term"><em class="parameter"><code>interface_type</code></em> :</span></p></td>
3121 <td>
3122 <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value of an interface type.</td>
3123 </tr>
3124 <tr>
3125 <td><p><span class="term"><em class="parameter"><code>info</code></em> :</span></p></td>
3126 <td>The <a class="link" href="gobject-Type-Information.html#GInterfaceInfo" title="struct GInterfaceInfo"><span class="type">GInterfaceInfo</span></a> structure for this
3127 (<em class="parameter"><code>instance_type</code></em>, <em class="parameter"><code>interface_type</code></em>) combination.</td>
3128 </tr>
3129 </tbody>
3130 </table></div>
3131 </div>
3132 <hr>
3133 <div class="refsect2">
3134 <a name="g-type-add-interface-dynamic"></a><h3>g_type_add_interface_dynamic ()</h3>
3135 <pre class="programlisting"><span class="returnvalue">void</span>                g_type_add_interface_dynamic        (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> instance_type</code></em>,
3136                                                          <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> interface_type</code></em>,
3137                                                          <em class="parameter"><code><a class="link" href="GTypePlugin.html" title="GTypePlugin"><span class="type">GTypePlugin</span></a> *plugin</code></em>);</pre>
3138 <p>
3139 Adds the dynamic <em class="parameter"><code>interface_type</code></em> to <em class="parameter"><code>instantiable_type</code></em>. The information
3140 contained in the <a class="link" href="GTypePlugin.html" title="GTypePlugin"><span class="type">GTypePlugin</span></a> structure pointed to by <em class="parameter"><code>plugin</code></em>
3141 is used to manage the relationship.
3142 </p>
3143 <div class="variablelist"><table border="0">
3144 <col align="left" valign="top">
3145 <tbody>
3146 <tr>
3147 <td><p><span class="term"><em class="parameter"><code>instance_type</code></em> :</span></p></td>
3148 <td>the <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value of an instantiable type.</td>
3149 </tr>
3150 <tr>
3151 <td><p><span class="term"><em class="parameter"><code>interface_type</code></em> :</span></p></td>
3152 <td>the <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value of an interface type.</td>
3153 </tr>
3154 <tr>
3155 <td><p><span class="term"><em class="parameter"><code>plugin</code></em> :</span></p></td>
3156 <td>the <a class="link" href="GTypePlugin.html" title="GTypePlugin"><span class="type">GTypePlugin</span></a> structure to retrieve the <a class="link" href="gobject-Type-Information.html#GInterfaceInfo" title="struct GInterfaceInfo"><span class="type">GInterfaceInfo</span></a> from.</td>
3157 </tr>
3158 </tbody>
3159 </table></div>
3160 </div>
3161 <hr>
3162 <div class="refsect2">
3163 <a name="g-type-interface-add-prerequisite"></a><h3>g_type_interface_add_prerequisite ()</h3>
3164 <pre class="programlisting"><span class="returnvalue">void</span>                g_type_interface_add_prerequisite   (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> interface_type</code></em>,
3165                                                          <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> prerequisite_type</code></em>);</pre>
3166 <p>
3167 Adds <em class="parameter"><code>prerequisite_type</code></em> to the list of prerequisites of <em class="parameter"><code>interface_type</code></em>.
3168 This means that any type implementing <em class="parameter"><code>interface_type</code></em> must also implement
3169 <em class="parameter"><code>prerequisite_type</code></em>. Prerequisites can be thought of as an alternative to
3170 interface derivation (which GType doesn't support). An interface can have
3171 at most one instantiatable prerequisite type.
3172 </p>
3173 <div class="variablelist"><table border="0">
3174 <col align="left" valign="top">
3175 <tbody>
3176 <tr>
3177 <td><p><span class="term"><em class="parameter"><code>interface_type</code></em> :</span></p></td>
3178 <td>
3179 <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value of an interface type.</td>
3180 </tr>
3181 <tr>
3182 <td><p><span class="term"><em class="parameter"><code>prerequisite_type</code></em> :</span></p></td>
3183 <td>
3184 <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value of an interface or instantiatable type.</td>
3185 </tr>
3186 </tbody>
3187 </table></div>
3188 </div>
3189 <hr>
3190 <div class="refsect2">
3191 <a name="g-type-get-plugin"></a><h3>g_type_get_plugin ()</h3>
3192 <pre class="programlisting"><a class="link" href="GTypePlugin.html" title="GTypePlugin"><span class="returnvalue">GTypePlugin</span></a> *       g_type_get_plugin                   (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>);</pre>
3193 <p>
3194 Returns the <a class="link" href="GTypePlugin.html" title="GTypePlugin"><span class="type">GTypePlugin</span></a> structure for <em class="parameter"><code>type</code></em> or
3195 <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if <em class="parameter"><code>type</code></em> does not have a <a class="link" href="GTypePlugin.html" title="GTypePlugin"><span class="type">GTypePlugin</span></a> structure.
3196 </p>
3197 <div class="variablelist"><table border="0">
3198 <col align="left" valign="top">
3199 <tbody>
3200 <tr>
3201 <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
3202 <td>The <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> to retrieve the plugin for.</td>
3203 </tr>
3204 <tr>
3205 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
3206 <td>The corresponding plugin if <em class="parameter"><code>type</code></em> is a
3207 dynamic type, <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> otherwise. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
3208 </td>
3209 </tr>
3210 </tbody>
3211 </table></div>
3212 </div>
3213 <hr>
3214 <div class="refsect2">
3215 <a name="g-type-interface-get-plugin"></a><h3>g_type_interface_get_plugin ()</h3>
3216 <pre class="programlisting"><a class="link" href="GTypePlugin.html" title="GTypePlugin"><span class="returnvalue">GTypePlugin</span></a> *       g_type_interface_get_plugin         (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> instance_type</code></em>,
3217                                                          <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> interface_type</code></em>);</pre>
3218 <p>
3219 Returns the <a class="link" href="GTypePlugin.html" title="GTypePlugin"><span class="type">GTypePlugin</span></a> structure for the dynamic interface
3220 <em class="parameter"><code>interface_type</code></em> which has been added to <em class="parameter"><code>instance_type</code></em>, or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if
3221 <em class="parameter"><code>interface_type</code></em> has not been added to <em class="parameter"><code>instance_type</code></em> or does not
3222 have a <a class="link" href="GTypePlugin.html" title="GTypePlugin"><span class="type">GTypePlugin</span></a> structure. See <a class="link" href="gobject-Type-Information.html#g-type-add-interface-dynamic" title="g_type_add_interface_dynamic ()"><code class="function">g_type_add_interface_dynamic()</code></a>.
3223 </p>
3224 <div class="variablelist"><table border="0">
3225 <col align="left" valign="top">
3226 <tbody>
3227 <tr>
3228 <td><p><span class="term"><em class="parameter"><code>instance_type</code></em> :</span></p></td>
3229 <td>the <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value of an instantiatable type.</td>
3230 </tr>
3231 <tr>
3232 <td><p><span class="term"><em class="parameter"><code>interface_type</code></em> :</span></p></td>
3233 <td>the <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value of an interface type.</td>
3234 </tr>
3235 <tr>
3236 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
3237 <td>the <a class="link" href="GTypePlugin.html" title="GTypePlugin"><span class="type">GTypePlugin</span></a> for the dynamic
3238 interface <em class="parameter"><code>interface_type</code></em> of <em class="parameter"><code>instance_type</code></em>. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
3239 </td>
3240 </tr>
3241 </tbody>
3242 </table></div>
3243 </div>
3244 <hr>
3245 <div class="refsect2">
3246 <a name="g-type-fundamental-next"></a><h3>g_type_fundamental_next ()</h3>
3247 <pre class="programlisting"><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a>               g_type_fundamental_next             (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
3248 <p>
3249 Returns the next free fundamental type id which can be used to
3250 register a new fundamental type with <a class="link" href="gobject-Type-Information.html#g-type-register-fundamental" title="g_type_register_fundamental ()"><code class="function">g_type_register_fundamental()</code></a>.
3251 The returned type ID represents the highest currently registered
3252 fundamental type identifier.
3253 </p>
3254 <div class="variablelist"><table border="0">
3255 <col align="left" valign="top">
3256 <tbody><tr>
3257 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
3258 <td>The nextmost fundamental type ID to be registered,
3259 or 0 if the type system ran out of fundamental type IDs.</td>
3260 </tr></tbody>
3261 </table></div>
3262 </div>
3263 <hr>
3264 <div class="refsect2">
3265 <a name="g-type-fundamental"></a><h3>g_type_fundamental ()</h3>
3266 <pre class="programlisting"><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a>               g_type_fundamental                  (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type_id</code></em>);</pre>
3267 <p>
3268 Internal function, used to extract the fundamental type ID portion.
3269 use <a class="link" href="gobject-Type-Information.html#G-TYPE-FUNDAMENTAL:CAPS" title="G_TYPE_FUNDAMENTAL()"><code class="function">G_TYPE_FUNDAMENTAL()</code></a> instead.
3270 </p>
3271 <div class="variablelist"><table border="0">
3272 <col align="left" valign="top">
3273 <tbody>
3274 <tr>
3275 <td><p><span class="term"><em class="parameter"><code>type_id</code></em> :</span></p></td>
3276 <td>valid type ID</td>
3277 </tr>
3278 <tr>
3279 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
3280 <td>fundamental type ID</td>
3281 </tr>
3282 </tbody>
3283 </table></div>
3284 </div>
3285 <hr>
3286 <div class="refsect2">
3287 <a name="g-type-create-instance"></a><h3>g_type_create_instance ()</h3>
3288 <pre class="programlisting"><a class="link" href="gobject-Type-Information.html#GTypeInstance" title="struct GTypeInstance"><span class="returnvalue">GTypeInstance</span></a> *     g_type_create_instance              (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>);</pre>
3289 <p>
3290 Creates and initializes an instance of <em class="parameter"><code>type</code></em> if <em class="parameter"><code>type</code></em> is valid and
3291 can be instantiated. The type system only performs basic allocation
3292 and structure setups for instances: actual instance creation should
3293 happen through functions supplied by the type's fundamental type
3294 implementation.  So use of <a class="link" href="gobject-Type-Information.html#g-type-create-instance" title="g_type_create_instance ()"><code class="function">g_type_create_instance()</code></a> is reserved for
3295 implementators of fundamental types only. E.g. instances of the
3296 <a class="link" href="gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> hierarchy should be created via <a class="link" href="gobject-The-Base-Object-Type.html#g-object-new" title="g_object_new ()"><code class="function">g_object_new()</code></a> and
3297 <span class="emphasis"><em>never</em></span> directly through
3298 <a class="link" href="gobject-Type-Information.html#g-type-create-instance" title="g_type_create_instance ()"><code class="function">g_type_create_instance()</code></a> which doesn't handle things like singleton
3299 objects or object construction.  Note: Do <span class="emphasis"><em>not</em></span>
3300 use this function, unless you're implementing a fundamental
3301 type. Also language bindings should <span class="emphasis"><em>not</em></span> use
3302 this function but <a class="link" href="gobject-The-Base-Object-Type.html#g-object-new" title="g_object_new ()"><code class="function">g_object_new()</code></a> instead.
3303 </p>
3304 <div class="variablelist"><table border="0">
3305 <col align="left" valign="top">
3306 <tbody>
3307 <tr>
3308 <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
3309 <td>An instantiatable type to create an instance for.</td>
3310 </tr>
3311 <tr>
3312 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
3313 <td>An allocated and initialized instance, subject to further
3314 treatment by the fundamental type implementation.</td>
3315 </tr>
3316 </tbody>
3317 </table></div>
3318 </div>
3319 <hr>
3320 <div class="refsect2">
3321 <a name="g-type-free-instance"></a><h3>g_type_free_instance ()</h3>
3322 <pre class="programlisting"><span class="returnvalue">void</span>                g_type_free_instance                (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GTypeInstance" title="struct GTypeInstance"><span class="type">GTypeInstance</span></a> *instance</code></em>);</pre>
3323 <p>
3324 Frees an instance of a type, returning it to the instance pool for
3325 the type, if there is one.
3326 </p>
3327 <p>
3328 Like <a class="link" href="gobject-Type-Information.html#g-type-create-instance" title="g_type_create_instance ()"><code class="function">g_type_create_instance()</code></a>, this function is reserved for
3329 implementors of fundamental types.
3330 </p>
3331 <div class="variablelist"><table border="0">
3332 <col align="left" valign="top">
3333 <tbody><tr>
3334 <td><p><span class="term"><em class="parameter"><code>instance</code></em> :</span></p></td>
3335 <td>an instance of a type.</td>
3336 </tr></tbody>
3337 </table></div>
3338 </div>
3339 <hr>
3340 <div class="refsect2">
3341 <a name="g-type-add-class-cache-func"></a><h3>g_type_add_class_cache_func ()</h3>
3342 <pre class="programlisting"><span class="returnvalue">void</span>                g_type_add_class_cache_func         (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> cache_data</code></em>,
3343                                                          <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GTypeClassCacheFunc" title="GTypeClassCacheFunc ()"><span class="type">GTypeClassCacheFunc</span></a> cache_func</code></em>);</pre>
3344 <p>
3345 Adds a <a class="link" href="gobject-Type-Information.html#GTypeClassCacheFunc" title="GTypeClassCacheFunc ()"><span class="type">GTypeClassCacheFunc</span></a> to be called before the reference count of a
3346 class goes from one to zero. This can be used to prevent premature class
3347 destruction. All installed <a class="link" href="gobject-Type-Information.html#GTypeClassCacheFunc" title="GTypeClassCacheFunc ()"><span class="type">GTypeClassCacheFunc</span></a> functions will be chained
3348 until one of them returns <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>. The functions have to check the class id
3349 passed in to figure whether they actually want to cache the class of this
3350 type, since all classes are routed through the same <a class="link" href="gobject-Type-Information.html#GTypeClassCacheFunc" title="GTypeClassCacheFunc ()"><span class="type">GTypeClassCacheFunc</span></a>
3351 chain.
3352 </p>
3353 <div class="variablelist"><table border="0">
3354 <col align="left" valign="top">
3355 <tbody>
3356 <tr>
3357 <td><p><span class="term"><em class="parameter"><code>cache_data</code></em> :</span></p></td>
3358 <td>data to be passed to <em class="parameter"><code>cache_func</code></em>
3359 </td>
3360 </tr>
3361 <tr>
3362 <td><p><span class="term"><em class="parameter"><code>cache_func</code></em> :</span></p></td>
3363 <td>a <a class="link" href="gobject-Type-Information.html#GTypeClassCacheFunc" title="GTypeClassCacheFunc ()"><span class="type">GTypeClassCacheFunc</span></a>
3364 </td>
3365 </tr>
3366 </tbody>
3367 </table></div>
3368 </div>
3369 <hr>
3370 <div class="refsect2">
3371 <a name="g-type-remove-class-cache-func"></a><h3>g_type_remove_class_cache_func ()</h3>
3372 <pre class="programlisting"><span class="returnvalue">void</span>                g_type_remove_class_cache_func      (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> cache_data</code></em>,
3373                                                          <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GTypeClassCacheFunc" title="GTypeClassCacheFunc ()"><span class="type">GTypeClassCacheFunc</span></a> cache_func</code></em>);</pre>
3374 <p>
3375 Removes a previously installed <a class="link" href="gobject-Type-Information.html#GTypeClassCacheFunc" title="GTypeClassCacheFunc ()"><span class="type">GTypeClassCacheFunc</span></a>. The cache
3376 maintained by <em class="parameter"><code>cache_func</code></em> has to be empty when calling
3377 <a class="link" href="gobject-Type-Information.html#g-type-remove-class-cache-func" title="g_type_remove_class_cache_func ()"><code class="function">g_type_remove_class_cache_func()</code></a> to avoid leaks.
3378 </p>
3379 <div class="variablelist"><table border="0">
3380 <col align="left" valign="top">
3381 <tbody>
3382 <tr>
3383 <td><p><span class="term"><em class="parameter"><code>cache_data</code></em> :</span></p></td>
3384 <td>data that was given when adding <em class="parameter"><code>cache_func</code></em>
3385 </td>
3386 </tr>
3387 <tr>
3388 <td><p><span class="term"><em class="parameter"><code>cache_func</code></em> :</span></p></td>
3389 <td>a <a class="link" href="gobject-Type-Information.html#GTypeClassCacheFunc" title="GTypeClassCacheFunc ()"><span class="type">GTypeClassCacheFunc</span></a>
3390 </td>
3391 </tr>
3392 </tbody>
3393 </table></div>
3394 </div>
3395 <hr>
3396 <div class="refsect2">
3397 <a name="g-type-class-unref-uncached"></a><h3>g_type_class_unref_uncached ()</h3>
3398 <pre class="programlisting"><span class="returnvalue">void</span>                g_type_class_unref_uncached         (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> g_class</code></em>);</pre>
3399 <p>
3400 A variant of <a class="link" href="gobject-Type-Information.html#g-type-class-unref" title="g_type_class_unref ()"><code class="function">g_type_class_unref()</code></a> for use in <a class="link" href="gobject-Type-Information.html#GTypeClassCacheFunc" title="GTypeClassCacheFunc ()"><span class="type">GTypeClassCacheFunc</span></a>
3401 implementations. It unreferences a class without consulting the chain
3402 of <a class="link" href="gobject-Type-Information.html#GTypeClassCacheFunc" title="GTypeClassCacheFunc ()"><span class="type">GTypeClassCacheFunc</span></a>s, avoiding the recursion which would occur
3403 otherwise.
3404 </p>
3405 <div class="variablelist"><table border="0">
3406 <col align="left" valign="top">
3407 <tbody><tr>
3408 <td><p><span class="term"><em class="parameter"><code>g_class</code></em> :</span></p></td>
3409 <td>The <a class="link" href="gobject-Type-Information.html#GTypeClass" title="struct GTypeClass"><span class="type">GTypeClass</span></a> structure to
3410 unreference. <span class="annotation">[<acronym title="Override the parsed C type with given type"><span class="acronym">type</span></acronym> GObject.TypeClass]</span>
3411 </td>
3412 </tr></tbody>
3413 </table></div>
3414 </div>
3415 <hr>
3416 <div class="refsect2">
3417 <a name="g-type-add-interface-check"></a><h3>g_type_add_interface_check ()</h3>
3418 <pre class="programlisting"><span class="returnvalue">void</span>                g_type_add_interface_check          (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> check_data</code></em>,
3419                                                          <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GTypeInterfaceCheckFunc" title="GTypeInterfaceCheckFunc ()"><span class="type">GTypeInterfaceCheckFunc</span></a> check_func</code></em>);</pre>
3420 <p>
3421 Adds a function to be called after an interface vtable is
3422 initialized for any class (i.e. after the <em class="parameter"><code>interface_init</code></em> member of
3423 <a class="link" href="gobject-Type-Information.html#GInterfaceInfo" title="struct GInterfaceInfo"><span class="type">GInterfaceInfo</span></a> has been called).
3424 </p>
3425 <p>
3426 This function is useful when you want to check an invariant that
3427 depends on the interfaces of a class. For instance, the
3428 implementation of <a class="link" href="gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> uses this facility to check that an
3429 object implements all of the properties that are defined on its
3430 interfaces.
3431 </p>
3432 <div class="variablelist"><table border="0">
3433 <col align="left" valign="top">
3434 <tbody>
3435 <tr>
3436 <td><p><span class="term"><em class="parameter"><code>check_data</code></em> :</span></p></td>
3437 <td>data to pass to <em class="parameter"><code>check_func</code></em>
3438 </td>
3439 </tr>
3440 <tr>
3441 <td><p><span class="term"><em class="parameter"><code>check_func</code></em> :</span></p></td>
3442 <td>function to be called after each interface
3443 is initialized.</td>
3444 </tr>
3445 </tbody>
3446 </table></div>
3447 <p class="since">Since 2.4</p>
3448 </div>
3449 <hr>
3450 <div class="refsect2">
3451 <a name="g-type-remove-interface-check"></a><h3>g_type_remove_interface_check ()</h3>
3452 <pre class="programlisting"><span class="returnvalue">void</span>                g_type_remove_interface_check       (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> check_data</code></em>,
3453                                                          <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GTypeInterfaceCheckFunc" title="GTypeInterfaceCheckFunc ()"><span class="type">GTypeInterfaceCheckFunc</span></a> check_func</code></em>);</pre>
3454 <p>
3455 Removes an interface check function added with
3456 <a class="link" href="gobject-Type-Information.html#g-type-add-interface-check" title="g_type_add_interface_check ()"><code class="function">g_type_add_interface_check()</code></a>.
3457 </p>
3458 <div class="variablelist"><table border="0">
3459 <col align="left" valign="top">
3460 <tbody>
3461 <tr>
3462 <td><p><span class="term"><em class="parameter"><code>check_data</code></em> :</span></p></td>
3463 <td>callback data passed to <a class="link" href="gobject-Type-Information.html#g-type-add-interface-check" title="g_type_add_interface_check ()"><code class="function">g_type_add_interface_check()</code></a>
3464 </td>
3465 </tr>
3466 <tr>
3467 <td><p><span class="term"><em class="parameter"><code>check_func</code></em> :</span></p></td>
3468 <td>callback function passed to <a class="link" href="gobject-Type-Information.html#g-type-add-interface-check" title="g_type_add_interface_check ()"><code class="function">g_type_add_interface_check()</code></a>
3469 </td>
3470 </tr>
3471 </tbody>
3472 </table></div>
3473 <p class="since">Since 2.4</p>
3474 </div>
3475 <hr>
3476 <div class="refsect2">
3477 <a name="GTypeInterfaceCheckFunc"></a><h3>GTypeInterfaceCheckFunc ()</h3>
3478 <pre class="programlisting"><span class="returnvalue">void</span>                (*GTypeInterfaceCheckFunc)          (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> check_data</code></em>,
3479                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> g_iface</code></em>);</pre>
3480 <p>
3481 A callback called after an interface vtable is initialized.
3482 See <a class="link" href="gobject-Type-Information.html#g-type-add-interface-check" title="g_type_add_interface_check ()"><code class="function">g_type_add_interface_check()</code></a>.
3483 </p>
3484 <div class="variablelist"><table border="0">
3485 <col align="left" valign="top">
3486 <tbody>
3487 <tr>
3488 <td><p><span class="term"><em class="parameter"><code>check_data</code></em> :</span></p></td>
3489 <td>data passed to <a class="link" href="gobject-Type-Information.html#g-type-add-interface-check" title="g_type_add_interface_check ()"><code class="function">g_type_add_interface_check()</code></a>.</td>
3490 </tr>
3491 <tr>
3492 <td><p><span class="term"><em class="parameter"><code>g_iface</code></em> :</span></p></td>
3493 <td>the interface that has been initialized</td>
3494 </tr>
3495 </tbody>
3496 </table></div>
3497 <p class="since">Since 2.4</p>
3498 </div>
3499 <hr>
3500 <div class="refsect2">
3501 <a name="g-type-value-table-peek"></a><h3>g_type_value_table_peek ()</h3>
3502 <pre class="programlisting"><a class="link" href="gobject-Type-Information.html#GTypeValueTable" title="struct GTypeValueTable"><span class="returnvalue">GTypeValueTable</span></a> *   g_type_value_table_peek             (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>);</pre>
3503 <p>
3504 Returns the location of the <a class="link" href="gobject-Type-Information.html#GTypeValueTable" title="struct GTypeValueTable"><span class="type">GTypeValueTable</span></a> associated with <em class="parameter"><code>type</code></em>.
3505 <span class="emphasis"><em>Note that this function should only be used from source code
3506 that implements or has internal knowledge of the implementation of
3507 <em class="parameter"><code>type</code></em>.</em></span>
3508 </p>
3509 <div class="variablelist"><table border="0">
3510 <col align="left" valign="top">
3511 <tbody>
3512 <tr>
3513 <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
3514 <td>A <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value.</td>
3515 </tr>
3516 <tr>
3517 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
3518 <td>Location of the <a class="link" href="gobject-Type-Information.html#GTypeValueTable" title="struct GTypeValueTable"><span class="type">GTypeValueTable</span></a> associated with <em class="parameter"><code>type</code></em> or
3519 <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if there is no <a class="link" href="gobject-Type-Information.html#GTypeValueTable" title="struct GTypeValueTable"><span class="type">GTypeValueTable</span></a> associated with <em class="parameter"><code>type</code></em>.</td>
3520 </tr>
3521 </tbody>
3522 </table></div>
3523 </div>
3524 <hr>
3525 <div class="refsect2">
3526 <a name="G-DEFINE-TYPE:CAPS"></a><h3>G_DEFINE_TYPE()</h3>
3527 <pre class="programlisting">#define G_DEFINE_TYPE(TN, t_n, T_P)                     G_DEFINE_TYPE_EXTENDED (TN, t_n, T_P, 0, {})
3528 </pre>
3529 <p>
3530 A convenience macro for type implementations, which declares a 
3531 class initialization function, an instance initialization function (see <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="struct GTypeInfo"><span class="type">GTypeInfo</span></a> for information about 
3532 these) and a static variable named <em class="parameter"><code>t_n</code></em>_parent_class pointing to the parent class. Furthermore, it defines 
3533 a *_get_type() function. See <a class="link" href="gobject-Type-Information.html#G-DEFINE-TYPE-EXTENDED:CAPS" title="G_DEFINE_TYPE_EXTENDED()"><code class="function">G_DEFINE_TYPE_EXTENDED()</code></a> for an example.
3534 </p>
3535 <div class="variablelist"><table border="0">
3536 <col align="left" valign="top">
3537 <tbody>
3538 <tr>
3539 <td><p><span class="term"><em class="parameter"><code>TN</code></em> :</span></p></td>
3540 <td>The name of the new type, in Camel case.</td>
3541 </tr>
3542 <tr>
3543 <td><p><span class="term"><em class="parameter"><code>t_n</code></em> :</span></p></td>
3544 <td>The name of the new type, in lowercase, with words
3545 separated by '_'.</td>
3546 </tr>
3547 <tr>
3548 <td><p><span class="term"><em class="parameter"><code>T_P</code></em> :</span></p></td>
3549 <td>The <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> of the parent type.</td>
3550 </tr>
3551 </tbody>
3552 </table></div>
3553 <p class="since">Since 2.4</p>
3554 </div>
3555 <hr>
3556 <div class="refsect2">
3557 <a name="G-DEFINE-TYPE-WITH-CODE:CAPS"></a><h3>G_DEFINE_TYPE_WITH_CODE()</h3>
3558 <pre class="programlisting">#define G_DEFINE_TYPE_WITH_CODE(TN, t_n, T_P, _C_)      _G_DEFINE_TYPE_EXTENDED_BEGIN (TN, t_n, T_P, 0) {_C_;} _G_DEFINE_TYPE_EXTENDED_END()
3559 </pre>
3560 <p>
3561 A convenience macro for type implementations.  
3562 Similar to <a class="link" href="gobject-Type-Information.html#G-DEFINE-TYPE:CAPS" title="G_DEFINE_TYPE()"><code class="function">G_DEFINE_TYPE()</code></a>, but allows you to insert custom code into the 
3563 *_get_type() function, e.g. interface implementations via <a class="link" href="gobject-Type-Information.html#G-IMPLEMENT-INTERFACE:CAPS" title="G_IMPLEMENT_INTERFACE()"><code class="function">G_IMPLEMENT_INTERFACE()</code></a>.
3564 See <a class="link" href="gobject-Type-Information.html#G-DEFINE-TYPE-EXTENDED:CAPS" title="G_DEFINE_TYPE_EXTENDED()"><code class="function">G_DEFINE_TYPE_EXTENDED()</code></a> for an example.
3565 </p>
3566 <div class="variablelist"><table border="0">
3567 <col align="left" valign="top">
3568 <tbody>
3569 <tr>
3570 <td><p><span class="term"><em class="parameter"><code>TN</code></em> :</span></p></td>
3571 <td>The name of the new type, in Camel case.</td>
3572 </tr>
3573 <tr>
3574 <td><p><span class="term"><em class="parameter"><code>t_n</code></em> :</span></p></td>
3575 <td>The name of the new type in lowercase, with words separated by '_'.</td>
3576 </tr>
3577 <tr>
3578 <td><p><span class="term"><em class="parameter"><code>T_P</code></em> :</span></p></td>
3579 <td>The <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> of the parent type.</td>
3580 </tr>
3581 <tr>
3582 <td><p><span class="term"><em class="parameter"><code>_C_</code></em> :</span></p></td>
3583 <td>Custom code that gets inserted in the *_get_type() function.</td>
3584 </tr>
3585 </tbody>
3586 </table></div>
3587 <p class="since">Since 2.4</p>
3588 </div>
3589 <hr>
3590 <div class="refsect2">
3591 <a name="G-DEFINE-ABSTRACT-TYPE:CAPS"></a><h3>G_DEFINE_ABSTRACT_TYPE()</h3>
3592 <pre class="programlisting">#define G_DEFINE_ABSTRACT_TYPE(TN, t_n, T_P)                    G_DEFINE_TYPE_EXTENDED (TN, t_n, T_P, G_TYPE_FLAG_ABSTRACT, {})
3593 </pre>
3594 <p>
3595 A convenience macro for type implementations. 
3596 Similar to <a class="link" href="gobject-Type-Information.html#G-DEFINE-TYPE:CAPS" title="G_DEFINE_TYPE()"><code class="function">G_DEFINE_TYPE()</code></a>, but defines an abstract type. 
3597 See <a class="link" href="gobject-Type-Information.html#G-DEFINE-TYPE-EXTENDED:CAPS" title="G_DEFINE_TYPE_EXTENDED()"><code class="function">G_DEFINE_TYPE_EXTENDED()</code></a> for an example.
3598 </p>
3599 <div class="variablelist"><table border="0">
3600 <col align="left" valign="top">
3601 <tbody>
3602 <tr>
3603 <td><p><span class="term"><em class="parameter"><code>TN</code></em> :</span></p></td>
3604 <td>The name of the new type, in Camel case.</td>
3605 </tr>
3606 <tr>
3607 <td><p><span class="term"><em class="parameter"><code>t_n</code></em> :</span></p></td>
3608 <td>The name of the new type, in lowercase, with words
3609 separated by '_'.</td>
3610 </tr>
3611 <tr>
3612 <td><p><span class="term"><em class="parameter"><code>T_P</code></em> :</span></p></td>
3613 <td>The <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> of the parent type.</td>
3614 </tr>
3615 </tbody>
3616 </table></div>
3617 <p class="since">Since 2.4</p>
3618 </div>
3619 <hr>
3620 <div class="refsect2">
3621 <a name="G-DEFINE-ABSTRACT-TYPE-WITH-CODE:CAPS"></a><h3>G_DEFINE_ABSTRACT_TYPE_WITH_CODE()</h3>
3622 <pre class="programlisting">#define G_DEFINE_ABSTRACT_TYPE_WITH_CODE(TN, t_n, T_P, _C_) _G_DEFINE_TYPE_EXTENDED_BEGIN (TN, t_n, T_P, G_TYPE_FLAG_ABSTRACT) {_C_;} _G_DEFINE_TYPE_EXTENDED_END()
3623 </pre>
3624 <p>
3625 A convenience macro for type implementations.
3626 Similar to <a class="link" href="gobject-Type-Information.html#G-DEFINE-TYPE-WITH-CODE:CAPS" title="G_DEFINE_TYPE_WITH_CODE()"><code class="function">G_DEFINE_TYPE_WITH_CODE()</code></a>, but defines an abstract type and allows you to 
3627 insert custom code into the *_get_type() function, e.g. interface implementations 
3628 via <a class="link" href="gobject-Type-Information.html#G-IMPLEMENT-INTERFACE:CAPS" title="G_IMPLEMENT_INTERFACE()"><code class="function">G_IMPLEMENT_INTERFACE()</code></a>. See <a class="link" href="gobject-Type-Information.html#G-DEFINE-TYPE-EXTENDED:CAPS" title="G_DEFINE_TYPE_EXTENDED()"><code class="function">G_DEFINE_TYPE_EXTENDED()</code></a> for an example.
3629 </p>
3630 <div class="variablelist"><table border="0">
3631 <col align="left" valign="top">
3632 <tbody>
3633 <tr>
3634 <td><p><span class="term"><em class="parameter"><code>TN</code></em> :</span></p></td>
3635 <td>The name of the new type, in Camel case.</td>
3636 </tr>
3637 <tr>
3638 <td><p><span class="term"><em class="parameter"><code>t_n</code></em> :</span></p></td>
3639 <td>The name of the new type, in lowercase, with words
3640 separated by '_'.</td>
3641 </tr>
3642 <tr>
3643 <td><p><span class="term"><em class="parameter"><code>T_P</code></em> :</span></p></td>
3644 <td>The <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> of the parent type.</td>
3645 </tr>
3646 <tr>
3647 <td><p><span class="term"><em class="parameter"><code>_C_</code></em> :</span></p></td>
3648 <td>Custom code that gets inserted in the <em class="parameter"><code><code class="function">type_name_get_type()</code></code></em> function.</td>
3649 </tr>
3650 </tbody>
3651 </table></div>
3652 <p class="since">Since 2.4</p>
3653 </div>
3654 <hr>
3655 <div class="refsect2">
3656 <a name="G-DEFINE-INTERFACE:CAPS"></a><h3>G_DEFINE_INTERFACE()</h3>
3657 <pre class="programlisting">#define G_DEFINE_INTERFACE(TN, t_n, T_P)                G_DEFINE_INTERFACE_WITH_CODE(TN, t_n, T_P, ;)
3658 </pre>
3659 <p>
3660 A convenience macro for <a class="link" href="gobject-Type-Information.html#GTypeInterface" title="struct GTypeInterface"><span class="type">GTypeInterface</span></a> definitions, which declares
3661 a default vtable initialization function and defines a *_get_type()
3662 function.
3663 </p>
3664 <p>
3665 The macro expects the interface initialization function to have the
3666 name <code class="literal">t_n ## _default_init</code>, and the interface
3667 structure to have the name <code class="literal">TN ## Interface</code>.
3668 </p>
3669 <div class="variablelist"><table border="0">
3670 <col align="left" valign="top">
3671 <tbody>
3672 <tr>
3673 <td><p><span class="term"><em class="parameter"><code>TN</code></em> :</span></p></td>
3674 <td>The name of the new type, in Camel case.</td>
3675 </tr>
3676 <tr>
3677 <td><p><span class="term"><em class="parameter"><code>t_n</code></em> :</span></p></td>
3678 <td>The name of the new type, in lowercase, with words separated by '_'.</td>
3679 </tr>
3680 <tr>
3681 <td><p><span class="term"><em class="parameter"><code>T_P</code></em> :</span></p></td>
3682 <td>The <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> of the prerequisite type for the interface, or 0
3683 (<a class="link" href="gobject-Type-Information.html#G-TYPE-INVALID:CAPS" title="G_TYPE_INVALID"><code class="literal">G_TYPE_INVALID</code></a>) for no prerequisite type.</td>
3684 </tr>
3685 </tbody>
3686 </table></div>
3687 <p class="since">Since 2.24</p>
3688 </div>
3689 <hr>
3690 <div class="refsect2">
3691 <a name="G-DEFINE-INTERFACE-WITH-CODE:CAPS"></a><h3>G_DEFINE_INTERFACE_WITH_CODE()</h3>
3692 <pre class="programlisting">#define G_DEFINE_INTERFACE_WITH_CODE(TN, t_n, T_P, _C_)     _G_DEFINE_INTERFACE_EXTENDED_BEGIN(TN, t_n, T_P) {_C_;} _G_DEFINE_INTERFACE_EXTENDED_END()
3693 </pre>
3694 <p>
3695 A convenience macro for <a class="link" href="gobject-Type-Information.html#GTypeInterface" title="struct GTypeInterface"><span class="type">GTypeInterface</span></a> definitions. Similar to
3696 <a class="link" href="gobject-Type-Information.html#G-DEFINE-INTERFACE:CAPS" title="G_DEFINE_INTERFACE()"><code class="function">G_DEFINE_INTERFACE()</code></a>, but allows you to insert custom code into the
3697 *_get_type() function, e.g. additional interface implementations
3698 via <a class="link" href="gobject-Type-Information.html#G-IMPLEMENT-INTERFACE:CAPS" title="G_IMPLEMENT_INTERFACE()"><code class="function">G_IMPLEMENT_INTERFACE()</code></a>, or additional prerequisite types. See
3699 <a class="link" href="gobject-Type-Information.html#G-DEFINE-TYPE-EXTENDED:CAPS" title="G_DEFINE_TYPE_EXTENDED()"><code class="function">G_DEFINE_TYPE_EXTENDED()</code></a> for a similar example using
3700 <a class="link" href="gobject-Type-Information.html#G-DEFINE-TYPE-WITH-CODE:CAPS" title="G_DEFINE_TYPE_WITH_CODE()"><code class="function">G_DEFINE_TYPE_WITH_CODE()</code></a>.
3701 </p>
3702 <div class="variablelist"><table border="0">
3703 <col align="left" valign="top">
3704 <tbody>
3705 <tr>
3706 <td><p><span class="term"><em class="parameter"><code>TN</code></em> :</span></p></td>
3707 <td>The name of the new type, in Camel case.</td>
3708 </tr>
3709 <tr>
3710 <td><p><span class="term"><em class="parameter"><code>t_n</code></em> :</span></p></td>
3711 <td>The name of the new type, in lowercase, with words separated by '_'.</td>
3712 </tr>
3713 <tr>
3714 <td><p><span class="term"><em class="parameter"><code>T_P</code></em> :</span></p></td>
3715 <td>The <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> of the prerequisite type for the interface, or 0
3716 (<a class="link" href="gobject-Type-Information.html#G-TYPE-INVALID:CAPS" title="G_TYPE_INVALID"><code class="literal">G_TYPE_INVALID</code></a>) for no prerequisite type.</td>
3717 </tr>
3718 <tr>
3719 <td><p><span class="term"><em class="parameter"><code>_C_</code></em> :</span></p></td>
3720 <td>Custom code that gets inserted in the *_get_type() function.</td>
3721 </tr>
3722 </tbody>
3723 </table></div>
3724 <p class="since">Since 2.24</p>
3725 </div>
3726 <hr>
3727 <div class="refsect2">
3728 <a name="G-IMPLEMENT-INTERFACE:CAPS"></a><h3>G_IMPLEMENT_INTERFACE()</h3>
3729 <pre class="programlisting">#define             G_IMPLEMENT_INTERFACE(TYPE_IFACE, iface_init)</pre>
3730 <p>
3731 A convenience macro to ease interface addition in the <em class="parameter"><code>_C_</code></em> section
3732 of <a class="link" href="gobject-Type-Information.html#G-DEFINE-TYPE-WITH-CODE:CAPS" title="G_DEFINE_TYPE_WITH_CODE()"><code class="function">G_DEFINE_TYPE_WITH_CODE()</code></a> or <a class="link" href="gobject-Type-Information.html#G-DEFINE-ABSTRACT-TYPE-WITH-CODE:CAPS" title="G_DEFINE_ABSTRACT_TYPE_WITH_CODE()"><code class="function">G_DEFINE_ABSTRACT_TYPE_WITH_CODE()</code></a>.
3733 See <a class="link" href="gobject-Type-Information.html#G-DEFINE-TYPE-EXTENDED:CAPS" title="G_DEFINE_TYPE_EXTENDED()"><code class="function">G_DEFINE_TYPE_EXTENDED()</code></a> for an example.
3734 </p>
3735 <p>
3736 Note that this macro can only be used together with the G_DEFINE_TYPE_*
3737 macros, since it depends on variable names from those macros.
3738 </p>
3739 <div class="variablelist"><table border="0">
3740 <col align="left" valign="top">
3741 <tbody>
3742 <tr>
3743 <td><p><span class="term"><em class="parameter"><code>TYPE_IFACE</code></em> :</span></p></td>
3744 <td>The <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> of the interface to add</td>
3745 </tr>
3746 <tr>
3747 <td><p><span class="term"><em class="parameter"><code>iface_init</code></em> :</span></p></td>
3748 <td>The interface init function</td>
3749 </tr>
3750 </tbody>
3751 </table></div>
3752 <p class="since">Since 2.4</p>
3753 </div>
3754 <hr>
3755 <div class="refsect2">
3756 <a name="G-DEFINE-TYPE-EXTENDED:CAPS"></a><h3>G_DEFINE_TYPE_EXTENDED()</h3>
3757 <pre class="programlisting">#define G_DEFINE_TYPE_EXTENDED(TN, t_n, T_P, _f_, _C_)          _G_DEFINE_TYPE_EXTENDED_BEGIN (TN, t_n, T_P, _f_) {_C_;} _G_DEFINE_TYPE_EXTENDED_END()
3758 </pre>
3759 <p>
3760 The most general convenience macro for type implementations, on which
3761 <a class="link" href="gobject-Type-Information.html#G-DEFINE-TYPE:CAPS" title="G_DEFINE_TYPE()"><code class="function">G_DEFINE_TYPE()</code></a>, etc are based.
3762 </p>
3763 <p>
3764 </p>
3765 <div class="informalexample">
3766   <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
3767     <tbody>
3768       <tr>
3769         <td class="listing_lines" align="right"><pre>1
3770 2
3771 3
3772 4
3773 5
3774 6</pre></td>
3775         <td class="listing_code"><pre class="programlisting"><span class="function"><a href="gobject-Type-Information.html#G-DEFINE-TYPE-EXTENDED:CAPS">G_DEFINE_TYPE_EXTENDED</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">GtkGadget</span><span class="symbol">,</span>
3776 <span class="normal">                        gtk_gadget</span><span class="symbol">,</span>
3777 <span class="normal">                        GTK_TYPE_WIDGET</span><span class="symbol">,</span>
3778 <span class="normal">                        </span><span class="number">0</span><span class="symbol">,</span>
3779 <span class="normal">                        </span><span class="function"><a href="gobject-Type-Information.html#G-IMPLEMENT-INTERFACE:CAPS">G_IMPLEMENT_INTERFACE</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">TYPE_GIZMO</span><span class="symbol">,</span>
3780 <span class="normal">                                               gtk_gadget_gizmo_init</span><span class="symbol">));</span></pre></td>
3781       </tr>
3782     </tbody>
3783   </table>
3784 </div>
3785
3786 <p>
3787 expands to
3788 </p>
3789 <div class="informalexample">
3790   <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
3791     <tbody>
3792       <tr>
3793         <td class="listing_lines" align="right"><pre>1
3794 2
3795 3
3796 4
3797 5
3798 6
3799 7
3800 8
3801 9
3802 10
3803 11
3804 12
3805 13
3806 14
3807 15
3808 16
3809 17
3810 18
3811 19
3812 20
3813 21
3814 22
3815 23
3816 24
3817 25
3818 26
3819 27
3820 28
3821 29
3822 30
3823 31
3824 32
3825 33</pre></td>
3826         <td class="listing_code"><pre class="programlisting"><span class="keyword">static</span><span class="normal"> </span><span class="type">void</span><span class="normal">     </span><span class="function">gtk_gadget_init</span><span class="normal">       </span><span class="symbol">(</span><span class="usertype">GtkGadget</span><span class="normal">      </span><span class="symbol">*</span><span class="normal">self</span><span class="symbol">);</span>
3827 <span class="keyword">static</span><span class="normal"> </span><span class="type">void</span><span class="normal">     </span><span class="function">gtk_gadget_class_init</span><span class="normal"> </span><span class="symbol">(</span><span class="usertype">GtkGadgetClass</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">klass</span><span class="symbol">);</span>
3828 <span class="keyword">static</span><span class="normal"> </span><span class="usertype">gpointer</span><span class="normal"> gtk_gadget_parent_class </span><span class="symbol">=</span><span class="normal"> <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">;</span>
3829 <span class="keyword">static</span><span class="normal"> </span><span class="type">void</span><span class="normal">     </span><span class="function">gtk_gadget_class_intern_init</span><span class="normal"> </span><span class="symbol">(</span><span class="usertype">gpointer</span><span class="normal"> klass</span><span class="symbol">)</span>
3830 <span class="cbracket">{</span>
3831 <span class="normal">  gtk_gadget_parent_class </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="gobject-Type-Information.html#g-type-class-peek-parent">g_type_class_peek_parent</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">klass</span><span class="symbol">);</span>
3832 <span class="normal">  </span><span class="function">gtk_gadget_class_init</span><span class="normal"> </span><span class="symbol">((</span><span class="normal">GtkGadgetClass</span><span class="symbol">*)</span><span class="normal"> klass</span><span class="symbol">);</span>
3833 <span class="cbracket">}</span>
3834
3835 <span class="normal"><a href="gobject-Type-Information.html#GType">GType</a></span>
3836 <span class="function">gtk_gadget_get_type</span><span class="normal"> </span><span class="symbol">(</span><span class="type">void</span><span class="symbol">)</span>
3837 <span class="cbracket">{</span>
3838 <span class="normal">  </span><span class="keyword">static</span><span class="normal"> </span><span class="keyword">volatile</span><span class="normal"> </span><span class="usertype">gsize</span><span class="normal"> g_define_type_id__volatile </span><span class="symbol">=</span><span class="normal"> </span><span class="number">0</span><span class="symbol">;</span>
3839 <span class="normal">  </span><span class="keyword">if</span><span class="normal"> </span><span class="symbol">(</span><span class="function"><a href="./../glib/glib/glib-Threads.html#g-once-init-enter">g_once_init_enter</a></span><span class="normal"> </span><span class="symbol">(&amp;</span><span class="normal">g_define_type_id__volatile</span><span class="symbol">))</span>
3840 <span class="normal">    </span><span class="cbracket">{</span>
3841 <span class="normal">      </span><span class="usertype">GType</span><span class="normal"> g_define_type_id </span><span class="symbol">=</span>
3842 <span class="normal">        </span><span class="function"><a href="gobject-Type-Information.html#g-type-register-static-simple">g_type_register_static_simple</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">GTK_TYPE_WIDGET</span><span class="symbol">,</span>
3843 <span class="normal">                                       </span><span class="function"><a href="./../glib/glib/glib-Quarks.html#g-intern-static-string">g_intern_static_string</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"GtkGadget"</span><span class="symbol">),</span>
3844 <span class="normal">                                       </span><span class="keyword">sizeof</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">GtkGadgetClass</span><span class="symbol">),</span>
3845 <span class="normal">                                       </span><span class="symbol">(</span><span class="normal"><a href="gobject-Type-Information.html#GClassInitFunc">GClassInitFunc</a></span><span class="symbol">)</span><span class="normal"> gtk_gadget_class_intern_init</span><span class="symbol">,</span>
3846 <span class="normal">                                       </span><span class="keyword">sizeof</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">GtkGadget</span><span class="symbol">),</span>
3847 <span class="normal">                                       </span><span class="symbol">(</span><span class="normal"><a href="gobject-Type-Information.html#GInstanceInitFunc">GInstanceInitFunc</a></span><span class="symbol">)</span><span class="normal"> gtk_gadget_init</span><span class="symbol">,</span>
3848 <span class="normal">                                       </span><span class="symbol">(</span><span class="normal"><a href="gobject-Type-Information.html#GTypeFlags">GTypeFlags</a></span><span class="symbol">)</span><span class="normal"> flags</span><span class="symbol">);</span>
3849 <span class="normal">      </span><span class="cbracket">{</span>
3850 <span class="normal">        </span><span class="keyword">const</span><span class="normal"> </span><span class="usertype">GInterfaceInfo</span><span class="normal"> g_implement_interface_info </span><span class="symbol">=</span><span class="normal"> </span><span class="cbracket">{</span>
3851 <span class="normal">          </span><span class="symbol">(</span><span class="normal"><a href="gobject-Type-Information.html#GInterfaceInitFunc">GInterfaceInitFunc</a></span><span class="symbol">)</span><span class="normal"> gtk_gadget_gizmo_init</span>
3852 <span class="normal">        </span><span class="cbracket">}</span><span class="symbol">;</span>
3853 <span class="normal">        </span><span class="function"><a href="gobject-Type-Information.html#g-type-add-interface-static">g_type_add_interface_static</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">g_define_type_id</span><span class="symbol">,</span><span class="normal"> TYPE_GIZMO</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&amp;</span><span class="normal">g_implement_interface_info</span><span class="symbol">);</span>
3854 <span class="normal">      </span><span class="cbracket">}</span>
3855 <span class="normal">      </span><span class="function"><a href="./../glib/glib/glib-Threads.html#g-once-init-leave">g_once_init_leave</a></span><span class="normal"> </span><span class="symbol">(&amp;</span><span class="normal">g_define_type_id__volatile</span><span class="symbol">,</span><span class="normal"> g_define_type_id</span><span class="symbol">);</span>
3856 <span class="normal">    </span><span class="cbracket">}</span>
3857 <span class="normal">  </span><span class="keyword">return</span><span class="normal"> g_define_type_id__volatile</span><span class="symbol">;</span>
3858 <span class="cbracket">}</span></pre></td>
3859       </tr>
3860     </tbody>
3861   </table>
3862 </div>
3863
3864 <p>
3865 The only pieces which have to be manually provided are the definitions of
3866 the instance and class structure and the definitions of the instance and
3867 class init functions.
3868 </p>
3869 <div class="variablelist"><table border="0">
3870 <col align="left" valign="top">
3871 <tbody>
3872 <tr>
3873 <td><p><span class="term"><em class="parameter"><code>TN</code></em> :</span></p></td>
3874 <td>The name of the new type, in Camel case.</td>
3875 </tr>
3876 <tr>
3877 <td><p><span class="term"><em class="parameter"><code>t_n</code></em> :</span></p></td>
3878 <td>The name of the new type, in lowercase, with words
3879 separated by '_'.</td>
3880 </tr>
3881 <tr>
3882 <td><p><span class="term"><em class="parameter"><code>T_P</code></em> :</span></p></td>
3883 <td>The <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> of the parent type.</td>
3884 </tr>
3885 <tr>
3886 <td><p><span class="term"><em class="parameter"><code>_f_</code></em> :</span></p></td>
3887 <td>
3888 <a class="link" href="gobject-Type-Information.html#GTypeFlags" title="enum GTypeFlags"><span class="type">GTypeFlags</span></a> to pass to <a class="link" href="gobject-Type-Information.html#g-type-register-static" title="g_type_register_static ()"><code class="function">g_type_register_static()</code></a>
3889 </td>
3890 </tr>
3891 <tr>
3892 <td><p><span class="term"><em class="parameter"><code>_C_</code></em> :</span></p></td>
3893 <td>Custom code that gets inserted in the *_get_type() function.</td>
3894 </tr>
3895 </tbody>
3896 </table></div>
3897 <p class="since">Since 2.4</p>
3898 </div>
3899 <hr>
3900 <div class="refsect2">
3901 <a name="G-DEFINE-BOXED-TYPE:CAPS"></a><h3>G_DEFINE_BOXED_TYPE()</h3>
3902 <pre class="programlisting">#define G_DEFINE_BOXED_TYPE(TypeName, type_name, copy_func, free_func) G_DEFINE_BOXED_TYPE_WITH_CODE (TypeName, type_name, copy_func, free_func, {})
3903 </pre>
3904 <p>
3905 A convenience macro for boxed type implementations, which defines a
3906 <code class="function">type_name_get_type()</code> function registering the boxed type.
3907 </p>
3908 <div class="variablelist"><table border="0">
3909 <col align="left" valign="top">
3910 <tbody>
3911 <tr>
3912 <td><p><span class="term"><em class="parameter"><code>TypeName</code></em> :</span></p></td>
3913 <td>The name of the new type, in Camel case.</td>
3914 </tr>
3915 <tr>
3916 <td><p><span class="term"><em class="parameter"><code>type_name</code></em> :</span></p></td>
3917 <td>The name of the new type, in lowercase, with words
3918 separated by '_'.</td>
3919 </tr>
3920 <tr>
3921 <td><p><span class="term"><em class="parameter"><code>copy_func</code></em> :</span></p></td>
3922 <td>the <a class="link" href="gobject-Boxed-Types.html#GBoxedCopyFunc" title="GBoxedCopyFunc ()"><span class="type">GBoxedCopyFunc</span></a> for the new type</td>
3923 </tr>
3924 <tr>
3925 <td><p><span class="term"><em class="parameter"><code>free_func</code></em> :</span></p></td>
3926 <td>the <a class="link" href="gobject-Boxed-Types.html#GBoxedFreeFunc" title="GBoxedFreeFunc ()"><span class="type">GBoxedFreeFunc</span></a> for the new type</td>
3927 </tr>
3928 </tbody>
3929 </table></div>
3930 <p class="since">Since 2.26</p>
3931 </div>
3932 <hr>
3933 <div class="refsect2">
3934 <a name="G-DEFINE-BOXED-TYPE-WITH-CODE:CAPS"></a><h3>G_DEFINE_BOXED_TYPE_WITH_CODE()</h3>
3935 <pre class="programlisting">#define G_DEFINE_BOXED_TYPE_WITH_CODE(TypeName, type_name, copy_func, free_func, _C_) _G_DEFINE_BOXED_TYPE_BEGIN (TypeName, type_name, copy_func, free_func) {_C_;} _G_DEFINE_TYPE_EXTENDED_END()
3936 </pre>
3937 <p>
3938 A convenience macro for boxed type implementations.
3939 Similar to <a class="link" href="gobject-Type-Information.html#G-DEFINE-BOXED-TYPE:CAPS" title="G_DEFINE_BOXED_TYPE()"><code class="function">G_DEFINE_BOXED_TYPE()</code></a>, but allows to insert custom code into the
3940 <code class="function">type_name_get_type()</code> function, e.g. to register value transformations with
3941 <a class="link" href="gobject-Generic-values.html#g-value-register-transform-func" title="g_value_register_transform_func ()"><code class="function">g_value_register_transform_func()</code></a>.
3942 </p>
3943 <div class="variablelist"><table border="0">
3944 <col align="left" valign="top">
3945 <tbody>
3946 <tr>
3947 <td><p><span class="term"><em class="parameter"><code>TypeName</code></em> :</span></p></td>
3948 <td>The name of the new type, in Camel case.</td>
3949 </tr>
3950 <tr>
3951 <td><p><span class="term"><em class="parameter"><code>type_name</code></em> :</span></p></td>
3952 <td>The name of the new type, in lowercase, with words
3953 separated by '_'.</td>
3954 </tr>
3955 <tr>
3956 <td><p><span class="term"><em class="parameter"><code>copy_func</code></em> :</span></p></td>
3957 <td>the <a class="link" href="gobject-Boxed-Types.html#GBoxedCopyFunc" title="GBoxedCopyFunc ()"><span class="type">GBoxedCopyFunc</span></a> for the new type</td>
3958 </tr>
3959 <tr>
3960 <td><p><span class="term"><em class="parameter"><code>free_func</code></em> :</span></p></td>
3961 <td>the <a class="link" href="gobject-Boxed-Types.html#GBoxedFreeFunc" title="GBoxedFreeFunc ()"><span class="type">GBoxedFreeFunc</span></a> for the new type</td>
3962 </tr>
3963 <tr>
3964 <td><p><span class="term"><em class="parameter"><code>_C_</code></em> :</span></p></td>
3965 <td>Custom code that gets inserted in the *_get_type() function.</td>
3966 </tr>
3967 </tbody>
3968 </table></div>
3969 <p class="since">Since 2.26</p>
3970 </div>
3971 <hr>
3972 <div class="refsect2">
3973 <a name="G-DEFINE-POINTER-TYPE:CAPS"></a><h3>G_DEFINE_POINTER_TYPE()</h3>
3974 <pre class="programlisting">#define G_DEFINE_POINTER_TYPE(TypeName, type_name) G_DEFINE_POINTER_TYPE_WITH_CODE (TypeName, type_name, {})
3975 </pre>
3976 <p>
3977 A convenience macro for pointer type implementations, which defines a
3978 <code class="function">type_name_get_type()</code> function registering the pointer type.
3979 </p>
3980 <div class="variablelist"><table border="0">
3981 <col align="left" valign="top">
3982 <tbody>
3983 <tr>
3984 <td><p><span class="term"><em class="parameter"><code>TypeName</code></em> :</span></p></td>
3985 <td>The name of the new type, in Camel case.</td>
3986 </tr>
3987 <tr>
3988 <td><p><span class="term"><em class="parameter"><code>type_name</code></em> :</span></p></td>
3989 <td>The name of the new type, in lowercase, with words
3990 separated by '_'.</td>
3991 </tr>
3992 </tbody>
3993 </table></div>
3994 <p class="since">Since 2.26</p>
3995 </div>
3996 <hr>
3997 <div class="refsect2">
3998 <a name="G-DEFINE-POINTER-TYPE-WITH-CODE:CAPS"></a><h3>G_DEFINE_POINTER_TYPE_WITH_CODE()</h3>
3999 <pre class="programlisting">#define G_DEFINE_POINTER_TYPE_WITH_CODE(TypeName, type_name, _C_) _G_DEFINE_POINTER_TYPE_BEGIN (TypeName, type_name) {_C_;} _G_DEFINE_TYPE_EXTENDED_END()
4000 </pre>
4001 <p>
4002 A convenience macro for pointer type implementations.
4003 Similar to <a class="link" href="gobject-Type-Information.html#G-DEFINE-POINTER-TYPE:CAPS" title="G_DEFINE_POINTER_TYPE()"><code class="function">G_DEFINE_POINTER_TYPE()</code></a>, but allows to insert custom code into the
4004 <code class="function">type_name_get_type()</code> function.
4005 </p>
4006 <div class="variablelist"><table border="0">
4007 <col align="left" valign="top">
4008 <tbody>
4009 <tr>
4010 <td><p><span class="term"><em class="parameter"><code>TypeName</code></em> :</span></p></td>
4011 <td>The name of the new type, in Camel case.</td>
4012 </tr>
4013 <tr>
4014 <td><p><span class="term"><em class="parameter"><code>type_name</code></em> :</span></p></td>
4015 <td>The name of the new type, in lowercase, with words
4016 separated by '_'.</td>
4017 </tr>
4018 <tr>
4019 <td><p><span class="term"><em class="parameter"><code>_C_</code></em> :</span></p></td>
4020 <td>Custom code that gets inserted in the *_get_type() function.</td>
4021 </tr>
4022 </tbody>
4023 </table></div>
4024 <p class="since">Since 2.26</p>
4025 </div>
4026 <hr>
4027 <div class="refsect2">
4028 <a name="G-TYPE-INVALID:CAPS"></a><h3>G_TYPE_INVALID</h3>
4029 <pre class="programlisting">#define G_TYPE_INVALID                      G_TYPE_MAKE_FUNDAMENTAL (0)
4030 </pre>
4031 <p>
4032 An invalid <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> used as error return value in some functions which return
4033 a <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a>.
4034 </p>
4035 </div>
4036 <hr>
4037 <div class="refsect2">
4038 <a name="G-TYPE-NONE:CAPS"></a><h3>G_TYPE_NONE</h3>
4039 <pre class="programlisting">#define G_TYPE_NONE                 G_TYPE_MAKE_FUNDAMENTAL (1)
4040 </pre>
4041 <p>
4042 A fundamental type which is used as a replacement for the C
4043 <code class="literal">void</code> return type.
4044 </p>
4045 </div>
4046 <hr>
4047 <div class="refsect2">
4048 <a name="G-TYPE-INTERFACE:CAPS"></a><h3>G_TYPE_INTERFACE</h3>
4049 <pre class="programlisting">#define G_TYPE_INTERFACE            G_TYPE_MAKE_FUNDAMENTAL (2)
4050 </pre>
4051 <p>
4052 The fundamental type from which all interfaces are derived.
4053 </p>
4054 </div>
4055 <hr>
4056 <div class="refsect2">
4057 <a name="G-TYPE-CHAR:CAPS"></a><h3>G_TYPE_CHAR</h3>
4058 <pre class="programlisting">#define G_TYPE_CHAR                 G_TYPE_MAKE_FUNDAMENTAL (3)
4059 </pre>
4060 <p>
4061 The fundamental type corresponding to <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>.
4062 The type designated by G_TYPE_CHAR is unconditionally an 8-bit signed integer.
4063 This may or may not be the same type a the C type "gchar".
4064 </p>
4065 </div>
4066 <hr>
4067 <div class="refsect2">
4068 <a name="G-TYPE-UCHAR:CAPS"></a><h3>G_TYPE_UCHAR</h3>
4069 <pre class="programlisting">#define G_TYPE_UCHAR                        G_TYPE_MAKE_FUNDAMENTAL (4)
4070 </pre>
4071 <p>
4072 The fundamental type corresponding to <a href="./../glib/glib/glib-Basic-Types.html#guchar"><span class="type">guchar</span></a>.
4073 </p>
4074 </div>
4075 <hr>
4076 <div class="refsect2">
4077 <a name="G-TYPE-BOOLEAN:CAPS"></a><h3>G_TYPE_BOOLEAN</h3>
4078 <pre class="programlisting">#define G_TYPE_BOOLEAN                      G_TYPE_MAKE_FUNDAMENTAL (5)
4079 </pre>
4080 <p>
4081 The fundamental type corresponding to <a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a>.
4082 </p>
4083 </div>
4084 <hr>
4085 <div class="refsect2">
4086 <a name="G-TYPE-INT:CAPS"></a><h3>G_TYPE_INT</h3>
4087 <pre class="programlisting">#define G_TYPE_INT                  G_TYPE_MAKE_FUNDAMENTAL (6)
4088 </pre>
4089 <p>
4090 The fundamental type corresponding to <a href="./../glib/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a>.
4091 </p>
4092 </div>
4093 <hr>
4094 <div class="refsect2">
4095 <a name="G-TYPE-UINT:CAPS"></a><h3>G_TYPE_UINT</h3>
4096 <pre class="programlisting">#define G_TYPE_UINT                 G_TYPE_MAKE_FUNDAMENTAL (7)
4097 </pre>
4098 <p>
4099 The fundamental type corresponding to <a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a>.
4100 </p>
4101 </div>
4102 <hr>
4103 <div class="refsect2">
4104 <a name="G-TYPE-LONG:CAPS"></a><h3>G_TYPE_LONG</h3>
4105 <pre class="programlisting">#define G_TYPE_LONG                 G_TYPE_MAKE_FUNDAMENTAL (8)
4106 </pre>
4107 <p>
4108 The fundamental type corresponding to <a href="./../glib/glib/glib-Basic-Types.html#glong"><span class="type">glong</span></a>.
4109 </p>
4110 </div>
4111 <hr>
4112 <div class="refsect2">
4113 <a name="G-TYPE-ULONG:CAPS"></a><h3>G_TYPE_ULONG</h3>
4114 <pre class="programlisting">#define G_TYPE_ULONG                        G_TYPE_MAKE_FUNDAMENTAL (9)
4115 </pre>
4116 <p>
4117 The fundamental type corresponding to <a href="./../glib/glib/glib-Basic-Types.html#gulong"><span class="type">gulong</span></a>.
4118 </p>
4119 </div>
4120 <hr>
4121 <div class="refsect2">
4122 <a name="G-TYPE-INT64:CAPS"></a><h3>G_TYPE_INT64</h3>
4123 <pre class="programlisting">#define G_TYPE_INT64                        G_TYPE_MAKE_FUNDAMENTAL (10)
4124 </pre>
4125 <p>
4126 The fundamental type corresponding to <a href="./../glib/glib/glib-Basic-Types.html#gint64"><span class="type">gint64</span></a>.
4127 </p>
4128 </div>
4129 <hr>
4130 <div class="refsect2">
4131 <a name="G-TYPE-UINT64:CAPS"></a><h3>G_TYPE_UINT64</h3>
4132 <pre class="programlisting">#define G_TYPE_UINT64                       G_TYPE_MAKE_FUNDAMENTAL (11)
4133 </pre>
4134 <p>
4135 The fundamental type corresponding to <a href="./../glib/glib/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a>.
4136 </p>
4137 </div>
4138 <hr>
4139 <div class="refsect2">
4140 <a name="G-TYPE-ENUM:CAPS"></a><h3>G_TYPE_ENUM</h3>
4141 <pre class="programlisting">#define G_TYPE_ENUM                 G_TYPE_MAKE_FUNDAMENTAL (12)
4142 </pre>
4143 <p>
4144 The fundamental type from which all enumeration types are derived.
4145 </p>
4146 </div>
4147 <hr>
4148 <div class="refsect2">
4149 <a name="G-TYPE-FLAGS:CAPS"></a><h3>G_TYPE_FLAGS</h3>
4150 <pre class="programlisting">#define G_TYPE_FLAGS                        G_TYPE_MAKE_FUNDAMENTAL (13)
4151 </pre>
4152 <p>
4153 The fundamental type from which all flags types are derived.
4154 </p>
4155 </div>
4156 <hr>
4157 <div class="refsect2">
4158 <a name="G-TYPE-FLOAT:CAPS"></a><h3>G_TYPE_FLOAT</h3>
4159 <pre class="programlisting">#define G_TYPE_FLOAT                        G_TYPE_MAKE_FUNDAMENTAL (14)
4160 </pre>
4161 <p>
4162 The fundamental type corresponding to <a href="./../glib/glib/glib-Basic-Types.html#gfloat"><span class="type">gfloat</span></a>.
4163 </p>
4164 </div>
4165 <hr>
4166 <div class="refsect2">
4167 <a name="G-TYPE-DOUBLE:CAPS"></a><h3>G_TYPE_DOUBLE</h3>
4168 <pre class="programlisting">#define G_TYPE_DOUBLE                       G_TYPE_MAKE_FUNDAMENTAL (15)
4169 </pre>
4170 <p>
4171 The fundamental type corresponding to <a href="./../glib/glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a>.
4172 </p>
4173 </div>
4174 <hr>
4175 <div class="refsect2">
4176 <a name="G-TYPE-STRING:CAPS"></a><h3>G_TYPE_STRING</h3>
4177 <pre class="programlisting">#define G_TYPE_STRING                       G_TYPE_MAKE_FUNDAMENTAL (16)
4178 </pre>
4179 <p>
4180 The fundamental type corresponding to nul-terminated C strings.
4181 </p>
4182 </div>
4183 <hr>
4184 <div class="refsect2">
4185 <a name="G-TYPE-POINTER:CAPS"></a><h3>G_TYPE_POINTER</h3>
4186 <pre class="programlisting">#define G_TYPE_POINTER                      G_TYPE_MAKE_FUNDAMENTAL (17)
4187 </pre>
4188 <p>
4189 The fundamental type corresponding to <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a>.
4190 </p>
4191 </div>
4192 <hr>
4193 <div class="refsect2">
4194 <a name="G-TYPE-BOXED:CAPS"></a><h3>G_TYPE_BOXED</h3>
4195 <pre class="programlisting">#define G_TYPE_BOXED                        G_TYPE_MAKE_FUNDAMENTAL (18)
4196 </pre>
4197 <p>
4198 The fundamental type from which all boxed types are derived.
4199 </p>
4200 </div>
4201 <hr>
4202 <div class="refsect2">
4203 <a name="G-TYPE-PARAM:CAPS"></a><h3>G_TYPE_PARAM</h3>
4204 <pre class="programlisting">#define G_TYPE_PARAM                        G_TYPE_MAKE_FUNDAMENTAL (19)
4205 </pre>
4206 <p>
4207 The fundamental type from which all <a class="link" href="gobject-GParamSpec.html#GParamSpec" title="struct GParamSpec"><span class="type">GParamSpec</span></a> types are derived.
4208 </p>
4209 </div>
4210 <hr>
4211 <div class="refsect2">
4212 <a name="G-TYPE-OBJECT:CAPS"></a><h3>G_TYPE_OBJECT</h3>
4213 <pre class="programlisting">#define G_TYPE_OBJECT                       G_TYPE_MAKE_FUNDAMENTAL (20)
4214 </pre>
4215 <p>
4216 The fundamental type for <a class="link" href="gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a>.
4217 </p>
4218 </div>
4219 <hr>
4220 <div class="refsect2">
4221 <a name="G-TYPE-GTYPE:CAPS"></a><h3>G_TYPE_GTYPE</h3>
4222 <pre class="programlisting">#define G_TYPE_GTYPE                        (g_gtype_get_type())
4223 </pre>
4224 <p>
4225 The type for <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a>.
4226 </p>
4227 </div>
4228 <hr>
4229 <div class="refsect2">
4230 <a name="G-TYPE-VARIANT:CAPS"></a><h3>G_TYPE_VARIANT</h3>
4231 <pre class="programlisting">#define G_TYPE_VARIANT                  G_TYPE_MAKE_FUNDAMENTAL (21)
4232 </pre>
4233 <p>
4234 The fundamental type corresponding to <a href="./../glib/glib/glib-GVariant.html#GVariant"><span class="type">GVariant</span></a>.
4235 </p>
4236 <p>
4237 All floating <a href="./../glib/glib/glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> instances passed through the <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> system are
4238 consumed.
4239 </p>
4240 <p>
4241 Note that callbacks in closures, and signal handlers
4242 for signals of return type <a class="link" href="gobject-Type-Information.html#G-TYPE-VARIANT:CAPS" title="G_TYPE_VARIANT"><code class="literal">G_TYPE_VARIANT</code></a>, must never return floating
4243 variants.
4244 </p>
4245 <p>
4246 Note: GLib 2.24 did include a boxed type with this name. It was replaced
4247 with this fundamental type in 2.26.
4248 </p>
4249 <p class="since">Since 2.26</p>
4250 </div>
4251 <hr>
4252 <div class="refsect2">
4253 <a name="G-TYPE-RESERVED-GLIB-FIRST:CAPS"></a><h3>G_TYPE_RESERVED_GLIB_FIRST</h3>
4254 <pre class="programlisting">#define G_TYPE_RESERVED_GLIB_FIRST (22)
4255 </pre>
4256 <p>
4257 First fundamental type number to create a new fundamental type id with
4258 <a class="link" href="gobject-Type-Information.html#G-TYPE-MAKE-FUNDAMENTAL:CAPS" title="G_TYPE_MAKE_FUNDAMENTAL()"><code class="function">G_TYPE_MAKE_FUNDAMENTAL()</code></a> reserved for GLib.
4259 </p>
4260 </div>
4261 <hr>
4262 <div class="refsect2">
4263 <a name="G-TYPE-RESERVED-GLIB-LAST:CAPS"></a><h3>G_TYPE_RESERVED_GLIB_LAST</h3>
4264 <pre class="programlisting">#define G_TYPE_RESERVED_GLIB_LAST (31)
4265 </pre>
4266 <p>
4267 Last fundamental type number reserved for GLib.
4268 </p>
4269 </div>
4270 <hr>
4271 <div class="refsect2">
4272 <a name="G-TYPE-RESERVED-BSE-FIRST:CAPS"></a><h3>G_TYPE_RESERVED_BSE_FIRST</h3>
4273 <pre class="programlisting">#define G_TYPE_RESERVED_BSE_FIRST (32)
4274 </pre>
4275 <p>
4276 First fundamental type number to create a new fundamental type id with
4277 <a class="link" href="gobject-Type-Information.html#G-TYPE-MAKE-FUNDAMENTAL:CAPS" title="G_TYPE_MAKE_FUNDAMENTAL()"><code class="function">G_TYPE_MAKE_FUNDAMENTAL()</code></a> reserved for BSE.
4278 </p>
4279 </div>
4280 <hr>
4281 <div class="refsect2">
4282 <a name="G-TYPE-RESERVED-BSE-LAST:CAPS"></a><h3>G_TYPE_RESERVED_BSE_LAST</h3>
4283 <pre class="programlisting">#define G_TYPE_RESERVED_BSE_LAST (48)
4284 </pre>
4285 <p>
4286 Last fundamental type number reserved for BSE.
4287 </p>
4288 </div>
4289 <hr>
4290 <div class="refsect2">
4291 <a name="G-TYPE-RESERVED-USER-FIRST:CAPS"></a><h3>G_TYPE_RESERVED_USER_FIRST</h3>
4292 <pre class="programlisting">#define G_TYPE_RESERVED_USER_FIRST (49)
4293 </pre>
4294 <p>
4295 First available fundamental type number to create new fundamental 
4296 type id with <a class="link" href="gobject-Type-Information.html#G-TYPE-MAKE-FUNDAMENTAL:CAPS" title="G_TYPE_MAKE_FUNDAMENTAL()"><code class="function">G_TYPE_MAKE_FUNDAMENTAL()</code></a>.
4297 </p>
4298 </div>
4299 </div>
4300 </div>
4301 <div class="footer">
4302 <hr>
4303           Generated by GTK-Doc V1.18</div>
4304 </body>
4305 </html>