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
impl AnimationInstanceBase
pub fn new( this: Weak<dyn IAnimationInstance>, target: ServerObjectId, parameters: Rc<PropertySetSnapshot>, ) -> Self
pub fn parameters(&self) -> &Rc<PropertySetSnapshot>
Sourcepub fn target_object(&self) -> ServerObjectId
pub fn target_object(&self) -> ServerObjectId
The id of the object whose property is animated.
Sourcepub fn target(&self) -> Option<Rc<dyn IAnimatedServerObject>>
pub fn target(&self) -> Option<Rc<dyn IAnimatedServerObject>>
The object whose property is animated, once resolved and while it is alive.
Sourcepub fn compositor(&self) -> Option<Rc<ServerCompositor>>
pub fn compositor(&self) -> Option<Rc<ServerCompositor>>
The compositor of the target (TargetObject.Compositor), once
resolved and while it is alive.
Sourcepub fn property(&self) -> Option<&'static CompositionProperty>
pub fn property(&self) -> Option<&'static CompositionProperty>
The property the instance animates, once initialized.
Sourcepub fn this_clock_item(&self) -> Option<Rc<dyn IServerClockItem>>
pub fn this_clock_item(&self) -> Option<Rc<dyn IServerClockItem>>
The handle of the embedding instance as a clock item.
Sourcepub fn resolve(&self, compositor: &Rc<ServerCompositor>)
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.
Sourcepub fn with_target_expression_object<R>(
&self,
f: impl FnOnce(Option<&dyn IExpressionObject>) -> R,
) -> R
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.
Sourcepub fn initialize(
&self,
property: &'static CompositionProperty,
tracked_objects: &HashSet<(String, String)>,
)
pub fn initialize( &self, property: &'static CompositionProperty, tracked_objects: &HashSet<(String, String)>, )
Initialize(property, trackedObjects).
Sourcepub fn begin_evaluate(&self)
pub fn begin_evaluate(&self)
The head of Evaluate: the evaluation makes the instance valid
again. The embedding class then evaluates its own core.
pub fn activate(&self)
pub fn deactivate(&self)
pub fn invalidate(&self)
pub fn on_tick(&self)
Auto Trait Implementations§
impl !Freeze for AnimationInstanceBase
impl !RefUnwindSafe for AnimationInstanceBase
impl !Send for AnimationInstanceBase
impl !Sync for AnimationInstanceBase
impl !UnwindSafe for AnimationInstanceBase
impl Unpin for AnimationInstanceBase
impl UnsafeUnpin for AnimationInstanceBase
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
affects_render, metadata
overrides). Read more