pub struct BrowserTopLevelImpl { /* private fields */ }Expand description
The top-level of a view: a canvas inside an element of the page.
Implementations§
Source§impl BrowserTopLevelImpl
impl BrowserTopLevelImpl
Sourcepub fn try_get_top_level(id: i32) -> Option<Rc<BrowserTopLevelImpl>>
pub fn try_get_top_level(id: i32) -> Option<Rc<BrowserTopLevelImpl>>
The top-level with the given id, while it is alive.
Sourcepub fn new(
container: JsObject,
native_control_host: JsObject,
input_element: JsObject,
) -> Rc<Self>
pub fn new( container: JsObject, native_control_host: JsObject, input_element: JsObject, ) -> Rc<Self>
Creates the top-level of container.
native_control_host is the element native controls are placed in
and input_element the hidden input element of the view.
Sourcepub fn surface(&self) -> Option<Rc<RenderTargetBrowserSurface>>
pub fn surface(&self) -> Option<Rc<RenderTargetBrowserSurface>>
The surface the top-level renders to; None once disposed.
Sourcepub fn top_level_id(&self) -> i32
pub fn top_level_id(&self) -> i32
The id the script side routes its callbacks by.
Sourcepub fn input_handler(&self) -> &Rc<BrowserInputHandler>
pub fn input_handler(&self) -> &Rc<BrowserInputHandler>
The input handler of the top-level: what turns the events of the page into raw input events.
Sourcepub fn input_root(&self) -> Option<Rc<dyn IInputRoot>>
pub fn input_root(&self) -> Option<Rc<dyn IInputRoot>>
The input root the top-level delivers input to.
Trait Implementations§
Source§impl IDisposable for BrowserTopLevelImpl
impl IDisposable for BrowserTopLevelImpl
Source§impl ITopLevelImpl for BrowserTopLevelImpl
impl ITopLevelImpl for BrowserTopLevelImpl
Source§fn desktop_scaling(&self) -> f64
fn desktop_scaling(&self) -> f64
Gets the scaling factor for window positioning and sizing.
Source§fn client_size(&self) -> Size
fn client_size(&self) -> Size
Gets the client size of the toplevel.
Source§fn render_scaling(&self) -> f64
fn render_scaling(&self) -> f64
Gets the scaling factor for the toplevel. This is used for rendering.
Source§fn surfaces(&self) -> Vec<Arc<dyn IPlatformRenderSurface>>
fn surfaces(&self) -> Vec<Arc<dyn IPlatformRenderSurface>>
The list of native platform’s surfaces that can be consumed by
rendering subsystems. Read more
Source§fn render_surfaces(
&self,
) -> Arc<dyn Fn() -> Vec<Arc<dyn IPlatformRenderSurface>> + Send + Sync> ⓘ
fn render_surfaces( &self, ) -> Arc<dyn Fn() -> Vec<Arc<dyn IPlatformRenderSurface>> + Send + Sync> ⓘ
The surfaces as the thread that renders asks for them: the function
is called by that thread whenever the renderer (re)creates its
render target (the reference reads
Surfaces of the top-level
there). Read moreSource§fn compositor(&self) -> Option<Rc<Compositor>>
fn compositor(&self) -> Option<Rc<Compositor>>
Gets the compositor that is used for the toplevel, if the platform
renders through one.
Source§fn input(&self) -> Option<Rc<dyn Fn(Rc<dyn IRawInputEventArgs>)>>
fn input(&self) -> Option<Rc<dyn Fn(Rc<dyn IRawInputEventArgs>)>>
Gets the method called when the toplevel receives input.
Source§fn set_input(&self, value: Option<Rc<dyn Fn(Rc<dyn IRawInputEventArgs>)>>)
fn set_input(&self, value: Option<Rc<dyn Fn(Rc<dyn IRawInputEventArgs>)>>)
Sets a method called when the toplevel receives input.
Source§fn paint(&self) -> Option<Rc<dyn Fn(Rect)>>
fn paint(&self) -> Option<Rc<dyn Fn(Rect)>>
Gets the method called when the toplevel requires painting.
Source§fn set_paint(&self, value: Option<Rc<dyn Fn(Rect)>>)
fn set_paint(&self, value: Option<Rc<dyn Fn(Rect)>>)
Sets a method called when the toplevel requires painting.
Source§fn resized(&self) -> Option<Rc<dyn Fn(Size, WindowResizeReason)>>
fn resized(&self) -> Option<Rc<dyn Fn(Size, WindowResizeReason)>>
Gets the method called when the toplevel is resized.
Source§fn set_resized(&self, value: Option<Rc<dyn Fn(Size, WindowResizeReason)>>)
fn set_resized(&self, value: Option<Rc<dyn Fn(Size, WindowResizeReason)>>)
Sets a method called when the toplevel is resized.
Source§fn scaling_changed(&self) -> Option<Rc<dyn Fn(f64)>>
fn scaling_changed(&self) -> Option<Rc<dyn Fn(f64)>>
Gets the method called when the toplevel’s scaling changes.
Source§fn set_scaling_changed(&self, value: Option<Rc<dyn Fn(f64)>>)
fn set_scaling_changed(&self, value: Option<Rc<dyn Fn(f64)>>)
Sets a method called when the toplevel’s scaling changes.
Source§fn transparency_level_changed(
&self,
) -> Option<Rc<dyn Fn(WindowTransparencyLevel)>>
fn transparency_level_changed( &self, ) -> Option<Rc<dyn Fn(WindowTransparencyLevel)>>
Gets the method called when the toplevel’s transparency level
changes.
Source§fn set_transparency_level_changed(
&self,
value: Option<Rc<dyn Fn(WindowTransparencyLevel)>>,
)
fn set_transparency_level_changed( &self, value: Option<Rc<dyn Fn(WindowTransparencyLevel)>>, )
Sets a method called when the toplevel’s transparency level changes.
Source§fn set_input_root(&self, input_root: Rc<dyn IInputRoot>)
fn set_input_root(&self, input_root: Rc<dyn IInputRoot>)
Sets the input root for the toplevel.
Source§fn point_to_client(&self, point: PixelPoint) -> Point
fn point_to_client(&self, point: PixelPoint) -> Point
Converts a point from screen to client coordinates.
Source§fn point_to_screen(&self, point: Point) -> PixelPoint
fn point_to_screen(&self, point: Point) -> PixelPoint
Converts a point from client to screen coordinates.
Source§fn set_cursor(&self, cursor: Option<Rc<dyn ICursorImpl>>)
fn set_cursor(&self, cursor: Option<Rc<dyn ICursorImpl>>)
Sets the cursor associated with the toplevel;
None stands for the
default cursor.Source§fn closed(&self) -> Option<Rc<dyn Fn()>>
fn closed(&self) -> Option<Rc<dyn Fn()>>
Gets the method called when the underlying implementation is
destroyed.
Source§fn set_closed(&self, value: Option<Rc<dyn Fn()>>)
fn set_closed(&self, value: Option<Rc<dyn Fn()>>)
Sets a method called when the underlying implementation is
destroyed.
Source§fn lost_focus(&self) -> Option<Rc<dyn Fn()>>
fn lost_focus(&self) -> Option<Rc<dyn Fn()>>
Gets the method called when the input focus is lost.
Source§fn set_lost_focus(&self, value: Option<Rc<dyn Fn()>>)
fn set_lost_focus(&self, value: Option<Rc<dyn Fn()>>)
Sets a method called when the input focus is lost.
Source§fn create_popup(&self) -> Option<Rc<dyn IPopupImpl>>
fn create_popup(&self) -> Option<Rc<dyn IPopupImpl>>
Creates a popup that belongs to the toplevel, if the platform
supports native popups.
Source§fn set_transparency_level_hint(
&self,
_transparency_levels: &[WindowTransparencyLevel],
)
fn set_transparency_level_hint( &self, _transparency_levels: &[WindowTransparencyLevel], )
Sets the transparency level hint of the toplevel, in order of
preference.
Source§fn transparency_level(&self) -> WindowTransparencyLevel
fn transparency_level(&self) -> WindowTransparencyLevel
Gets the current transparency level of the toplevel.
Source§fn acrylic_compensation_levels(&self) -> AcrylicPlatformCompensationLevels
fn acrylic_compensation_levels(&self) -> AcrylicPlatformCompensationLevels
Gets the acrylic compensation levels for the platform.
Source§fn set_frame_theme_variant(&self, _theme_variant: Option<PlatformThemeVariant>)
fn set_frame_theme_variant(&self, _theme_variant: Option<PlatformThemeVariant>)
Sets the theme variant on the frame if it should be dark or light.
Also applies for the mica and acrylic backdrops, if they are
applied;
None follows the system.Source§fn platform_specific_scene_info(&self) -> Option<Arc<dyn Any + Send + Sync>>
fn platform_specific_scene_info(&self) -> Option<Arc<dyn Any + Send + Sync>>
Gets the platform-specific scene info, which is passed to the render
target of the toplevel.
Source§fn platform_specific_scene_info_changed(
&self,
) -> Option<Rc<dyn Fn(Option<Arc<dyn Any + Send + Sync>>)>>
fn platform_specific_scene_info_changed( &self, ) -> Option<Rc<dyn Fn(Option<Arc<dyn Any + Send + Sync>>)>>
Gets the method called when the platform-specific scene info
changes.
Source§fn set_platform_specific_scene_info_changed(
&self,
_value: Option<Rc<dyn Fn(Option<Arc<dyn Any + Send + Sync>>)>>,
)
fn set_platform_specific_scene_info_changed( &self, _value: Option<Rc<dyn Fn(Option<Arc<dyn Any + Send + Sync>>)>>, )
Sets a method called when the platform-specific scene info changes.
Source§fn as_window_base_impl(&self) -> Option<&dyn IWindowBaseImpl>
fn as_window_base_impl(&self) -> Option<&dyn IWindowBaseImpl>
The toplevel as a window base implementation, if it is one.
Source§fn as_window_impl(&self) -> Option<&dyn IWindowImpl>
fn as_window_impl(&self) -> Option<&dyn IWindowImpl>
The toplevel as a window implementation, if it is one.
Source§fn as_popup_impl(&self) -> Option<&dyn IPopupImpl>
fn as_popup_impl(&self) -> Option<&dyn IPopupImpl>
The toplevel as a popup implementation, if it is one.
Source§fn as_win32_options_top_level_impl(
&self,
) -> Option<&dyn IWin32OptionsTopLevelImpl>
fn as_win32_options_top_level_impl( &self, ) -> Option<&dyn IWin32OptionsTopLevelImpl>
The toplevel as the Win32-specific options of a toplevel, if it has them.
Auto Trait Implementations§
impl !Freeze for BrowserTopLevelImpl
impl !RefUnwindSafe for BrowserTopLevelImpl
impl !Send for BrowserTopLevelImpl
impl !Sync for BrowserTopLevelImpl
impl !UnwindSafe for BrowserTopLevelImpl
impl Unpin for BrowserTopLevelImpl
impl UnsafeUnpin for BrowserTopLevelImpl
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
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
The static constructor of a type: work done once per thread, after
the properties of the type are registered and before its first
instance exists (class handlers,
affects_render, metadata
overrides). Read more