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

Browser

Struct Browser 

Source
pub struct Browser {
    pub config: BrowserConfig,
    pub tabs: TabManager,
    pub isolation: ProcessIsolation,
    pub address_bar: AddressBar,
    pub nav_bar: NavigationBar,
    pub framebuffer: Vec<u32>,
    pub needs_repaint: bool,
    pub history: Vec<String>,
    pub max_history: usize,
    pub running: bool,
    pub status_text: String,
}
Expand description

The main browser struct, integrating tabs, isolation, and rendering

Fields§

§config: BrowserConfig

Configuration

§tabs: TabManager

Tab manager

§isolation: ProcessIsolation

Process isolation

§address_bar: AddressBar

Address bar state

§nav_bar: NavigationBar

Navigation bar

§framebuffer: Vec<u32>

Pixel buffer for the entire browser window (BGRA u32)

§needs_repaint: bool

Whether the browser needs a repaint

§history: Vec<String>

History of visited URLs (global, for autocomplete)

§max_history: usize

Maximum history entries

§running: bool

Whether the browser is running

§status_text: String

Status bar text

Implementations§

Source§

impl Browser

Source

pub fn new(config: BrowserConfig) -> Self

Create a new browser with the given configuration

Source

pub fn init(&mut self)

Initialize the browser: open the home page in a new tab

Source

pub fn open_url(&mut self, url: &str) -> Option<TabId>

Open a URL in a new tab (or the current tab if it’s blank)

Source

pub fn navigate_active(&mut self, url: &str)

Navigate the active tab to a URL

Source

pub fn navigate_tab(&mut self, tab_id: TabId, url: &str)

Navigate a specific tab to a URL

Source

pub fn handle_key(&mut self, scancode: u8, ctrl: bool, shift: bool, alt: bool)

Handle keyboard input

Source

pub fn handle_click(&mut self, x: i32, y: i32)

Handle mouse click at (x, y) relative to browser window

Source

pub fn go_back(&mut self)

Go back in the active tab

Source

pub fn go_forward(&mut self)

Go forward in the active tab

Source

pub fn reload_active(&mut self)

Reload the active tab

Source

pub fn go_home(&mut self)

Navigate to home page

Source

pub fn stop_loading(&mut self)

Stop loading the active tab

Source

pub fn close_tab(&mut self, tab_id: TabId)

Close a tab

Source

pub fn render(&mut self)

Render the entire browser to the framebuffer

Source

pub fn tick(&mut self)

Tick the browser (advance timers, GC, etc.)

Source

pub fn framebuffer(&self) -> &[u32]

Get the framebuffer for display

Source

pub fn dimensions(&self) -> (u32, u32)

Get browser dimensions

Source

pub fn tab_count(&self) -> usize

Number of open tabs

Source

pub fn is_running(&self) -> bool

Whether the browser is still running

Source

pub fn quit(&mut self)

Quit the browser

Trait Implementations§

Source§

impl Default for Browser

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl Freeze for Browser

§

impl RefUnwindSafe for Browser

§

impl Send for Browser

§

impl Sync for Browser

§

impl Unpin for Browser

§

impl UnwindSafe for Browser

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.