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

LayerShellManager

Struct LayerShellManager 

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

Layer shell manager.

Tracks all layer surfaces and computes exclusive zones for the output.

Implementations§

Source§

impl LayerShellManager

Source

pub fn new() -> Self

Create a new layer shell manager.

Source

pub fn create_surface( &mut self, surface_id: u32, layer: Layer, namespace: &[u8], ) -> Result<u32, KernelError>

Create a new layer surface.

Returns the layer surface ID assigned by the manager.

Source

pub fn destroy_surface(&mut self, id: u32) -> Result<(), KernelError>

Destroy a layer surface.

Source

pub fn get_surface(&self, id: u32) -> Option<&LayerSurface>

Get a reference to a layer surface.

Source

pub fn get_surface_mut(&mut self, id: u32) -> Option<&mut LayerSurface>

Get a mutable reference to a layer surface.

Source

pub fn configure_surface( &mut self, id: u32, width: u32, height: u32, ) -> Result<u32, KernelError>

Configure a layer surface with its actual dimensions and send a configure serial to the client.

Returns the serial number to be sent in the configure event.

Source

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

Handle ack_configure from the client.

Source

pub fn get_surfaces_for_layer(&self, layer: Layer) -> Vec<&LayerSurface>

Get all layer surfaces belonging to a specific layer, sorted by creation order.

Source

pub fn calculate_exclusive_zones(&self) -> (i32, i32, i32, i32)

Calculate the total exclusive zone offsets for an output.

Returns (top, bottom, left, right) pixel offsets that normal windows should respect.

Source

pub fn get_usable_area( &self, output_width: u32, output_height: u32, ) -> UsableArea

Compute the usable area after subtracting all exclusive zones from the full output dimensions.

Source

pub fn surface_count(&self) -> usize

Return the total number of layer surfaces.

Trait Implementations§

Source§

impl Default for LayerShellManager

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl Freeze for LayerShellManager

§

impl RefUnwindSafe for LayerShellManager

§

impl Send for LayerShellManager

§

impl Sync for LayerShellManager

§

impl Unpin for LayerShellManager

§

impl UnwindSafe for LayerShellManager

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.