~ubuntu-branches/debian/squeeze/glib2.0/squeeze

« back to all changes in this revision

Viewing changes to docs/reference/gobject/html/GTypeModule.html

  • Committer: Bazaar Package Importer
  • Author(s): Gustavo Noronha Silva
  • Date: 2009-02-15 13:00:43 UTC
  • mfrom: (1.3.1 upstream) (69.1.10 intrepid)
  • Revision ID: james.westby@ubuntu.com-20090215130043-q47fbt3owmt42m2f
Tags: 2.18.4-2
* Release to unstable
* debian/rules:
- bump SHVER, since we are already forcing a 2.18.0 dependecy on the
  symbols introduced in the development versions
* debian/control.in:
- added Homepage and Vcs-* control fields

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
2
<html>
3
3
<head>
4
 
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
 
4
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
5
<title>GTypeModule</title>
6
 
<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
7
 
<link rel="start" href="index.html" title="GObject Reference Manual">
 
6
<meta name="generator" content="DocBook XSL Stylesheets V1.74.0">
 
7
<link rel="home" href="index.html" title="GObject Reference Manual">
8
8
<link rel="up" href="rn01.html" title="API Reference">
9
9
<link rel="prev" href="GTypePlugin.html" title="GTypePlugin">
10
 
<link rel="next" href="gobject-The-Base-Object-Type.html" title="GObject">
11
 
<meta name="generator" content="GTK-Doc V1.9 (XML mode)">
 
10
<link rel="next" href="gobject-The-Base-Object-Type.html" title="The Base Object Type">
 
11
<meta name="generator" content="GTK-Doc V1.11 (XML mode)">
12
12
<link rel="stylesheet" href="style.css" type="text/css">
13
13
<link rel="preface" href="pr01.html" title="Introduction">
14
 
<link rel="part" href="pt01.html" title="Part&#160;I.&#160;Concepts">
 
14
<link rel="part" href="pt01.html" title="Part I. Concepts">
15
15
<link rel="chapter" href="chapter-intro.html" title="Background">
16
16
<link rel="chapter" href="chapter-gtype.html" title="The GLib Dynamic Type System">
17
17
<link rel="chapter" href="chapter-gobject.html" title="The GObject base class">
18
18
<link rel="chapter" href="chapter-signal.html" title="The GObject messaging system">
19
19
<link rel="reference" href="rn01.html" title="API Reference">
20
20
<link rel="reference" href="rn02.html" title="Tools Reference">
21
 
<link rel="part" href="pt02.html" title="Part&#160;IV.&#160;Tutorial">
 
21
<link rel="part" href="pt02.html" title="Part IV. Tutorial">
22
22
<link rel="chapter" href="howto-gobject.html" title="How to define and implement a new GObject">
23
23
<link rel="chapter" href="howto-interface.html" title="How to define and implement interfaces">
24
24
<link rel="chapter" href="howto-signals.html" title="How to create and use signals">
25
 
<link rel="part" href="pt03.html" title="Part&#160;V.&#160;Related Tools">
 
25
<link rel="part" href="pt03.html" title="Part V. Related Tools">
 
26
<link rel="chapter" href="tools-vala.html" title="Vala">
26
27
<link rel="chapter" href="tools-gob.html" title="GObject builder">
27
28
<link rel="chapter" href="tools-ginspector.html" title="Graphical inspection of GObjects">
28
29
<link rel="chapter" href="tools-refdb.html" title="Debugging reference count problems">
36
37
<link rel="index" href="ix07.html" title="Index of new symbols in 2.10">
37
38
<link rel="index" href="ix08.html" title="Index of new symbols in 2.12">
38
39
<link rel="index" href="ix09.html" title="Index of new symbols in 2.14">
 
40
<link rel="index" href="ix10.html" title="Index of new symbols in 2.14">
39
41
</head>
40
42
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
41
43
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
46
48
<th width="100%" align="center">GObject Reference Manual</th>
47
49
<td><a accesskey="n" href="gobject-The-Base-Object-Type.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
48
50
</tr>
49
 
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id2852704" class="shortcut">Top</a>
50
 
                  &#160;|&#160;
51
 
                  <a href="#id2853058" class="shortcut">Description</a>
52
 
                  &#160;|&#160;
53
 
                  <a href="#id2853011" class="shortcut">Object Hierarchy</a>
54
 
                  &#160;|&#160;
55
 
                  <a href="#id2853036" class="shortcut">Implemented Interfaces</a></nobr></td></tr>
 
51
<tr><td colspan="5" class="shortcuts">
 
52
<a href="#GTypeModule.synopsis" class="shortcut">Top</a>
 
53
                 | 
 
54
                <a href="#GTypeModule.description" class="shortcut">Description</a>
 
55
                 | 
 
56
                <a href="#GTypeModule.object-hierarchy" class="shortcut">Object Hierarchy</a>
 
57
                 | 
 
58
                <a href="#GTypeModule.implemented-interfaces" class="shortcut">Implemented Interfaces</a>
 
59
</td></tr>
56
60
</table>
57
61
<div class="refentry" lang="en">
58
62
<a name="GTypeModule"></a><div class="titlepage"></div>
59
63
<div class="refnamediv"><table width="100%"><tr>
60
64
<td valign="top">
61
 
<h2>
62
 
<a name="id2852704"></a><span class="refentrytitle">GTypeModule</span>
63
 
</h2>
64
 
<p>GTypeModule &#8212; Type loading modules</p>
 
65
<h2><span class="refentrytitle"><a name="GTypeModule.top_of_page"></a>GTypeModule</span></h2>
 
66
<p>GTypeModule — Type loading modules</p>
65
67
</td>
66
68
<td valign="top" align="right"></td>
67
69
</tr></table></div>
68
70
<div class="refsynopsisdiv">
69
 
<h2>Synopsis</h2>
 
71
<a name="GTypeModule.synopsis"></a><h2>Synopsis</h2>
70
72
<pre class="synopsis">
71
73
 
72
74
#include &lt;glib-object.h&gt;
73
75
 
74
 
 
75
 
                    <a class="link" href="GTypeModule.html#GTypeModule-struct">GTypeModule</a>;
76
 
                    <a class="link" href="GTypeModule.html#GTypeModuleClass">GTypeModuleClass</a>;
 
76
                    <a class="link" href="GTypeModule.html#GTypeModule-struct" title="GTypeModule">GTypeModule</a>;
 
77
                    <a class="link" href="GTypeModule.html#GTypeModuleClass" title="GTypeModuleClass">GTypeModuleClass</a>;
77
78
<a
78
79
href="./../glib/glib/glib-Basic-Types.html#gboolean"
79
 
>gboolean</a>            <a class="link" href="GTypeModule.html#g-type-module-use">g_type_module_use</a>                   (<a class="link" href="GTypeModule.html" title="GTypeModule">GTypeModule</a> *module);
80
 
void                <a class="link" href="GTypeModule.html#g-type-module-unuse">g_type_module_unuse</a>                 (<a class="link" href="GTypeModule.html" title="GTypeModule">GTypeModule</a> *module);
81
 
