.. _stdlib_imgui_boost_runtime: ================================================================ Boost runtime — widget state structs, registry, and dispatcher ================================================================ .. das:module:: imgui_boost_runtime Runtime support layer for the ``[widget]`` / ``[container]`` macros: the per-kind state structs, the per-frame widget registry, the ``imgui_*`` live-command dispatcher, and the AwaitModifiers / Result framing that lets clients drive ImGui from outside the GLFW main thread. Widget state structs mix ``@live`` fields (preserved across hot-reload) and ``@optional`` fields (transient, dropped from JV when zero-valued). Common per-frame ImGui state — ``hex_id``, bbox, hover / active / focus — lives in :ref:`WidgetEntry `, not the per-kind structs, so each state struct stays small. The live-command surface (``imgui_snapshot``, ``imgui_click``, ``imgui_force_set``, ``imgui_open``, ``imgui_close``, ``imgui_focus``, ``imgui_await``) is the wire-protocol that ``imgui_playwright`` and external test harnesses drive. (Multi-frame drag/type live in ``imgui_live_core``'s ``imgui_mouse_play`` / ``imgui_key_type`` timelines, which playwright composes.) Commands resolve targets via the registry's path key (e.g. ``MAIN_WIN/SETTINGS_TAB/RPS``) or raw ``0x``; results carry an :ref:`AwaitResult ` whose ``await_*`` modifiers tell the client to wait for quiescence or a specific frame number before reading the response. ++++++++++++ Type aliases ++++++++++++ .. _alias-KindDispatcher: .. das:attribute:: KindDispatcher = function<(state_addr:void? const;action:string const;payload:string const):void> typedef KindDispatcher = function<(state_addr:void? const;action:string const;payload:string const):void> aka KindDispatcher ++++++++++ Structures ++++++++++ .. _struct-imgui_boost_runtime-ClickState: .. das:attribute:: ClickState :Fields: * **click_count** : int - cumulative across reloads * **clicked** : bool - true on the frame the button fired * **text** : string - visible label (## id suffix stripped) for snapshot/tests .. _struct-imgui_boost_runtime-SliderStateFloat: .. das:attribute:: SliderStateFloat :Fields: * **value** : float - preserved across reload * **bounds** : tuple - (min, max) * **has_pending** : bool - imgui_force_set L3 sets; render fn consumes * **pending_value** : float - next-frame value queued by imgui_force_set * **changed** : bool - true on the frame the widget fired .. _struct-imgui_boost_runtime-SliderStateFloat2: .. das:attribute:: SliderStateFloat2 :Fields: * **value** : float2 - preserved across reload * **bounds** : tuple - (min, max) applied to every component * **has_pending** : bool - imgui_force_set queued; consumed next frame * **pending_value** : float2 - next-frame value queued by imgui_force_set * **changed** : bool - true on the frame the widget fired .. _struct-imgui_boost_runtime-SliderStateFloat3: .. das:attribute:: SliderStateFloat3 :Fields: * **value** : float3 - preserved across reload * **bounds** : tuple - (min, max) applied to every component * **has_pending** : bool - imgui_force_set queued; consumed next frame * **pending_value** : float3 - next-frame value queued by imgui_force_set * **changed** : bool - true on the frame the widget fired .. _struct-imgui_boost_runtime-SliderStateFloat4: .. das:attribute:: SliderStateFloat4 :Fields: * **value** : float4 - preserved across reload * **bounds** : tuple - (min, max) applied to every component * **has_pending** : bool - imgui_force_set queued; consumed next frame * **pending_value** : float4 - next-frame value queued by imgui_force_set * **changed** : bool - true on the frame the widget fired .. _struct-imgui_boost_runtime-SliderStateInt: .. das:attribute:: SliderStateInt :Fields: * **value** : int - preserved across reload * **bounds** : tuple - (min, max) * **has_pending** : bool - imgui_force_set queued; consumed next frame * **pending_value** : int - next-frame value queued by imgui_force_set * **changed** : bool - true on the frame the widget fired .. _struct-imgui_boost_runtime-SliderStateInt2: .. das:attribute:: SliderStateInt2 :Fields: * **value** : int2 - preserved across reload * **bounds** : tuple - (min, max) applied to every component * **has_pending** : bool - imgui_force_set queued; consumed next frame * **pending_value** : int2 - next-frame value queued by imgui_force_set * **changed** : bool - true on the frame the widget fired .. _struct-imgui_boost_runtime-SliderStateInt3: .. das:attribute:: SliderStateInt3 :Fields: * **value** : int3 - preserved across reload * **bounds** : tuple - (min, max) applied to every component * **has_pending** : bool - imgui_force_set queued; consumed next frame * **pending_value** : int3 - next-frame value queued by imgui_force_set * **changed** : bool - true on the frame the widget fired .. _struct-imgui_boost_runtime-SliderStateInt4: .. das:attribute:: SliderStateInt4 :Fields: * **value** : int4 - preserved across reload * **bounds** : tuple - (min, max) applied to every component * **has_pending** : bool - imgui_force_set queued; consumed next frame * **pending_value** : int4 - next-frame value queued by imgui_force_set * **changed** : bool - true on the frame the widget fired .. _struct-imgui_boost_runtime-ToggleState: .. das:attribute:: ToggleState Shared across Checkbox / RadioButton (bool form) / Selectable / MenuItem. `pending_toggle` + `pending_value` let imgui_force_set steer the next frame's value deterministically; the renderer consumes-then-clears. :Fields: * **value** : bool - current toggle state; preserved across reload * **pending_toggle** : bool - imgui_force_set L3 sets; consumed next frame * **pending_value** : bool - next-frame value queued by imgui_force_set * **changed** : bool - true on the frame the widget fired * **text** : string - visible label (## id suffix stripped) for snapshot/tests .. _struct-imgui_boost_runtime-RadioIntState: .. das:attribute:: RadioIntState Backs RadioButton(int form). `value` is the currently-selected button id; the widget def takes the per-call `v_button` and writes value=v_button when the user clicks. `imgui_force_set {"value":N}` steers the selection. :Fields: * **value** : int - currently-selected button id * **pending_set** : bool - imgui_force_set queued; consumed next frame * **pending_value** : int - next-frame selection queued by imgui_force_set * **changed** : bool - true on the frame the selection changed .. _struct-imgui_boost_runtime-DragStateFloat: .. das:attribute:: DragStateFloat :Fields: * **value** : float - preserved across reload * **bounds** : tuple - (min, max); zero-init = unclamped * **has_pending** : bool - imgui_force_set queued; consumed next frame * **pending_value** : float - next-frame value queued by imgui_force_set * **changed** : bool - true on the frame the widget fired .. _struct-imgui_boost_runtime-DragStateFloat2: .. das:attribute:: DragStateFloat2 :Fields: * **value** : float2 - preserved across reload * **bounds** : tuple - (min, max); zero-init = unclamped * **has_pending** : bool - imgui_force_set queued; consumed next frame * **pending_value** : float2 - next-frame value queued by imgui_force_set * **changed** : bool - true on the frame the widget fired .. _struct-imgui_boost_runtime-DragStateFloat3: .. das:attribute:: DragStateFloat3 :Fields: * **value** : float3 - preserved across reload * **bounds** : tuple - (min, max); zero-init = unclamped * **has_pending** : bool - imgui_force_set queued; consumed next frame * **pending_value** : float3 - next-frame value queued by imgui_force_set * **changed** : bool - true on the frame the widget fired .. _struct-imgui_boost_runtime-DragStateFloat4: .. das:attribute:: DragStateFloat4 :Fields: * **value** : float4 - preserved across reload * **bounds** : tuple - (min, max); zero-init = unclamped * **has_pending** : bool - imgui_force_set queued; consumed next frame * **pending_value** : float4 - next-frame value queued by imgui_force_set * **changed** : bool - true on the frame the widget fired .. _struct-imgui_boost_runtime-DragStateInt: .. das:attribute:: DragStateInt :Fields: * **value** : int - preserved across reload * **bounds** : tuple - (min, max); zero-init = unclamped * **has_pending** : bool - imgui_force_set queued; consumed next frame * **pending_value** : int - next-frame value queued by imgui_force_set * **changed** : bool - true on the frame the widget fired .. _struct-imgui_boost_runtime-DragStateInt2: .. das:attribute:: DragStateInt2 :Fields: * **value** : int2 - preserved across reload * **bounds** : tuple - (min, max); zero-init = unclamped * **has_pending** : bool - imgui_force_set queued; consumed next frame * **pending_value** : int2 - next-frame value queued by imgui_force_set * **changed** : bool - true on the frame the widget fired .. _struct-imgui_boost_runtime-DragStateInt3: .. das:attribute:: DragStateInt3 :Fields: * **value** : int3 - preserved across reload * **bounds** : tuple - (min, max); zero-init = unclamped * **has_pending** : bool - imgui_force_set queued; consumed next frame * **pending_value** : int3 - next-frame value queued by imgui_force_set * **changed** : bool - true on the frame the widget fired .. _struct-imgui_boost_runtime-DragStateInt4: .. das:attribute:: DragStateInt4 :Fields: * **value** : int4 - preserved across reload * **bounds** : tuple - (min, max); zero-init = unclamped * **has_pending** : bool - imgui_force_set queued; consumed next frame * **pending_value** : int4 - next-frame value queued by imgui_force_set * **changed** : bool - true on the frame the widget fired .. _struct-imgui_boost_runtime-DragStateRangeFloat: .. das:attribute:: DragStateRangeFloat `value.x` = current_min, `value.y` = current_max. Bounds clamp both. `imgui_force_set {"value":[lo,hi]}` writes the whole range atomically. :Fields: * **value** : float2 - (current_min, current_max); preserved across reload * **bounds** : tuple - (min, max) clamp applied to both endpoints * **has_pending** : bool - imgui_force_set queued; consumed next frame * **pending_value** : float2 - next-frame range queued by imgui_force_set * **changed** : bool - true on the frame the range changed .. _struct-imgui_boost_runtime-DragStateRangeInt: .. das:attribute:: DragStateRangeInt `value.x` = current_min, `value.y` = current_max. :Fields: * **value** : int2 - (current_min, current_max); preserved across reload * **bounds** : tuple - (min, max) clamp applied to both endpoints * **has_pending** : bool - imgui_force_set queued; consumed next frame * **pending_value** : int2 - next-frame range queued by imgui_force_set * **changed** : bool - true on the frame the range changed .. _struct-imgui_boost_runtime-InputStateFloat: .. das:attribute:: InputStateFloat :Fields: * **value** : float - preserved across reload * **has_pending** : bool - imgui_force_set queued; consumed next frame * **pending_value** : float - next-frame value queued by imgui_force_set * **changed** : bool - true on the frame the widget fired .. _struct-imgui_boost_runtime-InputStateFloat2: .. das:attribute:: InputStateFloat2 :Fields: * **value** : float2 - preserved across reload * **has_pending** : bool - imgui_force_set queued; consumed next frame * **pending_value** : float2 - next-frame value queued by imgui_force_set * **changed** : bool - true on the frame the widget fired .. _struct-imgui_boost_runtime-InputStateFloat3: .. das:attribute:: InputStateFloat3 :Fields: * **value** : float3 - preserved across reload * **has_pending** : bool - imgui_force_set queued; consumed next frame * **pending_value** : float3 - next-frame value queued by imgui_force_set * **changed** : bool - true on the frame the widget fired .. _struct-imgui_boost_runtime-InputStateFloat4: .. das:attribute:: InputStateFloat4 :Fields: * **value** : float4 - preserved across reload * **has_pending** : bool - imgui_force_set queued; consumed next frame * **pending_value** : float4 - next-frame value queued by imgui_force_set * **changed** : bool - true on the frame the widget fired .. _struct-imgui_boost_runtime-InputStateInt: .. das:attribute:: InputStateInt :Fields: * **value** : int - preserved across reload * **has_pending** : bool - imgui_force_set queued; consumed next frame * **pending_value** : int - next-frame value queued by imgui_force_set * **changed** : bool - true on the frame the widget fired .. _struct-imgui_boost_runtime-InputStateInt2: .. das:attribute:: InputStateInt2 :Fields: * **value** : int2 - preserved across reload * **has_pending** : bool - imgui_force_set queued; consumed next frame * **pending_value** : int2 - next-frame value queued by imgui_force_set * **changed** : bool - true on the frame the widget fired .. _struct-imgui_boost_runtime-InputStateInt3: .. das:attribute:: InputStateInt3 :Fields: * **value** : int3 - preserved across reload * **has_pending** : bool - imgui_force_set queued; consumed next frame * **pending_value** : int3 - next-frame value queued by imgui_force_set * **changed** : bool - true on the frame the widget fired .. _struct-imgui_boost_runtime-InputStateInt4: .. das:attribute:: InputStateInt4 :Fields: * **value** : int4 - preserved across reload * **has_pending** : bool - imgui_force_set queued; consumed next frame * **pending_value** : int4 - next-frame value queued by imgui_force_set * **changed** : bool - true on the frame the widget fired .. _struct-imgui_boost_runtime-InputStateDouble: .. das:attribute:: InputStateDouble :Fields: * **value** : double - preserved across reload * **has_pending** : bool - imgui_force_set queued; consumed next frame * **pending_value** : double - next-frame value queued by imgui_force_set * **changed** : bool - true on the frame the widget fired .. _struct-imgui_boost_runtime-ColorState3: .. das:attribute:: ColorState3 :Fields: * **value** : float3 - RGB in [0..1] * **has_pending** : bool - imgui_force_set queued; consumed next frame * **pending_value** : float3 - next-frame RGB queued by imgui_force_set * **changed** : bool - true on the frame the color changed .. _struct-imgui_boost_runtime-ColorState4: .. das:attribute:: ColorState4 :Fields: * **value** : float4 - RGBA in [0..1] * **has_pending** : bool - imgui_force_set queued; consumed next frame * **pending_value** : float4 - next-frame RGBA queued by imgui_force_set * **changed** : bool - true on the frame the color changed .. _struct-imgui_boost_runtime-ComboState: .. das:attribute:: ComboState :Fields: * **value** : int = -1 - selected index, -1 = none * **has_pending** : bool - imgui_force_set queued; consumed next frame * **pending_value** : int - next-frame selection queued by imgui_force_set * **changed** : bool - true on the frame the selection changed * **items_buf** : array - transient zero-separated buffer; rebuilt each frame .. _struct-imgui_boost_runtime-ListBoxState: .. das:attribute:: ListBoxState :Fields: * **value** : int = -1 - selected index, -1 = none * **has_pending** : bool - imgui_force_set queued; consumed next frame * **pending_value** : int - next-frame selection queued by imgui_force_set * **changed** : bool - true on the frame the selection changed .. _struct-imgui_boost_runtime-InputTextState: .. das:attribute:: InputTextState :Fields: * **value** : string = "" - current text content (clone of buffer) * **capacity** : int = 256 - working buffer size in bytes (incl. trailing null) * **has_pending** : bool - imgui_force_set queued; consumed next frame * **pending_value** : string = "" - next-frame text queued by imgui_force_set * **changed** : bool - true on the frame the text changed * **buffer** : array - working buffer; mirrors `value`, allocated to capacity on first frame / post-reload .. _struct-imgui_boost_runtime-TextShowState: .. das:attribute:: TextShowState Backs the `text_show` display widget. Read-only from the user's perspective — `value` is set by a call-site initializer (`text_show(STATUS, value="saved")`), programmatically, or via `imgui_force_set`; the standard serializer surfaces it for telemetry. :Fields: * **value** : string = "" - displayed text; settable via call-site initializer or imgui_force_set .. _struct-imgui_boost_runtime-PlotState: .. das:attribute:: PlotState Backs `plot_lines` / `plot_histogram`. Plotted values are passed per-frame (not stored); state carries last-frame's call args for telemetry — label, (scale_min, scale_max) range, sample count. Read-only — no dispatcher. :Fields: * **title** : string - overlay text * **bounds** : tuple - (scale_min, scale_max) * **samples** : int - length(values) last frame .. _struct-imgui_boost_runtime-NarrativeState: .. das:attribute:: NarrativeState Backs every text-bearing narrative widget (text / text_unformatted / text_wrapped / text_colored / text_disabled / bullet_text / separator_text / set_tooltip / set_item_tooltip). Displayed string is per-call, echoed into `value` each frame for telemetry. Read-only. :Fields: * **value** : string - per-frame echo of call-site `text` arg .. _struct-imgui_boost_runtime-LabelTextState: .. das:attribute:: LabelTextState Backs the `label_text` widget. ImGui's `LabelText(label, fmt)` shows label-key on the left, value-text on the right; both per-call, echoed for telemetry. Read-only. (Field is `key` not `label` — `label` is reserved in gen2.) :Fields: * **key** : string - per-frame echo of the left-side label string * **value** : string - per-frame echo of the right-side value string .. _struct-imgui_boost_runtime-EmptyMarkerState: .. das:attribute:: EmptyMarkerState Backs the stateless decoration widgets (`separator`, `spacing`, `new_line`, `dummy`, `same_line`, `bullet`). The state global exists only because [widget] auto-emit needs something to instantiate. :Fields: * **_placeholder** : bool - unused; keeps the struct non-empty for [widget] auto-emit .. _struct-imgui_boost_runtime-ImageState: .. das:attribute:: ImageState Backs the `image` display widget. Texture handle is opaque (void?), so telemetry echoes only the actionable per-call args — size, uv rectangle, tint/border colors. Read-only — no dispatcher. :Fields: * **size** : float2 - per-call display size * **uv0** : float2 - upper-left uv * **uv1** : float2 - lower-right uv * **tint_col** : float4 - tint applied to texels * **border_col** : float4 - border color (zero alpha = no border) .. _struct-imgui_boost_runtime-ProgressBarState: .. das:attribute:: ProgressBarState Backs the `progress_bar` widget. `fraction` is per-frame per-call (caller drives progress); `overlay` is the optional center-aligned label; `size` is the per-call display size. Read-only — no dispatcher. :Fields: * **fraction** : float - per-frame progress in [0,1]; -1 means indeterminate * **overlay** : string - optional overlay text (e.g. "42/100") * **size** : float2 - per-call display size; (-1, 0) defaults to full-width .. _struct-imgui_boost_runtime-WindowState: .. das:attribute:: WindowState Backs the `window` container. `open` defaults true so a closable window renders from frame 1; X-button / `imgui_close` flips it, `@live` carries it across reload. Pos is NOT @live (ImGui persists it via imgui.ini). imgui_open/close route through pending_open/close, applied at the next frame's top. :Fields: * **open** : bool = true - window open state; preserved across reload * **flags** : :ref:`ImGuiWindowFlags ` - per-call ImGuiWindowFlags (echoed for telemetry) * **pos** : float2 - observed window position (top-left, screen coords) * **size** : float2 - observed window size * **collapsed** : bool - observed collapsed state * **scroll** : float2 - (GetScrollX, GetScrollY) of the window * **scroll_max** : float2 - (GetScrollMaxX, GetScrollMaxY) * **pending_open** : bool - imgui_open queued; applied next frame * **pending_close** : bool - imgui_close queued; applied next frame * **pending_size** : float2 - imgui_set_window_size queued — applied via SetNextWindowSize next frame * **pending_size_set** : bool - gates pending_size (so (0,0) is a valid request, not a sentinel) * **pending_scroll** : float2 - imgui_click scroll-into-view queued — applied via SetNextWindowScroll next frame * **pending_scroll_set** : bool - gates pending_scroll (so (0,0) is a valid request, not a sentinel) .. _struct-imgui_boost_runtime-ChildState: .. das:attribute:: ChildState Backs the `child` container. All fields are observed (scroll); per- call config (size, child_flags, window_flags) is supplied via the named-tuple at the call site. :Fields: * **size** : float2 - per-call child region size (echoed for telemetry) * **child_flags** : :ref:`ImGuiChildFlags ` - per-call ImGuiChildFlags * **window_flags** : :ref:`ImGuiWindowFlags ` - per-call ImGuiWindowFlags * **scroll** : float2 - (GetScrollX, GetScrollY) * **scroll_max** : float2 - (GetScrollMaxX, GetScrollMaxY) .. _struct-imgui_boost_runtime-GroupState: .. das:attribute:: GroupState Backs the `group` container. Pure layout grouping — no persistent/observable state, but [container] still needs a struct to hang the auto-emitted global on. `_placeholder` stays @optional so JV(state) emits `{}`. :Fields: * **_placeholder** : bool - unused; keeps the struct non-empty for [container] auto-emit .. _struct-imgui_boost_runtime-MenuBarState: .. das:attribute:: MenuBarState Backs the `menu_bar` container. Stateless wrapper. :Fields: * **_placeholder** : bool - unused; keeps the struct non-empty for [container] auto-emit .. _struct-imgui_boost_runtime-MenuState: .. das:attribute:: MenuState Backs the `menu` container — a single drop-down inside a menu bar. `enabled` is per-call; `opened` is per-frame observed. :Fields: * **enabled** : bool - per-call enable flag (echoed for telemetry) * **opened** : bool - observed per-frame: menu is currently expanded .. _struct-imgui_boost_runtime-PopupState: .. das:attribute:: PopupState Shared by `popup` and `popup_modal`. `open` is @live (survives reload). imgui_open/close route through pending_open/close; the renderer issues OpenPopup/CloseCurrentPopup on the next frame. :Fields: * **open** : bool - popup open state; preserved across reload * **flags** : :ref:`ImGuiWindowFlags ` - per-call ImGuiWindowFlags * **pending_open** : bool - imgui_open queued; OpenPopup fires next frame * **pending_close** : bool - imgui_close queued; CloseCurrentPopup fires next frame .. _struct-imgui_boost_runtime-TabBarState: .. das:attribute:: TabBarState Backs the `tab_bar` container. ImGui drives active-tab selection itself; we just observe. :Fields: * **flags** : :ref:`ImGuiTabBarFlags ` - per-call ImGuiTabBarFlags .. _struct-imgui_boost_runtime-TableState: .. das:attribute:: TableState Backs the `table` container. ImGui owns column-resize/sort state internally (TableSettings); per-call config is echoed for snapshot consumers. sort_specs / multi-select capture is deferred to the `tables.das` port. :Fields: * **columns** : int - per-call column count * **flags** : :ref:`ImGuiTableFlags ` - per-call ImGuiTableFlags * **outer_size** : float2 - per-call outer_size (echoed) * **inner_width** : float - per-call inner_width (echoed) .. _struct-imgui_boost_runtime-TabItemState: .. das:attribute:: TabItemState Backs the `tab_item` container. `open` defaults to true so a closable tab renders from frame 1; the X-button or `imgui_close` flips it false. `@live` carries that across reload. :Fields: * **open** : bool = true - tab open state; preserved across reload * **flags** : :ref:`ImGuiTabItemFlags ` - per-call ImGuiTabItemFlags * **pending_open** : bool - imgui_open queued; applied next frame * **pending_close** : bool - imgui_close queued; applied next frame * **pending_select** : bool - imgui_select queued; applied next frame (SetSelected) * **selected** : bool - observed: is this the active tab this frame (snapshot-visible) .. _struct-imgui_boost_runtime-WrapTabBarState: .. das:attribute:: WrapTabBarState Backs `wrap_tab_bar` (the multi-row/wrapping tab bar ImGui lacks). Active tab is an index like `combo`: `imgui_force_set {"value":N}` selects tab N next frame. `labels` mirrors last frame's tabs (header strip is laid out a frame behind so it can precede the bodies). :Fields: * **value** : int - active tab index; preserved across reload * **has_pending** : bool - imgui_force_set queued; consumed next frame * **pending_value** : int - next-frame index queued by imgui_force_set * **labels** : array - tab labels from the previous frame (snapshot-visible) .. _struct-imgui_boost_runtime-TooltipState: .. das:attribute:: TooltipState Backs both `tooltip` and `item_tooltip`. Tooltips don't persist — they're a per-frame chrome pop. :Fields: * **_placeholder** : bool - unused; keeps the struct non-empty for [container] auto-emit .. _struct-imgui_boost_runtime-PopupContextItemState: .. das:attribute:: PopupContextItemState Backs `popup_context_item`. Right-click attaches to the previous item and ImGui drives open/close internally; no pending flags needed. :Fields: * **_placeholder** : bool - unused; keeps the struct non-empty for [container] auto-emit .. _struct-imgui_boost_runtime-PopupContextWindowState: .. das:attribute:: PopupContextWindowState Backs `popup_context_window`. Right-click anywhere in the enclosing window opens the popup; ImGui drives open/close internally. :Fields: * **_placeholder** : bool - unused; keeps the struct non-empty for [container] auto-emit .. _struct-imgui_boost_runtime-PopupWindowState: .. das:attribute:: PopupWindowState Backs `popup_window` — stateless BeginPopup/EndPopup wrapper for the manual-trigger pattern: caller drives `open_popup(str_id, flags)` (typically on hover+release), then `popup_window` brackets the body when ImGui reports it open. ImGui owns the lifecycle by `str_id`, no pending flags. :Fields: * **_placeholder** : bool - unused; keeps the struct non-empty for [container] auto-emit .. _struct-imgui_boost_runtime-TextFilterState: .. das:attribute:: TextFilterState Backs `text_filter`. Holds the bound C++ `ImGuiTextFilter` inline — zero-init is safe (empty InputBuf/Filters ImVector, CountGrep=0), no ctor call needed. Renders the inline InputText via :Fields: * **value** : string - the bound `Draw()`; `passes_filter` delegates to the hand-bound `PassFilter(filter, text)`. * **filter** : :ref:`ImGuiTextFilter ` - mirrored InputBuf text for snapshot/telemetry .. _struct-imgui_boost_runtime-DragDropSourceState: .. das:attribute:: DragDropSourceState Backs `drag_drop_source`. Drag activation lives entirely in ImGui's internal drag-drop state machine; body runs only on active drag. :Fields: * **_placeholder** : bool - unused; keeps the struct non-empty for [container] auto-emit .. _struct-imgui_boost_runtime-DragDropTargetState: .. das:attribute:: DragDropTargetState Backs `drag_drop_target`. Body runs only when a payload-bearing drag is hovering this target — caller still calls AcceptDragDropPayload inside. :Fields: * **accepted** : int - running count of drops ImGui delivered here; telemetry rail to self-verify a real drop landed .. _struct-imgui_boost_runtime-TreeNodeState: .. das:attribute:: TreeNodeState Backs the `tree_node` container. ImGui owns the open/close state internally; we mirror what's observable so snapshots reflect truth, and the dispatcher routes open/close through SetNextItemOpen. :Fields: * **flags** : :ref:`ImGuiTreeNodeFlags ` - per-call ImGuiTreeNodeFlags * **opened** : bool - observed per-frame: TreeNode returned true * **pending_open** : bool - imgui_open queued; SetNextItemOpen(true) fires next frame * **pending_close** : bool - imgui_close queued; SetNextItemOpen(false) fires next frame .. _struct-imgui_boost_runtime-CollapsingHeaderState: .. das:attribute:: CollapsingHeaderState Backs `collapsing_header`. Same shape as TreeNodeState plus a `@live open` slot for the X-button form (CollapsingHeader(label, bool* p_visible, flags)); `open` defaults true so a closable section renders from frame 1, X-button / `imgui_close` flips it. :Fields: * **open** : bool = true - closable form's p_visible state; preserved across reload * **flags** : :ref:`ImGuiTreeNodeFlags ` - per-call ImGuiTreeNodeFlags * **opened** : bool - observed per-frame: CollapsingHeader returned true * **pending_open** : bool - imgui_open queued; SetNextItemOpen(true) fires next frame * **pending_close** : bool - imgui_close queued; SetNextItemOpen(false) fires next frame .. _struct-imgui_boost_runtime-MainMenuBarState: .. das:attribute:: MainMenuBarState Backs the `main_menu_bar` container — `BeginMainMenuBar()` / `EndMainMenuBar()`. Screen-top, persistent; ImGui owns visibility, we just register the container path. Stateless wrapper. :Fields: * **_placeholder** : bool - unused; keeps the struct non-empty for [container] auto-emit .. _struct-imgui_boost_runtime-WidgetEntry: .. das:attribute:: WidgetEntry Per-frame snapshot of one rendered widget. Common fields populated each frame; per-kind detail is materialized on demand at imgui_snapshot from the ``(addr, ti)`` pair in ``g_widgets[ident]`` (via ``sprint_json_at`` + ``read_json``). Stateless widgets instead set the ``serialize`` hook (+ ctx/id), built lazily at snapshot — zero per-frame JSON. :Fields: * **kind** : string - widget kind ("button", "slider_float", ...) * **hex_id** : uint - ImGui's GetID() for this widget on this frame * **bbox** : float4 - packed [x0, y0, x1, y1] — ALWAYS screen-space * **canvas_bbox** : float4 - packed [x0,y0,x1,y1] in a transformed canvas's LOCAL space. Emitted ONLY when the widget was captured under a non-identity snapshot item-transform (e.g. inside a node-editor canvas) — `bbox` is then its screen-space mapping. Absent for the common case where the widget is already screen-space. * **sub_bboxes** : array - per-component sub-rects for multi-component widgets (slider_float2/3/4, slider_int2/3/4, drag_float2/3/4, drag_int2/3/4, and the two-handle drag_*_range2 forms where [0]=lo, [1]=hi): each entry is one handle's screen-space [x0,y0,x1,y1]. Lets a driver target component N deterministically (widget_component_point) instead of guessing x within the combined bbox. Absent for single-component widgets. * **hover** : bool - IsItemHovered() this frame * **active** : bool - IsItemActive() this frame * **focus** : bool - IsItemFocused() this frame * **payload** : :ref:`JsonValue `? - populated by widget_entry_jv from (addr, ti) via sprint_json_at + read_json, or from the serialize hook below * **serialize_id** : int - id/key passed to `serialize` (stateless lazy-payload hook); JV-skipped at 0 * **serialize_ctx** : void? - opaque context passed to `serialize` (e.g. editor handle); JV skips void? * **serialize** : function<(ctx:void?;id:int): :ref:`JsonValue `?> - lazy per-snapshot payload builder for stateless widgets — never called per frame; JV skips functions .. _struct-imgui_boost_runtime-WidgetMeta: .. das:attribute:: WidgetMeta :Fields: * **module_name** : string - owning module; lets clear_module_widgets drop on reload * **kind** : string - widget kind ("button", "slider_float", ...) * **state_addr** : void? - non-indexed: stable address of the module-scope state global (set by ``register_widget``). Indexed widgets pass ``null`` here and re-resolve per-k through ``addr_getter_int`` / ``addr_getter_str``. Named ``state_addr`` (not ``addr``) because daslang reserves ``addr`` as the builtin address-of operator. * **ti** : :ref:`TypeInfo `? - ``TypeInfo`` of the state value at ``addr`` (or the indexed slot's element). Drives ``sprint_json_at`` at snapshot time and ``sscan_json_at`` on dispatcher set-actions without per-call-site daslang thunks. * **addr_getter_int** : function<(k:int):void?> - int-indexed path only: resolves live state-struct address per-call against the user's ``table``. Null for non-indexed widgets — use ``addr`` instead. * **k_int** : int - int key stored at registration for indexed-int widgets; 0 when not indexed. * **addr_getter_str** : function<(k:string):void?> - string-indexed path only: resolves live state-struct address for ``table``. Null when ``has_str_key=false``. * **k_str** : string - string key stored at registration; empty when ``has_str_key=false``. * **has_str_key** : bool - true => use ``addr_getter_str`` + ``k_str``; false => use ``state_addr`` (non-indexed) or ``addr_getter_int`` + ``k_int``. * **last_seen_frame** : int - last g_frame this path appeared in g_registry; -1 = never rendered .. _struct-imgui_boost_runtime-AwaitModifiers: .. das:attribute:: AwaitModifiers Per-command await knobs. Pulled from `input["await"]` by `with_await`; all fields optional with sensible defaults (5s, no-op). :Fields: * **await_frames** : int = -1 - min frames to advance before considering the command settled; -1 = no frame floor * **await_until** : string = "" - quiescence predicate name (empty = default is_quiescent()) * **timeout_sec** : float = 5f - client-side wait ceiling (seconds) * **fire_and_forget** : bool = false - when true, client skips the await loop entirely .. _struct-imgui_boost_runtime-MousePosArgs: .. das:attribute:: MousePosArgs struct MousePosArgs .. _struct-imgui_boost_runtime-MouseClickArgs: .. das:attribute:: MouseClickArgs struct MouseClickArgs .. _struct-imgui_boost_runtime-MouseScrollArgs: .. das:attribute:: MouseScrollArgs struct MouseScrollArgs .. _struct-imgui_boost_runtime-KeyPressArgs: .. das:attribute:: KeyPressArgs struct KeyPressArgs .. _struct-imgui_boost_runtime-KeyCharArgs: .. das:attribute:: KeyCharArgs struct KeyCharArgs .. _struct-imgui_boost_runtime-UserControlArgs: .. das:attribute:: UserControlArgs struct UserControlArgs .. _struct-imgui_boost_runtime-AwaitArgs: .. das:attribute:: AwaitArgs :Fields: * **until** : string = "quiescent" - quiescence predicate name to poll * **frame** : int = -1 - when >=0, return quiescent once g_frame >= this value .. _struct-imgui_boost_runtime-AwaitResult: .. das:attribute:: AwaitResult :Fields: * **quiescent** : bool = false - true when the requested condition currently holds * **frame** : int = 0 - server's current g_frame * **pending_coroutines** : int = 0 - length(g_coroutines) — in-flight L1 input drivers * **active_id** : uint = 0x0 - GetActiveID() — non-zero when a widget is being interacted with ++++++++++++++++++ Per-frame registry ++++++++++++++++++ * :ref:`begin_frame () ` * :ref:`clear_module_widgets (module_name: string) ` * :ref:`end_of_frame () ` * :ref:`id_to_bbox (hid: uint) : float4 ` * :ref:`id_to_path (hid: uint) : string ` * :ref:`lookup_state_addr (path: string) : void? ` * :ref:`register_clickable_bbox (alias_ident: string; id_tag: string; kind: string) ` * :ref:`register_clickable_state_bbox (alias_ident: string; id_tag: string; kind: string; state_addr: void?; ti: TypeInfo const?) ` * :ref:`register_end_of_frame_hook (name: string; hook: function\<():void\>) ` * :ref:`register_focusable (widget_ident: string) ` * :ref:`register_handle_bbox (tag: string) ` * :ref:`register_post_command_hook (name: string; hook: function\<(command:string;target:string):void\>) ` * :ref:`register_radio_site_alias (widget_ident: string; v_button: int; state_addr: void?; ti: TypeInfo const?) ` * :ref:`register_widget (module_name: string; bare_ident: string; kind: string; state_addr: void?; ti: TypeInfo const?) ` * :ref:`register_widget_dispatch_for_type (ti: TypeInfo const?; dispatcher: KindDispatcher) ` * :ref:`register_widget_indexed (module_name: string; bare_ident: string; kind: string; addr_getter: function\<(k:int):void?\>; ti: TypeInfo const?; k: int) ` * :ref:`register_widget_str (module_name: string; bare_ident: string; kind: string; addr_getter: function\<(k:string):void?\>; ti: TypeInfo const?; k: string) ` * :ref:`widget_prelude (widget_ident: string) ` * :ref:`widget_rect (target: string) : tuple\ ` * :ref:`widget_registered (path: string) : bool ` * :ref:`with_state (path: string; t: type\; blk: block\<(var s:T&):void\>) : auto ` .. _function-imgui_boost_runtime_begin_frame: .. das:function:: begin_frame() Per-frame reset: bumps the frame counter and clears the per-frame registry, ``hex_id``\ →bbox map, and container path. Call before rendering widgets; L1 coroutines advance separately via :ref:`advance_coroutines `. .. _function-imgui_boost_runtime_clear_module_widgets_string: .. das:function:: clear_module_widgets(module_name: string) Drop every widget tagged with this module from the long-lived registries (g_widgets / id_to_path / focusable / pending_focus); called from each module's ``[init]`` so hot-reload re-binds cleanly. :Arguments: * **module_name** : string .. _function-imgui_boost_runtime_end_of_frame: .. das:function:: end_of_frame() Per-frame painter drain — invokes every hook registered via :ref:`register_end_of_frame_hook `. Call after rendering all widgets. .. _function-imgui_boost_runtime_id_to_bbox_uint: .. das:function:: id_to_bbox(hid: uint) : float4 Per-frame ``hex_id`` → bbox lookup; returns ``float4(0)`` when the id didn't render this frame. :Arguments: * **hid** : uint .. _function-imgui_boost_runtime_id_to_path_uint: .. das:function:: id_to_path(hid: uint) : string Resolve a raw ImGui ``hex_id`` to its boost path_key, or ``""`` when unmapped. :Arguments: * **hid** : uint .. _function-imgui_boost_runtime_lookup_state_addr_string: .. das:function:: lookup_state_addr(path: string) : void? Resolve a widget's current state-struct address by path. For non-indexed widgets returns ``meta.state_addr`` directly; for indexed widgets invokes the registered ``addr_getter`` so the live table slot is re-resolved on every call (slots may be erased between frames). Returns null when ``path`` is absent from ``g_widgets`` or the getter reports the slot is gone. :Arguments: * **path** : string .. _function-imgui_boost_runtime_register_clickable_bbox_string_string_string: .. das:function:: register_clickable_bbox(alias_ident: string; id_tag: string; kind: string) Surface a draw-time clickable region (a raw Button/InvisibleButton a ``[container]`` draws itself) as child alias ``/alias_ident``, so drivers can target a REAL synthetic click by path. Geometry-only, written into ``g_registry`` (rides the per-frame clear). Call inside the container body right after ``Button(id_tag, …)``: ``id_tag`` is the ImGui id (for GetID), ``alias_ident`` the snapshot path leaf. :Arguments: * **alias_ident** : string * **id_tag** : string * **kind** : string .. _function-imgui_boost_runtime_register_clickable_state_bbox_string_string_string_void_q__TypeInfo_const_q_: .. das:function:: register_clickable_state_bbox(alias_ident: string; id_tag: string; kind: string; state_addr: void?; ti: TypeInfo const?) Stateful sibling of ``register_clickable_bbox`` for hand-drawn components. The geometry remains a real ImGui hit target while ``state_addr``/``ti`` make the component's semantic state available in ``imgui_snapshot``. :Arguments: * **alias_ident** : string * **id_tag** : string * **kind** : string * **state_addr** : void? * **ti** : :ref:`TypeInfo `? .. _function-imgui_boost_runtime_register_end_of_frame_hook_string_function_ls__c_void_gr_: .. das:function:: register_end_of_frame_hook(name: string; hook: function<():void>) Register a per-frame painter fired by :ref:`end_of_frame `; re-registering the same ``name`` replaces, so live-reload doesn't multiply hooks. :Arguments: * **name** : string * **hook** : function .. _function-imgui_boost_runtime_register_focusable_string: .. das:function:: register_focusable(widget_ident: string) Tag this widget's path as accepting keyboard focus; called from interactive finalize helpers so :ref:`imgui_focus ` accepts the target. :Arguments: * **widget_ident** : string .. _function-imgui_boost_runtime_register_handle_bbox_string: .. das:function:: register_handle_bbox(tag: string) Surface a split/dock drag-handle's geometry as child alias ``/HANDLE``, so drivers can target a REAL synthetic drag at the handle (not only ``imgui_force_set``-ing the fraction). Call inside the ``[container]`` body after the handle ``InvisibleButton(tag, …)``. Fixed ``HANDLE`` alias (one per split). :Arguments: * **tag** : string .. _function-imgui_boost_runtime_register_post_command_hook_string_function_ls_command_c_string;target_c_string_c_void_gr_: .. das:function:: register_post_command_hook(name: string; hook: function<(command:string;target:string):void>) Register a hook fired after every successful ``imgui_*`` command with ``(command_name, resolved_target)``; same name-keyed idempotent semantics as :ref:`register_end_of_frame_hook `. :Arguments: * **name** : string * **hook** : function<(command:string;target:string):void> .. _function-imgui_boost_runtime_register_radio_site_alias_string_int_void_q__TypeInfo_const_q_: .. das:function:: register_radio_site_alias(widget_ident: string; v_button: int; state_addr: void?; ti: TypeInfo const?) Register a per-site geometry alias ``#`` for a grouped ``radio_button_int`` so each option is independently click/test-targetable though all sites share one ident (hence one ````) for state. Call right after the site's finalize; ``widgets_mark_seen(alias, alias, …)`` skips the bare-ident migration (equal args) and refreshes the meta. :Arguments: * **widget_ident** : string * **v_button** : int * **state_addr** : void? * **ti** : :ref:`TypeInfo `? .. _function-imgui_boost_runtime_register_widget_string_string_string_void_q__TypeInfo_const_q_: .. das:function:: register_widget(module_name: string; bare_ident: string; kind: string; state_addr: void?; ti: TypeInfo const?) Module-init registration of a non-indexed widget into the long-lived ``g_widgets`` table. ``state_addr`` is the stable address of the module-scope state global (passed by the ``[widget]`` macro as ``unsafe(addr(IDENT))``); ``ti`` is its ``TypeInfo`` (``typeinfo rtti_typeinfo(IDENT)``). Both feed ``sprint_json_at`` at snapshot time — no per-widget getter/serializer functions emitted. For indexed widgets use ``register_widget_indexed`` / ``register_widget_str``. :Arguments: * **module_name** : string * **bare_ident** : string * **kind** : string * **state_addr** : void? * **ti** : :ref:`TypeInfo `? .. _function-imgui_boost_runtime_register_widget_dispatch_for_type_TypeInfo_const_q__KindDispatcher: .. das:function:: register_widget_dispatch_for_type(ti: TypeInfo const?; dispatcher: KindDispatcher) Register a dispatcher for every widget whose state has this ``TypeInfo``. Emitted by the ``[widget_dispatch]`` annotation. The user-facing function name is irrelevant — what matters is the first parameter's struct type. :Arguments: * **ti** : :ref:`TypeInfo `? * **dispatcher** : :ref:`KindDispatcher ` .. _function-imgui_boost_runtime_register_widget_indexed_string_string_string_function_ls_k_c_int_c_void_q__gr__TypeInfo_const_q__int: .. das:function:: register_widget_indexed(module_name: string; bare_ident: string; kind: string; addr_getter: function<(k:int):void?>; ti: TypeInfo const?; k: int) Int-indexed sibling of ``register_widget``. ``addr_getter(k)`` re-resolves per-call against the user's ``table`` (slots may be erased between frames); ``ti`` is the element's ``TypeInfo``. ``k`` is the table key, stored once at registration. :Arguments: * **module_name** : string * **bare_ident** : string * **kind** : string * **addr_getter** : function<(k:int):void?> * **ti** : :ref:`TypeInfo `? * **k** : int .. _function-imgui_boost_runtime_register_widget_str_string_string_string_function_ls_k_c_string_c_void_q__gr__TypeInfo_const_q__string: .. das:function:: register_widget_str(module_name: string; bare_ident: string; kind: string; addr_getter: function<(k:string):void?>; ti: TypeInfo const?; k: string) String-keyed sibling of ``register_widget_indexed`` for ``table``. Sets ``has_str_key`` so the lookup routes through ``addr_getter_str(k_str)``. :Arguments: * **module_name** : string * **bare_ident** : string * **kind** : string * **addr_getter** : function<(k:string):void?> * **ti** : :ref:`TypeInfo `? * **k** : string .. _function-imgui_boost_runtime_widget_prelude_string: .. das:function:: widget_prelude(widget_ident: string) Top-of-body helper for ``[widget]`` macros: ``PushID(widget_ident)`` and apply any pending :ref:`imgui_focus ` request. :Arguments: * **widget_ident** : string .. _function-imgui_boost_runtime_widget_rect_string: .. das:function:: widget_rect(target: string) : tuple Resolve a target string (path or ``0x...`` hex_id) to its last-known bbox ``(x0,y0,x1,y1)``; returns ``(false, float4(0))`` on miss. :Arguments: * **target** : string .. _function-imgui_boost_runtime_widget_registered_string: .. das:function:: widget_registered(path: string) : bool Idempotency probe used by indexed-form wrappers — true when ``path`` is already in ``g_widgets``. :Arguments: * **path** : string .. _function-imgui_boost_runtime_with_state_string_type_ls_autoT_const_gr__block_ls_var_s_c_T_ref__c_void_gr__0x420: .. das:function:: with_state(path: string; t: type; blk: block<(var s:T&):void>) : auto Safe dispatcher-side helper for ``[widget]`` finalize lambdas — resolves the live state-struct address at ``path`` and invokes ``blk`` with a mutable reference to the state. No-op when the slot is gone (erased indexed key). The block body looks like a plain ``state.field = ...`` mutation; the ``unsafe`` / ``reinterpret`` cast is hidden in this helper. :Arguments: * **path** : string * **t** : auto(T) * **blk** : block<(s:T\ &):void> ++++++++++++++ Path machinery ++++++++++++++ * :ref:`active_widget_path () : string ` * :ref:`container_path_key () : string ` * :ref:`container_path_pop () ` * :ref:`container_path_push (widget_ident: string) ` * :ref:`widget_path_key (widget_ident: string) : string ` .. _function-imgui_boost_runtime_active_widget_path: .. das:function:: active_widget_path() : string Path of the currently active/focused boost-wrapped widget, or ``""`` when none. .. _function-imgui_boost_runtime_container_path_key: .. das:function:: container_path_key() : string Registry/dispatcher key for the currently-open container's own entry. .. _function-imgui_boost_runtime_container_path_pop: .. das:function:: container_path_pop() Pop the tail container ident off the open-container chain; idempotent on empty. .. _function-imgui_boost_runtime_container_path_push_string: .. das:function:: container_path_push(widget_ident: string) Append ``widget_ident`` to the open-container chain; emitted by the ``[container]`` macro prelude. :Arguments: * **widget_ident** : string .. _function-imgui_boost_runtime_widget_path_key_string: .. das:function:: widget_path_key(widget_ident: string) : string Build a leaf widget's registry key: open container chain (``"/"``-joined) + ``widget_ident``; bare ident when unnested. :Arguments: * **widget_ident** : string ++++++++++ Coroutines ++++++++++ * :ref:`advance_coroutines () ` * :ref:`spawn_coroutine (var c: Coroutine) ` .. _function-imgui_boost_runtime_advance_coroutines: .. das:function:: advance_coroutines() Step every active L1 input coroutine one frame; finished coroutines drop out. ``harness_begin_frame`` calls this automatically — demo code should not call it directly. Exposed for the rare host that doesn't use the harness; in that case must run between ``ImGui_ImplGlfw_NewFrame()`` and ``NewFrame()`` so synthetic events aren't clobbered by the GLFW backend. .. _function-imgui_boost_runtime_spawn_coroutine_Coroutine: .. das:function:: spawn_coroutine(c: Coroutine) Schedule an L1 input coroutine (one event per frame); :ref:`advance_coroutines ` drains it. :Arguments: * **c** : :ref:`Coroutine ` ++++++++++++++ Window control ++++++++++++++ * :ref:`imgui_dock (input: JsonValue?) : JsonValue? ` * :ref:`imgui_dock_reset (input: JsonValue?) : JsonValue? ` * :ref:`imgui_raise (input: JsonValue?) : JsonValue? ` * :ref:`imgui_set_window_pos (input: JsonValue?) : JsonValue? ` * :ref:`imgui_set_window_size (input: JsonValue?) : JsonValue? ` * :ref:`imgui_undock (input: JsonValue?) : JsonValue? ` .. _function-imgui_boost_runtime_imgui_dock_JsonValue_q_: .. das:function:: imgui_dock(input: JsonValue?) : JsonValue? Live-command: re-dock the dock_window named by ``input["target"]`` into the dock node id supplied in ``input["value"]`` (a ``uint`` from a ``DockBuilder*`` call). Routes through SetNextWindowDockID on the next frame. :Arguments: * **input** : :ref:`JsonValue `? .. _function-imgui_boost_runtime_imgui_dock_reset_JsonValue_q_: .. das:function:: imgui_dock_reset(input: JsonValue?) : JsonValue? Live-command: reset the dockspace named by ``input["target"]`` — clears the DockBuilder node tree and flips ``state.has_initial_layout`` back to false so the user's setup function re-runs on the next frame. :Arguments: * **input** : :ref:`JsonValue `? .. _function-imgui_boost_runtime_imgui_raise_JsonValue_q_: .. das:function:: imgui_raise(input: JsonValue?) : JsonValue? Live-command: bring the dock_window named by ``input["target"]`` to the front of its dock node — when several windows are docked into one node (so they render as a tab strip), this selects that window's tab. Routes through SetNextWindowFocus() on the next frame. The automation counterpart of clicking a tab; ``imgui_click`` can't reach a dock node's internal tab bar. :Arguments: * **input** : :ref:`JsonValue `? .. _function-imgui_boost_runtime_imgui_set_window_pos_JsonValue_q_: .. das:function:: imgui_set_window_pos(input: JsonValue?) : JsonValue? Live-command: reposition the dock_window named by ``input["target"]``. ``value`` is a JSON object with required ``x``/``y`` and optional ``w``/``h``. Routes through SetNextWindowPos / SetNextWindowSize on the next frame; useful for placing a window after ``imgui_undock`` (the floating-window default location is implementation-defined) or for scripted layouts. :Arguments: * **input** : :ref:`JsonValue `? .. _function-imgui_boost_runtime_imgui_set_window_size_JsonValue_q_: .. das:function:: imgui_set_window_size(input: JsonValue?) : JsonValue? Live-command: resize the window named by ``input["target"]`` to (``w``, ``h``). Routes through SetNextWindowSize on the next frame via the regular-window dispatcher's ``pending_size`` rail. Used by the ``window_size_constraints`` recording driver to demonstrate the SetNextWindowSizeConstraints callbacks (snap/aspect/quantize) without needing a real border-drag synth. :Arguments: * **input** : :ref:`JsonValue `? .. _function-imgui_boost_runtime_imgui_undock_JsonValue_q_: .. das:function:: imgui_undock(input: JsonValue?) : JsonValue? Live-command: undock the dock_window named by ``input["target"]``; the window becomes free-floating. Routes through SetNextWindowDockID(0) on the next frame. :Arguments: * **input** : :ref:`JsonValue `? +++++++++++++ Live commands +++++++++++++ * :ref:`imgui_await (input: JsonValue?) : JsonValue? ` * :ref:`imgui_click (input: JsonValue?) : JsonValue? ` * :ref:`imgui_close (input: JsonValue?) : JsonValue? ` * :ref:`imgui_focus (input: JsonValue?) : JsonValue? ` * :ref:`imgui_force_set (input: JsonValue?) : JsonValue? ` * :ref:`imgui_key_char (input: JsonValue?) : JsonValue? ` * :ref:`imgui_key_press (input: JsonValue?) : JsonValue? ` * :ref:`imgui_key_release (input: JsonValue?) : JsonValue? ` * :ref:`imgui_mouse_click (input: JsonValue?) : JsonValue? ` * :ref:`imgui_mouse_pos (input: JsonValue?) : JsonValue? ` * :ref:`imgui_mouse_scroll (input: JsonValue?) : JsonValue? ` * :ref:`imgui_open (input: JsonValue?) : JsonValue? ` * :ref:`imgui_select (input: JsonValue?) : JsonValue? ` * :ref:`imgui_snapshot (_input: JsonValue?) : JsonValue? ` .. _function-imgui_boost_runtime_imgui_await_JsonValue_q_: .. das:function:: imgui_await(input: JsonValue?) : JsonValue? Live-command: poll quiescence. Returns ``{quiescent, frame, pending_coroutines, active_id}`` — clients drive the wait loop client-side (the server runs on the GLFW thread). :Arguments: * **input** : :ref:`JsonValue `? .. _function-imgui_boost_runtime_imgui_click_JsonValue_q_: .. das:function:: imgui_click(input: JsonValue?) : JsonValue? Live-command: a real synthetic mouse click on ``input["target"]`` (path or ``0x...`` hex_id; optional ``input["button"]`` — 0 left / 1 right / 2 middle). Presses/releases through ImGui's own input path, so the widget behaves exactly as under a real click. For an exact value, use ``imgui_force_set``. :Arguments: * **input** : :ref:`JsonValue `? .. _function-imgui_boost_runtime_imgui_close_JsonValue_q_: .. das:function:: imgui_close(input: JsonValue?) : JsonValue? Live-command: close the container named by ``input["target"]`` (window/popup/tree_node/collapsing_header/tab_item). :Arguments: * **input** : :ref:`JsonValue `? .. _function-imgui_boost_runtime_imgui_focus_JsonValue_q_: .. das:function:: imgui_focus(input: JsonValue?) : JsonValue? Live-command: force keyboard focus onto ``input["target"]``; the widget's path must have been tagged via :ref:`register_focusable `. :Arguments: * **input** : :ref:`JsonValue `? .. _function-imgui_boost_runtime_imgui_force_set_JsonValue_q_: .. das:function:: imgui_force_set(input: JsonValue?) : JsonValue? Live-command: force the next-frame value of ``input["target"]`` to ``input["value"]``. A BYPASS — writes state directly, doing what a user couldn't (exact value, off-screen or inactive widget). For a faithful interaction prefer ``imgui_click`` / ``imgui_key_type``; use this only when the value is the goal. :Arguments: * **input** : :ref:`JsonValue `? .. _function-imgui_boost_runtime_imgui_key_char_JsonValue_q_: .. das:function:: imgui_key_char(input: JsonValue?) : JsonValue? Live-command: push a synthetic Unicode character to the focused widget. :Arguments: * **input** : :ref:`JsonValue `? .. _function-imgui_boost_runtime_imgui_key_press_JsonValue_q_: .. das:function:: imgui_key_press(input: JsonValue?) : JsonValue? Live-command: press a synth key (ImGuiKey int); auto-pairs the mod alias. :Arguments: * **input** : :ref:`JsonValue `? .. _function-imgui_boost_runtime_imgui_key_release_JsonValue_q_: .. das:function:: imgui_key_release(input: JsonValue?) : JsonValue? Live-command: release a synth key (ImGuiKey int). :Arguments: * **input** : :ref:`JsonValue `? .. _function-imgui_boost_runtime_imgui_mouse_click_JsonValue_q_: .. das:function:: imgui_mouse_click(input: JsonValue?) : JsonValue? Live-command: press/release a synth mouse button at the current synth cursor. :Arguments: * **input** : :ref:`JsonValue `? .. _function-imgui_boost_runtime_imgui_mouse_pos_JsonValue_q_: .. das:function:: imgui_mouse_pos(input: JsonValue?) : JsonValue? Live-command: teleport the synth cursor to ``(x, y)`` and take ownership. :Arguments: * **input** : :ref:`JsonValue `? .. _function-imgui_boost_runtime_imgui_mouse_scroll_JsonValue_q_: .. das:function:: imgui_mouse_scroll(input: JsonValue?) : JsonValue? Live-command: synthetic mouse wheel. :Arguments: * **input** : :ref:`JsonValue `? .. _function-imgui_boost_runtime_imgui_open_JsonValue_q_: .. das:function:: imgui_open(input: JsonValue?) : JsonValue? Live-command: open the container named by ``input["target"]`` (window/popup/tree_node/collapsing_header/tab_item). :Arguments: * **input** : :ref:`JsonValue `? .. _function-imgui_boost_runtime_imgui_select_JsonValue_q_: .. das:function:: imgui_select(input: JsonValue?) : JsonValue? Live-command: activate the ``tab_item`` named by ``input["target"]`` — the automation counterpart of clicking a tab (ImGui owns active-tab selection, so an inactive tab can't be reached by ``imgui_click``). Routes through ImGuiTabItemFlags.SetSelected next frame; sets ``state.selected = true``. :Arguments: * **input** : :ref:`JsonValue `? .. _function-imgui_boost_runtime_imgui_snapshot_JsonValue_q_: .. das:function:: imgui_snapshot(_input: JsonValue?) : JsonValue? Live-command: return ``{frame, globals, io}`` — every registered widget joined with its per-frame entry when rendered. :Arguments: * **_input** : :ref:`JsonValue `? +++++++++++++++ Synthetic input +++++++++++++++ * :ref:`get_synth_cursor () : tuple\ ` * :ref:`get_synth_keys () : tuple\ ` * :ref:`imgui_synth_tick () ` * :ref:`register_real_input_toggle (hook: function\<(enabled:bool):void\>) ` * :ref:`register_synth_frame_hook (name: string; hook: function\<():void\>) ` * :ref:`register_synth_stop_hook (name: string; hook: function\<():void\>) ` * :ref:`release_held_buttons () ` * :ref:`release_held_keys () ` * :ref:`set_user_control (input: JsonValue?) : JsonValue? ` * :ref:`set_user_control_enabled (enabled: bool) ` * :ref:`synth_char (codepoint: uint) ` * :ref:`synth_key_press (key: int) ` * :ref:`synth_key_release (key: int) ` * :ref:`synth_mouse_button (button: int; action: int) ` * :ref:`synth_mouse_move (x: float; y: float) ` * :ref:`synth_mouse_wheel (dx: float; dy: float) ` * :ref:`user_control_enabled () : bool ` .. _function-imgui_boost_runtime_get_synth_cursor: .. das:function:: get_synth_cursor() : tuple Current synth cursor as ``(owned, x, y)``; ``owned`` means overlays should render against this instead of ``GetMousePos()``. .. _function-imgui_boost_runtime_get_synth_keys: .. das:function:: get_synth_keys() : tuple Synth-key state as ``(any_held, last_codepoint, last_codepoint_t)``. .. _function-imgui_boost_runtime_imgui_synth_tick: .. das:function:: imgui_synth_tick() Per-frame synth entry point — call between the backend's ``*_NewFrame()`` and ``ImGui::NewFrame()``. Detaches/reattaches real input on a user-control transition, advances registered timelines, and re-asserts held synth state (idempotent — ImGui dedupes same-state events). No-op when nothing is armed. ``harness_new_frame`` calls this for you. .. _function-imgui_boost_runtime_register_real_input_toggle_function_ls_enabled_c_bool_c_void_gr_: .. das:function:: register_real_input_toggle(hook: function<(enabled:bool):void>) Register the backend's real-input enable/disable callback. :ref:`imgui_synth_tick ` invokes it on a ``set_user_control`` transition (the GLFW backend wires ``imgui_set_real_input_callbacks``). :Arguments: * **hook** : function<(enabled:bool):void> .. _function-imgui_boost_runtime_register_synth_frame_hook_string_function_ls__c_void_gr_: .. das:function:: register_synth_frame_hook(name: string; hook: function<():void>) Register a per-frame synth callback invoked by :ref:`imgui_synth_tick ` (imgui_live_core's timeline playback uses this). :Arguments: * **name** : string * **hook** : function .. _function-imgui_boost_runtime_register_synth_stop_hook_string_function_ls__c_void_gr_: .. das:function:: register_synth_stop_hook(name: string; hook: function<():void>) Register a callback invoked when control is handed back to the user (``set_user_control(true)``) — stop in-flight playback. :Arguments: * **name** : string * **hook** : function .. _function-imgui_boost_runtime_release_held_buttons: .. das:function:: release_held_buttons() Release every currently-held synth mouse button. .. _function-imgui_boost_runtime_release_held_keys: .. das:function:: release_held_keys() Release every currently-held synth key. .. _function-imgui_boost_runtime_set_user_control_JsonValue_q_: .. das:function:: set_user_control(input: JsonValue?) : JsonValue? Live-command: enable/disable real mouse+keyboard reaching the UI. :Arguments: * **input** : :ref:`JsonValue `? .. _function-imgui_boost_runtime_set_user_control_enabled_bool: .. das:function:: set_user_control_enabled(enabled: bool) Toggle whether real mouse/keyboard reach the UI. The GLFW-callback detach/reattach happens on the next ``imgui_synth_tick`` (must run on the render thread), so this is safe to call off-thread. :Arguments: * **enabled** : bool .. _function-imgui_boost_runtime_synth_char_uint: .. das:function:: synth_char(codepoint: uint) Push a synthetic Unicode character to the focused widget. :Arguments: * **codepoint** : uint .. _function-imgui_boost_runtime_synth_key_press_int: .. das:function:: synth_key_press(key: int) Press synth ``key`` (ImGuiKey int); auto-pairs the ``ImGuiMod_*`` alias for side-mod keys so ``Shortcut()`` routing sees the chord. :Arguments: * **key** : int .. _function-imgui_boost_runtime_synth_key_release_int: .. das:function:: synth_key_release(key: int) Release synth ``key`` (and its mod alias). :Arguments: * **key** : int .. _function-imgui_boost_runtime_synth_mouse_button_int_int: .. das:function:: synth_mouse_button(button: int; action: int) Press (``action==1``) / release synth mouse ``button``. Emits the cursor pos immediately before the button so ImGui records ``MouseClickedPos`` at the synth coords and ``IsItemHovered()`` passes. :Arguments: * **button** : int * **action** : int .. _function-imgui_boost_runtime_synth_mouse_move_float_float: .. das:function:: synth_mouse_move(x: float; y: float) Teleport the synth cursor to ``(x, y)`` and take ownership (the real cursor can't move it until ``set_user_control(true)`` hands back). :Arguments: * **x** : float * **y** : float .. _function-imgui_boost_runtime_synth_mouse_wheel_float_float: .. das:function:: synth_mouse_wheel(dx: float; dy: float) Synthetic mouse wheel; takes cursor ownership. :Arguments: * **dx** : float * **dy** : float .. _function-imgui_boost_runtime_user_control_enabled: .. das:function:: user_control_enabled() : bool False when ``set_user_control`` has disabled real input — :ref:`imgui_synth_tick ` drops the backend input queue each frame so synth fully owns IO. +++++++++++++ Debug logging +++++++++++++ * :ref:`imgui_log_drain (_input: JsonValue?) : JsonValue? ` * :ref:`imgui_log_section (input: JsonValue?) : JsonValue? ` * :ref:`log_section (name: string; on: bool) ` * :ref:`log_section_on (name: string) : bool ` .. _function-imgui_boost_runtime_imgui_log_drain_JsonValue_q_: .. das:function:: imgui_log_drain(_input: JsonValue?) : JsonValue? Live-command: return the host-side instrumentation lines accumulated since the last drain (a JSON array of strings) and clear the buffer. The transport-readable companion to the stdout emit — a test or MCP client reads the dispatch/coroutine trace from the response. :Arguments: * **_input** : :ref:`JsonValue `? .. _function-imgui_boost_runtime_imgui_log_section_JsonValue_q_: .. das:function:: imgui_log_section(input: JsonValue?) : JsonValue? Live-command: enable/disable host-side debug log section ``input["name"]`` per ``input["on"]``. Gated emit sites cost one set-lookup when off, so heavy per-frame logging is free until enabled. Runs in the host context, so it reaches dispatch/coroutine instrumentation a test's context can't. :Arguments: * **input** : :ref:`JsonValue `? .. _function-imgui_boost_runtime_log_section_string_bool: .. das:function:: log_section(name: string; on: bool) Enable/disable a debug log section. Sections are checked by log_section_on; gated emit sites cost one set-lookup when off, so heavy per-frame logging is free until a section is turned on. :Arguments: * **name** : string * **on** : bool .. _function-imgui_boost_runtime_log_section_on_string: .. das:function:: log_section_on(name: string) : bool True if debug log section ``name`` is enabled. Guard heavy per-frame emit: ``if (log_section_on("x")) clk_log(...)``. :Arguments: * **name** : string ++++++++++++++++ Memory debugging ++++++++++++++++ * :ref:`imgui_debug_memory (enabled: bool) ` * :ref:`imgui_memory_report () ` * :ref:`imgui_reset_memory_baseline () ` .. _function-imgui_boost_runtime_imgui_debug_memory_bool: .. das:function:: imgui_debug_memory(enabled: bool) Toggle per-frame heap / string-heap GC-pressure logging. Enabling (re)sets the baseline, so a steadily-growing heap surfaces as the per-frame ``+delta`` climbing instead of flat. :Arguments: * **enabled** : bool .. _function-imgui_boost_runtime_imgui_memory_report: .. das:function:: imgui_memory_report() Emit a final heap / string-heap delta-vs-baseline line, plus a WARNING if either grew past 64kb (a steady per-frame leak / GC-pressure smell). Called at teardown by with_imgui_app / with_recording_app; safe to call by hand. No-op until a baseline has been taken. .. _function-imgui_boost_runtime_imgui_reset_memory_baseline: .. das:function:: imgui_reset_memory_baseline() Snapshot current heap + string-heap usage as the leak-tracking baseline. Call after one-time setup (window/fonts/first frame) so only steady-state growth is measured. ++++++++++++++++++ Snapshot transform ++++++++++++++++++ * :ref:`capture_current_item_rect () : float4 ` * :ref:`capture_item_bbox (var entry: WidgetEntry; local: float4) ` * :ref:`pop_snapshot_item_transform () ` * :ref:`push_snapshot_item_transform (scale: float2; offset: float2) ` .. _function-imgui_boost_runtime_capture_current_item_rect: .. das:function:: capture_current_item_rect() : float4 The just-submitted ImGui item's screen-space rect [x0,y0,x1,y1], mapped through the active item-transform (identity in the common case). For popup/list items NOT separately registered (combo popup items): capture one rect per item after its Selectable to build sub_bboxes. .. _function-imgui_boost_runtime_capture_item_bbox_WidgetEntry_float4: .. das:function:: capture_item_bbox(entry: WidgetEntry; local: float4) Record a captured imgui item rect into `entry`: `bbox` screen-mapped via the active item-transform, plus `canvas_bbox` (local rect) when the transform moved it. Single capture chokepoint for leaf widgets and container headers. The (0,0,0,0) sentinel (headerless container) is left untouched — no phantom rect at the transform offset. :Arguments: * **entry** : :ref:`WidgetEntry ` * **local** : float4 .. _function-imgui_boost_runtime_pop_snapshot_item_transform: .. das:function:: pop_snapshot_item_transform() Pop the innermost item-transform pushed by `push_snapshot_item_transform`, restoring the enclosing canvas's mapping (or identity at the outermost level). .. _function-imgui_boost_runtime_push_snapshot_item_transform_float2_float2: .. das:function:: push_snapshot_item_transform(scale: float2; offset: float2) Push a `screen = local * scale + offset` mapping applied to every widget's captured item rect until the matching `pop_snapshot_item_transform()`. A canvas (e.g. `node_editor`) pushes this so interior widgets report screen-space `bbox` plus a `canvas_bbox` with the local rect. Nestable. :Arguments: * **scale** : float2 * **offset** : float2 ++++++++++++++++++ JSON serialization ++++++++++++++++++ * :ref:`JV (r: $Result(type\,type\)) : JsonValue? ` * :ref:`JV (value: TextFilterState) : JsonValue? ` * :ref:`serialize (var arch: Archive; var value: TextFilterState) ` * :ref:`state_jv (path: string; t: type\) : JsonValue? ` JV ^^ .. _function-imgui_boost_runtime_JV__builtin_Resulttype_ls_autoTT_gr_,type_ls_autoEE_gr_: .. das:function:: JV(r: $Result(type,type)) : JsonValue? Wire format for ``Result``: ``{"ok": bool, "value"|"error": ...}``; the transport contract every ``imgui_*`` handler returns. :Arguments: * **r** : typemacro .. _function-imgui_boost_runtime_JV_TextFilterState: .. das:function:: JV(value: TextFilterState) : JsonValue? ---- .. _function-imgui_boost_runtime_serialize_Archive_TextFilterState: .. das:function:: serialize(arch: Archive; value: TextFilterState) def serialize (var arch: Archive; var value: TextFilterState) :Arguments: * **arch** : :ref:`Archive ` * **value** : :ref:`TextFilterState ` .. _function-imgui_boost_runtime_state_jv_string_type_ls_autoT_const_gr__0x417: .. das:function:: state_jv(path: string; t: type) : JsonValue? Safe serializer-side helper for ``[widget]`` finalize lambdas — resolves the live state-struct address at ``path`` and returns ``JV(state)``. Returns ``null`` when the slot is gone (erased indexed key) so the snapshot reports the widget without a payload instead of dereferencing a stale capture. Pair with ``with_state`` on the dispatcher side; together they let custom-widget finalize helpers stay free of ``unsafe`` / ``reinterpret``. :Arguments: * **path** : string * **t** : auto(T)