pub struct CompositionGeometry { /* private fields */ }Expand description
The geometry of a sprite shape or a geometric clip (WinUI
Microsoft.UI.Composition.CompositionGeometry), with the animatable
trimming of its outline: TrimStart and TrimEnd (fractions of the
length of the outline, default 0 and 1) and TrimOffset (added to both,
wrapping around the outline).
Implementations§
Source§impl CompositionGeometry
impl CompositionGeometry
Sourcepub fn geometry_props(&self) -> &CompositionGeometryProps
pub fn geometry_props(&self) -> &CompositionGeometryProps
The generated properties of CompositionGeometry.
pub fn compositor(&self) -> &Rc<Compositor>
Sourcepub fn object(&self) -> &CompositionObject
pub fn object(&self) -> &CompositionObject
The embedded CompositionObject.
Sourcepub fn server(&self) -> ServerObjectId
pub fn server(&self) -> ServerObjectId
The id of the server-side geometry.
pub fn is_disposed(&self) -> bool
pub fn dispose(&self)
Sourcepub fn trim_end(&self) -> f32
pub fn trim_end(&self) -> f32
Where the drawn part of the outline ends, as a fraction of its length (default 1).
pub fn set_trim_end(&self, value: f32)
Sourcepub fn trim_offset(&self) -> f32
pub fn trim_offset(&self) -> f32
How far along the outline both trim points are moved, as a fraction of its length; the drawn part wraps around the start of the outline.
pub fn set_trim_offset(&self, value: f32)
Sourcepub fn trim_start(&self) -> f32
pub fn trim_start(&self) -> f32
Where the drawn part of the outline starts, as a fraction of its length (default 0).
pub fn set_trim_start(&self, value: f32)
Trait Implementations§
Source§impl AsCompositionObject for CompositionGeometry
impl AsCompositionObject for CompositionGeometry
Source§fn as_composition_object(&self) -> &CompositionObject
fn as_composition_object(&self) -> &CompositionObject
The embedded
CompositionObject.Source§fn composition_type_name(&self) -> &'static str
fn composition_type_name(&self) -> &'static str
The name of the class of the object, for messages.
Source§fn as_property_set(self: Rc<Self>) -> Option<Rc<CompositionPropertySet>>
fn as_property_set(self: Rc<Self>) -> Option<Rc<CompositionPropertySet>>
The object as a property set, if it is one (the
is CompositionPropertySet test of upstream).Source§impl CompositionEllipseGeometryHooks for CompositionGeometry
impl CompositionEllipseGeometryHooks for CompositionGeometry
fn initialize_defaults_extra(&self)
fn validate_center_change(&self, _old_value: Vector, _new_value: Vector)
fn on_center_changed(&self)
fn on_center_changing(&self)
fn validate_radius_change(&self, _old_value: Vector, _new_value: Vector)
fn on_radius_changed(&self)
fn on_radius_changing(&self)
Source§impl CompositionGeometryHooks for CompositionGeometry
impl CompositionGeometryHooks for CompositionGeometry
fn initialize_defaults_extra(&self)
fn validate_trim_end_change(&self, _old_value: f32, _new_value: f32)
fn on_trim_end_changed(&self)
fn on_trim_end_changing(&self)
fn validate_trim_offset_change(&self, _old_value: f32, _new_value: f32)
fn on_trim_offset_changed(&self)
fn on_trim_offset_changing(&self)
fn validate_trim_start_change(&self, _old_value: f32, _new_value: f32)
fn on_trim_start_changed(&self)
fn on_trim_start_changing(&self)
Source§impl CompositionLineGeometryHooks for CompositionGeometry
impl CompositionLineGeometryHooks for CompositionGeometry
fn initialize_defaults_extra(&self)
fn validate_start_change(&self, _old_value: Vector, _new_value: Vector)
fn on_start_changed(&self)
fn on_start_changing(&self)
fn validate_end_change(&self, _old_value: Vector, _new_value: Vector)
fn on_end_changed(&self)
fn on_end_changing(&self)
Source§impl CompositionPathGeometryHooks for CompositionGeometry
impl CompositionPathGeometryHooks for CompositionGeometry
fn initialize_defaults_extra(&self)
fn validate_path_change( &self, _old_value: &Option<Arc<CompositionPath>>, _new_value: &Option<Arc<CompositionPath>>, )
fn on_path_changed(&self)
fn on_path_changing(&self)
Source§impl CompositionRectangleGeometryHooks for CompositionGeometry
impl CompositionRectangleGeometryHooks for CompositionGeometry
fn initialize_defaults_extra(&self)
fn validate_offset_change(&self, _old_value: Vector, _new_value: Vector)
fn on_offset_changed(&self)
fn on_offset_changing(&self)
fn validate_size_change(&self, _old_value: Vector, _new_value: Vector)
fn on_size_changed(&self)
fn on_size_changing(&self)
Source§impl CompositionRoundedRectangleGeometryHooks for CompositionGeometry
impl CompositionRoundedRectangleGeometryHooks for CompositionGeometry
fn initialize_defaults_extra(&self)
fn validate_corner_radius_change(&self, _old_value: Vector, _new_value: Vector)
fn on_corner_radius_changed(&self)
fn on_corner_radius_changing(&self)
fn validate_offset_change(&self, _old_value: Vector, _new_value: Vector)
fn on_offset_changed(&self)
fn on_offset_changing(&self)
fn validate_size_change(&self, _old_value: Vector, _new_value: Vector)
fn on_size_changed(&self)
fn on_size_changing(&self)
Source§impl ICompositionObjectAnimations for CompositionGeometry
impl ICompositionObjectAnimations for CompositionGeometry
Source§fn try_start_animation(
&self,
property_name: &str,
animation: &dyn ICompositionAnimation,
final_value: Option<ExpressionVariant>,
) -> bool
fn try_start_animation( &self, property_name: &str, animation: &dyn ICompositionAnimation, final_value: Option<ExpressionVariant>, ) -> bool
StartAnimation(propertyName, animation, finalValue) of the class:
returns false for a property the class does not know.Source§fn get_composition_property(
&self,
property_name: &str,
) -> Option<&'static CompositionProperty>
fn get_composition_property( &self, property_name: &str, ) -> Option<&'static CompositionProperty>
The composition property with the given name.
Source§fn composition_object(&self) -> &CompositionObject
fn composition_object(&self) -> &CompositionObject
The embedded
CompositionObject.Source§fn start_animation(
&self,
property_name: &str,
animation: &dyn ICompositionAnimation,
)
fn start_animation( &self, property_name: &str, animation: &dyn ICompositionAnimation, )
Connects an animation with the named property of the object and
starts the animation.
Source§fn start_animation_with_final_value(
&self,
property_name: &str,
animation: &dyn ICompositionAnimation,
final_value: Option<ExpressionVariant>,
)
fn start_animation_with_final_value( &self, property_name: &str, animation: &dyn ICompositionAnimation, final_value: Option<ExpressionVariant>, )
See
start_animation. property_name may
name a sub-channel of a vector property (Offset.X, Scale.XY,
components X, Y, Z, W in any case): the animation then animates a
value of the sub-channel’s type (a scalar for one component, a
Vector2 for two, …) and leaves the other components alone. Several
sub-channels of one property run together; an animation of the whole
property replaces them.Source§fn start_animation_with_controller(
&self,
property_name: &str,
animation: &dyn ICompositionAnimation,
controller: &Rc<AnimationController>,
)
fn start_animation_with_controller( &self, property_name: &str, animation: &dyn ICompositionAnimation, controller: &Rc<AnimationController>, )
StartAnimation(propertyName, animation, animationController): starts
the animation under controller, which can pause, resume, scrub and
speed it up. property_name may name a sub-channel, as for
start_animation.Source§fn try_get_animation_controller(
&self,
property_name: &str,
) -> Option<Rc<AnimationController>>
fn try_get_animation_controller( &self, property_name: &str, ) -> Option<Rc<AnimationController>>
The controller of the animation of the named property
(
TryGetAnimationController): the controller it was started with, or
a new controller that takes the running animation over. None when no
animation was started on the property through this object, or it was
stopped.Source§fn stop_animation(&self, property_name: &str)
fn stop_animation(&self, property_name: &str)
Disconnects an animation from the named property and stops it,
applying its stop behavior.
property_name may name a sub-channel
(Offset.X): the animations of the sub-channels that share a
component with it are stopped.Source§fn start_animation_group(&self, grp: &dyn ICompositionAnimationBase)
fn start_animation_group(&self, grp: &dyn ICompositionAnimationBase)
Starts an animation group.
The StartAnimationGroup method on CompositionObject lets you start CompositionAnimationGroup.
All the animations in the group will be started at the same time on the object.
Source§fn start_animation_group_part(
&self,
animation: &dyn ICompositionAnimation,
target: &str,
final_value: ExpressionVariant,
) -> bool
fn start_animation_group_part( &self, animation: &dyn ICompositionAnimation, target: &str, final_value: ExpressionVariant, ) -> bool
StartAnimationGroupPart.Source§fn start_animation_group_for(
&self,
grp: &dyn ICompositionAnimationBase,
target: &str,
final_value: ExpressionVariant,
) -> bool
fn start_animation_group_for( &self, grp: &dyn ICompositionAnimationBase, target: &str, final_value: ExpressionVariant, ) -> bool
Starts an animation or an animation group triggered by the change
of property
target to final_value. Returns whether one of the
animations targets that property.Source§fn stop_animation_group(&self, grp: &dyn ICompositionAnimationBase)
fn stop_animation_group(&self, grp: &dyn ICompositionAnimationBase)
Stops an animation group.
Source§impl ICompositionObjectHost for CompositionGeometry
impl ICompositionObjectHost for CompositionGeometry
Source§fn server(&self) -> ServerObjectId
fn server(&self) -> ServerObjectId
The id of the server-side counterpart of the object.
Source§fn pending_animations(&self) -> &PendingAnimations
fn pending_animations(&self) -> &PendingAnimations
The animations waiting to be sent with the next batch.
Source§fn implicit_animation(
&self,
property_name: &str,
) -> Option<Rc<dyn ICompositionAnimationBase>>
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)).Source§fn start_animation_group(
&self,
grp: &Rc<dyn ICompositionAnimationBase>,
target: &str,
final_value: ExpressionVariant,
) -> bool
fn start_animation_group( &self, grp: &Rc<dyn ICompositionAnimationBase>, target: &str, final_value: ExpressionVariant, ) -> bool
Starts an animation or an animation group triggered by the change
of property
target to final_value. Returns whether one of the
animations targets that property.Source§impl ICompositorSerializable for CompositionGeometry
impl ICompositorSerializable for CompositionGeometry
Source§fn try_get_server(&self, c: &Compositor) -> Option<ServerObjectId>
fn try_get_server(&self, c: &Compositor) -> Option<ServerObjectId>
The server-side counterpart of the object on compositor
c, if it
has one.Source§fn serialize_changes(&self, c: &Compositor, writer: &mut BatchStreamWriter<'_>)
fn serialize_changes(&self, c: &Compositor, writer: &mut BatchStreamWriter<'_>)
Writes the pending changes of the object for compositor
c.Source§fn serialization_key(&self) -> *const ()
fn serialization_key(&self) -> *const ()
The identity of the object, by which a compositor avoids queueing
it twice. The default is the address of the implementing value; an
adapter around an object returns the identity of that object.
Source§fn prepare_serialization(&self, _c: &Compositor)
fn prepare_serialization(&self, _c: &Compositor)
Called before the changes of the object are written for compositor
c. Read moreAuto Trait Implementations§
impl !Freeze for CompositionGeometry
impl !RefUnwindSafe for CompositionGeometry
impl !Send for CompositionGeometry
impl !Sync for CompositionGeometry
impl !UnwindSafe for CompositionGeometry
impl Unpin for CompositionGeometry
impl UnsafeUnpin for CompositionGeometry
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
Mutably borrows from an owned value. Read more
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
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