Skip to main content

TestWindow

Struct TestWindow 

Source
pub struct TestWindow { /* private fields */ }
Expand description

A window that shows nothing, keeps the frame, the title and the icon it was last given, whether it was last shown or hidden, whether it is maximized or full screen and the size limits it was last given, and counts how often it was closed and dragged: one of TestWindows, or one a test gives the app a view in. A closed window’s view is in no window any more, and is no longer among the views of TestWindows. It is neither minimized nor occluded until a test says so, and the test then reports the change itself, as a host would through EmbedderClient::window_changed.

Implementations§

Source§

impl TestWindow

Source

pub fn around(view: TestView, config: WindowConfig) -> Rc<TestWindow>

A window configured as config around view, which is in it from now on: as a desktop makes for a request, or as WaOS shows a program’s view it gives. It starts where the configuration places it, or at the origin, and shown as the configuration says.

Source

pub fn test_view(&self) -> &Rc<TestView>

The view the window shows, which counts the pictures presented to it.

Source

pub fn config(&self) -> &WindowConfig

The configuration the window was asked for with.

Source

pub fn title(&self) -> String

The title the window was last given, its configuration’s until the app sets another.

Source

pub fn icon(&self) -> Option<IconImage>

The icon the window was last given, its configuration’s until the app sets another.

Source

pub fn is_shown(&self) -> bool

Whether the window was last shown, rather than hidden.

Source

pub fn closes(&self) -> u32

How many times the window was closed.

Source

pub fn drags(&self) -> u32

How many times the window was dragged.

Source

pub fn activations(&self) -> u32

How many times the window was asked to be activated.

Source

pub fn set_minimized(&self, minimized: bool)

The window is minimized, or restored, from now on.

Source

pub fn set_occluded(&self, occluded: bool)

The window is occluded, or shown, from now on.

Source

pub fn min_size(&self) -> Option<Size>

The smallest size the window was last given for its view; none until one is set.

Source

pub fn max_size(&self) -> Option<Size>

The largest size the window was last given for its view; none until one is set.

Trait Implementations§

Source§

impl HostWindow for TestWindow

Source§

fn activate(&self)

Shown, restored where it is minimized, and counted.

Source§

fn set_fullscreen(&self, fullscreen: bool, _screen: Option<ScreenId>)

Full screen at once, on whichever screen: a test window is on none.

Source§

fn view(&self) -> ViewRef

Source§

fn frame(&self) -> Rect

The window’s logical frame in screen space.
Source§

fn set_frame(&self, frame: Rect, _animate: Option<Duration>)

Moves and sizes the window, over animate when the host can animate a frame.
Source§

fn set_title(&self, title: &str)

Source§

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.
Source§

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.
Source§

fn hide(&self)

Takes the window off the screen, kept, at once. A system that cannot hide a window leaves it as it is.
Source§

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.
Source§

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.
Source§

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.
Source§

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.
Source§

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.
Source§

fn is_maximized(&self) -> bool

Flutter WindowController.isMaximized; on macOS, zoomed. false while the window is full screen.
Source§

fn set_maximized(&self, maximized: bool)

Flutter WindowController.setMaximized; on macOS, zooms the window or returns it to its size from before.
Source§

fn set_minimized(&self, minimized: bool)

Flutter WindowController.setMinimized.
Source§

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.
Source§

fn native_handle(&self) -> Option<RawWindowHandle>

The native window, for configuration this interface does not carry.
Source§

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”.
Source§

impl WindowSizeLimits for TestWindow

Source§

fn set_min_size(&self, size: Option<Size>)

Source§

fn set_max_size(&self, size: Option<Size>)

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>