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

XWaylandServer

Struct XWaylandServer 

Source
pub struct XWaylandServer { /* private fields */ }
Expand description

XWayland compatibility server.

Manages the lifecycle of the XWayland process and maintains the mapping between X11 window IDs and Wayland surface IDs.

Implementations§

Source§

impl XWaylandServer

Source

pub fn new() -> Self

Create a new XWayland server (not yet started).

Source

pub fn with_display(display: u32) -> Self

Create a new XWayland server with a specific display number.

Source

pub fn start(&mut self) -> Result<(), KernelError>

Start the XWayland server.

In this stub implementation, this creates the socket directory structure and transitions to the Running state. Actual XWayland process spawning is deferred to Phase 8.

Source

pub fn stop(&mut self) -> Result<(), KernelError>

Stop the XWayland server.

Source

pub fn state(&self) -> XWaylandState

Get the current server state.

Source

pub fn display_number(&self) -> u32

Get the display number.

Source

pub fn socket_path(&self) -> &str

Get the socket path.

Source

pub fn is_running(&self) -> bool

Check if the server is running.

Source

pub fn create_window_mapping( &mut self, wayland_surface_id: u32, ) -> Result<u32, KernelError>

Create a new X11-to-Wayland window mapping.

Called when XWayland creates a new X11 window and its corresponding Wayland surface.

Source

pub fn destroy_window_mapping( &mut self, x11_window_id: u32, ) -> Result<(), KernelError>

Destroy a window mapping by X11 window ID.

Source

pub fn get_surface_for_x11_window(&self, x11_window_id: u32) -> Option<u32>

Get the Wayland surface ID for an X11 window.

Source

pub fn get_x11_window_for_surface(&self, wayland_surface_id: u32) -> Option<u32>

Get the X11 window ID for a Wayland surface.

Source

pub fn get_window_mapping( &self, x11_window_id: u32, ) -> Option<&X11WindowMapping>

Get a reference to a window mapping.

Source

pub fn get_window_mapping_mut( &mut self, x11_window_id: u32, ) -> Option<&mut X11WindowMapping>

Get a mutable reference to a window mapping.

Source

pub fn get_all_mappings(&self) -> &[X11WindowMapping]

Get all active window mappings.

Source

pub fn window_count(&self) -> usize

Get the number of active window mappings.

Source

pub fn handle_x11_event(&mut self, event: &X11Event) -> Result<(), KernelError>

Handle an X11 event from the XWayland process.

In the stub implementation, this updates internal mappings. In Phase 8, this would translate X11 events to Wayland compositor actions.

Source

pub fn find_free_display() -> Result<u32, KernelError>

Find a free display number by checking for existing lock files.

Returns the first available display number, or an error if all display numbers up to MAX_DISPLAY are taken.

Source

pub fn display_string(&self) -> String

Get the DISPLAY environment variable string for this server.

Returns a string like “:0” that X11 clients use to connect.

Trait Implementations§

Source§

impl Default for XWaylandServer

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl Freeze for XWaylandServer

§

impl RefUnwindSafe for XWaylandServer

§

impl Send for XWaylandServer

§

impl Sync for XWaylandServer

§

impl Unpin for XWaylandServer

§

impl UnwindSafe for XWaylandServer

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.