Trait cushy::window::PlatformWindowImplementation

source ·
pub trait PlatformWindowImplementation {
Show 22 methods // Required methods fn close(&mut self); fn winit(&self) -> Option<&Arc<Window>>; fn set_needs_redraw(&mut self); fn redraw_in(&mut self, duration: Duration); fn redraw_at(&mut self, moment: Instant); fn modifiers(&self) -> Modifiers; fn elapsed(&self) -> Duration; fn set_cursor(&mut self, cursor: Cursor); fn handle(&self, redraw_status: InvalidationStatus) -> WindowHandle; fn inner_size(&self) -> Size<UPx>; // Provided methods fn outer_position(&self) -> Point<Px> { ... } fn inner_position(&self) -> Point<Px> { ... } fn outer_size(&self) -> Size<UPx> { ... } fn is_resizable(&self) -> bool { ... } fn theme(&self) -> Theme { ... } fn request_inner_size(&mut self, inner_size: Size<UPx>) -> Option<Size<UPx>> { ... } fn set_ime_allowed(&self, allowed: bool) { ... } fn set_ime_location(&self, location: Rect<Px>) { ... } fn set_ime_purpose(&self, purpose: ImePurpose) { ... } fn set_min_inner_size(&self, min_size: Option<Size<UPx>>) { ... } fn set_max_inner_size(&self, max_size: Option<Size<UPx>>) { ... } fn redraw_when_changed( &self, value: &impl Trackable, invalidation_status: &InvalidationStatus, ) where Self: Sized { ... }
}
Expand description

A platform-dependent window implementation.

Required Methods§

source

fn close(&mut self)

Marks the window to close as soon as possible.

source

fn winit(&self) -> Option<&Arc<Window>>

Returns the underlying winit window, if one exists.

source

fn set_needs_redraw(&mut self)

Sets the window to redraw as soon as possible.

source

fn redraw_in(&mut self, duration: Duration)

Sets the window to redraw after a duration.

source

fn redraw_at(&mut self, moment: Instant)

Sets the window to redraw at a specified instant.

source

fn modifiers(&self) -> Modifiers

Returns the current keyboard modifiers.

source

fn elapsed(&self) -> Duration

Returns the amount of time that has elapsed since the last redraw.

source

fn set_cursor(&mut self, cursor: Cursor)

Sets the current cursor icon to cursor.

source

fn handle(&self, redraw_status: InvalidationStatus) -> WindowHandle

Returns a handle for the window.

source

fn inner_size(&self) -> Size<UPx>

Returns the current inner size of the window.

Provided Methods§

source

fn outer_position(&self) -> Point<Px>

Returns the current outer position of the window.

source

fn inner_position(&self) -> Point<Px>

Returns the current inner position of the window.

source

fn outer_size(&self) -> Size<UPx>

Returns the current outer size of the window.

source

fn is_resizable(&self) -> bool

Returns true if the window can have its size changed.

The provided implementation returns [winit::window::Window::is_resizable], or true if this window has no winit window.

source

fn theme(&self) -> Theme

Returns the underlying window theme.

The provided implementation returns [winit::window::Window::theme], or dark if this window has no winit window.

source

fn request_inner_size(&mut self, inner_size: Size<UPx>) -> Option<Size<UPx>>

Requests that the window change its inner size.

The provided implementation forwards the request onto the winit window, if present.

The result is the same [winit::window::Window::request_inner_size] – if a size is returned, the change was made before the call returns, and no resized event will be emitted.

source

fn set_ime_allowed(&self, allowed: bool)

Sets whether [Ime] events should be enabled.

The provided implementation forwards the request onto the winit window, if present.

source

fn set_ime_location(&self, location: Rect<Px>)

Sets the location of the cursor.

source

fn set_ime_purpose(&self, purpose: ImePurpose)

Sets the current [Ime] purpose.

The provided implementation forwards the request onto the winit window, if present.

source

fn set_min_inner_size(&self, min_size: Option<Size<UPx>>)

Sets the window’s minimum inner size.

source

fn set_max_inner_size(&self, max_size: Option<Size<UPx>>)

Sets the window’s maximum inner size.

source

fn redraw_when_changed( &self, value: &impl Trackable, invalidation_status: &InvalidationStatus, )
where Self: Sized,

Ensures that this window will be redrawn when value has been updated.

Implementations on Foreign Types§

source§

impl PlatformWindowImplementation for Window<'_, WindowCommand>

source§

fn set_cursor(&mut self, cursor: Cursor)

source§

fn inner_size(&self) -> Size<UPx>

source§

fn close(&mut self)

source§

fn winit(&self) -> Option<&Arc<Window>>

source§

fn set_needs_redraw(&mut self)

source§

fn redraw_in(&mut self, duration: Duration)

source§

fn redraw_at(&mut self, moment: Instant)

source§

fn modifiers(&self) -> Modifiers

source§

fn elapsed(&self) -> Duration

source§

fn handle(&self, redraw_status: InvalidationStatus) -> WindowHandle

source§

fn request_inner_size(&mut self, inner_size: Size<UPx>) -> Option<Size<UPx>>

Implementors§