# Screen

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-controls/platform/struct-screen/

**struct** · [`ferroui-controls`](/docs/0.5.0/api/ferroui-controls/) · v0.5.0

```rust
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](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/platform/screen.rs#L47)

## Members

- [`new`](#function-new)
- [`display_name`](#function-display_name)
- [`set_display_name`](#function-set_display_name)
- [`current_orientation`](#function-current_orientation)
- [`set_current_orientation`](#function-set_current_orientation)
- [`scaling`](#function-scaling)
- [`set_scaling`](#function-set_scaling)
- [`bounds`](#function-bounds)
- [`set_bounds`](#function-set_bounds)
- [`working_area`](#function-working_area)
- [`set_working_area`](#function-set_working_area)
- [`is_primary`](#function-is_primary)
- [`set_is_primary`](#function-set_is_primary)
- [`try_get_platform_handle`](#function-try_get_platform_handle)
- [`on_removed`](#function-on_removed)

<a id="function-new"></a>

### new

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

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

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/platform/screen.rs#L59)

<a id="function-display_name"></a>

### display_name

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

Gets the device name associated with a display.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/platform/screen.rs#L72)

<a id="function-set_display_name"></a>

### set_display_name

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

Sets the device name associated with a display.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/platform/screen.rs#L77)

<a id="function-current_orientation"></a>

### current_orientation

```rust
fn current_orientation(self: &Self) -> ScreenOrientation
```

Gets the current orientation of a screen.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/platform/screen.rs#L82)

<a id="function-set_current_orientation"></a>

### set_current_orientation

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

Sets the current orientation of a screen.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/platform/screen.rs#L87)

<a id="function-scaling"></a>

### scaling

```rust
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](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/platform/screen.rs#L96)

<a id="function-set_scaling"></a>

### set_scaling

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

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

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/platform/screen.rs#L102)

<a id="function-bounds"></a>

### bounds

```rust
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](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/platform/screen.rs#L110)

<a id="function-set_bounds"></a>

### set_bounds

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

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

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/platform/screen.rs#L115)

<a id="function-working_area"></a>

### working_area

```rust
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](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/platform/screen.rs#L123)

<a id="function-set_working_area"></a>

### set_working_area

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

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

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/platform/screen.rs#L128)

<a id="function-is_primary"></a>

### is_primary

```rust
fn is_primary(self: &Self) -> bool
```

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

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/platform/screen.rs#L133)

<a id="function-set_is_primary"></a>

### set_is_primary

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

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

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/platform/screen.rs#L138)

<a id="function-try_get_platform_handle"></a>

### try_get_platform_handle

```rust
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](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/platform/screen.rs#L146)

<a id="function-on_removed"></a>

### on_removed

```rust
fn on_removed(self: &Self)
```

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

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/platform/screen.rs#L152)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToString`
- [`ResourceKeyObject`](/docs/0.5.0/api/ferroui-base/controls/trait-resourcekeyobject/)
- [`AnyValue`](/docs/0.5.0/api/ferroui-base/trait-anyvalue/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- `PartialEq`
- `Eq`
- `Hash`
- `Display`
- `Debug`

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
