FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    Screen

    struct · ferroui-controls · v0.5.0

    struct Screen
    

    Represents a single display screen.

    Screens are shared (Rc<Screen>) and updated in place by the platform backend that owns them; the setters are meant for backends only.

    Two screens are equal when both have a platform handle and the handles are equal; a screen without a platform handle is only equal to itself.

    View source

    Members

    new

    fn new(platform_handle: Option<Rc<dyn IPlatformHandle>>) -> Self
    

    Creates a screen with a scaling of 1 and otherwise empty properties.

    Source

    display_name

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

    Gets the device name associated with a display.

    Source

    set_display_name

    fn set_display_name(self: &Self, value: Option<String>)
    

    Sets the device name associated with a display.

    Source

    current_orientation

    fn current_orientation(self: &Self) -> ScreenOrientation
    

    Gets the current orientation of a screen.

    Source

    set_current_orientation

    fn set_current_orientation(self: &Self, value: ScreenOrientation)
    

    Sets the current orientation of a screen.

    Source

    scaling

    fn scaling(self: &Self) -> f64
    

    Gets the scaling factor applied to the screen by the operating system.

    Multiply this value by 100 to get a percentage. Both X and Y scaling factors are assumed uniform.

    Source

    set_scaling

    fn set_scaling(self: &Self, value: f64)
    

    Sets the scaling factor applied to the screen by the operating system.

    Source

    bounds

    fn bounds(self: &Self) -> PixelRect
    

    Gets the overall pixel-size and position of the screen.

    This generally is the raw pixel counts in both the X and Y direction.

    Source

    set_bounds

    fn set_bounds(self: &Self, value: PixelRect)
    

    Sets the overall pixel-size and position of the screen.

    Source

    working_area

    fn working_area(self: &Self) -> PixelRect
    

    Gets the actual working-area pixel-size of the screen.

    This area may be smaller than bounds to account for notches and other block-out areas such as taskbars etc.

    Source

    set_working_area

    fn set_working_area(self: &Self, value: PixelRect)
    

    Sets the actual working-area pixel-size of the screen.

    Source

    is_primary

    fn is_primary(self: &Self) -> bool
    

    Gets a value indicating whether the screen is the primary one.

    Source

    set_is_primary

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

    Sets a value indicating whether the screen is the primary one.

    Source

    try_get_platform_handle

    fn try_get_platform_handle(self: &Self) -> Option<Rc<dyn IPlatformHandle>>
    

    Tries to get the platform handle for the screen.

    Returns a handle describing the screen, or None if the handle could not be retrieved.

    Source

    on_removed

    fn on_removed(self: &Self)
    

    When a screen is removed, all of its properties are at least emptied.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • Borrow<T>
    • BorrowMut<T>
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ToString
    • ResourceKeyObject
    • AnyValue
    • ClassDefaults
    • ErasedDestructor
    • IntoEither
    • PartialEq
    • Eq
    • Hash
    • Display
    • Debug

    Availability

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