1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <title>ClutterBehaviour</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
7 <link rel="home" href="index.html" title="Clutter Reference Manual">
8 <link rel="up" href="deprecated.html" title="Part X. Deprecated Classes">
9 <link rel="prev" href="clutter-Shaders.html" title="Shaders">
10 <link rel="next" href="ClutterBehaviourDepth.html" title="ClutterBehaviourDepth">
11 <meta name="generator" content="GTK-Doc V1.18.1 (XML mode)">
12 <link rel="stylesheet" href="style.css" type="text/css">
14 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
17 <td><a accesskey="p" href="clutter-Shaders.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
18 <td><a accesskey="u" href="deprecated.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
19 <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
20 <th width="100%" align="center">Clutter Reference Manual</th>
21 <td><a accesskey="n" href="ClutterBehaviourDepth.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
23 <tr><td colspan="5" class="shortcuts">
24 <a href="#ClutterBehaviour.synopsis" class="shortcut">Top</a>
26 <a href="#ClutterBehaviour.description" class="shortcut">Description</a>
28 <a href="#ClutterBehaviour.object-hierarchy" class="shortcut">Object Hierarchy</a>
30 <a href="#ClutterBehaviour.implemented-interfaces" class="shortcut">Implemented Interfaces</a>
32 <a href="#ClutterBehaviour.properties" class="shortcut">Properties</a>
34 <a href="#ClutterBehaviour.signals" class="shortcut">Signals</a>
37 <div class="refentry">
38 <a name="ClutterBehaviour"></a><div class="titlepage"></div>
39 <div class="refnamediv"><table width="100%"><tr>
41 <h2><span class="refentrytitle"><a name="ClutterBehaviour.top_of_page"></a>ClutterBehaviour</span></h2>
42 <p>ClutterBehaviour — Class for providing behaviours to actors</p>
44 <td valign="top" align="right"></td>
46 <div class="refsynopsisdiv">
47 <a name="ClutterBehaviour.synopsis"></a><h2>Synopsis</h2>
48 <pre class="synopsis"> <a class="link" href="ClutterBehaviour.html#ClutterBehaviour-struct" title="ClutterBehaviour">ClutterBehaviour</a>;
49 struct <a class="link" href="ClutterBehaviour.html#ClutterBehaviourClass" title="struct ClutterBehaviourClass">ClutterBehaviourClass</a>;
50 <span class="returnvalue">void</span> <a class="link" href="ClutterBehaviour.html#clutter-behaviour-apply" title="clutter_behaviour_apply ()">clutter_behaviour_apply</a> (<em class="parameter"><code><a class="link" href="ClutterBehaviour.html" title="ClutterBehaviour"><span class="type">ClutterBehaviour</span></a> *behave</code></em>,
51 <em class="parameter"><code><a class="link" href="ClutterActor.html" title="ClutterActor"><span class="type">ClutterActor</span></a> *actor</code></em>);
52 <span class="returnvalue">void</span> <a class="link" href="ClutterBehaviour.html#clutter-behaviour-remove" title="clutter_behaviour_remove ()">clutter_behaviour_remove</a> (<em class="parameter"><code><a class="link" href="ClutterBehaviour.html" title="ClutterBehaviour"><span class="type">ClutterBehaviour</span></a> *behave</code></em>,
53 <em class="parameter"><code><a class="link" href="ClutterActor.html" title="ClutterActor"><span class="type">ClutterActor</span></a> *actor</code></em>);
54 <span class="returnvalue">void</span> <a class="link" href="ClutterBehaviour.html#clutter-behaviour-remove-all" title="clutter_behaviour_remove_all ()">clutter_behaviour_remove_all</a> (<em class="parameter"><code><a class="link" href="ClutterBehaviour.html" title="ClutterBehaviour"><span class="type">ClutterBehaviour</span></a> *behave</code></em>);
55 <span class="returnvalue">gboolean</span> <a class="link" href="ClutterBehaviour.html#clutter-behaviour-is-applied" title="clutter_behaviour_is_applied ()">clutter_behaviour_is_applied</a> (<em class="parameter"><code><a class="link" href="ClutterBehaviour.html" title="ClutterBehaviour"><span class="type">ClutterBehaviour</span></a> *behave</code></em>,
56 <em class="parameter"><code><a class="link" href="ClutterActor.html" title="ClutterActor"><span class="type">ClutterActor</span></a> *actor</code></em>);
57 <span class="returnvalue">void</span> (<a class="link" href="ClutterBehaviour.html#ClutterBehaviourForeachFunc" title="ClutterBehaviourForeachFunc ()">*ClutterBehaviourForeachFunc</a>) (<em class="parameter"><code><a class="link" href="ClutterBehaviour.html" title="ClutterBehaviour"><span class="type">ClutterBehaviour</span></a> *behaviour</code></em>,
58 <em class="parameter"><code><a class="link" href="ClutterActor.html" title="ClutterActor"><span class="type">ClutterActor</span></a> *actor</code></em>,
59 <em class="parameter"><code><span class="type">gpointer</span> data</code></em>);
60 <span class="returnvalue">void</span> <a class="link" href="ClutterBehaviour.html#clutter-behaviour-actors-foreach" title="clutter_behaviour_actors_foreach ()">clutter_behaviour_actors_foreach</a> (<em class="parameter"><code><a class="link" href="ClutterBehaviour.html" title="ClutterBehaviour"><span class="type">ClutterBehaviour</span></a> *behave</code></em>,
61 <em class="parameter"><code><a class="link" href="ClutterBehaviour.html#ClutterBehaviourForeachFunc" title="ClutterBehaviourForeachFunc ()"><span class="type">ClutterBehaviourForeachFunc</span></a> func</code></em>,
62 <em class="parameter"><code><span class="type">gpointer</span> data</code></em>);
63 <span class="returnvalue">GSList</span> * <a class="link" href="ClutterBehaviour.html#clutter-behaviour-get-actors" title="clutter_behaviour_get_actors ()">clutter_behaviour_get_actors</a> (<em class="parameter"><code><a class="link" href="ClutterBehaviour.html" title="ClutterBehaviour"><span class="type">ClutterBehaviour</span></a> *behave</code></em>);
64 <span class="returnvalue">gint</span> <a class="link" href="ClutterBehaviour.html#clutter-behaviour-get-n-actors" title="clutter_behaviour_get_n_actors ()">clutter_behaviour_get_n_actors</a> (<em class="parameter"><code><a class="link" href="ClutterBehaviour.html" title="ClutterBehaviour"><span class="type">ClutterBehaviour</span></a> *behave</code></em>);
65 <a class="link" href="ClutterActor.html" title="ClutterActor"><span class="returnvalue">ClutterActor</span></a> * <a class="link" href="ClutterBehaviour.html#clutter-behaviour-get-nth-actor" title="clutter_behaviour_get_nth_actor ()">clutter_behaviour_get_nth_actor</a> (<em class="parameter"><code><a class="link" href="ClutterBehaviour.html" title="ClutterBehaviour"><span class="type">ClutterBehaviour</span></a> *behave</code></em>,
66 <em class="parameter"><code><span class="type">gint</span> index_</code></em>);
67 <a class="link" href="ClutterAlpha.html" title="ClutterAlpha"><span class="returnvalue">ClutterAlpha</span></a> * <a class="link" href="ClutterBehaviour.html#clutter-behaviour-get-alpha" title="clutter_behaviour_get_alpha ()">clutter_behaviour_get_alpha</a> (<em class="parameter"><code><a class="link" href="ClutterBehaviour.html" title="ClutterBehaviour"><span class="type">ClutterBehaviour</span></a> *behave</code></em>);
68 <span class="returnvalue">void</span> <a class="link" href="ClutterBehaviour.html#clutter-behaviour-set-alpha" title="clutter_behaviour_set_alpha ()">clutter_behaviour_set_alpha</a> (<em class="parameter"><code><a class="link" href="ClutterBehaviour.html" title="ClutterBehaviour"><span class="type">ClutterBehaviour</span></a> *behave</code></em>,
69 <em class="parameter"><code><a class="link" href="ClutterAlpha.html" title="ClutterAlpha"><span class="type">ClutterAlpha</span></a> *alpha</code></em>);
72 <div class="refsect1">
73 <a name="ClutterBehaviour.object-hierarchy"></a><h2>Object Hierarchy</h2>
74 <pre class="synopsis">
77 +----<a class="link" href="ClutterBehaviourDepth.html" title="ClutterBehaviourDepth">ClutterBehaviourDepth</a>
78 +----<a class="link" href="ClutterBehaviourEllipse.html" title="ClutterBehaviourEllipse">ClutterBehaviourEllipse</a>
79 +----<a class="link" href="ClutterBehaviourOpacity.html" title="ClutterBehaviourOpacity">ClutterBehaviourOpacity</a>
80 +----<a class="link" href="ClutterBehaviourPath.html" title="ClutterBehaviourPath">ClutterBehaviourPath</a>
81 +----<a class="link" href="ClutterBehaviourRotate.html" title="ClutterBehaviourRotate">ClutterBehaviourRotate</a>
82 +----<a class="link" href="ClutterBehaviourScale.html" title="ClutterBehaviourScale">ClutterBehaviourScale</a>
85 <div class="refsect1">
86 <a name="ClutterBehaviour.implemented-interfaces"></a><h2>Implemented Interfaces</h2>
88 ClutterBehaviour implements
89 <a class="link" href="ClutterScriptable.html" title="ClutterScriptable">ClutterScriptable</a>.</p>
91 <div class="refsect1">
92 <a name="ClutterBehaviour.properties"></a><h2>Properties</h2>
93 <pre class="synopsis">
94 "<a class="link" href="ClutterBehaviour.html#ClutterBehaviour--alpha" title='The "alpha" property'>alpha</a>" <a class="link" href="ClutterAlpha.html" title="ClutterAlpha"><span class="type">ClutterAlpha</span></a>* : Read / Write
97 <div class="refsect1">
98 <a name="ClutterBehaviour.signals"></a><h2>Signals</h2>
99 <pre class="synopsis">
100 "<a class="link" href="ClutterBehaviour.html#ClutterBehaviour-applied" title='The "applied" signal'>applied</a>" : <code class="literal">Run First</code>
101 "<a class="link" href="ClutterBehaviour.html#ClutterBehaviour-removed" title='The "removed" signal'>removed</a>" : <code class="literal">Run First</code>
104 <div class="refsect1">
105 <a name="ClutterBehaviour.description"></a><h2>Description</h2>
107 <a class="link" href="ClutterBehaviour.html" title="ClutterBehaviour"><span class="type">ClutterBehaviour</span></a> is the base class for implementing behaviours. A
108 behaviour is a controller object for <a class="link" href="ClutterActor.html" title="ClutterActor"><span class="type">ClutterActor</span></a>s; you can
109 use a behaviour to control one or more properties of an actor (such
110 as its opacity, or its position). A <a class="link" href="ClutterBehaviour.html" title="ClutterBehaviour"><span class="type">ClutterBehaviour</span></a> is driven by
111 an "alpha function" stored inside a <a class="link" href="ClutterAlpha.html" title="ClutterAlpha"><span class="type">ClutterAlpha</span></a> object; an alpha
112 function is a function depending solely on time. The alpha function
113 computes a value which is then applied to the properties of the
114 actors driven by a behaviour.
117 Clutter provides some pre-defined behaviours, like <a class="link" href="ClutterBehaviourPath.html" title="ClutterBehaviourPath"><span class="type">ClutterBehaviourPath</span></a>,
118 which controls the position of a set of actors making them "walk" along
119 a set of nodes; <a class="link" href="ClutterBehaviourOpacity.html" title="ClutterBehaviourOpacity"><span class="type">ClutterBehaviourOpacity</span></a>, which controls the opacity
120 of a set of actors; <a class="link" href="ClutterBehaviourScale.html" title="ClutterBehaviourScale"><span class="type">ClutterBehaviourScale</span></a>, which controls the width
121 and height of a set of actors.
124 To visualize the effects of different alpha functions on a
125 <a class="link" href="ClutterBehaviour.html" title="ClutterBehaviour"><span class="type">ClutterBehaviour</span></a> implementation it is possible to take the
126 <a class="link" href="ClutterBehaviourPath.html" title="ClutterBehaviourPath"><span class="type">ClutterBehaviourPath</span></a> as an example:
131 <a name="behaviour-path-alpha"></a><p class="title"><b>Figure 10. Effects of alpha functions on a path</b></p>
132 <div class="figure-contents"><div><img src="path-alpha-func.png" alt="Effects of alpha functions on a path"></div></div>
134 <p><br class="figure-break">
137 The actors position between the path's end points directly correlates
138 to the <a class="link" href="ClutterAlpha.html" title="ClutterAlpha"><span class="type">ClutterAlpha</span></a>'s current alpha value driving the behaviour. With
139 the <a class="link" href="ClutterAlpha.html" title="ClutterAlpha"><span class="type">ClutterAlpha</span></a>'s function set to a linear ramp the actor
140 will follow the path at a constant velocity, but when changing to
141 a sine wave the actor initially accelerates before quickly
145 In order to implement a new behaviour you should subclass <a class="link" href="ClutterBehaviour.html" title="ClutterBehaviour"><span class="type">ClutterBehaviour</span></a>
146 and override the "alpha_notify" virtual function; inside the overridden
147 function you should obtain the alpha value from the <a class="link" href="ClutterAlpha.html" title="ClutterAlpha"><span class="type">ClutterAlpha</span></a>
148 instance bound to the behaviour and apply it to the desiderd property
149 (or properties) of every actor controlled by the behaviour.
152 <a class="link" href="ClutterBehaviour.html" title="ClutterBehaviour"><span class="type">ClutterBehaviour</span></a> is available since Clutter 0.2.
155 <a class="link" href="ClutterBehaviour.html" title="ClutterBehaviour"><span class="type">ClutterBehaviour</span></a> and its sub-classes have been deprecated since Clutter
156 1.6. You should see <a class="link" href="migrating-ClutterBehaviour.html" title="Migrating from ClutterBehaviour">the
157 migration guide</a> for more information on migrating code from using
158 the <a class="link" href="ClutterBehaviour.html" title="ClutterBehaviour"><span class="type">ClutterBehaviour</span></a> API to the animation framework API.
161 <div class="refsect1">
162 <a name="ClutterBehaviour.details"></a><h2>Details</h2>
163 <div class="refsect2">
164 <a name="ClutterBehaviour-struct"></a><h3>ClutterBehaviour</h3>
165 <pre class="programlisting">typedef struct _ClutterBehaviour ClutterBehaviour;</pre>
166 <div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
167 <h3 class="title">Warning</h3>
168 <p><code class="literal">ClutterBehaviour</code> is deprecated and should not be used in newly-written code. 1.6</p>
171 <a class="link" href="ClutterBehaviour.html#ClutterBehaviour-struct" title="ClutterBehaviour"><span class="type">ClutterBehaviour</span></a> contains only private data and should
172 be accessed with the functions below.
174 <p class="since">Since 0.2</p>
177 <div class="refsect2">
178 <a name="ClutterBehaviourClass"></a><h3>struct ClutterBehaviourClass</h3>
179 <pre class="programlisting">struct ClutterBehaviourClass {
180 /* vfunc, not signal */
181 void (*alpha_notify) (ClutterBehaviour *behave,
182 gdouble alpha_value);
185 void (*applied) (ClutterBehaviour *behave,
186 ClutterActor *actor);
187 void (*removed) (ClutterBehaviour *behave,
188 ClutterActor *actor);
191 <div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
192 <h3 class="title">Warning</h3>
193 <p><code class="literal">ClutterBehaviourClass</code> is deprecated and should not be used in newly-written code. 1.6</p>
196 Base class for behaviours.
198 <div class="variablelist"><table border="0">
199 <col align="left" valign="top">
202 <td><p><span class="term"><em class="structfield"><code><a name="ClutterBehaviourClass.alpha-notify"></a>alpha_notify</code></em> ()</span></p></td>
203 <td>virtual function, called each time the <a class="link" href="ClutterAlpha.html" title="ClutterAlpha"><span class="type">ClutterAlpha</span></a>
204 computes a new alpha value; the actors to which the behaviour applies
205 should be changed in this function. Every subclass of <a class="link" href="ClutterBehaviour.html" title="ClutterBehaviour"><span class="type">ClutterBehaviour</span></a>
206 must implement this virtual function</td>
209 <td><p><span class="term"><em class="structfield"><code><a name="ClutterBehaviourClass.applied"></a>applied</code></em> ()</span></p></td>
210 <td>signal class handler for the ClutterBehaviour::applied signal</td>
213 <td><p><span class="term"><em class="structfield"><code><a name="ClutterBehaviourClass.removed"></a>removed</code></em> ()</span></p></td>
214 <td>signal class handler for the ClutterBehaviour::removed signal</td>
218 <p class="since">Since 0.2</p>
221 <div class="refsect2">
222 <a name="clutter-behaviour-apply"></a><h3>clutter_behaviour_apply ()</h3>
223 <pre class="programlisting"><span class="returnvalue">void</span> clutter_behaviour_apply (<em class="parameter"><code><a class="link" href="ClutterBehaviour.html" title="ClutterBehaviour"><span class="type">ClutterBehaviour</span></a> *behave</code></em>,
224 <em class="parameter"><code><a class="link" href="ClutterActor.html" title="ClutterActor"><span class="type">ClutterActor</span></a> *actor</code></em>);</pre>
225 <div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
226 <h3 class="title">Warning</h3>
227 <p><code class="literal">clutter_behaviour_apply</code> is deprecated and should not be used in newly-written code. 1.6</p>
230 Applies <em class="parameter"><code>behave</code></em> to <em class="parameter"><code>actor</code></em>. This function adds a reference on
233 <div class="variablelist"><table border="0">
234 <col align="left" valign="top">
237 <td><p><span class="term"><em class="parameter"><code>behave</code></em> :</span></p></td>
238 <td>a <a class="link" href="ClutterBehaviour.html" title="ClutterBehaviour"><span class="type">ClutterBehaviour</span></a>
242 <td><p><span class="term"><em class="parameter"><code>actor</code></em> :</span></p></td>
243 <td>a <a class="link" href="ClutterActor.html" title="ClutterActor"><span class="type">ClutterActor</span></a>
248 <p class="since">Since 0.2</p>
251 <div class="refsect2">
252 <a name="clutter-behaviour-remove"></a><h3>clutter_behaviour_remove ()</h3>
253 <pre class="programlisting"><span class="returnvalue">void</span> clutter_behaviour_remove (<em class="parameter"><code><a class="link" href="ClutterBehaviour.html" title="ClutterBehaviour"><span class="type">ClutterBehaviour</span></a> *behave</code></em>,
254 <em class="parameter"><code><a class="link" href="ClutterActor.html" title="ClutterActor"><span class="type">ClutterActor</span></a> *actor</code></em>);</pre>
255 <div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
256 <h3 class="title">Warning</h3>
257 <p><code class="literal">clutter_behaviour_remove</code> is deprecated and should not be used in newly-written code. 1.6</p>
260 Removes <em class="parameter"><code>actor</code></em> from the list of <a class="link" href="ClutterActor.html" title="ClutterActor"><span class="type">ClutterActor</span></a>s to which
261 <em class="parameter"><code>behave</code></em> applies. This function removes a reference on the actor.
263 <div class="variablelist"><table border="0">
264 <col align="left" valign="top">
267 <td><p><span class="term"><em class="parameter"><code>behave</code></em> :</span></p></td>
268 <td>a <a class="link" href="ClutterBehaviour.html" title="ClutterBehaviour"><span class="type">ClutterBehaviour</span></a>
272 <td><p><span class="term"><em class="parameter"><code>actor</code></em> :</span></p></td>
273 <td>a <a class="link" href="ClutterActor.html" title="ClutterActor"><span class="type">ClutterActor</span></a>
278 <p class="since">Since 0.2</p>
281 <div class="refsect2">
282 <a name="clutter-behaviour-remove-all"></a><h3>clutter_behaviour_remove_all ()</h3>
283 <pre class="programlisting"><span class="returnvalue">void</span> clutter_behaviour_remove_all (<em class="parameter"><code><a class="link" href="ClutterBehaviour.html" title="ClutterBehaviour"><span class="type">ClutterBehaviour</span></a> *behave</code></em>);</pre>
284 <div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
285 <h3 class="title">Warning</h3>
286 <p><code class="literal">clutter_behaviour_remove_all</code> is deprecated and should not be used in newly-written code. 1.6</p>
289 Removes every actor from the list that <em class="parameter"><code>behave</code></em> holds.
291 <div class="variablelist"><table border="0">
292 <col align="left" valign="top">
294 <td><p><span class="term"><em class="parameter"><code>behave</code></em> :</span></p></td>
295 <td>a <a class="link" href="ClutterBehaviour.html" title="ClutterBehaviour"><span class="type">ClutterBehaviour</span></a>
299 <p class="since">Since 0.4</p>
302 <div class="refsect2">
303 <a name="clutter-behaviour-is-applied"></a><h3>clutter_behaviour_is_applied ()</h3>
304 <pre class="programlisting"><span class="returnvalue">gboolean</span> clutter_behaviour_is_applied (<em class="parameter"><code><a class="link" href="ClutterBehaviour.html" title="ClutterBehaviour"><span class="type">ClutterBehaviour</span></a> *behave</code></em>,
305 <em class="parameter"><code><a class="link" href="ClutterActor.html" title="ClutterActor"><span class="type">ClutterActor</span></a> *actor</code></em>);</pre>
306 <div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
307 <h3 class="title">Warning</h3>
308 <p><code class="literal">clutter_behaviour_is_applied</code> is deprecated and should not be used in newly-written code. 1.6</p>
311 Check if <em class="parameter"><code>behave</code></em> applied to <em class="parameter"><code>actor</code></em>.
313 <div class="variablelist"><table border="0">
314 <col align="left" valign="top">
317 <td><p><span class="term"><em class="parameter"><code>behave</code></em> :</span></p></td>
318 <td>a <a class="link" href="ClutterBehaviour.html" title="ClutterBehaviour"><span class="type">ClutterBehaviour</span></a>
322 <td><p><span class="term"><em class="parameter"><code>actor</code></em> :</span></p></td>
323 <td>a <a class="link" href="ClutterActor.html" title="ClutterActor"><span class="type">ClutterActor</span></a>
327 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
328 <td>TRUE if actor has behaviour. FALSE otherwise.</td>
332 <p class="since">Since 0.4</p>
335 <div class="refsect2">
336 <a name="ClutterBehaviourForeachFunc"></a><h3>ClutterBehaviourForeachFunc ()</h3>
337 <pre class="programlisting"><span class="returnvalue">void</span> (*ClutterBehaviourForeachFunc) (<em class="parameter"><code><a class="link" href="ClutterBehaviour.html" title="ClutterBehaviour"><span class="type">ClutterBehaviour</span></a> *behaviour</code></em>,
338 <em class="parameter"><code><a class="link" href="ClutterActor.html" title="ClutterActor"><span class="type">ClutterActor</span></a> *actor</code></em>,
339 <em class="parameter"><code><span class="type">gpointer</span> data</code></em>);</pre>
340 <div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
341 <h3 class="title">Warning</h3>
342 <p><code class="literal">ClutterBehaviourForeachFunc</code> is deprecated and should not be used in newly-written code. 1.6</p>
345 This function is passed to <a class="link" href="ClutterBehaviour.html#clutter-behaviour-actors-foreach" title="clutter_behaviour_actors_foreach ()"><code class="function">clutter_behaviour_actors_foreach()</code></a> and
346 will be called for each actor driven by <em class="parameter"><code>behaviour</code></em>.
348 <div class="variablelist"><table border="0">
349 <col align="left" valign="top">
352 <td><p><span class="term"><em class="parameter"><code>behaviour</code></em> :</span></p></td>
353 <td>the <a class="link" href="ClutterBehaviour.html" title="ClutterBehaviour"><span class="type">ClutterBehaviour</span></a>
357 <td><p><span class="term"><em class="parameter"><code>actor</code></em> :</span></p></td>
358 <td>an actor driven by <em class="parameter"><code>behaviour</code></em>
362 <td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
363 <td>optional data passed to the function. <span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span>
368 <p class="since">Since 0.2</p>
371 <div class="refsect2">
372 <a name="clutter-behaviour-actors-foreach"></a><h3>clutter_behaviour_actors_foreach ()</h3>
373 <pre class="programlisting"><span class="returnvalue">void</span> clutter_behaviour_actors_foreach (<em class="parameter"><code><a class="link" href="ClutterBehaviour.html" title="ClutterBehaviour"><span class="type">ClutterBehaviour</span></a> *behave</code></em>,
374 <em class="parameter"><code><a class="link" href="ClutterBehaviour.html#ClutterBehaviourForeachFunc" title="ClutterBehaviourForeachFunc ()"><span class="type">ClutterBehaviourForeachFunc</span></a> func</code></em>,
375 <em class="parameter"><code><span class="type">gpointer</span> data</code></em>);</pre>
376 <div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
377 <h3 class="title">Warning</h3>
378 <p><code class="literal">clutter_behaviour_actors_foreach</code> is deprecated and should not be used in newly-written code. 1.6</p>
381 Calls <em class="parameter"><code>func</code></em> for every actor driven by <em class="parameter"><code>behave</code></em>.
383 <div class="variablelist"><table border="0">
384 <col align="left" valign="top">
387 <td><p><span class="term"><em class="parameter"><code>behave</code></em> :</span></p></td>
388 <td>a <a class="link" href="ClutterBehaviour.html" title="ClutterBehaviour"><span class="type">ClutterBehaviour</span></a>
392 <td><p><span class="term"><em class="parameter"><code>func</code></em> :</span></p></td>
393 <td>a function called for each actor. <span class="annotation">[<acronym title="The callback is valid only during the call to the method."><span class="acronym">scope call</span></acronym>]</span>
397 <td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
398 <td>optional data to be passed to the function, or <a href="/home/ebassi/gnome3/install/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL--CAPS"><code class="literal">NULL</code></a>
403 <p class="since">Since 0.2</p>
406 <div class="refsect2">
407 <a name="clutter-behaviour-get-actors"></a><h3>clutter_behaviour_get_actors ()</h3>
408 <pre class="programlisting"><span class="returnvalue">GSList</span> * clutter_behaviour_get_actors (<em class="parameter"><code><a class="link" href="ClutterBehaviour.html" title="ClutterBehaviour"><span class="type">ClutterBehaviour</span></a> *behave</code></em>);</pre>
409 <div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
410 <h3 class="title">Warning</h3>
411 <p><code class="literal">clutter_behaviour_get_actors</code> is deprecated and should not be used in newly-written code. 1.6</p>
414 Retrieves all the actors to which <em class="parameter"><code>behave</code></em> applies. It is not recommended
415 for derived classes to use this in there alpha notify method but use
416 <a class="link" href="ClutterBehaviour.html#clutter-behaviour-actors-foreach" title="clutter_behaviour_actors_foreach ()"><span class="type">clutter_behaviour_actors_foreach</span></a> as it avoids alot of needless allocations.
418 <div class="variablelist"><table border="0">
419 <col align="left" valign="top">
422 <td><p><span class="term"><em class="parameter"><code>behave</code></em> :</span></p></td>
423 <td>a <a class="link" href="ClutterBehaviour.html" title="ClutterBehaviour"><span class="type">ClutterBehaviour</span></a>
427 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
429 actors. You should free the returned list with <code class="function">g_slist_free()</code> when
430 finished using it. <span class="annotation">[<acronym title="Free data container after the code is done."><span class="acronym">transfer container</span></acronym>][<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> Clutter.Actor]</span>
435 <p class="since">Since 0.2</p>
438 <div class="refsect2">
439 <a name="clutter-behaviour-get-n-actors"></a><h3>clutter_behaviour_get_n_actors ()</h3>
440 <pre class="programlisting"><span class="returnvalue">gint</span> clutter_behaviour_get_n_actors (<em class="parameter"><code><a class="link" href="ClutterBehaviour.html" title="ClutterBehaviour"><span class="type">ClutterBehaviour</span></a> *behave</code></em>);</pre>
441 <div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
442 <h3 class="title">Warning</h3>
443 <p><code class="literal">clutter_behaviour_get_n_actors</code> is deprecated and should not be used in newly-written code. 1.6</p>
446 Gets the number of actors this behaviour is applied too.
448 <div class="variablelist"><table border="0">
449 <col align="left" valign="top">
452 <td><p><span class="term"><em class="parameter"><code>behave</code></em> :</span></p></td>
453 <td>a <a class="link" href="ClutterBehaviour.html" title="ClutterBehaviour"><span class="type">ClutterBehaviour</span></a>
457 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
458 <td>The number of applied actors</td>
462 <p class="since">Since 0.2</p>
465 <div class="refsect2">
466 <a name="clutter-behaviour-get-nth-actor"></a><h3>clutter_behaviour_get_nth_actor ()</h3>
467 <pre class="programlisting"><a class="link" href="ClutterActor.html" title="ClutterActor"><span class="returnvalue">ClutterActor</span></a> * clutter_behaviour_get_nth_actor (<em class="parameter"><code><a class="link" href="ClutterBehaviour.html" title="ClutterBehaviour"><span class="type">ClutterBehaviour</span></a> *behave</code></em>,
468 <em class="parameter"><code><span class="type">gint</span> index_</code></em>);</pre>
469 <div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
470 <h3 class="title">Warning</h3>
471 <p><code class="literal">clutter_behaviour_get_nth_actor</code> is deprecated and should not be used in newly-written code. 1.6</p>
474 Gets an actor the behaviour was applied to referenced by index num.
476 <div class="variablelist"><table border="0">
477 <col align="left" valign="top">
480 <td><p><span class="term"><em class="parameter"><code>behave</code></em> :</span></p></td>
481 <td>a <a class="link" href="ClutterBehaviour.html" title="ClutterBehaviour"><span class="type">ClutterBehaviour</span></a>
485 <td><p><span class="term"><em class="parameter"><code>index_</code></em> :</span></p></td>
486 <td>the index of an actor this behaviour is applied too.</td>
489 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
490 <td>A Clutter actor or NULL if <em class="parameter"><code>index_</code></em> is invalid. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
495 <p class="since">Since 0.2</p>
498 <div class="refsect2">
499 <a name="clutter-behaviour-get-alpha"></a><h3>clutter_behaviour_get_alpha ()</h3>
500 <pre class="programlisting"><a class="link" href="ClutterAlpha.html" title="ClutterAlpha"><span class="returnvalue">ClutterAlpha</span></a> * clutter_behaviour_get_alpha (<em class="parameter"><code><a class="link" href="ClutterBehaviour.html" title="ClutterBehaviour"><span class="type">ClutterBehaviour</span></a> *behave</code></em>);</pre>
501 <div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
502 <h3 class="title">Warning</h3>
503 <p><code class="literal">clutter_behaviour_get_alpha</code> is deprecated and should not be used in newly-written code. 1.6</p>
506 Retrieves the <a class="link" href="ClutterAlpha.html" title="ClutterAlpha"><span class="type">ClutterAlpha</span></a> object bound to <em class="parameter"><code>behave</code></em>.
508 <div class="variablelist"><table border="0">
509 <col align="left" valign="top">
512 <td><p><span class="term"><em class="parameter"><code>behave</code></em> :</span></p></td>
513 <td>a <a class="link" href="ClutterBehaviour.html" title="ClutterBehaviour"><span class="type">ClutterBehaviour</span></a>
517 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
518 <td>a <a class="link" href="ClutterAlpha.html" title="ClutterAlpha"><span class="type">ClutterAlpha</span></a> object, or <a href="/home/ebassi/gnome3/install/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL--CAPS"><code class="literal">NULL</code></a> if no alpha
519 object has been bound to this behaviour. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
524 <p class="since">Since 0.2</p>
527 <div class="refsect2">
528 <a name="clutter-behaviour-set-alpha"></a><h3>clutter_behaviour_set_alpha ()</h3>
529 <pre class="programlisting"><span class="returnvalue">void</span> clutter_behaviour_set_alpha (<em class="parameter"><code><a class="link" href="ClutterBehaviour.html" title="ClutterBehaviour"><span class="type">ClutterBehaviour</span></a> *behave</code></em>,
530 <em class="parameter"><code><a class="link" href="ClutterAlpha.html" title="ClutterAlpha"><span class="type">ClutterAlpha</span></a> *alpha</code></em>);</pre>
531 <div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
532 <h3 class="title">Warning</h3>
533 <p><code class="literal">clutter_behaviour_set_alpha</code> is deprecated and should not be used in newly-written code. 1.6</p>
536 Binds <em class="parameter"><code>alpha</code></em> to a <a class="link" href="ClutterBehaviour.html" title="ClutterBehaviour"><span class="type">ClutterBehaviour</span></a>. The <a class="link" href="ClutterAlpha.html" title="ClutterAlpha"><span class="type">ClutterAlpha</span></a> object
537 is what makes a behaviour work: for each tick of the timeline
538 used by <a class="link" href="ClutterAlpha.html" title="ClutterAlpha"><span class="type">ClutterAlpha</span></a> a new value of the alpha parameter is
539 computed by the alpha function; the value should be used by
540 the <a class="link" href="ClutterBehaviour.html" title="ClutterBehaviour"><span class="type">ClutterBehaviour</span></a> to update one or more properties of the
541 actors to which the behaviour applies.
544 If <em class="parameter"><code>alpha</code></em> is not <a href="/home/ebassi/gnome3/install/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL--CAPS"><code class="literal">NULL</code></a>, the <a class="link" href="ClutterBehaviour.html" title="ClutterBehaviour"><span class="type">ClutterBehaviour</span></a> will take ownership
545 of the <a class="link" href="ClutterAlpha.html" title="ClutterAlpha"><span class="type">ClutterAlpha</span></a> instance.
547 <div class="variablelist"><table border="0">
548 <col align="left" valign="top">
551 <td><p><span class="term"><em class="parameter"><code>behave</code></em> :</span></p></td>
552 <td>a <a class="link" href="ClutterBehaviour.html" title="ClutterBehaviour"><span class="type">ClutterBehaviour</span></a>
556 <td><p><span class="term"><em class="parameter"><code>alpha</code></em> :</span></p></td>
557 <td>a <a class="link" href="ClutterAlpha.html" title="ClutterAlpha"><span class="type">ClutterAlpha</span></a> or <a href="/home/ebassi/gnome3/install/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL--CAPS"><code class="literal">NULL</code></a> to unset a previously set alpha</td>
561 <p class="since">Since 0.2</p>
564 <div class="refsect1">
565 <a name="ClutterBehaviour.property-details"></a><h2>Property Details</h2>
566 <div class="refsect2">
567 <a name="ClutterBehaviour--alpha"></a><h3>The <code class="literal">"alpha"</code> property</h3>
568 <pre class="programlisting"> "alpha" <a class="link" href="ClutterAlpha.html" title="ClutterAlpha"><span class="type">ClutterAlpha</span></a>* : Read / Write</pre>
569 <div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
570 <h3 class="title">Warning</h3>
571 <p><code class="literal">ClutterBehaviour:alpha</code> is deprecated and should not be used in newly-written code. 1.6</p>
574 The <a class="link" href="ClutterAlpha.html" title="ClutterAlpha"><span class="type">ClutterAlpha</span></a> object used to drive this behaviour. A <a class="link" href="ClutterAlpha.html" title="ClutterAlpha"><span class="type">ClutterAlpha</span></a>
575 object binds a <a class="link" href="ClutterTimeline.html" title="ClutterTimeline"><span class="type">ClutterTimeline</span></a> and a function which computes a value
576 (the "alpha") depending on the time. Each time the alpha value changes
577 the alpha-notify virtual function is called.
579 <p class="since">Since 0.2</p>
582 <div class="refsect1">
583 <a name="ClutterBehaviour.signal-details"></a><h2>Signal Details</h2>
584 <div class="refsect2">
585 <a name="ClutterBehaviour-applied"></a><h3>The <code class="literal">"applied"</code> signal</h3>
586 <pre class="programlisting"><span class="returnvalue">void</span> user_function (<a class="link" href="ClutterBehaviour.html" title="ClutterBehaviour"><span class="type">ClutterBehaviour</span></a> *behaviour,
587 <a class="link" href="ClutterActor.html" title="ClutterActor"><span class="type">ClutterActor</span></a> *actor,
588 <span class="type">gpointer</span> user_data) : <code class="literal">Run First</code></pre>
589 <div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
590 <h3 class="title">Warning</h3>
591 <p><code class="literal">ClutterBehaviour::applied</code> is deprecated and should not be used in newly-written code. 1.6</p>
594 The ::apply signal is emitted each time the behaviour is applied
597 <div class="variablelist"><table border="0">
598 <col align="left" valign="top">
601 <td><p><span class="term"><em class="parameter"><code>behaviour</code></em> :</span></p></td>
602 <td>the <a class="link" href="ClutterBehaviour.html" title="ClutterBehaviour"><span class="type">ClutterBehaviour</span></a> that received the signal</td>
605 <td><p><span class="term"><em class="parameter"><code>actor</code></em> :</span></p></td>
606 <td>the actor the behaviour was applied to.</td>
609 <td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
610 <td>user data set when the signal handler was connected.</td>
614 <p class="since">Since 0.4</p>
617 <div class="refsect2">
618 <a name="ClutterBehaviour-removed"></a><h3>The <code class="literal">"removed"</code> signal</h3>
619 <pre class="programlisting"><span class="returnvalue">void</span> user_function (<a class="link" href="ClutterBehaviour.html" title="ClutterBehaviour"><span class="type">ClutterBehaviour</span></a> *behaviour,
620 <a class="link" href="ClutterActor.html" title="ClutterActor"><span class="type">ClutterActor</span></a> *actor,
621 <span class="type">gpointer</span> user_data) : <code class="literal">Run First</code></pre>
622 <div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
623 <h3 class="title">Warning</h3>
624 <p><code class="literal">ClutterBehaviour::removed</code> is deprecated and should not be used in newly-written code. 1.6</p>
627 The ::removed signal is emitted each time a behaviour is not applied
630 <div class="variablelist"><table border="0">
631 <col align="left" valign="top">
634 <td><p><span class="term"><em class="parameter"><code>behaviour</code></em> :</span></p></td>
635 <td>the <a class="link" href="ClutterBehaviour.html" title="ClutterBehaviour"><span class="type">ClutterBehaviour</span></a> that received the signal</td>
638 <td><p><span class="term"><em class="parameter"><code>actor</code></em> :</span></p></td>
639 <td>the removed actor</td>
642 <td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
643 <td>user data set when the signal handler was connected.</td>
647 <p class="since">Since 0.4</p>
653 Generated by GTK-Doc V1.18.1</div>