pub struct BrowserUi { /* private fields */ }Expand description
BrowserUi は 1 ウィンドウ分の状態管理を担当する。
責務:
- タブとアクティブタブの管理
- ウィンドウ・入力イベント(キーボード / IME / マウス / スクロール)の処理
- タブの tick と fetch 結果の配送
- 実際の描画は
BrowserRendererへ委譲する
Implementations§
Source§impl BrowserUi
impl BrowserUi
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a UI with the default BasicChrome, the default
BasicContextMenu and no tabs.
Sourcepub fn with_tab(tab: Tab) -> Self
pub fn with_tab(tab: Tab) -> Self
Creates a UI with one tab and the default BasicChrome.
Sourcepub fn with_chrome(chrome: Box<dyn Chrome>) -> Self
pub fn with_chrome(chrome: Box<dyn Chrome>) -> Self
Creates a UI with a custom chrome, the default BasicContextMenu
and no tabs.
Sourcepub fn with_tab_and_chrome(tab: Tab, chrome: Box<dyn Chrome>) -> Self
pub fn with_tab_and_chrome(tab: Tab, chrome: Box<dyn Chrome>) -> Self
Creates a UI with one tab, a custom chrome and the default
BasicContextMenu.
Creates a UI with a custom chrome, a custom context menu and no tabs.
Creates a UI with one tab, a custom chrome and a custom context menu.
Sourcepub fn active_tab_id(&self) -> Option<TabId>
pub fn active_tab_id(&self) -> Option<TabId>
Returns the active tab, if any.
pub fn active_tab(&self) -> Option<&Tab>
pub fn active_tab_mut(&mut self) -> Option<&mut Tab>
pub fn tab_mut(&mut self, id: &TabId) -> Option<&mut Tab>
pub fn add_tab(&mut self, tab: Tab)
Sourcepub fn set_window(
&mut self,
window_size: (u32, u32),
scale_factor: f64,
window_title: String,
)
pub fn set_window( &mut self, window_size: (u32, u32), scale_factor: f64, window_title: String, )
ウィンドウの初期サイズ・スケール・タイトルを設定する。
Sourcepub fn window_size(&self) -> (u32, u32)
pub fn window_size(&self) -> (u32, u32)
Returns the window size in physical pixels.
Sourcepub fn window_title(&self) -> String
pub fn window_title(&self) -> String
Returns the current window title.
Sourcepub fn redraw(&mut self, gpu: &mut GpuRenderer)
pub fn redraw(&mut self, gpu: &mut GpuRenderer)
Rebuilds the render tree and sends draw commands to the GPU for this window.
Sourcepub fn apply_draw_commands(&self, gpu: &mut GpuRenderer)
pub fn apply_draw_commands(&self, gpu: &mut GpuRenderer)
Applies the current draw commands to the GPU renderer.
Sourcepub fn handle_window_event(
&mut self,
event: WindowEvent,
gpu: &mut GpuRenderer,
) -> BrowserCommand
pub fn handle_window_event( &mut self, event: WindowEvent, gpu: &mut GpuRenderer, ) -> BrowserCommand
Handles a winit window event for this window and returns a BrowserCommand.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for BrowserUi
impl !Send for BrowserUi
impl !Sync for BrowserUi
impl !UnwindSafe for BrowserUi
impl Freeze for BrowserUi
impl Unpin for BrowserUi
impl UnsafeUnpin for BrowserUi
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().