⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

XdgShell

Struct XdgShell 

Source
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

Source

pub fn new() -> Self

Source

pub fn handle_pong(&mut self, serial: u32) -> bool

Handle xdg_wm_base.pong from the client.

Source

pub fn build_ping(&mut self, wm_base_id: u32) -> Vec<u8>

Build a ping event to send to the client.

Source

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.

Source

pub fn get_xdg_surface(&self, id: u32) -> Option<&XdgSurface>

Get a reference to an xdg_surface.

Source

pub fn get_xdg_surface_mut(&mut self, id: u32) -> Option<&mut XdgSurface>

Get a mutable reference to an xdg_surface.

Source

pub fn destroy_xdg_surface(&mut self, id: u32) -> bool

Destroy an xdg_surface.

Source

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.

Source

pub fn create_toplevel( &mut self, xdg_surface_id: u32, toplevel_id: u32, ) -> Result<(), KernelError>

Create a toplevel role on an xdg_surface.

Source

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.

Source

pub fn build_close_event(&self, xdg_surface_id: u32) -> Option<Vec<u8>>

Build an xdg_toplevel.close event.

Trait Implementations§

Source§

impl Default for XdgShell

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for XdgShell

§

impl RefUnwindSafe for XdgShell

§

impl Send for XdgShell

§

impl Sync for XdgShell

§

impl Unpin for XdgShell

§

impl UnwindSafe for XdgShell

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

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

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

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

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

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.