Struct winit::platform_impl::platform::wayland::window::shim::WindowHandle
source · 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
impl WindowHandle
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
pub fn scale_factor(&self) -> f64
pub fn set_cursor_grab(&self, mode: CursorGrabMode)
pub fn set_locked_cursor_position(&self, position: LogicalPosition<u32>)
pub fn set_user_attention(&self, request_type: Option<UserAttentionType>)
sourcepub fn pointer_entered(&mut self, pointer: WinitPointer)
pub fn pointer_entered(&mut self, pointer: WinitPointer)
Pointer appeared over the window.
sourcepub fn pointer_left(&mut self, pointer: WinitPointer)
pub fn pointer_left(&mut self, pointer: WinitPointer)
Pointer left the window.
pub fn text_input_entered(&mut self, text_input: TextInputHandler)
pub fn text_input_left(&mut self, text_input: TextInputHandler)
pub fn set_ime_position(&self, position: LogicalPosition<u32>)
pub fn passthrough_mouse_input(&self, passthrough_mouse_input: bool)
pub fn set_transparent(&self, transparent: bool)
pub fn set_ime_allowed(&self, allowed: bool, event_sink: &mut EventSink)
pub fn set_ime_purpose(&self, purpose: ImePurpose)
pub fn set_cursor_visible(&self, visible: bool)
pub fn set_cursor_icon(&self, cursor_icon: CursorIcon)
pub fn drag_window(&self)
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for WindowHandle
impl !Send for WindowHandle
impl !Sync for WindowHandle
impl Unpin for WindowHandle
impl !UnwindSafe for WindowHandle
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more