pub struct PresentationSource { /* private fields */ }Expand description
Connects the root visual of a top-level to its platform implementation, renderer, layout manager and input.
Implementations§
Source§impl PresentationSource
impl PresentationSource
Sourcepub fn new(
root_visual: Ref<InputElement>,
default_focus_visual: &Ref<InputElement>,
platform_impl: Rc<dyn ITopLevelImpl>,
dependency_resolver: &dyn IFerroDependencyResolver,
) -> Rc<PresentationSource>
pub fn new( root_visual: Ref<InputElement>, default_focus_visual: &Ref<InputElement>, platform_impl: Rc<dyn ITopLevelImpl>, dependency_resolver: &dyn IFerroDependencyResolver, ) -> Rc<PresentationSource>
Creates the presentation source of a top-level.
root_visual becomes the root of the visual tree, default_focus_visual
receives keyboard input when nothing is focused, platform_impl is
the platform implementation of the top-level and the services of the
source are taken from dependency_resolver.
Sourcepub fn platform_impl(&self) -> Option<Rc<dyn ITopLevelImpl>>
pub fn platform_impl(&self) -> Option<Rc<dyn ITopLevelImpl>>
The platform implementation of the top-level; None once the source
has been disposed.
Sourcepub fn focus_manager(&self) -> &Rc<FocusManager>
pub fn focus_manager(&self) -> &Rc<FocusManager>
The focus manager of the tree.
Sourcepub fn root_visual(&self) -> Option<Ref<InputElement>>
pub fn root_visual(&self) -> Option<Ref<InputElement>>
The root of the visual tree; None after the top-level has closed.
Sourcepub fn set_root_visual(&self, value: Option<Ref<InputElement>>)
pub fn set_root_visual(&self, value: Option<Ref<InputElement>>)
Sets the root of the visual tree: the old root is detached from the source and the new one attached to it.
Sourcepub fn root_element(&self) -> Ref<InputElement>
pub fn root_element(&self) -> Ref<InputElement>
Sourcepub fn from_root_visual(root_visual: &Visual) -> Option<Rc<PresentationSource>>
pub fn from_root_visual(root_visual: &Visual) -> Option<Rc<PresentationSource>>
The presentation source whose root visual is root_visual, if the
visual is the root of one (upstream casts the source of the root
visual to this class).
Sourcepub fn platform_settings(&self) -> Option<Rc<dyn IPlatformSettings>>
pub fn platform_settings(&self) -> Option<Rc<dyn IPlatformSettings>>
The platform settings of the application.
Sourcepub fn dispose(&self)
pub fn dispose(&self)
Detaches the source from its platform implementation and releases the renderer, the layout manager and the input subscriptions.
Sourcepub fn get_last_pointer_position(
&self,
_top_level: &Visual,
) -> Option<PixelPoint>
pub fn get_last_pointer_position( &self, _top_level: &Visual, ) -> Option<PixelPoint>
The last known position of the pointer, in screen coordinates.
Source§impl PresentationSource
impl PresentationSource
Sourcepub fn set_cursor_override(&self, cursor: Option<Rc<Cursor>>)
pub fn set_cursor_override(&self, cursor: Option<Rc<Cursor>>)
This should only be used by the in-process drag source.
Source§impl PresentationSource
impl PresentationSource
Sourcepub fn input_root(&self) -> Rc<dyn IInputRoot>
pub fn input_root(&self) -> Rc<dyn IInputRoot>
The source as the input root of its tree.
Sourcepub fn focus_root(&self) -> Ref<InputElement>
pub fn focus_root(&self) -> Ref<InputElement>
The element keyboard input is sent to when nothing is focused.
§Panics
Panics when the element has been dropped.
Source§impl PresentationSource
impl PresentationSource
Sourcepub fn layout_scaling(&self) -> f64
pub fn layout_scaling(&self) -> f64
The scaling factor to use in layout.
Sourcepub fn layout_manager(&self) -> &Rc<LayoutManager>
pub fn layout_manager(&self) -> &Rc<LayoutManager>
The layout manager of the tree.
Source§impl PresentationSource
impl PresentationSource
Sourcepub fn typed_renderer(&self) -> &Rc<dyn ITopLevelRenderer>
pub fn typed_renderer(&self) -> &Rc<dyn ITopLevelRenderer>
The renderer of the tree.
Sourcepub fn hit_tester(&self) -> Rc<dyn IHitTester>
pub fn hit_tester(&self) -> Rc<dyn IHitTester>
The hit tester of the tree: the override when one is set, otherwise the hit tester of the renderer, otherwise one that walks the visual tree.
Sourcepub fn hit_tester_override(&self) -> Option<Rc<dyn IHitTester>>
pub fn hit_tester_override(&self) -> Option<Rc<dyn IHitTester>>
The hit tester used instead of the renderer’s, for unit tests that do not set up a hit-testable visual tree.
pub fn set_hit_tester_override(&self, value: Option<Rc<dyn IHitTester>>)
Sourcepub fn render_scaling(&self) -> f64
pub fn render_scaling(&self) -> f64
The scaling factor to use in rendering.
Sourcepub fn client_size(&self) -> Size
pub fn client_size(&self) -> Size
The size of the client area of the platform implementation.
Sourcepub fn point_to_screen(&self, point: Point) -> Option<PixelPoint>
pub fn point_to_screen(&self, point: Point) -> Option<PixelPoint>
Converts a point from client to screen coordinates.
Sourcepub fn point_to_client(&self, point: PixelPoint) -> Option<Point>
pub fn point_to_client(&self, point: PixelPoint) -> Option<Point>
Converts a point from screen to client coordinates.
Trait Implementations§
Source§impl IInputRoot for PresentationSource
impl IInputRoot for PresentationSource
Source§fn hit_test_chrome_element(
&self,
point: Point,
) -> Option<WindowDecorationsElementRole>
fn hit_test_chrome_element( &self, point: Point, ) -> Option<WindowDecorationsElementRole>
Source§fn focus_manager(&self) -> Option<Rc<FocusManager>>
fn focus_manager(&self) -> Option<Rc<FocusManager>>
Source§fn pointer_over_element(&self) -> Option<Ref<InputElement>>
fn pointer_over_element(&self) -> Option<Ref<InputElement>>
Source§fn set_pointer_over_element(&self, value: Option<Ref<InputElement>>)
fn set_pointer_over_element(&self, value: Option<Ref<InputElement>>)
Source§fn cursor_element(&self) -> Option<Ref<InputElement>>
fn cursor_element(&self) -> Option<Ref<InputElement>>
Source§fn set_cursor_element(&self, value: Option<Ref<InputElement>>)
fn set_cursor_element(&self, value: Option<Ref<InputElement>>)
Source§fn input_method(&self) -> Option<Rc<dyn ITextInputMethodImpl>>
fn input_method(&self) -> Option<Rc<dyn ITextInputMethodImpl>>
Source§fn root_element(&self) -> Ref<InputElement>
fn root_element(&self) -> Ref<InputElement>
Source§fn try_root_element(&self) -> Option<Ref<InputElement>>
fn try_root_element(&self) -> Option<Ref<InputElement>>
root_element. Read moreSource§fn focus_root(&self) -> Ref<InputElement>
fn focus_root(&self) -> Ref<InputElement>
Source§fn pointer_over_invalidated(&self)
fn pointer_over_invalidated(&self)
Source§impl ILayoutRoot for PresentationSource
impl ILayoutRoot for PresentationSource
Source§fn layout_scaling(&self) -> f64
fn layout_scaling(&self) -> f64
Source§fn layout_manager(&self) -> Rc<dyn ILayoutManager>
fn layout_manager(&self) -> Rc<dyn ILayoutManager>
Source§fn root_visual(&self) -> Ref<Layoutable>
fn root_visual(&self) -> Ref<Layoutable>
Source§impl IPresentationSource for PresentationSource
impl IPresentationSource for PresentationSource
Source§fn render_scaling(&self) -> f64
fn render_scaling(&self) -> f64
Source§fn layout_root(&self) -> Rc<dyn ILayoutRoot>
fn layout_root(&self) -> Rc<dyn ILayoutRoot>
Source§fn client_size(&self) -> Size
fn client_size(&self) -> Size
Source§fn platform_settings(&self) -> Option<Rc<dyn IPlatformSettings>>
fn platform_settings(&self) -> Option<Rc<dyn IPlatformSettings>>
Source§fn hit_tester(&self) -> Rc<dyn IHitTester>
fn hit_tester(&self) -> Rc<dyn IHitTester>
Source§fn input_root(&self) -> Rc<dyn IInputRoot>
fn input_root(&self) -> Rc<dyn IInputRoot>
Source§fn point_to_screen(&self, point: Point) -> Option<PixelPoint>
fn point_to_screen(&self, point: Point) -> Option<PixelPoint>
Source§fn point_to_client(&self, point: PixelPoint) -> Option<Point>
fn point_to_client(&self, point: PixelPoint) -> Option<Point>
Auto Trait Implementations§
impl !Freeze for PresentationSource
impl !RefUnwindSafe for PresentationSource
impl !Send for PresentationSource
impl !Sync for PresentationSource
impl !UnwindSafe for PresentationSource
impl Unpin for PresentationSource
impl UnsafeUnpin for PresentationSource
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
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
affects_render, metadata
overrides). Read more