Skip to content

aowlspt_ui.h

Source: abi/aowlspt_ui.h — 812 lines, 50 file-scope functions.

What this header owns

Reproduced verbatim from the header's own banner comment — these notes are frequently the only written record of why the subsystem is shaped the way it is.

text
 aowlspt_ui.h -- the BACKEND-AGNOSTIC, RETAINED-MODE widget core.

This header is the SHARED CORE the unified UI framework is built on. It is
deliberately POINTER-FREE of any game type and touches neither IL2CPP nor
D3D: it is pure arithmetic and pure state, so every line here is offline-
testable and none of it can fault the client. The two backends live ABOVE
it:

  * OVERLAY (bkOverlay) -- our own D3D11 pixels via `aowl_region_*`
    (aowlspt_region.h). A retained widget tree is walked ONCE PER FRAME by
    `aowl_ui_overlay_emit`, which turns each widget into FILL/BOX/TEXT draw
    ops; the host's region DRAW callback replays those ops through
    `aowl_region_fill/box/text`. Immediate-mode rasteriser, retained-mode
    model.

  * NATIVE (bkNative) -- real Tarkov GameObjects via nativeui.nim
    (fact #225). The Nim surface owns the il2cpp construction; this core
    only holds the widget record, its computed rect, and its state, and
    stores the opaque native handles the Nim side fills in.

THE UNIFICATION. `uiPanel/uiLabel/uiToggle/uiButton/uiTabStrip/uiRow` build
the SAME widget records regardless of backend; the `backend` field on each
record decides how it is realised. Layout, the tab-selection state machine,
hit-testing and config binding are computed here, ONCE, above the split --
which is most of the value and all of the offline-testable surface.

SAFETY. Fixed-size tables, capped iteration, no allocation, every index
bounds-checked, every builder returns a handle or a NAMED refusal code
(never a silent -1). Three outcomes: a widget is BUILT, REFUSED (with a
reason), or INCONCLUSIVE (its backend could not prove it -- e.g. native
Image). A check that cannot fail is the bug (CLAUDE.md 9b), so the hit-test
and layout predicates are written to be falsifiable and the test suite feeds
them wrong values on purpose.

Constants

  • AOWLSPT_UI_H

Functions

SignatureLine
char aowl_ui_refusal_text(int32_t code)104
int32_t aowl_ui_finite(float v)219
int32_t aowl_ui_rect_ok(float x, float y, float w, float h)223
int32_t aowl_ui_handle_at(int32_t index)249
int32_t aowl_ui_handle_check(int32_t h, int32_t* outIndex)258
int32_t aowl_ui_index_of(int32_t h)283
int32_t aowl_ui_last_handle_refusal(void)289
int32_t aowl_ui_handle_faults(void)290
int32_t aowl_ui_disabled(void)291
void aowl_ui_reset(void)293
int32_t aowl_ui_begin(int32_t backend)310
int32_t aowl_ui_valid(int32_t h)317
AowlUiWidget aowl_ui_at(int32_t h)321
int32_t aowl_ui_new(int32_t kind, int32_t parent, float x, float y, float w, float h)328
void aowl_ui_set_text(int32_t h, const char* s)365
void aowl_ui_set_colors(int32_t h, uint32_t col, uint32_t accent)371
void aowl_ui_set_interactive(int32_t h, int32_t on)376
void aowl_ui_set_visible(int32_t h, int32_t on)380
void aowl_ui_set_native(int32_t h, uint64_t go, uint64_t rt, uint64_t comp, uint64_t tmp)384
void aowl_ui_set_refusal(int32_t h, int32_t code)391
int32_t aowl_ui_stack_slot(float cx, float cy, float cw, float ch, int32_t index, int32_t count, float pad, float spacing, int32_t horizontal, float* ox, float* oy, float* ow, float* oh)405
int32_t aowl_ui_row_split(float rx, float ry, float rw, float rh, float labelFrac, float gap, float* lx, float* ly, float* lw, float* lh, float* kx, float* ky, float* kw, float* kh)432
int32_t aowl_ui_tab_add(int32_t strip, int32_t contentHandle)452
int32_t aowl_ui_tab_apply(int32_t strip)466
int32_t aowl_ui_tab_select(int32_t strip, int32_t idx)479
int32_t aowl_ui_tab_selected(int32_t strip)486
int32_t aowl_ui_tab_content_active(int32_t strip, int32_t contentHandle)492
int32_t aowl_ui_tab_hit(int32_t strip, float px)500
void aowl_ui_bind_join(const char* modGuid, const char* key, char* out, int32_t cap)517
int32_t aowl_ui_bind_intern(const char* modGuid, const char* key, int32_t type)531
int32_t aowl_ui_bind_widget(int32_t h, const char* modGuid, const char* key, int32_t type)561
int32_t aowl_ui_bind_valid(int32_t b)573
double aowl_ui_bind_get(int32_t b)576
void aowl_ui_bind_set(int32_t b, double v)579
int32_t aowl_ui_bind_dirty(int32_t b)586
void aowl_ui_bind_clear_dirty(int32_t b)589
int32_t aowl_ui_bind_dirty_count(void)592
int32_t aowl_ui_point_in(const AowlUiWidget* p, float px, float py)611
void aowl_ui_set_rect(int32_t h, float x, float y, float w, float hh)618
int32_t aowl_ui_pump(float px, float py, int32_t down)627
int32_t aowl_ui_take_click(int32_t h)659
int32_t aowl_ui_toggle_state(int32_t h)667
void aowl_ui_toggle_force(int32_t h, int32_t on)672
void aowl_ui_op(int32_t op, float x, float y, float w, float h, float thickness, uint32_t col, const char* text)691
int32_t aowl_ui_overlay_emit(void)703
int32_t aowl_ui_op_count(void)768
AowlUiDrawOp aowl_ui_op_at(int32_t i)769
int32_t aowl_ui_count(void)772
int32_t aowl_ui_backend(void)773
int32_t aowl_ui_overlay_replay(AowlUiFillFn fill, AowlUiBoxFn box, AowlUiTextFn text)789

aoughwl — self-hosted platform for things n stuff. Contact / Support on Discord for access to the private backends.