pub struct WaylandWindow {Show 16 fields
pub redraw_requested: bool,
pub globals: WaylandGlobals,
pub registry_id: u32,
pub compositor_id: u32,
pub shm_id: u32,
pub xdg_wm_base_id: u32,
pub seat_id: u32,
pub surface_id: u32,
pub xdg_surface_id: u32,
pub xdg_toplevel_id: u32,
pub pointer_id: u32,
pub keyboard_id: u32,
pub last_serial: u32,
pub shm_buffer: Option<ShmBuffer>,
pub cursor_pos: (f32, f32),
pub last_click: Option<(Instant, f32, f32)>,
/* private fields */
}Expand description
Pure-Rust Wayland window implementation backed by UNIX domain socket IPC.
Fields§
§redraw_requested: bool§globals: WaylandGlobals§registry_id: u32§compositor_id: u32§shm_id: u32§xdg_wm_base_id: u32§seat_id: u32§surface_id: u32§xdg_surface_id: u32§xdg_toplevel_id: u32§pointer_id: u32§keyboard_id: u32§last_serial: u32§shm_buffer: Option<ShmBuffer>§cursor_pos: (f32, f32)§last_click: Option<(Instant, f32, f32)>Implementations§
Source§impl WaylandWindow
impl WaylandWindow
Sourcepub fn new(config: WindowConfig) -> Result<WaylandWindow, String>
pub fn new(config: WindowConfig) -> Result<WaylandWindow, String>
Attempts to connect to the active Wayland compositor and instantiate a native window.
Sourcepub fn present_bgra(
&mut self,
pixels: &[u8],
width: u32,
height: u32,
) -> Result<(), String>
pub fn present_bgra( &mut self, pixels: &[u8], width: u32, height: u32, ) -> Result<(), String>
Presents a 32-bit BGRA buffer directly to the Wayland surface via wl_shm.
Sourcepub fn poll_native_events(&mut self) -> Vec<PlatformEvent>
pub fn poll_native_events(&mut self) -> Vec<PlatformEvent>
Pumps incoming Wayland socket events and returns translated platform events.
Trait Implementations§
Source§impl NativeSurfaceWindow for WaylandWindow
impl NativeSurfaceWindow for WaylandWindow
Source§fn present_surface(
&mut self,
pixels: &[u8],
width: u32,
height: u32,
) -> Result<(), PresentError>
fn present_surface( &mut self, pixels: &[u8], width: u32, height: u32, ) -> Result<(), PresentError>
Blits a 32-bit BGRA uncompressed buffer to the window client area.
Source§impl PlatformWindow for WaylandWindow
impl PlatformWindow for WaylandWindow
fn title(&self) -> &str
fn set_title(&mut self, title: &str)
fn size(&self) -> (u32, u32)
fn set_size(&mut self, width: u32, height: u32)
fn scale_factor(&self) -> f32
fn set_scale_factor(&mut self, scale_factor: f32)
fn mode(&self) -> WindowMode
fn set_mode(&mut self, mode: WindowMode)
fn is_focused(&self) -> bool
fn set_focused(&mut self, focused: bool)
fn cursor(&self) -> CursorIcon
fn set_cursor(&mut self, cursor: CursorIcon)
fn request_redraw(&mut self)
fn is_redraw_requested(&self) -> bool
fn poll_events(&mut self) -> Vec<PlatformEvent>
fn push_event(&mut self, event: PlatformEvent)
Source§fn begin_window_drag(&mut self, _x: f32, _y: f32)
fn begin_window_drag(&mut self, _x: f32, _y: f32)
Initiates an interactive window drag operation with the native window manager.
Source§fn begin_window_resize(&mut self, edge: CsdHitZone, _x: f32, _y: f32)
fn begin_window_resize(&mut self, edge: CsdHitZone, _x: f32, _y: f32)
Initiates an interactive window resize operation with the native window manager.
Source§fn current_monitor(&self) -> Option<MonitorInfo>
fn current_monitor(&self) -> Option<MonitorInfo>
Returns the monitor containing the center of this window, if known.
Source§fn available_monitors(&self) -> Vec<MonitorInfo>
fn available_monitors(&self) -> Vec<MonitorInfo>
Returns the list of currently connected physical display monitors.
Source§fn primary_monitor(&self) -> Option<MonitorInfo>
fn primary_monitor(&self) -> Option<MonitorInfo>
Returns the primary system monitor.
Source§fn on_accessibility_update(&mut self, _json_payload: &str)
fn on_accessibility_update(&mut self, _json_payload: &str)
Transmits an incremental AccessKit/OS accessibility tree update to native screen readers.
Source§fn set_ime_cursor_location(
&mut self,
_x: i32,
_y: i32,
_width: i32,
_height: i32,
)
fn set_ime_cursor_location( &mut self, _x: i32, _y: i32, _width: i32, _height: i32, )
Sets candidate window positioning following active text caret coordinate.
Source§fn set_ime_surrounding_text(&mut self, _text: &str, _cursor_index: i32)
fn set_ime_surrounding_text(&mut self, _text: &str, _cursor_index: i32)
Updates surrounding text buffer for context-aware IME prediction.
Source§fn toggle_maximize(&mut self) -> bool
fn toggle_maximize(&mut self) -> bool
Toggles the window maximized state and returns true if the window is now maximized.
Auto Trait Implementations§
impl !Send for WaylandWindow
impl !Sync for WaylandWindow
impl Forget for WaylandWindow
impl Freeze for WaylandWindow
impl Move for WaylandWindow
impl RefUnwindSafe for WaylandWindow
impl Unpin for WaylandWindow
impl UnsafeUnpin for WaylandWindow
impl UnwindSafe for WaylandWindow
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