5
5
<title>Utilities</title>
6
6
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
7
7
<link rel="home" href="index.html" title="Clutter Reference Manual">
8
<link rel="up" href="ch07.html" title="General purpose API">
8
<link rel="up" href="ch08.html" title="General purpose API">
9
9
<link rel="prev" href="clutter-Unit-conversion.html" title="Unit conversion">
10
<link rel="next" href="clutter-Versioning-Macros.html" title="Versioning Macros">
11
<meta name="generator" content="GTK-Doc V1.11 (XML mode)">
10
<link rel="next" href="clutter-Features.html" title="Features">
11
<meta name="generator" content="GTK-Doc V1.15.1 (XML mode)">
12
12
<link rel="stylesheet" href="style.css" type="text/css">
13
<link rel="part" href="clutter-overview.html" title="Part I. Overview">
14
<link rel="part" href="building-clutter.html" title="Part II. Building Clutter">
15
<link rel="part" href="running-clutter.html" title="Part III. Running Clutter">
16
<link rel="part" href="clutterbase.html" title="Part IV. Clutter Core Reference">
17
<link rel="chapter" href="ch01.html" title="Abstract classes and interfaces">
18
<link rel="chapter" href="ch02.html" title="Base actors">
19
<link rel="chapter" href="ch03.html" title="Container actors">
20
<link rel="part" href="clutteranimation.html" title="Part V. Clutter Animation Framework">
21
<link rel="chapter" href="ch04.html" title="Base classes">
22
<link rel="chapter" href="ch05.html" title="Behaviours">
23
<link rel="chapter" href="ch06.html" title="High Level API">
24
<link rel="part" href="cluttertools.html" title="Part VI. Clutter Tools">
25
<link rel="chapter" href="ch07.html" title="General purpose API">
26
<link rel="chapter" href="ch08.html" title="User interface definition">
27
<link rel="chapter" href="ch09.html" title="Generic list model">
28
<link rel="part" href="clutterbackends.html" title="Part VII. Clutter Backends">
29
<link rel="part" href="additionaldocs.html" title="Part VIII. Additional Documentation">
30
<link rel="chapter" href="clutter-subclassing-ClutterActor.html" title="Implementing a new actor">
31
<link rel="chapter" href="clutter-animations.html" title="Creating Animations with Clutter">
32
<link rel="chapter" href="creating-your-own-behaviours.html" title="Creating You Own Behaviours">
33
<link rel="part" href="migration.html" title="Part IX. Migrating from previous version of Clutter">
34
<link rel="part" href="pt10.html" title="Part I. ">
35
<link rel="chapter" href="migrating-ClutterEffect.html" title="Migrating from ClutterEffect">
36
<link rel="chapter" href="migrating-ClutterPath.html" title="Migrating to ClutterPath">
37
<link rel="part" href="clutterobjects.html" title="Part X. Clutter Actors and Objects">
38
<link rel="chapter" href="clutterobjecthierarchy.html" title="Object Hierarchy">
39
<link rel="chapter" href="clutterobjectindex.html" title="Object Index">
40
<link rel="part" href="clutterglossary.html" title="Part XI. Glossaries">
41
<link rel="glossary" href="go01.html" title="Glossary">
42
<link rel="glossary" href="annotation-glossary.html" title="Annotation Glossary">
43
<link rel="index" href="ix01.html" title="Index of all symbols">
44
<link rel="index" href="ix02.html" title="Index of deprecated symbols">
45
<link rel="index" href="ix03.html" title="Index of new symbols in 0.2">
46
<link rel="index" href="ix04.html" title="Index of new symbols in 0.4">
47
<link rel="index" href="ix05.html" title="Index of new symbols in 0.6">
48
<link rel="index" href="ix06.html" title="Index of new symbols in 0.8">
49
<link rel="index" href="ix07.html" title="Index of new symbols in 1.0">
50
<link rel="appendix" href="license.html" title="Appendix A. License">
52
14
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
53
15
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
54
16
<tr valign="middle">
55
17
<td><a accesskey="p" href="clutter-Unit-conversion.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
56
<td><a accesskey="u" href="ch07.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
18
<td><a accesskey="u" href="ch08.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
57
19
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
58
20
<th width="100%" align="center">Clutter Reference Manual</th>
59
<td><a accesskey="n" href="clutter-Versioning-Macros.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
21
<td><a accesskey="n" href="clutter-Features.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
61
23
<tr><td colspan="5" class="shortcuts">
62
24
<a href="#clutter-Utilities.synopsis" class="shortcut">Top</a>
64
<a href="#clutter-Utilities.description" class="shortcut">Description</a>
26
<a href="#clutter-Utilities.description" class="shortcut">Description</a>
67
29
<div class="refentry" title="Utilities">
69
31
<div class="refnamediv"><table width="100%"><tr>
71
33
<h2><span class="refentrytitle"><a name="clutter-Utilities.top_of_page"></a>Utilities</span></h2>
72
<p>Utilities — Misc utility functions.</p>
34
<p>Utilities — Utility functions</p>
74
36
<td valign="top" align="right"></td>
75
37
</tr></table></div>
76
38
<div class="refsynopsisdiv" title="Synopsis">
77
39
<a name="clutter-Utilities.synopsis"></a><h2>Synopsis</h2>
78
<pre class="synopsis">
79
int <a class="link" href="clutter-Utilities.html#clutter-util-next-p2" title="clutter_util_next_p2 ()">clutter_util_next_p2</a> (int a);
81
ClutterTimeoutPool * <a class="link" href="clutter-Utilities.html#clutter-timeout-pool-new" title="clutter_timeout_pool_new ()">clutter_timeout_pool_new</a> (<a
82
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"
85
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
86
>guint</a> <a class="link" href="clutter-Utilities.html#clutter-timeout-pool-add" title="clutter_timeout_pool_add ()">clutter_timeout_pool_add</a> (ClutterTimeoutPool *pool,
88
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
91
href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#GSourceFunc"
92
>GSourceFunc</a> func,
94
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
97
href="http://library.gnome.org/devel/glib/unstable/glib-Datasets.html#GDestroyNotify"
98
>GDestroyNotify</a> notify);
99
void <a class="link" href="clutter-Utilities.html#clutter-timeout-pool-remove" title="clutter_timeout_pool_remove ()">clutter_timeout_pool_remove</a> (ClutterTimeoutPool *pool,
101
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
105
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
106
>guint</a> <a class="link" href="clutter-Utilities.html#clutter-frame-source-add" title="clutter_frame_source_add ()">clutter_frame_source_add</a> (<a
107
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
110
href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#GSourceFunc"
111
>GSourceFunc</a> func,
113
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
116
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
117
>guint</a> <a class="link" href="clutter-Utilities.html#clutter-frame-source-add-full" title="clutter_frame_source_add_full ()">clutter_frame_source_add_full</a> (<a
118
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"
121
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
124
href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#GSourceFunc"
125
>GSourceFunc</a> func,
127
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
130
href="http://library.gnome.org/devel/glib/unstable/glib-Datasets.html#GDestroyNotify"
131
>GDestroyNotify</a> notify);
40
<pre class="synopsis"><span class="returnvalue">gint</span> <a class="link" href="clutter-Utilities.html#clutter-util-next-p2" title="clutter_util_next_p2 ()">clutter_util_next_p2</a> (<em class="parameter"><code><span class="type">gint</span> a</code></em>);
42
<span class="returnvalue">ClutterTimeoutPool</span> * <a class="link" href="clutter-Utilities.html#clutter-timeout-pool-new" title="clutter_timeout_pool_new ()">clutter_timeout_pool_new</a> (<em class="parameter"><code><span class="type">gint</span> priority</code></em>);
43
<span class="returnvalue">guint</span> <a class="link" href="clutter-Utilities.html#clutter-timeout-pool-add" title="clutter_timeout_pool_add ()">clutter_timeout_pool_add</a> (<em class="parameter"><code><span class="type">ClutterTimeoutPool</span> *pool</code></em>,
44
<em class="parameter"><code><span class="type">guint</span> fps</code></em>,
45
<em class="parameter"><code><span class="type">GSourceFunc</span> func</code></em>,
46
<em class="parameter"><code><span class="type">gpointer</span> data</code></em>,
47
<em class="parameter"><code><span class="type">GDestroyNotify</span> notify</code></em>);
48
<span class="returnvalue">void</span> <a class="link" href="clutter-Utilities.html#clutter-timeout-pool-remove" title="clutter_timeout_pool_remove ()">clutter_timeout_pool_remove</a> (<em class="parameter"><code><span class="type">ClutterTimeoutPool</span> *pool</code></em>,
49
<em class="parameter"><code><span class="type">guint</span> id</code></em>);
51
<span class="returnvalue">guint</span> <a class="link" href="clutter-Utilities.html#clutter-frame-source-add" title="clutter_frame_source_add ()">clutter_frame_source_add</a> (<em class="parameter"><code><span class="type">guint</span> fps</code></em>,
52
<em class="parameter"><code><span class="type">GSourceFunc</span> func</code></em>,
53
<em class="parameter"><code><span class="type">gpointer</span> data</code></em>);
54
<span class="returnvalue">guint</span> <a class="link" href="clutter-Utilities.html#clutter-frame-source-add-full" title="clutter_frame_source_add_full ()">clutter_frame_source_add_full</a> (<em class="parameter"><code><span class="type">gint</span> priority</code></em>,
55
<em class="parameter"><code><span class="type">guint</span> fps</code></em>,
56
<em class="parameter"><code><span class="type">GSourceFunc</span> func</code></em>,
57
<em class="parameter"><code><span class="type">gpointer</span> data</code></em>,
58
<em class="parameter"><code><span class="type">GDestroyNotify</span> notify</code></em>);
133
60
<a class="link" href="clutter-Utilities.html#ClutterParamSpecFixed" title="ClutterParamSpecFixed">ClutterParamSpecFixed</a>;
135
href="http://library.gnome.org/devel/gobject/unstable/gobject-GParamSpec.html#GParamSpec"
136
>GParamSpec</a> * <a class="link" href="clutter-Utilities.html#clutter-param-spec-fixed" title="clutter_param_spec_fixed ()">clutter_param_spec_fixed</a> (const <a
137
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"
140
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"
143
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"
146
href="../cogl/cogl-Fixed-Point-API.html#CoglFixed"
147
>CoglFixed</a> minimum,
149
href="../cogl/cogl-Fixed-Point-API.html#CoglFixed"
150
>CoglFixed</a> maximum,
152
href="../cogl/cogl-Fixed-Point-API.html#CoglFixed"
153
>CoglFixed</a> default_value,
155
href="http://library.gnome.org/devel/gobject/unstable/gobject-GParamSpec.html#GParamFlags"
156
>GParamFlags</a> flags);
157
#define <a class="link" href="clutter-Utilities.html#CLUTTER-VALUE-HOLDS-FIXED--CAPS" title="CLUTTER_VALUE_HOLDS_FIXED()">CLUTTER_VALUE_HOLDS_FIXED</a> (x)
158
void <a class="link" href="clutter-Utilities.html#clutter-value-set-fixed" title="clutter_value_set_fixed ()">clutter_value_set_fixed</a> (<a
159
href="http://library.gnome.org/devel/gobject/unstable/gobject-Generic-values.html#GValue"
162
href="../cogl/cogl-Fixed-Point-API.html#CoglFixed"
163
>CoglFixed</a> fixed_);
165
href="../cogl/cogl-Fixed-Point-API.html#CoglFixed"
166
>CoglFixed</a> <a class="link" href="clutter-Utilities.html#clutter-value-get-fixed" title="clutter_value_get_fixed ()">clutter_value_get_fixed</a> (const <a
167
href="http://library.gnome.org/devel/gobject/unstable/gobject-Generic-values.html#GValue"
61
<span class="returnvalue">GParamSpec</span> * <a class="link" href="clutter-Utilities.html#clutter-param-spec-fixed" title="clutter_param_spec_fixed ()">clutter_param_spec_fixed</a> (<em class="parameter"><code>const <span class="type">gchar</span> *name</code></em>,
62
<em class="parameter"><code>const <span class="type">gchar</span> *nick</code></em>,
63
<em class="parameter"><code>const <span class="type">gchar</span> *blurb</code></em>,
64
<em class="parameter"><code><a href="/home/ebassi/clutter/install/share/gtk-doc/html/cogl/cogl-Fixed-Point-API.html#CoglFixed"><span class="type">CoglFixed</span></a> minimum</code></em>,
65
<em class="parameter"><code><a href="/home/ebassi/clutter/install/share/gtk-doc/html/cogl/cogl-Fixed-Point-API.html#CoglFixed"><span class="type">CoglFixed</span></a> maximum</code></em>,
66
<em class="parameter"><code><a href="/home/ebassi/clutter/install/share/gtk-doc/html/cogl/cogl-Fixed-Point-API.html#CoglFixed"><span class="type">CoglFixed</span></a> default_value</code></em>,
67
<em class="parameter"><code><span class="type">GParamFlags</span> flags</code></em>);
68
#define <a class="link" href="clutter-Utilities.html#CLUTTER-VALUE-HOLDS-FIXED:CAPS" title="CLUTTER_VALUE_HOLDS_FIXED()">CLUTTER_VALUE_HOLDS_FIXED</a> (x)
69
<span class="returnvalue">void</span> <a class="link" href="clutter-Utilities.html#clutter-value-set-fixed" title="clutter_value_set_fixed ()">clutter_value_set_fixed</a> (<em class="parameter"><code><span class="type">GValue</span> *value</code></em>,
70
<em class="parameter"><code><a href="/home/ebassi/clutter/install/share/gtk-doc/html/cogl/cogl-Fixed-Point-API.html#CoglFixed"><span class="type">CoglFixed</span></a> fixed_</code></em>);
71
<a href="/home/ebassi/clutter/install/share/gtk-doc/html/cogl/cogl-Fixed-Point-API.html#CoglFixed"><span class="returnvalue">CoglFixed</span></a> <a class="link" href="clutter-Utilities.html#clutter-value-get-fixed" title="clutter_value_get_fixed ()">clutter_value_get_fixed</a> (<em class="parameter"><code>const <span class="type">GValue</span> *value</code></em>);
171
74
<div class="refsect1" title="Description">
172
75
<a name="clutter-Utilities.description"></a><h2>Description</h2>
174
Various misc utilility functions.</p>
77
Various miscellaneous utilility functions.
178
80
<div class="refsect1" title="Details">
179
81
<a name="clutter-Utilities.details"></a><h2>Details</h2>
180
82
<div class="refsect2" title="clutter_util_next_p2 ()">
181
83
<a name="clutter-util-next-p2"></a><h3>clutter_util_next_p2 ()</h3>
182
<pre class="programlisting">int clutter_util_next_p2 (int a);</pre>
184
Calculates the nearest power of two, greater than or equal to <em class="parameter"><code>a</code></em>.</p>
84
<pre class="programlisting"><span class="returnvalue">gint</span> clutter_util_next_p2 (<em class="parameter"><code><span class="type">gint</span> a</code></em>);</pre>
85
<div class="warning" title="Warning" style="margin-left: 0.5in; margin-right: 0.5in;">
86
<h3 class="title">Warning</h3>
87
<p><code class="literal">clutter_util_next_p2</code> is deprecated and should not be used in newly-written code. 1.2</p>
90
Calculates the nearest power of two, greater than or equal to <em class="parameter"><code>a</code></em>.
187
92
<div class="variablelist"><table border="0">
188
93
<col align="left" valign="top">
191
96
<td><p><span class="term"><em class="parameter"><code>a</code></em> :</span></p></td>
192
<td> Value to get the next power
97
<td>Value to get the next power
196
101
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
197
102
<td> The nearest power of two, greater or equal to <em class="parameter"><code>a</code></em>.
204
110
<div class="refsect2" title="clutter_timeout_pool_new ()">
205
111
<a name="clutter-timeout-pool-new"></a><h3>clutter_timeout_pool_new ()</h3>
206
<pre class="programlisting">ClutterTimeoutPool * clutter_timeout_pool_new (<a
207
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"
208
>gint</a> priority);</pre>
112
<pre class="programlisting"><span class="returnvalue">ClutterTimeoutPool</span> * clutter_timeout_pool_new (<em class="parameter"><code><span class="type">gint</span> priority</code></em>);</pre>
210
114
Creates a new timeout pool source. A timeout pool should be used when
211
115
multiple timeout functions, running at the same priority, are needed and
213
href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#g-timeout-add"
214
><code class="function">g_timeout_add()</code></a> API might lead to starvation of the time slice of
116
the <code class="function">g_timeout_add()</code> API might lead to starvation of the time slice of
215
117
the main loop. A timeout pool allocates a single time slice of the main
216
118
loop and runs every timeout function inside it. The timeout pool is
217
119
always sorted, so that the extraction of the next timeout function is
218
120
a constant time operation.
221
Inside Clutter, every <a class="link" href="ClutterTimeline.html" title="ClutterTimeline"><span class="type">ClutterTimeline</span></a> share the same timeout pool, unless
222
the CLUTTER_TIMELINE=no-pool environment variable is set.
225
<span class="type">ClutterTimeoutPool</span> is part of the <a class="link" href="ClutterTimeline.html" title="ClutterTimeline"><span class="type">ClutterTimeline</span></a> implementation
226
and should not be used by application developers.</p>
229
122
<div class="variablelist"><table border="0">
230
123
<col align="left" valign="top">
233
126
<td><p><span class="term"><em class="parameter"><code>priority</code></em> :</span></p></td>
234
<td> the priority of the timeout pool. Typically this will
236
href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#G-PRIORITY-DEFAULT--CAPS"
237
><span class="type">G_PRIORITY_DEFAULT</span></a>
127
<td>the priority of the timeout pool. Typically this will
128
be <span class="type">G_PRIORITY_DEFAULT</span>
256
145
<div class="refsect2" title="clutter_timeout_pool_add ()">
257
146
<a name="clutter-timeout-pool-add"></a><h3>clutter_timeout_pool_add ()</h3>
258
<pre class="programlisting"><a
259
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
260
>guint</a> clutter_timeout_pool_add (ClutterTimeoutPool *pool,
262
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
265
href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#GSourceFunc"
266
>GSourceFunc</a> func,
268
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
271
href="http://library.gnome.org/devel/glib/unstable/glib-Datasets.html#GDestroyNotify"
272
>GDestroyNotify</a> notify);</pre>
147
<pre class="programlisting"><span class="returnvalue">guint</span> clutter_timeout_pool_add (<em class="parameter"><code><span class="type">ClutterTimeoutPool</span> *pool</code></em>,
148
<em class="parameter"><code><span class="type">guint</span> fps</code></em>,
149
<em class="parameter"><code><span class="type">GSourceFunc</span> func</code></em>,
150
<em class="parameter"><code><span class="type">gpointer</span> data</code></em>,
151
<em class="parameter"><code><span class="type">GDestroyNotify</span> notify</code></em>);</pre>
274
153
Sets a function to be called at regular intervals, and puts it inside
275
the <em class="parameter"><code>pool</code></em>. The function is repeatedly called until it returns <a
276
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE--CAPS"
277
><code class="literal">FALSE</code></a>,
154
the <em class="parameter"><code>pool</code></em>. The function is repeatedly called until it returns <code class="literal">FALSE</code>,
278
155
at which point the timeout is automatically destroyed and the function
279
won't be called again. If <em class="parameter"><code>notify</code></em> is not <a
280
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL--CAPS"
281
><code class="literal">NULL</code></a>, the <em class="parameter"><code>notify</code></em> function
156
won't be called again. If <em class="parameter"><code>notify</code></em> is not <code class="literal">NULL</code>, the <em class="parameter"><code>notify</code></em> function
282
157
will be called. The first call to <em class="parameter"><code>func</code></em> will be at the end of <em class="parameter"><code>interval</code></em>.
285
Since version 0.8 this will try to compensate for delays. For
160
Since Clutter 0.8 this will try to compensate for delays. For
286
161
example, if <em class="parameter"><code>func</code></em> takes half the interval time to execute then the
287
162
function will be called again half the interval time after it
288
163
finished. Before version 0.8 it would not fire until a full
289
164
interval after the function completes so the delay between calls
290
165
would be <em class="parameter"><code>interval</code></em> * 1.5. This function does not however try to
291
166
invoke the function multiple times to catch up missing frames if
292
<em class="parameter"><code>func</code></em> takes more than <em class="parameter"><code>interval</code></em> ms to execute.</p>
167
<em class="parameter"><code>func</code></em> takes more than <em class="parameter"><code>interval</code></em> ms to execute.
295
169
<div class="variablelist"><table border="0">
296
170
<col align="left" valign="top">
299
173
<td><p><span class="term"><em class="parameter"><code>pool</code></em> :</span></p></td>
300
<td> a <span class="type">ClutterTimeoutPool</span>
174
<td>a <span class="type">ClutterTimeoutPool</span>
304
178
<td><p><span class="term"><em class="parameter"><code>fps</code></em> :</span></p></td>
305
<td> the time between calls to the function, in frames per second
179
<td>the time between calls to the function, in frames per second
309
183
<td><p><span class="term"><em class="parameter"><code>func</code></em> :</span></p></td>
310
<td> function to call
314
188
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
315
<td> data to pass to the function, or <a
316
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL--CAPS"
317
><code class="literal">NULL</code></a>
189
<td>data to pass to the function, or <code class="literal">NULL</code>
321
193
<td><p><span class="term"><em class="parameter"><code>notify</code></em> :</span></p></td>
322
<td> function to call when the timeout is removed, or <a
323
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL--CAPS"
324
><code class="literal">NULL</code></a>
194
<td>function to call when the timeout is removed, or <code class="literal">NULL</code>
369
236
<div class="refsect2" title="clutter_frame_source_add ()">
370
237
<a name="clutter-frame-source-add"></a><h3>clutter_frame_source_add ()</h3>
371
<pre class="programlisting"><a
372
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
373
>guint</a> clutter_frame_source_add (<a
374
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
377
href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#GSourceFunc"
378
>GSourceFunc</a> func,
380
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
381
>gpointer</a> data);</pre>
383
Simple wrapper around <a class="link" href="clutter-Utilities.html#clutter-frame-source-add-full" title="clutter_frame_source_add_full ()"><code class="function">clutter_frame_source_add_full()</code></a>.</p>
238
<pre class="programlisting"><span class="returnvalue">guint</span> clutter_frame_source_add (<em class="parameter"><code><span class="type">guint</span> fps</code></em>,
239
<em class="parameter"><code><span class="type">GSourceFunc</span> func</code></em>,
240
<em class="parameter"><code><span class="type">gpointer</span> data</code></em>);</pre>
242
Simple wrapper around <a class="link" href="clutter-Utilities.html#clutter-frame-source-add-full" title="clutter_frame_source_add_full ()"><code class="function">clutter_frame_source_add_full()</code></a>.
386
244
<div class="variablelist"><table border="0">
387
245
<col align="left" valign="top">
390
248
<td><p><span class="term"><em class="parameter"><code>fps</code></em> :</span></p></td>
391
<td> the number of times per second to call the function
249
<td>the number of times per second to call the function
395
253
<td><p><span class="term"><em class="parameter"><code>func</code></em> :</span></p></td>
396
<td> function to call
400
258
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
401
<td> data to pass to the function
259
<td>data to pass to the function
415
273
<div class="refsect2" title="clutter_frame_source_add_full ()">
416
274
<a name="clutter-frame-source-add-full"></a><h3>clutter_frame_source_add_full ()</h3>
417
<pre class="programlisting"><a
418
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
419
>guint</a> clutter_frame_source_add_full (<a
420
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"
423
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
426
href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#GSourceFunc"
427
>GSourceFunc</a> func,
429
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
432
href="http://library.gnome.org/devel/glib/unstable/glib-Datasets.html#GDestroyNotify"
433
>GDestroyNotify</a> notify);</pre>
275
<pre class="programlisting"><span class="returnvalue">guint</span> clutter_frame_source_add_full (<em class="parameter"><code><span class="type">gint</span> priority</code></em>,
276
<em class="parameter"><code><span class="type">guint</span> fps</code></em>,
277
<em class="parameter"><code><span class="type">GSourceFunc</span> func</code></em>,
278
<em class="parameter"><code><span class="type">gpointer</span> data</code></em>,
279
<em class="parameter"><code><span class="type">GDestroyNotify</span> notify</code></em>);</pre>
435
281
Sets a function to be called at regular intervals with the given
436
282
priority. The function is called repeatedly until it returns
438
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE--CAPS"
439
><code class="literal">FALSE</code></a>, at which point the timeout is automatically destroyed and
283
<code class="literal">FALSE</code>, at which point the timeout is automatically destroyed and
440
284
the function will not be called again. The <em class="parameter"><code>notify</code></em> function is
441
285
called when the timeout is destroyed. The first call to the
442
286
function will be at the end of the first <em class="parameter"><code>interval</code></em>.
445
This function is similar to <a
446
href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#g-timeout-add-full"
447
><code class="function">g_timeout_add_full()</code></a> except that it
289
This function is similar to <code class="function">g_timeout_add_full()</code> except that it
448
290
will try to compensate for delays. For example, if <em class="parameter"><code>func</code></em> takes half
449
291
the interval time to execute then the function will be called again
450
292
half the interval time after it finished. In contrast
452
href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#g-timeout-add-full"
453
><code class="function">g_timeout_add_full()</code></a> would not fire until a full interval after the
293
<code class="function">g_timeout_add_full()</code> would not fire until a full interval after the
454
294
function completes so the delay between calls would be 1.0 / <em class="parameter"><code>fps</code></em> *
455
295
1.5. This function does not however try to invoke the function
456
296
multiple times to catch up missing frames if <em class="parameter"><code>func</code></em> takes more than
457
<em class="parameter"><code>interval</code></em> ms to execute.</p>
297
<em class="parameter"><code>interval</code></em> ms to execute.
460
299
<div class="variablelist"><table border="0">
461
300
<col align="left" valign="top">
464
303
<td><p><span class="term"><em class="parameter"><code>priority</code></em> :</span></p></td>
465
<td> the priority of the frame source. Typically this will be in the
467
href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#G-PRIORITY-DEFAULT--CAPS"
468
><span class="type">G_PRIORITY_DEFAULT</span></a> and <a
469
href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#G-PRIORITY-HIGH--CAPS"
470
><span class="type">G_PRIORITY_HIGH</span></a>.
304
<td>the priority of the frame source. Typically this will be in the
305
range between <code class="literal">G_PRIORITY_DEFAULT</code> and <code class="literal">G_PRIORITY_HIGH</code>.
474
309
<td><p><span class="term"><em class="parameter"><code>fps</code></em> :</span></p></td>
475
<td> the number of times per second to call the function
310
<td>the number of times per second to call the function
479
314
<td><p><span class="term"><em class="parameter"><code>func</code></em> :</span></p></td>
480
<td> function to call
484
319
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
485
<td> data to pass to the function
320
<td>data to pass to the function
489
324
<td><p><span class="term"><em class="parameter"><code>notify</code></em> :</span></p></td>
490
<td> function to call when the timeout source is removed
325
<td>function to call when the timeout source is removed
547
373
<div class="refsect2" title="clutter_param_spec_fixed ()">
548
374
<a name="clutter-param-spec-fixed"></a><h3>clutter_param_spec_fixed ()</h3>
549
<pre class="programlisting"><a
550
href="http://library.gnome.org/devel/gobject/unstable/gobject-GParamSpec.html#GParamSpec"
551
>GParamSpec</a> * clutter_param_spec_fixed (const <a
552
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"
555
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"
558
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"
561
href="../cogl/cogl-Fixed-Point-API.html#CoglFixed"
562
>CoglFixed</a> minimum,
564
href="../cogl/cogl-Fixed-Point-API.html#CoglFixed"
565
>CoglFixed</a> maximum,
567
href="../cogl/cogl-Fixed-Point-API.html#CoglFixed"
568
>CoglFixed</a> default_value,
570
href="http://library.gnome.org/devel/gobject/unstable/gobject-GParamSpec.html#GParamFlags"
571
>GParamFlags</a> flags);</pre>
574
href="http://library.gnome.org/devel/gobject/unstable/gobject-GParamSpec.html#GParamSpec"
575
><span class="type">GParamSpec</span></a> for properties using <a
576
href="../cogl/cogl-Fixed-Point-API.html#CoglFixed"
577
><span class="type">CoglFixed</span></a> values</p>
375
<pre class="programlisting"><span class="returnvalue">GParamSpec</span> * clutter_param_spec_fixed (<em class="parameter"><code>const <span class="type">gchar</span> *name</code></em>,
376
<em class="parameter"><code>const <span class="type">gchar</span> *nick</code></em>,
377
<em class="parameter"><code>const <span class="type">gchar</span> *blurb</code></em>,
378
<em class="parameter"><code><a href="/home/ebassi/clutter/install/share/gtk-doc/html/cogl/cogl-Fixed-Point-API.html#CoglFixed"><span class="type">CoglFixed</span></a> minimum</code></em>,
379
<em class="parameter"><code><a href="/home/ebassi/clutter/install/share/gtk-doc/html/cogl/cogl-Fixed-Point-API.html#CoglFixed"><span class="type">CoglFixed</span></a> maximum</code></em>,
380
<em class="parameter"><code><a href="/home/ebassi/clutter/install/share/gtk-doc/html/cogl/cogl-Fixed-Point-API.html#CoglFixed"><span class="type">CoglFixed</span></a> default_value</code></em>,
381
<em class="parameter"><code><span class="type">GParamFlags</span> flags</code></em>);</pre>
383
Creates a <span class="type">GParamSpec</span> for properties using <a href="/home/ebassi/clutter/install/share/gtk-doc/html/cogl/cogl-Fixed-Point-API.html#CoglFixed"><span class="type">CoglFixed</span></a> values
580
385
<div class="variablelist"><table border="0">
581
386
<col align="left" valign="top">
584
389
<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
585
<td> name of the property
390
<td>name of the property
589
394
<td><p><span class="term"><em class="parameter"><code>nick</code></em> :</span></p></td>
594
399
<td><p><span class="term"><em class="parameter"><code>blurb</code></em> :</span></p></td>
595
<td> description (can be translatable)
400
<td>description (can be translatable)
599
404
<td><p><span class="term"><em class="parameter"><code>minimum</code></em> :</span></p></td>
604
409
<td><p><span class="term"><em class="parameter"><code>maximum</code></em> :</span></p></td>
609
414
<td><p><span class="term"><em class="parameter"><code>default_value</code></em> :</span></p></td>
614
419
<td><p><span class="term"><em class="parameter"><code>flags</code></em> :</span></p></td>
615
<td> flags for the param spec
420
<td>flags for the param spec
619
424
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
620
<td> the newly created <a
621
href="http://library.gnome.org/devel/gobject/unstable/gobject-GParamSpec.html#GParamSpec"
622
><span class="type">GParamSpec</span></a>
425
<td> the newly created <span class="type">GParamSpec</span>
688
477
<div class="refsect2" title="clutter_value_get_fixed ()">
689
478
<a name="clutter-value-get-fixed"></a><h3>clutter_value_get_fixed ()</h3>
690
<pre class="programlisting"><a
691
href="../cogl/cogl-Fixed-Point-API.html#CoglFixed"
692
>CoglFixed</a> clutter_value_get_fixed (const <a
693
href="http://library.gnome.org/devel/gobject/unstable/gobject-Generic-values.html#GValue"
694
>GValue</a> *value);</pre>
696
Gets the fixed point value stored inside <em class="parameter"><code>value</code></em>.</p>
479
<pre class="programlisting"><a href="/home/ebassi/clutter/install/share/gtk-doc/html/cogl/cogl-Fixed-Point-API.html#CoglFixed"><span class="returnvalue">CoglFixed</span></a> clutter_value_get_fixed (<em class="parameter"><code>const <span class="type">GValue</span> *value</code></em>);</pre>
481
Gets the fixed point value stored inside <em class="parameter"><code>value</code></em>.
699
483
<div class="variablelist"><table border="0">
700
484
<col align="left" valign="top">
703
487
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
705
href="http://library.gnome.org/devel/gobject/unstable/gobject-Generic-values.html#GValue"
706
><span class="type">GValue</span></a> initialized to <code class="literal">COGL_TYPE_FIXED</code>
488
<td>a <span class="type">GValue</span> initialized to <code class="literal">COGL_TYPE_FIXED</code>
710
492
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
711
<td> the value inside the passed <a
712
href="http://library.gnome.org/devel/gobject/unstable/gobject-Generic-values.html#GValue"
713
><span class="type">GValue</span></a>
493
<td> the value inside the passed <span class="type">GValue</span>