Trait libbismuth::prelude::AnimationExt

source ·
pub trait AnimationExt: IsA<Animation> + Sealed + 'static {
Show 14 methods // Provided methods fn state(&self) -> AnimationState { ... } fn target(&self) -> AnimationTarget { ... } fn value(&self) -> f64 { ... } fn widget(&self) -> Widget { ... } fn pause(&self) { ... } fn play(&self) { ... } fn reset(&self) { ... } fn resume(&self) { ... } fn set_target(&self, target: &impl IsA<AnimationTarget>) { ... } fn skip(&self) { ... } fn connect_done<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { ... } fn connect_state_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_target_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_value_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... }
}
Expand description

Trait containing all Animation methods.

§Implementors

Animation, SpringAnimation, TimedAnimation

Provided Methods§

source

fn state(&self) -> AnimationState

Gets the current value of @self.

The state indicates whether @self is currently playing, paused, finished or hasn’t been started yet.

§Returns

the animation value

source

fn target(&self) -> AnimationTarget

Gets the target @self animates.

§Returns

the animation target

source

fn value(&self) -> f64

Gets the current value of @self.

§Returns

the current value

source

fn widget(&self) -> Widget

Gets the widget @self was created for.

It provides the frame clock for the animation. It’s not strictly necessary for this widget to be same as the one being animated.

The widget must be mapped in order for the animation to work. If it’s not mapped, or if it gets unmapped during an ongoing animation, the animation will be automatically skipped.

§Returns

the animation widget

source

fn pause(&self)

Pauses a playing animation for @self.

Does nothing if the current state of @self isn’t BIS_ANIMATION_PLAYING.

Sets state to BIS_ANIMATION_PAUSED.

source

fn play(&self)

Starts the animation for @self.

If the animation is playing, paused or has been completed, restarts it from the beginning. This allows to easily play an animation regardless of whether it’s already playing or not.

Sets state to BIS_ANIMATION_PLAYING.

The animation will be automatically skipped if widget is unmapped, or if [gtk-enable-animations][struct@crate::Gtk::Settings#gtk-enable-animations] is FALSE.

As such, it’s not guaranteed that the animation will actually run. For example, when using idle_add() and starting an animation immediately afterwards, it’s entirely possible that the idle callback will run after the animation has already finished, and not while it’s playing.

source

fn reset(&self)

Resets the animation for @self.

Sets state to BIS_ANIMATION_IDLE.

source

fn resume(&self)

Resumes a paused animation for @self.

This function must only be used if the animation has been paused with pause().

Sets state to BIS_ANIMATION_PLAYING.

source

fn set_target(&self, target: &impl IsA<AnimationTarget>)

Sets the target @self animates to @target.

§target

an animation target

source

fn skip(&self)

Skips the animation for @self.

If the animation hasn’t been started yet, is playing, or is paused, instantly skips the animation to the end and causes done to be emitted.

Sets state to BIS_ANIMATION_FINISHED.

source

fn connect_done<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

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

source

fn connect_state_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

source

fn connect_target_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

source

fn connect_value_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<O: IsA<Animation>> AnimationExt for O