pub struct Window { /* private fields */ }
Expand description
A Verso window is a Winit window containing several web views.
Implementations§
source§impl Window
impl Window
sourcepub fn handle_servo_messages_with_webview(
&mut self,
webview_id: WebViewId,
message: EmbedderMsg,
sender: &Sender<ConstellationMsg>,
clipboard: Option<&mut Clipboard>,
_compositor: &mut IOCompositor,
)
pub fn handle_servo_messages_with_webview( &mut self, webview_id: WebViewId, message: EmbedderMsg, sender: &Sender<ConstellationMsg>, clipboard: Option<&mut Clipboard>, _compositor: &mut IOCompositor, )
Handle servo messages with corresponding web view ID.
sourcepub fn handle_servo_messages_with_panel(
&mut self,
panel_id: WebViewId,
message: EmbedderMsg,
sender: &Sender<ConstellationMsg>,
clipboard: Option<&mut Clipboard>,
_compositor: &mut IOCompositor,
) -> bool
pub fn handle_servo_messages_with_panel( &mut self, panel_id: WebViewId, message: EmbedderMsg, sender: &Sender<ConstellationMsg>, clipboard: Option<&mut Clipboard>, _compositor: &mut IOCompositor, ) -> bool
Handle servo messages with main panel. Return true it requests a new window.
source§impl Window
impl Window
sourcepub fn new(evl: &ActiveEventLoop) -> (Self, RenderingContext)
pub fn new(evl: &ActiveEventLoop) -> (Self, RenderingContext)
Create a Verso window from Winit window and return the rendering context.
sourcepub fn new_with_compositor(
evl: &ActiveEventLoop,
compositor: &mut IOCompositor,
) -> Self
pub fn new_with_compositor( evl: &ActiveEventLoop, compositor: &mut IOCompositor, ) -> Self
Create a Verso window with the rendering context.
sourcepub fn handle_winit_window_event(
&mut self,
sender: &Sender<ConstellationMsg>,
compositor: &mut IOCompositor,
event: &WindowEvent,
) -> bool
pub fn handle_winit_window_event( &mut self, sender: &Sender<ConstellationMsg>, compositor: &mut IOCompositor, event: &WindowEvent, ) -> bool
Handle Winit window event and return a boolean to indicate if the compositor should repaint immediately.
sourcepub fn handle_servo_message(
&mut self,
webview_id: WebViewId,
message: EmbedderMsg,
sender: &Sender<ConstellationMsg>,
clipboard: Option<&mut Clipboard>,
compositor: &mut IOCompositor,
) -> bool
pub fn handle_servo_message( &mut self, webview_id: WebViewId, message: EmbedderMsg, sender: &Sender<ConstellationMsg>, clipboard: Option<&mut Clipboard>, compositor: &mut IOCompositor, ) -> bool
Handle servo messages. Return true if it requests a new window
sourcepub fn request_redraw(&self)
pub fn request_redraw(&self)
Queues a Winit WindowEvent::RedrawRequested
event to be emitted that aligns with the windowing system drawing loop.
sourcepub fn scale_factor(&self) -> f64
pub fn scale_factor(&self) -> f64
Scale factor of the window. This is also known as HIDPI.
sourcepub fn has_webview(&self, id: WebViewId) -> bool
pub fn has_webview(&self, id: WebViewId) -> bool
Check if the window has such webview.
sourcepub fn remove_webview(
&mut self,
id: WebViewId,
compositor: &mut IOCompositor,
) -> (Option<WebView>, bool)
pub fn remove_webview( &mut self, id: WebViewId, compositor: &mut IOCompositor, ) -> (Option<WebView>, bool)
Remove the webview in this window by provided webview ID. If this is the panel, it will shut down the compositor and then close whole application.
sourcepub fn painting_order(&self) -> Vec<&WebView>
pub fn painting_order(&self) -> Vec<&WebView>
Get the painting order of this window.
sourcepub fn set_cursor_icon(&self, cursor: Cursor)
pub fn set_cursor_icon(&self, cursor: Cursor)
Set cursor icon of the window.
Auto Trait Implementations§
impl !Freeze for Window
impl !RefUnwindSafe for Window
impl Send for Window
impl !Sync for Window
impl Unpin for Window
impl !UnwindSafe for Window
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<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>
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>
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)
&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)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> Filterable for T
impl<T> Filterable 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>
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