Skip to main content

CallbackChange

Enum CallbackChange 

Source
pub enum CallbackChange {
Show 50 variants ModifyWindowState { state: FullWindowState, }, QueueWindowStateSequence { states: Vec<FullWindowState>, }, CreateNewWindow { options: WindowCreateOptions, }, CloseWindow, SetFocusTarget { target: FocusTarget, }, StopPropagation, PreventDefault, AddTimer { timer_id: TimerId, timer: Timer, }, RemoveTimer { timer_id: TimerId, }, AddThread { thread_id: ThreadId, thread: Thread, }, RemoveThread { thread_id: ThreadId, }, ChangeNodeText { node_id: DomNodeId, text: AzString, }, ChangeNodeImage { dom_id: DomId, node_id: NodeId, image: ImageRef, update_type: UpdateImageType, }, UpdateImageCallback { dom_id: DomId, node_id: NodeId, }, UpdateIFrame { dom_id: DomId, node_id: NodeId, }, ChangeNodeImageMask { dom_id: DomId, node_id: NodeId, mask: ImageMask, }, ChangeNodeCssProperties { dom_id: DomId, node_id: NodeId, properties: CssPropertyVec, }, ScrollTo { dom_id: DomId, node_id: NodeHierarchyItemId, position: LogicalPosition, }, ScrollIntoView { node_id: DomNodeId, options: ScrollIntoViewOptions, }, AddImageToCache { id: AzString, image: ImageRef, }, RemoveImageFromCache { id: AzString, }, ReloadSystemFonts, OpenMenu { menu: Menu, position: Option<LogicalPosition>, }, ShowTooltip { text: AzString, position: LogicalPosition, }, HideTooltip, InsertText { dom_id: DomId, node_id: NodeId, text: AzString, }, DeleteBackward { dom_id: DomId, node_id: NodeId, }, DeleteForward { dom_id: DomId, node_id: NodeId, }, MoveCursor { dom_id: DomId, node_id: NodeId, cursor: TextCursor, }, SetSelection { dom_id: DomId, node_id: NodeId, selection: Selection, }, SetTextChangeset { changeset: PendingTextEdit, }, MoveCursorLeft { dom_id: DomId, node_id: NodeId, extend_selection: bool, }, MoveCursorRight { dom_id: DomId, node_id: NodeId, extend_selection: bool, }, MoveCursorUp { dom_id: DomId, node_id: NodeId, extend_selection: bool, }, MoveCursorDown { dom_id: DomId, node_id: NodeId, extend_selection: bool, }, MoveCursorToLineStart { dom_id: DomId, node_id: NodeId, extend_selection: bool, }, MoveCursorToLineEnd { dom_id: DomId, node_id: NodeId, extend_selection: bool, }, MoveCursorToDocumentStart { dom_id: DomId, node_id: NodeId, extend_selection: bool, }, MoveCursorToDocumentEnd { dom_id: DomId, node_id: NodeId, extend_selection: bool, }, SetCopyContent { target: DomNodeId, content: ClipboardContent, }, SetCutContent { target: DomNodeId, content: ClipboardContent, }, SetSelectAllRange { target: DomNodeId, range: SelectionRange, }, RequestHitTestUpdate { position: LogicalPosition, }, ProcessTextSelectionClick { position: LogicalPosition, time_ms: u64, }, SetCursorVisibility { visible: bool, }, ResetCursorBlink, StartCursorBlinkTimer, StopCursorBlinkTimer, ScrollActiveCursorIntoView, CreateTextInput { text: AzString, },
}
Expand description

Represents a change made by a callback that will be applied after the callback returns

This transaction-based system provides:

  • Clear separation between read-only queries and modifications
  • Atomic application of all changes
  • Easy debugging and logging of callback actions
  • Future extensibility for new change types

Variants§

§

ModifyWindowState

Modify the window state (size, position, title, etc.)

Fields

§

QueueWindowStateSequence

Queue multiple window state changes to be applied in sequence across frames. This is needed for simulating clicks (mouse down → wait → mouse up) where each state change needs to trigger separate event processing.

Fields

§

CreateNewWindow

Create a new window

Fields

§

CloseWindow

Close the current window (via Update::CloseWindow return value, tracked here for logging)

§

SetFocusTarget

Change keyboard focus to a specific node or clear focus

Fields

§

StopPropagation

Stop event from propagating to parent nodes

§

PreventDefault

Prevent default browser behavior (e.g., block text input from being applied)

§

AddTimer

Add a new timer to the window

Fields

§timer_id: TimerId
§timer: Timer
§

RemoveTimer

Remove an existing timer

Fields

§timer_id: TimerId
§

AddThread

Add a new background thread

Fields

§thread_id: ThreadId
§thread: Thread
§

RemoveThread

Remove an existing thread

Fields

§thread_id: ThreadId
§

ChangeNodeText

Change the text content of a node

Fields

§node_id: DomNodeId
§

ChangeNodeImage

Change the image of a node

Fields

§dom_id: DomId
§node_id: NodeId
§image: ImageRef
§update_type: UpdateImageType
§

UpdateImageCallback

Re-render an image callback (for resize/animation) This triggers re-invocation of the RenderImageCallback

Fields

§dom_id: DomId
§node_id: NodeId
§

UpdateIFrame

Trigger re-rendering of an IFrame with a new DOM This forces the IFrame to call its callback and update the display list

Fields

§dom_id: DomId
§node_id: NodeId
§

ChangeNodeImageMask

Change the image mask of a node

