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

WindowManager

Struct WindowManager 

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

Window Manager

Implementations§

Source§

impl WindowManager

Source

pub fn new() -> Self

Create a new window manager

Source

pub fn create_window( &self, x: i32, y: i32, width: u32, height: u32, owner_pid: u64, ) -> Result<WindowId, KernelError>

Create a new window

Source

pub fn destroy_window(&self, window_id: WindowId) -> Result<(), KernelError>

Destroy a window

Source

pub fn move_window( &self, window_id: WindowId, x: i32, y: i32, ) -> Result<(), KernelError>

Move a window

Source

pub fn resize_window( &self, window_id: WindowId, width: u32, height: u32, ) -> Result<(), KernelError>

Resize a window

Source

pub fn focus_window(&self, window_id: WindowId) -> Result<(), KernelError>

Focus a window

Source

pub fn window_at_position(&self, x: i32, y: i32) -> Option<WindowId>

Get window at position

Source

pub fn process_input(&self, event: InputEvent)

Process input event

Source

pub fn queue_event(&self, event: WindowEvent)

Queue an event for delivery

Source

pub fn get_events(&self, window_id: WindowId) -> Vec<InputEvent>

Get pending events for a window

Source

pub fn set_window_title(&self, window_id: WindowId, title: &str)

Set a window’s title.

Source

pub fn get_window(&self, window_id: WindowId) -> Option<Window>

Get a clone of a window by ID.

Source

pub fn get_focused_window_id(&self) -> Option<WindowId>

Get the currently focused window ID.

Source

pub fn get_all_windows(&self) -> Vec<Window>

Get all windows

Source

pub fn get_visible_windows(&self) -> Vec<Window>

Get all visible windows on the active workspace, ordered by z-order (bottom to top – last element is the topmost window).

Source

pub fn set_screen_size(&self, width: u32, height: u32)

Set the screen dimensions (called when display is configured)

Source

pub fn set_placement_heuristic(&self, heuristic: PlacementHeuristic)

Set the window placement heuristic

Source

pub fn place_window(&self, window_id: WindowId) -> (i32, i32)

Compute the placement position for a window based on the current heuristic.

The window must already be inserted into self.windows so its dimensions can be read. Returns (x, y) for the top-left corner.

Source

pub fn snap_window(&self, window_id: WindowId, zone: SnapZone)

Snap a window to a screen zone (half, quarter, or maximize).

Saves the window’s current geometry so it can be restored later.

Source

pub fn detect_snap_zone( x: i32, y: i32, screen_w: u32, screen_h: u32, ) -> SnapZone

Detect which snap zone a screen coordinate falls in.

Returns SnapZone::None if the position is not within the edge threshold (8 pixels).

Source

pub fn tile_windows(&self, layout: TileLayout)

Tile all visible windows on the active workspace using the given layout.

Source

pub fn set_window_opacity(&self, window_id: WindowId, opacity: u8)

Set window opacity (0 = transparent, 255 = opaque)

Source

pub fn switch_workspace(&self, workspace_id: WorkspaceId)

Switch to a different workspace.

Source

pub fn move_window_to_workspace( &self, window_id: WindowId, workspace_id: WorkspaceId, )

Move a window to a different workspace.

Source

pub fn get_active_workspace(&self) -> WorkspaceId

Get the currently active workspace ID.

Source

pub fn get_workspace_windows(&self, workspace_id: WorkspaceId) -> Vec<WindowId>

Get the list of window IDs on a given workspace.

Source

pub fn event_loop_iteration(&self)

Event loop iteration

Trait Implementations§

Source§

impl Default for WindowManager

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl !Freeze for WindowManager

§

impl !RefUnwindSafe for WindowManager

§

impl Send for WindowManager

§

impl Sync for WindowManager

§

impl Unpin for WindowManager

§

impl UnwindSafe for WindowManager

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.