pub struct CompositionShape { /* private fields */ }Expand description
A shape of a shape visual (WinUI
Microsoft.UI.Composition.CompositionShape), with its own animatable
transform in the space of its parent (CenterPoint, Offset,
RotationAngle, Scale, TransformMatrix), applied as the transform of
a visual: the transform matrix, the scale and the rotation about the
center point, then the offset.
Implementations§
Source§impl CompositionShape
impl CompositionShape
Sourcepub fn shape_props(&self) -> &CompositionShapeProps
pub fn shape_props(&self) -> &CompositionShapeProps
The generated properties of CompositionShape.
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 shape.
pub fn is_disposed(&self) -> bool
pub fn dispose(&self)
Sourcepub fn center_point(&self) -> Vector
pub fn center_point(&self) -> Vector
The point the shape is scaled and rotated about.
pub fn set_center_point(&self, value: Vector)
pub fn set_offset(&self, value: Vector)
Sourcepub fn rotation_angle(&self) -> f32
pub fn rotation_angle(&self) -> f32
The rotation of the shape about its center point, in radians.
pub fn set_rotation_angle(&self, value: f32)
Sourcepub fn rotation_angle_in_degrees(&self) -> f32
pub fn rotation_angle_in_degrees(&self) -> f32
The rotation of the shape in degrees: a view of
rotation_angle.
Deviation (winui-composition.md): not an animation target, as for the clips.
pub fn set_rotation_angle_in_degrees(&self, value: f32)
pub fn set_scale(&self, value: Vector)
Sourcepub fn transform_matrix(&self) -> Matrix
pub fn transform_matrix(&self) -> Matrix
The transform matrix of the shape (WinUI Matrix3x2).
pub fn set_transform_matrix(&self, value: Matrix)
Trait Implementations§
Source§impl AsCompositionObject for CompositionShape
impl AsCompositionObject for CompositionShape
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 CompositionContainerShapeHooks for CompositionShape
impl CompositionContainerShapeHooks for CompositionShape
fn initialize_defaults_extra(&self)
fn validate_shapes_change( &self, _old_value: &Option<Rc<dyn ICompositionObject>>, _new_value: &Option<Rc<dyn ICompositionObject>>, )
fn on_shapes_changed(&self)
fn on_shapes_changing(&self)
Source§impl CompositionShapeCollectionHooks<CompositionShape> for CompositionShapeCollection
impl CompositionShapeCollectionHooks<CompositionShape> for CompositionShapeCollection
fn initialize_defaults_extra(&self)
fn on_before_added(&self, _item: &Rc<TItem>)
fn on_added(&self, _item: &Rc<TItem>)
fn on_removed(&self, _item: &Rc<TItem>)
fn on_before_clear(&self)
fn on_before_replace(&self, _old_item: &Rc<TItem>, _new_item: &Rc<TItem>)
fn on_replace(&self, _old_item: &Rc<TItem>, _new_item: &Rc<TItem>)
fn on_clear(&self)
Source§impl CompositionShapeHooks for CompositionShape
impl CompositionShapeHooks for CompositionShape
fn initialize_defaults_extra(&self)
fn validate_center_point_change(&self, _old_value: Vector, _new_value: Vector)
fn on_center_point_changed(&self)
fn on_center_point_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_rotation_angle_change(&self, _old_value: f32, _new_value: f32)
fn on_rotation_angle_changed(&self)
fn on_rotation_angle_changing(&self)
fn validate_scale_change(&self, _old_value: Vector, _new_value: Vector)
fn on_scale_changed(&self)
fn on_scale_changing(&self)
fn validate_transform_matrix_change( &self, _old_value: Matrix, _new_value: Matrix, )
fn on_transform_matrix_changed(&self)
fn on_transform_matrix_changing(&self)
Source§impl CompositionSpriteShapeHooks for CompositionShape
impl CompositionSpriteShapeHooks for CompositionShape
fn initialize_defaults_extra(&self)
fn validate_fill_brush_change( &self, _old_value: &Option<Rc<dyn ICompositionObject>>, _new_value: &Option<Rc<dyn ICompositionObject>>, )
fn on_fill_brush_changed(&self)
fn on_fill_brush_changing(&self)
fn validate_geometry_change( &self, _old_value: &Option<Rc<dyn ICompositionObject>>, _new_value: &Option<Rc<dyn ICompositionObject>>, )
fn on_geometry_changed(&self)
fn on_geometry_changing(&self)
fn validate_is_stroke_non_scaling_change( &self, _old_value: bool, _new_value: bool, )
fn on_is_stroke_non_scaling_changed(&self)
fn on_is_stroke_non_scaling_changing(&self)
fn validate_stroke_brush_change( &self, _old_value: &Option<Rc<dyn ICompositionObject>>, _new_value: &Option<Rc<dyn ICompositionObject>>, )
fn on_stroke_brush_changed(&self)
fn on_stroke_brush_changing(&self)
fn validate_stroke_dash_array_change( &self, _old_value: &Option<Arc<Vec<f32>>>, _new_value: &Option<Arc<Vec<f32>>>, )
fn on_stroke_dash_array_changed(&self)
fn on_stroke_dash_array_changing(&self)
fn validate_stroke_dash_cap_change( &self, _old_value: CompositionStrokeCap, _new_value: CompositionStrokeCap, )
fn on_stroke_dash_cap_changed(&self)
fn on_stroke_dash_cap_changing(&self)
fn validate_stroke_dash_offset_change(&self, _old_value: f32, _new_value: f32)
fn on_stroke_dash_offset_changed(&self)
fn on_stroke_dash_offset_changing(&self)
fn validate_stroke_end_cap_change( &self, _old_value: CompositionStrokeCap, _new_value: CompositionStrokeCap, )
fn on_stroke_end_cap_changed(&self)
fn on_stroke_end_cap_changing(&self)
fn validate_stroke_line_join_change( &self, _old_value: CompositionStrokeLineJoin, _new_value: CompositionStrokeLineJoin, )
fn on_stroke_line_join_changed(&self)
fn on_stroke_line_join_changing(&self)
fn validate_stroke_miter_limit_change(&self, _old_value: f32, _new_value: f32)
fn on_stroke_miter_limit_changed(&self)
fn on_stroke_miter_limit_changing(&self)
fn validate_stroke_start_cap_change( &self, _old_value: CompositionStrokeCap, _new_value: CompositionStrokeCap, )
fn on_stroke_start_cap_changed(&self)
fn on_stroke_start_cap_changing(&self)
fn validate_stroke_thickness_change(&self, _old_value: f32, _new_value: f32)
fn on_stroke_thickness_changed(&self)
fn on_stroke_thickness_changing(&self)
Source§impl ICompositionObjectAnimations for CompositionShape
impl ICompositionObjectAnimations for CompositionShape
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 CompositionShape
impl ICompositionObjectHost for CompositionShape
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 CompositionShape
impl ICompositorSerializable for CompositionShape
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 CompositionShape
impl !RefUnwindSafe for CompositionShape
impl !Send for CompositionShape
impl !Sync for CompositionShape
impl !UnwindSafe for CompositionShape
impl Unpin for CompositionShape
impl UnsafeUnpin for CompositionShape
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