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
state: FullWindowStateQueueWindowStateSequence
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
states: Vec<FullWindowState>CreateNewWindow
Create a new window
Fields
options: WindowCreateOptionsCloseWindow
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
target: FocusTargetStopPropagation
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
RemoveTimer
Remove an existing timer
AddThread
Add a new background thread
RemoveThread
Remove an existing thread
ChangeNodeText
Change the text content of a node
ChangeNodeImage
Change the image of a node
UpdateImageCallback
Re-render an image callback (for resize/animation) This triggers re-invocation of the RenderImageCallback
UpdateIFrame
Trigger re-rendering of an IFrame with a new DOM This forces the IFrame to call its callback and update the display list
ChangeNodeImageMask
Change the image mask of a node
ChangeNodeCssProperties
Change CSS properties of a node
ScrollTo
Scroll a node to a specific position
ScrollIntoView
Scroll a node into view (W3C scrollIntoView API) The scroll adjustments are calculated and applied when the change is processed
AddImageToCache
Add an image to the image cache
RemoveImageFromCache
Remove an image from the image cache
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
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)
HideTooltip
Hide the currently displayed tooltip
InsertText
Insert text at the current cursor position or replace selection
DeleteBackward
Delete text backward (backspace) at cursor
DeleteForward
Delete text forward (delete key) at cursor
MoveCursor
Move cursor to a specific position
SetSelection
Set text selection range
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
changeset: PendingTextEditMoveCursorLeft
Move cursor left (arrow left)
MoveCursorRight
Move cursor right (arrow right)
MoveCursorUp
Move cursor up (arrow up)
MoveCursorDown
Move cursor down (arrow down)
MoveCursorToLineStart
Move cursor to line start (Home key)
MoveCursorToLineEnd
Move cursor to line end (End key)
MoveCursorToDocumentStart
Move cursor to document start (Ctrl+Home)
MoveCursorToDocumentEnd
Move cursor to document end (Ctrl+End)
SetCopyContent
Override clipboard content for copy operation
SetCutContent
Override clipboard content for cut operation
SetSelectAllRange
Override selection range for select-all operation
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
position: LogicalPositionProcessTextSelectionClick
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:
- Hit-test IFC roots to find selectable text at the position
- Create a text cursor at the clicked position
- Update the selection manager with the new selection
SetCursorVisibility
Set the cursor visibility state (called by blink timer)
ResetCursorBlink
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:
- Record the text in TextInputManager (creating a PendingTextEdit)
- Generate synthetic TextInput events
- Invoke user callbacks (which can intercept/reject via preventDefault)
- Apply the changeset if not rejected
- Mark dirty nodes for re-render
Trait Implementations§
Source§impl Clone for CallbackChange
impl Clone for CallbackChange
Source§fn clone(&self) -> CallbackChange
fn clone(&self) -> CallbackChange
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for CallbackChange
impl RefUnwindSafe for CallbackChange
impl Send for CallbackChange
impl Sync for CallbackChange
impl Unpin for CallbackChange
impl UnwindSafe for CallbackChange
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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