pub struct PaxEngine {
pub runtime_context: Rc<RuntimeContext>,
pub root_expanded_node: Option<Rc<ExpandedNode>>,
pub scroller_tiling_policy: ScrollerTilingPolicy,
}Expand description
Singleton struct storing everything related to properties computation & rendering
Fields§
§runtime_context: Rc<RuntimeContext>§root_expanded_node: Option<Rc<ExpandedNode>>§scroller_tiling_policy: ScrollerTilingPolicyImplementations§
Source§impl PaxEngine
Central instance of the PaxEngine and runtime, intended to be created by a particular chassis.
Contains all rendering and runtime logic.
impl PaxEngine
Central instance of the PaxEngine and runtime, intended to be created by a particular chassis. Contains all rendering and runtime logic.
pub fn new_empty( viewport_size: (f64, f64), platform: Platform, os: OS, get_elapsed_millis: Box<dyn Fn() -> u128>, scroller_tiling_policy: ScrollerTilingPolicy, ) -> Self
Sourcepub fn mount_root_component(
&mut self,
main_component_instance: Rc<ComponentInstance>,
) -> Rc<ExpandedNode>
pub fn mount_root_component( &mut self, main_component_instance: Rc<ComponentInstance>, ) -> Rc<ExpandedNode>
Mount a root component tree into an existing runtime kernel.
Sourcepub fn unmount(&mut self)
pub fn unmount(&mut self)
Detach the mounted root component tree, leaving the runtime kernel empty.
pub fn new( main_component_instance: Rc<ComponentInstance>, viewport_size: (f64, f64), platform: Platform, os: OS, get_elapsed_millis: Box<dyn Fn() -> u128>, scroller_tiling_policy: ScrollerTilingPolicy, ) -> Self
Sourcepub fn tick(&mut self) -> Vec<NativeMessage>
pub fn tick(&mut self) -> Vec<NativeMessage>
Workhorse methods of every tick. Will be executed up to 240 Hz. Three phases:
- Expand nodes & compute properties; recurse entire instance tree and evaluate ExpandedNodes, stitching together parent/child relationships between ExpandedNodes along the way.
- Compute layout (z-index & TransformAndBounds) by visiting ExpandedNode tree in rendering order, writing computed rendering-specific values to ExpandedNodes
- Render: a. find lowest node (last child of last node) b. start rendering, from lowest node on-up, throughout tree
pub fn render(&mut self, rcs: &mut dyn RenderContext)
pub fn get_expanded_node( &self, id: ExpandedNodeIdentifier, ) -> Option<Rc<ExpandedNode>>
Sourcepub fn set_viewport_size(&mut self, new_viewport_size: (f64, f64))
pub fn set_viewport_size(&mut self, new_viewport_size: (f64, f64))
Called by chassis when viewport size changes, e.g. with native window resizes
pub fn update_layer_count(&self, rcs: &mut dyn RenderContext)
pub fn global_dispatch_focus(&self, args: Focus) -> bool
pub fn global_dispatch_select_start(&self, args: SelectStart) -> bool
pub fn global_dispatch_key_down(&self, args: KeyDown) -> bool
pub fn global_dispatch_key_up(&self, args: KeyUp) -> bool
pub fn global_dispatch_key_press(&self, args: KeyPress) -> bool
pub fn global_dispatch_gyro(&self, args: Gyro) -> bool
pub fn global_dispatch_accel(&self, args: Accel) -> bool
Auto Trait Implementations§
impl !RefUnwindSafe for PaxEngine
impl !Send for PaxEngine
impl !Sync for PaxEngine
impl !UnwindSafe for PaxEngine
impl Freeze for PaxEngine
impl Unpin for PaxEngine
impl UnsafeUnpin for PaxEngine
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
Source§fn round_into(self) -> U
fn round_into(self) -> U
Performs the conversion.