If the Interval used has a different type than the property we are
animating through a PropertyTransition then we should transform the
interpolated value before applying it, to avoid warnings down the
line.
The compute() method will cache the result, to avoid multiple
allocations and copies; this means, though, that we need to unset the
GValue when destroying the Interval.
Now that the interval can transform the initial and final values to the
type declared when constructing it, there is no need to check for the
value type inside set_initial_value() and set_final_value().
It's possible that GValues passed to a ClutterInterval setter are not
of the same type as the interval - for instance, if they come from
language bindings, or from untrusted sources; we can use the same
transformation functions we already use inside ClutterTransition to
ensure that the ClutterInterval always stores values of the same type
used to create the interval itself.
The ::stopped signal should be emitted at the end of the Timeline, after
the last ::completed signal emission, in order to have a proper
chronological progress of signal emissions:
started → new-frame → [ ... ] → completed → stopped
This way, ::stopped can perform a proper teardown of the state set up
during ::started, without interfering with the potential cyclical
emission of ::completed.
Calling clutter_point_free(clutter_point_zero()) or calling
clutter_rect_free(clutter_rect_zero()) should be safe, exactly like it's
safe to call those functions with a NULL argument.
The animation tutorial was written in the Good Ol' 0.x days, and has
barely been updated during the 1.x cycle; it only referenced low level
or deprecated API, and the ClutterActor class description has a whole
section on how to animate actors using both the implicit and the
explicit animation API.
The implicit animations only apply to properties that are documented as
'animatable'; the explicit animations apply to any property defined
through GObject or ClutterAnimatable.
For 1.x, we still have a duration of 0 msecs, but we have a valid easing
state, so we can change the easing parameters without calling save and
restore.
By checking if the interval is valid inside compute_value() we can catch
the cases where the interval values of a PropertyTransition are set
after the transition has been added to an Animatable instance - i.e. the
following code:
let transition = new Clutter.PropertyTransition();
transition.set_property_name('opacity');
actor.add_transition('opacityAnim', transition);
transition.set_to_value(0);
should be equivalent to:
let transition = new Clutter.PropertyTransition();
transition.set_property_name('opacity');
transition.set_to_value(0);
actor.add_transition('opacityAnim', transition);
instead of emitting a warning.
Once a ClutterPropertyTransition is attached to a ClutterAnimatable, if
no interval is set we can simply use the current state of the property
to define the from and to values. This allows the creation of property
transitions from the current state of the Animatable instance without
excessive verbosity.
ClutterContent implementations may allow repeating their contents when
painting; we should provide the repeat policy on the actor, like we do
for scaling filters and content gravity.
ClutterActor's x-align and y-align properties should be used to control
the alignment of the PangoLayout when painting it within a larger
allocation, and the ClutterText has the x-expand or the y-expand flags
set.