FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    CompositionVisual

    struct · ferroui-base · v0.5.0

    struct CompositionVisual
    

    A node of the composition visual tree.

    View source

    Members

    rotation_angle_in_degrees

    fn rotation_angle_in_degrees(self: &Self) -> f32
    

    The rotation about the rotation axis in degrees: a view of rotation_angle.

    Deviation (winui-composition.md): not an animation target of its own; animate RotationAngle.

    Source

    set_rotation_angle_in_degrees

    fn set_rotation_angle_in_degrees(self: &Self, value: f32)
    

    Source

    rotation_axis

    fn rotation_axis(self: &Self) -> Vector3D
    

    The axis rotation_angle rotates about (default (0, 0, 1); animatable as RotationAxis).

    Deviation (winui-composition.md): an axis along Z (or a zero axis) rotates in the plane; any other axis rotates in 3D, of which the 2D renderers show the projection, as for Orientation.

    Source

    set_rotation_axis

    fn set_rotation_axis(self: &Self, value: Vector3D)
    

    Source

    relative_offset_adjustment

    fn relative_offset_adjustment(self: &Self) -> Vector3D
    

    The part of the size of the parent added to the offset: the offset of the visual is Offset + RelativeOffsetAdjustment * parent size (animatable as RelativeOffsetAdjustment; Z is not adjusted, the parent has no depth).

    Source

    set_relative_offset_adjustment

    fn set_relative_offset_adjustment(self: &Self, value: Vector3D)
    

    Source

    relative_size_adjustment

    fn relative_size_adjustment(self: &Self) -> Vector
    

    The part of the size of the parent added to the size: the size of the visual is Size + RelativeSizeAdjustment * parent size (animatable as RelativeSizeAdjustment). (1, 1) with a zero Size makes the visual as large as its parent.

    Source

    set_relative_size_adjustment

    fn set_relative_size_adjustment(self: &Self, value: Vector)
    

    Source

    effective_size

    fn effective_size(self: &Self) -> Vector
    

    The size of the visual with its relative size adjustment applied: what is rendered and hit tested. size is the Size property alone.

    Source

    is_hit_test_visible

    fn is_hit_test_visible(self: &Self) -> bool
    

    Whether the visual and its subtree take part in hit testing (default true).

    Source

    set_is_hit_test_visible

    fn set_is_hit_test_visible(self: &Self, value: bool)
    

    Source

    is_pixel_snapping_enabled

    fn is_pixel_snapping_enabled(self: &Self) -> bool
    

    Whether the offset of the visual is snapped to device pixels.

    Deviation (winui-composition.md): the translation of the transform of the visual relative to its parent is rounded to device pixels of its target, not its position in the window.

    Source

    set_is_pixel_snapping_enabled

    fn set_is_pixel_snapping_enabled(self: &Self, value: bool)
    

    Source

    border_mode

    fn border_mode(self: &Self) -> CompositionBorderMode
    

    How the edges of the visual are antialiased. Stored only.

    Source

    set_border_mode

    fn set_border_mode(self: &Self, value: CompositionBorderMode)
    

    Source

    backface_visibility

    fn backface_visibility(self: &Self) -> CompositionBackfaceVisibility
    

    Whether the back of the visual is shown when it is turned in 3D. Stored only.

    Source

    set_backface_visibility

    fn set_backface_visibility(self: &Self, value: CompositionBackfaceVisibility)
    

    Source

    composite_mode

    fn composite_mode(self: &Self) -> CompositionCompositeMode
    

    How the visual is blended with what is behind it. Stored only.

    Source

    set_composite_mode

    fn set_composite_mode(self: &Self, value: CompositionCompositeMode)
    

    Source

    parent_for_transform

    fn parent_for_transform(self: &Self) -> Option<Rc<CompositionVisual>>
    

    The visual whose coordinate space the transform of this visual is relative to, instead of its parent: the visual is drawn where its parent is, in the place its offset and transform give it inside parent_for_transform.

    Deviation (winui-composition.md): the two visuals must be in one tree (otherwise the transform is relative to the parent); clips and opacity still come from the parent chain.

    Source

    set_parent_for_transform

    fn set_parent_for_transform(self: &Self, value: Option<Rc<CompositionVisual>>)
    

    Source

    visible

    fn visible(self: &Self) -> bool
    

    Source

    set_visible

    fn set_visible(self: &Self, value: bool)
    

    Source

    opacity

    fn opacity(self: &Self) -> f32
    

    Source

    set_opacity

    fn set_opacity(self: &Self, value: f32)
    

    Source

    clip_to_bounds

    fn clip_to_bounds(self: &Self) -> bool
    

    Source

    set_clip_to_bounds

    fn set_clip_to_bounds(self: &Self, value: bool)
    

    Source

    offset

    fn offset(self: &Self) -> Vector3D
    

    Source

    set_offset

    fn set_offset(self: &Self, value: Vector3D)
    

    Source

    translation

    fn translation(self: &Self) -> Vector3D
    

    Source

    set_translation

    fn set_translation(self: &Self, value: Vector3D)
    

    Source

    size

    fn size(self: &Self) -> Vector
    

    Source

    set_size

    fn set_size(self: &Self, value: Vector)
    

    Source

    anchor_point

    fn anchor_point(self: &Self) -> Vector
    

    Source

    set_anchor_point

    fn set_anchor_point(self: &Self, value: Vector)
    

    Source

    center_point

    fn center_point(self: &Self) -> Vector3D
    

    Source

    set_center_point

    fn set_center_point(self: &Self, value: Vector3D)
    

    Source

    rotation_angle

    fn rotation_angle(self: &Self) -> f32
    

    Source

    set_rotation_angle

    fn set_rotation_angle(self: &Self, value: f32)
    

    Source

    orientation

    fn orientation(self: &Self) -> Quaternion
    

    Source

    set_orientation

    fn set_orientation(self: &Self, value: Quaternion)
    

    Source

    scale

    fn scale(self: &Self) -> Vector3D
    

    Source

    set_scale

    fn set_scale(self: &Self, value: Vector3D)
    

    Source

    transform_matrix

    fn transform_matrix(self: &Self) -> Matrix
    

    Source

    set_transform_matrix

    fn set_transform_matrix(self: &Self, value: Matrix)
    

    Source

    adorner_is_clipped

    fn adorner_is_clipped(self: &Self) -> bool
    

    Whether the adorner is clipped by the clips of the adorned visual and its ancestors.

    Source

    set_adorner_is_clipped

    fn set_adorner_is_clipped(self: &Self, value: bool)
    

    Source

    effect

    fn effect(self: &Self) -> Option<std::sync::Arc<dyn IImmutableEffect>>
    

    Source

    set_effect

    fn set_effect(self: &Self, value: Option<std::sync::Arc<dyn IImmutableEffect>>)
    

    Source

    render_options

    fn render_options(self: &Self) -> RenderOptions
    

    Source

    set_render_options

    fn set_render_options(self: &Self, value: RenderOptions)
    

    Source

    text_options

    fn text_options(self: &Self) -> TextOptions
    

    Source

    set_text_options

    fn set_text_options(self: &Self, value: TextOptions)
    

    Source

    compositor

    fn compositor(self: &Self) -> &Rc<Compositor>
    

    Source

    object

    fn object(self: &Self) -> &CompositionObject
    

    The embedded CompositionObject.

    Source

    implicit_animations

    fn implicit_animations(self: &Self) -> Option<Rc<ImplicitAnimationCollection>>
    

    The collection of implicit animations attached to this object.

    Source

    set_implicit_animations

    fn set_implicit_animations(self: &Self, value: Option<Rc<ImplicitAnimationCollection>>)
    

    Source

    is_disposed

    fn is_disposed(self: &Self) -> bool
    

    Source

    dispose

    fn dispose(self: &Self)
    

    Source

    children

    fn children(self: &Self) -> &Rc<CompositionVisualCollection>
    

    The children of the visual.

    Source

    root

    fn root(self: &Self) -> Option<Rc<CompositionTarget>>
    

    Source

    parent

    fn parent(self: &Self) -> Option<Rc<CompositionVisual>>
    

    Source

    adorned_visual

    fn adorned_visual(self: &Self) -> Option<Rc<CompositionVisual>>
    

    The visual this visual is an adorner of: its transform follows that visual.

    Source

    set_adorned_visual

    fn set_adorned_visual(self: &Self, value: Option<Rc<CompositionVisual>>)
    

    Source

    cache_mode

    fn cache_mode(self: &Self) -> Option<Rc<CompositionBitmapCache>>
    

    Source

    set_cache_mode

    fn set_cache_mode(self: &Self, value: Option<Rc<CompositionBitmapCache>>)
    

    Source

    composition_clip

    fn composition_clip(self: &Self) -> Option<Rc<CompositionClip>>
    

    The WinUI clip of the visual (Visual.Clip): an InsetClip or a RectangleClip, applied in the coordinates of the visual, after its transform, to its content and children.

    Deviation (winui-composition.md): WinUI names it Clip; here clip is the geometry clip of the upstream compositor, so the WinUI member is composition_clip. Both may be set; the visible area is their intersection.

    Source

    set_composition_clip

    fn set_composition_clip(self: &Self, value: Option<Rc<CompositionClip>>)
    

    Source

    disable_sub_tree_bounds_hit_test_optimization

    fn disable_sub_tree_bounds_hit_test_optimization(self: &Self) -> bool
    

    Source

    opacity_mask

    fn opacity_mask(self: &Self) -> Option<Rc<dyn IBrush>>
    

    Source

    set_opacity_mask

    fn set_opacity_mask(self: &Self, value: Option<Rc<dyn IBrush>>)
    

    Source

    tag

    fn tag(self: &Self) -> Option<Rc<dyn Any>>
    

    Source

    set_tag

    fn set_tag(self: &Self, value: Option<Rc<dyn Any>>)
    

    Source

    hit_test

    fn hit_test(self: &Self, point: Point) -> bool
    

    Whether the content of the visual is hit at a point in its own coordinates.

    Source

    hit_test_geometry

    fn hit_test_geometry(self: &Self, geometry: &Ref<Geometry>) -> IntersectionResult
    

    How the content of the visual intersects a geometry in its own coordinates.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • ClassDefaults
    • Borrow<T>
    • BorrowMut<T>
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ErasedDestructor
    • IntoEither
    • CompositionExperimentalAcrylicVisualHooks
    • VisualUnorderedCollectionHooks<CompositionVisual>
    • CompositionSolidColorVisualHooks
    • CompositionSurfaceVisualHooks
    • LayerVisualHooks
    • RedirectVisualHooks
    • ShapeVisualHooks
    • SpriteVisualHooks
    • CompositionVisualHooks
    • CompositionContainerVisualHooks
    • IRegisterForSerialization
    • ICompositionObjectHost
    • ICompositionObjectAnimations
    • AsCompositionObject
    • ICompositionObject
    • ICompositorSerializable
    • CompositionVisualCollectionHooks<CompositionVisual>

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.