Skip to main content

Module call

Module call 

Source
Expand description

The graphics call executor: one service behind every way a program reaches the UI.

A caller names a call by its catalog ID and passes up to MAX_ARGUMENTS words. execute checks the call, takes the graphics lock, resolves object handles through the caller’s State, runs the call on LVGL and writes the result back. Whatever differs between callers is behind Transport: how a pointer, string or buffer word becomes memory. Wasm guests pass offsets into linear memory (LinearMemory); native code passes host pointers.

The executor owns what every caller needs and none should reimplement:

  • the graphics lock, held for exactly one call;
  • the per-process object identity table in State, deleted with the process;
  • the event queue behind window_pop_event;
  • the Xila extension calls (IDs from 0xf000).

The call table (the Function enum and its dispatch) is generated at build time from the same catalog that generates guest bindings.

Structs§

Call
One call. arguments beyond the function’s count are ignored but must be present; count must equal the function’s argument count.
LinearMemory
A flat byte buffer addressed by offset: the transport for Wasm linear memory, and for any caller whose pointers are offsets into one buffer. Offset 0 is null.
State
One process’s graphics identity table and the resources behind it.

Enums§

Error
EventCode
Function
Every call the executor implements, with its catalog ID.

Constants§

EVENT_CLOSE_REQUESTED
Xila window close request, separate from LVGL’s standard events.
MAX_ARGUMENTS
The most argument words one call carries.

Traits§

Transport
Argument memory of one caller.

Functions§

execute
Run one call for the process that owns state, blocking the thread while another holder has the graphics lock. A caller on a cooperative executor takes the lock itself and uses execute_locked.
execute_locked
Run a call after the caller has acquired the graphics lock.

Type Aliases§

Result
Word
One argument word: as wide as the host’s pointers, so a call costs no double-word arithmetic on a 32-bit target. A Wasm guest’s 32-bit or 64-bit word fits, since guests with 64-bit memory only run on 64-bit hosts.