Skip to main content

Module scripting

Module scripting 

Source
Expand description

Protocol helpers for scripting messages.

Both the daemon and headless modes handle Query/Interact/Reset/TreeHash messages from stdin. The logic is identical; only the surrounding event loop differs. This module contains the canonical implementations so the two modes stay in sync.

Event construction functions (parse_iced_key, parse_iced_modifiers, make_key_pressed, make_key_released, interaction_to_iced_events) also live here. Both the daemon renderer and headless mode use them to translate scripting protocol interactions into iced events.

Enums§

Selector
A selector that identifies a widget in the UI tree.

Constants§

MAX_SELECTOR_SEARCH_DEPTH
Maximum recursion depth for selector tree traversal.

Functions§

build_interact_response
Build an InteractResponse without writing it anywhere.
build_query_response
Build a QueryResponse without writing it anywhere.
build_reset_response
Reset core to a blank state and return the response.
build_tree_hash_response
Build a TreeHashResponse without writing it anywhere.
emit_wire
Write a serialized response using the given codec.
find_by_selector
Find a node in the core tree using any Selector.
find_focused_node
find_id_by_label
find_id_by_role
find_id_by_text
find_id_focused
find_node_by_id
find_node_by_label
find_node_by_role
find_node_by_text
handle_interact
Build and emit an InteractResponse to stdout.
handle_query
Build and emit a QueryResponse to stdout.
handle_reset
Reset core and emit the response to stdout.
handle_tree_hash
Build and emit a TreeHashResponse to stdout.
interaction_to_iced_events
Convert a scripting protocol interaction into a sequence of iced events.
make_key_pressed
Build a KeyPressed iced event.
make_key_released
Build a KeyReleased iced event.
parse_iced_key
Convert a key name string to an iced keyboard::Key.
parse_iced_modifiers
Build iced Modifiers from parsed scripting protocol modifiers JSON.
parse_key_and_modifiers
Parse key and modifiers from an interact payload.
parse_selector
Parse a selector from wire protocol JSON.
resolve_widget_id
Resolve a selector to a widget ID without emitting anything.