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

AppSwitcher

Struct AppSwitcher 

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

Switcher overlay state.

The overlay is drawn centered on screen and shows one entry per open window. Entries are rendered as an icon + title, with the currently selected entry highlighted.

Implementations§

Source§

impl AppSwitcher

Source

pub fn new() -> Self

Create a new (hidden) application switcher.

Source

pub fn show(&mut self, windows: Vec<(u32, String)>)

Show the switcher overlay populated with the given windows.

windows is a list of (window_id, title) pairs in Z-order (top first). The first entry is pre-selected.

Source

pub fn hide(&mut self) -> Option<u32>

Hide the overlay and return the selected window ID (if any).

Source

pub fn next(&mut self)

Advance selection to the next entry (wraps around).

Source

pub fn previous(&mut self)

Move selection to the previous entry (wraps around).

Source

pub fn is_visible(&self) -> bool

Returns true if the overlay is currently visible.

Source

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

Get the currently selected window ID (without hiding the overlay).

Source

pub fn entry_count(&self) -> usize

Get the number of entries.

Source

pub fn render(&self, buffer: &mut [u32], buf_width: u32, buf_height: u32)

Render the switcher overlay into a u32 XRGB8888 buffer.

The overlay is drawn centered on the screen. buf_width and buf_height are the full screen dimensions.

Trait Implementations§

Source§

impl Default for AppSwitcher

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl Freeze for AppSwitcher

§

impl RefUnwindSafe for AppSwitcher

§

impl Send for AppSwitcher

§

impl Sync for AppSwitcher

§

impl Unpin for AppSwitcher

§

impl UnwindSafe for AppSwitcher

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.