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

AppLauncher

Struct AppLauncher 

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

Application launcher with search, grid display, and keyboard navigation.

Implementations§

Source§

impl AppLauncher

Source

pub fn new() -> Self

Create a new application launcher pre-populated with default applications.

Source

pub fn show(&mut self)

Show the launcher overlay, clearing any previous search.

Source

pub fn hide(&mut self)

Hide the launcher overlay.

Source

pub fn toggle(&mut self)

Toggle the launcher between visible and hidden.

Source

pub fn is_visible(&self) -> bool

Returns true if the launcher is currently visible.

Source

pub fn set_overlay_rect( &mut self, x: usize, y: usize, width: usize, height: usize, )

Set the overlay position and dimensions (called when screen size is known).

Source

pub fn register_app(&mut self, entry: AppEntry)

Register a new application entry with the launcher.

Source

pub fn unregister_app(&mut self, exec_path: &str)

Remove an application by exec path.

Source

pub fn handle_key(&mut self, key: u8) -> Option<LauncherAction>

Handle a keyboard input event.

Returns an optional LauncherAction indicating what the caller should do (launch an app, hide the launcher, or nothing).

Key mappings:

  • Enter (0x0A or 0x0D): launch the selected application
  • Escape (0x1B): hide the launcher
  • Backspace (0x08): delete last character from search query
  • Arrow Up (0x80): move selection up one row
  • Arrow Down (0x81): move selection down one row
  • Arrow Left (0x82): move selection left one column
  • Arrow Right (0x83): move selection right one column
  • Printable ASCII (0x20..=0x7E): append to search query, filter entries
Source

pub fn handle_click(&mut self, x: usize, y: usize) -> Option<LauncherAction>

Handle a mouse click at absolute screen coordinates (x, y).

Returns Some(LauncherAction::Launch(...)) if an app entry was clicked, or None if the click was outside the grid area (but still inside the overlay).

Source

pub fn filter_entries(&mut self)

Filter entries by the current search_query.

Performs a case-insensitive substring match on the application name. If the query is empty, all entries are shown.

Source

pub fn selected_entry(&self) -> Option<&AppEntry>

Get a reference to the currently selected application entry.

Source

pub fn visible_entries(&self) -> &[usize]

Get the indices of visible (filtered) entries.

Source

pub fn filtered_count(&self) -> usize

Get the total number of filtered entries.

Source

pub fn entries(&self) -> &[AppEntry]

Get a reference to all registered entries.

Source

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

Render the launcher overlay into a u32 BGRA pixel buffer.

The buffer dimensions must be buf_width * buf_height elements. The launcher is drawn at its configured overlay position.

Trait Implementations§

Source§

impl Default for AppLauncher

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl Freeze for AppLauncher

§

impl RefUnwindSafe for AppLauncher

§

impl Send for AppLauncher

§

impl Sync for AppLauncher

§

impl Unpin for AppLauncher

§

impl UnwindSafe for AppLauncher

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.