pub struct CompositionObject { /* private fields */ }Expand description
The part every composition object embeds: what upstream’s abstract
CompositionObject holds.
A class “derives” from CompositionObject by embedding this value,
implementing ICompositorSerializable through it, and forwarding the
animation members to the functions of this module.
The server-side counterpart is known by id. Disposing the object disposes its counterpart with the next batch, which keeps it under its id while this object is alive: upstream the UI-thread object holds its server object, so jobs and animations that name it after the disposal still reach it, and the id cannot be reused meanwhile. When the object is dropped, its counterpart is disposed (if it was not) and released with a later batch: this stands in for the garbage collector, which reclaims a server object upstream once the UI-thread object is unreachable. A counterpart that was disposed out of band (a composition target) is kept and released the same way.
Implementations§
Source§impl CompositionObject
impl CompositionObject
pub fn new(compositor: &Rc<Compositor>, server: Option<ServerObjectId>) -> Self
Sourcepub fn implicit_animations(&self) -> Option<Rc<ImplicitAnimationCollection>>
pub fn implicit_animations(&self) -> Option<Rc<ImplicitAnimationCollection>>
The collection of implicit animations attached to this object.
pub fn set_implicit_animations( &self, value: Option<Rc<ImplicitAnimationCollection>>, )
Sourcepub fn implicit_animation(
&self,
property_name: &str,
) -> Option<Rc<dyn ICompositionAnimationBase>>
pub fn implicit_animation( &self, property_name: &str, ) -> Option<Rc<dyn ICompositionAnimationBase>>
The implicit animation attached to a property of the object, if
there is one (ImplicitAnimations?.TryGetValue(name) of the
generated setters).
pub fn compositor(&self) -> &Rc<Compositor>
Sourcepub fn server(&self) -> Option<ServerObjectId>
pub fn server(&self) -> Option<ServerObjectId>
The id of the server-side counterpart, if the object has one.
Sourcepub fn required_server(&self) -> ServerObjectId
pub fn required_server(&self) -> ServerObjectId
The id of the server-side counterpart. Panics if there is none.
Sourcepub fn try_get_server(&self, c: &Compositor) -> Option<ServerObjectId>
pub fn try_get_server(&self, c: &Compositor) -> Option<ServerObjectId>
ICompositorSerializable.TryGetServer. A disposed object has no
counterpart any more, so its pending changes are not written.
pub fn is_disposed(&self) -> bool
pub fn pending_animations(&self) -> &PendingAnimations
pub fn dispose(&self)
Sourcepub fn register_for_serialization(
&self,
this: impl FnOnce() -> Option<Rc<dyn ICompositorSerializable>>,
)
pub fn register_for_serialization( &self, this: impl FnOnce() -> Option<Rc<dyn ICompositorSerializable>>, )
Queues the object for serialization. this yields the handle of the
object that embeds this part.
Sourcepub fn begin_serialize_changes(&self, c: &Compositor)
pub fn begin_serialize_changes(&self, c: &Compositor)
The head of ICompositorSerializable.SerializeChanges: the object
may be registered again from now on.
Sourcepub fn stop_animation(&self, property: &'static CompositionProperty)
pub fn stop_animation(&self, property: &'static CompositionProperty)
StopAnimation: removes the animation of a property on the server.
property is the composition property the class resolved from the
property name. The server object is reached through a job of the
next batch.
Trait Implementations§
Source§impl Drop for CompositionObject
impl Drop for CompositionObject
Auto Trait Implementations§
impl !Freeze for CompositionObject
impl !RefUnwindSafe for CompositionObject
impl !Send for CompositionObject
impl !Sync for CompositionObject
impl !UnwindSafe for CompositionObject
impl Unpin for CompositionObject
impl UnsafeUnpin for CompositionObject
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