pub struct Window<TS: ThreadSafety> { /* private fields */ }
Expand description
A window.
Implementations§
Source§impl<TS: ThreadSafety> Window<TS>
impl<TS: ThreadSafety> Window<TS>
Sourcepub fn scale_factor(&self) -> f64
pub fn scale_factor(&self) -> f64
Get the scale factor of the window.
Sourcepub fn request_redraw(&self)
pub fn request_redraw(&self)
Request a redraw.
Source§impl<TS: ThreadSafety> Window<TS>
impl<TS: ThreadSafety> Window<TS>
Sourcepub async fn inner_position(
&self,
) -> Result<PhysicalPosition<i32>, NotSupportedError>
pub async fn inner_position( &self, ) -> Result<PhysicalPosition<i32>, NotSupportedError>
Get the inner position of the window.
Sourcepub async fn outer_position(
&self,
) -> Result<PhysicalPosition<i32>, NotSupportedError>
pub async fn outer_position( &self, ) -> Result<PhysicalPosition<i32>, NotSupportedError>
Get the outer position of the window.
Sourcepub async fn set_outer_position(&self, position: impl Into<Position>)
pub async fn set_outer_position(&self, position: impl Into<Position>)
Set the outer position of the window.
Sourcepub async fn inner_size(&self) -> PhysicalSize<u32>
pub async fn inner_size(&self) -> PhysicalSize<u32>
Get the inner size of the window.
Sourcepub async fn outer_size(&self) -> PhysicalSize<u32>
pub async fn outer_size(&self) -> PhysicalSize<u32>
Get the outer size of the window.
Sourcepub async fn set_inner_size(&self, size: impl Into<Size>)
pub async fn set_inner_size(&self, size: impl Into<Size>)
Set the inner size of the window.
Sourcepub async fn set_min_inner_size(&self, size: impl Into<Option<Size>>)
pub async fn set_min_inner_size(&self, size: impl Into<Option<Size>>)
Set the minimum inner size of the window.
Sourcepub async fn set_max_inner_size(&self, size: impl Into<Option<Size>>)
pub async fn set_max_inner_size(&self, size: impl Into<Option<Size>>)
Set the maximum inner size of the window.
Sourcepub async fn resize_increments(&self) -> Option<PhysicalSize<u32>>
pub async fn resize_increments(&self) -> Option<PhysicalSize<u32>>
Get the resize increments of the window.
Sourcepub async fn set_resize_increments(&self, size: impl Into<Option<Size>>)
pub async fn set_resize_increments(&self, size: impl Into<Option<Size>>)
Set the resize increments of the window.
Sourcepub async fn set_visible(&self, visible: bool)
pub async fn set_visible(&self, visible: bool)
Set whether the window is visible.
Sourcepub async fn is_visible(&self) -> Option<bool>
pub async fn is_visible(&self) -> Option<bool>
Get the window’s visibility.
Sourcepub async fn set_transparent(&self, transparent: bool)
pub async fn set_transparent(&self, transparent: bool)
Set the window’s transparency.
Sourcepub async fn set_resizable(&self, resizable: bool)
pub async fn set_resizable(&self, resizable: bool)
Set the window’s resizable property.
Sourcepub async fn is_resizable(&self) -> bool
pub async fn is_resizable(&self) -> bool
Get the window’s resizable property.
Sourcepub async fn set_minimized(&self, minimized: bool)
pub async fn set_minimized(&self, minimized: bool)
Set the window’s minimization.
Sourcepub async fn is_minimized(&self) -> Option<bool>
pub async fn is_minimized(&self) -> Option<bool>
Get the window’s minimization.
Sourcepub async fn set_maximized(&self, maximized: bool)
pub async fn set_maximized(&self, maximized: bool)
Set the window’s maximization.
Sourcepub async fn is_maximized(&self) -> bool
pub async fn is_maximized(&self) -> bool
Get the window’s maximization.
Sourcepub async fn set_fullscreen(&self, fullscreen: Option<Fullscreen>)
pub async fn set_fullscreen(&self, fullscreen: Option<Fullscreen>)
Set the window’s fullscreen state.
Sourcepub async fn fullscreen(&self) -> Option<Fullscreen>
pub async fn fullscreen(&self) -> Option<Fullscreen>
Get the fullscreen state of the window.
Sourcepub async fn set_decorations(&self, decorations: bool)
pub async fn set_decorations(&self, decorations: bool)
Set the window’s decorations.
Sourcepub async fn is_decorated(&self) -> bool
pub async fn is_decorated(&self) -> bool
Get the window’s decorations.
Sourcepub async fn set_window_level(&self, level: WindowLevel)
pub async fn set_window_level(&self, level: WindowLevel)
Set the window level.
Sourcepub async fn set_window_icon(&self, icon: Option<Icon>)
pub async fn set_window_icon(&self, icon: Option<Icon>)
Set the window icon.
Sourcepub async fn set_ime_position(&self, posn: impl Into<Position>)
pub async fn set_ime_position(&self, posn: impl Into<Position>)
Set the IME position.
Sourcepub async fn set_ime_allowed(&self, allowed: bool)
pub async fn set_ime_allowed(&self, allowed: bool)
Set whether IME is allowed.
Sourcepub async fn set_ime_purpose(&self, purpose: ImePurpose)
pub async fn set_ime_purpose(&self, purpose: ImePurpose)
Set the IME purpose.
Sourcepub async fn focus_window(&self)
pub async fn focus_window(&self)
Focus the window.
Sourcepub async fn is_focused(&self) -> bool
pub async fn is_focused(&self) -> bool
Tell whether the window is focused.
Sourcepub async fn request_user_attention(
&self,
request_type: Option<UserAttentionType>,
)
pub async fn request_user_attention( &self, request_type: Option<UserAttentionType>, )
Request the user’s attention.
Sourcepub async fn set_content_protected(&self, protected: bool)
pub async fn set_content_protected(&self, protected: bool)
Set the window’s protected content.
Sourcepub async fn set_cursor_icon(&self, icon: CursorIcon)
pub async fn set_cursor_icon(&self, icon: CursorIcon)
Set the cursor icon.
Sourcepub async fn set_cursor_position(
&self,
posn: impl Into<Position>,
) -> Result<(), ExternalError>
pub async fn set_cursor_position( &self, posn: impl Into<Position>, ) -> Result<(), ExternalError>
Set the cursor position.
Sourcepub async fn set_cursor_grab(
&self,
mode: CursorGrabMode,
) -> Result<(), ExternalError>
pub async fn set_cursor_grab( &self, mode: CursorGrabMode, ) -> Result<(), ExternalError>
Set the cursor’s grab mode.
Sourcepub async fn set_cursor_visible(&self, visible: bool)
pub async fn set_cursor_visible(&self, visible: bool)
Set the cursor’s visibility.
Sourcepub async fn drag_window(&self) -> Result<(), ExternalError>
pub async fn drag_window(&self) -> Result<(), ExternalError>
Drag the window.
Sourcepub async fn drag_resize_window(
&self,
direction: ResizeDirection,
) -> Result<(), ExternalError>
pub async fn drag_resize_window( &self, direction: ResizeDirection, ) -> Result<(), ExternalError>
Drag-resize the window.
Sourcepub async fn set_cursor_hittest(
&self,
hit_test: bool,
) -> Result<(), ExternalError>
pub async fn set_cursor_hittest( &self, hit_test: bool, ) -> Result<(), ExternalError>
Set the cursor hit test.
Sourcepub async fn current_monitor(&self) -> Option<MonitorHandle>
pub async fn current_monitor(&self) -> Option<MonitorHandle>
Get the current monitor of this window.
Source§impl<TS: ThreadSafety> Window<TS>
Waiting for events.
impl<TS: ThreadSafety> Window<TS>
Waiting for events.
Sourcepub fn redraw_requested(&self) -> &Handler<(), TS>
pub fn redraw_requested(&self) -> &Handler<(), TS>
Get the handler for the RedrawRequested
event.
Sourcepub fn close_requested(&self) -> &Handler<(), TS>
pub fn close_requested(&self) -> &Handler<(), TS>
Get the handler for the CloseRequested
event.
Sourcepub fn resized(&self) -> &Handler<PhysicalSize<u32>, TS>
pub fn resized(&self) -> &Handler<PhysicalSize<u32>, TS>
Get the handler for the Resized
event.
Sourcepub fn moved(&self) -> &Handler<PhysicalPosition<i32>, TS>
pub fn moved(&self) -> &Handler<PhysicalPosition<i32>, TS>
Get the handler for the Moved
event.
Sourcepub fn keyboard_input(&self) -> &Handler<KeyboardInput, TS>
pub fn keyboard_input(&self) -> &Handler<KeyboardInput, TS>
Get the handler for the KeyboardInput
event.
Sourcepub fn modifiers_changed(&self) -> &Handler<ModifiersState, TS>
pub fn modifiers_changed(&self) -> &Handler<ModifiersState, TS>
Get the handler for the ModifiersChanged
event.
Sourcepub fn received_character(&self) -> &Handler<char, TS>
pub fn received_character(&self) -> &Handler<char, TS>
Get the handler for the ReceivedCharacter
event.
Sourcepub fn cursor_moved(&self) -> &Handler<CursorMoved, TS>
pub fn cursor_moved(&self) -> &Handler<CursorMoved, TS>
Get the handler for the CursorMoved
event.
Sourcepub fn cursor_entered(&self) -> &Handler<DeviceId, TS>
pub fn cursor_entered(&self) -> &Handler<DeviceId, TS>
Get the handler for the CursorEntered
event.
Sourcepub fn cursor_left(&self) -> &Handler<DeviceId, TS>
pub fn cursor_left(&self) -> &Handler<DeviceId, TS>
Get the handler for the CursorLeft
event.
Sourcepub fn mouse_wheel(&self) -> &Handler<MouseWheel, TS>
pub fn mouse_wheel(&self) -> &Handler<MouseWheel, TS>
Get the handle for the MouseWheel
event.
Sourcepub fn mouse_input(&self) -> &Handler<MouseInput, TS>
pub fn mouse_input(&self) -> &Handler<MouseInput, TS>
Get the handle for the MouseInput
event.
Sourcepub fn touchpad_magnify(&self) -> &Handler<TouchpadMagnify, TS>
pub fn touchpad_magnify(&self) -> &Handler<TouchpadMagnify, TS>
Get the handle for the TouchpadMagnify
event.
Sourcepub fn touchpad_pressure(&self) -> &Handler<TouchpadPressure, TS>
pub fn touchpad_pressure(&self) -> &Handler<TouchpadPressure, TS>
Get the handle for the TouchpadPressure
event.
Sourcepub fn scale_factor_changed(&self) -> &Handler<ScaleFactor, TS>
pub fn scale_factor_changed(&self) -> &Handler<ScaleFactor, TS>
Get the handle for the ScaleFactorChanged
event.
Sourcepub fn touchpad_rotate(&self) -> &Handler<TouchpadRotate, TS>
pub fn touchpad_rotate(&self) -> &Handler<TouchpadRotate, TS>
Get the handle for the TouchpadRotate
event.
Sourcepub fn smart_magnify(&self) -> &Handler<DeviceId, TS>
pub fn smart_magnify(&self) -> &Handler<DeviceId, TS>
Get the handle for the SmartMagnify
event.
Sourcepub fn axis_motion(&self) -> &Handler<AxisMotion, TS>
pub fn axis_motion(&self) -> &Handler<AxisMotion, TS>
Get the handle for the AxisMotion
event.
Sourcepub fn theme_changed(&self) -> &Handler<Theme, TS>
pub fn theme_changed(&self) -> &Handler<Theme, TS>
Get the handle for the ThemeChanged
event.