Skip to main content

TimerCallbackInfo

Struct TimerCallbackInfo 

Source
#[repr(C)]
pub struct TimerCallbackInfo { pub callback_info: CallbackInfo, pub node_id: OptionDomNodeId, pub frame_start: Instant, pub call_count: usize, pub is_about_to_finish: bool, pub _abi_ref: *const c_void, pub _abi_mut: *mut c_void, }
Expand description

Information passed to timer callbacks.

This wraps CallbackInfo and adds timer-specific fields like call_count and frame_start. CallbackInfo methods are available via explicit delegation methods below.

Fields§

§callback_info: CallbackInfo§node_id: OptionDomNodeId§frame_start: Instant§call_count: usize§is_about_to_finish: bool§_abi_ref: *const c_void§_abi_mut: *mut c_void

Implementations§

Source§

impl TimerCallbackInfo

Source

pub fn create( callback_info: CallbackInfo, node_id: OptionDomNodeId, frame_start: Instant, call_count: usize, is_about_to_finish: bool, ) -> Self

Source

pub fn get_attached_node_size(&self) -> Option<LogicalSize>

Source

pub fn get_attached_node_position(&self) -> Option<LogicalPosition>

Source

pub fn get_callback_info(&self) -> &CallbackInfo

Source

pub fn get_callback_info_mut(&mut self) -> &mut CallbackInfo

Source

pub fn get_ctx(&self) -> OptionRefAny

Get the callable for FFI language bindings (Python, etc.)

Source

pub fn add_timer(&mut self, timer_id: TimerId, timer: Timer)

Add a timer to this window (applied after callback returns)

Source

pub fn remove_timer(&mut self, timer_id: TimerId)

Remove a timer from this window (applied after callback returns)

Source

pub fn add_thread(&mut self, thread_id: ThreadId, thread: Thread)

Add a thread to this window (applied after callback returns)

Source

pub fn remove_thread(&mut self, thread_id: ThreadId)

Remove a thread from this window (applied after callback returns)

Source

pub fn stop_propagation(&mut self)

Stop event propagation (applied after callback returns)

Source

pub fn create_window(&mut self, options: WindowCreateOptions)

Create a new window (applied after callback returns)

Source

pub fn close_window(&mut self)

Close the current window (applied after callback returns)

Source

pub fn modify_window_state(&mut self, state: FullWindowState)

Modify the window state (applied after callback returns)

Source

pub fn add_image_to_cache(&mut self, id: AzString, image: ImageRef)

Add an image to the image cache (applied after callback returns)

Source

pub fn remove_image_from_cache(&mut self, id: AzString)

Remove an image from the image cache (applied after callback returns)

Source

pub fn update_all_image_callbacks(&mut self)

Re-render ALL image callbacks across all DOMs (applied after callback returns)

This is the most efficient way to update animated GL textures from a timer. Triggers only texture re-rendering - no DOM rebuild or display list resubmission.

Source

pub fn trigger_virtual_view_rerender(&mut self, dom_id: DomId, node_id: NodeId)

Trigger re-rendering of a VirtualView (applied after callback returns)

Source

pub fn reload_system_fonts(&mut self)

Reload system fonts (applied after callback returns)

Source

pub fn prevent_default(&mut self)

Prevent the default action

Source

pub fn open_menu(&mut self, menu: Menu)

Open a menu

Source

pub fn open_menu_at(&mut self, menu: Menu, position: LogicalPosition)

Open a menu at a specific position

Source

pub fn show_tooltip(&mut self, text: AzString)

Show a tooltip at the current cursor position

Source

pub fn show_tooltip_at(&mut self, text: AzString, position: LogicalPosition)

Show a tooltip at a specific position

Source

pub fn hide_tooltip(&mut self)

Hide the currently displayed tooltip

Source

pub fn open_menu_for_hit_node(&mut self, menu: Menu) -> bool

Open a menu positioned relative to the currently hit node

Source

pub fn get_current_window_flags(&self) -> WindowFlags

Get current window flags

Source

pub fn get_current_keyboard_state(&self) -> KeyboardState

Get current keyboard state

Source

pub fn get_current_mouse_state(&self) -> MouseState

Get current mouse state

Source

pub fn get_cursor_relative_to_node(&self) -> OptionCursorNodePosition

Get the cursor position relative to the hit node

Source

pub fn get_cursor_relative_to_viewport(&self) -> OptionLogicalPosition

Get the cursor position relative to the viewport

Source

pub fn get_cursor_position(&self) -> Option<LogicalPosition>

Get the current cursor position

Source

pub fn get_current_time(&self) -> Instant

Get the current time (when the timer callback started)

Source

pub fn is_dom_focused(&self) -> bool

Check if the DOM is focused

Source

pub fn is_pen_in_contact(&self) -> bool

Check if pen is in contact

Source

pub fn is_pen_eraser(&self) -> bool

Check if pen eraser is active

Source

pub fn is_pen_barrel_button_pressed(&self) -> bool

Check if pen barrel button is pressed

Source

pub fn is_dragging(&self) -> bool

Check if dragging is active

Source

pub fn is_drag_active(&self) -> bool

Check if drag is active

Source

pub fn is_node_drag_active(&self) -> bool

Check if node drag is active

Source

pub fn is_file_drag_active(&self) -> bool

Check if file drag is active

Source

pub fn has_sufficient_history_for_gestures(&self) -> bool

Check if there’s sufficient history for gestures

Source

pub fn get_scroll_node_info( &self, dom_id: DomId, node_id: NodeId, ) -> Option<ScrollNodeInfo>

Get a read-only snapshot of a scroll node’s bounds and position.

Timer callbacks use this to read current scroll state for physics calculation.

Source

pub fn find_scroll_parent( &self, dom_id: DomId, node_id: NodeId, ) -> Option<NodeId>

Find the closest scrollable ancestor of a node.

Used by auto-scroll timer to find which container to scroll when the user drags beyond the container edge.

Source

pub fn get_scroll_input_queue(&self) -> ScrollInputQueue

Get the scroll input queue for consuming pending scroll inputs.

The physics timer calls take_all() each tick to drain inputs recorded by platform event handlers.

Source

pub fn scroll_to( &mut self, dom_id: DomId, node_id: NodeHierarchyItemId, position: LogicalPosition, )

Scroll a node to a specific position (via transactional CallbackChange).

This is the primary way for timer callbacks to update scroll positions. The change is applied after the callback returns.

Source

pub fn scroll_to_unclamped( &mut self, dom_id: DomId, node_id: NodeHierarchyItemId, position: LogicalPosition, )

Scroll to position without clamping (for rubber-banding/overscroll).

Source

pub fn set_cursor_visibility(&mut self, visible: bool)

Set cursor visibility state (for cursor blink timer)

Source

pub fn set_cursor_visibility_toggle(&mut self)

Toggle cursor visibility (for cursor blink timer).

NOTE: Currently always sets visibility to true — proper toggle logic requires a CallbackChange::ToggleCursorVisibility variant or reading current state, which is not yet implemented.

Reset cursor blink state on user input

Trait Implementations§

Source§

impl Clone for TimerCallbackInfo

Source§

fn clone(&self) -> TimerCallbackInfo

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.