FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    CompositionLight

    struct · ferroui-base · v0.5.0

    struct CompositionLight
    

    A light (WinUI Microsoft.UI.Composition.CompositionLight): it lights the visuals of targets and their subtrees, minus the visuals of exclusions_from_targets and their subtrees, while it is_enabled. A visual that some enabled light reaches shows its content multiplied by the sum of the lights that reach it, so it is dark where none of them shines.

    Deviation (winui-composition.md): the lighting is a light map drawn over the content of each lit visual, see server::LitContent.

    View source

    Members

    compositor

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

    Source

    object

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

    The embedded CompositionObject.

    Source

    is_disposed

    fn is_disposed(self: &Self) -> bool
    

    Source

    dispose

    fn dispose(self: &Self)
    

    Disposes the light and its two collections: the visuals it lit are drawn without it from the next frame.

    Source

    type_name

    fn type_name(self: &Self) -> &'static str
    

    The name of the concrete class, for messages.

    Source

    targets

    fn targets(self: &Self) -> &Rc<VisualUnorderedCollection>
    

    Targets: the visuals the light lights, with their subtrees.

    Source

    exclusions_from_targets

    fn exclusions_from_targets(self: &Self) -> &Rc<VisualUnorderedCollection>
    

    ExclusionsFromTargets: the visuals, with their subtrees, the light does not light although they are in the subtree of a target.

    Source

    set_xaml_binding

    fn set_xaml_binding(self: &Self, id: Option<String>, scope: Option<Rc<CompositionVisual>>)
    

    Binds the light to a XAML light (XamlLight.CompositionLight): the light then also lights the XAML brushes that target the id id (XamlLight.AddTargetBrush) where they are drawn in the subtree of scope, the visual of the element whose Lights holds the XAML light. None unbinds it. Called by XamlLight.

    Source

    xaml_id

    fn xaml_id(self: &Self) -> Option<String>
    

    The id of the XAML light the light is bound to, if any.

    Source

    is_enabled

    fn is_enabled(self: &Self) -> bool
    

    IsEnabled (default true): a disabled light lights nothing, and the visuals it targets are drawn as if it did not exist.

    Source

    set_is_enabled

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

    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
    • CompositionLightHooks
    • AmbientLightHooks
    • DistantLightHooks
    • PointLightHooks
    • SpotLightHooks
    • IRegisterForSerialization
    • ICompositionObjectHost
    • ICompositionObjectAnimations
    • AsCompositionObject
    • ICompositionObject
    • ICompositorSerializable

    Availability

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