pub struct CompositionVisual { /* private fields */ }Expand description
A node of the composition visual tree.
Implementations§
Source§impl CompositionVisual
impl CompositionVisual
pub fn visible(&self) -> bool
pub fn set_visible(&self, value: bool)
pub fn opacity(&self) -> f32
pub fn set_opacity(&self, value: f32)
Sourcepub fn clip(&self) -> Option<Arc<dyn IGeometryImpl>>
pub fn clip(&self) -> Option<Arc<dyn IGeometryImpl>>
The geometry the visual is clipped with.
pub fn set_clip(&self, value: Option<Arc<dyn IGeometryImpl>>)
pub fn clip_to_bounds(&self) -> bool
pub fn set_clip_to_bounds(&self, value: bool)
pub fn offset(&self) -> Vector3D
pub fn set_offset(&self, value: Vector3D)
pub fn translation(&self) -> Vector3D
pub fn set_translation(&self, value: Vector3D)
pub fn size(&self) -> Vector
pub fn set_size(&self, value: Vector)
pub fn anchor_point(&self) -> Vector
pub fn set_anchor_point(&self, value: Vector)
pub fn center_point(&self) -> Vector3D
pub fn set_center_point(&self, value: Vector3D)
pub fn rotation_angle(&self) -> f32
pub fn set_rotation_angle(&self, value: f32)
pub fn orientation(&self) -> Quaternion
pub fn set_orientation(&self, value: Quaternion)
pub fn scale(&self) -> Vector3D
pub fn set_scale(&self, value: Vector3D)
pub fn transform_matrix(&self) -> Matrix
pub fn set_transform_matrix(&self, value: Matrix)
Sourcepub fn adorner_is_clipped(&self) -> bool
pub fn adorner_is_clipped(&self) -> bool
Whether the adorner is clipped by the clips of the adorned visual and its ancestors.
pub fn set_adorner_is_clipped(&self, value: bool)
pub fn effect(&self) -> Option<Arc<dyn IImmutableEffect>>
pub fn set_effect(&self, value: Option<Arc<dyn IImmutableEffect>>)
pub fn render_options(&self) -> RenderOptions
pub fn set_render_options(&self, value: RenderOptions)
pub fn text_options(&self) -> TextOptions
pub fn set_text_options(&self, value: TextOptions)
Source§impl CompositionVisual
impl CompositionVisual
Sourcepub fn visual_props(&self) -> &CompositionVisualProps
pub fn visual_props(&self) -> &CompositionVisualProps
The generated properties of the visual class.
pub fn compositor(&self) -> &Rc<Compositor>
Sourcepub fn object(&self) -> &CompositionObject
pub fn object(&self) -> &CompositionObject
The embedded CompositionObject.
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 server(&self) -> ServerObjectId
pub fn server(&self) -> ServerObjectId
The id of the server-side visual.
pub fn is_disposed(&self) -> bool
pub fn dispose(&self)
Sourcepub fn children(&self) -> &Rc<CompositionVisualCollection>
pub fn children(&self) -> &Rc<CompositionVisualCollection>
The children of the visual.
Sourcepub fn root(&self) -> Option<Rc<CompositionTarget>>
pub fn root(&self) -> Option<Rc<CompositionTarget>>
The composition target the visual is attached to.
pub fn parent(&self) -> Option<Rc<CompositionVisual>>
Sourcepub fn adorned_visual(&self) -> Option<Rc<CompositionVisual>>
pub fn adorned_visual(&self) -> Option<Rc<CompositionVisual>>
The visual this visual is an adorner of: its transform follows that visual.
pub fn set_adorned_visual(&self, value: Option<Rc<CompositionVisual>>)
pub fn cache_mode(&self) -> Option<Rc<CompositionBitmapCache>>
pub fn set_cache_mode(&self, value: Option<Rc<CompositionBitmapCache>>)
pub fn disable_sub_tree_bounds_hit_test_optimization(&self) -> bool
pub fn opacity_mask(&self) -> Option<Rc<dyn IBrush>>
pub fn set_opacity_mask(&self, value: Option<Rc<dyn IBrush>>)
Sourcepub fn try_get_valid_readback(&self) -> Option<ReadbackData>
pub fn try_get_valid_readback(&self) -> Option<ReadbackData>
The data the server wrote back for this visual, if it is valid for the current read revision.
pub fn tag(&self) -> Option<Rc<dyn Any>>
pub fn set_tag(&self, value: Option<Rc<dyn Any>>)
Sourcepub fn hit_test(&self, point: Point) -> bool
pub fn hit_test(&self, point: Point) -> bool
Whether the content of the visual is hit at a point in its own coordinates.
Sourcepub fn hit_test_geometry(&self, geometry: &Ref<Geometry>) -> IntersectionResult
pub fn hit_test_geometry(&self, geometry: &Ref<Geometry>) -> IntersectionResult
How the content of the visual intersects a geometry in its own coordinates.
Trait Implementations§
Source§impl AsCompositionObject for CompositionVisual
impl AsCompositionObject for CompositionVisual
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 CompositionContainerVisualHooks for CompositionVisual
impl CompositionContainerVisualHooks for CompositionVisual
fn initialize_defaults_extra(&self)
Source§impl CompositionExperimentalAcrylicVisualHooks for CompositionVisual
impl CompositionExperimentalAcrylicVisualHooks for CompositionVisual
Source§fn base_serialize_changes_core(&self, writer: &mut BatchStreamWriter<'_>)
fn base_serialize_changes_core(&self, writer: &mut BatchStreamWriter<'_>)
base.SerializeChangesCore(writer): serializes the changes of the
hand-written base class CompositionDrawListVisual.fn initialize_defaults_extra(&self)
fn validate_material_change( &self, _old_value: ImmutableExperimentalAcrylicMaterial, _new_value: ImmutableExperimentalAcrylicMaterial, )
fn on_material_changed(&self)
fn on_material_changing(&self)
fn validate_corner_radius_change( &self, _old_value: CornerRadius, _new_value: CornerRadius, )
fn on_corner_radius_changed(&self)
fn on_corner_radius_changing(&self)
Source§impl CompositionSolidColorVisualHooks for CompositionVisual
impl CompositionSolidColorVisualHooks for CompositionVisual
fn initialize_defaults_extra(&self)
fn validate_color_change(&self, _old_value: Color, _new_value: Color)
fn on_color_changed(&self)
fn on_color_changing(&self)
Source§impl CompositionSurfaceVisualHooks for CompositionVisual
impl CompositionSurfaceVisualHooks for CompositionVisual
fn initialize_defaults_extra(&self)
fn validate_surface_change( &self, _old_value: &Option<Rc<dyn ICompositionObject>>, _new_value: &Option<Rc<dyn ICompositionObject>>, )
fn on_surface_changed(&self)
fn on_surface_changing(&self)
Source§impl CompositionVisualCollectionHooks<CompositionVisual> for CompositionVisualCollection
impl CompositionVisualCollectionHooks<CompositionVisual> for CompositionVisualCollection
fn on_added(&self, item: &Rc<CompositionVisual>)
fn on_before_replace( &self, old_item: &Rc<CompositionVisual>, new_item: &Rc<CompositionVisual>, )
fn on_replace( &self, old_item: &Rc<CompositionVisual>, new_item: &Rc<CompositionVisual>, )
fn on_removed(&self, item: &Rc<CompositionVisual>)
fn on_before_clear(&self)
fn on_clear(&self)
fn on_before_added(&self, item: &Rc<CompositionVisual>)
fn initialize_defaults_extra(&self)
Source§impl CompositionVisualHooks for CompositionVisual
impl CompositionVisualHooks for CompositionVisual
fn on_root_changed(&self)
fn on_parent_changing(&self)
fn on_parent_changed(&self)
fn initialize_defaults_extra(&self)
fn validate_root_change( &self, _old_value: &Option<Rc<dyn ICompositionObject>>, _new_value: &Option<Rc<dyn ICompositionObject>>, )
fn on_root_changing(&self)
fn validate_parent_change( &self, _old_value: &Option<Rc<dyn ICompositionObject>>, _new_value: &Option<Rc<dyn ICompositionObject>>, )
fn validate_visible_change(&self, _old_value: bool, _new_value: bool)
fn on_visible_changed(&self)
fn on_visible_changing(&self)
fn validate_opacity_change(&self, _old_value: f32, _new_value: f32)
fn on_opacity_changed(&self)
fn on_opacity_changing(&self)
fn validate_clip_change( &self, _old_value: &Option<Arc<dyn IGeometryImpl>>, _new_value: &Option<Arc<dyn IGeometryImpl>>, )
fn on_clip_changed(&self)
fn on_clip_changing(&self)
fn validate_clip_to_bounds_change(&self, _old_value: bool, _new_value: bool)
fn on_clip_to_bounds_changed(&self)
fn on_clip_to_bounds_changing(&self)
fn validate_offset_change(&self, _old_value: Vector3D, _new_value: Vector3D)
fn on_offset_changed(&self)
fn on_offset_changing(&self)
fn validate_translation_change( &self, _old_value: Vector3D, _new_value: Vector3D, )
fn on_translation_changed(&self)
fn on_translation_changing(&self)
fn validate_size_change(&self, _old_value: Vector, _new_value: Vector)
fn on_size_changed(&self)
fn on_size_changing(&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: Vector3D, _new_value: Vector3D, )
fn on_center_point_changed(&self)
fn on_center_point_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_orientation_change( &self, _old_value: Quaternion, _new_value: Quaternion, )
fn on_orientation_changed(&self)
fn on_orientation_changing(&self)
fn validate_scale_change(&self, _old_value: Vector3D, _new_value: Vector3D)
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)
fn validate_adorned_visual_change( &self, _old_value: &Option<Rc<dyn ICompositionObject>>, _new_value: &Option<Rc<dyn ICompositionObject>>, )
fn on_adorned_visual_changed(&self)
fn on_adorned_visual_changing(&self)
fn validate_adorner_is_clipped_change(&self, _old_value: bool, _new_value: bool)
fn on_adorner_is_clipped_changed(&self)
fn on_adorner_is_clipped_changing(&self)
fn validate_opacity_mask_brush_change( &self, _old_value: &Option<BatchResource<dyn IBrush>>, _new_value: &Option<BatchResource<dyn IBrush>>, )
fn on_opacity_mask_brush_changed(&self)
fn on_opacity_mask_brush_changing(&self)
fn validate_effect_change( &self, _old_value: &Option<Arc<dyn IImmutableEffect>>, _new_value: &Option<Arc<dyn IImmutableEffect>>, )
fn on_effect_changed(&self)
fn on_effect_changing(&self)
fn validate_render_options_change( &self, _old_value: RenderOptions, _new_value: RenderOptions, )
fn on_render_options_changed(&self)
fn on_render_options_changing(&self)
fn validate_text_options_change( &self, _old_value: TextOptions, _new_value: TextOptions, )
fn on_text_options_changed(&self)
fn on_text_options_changing(&self)
fn validate_cache_mode_change( &self, _old_value: &Option<Rc<dyn ICompositionObject>>, _new_value: &Option<Rc<dyn ICompositionObject>>, )
fn on_cache_mode_changed(&self)
fn on_cache_mode_changing(&self)
Source§impl ICompositionObjectAnimations for CompositionVisual
impl ICompositionObjectAnimations for CompositionVisual
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.
fn start_animation_with_final_value( &self, property_name: &str, animation: &dyn ICompositionAnimation, final_value: Option<ExpressionVariant>, )
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.
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 CompositionVisual
impl ICompositionObjectHost for CompositionVisual
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 CompositionVisual
impl ICompositorSerializable for CompositionVisual
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 CompositionVisual
impl !RefUnwindSafe for CompositionVisual
impl !Send for CompositionVisual
impl !Sync for CompositionVisual
impl !UnwindSafe for CompositionVisual
impl Unpin for CompositionVisual
impl UnsafeUnpin for CompositionVisual
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