/usr/share/gtk-doc/html/clutter/migrating-ClutterAnimation.html is in libclutter-1.0-doc 1.16.4-0ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Clutter Reference Manual: Migrating from ClutterAnimation</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="index.html" title="Clutter Reference Manual">
<link rel="up" href="migration.html" title="Part VIII. Migrating from previous version of Clutter">
<link rel="prev" href="migrating-ClutterBehaviour.html" title="Migrating from ClutterBehaviour">
<link rel="next" href="deprecated.html" title="Part IX. Deprecated Classes">
<meta name="generator" content="GTK-Doc V1.20 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="10"><tr valign="middle">
<td width="100%" align="left" class="shortcuts"></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="migration.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="migrating-ClutterBehaviour.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="deprecated.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="chapter">
<div class="titlepage"><div>
<div><h2 class="title">
<a name="migrating-ClutterAnimation"></a>Migrating from ClutterAnimation</h2></div>
<div><div class="author">
<h3 class="author">
<span class="firstname">Emmanuele</span> <span class="surname">Bassi</span>
</h3>
<div class="affiliation"><div class="address"><p><br>
<code class="email"><<a class="email" href="mailto:ebassignome.org">ebassi<em class="parameter"><code>gnome.org</code></em></a>></code><br>
</p></div></div>
</div></div>
</div></div>
<div class="toc"><dl class="toc"><dt><span class="section"><a href="migrating-ClutterAnimation.html#id-1.9.6.12">Migrating <code class="function">clutter_actor_animate()</code></a></span></dt></dl></div>
<p>The <a class="link" href="clutter-Implicit-Animations.html#ClutterAnimation"><span class="type">ClutterAnimation</span></a> class, along with the <a class="link" href="ClutterActor.html" title="ClutterActor"><span class="type">ClutterActor</span></a> wrappers
<a class="link" href="clutter-Implicit-Animations.html#clutter-actor-animate" title="clutter_actor_animate ()"><code class="function">clutter_actor_animate()</code></a>, <a class="link" href="clutter-Implicit-Animations.html#clutter-actor-animate-with-timeline" title="clutter_actor_animate_with_timeline ()"><code class="function">clutter_actor_animate_with_timeline()</code></a> and
<a class="link" href="clutter-Implicit-Animations.html#clutter-actor-animate-with-alpha" title="clutter_actor_animate_with_alpha ()"><code class="function">clutter_actor_animate_with_alpha()</code></a>, has been deprecated in Clutter 1.12,
and should not be used in newly written code.</p>
<p>The direct replacement for a <a class="link" href="clutter-Implicit-Animations.html#ClutterAnimation"><span class="type">ClutterAnimation</span></a> is the
<a class="link" href="ClutterPropertyTransition.html" title="ClutterPropertyTransition"><span class="type">ClutterPropertyTransition</span></a> class, which allows the transition of a
single <span class="type">GObject</span> property from an initial value to a final value over a
user-defined time using a user-defined easing curve.</p>
<p>The <a class="link" href="ClutterPropertyTransition.html" title="ClutterPropertyTransition"><span class="type">ClutterPropertyTransition</span></a> class inherits from <a class="link" href="ClutterTransition.html" title="ClutterTransition"><span class="type">ClutterTransition</span></a>,
which allows setting the transition interval, as well as the animatable
instance to be transitioned; and from <a class="link" href="ClutterTimeline.html" title="ClutterTimeline"><span class="type">ClutterTimeline</span></a>, which allows setting
the duration and easing curve of the transition.</p>
<p>For instance, the following <a class="link" href="clutter-Implicit-Animations.html#ClutterAnimation"><span class="type">ClutterAnimation</span></a> set up:</p>
<div class="informalexample"><pre class="programlisting">
ClutterAnimation *animation = clutter_animation_new ();
clutter_animation_set_mode (animation, CLUTTER_EASE_OUT_CUBIC);
clutter_animation_set_duration (animation, 2500);
/* object_to_animate is set elsewhere */
clutter_animation_set_object (animation, object_to_animate);
ClutterInterval *interval = clutter_interval_new (G_TYPE_FLOAT, 0.0, 100.0);
/* property_name is set elsewhere */
clutter_animation_bind_interval (animation, property_name, interval);
ClutterTimeline *timeline = clutter_animation_get_timeline (animation);
clutter_timeline_start (timeline);
</pre></div>
<p>Can be replaced by <a class="link" href="ClutterPropertyTransition.html" title="ClutterPropertyTransition"><span class="type">ClutterPropertyTransition</span></a>:</p>
<div class="informalexample"><pre class="programlisting">
ClutterTransition *transition = clutter_property_transition_new (property_name);
clutter_timeline_set_progress_mode (CLUTTER_TIMELINE (transition),
CLUTTER_EASE_OUT_CUBIC);
clutter_timeline_set_duration (CLUTTER_TIMELINE (transition), 2000);
clutter_transition_set_animatable (transition, object_to_animate);
clutter_transition_set_from (transition, G_TYPE_FLOAT, 0.0);
clutter_transition_set_to (transition, G_TYPE_FLOAT, 100.0);
clutter_timeline_start (CLUTTER_TIMELINE (transition));
</pre></div>
<p>It is important to note that only <a class="link" href="ClutterAnimatable.html" title="ClutterAnimatable"><span class="type">ClutterAnimatable</span></a> implementations
can be used directly with <a class="link" href="ClutterTransition.html" title="ClutterTransition"><span class="type">ClutterTransition</span></a>.</p>
<p>A <a class="link" href="ClutterPropertyTransition.html" title="ClutterPropertyTransition"><span class="type">ClutterPropertyTransition</span></a> can only animate a single property; if
more than one property transition is required, you can use the
<a class="link" href="ClutterTransitionGroup.html" title="ClutterTransitionGroup"><span class="type">ClutterTransitionGroup</span></a> class to group the transitions together.</p>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="id-1.9.6.12"></a>Migrating <a class="link" href="clutter-Implicit-Animations.html#clutter-actor-animate" title="clutter_actor_animate ()"><code class="function">clutter_actor_animate()</code></a>
</h2></div></div></div>
<p><a class="link" href="ClutterActor.html" title="ClutterActor"><span class="type">ClutterActor</span></a> animatable properties can use implicit transitions
through their setter functions. The duration and easing curve of the
animation is controlled by <a class="link" href="ClutterActor.html#clutter-actor-set-easing-duration" title="clutter_actor_set_easing_duration ()"><code class="function">clutter_actor_set_easing_duration()</code></a> and by
<a class="link" href="ClutterActor.html#clutter-actor-set-easing-mode" title="clutter_actor_set_easing_mode ()"><code class="function">clutter_actor_set_easing_mode()</code></a>, respectively; for instance, the
equivalent of the following <a class="link" href="clutter-Implicit-Animations.html#clutter-actor-animate" title="clutter_actor_animate ()"><code class="function">clutter_actor_animate()</code></a> call:</p>
<div class="informalexample"><pre class="programlisting">
clutter_actor_animate (actor, CLUTTER_EASE_OUT_BOUNCE, 500,
"x", new_x_position,
"y", new_y_position,
"opacity", 255,
NULL);
</pre></div>
<p>Can be replaced by the following:</p>
<div class="informalexample"><pre class="programlisting">
clutter_actor_set_easing_mode (actor, CLUTTER_EASE_OUT_BOUNCE);
clutter_actor_set_easing_duration (actor, 500);
clutter_actor_set_position (actor, new_x_position, new_y_position);
clutter_actor_set_opacity (actor, 255);
</pre></div>
<p>The default easing duration for the 1.0 API series is set to 0,
which means no transition at all.</p>
<p>It is possible to set the easing state of a <a class="link" href="ClutterActor.html" title="ClutterActor"><span class="type">ClutterActor</span></a> to its
default values by using <a class="link" href="ClutterActor.html#clutter-actor-save-easing-state" title="clutter_actor_save_easing_state ()"><code class="function">clutter_actor_save_easing_state()</code></a>, and return
to the previous values by calling <a class="link" href="ClutterActor.html#clutter-actor-restore-easing-state" title="clutter_actor_restore_easing_state ()"><code class="function">clutter_actor_restore_easing_state()</code></a>
instead. The easing state affects all the animatable properties that
are modified after changing it; so, for instance:</p>
<div class="informalexample"><pre class="programlisting">
clutter_actor_save_easing_state (actor);
clutter_actor_set_easing_duration (actor, 500);
clutter_actor_set_opacity (actor, 255);
clutter_actor_save_easing_state (actor);
clutter_actor_set_easing_delay (actor, 500);
clutter_actor_set_easing_duration (actor, 500);
clutter_actor_set_size (actor, width, height);
clutter_actor_restore_easing_state (actor);
clutter_actor_restore_easing_state (actor);
</pre></div>
<p>The animation above will implicitly transition the opacity from
its current value to 255 in 500 milliseconds using the default easing
curve; at the same time, the size of the actor will be transitioned in
500 milliseconds after a delay of 500 milliseconds to the new size
stored in the variables <span class="emphasis"><em>width</em></span> and
<span class="emphasis"><em>height</em></span>.</p>
</div>
</div>
<div class="footer">
<hr>
Generated by GTK-Doc V1.20</div>
</body>
</html>
|