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.
Members
newdisplay_nameset_display_namecurrent_orientationset_current_orientationscalingset_scalingboundsset_boundsworking_areaset_working_areais_primaryset_is_primarytry_get_platform_handleon_removed
new
fn new(platform_handle: Option<Rc<dyn IPlatformHandle>>) -> Self
Creates a screen with a scaling of 1 and otherwise empty properties.
display_name
fn display_name(self: &Self) -> Option<String>
Gets the device name associated with a display.
set_display_name
fn set_display_name(self: &Self, value: Option<String>)
Sets the device name associated with a display.
current_orientation
fn current_orientation(self: &Self) -> ScreenOrientation
Gets the current orientation of a screen.
set_current_orientation
fn set_current_orientation(self: &Self, value: ScreenOrientation)
Sets the current orientation of a screen.
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.
set_scaling
fn set_scaling(self: &Self, value: f64)
Sets the scaling factor applied to the screen by the operating system.
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.
set_bounds
fn set_bounds(self: &Self, value: PixelRect)
Sets the overall pixel-size and position of the screen.
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.
set_working_area
fn set_working_area(self: &Self, value: PixelRect)
Sets the actual working-area pixel-size of the screen.
is_primary
fn is_primary(self: &Self) -> bool
Gets a value indicating whether the screen is the primary one.
set_is_primary
fn set_is_primary(self: &Self, value: bool)
Sets a value indicating whether the screen is the primary one.
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.
on_removed
fn on_removed(self: &Self)
When a screen is removed, all of its properties are at least emptied.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyToStringResourceKeyObjectAnyValueClassDefaultsErasedDestructorIntoEitherPartialEqEqHashDisplayDebug
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.