Struct PaintEngine
pub struct PaintEngine { /* private fields */ }Expand description
Any engine, drawn as a display list. Commands and events pass through; the source’s own requests and answers are consumed here.
Implementations§
§impl PaintEngine
impl PaintEngine
pub fn new(inner: Arc<dyn WebViewEngine>) -> Arc<PaintEngine> ⓘ
pub fn with_interval(
inner: Arc<dyn WebViewEngine>,
interval: Duration,
) -> Arc<PaintEngine> ⓘ
pub fn with_interval( inner: Arc<dyn WebViewEngine>, interval: Duration, ) -> Arc<PaintEngine> ⓘ
As Self::new, capturing at most once per interval.
pub fn streaming(inner: Arc<dyn WebViewEngine>) -> Arc<PaintEngine> ⓘ
pub fn streaming(inner: Arc<dyn WebViewEngine>) -> Arc<PaintEngine> ⓘ
An engine drawn from its own pixels, whose page is captured as a display list only while a session shares it with someone watching.
Trait Implementations§
§impl WebViewEngine for PaintEngine
impl WebViewEngine for PaintEngine
§fn create_tab(&self) -> Result<Arc<dyn WebViewEngine>, String>
fn create_tab(&self) -> Result<Arc<dyn WebViewEngine>, String>
Create an independent document in the same runtime/profile. Read more
§fn set_visible(&self, visible: bool)
fn set_visible(&self, visible: bool)
Suspend painting without discarding the document or its session history.
§fn presented(&self)
fn presented(&self)
A view drew this engine’s page just now. Engines that stop painting
pages nobody draws (see
paint::PaintEngine) resume here.§fn set_modifiers(&self, modifiers: KeyModifiers)
fn set_modifiers(&self, modifiers: KeyModifiers)
Keep pointer modifiers current even when no key event reaches the page.
§fn take_new_tab_requests(&self) -> Vec<(String, bool)>
fn take_new_tab_requests(&self) -> Vec<(String, bool)>
Native new-window intents, delivered to browser chrome as tab requests.
§fn supports_native_filtering(&self) -> bool
fn supports_native_filtering(&self) -> bool
Whether this backend accepts source rules instead of
WebKit JSON.§fn send(&self, cmd: WebViewCommand)
fn send(&self, cmd: WebViewCommand)
Enqueue a command. Must never block on engine work.
fn frames(&self) -> Arc<Mutex<Option<Frame>>> ⓘ
§fn paint_seq(&self) -> u64
fn paint_seq(&self) -> u64
The sequence number of the display list this engine paints
(
Self::paint_frame’s Frame::seq):
moves on with every change to what the page draws, so a widget
repaints exactly when the page did. 0 for an engine that paints
pixels rather than a display list.§fn drain_events(&self) -> Vec<WebViewEvent>
fn drain_events(&self) -> Vec<WebViewEvent>
Take all pending events, oldest first.
§fn request_close(&self) -> bool
fn request_close(&self) -> bool
Request native close admission. True allows immediate local close; false
completes asynchronously through
TabClosed, TabDetached or TabCloseBlocked.§fn drain_download_events(&self) -> Vec<WebViewEvent>
fn drain_download_events(&self) -> Vec<WebViewEvent>
Runtime-owned download events, independent of a tab lifetime.
§fn set_waker(&self, waker: Box<dyn Fn() + Send + Sync>)
fn set_waker(&self, waker: Box<dyn Fn() + Send + Sync>)
Invoked (from any thread) whenever a new frame or event is ready —
typically wired to the winit event loop proxy so idle apps repaint
on engine activity. Synchronous engines don’t need one.
§fn wrapped(&self) -> Option<&Arc<dyn WebViewEngine>>
fn wrapped(&self) -> Option<&Arc<dyn WebViewEngine>>
The engine this one wraps, for what only a backend can answer.
§fn paint_frame(&self) -> Option<Arc<Frame>>
fn paint_frame(&self) -> Option<Arc<Frame>>
§fn take_paint_stream(&self, keyframe: bool) -> Vec<Payload>
fn take_paint_stream(&self, keyframe: bool) -> Vec<Payload>
The page as a stream for a session to share: a whole frame when
keyframe (or when the consumer must start over), else the patches
since the last call, followed by images not sent yet. Empty for an
engine without a display list.§fn paint_blob(&self, hash: &[u8; 32]) -> Option<Arc<Vec<u8>>>
fn paint_blob(&self, hash: &[u8; 32]) -> Option<Arc<Vec<u8>>>
Encoded bytes of an image a
paint_frame references.fn supports_text_input(&self) -> bool
§fn supports_guarded_edit_history(&self) -> bool
fn supports_guarded_edit_history(&self) -> bool
Whether original-field acknowledged Undo/Redo is supported.
§fn handle_undo_request(&self, request: UndoRequest) -> bool
fn handle_undo_request(&self, request: UndoRequest) -> bool
Offer system Undo/Redo to this page’s native editing history.
True means the backend consumed the request, not that a history entry
existed or that an asynchronous edit has already completed.
§fn text_input(&self, request: Request) -> Option<Receipt>
fn text_input(&self, request: Request) -> Option<Receipt>
Private text transactions never enter the app event or page-agent stream.
§fn accept_popups(&self)
fn accept_popups(&self)
Have the page’s popup windows (
window.open with a size: a sign-in,
a payment) opened as popups of this page, which can answer it,
rather than as tabs: Self::take_popups then lists them. An engine
that cannot goes on opening them as tabs.§fn accept_page_dialogs(&self)
fn accept_page_dialogs(&self)
Have the page’s own questions (
alert, confirm, prompt, “leave
this page?”) sent as WebViewEvent::PageDialog for the embedder to
show and answer. Until then, and in an engine that cannot, each is
declined at once and a page may always be left.Have what the page copies sent as
WebViewEvent::ClipboardWrite,
and its pastes and reads asked of the embedder
(WebViewEvent::ClipboardRead), where the engine cannot reach the
system clipboard itself. Until then, and in an engine that can or
cannot ask, the page’s clipboard is the engine’s own.§fn take_popups(&self) -> Vec<Popup>
fn take_popups(&self) -> Vec<Popup>
The popups the page opened since the last call.
§fn adopt_popup(&self, popup: u32) -> Result<Arc<dyn WebViewEngine>, String>
fn adopt_popup(&self, popup: u32) -> Result<Arc<dyn WebViewEngine>, String>
The engine of a popup
Self::take_popups listed, to show it.
Dropping it closes the popup. Read more§fn measures_document(&self) -> bool
fn measures_document(&self) -> bool
Whether
WebViewCommand::ReportDocumentSize is answered: the
engine measures its document. Known once the engine is ready.Admit a navigation and reserve its terminal outcome. IDs must increase
strictly within this engine’s lifetime and fit a positive CEF signed integer. Read more
§fn supports_composition(&self) -> bool
fn supports_composition(&self) -> bool
Whether the engine takes an input method’s composition
(
WebViewCommand::ImeComposition, WebViewCommand::ImeCommit)
and reports the page’s focused field (Self::text_field).§fn text_field(&self) -> Option<TextField>
fn text_field(&self) -> Option<TextField>
The page’s focused editable field, for the platform input method;
None while nothing editable in the page has the focus.§fn cursor(&self) -> Option<CursorIcon>
fn cursor(&self) -> Option<CursorIcon>
The pointer shape the page last asked for where the pointer is (a
hand on a link, an I-beam on text);
None for the default arrow, or
an engine that does not say.Auto Trait Implementations§
impl !Freeze for PaintEngine
impl !RefUnwindSafe for PaintEngine
impl Send for PaintEngine
impl Sync for PaintEngine
impl Unpin for PaintEngine
impl UnsafeUnpin for PaintEngine
impl !UnwindSafe for PaintEngine
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
Mutably borrows from an owned value. Read more
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§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>
Converts
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>
Converts
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