pub struct XdgShell { /* private fields */ }Expand description
Manages the xdg_wm_base protocol state: ping/pong, xdg_surface and xdg_toplevel lifecycle.
Implementations§
Source§impl XdgShell
impl XdgShell
pub fn new() -> Self
Sourcepub fn handle_pong(&mut self, serial: u32) -> bool
pub fn handle_pong(&mut self, serial: u32) -> bool
Handle xdg_wm_base.pong from the client.
Sourcepub fn build_ping(&mut self, wm_base_id: u32) -> Vec<u8>
pub fn build_ping(&mut self, wm_base_id: u32) -> Vec<u8>
Build a ping event to send to the client.
Sourcepub fn create_xdg_surface(
&mut self,
xdg_surface_id: u32,
surface_id: u32,
) -> Result<(), KernelError>
pub fn create_xdg_surface( &mut self, xdg_surface_id: u32, surface_id: u32, ) -> Result<(), KernelError>
Create a new xdg_surface wrapping a wl_surface.
Sourcepub fn get_xdg_surface(&self, id: u32) -> Option<&XdgSurface>
pub fn get_xdg_surface(&self, id: u32) -> Option<&XdgSurface>
Get a reference to an xdg_surface.
Sourcepub fn get_xdg_surface_mut(&mut self, id: u32) -> Option<&mut XdgSurface>
pub fn get_xdg_surface_mut(&mut self, id: u32) -> Option<&mut XdgSurface>
Get a mutable reference to an xdg_surface.
Sourcepub fn destroy_xdg_surface(&mut self, id: u32) -> bool
pub fn destroy_xdg_surface(&mut self, id: u32) -> bool
Destroy an xdg_surface.
Sourcepub fn with_toplevel_mut<R, F: FnOnce(&mut XdgToplevel) -> R>(
&mut self,
toplevel_id: u32,
f: F,
) -> Option<R>
pub fn with_toplevel_mut<R, F: FnOnce(&mut XdgToplevel) -> R>( &mut self, toplevel_id: u32, f: F, ) -> Option<R>
Find and mutate a toplevel by its object ID.
Scans all xdg_surfaces for a toplevel matching toplevel_id and calls
f on it if found.
Sourcepub fn create_toplevel(
&mut self,
xdg_surface_id: u32,
toplevel_id: u32,
) -> Result<(), KernelError>
pub fn create_toplevel( &mut self, xdg_surface_id: u32, toplevel_id: u32, ) -> Result<(), KernelError>
Create a toplevel role on an xdg_surface.
Sourcepub fn build_initial_configure(
&mut self,
xdg_surface_id: u32,
width: u32,
height: u32,
) -> Vec<u8>
pub fn build_initial_configure( &mut self, xdg_surface_id: u32, width: u32, height: u32, ) -> Vec<u8>
Build an xdg_toplevel.configure event followed by xdg_surface.configure.
This is the initial configure sequence that must be sent before the client can attach buffers.
Sourcepub fn build_close_event(&self, xdg_surface_id: u32) -> Option<Vec<u8>>
pub fn build_close_event(&self, xdg_surface_id: u32) -> Option<Vec<u8>>
Build an xdg_toplevel.close event.