[go: up one dir, main page]

Window

Struct Window 

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

The Win32 implementation of the main Window object.

Implementations§

Source§

impl Window

Source

pub fn hwnd(&self) -> HWND

Returns the hwnd of this window.

Source

pub fn raw_window_handle_rwh_06(&self) -> Result<RawWindowHandle, HandleError>

Source

pub fn raw_display_handle_rwh_06(&self) -> Result<RawDisplayHandle, HandleError>

Source

pub fn set_enable(&self, enabled: bool)

Source

pub fn set_skip_taskbar(&self, skip: bool)

Source

pub fn set_undecorated_shadow(&self, shadow: bool)

Source

pub fn set_system_backdrop(&self, backdrop_type: BackdropType)

Source

pub fn set_taskbar_icon(&self, taskbar_icon: Option<Icon>)

Source

pub fn set_border_color(&self, color: Color)

Source

pub fn set_title_background_color(&self, color: Color)

Source

pub fn set_title_text_color(&self, color: Color)

Source

pub fn set_corner_preference(&self, preference: CornerPreference)

Source

pub fn set_use_system_scroll_speed(&self, should_use: bool)

Trait Implementations§

Source§

impl Debug for Window

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for Window

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl HasDisplayHandle for Window

Source§

fn display_handle(&self) -> Result<DisplayHandle<'_>, HandleError>

Get a handle to the display controller of the windowing system.
Source§

impl HasWindowHandle for Window

Source§

fn window_handle(&self) -> Result<WindowHandle<'_>, HandleError>

Get a handle to the window.
Source§

impl Window for Window

Source§

fn set_title(&self, text: &str)

Modifies the title of the window. Read more
Source§

fn set_transparent(&self, transparent: bool)

Change the window transparency state. Read more
Source§

fn set_blur(&self, _blur: bool)

Change the window blur state. Read more
Source§

fn set_visible(&self, visible: bool)

Modifies the window’s visibility. Read more
Source§

fn is_visible(&self) -> Option<bool>

Gets the window’s current visibility state. Read more
Source§

fn request_redraw(&self)

Queues a WindowEvent::RedrawRequested event to be emitted that aligns with the windowing system drawing loop. Read more
Source§

fn pre_present_notify(&self)

Notify the windowing system before presenting to the window. Read more
Source§

fn outer_position(&self) -> Result<PhysicalPosition<i32>, RequestError>

The position of the top-left hand corner of the window relative to the top-left hand corner of the desktop. Read more
Source§

fn surface_position(&self) -> PhysicalPosition<i32>

The position of the top-left hand corner of the surface relative to the top-left hand corner of the window. Read more
Source§

fn set_outer_position(&self, position: Position)

Sets the position of the window on the desktop. Read more
Source§

fn surface_size(&self) -> PhysicalSize<u32>

Returns the size of the window’s render-able surface. Read more
Source§

fn outer_size(&self) -> PhysicalSize<u32>

Returns the size of the entire window. Read more
Source§

fn request_surface_size(&self, size: Size) -> Option<PhysicalSize<u32>>

Request the new size for the surface. Read more
Source§

fn safe_area(&self) -> PhysicalInsets<u32>

The inset area of the surface that is unobstructed. Read more
Source§

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

Sets a minimum dimensions of the window’s surface. Read more
Source§

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

Sets a maximum dimensions of the window’s surface. Read more
Source§

fn surface_resize_increments(&self) -> Option<PhysicalSize<u32>>

Returns surface resize increments if any were set. Read more
Source§

fn set_surface_resize_increments(&self, increments: Option<Size>)

Sets resize increments of the surface. Read more
Source§

fn set_resizable(&self, resizable: bool)

Sets whether the window is resizable or not. Read more
Source§

fn is_resizable(&self) -> bool

Gets the window’s current resizable state. Read more
Source§

fn set_enabled_buttons(&self, buttons: WindowButtons)

Sets the enabled window buttons. Read more
Source§

fn enabled_buttons(&self) -> WindowButtons

Gets the enabled window buttons. Read more
Source§

fn set_cursor(&self, cursor: Cursor)

Modifies the cursor icon of the window. Read more
Source§

fn set_cursor_grab(&self, mode: CursorGrabMode) -> Result<(), RequestError>

Set grabbing mode on the cursor preventing it from leaving the window. Read more
Source§

fn set_cursor_visible(&self, visible: bool)

Modifies the cursor’s visibility. Read more
Source§

fn scale_factor(&self) -> f64

Returns the scale factor that can be used to map logical pixels to physical pixels, and vice versa. Read more
Source§

fn set_cursor_position(&self, position: Position) -> Result<(), RequestError>

Changes the position of the cursor in window coordinates. Read more
Source§

fn drag_window(&self) -> Result<(), RequestError>

Moves the window with the left mouse button until the button is released. Read more
Source§

