sco.widgets
Methods and entrypoints for sco.widgets.
sco_widgets_v1
Section titled “sco_widgets_v1”Renderer-neutral retained panels, host-owned service 1.3. Source: include/sco_widgets.h,
src/widgets/widgets.cpp; design: widgets. This does not change
the frozen sco_api ABI or the legacy sco.ui draw-context/hotkey route. Limits:
64 panels, 256 nodes/panel, 4096 live nodes, 256 items/node, 16 table columns.
Strings are copied UTF-8, plain text; callbacks and context are borrowed. All
methods/events are game-thread only. Events update retained state then dispatch
under the owner guard; replacing/removing a panel invalidates pending generations.
C is direct; C++ has scosdk/widgets.hpp; Lua has bounded sco.widgets tables
and registry-rooted typed callbacks. C# provides bounded typed nodes/events and
rooted callbacks. C#/Lua retain the 1.0 input route and guard optional presentation
features through the version and capability checks described below.
The optional ImGui adapter is host-only; plugins never include it.
1.1 appends update_nodes, remove_nodes and capabilities (table 24 -> 48 bytes) and
adds opt-in sco_widget_node_1_1 (104 bytes: tooltip, severity, LIST/TABLE paging) and
sco_widget_event_1_1 (40 bytes: row). The 80-byte node and 32-byte event are unchanged, so
1.0 strides and size checks stay valid; a node below 104 bytes is a 1.0 node. Panels that
hold a 1.1 node receive 1.1 events, including SCO_WIDGET_EVENT_PAGE; other panels keep
32-byte events. Render snapshots are rebuilt at most once per panel render pass, after a
change. C++20, C# and Lua expose the guarded sco.widgets 1.1 tail routes. C#/Lua negotiate optional 1.1/1.2/1.3 presentation fields and refuse unsupported semantics; copied events expose row/PAGE after checking the extended event extent. Pins: tests/abi_widgets.c; host tests:
tests/test_widgets11.cpp.
1.2 adds a node extension, not a table member: sco_widget_node_1_2 is 128 bytes,
with const char* tag at offset 104 and zero reserved words at offset 112.
The host copies panel-unique ASCII tags matching [A-Za-z0-9._-]{1..63}.
Check the complete capabilities member and SCO_WIDGETS_FEATURE_STABLE_TAGS
before relying on tags. The table remains 48 bytes; 80/104-byte nodes stay valid.
C# and Lua support tags through their typed routes when the provider advertises them.
1.3 adds sco_widget_node_1_3 (144 bytes) with numeric presentation for
NUMBER, INTEGER and INTEGER_PERCENT. Integer values and bounds must be integral
and within the signed 32-bit range. Check the complete capabilities member and
SCO_WIDGETS_FEATURE_NUMERIC_PRESENTATION before submitting the 1.3 tail.
The table stays 48 bytes and earlier node sizes remain valid. C++, C# and Lua
provide guarded submission paths; integer slider rendering rounds ties away from
zero and clamps to the declared bounds. Headless tests do not prove GPU rendering.