1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
use super::{IHitTester, IRenderer};
use crate::input::IInputRoot;
use crate::layout::ILayoutRoot;
use crate::platform::IPlatformSettings;
use crate::{PixelPoint, Point, Ref, Size, Visual};
use std::rc::Rc;
/// The host of a visual tree: connects the tree to its renderer, layout root
/// and input root.
pub trait IPresentationSource {
/// The root visual of the tree.
fn root_visual(&self) -> Option<Ref<Visual>>;
/// The scaling factor to use in rendering.
fn render_scaling(&self) -> f64;
/// The renderer of the tree.
fn renderer(&self) -> Rc<dyn IRenderer>;
/// The layout root of the tree.
fn layout_root(&self) -> Rc<dyn ILayoutRoot>;
/// The size of the client area, in device-independent pixels.
fn client_size(&self) -> Size;
/// The platform settings of the host, if it has any.
fn platform_settings(&self) -> Option<Rc<dyn IPlatformSettings>> {
None
}
/// The hit tester of the tree.
fn hit_tester(&self) -> Rc<dyn IHitTester>;
/// The input root of the tree.
fn input_root(&self) -> Rc<dyn IInputRoot>;
/// Converts a point from client to screen coordinates, if the host is
/// on a screen.
fn point_to_screen(&self, _point: Point) -> Option<PixelPoint> {
None
}
/// Converts a point from screen to client coordinates, if the host is
/// on a screen.
fn point_to_client(&self, _point: PixelPoint) -> Option<Point> {
None
}
}