Fields

§dom_id: DomId
§node_id: NodeId
§

ChangeNodeCssProperties

Change CSS properties of a node

Fields

§dom_id: DomId
§node_id: NodeId
§properties: CssPropertyVec
§

ScrollTo

Scroll a node to a specific position

Fields

§dom_id: DomId
§

ScrollIntoView

Scroll a node into view (W3C scrollIntoView API) The scroll adjustments are calculated and applied when the change is processed

Fields

§node_id: DomNodeId
§

AddImageToCache

Add an image to the image cache

Fields

§image: ImageRef
§

RemoveImageFromCache

Remove an image from the image cache

Fields

§

ReloadSystemFonts

Reload system fonts (expensive operation)

§

OpenMenu

Open a context menu or dropdown menu Whether it’s native or fallback depends on window.state.flags.use_native_context_menus

Fields

§menu: Menu
§position: Option<LogicalPosition>

Optional position override (if None, uses menu.position)

§

ShowTooltip

Show a tooltip at a specific position

Platform-specific implementation:

  • Windows: Uses native tooltip window (TOOLTIPS_CLASS)
  • macOS: Uses NSPopover or custom NSWindow with tooltip styling
  • X11: Creates transient window with _NET_WM_WINDOW_TYPE_TOOLTIP
  • Wayland: Creates surface with zwlr_layer_shell_v1 (overlay layer)

Fields

§

HideTooltip

Hide the currently displayed tooltip

§

InsertText

Insert text at the current cursor position or replace selection

Fields

§dom_id: DomId
§node_id: NodeId
§

DeleteBackward

Delete text backward (backspace) at cursor

Fields

§dom_id: DomId
§node_id: NodeId
§

DeleteForward

Delete text forward (delete key) at cursor

Fields

§dom_id: DomId
§node_id: NodeId
§

MoveCursor

Move cursor to a specific position

Fields

§dom_id: DomId
§node_id: NodeId
§cursor: TextCursor
§

SetSelection

Set text selection range

Fields

§dom_id: DomId
§node_id: NodeId
§selection: Selection
§

SetTextChangeset

Set/override the text changeset for the current text input operation This allows callbacks to modify what text will be inserted during text input events

Fields

§

MoveCursorLeft

Move cursor left (arrow left)

Fields

§dom_id: DomId
§node_id: NodeId
§extend_selection: bool
§

MoveCursorRight

Move cursor right (arrow right)

Fields

§dom_id: DomId
§node_id: NodeId
§extend_selection: bool
§

MoveCursorUp

Move cursor up (arrow up)

Fields

§dom_id: DomId
§node_id: NodeId
§extend_selection: bool
§

MoveCursorDown

Move cursor down (arrow down)

Fields

§dom_id: DomId
§node_id: NodeId
§extend_selection: bool
§

MoveCursorToLineStart

Move cursor to line start (Home key)

Fields

§dom_id: DomId
§node_id: NodeId
§extend_selection: bool
§

MoveCursorToLineEnd

Move cursor to line end (End key)

Fields

§dom_id: DomId
§node_id: NodeId
§extend_selection: bool
§

MoveCursorToDocumentStart

Move cursor to document start (Ctrl+Home)

Fields

§dom_id: DomId
§node_id: NodeId
§extend_selection: bool
§

MoveCursorToDocumentEnd

Move cursor to document end (Ctrl+End)

Fields

§dom_id: DomId
§node_id: NodeId
§extend_selection: bool
§

SetCopyContent

Override clipboard content for copy operation

Fields

§target: DomNodeId
§

SetCutContent

Override clipboard content for cut operation

Fields

§target: DomNodeId
§

SetSelectAllRange

Override selection range for select-all operation

Fields

§target: DomNodeId
§

RequestHitTestUpdate

Request a hit test update at a specific position

This is used by the Debug API to update the hover manager’s hit test data after modifying the mouse position, ensuring that callbacks can find the correct nodes under the cursor.

Fields

§

ProcessTextSelectionClick

Process a text selection click at a specific position

This is used by the Debug API to trigger text selection directly, bypassing the normal event pipeline. The handler will:

  1. Hit-test IFC roots to find selectable text at the position
  2. Create a text cursor at the clicked position
  3. Update the selection manager with the new selection

Fields

§time_ms: u64
§

SetCursorVisibility

Set the cursor visibility state (called by blink timer)

Fields

§visible: bool

Reset cursor blink state on user input (makes cursor visible, records time)

§

StartCursorBlinkTimer

Start the cursor blink timer for the focused contenteditable element

§

StopCursorBlinkTimer

Stop the cursor blink timer (when focus leaves contenteditable)

§

ScrollActiveCursorIntoView

Scroll the active text cursor into view within its scrollable container This is automatically triggered after text input or cursor movement

§

CreateTextInput

Create a synthetic text input event

This simulates receiving text input from the OS. The text input flow will:

  1. Record the text in TextInputManager (creating a PendingTextEdit)
  2. Generate synthetic TextInput events
  3. Invoke user callbacks (which can intercept/reject via preventDefault)
  4. Apply the changeset if not rejected
  5. Mark dirty nodes for re-render

Fields

§text: AzString

The text to insert

Trait Implementations§

Source§

impl Clone for CallbackChange

Source§

fn clone(&self) -> CallbackChange

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for CallbackChange

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. 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.
Source§

impl<G1, G2> Within<G2> for G1
where G2: Contains<G1>,

Source§

fn is_within(&self, b: &G2) -> bool