Skip to main content

AnimationInstanceBase

Struct AnimationInstanceBase 

Source
pub struct AnimationInstanceBase { /* private fields */ }
Expand description

The base class for both key-frame and expression animation instances Is responsible for activation tracking and for subscribing to properties used in dependencies

A class “derives” from it by embedding it and forwarding the members of IAnimationInstance it does not override. The embedding class is created with Rc::new_cyclic and hands the weak handle of itself to the base, which subscribes it to the objects it tracks.

The target and the tracked objects are held weakly: the animations of the target hold the instance, and the instance must not keep the target alive in turn.

Implementations§

Source§

impl AnimationInstanceBase

Source

pub fn new( this: Weak<dyn IAnimationInstance>, target: ServerObjectId, parameters: Rc<PropertySetSnapshot>, ) -> Self

Source

pub fn parameters(&self) -> &Rc<PropertySetSnapshot>

Source

pub fn target_object(&self) -> ServerObjectId

The id of the object whose property is animated.

Source

pub fn target(&self) -> Option<Rc<dyn IAnimatedServerObject>>

The object whose property is animated, once resolved and while it is alive.

Source

pub fn compositor(&self) -> Option<Rc<ServerCompositor>>

The compositor of the target (TargetObject.Compositor), once resolved and while it is alive.

Source

pub fn property(&self) -> Option<&'static CompositionProperty>

The property the instance animates, once initialized.

Source

pub fn this_clock_item(&self) -> Option<Rc<dyn IServerClockItem>>

The handle of the embedding instance as a clock item.

Source

pub fn resolve(&self, compositor: &Rc<ServerCompositor>)

See IAnimationInstance::resolve: resolves the target and the objects of the reference parameters on compositor.

Upstream the instance holds its target. The target is the object whose batch changes carry the instance, so its id names it here; an id that names no animatable object leaves the instance without a target, which it then treats as gone.

Source

pub fn with_target_expression_object<R>( &self, f: impl FnOnce(Option<&dyn IExpressionObject>) -> R, ) -> R

Calls f with the target as the expressions of the instance see it.

Source

pub fn initialize( &self, property: &'static CompositionProperty, tracked_objects: &HashSet<(String, String)>, )

Initialize(property, trackedObjects).

Source

pub fn begin_evaluate(&self)

The head of Evaluate: the evaluation makes the instance valid again. The embedding class then evaluates its own core.

Source

pub fn activate(&self)

Source

pub fn deactivate(&self)

Source

pub fn invalidate(&self)

Source

pub fn on_tick(&self)

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ClassDefaults for T
where T: ?Sized,

Source§

fn static_constructor()

The static constructor of a type: work done once per thread, after the properties of the type are registered and before its first instance exists (class handlers, affects_render, metadata overrides). Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.