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

OutputManager

Struct OutputManager 

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

Manages all display outputs and their configuration.

The output manager tracks the global coordinate layout, handles hotplug events, and provides queries for surface-to-output mapping.

Implementations§

Source§

impl OutputManager

Source

pub fn new() -> Self

Create a new output manager with no outputs.

Source

pub fn new_with_framebuffer(width: u32, height: u32) -> Self

Create an output manager with a single virtual output matching the framebuffer dimensions.

Source

pub fn add_output(&mut self, output: Output) -> u32

Add a new output to the manager. Returns the assigned output ID.

Source

pub fn remove_output(&mut self, id: u32) -> Option<Output>

Remove an output by ID.

If the removed output was primary, the next available output becomes primary. Returns the removed output if it existed.

Source

pub fn get_output(&self, id: u32) -> Option<&Output>

Get a reference to an output by ID.

Source

pub fn get_output_mut(&mut self, id: u32) -> Option<&mut Output>

Get a mutable reference to an output by ID.

Source

pub fn get_primary(&self) -> Option<&Output>

Get the primary output.

Source

pub fn get_primary_id(&self) -> Option<u32>

Get the primary output ID.

Source

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

Set the primary output.

Source

pub fn get_all_outputs(&self) -> Vec<&Output>

Get all outputs as a list of references.

Source

pub fn output_count(&self) -> usize

Get the number of active outputs.

Source

pub fn get_total_area(&self) -> (i32, i32, u32, u32)

Calculate the total bounding rectangle across all outputs.

Returns (min_x, min_y, total_width, total_height) in global coords.

Source

pub fn get_output_at_point(&self, x: i32, y: i32) -> Option<u32>

Find the output at a given point in global coordinates.

Returns the output ID if found.

Source

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

Set the scale factor for an output.

Source

pub fn set_position( &mut self, id: u32, x: i32, y: i32, ) -> Result<(), KernelError>

Set the position of an output in global coordinates.

Source

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

Set the transform for an output.

Source

pub fn handle_hotplug(&mut self, output: Output) -> u32

Handle a hotplug event: add a new output to the right of existing outputs.

Returns the assigned output ID.

Source

pub fn arrange_horizontal(&mut self)

Arrange outputs side by side (left to right) in the order they were added.

Source

pub fn arrange_vertical(&mut self)

Arrange outputs vertically (top to bottom).

Source

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

Enable or disable an output.

Source

pub fn scale_at_point(&self, x: i32, y: i32) -> u32

Get the effective scale for a point in global coordinates.

Returns the scale factor of the output containing the point, or 1 if no output contains the point.

Source

pub fn outputs_for_rect(&self, x: i32, y: i32, w: u32, h: u32) -> Vec<u32>

Get all outputs that overlap with a given rectangle.

Trait Implementations§

Source§

impl Default for OutputManager

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl !Freeze for OutputManager

§

impl RefUnwindSafe for OutputManager

§

impl Send for OutputManager

§

impl Sync for OutputManager

§

impl Unpin for OutputManager

§

impl UnwindSafe for OutputManager

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.