Class
AdapAnimation
since: 1
Description [src]
abstract class Adap.Animation : GObject.Object
{
/* No available fields */
}
A base class for animations.
AdapAnimation
represents an animation on a widget. It has a target that
provides a value to animate, and a state indicating whether the
animation hasn’t been started yet, is playing, paused or finished.
Currently there are two concrete animation types:
AdapTimedAnimation
and AdapSpringAnimation
.
AdapAnimation
will automatically skip the animation if
AdapAnimation:widget
is unmapped, or if
GtkSettings:gtk-enable-animations
is FALSE
.
The AdapAnimation::done
signal can be used to perform an action after
the animation ends, for example hiding a widget after animating its
GtkWidget:opacity
to 0.
AdapAnimation
will be kept alive while the animation is playing. As such,
it’s safe to create an animation, start it and immediately unref it:
A fire-and-forget animation:
static void
animation_cb (double value,
MyObject *self)
{
// Do something with @value
}
static void
my_object_animate (MyObject *self)
{
AdapAnimationTarget *target =
adap_callback_animation_target_new ((AdapAnimationTargetFunc) animation_cb,
self, NULL);
g_autoptr (AdapAnimation) animation =
adap_timed_animation_new (widget, 0, 1, 250, target);
adap_animation_play (animation);
}
If there’s a chance the previous animation for the same target hasn’t yet
finished, the previous animation should be stopped first, or the existing
AdapAnimation
object can be reused.
Available since: 1
Instance methods
adap_animation_get_follow_enable_animations_setting
Gets whether self
should be skipped when animations are globally disabled.
since: 1.3
adap_animation_set_follow_enable_animations_setting
Sets whether to skip self
when animations are globally disabled.
since: 1.3
Properties
Adap.Animation:follow-enable-animations-setting
Whether to skip the animation when animations are globally disabled.
since: 1.3
Signals
Adap.Animation::done
This signal is emitted when the animation has been completed, either on its
own or via calling adap_animation_skip()
.
since: 1
Signals inherited from GObject (1)
GObject::notify
The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.
unstable since: 2.0