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: BrowserConfigConfiguration
tabs: TabManagerTab manager
isolation: ProcessIsolationProcess isolation
address_bar: AddressBarAddress bar state
Navigation bar
framebuffer: Vec<u32>Pixel buffer for the entire browser window (BGRA u32)
needs_repaint: boolWhether the browser needs a repaint
history: Vec<String>History of visited URLs (global, for autocomplete)
max_history: usizeMaximum history entries
running: boolWhether the browser is running
status_text: StringStatus bar text
Implementations§
Source§impl Browser
impl Browser
Sourcepub fn new(config: BrowserConfig) -> Self
pub fn new(config: BrowserConfig) -> Self
Create a new browser with the given configuration
Sourcepub fn open_url(&mut self, url: &str) -> Option<TabId>
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)
Navigate the active tab to a URL
Navigate a specific tab to a URL
Sourcepub fn handle_key(&mut self, scancode: u8, ctrl: bool, shift: bool, alt: bool)
pub fn handle_key(&mut self, scancode: u8, ctrl: bool, shift: bool, alt: bool)
Handle keyboard input
Sourcepub fn handle_click(&mut self, x: i32, y: i32)
pub fn handle_click(&mut self, x: i32, y: i32)
Handle mouse click at (x, y) relative to browser window
Sourcepub fn go_forward(&mut self)
pub fn go_forward(&mut self)
Go forward in the active tab
Sourcepub fn reload_active(&mut self)
pub fn reload_active(&mut self)
Reload the active tab
Sourcepub fn stop_loading(&mut self)
pub fn stop_loading(&mut self)
Stop loading the active tab
Sourcepub fn framebuffer(&self) -> &[u32]
pub fn framebuffer(&self) -> &[u32]
Get the framebuffer for display
Sourcepub fn dimensions(&self) -> (u32, u32)
pub fn dimensions(&self) -> (u32, u32)
Get browser dimensions
Sourcepub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
Whether the browser is still running