Skip to main content

PresentationSource

Struct PresentationSource 

Source
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

Source

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.

Source

pub fn platform_impl(&self) -> Option<Rc<dyn ITopLevelImpl>>

The platform implementation of the top-level; None once the source has been disposed.

Source

pub fn focus_manager(&self) -> &Rc<FocusManager>

The focus manager of the tree.

Source

pub fn root_visual(&self) -> Option<Ref<InputElement>>

The root of the visual tree; None after the top-level has closed.

Source

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.

Source

pub fn root_element(&self) -> Ref<InputElement>

The root input element; the root visual.

§Panics

Panics after the top-level has closed.

Source

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).

Source

pub fn platform_settings(&self) -> Option<Rc<dyn IPlatformSettings>>

The platform settings of the application.

Source

pub fn dispose(&self)

Detaches the source from its platform implementation and releases the renderer, the layout manager and the input subscriptions.

Source

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

Source

pub fn set_cursor_override(&self, cursor: Option<Rc<Cursor>>)

This should only be used by the in-process drag source.

Source§

impl PresentationSource

Source

pub fn input_root(&self) -> Rc<dyn IInputRoot>

The source as the input root of its tree.

Source

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

Source

pub fn layout_scaling(&self) -> f64

The scaling factor to use in layout.

Source

pub fn layout_manager(&self) -> &Rc<LayoutManager>

The layout manager of the tree.

Source§

impl PresentationSource

Source

pub fn typed_renderer(&self) -> &Rc<dyn ITopLevelRenderer>

The renderer of the tree.

Source

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.

Source

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.

Source

pub fn set_hit_tester_override(&self, value: Option<Rc<dyn IHitTester>>)

Source

pub fn render_scaling(&self) -> f64

The scaling factor to use in rendering.

Source

pub fn client_size(&self) -> Size

The size of the client area of the platform implementation.

Source

pub fn point_to_screen(&self, point: Point) -> Option<PixelPoint>

Converts a point from client to screen coordinates.

Source

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

Source§

fn hit_test_chrome_element( &self, point: Point, ) -> Option<WindowDecorationsElementRole>

Performs a hit-test for chrome/decoration elements at the given position, in root-relative coordinates. Read more
Source§

fn focus_manager(&self) -> Option<Rc<FocusManager>>

The focus manager of the root.
Source§

fn pointer_over_element(&self) -> Option<Ref<InputElement>>

The input element that the pointer is currently over.
Source§

fn set_pointer_over_element(&self, value: Option<Ref<InputElement>>)

Sets the input element that the pointer is currently over.
Source§

fn cursor_element(&self) -> Option<Ref<InputElement>>

The element whose cursor is shown.
Source§

fn set_cursor_element(&self, value: Option<Ref<InputElement>>)

Sets the element whose cursor is shown.
Source§

fn input_method(&self) -> Option<Rc<dyn ITextInputMethodImpl>>

The input method of the platform for this root, if it has one. Read more
Source§

fn root_element(&self) -> Ref<InputElement>

The root input element.
Source§

fn try_root_element(&self) -> Option<Ref<InputElement>>

Deviation (DEVIATIONS.md, Input): the optional form of root_element. Read more
Source§

fn focus_root(&self) -> Ref<InputElement>

The element keyboard input is sent to when nothing is focused.
Source§

fn pointer_over_invalidated(&self)

Called when what is under the pointer may have changed without the pointer moving, e.g. when the capture of a pointer changes. Read more
Source§

impl ILayoutRoot for PresentationSource

Source§

fn layout_scaling(&self) -> f64

The scaling factor to use in layout.
Source§

fn layout_manager(&self) -> Rc<dyn ILayoutManager>

The layout manager that lays out the tree.
Source§

fn root_visual(&self) -> Ref<Layoutable>

The root layoutable.
Source§

impl IPresentationSource for PresentationSource

Source§

fn root_visual(&self) -> Option<Ref<Visual>>

The root visual of the tree.
Source§

fn render_scaling(&self) -> f64

The scaling factor to use in rendering.
Source§

fn renderer(&self) -> Rc<dyn IRenderer>

The renderer of the tree.
Source§

fn layout_root(&self) -> Rc<dyn ILayoutRoot>

The layout root of the tree.
Source§

fn client_size(&self) -> Size

The size of the client area, in device-independent pixels.
Source§

fn platform_settings(&self) -> Option<Rc<dyn IPlatformSettings>>

The platform settings of the host, if it has any.
Source§

fn hit_tester(&self) -> Rc<dyn IHitTester>

The hit tester of the tree.
Source§

fn input_root(&self) -> Rc<dyn IInputRoot>

The input root of the tree.
Source§

fn point_to_screen(&self, point: Point) -> Option<PixelPoint>

Converts a point from client to screen coordinates, if the host is on a screen.
Source§

fn point_to_client(&self, point: PixelPoint) -> Option<Point>

Converts a point from screen to client coordinates, if the host is on a screen.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ClassDefaults for T
where T: ?Sized,

Source§

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
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.