Class

BisAnimation

Description [src]

abstract class Bis.Animation : GObject.Object {
  parent_instance: GObject
}

A base class for animations.

BisAnimation 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: BisTimedAnimation and BisSpringAnimation.

BisAnimation will automatically skip the animation if BisAnimation:widget is unmapped, or if GtkSettings:gtk-enable-animations is FALSE.

The BisAnimation::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.

BisAnimation 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)
{
  BisAnimationTarget *target =
    bis_callback_animation_target_new ((BisAnimationTargetFunc) animation_cb,
                                       self, NULL);
  g_autoptr (BisAnimation) animation =
    bis_timed_animation_new (widget, 0, 1, 250, target);

  bis_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 BisAnimation object can be reused.

Available since:1.0

Ancestors

Instance methods

bis_animation_get_state

Gets the current value of self.

Available since: 1.0

bis_animation_get_target

Gets the target self animates.

Available since: 1.0

bis_animation_get_value

Gets the current value of self.

Available since: 1.0

bis_animation_get_widget

Gets the widget self was created for.

Available since: 1.0

bis_animation_pause

Pauses a playing animation for self.

Available since: 1.0

bis_animation_play

Starts the animation for self.

Available since: 1.0

bis_animation_reset

Resets the animation for self.

Available since: 1.0

bis_animation_resume

Resumes a paused animation for self.

Available since: 1.0

bis_animation_set_target

Sets the target self animates to target.

Available since: 1.0

bis_animation_skip

Skips the animation for self.

Available since: 1.0

Methods inherited from GObject (43)

Please see GObject for a full list of methods.

Properties

Bis.Animation:state

The animation state.

Available since: 1.0

Bis.Animation:target

The target to animate.

Available since: 1.0

Bis.Animation:value

The current value of the animation.

Available since: 1.0

Bis.Animation:widget

The animation widget.

Available since: 1.0

Signals

Bis.Animation::done

This signal is emitted when the animation has been completed, either on its own or via calling bis_animation_skip().

Available since: 1.0

Signals inherited from GObject (1)
GObject.Object::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.

Class structure

struct BisAnimationClass {
  /* no available fields */
}