pub struct CompositionClip { /* private fields */ }Expand description
A clip of a visual (WinUI Microsoft.UI.Composition.CompositionClip):
the area of the visual that stays visible, with its own animatable
transform (AnchorPoint, CenterPoint, Offset, RotationAngle,
Scale, TransformMatrix) in the space of the visual.
Deviation (winui-composition.md): AnchorPoint is relative to the size of
the visual the clip is set on; RotationAngleInDegrees is a view of
RotationAngle and cannot be the target of an animation.
Implementations§
Source§impl CompositionClip
impl CompositionClip
Sourcepub fn clip_props(&self) -> &CompositionClipProps
pub fn clip_props(&self) -> &CompositionClipProps
The generated properties of CompositionClip.
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 clip.
pub fn is_disposed(&self) -> bool
pub fn dispose(&self)
Sourcepub fn anchor_point(&self) -> Vector
pub fn anchor_point(&self) -> Vector
The point of the clip, relative to the size of the visual, that is
placed at offset.
pub fn set_anchor_point(&self, value: Vector)
Sourcepub fn center_point(&self) -> Vector
pub fn center_point(&self) -> Vector
The point the clip 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 clip 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 clip in degrees: a view of
rotation_angle.
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 clip (WinUI Matrix3x2).
pub fn set_transform_matrix(&self, value: Matrix)
Trait Implementations§
Source§impl AsCompositionObject for CompositionClip
impl AsCompositionObject for CompositionClip
Source§fn as_composition_object(&self) -> &CompositionObject
fn as_composition_object(&self) -> &CompositionObject
CompositionObject.Source§fn composition_type_name(&self) -> &'static str
fn composition_type_name(&self) -> &'static str
Source§fn as_property_set(self: Rc<Self>) -> Option<Rc<CompositionPropertySet>>
fn as_property_set(self: Rc<Self>) -> Option<Rc<CompositionPropertySet>>
is CompositionPropertySet test of upstream).Source§impl CompositionClipHooks for CompositionClip
impl CompositionClipHooks for CompositionClip
fn initialize_defaults_extra(&self)
fn validate_anchor_point_change(&self, _old_value: Vector, _new_value: Vector)
fn on_anchor_point_changed(&self)
fn on_anchor_point_changing(&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 GeometricClipHooks for CompositionClip
impl GeometricClipHooks for CompositionClip
fn initialize_defaults_extra(&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_view_box_change( &self, _old_value: &Option<Rc<dyn ICompositionObject>>, _new_value: &Option<Rc<dyn ICompositionObject>>, )
fn on_view_box_changed(&self)
fn on_view_box_changing(&self)
Source§impl ICompositionObject for CompositionClip
impl ICompositionObject for CompositionClip
Source§impl ICompositionObjectAnimations for CompositionClip
impl ICompositionObjectAnimations for CompositionClip
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>
Source§fn composition_object(&self) -> &CompositionObject
fn composition_object(&self) -> &CompositionObject
CompositionObject.Source§fn start_animation(
&self,
property_name: &str,
animation: &dyn ICompositionAnimation,
)
fn start_animation( &self, property_name: &str, animation: &dyn ICompositionAnimation, )
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>, )
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>>
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)
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)
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
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)
Source§impl ICompositionObjectHost for CompositionClip
impl ICompositionObjectHost for CompositionClip
Source§fn server(&self) -> ServerObjectId
fn server(&self) -> ServerObjectId
Source§fn pending_animations(&self) -> &PendingAnimations
fn pending_animations(&self) -> &PendingAnimations
Source§fn implicit_animation(
&self,
property_name: &str,
) -> Option<Rc<dyn ICompositionAnimationBase>>
fn implicit_animation( &self, property_name: &str, ) -> Option<Rc<dyn ICompositionAnimationBase>>
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
target to final_value. Returns whether one of the
animations targets that property.Source§impl ICompositorSerializable for CompositionClip
impl ICompositorSerializable for CompositionClip
Source§fn try_get_server(&self, c: &Compositor) -> Option<ServerObjectId>
fn try_get_server(&self, c: &Compositor) -> Option<ServerObjectId>
c, if it
has one.Source§fn serialize_changes(&self, c: &Compositor, writer: &mut BatchStreamWriter<'_>)
fn serialize_changes(&self, c: &Compositor, writer: &mut BatchStreamWriter<'_>)
c.Source§fn serialization_key(&self) -> *const ()
fn serialization_key(&self) -> *const ()
Source§fn prepare_serialization(&self, _c: &Compositor)
fn prepare_serialization(&self, _c: &Compositor)
c. Read moreSource§impl IRegisterForSerialization for CompositionClip
impl IRegisterForSerialization for CompositionClip
fn register_for_serialization(&self)
Source§impl InsetClipHooks for CompositionClip
impl InsetClipHooks for CompositionClip
fn initialize_defaults_extra(&self)
fn validate_left_inset_change(&self, _old_value: f32, _new_value: f32)
fn on_left_inset_changed(&self)
fn on_left_inset_changing(&self)
fn validate_top_inset_change(&self, _old_value: f32, _new_value: f32)
fn on_top_inset_changed(&self)
fn on_top_inset_changing(&self)
fn validate_right_inset_change(&self, _old_value: f32, _new_value: f32)
fn on_right_inset_changed(&self)
fn on_right_inset_changing(&self)
fn validate_bottom_inset_change(&self, _old_value: f32, _new_value: f32)
fn on_bottom_inset_changed(&self)
fn on_bottom_inset_changing(&self)
Source§impl RectangleClipHooks for CompositionClip
impl RectangleClipHooks for CompositionClip
fn initialize_defaults_extra(&self)
fn validate_left_change(&self, _old_value: f32, _new_value: f32)
fn on_left_changed(&self)
fn on_left_changing(&self)
fn validate_top_change(&self, _old_value: f32, _new_value: f32)
fn on_top_changed(&self)
fn on_top_changing(&self)
fn validate_right_change(&self, _old_value: f32, _new_value: f32)
fn on_right_changed(&self)
fn on_right_changing(&self)
fn validate_bottom_change(&self, _old_value: f32, _new_value: f32)
fn on_bottom_changed(&self)
fn on_bottom_changing(&self)
fn validate_top_left_radius_change( &self, _old_value: Vector, _new_value: Vector, )
fn on_top_left_radius_changed(&self)
fn on_top_left_radius_changing(&self)
fn validate_top_right_radius_change( &self, _old_value: Vector, _new_value: Vector, )
fn on_top_right_radius_changed(&self)
fn on_top_right_radius_changing(&self)
fn validate_bottom_left_radius_change( &self, _old_value: Vector, _new_value: Vector, )
fn on_bottom_left_radius_changed(&self)
fn on_bottom_left_radius_changing(&self)
fn validate_bottom_right_radius_change( &self, _old_value: Vector, _new_value: Vector, )
fn on_bottom_right_radius_changed(&self)
fn on_bottom_right_radius_changing(&self)
Auto Trait Implementations§
impl !Freeze for CompositionClip
impl !RefUnwindSafe for CompositionClip
impl !Send for CompositionClip
impl !Sync for CompositionClip
impl !UnwindSafe for CompositionClip
impl Unpin for CompositionClip
impl UnsafeUnpin for CompositionClip
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