Skip to main content

CompositionShape

Struct CompositionShape 

Source
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

Source

pub fn shape_props(&self) -> &CompositionShapeProps

The generated properties of CompositionShape.

Source

pub fn compositor(&self) -> &Rc<Compositor>

Source

pub fn object(&self) -> &CompositionObject

The embedded CompositionObject.

Source

pub fn server(&self) -> ServerObjectId

The id of the server-side shape.

Source

pub fn is_disposed(&self) -> bool

Source

pub fn dispose(&self)

Source

pub fn type_name(&self) -> &'static str

The name of the concrete class, for messages.

Source

pub fn center_point(&self) -> Vector

The point the shape is scaled and rotated about.

Source

pub fn set_center_point(&self, value: Vector)

Source

pub fn offset(&self) -> Vector

The offset of the shape in the space of its parent.

Source

pub fn set_offset(&self, value: Vector)

Source

pub fn rotation_angle(&self) -> f32

The rotation of the shape about its center point, in radians.

Source

pub fn set_rotation_angle(&self, value: f32)

Source

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.

Source

pub fn set_rotation_angle_in_degrees(&self, value: f32)

Source

pub fn scale(&self) -> Vector

The scale of the shape about its center point (default (1, 1)).

Source

pub fn set_scale(&self, value: Vector)

Source

pub fn transform_matrix(&self) -> Matrix

The transform matrix of the shape (WinUI Matrix3x2).

Source

pub fn set_transform_matrix(&self, value: Matrix)

Trait Implementations§

Source§

impl AsCompositionObject for CompositionShape

Source§

fn as_composition_object(&self) -> &CompositionObject

The embedded CompositionObject.
Source§

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>>

The object as a property set, if it is one (the is CompositionPropertySet test of upstream).
Source§

impl CompositionContainerShapeHooks for CompositionShape

Source§

impl CompositionShapeCollectionHooks<CompositionShape> for CompositionShapeCollection

Source§

fn initialize_defaults_extra(&self)

Source§

fn on_before_added(&self, _item: &Rc<TItem>)

Source§

fn on_added(&self, _item: &Rc<TItem>)

Source§

fn on_removed(&self, _item: &Rc<TItem>)

Source§

fn on_before_clear(&self)

Source§

fn on_before_replace(&self, _old_item: &Rc<TItem>, _new_item: &Rc<TItem>)

Source§

fn on_replace(&self, _old_item: &Rc<TItem>, _new_item: &Rc<TItem>)

Source§

fn on_clear(&self)

Source§

impl CompositionShapeHooks for CompositionShape

Source§

impl CompositionSpriteShapeHooks for CompositionShape

Source§

fn initialize_defaults_extra(&self)

Source§

fn validate_fill_brush_change( &self, _old_value: &Option<Rc<dyn ICompositionObject>>, _new_value: &Option<Rc<dyn ICompositionObject>>, )

Source§

fn on_fill_brush_changed(&self)

Source§

fn on_fill_brush_changing(&self)

Source§

fn validate_geometry_change( &self, _old_value: &Option<Rc<dyn ICompositionObject>>, _new_value: &Option<Rc<dyn ICompositionObject>>, )

Source§

fn on_geometry_changed(&self)

Source§

fn on_geometry_changing(&self)

Source§

fn validate_is_stroke_non_scaling_change( &self, _old_value: bool, _new_value: bool, )

Source§

fn on_is_stroke_non_scaling_changed(&self)

Source§

fn on_is_stroke_non_scaling_changing(&self)

Source§

fn validate_stroke_brush_change( &self, _old_value: &Option<Rc<dyn ICompositionObject>>, _new_value: &Option<Rc<dyn ICompositionObject>>, )

Source§

fn on_stroke_brush_changed(&self)

Source§

fn on_stroke_brush_changing(&self)

Source§

fn validate_stroke_dash_array_change( &self, _old_value: &Option<Arc<Vec<f32>>>, _new_value: &Option<Arc<Vec<f32>>>, )

Source§

fn on_stroke_dash_array_changed(&self)

Source§

fn on_stroke_dash_array_changing(&self)

Source§

fn validate_stroke_dash_cap_change( &self, _old_value: CompositionStrokeCap, _new_value: CompositionStrokeCap, )

Source§

fn on_stroke_dash_cap_changed(&self)

Source§

fn on_stroke_dash_cap_changing(&self)

Source§

fn validate_stroke_dash_offset_change(&self, _old_value: f32, _new_value: f32)

Source§

fn on_stroke_dash_offset_changed(&self)

Source§

fn on_stroke_dash_offset_changing(&self)

Source§

fn validate_stroke_end_cap_change( &self, _old_value: CompositionStrokeCap, _new_value: CompositionStrokeCap, )

Source§

fn on_stroke_end_cap_changed(&self)

Source§

fn on_stroke_end_cap_changing(&self)

Source§

fn validate_stroke_line_join_change( &self, _old_value: CompositionStrokeLineJoin, _new_value: CompositionStrokeLineJoin, )

Source§

fn on_stroke_line_join_changed(&self)

Source§

fn on_stroke_line_join_changing(&self)

Source§

fn validate_stroke_miter_limit_change(&self, _old_value: f32, _new_value: f32)

Source§

fn on_stroke_miter_limit_changed(&self)

Source§

fn on_stroke_miter_limit_changing(&self)

Source§

fn validate_stroke_start_cap_change( &self, _old_value: CompositionStrokeCap, _new_value: CompositionStrokeCap, )

Source§

fn on_stroke_start_cap_changed(&self)

Source§

fn on_stroke_start_cap_changing(&self)

Source§

fn validate_stroke_thickness_change(&self, _old_value: f32, _new_value: f32)

Source§

fn on_stroke_thickness_changed(&self)

Source§

fn on_stroke_thickness_changing(&self)

Source§

impl ICompositionObject for CompositionShape

Source§

fn server(&self) -> ServerObjectId

The id of the server-side counterpart of the object.
Source§

fn as_any(&self) -> &dyn Any

Source§

fn into_any_rc(self: Rc<Self>) -> Rc<dyn Any>

Source§

impl ICompositionObjectAnimations for CompositionShape

Source§

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>

The composition property with the given name.
Source§

fn composition_object(&self) -> &CompositionObject

The embedded CompositionObject.
Source§

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>, )

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>, )

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>>

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)

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)

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

StartAnimationGroupPart.
Source§

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)

Stops an animation group.
Source§

impl ICompositionObjectHost for CompositionShape

Source§

fn server(&self) -> ServerObjectId

The id of the server-side counterpart of the object.
Source§

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>>

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

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

Source§

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<'_>)

Writes the pending changes of the object for compositor c.
Source§

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)

Called before the changes of the object are written for compositor c. Read more
Source§

impl IRegisterForSerialization for CompositionShape

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.