pub struct Context {
pub input: InputState,
pub layout: LayoutTree,
pub registry: StateRegistry,
pub animations: AnimationCoordinator,
pub time: f64,
}Expand description
The central brain of the UZOR engine
Fields§
§input: InputStateTransient input state for the current frame
layout: LayoutTreeCalculated layout rectangles for all widgets
registry: StateRegistryPersistent behavioral state (scroll, focus, etc.)
animations: AnimationCoordinatorAnimation coordinator for managing widget animations
time: f64Time since startup in seconds (for animations)
Implementations§
Source§impl Context
impl Context
pub fn new(root_node: LayoutNode) -> Self
Sourcepub fn begin_frame(&mut self, input: InputState, viewport: Rect)
pub fn begin_frame(&mut self, input: InputState, viewport: Rect)
Begin a new frame with updated input
Sourcepub fn state<T: 'static + Send + Sync + Default>(
&mut self,
id: impl Into<WidgetId>,
) -> &mut T
pub fn state<T: 'static + Send + Sync + Default>( &mut self, id: impl Into<WidgetId>, ) -> &mut T
Access persistent state for a widget
Sourcepub fn widget_rect(&self, id: &WidgetId) -> Rect
pub fn widget_rect(&self, id: &WidgetId) -> Rect
Helper to get widget rectangle from computed layout
Calculate button interaction state
Sourcepub fn checkbox(
&mut self,
id: impl Into<WidgetId>,
checked: bool,
) -> CheckboxResponse
pub fn checkbox( &mut self, id: impl Into<WidgetId>, checked: bool, ) -> CheckboxResponse
Calculate checkbox interaction state
Sourcepub fn scroll_area(
&mut self,
id: impl Into<WidgetId>,
content_height: f64,
) -> (Rect, ScrollState)
pub fn scroll_area( &mut self, id: impl Into<WidgetId>, content_height: f64, ) -> (Rect, ScrollState)
Calculate scroll area geometry and physics
Calculate interaction state for an icon button
Auto Trait Implementations§
impl Freeze for Context
impl !RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl UnsafeUnpin for Context
impl !UnwindSafe for Context
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