fn drag_resize_window( &self, direction: ResizeDirection, ) -> Result<(), RequestError>

Resizes the window with the left mouse button until the button is released. Read more
Source§

fn show_window_menu(&self, position: Position)

Show window menu at a specified position in surface coordinates. Read more
Source§

fn set_cursor_hittest(&self, hittest: bool) -> Result<(), RequestError>

Modifies whether the window catches cursor events. Read more
Source§

fn id(&self) -> WindowId

Returns an identifier unique to the window.
Source§

fn set_minimized(&self, minimized: bool)

Minimize the window, or put it back from the minimized state. Read more
Source§

fn is_minimized(&self) -> Option<bool>

Gets the window’s current minimized state. Read more
Source§

fn set_maximized(&self, maximized: bool)

Sets the window to maximized or back. Read more
Source§

fn is_maximized(&self) -> bool

Gets the window’s current maximized state. Read more
Source§

fn fullscreen(&self) -> Option<Fullscreen>

Gets the window’s current fullscreen state. Read more
Source§

fn set_fullscreen(&self, fullscreen: Option<Fullscreen>)

Set the window’s fullscreen state. Read more
Source§

fn set_decorations(&self, decorations: bool)

Turn window decorations on or off. Read more
Source§

fn is_decorated(&self) -> bool

Gets the window’s current decorations state. Read more
Source§

fn set_window_level(&self, level: WindowLevel)

Change the window level. Read more
Source§

fn current_monitor(&self) -> Option<CoreMonitorHandle>

Returns the monitor on which the window currently resides. Read more
Source§

fn available_monitors(&self) -> Box<dyn Iterator<Item = CoreMonitorHandle>>

Returns the list of all the monitors available on the system. Read more
Source§

fn primary_monitor(&self) -> Option<CoreMonitorHandle>

Returns the primary monitor of the system. Read more
Source§

fn set_window_icon(&self, window_icon: Option<Icon>)

Sets the window icon. Read more
Source§

fn ime_capabilities(&self) -> Option<ImeCapabilities>

Return enabled by the client ImeCapabilities for this window. Read more
Source§

fn request_ime_update(&self, request: ImeRequest) -> Result<(), ImeRequestError>

Atomically apply request to IME. Read more
Source§

fn request_user_attention(&self, request_type: Option<UserAttentionType>)

Requests user attention to the window, this has no effect if the application is already focused. How requesting for user attention manifests is platform dependent, see UserAttentionType for details. Read more
Source§

fn set_theme(&self, theme: Option<Theme>)

Set or override the window theme. Read more
Source§

fn theme(&self) -> Option<Theme>

Returns the current window theme. Read more
Source§

fn has_focus(&self) -> bool

Gets whether the window has keyboard focus. Read more
Source§

fn title(&self) -> String

Gets the current title of the window. Read more
Source§

fn focus_window(&self)

Brings the window to the front and sets input focus. Has no effect if the window is already in focus, minimized, or not visible. Read more
Source§

fn set_content_protected(&self, protected: bool)

Prevents the window contents from being captured by other apps. Read more
Source§

fn reset_dead_keys(&self)

Reset the dead key state of the keyboard. Read more
Source§

fn rwh_06_window_handle(&self) -> &dyn HasWindowHandle

Get the raw-window-handle v0.6 window handle.
Source§

fn rwh_06_display_handle(&self) -> &dyn HasDisplayHandle

Get the raw-window-handle v0.6 display handle.
Source§

fn set_ime_cursor_area(&self, position: Position, size: Size)

👎Deprecated: use Window::request_ime_update instead
Set the IME cursor editing area, where the position is the top left corner of that area in surface coordinates and size is the size of this area starting from the position. An example of such area could be a input field in the UI or line in the editor. Read more
Source§

fn set_ime_allowed(&self, allowed: bool)

👎Deprecated: use Window::request_ime_update instead
Sets whether the window should get IME events Read more
Source§

fn set_ime_purpose(&self, purpose: ImePurpose)

👎Deprecated: use Window::request_ime_update instead
Sets the IME purpose for the window using ImePurpose. Read more

Auto Trait Implementations§

§

impl Freeze for Window

§

impl RefUnwindSafe for Window

§

impl Send for Window

§

impl Sync for Window

§

impl Unpin for Window

§

impl UnwindSafe for Window

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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> HasRawDisplayHandle for T
where T: HasDisplayHandle + ?Sized,

Source§

fn raw_display_handle(&self) -> Result<RawDisplayHandle, HandleError>

👎Deprecated: Use HasDisplayHandle instead
Source§

impl<T> HasRawWindowHandle for T
where T: HasWindowHandle + ?Sized,

Source§

fn raw_window_handle(&self) -> Result<RawWindowHandle, HandleError>

👎Deprecated: Use HasWindowHandle instead
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more