pub trait HostWindow: 'static {
Show 20 methods
// Required methods
fn view(&self) -> ViewRef;
fn frame(&self) -> Rect;
fn set_frame(&self, frame: Rect, animate: Option<Duration>);
fn set_title(&self, title: &str);
fn set_icon(&self, icon: Option<&IconImage>);
fn show(&self);
fn hide(&self);
fn activate(&self);
fn is_minimized(&self) -> bool;
fn is_occluded(&self) -> bool;
fn close(&self);
fn size_limits(&self) -> Option<&dyn WindowSizeLimits>;
fn drag(&self);
fn is_maximized(&self) -> bool;
fn set_maximized(&self, maximized: bool);
fn set_minimized(&self, minimized: bool);
fn is_fullscreen(&self) -> bool;
fn set_fullscreen(&self, fullscreen: bool, screen: Option<ScreenId>);
fn native_handle(&self) -> Option<RawWindowHandle>;
// Provided method
fn title_bar_double_click_action(&self) -> TitleBarAction { ... }
}Expand description
The window around a view the host puts on screen in a window the app may manage.
Required Methods§
fn view(&self) -> ViewRef
Sourcefn set_frame(&self, frame: Rect, animate: Option<Duration>)
fn set_frame(&self, frame: Rect, animate: Option<Duration>)
Moves and sizes the window, over animate when the host can animate a frame.
fn set_title(&self, title: &str)
Sourcefn set_icon(&self, icon: Option<&IconImage>)
fn set_icon(&self, icon: Option<&IconImage>)
The window’s own icon from now on (WindowConfig::icon); the app’s icon where None.
A system that shows no icon for a window, as macOS and Wayland do not, drops it.
Sourcefn show(&self)
fn show(&self)
Makes the window visible, where it is in the stack, without taking the focus, at once, before its view’s first frame too. A system that cannot show a window without bringing it forward with the focus does that instead.
Sourcefn hide(&self)
fn hide(&self)
Takes the window off the screen, kept, at once. A system that cannot hide a window leaves it as it is.
Sourcefn activate(&self)
fn activate(&self)
Flutter WindowController.activate: makes the window visible at once, a minimized one at
the size and position it had before, brings it to the front and gives it the focus, as far
as the system lets the app; where it does not, the system draws attention to the window
instead.
The window alone: where the system activates an application apart from its windows, as
macOS does, the application is not activated, which its platform’s own call does.
Sourcefn is_minimized(&self) -> bool
fn is_minimized(&self) -> bool
Flutter WindowController.isMinimized; macOS isMiniaturized, Windows IsIconic.
false where the system does not tell a client, as Wayland does not.
Sourcefn is_occluded(&self) -> bool
fn is_occluded(&self) -> bool
Covered all over, or otherwise not shown: macOS’s occlusion state without its visible bit,
winit’s Occluded. Not in Flutter’s controller; Waft’s, after the platforms. false
where the system does not tell a window, as Windows and Wayland do not.
Sourcefn close(&self)
fn close(&self)
Closes the window; its view goes away with it. The user’s asking to close it only reports
it (EmbedderClient::view_close_requested);
this closes it.
Sourcefn size_limits(&self) -> Option<&dyn WindowSizeLimits>
fn size_limits(&self) -> Option<&dyn WindowSizeLimits>
The smallest and largest size the user may resize this window to; none where users don’t
resize windows (phones). Flutter WindowController.setConstraints.
Sourcefn drag(&self)
fn drag(&self)
Starts the system’s own move of the window from the press under way, as a press on its
title bar does: for an app that draws its own (MacosTitleBar::Hidden). Call it from
the press.
Sourcefn is_maximized(&self) -> bool
fn is_maximized(&self) -> bool
Flutter WindowController.isMaximized; on macOS, zoomed. false while the window is full
screen.
Sourcefn set_maximized(&self, maximized: bool)
fn set_maximized(&self, maximized: bool)
Flutter WindowController.setMaximized; on macOS, zooms the window or returns it to its
size from before.
Sourcefn set_minimized(&self, minimized: bool)
fn set_minimized(&self, minimized: bool)
Flutter WindowController.setMinimized.
Sourcefn is_fullscreen(&self) -> bool
fn is_fullscreen(&self) -> bool
Flutter WindowController.isFullscreen: whether the window fills a screen, without its
title bar and over the system’s own bars; on macOS, in a Space of its own. false where a
window has no such state, as a phone’s task, which fills the screen as it is.
Sourcefn set_fullscreen(&self, fullscreen: bool, screen: Option<ScreenId>)
fn set_fullscreen(&self, fullscreen: bool, screen: Option<ScreenId>)
Flutter WindowController.setFullscreen: has the window fill screen, the one it is on
where None, or returns it to how it was before, when screen is not read. The system
may take a while, or refuse: the window answers is_fullscreen
once it has, and the host reports the change
(EmbedderClient::window_changed).
Sourcefn native_handle(&self) -> Option<RawWindowHandle>
fn native_handle(&self) -> Option<RawWindowHandle>
The native window, for configuration this interface does not carry.
Provided Methods§
Sourcefn title_bar_double_click_action(&self) -> TitleBarAction
fn title_bar_double_click_action(&self) -> TitleBarAction
What the system’s settings say a double-click on a title bar does, for an app that draws
its own (MacosTitleBar::Hidden): macOS’s “Double-click a window’s title bar to”.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".