void                <a class="link" href="GTypeModule.html#g-type-module-set-name">g_type_module_set_name</a>              (<a class="link" href="GTypeModule.html" title="GTypeModule">GTypeModule</a> *module,
 
80
>gboolean</a>            <a class="link" href="GTypeModule.html#g-type-module-use" title="g_type_module_use ()">g_type_module_use</a>                   (<a class="link" href="GTypeModule.html" title="GTypeModule">GTypeModule</a> *module);
 
81
void                <a class="link" href="GTypeModule.html#g-type-module-unuse" title="g_type_module_unuse ()">g_type_module_unuse</a>                 (<a class="link" href="GTypeModule.html" title="GTypeModule">GTypeModule</a> *module);
 
82
void                <a class="link" href="GTypeModule.html#g-type-module-set-name" title="g_type_module_set_name ()">g_type_module_set_name</a>              (<a class="link" href="GTypeModule.html" title="GTypeModule">GTypeModule</a> *module,
82
83
                                                         const <a
83
84
href="./../glib/glib/glib-Basic-Types.html#gchar"
84
85
>gchar</a> *name);
85
 
<a class="link" href="gobject-Type-Information.html#GType">GType</a>               <a class="link" href="GTypeModule.html#g-type-module-register-type">g_type_module_register_type</a>         (<a class="link" href="GTypeModule.html" title="GTypeModule">GTypeModule</a> *module,
86
 
                                                         <a class="link" href="gobject-Type-Information.html#GType">GType</a> parent_type,
 
86
<a class="link" href="gobject-Type-Information.html#GType" title="GType">GType</a>               <a class="link" href="GTypeModule.html#g-type-module-register-type" title="g_type_module_register_type ()">g_type_module_register_type</a>         (<a class="link" href="GTypeModule.html" title="GTypeModule">GTypeModule</a> *module,
 
87
                                                         <a class="link" href="gobject-Type-Information.html#GType" title="GType">GType</a> parent_type,
87
88
                                                         const <a
88
89
href="./../glib/glib/glib-Basic-Types.html#gchar"
89
90
>gchar</a> *type_name,
90
 
                                                         const <a class="link" href="gobject-Type-Information.html#GTypeInfo">GTypeInfo</a> *type_info,
91
 
                                                         <a class="link" href="gobject-Type-Information.html#GTypeFlags">GTypeFlags</a> flags);
92
 
void                <a class="link" href="GTypeModule.html#g-type-module-add-interface">g_type_module_add_interface</a>         (<a class="link" href="GTypeModule.html" title="GTypeModule">GTypeModule</a> *module,
93
 
                                                         <a class="link" href="gobject-Type-Information.html#GType">GType</a> instance_type,
94
 
                                                         <a class="link" href="gobject-Type-Information.html#GType">GType</a> interface_type,
95
 
                                                         const <a class="link" href="gobject-Type-Information.html#GInterfaceInfo">GInterfaceInfo</a> *interface_info);
96
 
<a class="link" href="gobject-Type-Information.html#GType">GType</a>               <a class="link" href="GTypeModule.html#g-type-module-register-enum">g_type_module_register_enum</a>         (<a class="link" href="GTypeModule.html" title="GTypeModule">GTypeModule</a> *module,
97
 
                                                         const <a
98
 
href="./../glib/glib/glib-Basic-Types.html#gchar"
99
 
>gchar</a> *name,
100
 
                                                         const <a class="link" href="gobject-Enumeration-and-Flag-Types.html#GEnumValue">GEnumValue</a> *const_static_values);
101
 
<a class="link" href="gobject-Type-Information.html#GType">GType</a>               <a class="link" href="GTypeModule.html#g-type-module-register-flags">g_type_module_register_flags</a>        (<a class="link" href="GTypeModule.html" title="GTypeModule">GTypeModule</a> *module,
102
 
                                                         const <a
103
 
href="./../glib/glib/glib-Basic-Types.html#gchar"
104
 
>gchar</a> *name,
105
 
                                                         const <a class="link" href="gobject-Enumeration-and-Flag-Types.html#GFlagsValue">GFlagsValue</a> *const_static_values);
106
 
#define             <a class="link" href="GTypeModule.html#G-DEFINE-DYNAMIC-TYPE:CAPS">G_DEFINE_DYNAMIC_TYPE</a>               (TN, t_n, T_P)
107
 
#define             <a class="link" href="GTypeModule.html#G-DEFINE-DYNAMIC-TYPE-EXTENDED:CAPS">G_DEFINE_DYNAMIC_TYPE_EXTENDED</a>      (TypeName, type_name, TYPE_PARENT, flags, CODE)
108
 
 
 
91
                                                         const <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="GTypeInfo">GTypeInfo</a> *type_info,
 
92
                                                         <a class="link" href="gobject-Type-Information.html#GTypeFlags" title="enum GTypeFlags">GTypeFlags</a> flags);
 
93
void                <a class="link" href="GTypeModule.html#g-type-module-add-interface" title="g_type_module_add_interface ()">g_type_module_add_interface</a>         (<a class="link" href="GTypeModule.html" title="GTypeModule">GTypeModule</a> *module,
 
94
                                                         <a class="link" href="gobject-Type-Information.html#GType" title="GType">GType</a> instance_type,
 
95
                                                         <a class="link" href="gobject-Type-Information.html#GType" title="GType">GType</a> interface_type,
 
96
                                                         const <a class="link" href="gobject-Type-Information.html#GInterfaceInfo" title="GInterfaceInfo">GInterfaceInfo</a> *interface_info);
 
97
<a class="link" href="gobject-Type-Information.html#GType" title="GType">GType</a>               <a class="link" href="GTypeModule.html#g-type-module-register-enum" title="g_type_module_register_enum ()">g_type_module_register_enum</a>         (<a class="link" href="GTypeModule.html" title="GTypeModule">GTypeModule</a> *module,
 
98
                                                         const <a
 
99
href="./../glib/glib/glib-Basic-Types.html#gchar"
 
100
>gchar</a> *name,
 
101
                                                         const <a class="link" href="gobject-Enumeration-and-Flag-Types.html#GEnumValue" title="GEnumValue">GEnumValue</a> *const_static_values);
 
102
<a class="link" href="gobject-Type-Information.html#GType" title="GType">GType</a>               <a class="link" href="GTypeModule.html#g-type-module-register-flags" title="g_type_module_register_flags ()">g_type_module_register_flags</a>        (<a class="link" href="GTypeModule.html" title="GTypeModule">GTypeModule</a> *module,
 
103
                                                         const <a
 
104
href="./../glib/glib/glib-Basic-Types.html#gchar"
 
105
>gchar</a> *name,
 
106
                                                         const <a class="link" href="gobject-Enumeration-and-Flag-Types.html#GFlagsValue" title="GFlagsValue">GFlagsValue</a> *const_static_values);
 
107
#define             <a class="link" href="GTypeModule.html#G-DEFINE-DYNAMIC-TYPE--CAPS" title="G_DEFINE_DYNAMIC_TYPE()">G_DEFINE_DYNAMIC_TYPE</a>               (TN, t_n, T_P)
 
108
#define             <a class="link" href="GTypeModule.html#G-DEFINE-DYNAMIC-TYPE-EXTENDED--CAPS" title="G_DEFINE_DYNAMIC_TYPE_EXTENDED()">G_DEFINE_DYNAMIC_TYPE_EXTENDED</a>      (TypeName, type_name, TYPE_PARENT, flags, CODE)
109
109
</pre>
110
110
</div>
111
111
<div class="refsect1" lang="en">
112
 
<a name="id2853011"></a><h2>Object Hierarchy</h2>
 
112
<a name="GTypeModule.object-hierarchy"></a><h2>Object Hierarchy</h2>
113
113
<pre class="synopsis">
114
 
 
115
114
  <a class="link" href="gobject-The-Base-Object-Type.html#GObject">GObject</a>
116
115
   +----GTypeModule
117
116
</pre>
118
117
</div>
119
118
<div class="refsect1" lang="en">
120
 
<a name="id2853036"></a><h2>Implemented Interfaces</h2>
 
119
<a name="GTypeModule.implemented-interfaces"></a><h2>Implemented Interfaces</h2>
121
120
<p>
122
121
GTypeModule implements
123
122
 <a class="link" href="GTypePlugin.html" title="GTypePlugin">GTypePlugin</a>.</p>
124
123
</div>
125
124
<div class="refsect1" lang="en">
126
 
<a name="id2853058"></a><h2>Description</h2>
 
125
<a name="GTypeModule.description"></a><h2>Description</h2>
127
126
<p>
128
127
<a class="link" href="GTypeModule.html" title="GTypeModule"><span class="type">GTypeModule</span></a> provides a simple implementation of the <a class="link" href="GTypePlugin.html" title="GTypePlugin"><span class="type">GTypePlugin</span></a>
129
128
interface. The model of <a class="link" href="GTypeModule.html" title="GTypeModule"><span class="type">GTypeModule</span></a> is a dynamically loaded module
130
129
which implements some number of types and interface
131
130
implementations. When the module is loaded, it registers its types
132
 
and interfaces using <a class="link" href="GTypeModule.html#g-type-module-register-type"><code class="function">g_type_module_register_type()</code></a> and
133
 
<a class="link" href="GTypeModule.html#g-type-module-add-interface"><code class="function">g_type_module_add_interface()</code></a>.  As long as any instances of these
 
131
and interfaces using <a class="link" href="GTypeModule.html#g-type-module-register-type" title="g_type_module_register_type ()"><code class="function">g_type_module_register_type()</code></a> and
 
132
<a class="link" href="GTypeModule.html#g-type-module-add-interface" title="g_type_module_add_interface ()"><code class="function">g_type_module_add_interface()</code></a>.  As long as any instances of these
134
133
types and interface implementations are in use, the module is kept
135
134
loaded. When the types and interfaces are gone, the module may be
136
135
unloaded. If the types and interfaces become used again, the module
137
136
will be reloaded. Note that the last unref can not happen in module
138
137
code, since that would lead to the caller's code being unloaded before
139
 
<a class="link" href="gobject-The-Base-Object-Type.html#g-object-unref"><code class="function">g_object_unref()</code></a> returns to it.
 
138
<a class="link" href="gobject-The-Base-Object-Type.html#g-object-unref" title="g_object_unref ()"><code class="function">g_object_unref()</code></a> returns to it.
140
139
</p>
141
140
<p>
142
141
Keeping track of whether the module should be loaded or not is done by
143
142
using a use count - it starts at zero, and whenever it is greater than
144
143
zero, the module is loaded. The use count is maintained internally by
145
144
the type system, but also can be explicitly controlled by
146
 
<a class="link" href="GTypeModule.html#g-type-module-use"><code class="function">g_type_module_use()</code></a> and <a class="link" href="GTypeModule.html#g-type-module-unuse"><code class="function">g_type_module_unuse()</code></a>. Typically, when loading
147
 
a module for the first type, <a class="link" href="GTypeModule.html#g-type-module-use"><code class="function">g_type_module_use()</code></a> will be used to load
 
145
<a class="link" href="GTypeModule.html#g-type-module-use" title="g_type_module_use ()"><code class="function">g_type_module_use()</code></a> and <a class="link" href="GTypeModule.html#g-type-module-unuse" title="g_type_module_unuse ()"><code class="function">g_type_module_unuse()</code></a>. Typically, when loading
 
146
a module for the first type, <a class="link" href="GTypeModule.html#g-type-module-use" title="g_type_module_use ()"><code class="function">g_type_module_use()</code></a> will be used to load
148
147
it so that it can initialize its types. At some later point, when the
149
148
module no longer needs to be loaded except for the type
150
 
implementations it contains, <a class="link" href="GTypeModule.html#g-type-module-unuse"><code class="function">g_type_module_unuse()</code></a> is called.
 
149
implementations it contains, <a class="link" href="GTypeModule.html#g-type-module-unuse" title="g_type_module_unuse ()"><code class="function">g_type_module_unuse()</code></a> is called.
151
150
</p>
152
151
<p>
153
152
<a class="link" href="GTypeModule.html" title="GTypeModule"><span class="type">GTypeModule</span></a> does not actually provide any implementation of module
154
153
loading and unloading. To create a particular module type you must
155
154
derive from <a class="link" href="GTypeModule.html" title="GTypeModule"><span class="type">GTypeModule</span></a> and implement the load and unload functions
156
 
in <a class="link" href="GTypeModule.html#GTypeModuleClass"><span class="type">GTypeModuleClass</span></a>.
 
155
in <a class="link" href="GTypeModule.html#GTypeModuleClass" title="GTypeModuleClass"><span class="type">GTypeModuleClass</span></a>.</p>
 
156
<p>
157
157
</p>
158
158
</div>
159
159
<div class="refsect1" lang="en">
160
 
<a name="id2853224"></a><h2>Details</h2>
 
160
<a name="GTypeModule.details"></a><h2>Details</h2>
161
161
<div class="refsect2" lang="en">
162
 
<a name="id2853234"></a><h3>
163
 
<a name="GTypeModule-struct"></a>GTypeModule</h3>
164
 
<a class="indexterm" name="id2853247"></a><pre class="programlisting">typedef struct {
 
162
<a name="GTypeModule-struct"></a><h3>GTypeModule</h3>
 
163
<pre class="programlisting">typedef struct {
165
164
  gchar *name;
166
165
} GTypeModule;
167
166
</pre>
168
167
<p>
169
168
The members of the <span class="structname">GTypeModule</span> structure should not 
170
 
be accessed directly, except for the <em class="parameter"><code>name</code></em> field.
 
169
be accessed directly, except for the <em class="parameter"><code>name</code></em> field.</p>
 
170
<p>
171
171
</p>
172
172
<div class="variablelist"><table border="0">
173
173
<col align="left" valign="top">
174
174
<tbody><tr>
175
175
<td><p><span class="term"><a
176
176
href="./../glib/glib/glib-Basic-Types.html#gchar"
177
 
>gchar</a>&#160;*<em class="structfield"><code>name</code></em>;</span></p></td>
178
 
<td>the name of the module
179
 
 
 
177
>gchar</a> *<em class="structfield"><code>name</code></em>;</span></p></td>
 
178
<td> the name of the module
180
179
</td>
181
180
</tr></tbody>
182
181
</table></div>
183
182
</div>
184
183
<hr>
185
184
<div class="refsect2" lang="en">
186
 
<a name="id2853298"></a><h3>
187
 
<a name="GTypeModuleClass"></a>GTypeModuleClass</h3>
188
 
<a class="indexterm" name="id2853311"></a><pre class="programlisting">typedef struct {
 
185
<a name="GTypeModuleClass"></a><h3>GTypeModuleClass</h3>
 
186
<pre class="programlisting">typedef struct {
189
187
  GObjectClass parent_class;
190
188
 
191
189
  gboolean (* load)   (GTypeModule *module);
194
192
</pre>
195
193
<p>
196
194
In order to implement dynamic loading of types based on <a class="link" href="GTypeModule.html" title="GTypeModule"><span class="type">GTypeModule</span></a>, 
197
 
the <em class="parameter"><code>load</code></em> and <em class="parameter"><code>unload</code></em> functions in <a class="link" href="GTypeModule.html#GTypeModuleClass"><span class="type">GTypeModuleClass</span></a> must be implemented.
 
195
the <em class="parameter"><code>load</code></em> and <em class="parameter"><code>unload</code></em> functions in <a class="link" href="GTypeModule.html#GTypeModuleClass" title="GTypeModuleClass"><span class="type">GTypeModuleClass</span></a> must be implemented.</p>
 
196
<p>
198
197
</p>
199
198
<div class="variablelist"><table border="0">
200
199
<col align="left" valign="top">
201
200
<tbody>
202
201
<tr>
203
 
<td><p><span class="term"><a class="link" href="gobject-The-Base-Object-Type.html#GObjectClass">GObjectClass</a>&#160;<em class="structfield"><code>parent_class</code></em>;</span></p></td>
204
 
<td>the parent class
205
 
</td>
206
 
</tr>
207
 
<tr>
208
 
<td><p><span class="term"><em class="structfield"><code>load</code></em>&#160;()</span></p></td>
209
 
<td>loads the module and registers one or more types using
210
 
  <a class="link" href="GTypeModule.html#g-type-module-register-type"><code class="function">g_type_module_register_type()</code></a>.
211
 
</td>
212
 
</tr>
213
 
<tr>
214
 
<td><p><span class="term"><em class="structfield"><code>unload</code></em>&#160;()</span></p></td>
215
 
<td>unloads the module
216
 
 
 
202
<td><p><span class="term"><a class="link" href="gobject-The-Base-Object-Type.html#GObjectClass" title="GObjectClass">GObjectClass</a> <em class="structfield"><code>parent_class</code></em>;</span></p></td>
 
203
<td> the parent class
 
204
</td>
 
205
</tr>
 
206
<tr>
 
207
<td><p><span class="term"><em class="structfield"><code>load</code></em> ()</span></p></td>
 
208
<td> loads the module and registers one or more types using
 
209
 <a class="link" href="GTypeModule.html#g-type-module-register-type" title="g_type_module_register_type ()"><code class="function">g_type_module_register_type()</code></a>.
 
210
</td>
 
211
</tr>
 
212
<tr>
 
213
<td><p><span class="term"><em class="structfield"><code>unload</code></em> ()</span></p></td>
 
214
<td> unloads the module
217
215
</td>
218
216
</tr>
219
217
</tbody>
221
219
</div>
222
220
<hr>
223
221
<div class="refsect2" lang="en">
224
 
<a name="id2853424"></a><h3>
225
 
<a name="g-type-module-use"></a>g_type_module_use ()</h3>
226
 
<a class="indexterm" name="id2853437"></a><pre class="programlisting"><a
 
222
<a name="g-type-module-use"></a><h3>g_type_module_use ()</h3>
 
223
<pre class="programlisting"><a
227
224
href="./../glib/glib/glib-Basic-Types.html#gboolean"
228
225
>gboolean</a>            g_type_module_use                   (<a class="link" href="GTypeModule.html" title="GTypeModule">GTypeModule</a> *module);</pre>
229
226
<p>
230
227
Increases the use count of a <a class="link" href="GTypeModule.html" title="GTypeModule"><span class="type">GTypeModule</span></a> by one. If the
231
228
use count was zero before, the plugin will be loaded.
 
229
If loading the plugin fails, the use count is reset to 
 
230
its prior value.</p>
 
231
<p>
232
232
</p>
233
233
<div class="variablelist"><table border="0">
234
234
<col align="left" valign="top">
235
235
<tbody>
236
236
<tr>
237
 
<td><p><span class="term"><em class="parameter"><code>module</code></em>&#160;:</span></p></td>
238
 
<td>a <a class="link" href="GTypeModule.html" title="GTypeModule"><span class="type">GTypeModule</span></a>
 
237
<td><p><span class="term"><em class="parameter"><code>module</code></em> :</span></p></td>
 
238
<td> a <a class="link" href="GTypeModule.html" title="GTypeModule"><span class="type">GTypeModule</span></a>
239
239
</td>
240
240
</tr>
241
241
<tr>
242
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
243
 
<td>
244
 
<a
245
 
href="./../glib/glib/glib-Standard-Macros.html#FALSE:CAPS"
 
242
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
243
<td> <a
 
244
href="./../glib/glib/glib-Standard-Macros.html#FALSE--CAPS"
246
245
><code class="literal">FALSE</code></a> if the plugin needed to be loaded and
247
 
          loading the plugin failed.
248
 
 
249
 
 
 
246
 loading the plugin failed.
250
247
</td>
251
248
</tr>
252
249
</tbody>
254
251
</div>
255
252
<hr>
256
253
<div class="refsect2" lang="en">
257
 
<a name="id2853521"></a><h3>
258
 
<a name="g-type-module-unuse"></a>g_type_module_unuse ()</h3>
259
 
<a class="indexterm" name="id2853534"></a><pre class="programlisting">void                g_type_module_unuse                 (<a class="link" href="GTypeModule.html" title="GTypeModule">GTypeModule</a> *module);</pre>
 
254
<a name="g-type-module-unuse"></a><h3>g_type_module_unuse ()</h3>
 
255
<pre class="programlisting">void                g_type_module_unuse                 (<a class="link" href="GTypeModule.html" title="GTypeModule">GTypeModule</a> *module);</pre>
260
256
<p>
261
257
Decreases the use count of a <a class="link" href="GTypeModule.html" title="GTypeModule"><span class="type">GTypeModule</span></a> by one. If the
262
258
result is zero, the module will be unloaded. (However, the
263
259
<a class="link" href="GTypeModule.html" title="GTypeModule"><span class="type">GTypeModule</span></a> will not be freed, and types associated with the
264
 
<a class="link" href="GTypeModule.html" title="GTypeModule"><span class="type">GTypeModule</span></a> are not unregistered. Once a <a class="link" href="GTypeModule.html" title="GTypeModule"><span class="type">GTypeModule</span></a> is 
265
 
initialized, it must exist forever.)
 
260
<a class="link" href="GTypeModule.html" title="GTypeModule"><span class="type">GTypeModule</span></a> are not unregistered. Once a <a class="link" href="GTypeModule.html" title="GTypeModule"><span class="type">GTypeModule</span></a> is
 
261
initialized, it must exist forever.)</p>
 
262
<p>
266
263
</p>
267
264
<div class="variablelist"><table border="0">
268
265
<col align="left" valign="top">
269
266
<tbody><tr>
270
 
<td><p><span class="term"><em class="parameter"><code>module</code></em>&#160;:</span></p></td>
271
 
<td>a <a class="link" href="GTypeModule.html" title="GTypeModule"><span class="type">GTypeModule</span></a>
272
 
 
273
 
 
 
267
<td><p><span class="term"><em class="parameter"><code>module</code></em> :</span></p></td>
 
268
<td> a <a class="link" href="GTypeModule.html" title="GTypeModule"><span class="type">GTypeModule</span></a>
274
269
</td>
275
270
</tr></tbody>
276
271
</table></div>
277
272
</div>
278
273
<hr>
279
274
<div class="refsect2" lang="en">
280
 
<a name="id2853622"></a><h3>
281
 
<a name="g-type-module-set-name"></a>g_type_module_set_name ()</h3>
282
 
<a class="indexterm" name="id2853636"></a><pre class="programlisting">void                g_type_module_set_name              (<a class="link" href="GTypeModule.html" title="GTypeModule">GTypeModule</a> *module,
 
275
<a name="g-type-module-set-name"></a><h3>g_type_module_set_name ()</h3>
 
276
<pre class="programlisting">void                g_type_module_set_name              (<a class="link" href="GTypeModule.html" title="GTypeModule">GTypeModule</a> *module,
283
277
                                                         const <a
284
278
href="./../glib/glib/glib-Basic-Types.html#gchar"
285
279
>gchar</a> *name);</pre>
286
280
<p>
287
 
Sets the name for a <a class="link" href="GTypeModule.html" title="GTypeModule"><span class="type">GTypeModule</span></a> 
 
281
Sets the name for a <a class="link" href="GTypeModule.html" title="GTypeModule"><span class="type">GTypeModule</span></a></p>
 
282
<p>
288
283
</p>
289
284
<div class="variablelist"><table border="0">
290
285
<col align="left" valign="top">
291
286
<tbody>
292
287
<tr>
293
 
<td><p><span class="term"><em class="parameter"><code>module</code></em>&#160;:</span></p></td>
294
 
<td>a <a class="link" href="GTypeModule.html" title="GTypeModule"><span class="type">GTypeModule</span></a>.
 
288
<td><p><span class="term"><em class="parameter"><code>module</code></em> :</span></p></td>
 
289
<td> a <a class="link" href="GTypeModule.html" title="GTypeModule"><span class="type">GTypeModule</span></a>.
295
290
</td>
296
291
</tr>
297
292
<tr>
298
 
<td><p><span class="term"><em class="parameter"><code>name</code></em>&#160;:</span></p></td>
299
 
<td>a human-readable name to use in error messages.
300
 
 
301
 
 
 
293
<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
 
294
<td> a human-readable name to use in error messages.
302
295
</td>
303
296
</tr>
304
297
</tbody>
306
299
</div>
307
300
<hr>
308
301
<div class="refsect2" lang="en">
309
 
<a name="id2853720"></a><h3>
310
 
<a name="g-type-module-register-type"></a>g_type_module_register_type ()</h3>
311
 
<a class="indexterm" name="id2853734"></a><pre class="programlisting"><a class="link" href="gobject-Type-Information.html#GType">GType</a>               g_type_module_register_type         (<a class="link" href="GTypeModule.html" title="GTypeModule">GTypeModule</a> *module,
312
 
                                                         <a class="link" href="gobject-Type-Information.html#GType">GType</a> parent_type,
 
302
<a name="g-type-module-register-type"></a><h3>g_type_module_register_type ()</h3>
 
303
<pre class="programlisting"><a class="link" href="gobject-Type-Information.html#GType" title="GType">GType</a>               g_type_module_register_type         (<a class="link" href="GTypeModule.html" title="GTypeModule">GTypeModule</a> *module,
 
304
                                                         <a class="link" href="gobject-Type-Information.html#GType" title="GType">GType</a> parent_type,
313
305
                                                         const <a
314
306
href="./../glib/glib/glib-Basic-Types.html#gchar"
315
307
>gchar</a> *type_name,
316
 
                                                         const <a class="link" href="gobject-Type-Information.html#GTypeInfo">GTypeInfo</a> *type_info,
317
 
                                                         <a class="link" href="gobject-Type-Information.html#GTypeFlags">GTypeFlags</a> flags);</pre>
 
308
                                                         const <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="GTypeInfo">GTypeInfo</a> *type_info,
 
309
                                                         <a class="link" href="gobject-Type-Information.html#GTypeFlags" title="enum GTypeFlags">GTypeFlags</a> flags);</pre>
318
310
<p>
319
311
Looks up or registers a type that is implemented with a particular
320
312
type plugin. If a type with name <em class="parameter"><code>type_name</code></em> was previously registered,
321
 
the <a class="link" href="gobject-Type-Information.html#GType"><span class="type">GType</span></a> identifier for the type is returned, otherwise the type
322
 
is newly registered, and the resulting <a class="link" href="gobject-Type-Information.html#GType"><span class="type">GType</span></a> identifier returned.
 
313
the <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> identifier for the type is returned, otherwise the type
 
314
is newly registered, and the resulting <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> identifier returned.
323
315
</p>
324
316
<p>
325
317
When reregistering a type (typically because a module is unloaded
328
320
</p>
329
321
<p>
330
322
As long as any instances of the type exist, the type plugin will
331
 
not be unloaded.
 
323
not be unloaded.</p>
 
324
<p>
332
325
</p>
333
326
<div class="variablelist"><table border="0">
334
327
<col align="left" valign="top">
335
328
<tbody>
336
329
<tr>
337
 
<td><p><span class="term"><em class="parameter"><code>module</code></em>&#160;:</span></p></td>
 
330
<td><p><span class="term"><em class="parameter"><code>module</code></em> :</span></p></td>
338
331
<td> a <a class="link" href="GTypeModule.html" title="GTypeModule"><span class="type">GTypeModule</span></a>
339
332
</td>
340
333
</tr>
341
334
<tr>
342
 
<td><p><span class="term"><em class="parameter"><code>parent_type</code></em>&#160;:</span></p></td>
343
 
<td>   the type for the parent class
344
 
</td>
345
 
</tr>
346
 
<tr>
347
 
<td><p><span class="term"><em class="parameter"><code>type_name</code></em>&#160;:</span></p></td>
348
 
<td>     name for the type
349
 
</td>
350
 
</tr>
351
 
<tr>
352
 
<td><p><span class="term"><em class="parameter"><code>type_info</code></em>&#160;:</span></p></td>
353
 
<td>     type information structure
354
 
</td>
355
 
</tr>
356
 
<tr>
357
 
<td><p><span class="term"><em class="parameter"><code>flags</code></em>&#160;:</span></p></td>
358
 
<td>         flags field providing details about the type
359
 
</td>
360
 
</tr>
361
 
<tr>
362
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
363
 
<td>the new or existing type ID
364
 
 
365
 
 
 
335
<td><p><span class="term"><em class="parameter"><code>parent_type</code></em> :</span></p></td>
 
336
<td> the type for the parent class
 
337
</td>
 
338
</tr>
 
339
<tr>
 
340
<td><p><span class="term"><em class="parameter"><code>type_name</code></em> :</span></p></td>
 
341
<td> name for the type
 
342
</td>
 
343
</tr>
 
344
<tr>
 
345
<td><p><span class="term"><em class="parameter"><code>type_info</code></em> :</span></p></td>
 
346
<td> type information structure
 
347
</td>
 
348
</tr>
 
349
<tr>
 
350
<td><p><span class="term"><em class="parameter"><code>flags</code></em> :</span></p></td>
 
351
<td> flags field providing details about the type
 
352
</td>
 
353
</tr>
 
354
<tr>
 
355
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
356
<td> the new or existing type ID
366
357
</td>
367
358
</tr>
368
359
</tbody>
370
361
</div>
371
362
<hr>
372
363
<div class="refsect2" lang="en">
373
 
<a name="id2853935"></a><h3>
374
 
<a name="g-type-module-add-interface"></a>g_type_module_add_interface ()</h3>
375
 
<a class="indexterm" name="id2853949"></a><pre class="programlisting">void                g_type_module_add_interface         (<a class="link" href="GTypeModule.html" title="GTypeModule">GTypeModule</a> *module,
376
 
                                                         <a class="link" href="gobject-Type-Information.html#GType">GType</a> instance_type,
377
 
                                                         <a class="link" href="gobject-Type-Information.html#GType">GType</a> interface_type,
378
 
                                                         const <a class="link" href="gobject-Type-Information.html#GInterfaceInfo">GInterfaceInfo</a> *interface_info);</pre>
 
364
<a name="g-type-module-add-interface"></a><h3>g_type_module_add_interface ()</h3>
 
365
<pre class="programlisting">void                g_type_module_add_interface         (<a class="link" href="GTypeModule.html" title="GTypeModule">GTypeModule</a> *module,
 
366
                                                         <a class="link" href="gobject-Type-Information.html#GType" title="GType">GType</a> instance_type,
 
367
                                                         <a class="link" href="gobject-Type-Information.html#GType" title="GType">GType</a> interface_type,
 
368
                                                         const <a class="link" href="gobject-Type-Information.html#GInterfaceInfo" title="GInterfaceInfo">GInterfaceInfo</a> *interface_info);</pre>
379
369
<p>
380
 
Registers an additional interface for a type, whose interface
381
 
lives in the given type plugin. If the interface was already registered
382
 
for the type in this plugin, nothing will be done. 
 
370
Registers an additional interface for a type, whose interface lives
 
371
in the given type plugin. If the interface was already registered
 
372
for the type in this plugin, nothing will be done.
383
373
</p>
384
374
<p>
385
375
As long as any instances of the type exist, the type plugin will
386
 
not be unloaded.
 
376
not be unloaded.</p>
 
377
<p>
387
378
</p>
388
379
<div class="variablelist"><table border="0">
389
380
<col align="left" valign="top">
390
381
<tbody>
391
382
<tr>
392
 
<td><p><span class="term"><em class="parameter"><code>module</code></em>&#160;:</span></p></td>
393
 
<td>a <a class="link" href="GTypeModule.html" title="GTypeModule"><span class="type">GTypeModule</span></a>
394
 
</td>
395
 
</tr>
396
 
<tr>
397
 
<td><p><span class="term"><em class="parameter"><code>instance_type</code></em>&#160;:</span></p></td>
398
 
<td>type to which to add the interface.
399
 
</td>
400
 
</tr>
401
 
<tr>
402
 
<td><p><span class="term"><em class="parameter"><code>interface_type</code></em>&#160;:</span></p></td>
403
 
<td>interface type to add
404
 
</td>
405
 
</tr>
406
 
<tr>
407
 
<td><p><span class="term"><em class="parameter"><code>interface_info</code></em>&#160;:</span></p></td>
408
 
<td>type information structure
409
 
 
410
 
 
 
383
<td><p><span class="term"><em class="parameter"><code>module</code></em> :</span></p></td>
 
384
<td> a <a class="link" href="GTypeModule.html" title="GTypeModule"><span class="type">GTypeModule</span></a>
 
385
</td>
 
386
</tr>
 
387
<tr>
 
388
<td><p><span class="term"><em class="parameter"><code>instance_type</code></em> :</span></p></td>
 
389
<td> type to which to add the interface.
 
390
</td>
 
391
</tr>
 
392
<tr>
 
393
<td><p><span class="term"><em class="parameter"><code>interface_type</code></em> :</span></p></td>
 
394
<td> interface type to add
 
395
</td>
 
396
</tr>
 
397
<tr>
 
398
<td><p><span class="term"><em class="parameter"><code>interface_info</code></em> :</span></p></td>
 
399
<td> type information structure
411
400
</td>
412
401
</tr>
413
402
</tbody>
415
404
</div>
416
405
<hr>
417
406
<div class="refsect2" lang="en">
418
 
<a name="id2854078"></a><h3>
419
 
<a name="g-type-module-register-enum"></a>g_type_module_register_enum ()</h3>
420
 
<a class="indexterm" name="id2854093"></a><pre class="programlisting"><a class="link" href="gobject-Type-Information.html#GType">GType</a>               g_type_module_register_enum         (<a class="link" href="GTypeModule.html" title="GTypeModule">GTypeModule</a> *module,
 
407
<a name="g-type-module-register-enum"></a><h3>g_type_module_register_enum ()</h3>
 
408
<pre class="programlisting"><a class="link" href="gobject-Type-Information.html#GType" title="GType">GType</a>               g_type_module_register_enum         (<a class="link" href="GTypeModule.html" title="GTypeModule">GTypeModule</a> *module,
421
409
                                                         const <a
422
410
href="./../glib/glib/glib-Basic-Types.html#gchar"
423
411
>gchar</a> *name,
424
 
                                                         const <a class="link" href="gobject-Enumeration-and-Flag-Types.html#GEnumValue">GEnumValue</a> *const_static_values);</pre>
 
412
                                                         const <a class="link" href="gobject-Enumeration-and-Flag-Types.html#GEnumValue" title="GEnumValue">GEnumValue</a> *const_static_values);</pre>
425
413
<p>
426
414
Looks up or registers an enumeration that is implemented with a particular
427
415
type plugin. If a type with name <em class="parameter"><code>type_name</code></em> was previously registered,
428
 
the <a class="link" href="gobject-Type-Information.html#GType"><span class="type">GType</span></a> identifier for the type is returned, otherwise the type
429
 
is newly registered, and the resulting <a class="link" href="gobject-Type-Information.html#GType"><span class="type">GType</span></a> identifier returned.
 
416
the <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> identifier for the type is returned, otherwise the type
 
417
is newly registered, and the resulting <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> identifier returned.
430
418
</p>
431
419
<p>
432
420
As long as any instances of the type exist, the type plugin will
433
 
not be unloaded.
 
421
not be unloaded.</p>
 
422
<p>
434
423
</p>
435
424
<div class="variablelist"><table border="0">
436
425
<col align="left" valign="top">
437
426
<tbody>
438
427
<tr>
439
 
<td><p><span class="term"><em class="parameter"><code>module</code></em>&#160;:</span></p></td>
440
 
<td>             a <a class="link" href="GTypeModule.html" title="GTypeModule"><span class="type">GTypeModule</span></a>
441
 
</td>
442
 
</tr>
443
 
<tr>
444
 
<td><p><span class="term"><em class="parameter"><code>name</code></em>&#160;:</span></p></td>
445
 
<td>               name for the type
446
 
</td>
447
 
</tr>
448
 
<tr>
449
 
<td><p><span class="term"><em class="parameter"><code>const_static_values</code></em>&#160;:</span></p></td>
450
 
<td>an array of <a class="link" href="gobject-Enumeration-and-Flag-Types.html#GEnumValue"><span class="type">GEnumValue</span></a> structs for the possible
451
 
  enumeration values. The array is terminated by a struct with all 
452
 
  members being 0.
453
 
</td>
454
 
</tr>
455
 
<tr>
456
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
457
 
<td>the new or existing type ID
 
428
<td><p><span class="term"><em class="parameter"><code>module</code></em> :</span></p></td>
 
429
<td> a <a class="link" href="GTypeModule.html" title="GTypeModule"><span class="type">GTypeModule</span></a>
 
430
</td>
 
431
</tr>
 
432
<tr>
 
433
<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
 
434
<td> name for the type
 
435
</td>
 
436
</tr>
 
437
<tr>
 
438
<td><p><span class="term"><em class="parameter"><code>const_static_values</code></em> :</span></p></td>
 
439
<td> an array of <a class="link" href="gobject-Enumeration-and-Flag-Types.html#GEnumValue" title="GEnumValue"><span class="type">GEnumValue</span></a> structs for the
 
440
                      possible enumeration values. The array is
 
441
                      terminated by a struct with all members being
 
442
                      0.
 
443
</td>
 
444
</tr>
 
445
<tr>
 
446
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
447
<td> the new or existing type ID
458
448
</td>
459
449
</tr>
460
450
</tbody>
461
451
</table></div>
462
 
<p class="since">Since 2.6
463
 
 
464
 
 
465
 
</p>
 
452
<p class="since">Since 2.6</p>
466
453
</div>
467
454
<hr>
468
455
<div class="refsect2" lang="en">
469
 
<a name="id2854250"></a><h3>
470
 
<a name="g-type-module-register-flags"></a>g_type_module_register_flags ()</h3>
471
 
<a class="indexterm" name="id2854266"></a><pre class="programlisting"><a class="link" href="gobject-Type-Information.html#GType">GType</a>               g_type_module_register_flags        (<a class="link" href="GTypeModule.html" title="GTypeModule">GTypeModule</a> *module,
 
456
<a name="g-type-module-register-flags"></a><h3>g_type_module_register_flags ()</h3>
 
457
<pre class="programlisting"><a class="link" href="gobject-Type-Information.html#GType" title="GType">GType</a>               g_type_module_register_flags        (<a class="link" href="GTypeModule.html" title="GTypeModule">GTypeModule</a> *module,
472
458
                                                         const <a
473
459
href="./../glib/glib/glib-Basic-Types.html#gchar"
474
460
>gchar</a> *name,
475
 
                                                         const <a class="link" href="gobject-Enumeration-and-Flag-Types.html#GFlagsValue">GFlagsValue</a> *const_static_values);</pre>
 
461
                                                         const <a class="link" href="gobject-Enumeration-and-Flag-Types.html#GFlagsValue" title="GFlagsValue">GFlagsValue</a> *const_static_values);</pre>
476
462
<p>
477
463
Looks up or registers a flags type that is implemented with a particular
478
464
type plugin. If a type with name <em class="parameter"><code>type_name</code></em> was previously registered,
479
 
the <a class="link" href="gobject-Type-Information.html#GType"><span class="type">GType</span></a> identifier for the type is returned, otherwise the type
480
 
is newly registered, and the resulting <a class="link" href="gobject-Type-Information.html#GType"><span class="type">GType</span></a> identifier returned.
 
465
the <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> identifier for the type is returned, otherwise the type
 
466
is newly registered, and the resulting <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> identifier returned.
481
467
</p>
482
468
<p>
483
469
As long as any instances of the type exist, the type plugin will
484
 
not be unloaded.
 
470
not be unloaded.</p>
 
471
<p>
485
472
</p>
486
473
<div class="variablelist"><table border="0">
487
474
<col align="left" valign="top">
488
475
<tbody>
489
476
<tr>
490
 
<td><p><span class="term"><em class="parameter"><code>module</code></em>&#160;:</span></p></td>
491
 
<td>             a <a class="link" href="GTypeModule.html" title="GTypeModule"><span class="type">GTypeModule</span></a>
492
 
</td>
493
 
</tr>
494
 
<tr>
495
 
<td><p><span class="term"><em class="parameter"><code>name</code></em>&#160;:</span></p></td>
496
 
<td>               name for the type
497
 
</td>
498
 
</tr>
499
 
<tr>
500
 
<td><p><span class="term"><em class="parameter"><code>const_static_values</code></em>&#160;:</span></p></td>
501
 
<td>an array of <a class="link" href="gobject-Enumeration-and-Flag-Types.html#GFlagsValue"><span class="type">GFlagsValue</span></a> structs for the possible
502
 
  flags values. The array is terminated by a struct with all 
503
 
  members being 0.
504
 
</td>
505
 
</tr>
506
 
<tr>
507
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
508
 
<td>the new or existing type ID
 
477
<td><p><span class="term"><em class="parameter"><code>module</code></em> :</span></p></td>
 
478
<td> a <a class="link" href="GTypeModule.html" title="GTypeModule"><span class="type">GTypeModule</span></a>
 
479
</td>
 
480
</tr>
 
481
<tr>
 
482
<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
 
483
<td> name for the type
 
484
</td>
 
485
</tr>
 
486
<tr>
 
487
<td><p><span class="term"><em class="parameter"><code>const_static_values</code></em> :</span></p></td>
 
488
<td> an array of <a class="link" href="gobject-Enumeration-and-Flag-Types.html#GFlagsValue" title="GFlagsValue"><span class="type">GFlagsValue</span></a> structs for the
 
489
                      possible flags values. The array is
 
490
                      terminated by a struct with all members being
 
491
                      0.
 
492
</td>
 
493
</tr>
 
494
<tr>
 
495
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
496
<td> the new or existing type ID
509
497
</td>
510
498
</tr>
511
499
</tbody>
512
500
</table></div>
513
 
<p class="since">Since 2.6
514
 
 
515
 
 
516
 
</p>
 
501
<p class="since">Since 2.6</p>
517
502
</div>
518
503
<hr>
519
504
<div class="refsect2" lang="en">
520
 
<a name="id2854422"></a><h3>
521
 
<a name="G-DEFINE-DYNAMIC-TYPE:CAPS"></a>G_DEFINE_DYNAMIC_TYPE()</h3>
522
 
<a class="indexterm" name="id2854438"></a><pre class="programlisting">#define G_DEFINE_DYNAMIC_TYPE(TN, t_n, T_P)          G_DEFINE_DYNAMIC_TYPE_EXTENDED (TN, t_n, T_P, 0, {})
 
505
<a name="G-DEFINE-DYNAMIC-TYPE--CAPS"></a><h3>G_DEFINE_DYNAMIC_TYPE()</h3>
 
506
<pre class="programlisting">#define G_DEFINE_DYNAMIC_TYPE(TN, t_n, T_P)          G_DEFINE_DYNAMIC_TYPE_EXTENDED (TN, t_n, T_P, 0, {})
523
507
</pre>
524
508
<p>
525
509
A convenience macro for dynamic type implementations, which declares a
526
510
class initialization function, an instance initialization function (see 
527
 
<a class="link" href="gobject-Type-Information.html#GTypeInfo"><span class="type">GTypeInfo</span></a> for information about these) and a static variable named 
 
511
<a class="link" href="gobject-Type-Information.html#GTypeInfo" title="GTypeInfo"><span class="type">GTypeInfo</span></a> for information about these) and a static variable named 
528
512
<em class="parameter"><code>t_n</code></em>_parent_class pointing to the parent class. Furthermore, 
529
513
it defines a <code class="function">*<code class="function">_get_type()</code></code> and a static 
530
514
<code class="function">*<code class="function">_register_type()</code></code> function for use in your
531
515
<code class="function"><code class="function">module_init()</code></code>.
532
 
See <a class="link" href="GTypeModule.html#G-DEFINE-DYNAMIC-TYPE-EXTENDED:CAPS"><code class="function">G_DEFINE_DYNAMIC_TYPE_EXTENDED()</code></a> for an example.
 
516
See <a class="link" href="GTypeModule.html#G-DEFINE-DYNAMIC-TYPE-EXTENDED--CAPS" title="G_DEFINE_DYNAMIC_TYPE_EXTENDED()"><code class="function">G_DEFINE_DYNAMIC_TYPE_EXTENDED()</code></a> for an example.</p>
 
517
<p>
533
518
</p>
534
519
<div class="variablelist"><table border="0">
535
520
<col align="left" valign="top">
536
521
<tbody>
537
522
<tr>
538
 
<td><p><span class="term"><em class="parameter"><code>TN</code></em>&#160;:</span></p></td>
539
 
<td>The name of the new type, in Camel case.
540
 
</td>
541
 
</tr>
542
 
<tr>
543
 
<td><p><span class="term"><em class="parameter"><code>t_n</code></em>&#160;:</span></p></td>
544
 
<td>The name of the new type, in lowercase, with words
545
 
  separated by '_'.
546
 
</td>
547
 
</tr>
548
 
<tr>
549
 
<td><p><span class="term"><em class="parameter"><code>T_P</code></em>&#160;:</span></p></td>
550
 
<td>The <a class="link" href="gobject-Type-Information.html#GType"><span class="type">GType</span></a> of the parent type.
 
523
<td><p><span class="term"><em class="parameter"><code>TN</code></em> :</span></p></td>
 
524
<td> The name of the new type, in Camel case.
 
525
</td>
 
526
</tr>
 
527
<tr>
 
528
<td><p><span class="term"><em class="parameter"><code>t_n</code></em> :</span></p></td>
 
529
<td> The name of the new type, in lowercase, with words
 
530
 separated by '_'.
 
531
</td>
 
532
</tr>
 
533
<tr>
 
534
<td><p><span class="term"><em class="parameter"><code>T_P</code></em> :</span></p></td>
 
535
<td> The <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> of the parent type.
551
536
</td>
552
537
</tr>
553
538
</tbody>
554
539
</table></div>
555
 
<p class="since">Since 2.14
556
 
 
557
 
 
558
 
</p>
 
540
<p class="since">Since 2.14</p>
559
541
</div>
560
542
<hr>
561
543
<div class="refsect2" lang="en">
562
 
<a name="id2854593"></a><h3>
563
 
<a name="G-DEFINE-DYNAMIC-TYPE-EXTENDED:CAPS"></a>G_DEFINE_DYNAMIC_TYPE_EXTENDED()</h3>
564
 
<a class="indexterm" name="id2854609"></a><pre class="programlisting">#define             G_DEFINE_DYNAMIC_TYPE_EXTENDED(TypeName, type_name, TYPE_PARENT, flags, CODE)</pre>
565
 
<p>
566
 
A more general version of <a class="link" href="GTypeModule.html#G-DEFINE-DYNAMIC-TYPE:CAPS"><code class="function">G_DEFINE_DYNAMIC_TYPE()</code></a> which
567
 
allows to specify <a class="link" href="gobject-Type-Information.html#GTypeFlags"><span class="type">GTypeFlags</span></a> and custom code.
568
 
</p>
569
 
<div class="informalexample">
570
 
<pre class="programlisting">
 
544
<a name="G-DEFINE-DYNAMIC-TYPE-EXTENDED--CAPS"></a><h3>G_DEFINE_DYNAMIC_TYPE_EXTENDED()</h3>
 
545
<pre class="programlisting">#define             G_DEFINE_DYNAMIC_TYPE_EXTENDED(TypeName, type_name, TYPE_PARENT, flags, CODE)</pre>
 
546
<p>
 
547
A more general version of <a class="link" href="GTypeModule.html#G-DEFINE-DYNAMIC-TYPE--CAPS" title="G_DEFINE_DYNAMIC_TYPE()"><code class="function">G_DEFINE_DYNAMIC_TYPE()</code></a> which
 
548
allows to specify <a class="link" href="gobject-Type-Information.html#GTypeFlags" title="enum GTypeFlags"><span class="type">GTypeFlags</span></a> and custom code.
 
549
</p>
 
550
<p>
 
551
</p>
 
552
<div class="informalexample"><pre class="programlisting">
571
553
G_DEFINE_DYNAMIC_TYPE_EXTENDED (GtkGadget,
572
554
                                gtk_gadget,
573
555
                                GTK_TYPE_THING,
574
556
                                0,
575
557
                                G_IMPLEMENT_INTERFACE (TYPE_GIZMO,
576
558
                                                       gtk_gadget_gizmo_init));
577
 
</pre>
 
559
</pre></div>
 
560
<p>
578
561
expands to
579
 
<pre class="programlisting">
 
562
</p>
 
563
<div class="informalexample"><pre class="programlisting">
580
564
static void     gtk_gadget_init              (GtkGadget      *self);
581
565
static void     gtk_gadget_class_init        (GtkGadgetClass *klass);
582
566
static void     gtk_gadget_class_finalize    (GtkGadgetClass *klass);
605
589
    (GBaseFinalizeFunc) NULL,
606
590
    (GClassInitFunc) gtk_gadget_class_intern_init,
607
591
    (GClassFinalizeFunc) gtk_gadget_class_finalize,
608
 
    NULL,   /* class_data */
 
592
    NULL,   // class_data
609
593
    sizeof (GtkGadget),
610
 
    0,      /* n_preallocs */
 
594
    0,      // n_preallocs
611
595
    (GInstanceInitFunc) gtk_gadget_init, 
612
 
    NULL    /* value_table */
 
596
    NULL    // value_table
613
597
  };
614
598
  gtk_gadget_type_id = g_type_module_register_type (type_module,
615
599
                                                    GTK_TYPE_THING,
623
607
    g_type_add_interface_static (g_define_type_id, TYPE_GIZMO, &amp;g_implement_interface_info);
624
608
  }
625
609
}
626
 
</pre>
627
 
</div>
 
610
</pre></div>
 
611
<p>
 
612
</p>
628
613
<div class="variablelist"><table border="0">
629
614
<col align="left" valign="top">
630
615
<tbody>
631
616
<tr>
632
 
<td><p><span class="term"><em class="parameter"><code>TypeName</code></em>&#160;:</span></p></td>
633
 
<td>The name of the new type, in Camel case.
634
 
</td>
635
 
</tr>
636
 
<tr>
637
 
<td><p><span class="term"><em class="parameter"><code>type_name</code></em>&#160;:</span></p></td>
638
 
<td>The name of the new type, in lowercase, with words
639
 
  separated by '_'.
640
 
</td>
641
 
</tr>
642
 
<tr>
643
 
<td><p><span class="term"><em class="parameter"><code>TYPE_PARENT</code></em>&#160;:</span></p></td>
644
 
<td>The <a class="link" href="gobject-Type-Information.html#GType"><span class="type">GType</span></a> of the parent type.
645
 
</td>
646
 
</tr>
647
 
<tr>
648
 
<td><p><span class="term"><em class="parameter"><code>flags</code></em>&#160;:</span></p></td>
649
 
<td>
650
 
<a class="link" href="gobject-Type-Information.html#GTypeFlags"><span class="type">GTypeFlags</span></a> to pass to <a class="link" href="GTypeModule.html#g-type-module-register-type"><code class="function">g_type_module_register_type()</code></a>
651
 
</td>
652
 
</tr>
653
 
<tr>
654
 
<td><p><span class="term"><em class="parameter"><code>CODE</code></em>&#160;:</span></p></td>
655
 
<td>Custom code that gets inserted in the *<code class="function">_get_type()</code> function.
 
617
<td><p><span class="term"><em class="parameter"><code>TypeName</code></em> :</span></p></td>
 
618
<td> The name of the new type, in Camel case.
 
619
</td>
 
620
</tr>
 
621
<tr>
 
622
<td><p><span class="term"><em class="parameter"><code>type_name</code></em> :</span></p></td>
 
623
<td> The name of the new type, in lowercase, with words
 
624
 separated by '_'.
 
625
</td>
 
626
</tr>
 
627
<tr>
 
628
<td><p><span class="term"><em class="parameter"><code>TYPE_PARENT</code></em> :</span></p></td>
 
629
<td> The <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> of the parent type.
 
630
</td>
 
631
</tr>
 
632
<tr>
 
633
<td><p><span class="term"><em class="parameter"><code>flags</code></em> :</span></p></td>
 
634
<td> <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="GTypeModule.html#g-type-module-register-type" title="g_type_module_register_type ()"><code class="function">g_type_module_register_type()</code></a>
 
635
</td>
 
636
</tr>
 
637
<tr>
 
638
<td><p><span class="term"><em class="parameter"><code>CODE</code></em> :</span></p></td>
 
639
<td> Custom code that gets inserted in the *<code class="function">_get_type()</code> function.
656
640
</td>
657
641
</tr>
658
642
</tbody>
659
643
</table></div>
660
 
<p class="since">Since 2.14
661
 
 
662
 
 
663
 
</p>
 
644
<p class="since">Since 2.14</p>
664
645
</div>
665
646
</div>
666
647
<div class="refsect1" lang="en">
667
 
<a name="id2852684"></a><h2>See Also</h2>
668
 
<p>
669
 
</p>
 
648
<a name="GTypeModule.see-also"></a><h2>See Also</h2>
670
649
<div class="variablelist"><table border="0">
671
650
<col align="left" valign="top">
672
651
<tbody>
682
661
</tr>
683
662
</tbody>
684
663
</table></div>
685
 
<p>
686
 
</p>
687
 
</div>
688
 
<div class="refsect1" lang="en">
689
 
<a name="id2855012"></a><div class="refsect2" lang="en"><a name="id2855013"></a></div>
 
664
</div>
 
665
</div>
 
666
<div class="footer">
690
667
<hr>
691
 
<div class="refsect2" lang="en"><a name="id2855014"></a></div>
692
 
</div>
693
 
</div>
 
668
          Generated by GTK-Doc V1.11</div>
694
669
</body>
695
670
</html>