Struct async_winit::window::Window
source · pub struct Window { /* private fields */ }
Expand description
A window.
Implementations§
source§impl Window
impl Window
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 Window
impl Window
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 Window
impl Window
Waiting for events.
sourcepub fn redraw_requested(&self) -> &Handler<()> ⓘ
pub fn redraw_requested(&self) -> &Handler<()> ⓘ
Get the handler for the RedrawRequested
event.
sourcepub fn close_requested(&self) -> &Handler<()> ⓘ
pub fn close_requested(&self) -> &Handler<()> ⓘ
Get the handler for the CloseRequested
event.
sourcepub fn keyboard_input(&self) -> &Handler<KeyboardInput> ⓘ
pub fn keyboard_input(&self) -> &Handler<KeyboardInput> ⓘ
Get the handler for the KeyboardInput
event.
sourcepub fn modifiers_changed(&self) -> &Handler<ModifiersState> ⓘ
pub fn modifiers_changed(&self) -> &Handler<ModifiersState> ⓘ
Get the handler for the ModifiersChanged
event.
sourcepub fn received_character(&self) -> &Handler<char> ⓘ
pub fn received_character(&self) -> &Handler<char> ⓘ
Get the handler for the ReceivedCharacter
event.
sourcepub fn cursor_moved(&self) -> &Handler<CursorMoved> ⓘ
pub fn cursor_moved(&self) -> &Handler<CursorMoved> ⓘ
Get the handler for the CursorMoved
event.
sourcepub fn cursor_entered(&self) -> &Handler<DeviceId> ⓘ
pub fn cursor_entered(&self) -> &Handler<DeviceId> ⓘ
Get the handler for the CursorEntered
event.
sourcepub fn cursor_left(&self) -> &Handler<DeviceId> ⓘ
pub fn cursor_left(&self) -> &Handler<DeviceId> ⓘ
Get the handler for the CursorLeft
event.
sourcepub fn mouse_wheel(&self) -> &Handler<MouseWheel> ⓘ
pub fn mouse_wheel(&self) -> &Handler<MouseWheel> ⓘ
Get the handle for the MouseWheel
event.
sourcepub fn mouse_input(&self) -> &Handler<MouseInput> ⓘ
pub fn mouse_input(&self) -> &Handler<MouseInput> ⓘ
Get the handle for the MouseInput
event.
sourcepub fn touchpad_magnify(&self) -> &Handler<TouchpadMagnify> ⓘ
pub fn touchpad_magnify(&self) -> &Handler<TouchpadMagnify> ⓘ
Get the handle for the TouchpadMagnify
event.
sourcepub fn touchpad_pressure(&self) -> &Handler<TouchpadPressure> ⓘ
pub fn touchpad_pressure(&self) -> &Handler<TouchpadPressure> ⓘ
Get the handle for the TouchpadPressure
event.
sourcepub fn scale_factor_changed(&self) -> &Handler<ScaleFactor> ⓘ
pub fn scale_factor_changed(&self) -> &Handler<ScaleFactor> ⓘ
Get the handle for the ScaleFactorChanged
event.
sourcepub fn touchpad_rotate(&self) -> &Handler<TouchpadRotate> ⓘ
pub fn touchpad_rotate(&self) -> &Handler<TouchpadRotate> ⓘ
Get the handle for the TouchpadRotate
event.
sourcepub fn smart_magnify(&self) -> &Handler<DeviceId> ⓘ
pub fn smart_magnify(&self) -> &Handler<DeviceId> ⓘ
Get the handle for the SmartMagnify
event.
sourcepub fn axis_motion(&self) -> &Handler<AxisMotion> ⓘ
pub fn axis_motion(&self) -> &Handler<AxisMotion> ⓘ
Get the handle for the AxisMotion
event.
sourcepub fn theme_changed(&self) -> &Handler<Theme> ⓘ
pub fn theme_changed(&self) -> &Handler<Theme> ⓘ
Get the handle for the ThemeChanged
event.