pub struct WindowHandle {
Show 18 fields pub window: ManuallyDrop<Window<AdwaitaFrame>>, pub fractional_scaling_state: Option<FractionalScalingState>, pub scale_factor: Arc<Mutex<f64>>, pub size: Arc<Mutex<LogicalSize<u32>>>, pub pending_window_requests: Arc<Mutex<Vec<WindowRequest>>>, pub cursor_icon: Cell<CursorIcon>, pub is_resizable: Cell<bool>, pub has_focus: Arc<AtomicBool>, pub ime_allowed: Cell<bool>, pub ime_purpose: Cell<ImePurpose>, pub transparent: Cell<bool>, cursor_visible: Cell<bool>, cursor_grab_mode: Cell<CursorGrabMode>, pointers: Vec<WinitPointer>, text_inputs: Vec<TextInputHandler>, xdg_activation: Option<Attached<XdgActivationV1>>, attention_requested: Cell<bool>, compositor: Attached<WlCompositor>,
}
Expand description

A handle to perform operations on SCTK window and react to events.

Fields§

§window: ManuallyDrop<Window<AdwaitaFrame>>

An actual window.

§fractional_scaling_state: Option<FractionalScalingState>

The state of the fractional scaling handlers for the window.

§scale_factor: Arc<Mutex<f64>>

The scale factor of the window.

§size: Arc<Mutex<LogicalSize<u32>>>

The current size of the window.

§pending_window_requests: Arc<Mutex<Vec<WindowRequest>>>

A pending requests to SCTK window.

§cursor_icon: Cell<CursorIcon>

Current cursor icon.

§is_resizable: Cell<bool>

Whether the window is resizable.

§has_focus: Arc<AtomicBool>

Whether the window has keyboard focus.

§ime_allowed: Cell<bool>

Allow IME events for that window.

§ime_purpose: Cell<ImePurpose>

IME purpose for that window.

§transparent: Cell<bool>

Wether the window is transparent.

§cursor_visible: Cell<bool>

Visible cursor or not.

§cursor_grab_mode: Cell<CursorGrabMode>

Cursor confined to the surface.

§pointers: Vec<WinitPointer>

Pointers over the current surface.

§text_inputs: Vec<TextInputHandler>

Text inputs on the current surface.

§xdg_activation: Option<Attached<XdgActivationV1>>

XdgActivation object.

§attention_requested: Cell<bool>

Indicator whether user attention is requested.

§compositor: Attached<WlCompositor>

Compositor

Implementations§

source§

impl WindowHandle

source

pub fn new( env: &Environment<WinitEnv>, window: Window<AdwaitaFrame>, size: Arc<Mutex<LogicalSize<u32>>>, has_focus: Arc<AtomicBool>, fractional_scaling_state: Option<FractionalScalingState>, scale_factor: f64, pending_window_requests: Arc<Mutex<Vec<WindowRequest>>> ) -> Self

source

pub fn scale_factor(&self) -> f64

source

pub fn set_cursor_grab(&self, mode: CursorGrabMode)

source

pub fn set_locked_cursor_position(&self, position: LogicalPosition<u32>)

source

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

source

pub fn pointer_entered(&mut self, pointer: WinitPointer)

Pointer appeared over the window.

source

pub fn pointer_left(&mut self, pointer: WinitPointer)

Pointer left the window.

source

pub fn text_input_entered(&mut self, text_input: TextInputHandler)

source

pub fn text_input_left(&mut self, text_input: TextInputHandler)

source

pub fn set_ime_position(&self, position: LogicalPosition<u32>)

source

pub fn passthrough_mouse_input(&self, passthrough_mouse_input: bool)

source

pub fn set_transparent(&self, transparent: bool)

source

pub fn set_ime_allowed(&self, allowed: bool, event_sink: &mut EventSink)

source

pub fn set_ime_purpose(&self, purpose: ImePurpose)

source

pub fn set_cursor_visible(&self, visible: bool)

source

pub fn set_cursor_icon(&self, cursor_icon: CursorIcon)

source

pub fn drag_window(&self)

Trait Implementations§

source§

impl Drop for WindowHandle

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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, U> Into<U> for Twhere 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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.