# Screens

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

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

```rust
struct Screens
```

Represents all screens available on a device.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/screens.rs#L11)

## Members

- [`screen_count`](#function-screen_count)
- [`all`](#function-all)
- [`primary`](#function-primary)
- [`changed`](#function-changed)
- [`screen_from_bounds`](#function-screen_from_bounds)
- [`screen_from_window`](#function-screen_from_window)
- [`screen_from_top_level`](#function-screen_from_top_level)
- [`screen_from_point`](#function-screen_from_point)
- [`screen_from_visual`](#function-screen_from_visual)
- [`request_screen_details`](#function-request_screen_details)

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

### screen_count

```rust
fn screen_count(self: &Self) -> i32
```

The number of screens available on the device.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/screens.rs#L24)

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

### all

```rust
fn all(self: &Self) -> Vec<Rc<Screen>>
```

All screens available on the device.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/screens.rs#L29)

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

### primary

```rust
fn primary(self: &Self) -> Option<Rc<Screen>>
```

The primary screen on the device.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/screens.rs#L34)

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

### changed

```rust
fn changed(self: &Self, handler: impl Fn() -> () + 'static) -> Subscription
```

Fired when screens are added or removed, or when a screen's properties
change.

Dropping the returned guard removes the handler;
`Subscription::detach` keeps it for the life of the screens.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/screens.rs#L43)

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

### screen_from_bounds

```rust
fn screen_from_bounds(self: &Self, bounds: PixelRect) -> Option<Rc<Screen>>
```

Retrieves the screen that contains the largest area of the specified
bounds.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/screens.rs#L67)

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

### screen_from_window

```rust
fn screen_from_window(self: &Self, window: &WindowBase) -> Option<Rc<Screen>>
```

Retrieves the screen for the specified window.
## Panics
Panics when the window platform implementation was already disposed.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/screens.rs#L75)

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

### screen_from_top_level

```rust
fn screen_from_top_level(self: &Self, top_level: &TopLevel) -> Option<Rc<Screen>>
```

Retrieves the screen for the specified top-level.
## Panics
Panics when the platform implementation was already disposed.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/screens.rs#L89)

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

### screen_from_point

```rust
fn screen_from_point(self: &Self, point: PixelPoint) -> Option<Rc<Screen>>
```

Retrieves the screen that contains the specified point.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/screens.rs#L97)

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

### screen_from_visual

```rust
fn screen_from_visual(self: &Self, visual: &Visual) -> Option<Rc<Screen>>
```

Retrieves the screen that contains the specified visual.
## Panics
Panics when the visual does not belong to a visual tree.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/screens.rs#L105)

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

### request_screen_details

```rust
fn request_screen_details(self: &Self) -> Pin<Box<dyn Future<Output = bool>>>
```

Asks the underlying system for permission to get more detailed
information about screens.

On the browser platform the user has to grant permission; on other
platforms the details are always available.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/screens.rs#L126)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`

## Availability

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