Skip to content

ElmTUI API Reference

Generated from live Common Lisp DOCUMENTATION metadata.

Scope: exported, live bindings in ElmTUI and its CL-EVENTS, CL-STATE, CL-INPUTS, CL-STYLES support packages. Re-exports appear once; each qualified name uses an exporting package.

Coverage: 1695 of 1873 bindings documented; 178 have no metadata (90.5% documented). Missing entries are intentionally shown, not silently omitted.

CL-EVENTS.ASYNC:ALL

Kinds: function

Create a composite asynchronous operation that waits for all supplied promises.

CL-EVENTS.ASYNC:ASYNC-EXEC

Kinds: function

Execute work asynchronously and return a handle to its completion.

CL-EVENTS.ASYNC:ASYNC-RUN

Kinds: function

Run asynchronous work using the asynchronous task machinery.

CL-EVENTS.ASYNC:ASYNC-TASK

Kinds: type

Public async task type used to represent structured terminal events and commands.

CL-EVENTS.ASYNC:ASYNC-TASK-ERROR

Kinds: function

Return the error recorded in the async task representation.

CL-EVENTS.ASYNC:ASYNC-TASK-FINISHED-P

Kinds: function

Return true when the supplied value satisfies the async task finished type predicate.

CL-EVENTS.ASYNC:ASYNC-TASK-PROMISE

Kinds: function

Return the promise recorded in the async task representation.

CL-EVENTS.ASYNC:ASYNC-TASK-RESULT

Kinds: function

Return the result recorded in the async task representation.

CL-EVENTS.ASYNC:ASYNC-TASK-STATUS

Kinds: function

Return the status recorded in the async task representation.

CL-EVENTS.ASYNC:AWAIT

Kinds: function

Wait for the supplied asynchronous promise and obtain its completed outcome.

CL-EVENTS.ASYNC:CANCEL

Kinds: function

Request cancellation of asynchronous work through its supported cancellation protocol.

CL-EVENTS.ASYNC:CHAIN

Kinds: function

Sequence asynchronous computations so the next operation receives the prior outcome.

CL-EVENTS.ASYNC:FUTURE

Kinds: function

Schedule computation and obtain a future handle for its eventual outcome.

CL-EVENTS.ASYNC:MAKE-PROMISE

Kinds: function

Allocate a pending promise for a value or condition delivered later.

CL-EVENTS.ASYNC:MAKE-TASK-SCOPE

Kinds: function

Create an OPEN structured task scope, optionally owned by PARENT.

CL-EVENTS.ASYNC:NEW-TASK

Kinds: function

Allocate a task record for asynchronous work before scheduling it.

CL-EVENTS.ASYNC:PROMISE

Kinds: type

Public promise type used to represent structured terminal events and commands.

CL-EVENTS.ASYNC:PROMISE-CANCEL

Kinds: function

Request cancellation of the given asynchronous promise.

CL-EVENTS.ASYNC:PROMISE-CANCELLED

Kinds: function

Return the cancelled recorded in the promise representation.

CL-EVENTS.ASYNC:PROMISE-CANCELLED-P

Kinds: function

Return true when the supplied value satisfies the promise cancelled type predicate.

CL-EVENTS.ASYNC:PROMISE-ERROR

Kinds: function

Return the error recorded in the promise representation.

CL-EVENTS.ASYNC:PROMISE-RESOLVED

Kinds: function

Return the resolved recorded in the promise representation.

CL-EVENTS.ASYNC:PROMISE-STATE

Kinds: function

Return the state recorded in the promise representation.

CL-EVENTS.ASYNC:PROMISE-VALUE

Kinds: function

Return the value recorded in the promise representation.

CL-EVENTS.ASYNC:RACE

Kinds: function

Create a composite asynchronous operation resolved by the first completed child.

CL-EVENTS.ASYNC:REJECT-PROMISE

Kinds: function

Mark a pending promise rejected with the supplied error outcome.

CL-EVENTS.ASYNC:RESOLVE-PROMISE

Kinds: function

Mark a pending promise resolved with the supplied successful value.

CL-EVENTS.ASYNC:SCHEDULE-AFTER

Kinds: function

Schedule a callback to execute after the requested delay.

CL-EVENTS.ASYNC:SCHEDULE-EVERY

Kinds: function

Schedule a recurring callback at the requested interval.

CL-EVENTS.ASYNC:SCOPE-CANCEL

Kinds: function

Cancel SCOPE and every currently owned child scope/task. Idempotent.

CL-EVENTS.ASYNC:SCOPE-JOIN

Kinds: function

Join owned work with one deadline; timeout cancels and reaps remaining workers.

CL-EVENTS.ASYNC:SCOPE-SCHEDULE-AFTER

Kinds: function

Run FUNCTION once after SECONDS as work owned by SCOPE.

CL-EVENTS.ASYNC:SCOPE-SCHEDULE-EVERY

Kinds: function

Run FUNCTION repeatedly every SECONDS until SCOPE is cancelled.

CL-EVENTS.ASYNC:SCOPE-SPAWN

Kinds: function

Register and start one ASYNC-TASK owned by SCOPE.

CL-EVENTS.ASYNC:SPAWN-TASK

Kinds: function

Start a task with the asynchronous executor and return its task handle.

CL-EVENTS.ASYNC:TASK-SCOPE

Kinds: type

Public task scope type used to represent structured terminal events and commands.

CL-EVENTS.ASYNC:TASK-SCOPE-ERROR

Kinds: function

Return the error recorded in the task scope representation.

CL-EVENTS.ASYNC:TASK-SCOPE-STATE

Kinds: function

Return the state recorded in the task scope representation.

CL-EVENTS.BUS:EVENT-BUS

Kinds: type

No documentation metadata.

CL-EVENTS.BUS:EVENT-BUS-METRICS

Kinds: function

Return a lock-consistent snapshot of bus counters and active subscription count.

CL-EVENTS.BUS:MAKE-EVENT-BUS

Kinds: function

Create a bounded event bus. :BLOCK preserves legacy backpressure semantics.

CL-EVENTS.BUS:PUBLISH-EVENT

Kinds: function

Publish EVENT in stable subscription order under the configured delivery policies.

CL-EVENTS.BUS:SUBSCRIBE

Kinds: function

Compatibility API returning only the channel of a new independent subscription.

CL-EVENTS.BUS:SUBSCRIBE-HANDLE

Kinds: function

Create one independent subscription handle. Duplicate topic subscriptions are allowed.

CL-EVENTS.BUS:SUBSCRIPTION

Kinds: type

No documentation metadata.

CL-EVENTS.BUS:SUBSCRIPTION-ACTIVE-P

Kinds: function

No documentation metadata.

CL-EVENTS.BUS:SUBSCRIPTION-CHANNEL

Kinds: function

No documentation metadata.

CL-EVENTS.BUS:SUBSCRIPTION-METRICS

Kinds: function

Return a snapshot without holding the bus lock while acquiring the channel lock.

CL-EVENTS.BUS:SUBSCRIPTION-TOPIC

Kinds: function

No documentation metadata.

CL-EVENTS.BUS:UNSUBSCRIBE

Kinds: function

Compatibility unsubscribe. The removed subscription channel is closed to wake waiters.

CL-EVENTS.BUS:UNSUBSCRIBE-HANDLE

Kinds: function

End HANDLE once, remove it from the bus, and close its owned channel.

CL-EVENTS.BUS:WITH-SUBSCRIPTION

Kinds: macro

No documentation metadata.

CL-EVENTS.CHANNEL:->

Kinds: function

Send ITEM to CH using CHAN-PUT, returning the success flag and status as two values.

CL-EVENTS.CHANNEL:<-

Kinds: function

Take the next item from CH using CHAN-TAKE, returning the item and status as two values.

CL-EVENTS.CHANNEL:CHAN-CLOSE

Kinds: function

Close CH for new sends, preserve pending queue items until drained, and return true plus the channel state.

CL-EVENTS.CHANNEL:CHAN-PUT

Kinds: function

Send ITEM into CH, optionally waiting for capacity with :TIMEOUT and :CANCEL-TOKEN; return success and status.

CL-EVENTS.CHANNEL:CHAN-TAKE

Kinds: function

Receive one queued item from CH, optionally waiting with :TIMEOUT and :CANCEL-TOKEN; return item and status.

CL-EVENTS.CHANNEL:CHANNEL

Kinds: type

Bounded FIFO channel structure with queue, capacity, state, synchronization and select waiters.

CL-EVENTS.CHANNEL:CHANNEL-ADD-FILTER

Kinds: function

Add FILTER to filtered channel CH. FILTER must be callable.

CL-EVENTS.CHANNEL:CHANNEL-LENGTH

Kinds: function

Return the current queue length of CH.

CL-EVENTS.CHANNEL:CHANNEL-PUT!

Kinds: function

Compatibility wrapper around CHAN-PUT for writing ITEM to CH; returns the underlying success and status.

CL-EVENTS.CHANNEL:CHANNEL-REMOVE-FILTER

Kinds: function

Remove FILTER by identity from a FILTERED-CHANNEL's filter list, leaving ordinary channels unchanged.

CL-EVENTS.CHANNEL:CHANNEL-STATE

Kinds: function

Return the channel lifecycle state :OPEN, :CLOSING or :CLOSED; :CLOSING retains items until drained.

CL-EVENTS.CHANNEL:CHANNEL-TAKE!

Kinds: function

Compatibility wrapper around CHAN-TAKE for receiving the next queued value from CH.

CL-EVENTS.CHANNEL:FILTERED-CHANNEL

Kinds: type

Wrapper holding an underlying FIFO channel and a list of predicate filters applied to sends.

CL-EVENTS.CHANNEL:MAILBOX

Kinds: type

Single-slot synchronized mailbox with latest stored item, occupancy flag and lifecycle state.

CL-EVENTS.CHANNEL:MAILBOX-STATE

Kinds: function

Return the mailbox lifecycle state :OPEN, :CLOSING or :CLOSED.

CL-EVENTS.CHANNEL:MAKE-CHANNEL

Kinds: function

Construct a new bounded FIFO channel with integer :CAPACITY greater than zero, defaulting to 256.

CL-EVENTS.CHANNEL:MAKE-FILTERED-CHANNEL

Kinds: function

Construct a channel wrapper using optional :CAPACITY and :FILTERS, copying the supplied filter list.

CL-EVENTS.CHANNEL:MAKE-MAILBOX

Kinds: function

Construct an initially empty single-slot mailbox with its own lock and condition variable.

CL-EVENTS.CHANNEL:MB-CLOSE

Kinds: function

Stop accepting new mailbox writes, permitting a pending slot to be read before final closure.

CL-EVENTS.CHANNEL:MB-EMPTY-P

Kinds: function

Return true if the mailbox has no occupied slot, checking the state under its lock.

CL-EVENTS.CHANNEL:MB-PUT

Kinds: function

Store ITEM in the mailbox's single slot if open, overwriting any previous unread value; return success and status.

CL-EVENTS.CHANNEL:MB-TAKE

Kinds: function

Wait for and consume the mailbox slot, or return :TIMEOUT, :CANCELLED or :CLOSED status when applicable.

CL-EVENTS.CHANNEL:NO-WAIT

Kinds: function

Check immediate send readiness or atomically take an available item when :SEND is false; return value, readiness and status.

CL-EVENTS.CHANNEL:SELECT

Kinds: macro

Select channel operations. Clause order is the deterministic tie breaker.

CL-EVENTS.CHANNEL:TRY-PUT

Kinds: function

Atomically enqueue ITEM without waiting and return success plus status.

CL-EVENTS.DISPATCHER:DISPATCH-EVENT

Kinds: function

No documentation metadata.

CL-EVENTS.DISPATCHER:DISPATCH-MESSAGE-BATCH

Kinds: function

Apply messages in order; return (values new-state commands)

CL-EVENTS.DISPATCHER:EXECUTE-COMMANDS

Kinds: function

Run effects; effects may publish further events.

CL-EVENTS.LIFECYCLE:CANCELLATION-REASON

Kinds: function

Return the cancellation reason recorded on TOKEN.

CL-EVENTS.LIFECYCLE:CANCELLATION-REQUESTED-P

Kinds: function

Return whether TOKEN has been cancelled.

CL-EVENTS.LIFECYCLE:CANCELLATION-TOKEN

Kinds: type

No documentation metadata.

CL-EVENTS.LIFECYCLE:DEADLINE-BUDGET

Kinds: type

No documentation metadata.

CL-EVENTS.LIFECYCLE:DEADLINE-BUDGET-EXPIRED-P

Kinds: function

Return true when BUDGET has a deadline and that deadline has been reached.

CL-EVENTS.LIFECYCLE:DEADLINE-BUDGET-REMAINING-SECONDS

Kinds: function

Return remaining seconds, NIL for an unbounded budget, or zero when expired.

CL-EVENTS.LIFECYCLE:MAKE-CANCELLATION-TOKEN

Kinds: function

Create an independently cancellable lifecycle token.

CL-EVENTS.LIFECYCLE:MAKE-DEADLINE-BUDGET

Kinds: function

Create one monotonic timeout budget. NIL means no deadline.

CL-EVENTS.LIFECYCLE:REQUEST-CANCELLATION

Kinds: function

Cancel TOKEN once, wake its waiters, and return the resulting lifecycle state.
Every listener is notified, even if a preceding listener signals an error.
Re-signal the first callback error after all cleanup listeners have run.

CL-EVENTS.LOOP:+DEFAULT-POLL-INTERVAL-SECONDS+

Kinds: variable

Default cooperative pause between unsuccessful polling probes.

CL-EVENTS.LOOP:+DEFAULT-POLL-TIMEOUT-SECONDS+

Kinds: variable

Default timeout (seconds) for poll-based event loops.

CL-EVENTS.LOOP:APP-CONTEXT

Kinds: type

No documentation metadata.

CL-EVENTS.LOOP:APP-CONTEXT-LOOP-TASK

Kinds: function

No documentation metadata.

CL-EVENTS.LOOP:DEADLINE-EXPIRED-P

Kinds: function

Return true when NOW-FN has reached or passed DEADLINE.

CL-EVENTS.LOOP:DEFAULT-RUNTIME-ERROR-POLICY

Kinds: function

Default runtime error policy; currently always stops the loop.

CL-EVENTS.LOOP:JOIN-APP-LOOP

Kinds: function

Wait for the owned app-loop task and return its value plus lifecycle status.

CL-EVENTS.LOOP:MAKE-APP-CONTEXT

Kinds: function

No documentation metadata.

CL-EVENTS.LOOP:MAKE-JOIN-DEADLINE

Kinds: function

Return an internal-time deadline SECONDS from NOW-FN.

CL-EVENTS.LOOP:POLL-RUNTIME-EVENT

Kinds: function

Poll CHANNELS through WAIT-FN using the shared runtime timeout contract.

WAIT-FN is called as (WAIT-FN CHANNELS :TIMEOUT TIMEOUT) and its multiple values
are returned unchanged.  Implementations that need repeated non-blocking probes
should use POLL-UNTIL rather than introducing an independent sleep/deadline
loop.  This function performs no mutation itself and propagates conditions from
WAIT-FN unchanged.

CL-EVENTS.LOOP:POLL-UNTIL

Kinds: function

Run PROBE-FN until it succeeds, STOP-P requests cancellation, or TIMEOUT expires.

PROBE-FN may return multiple values.  Its first value is the success value; when
that value is non-NIL all values are returned unchanged.  A NIL first value
means that no result is ready yet.

TIMEOUT is measured in seconds.  NIL means wait indefinitely, zero means perform
exactly one probe, and a positive value bounds the total wait.  STOP-P, when
non-NIL, is called before every probe and can end an otherwise unbounded wait.
INTERVAL is the cooperative sleep between unsuccessful probes and must be a
non-negative real.  A finite timeout clamps each sleep to the remaining budget,
and no retry begins after that budget expires.

The optional SLEEP-FN and NOW-FN hooks make timing deterministic in tests.
Polling itself performs no mutation other than whatever PROBE-FN, STOP-P, or the
injected timing functions perform.  Conditions signaled by those functions are
not swallowed; callers can inspect them or establish handlers/restarts.

CL-EVENTS.LOOP:RESOLVE-RUNTIME-ERROR-ACTION

Kinds: function

Resolve POLICY to a concrete runtime error action (:stop or :restart).
POLICY can be a keyword action or a function of ERROR.

CL-EVENTS.LOOP:RUN-APP-LOOP

Kinds: function

No documentation metadata.

CL-EVENTS.LOOP:RUN-CONSUMER-LOOP-SHELL

Kinds: function

Reusable consumer lifecycle shell.
Loops until STOP-P is true or STEP-FN requests stop/restart.
When CHANNELS-FN returns NIL, ON-IDLE is called.
STEP-FN should return an action keyword; :stop and :restart are handled explicitly.

CL-EVENTS.LOOP:RUNTIME-CONSUME-ONCE

Kinds: function

Execute one runtime consume iteration with policy hooks.
Returns one of :stop, :event, :idle, :continue, :restart, or :error.

CL-EVENTS.LOOP:SELECT-PRIMARY-CHANNEL

Kinds: function

Select channel from CHANNELS by DESIRED-NAME using NAME-FN, fallback to first.

CL-EVENTS.LOOP:STOP-APP-LOOP

Kinds: function

Request app-loop shutdown without waiting for worker termination.

CL-EVENTS.MESSAGING:ENVELOPE->MESSAGES

Kinds: function

Extract the underlying message from each envelope in ENVELOPES, preserving input order.

CL-EVENTS.MESSAGING:EXPAND-MESSAGE

Kinds: function

Wrap MESSAGE in one envelope per propagation phase, in the order returned by MESSAGE-PHASES.

CL-EVENTS.MESSAGING:MAKE-MESSAGE-ENVELOPE

Kinds: function

Construct a message envelope holding MESSAGE, phase, stop flag, and propagation-mode flags.

CL-EVENTS.MESSAGING:MESSAGE->ENVELOPE

Kinds: function

Wrap MESSAGE with optional :PHASE and :STOP-P while reading its broadcast, capture and bubble protocol flags.

CL-EVENTS.MESSAGING:MESSAGE-ENVELOPE

Kinds: type

Message wrapper holding propagation phase, stop flag, and copied broadcast, capture and bubble capabilities.

CL-EVENTS.MESSAGING:MESSAGE-ENVELOPE-BROADCAST-P

Kinds: function

Read or set the broadcast flag stored on a message envelope.

CL-EVENTS.MESSAGING:MESSAGE-ENVELOPE-BUBBLE-P

Kinds: function

Read or set the bubble phase flag stored on a message envelope.

CL-EVENTS.MESSAGING:MESSAGE-ENVELOPE-CAPTURE-P

Kinds: function

Read or set the capture phase flag stored on a message envelope.

CL-EVENTS.MESSAGING:MESSAGE-ENVELOPE-MESSAGE

Kinds: function

Read or replace the underlying message stored by the envelope.

CL-EVENTS.MESSAGING:MESSAGE-ENVELOPE-PHASE

Kinds: function

Read or set the propagation phase keyword of an envelope, normally :CAPTURE, :TARGET, :BUBBLE or :BROADCAST.

CL-EVENTS.MESSAGING:MESSAGE-ENVELOPE-STOP-P

Kinds: function

Read or set the envelope stop-propagation flag, initially false.

CL-EVENTS.MESSAGING:MESSAGE-PHASES

Kinds: function

Return :BROADCAST alone for a broadcast message; otherwise order enabled :CAPTURE, :TARGET and :BUBBLE phases.

CL-EVENTS.PROTOCOLS:APP-UPDATE

Kinds: function

Pure update. Returns NEW-STATE and a list of COMMANDs.

CL-EVENTS.PROTOCOLS:APP-VIEW

Kinds: function

Pure view function producing a renderable tree.

CL-EVENTS.PROTOCOLS:BROADCAST-P

Kinds: function

No documentation metadata.

CL-EVENTS.PROTOCOLS:BUBBLE-P

Kinds: function

No documentation metadata.

CL-EVENTS.PROTOCOLS:CAPTURE-P

Kinds: function

No documentation metadata.

CL-EVENTS.PROTOCOLS:EVENT-PAYLOAD

Kinds: function

No documentation metadata.

CL-EVENTS.PROTOCOLS:EVENT-TIMESTAMP

Kinds: function

No documentation metadata.

CL-EVENTS.PROTOCOLS:EVENT-TOPIC

Kinds: function

No documentation metadata.

CL-EVENTS.PROTOCOLS:MESSAGE-PRIORITY

Kinds: function

No documentation metadata.

CL-EVENTS.PROTOCOLS:MESSAGE-STATE

Kinds: function

No documentation metadata.

CL-EVENTS.PROTOCOLS:PERFORM-COMMAND

Kinds: function

Run effect; may publish events back to the bus.

CL-EVENTS.PROTOCOLS:PERFORM-RENDER

Kinds: function

Render VIEW-MODEL. May consult APP-STATE for metrics.

CL-EVENTS.PROTOCOLS:STOP-PROPAGATION

Kinds: function

No documentation metadata.

CL-EVENTS.PROTOCOLS:TRANSLATE-EVENT->MESSAGES

Kinds: function

Return a list of MESSAGES produced by EVENT.

CL-EVENTS.SYSTEM-EVENTS:MAKE-APP-SHUTDOWN-EVENT

Kinds: function

Construct a normalized app shutdown event payload.

CL-EVENTS.SYSTEM-EVENTS:MAKE-CURSOR-POSITION-EVENT

Kinds: function

Construct a normalized cursor position event payload.

CL-EVENTS.SYSTEM-EVENTS:MAKE-TERMINAL-RESIZED-EVENT

Kinds: function

Construct a normalized terminal resize event payload.

CL-EVENTS.TYPES:COMMAND

Kinds: type

Public command type used to represent structured terminal events and commands.

CL-EVENTS.TYPES:COMMAND-ARGS

Kinds: function

Return the args recorded in the command representation.

CL-EVENTS.TYPES:COMMAND-TYPE

Kinds: function

Return the type recorded in the command representation.

CL-EVENTS.TYPES:CONSUME-EVENT

Kinds: function

Mark an event as consumed to prevent further processing.

CL-EVENTS.TYPES:EVENT

Kinds: type

Public event type used to represent structured terminal events and commands.

CL-EVENTS.TYPES:EVENT-DATA

Kinds: function

Return the payload data stored in EVENT.

CL-EVENTS.TYPES:EVENT-TYPE

Kinds: function

Return the event type stored in EVENT.

CL-EVENTS.TYPES:EVENT-WHEN

Kinds: function

Return the timestamp stored in EVENT.

CL-EVENTS.TYPES:FOCUS-EVENT

Kinds: type

Public focus event type used to represent structured terminal events and commands.

CL-EVENTS.TYPES:FOCUS-EVENT-CONSUMED-P

Kinds: function

Report whether this focus event has been marked consumed by an event handler.

CL-EVENTS.TYPES:FOCUS-EVENT-P

Kinds: function

Return true when the supplied value satisfies the focus event type predicate.

CL-EVENTS.TYPES:FOCUS-EVENT-SOURCE

Kinds: function

Return the source recorded in the focus event representation.

CL-EVENTS.TYPES:FOCUS-EVENT-TARGET

Kinds: function

Return the target recorded in the focus event representation.

CL-EVENTS.TYPES:FOCUS-EVENT-TIMESTAMP

Kinds: function

Return the timestamp recorded in the focus event representation.

CL-EVENTS.TYPES:FOCUS-EVENT-TYPE

Kinds: function

Return the type recorded in the focus event representation.

CL-EVENTS.TYPES:HAS-MODIFIER-P

Kinds: function

Checks if an event has a specific modifier.

CL-EVENTS.TYPES:KEY-EVENT

Kinds: type

Public key event type used to represent structured terminal events and commands.

CL-EVENTS.TYPES:KEY-EVENT-CHAR

Kinds: function

Return the char recorded in the key event representation.

CL-EVENTS.TYPES:KEY-EVENT-CODE

Kinds: function

Return the code recorded in the key event representation.

CL-EVENTS.TYPES:KEY-EVENT-CONSUMED-P

Kinds: function

Report whether this key event has been marked consumed by an event handler.

CL-EVENTS.TYPES:KEY-EVENT-KEY

Kinds: function

Return the key recorded in the key event representation.

CL-EVENTS.TYPES:KEY-EVENT-MODIFIERS

Kinds: function

Return the modifiers recorded in the key event representation.

CL-EVENTS.TYPES:KEY-EVENT-P

Kinds: function

Return true when the supplied value satisfies the key event type predicate.

CL-EVENTS.TYPES:KEY-EVENT-TIMESTAMP

Kinds: function

Return the timestamp recorded in the key event representation.

CL-EVENTS.TYPES:KEY-EVENT-TYPE

Kinds: function

Return the type recorded in the key event representation.

CL-EVENTS.TYPES:MAKE-COMMAND

Kinds: function

Construct a COMMAND from TYPE and ARGS.

CL-EVENTS.TYPES:MAKE-EVENT

Kinds: function

Construct an EVENT from TYPE, DATA, and WHEN fields.

CL-EVENTS.TYPES:MAKE-FOCUS-EVENT

Kinds: function

Construct a focus event structure from its provided initialization fields.

CL-EVENTS.TYPES:MAKE-KEY-EVENT

Kinds: function

Construct a key event structure from its provided initialization fields.

CL-EVENTS.TYPES:MAKE-MESSAGE

Kinds: function

Construct a MESSAGE carrying TYPE, DATA, STATE, and PRIORITY metadata.

CL-EVENTS.TYPES:MAKE-MOUSE-EVENT

Kinds: function

Construct a mouse event structure from its provided initialization fields.

CL-EVENTS.TYPES:MAKE-UI-EVENT

Kinds: function

Construct a ui event structure from its provided initialization fields.

CL-EVENTS.TYPES:MESSAGE

Kinds: type

Public message type used to represent structured terminal events and commands.

CL-EVENTS.TYPES:MESSAGE-DATA

Kinds: function

Return the payload data stored in MESSAGE.

CL-EVENTS.TYPES:MESSAGE-TYPE

Kinds: function

Return the message type stored in MESSAGE.

CL-EVENTS.TYPES:MOUSE-EVENT

Kinds: type

Public mouse event type used to represent structured terminal events and commands.

CL-EVENTS.TYPES:MOUSE-EVENT-BUTTON

Kinds: function

Return the button recorded in the mouse event representation.

CL-EVENTS.TYPES:MOUSE-EVENT-CLICK-COUNT

Kinds: function

Return the click count recorded in the mouse event representation.

CL-EVENTS.TYPES:MOUSE-EVENT-CONSUMED-P

Kinds: function

Report whether this mouse event has been marked consumed by an event handler.

CL-EVENTS.TYPES:MOUSE-EVENT-DELTA-X

Kinds: function

Return the delta x recorded in the mouse event representation.

CL-EVENTS.TYPES:MOUSE-EVENT-DELTA-Y

Kinds: function

Return the delta y recorded in the mouse event representation.

CL-EVENTS.TYPES:MOUSE-EVENT-MODIFIERS

Kinds: function

Return the modifiers recorded in the mouse event representation.

CL-EVENTS.TYPES:MOUSE-EVENT-P

Kinds: function

Return true when the supplied value satisfies the mouse event type predicate.

CL-EVENTS.TYPES:MOUSE-EVENT-TIMESTAMP

Kinds: function

Return the timestamp recorded in the mouse event representation.

CL-EVENTS.TYPES:MOUSE-EVENT-TYPE

Kinds: function

Return the type recorded in the mouse event representation.

CL-EVENTS.TYPES:MOUSE-EVENT-X

Kinds: function

Return the x recorded in the mouse event representation.

CL-EVENTS.TYPES:MOUSE-EVENT-Y

Kinds: function

Return the y recorded in the mouse event representation.

CL-EVENTS.TYPES:PREVENT-DEFAULT

Kinds: function

Marks event as having its default behavior prevented.

CL-EVENTS.TYPES:STOP-PROPAGATION*

Kinds: function

Generic function to stop event propagation.

CL-EVENTS.TYPES:UI-EVENT

Kinds: type

Public ui event type used to represent structured terminal events and commands.

CL-EVENTS.TYPES:UI-EVENT-CONSUMED-P

Kinds: function

Report whether this ui event has been marked consumed by an event handler.

CL-EVENTS.TYPES:UI-EVENT-ORIGINAL-EVENT

Kinds: function

Return the original event recorded in the ui event representation.

CL-EVENTS.TYPES:UI-EVENT-P

Kinds: function

Return true when the supplied value satisfies the ui event type predicate.

CL-EVENTS.TYPES:UI-EVENT-TARGET

Kinds: function

Return the target recorded in the ui event representation.

CL-EVENTS.TYPES:UI-EVENT-TIMESTAMP

Kinds: function

Return the timestamp recorded in the ui event representation.

CL-EVENTS.TYPES:UI-EVENT-TYPE

Kinds: function

Return the type recorded in the ui event representation.

CL-INPUTS.ADAPTERS:TOKEN->NORMALIZED-EVENT

Kinds: function

Convert a cl-inputs token into a normalized event plist.
Returns NIL when TOKEN kind is unsupported.

CL-INPUTS.API:MAKE-READY-INPUT-SOURCE

Kinds: function

Return an owned input source; lifecycle setup is centralized in MAKE-INPUT-SOURCE.

CL-INPUTS.API:READ-TOKENS

Kinds: function

Read all available tokens from DEV until TIMEOUT seconds elapse.

Arguments:
  DEV     -- device object supporting input
  TIMEOUT -- maximum seconds to wait for input (type: real, default: 5)

Return Value:
  List of tokens read from DEV.

Side Effects:
  Closes the input source after reading.

CL-INPUTS.API:SET-TERMINAL-MODES

Kinds: function

Convenience: toggle device terminal modes via device-set-modes.

CL-INPUTS.API:WITH-ASYNC-SIGNAL

Kinds: macro

Run BODY in a background thread, allowing interruption and result retrieval.
RETURN-VAR is a symbol bound to NIL and can be set within BODY to track progress or result.
Defines a SIGNAL-FN function that interrupts the thread and returns the current value of RETURN-VAR.
Returns (values thread signal-fn device).

CL-INPUTS.API:WITH-INPUT-SOURCE

Kinds: macro

Bind VAR to a ready input-source around BODY; cleans up on exit.

CL-INPUTS.API:WITH-RAW-INPUT

Kinds: macro

Own DEV for BODY: open once, enter raw-char mode once, and restore/close once.

CL-INPUTS.DECODER:DECODE-CHUNK

Kinds: function

Incrementally decode OCTET-VECTOR into semantic input tokens.

Chunk boundaries do not change semantic output. NOW, when supplied, is monotonic
seconds used only for externally controlled ambiguity-deadline evaluation.

CL-INPUTS.DECODER:DECODER-BUFFERED-BYTE-COUNT

Kinds: function

Return the number of bytes retained across decode calls.

CL-INPUTS.DECODER:DECODER-NEXT-DEADLINE

Kinds: function

Return the pending ESC ambiguity deadline in monotonic seconds, or NIL.

CL-INPUTS.DECODER:DECODER-STATE

Kinds: function

Return a diagnostic snapshot of DECODER's raw parser state.

CL-INPUTS.DECODER:FINISH-DECODER

Kinds: function

Finish DECODER at end-of-stream and return final tokens plus reset state.

CL-INPUTS.DECODER:MAKE-DECODER

Kinds: function

Create a semantic decoder with explicit raw-protocol bounds and ESC policy.

CL-INPUTS.DEVICE.API:ACQUIRE-LOCK

Kinds: function

No documentation metadata.

CL-INPUTS.DEVICE.API:CLOSE-DEVICE

Kinds: function

Idempotently release backend-owned resources. Concrete terminal devices
must restore any raw state they still own before their descriptors disappear.

CL-INPUTS.DEVICE.API:DEVICE-CAPABILITIES

Kinds: function

Return a plist describing negotiated/known features, e.g.:
    (:truecolor t
     :mouse :sgr             ; :x10 | :urxvt | :sgr
     :focus-events t
     :bracketed-paste t
     :winch t                ; supports reporting resize
     :term ("xterm-256color"))

CL-INPUTS.DEVICE.API:DEVICE-ERROR

Kinds: type

Generic device error condition for device API failures.

CL-INPUTS.DEVICE.API:DEVICE-FD

Kinds: function

Return the underlying file descriptor for DEV, or NIL if not supported.

CL-INPUTS.DEVICE.API:DEVICE-INPUT-STREAM

Kinds: function

Return the underlying binary input stream for DEV, or NIL if not available.

CL-INPUTS.DEVICE.API:DEVICE-KIND

Kinds: function

Return a keyword like :tty, :faketerm, :urxvt.

CL-INPUTS.DEVICE.API:DEVICE-OUTPUT-STREAM

Kinds: function

Return the underlying binary output stream for DEV, or NIL if not available.

CL-INPUTS.DEVICE.API:DEVICE-READ-BYTES

Kinds: function

Perform at most one read attempt into BUFFER[START,END). Return a positive
byte count, 0 for a zero-length request, :EOF for terminal end, :WOULD-BLOCK for
EAGAIN/EWOULDBLOCK, or :INTERRUPTED for EINTR. The caller owns retry/deadline
policy; implementations must not hide retry loops or fixed readiness sleeps.

CL-INPUTS.DEVICE.API:DEVICE-SET-MODES

Kinds: function

Enable terminal modes (mouse tracking, bracketed paste, focus in/out).
    MODES is a plist, e.g. (:mouse :sgr :paste t :focus t).

CL-INPUTS.DEVICE.API:DEVICE-SET-NONBLOCKING

Kinds: function

Enable/disable O_NONBLOCK; return FLAG actually set.

CL-INPUTS.DEVICE.API:DEVICE-WAIT-READABLE

Kinds: function

Wait at most TIMEOUT-MS (a non-negative real, or NIL) for readability.
Return T if readable, NIL on timeout, or :INTERRUPTED for EINTR. The caller is
responsible for recomputing its remaining deadline budget before retrying.

CL-INPUTS.DEVICE.API:DEVICE-WRITE-BYTES

Kinds: function

Optional; return bytes written.

CL-INPUTS.DEVICE.API:DISABLE-RAW-CHAR-MODE

Kinds: function

No documentation metadata.

CL-INPUTS.DEVICE.API:DISABLE-RAW-MODE

Kinds: function

No documentation metadata.

CL-INPUTS.DEVICE.API:ENABLE-RAW-CHAR-MODE

Kinds: function

Enter raw character mode; SHOULD be idempotent and nestable.

CL-INPUTS.DEVICE.API:ENABLE-RAW-MODE

Kinds: function

No documentation metadata.

CL-INPUTS.DEVICE.API:LOCK-OF

Kinds: function

No documentation metadata.

CL-INPUTS.DEVICE.API:LOCKABLE

Kinds: type

No documentation metadata.

CL-INPUTS.DEVICE.API:MAKE-DEVICE

Kinds: function

Construct a device instance for BACKEND (a keyword or descriptor).
    No global singletons; return a self-contained handle.

CL-INPUTS.DEVICE.API:OPEN-DEVICE

Kinds: function

Acquire DEV resources idempotently and return DEV. A backend that acquires
multiple resources must clean up already-acquired resources if opening fails.

CL-INPUTS.DEVICE.API:RAW-MODE-ERROR

Kinds: type

Condition signaled when raw mode operations fail.

CL-INPUTS.DEVICE.API:RELEASE-LOCK

Kinds: function

No documentation metadata.

CL-INPUTS.DEVICE.API:WITH-LOCK

Kinds: macro

Execute BODY with the lock of LOCKABLE L acquired.
This macro ensures that the lock is acquired before executing BODY,
and released afterwards, even if an error occurs during execution.
It uses `acquire-lock` and `release-lock` methods to manage the lock.
This is useful for ensuring thread safety when accessing shared resources.

CL-INPUTS.DEVICE.API:WITH-RAW-CHAR-MODE

Kinds: macro

Portable wrapper that enables raw char mode before BODY and restores it after,
   relying on device methods. Idempotent and safe to nest.

CL-INPUTS.DEVICE.API:WITH-TERMINAL-LOCK

Kinds: macro

No documentation metadata.

CL-INPUTS.DEVICE.FAKETERM:FAKETERM-CAPTURED

Kinds: function

Return all octets captured in the output queue of DEV.

CL-INPUTS.DEVICE.FAKETERM:FAKETERM-DEVICE-CLOSE-COUNT

Kinds: function

Return how many actual device closures occurred; repeated CLOSE-DEVICE calls are idempotent.

CL-INPUTS.DEVICE.FAKETERM:FAKETERM-DEVICE-CLOSED-P

Kinds: function

Return whether the fake terminal device has entered its closed lifecycle state.

CL-INPUTS.DEVICE.FAKETERM:FAKETERM-DEVICE-HEIGHT

Kinds: function

Return or set the fake terminal's screen height in rows.

CL-INPUTS.DEVICE.FAKETERM:FAKETERM-DEVICE-NONBLOCKING-P

Kinds: function

Return or set whether fake-terminal device reads use nonblocking behavior.

CL-INPUTS.DEVICE.FAKETERM:FAKETERM-DEVICE-OPEN-P

Kinds: function

Return whether the fake terminal device is currently open.

CL-INPUTS.DEVICE.FAKETERM:FAKETERM-DEVICE-P

Kinds: function

Return true when the supplied value is a fake terminal device structure.

CL-INPUTS.DEVICE.FAKETERM:FAKETERM-DEVICE-RAW-DEPTH

Kinds: function

Return the current nested raw-mode activation depth; disabling raw mode decrements to zero.

CL-INPUTS.DEVICE.FAKETERM:FAKETERM-DEVICE-READ-COUNT

Kinds: function

Return the number of device-read attempts recorded by the fake terminal.

CL-INPUTS.DEVICE.FAKETERM:FAKETERM-DEVICE-WAIT-COUNT

Kinds: function

Return the number of calls to wait-for-readable on this fake terminal.

CL-INPUTS.DEVICE.FAKETERM:FAKETERM-DEVICE-WIDTH

Kinds: function

Return or set the fake terminal screen width in columns.

CL-INPUTS.DEVICE.FAKETERM:FAKETERM-INJECT!

Kinds: function

Inject OCTETS into the input queue of DEV.

CL-INPUTS.DEVICE.FAKETERM:FAKETERM-SCREEN-LINES

Kinds: function

Return the fake screen contents as a list of strings.

CL-INPUTS.DEVICE.TTY:MAKE-TTY-DEVICE

Kinds: function

No documentation metadata.

CL-INPUTS.DEVICE.TTY:TTY-DEVICE

Kinds: type

No documentation metadata.

CL-INPUTS.DEVICE.TTY:TTY-DEVICE-PATH

Kinds: function

No documentation metadata.

CL-INPUTS.ESCAPE:CSI-FINAL-BYTE-P

Kinds: function

Return T if BYTE is an ECMA-48 final byte (0x40..0x7E), NIL otherwise.

CL-INPUTS.ESCAPE:DECODE-CSI-TO-TOKEN

Kinds: function

Attempt to map a full CSI/ESC sequence (OCTETS) to a token.
Return NIL to let the generic path try SGR mouse or fallback handling.
Override this function to provide custom escape sequence decoding.

CL-INPUTS.KEYMAP:DEFAULT-KEYMAP

Kinds: variable

Default keymap: maps common escape sequences to symbolic key names.
Extend this table to support additional keys or custom layouts.

CL-INPUTS.KEYMAP:CANONICALIZE-KEY

Kinds: function

Return a stable keyword for CHAR and its modifier flags.

Modifiers use the conventional C-/M-/S- prefixes, in that order.  For
example, Control+Alt+Shift+A becomes :C-M-S-A.

CL-INPUTS.KEYMAP:LOOKUP-SEQ

Kinds: function

Look up OCTETS (vector of char codes) in TABLE and return the mapped key symbol.
Returns NIL if no match is found.

CL-INPUTS.LOOP:CANCEL-INPUT-SOURCE

Kinds: function

Idempotently cancel SRC and wait for its active bounded read to unwind.

CL-INPUTS.LOOP:CLOSE-INPUT-SOURCE

Kinds: function

Idempotently close SRC after any active bounded read returns.

CL-INPUTS.LOOP:EXPECT-TERMINAL-RESPONSE

Kinds: function

Register RESPONSE-TYPE on SRC without writing terminal bytes.

This is the correlation seam for protocol extensions. Register before emitting a
custom query so a fast response cannot race ahead of its correlation.

CL-INPUTS.LOOP:INPUT-LOOP

Kinds: type

State for a running input loop.

Fields:
  DEV            -- device handle (type: device object)
  SINK           -- sink function or object for token delivery (type: function or sink object)
  DECODER        -- decoder state object (type: decoder)
  THREAD         -- thread running the loop (if async) (type: thread or null)
  STOP?          -- flag to request loop termination (type: boolean)
  CONDITION      -- condition variable for sync/notify (type: condition-variable or null)
  CONDITION-LOCK -- lock for condition variable (type: lock or null)
  LAST-OUTPUT    -- last token delivered (type: token or null)

All fields are required except THREAD, CONDITION, CONDITION-LOCK, and LAST-OUTPUT, which may be NIL if not used.

CL-INPUTS.LOOP:INPUT-SOURCE-OWNS-DEVICE-P

Kinds: function

No documentation metadata.

CL-INPUTS.LOOP:INPUT-SOURCE-RESPONSE-ROUTER

Kinds: function

No documentation metadata.

CL-INPUTS.LOOP:INPUT-SOURCE-STATE

Kinds: function

No documentation metadata.

CL-INPUTS.LOOP:INPUT-SOURCE-TERMINAL-OUTCOME

Kinds: function

No documentation metadata.

CL-INPUTS.LOOP:MAKE-INPUT-SOURCE

Kinds: function

Create an explicit source lifecycle around DEVICE and DECODER.

When OWNS-DEVICE-P is true (the default), this function opens DEVICE, enables
nonblocking reads and raw-character mode, and the returned source is responsible
for restoring raw mode and closing the device exactly once. Partial-open or
raw-mode failure is cleaned up before the original condition is re-signaled.
When OWNS-DEVICE-P is false, the caller retains ownership and must keep DEVICE
open, raw-configured, and nonblocking for the source lifetime; the source never
changes or closes that borrowed device. MONITOR-RESIZE-P opts into ioctl-backed
size sampling for an open Linux/SBCL TTY. Other device kinds cannot claim
kernel resize evidence through this contract.

CL-INPUTS.LOOP:NEXT-TOKEN

Kinds: function

Return the next token, NIL on timeout/end, and preserve source terminal state.

TIMEOUT is a non-negative number of seconds or NIL for an indefinite logical
wait. Even an indefinite wait uses finite readiness slices so concurrent
close/cancel is observed. EINTR retries consume the caller's original budget;
EAGAIN/would-block returns to readiness waiting rather than spinning. The
Phase-A decoder ESC deadline participates in the same deadline calculation.

CL-INPUTS.LOOP:SEND-TERMINAL-QUERY

Kinds: function

Register and emit a supported read-only terminal protocol QUERY.

The correlation is installed before bytes are written. A short/failed write
cancels the correlation and signals rather than leaving an unfulfillable live
request. QUERY describes protocol negotiation only; it carries no rendering
policy.

CL-INPUTS.LOOP:START-INPUT-LOOP

Kinds: function

Start an input loop. MODE can be :async (default) or :sync.

CL-INPUTS.LOOP:STOP-INPUT-LOOP

Kinds: function

Request loop cancellation. Active reads are bounded by the source wait slice.

CL-INPUTS.LOOP:TAKE-INPUT-PROTOCOL-DIAGNOSTIC

Kinds: function

Return the oldest malformed/unknown protocol token retained by SRC.

CL-INPUTS.LOOP:TAKE-UNMATCHED-TERMINAL-RESPONSE

Kinds: function

Return the oldest valid terminal reply that had no live correlation.

CL-INPUTS.LOOP:WAIT-TERMINAL-RESPONSE

Kinds: function

Pump SRC until CORRELATION matches/expires, without consuming user input.

User-input tokens observed while waiting remain queued for NEXT-TOKEN in their
original order. TIMEOUT bounds this wait only; the correlation keeps its own
absolute deadline and may remain :PENDING if this call returns earlier.

CL-INPUTS.PROTOCOL:+DEFAULT-ESCAPE-TIMEOUT+

Kinds: variable

Default ambiguity timeout in seconds for a standalone ESC byte, currently 0.025 seconds.

CL-INPUTS.PROTOCOL:+DEFAULT-MAX-BUFFER-BYTES+

Kinds: variable

Default maximum aggregate retained bytes in the incremental protocol parser.

CL-INPUTS.PROTOCOL:+DEFAULT-MAX-PASTE-BYTES+

Kinds: variable

Default maximum accumulated bracketed-paste payload bytes, currently one mebibyte.

CL-INPUTS.PROTOCOL:+DEFAULT-MAX-SEQUENCE-BYTES+

Kinds: variable

Default maximum recognized escape sequence length, currently 128 bytes.

CL-INPUTS.PROTOCOL:DECODE-UTF-8-OCTETS

Kinds: function

Decode OCTETS, replacing malformed bytes deterministically.
Return string, validity, and number of replacement events.

CL-INPUTS.PROTOCOL:FINISH-PROTOCOL

Kinds: function

Finish a byte stream and convert retained incomplete input to typed events.

CL-INPUTS.PROTOCOL:MAKE-PROTOCOL-PARSER

Kinds: function

Create a bounded incremental terminal-protocol recognizer.

CLOCK returns monotonic seconds. ESCAPE-TIMEOUT resolves only standalone Escape
ambiguity; the parser never sleeps. Sequence, paste, and aggregate retained
state are constrained by explicit hard limits.

CL-INPUTS.PROTOCOL:PROTOCOL-BUFFERED-BYTE-COUNT

Kinds: function

Return the total buffered undecoded byte count currently held by a protocol parser.

CL-INPUTS.PROTOCOL:PROTOCOL-EVENT

Kinds: type

Recognized terminal protocol event record containing category, payload, raw bytes, reason and metadata.

CL-INPUTS.PROTOCOL:PROTOCOL-EVENT-CATEGORY

Kinds: function

Return the classification category of a recognized terminal protocol event.

CL-INPUTS.PROTOCOL:PROTOCOL-EVENT-METADATA

Kinds: function

Return extra parser metadata associated with a recognized terminal protocol event.

CL-INPUTS.PROTOCOL:PROTOCOL-EVENT-PAYLOAD

Kinds: function

Return decoded terminal input payload such as a key or pasted text.

CL-INPUTS.PROTOCOL:PROTOCOL-EVENT-RAW

Kinds: function

Return the raw octets associated with a recognized terminal input event.

CL-INPUTS.PROTOCOL:PROTOCOL-EVENT-REASON

Kinds: function

Return the reason or parsing diagnostic associated with a protocol event.

CL-INPUTS.PROTOCOL:PROTOCOL-NEXT-DEADLINE

Kinds: function

Return the next monotonic deadline for resolving pending ESC ambiguity, or NIL when none is pending.

CL-INPUTS.PROTOCOL:PROTOCOL-PARSER-STATE

Kinds: function

Return a diagnostic snapshot with copies of retained protocol bytes only.

CL-INPUTS.PROTOCOL:RECOGNIZE-CHUNK

Kinds: function

Consume OCTET-VECTOR, returning raw events and a fresh parser state.

NOW is a monotonic timestamp in seconds. If omitted, the injected parser clock
is called once. Retained parser state is copied so the supplied PARSER remains
unchanged.

CL-INPUTS.ROUTING:+DEFAULT-MAX-PROTOCOL-BACKLOG+

Kinds: variable

Maximum unmatched replies or protocol diagnostics retained per router queue.

CL-INPUTS.ROUTING:+DEFAULT-MAX-RESPONSE-CORRELATIONS+

Kinds: variable

Maximum simultaneously pending response correlations per input source.

CL-INPUTS.ROUTING:CANCEL-RESPONSE-CORRELATION

Kinds: function

Idempotently cancel CORRELATION unless it already reached a terminal state.

CL-INPUTS.ROUTING:EXPIRE-RESPONSE-CORRELATIONS

Kinds: function

Expire all pending correlations whose absolute deadlines are due.

CL-INPUTS.ROUTING:MAKE-RESPONSE-ROUTER

Kinds: function

Create a bounded response router with an injectable monotonic CLOCK.

CL-INPUTS.ROUTING:REGISTER-RESPONSE-CORRELATION

Kinds: function

Register an expected RESPONSE-TYPE before emitting its terminal query.

TIMEOUT is relative to ROUTER's monotonic clock. DEADLINE, when supplied, is an
absolute monotonic timestamp and is mutually exclusive with a non-default
TIMEOUT argument in intent; callers should normally use one or the other. The
router has a hard bound and rejects registration rather than evicting a live
request. Correlations are FIFO among requests for the same response type.

CL-INPUTS.ROUTING:RESPONSE-CORRELATION

Kinds: type

One terminal query/reply correlation with an absolute monotonic deadline.

CL-INPUTS.ROUTING:RESPONSE-CORRELATION-DEADLINE

Kinds: function

No documentation metadata.

CL-INPUTS.ROUTING:RESPONSE-CORRELATION-ID

Kinds: function

No documentation metadata.

CL-INPUTS.ROUTING:RESPONSE-CORRELATION-RESPONSE

Kinds: function

Return the matched terminal-response token, or NIL when none matched.

CL-INPUTS.ROUTING:RESPONSE-CORRELATION-RESPONSE-TYPE

Kinds: function

No documentation metadata.

CL-INPUTS.ROUTING:RESPONSE-CORRELATION-STATE

Kinds: function

Return CORRELATION lifecycle state, expiring a due pending request.

States are :PENDING, :MATCHED, :EXPIRED, and :CANCELLED. Deadline comparison is
inclusive: a reply observed at or after the absolute deadline cannot match.

CL-INPUTS.ROUTING:RESPONSE-ROUTER-NEXT-DEADLINE

Kinds: function

Return the earliest pending correlation deadline, or NIL.

CL-INPUTS.ROUTING:ROUTE-TOKEN

Kinds: function

Route TOKEN and return two values: route keyword and matched correlation.

A valid terminal response is consumed only by a live matching correlation.
Unmatched or stale replies are retained in the bounded unmatched queue and are
never reinterpreted as user input. Protocol diagnostics are likewise retained
separately.

CL-INPUTS.ROUTING:TAKE-PROTOCOL-DIAGNOSTIC

Kinds: function

Remove and return the oldest protocol diagnostic, or NIL.

CL-INPUTS.ROUTING:TAKE-UNMATCHED-RESPONSE

Kinds: function

Remove and return the oldest unmatched terminal response, or NIL.

CL-INPUTS.ROUTING:TERMINAL-QUERY-BYTES

Kinds: function

Return a fresh octet vector for a supported read-only terminal QUERY.

CL-INPUTS.ROUTING:TERMINAL-QUERY-RESPONSE-TYPE

Kinds: function

Return the response type expected for a supported protocol QUERY.

CL-INPUTS.ROUTING:TERMINAL-RESPONSE-TYPE

Kinds: function

Return TOKEN's declared terminal response type, or NIL.

CL-INPUTS.ROUTING:TOKEN-ROUTE

Kinds: function

Classify TOKEN without mutating routing state.

Only established user-input token kinds enter :USER-INPUT. Terminal replies and
protocol diagnostics remain on separate paths; unknown future kinds fail closed
to :PROTOCOL rather than silently becoming user input.

CL-INPUTS.SINK:ACCEPT-TOKEN

Kinds: function

Deliver TOKEN to SINK. The default method is a no-op.

CL-INPUTS.SINK:FN-SINK

Kinds: function

Adapt FN to a token sink function.

CL-INPUTS.SINK:ON-CTRL-C

Kinds: function

Handle a :ctrl-c token.

CL-INPUTS.SINK:ON-FOCUS

Kinds: function

Handle a :focus token.

CL-INPUTS.SINK:ON-KEY

Kinds: function

Handle a :key token.

CL-INPUTS.SINK:ON-MOUSE

Kinds: function

Handle a :mouse token.

CL-INPUTS.SINK:ON-PASTE

Kinds: function

Handle a :paste token.

CL-INPUTS.SINK:ON-RESIZE

Kinds: function

Handle a :resize token.

CL-INPUTS.SINK:TEE-SINK

Kinds: function

Return a sink function that fans each token out to SINKS in order.

CL-INPUTS.TERMINAL.ANSII:ANSI-KEYS

Kinds: variable

Alist mapping key symbols to their ANSI escape sequence definitions.
   Each definition is a list starting with the introducer type (e.g., :CSI, :SS3)
   followed by the characters/codes that make up the rest of the sequence.
   Some keys might have multiple possible sequences (e.g., :HOME).

CL-INPUTS.TERMINAL.ANSII:INTRODUCERS

Kinds: variable

A list of ANSI escape sequence introducers. Each entry is a list of:
  (Description Name Esc-Char-Suffix Esc-Char-Code-List).
  The Esc-Char-Code-List is (ESC-Code Actual-Char-Code).

CL-INPUTS.TERMINAL.ANSII:+ANSI-ESCAPE-SEQUENCES+

Kinds: variable

Hash table mapping ANSI sequence identifier keywords to sequence objects registered by the DEFSEQ table.

CL-INPUTS.TERMINAL.ANSII:+ANSI-ESCAPE-SEQUENCES-LOOKUP+

Kinds: variable

Hash table mapping printable control-sequence templates to their registered identifier keywords.

CL-INPUTS.TERMINAL.ANSII:+ANSI-ESCAPE-SEQUENCES-RESET-LOOKUP+

Kinds: variable

Hash table mapping ANSI sequence identifiers to their corresponding reset-sequence identifiers.

CL-INPUTS.TERMINAL.ANSII:ANSI-ATTR-SEQ

Kinds: function

Render the ANSI SGR sequence enabling ATTR-KEYWORD or disabling it when ACTIVEP is false; return NIL when unregistered.

CL-INPUTS.TERMINAL.ANSII:ANSI-BG-COLOR-SEQ

Kinds: function

Render the background-color ANSI SGR sequence for NIL, a named color keyword, a palette index, or a three-channel RGB list.

CL-INPUTS.TERMINAL.ANSII:ANSI-FG-COLOR-SEQ

Kinds: function

Render the foreground-color ANSI SGR sequence for NIL, a named color keyword, a palette index, or a three-channel RGB list.

CL-INPUTS.TERMINAL.ANSII:ANSI-SEQUENCE

Kinds: type

Ansi Escape Sequence to be sent to the terminal.

CL-INPUTS.TERMINAL.ANSII:COLLECT-CSI-PARAMS

Kinds: function

Parses a list of character codes (after ESC [) into CSI parameters, intermediates, and the final byte.
   Returns (VALUES PARAM-LIST INTERMEDIATE-CHARS FINAL-BYTE-CHAR-CODE).

CL-INPUTS.TERMINAL.ANSII:DEFAULT-ARGS

Kinds: function

Read the default argument slot of an ANSI-SEQUENCE object, if that slot has been initialized.

CL-INPUTS.TERMINAL.ANSII:DESCRIPTION

Kinds: function

Return the human-readable description assigned to an ANSI-SEQUENCE control sequence object.

CL-INPUTS.TERMINAL.ANSII:GET-RESET-SEQUENCE

Kinds: function

Return the reset escape sequence id for IDENTIFIER.

CL-INPUTS.TERMINAL.ANSII:GET-SEQUENCE

Kinds: function

Return the escape sequence object for IDENTIFIER.

CL-INPUTS.TERMINAL.ANSII:IDENTIFIER

Kinds: function

Return the keyword identifying a registered ANSI control sequence.

CL-INPUTS.TERMINAL.ANSII:INTRODUCER

Kinds: type

Structure describing an ANSI escape introducer, including symbolic name, escape code and printable representations.

CL-INPUTS.TERMINAL.ANSII:INTRODUCER-CODE

Kinds: function

Read or set the integer code slot of an ANSI escape introducer structure.

CL-INPUTS.TERMINAL.ANSII:INTRODUCER-DESC

Kinds: function

Read or set the optional human-readable description of an ANSI escape introducer.

CL-INPUTS.TERMINAL.ANSII:INTRODUCER-ESC

Kinds: function

Read or set the integer ESC prefix code recorded in the introducer.

CL-INPUTS.TERMINAL.ANSII:INTRODUCER-ESC-CHAR

Kinds: function

Read or set the character representation of the introducer suffix.

CL-INPUTS.TERMINAL.ANSII:INTRODUCER-ESC-DEC

Kinds: function

Read or set the decimal-text representation of an introducer escape code.

CL-INPUTS.TERMINAL.ANSII:INTRODUCER-ESC-HEX

Kinds: function

Read or set the hexadecimal-text representation of an introducer escape code.

CL-INPUTS.TERMINAL.ANSII:INTRODUCER-ESC-OCT

Kinds: function

Read or set the octal-text representation of an introducer escape code.

CL-INPUTS.TERMINAL.ANSII:INTRODUCER-ESC-STR

Kinds: function

Read or set the optional printable escape string stored in an ANSI introducer.

CL-INPUTS.TERMINAL.ANSII:INTRODUCER-KEY

Kinds: function

Given a byte that follows an ESC (0x1B) character, returns the keyword
   identifier for the introducer type (e.g., :CSI, :SS3, :OSC).

CL-INPUTS.TERMINAL.ANSII:INTRODUCER-NAME

Kinds: function

Read or set the symbolic introducer identifier, such as :CSI or :SS3.

CL-INPUTS.TERMINAL.ANSII:IS-CSI-FINAL-BYTE?

Kinds: function

Checks if the character code is a CSI final byte (ASCII 64-126).

CL-INPUTS.TERMINAL.ANSII:LOOKUP-SEQUENCE

Kinds: function

Lookup the sequence for IDENTIFIER (can be keyword or string rep).

CL-INPUTS.TERMINAL.ANSII:MAKE-ANSI-SEQUENCE

Kinds: function

Construct an ANSI-SEQUENCE instance using :SEQ, :DESCRIPTION, :IDENTIFIER, :RESPONSE-TYPE and :RESET-SEQUENCE.

CL-INPUTS.TERMINAL.ANSII:MAKE-INTRODUCER

Kinds: function

Construct an ANSI introducer structure with keyword initializers for its descriptor and escape fields.

CL-INPUTS.TERMINAL.ANSII:NUMBER-OF-ARGUMENTS

Kinds: function

Count nonstring placeholder entries in an ANSI-SEQUENCE's parts list; these accept arguments during rendering.

CL-INPUTS.TERMINAL.ANSII:PARSE-CSI-SEQUENCE

Kinds: function

Parses a CSI sequence (list of char codes after ESC [) and returns a structured representation.
   Returns a list like (:type :cursor-up :params (1)) or (:type :sgr :changes ((:bold t) (:fg-color :red))).

CL-INPUTS.TERMINAL.ANSII:PARSE-PARAMETERS

Kinds: function

Parses a list of parameter characters (digits and ';', ':') into a list of integers.

CL-INPUTS.TERMINAL.ANSII:PARSE-SGR-PARAMETERS

Kinds: function

Parses a list of SGR numeric parameters and returns a list of style changes.
   Example: (0) -> '((:reset t))
            (1) -> '((:bold t))
            (31) -> '((:fg-color :red))
            (38 5 200) -> '((:fg-color (:type :xterm :value 200)))
            (38 2 100 150 200) -> '((:fg-color (:type :rgb :r 100 :g 150 :b 200)))

CL-INPUTS.TERMINAL.ANSII:PRERENDER

Kinds: function

Read or set the optional pre-render callback of an ANSI-SEQUENCE; the renderer composes parts directly.

CL-INPUTS.TERMINAL.ANSII:READ-ESCAPE-BYTES

Kinds: function

Reads bytes from STREAM following an ESC and an introducer (like '[', 'O').
   Tries to match the sequence against *ANSI-KEYS*.
   STREAM: The input stream to read from.
   INTRODUCER-TYPE: The keyword for the introducer (e.g., :CSI, :SS3).
   Returns (VALUES KEY-SYMBOL REMAINING-BYTES) or (VALUES NIL ALL-READ-BYTES) if no match.
   REMAINING-BYTES are bytes read that didn't form a known key sequence.
   ALL-READ-BYTES are all bytes read if no specific key was matched.

CL-INPUTS.TERMINAL.ANSII:RENDER-SEQ

Kinds: function

Render an ANSI-SEQUENCE to a string beginning with ESC, inserting supplied arguments into NIL placeholders.

CL-INPUTS.TERMINAL.ANSII:RESET-SEQUENCE

Kinds: function

Read the configured reset-sequence identifier from an ANSI-SEQUENCE instance.

CL-INPUTS.TERMINAL.ANSII:RESPONSE-TYPE

Kinds: function

Read the expected response type for an ANSI-SEQUENCE query, or NIL.

CL-INPUTS.TERMINAL.ANSII:SEQ

Kinds: function

Read the sequence template parts list from an ANSI-SEQUENCE instance, including literal strings and NIL placeholders.

CL-INPUTS.TERMINAL.ANSII:SPLIT-SEQ-IF

Kinds: function

Split STRING into a list of substrings based on characters that match PREDICATE.

CL-INPUTS.TERMINAL.API:%EMIT-ANSI

Kinds: function

Format an ANSI control sequence and write it to TARGET via DEVICE-WRITE-BYTES.

CL-INPUTS.TERMINAL.API:%STYLE->SGR-STRING

Kinds: function

Return an SGR fragment (without final 'm') for STYLE plist or NIL.

CL-INPUTS.TERMINAL.API:+ESC+

Kinds: variable

ESC character as a string literal.

CL-INPUTS.TERMINAL.API:APPLY-STYLE

Kinds: function

Apply STYLE as the current terminal attributes.

CL-INPUTS.TERMINAL.API:CLEAR-AREA

Kinds: function

Clear a rectangular region starting at ROW/COL with HEIGHT x WIDTH.

CL-INPUTS.TERMINAL.API:CLEAR-SCREEN

Kinds: function

Clear the full terminal content and home the cursor.

CL-INPUTS.TERMINAL.API:DRAW-CHAR-AT

Kinds: function

Draw CHAR with optional STYLE at ROW/COL.

CL-INPUTS.TERMINAL.API:DRAW-TEXT-AT

Kinds: function

Draw TEXT with optional STYLE at ROW/COL.

CL-INPUTS.TERMINAL.API:FILL-RECTANGLE

Kinds: function

Fill rectangle with CHAR (defaults to space) using STYLE.

CL-INPUTS.TERMINAL.API:FLUSH-OUTPUT

Kinds: function

Ensure buffered terminal output for TARGET is flushed.

CL-INPUTS.TERMINAL.API:GET-CURSOR-POSITION

Kinds: function

Return cursor ROW and COL (0-based) if known, NIL otherwise.

CL-INPUTS.TERMINAL.API:GET-TERMINAL-SIZE

Kinds: function

Return WIDTH and HEIGHT as two values when known, or NIL and NIL otherwise.

CL-INPUTS.TERMINAL.API:HIDE-CURSOR

Kinds: function

No documentation metadata.

CL-INPUTS.TERMINAL.API:RESET-STYLE

Kinds: function

Reset terminal attributes to defaults.

CL-INPUTS.TERMINAL.API:SCROLL-LINES

Kinds: function

Scroll the display by COUNT lines (positive = up, negative = down).

CL-INPUTS.TERMINAL.API:SET-CURSOR-POSITION

Kinds: function

Move cursor to ROW/COL (0-based).

CL-INPUTS.TERMINAL.API:SHOW-CURSOR

Kinds: function

No documentation metadata.

CL-INPUTS.TERMINAL.API:WITH-STYLED-OUTPUT

Kinds: macro

Emit STYLE before BODY and reset attributes afterwards.

Args
  - ~target~: The output destination (e.g., a stream or buffer).
  - ~style~: A style specification, typically a plist or object that ~%style->sgr-string~ can convert to an ANSI SGR string.
  - ~body~: Forms to execute with the style applied.


*Style Evaluation*: The macro evaluates ~style~ and, if non-nil, converts it to an ANSI SGR string using ~%style->sgr-string~.
*Emit Style*: If a style string is produced, it emits the ANSI code to the ~target~ using ~%emit-ansi~.
*Body Execution*: Executes the ~body~ forms.
*Reset Style*: After the body, emits the ANSI reset code (~[0m~) to the ~target~, ensuring styles do not leak.
*No Style Case*: If ~style~ is nil, simply executes the body with no styling.

Example Usage:
  (with-styled-output (my-terminal '(:fg :red :attrs (:bold :underline)))
    (draw-text-at my-terminal 10 5 "Hello, World!") ;; => Draws bold, underlined red text at row 10, column 5.

CL-INPUTS.TOKENS:+K-FOCUS+

Kinds: variable

No documentation metadata.

CL-INPUTS.TOKENS:+K-KEY+

Kinds: variable

No documentation metadata.

CL-INPUTS.TOKENS:+K-MOUSE+

Kinds: variable

No documentation metadata.

CL-INPUTS.TOKENS:+K-PASTE+

Kinds: variable

No documentation metadata.

CL-INPUTS.TOKENS:+K-PROTOCOL+

Kinds: variable

No documentation metadata.

CL-INPUTS.TOKENS:+K-RESIZE+

Kinds: variable

No documentation metadata.

CL-INPUTS.TOKENS:+K-TERMINAL-RESPONSE+

Kinds: variable

No documentation metadata.

CL-INPUTS.TOKENS:INPUT-TOKEN

Kinds: type

A token representing a single input event.

Fields:
  KIND -- event kind (type: keyword, one of the +k-*+ constants)
  DATA -- event data (type: plist, e.g., (:code :enter :mods (:ctrl)))
  TS   -- timestamp (type: universal-time or monotonic integer)

All fields are required.

CL-INPUTS.TOKENS:INPUT-TOKEN-DATA

Kinds: function

No documentation metadata.

CL-INPUTS.TOKENS:INPUT-TOKEN-KIND

Kinds: function

No documentation metadata.

CL-INPUTS.TOKENS:INPUT-TOKEN-TS

Kinds: function

No documentation metadata.

CL-INPUTS.TOKENS:MAKE-TOKEN

Kinds: function

Construct an input-token of KIND with DATA and optional TS (timestamp).
If TS is not provided, uses the current universal time.

CL-INPUTS.UTIL:AS-UTF-8-BYTES

Kinds: macro

Call WRITER for every byte in the UTF-8 encoding of CHAR.

Arguments:
  CHAR   -- a character to encode (type: character)
  WRITER -- a function or macro accepting a single byte (type: (function (unsigned-byte) *))

Side Effects:
  Calls WRITER for each byte of the UTF-8 encoding of CHAR. WRITER may have side effects.

Return Value:
  None (macro expands to a series of WRITER calls).

CL-INPUTS.UTIL:STRING-TO-UTF-8-BYTES

Kinds: function

Convert STR to a freshly allocated (unsigned-byte 8) vector holding its UTF-8 bytes.

Arguments:
  STR -- a string to encode (type: string)

Return Value:
  A vector of (unsigned-byte 8) containing the UTF-8 encoding of STR. The vector
  is adjustable with a fill pointer so callers can re-use it if desired.

Side Effects:
  None.

CL-INPUTS.UTIL:WRITE-OUTPUT

Kinds: function

Write output to the terminal
This method should be implemented by subclasses of low-level-terminal.

CL-STATE.API:APPLICATION-STATE-DATA

Kinds: function

Deprecated compatibility read returning an owned logical STATE snapshot.

This public façade no longer exposes the live backing container. Prefer
STATE-REF for a borrowed path read, STATE-VALUE for an owned path read, or
STATE-SNAPSHOT for the whole logical model. Framework internals that genuinely
need representation access must name CL-STATE.CORE:APPLICATION-STATE-DATA
explicitly.

CL-STATE.API:APPLICATION-STATE-LOG

Kinds: function

Return an owned compatibility view of STATE's mutation log.

Opaque internal missing/deletion markers are projected to :NOT-PRESENT and
:ELMTUI-DELETE-PATH.  Internal transaction/undo code continues to use
CL-STATE.CORE:APPLICATION-STATE-LOG directly so rollback identity is not lost.

CL-STATE.CORE:STATE-MUTATION-POLICY

Kinds: variable

Dynamic policy for APPLICATION-STATE mutation through the CL-STATE API.

:ALLOW permits mutation. :FORBID signals STATE-MUTATION-FORBIDDEN before a
supported mutator changes logical state. ElmTUI binds :FORBID while executing
strict-Elm user decision/view/subscription code, then restores :ALLOW for the
internal fresh-state commit.

CL-STATE.CORE:TRANSACTION-ACTIVE

Kinds: variable

True while a CL-STATE transaction boundary is active.

CL-STATE.CORE:APPLICATION-STATE

Kinds: type

Managed application state containing backing data, backend, synchronization, history, version, revision and observer state.

CL-STATE.CORE:APPLICATION-STATE-BACKEND

Kinds: function

Return the physical storage backend; use SET-APPLICATION-STATE-BACKEND for safe conversion.

CL-STATE.CORE:APPLICATION-STATE-DATA

Kinds: function

Low-level representation accessor for APPLICATION-STATE.

This accessor exposes the live backing container and is intentionally confined
to CL-STATE.CORE. Application code should use STATE-REF for a borrowed path
read, STATE-VALUE for an owned path value, or STATE-SNAPSHOT for an owned whole
model. Destructive mutation through this representation accessor bypasses state
locking, versioning, observers, history, and strict snapshot guarantees.

CL-STATE.CORE:APPLICATION-STATE-HISTORY

Kinds: function

Return the state history records used by undo and redo logic.

CL-STATE.CORE:APPLICATION-STATE-LOCK

Kinds: function

Return the mutex guarding a managed application state.

CL-STATE.CORE:APPLICATION-STATE-LOG

Kinds: function

Return the mutation log maintained by supported state writes.

CL-STATE.CORE:APPLICATION-STATE-OBSERVERS

Kinds: function

Return registered state observers; use the supported observer API for changes.

CL-STATE.CORE:APPLICATION-STATE-P

Kinds: function

Return true if the value is an APPLICATION-STATE object.

CL-STATE.CORE:APPLICATION-STATE-PLIST

Kinds: function

Return an owned plist representation of STATE's logical model.

CL-STATE.CORE:APPLICATION-STATE-REVISION

Kinds: function

Return the logical commit revision used for optimistic write preconditions.

CL-STATE.CORE:APPLICATION-STATE-UNDONE

Kinds: function

Return entries from the undo history staged for redo.

CL-STATE.CORE:APPLICATION-STATE-VERSION

Kinds: function

Return the state version updated as logical mutations occur.

CL-STATE.CORE:ASSERT-STATE-MUTATION-ALLOWED

Kinds: function

Signal STATE-MUTATION-FORBIDDEN when STATE is frozen or dynamically read-only.

CL-STATE.CORE:ASSERT-STATE-REVISION

Kinds: function

Atomically require STATE to have EXPECTED-REVISION or signal STATE-REVISION-CONFLICT.

CL-STATE.CORE:ASSERT-VALID-STATE-PATH

Kinds: function

Return PATH or signal INVALID-STATE-PATH with the rejected value.

CL-STATE.CORE:COPY-STATE-VALUE

Kinds: function

Return an owned logical copy of VALUE for crossing a state ownership boundary.

Built-in hash tables, cons trees, and vectors are copied recursively. Immutable
atoms are returned as-is. Custom mutable leaf types should specialize this
generic and return an independent value.

CL-STATE.CORE:DEEP-COPY-APPLICATION-STATE

Kinds: function

Return an independent mutable state copied from one stable managed view.

Built-in container spines are detached while APP is locked; extensible
COPY-STATE-VALUE methods run only after that lock has been released.

CL-STATE.CORE:DEEP-COPY-DATA

Kinds: function

Compatibility alias for COPY-STATE-VALUE.

New state-boundary code should call COPY-STATE-VALUE explicitly so custom leaf
specializations participate in ownership transfer.

CL-STATE.CORE:FREEZE-STATE-VALUE

Kinds: function

Return VALUE in a representation suitable for persistent structural sharing.

Built-in containers are recursively copied. Custom mutable leaf types should
specialize this generic to return an immutable/persistent representation when
strict snapshot semantics require more than COPY-STATE-VALUE.

CL-STATE.CORE:GET-COMPONENT-BY-PATH

Kinds: function

Retrieve a component instance from APP-STATE using its ID path.

CL-STATE.CORE:GET-STATE

Kinds: function

Convenience wrapper for state-ref.

CL-STATE.CORE:INVALID-STATE-PATH

Kinds: type

Signaled when a CL-STATE operation receives an invalid logical path.

CL-STATE.CORE:INVALID-STATE-PATH-PATH

Kinds: function

Return the malformed state path retained by an INVALID-STATE-PATH condition.

CL-STATE.CORE:MAKE-APPLICATION-STATE

Kinds: function

Construct raw managed state slots; prefer MAKE-STATE for validated copied initial values.

CL-STATE.CORE:MAKE-STATE

Kinds: function

Create an application state object.

Arguments:
+ ~:initial~ — The initial data to populate the state. This can be any data structure compatible with the chosen backend.
+ ~:backend~ — The backend type for storing the state: ~:hash-table~ (default) or ~:plist~.

Returns:
+ A new application state object created by ~make-application-state~, initialized with the given data and backend.

Usage:
  (make-state :initial '(:foo 42 :bar 99))
  (make-state :initial '(:foo 42) :backend :plist)

Notes:
+ All arguments are keyword arguments; you must use ~:initial~ and ~:backend~ when calling the function.
+ Supported mutable containers in ~:initial~ are recursively copied before storage, so the new state owns its container graph.
+ The function expects that ~%normalize-backend~ and ~%coerce-initial~ are defined elsewhere and handle backend normalization and data coercion.

See Also:
+ ~%normalize-backend~
+ ~%coerce-initial~
+ ~make-application-state~

CL-STATE.CORE:PERSISTENT-STATE-VALUE-P

Kinds: function

Return true when VALUE is known safe for persistent sharing under the state contract.

The predicate is diagnostic rather than an admission gate: unknown custom leaf
types return NIL for compatibility, while applications can specialize it after
providing COPY-STATE-VALUE/FREEZE-STATE-VALUE methods.

CL-STATE.CORE:SET-APPLICATION-STATE-BACKEND

Kinds: function

Convert STATE's physical representation without changing logical revision.

CL-STATE.CORE:STATE-CONFLICT

Kinds: type

Base condition for optimistic/concurrent managed-state access conflicts.

CL-STATE.CORE:STATE-CONFLICT-OPERATION

Kinds: function

Return the operation associated with a managed state conflict.

CL-STATE.CORE:STATE-CONFLICT-STATE

Kinds: function

Return the managed state object associated with a conflict.

CL-STATE.CORE:STATE-FROZEN-P

Kinds: function

Return true when STATE is a frozen APPLICATION-STATE snapshot.

CL-STATE.CORE:STATE-MUTATION-FORBIDDEN

Kinds: type

Condition signaled when supported state mutation is forbidden by the current dynamic policy.

CL-STATE.CORE:STATE-MUTATION-FORBIDDEN-OPERATION

Kinds: function

Return the operation keyword describing the rejected state mutation.

CL-STATE.CORE:STATE-MUTATION-FORBIDDEN-PATH

Kinds: function

Return the state path associated with a rejected mutation, or NIL when not path-specific.

CL-STATE.CORE:STATE-MUTATION-FORBIDDEN-STATE

Kinds: function

Return the APPLICATION-STATE whose mutation was rejected.

CL-STATE.CORE:STATE-REF

Kinds: function

Return the logical value at KEY without copying it.

For APPLICATION-STATE this is a borrowed read: container values may be shared
with strict snapshots and must not be destructively modified. Use STATE-VALUE
when the caller needs an owned mutable copy.

CL-STATE.CORE:STATE-REVISION

Kinds: function

Return STATE's monotonic logical commit revision.

CL-STATE.CORE:STATE-REVISION-CONFLICT

Kinds: type

Signaled before mutation when an optimistic revision precondition is stale.

CL-STATE.CORE:STATE-REVISION-CONFLICT-ACTUAL-REVISION

Kinds: function

Return the revision found in state when a conditional write was rejected.

CL-STATE.CORE:STATE-REVISION-CONFLICT-EXPECTED-REVISION

Kinds: function

Return the requested revision that failed an optimistic-write precondition.

CL-STATE.CORE:STATE-SET

Kinds: function

Set VALUE at KEY through the supported STATE-REF mutation path.

For APPLICATION-STATE this mutates logical state, appends a log entry, increments
VERSION, and increments REVISION for a direct commit. Transaction-local writes
leave REVISION unchanged until their outer transaction commits. Observers run
after the state lock is released; callback failure does not undo a direct
mutation. Strict or frozen application states reject before mutation.

CL-STATE.CORE:STATE-SET-IF-REVISION

Kinds: function

Atomically set KEY only when STATE still has EXPECTED-REVISION.

A stale precondition signals STATE-REVISION-CONFLICT before logical state,
version, revision, log/history, or observer delivery changes. On success return
VALUE and the resulting revision as two values.

CL-STATE.CORE:STATE-SNAPSHOT

Kinds: function

Return an owned copy of STATE's complete logical model.

Managed APPLICATION-STATE snapshots detach their built-in container graph under
the state lock and reject a foreign in-progress transaction. Extensible
COPY-STATE-VALUE methods then run after that lock is released. Runtime metadata
such as locks, observers, history, and undo stacks is not part of this value.
Raw hash-table/list inputs are copied directly.

CL-STATE.CORE:STATE-TRANSACTION-CONFLICT

Kinds: type

Signaled when a managed operation requires a stable state owned by another transaction.

CL-STATE.CORE:STATE-VALUE

Kinds: function

Return an owned logical copy of the value at KEY in STATE.

For APPLICATION-STATE the lookup and ownership copy occur under one internal
lock and reject a foreign in-progress transaction. Raw containers retain their
historical direct-copy behavior.

CL-STATE.CORE:STATE-VALUE-AT-REVISION

Kinds: function

Atomically return an owned KEY value and STATE's committed REVISION.

Unlike separate STATE-VALUE and STATE-REVISION calls, the two values describe
one lock-protected observation. If another transaction currently owns STATE,
STATE-TRANSACTION-CONFLICT is signaled rather than exposing an in-progress value
paired with the last committed revision. Extensible COPY-STATE-VALUE methods run
after the internal state lock is released.

CL-STATE.CORE:VALID-STATE-PATH-P

Kinds: function

Return true when PATH is a symbol or a proper list of non-NIL symbols.

CL-STATE.OBSERVER:ADD-OBSERVER

Kinds: function

Register runtime observer FN for KEY in APP.

Observer registration is runtime metadata, not logical model mutation. It is
therefore allowed on frozen snapshots, does not increment model VERSION or
REVISION, and is copied into a descendant strict snapshot only when that
descendant is committed.

CL-STATE.OBSERVER:NOTIFY-OBSERVERS

Kinds: function

Notify APP observers for KEY in registration order.

The observer list is captured while APP's internal lock is held, then the lock
is released before any callback executes. Observers fail fast by default. An
arbitrary callback error is wrapped in OBSERVER-NOTIFICATION-ERROR with the
callback, values, phase, and original cause. A handler may explicitly invoke
CONTINUE-OBSERVER-NOTIFICATION to skip that failed callback and continue with
later observers. Notification never rolls back logical state.

CL-STATE.OBSERVER:OBSERVER-NOTIFICATION-ERROR

Kinds: type

Inspect an observer callback failure without hiding the original cause.

CL-STATE.OBSERVER:OBSERVER-NOTIFICATION-ERROR-CAUSE

Kinds: function

No documentation metadata.

CL-STATE.OBSERVER:OBSERVER-NOTIFICATION-ERROR-KEY

Kinds: function

No documentation metadata.

CL-STATE.OBSERVER:OBSERVER-NOTIFICATION-ERROR-NEW-VALUE

Kinds: function

No documentation metadata.

CL-STATE.OBSERVER:OBSERVER-NOTIFICATION-ERROR-OBSERVER

Kinds: function

No documentation metadata.

CL-STATE.OBSERVER:OBSERVER-NOTIFICATION-ERROR-OLD-VALUE

Kinds: function

No documentation metadata.

CL-STATE.OBSERVER:OBSERVER-NOTIFICATION-ERROR-PHASE

Kinds: function

No documentation metadata.

CL-STATE.OBSERVER:OBSERVER-NOTIFICATION-ERROR-STATE

Kinds: function

No documentation metadata.

CL-STATE.OBSERVER:REMOVE-OBSERVER

Kinds: function

Remove runtime observer FN for KEY from APP.

This metadata operation is allowed on frozen snapshots and does not change the
logical model/version/revision/history. Returns true only when FN was registered
and removed.

CL-STATE.PATCH:APPLY-PATCH

Kinds: function

Apply P to a raw container or APPLICATION-STATE.

APPLICATION-STATE operations mutate the supported logical model path and use the
same log/version/observer policy as STATE-SET. A remove patch records a deletion
only when the path exists. Example: APPLY-PATCH with a SET patch at :COUNT and
value 3 changes :COUNT to 3.

CL-STATE.PATCH:APPLY-PATCHES

Kinds: function

Apply PATCHES in order.

For raw containers this is a direct reduction. For APPLICATION-STATE values,
the whole batch joins an existing transaction for STATE or otherwise creates
one undoable transaction. Example: setting (:USER :NAME) to Ada and removing
:STALE in one PATCHES list commits both mutations atomically.

CL-STATE.PATCH:APPLY-PATCHES-PERSISTENT

Kinds: function

Return the post-PATCHES state without mutating STATE.

APPLICATION-STATE values are deeply copied across the supported CL-STATE
container graph before the transactional patch engine runs against the fresh
copy. The returned state has normal log/version/history/observer semantics while
the caller's previous state remains observationally unchanged. Raw list/hash-
table containers are also copied before patch application.

This function is the commit primitive used by ElmTUI's :STRICT-ELM application
mode. For example, setting :COUNT on the returned state never changes :COUNT on
STATE. Observer failure is reported for the fresh committed state and does not
mutate or roll back the source STATE.

Custom mutable leaf objects are treated atomically by DEEP-COPY-DATA because
Common Lisp has no portable universal object-copy protocol. Such leaves must be
application-immutable or copied before insertion when strict value semantics are
required.

CL-STATE.PATCH:DIFF-STATES

Kinds: function

Return shorthand patches whose sequential application transforms OLD into NEW.

CL-STATE.PATCH:INVALID-PATCH-FORMAT

Kinds: type

Validation condition for an unsupported patch input format.

CL-STATE.PATCH:INVALID-PATCH-OPERATION

Kinds: type

Validation condition for an operation outside :SET :REMOVE :MERGE and :UPDATE.

CL-STATE.PATCH:INVALID-PATCH-OPERATION-OPERATION

Kinds: function

Return the rejected patch operation retained by the validation condition.

CL-STATE.PATCH:INVALID-PATCH-PATH

Kinds: type

Validation condition for invalid paths; a path is a symbol or a nonempty proper list of symbols.

CL-STATE.PATCH:INVALID-PATCH-PATH-PATH

Kinds: function

Return the invalid logical state path recorded by a patch condition.

CL-STATE.PATCH:INVALID-PATCH-VALUE

Kinds: type

Validation condition when a patch value is incompatible with the selected operation.

CL-STATE.PATCH:INVALID-PATCH-VALUE-OPERATION

Kinds: function

Return the operation associated with the rejected patch value.

CL-STATE.PATCH:INVALID-PATCH-VALUE-VALUE

Kinds: function

Return the value rejected by operation-specific patch validation.

CL-STATE.PATCH:MAKE-PATCH

Kinds: function

Create a validated patch from :PATH :OP and :VALUE; malformed inputs signal typed validation conditions.

CL-STATE.PATCH:MERGE-PATCH

Kinds: function

Merge one shorthand patch into STATE and return the modified state.

CL-STATE.PATCH:MERGE-PATCHES

Kinds: function

Merge a list of PATCHES into STATE.
Returns the modified STATE (functional API).

CL-STATE.PATCH:NORMALIZE-PATCHES

Kinds: function

Return validated patch records for each record or two-element shorthand in PATCHES, preserving order.

CL-STATE.PATCH:PATCH

Kinds: function, type

Build an update-result from flat KEY VALUE pairs.
Each KEY names a top-level state slot; VALUE is its new value.
For nested paths or commands, use MAKE-UPDATE-RESULT directly.

CL-STATE.PATCH:PATCH-OP

Kinds: function

Return the validated operation keyword of a state patch, such as :SET, :REMOVE, :MERGE or :UPDATE.

CL-STATE.PATCH:PATCH-P

Kinds: function

Return true if the value is a CL-STATE PATCH record.

CL-STATE.PATCH:PATCH-PATH

Kinds: function

Return the logical state path selected for mutation.

CL-STATE.PATCH:PATCH-VALIDATION-ERROR

Kinds: type

Base condition retaining rejected patch input and the validation reason.

CL-STATE.PATCH:PATCH-VALIDATION-ERROR-INPUT

Kinds: function

Return the original invalid patch form received by the validator.

CL-STATE.PATCH:PATCH-VALIDATION-ERROR-REASON

Kinds: function

Return the reason keyword describing why the supplied state patch failed validation.

CL-STATE.PATCH:PATCH-VALUE

Kinds: function

Return the operand for a patch; :UPDATE patches use a function designator.

CL-STATE.SCHEMA:DEFINE-TYPE-PREDICATE

Kinds: macro

Define and register a type predicate

CL-STATE.SCHEMA:FINITE-NUMBER-P

Kinds: function

True for finite real and complex numbers, rejecting nonfinite components.

CL-STATE.SCHEMA:KEYWORD-SYMBOL-P

Kinds: function

No documentation metadata.

CL-STATE.SCHEMA:LIST-REGISTERED-TYPES

Kinds: function

List all registered type predicates

CL-STATE.SCHEMA:LOOKUP-TYPE-PREDICATE

Kinds: function

Get a predicate for a type

CL-STATE.SCHEMA:MAKE-ENUM-PREDICATE

Kinds: function

Create a predicate that validates against an enumeration of values

CL-STATE.SCHEMA:NON-EMPTY-STRING-P

Kinds: function

No documentation metadata.

CL-STATE.SCHEMA:NON-NEGATIVE-INTEGER-P

Kinds: function

No documentation metadata.

CL-STATE.SCHEMA:POSITIVE-INTEGER-P

Kinds: function

No documentation metadata.

CL-STATE.SCHEMA:REGISTER-ENUM-TYPE

Kinds: function

Register an enum type with the allowed values

CL-STATE.SCHEMA:REGISTER-TYPE-PREDICATE

Kinds: function

Register a predicate for a type

CL-STATE.SCHEMA:VALIDATE-TYPE

Kinds: function

Validate that a value satisfies a type predicate

CL-STATE.TX:MAKE-TX

Kinds: function

No documentation metadata.

CL-STATE.TX:REDO

Kinds: function

Redo the last undone transaction without observer delivery. Successful replay advances REVISION exactly once while retaining the historical compatibility rule that VERSION does not change.

CL-STATE.TX:TX

Kinds: type

No documentation metadata.

CL-STATE.TX:TX-CHANGES

Kinds: function

No documentation metadata.

CL-STATE.TX:TX-ID

Kinds: function

No documentation metadata.

CL-STATE.TX:TX-NAME

Kinds: function

No documentation metadata.

CL-STATE.TX:TX-P

Kinds: function

No documentation metadata.

CL-STATE.TX:UNDO

Kinds: function

Undo the last committed transaction without observer delivery. Successful replay advances REVISION exactly once while retaining the historical compatibility rule that VERSION does not change.

CL-STATE.TX:WITH-TRANSACTION

Kinds: macro

Execute BODY as one reserved logical-state transaction on APP.

EXPECTED-REVISION is an optimistic precondition checked atomically before APP is
reserved. Same-state nesting joins the outer transaction and may repeat the
same revision precondition; it is not a savepoint. Other supported writers are
rejected with STATE-TRANSACTION-CONFLICT while the outer body is active.
Rollback restores logical values, physical backend, VERSION, log, history, and redo metadata;
REVISION advances exactly once only after a successful outer commit. Observer
callbacks run after reservation is released and after all internal locks are
released.

CL-STATE.UNDO:HISTORY

Kinds: type

No documentation metadata.

CL-STATE.UNDO:HISTORY-FUTURE

Kinds: function

No documentation metadata.

CL-STATE.UNDO:HISTORY-PAST

Kinds: function

No documentation metadata.

CL-STATE.UNDO:HISTORY-REDO

Kinds: function

Redo to next state. Returns the redone state (moved back to past).

CL-STATE.UNDO:HISTORY-UNDO

Kinds: function

Undo to previous state. Returns the previous state, or nil if at beginning.

CL-STATE.UNDO:MAKE-HISTORY

Kinds: function

No documentation metadata.

CL-STATE.UNDO:PUSH-SNAPSHOT

Kinds: function

Push STATE as the current snapshot. Clears future stack if STATE differs from current.

CL-STATE.UTILS:COERCE-DATA

Kinds: function

Coerce DATA to BACKEND (:hash-table or :plist) when possible.

CL-STATE.UTILS:GET-PATH

Kinds: function

Read value at PATH inside DATA; return DEFAULT when missing.

CL-STATE.UTILS:HASH-TABLE->PLIST

Kinds: function

Convert a hash-table to a plist. Recursively converts nested hash-tables.

CL-STATE.UTILS:PLIST->HASH-TABLE

Kinds: function

Convert a plist to a hash-table. Recursively converts nested plist-like lists.

CL-STATE.UTILS:REMOVE-PATH

Kinds: function

Delete item at PATH. Returns two values: NEW-DATA, REMOVEDP.

CL-STATE.UTILS:SET-PATH

Kinds: function

Store VALUE at PATH inside DATA, creating intermediate nodes when CREATEP.

CL-STATE.VALIDATION:DEFINE-VALIDATOR

Kinds: macro

Define NAME as a validator whose BODY returns T or an error message.

CL-STATE.VALIDATION:MAKE-VALIDATOR

Kinds: function

Create a validator function from PREDICATE and ERROR-MESSAGE.

CL-STATE.VALIDATION:REGISTER-TYPE-VALIDATOR

Kinds: function

Compatibility name for REGISTER-TYPE-PREDICATE.

CL-STATE.VALIDATION:TYPE-PREDICATE

Kinds: function

Return the predicate registered for TYPE-NAME.

CL-STATE.VALIDATION:VALIDATE-FIELD

Kinds: function

Validate VALUE against TYPE and signal VALIDATION-ERROR on mismatch.

CL-STATE.VALIDATION:VALIDATE-MODEL-SCHEMA

Kinds: function

Validate MODEL using SCHEMA or an embedded SCHEMA slot.

When MODEL also has a DATA slot, the embedded schema describes that data
container rather than the wrapper object itself.

CL-STATE.VALIDATION:VALIDATE-NESTED

Kinds: function

Validate OBJECT fields according to SCHEMA entries (FIELD TYPE).

CL-STATE.VALIDATION:VALIDATION-ERROR

Kinds: type

No documentation metadata.

CL-STATE.VALIDATION:VALIDATION-ERROR-MESSAGE

Kinds: function

No documentation metadata.

CL-STATE.VALIDATION:VALIDATION-ERROR-PATH

Kinds: function

No documentation metadata.

CL-STATE.VALIDATION:VALIDATION-ERROR-VALUE

Kinds: function

No documentation metadata.

CL-STATE.VALIDATION:WITH-VALIDATION

Kinds: macro

Run BODY while reporting validation failures before they unwind normally.

CL-STYLES.ADAPTERS:NORMALIZE-TUI-DECLARATIONS

Kinds: function

Normalize ElmTUI compatibility declarations without weakening core validation.

Legacy TUI spellings are translated once at style ingress.  The reusable
property engine can therefore stay strict while render/layout code receives a
canonical declaration vocabulary.

CL-STYLES.ADAPTERS:NORMALIZE-TUI-STYLE-PLIST

Kinds: function

Extract terminal colors/attributes from PLIST without rebuilding declarations.

This function sits on the per-node render hot path.  Declaration compatibility
normalization belongs at style ingress in NORMALIZE-TUI-DECLARATIONS; rendering
only needs a small alias-aware projection.

CL-STYLES.ENGINE:CASCADE-SEMANTICS-REVISION

Kinds: variable

Current identifier for the ordered style cascade semantics; recorded in computed style revisions.

CL-STYLES.ENGINE:APPLY-STYLESHEET

Kinds: function

Apply SHEET to a flat list of OBJECTS, returning either :patches or :objects.

If :patches, return a list of style-patch structs with the path to the object and its computed style.
If :objects, return a list of the objects themselves with their computed styles set.

Objects must implement the cl-styles.protocols interface.

Arguments:
 SHEET    A cl-styles.sheet:stylesheet object.
 OBJECTS  A list of objects implementing cl-styles.protocols.
 RETURN   Either :patches (default) or :objects.

Returns:
 A list of style-patch structs or objects with computed styles set.

Example:
 (apply-stylesheet (make-stylesheet :rules ((defrule (type> :button) :color :red)))
                   (list (make-object :id :btn1 :type :button)
                        (make-object :id :lbl1 :type :label))
                   :return :patches)
 => (#<STYLE-PATCH path (:BY-KEY :BTN1) computed (:COLOR :RED)
      #<STYLE-PATCH path (:BY-KEY :LBL1) computed NIL)
or if :return :objects:
  => (#<OBJECT id :BTN1 type :BUTTON computed (:COLOR :RED)>
      #<OBJECT id :LBL1 type :LABEL computed NIL>)

CL-STYLES.ENGINE:APPLY-STYLESHEET-TO-TREE

Kinds: function

Apply SHEET to ROOT by full recomputation.
CACHE and PREVIOUS-SIGNATURE are accepted for source compatibility but ignored;
revision-safe caching is a separate contract and stale cached style is never reused.

CL-STYLES.ENGINE:COMPUTE-STYLE

Kinds: function

Compute OBJ style using defaults < inheritance < rules < inline precedence.
Rules sort by specificity and retain source order for ties; later tied rules win.

CL-STYLES.ENGINE:COMPUTE-STYLE-RESULT

Kinds: function

Return a first-class computed style result with an explicit cascade revision.

CL-STYLES.ENGINE:COMPUTED-STYLE-RESULT

Kinds: type

Computed cascade result containing resolved style, revision, optional declaration trace and diagnostics.

CL-STYLES.ENGINE:COMPUTED-STYLE-RESULT-DIAGNOSTICS

Kinds: function

Return variable-resolution diagnostics recorded while tracing a computed style.

CL-STYLES.ENGINE:COMPUTED-STYLE-RESULT-REVISION

Kinds: function

Return the style revision combining cascade semantics and stylesheet revision identifiers.

CL-STYLES.ENGINE:COMPUTED-STYLE-RESULT-STYLE

Kinds: function

Return the computed style property list for the styled element.

CL-STYLES.ENGINE:COMPUTED-STYLE-RESULT-TRACE

Kinds: function

Return the ordered declaration trace, when computation requested tracing.

CL-STYLES.ENGINE:DECLARATION-TRACE

Kinds: type

Record of one candidate declaration's property, value, origin, selector, specificity and winning status.

CL-STYLES.ENGINE:DECLARATION-TRACE-ORIGIN

Kinds: function

Return the source origin of the declaration, such as :DEFAULT, :INHERITED, :RULE or :INLINE.

CL-STYLES.ENGINE:DECLARATION-TRACE-PROPERTY

Kinds: function

Return the style property key associated with a declaration trace entry.

CL-STYLES.ENGINE:DECLARATION-TRACE-SELECTOR

Kinds: function

Return the rule selector associated with a traced declaration, or NIL for non-rule sources.

CL-STYLES.ENGINE:DECLARATION-TRACE-SOURCE-DECLARATIONS

Kinds: function

Return the original property declarations before variable normalization and expansion.

CL-STYLES.ENGINE:DECLARATION-TRACE-SOURCE-ORDER

Kinds: function

Return the stylesheet order index recorded for the candidate declaration.

CL-STYLES.ENGINE:DECLARATION-TRACE-SPECIFICITY

Kinds: function

Return the CSS-like specificity triple or :INLINE marker associated with the declaration.

CL-STYLES.ENGINE:DECLARATION-TRACE-STATUS

Kinds: function

Return the trace status :WINNER or :OVERRIDDEN after later declarations have been applied.

CL-STYLES.ENGINE:DECLARATION-TRACE-VALUE

Kinds: function

Return the normalized property value recorded for a declaration trace entry.

CL-STYLES.ENGINE:DECLARATION-TRACE-VARIABLE-EXPANSIONS

Kinds: function

Return variable expansion metadata captured while resolving this declaration.

CL-STYLES.ENGINE:EXPLAIN-STYLE

Kinds: function

Explain OBJ's cascade without mutating it.
The trace marks every candidate :WINNER or :OVERRIDDEN and records origin,
specificity, source order, source declarations, and variable expansion.

CL-STYLES.ENGINE:INHERIT-PROPERTIES

Kinds: function

Compatibility stub: currently ignores PARENT and CHILD and returns NIL; not a supported inheritance engine.

CL-STYLES.ENGINE:MATCH-RULES

Kinds: function

Return matched stylesheet rules paired with CSS-like specificity triples in stylesheet traversal order.

CL-STYLES.ENGINE:STYLE-PATCH

Kinds: type

Immutable-shaped style application record carrying target PATH and COMPUTED style; structure slots remain assignable.

CL-STYLES.ENGINE:STYLE-PATCH-COMPUTED

Kinds: function

Return the computed style property list contained in a style application patch.

CL-STYLES.ENGINE:STYLE-PATCH-PATH

Kinds: function

Return the node key path targeted by an applied stylesheet patch.

CL-STYLES.ENGINE:STYLE-REVISION

Kinds: type

Version record containing cascade semantics revision and originating stylesheet revision.

CL-STYLES.ENGINE:STYLE-REVISION-CASCADE

Kinds: function

Return the cascade semantics revision used to compute the style.

CL-STYLES.ENGINE:STYLE-REVISION-STYLESHEET

Kinds: function

Return the source stylesheet revision, or NIL if no stylesheet was provided.

CL-STYLES.PROPERTIES:DEFINE-GROUP

Kinds: function

Register GROUP with unique property names from PROPS and return the resulting group property list.

CL-STYLES.PROPERTIES:DEFPROPERTY

Kinds: macro

Macro registering a style property with type, enum, synonyms, group, default and documentation metadata.

CL-STYLES.PROPERTIES:ENSURE-DECLARATIONS

Kinds: function

Normalize declaration keys and values before validating against registered style property contracts.

CL-STYLES.PROPERTIES:ENSURE-STATIC-DECLARATIONS

Kinds: function

Validate static declaration shape, known properties, and literal values.
Variable references are type-checked after resolution; a literal fallback is checked now.

CL-STYLES.PROPERTIES:EXPECTED

Kinds: function

Return the type or constraint expected by a STYLE-CONTRACT-VIOLATION condition.

CL-STYLES.PROPERTIES:GOT

Kinds: function

Return the rejected value recorded by a STYLE-CONTRACT-VIOLATION condition.

CL-STYLES.PROPERTIES:GROUPS-FOR-LAYOUT

Kinds: function

Register LAYOUT with a deduplicated list of named style property groups.

CL-STYLES.PROPERTIES:NORMALIZE-DECLARATIONS

Kinds: function

Normalize the keys and values in a property list (PLIST).

This function ensures that all keys in the property list are normalized
(using `%normalize-key`) and that their corresponding values are also normalized
(using `%normalize-value`). The original keys are replaced with their normalized
versions, and duplicate keys are avoided.

Arguments:
- PLIST: A property list where keys and values may need normalization.

Returns:
- A new property list with normalized keys and values.

Example:
  (normalize-declarations '(:MARGIN-LEFT 10 :MARGIN-RIGHT 10 :MARGIN-BOTTOM 5 :MARGIN-TOP 5
                           :PADDING-LEFT 10 :PADDING-BOTTOM 10 :PADDING-RIGHT 10 :PADDING-TOP 10
                           :COLOR :BLUE :PADDING 10 :MARGIN (5 10) :FONT-FAMILY "Arial"))
  ;; Returns: (:MARGIN-LEFT 10 :MARGIN-RIGHT 10 :MARGIN-BOTTOM 5 :MARGIN-TOP 5
  ;;           :PADDING-LEFT 10 :PADDING-BOTTOM 10 :PADDING-RIGHT 10 :PADDING-TOP 10
  ;;           :COLOR :BLUE :PADDING 10 :MARGIN (5 10) :FONT-FAMILY "Arial")

CL-STYLES.PROPERTIES:PROPERTIES-FOR-GROUP

Kinds: function

Return a fresh copy of the properties registered under GROUP, or NIL for an unknown group.

CL-STYLES.PROPERTIES:PROPERTIES-FOR-LAYOUT

Kinds: function

Return unique properties collected from the groups registered for LAYOUT.

CL-STYLES.PROPERTIES:PROPERTY-DEFAULT

Kinds: function

Return a property's explicit default and whether a default was supplied.

CL-STYLES.PROPERTIES:PROPERTY-DEFAULTS

Kinds: function

Return a deterministic plist of explicitly declared property defaults.

CL-STYLES.PROPERTIES:PROPERTY-DEFINITION

Kinds: function

Look up NAME directly in the global property registry, returning its definition plist or NIL.

CL-STYLES.PROPERTIES:REGISTER-PROPERTY

Kinds: function

Register a style property definition plist under NAME, replacing any existing registry entry.

CL-STYLES.PROPERTIES:REGISTER-PROPERTY-ALIAS

Kinds: function

Register ALIAS as an alternate spelling for CANONICAL-NAME.

CL-STYLES.PROPERTIES:STYLE-CONTRACT-VIOLATION

Kinds: type

Condition raised for malformed declarations or values violating registered style property types and enums.

CL-STYLES.PROPERTIES:VALIDATE-DECLARATIONS

Kinds: function

Validate the types of values in a property list (PLIST) against their definitions.
This function checks each key-value pair in the property list to ensure that
the value conforms to the expected type defined for that property. If a value
does not match the expected type, a `style-contract-violation` error is raised.

Arguments:
- PLIST: A property list where keys are property names and values are the corresponding values to validate.
Returns:
- The original property list if all values are valid.
Raises:
- `style-contract-violation`: If any value does not conform to the expected type for its property.

CL-STYLES.PROPERTIES:WHERE

Kinds: function

Return the property key or declaration context where a STYLE-CONTRACT-VIOLATION was raised.

CL-STYLES.PROTOCOLS:GET-COMPUTED-STYLE

Kinds: function

Return previously computed style plist or NIL.

CL-STYLES.PROTOCOLS:SET-COMPUTED-STYLE

Kinds: function

Attach computed style. In TEA return a PATCH or a NEW-OBJ (pure).

CL-STYLES.PROTOCOLS:STYLABLE-ATTRIBUTES

Kinds: function

Arbitrary attributes for [attr=value] selectors. Return plist/alist.

CL-STYLES.PROTOCOLS:STYLABLE-CHILDREN

Kinds: function

Return sequence of children (list/vector).

CL-STYLES.PROTOCOLS:STYLABLE-CLASSES

Kinds: function

List of classes for .class selectors. Return list of keyword/string.

CL-STYLES.PROTOCOLS:STYLABLE-ID

Kinds: function

Stable identifier for #id selectors. Return keyword/string or NIL.

CL-STYLES.PROTOCOLS:STYLABLE-INDEX

Kinds: function

0-based index among siblings (for nth/first/last).

CL-STYLES.PROTOCOLS:STYLABLE-INLINE-STYLE

Kinds: function

Inline style plist (highest priority before !important).

CL-STYLES.PROTOCOLS:STYLABLE-KEY

Kinds: function

No documentation metadata.

CL-STYLES.PROTOCOLS:STYLABLE-NAMESPACE

Kinds: function

No documentation metadata.

CL-STYLES.PROTOCOLS:STYLABLE-PARENT

Kinds: function

Return parent or NIL.

CL-STYLES.PROTOCOLS:STYLABLE-STATE

Kinds: function

State flags for pseudo-classes (e.g., :focus :disabled). Return plist/list.

CL-STYLES.PROTOCOLS:STYLABLE-THEME

Kinds: function

No documentation metadata.

CL-STYLES.PROTOCOLS:STYLABLE-TYPE

Kinds: function

Node/tag type for type selectors. Return keyword/symbol.

CL-STYLES.RULE:DEFRULE

Kinds: macro

Create a rule. Declarations are a property list of property/value pairs.

This macro processes the declarations to ensure that list literals starting
with a number or keyword (e.g., (1 1 0) for :flex or (0 1) for :padding) are
wrapped in `(list ...)` so they are treated as data, not function calls.
Values starting with a symbol (e.g., (rgb ...)) are left as-is to evaluate.

Arguments:
- SELECTOR: A CSS-like selector to which the rule applies.
- DECLARATIONS: A property list of property/value pairs.

Returns:
- A `make-rule` form with the processed selector, declarations, and specificity.

Example:
  (defrule ".example"
    :color (rgb 255 0 0)
    :padding (10 20))
  ;; Expands to:
  ;; (make-rule
  ;;  :selector (cl-styles.selector:compile-selector ".example")
  ;;  :declarations (list :color (rgb 255 0 0) :padding (list 10 20))
  ;;  :specificity (cl-styles.selector:selector-specificity ".example"))

CL-STYLES.RULE:EXPAND-SHORTHANDS

Kinds: function

Expand common CSS-like shorthands into longhands.
Supports: :padding, :margin, :gap → (:row-gap :column-gap). Longhands win.

CL-STYLES.RULE:INVALID-RULE

Kinds: type

No documentation metadata.

CL-STYLES.RULE:INVALID-RULE-REASON

Kinds: function

No documentation metadata.

CL-STYLES.RULE:INVALID-RULE-RULE

Kinds: function

No documentation metadata.

CL-STYLES.RULE:MAKE-RULE

Kinds: function

Construct a validated style rule with TUI compatibility normalized at ingress.

CL-STYLES.RULE:RULE

Kinds: type

No documentation metadata.

CL-STYLES.RULE:RULE-DECLARATIONS

Kinds: function

No documentation metadata.

CL-STYLES.RULE:RULE-SELECTOR

Kinds: function

No documentation metadata.

CL-STYLES.RULE:RULE-SPECIFICITY

Kinds: function

No documentation metadata.

CL-STYLES.RULE:VALIDATE-RULE

Kinds: function

Validate a constructed rule and return it.

CL-STYLES.SELECTOR:ATTR>

Kinds: function

Construct an attribute selector keyed by KEY, with optional VALUE; when VALUE is omitted, match truthy attribute presence.

CL-STYLES.SELECTOR:CHILD>

Kinds: function

Construct a direct-child relationship selector combining parent and child match criteria.

CL-STYLES.SELECTOR:CLS>

Kinds: function

Construct a class selector requiring every supplied class name.

CL-STYLES.SELECTOR:COMPILE-SELECTOR

Kinds: function

Validate and return the selector S-expression used by the matcher.

CL-STYLES.SELECTOR:DESCENDANT>

Kinds: function

Construct an ancestor-descendant relationship selector for any matching ancestor.

CL-STYLES.SELECTOR:FIRST-CHILD

Kinds: function

Construct a selector for a node with a parent and zero-based index zero.

CL-STYLES.SELECTOR:HAS

Kinds: function

Construct a selector matching nodes with at least one descendant satisfying another selector.

CL-STYLES.SELECTOR:ID>

Kinds: function

Construct a selector for a given stylable identifier.

CL-STYLES.SELECTOR:INVALID-SELECTOR

Kinds: type

Condition raised when selector validation finds an unsupported operator or structurally invalid argument.

CL-STYLES.SELECTOR:INVALID-SELECTOR-PATH

Kinds: function

Return the index path locating the invalid nested selector.

CL-STYLES.SELECTOR:INVALID-SELECTOR-REASON

Kinds: function

Return a failure reason keyword from a selector validation condition.

CL-STYLES.SELECTOR:INVALID-SELECTOR-SELECTOR

Kinds: function

Return the rejected selector stored by the validation condition.

CL-STYLES.SELECTOR:LAST-CHILD

Kinds: function

Construct a selector for the final child in its parent's ordered children.

CL-STYLES.SELECTOR:MATCH-SELECTOR-P

Kinds: function

Return whether SEL matches OBJ under element, class, state, parentage, and descendant rules.

CL-STYLES.SELECTOR:NTH-CHILD

Kinds: function

Construct a selector for zero-based child index N; validation rejects negative and noninteger values.

CL-STYLES.SELECTOR:SEL-AND

Kinds: function

Construct an intersection selector whose members must all match.

CL-STYLES.SELECTOR:SEL-NOT

Kinds: function

Construct a selector matching when the supplied nested selector does not match.

CL-STYLES.SELECTOR:SEL-OR

Kinds: function

Construct a union selector that succeeds if at least one member matches.

CL-STYLES.SELECTOR:SELECTOR-SPECIFICITY

Kinds: function

Return the deterministic CSS-like specificity triple (ID CLASS TYPE) for SEL.

CL-STYLES.SELECTOR:STATE>

Kinds: function

Construct a state selector requiring all supplied flags.

CL-STYLES.SELECTOR:TYPE>

Kinds: function

Construct a selector comparing the node's stylable type.

CL-STYLES.SELECTOR:VALIDATE-SELECTOR

Kinds: function

Validate SELECTOR shape recursively and return it, or signal INVALID-SELECTOR.

CL-STYLES.SHEET:ADD-RULE

Kinds: function

Add a rule to the stylesheet.

WARNING: This mutates the stylesheet in-place. For functional/immutable
operations (preferred in TEA architecture), create a new stylesheet with
make-stylesheet instead.

CL-STYLES.SHEET:DEFSTYLESHEET

Kinds: macro

Define a stylesheet with the given rules.

CL-STYLES.SHEET:MAKE-STYLESHEET

Kinds: function

Create and validate a stylesheet instance with revision zero.

CL-STYLES.SHEET:REMOVE-RULE

Kinds: function

Remove a rule from the stylesheet.

WARNING: This mutates the stylesheet in-place. For functional/immutable
operations (preferred in TEA architecture), create a new stylesheet with
make-stylesheet instead.

CL-STYLES.SHEET:STYLE-ENGINE

Kinds: type

Stateful styling engine for advanced use cases like caching and batch operations.
Currently unused - the functional API (apply-stylesheet, apply-stylesheet-to-tree) is preferred.
Reserved for future optimizations like selector compilation caching or computed style caching.

CL-STYLES.SHEET:STYLE-ENGINE-DIRTY

Kinds: function

No documentation metadata.

CL-STYLES.SHEET:STYLE-ENGINE-PATCHES

Kinds: function

No documentation metadata.

CL-STYLES.SHEET:STYLE-ENGINE-STYLESHEET

Kinds: function

No documentation metadata.

CL-STYLES.SHEET:STYLESHEET

Kinds: type

No documentation metadata.

CL-STYLES.SHEET:STYLESHEET-NAMESPACE

Kinds: function

No documentation metadata.

CL-STYLES.SHEET:STYLESHEET-REVISION

Kinds: function

No documentation metadata.

CL-STYLES.SHEET:STYLESHEET-RULES

Kinds: function

No documentation metadata.

CL-STYLES.SHEET:STYLESHEET-VARIABLES

Kinds: function

No documentation metadata.

CL-STYLES.SHEET:VALIDATE-STYLESHEET

Kinds: function

Validate rules and variables for SHEET and return it.

CL-STYLES.TOKENS:CH

Kinds: function

Construct a character-cell relative length token for style resolution.

CL-STYLES.TOKENS:COLOR-P

Kinds: function

Colors supported by the ElmTUI terminal conversion boundary.
RGB channels are 8-bit integers; HSL saturation/lightness are percentages.

CL-STYLES.TOKENS:EM

Kinds: function

Construct an em-relative length token for style resolution.

CL-STYLES.TOKENS:HSL

Kinds: function

Construct an HSL color token for the styling engine.

CL-STYLES.TOKENS:LEN

Kinds: function

Construct a normalized length token from the supplied value and unit.

CL-STYLES.TOKENS:LENGTH-P

Kinds: function

Report whether the supplied value is a normalized length token.

CL-STYLES.TOKENS:MISSING-STYLE-VARIABLE

Kinds: type

Public missing style variable type used to represent structured asynchronous tasks, styles or UI elements.

CL-STYLES.TOKENS:PERCENT

Kinds: function

Construct a percentage length token for relative layout or styling.

CL-STYLES.TOKENS:PX

Kinds: function

Construct a pixel or terminal-cell length token used by the styling layer.

CL-STYLES.TOKENS:RESOLVE-VARIABLE-VALUE

Kinds: function

Resolve VALUE recursively against VARS and return VALUE plus expansion records.
Missing variables and cycles signal typed conditions unless the reference supplies a fallback.

CL-STYLES.TOKENS:RESOLVE-VARIABLES

Kinds: function

Resolve top-level variable references in PLIST recursively.
Returns two values: the resolved plist and VARIABLE-EXPANSION records.
A missing variable or cycle signals a typed condition unless a VAR fallback recovers it.

CL-STYLES.TOKENS:RGB

Kinds: function

Construct an RGB color token from red, green and blue components.

CL-STYLES.TOKENS:RGBA

Kinds: function

Construct an RGBA color token including alpha.

CL-STYLES.TOKENS:ROOT-EM

Kinds: function

Construct a root-em-relative length token for style resolution.

CL-STYLES.TOKENS:STYLE-VARIABLE-CHAIN

Kinds: function

Return the chain recorded in the style variable representation.

CL-STYLES.TOKENS:STYLE-VARIABLE-CYCLE

Kinds: type

Public style variable cycle type used to represent structured asynchronous tasks, styles or UI elements.

CL-STYLES.TOKENS:STYLE-VARIABLE-NAME

Kinds: function

Return the name recorded in the style variable representation.

CL-STYLES.TOKENS:STYLE-VARIABLE-RESOLUTION-ERROR

Kinds: type

Public style variable resolution error type used to represent structured asynchronous tasks, styles or UI elements.

CL-STYLES.TOKENS:VALIDATE-VARIABLE-ENVIRONMENT

Kinds: function

Resolve every defined variable once so cycles and missing dependencies fail early.

CL-STYLES.TOKENS:VAR

Kinds: function

Construct a style variable reference, optionally with a fallback value.

CL-STYLES.TOKENS:VARIABLE-EXPANSION

Kinds: type

Public variable expansion type used to represent structured asynchronous tasks, styles or UI elements.

CL-STYLES.TOKENS:VARIABLE-EXPANSION-CHAIN

Kinds: function

Return the chain recorded in the variable expansion representation.

CL-STYLES.TOKENS:VARIABLE-EXPANSION-FALLBACK-USED-P

Kinds: function

Return true when the supplied value satisfies the variable expansion fallback used type predicate.

CL-STYLES.TOKENS:VARIABLE-EXPANSION-NAME

Kinds: function

Return the name recorded in the variable expansion representation.

CL-STYLES.TOKENS:VARIABLE-EXPANSION-PROPERTY

Kinds: function

Return the property recorded in the variable expansion representation.

CL-STYLES.TOKENS:VARIABLE-EXPANSION-VALUE

Kinds: function

Return the value recorded in the variable expansion representation.

CL-STYLES.TOKENS:VARIABLE-REF-P

Kinds: function

Report whether a style value refers to a stylesheet variable.

ELMTUI.API:DSL-TYPE

Kinds: function

Resolve DSL TYPE to a component class.
This generic function is the core of the polymorphic DSL resolution system.

Methods are defined per component or variant:
- Keywords resolve to classes
- Lists inject extra props
- Symbols terminate (are classes)

Returns (values class props).

ELMTUI.APP:DEFINE-WIDGET-KEYMAP

Kinds: macro

DSL = DEFINE-KEYMAP + automatic registration + context.

ELMTUI.APP:KEY-PRESSED-P

Kinds: function

Return true when MESSAGE is a key press matching CHAR, KEY and MODIFIERS.

MESSAGE is any message an update function receives; non-key messages never
match. CHAR is a character compared with the typed character (case-sensitive,
so #\q and #\Q differ). KEY is a keyword naming a key, such as :UP,
:ENTER or :ESCAPE, or a list of such keywords any of which matches. When both
are given, either may match. MODIFIERS is a list of modifiers that must all be
held, e.g. (:CTRL); :CONTROL and :CTRL, and :META and :ALT, are synonyms. With
no MODIFIERS the modifier state is not checked.

  (key-pressed-p message :char #\q)                    ; q
  (key-pressed-p message :key '(:up :k))                 ; Up arrow or k
  (key-pressed-p message :char #\s :modifiers '(:ctrl)) ; Ctrl-S

ELMTUI.APP:MAKE-APP-CONFIG

Kinds: function

No documentation metadata.

ELMTUI.APP:QUIT-REQUESTED-P

Kinds: function

Return true when MESSAGE asks the application to quit.

The runtime sends (:APP-QUIT-REQUESTED) for Ctrl-C and for keymap :QUIT
bindings. An update function normally answers it by patching :SHOULD-QUIT to
true, which ends the application.

ELMTUI.APP:REGISTER-MESSAGE-BINDING

Kinds: function

Sugar: add a :message binding that emits MSG list.

ELMTUI.APP.API:APP-CONFIG

Kinds: type

Structured declared application configuration, including callbacks, state semantics, message queue and CLI options.

ELMTUI.APP.API:APP-CONFIG-BINARY-OPTIONS

Kinds: function

Return the optional binary execution options recorded in an application configuration.

ELMTUI.APP.API:APP-CONFIG-CLI-OPTIONS

Kinds: function

Return the application command-line option definitions.

ELMTUI.APP.API:APP-CONFIG-COMMAND-PROCESSOR-FN

Kinds: function

Return the optional application-specific command processor function designator.

ELMTUI.APP.API:APP-CONFIG-CONFIGURE-FN

Kinds: function

Return the optional application configuration callback designator.

ELMTUI.APP.API:APP-CONFIG-INITIAL-STATE-PLIST

Kinds: function

Return the application's initial state property list.

ELMTUI.APP.API:APP-CONFIG-MESSAGE-QUEUE

Kinds: function

Return the event channel required for application message queue processing.

ELMTUI.APP.API:APP-CONFIG-NAME

Kinds: function

Return the symbolic name identifying a declared application.

ELMTUI.APP.API:APP-CONFIG-RENDERER-FN

Kinds: function

Return the optional renderer callback designator stored in the application configuration.

ELMTUI.APP.API:APP-CONFIG-ROOT-COMPONENT-DSL

Kinds: function

Return the declared root component DSL used to build an application view.

ELMTUI.APP.API:APP-CONFIG-STATE-SEMANTICS

Kinds: function

Return the application's state commit semantics, either :TRANSACTIONAL or :STRICT-ELM.

ELMTUI.APP.API:APP-CONFIG-SUBSCRIPTIONS-FN-FORM

Kinds: function

Return the stored symbol or form designating the application's subscriptions callback.

ELMTUI.APP.API:APP-CONFIG-UPDATE-FN-SYM

Kinds: function

Return the update callback symbol, function, or form used for application state transitions.

ELMTUI.APP.API:APP-CONFIG-VIEW-FN-SYM

Kinds: function

Return the view callback symbol, function, or form used to produce the declarative UI.

ELMTUI.APP.API:DEFAPPLICATION

Kinds: macro

Define the normative full-featured ElmTUI application called NAME.

DEFAPPLICATION is the application constructor selected for the next stable major
version. It owns the production application surface: CL-STATE initialization,
component/root-viewport wiring, context/patch updates, subscriptions, CLI and
binary configuration, keymaps, generated runners, and selectable
:TRANSACTIONAL/:STRICT-ELM commit semantics. ELMTUI.APP.TEA-CORE:DEFTEA-APP
remains a supported minimal direct-transition adapter for small or pedagogical
TEA programs; both constructors lower to MAKE-RUNTIME-APP-SPEC and therefore
share the same INIT/TRANSITION/VIEW/SUBSCRIPTIONS runtime vocabulary.

Arguments:
  NAME is a non-keyword application symbol. ARGS is the DEFAPPLICATION keyword
  plist. :ROOT-VIEWPORT-ID and :ROOT-COMPONENT-DSL are required. Optional keys
  include :INITIAL-STATE-PLIST/:INITIAL-STATE-FN, :UPDATE-FN, :VIEW-FN,
  :SUBSCRIPTIONS-FN, :COMMAND-PROCESSOR-FN, :STATE-SEMANTICS, CLI/binary
  configuration, and platform options.

Application contract:
  :INITIAL-STATE-FN returns the initial state as a plist (optionally startup
  commands as a second value). :UPDATE-FN is called as (UPDATE MESSAGE STATE)
  with the current application state; it reads with STATE-REF and returns
  (MAKE-UPDATE-RESULT :PATCHES ((PATH VALUE) ...) :COMMANDS (...)) without
  changing STATE. Key presses arrive as KEY-EVENT objects (match them with
  KEY-PRESSED-P); Ctrl-C arrives as (:APP-QUIT-REQUESTED) (QUIT-REQUESTED-P).
  Patching :SHOULD-QUIT to true ends the application. :VIEW-FN is a pure
  function of the state returning the DSL tree rendered inside the root
  viewport. A :BELOW-CURSOR root viewport needs an explicit :HEIGHT.

Returns:
  Macro expansion defining application helpers, configuration, and RUN-NAME;
  the expansion itself yields NAME. RUN-NAME (interned in the current package,
  not exported) takes &KEY PLATFORM PLATFORM-OPTIONS ARGV LOG-FILE LOG-BUFFER;
  logging is silent while the application runs unless LOG-FILE or LOG-BUFFER
  (or --log-file/--log-buffer in ARGV) is given.

Mutation:
  Macro expansion registers application configuration and generated functions.
  Runtime mutation follows :STATE-SEMANTICS: :TRANSACTIONAL commits through the
  state transaction machinery; :STRICT-ELM installs frozen replacement
  snapshots with structural sharing.

Conditions:
  Macro expansion signals an error for missing required keys, unsupported state
  semantics, or invalid function/configuration designators. Runtime conditions
  from generated update/view/subscription code remain inspectable through their
  owning framework boundaries.

Example:
  (defapplication counter
    :root-viewport-id :root
    :root-component-dsl '(:root-viewport :id :root :children ())
    :initial-state-plist '(:count 0)
    :update-fn #'counter-update
    :view-fn #'counter-view
    :subscriptions-fn #'counter-subscriptions
    :state-semantics :strict-elm)

ELMTUI.APP.API:GET-CLI-ARG

Kinds: function

Read CLI argument KEY from STATE at (:cli KEY), returning DEFAULT when absent.

ELMTUI.APP.API:GET-COMPONENT-INSTANCE

Kinds: function

Resolve a component ID path against an APPLICATION-STATE.
ID-PATH accepts a scalar keyword, symbol or string, or a list of segments;
:COMPONENTS is an optional leading path segment. Invalid states signal TYPE-ERROR.

ELMTUI.APP.API:MAKE-RUNTIME-APP-SPEC

Kinds: function

Build the canonical runtime application specification.

The normative runtime vocabulary is INIT and TRANSITION:

  INIT :: () -> (values MODEL COMMANDS)
  TRANSITION :: (MESSAGE MODEL) -> (values NEXT-MODEL COMMANDS)
  VIEW :: MODEL -> DSL
  SUBSCRIPTIONS :: MODEL -> SUBSCRIPTIONS

DEFAPPLICATION, the normative full application constructor for the next stable
major version, adapts its context/patch update callback into TRANSITION.
DEFTEA-APP remains the supported minimal direct-transition adapter for small and
pedagogical applications. Both lower through this function. The returned plist
retains the legacy internal :UPDATE-FN key because the platform driver consumes
that key, but new framework code should construct specs through this function
and speak in terms of transitions.

STATE-SEMANTICS must be :TRANSACTIONAL or :STRICT-ELM. A NIL SUBSCRIPTIONS value
is normalized to an empty subscription function.

ELMTUI.APP.API:PROCESS-COMMAND-DEFAULT

Kinds: function

Default command processing function. Can be overridden by specific applications.

ELMTUI.APP.API:READ-EVENT-DEFAULT

Kinds: function

Default event reading function. Can be overridden by specific applications.

ELMTUI.APP.API:RENDER-VIEW-DEFAULT

Kinds: function

Default view rendering function. Can be overridden by specific applications.

ELMTUI.APP.API:RUN-APPLICATION

Kinds: function

Run the application with the given app-spec and platform options.

ELMTUI.APP.API:VALIDATE-PLATFORM-OPTIONS

Kinds: function

Validate a proper PLATFORM-OPTIONS keyword/value plist for PLATFORM.

ELMTUI.APP.EXTENSION:EXTRACT-PLATFORM-OPTIONS

Kinds: function

Select options marked with :platform-option from PARSED-VALUES.

ELMTUI.APP.EXTENSION:MERGE-CLI-OPTION-SPECS

Kinds: function

Merge :cli-options and :args into one validated option spec list.

ELMTUI.APP.EXTENSION:NORMALIZE-BINARY-OPTIONS

Kinds: function

Normalize :binary setting into a plist, or NIL when disabled.

ELMTUI.APP.EXTENSION:NORMALIZE-SIMPLE-ARGS-SPECS

Kinds: function

Normalize :args simple specs into internal CLI option specs.

ELMTUI.APP.EXTENSION:PARSE-CLI-OPTIONS

Kinds: function

Parse ARGV according to SPECS and return a plist keyed by :name.

ELMTUI.APP.EXTENSION:VALIDATE-CLI-OPTION-SPECS

Kinds: function

Validate CLI option SPECS and return them unchanged.

ELMTUI.APP.TEA-CORE:APP-MODEL

Kinds: function

Return the user model from a DEFTEA-APP application state.

APP-STATE is the CL-STATE application-state object that components receive in
their :UPDATE and :VIEW clauses. In a DEFTEA-APP application the user's model
is stored under the :TEA-MODEL key; this function extracts it.

Use this in DEFCOMPONENT :VIEW and :UPDATE clauses to read the app model
without depending on the internal :TEA-MODEL key:

  (:view (local-state app-state id-path children)
    (let ((model (elmtui:app-model app-state)))
      ...))

Returns the user model object, or NIL if the key is absent (e.g. when the
component is hosted by a DEFAPPLICATION that does not use :TEA-MODEL).

ELMTUI.APP.TEA-CORE:DEFTEA-APP

Kinds: macro

Define a supported minimal direct-transition TEA application and RUN-NAME.

DEFTEA-APP is intentionally the small/pedagogical constructor, not the normative
full application constructor for the next stable major version. Use
ELMTUI.APP:DEFAPPLICATION for production application composition, component and
root-viewport initialization, CL-STATE patch/context updates, CLI/binary
configuration, keymaps, and selectable transaction semantics. DEFTEA-APP remains
compatible for direct model-replacement programs. It expands into
DEFAPPLICATION with :STRICT-ELM state semantics, keeping the model under the
:TEA-MODEL key of the application state, so both constructors share one runtime.
Ctrl-C quits; so does a transition that returns a plist model with :SHOULD-QUIT
true.

Syntax:

  (deftea-app NAME
    :init       INIT-FN
    :transition TRANSITION-FN
    :view       VIEW-FN
    &key
      :subscriptions        SUBS-FN
      :command-processor    CMD-FN
      :root-viewport-id     ROOT-ID
      :root-component-dsl   DSL         ; override auto-generated DSL
      :anchor               ANCHOR      ; default :BELOW-CURSOR
      :height               ROWS        ; default: sized by the content
      :handle-quit          BOOL)       ; default T; auto-handle :APP-QUIT-REQUESTED

Required arguments:

  NAME
    A non-keyword symbol naming the application. This is used to derive:

      * *NAME-APP-SPEC* — a DEFparameter holding the app spec plist
      * RUN-NAME        — the DEFAPPLICATION runner for the application

  :INIT
    A function designator (symbol or lambda) called with no arguments:

      INIT-FN :: () -> (values MODEL COMMANDS)

    MODEL
      Arbitrary application model object (often a plist or hash table).
    COMMANDS
      A list of "commands" understood by the command processor,
      or NIL if there are no startup side-effects.

  :TRANSITION
    The canonical direct transition function designator called for each message:

      TRANSITION-FN :: (MSG MODEL) -> (values NEXT-MODEL COMMANDS)

    :UPDATE is retained as a legacy compatibility alias for :TRANSITION. Do not
    specify both; new code should use :TRANSITION.

    MSG
      An arbitrary message object (often a keyword or small list).
    MODEL / NEXT-MODEL
      The current / next model. NEXT-MODEL must be suitable for
      subsequent calls to TRANSITION and VIEW.
    COMMANDS
      A list of commands to execute after the update, or NIL.

  :VIEW
    A function designator that renders the current model into a DSL tree:

      VIEW-FN :: MODEL -> DSL-TREE

    DSL-TREE
      A tree of view nodes understood by the rendering pipeline.
      In a typical setup the root node is a ROOT-VIEWPORT widget,
      often of the form:

        (:root-viewport :id ROOT-ID ...)

    where ROOT-ID matches the :ROOT-VIEWPORT-ID argument below.

Optional keywords:

  :SUBSCRIPTIONS
    A function designator

      SUBS-FN :: MODEL -> LIST-OF-SUBSCRIPTIONS

    or NIL.  If NIL, it is replaced with a function that always
    returns NIL.  This function is passed to the driver in the
    :SUBSCRIPTIONS-FN slot of the app spec and may be used by the
    event loop to (re-)establish subscriptions after each update.

  :COMMAND-PROCESSOR
    A function designator

      CMD-FN :: (CMD QUEUE MODEL APP-CONFIG) -> *

    or NIL.  If non-NIL, the driver calls it for each command
    produced by TRANSITION, passing:

      CMD        — the command object
      QUEUE      — the app's message queue (for enqueuing new MSGs)
      MODEL      — the current model *after* the update
      APP-CONFIG — optional configuration object (may be NIL)

    For a minimal TEA app you can omit this entirely.

  :ROOT-COMPONENT-DSL
    An optional DSL tree that overrides the auto-generated root viewport
    DSL. Use this to place DEFCOMPONENT children inside a DEFTEA-APP
    application. When provided, the user's :VIEW function output is
    ignored and the DSL tree governs the component layout. Components in
    the tree receive the CL-STATE application state in their :UPDATE and
    :VIEW clauses; use (ELMTUI:APP-MODEL APP-STATE) to read the user
    model.

    Example:
      :root-component-dsl '(:root-viewport :id :root :anchor :below-cursor
                            :height 5
                            :children ((:my-display :id :display)))

  :ROOT-VIEWPORT-ID
    A symbol, keyword, or string naming the logical root viewport.
    It is converted to a keyword via a small helper and passed as
    :ROOT-VIEWPORT-ID in the app spec.  The platform driver uses this
    to compute the root component path.

    If omitted, defaults to :ROOT-VIEWPORT.

Expansion / side effects:

  (deftea-app NAME ...) expands to:

    - Adapter functions %TEA-INIT-NAME, %TEA-UPDATE-NAME, %TEA-VIEW-NAME and
      %TEA-SUBSCRIPTIONS-NAME that translate between the direct model and
      the application state (the model is stored under :TEA-MODEL; a new
      model becomes one patch). A view that returns a :ROOT-VIEWPORT tree is
      unwrapped to its children, because the application owns the viewport.

    - (DEFAPPLICATION NAME ...), which defines RUN-NAME:

        (RUN-NAME &key (platform :tty) platform-options argv
                       log-file log-buffer &allow-other-keys)

    - A DEFparameter *NAME-APP-SPEC*: the MAKE-RUNTIME-APP-SPEC plist of the
      generated application, for callers of ELMTUI.APP.API:RUN-APPLICATION.

Contracts / validation:

  * NAME must be a non-keyword symbol.
  * :INIT, :VIEW, and one of canonical :TRANSITION or legacy :UPDATE must be
    non-NIL and suitable as FUNCALL arguments (symbol or lambda).
  * :ROOT-VIEWPORT-ID must resolve to a keyword; an error is signaled
    at macro-expansion time for unsupported types.

  If the ELMTUI.CONTRACTS package is loaded and provides the function
  VALIDATE-ELM-APPLICATION, a sanity check is run once at load-time:

    (validate-elm-application UPDATE-FN VIEW-FN SUBS-FN)

  using a synthetic test model.  If this check fails, an error is
  signaled during load, so application contracts fail fast.

ELMTUI.BACKEND.FAKETERM:FAKETERM-ENQUEUE-INPUT

Kinds: function

Append EVENT to INSTANCE's deterministic fake input queue.

ELMTUI.BACKEND.FAKETERM:FAKETERM-INSTANCE

Kinds: type

No documentation metadata.

ELMTUI.BACKEND.FAKETERM:FAKETERM-LOG-LINES

Kinds: function

Return the current faketerm operation log as deterministic strings.

ELMTUI.BACKEND.FAKETERM:FAKETERM-RUN-TO-QUIESCENCE

Kinds: function

Drive INSTANCE with STEP-FN until deterministic quiescence.

STEP-FN is called as (STEP-FN INSTANCE STEP), with STEP starting at 1.
The runner never sleeps: it stops when INSTANCE has no queued input and the
screen snapshot is unchanged across a step, or when UNTIL returns true.  If no
condition is reached within MAX-STEPS, signal an error with the latest screen
and queue state in the message.

ELMTUI.BACKEND.FAKETERM:FAKETERM-SCREEN-LINES

Kinds: function

Return a deterministic row-major snapshot of the fake terminal screen as strings.

Each string has exactly the faketerm width. The returned list has exactly
faketerm height entries, making it suitable for non-interactive assertions
against rendered TUI state.

ELMTUI.BACKEND.FAKETERM:GET-CELL-STYLE-FAKETERM

Kinds: function

Returns the style plist at the given row and col from the screen buffer.

ELMTUI.BACKEND.FAKETERM:GET-CHAR-AT-FAKETERM

Kinds: function

Returns the character at the given row and col from the screen buffer.

ELMTUI.CL-STATE.MESSAGE-NORMALIZATION:CANONICALIZE-MESSAGE-VARIANT

Kinds: function

Delegating boundary module for message variant canonicalization.

ELMTUI.CL-STATE.MESSAGE-NORMALIZATION:MESSAGE-VARIANT-P

Kinds: function

Delegating boundary module for message variant checks used by state/contracts.

ELMTUI.CL-STATE.MESSAGE-NORMALIZATION:VALIDATE-MESSAGE-INSTANCE

Kinds: function

Validate MESSAGE-INSTANCE against DEFMSG schema for MESSAGE-TYPE.
Returns two values:
  1) canonicalized message instance on success, NIL on failure
  2) failure reason string on failure, NIL on success.

ELMTUI.CL-STATE.PATH-CONTEXT:COMPOSE-STATE-PATH

Kinds: function

Compose PATH onto BASE-PATH for state access/update contexts.

ELMTUI.CONTRACTS:ANALYZE-MESSAGE-USAGE

Kinds: function

Analyzes message usage patterns from update execution log

ELMTUI.CONTRACTS:APP-CONTEXT

Kinds: type

Global application context for the pipeline.

   Arguments:
     STATE          -- (plist) Application model.
     VIEWPORT-RECT  -- (object) Geometry rectangle.
     DSL-TREE       -- (dsl-tree) DSL tree struct.
     RAW-TREE       -- (raw-tree) Raw tree struct.
     STYLED-TREE    -- (styled-tree) Styled tree struct.
     VIEW-FN        -- (function) View function.
     ATOMIC-TREE    -- (atomic-tree) Atomic tree struct.
     LAID-OUT-TREE  -- (laid-out-tree) Laid-out tree struct.
     FRONT-BUFFER   -- (object) Front buffer.
     BACKEND        -- (object) Backend instance.

   Returns:
     An APP-CONTEXT struct holding all pipeline stages and frame state.

   Example:
     (make-app-context :state '(:foo 1) :dsl-tree (make-dsl-tree :root ...))

   (plist, ...) => app-context (pure, no side-effects)

ELMTUI.CONTRACTS:ATOMIC-TREE

Kinds: type

Atomic tree: visibility/overflow resolved.

ELMTUI.CONTRACTS:CONTRACT-SUMMARY

Kinds: function

Returns summary of contract executions for debugging

ELMTUI.CONTRACTS:CONTRACT-VIOLATION

Kinds: type

Base condition for a failed ElmTUI contract. Records FUNCTION-NAME, EXPECTED-TYPE, ACTUAL-VALUE, and optional CONTEXT; its report prints these fields.

ELMTUI.CONTRACTS:CTX-ATOMIC-TREE

Kinds: function

Return the ATOMIC-TREE stage with visibility and overflow decisions resolved.

ELMTUI.CONTRACTS:CTX-BACK-BUFFER

Kinds: function

Return the back buffer used to assemble the next frame.

ELMTUI.CONTRACTS:CTX-BACKEND

Kinds: function

Return the rendering backend associated with APP-CONTEXT.

ELMTUI.CONTRACTS:CTX-DSL-TREE

Kinds: function

Return the DSL-TREE stage currently stored in APP-CONTEXT.

ELMTUI.CONTRACTS:CTX-FRONT-BUFFER

Kinds: function

Return the front buffer representing the previously presented frame.

ELMTUI.CONTRACTS:CTX-LAID-OUT-TREE

Kinds: function

Return the LAID-OUT-TREE stage containing resolved geometry.

ELMTUI.CONTRACTS:CTX-RAW-TREE

Kinds: function

Return the RAW-TREE stage currently stored in APP-CONTEXT.

ELMTUI.CONTRACTS:CTX-STATE

Kinds: function

Return the application model stored in APP-CONTEXT.

ELMTUI.CONTRACTS:CTX-STYLED-TREE

Kinds: function

Return the STYLED-TREE stage currently stored in APP-CONTEXT.

ELMTUI.CONTRACTS:CTX-STYLESHEET

Kinds: function

Return the stylesheet used by the styling stage of APP-CONTEXT.

ELMTUI.CONTRACTS:CTX-VIEW-FN

Kinds: function

Return the view function stored in APP-CONTEXT.

ELMTUI.CONTRACTS:CTX-VIEWPORT-RECT

Kinds: function

Return the viewport rectangle associated with APP-CONTEXT.

ELMTUI.CONTRACTS:CV-ACTUAL-VALUE

Kinds: function

Return the actual offending value recorded in a CONTRACT-VIOLATION condition.

ELMTUI.CONTRACTS:CV-CONTEXT

Kinds: function

Return optional contextual information for a CONTRACT-VIOLATION, or NIL when no context was supplied.

ELMTUI.CONTRACTS:CV-EXPECTED-TYPE

Kinds: function

Return the expected type descriptor recorded in a CONTRACT-VIOLATION condition.

ELMTUI.CONTRACTS:CV-FUNCTION-NAME

Kinds: function

Return the function name recorded in a CONTRACT-VIOLATION condition, identifying the rejected contract boundary.

ELMTUI.CONTRACTS:DEFINE-PIPELINE

Kinds: macro

Compose STAGE-FNS into a single function that threads a context through them.

Each stage must be a function of one argument (the context), and will be
called in the order provided. The declared :pipeline/in-type and
:pipeline/out-type metadata from DEFINE-STAGE can be used by tooling or
validation code, but are not enforced here directly.

ELMTUI.CONTRACTS:DEFINE-STAGE

Kinds: macro

Define a pipeline stage NAME with input/OUTPUT type contracts.

IN-TYPE and OUT-TYPE are type designators used for:
  - A CHECK-TYPE precondition on the input.
  - A TYPEP-based postcondition on the result.

Any non-Elmtui ERROR signaled inside BODY is wrapped in a
PIPELINE-CONTRACT-VIOLATION. Errors that already belong to the
Elmtui error hierarchy (ELMTUI-ERROR and subclasses like DSL-ERROR)
are allowed to propagate unchanged, preserving their rich context.

ELMTUI.CONTRACTS:DEFSUBSCRIPTIONS

Kinds: macro

Defines a subscriptions function with contract enforcement.

ELMTUI.CONTRACTS:DEFTRANSFORM

Kinds: macro

Define a pure transformer and an App-Context plumbing stage.

ELMTUI.CONTRACTS:DEFTRANSFORMER

Kinds: macro

Define a pure (tree &key …) → tree function and an APP-CONTEXT stage.

   Example:

     (deftransformer raw→styled (raw-tree) (styled-tree)
       (raw-tree &key stylesheet theme)
       ...)

   The wrapper extracts :STYLESHEET and :THEME from CTX via CTX-STYLESHEET,
   CTX-THEME accessors and calls RAW→STYLED with them.

ELMTUI.CONTRACTS:DEFUPDATE-CTR

Kinds: macro

Defines an update function with flexible message validation (backward compatible).
   This is equivalent to defupdate-flexible.

ELMTUI.CONTRACTS:DEFUPDATE-FLEXIBLE

Kinds: macro

Defines an update function with flexible message validation.
   Accepts any message format - useful for prototyping and migration.

   Contract: update(message, model) => (values new-model commands)
   - model: Current application state (immutable, property list)
   - message: Any message format (flexible validation)
   - new-model: Updated state or nil (no change)
   - commands: List of side-effects to execute or nil

ELMTUI.CONTRACTS:DEFUPDATE-HYBRID

Kinds: macro

Define an UPDATE function that works with *either* typed or flexible
   messages.

   Usage
   -----
     (defupdate-hybrid <function-name> (message model)
       [:MESSAGE-TYPE <symbol>]   ;; preferred defmsg schema
       [:PREFER-TYPED  <boolean>] ;; warn on untyped msg when non-NIL
       [doc-string]               ;; optional
       body-forms…)

   Contract: (update message model) -> (values new-model commands)

ELMTUI.CONTRACTS:DEFUPDATE-TYPED

Kinds: macro

Defines an update function with strict message type validation.
   Only accepts messages that conform to the specified defmsg schema.

   Contract: update(typed-message, model) => (values new-model commands)
   - model: Current application state (immutable, property list)
   - message: Must be valid variant of message-type (strict validation)
   - message-type: Symbol naming the defmsg schema (e.g., 'AppMsg)
   - new-model: Updated state or nil (no change)
   - commands: List of side-effects to execute or nil

   Example:
   (defupdate-typed counter-update (message model) AppMsg
     (case (first message)
       (:increment (values (list :count (1+ (getf model :count 0))) nil))
       (:decrement (values (list :count (1- (getf model :count 0))) nil))
       (t (values nil nil))))

ELMTUI.CONTRACTS:DEFVIEW

Kinds: macro

Defines a view function with strict contract enforcement.

   Arguments:
     NAME        -- (symbol) Name of the view function.
     MODEL-PARAM -- (symbol) Model parameter name.
     BODY        -- (forms) Body of the view function.

   Returns:
     Defines a function that validates input, executes BODY, and validates output as a DSL tree.

   Example:
     (defview my-view (model)
       (list :container :children ...))

   (symbol, symbol, forms) => macro-expansion (side-effect: defines function)

   Side-effects:
     - Defines a function.
     - Signals errors on contract violation.
     - May log execution if debugging enabled.

   Purity: impure (macro, global definition, error signaling)

ELMTUI.CONTRACTS:DSL-TREE

Kinds: type

DSL tree: holds the nested DSL list.

   Arguments:
     ROOT -- (list) The nested DSL list.

   Returns:
     A DSL-TREE struct.

   Example:
     (make-dsl-tree :root '(:container ...))

   (list) => dsl-tree (pure, no side-effects)

ELMTUI.CONTRACTS:ENABLE-CONTRACT-DEBUGGING

Kinds: function

Enable/disable contract debugging

ELMTUI.CONTRACTS:LAID-OUT-TREE

Kinds: type

Laid-out tree: geometry resolved.

ELMTUI.CONTRACTS:MAKE-APP-CONTEXT

Kinds: function

Construct an APP-CONTEXT from the supplied pipeline state, tree stages, buffers, viewport, stylesheet, view function, and backend. The constructor only packages references; it does not render or mutate application state.

ELMTUI.CONTRACTS:MAKE-ATOMIC-TREE

Kinds: function

Construct an ATOMIC-TREE with ROOT holding the tree after visibility and overflow decisions.

ELMTUI.CONTRACTS:MAKE-DSL-TREE

Kinds: function

Construct a DSL-TREE with ROOT holding a nested declarative DSL list before conversion to UI nodes.

ELMTUI.CONTRACTS:MAKE-LAID-OUT-TREE

Kinds: function

Construct a LAID-OUT-TREE with ROOT holding the tree after geometry has been resolved.

ELMTUI.CONTRACTS:MAKE-RAW-TREE

Kinds: function

Construct a RAW-TREE whose ROOT holds the generated UI-node tree before stylesheet application.

ELMTUI.CONTRACTS:MAKE-STYLED-TREE

Kinds: function

Construct a STYLED-TREE with ROOT holding the UI-node tree after styles have been applied.

ELMTUI.CONTRACTS:MAKE-SUBSCRIPTION

Kinds: function

Construct a SUBSCRIPTION descriptor with TYPE, CONFIG plist, and MESSAGE-FN for converting incoming event data into an application message.

ELMTUI.CONTRACTS:MESSAGE-CONTRACT-VIOLATION

Kinds: type

Specialized CONTRACT-VIOLATION for a message rejected by its schema or required validation mode.

ELMTUI.CONTRACTS:PIPELINE-CONTRACT-VIOLATION

Kinds: type

Pipeline error condition recording STAGE, EXPECTED-TYPE, GOT-OBJECT, and optional STACK-TRACE; signaled for failed pipeline type contracts.

ELMTUI.CONTRACTS:RAW-TREE

Kinds: type

Raw tree: UI-node tree before styling.

   Arguments:
     ROOT -- (object) The root UI-node.

   Returns:
     A RAW-TREE struct.

   Example:
     (make-raw-tree :root ...)

   (object) => raw-tree (pure, no side-effects)

ELMTUI.CONTRACTS:ROOT

Kinds: function

Returns the root node of a tree structure.

ELMTUI.CONTRACTS:STYLED-TREE

Kinds: type

Styled tree: after stylesheet application.

ELMTUI.CONTRACTS:SUBSCRIPTION

Kinds: type

Subscription descriptor for Elm Architecture

ELMTUI.CONTRACTS:SUBSCRIPTION-CONTRACT-VIOLATION

Kinds: type

Specialized CONTRACT-VIOLATION for subscription generation or validation failures.

ELMTUI.CONTRACTS:SUBSCRIPTION-P

Kinds: function

Return true when OBJECT is a SUBSCRIPTION structure produced by the framework subscription constructor; otherwise return NIL.

ELMTUI.CONTRACTS:SUGGEST-MESSAGE-SCHEMA

Kinds: function

Suggests a defmsg schema based on observed message patterns

ELMTUI.CONTRACTS:TRACE-CONTRACTS

Kinds: function

Return tracing status text for selected contract types.

When STREAM is supplied, also write the generated text there. This keeps
non-interactive callers silent by default while preserving an explicit
interactive diagnostic path.

ELMTUI.CONTRACTS:UPDATE-CONTRACT-VIOLATION

Kinds: type

Specialized CONTRACT-VIOLATION signaled for invalid update input, update execution, or update result contracts.

ELMTUI.CONTRACTS:VALIDATE-COMMANDS

Kinds: function

Validates that commands list is properly structured

ELMTUI.CONTRACTS:VALIDATE-DSL

Kinds: function

Validates that DSL is a valid DSL structure.

   Arguments:
     DSL           -- (any) The DSL value to validate.
     FUNCTION-NAME -- (symbol) Name of the calling function.
     MODEL         -- (any) The model used for rendering.

   Returns:
     DSL if valid, otherwise signals a view-contract-violation error.

   Example:
     (validate-dsl '(:container :children ...) 'my-view '(:foo 1))

   (any, symbol, any) => any (side-effect: error signaling)

   Side-effects:
     - Signals error if DSL is invalid.

   Purity: impure (error signaling)

ELMTUI.CONTRACTS:VALIDATE-ELM-APPLICATION

Kinds: function

Validates that an Elm application's functions conform to contracts

ELMTUI.CONTRACTS:VALIDATE-FLEXIBLE-MESSAGE

Kinds: function

Validates message in flexible mode - accepts any message format

ELMTUI.CONTRACTS:VALIDATE-HYBRID-MESSAGE

Kinds: function

Validates message in hybrid mode - accepts both typed and flexible messages

ELMTUI.CONTRACTS:VALIDATE-MESSAGE

Kinds: function

Validates message according to specified validation mode.

   Validation modes:
   - :flexible  - Accept any message (current behavior)
   - :typed     - Enforce specific message type schema
   - :hybrid    - Accept both typed and flexible messages
   - :strict    - Only typed messages, no ad-hoc allowed

ELMTUI.CONTRACTS:VALIDATE-MODEL

Kinds: function

Validates that model follows proper structure

ELMTUI.CONTRACTS:VALIDATE-STRICT-MESSAGE

Kinds: function

Validates message in strict mode - only typed messages allowed

ELMTUI.CONTRACTS:VALIDATE-SUBSCRIPTIONS

Kinds: function

Validates subscriptions list structure.
Accepts NIL, a single keyword-headed descriptor plist, a subscription struct,
or a list of either form.

ELMTUI.CONTRACTS:VALIDATE-TYPED-MESSAGE

Kinds: function

Validates message against a specific defmsg schema

ELMTUI.CONTRACTS:VALIDATE-UPDATE-RESULT

Kinds: function

Validates the result of an update function

ELMTUI.CONTRACTS:VIEW-CONTRACT-VIOLATION

Kinds: type

Specialized CONTRACT-VIOLATION signaled when a view function fails validation or returns an invalid view.

ELMTUI.CONTRACTS:VIOLATION-EXPECTED

Kinds: function

Return the expected type descriptor recorded in a PIPELINE-CONTRACT-VIOLATION.

ELMTUI.CONTRACTS:VIOLATION-GOT

Kinds: function

Return the offending object recorded in a PIPELINE-CONTRACT-VIOLATION.

ELMTUI.CONTRACTS:VIOLATION-STAGE

Kinds: function

Return the stage identifier recorded in a PIPELINE-CONTRACT-VIOLATION.

ELMTUI.CORE.ASYNC:ASYNC-ERRORS

Kinds: variable

Async task errors.

ELMTUI.CORE.ASYNC:ASYNC-TASKS

Kinds: variable

Active async tasks.

ELMTUI.CORE.ASYNC:AWAIT-CMD

Kinds: function

Wait for CMD and return its completed result.

Arguments:
  CMD is an ElmTUI command structure. :ASYNC commands are awaited directly;
  :BATCH commands are awaited recursively; :DISPATCH returns NIL.

Returns:
  The async task result, a list of batch results, or NIL for non-awaitable
  command kinds.

Mutation:
  Waiting does not mutate application state, but the worker being awaited may
  already have performed its documented effects and promise transitions.

Conditions:
  Worker failures are translated to ASYNC-TASK-ERROR while preserving the
  original failure as the condition reason. Unknown command kinds are warned
  about and return NIL.

Restarts:
  WITH-ASYNC-RESTARTS establishes IGNORE-TASK, REPLACE-TASK, PROVIDE-RESULT,
  standard USE-VALUE, and RETRY while the await operation is active. RETRY may
  repeat an await and must not be confused with rerunning an arbitrary effect.

Example:
  (handler-bind
      ((elmtui.core.conditions:async-task-error
         (lambda (condition)
           (declare (ignore condition))
           (invoke-restart 'use-value :cached))))
    (await-cmd command))

ELMTUI.CORE.ASYNC:CANCEL-CMD

Kinds: function

Cancel CMD according to its command kind.

Arguments:
  CMD is an ElmTUI command structure. For :ASYNC commands the associated task
  and promise are cancelled; batches are traversed recursively where supported.

Returns:
  The command-kind-specific cancellation result, conventionally true/NIL.

Mutation:
  Mutates task/promise lifecycle state and the async task registry as required
  by the command implementation. It does not directly mutate the application
  model.

Conditions:
  Cancellation failures are exposed as ASYNC-TASK-ERROR. Unknown/non-cancellable
  commands may warn and return NIL.

Restarts:
  The standard async recovery restarts are active while cancellation runs.
  Retrying cancellation is intended to be safe only for cancellation backends
  whose operation is idempotent.

Example:
  (cancel-cmd command)

ELMTUI.CORE.ASYNC:CANCEL-RECURRING-CMD

Kinds: function

Cancel a recurring command.

ELMTUI.CORE.ASYNC:CMD-ASYNC

Kinds: function

Construct an asynchronous ElmTUI command around FUNCTION.

Arguments:
  FUNCTION is called with ARGS by default. When PROGRESS is true, FUNCTION
  receives a progress callback as its first argument followed by ARGS; the
  callback sends (:ASYNC-PROGRESS-UPDATE ...) messages to the application.
  ON-COMPLETE maps a successful result to an application message; ON-ERROR maps
  a failure to an application message. TIMEOUT schedules promise cancellation
  after the given seconds. CANCELLATION-FN is optional best-effort cancellation
  cleanup.

Returns:
  A command plist beginning with :ASYNC and containing the task, generated task
  id, promise, and completion/error callbacks. Execution does not begin until
  INTERPRET-CMD processes the command.

Mutation:
  Allocates task/promise objects. Once interpreted, the worker resolves/rejects
  the promise and sends progress/completion/error messages through *APP-SENDER*.
  A timeout may invoke CANCELLATION-FN and cancel the promise.

Conditions:
  Construction errors are exposed through ASYNC-TASK-ERROR recovery. Worker
  errors reject the promise, optionally emit ON-ERROR output, and remain
  available when the task is awaited. CANCELLATION-FN failures are currently
  deliberately suppressed during timeout cleanup.

Restarts:
  Construction is wrapped by WITH-RECOVERY with IGNORE-TASK and RETRY. Retrying
  construction may allocate a new task/promise pair.

Example:
  ;; Without progress (default):
  (cmd-async (lambda (value) (1+ value))
             :args '(41)
             :on-complete
             (lambda (result)
               `(:lookup-succeeded :result ,result)))

  ;; With progress opt-in:
  (cmd-async (lambda (progress value)
               (funcall progress '(:phase :working))
               (1+ value))
             :args '(41)
             :progress t
             :on-complete
             (lambda (result)
               `(:lookup-succeeded :result ,result)))

ELMTUI.CORE.ASYNC:CMD-ASYNC-WITH-RETRY

Kinds: function

Construct a CMD that will run FUNCTION with ARGS asynchronously, retrying on failure.
   Parameters are the same as cmd-async with these additional options:
   - RETRY-ATTEMPTS: Number of retry attempts (default: 3)
   - RETRY-DELAY: Delay in seconds between retry attempts (default: 1.0)

   The function will retry automatically if it fails, up to RETRY-ATTEMPTS times
   with RETRY-DELAY seconds between attempts.

ELMTUI.CORE.ASYNC:CMD-BATCH

Kinds: function

Create a CMD that executes a batch of COMMANDS sequentially.
   Returns a list of results from each command in the batch.

ELMTUI.CORE.ASYNC:CMD-RECURRING

Kinds: function

Create a recurring command that runs periodically.
   Parameters:
   - INTERVAL-SECONDS: Time in seconds between executions
   - FUNCTION: The function to execute repeatedly
   - ARGS: Arguments to pass to the function
   - ON-MESSAGE: Function to create messages from function results
   - STOP-CONDITION: Function that returns true when the recurring task should stop
   - MAX-ITERATIONS: Maximum number of iterations (-1 for unlimited)

   Returns a command structure for a recurring task that can be cancelled.

ELMTUI.CORE.ASYNC:INTERPRET-CMD

Kinds: function

Interpret and execute one ElmTUI command.

Arguments:
  CMD begins with one of :ASYNC, :BATCH, :DISPATCH, or :RECURRING-TASK.
  *APP-SENDER* must name a callable application-message sink.

Returns:
  :ASYNC returns two values, its task and promise. :BATCH returns a list of
  recursively interpreted results. :DISPATCH sends its payload and returns NIL.
  :RECURRING-TASK starts its worker and returns its task id. Unknown command
  kinds return (:UNKNOWN KIND) after a warning.

Mutation:
  :ASYNC stores the task in *ASYNC-TASKS* and starts it. :DISPATCH sends a
  message. :RECURRING-TASK creates/stores a worker thread whose function may
  perform its documented effects and emit messages. The application model is
  changed only later through messages/update, not directly by this interpreter.

Conditions:
  Missing *APP-SENDER* is an error. Command execution failures are translated
  to ASYNC-TASK-ERROR with CMD in the task slot and the original condition in
  the reason slot.

Restarts:
  WITH-ASYNC-RESTARTS keeps the original ASYNC-TASK-ERROR inspectable while
  offering IGNORE-TASK, REPLACE-TASK, PROVIDE-RESULT, standard USE-VALUE, and
  RETRY. RETRY can repeat command side effects and is safe only when the command
  operation is idempotent or otherwise transactionally protected.

Example:
  (multiple-value-bind (task promise)
      (interpret-cmd
       (cmd-async (lambda () :ready)))
    (values task promise))

ELMTUI.CORE.ASYNC:SPAWN-WORKER

Kinds: function

Spawn a worker thread to execute TASK asynchronously.

ELMTUI.CORE.ASYNC:WITH-ASYNC-RESTARTS

Kinds: macro

Execute FORMS with async-task recovery restarts around the operation.

Arguments:
  CONDITION-VAR names an ELMTUI.CORE.CONDITIONS:ASYNC-TASK-ERROR while its
  handler is active. FORMS are the operation to execute.

Returns:
  The values of FORMS on success. IGNORE-TASK returns NIL, REPLACE-TASK returns
  the supplied replacement task, PROVIDE-RESULT returns the supplied result,
  and RETRY re-executes FORMS.

Mutation:
  The macro itself only logs signaled async-task conditions. FORMS controls
  application mutation. RETRY can repeat effects, so use it only around work
  whose retry semantics are safe, idempotent, or otherwise explicitly handled.

Conditions:
  ASYNC-TASK-ERROR is observed with HANDLER-BIND but is not reconstructed or
  re-signaled. If no handler/debugger invokes a restart, the original condition
  propagates normally with its identity and debugger context intact.

Restarts:
  IGNORE-TASK, REPLACE-TASK, PROVIDE-RESULT, the standard Common Lisp
  USE-VALUE, and RETRY are active while FORMS executes. USE-VALUE is the
  preferred programmatic value-substitution restart across package boundaries.

Example:
  (handler-bind
      ((elmtui.core.conditions:async-task-error
         (lambda (condition)
           (declare (ignore condition))
           (invoke-restart 'use-value :cached))))
    (with-async-restarts (_condition)
      (run-async-operation)))

ELMTUI.CORE.CONDITIONS:ASYNC-TASK-ERROR

Kinds: type

Asynchronous task failure retaining task and reason for handler inspection.

ELMTUI.CORE.CONDITIONS:ASYNC-TASK-ERROR-REASON

Kinds: function

Return the asynchronous task failure reason carried by CONDITION.

ELMTUI.CORE.CONDITIONS:ASYNC-TASK-ERROR-TASK

Kinds: function

Return the asynchronous task associated with CONDITION.

ELMTUI.CORE.CONDITIONS:COMMAND-EXECUTION-ERROR

Kinds: type

Failed command execution; preserves original command and diagnostic reason.

ELMTUI.CORE.CONDITIONS:COMMAND-EXECUTION-ERROR-COMMAND

Kinds: function

Return the command whose execution failed in CONDITION.

ELMTUI.CORE.CONDITIONS:COMMAND-EXECUTION-ERROR-REASON

Kinds: function

Return the command execution failure reason carried by CONDITION.

ELMTUI.CORE.CONDITIONS:CONSTRAINT-VALIDATION-ERROR

Kinds: type

Constraint validation failure preserving the violated rule designator.

ELMTUI.CORE.CONDITIONS:CONSTRAINT-VALIDATION-ERROR-CONSTRAINT

Kinds: function

Return the violated constraint designator.

ELMTUI.CORE.CONDITIONS:ELMTUI-VALIDATION-ERROR

Kinds: type

Validation base condition retaining the path, offending value and message.

ELMTUI.CORE.CONDITIONS:EVENT-LOOP-DISPATCH-ERROR

Kinds: type

Event dispatch failure; preserves dispatched event and error reason.

ELMTUI.CORE.CONDITIONS:EVENT-LOOP-DISPATCH-ERROR-EVENT

Kinds: function

Return the event whose dispatch failed in CONDITION.

ELMTUI.CORE.CONDITIONS:EVENT-LOOP-DISPATCH-ERROR-REASON

Kinds: function

Return the event dispatch failure reason carried by CONDITION.

ELMTUI.CORE.CONDITIONS:EVENT-VALIDATION-ERROR

Kinds: type

Event validation failure preserving failed event type and original value.

ELMTUI.CORE.CONDITIONS:LOG-CONDITION

Kinds: function

Log CONDITION with the given LEVEL.

ELMTUI.CORE.CONDITIONS:MESSAGE-DESERIALIZATION-ERROR

Kinds: type

Failed deserialization retaining serialized data and original cause condition.

ELMTUI.CORE.CONDITIONS:MESSAGE-DESERIALIZATION-ERROR-DATA

Kinds: function

Return the serialized message data that failed deserialization in CONDITION.

ELMTUI.CORE.CONDITIONS:MESSAGE-DESERIALIZATION-ERROR-UNDERLYING-CONDITION

Kinds: function

Return the underlying condition that caused message deserialization to fail.

ELMTUI.CORE.CONDITIONS:MESSAGE-SERIALIZATION-ERROR

Kinds: type

Failed serialization retaining message data and original cause condition.

ELMTUI.CORE.CONDITIONS:MESSAGE-SERIALIZATION-ERROR-DATA

Kinds: function

Return the message data that failed serialization in CONDITION.

ELMTUI.CORE.CONDITIONS:MESSAGE-SERIALIZATION-ERROR-UNDERLYING-CONDITION

Kinds: function

Return the underlying condition that caused message serialization to fail.

ELMTUI.CORE.CONDITIONS:MESSAGE-VALIDATION-ERROR

Kinds: type

Rejected application message; retains the message and failure reason via prefixed readers.

ELMTUI.CORE.CONDITIONS:MESSAGE-VALIDATION-ERROR-MESSAGE

Kinds: function

Return the message that failed validation in CONDITION.

ELMTUI.CORE.CONDITIONS:MESSAGE-VALIDATION-ERROR-REASON

Kinds: function

Return the validation failure reason carried by CONDITION.

ELMTUI.CORE.CONDITIONS:PROPERTY-VALIDATION-ERROR

Kinds: type

Property validation failure preserving the invalid property designator.

ELMTUI.CORE.CONDITIONS:PROPERTY-VALIDATION-ERROR-PROPERTY

Kinds: function

Return the rejected UI property name or designator.

ELMTUI.CORE.CONDITIONS:RENDER-ERROR

Kinds: type

Rendering failure carrying a diagnostic message and underlying reason.

ELMTUI.CORE.CONDITIONS:RENDER-ERROR-MESSAGE

Kinds: function

Return the render diagnostic message carried by CONDITION.

ELMTUI.CORE.CONDITIONS:RENDER-ERROR-REASON

Kinds: function

Return the render failure reason carried by CONDITION.

ELMTUI.CORE.CONDITIONS:SIGNAL-SUBSCRIBER-ERROR

Kinds: type

Failure of a signal subscriber retaining the delivered signal and reason. Reporting does not invoke CL:SIGNAL.

ELMTUI.CORE.CONDITIONS:SIGNAL-SUBSCRIBER-ERROR-REASON

Kinds: function

Return the signal subscriber failure reason carried by CONDITION.

ELMTUI.CORE.CONDITIONS:SIGNAL-SUBSCRIBER-ERROR-SIGNAL

Kinds: function

Return the signal being delivered when CONDITION was signaled.

ELMTUI.CORE.CONDITIONS:STATE-UPDATE-ERROR

Kinds: type

State update failure retaining the affected state and failure reason.

ELMTUI.CORE.CONDITIONS:STATE-UPDATE-ERROR-REASON

Kinds: function

Return the state update failure reason carried by CONDITION.

ELMTUI.CORE.CONDITIONS:STATE-UPDATE-ERROR-STATE

Kinds: function

Return the state associated with the failed update in CONDITION.

ELMTUI.CORE.CONDITIONS:SUBSCRIBER-HANDLER-ERROR

Kinds: type

Subscriber callback failure preserving input event, callback and failure reason.

ELMTUI.CORE.CONDITIONS:SUBSCRIBER-HANDLER-ERROR-EVENT

Kinds: function

Return the event being handled when CONDITION was signaled.

ELMTUI.CORE.CONDITIONS:SUBSCRIBER-HANDLER-ERROR-HANDLER

Kinds: function

Return the subscriber handler associated with CONDITION.

ELMTUI.CORE.CONDITIONS:SUBSCRIBER-HANDLER-ERROR-REASON

Kinds: function

Return the subscriber handler failure reason carried by CONDITION.

ELMTUI.CORE.CONDITIONS:TYPE-VALIDATION-ERROR

Kinds: type

Type validation failure retaining expected type, original value and path.

ELMTUI.CORE.CONDITIONS:TYPE-VALIDATION-ERROR-EXPECTED-TYPE

Kinds: function

Return the expected type designator used in validation.

ELMTUI.CORE.CONDITIONS:VALIDATION-ERROR-MESSAGE

Kinds: function

Return the framework-prefixed validation message carried by CONDITION.

ELMTUI.CORE.CONDITIONS:VALIDATION-ERROR-PATH

Kinds: function

Return the optional path locating the offending value.

ELMTUI.CORE.CONDITIONS:VALIDATION-ERROR-VALUE

Kinds: function

Return the original offending Lisp value, without coercion.

ELMTUI.CORE.CONDITIONS:WITH-MESSAGE-RESTARTS

Kinds: macro

Execute FORMS with message-specific restarts around validation failures.

While MESSAGE-VALIDATION-ERROR is active, SKIP-MESSAGE returns NIL,
REPLACE-MESSAGE returns a caller-supplied replacement, and RETRY re-executes
FORMS. CONDITION-VAR names the original condition for logging and inspection.

Mutation: only FORMS may mutate state; RETRY can repeat those effects.
Conditions: the original condition is logged but not re-signaled or swallowed;
handlers or the debugger may invoke the active restarts.

ELMTUI.CORE.CONDITIONS:WITH-RECOVERY

Kinds: macro

Execute BODY with inspectable CONDITION-TYPE recovery restarts.

ON-ERROR is called whenever CONDITION-TYPE is signaled. RESTARTS is a literal
or quoted list containing any of :RETRY, :SKIP, :IGNORE-TASK, :USE-VALUE, and
:ABORT. The selected restarts surround BODY, so handlers and the debugger can
inspect the original condition and invoke recovery without re-signaling it.

:RETRY re-executes BODY, :SKIP and :IGNORE-TASK return NIL, :USE-VALUE returns a
replacement supplied to the restart, and :ABORT propagates the original
condition as an error.

Mutation: the macro itself only records the most recently signaled condition;
BODY controls application mutation. Retrying BODY can repeat its side effects,
so callers should use :RETRY only around idempotent or transactional work.
Conditions: unhandled conditions propagate normally; nothing is swallowed.

Example:
  (handler-bind
      ((message-validation-error
         (lambda (condition)
           (declare (ignore condition))
           (invoke-restart 'use-value :replacement))))
    (with-recovery (message-validation-error :restarts '(:use-value :abort))
      (validate-message message)))

ELMTUI.CORE.CONDITIONS:WITH-RENDER-RESTARTS

Kinds: macro

Execute FORMS with render-specific recovery restarts.

While RENDER-ERROR is active, SKIP-FRAME returns NIL, FALLBACK-VIEW returns a
caller-supplied fallback value, and RETRY re-executes FORMS. CONDITION-VAR names
the original condition for logging and inspection.

Mutation: only FORMS may mutate state; RETRY can repeat those effects.
Conditions: the original condition is logged but remains available to handlers,
the debugger, and active restarts.

ELMTUI.CORE.DEFAULTS:DEFAULT-REGISTRY

Kinds: variable

Global registry of default values for all Elmtui components.

ELMTUI.CORE.DEFAULTS:DEFAULT-SPEC

Kinds: type

Specification for a default value with metadata.

ELMTUI.CORE.DEFAULTS:GET-DEFAULT

Kinds: function

Get a default value by key. If ERROR-P is true, signal error for missing defaults.

ELMTUI.CORE.DEFAULTS:GET-DEFAULT-OR-ERROR

Kinds: function

Get a default value, signaling an error if not found.

ELMTUI.CORE.DEFAULTS:MAKE-DEFAULT-CONTEXT

Kinds: function

Create a new default context, optionally inheriting from parent.

ELMTUI.CORE.DEFAULTS:REGISTER-DEFAULT

Kinds: macro

Macro version of register-default for compile-time type safety.

KEY: Symbol or keyword identifying the default
VALUE: The default value
TYPE: Expected type for type checking (evaluated at macroexpansion)
DOCUMENTATION: String describing the default
FALLBACK: Fallback value if primary value is invalid
VALIDATOR: Function to validate the value
CATEGORY: Keyword for grouping related defaults
SOURCE: Source file or system where this default originated

ELMTUI.CORE.DEFAULTS:VALIDATE-DEFAULT-VALUE

Kinds: function

Validate that a default specification is valid.

ELMTUI.CORE.DEFAULTS:WITH-DEFAULTS

Kinds: macro

Execute BODY with thread-local defaults, restoring the caller's binding on exit.

ELMTUI.CORE.ERRORS:+DIAGNOSTIC-CONTEXT-KEYS+

Kinds: variable

Canonical keys for structured ElmTUI diagnostic context.

The vocabulary is deliberately small and orthogonal: operation identifies the
action, component/state/backend keys identify ownership and location,
message/event identifies runtime input, offending-value and expected-type
explain validation failures, and underlying-condition preserves causal errors.

ELMTUI.CORE.ERRORS:BACKEND-ERROR

Kinds: type

Platform backend operation failure exposing backend type and attempted operation.

ELMTUI.CORE.ERRORS:BACKEND-ERROR-OPERATION

Kinds: function

Return the backend operation associated with CONDITION.

ELMTUI.CORE.ERRORS:BACKEND-ERROR-TYPE

Kinds: function

Return the backend type associated with CONDITION.

ELMTUI.CORE.ERRORS:COMPONENT-ERROR

Kinds: type

Component operation failure retaining component type, identifier and operation for recovery handling.

ELMTUI.CORE.ERRORS:COMPONENT-ERROR-ID

Kinds: function

Return the component identifier associated with CONDITION.

ELMTUI.CORE.ERRORS:COMPONENT-ERROR-OPERATION

Kinds: function

Return the component operation associated with CONDITION.

ELMTUI.CORE.ERRORS:COMPONENT-ERROR-TYPE

Kinds: function

Return the component type associated with CONDITION.

ELMTUI.CORE.ERRORS:DEFCOMPONENT-ERROR

Kinds: type

Invalid component definition. Exposes rejected macro argument and validation category.

ELMTUI.CORE.ERRORS:DEFCOMPONENT-ERROR-ARG

Kinds: function

Return the DEFCOMPONENT argument associated with CONDITION.

ELMTUI.CORE.ERRORS:DEFCOMPONENT-ERROR-VALIDATION-TYPE

Kinds: function

Return the DEFCOMPONENT validation category associated with CONDITION.

ELMTUI.CORE.ERRORS:DEVELOPMENT-MODE-P

Kinds: function

Returns true if we're in development mode.

ELMTUI.CORE.ERRORS:DIAGNOSTIC-CONTEXT-KEY-P

Kinds: function

Return true when KEY belongs to the canonical diagnostic context vocabulary.

ELMTUI.CORE.ERRORS:DSL-ERROR

Kinds: type

Declarative UI form failure, preserving the offending DSL form and source position.

ELMTUI.CORE.ERRORS:DSL-ERROR-FORM

Kinds: function

Return the DSL form associated with CONDITION.

ELMTUI.CORE.ERRORS:DSL-ERROR-POSITION

Kinds: function

Return the DSL source position associated with CONDITION.

ELMTUI.CORE.ERRORS:ELMTUI-CONDITION

Kinds: type

Inspectable root for maintained ElmTUI framework conditions.

ELMTUI-INFORMATION, ELMTUI-WARNING, and ELMTUI-ERROR form the public severity
families. Subsystem conditions remain inspectable through their concrete type
while a handler on ELMTUI-CONDITION can observe the whole framework family.

ELMTUI.CORE.ERRORS:ELMTUI-ERROR

Kinds: type

Base error condition for ElmTUI failures.

Instances are intended to remain inspectable in the debugger: MESSAGE summarizes
the failure, CONTEXT carries machine-readable details, MODULE identifies the
subsystem, and SUGGESTIONS provides human-oriented remediation.  Signaling this
condition does not mutate application state; callers may establish handlers and
invoke restarts supplied around the signaling operation.

ELMTUI.CORE.ERRORS:ELMTUI-ERROR-CONTEXT

Kinds: function

Return the structured diagnostic context carried by CONDITION.

ELMTUI.CORE.ERRORS:ELMTUI-ERROR-MESSAGE

Kinds: function

Return the optional human-readable summary carried by CONDITION.

ELMTUI.CORE.ERRORS:ELMTUI-ERROR-MODULE

Kinds: function

Return the logical subsystem identifier carried by CONDITION.

ELMTUI.CORE.ERRORS:ELMTUI-ERROR-SUGGESTIONS

Kinds: function

Return the ordered recovery suggestions carried by CONDITION.

ELMTUI.CORE.ERRORS:ELMTUI-INFORMATION

Kinds: type

Base class for non-warning informational ElmTUI conditions.

ELMTUI.CORE.ERRORS:ELMTUI-WARNING

Kinds: type

Base class for ElmTUI warnings.

ELMTUI.CORE.ERRORS:ERROR-WITH-CONTEXT

Kinds: function

Signal an error with rich context information.

ELMTUI.CORE.ERRORS:MAKE-ELMTUI-ERROR

Kinds: function

Construct and return an inspectable ElmTUI condition of TYPE.

Arguments:
  TYPE is ELMTUI-ERROR or one of its subclasses. MESSAGE is an optional concise
  summary. CONTEXT is preserved as the caller supplied it, so structured
  plists/alists remain debugger-inspectable. SUGGESTIONS is normalized to a
  list. MODULE identifies the logical subsystem. Remaining keyword arguments
  are passed to MAKE-CONDITION for subclass-specific slots.

Returns:
  A condition object. The condition is not signaled by this function.

Mutation:
  None. Caller-owned CONTEXT and SUGGESTIONS are referenced, not modified.

Conditions:
  MAKE-CONDITION may signal an error when TYPE is unknown or required
  subclass initargs are missing. Those conditions propagate unchanged.

Example:
  (make-elmtui-error 'state-error
    :message "Counter state is invalid"
    :operation :update
    :path '(:counter :value)
    :state-type :plist
    :context '((:component-id . :counter)))

ELMTUI.CORE.ERRORS:PLATFORM-ERROR

Kinds: type

Base class for ElmTUI failures originating at a platform/backend boundary.

ELMTUI.CORE.ERRORS:RUNTIME-ERROR

Kinds: type

Base class for ElmTUI failures that occur during application/runtime execution.

ELMTUI.CORE.ERRORS:STATE-ERROR

Kinds: type

Runtime state access or mutation failure. Inspect STATE-ERROR-OPERATION, STATE-ERROR-PATH and STATE-ERROR-TYPE.

ELMTUI.CORE.ERRORS:STATE-ERROR-OPERATION

Kinds: function

Return the state operation associated with CONDITION.

ELMTUI.CORE.ERRORS:STATE-ERROR-PATH

Kinds: function

Return the state path associated with CONDITION.

ELMTUI.CORE.ERRORS:STATE-ERROR-TYPE

Kinds: function

Return the expected or observed state representation associated with CONDITION.

ELMTUI.CORE.ERRORS:SUGGEST-FIXES

Kinds: function

Create a list of suggested fixes for error messages.

ELMTUI.CORE.ERRORS:WITH-ERROR-CONTEXT

Kinds: macro

Annotate ElmTUI errors signaled by BODY without replacing the condition object.

CONTEXT, MODULE, OPERATION, COMPONENT-ID, and MACRO-ARG are evaluated once.  If
BODY signals ELMTUI-ERROR, the same condition object is enriched in place and
continues through the active condition machinery.  Preserving object identity
also preserves every subclass slot, debugger state, and restart association.

Existing structured context is retained.  Non-list context is wrapped as a
:CONTEXT entry before new entries are appended.  MODULE, when non-NIL, also
updates the condition's module slot.

Mutation: mutates only diagnostic slots of a signaled ELMTUI-ERROR; application
state is untouched.
Conditions: does not catch or suppress ELMTUI-ERROR.  The original condition
continues outward and remains available to HANDLER-BIND, the debugger, and
active restarts.

Example:
  (with-error-context (:module :renderer :operation :draw :component-id id)
    (render-component component))

ELMTUI.CORE.EVENT-ASYNC:EVENT-PROMISE

Kinds: function

Register a one-shot event handler on CHANNEL and return a small promise state.

This compatibility helper intentionally keeps the old API contract needed by
legacy regression tests: matching an event resolves once and unregisters the
handler from the channel. TIMEOUT is accepted for API compatibility; no timer is
started here because the current runtime no longer depends on this helper for
production async dispatch.

ELMTUI.CORE.EVENT-CHANNELS:ADD-EVENT-FILTER

Kinds: function

Add FN to CHAN's filter list and rebuild its underlying filtered channel; return CHAN.

ELMTUI.CORE.EVENT-CHANNELS:CHANNEL-OF

Kinds: function

Return the underlying CL-EVENTS channel owned by a typed EVENT-CHANNEL instance.

ELMTUI.CORE.EVENT-CHANNELS:CHANNEL-PRIORITY

Kinds: function

Return CHAN's :HIGH, :NORMAL, or :LOW priority.

ELMTUI.CORE.EVENT-CHANNELS:COMMAND-CHANNEL

Kinds: type

Command-Channel events.

ELMTUI.CORE.EVENT-CHANNELS:EVENT-CHANNEL

Kinds: type

Common superclass for all typed event channels.

ELMTUI.CORE.EVENT-CHANNELS:FILTERS

Kinds: function

Read or replace the channel wrapper's list of registered filter functions.

ELMTUI.CORE.EVENT-CHANNELS:FOCUS-CHANNEL

Kinds: type

Focus-Channel events.

ELMTUI.CORE.EVENT-CHANNELS:HANDLERS

Kinds: function

Read or replace the channel wrapper's registered handler list; handlers are not invoked automatically by RECEIVE-EVENT.

ELMTUI.CORE.EVENT-CHANNELS:KEYBOARD-CHANNEL

Kinds: type

Keyboard-Channel events.

ELMTUI.CORE.EVENT-CHANNELS:MAKE-COMMAND-CHANNEL

Kinds: function

Construct a typed command channel, forwarding keyword options such as :PRIORITY, :FILTERS and :CAPACITY.

ELMTUI.CORE.EVENT-CHANNELS:MAKE-EVENT-CHANNEL

Kinds: function

Low-level helper – CLASS is a subclass symbol of `event-channel'.

ELMTUI.CORE.EVENT-CHANNELS:MAKE-FOCUS-CHANNEL

Kinds: function

Construct a typed focus channel, forwarding keyword options such as :PRIORITY, :FILTERS and :CAPACITY.

ELMTUI.CORE.EVENT-CHANNELS:MAKE-KEYBOARD-CHANNEL

Kinds: function

Construct a typed keyboard channel, forwarding keyword options such as :PRIORITY, :FILTERS and :CAPACITY.

ELMTUI.CORE.EVENT-CHANNELS:MAKE-MESSAGE-CHANNEL

Kinds: function

Construct a typed message channel, forwarding keyword options such as :PRIORITY, :FILTERS and :CAPACITY.

ELMTUI.CORE.EVENT-CHANNELS:MAKE-MOUSE-CHANNEL

Kinds: function

Construct a typed mouse channel, forwarding keyword options such as :PRIORITY, :FILTERS and :CAPACITY.

ELMTUI.CORE.EVENT-CHANNELS:MAKE-SYSTEM-CHANNEL

Kinds: function

Construct a typed system channel, forwarding keyword options such as :PRIORITY, :FILTERS and :CAPACITY.

ELMTUI.CORE.EVENT-CHANNELS:MAKE-UI-CHANNEL

Kinds: function

Construct a typed UI channel, forwarding keyword options such as :PRIORITY, :FILTERS and :CAPACITY.

ELMTUI.CORE.EVENT-CHANNELS:MESSAGE-CHANNEL

Kinds: type

Message-Channel events.

ELMTUI.CORE.EVENT-CHANNELS:MOUSE-CHANNEL

Kinds: type

Mouse-Channel events.

ELMTUI.CORE.EVENT-CHANNELS:NAME

Kinds: function

Return the typed event channel's symbolic identifier.

ELMTUI.CORE.EVENT-CHANNELS:PRIORITY

Kinds: function

Read or replace the wrapper's dispatch priority, one of :HIGH, :NORMAL, or :LOW.

ELMTUI.CORE.EVENT-CHANNELS:RECEIVE-EVENT

Kinds: function

Receive an item from CHAN's underlying CL-EVENTS channel using the blocking receive operation.

ELMTUI.CORE.EVENT-CHANNELS:REGISTER-EVENT-HANDLER

Kinds: function

Push FN onto CHAN's registered handler list and return CHAN; this does not automatically dispatch received events.

ELMTUI.CORE.EVENT-CHANNELS:REMOVE-EVENT-FILTER

Kinds: function

Remove FN from CHAN's filter list and update the underlying filtered channel; return CHAN.

ELMTUI.CORE.EVENT-CHANNELS:SEND-EVENT

Kinds: function

Send EV into CHAN's underlying CL-EVENTS channel using its normal send operation.

ELMTUI.CORE.EVENT-CHANNELS:SET-CHANNEL-PRIORITY

Kinds: function

Set CHAN's symbolic priority to NEW and return the assigned value.

ELMTUI.CORE.EVENT-CHANNELS:STANDARD-EVENT-CHANNELS

Kinds: function

Return an alist (KEY . CHANNEL) for all built-ins.

ELMTUI.CORE.EVENT-CHANNELS:SYSTEM-CHANNEL

Kinds: type

System-Channel events.

ELMTUI.CORE.EVENT-CHANNELS:TRY-RECEIVE-EVENT

Kinds: function

Try to receive one event from CHAN, optionally waiting up to TIMEOUT seconds.

With NIL or zero TIMEOUT this performs exactly one non-blocking probe.  A
positive TIMEOUT repeatedly probes through CL-EVENTS.LOOP:POLL-UNTIL and returns
NIL when the deadline expires.  The event is consumed when returned.

Mutation: consumes at most one item from CHAN's underlying queue.
Conditions: channel/probe conditions are propagated unchanged; none are
silently converted to NIL.

ELMTUI.CORE.EVENT-CHANNELS:UI-CHANNEL

Kinds: type

Ui-Channel events.

ELMTUI.CORE.EVENT-CHANNELS:UNREGISTER-EVENT-HANDLER

Kinds: function

Remove FN from CHAN's registered handler list and return CHAN.

ELMTUI.CORE.EVENT-CHANNELS:WAIT-FOR-EVENT

Kinds: function

Wait for the first ready event from EVENT-CHANNELS.

Channels are stably ordered by PRIORITY before each wait: :HIGH, :NORMAL, then
:LOW.  Returns two values, EVENT and its EVENT-CHANNEL.  TIMEOUT is in seconds;
NIL waits indefinitely and zero performs one scan.

All repeated probing, deadline handling, and cooperative sleeping are delegated
to CL-EVENTS.LOOP:POLL-UNTIL so the runtime has one polling implementation.

Mutation: consumes exactly one queued event on success.
Conditions: channel/probe conditions propagate to the caller unchanged.

ELMTUI.CORE.EVENT-PIPELINE:CONDITIONAL-PIPE

Kinds: type

Pipe class selecting its THEN or ELSE nested pipe by calling the predicate in :CONDITION on each event.

ELMTUI.CORE.EVENT-PIPELINE:FILTER-PIPE

Kinds: type

Pipe class whose :FILTER function receives an event; a false value drops it and a true value retains the original event.

ELMTUI.CORE.EVENT-PIPELINE:MAKE-PIPELINE

Kinds: function

Construct a pipeline with an ordered list of PIPES and optional FALLTHROUGH flag, which defaults to true.

ELMTUI.CORE.EVENT-PIPELINE:PIPE

Kinds: type

Base class of event-processing pipes, specialized by filters, transformations, and conditional branches.

ELMTUI.CORE.EVENT-PIPELINE:PIPELINE

Kinds: type

An ordered event-processing pipeline with mutable PIPES and FALLTHROUGH slots.

ELMTUI.CORE.EVENT-PIPELINE:PIPELINE-FALLTHROUGH

Kinds: function

Read or set the pipeline's FALLTHROUGH flag controlling what happens when a stage returns NIL.

ELMTUI.CORE.EVENT-PIPELINE:PIPELINE-PIPES

Kinds: function

Read or set the ordered list of pipe objects processed by a pipeline.

ELMTUI.CORE.EVENT-PIPELINE:PROCESS-EVENT

Kinds: function

Run EVENT through each pipeline pipe in order. A stage returning NIL clears the event when FALLTHROUGH is true, otherwise processing returns NIL immediately.

ELMTUI.CORE.EVENT-PIPELINE:TRANSFORM-PIPE

Kinds: type

Pipe class whose :TRANSFORM function maps an incoming event to the next stage's value.

ELMTUI.CORE.EVENT-TYPES:COMMAND-EVENT

Kinds: type

Public command event type used to represent structured terminal events and commands.

ELMTUI.CORE.EVENT-TYPES:COMMAND-EVENT-ARGS

Kinds: function

Return the event args recorded in the command representation.

ELMTUI.CORE.EVENT-TYPES:COMMAND-EVENT-NAME

Kinds: function

Return the event name recorded in the command representation.

ELMTUI.CORE.EVENT-TYPES:COMMAND-EVENT-P

Kinds: function

Return true when the supplied value satisfies the command event type predicate.

ELMTUI.CORE.EVENT-TYPES:COMMAND-EVENT-SOURCE

Kinds: function

Return the event source recorded in the command representation.

ELMTUI.CORE.EVENT-TYPES:COMMAND-EVENT-TIMESTAMP

Kinds: function

Return the event timestamp recorded in the command representation.

ELMTUI.CORE.EVENT-TYPES:CONVERT-LIST-TO-EVENT

Kinds: function

Converts a list-format event to the appropriate struct format.

ELMTUI.CORE.EVENT-TYPES:KEY-0

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: 0

ELMTUI.CORE.EVENT-TYPES:KEY-1

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: 1

ELMTUI.CORE.EVENT-TYPES:KEY-2

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: 2

ELMTUI.CORE.EVENT-TYPES:KEY-3

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: 3

ELMTUI.CORE.EVENT-TYPES:KEY-4

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: 4

ELMTUI.CORE.EVENT-TYPES:KEY-5

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: 5

ELMTUI.CORE.EVENT-TYPES:KEY-6

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: 6

ELMTUI.CORE.EVENT-TYPES:KEY-7

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: 7

ELMTUI.CORE.EVENT-TYPES:KEY-8

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: 8

ELMTUI.CORE.EVENT-TYPES:KEY-9

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: 9

ELMTUI.CORE.EVENT-TYPES:KEY-A

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: A

ELMTUI.CORE.EVENT-TYPES:KEY-B

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: B

ELMTUI.CORE.EVENT-TYPES:KEY-BACKSPACE

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: BACKSPACE

ELMTUI.CORE.EVENT-TYPES:KEY-C

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: C

ELMTUI.CORE.EVENT-TYPES:KEY-COMMA

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: COMMA

ELMTUI.CORE.EVENT-TYPES:KEY-D

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: D

ELMTUI.CORE.EVENT-TYPES:KEY-DELETE

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: DELETE

ELMTUI.CORE.EVENT-TYPES:KEY-DOWN

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: ARROW-DOWN

ELMTUI.CORE.EVENT-TYPES:KEY-E

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: E

ELMTUI.CORE.EVENT-TYPES:KEY-END

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: END

ELMTUI.CORE.EVENT-TYPES:KEY-ENTER

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: ENTER

ELMTUI.CORE.EVENT-TYPES:KEY-EQUALS

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: EQUALS

ELMTUI.CORE.EVENT-TYPES:KEY-ESCAPE

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: ESCAPE

ELMTUI.CORE.EVENT-TYPES:KEY-EVENT-PARTS

Kinds: function

Extract key event components from MESSAGE.
Returns (values KEY CHAR MODIFIERS) for key events, or (values NIL NIL NIL)
otherwise.  Handles both key-event structs and legacy (:keyevent ...) plist
messages.

ELMTUI.CORE.EVENT-TYPES:KEY-F

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: F

ELMTUI.CORE.EVENT-TYPES:KEY-F1

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: F1

ELMTUI.CORE.EVENT-TYPES:KEY-F10

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: F10

ELMTUI.CORE.EVENT-TYPES:KEY-F11

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: F11

ELMTUI.CORE.EVENT-TYPES:KEY-F12

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: F12

ELMTUI.CORE.EVENT-TYPES:KEY-F2

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: F2

ELMTUI.CORE.EVENT-TYPES:KEY-F3

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: F3

ELMTUI.CORE.EVENT-TYPES:KEY-F4

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: F4

ELMTUI.CORE.EVENT-TYPES:KEY-F5

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: F5

ELMTUI.CORE.EVENT-TYPES:KEY-F6

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: F6

ELMTUI.CORE.EVENT-TYPES:KEY-F7

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: F7

ELMTUI.CORE.EVENT-TYPES:KEY-F8

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: F8

ELMTUI.CORE.EVENT-TYPES:KEY-F9

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: F9

ELMTUI.CORE.EVENT-TYPES:KEY-G

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: G

ELMTUI.CORE.EVENT-TYPES:KEY-H

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: H

ELMTUI.CORE.EVENT-TYPES:KEY-HOME

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: HOME

ELMTUI.CORE.EVENT-TYPES:KEY-I

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: I

ELMTUI.CORE.EVENT-TYPES:KEY-INSERT

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: INSERT

ELMTUI.CORE.EVENT-TYPES:KEY-J

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: J

ELMTUI.CORE.EVENT-TYPES:KEY-K

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: K

ELMTUI.CORE.EVENT-TYPES:KEY-L

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: L

ELMTUI.CORE.EVENT-TYPES:KEY-LEFT

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: ARROW-LEFT

ELMTUI.CORE.EVENT-TYPES:KEY-LEFT-BRACKET

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: LEFT-BRACKET

ELMTUI.CORE.EVENT-TYPES:KEY-M

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: M

ELMTUI.CORE.EVENT-TYPES:KEY-MINUS

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: MINUS

ELMTUI.CORE.EVENT-TYPES:KEY-N

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: N

ELMTUI.CORE.EVENT-TYPES:KEY-O

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: O

ELMTUI.CORE.EVENT-TYPES:KEY-P

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: P

ELMTUI.CORE.EVENT-TYPES:KEY-PAGE-DOWN

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: PAGE-DOWN

ELMTUI.CORE.EVENT-TYPES:KEY-PAGE-UP

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: PAGE-UP

ELMTUI.CORE.EVENT-TYPES:KEY-PERIOD

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: PERIOD

ELMTUI.CORE.EVENT-TYPES:KEY-Q

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: Q

ELMTUI.CORE.EVENT-TYPES:KEY-QUOTE

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: QUOTE

ELMTUI.CORE.EVENT-TYPES:KEY-R

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: R

ELMTUI.CORE.EVENT-TYPES:KEY-RIGHT

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: ARROW-RIGHT

ELMTUI.CORE.EVENT-TYPES:KEY-RIGHT-BRACKET

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: RIGHT-BRACKET

ELMTUI.CORE.EVENT-TYPES:KEY-S

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: S

ELMTUI.CORE.EVENT-TYPES:KEY-SEMICOLON

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: SEMICOLON

ELMTUI.CORE.EVENT-TYPES:KEY-SLASH

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: SLASH

ELMTUI.CORE.EVENT-TYPES:KEY-SPACE

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: SPACE

ELMTUI.CORE.EVENT-TYPES:KEY-T

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: T

ELMTUI.CORE.EVENT-TYPES:KEY-TAB

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: TAB

ELMTUI.CORE.EVENT-TYPES:KEY-U

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: U

ELMTUI.CORE.EVENT-TYPES:KEY-UP

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: ARROW-UP

ELMTUI.CORE.EVENT-TYPES:KEY-V

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: V

ELMTUI.CORE.EVENT-TYPES:KEY-W

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: W

ELMTUI.CORE.EVENT-TYPES:KEY-X

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: X

ELMTUI.CORE.EVENT-TYPES:KEY-Y

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: Y

ELMTUI.CORE.EVENT-TYPES:KEY-Z

Kinds: variable

Key constant generated by DEFINE-KEY-CONSTANTS: Z

ELMTUI.CORE.EVENT-TYPES:MAKE-COMMAND-EVENT

Kinds: function

Construct a command event structure from its provided initialization fields.

ELMTUI.CORE.EVENT-TYPES:MAKE-SYSTEM-EVENT

Kinds: function

Construct a system event structure from its provided initialization fields.

ELMTUI.CORE.EVENT-TYPES:MAKE-TIMER-EVENT

Kinds: function

Construct a timer event structure from its provided initialization fields.

ELMTUI.CORE.EVENT-TYPES:MAKE-WINDOW-EVENT

Kinds: function

Construct a window event structure from its provided initialization fields.

ELMTUI.CORE.EVENT-TYPES:NORMALIZE-FOCUS-EVENT

Kinds: function

Converts platform-specific focus event to a standardized focus-event.
   PLATFORM-EVENT: The raw event from the platform layer.

ELMTUI.CORE.EVENT-TYPES:NORMALIZE-KEY-EVENT

Kinds: function

Converts platform-specific keyboard event to a standardized key-event.
   PLATFORM-EVENT: The raw event from the platform layer.

ELMTUI.CORE.EVENT-TYPES:NORMALIZE-MOUSE-EVENT

Kinds: function

Converts platform-specific mouse event to a standardized mouse-event.
   PLATFORM-EVENT: The raw event from the platform layer.

ELMTUI.CORE.EVENT-TYPES:SYSTEM-EVENT

Kinds: type

Public system event type used to represent structured terminal events and commands.

ELMTUI.CORE.EVENT-TYPES:SYSTEM-EVENT-DATA

Kinds: function

Return the data recorded in the system event representation.

ELMTUI.CORE.EVENT-TYPES:SYSTEM-EVENT-P

Kinds: function

Return true when the supplied value satisfies the system event type predicate.

ELMTUI.CORE.EVENT-TYPES:SYSTEM-EVENT-TIMESTAMP

Kinds: function

Return the timestamp recorded in the system event representation.

ELMTUI.CORE.EVENT-TYPES:SYSTEM-EVENT-TYPE

Kinds: function

Return the type recorded in the system event representation.

ELMTUI.CORE.EVENT-TYPES:TIMER-EVENT

Kinds: type

Public timer event type used to represent structured terminal events and commands.

ELMTUI.CORE.EVENT-TYPES:TIMER-EVENT-ID

Kinds: function

Return the id recorded in the timer event representation.

ELMTUI.CORE.EVENT-TYPES:TIMER-EVENT-P

Kinds: function

Return true when the supplied value satisfies the timer event type predicate.

ELMTUI.CORE.EVENT-TYPES:TIMER-EVENT-TIMESTAMP

Kinds: function

Return the timestamp recorded in the timer event representation.

ELMTUI.CORE.EVENT-TYPES:TIMER-EVENT-USER-DATA

Kinds: function

Return the user data recorded in the timer event representation.

ELMTUI.CORE.EVENT-TYPES:VALID-KEY-EVENT-P

Kinds: function

Returns true if EVENT is a valid key-event structure.

ELMTUI.CORE.EVENT-TYPES:VALID-MOUSE-EVENT-P

Kinds: function

Returns true if EVENT is a valid mouse-event structure.

ELMTUI.CORE.EVENT-TYPES:WINDOW-EVENT

Kinds: type

Public window event type used to represent structured terminal events and commands.

ELMTUI.CORE.EVENT-TYPES:WINDOW-EVENT-HEIGHT

Kinds: function

Return the height recorded in the window event representation.

ELMTUI.CORE.EVENT-TYPES:WINDOW-EVENT-P

Kinds: function

Return true when the supplied value satisfies the window event type predicate.

ELMTUI.CORE.EVENT-TYPES:WINDOW-EVENT-TIMESTAMP

Kinds: function

Return the timestamp recorded in the window event representation.

ELMTUI.CORE.EVENT-TYPES:WINDOW-EVENT-TYPE

Kinds: function

Return the type recorded in the window event representation.

ELMTUI.CORE.EVENT-TYPES:WINDOW-EVENT-WIDTH

Kinds: function

Return the width recorded in the window event representation.

ELMTUI.CORE.EVENTS:AFTER-SEND-MESSAGE-HOOKS

Kinds: variable

A list of functions to be called after a message has been processed by SEND-MESSAGE.
Each hook function should accept the target and the message as arguments.

ELMTUI.CORE.EVENTS:BEFORE-SEND-MESSAGE-HOOKS

Kinds: variable

A list of functions to be called before a message is sent via SEND-MESSAGE.
Each hook function should accept the target and the message as arguments.

ELMTUI.CORE.EVENTS:MESSAGE-CONTRACTS

Kinds: variable

Registry of message contracts for validation and documentation.

ELMTUI.CORE.EVENTS:ADD-AFTER-SEND-MESSAGE-HOOK

Kinds: function

Adds HOOK-FN to the list of hooks executed after sending a message.

ELMTUI.CORE.EVENTS:ADD-BEFORE-SEND-MESSAGE-HOOK

Kinds: function

Adds HOOK-FN to the list of hooks executed before sending a message.

ELMTUI.CORE.EVENTS:CMD

Kinds: type

A command for side-effects: (:async FUNCTION ARGS...) or (:batch [CMDS]).
   Contract: type ∈ :async|:batch|…; args ∈ list.

ELMTUI.CORE.EVENTS:DESERIALIZE-MESSAGE

Kinds: function

Deserializes a property list representation back into a message object.
   Expects a plist like '(:type <type> :data "<serialized-data-string>").
   Returns a new message object or NIL if deserialization fails and is not recovered.

ELMTUI.CORE.EVENTS:LOG-MESSAGE

Kinds: function

Log MSG with tracing for message flows.

ELMTUI.CORE.EVENTS:MAKE-CMD

Kinds: function

No documentation metadata.

ELMTUI.CORE.EVENTS:PROPAGATION-STOPPED-P

Kinds: function

No documentation metadata.

ELMTUI.CORE.EVENTS:REGISTER-MESSAGE-CONTRACT

Kinds: macro

Register CONTRACT-FN as the explicit validation contract for TYPE.
PRIORITY is deprecated and ignored for source compatibility. Message priority is
owned exclusively by CL-EVENTS.PROTOCOLS:MESSAGE-PRIORITY on message values.

ELMTUI.CORE.EVENTS:REMOVE-AFTER-SEND-MESSAGE-HOOK

Kinds: function

Removes HOOK-FN from the list of hooks executed after sending a message.

ELMTUI.CORE.EVENTS:REMOVE-BEFORE-SEND-MESSAGE-HOOK

Kinds: function

Removes HOOK-FN from the list of hooks executed before sending a message.

ELMTUI.CORE.EVENTS:SEND-MESSAGE

Kinds: function

Send MSG to TARGET using the on-message protocol.
   Validates, logs the message, and calls lifecycle hooks. Handles validation and dispatch errors.

ELMTUI.CORE.EVENTS:SERIALIZE-MESSAGE

Kinds: function

Serializes a message object into a property list.
   Focuses on :type and :data. Other slots (state, handles) are lost.
   Returns a plist like '(:type <type> :data "<serialized-data-string>") or NIL if serialization fails and is not recovered.

ELMTUI.CORE.EVENTS:VALIDATE-MESSAGE

Kinds: function

Validate MSG against its explicit contract or its schema from DEFMSG.
   Signals message-validation-error if invalid.

ELMTUI.CORE.FOCUS:ACTIVATE-FOCUS-CONTEXT

Kinds: function

Activate a focus context in the focus manager.
   Saves current focus to the outgoing context's last-focus.
   Restores focus from the incoming context's last-focus if available.

ELMTUI.CORE.FOCUS:CLEAR-FOCUS

Kinds: function

Clears the current focus.

ELMTUI.CORE.FOCUS:COLLECT-FOCUSABLE-ELEMENTS

Kinds: function

Traverses the UI tree and collects all elements that are focusable.
   Supports legacy plist nodes and Hiccup-style (type props . children) nodes.

ELMTUI.CORE.FOCUS:COLLECT-FOCUSABLE-IDS

Kinds: function

Traverses the UI tree and collects IDs of all elements that are focusable.
   Returns a list of element IDs that can receive focus.

ELMTUI.CORE.FOCUS:FIND-COMPONENT-KEYMAP-CONTEXT

Kinds: function

Find or create a keymap context for a component.
   CONTROLS keymap activation based on widget model keymap definitions.

ELMTUI.CORE.FOCUS:FOCUS-MANAGER

Kinds: type

Manages focus state and navigation in the application.

ELMTUI.CORE.FOCUS:FOCUS-MANAGER-ACTIVE-FOCUS-CONTEXT

Kinds: function

Return or set the identifier of the currently active focus context, or NIL.

ELMTUI.CORE.FOCUS:FOCUS-MANAGER-CONTEXT-DATA

Kinds: function

Return the focus manager's hash table mapping context identifiers to stored focus-context records.

ELMTUI.CORE.FOCUS:FOCUS-MANAGER-CURRENT-FOCUS

Kinds: function

Return or set the identifier of the currently focused widget, or NIL.

ELMTUI.CORE.FOCUS:FOCUS-MANAGER-FOCUS-HISTORY

Kinds: function

Return or replace the focus manager's stack of previously focused widget identifiers.

ELMTUI.CORE.FOCUS:FOCUS-MANAGER-FOCUS-RING-DIRTY-P

Kinds: function

Return or set whether the cached focusable widget ring must be recalculated.

ELMTUI.CORE.FOCUS:FOCUS-MANAGER-FOCUSABLE-ELEMENTS

Kinds: function

Return or set the ordered list of focusable widget identifiers used by focus traversal.

ELMTUI.CORE.FOCUS:FOCUS-PREVIOUS-FROM-HISTORY

Kinds: function

Sets focus to the previous element in the focus history.

ELMTUI.CORE.FOCUS:GET-CONTEXT-LAST-FOCUS

Kinds: function

Returns the last known focused element ID for the given context-id.

ELMTUI.CORE.FOCUS:GET-CURRENT-FOCUS

Kinds: function

Returns the ID of the currently focused element.

ELMTUI.CORE.FOCUS:GET-NEXT-FOCUSABLE

Kinds: function

Returns the ID of the next focusable element after CURRENT-ID.
   If CURRENT-ID is nil or not found, returns the first focusable element.
   Wraps around to the beginning if at the end.

ELMTUI.CORE.FOCUS:GET-PREVIOUS-FOCUSABLE

Kinds: function

Returns the ID of the previous focusable element before CURRENT-ID.
   If CURRENT-ID is nil or not found, returns the last focusable element.
   Wraps around to the end if at the beginning.

ELMTUI.CORE.FOCUS:HANDLE-DEFAULT-NAVIGATION-KEYS

Kinds: function

Handle standard navigation keys including arrows, tab, escape, etc.
   Provides a comprehensive set of default navigation behaviors.
   Returns T if the event was handled, NIL otherwise.

ELMTUI.CORE.FOCUS:HANDLE-FOCUS-MESSAGE

Kinds: function

Handles focus-related messages.
   Returns a plist describing the state changes to be made, or NIL if no changes.
   This function now operates directly on the focus-manager instance passed to it,
   and expects app-state for context when calling set-focus or other operations
   that might interact with the broader application state (e.g., component-gained/lost-focus hooks).
   It returns T if a message was handled and resulted in a change, NIL otherwise.

ELMTUI.CORE.FOCUS:HANDLE-KEY-EVENT-FOR-COMPONENT

Kinds: function

Handle a key event for a specific component.
   Returns T if the event was handled, NIL otherwise.

ELMTUI.CORE.FOCUS:HANDLE-NAVIGATION-KEYS

Kinds: function

Handle standard navigation keys like arrows, etc.
   UI-TREE is passed down for directional navigation.

ELMTUI.CORE.FOCUS:HANDLE-TAB-NAVIGATION

Kinds: function

Handles Tab and Shift+Tab navigation events.

ELMTUI.CORE.FOCUS:LIST-ACTIVE-KEYBINDINGS

Kinds: function

List all active keybindings for a component or globally.
   Returns a list of plists with :key, :description, :type and :source fields.

ELMTUI.CORE.FOCUS:MAKE-FOCUS-MANAGER

Kinds: function

Create a new focus manager.
   INITIAL-FOCUS: The ID of the element to focus initially.
   INITIAL-CONTEXT-IDS: A list of context IDs to register initially.
   INITIAL-ACTIVE-CONTEXT: The ID of the context to make active initially.

ELMTUI.CORE.FOCUS:NAVIGATE-DOWN

Kinds: function

Navigate focus downward.

ELMTUI.CORE.FOCUS:NAVIGATE-LEFT

Kinds: function

Navigate focus to the left.

ELMTUI.CORE.FOCUS:NAVIGATE-RIGHT

Kinds: function

Navigate focus to the right.

ELMTUI.CORE.FOCUS:NAVIGATE-UP

Kinds: function

Navigate focus upward.

ELMTUI.CORE.FOCUS:RECALCULATE-FOCUSABLE-ELEMENTS

Kinds: function

Recalculates the list of focusable elements based on the current UI tree.
   Returns the updated list. If preserve-focus is T, tries to maintain current focus.
   If the current focus is no longer valid, either clears focus or sets to the first element.

ELMTUI.CORE.FOCUS:REGISTER-FOCUS-CONTEXT

Kinds: function

Register a new focus context with the focus manager.

ELMTUI.CORE.FOCUS:REQUEST-FOCUS

Kinds: function

Requests focus for a specific element.
   When used with app-state, sets focus immediately.

ELMTUI.CORE.FOCUS:SET-FOCUS

Kinds: function

Set focus to ELEMENT-ID. Notifies the focused component and keymap system.
   Also updates the last-focus for the active context.

ELMTUI.CORE.FOCUS:TAB-NAVIGATE

Kinds: function

Navigate through focusable elements using Tab key.
   DIRECTION can be :forward or :backward.

ELMTUI.CORE.GLOBALS:APP-MESSAGE-PROCESSOR

Kinds: variable

Holds the function (message app-state) to process application messages.

ELMTUI.CORE.GLOBALS:APP-SENDER

Kinds: variable

Holds the function (e.g., #'elmtui.core.loop:publish) to send messages into the TEA loop.

ELMTUI.CORE.GLOBALS:APP-STATE

Kinds: variable

The current application state (ut.state:application-state instance).

ELMTUI.CORE.GLOBALS:APPLICATIONS

Kinds: variable

Hash table of registered applications, keyed by their names.

ELMTUI.CORE.GLOBALS:CONFIG

Kinds: variable

Global configuration settings.

ELMTUI.CORE.GLOBALS:CURRENT-BACKEND

Kinds: variable

The active platform backend instance.

ELMTUI.CORE.GLOBALS:CURRENT-PROGRAM

Kinds: variable

The top-level program or application object.

ELMTUI.CORE.GLOBALS:DEBUG-LAYOUT-OUTLINES

Kinds: variable

If T, enables layout outlines for debugging purposes.
   This is typically used to visualize widget boundaries and layout structures.

ELMTUI.CORE.GLOBALS:DEBUG-MODE

Kinds: variable

Enable extensive debugging output if T.

ELMTUI.CORE.GLOBALS:EVENT-LOOP

Kinds: variable

The main event loop instance (legacy).

ELMTUI.CORE.GLOBALS:FOCUS-MANAGER

Kinds: variable

The active focus manager instance.

ELMTUI.CORE.GLOBALS:KEYMAP-REGISTRY

Kinds: variable

The global keymap registry.

ELMTUI.CORE.GLOBALS:MAIN-EVENT-CHANNEL

Kinds: variable

The main channel for TEA-style event/message processing.

ELMTUI.CORE.GLOBALS:MESSAGE-SCHEMAS

Kinds: variable

Global registry for message types and their variants defined by defmsg.

ELMTUI.CORE.GLOBALS:STYLESHEETS

Kinds: variable

No documentation metadata.

ELMTUI.CORE.GLOBALS:SUBSCRIBERS

Kinds: variable

Hash table for legacy event subscribers.

ELMTUI.CORE.GLOBALS:THEME

Kinds: variable

Global theme settings.

ELMTUI.CORE.LOGGING:SETUP-UI-LOGGERS

Kinds: function

Create one logger per SUBSYSTEM and attach a dedicated FILE-APPENDER to each.

Arguments
---------
DIRECTORY   ― pathname designator for the log directory
SUBSYSTEMS  ― list of symbols naming logical UI areas
LEVEL       ― minimum sever­ity accepted by every subsystem logger
LAYOUT      ― `:simple` or `:pattern` (cf. LOG4CL manual)

Return value
------------
An alist of (SUBSYSTEM . LOGGER) pairs for convenient programmatic use.

Calling this function repeatedly REPLACES all appenders of already-existing
loggers, so you can reconfigure at runtime (e.g. switch on DEBUG).

ELMTUI.CORE.LOGGING:SUBSYSTEM-LOGGER

Kinds: function

Return the logger object for SUBSYSTEM (a keyword or string).

If the logger does not exist yet, it is *created on demand* **without**
any appenders.  Call `SETUP-UI-LOGGERS` first if you want automatic
file appenders.

ELMTUI.CORE.LOGGING:WITH-SUBSYSTEM-LOGGER

Kinds: macro

Execute BODY with *logger* rebound to the SUBSYSTEM logger.

Example
-------
```lisp
(with-subsystem-logger :rendering
  (log:debug "Drawing the main canvas"))
```

ELMTUI.CORE.LOOP:CONSUMER-THREAD

Kinds: variable

Thread for consuming events from *active-event-channels*
- consumer is the dequeuing events/messages and running the update function
as well as the view function for the application.

ELMTUI.CORE.LOOP:AS-PLIST

Kinds: function

Convert a style object to a property list.

ELMTUI.CORE.LOOP:ELM-STOP-LOOP

Kinds: function

Close the mailbox to wake blocked readers, then reap the consumer if external.
Safe after an earlier shutdown request and safe from the consumer itself.

ELMTUI.CORE.LOOP:GET-EVENT-LOOP-STATUS

Kinds: function

Get the current status of the event loop.

ELMTUI.CORE.LOOP:GET-EVENT-QUEUE-LENGTH

Kinds: function

Get the sum of approximate queue lengths of all active event channels.

ELMTUI.CORE.LOOP:INSTRUMENT-EVENT-LOOP

Kinds: function

Instrumentation hook for debugging/profiling.

ELMTUI.CORE.LOOP:PUBLISH

Kinds: function

Publish EVENT to TARGET-CHANNEL-NAME (keyword or string).
Returns T on success, NIL on drop. Safe after shutdown.

ELMTUI.CORE.LOOP:START-LOOP

Kinds: function

Initialize the event-driven channel consumer once and return T.
Legacy :FPS and :WAIT are deprecated, ignored compatibility arguments.
They do not configure a frame ticker or alter startup behavior.
The loop sleeps on the channel and emits no idle frames.

ELMTUI.CORE.LOOP:SUBSCRIBE

Kinds: function

Subscribe a HANDLER to a specific EVENT-TYPE.
   EVENT-TYPE should be a keyword matching a channel name.

ELMTUI.CORE.SYSTEM-EVENTS:MAKE-APPSHUTDOWN-SYSTEMEVENT

Kinds: function

No documentation metadata.

ELMTUI.CORE.SYSTEM-EVENTS:MAKE-CURSORPOSITION-SYSTEMEVENT

Kinds: function

No documentation metadata.

ELMTUI.CORE.SYSTEM-EVENTS:MAKE-TERMINALRESIZED-SYSTEMEVENT

Kinds: function

No documentation metadata.

ELMTUI.CORE.THREADS:COND-MESSAGE

Kinds: function

Get the message from a condition object.

ELMTUI.CORE.THREADS:WITH-INTERRUPTABLE-SIGNAL

Kinds: macro

Spawn a background thread running BODY.  RETURN-VAR is a user-supplied symbol,
initialized to NIL; you can (SETF RETURN-VAR …) anywhere in BODY to record progress
or final result.  Defines a global function SIGNAL-FN which, when called, will:

 1. interrupt the thread,
 2. throw a tag 'interrupt carrying the current RETURN-VAR,
 3. return that RETURN-VAR to the caller of SIGNAL-FN.

The macro expands to evaluating to the thread object itself.

ELMTUI.CORE.TOPIC-REGISTRY:CLEAR-REGISTRY

Kinds: function

Clear global topic and channel subscriptions, reset the subscription identifier counter, and return true.

ELMTUI.CORE.TOPIC-REGISTRY:DISPATCH-TOPIC

Kinds: function

Call all handlers matching TOPIC with MESSAGE; when APP-STATE is non-NIL, pass it as a second argument. Return collected handler results.

ELMTUI.CORE.TOPIC-REGISTRY:FIND-HANDLERS-FOR-TOPIC

Kinds: function

Return matching topic handler functions in their priority-sorted dispatch order.

ELMTUI.CORE.TOPIC-REGISTRY:FIND-SUBSCRIPTIONS-FOR-TOPIC

Kinds: function

Return matching subscription tokens for TOPIC-NAME, stably ordered with :HIGH first, then :NORMAL and :LOW.

ELMTUI.CORE.TOPIC-REGISTRY:GET-ALL-SUBSCRIPTIONS

Kinds: function

Return an alist mapping each subscribed topic pattern to its registered handler functions.

ELMTUI.CORE.TOPIC-REGISTRY:GET-CHANNEL-SUBSCRIPTIONS

Kinds: function

Return an alist of topic patterns and channel subscription objects for CHANNEL-ID.

ELMTUI.CORE.TOPIC-REGISTRY:GET-TOPICS-WITH-SUBSCRIBERS

Kinds: function

Return distinct topic patterns subscribed through either topic or channel registries, sorted by printed representation.

ELMTUI.CORE.TOPIC-REGISTRY:LIST-SUBSCRIPTIONS

Kinds: function

Return topic subscription tokens for PATTERN, or tokens for all patterns if PATTERN is NIL. Does not include channel subscriptions.

ELMTUI.CORE.TOPIC-REGISTRY:PUBLISH

Kinds: function

Publish MESSAGE to handlers matching TOPIC-NAME, collecting each handler's return value; alias of PUBLISH-TO-TOPIC.

ELMTUI.CORE.TOPIC-REGISTRY:PUBLISH-TO-CHANNEL

Kinds: function

Call active handlers for TOPIC matching CHANNEL-ID and collect their return values; channel identifiers compare with EQL.

ELMTUI.CORE.TOPIC-REGISTRY:PUBLISH-TO-TOPIC

Kinds: function

Call all topic handlers matching TOPIC-NAME in priority order, collecting and returning each result.

ELMTUI.CORE.TOPIC-REGISTRY:SUBSCRIBE

Kinds: function

Subscribe HANDLER to PATTERN and return an unsubscribe token.

ELMTUI.CORE.TOPIC-REGISTRY:SUBSCRIBE-IF

Kinds: function

Subscribe HANDLER to PATTERN, guarded by PREDICATE-FN.

ELMTUI.CORE.TOPIC-REGISTRY:SUBSCRIBE-TO-TOPIC-ON-CHANNEL

Kinds: function

Register HANDLER-FN for TOPIC and CHANNEL-ID; return a channel subscription object for later removal.

ELMTUI.CORE.TOPIC-REGISTRY:SUBSCRIPTION-COUNT

Kinds: function

Return the total number of registrations across the topic subscription and channel subscription tables.

ELMTUI.CORE.TOPIC-REGISTRY:SUBSCRIPTION-INFO

Kinds: function

Return plists with :ID, :PATTERN, and :PRIORITY for topic subscriptions, optionally filtered by PATTERN.

ELMTUI.CORE.TOPIC-REGISTRY:UNSUBSCRIBE

Kinds: function

Remove a topic subscription using the token returned by SUBSCRIBE and return true, including when already absent.

ELMTUI.CORE.TOPIC-REGISTRY:UNSUBSCRIBE-FROM-CHANNEL

Kinds: function

Remove the supplied channel subscription object from its topic and channel pair; return true.

ELMTUI.CORE.TOPICS:FIND-TOPIC

Kinds: function

Look up NAME in the process-wide topic registry and return the registered topic or NIL.

ELMTUI.CORE.TOPICS:FIND-TOPICS-BY-PATTERN

Kinds: function

Return registered topic objects whose segment paths match PATTERN, including wildcard segments.

ELMTUI.CORE.TOPICS:LIST-TOPICS

Kinds: function

Return the currently registered topic objects in hash-table traversal order; no ordering is guaranteed.

ELMTUI.CORE.TOPICS:MAKE-TOPIC

Kinds: function

Construct a topic with NAME, optional PARENT and DESCRIPTION. Also adds the new topic to its parent's children, but does not register it.

ELMTUI.CORE.TOPICS:MAKE-TOPIC-SUBSCRIPTION

Kinds: function

Construct a subscription holding PATTERN, HANDLER, and optional priority of :HIGH, :NORMAL, or :LOW.

ELMTUI.CORE.TOPICS:REGISTER-TOPIC

Kinds: function

Register TOPIC globally by its topic name, replacing any prior entry under that name, and return TOPIC.

ELMTUI.CORE.TOPICS:TOPIC

Kinds: type

Topic structure containing a symbol or string name, optional parent, child list, and optional description.

ELMTUI.CORE.TOPICS:TOPIC-ANCESTORS

Kinds: function

Return TOPIC's parents from nearest to farthest; return NIL for a root topic.

ELMTUI.CORE.TOPICS:TOPIC-CHILDREN

Kinds: function

Return the list of immediate child topics; making a topic with a parent adds to this list.

ELMTUI.CORE.TOPICS:TOPIC-DESCENDANTS

Kinds: function

Return all child topic objects recursively. Immediate children appear before recursively visited descendants.

ELMTUI.CORE.TOPICS:TOPIC-DESCRIPTION

Kinds: function

Return TOPIC's optional descriptive string, or NIL if no description was supplied.

ELMTUI.CORE.TOPICS:TOPIC-MATCH-P

Kinds: function

Return true if TOPIC1 is TOPIC2 or a descendant of TOPIC2, using object identity for ancestry.

ELMTUI.CORE.TOPICS:TOPIC-NAME

Kinds: function

Return the topic's original symbol or string name.

ELMTUI.CORE.TOPICS:TOPIC-PARENT

Kinds: function

Return TOPIC's parent topic object or NIL for a root.

ELMTUI.CORE.TOPICS:TOPIC-PATH

Kinds: function

Return topic name segments from the root through TOPIC. A root string containing slashes is split into path segments.

ELMTUI.CORE.TOPICS:TOPIC-PATTERN-MATCH-P

Kinds: function

Match PATTERN against TOPIC by case-insensitive path segments; * matches one segment and # matches the remaining suffix, including an empty suffix.

ELMTUI.CORE.TOPICS:TOPIC-SUBSCRIPTION

Kinds: type

Subscription structure containing a pattern, a handler function, and a :HIGH, :NORMAL, or :LOW priority.

ELMTUI.CORE.TOPICS:TOPIC-SUBSCRIPTION-HANDLER

Kinds: function

Return the handler function stored in a topic subscription.

ELMTUI.CORE.TOPICS:TOPIC-SUBSCRIPTION-PATTERN

Kinds: function

Return the string or symbol pattern matched by a topic subscription.

ELMTUI.CORE.TOPICS:TOPIC-SUBSCRIPTION-PRIORITY

Kinds: function

Return a subscription's dispatch priority, one of :HIGH, :NORMAL, or :LOW.

ELMTUI.DOCS:BUILD-API-DOCS

Kinds: function

Write live-symbol Markdown and HTML references with public export paths.

Returns two values: API Markdown and HTML paths. The documents explicitly
report missing metadata, and document text is fenced/escaped as literal text.

ELMTUI.DOCS:DOCSTRING-AUDIT

Kinds: function

Return current public API documentation coverage.

Arguments:
  None.

Returns:
  Three values: total public bindings, bindings without documentation metadata,
  and a fresh alist mapping home package names to missing counts.

Mutation:
  None outside temporary result allocation.

Conditions:
  Propagates conditions from PUBLIC-API-BINDINGS.

Example:
  (multiple-value-bind (total missing packages) (docstring-audit)
    (format t "~D of ~D missing: ~S~%" missing total packages))

ELMTUI.DOCS:PUBLIC-API-BINDINGS

Kinds: function

Return canonical, exported, de-duplicated metadata for the live public API.

The :PACKAGE is always an actual exporting package, so PACKAGE:SYMBOL resolves
with the normal single-colon syntax. :HOME-PACKAGE records the defining
symbol's home when it differs. Re-exports are de-duplicated by identity.

ELMTUI.KEYMAPS:ACTIVE-CONTEXTS

Kinds: variable

Special variable holding the active contexts configuration or registry used by the keyboard dispatch subsystem.

ELMTUI.KEYMAPS:CONTEXTS

Kinds: variable

Special variable holding the contexts configuration or registry used by the keyboard dispatch subsystem.

ELMTUI.KEYMAPS:DIALOG-KEYMAP

Kinds: variable

Special variable holding the dialog keymap configuration or registry used by the keyboard dispatch subsystem.

ELMTUI.KEYMAPS:DISPATCH-FN

Kinds: variable

Dynamically bound function for dispatching messages from keybindings.

ELMTUI.KEYMAPS:EDITOR-KEYMAP

Kinds: variable

Special variable holding the editor keymap configuration or registry used by the keyboard dispatch subsystem.

ELMTUI.KEYMAPS:FORM-KEYMAP

Kinds: variable

Special variable holding the form keymap configuration or registry used by the keyboard dispatch subsystem.

ELMTUI.KEYMAPS:GLOBAL-KEYMAP-CONTEXT

Kinds: variable

The root keymap context.

ELMTUI.KEYMAPS:GLOBAL-NAVIGATION-KEYMAP

Kinds: variable

Special variable holding the global navigation keymap configuration or registry used by the keyboard dispatch subsystem.

ELMTUI.KEYMAPS:LIST-NAVIGATION-KEYMAP

Kinds: variable

Special variable holding the list navigation keymap configuration or registry used by the keyboard dispatch subsystem.

ELMTUI.KEYMAPS:REGISTRY

Kinds: variable

Special variable holding the registry configuration or registry used by the keyboard dispatch subsystem.

ELMTUI.KEYMAPS:ACTIVATE-CONTEXT

Kinds: function

Activate a named keymap context so its bindings participate in key dispatch.

ELMTUI.KEYMAPS:ADD-KEYBINDING

Kinds: function

Register a key specification and its target action or message in a keymap.

ELMTUI.KEYMAPS:ADD-KEYMAP-TO-CONTEXT

Kinds: function

Associate a keymap with a context for scoped keyboard lookup.

ELMTUI.KEYMAPS:CURRENT-CONTEXT

Kinds: function

Return the currently selected keyboard context, if one is active.

ELMTUI.KEYMAPS:DEACTIVATE-CONTEXT

Kinds: function

Deactivate a named keymap context, removing its bindings from active dispatch.

ELMTUI.KEYMAPS:DEFINE-KEYMAP

Kinds: macro

Define a keymap VAR with BINDINGS.

Binds a keymap object to the symbol VAR and DOES NOT register it in *registry*. The
keymap object is returned as the value of the macro.
WARNING: VAR is not quoted, it is a symbol to be defined.

*registry*: A global hash table mapping keymap names (symbols) to keymap objects.
This allows keymaps to be referenced by name in contexts.

BINDINGS is a list of (KEY-STRING . PLIST) pairs, where KEY-STRING is a
string like "C-x" or "Shift-F1", and PLIST contains:
  :type        - either :action or :message
  :target      - function symbol (for :action) or message payload (for :message
                 e.g., '(:quit
  :description - human-readable description for help overlays
Example:
  (define-keymap *my-keymap*
    ("C-x" :type :action  :target 'my-action      :description "Do something")
    ("F1"  :type :message :target '(:show-help)   :description "Show help")
    ("C-q" :type :message :target '(:quit)        :description "Quit application")
    ("C-c C-c" :type :message :target '(:copy)    :description "Copy selection")
    ("C-v" :type :message :target '(:paste)       :description "Paste from clipboard")
    ("Shift-Tab" :type :message :target '(:focus-prev) :description "Focus previous element")
    ("Tab" :type :message :target '(:focus-next)  :description "Focus next element")
    ("Up"  :type :message :target '(:move-up)     :description "Move up")
    ("Down":type :message :target '(:move-down)   :description "Move down")
    ("Enter":type :message :target '(:activate)   :description "Activate/Select"))
 Returns the created keymap object.

ELMTUI.KEYMAPS:DEFINE-KEYMAP-CONTEXT

Kinds: function

Creates and registers a keymap context.
- NAME: The keyword name for the context (e.g., :my-context).
- PARENT: The keyword name of the parent context (e.g., :global).
- KEYMAPS: A list of keymap names (e.g., '(:dialog :form)).
Returns the created context object.

  Example:
  (define-keymap-context :my-context
    :parent :global
    :keymaps '(:dialog :form))
If PARENT is not provided, the context will be a root context.
If KEYMAPS is not provided, the context will have no keymaps.
If a keymap name is not found in the registry, an error is raised.

ELMTUI.KEYMAPS:FIND-CONTEXT

Kinds: function

Locate the registered keymap context with the supplied identifier.

ELMTUI.KEYMAPS:INITIALISE

Kinds: function

Call once on application start.

ELMTUI.KEYMAPS:KEY-EVENT->NORMALIZED-KEY

Kinds: function

Convert a terminal key event into the normalized key and modifiers used by bindings.

ELMTUI.KEYMAPS:KEYMAP!

Kinds: macro

Define a keymap VAR with BINDINGS.

creates and returns a keymap object, does NOT bind it to VAR or register it.

*registry*: A global hash table mapping keymap names (symbols) to keymap objects.
This allows keymaps to be referenced by name in contexts.

BINDINGS is a list of (KEY-STRING . PLIST) pairs, where KEY-STRING is a
string like "C-x" or "Shift-F1", and PLIST contains:
  :type        - either :action or :message
  :target      - function symbol (for :action) or message payload (for :message
                 e.g., '(:quit
  :description - human-readable description for help overlays
Example:
  (keymap! :my-km
    ("C-x" :type :action  :target 'my-action      :description "Do something")
    ("F1"  :type :message :target '(:show-help)   :description "Show help")
    ("C-q" :type :message :target '(:quit)        :description "Quit application")
    ("C-c C-c" :type :message :target '(:copy)    :description "Copy selection")
    ("C-v" :type :message :target '(:paste)       :description "Paste from clipboard")
    ("Shift-Tab" :type :message :target '(:focus-prev) :description "Focus previous element")
    ("Tab" :type :message :target '(:focus-next)  :description "Focus next element")
    ("Up"  :type :message :target '(:move-up)     :description "Move up")
    ("Down":type :message :target '(:move-down)   :description "Move down")
    ("Enter":type :message :target '(:activate)   :description "Activate/Select"))
 Returns the created keymap object.

ELMTUI.KEYMAPS:KEYMAP-BINDINGS

Kinds: function

Return the bindings currently registered on the keymap.

ELMTUI.KEYMAPS:KEYMAP-CONTEXT

Kinds: type

Public keymap context type used to represent structured asynchronous tasks, styles or UI elements.

ELMTUI.KEYMAPS:KEYMAP-CONTEXT-KEYMAPS

Kinds: function

Return keymaps associated with this keymap context.

ELMTUI.KEYMAPS:KEYMAP-CONTEXT-NAME

Kinds: function

Return this keymap context's name.

ELMTUI.KEYMAPS:KEYMAP-CONTEXT-PARENT

Kinds: function

Return its parent context used in contextual key dispatch.

ELMTUI.KEYMAPS:LIST-ACTIVE-KEYBINDINGS

Kinds: function

Return list of plists {:key … :description … :source-keymap …}

ELMTUI.KEYMAPS:LOOKUP

Kinds: function

Return binding for KEY (NORMALIZED-KEY or KEY-SEQUENCE).

ELMTUI.KEYMAPS:LOOKUP-BINDING

Kinds: function

Resolve a normalized key against the active keymap contexts in precedence order.

ELMTUI.KEYMAPS:LOOKUP-BINDING-IN

Kinds: function

Lookup a binding starting at CONTEXT. If INCLUDE-PARENTS is true,
walk up parent contexts; otherwise only search CONTEXT's keymaps.

ELMTUI.KEYMAPS:MAKE-KEYMAP-CONTEXT

Kinds: function

Construct a keymap context with name, parent and contained keymaps.

ELMTUI.KEYMAPS:NORMALIZED-KEY->STRING

Kinds: function

Format a normalized key as a stable human-readable key specification.

ELMTUI.KEYMAPS:NORMALIZED-KEY-KEY

Kinds: function

Return the base key of a normalized keyboard input.

ELMTUI.KEYMAPS:NORMALIZED-KEY-MODIFIERS

Kinds: function

Return modifiers carried by a normalized keyboard input.

ELMTUI.KEYMAPS:PARSE-KEY-STRING

Kinds: function

Parse a textual key combination into its normalized key representation.

ELMTUI.KEYMAPS:PROCESS-KEY-EVENT

Kinds: function

Main dispatcher – converts EVT to NORMALIZED-KEY, runs registry lookup.
   Binds *dispatch-fn* to DISPATCH-FN for the duration of the call.

ELMTUI.KEYMAPS:REMOVE-KEYBINDING

Kinds: function

Remove a previously registered key binding from its keymap.

ELMTUI.KEYMAPS:RESOLVE-KEYMAP-REFERENCE

Kinds: function

Resolve an identifier or existing keymap reference to its registered keymap.

ELMTUI.PIPELINE:PRESERVE-UNDERLAY

Kinds: variable

When true, render-to-buffer starts from current front-buffer content and avoids clearing it.

ELMTUI.PIPELINE:UNDERLAY-BUFFER

Kinds: variable

Immutable full-pane capture of the cells under a normal-screen application.

When bound together with *PRESERVE-UNDERLAY*, every frame is composited onto
the region of this buffer under the root viewport instead of onto the previous
frame. Cells the current frame does not paint therefore revert to their
captured underlay, so overlays that move (for example a cursor focus box) never
leave stale paint behind. The driver binds it only while the capture geometry
matches the live pane.

ELMTUI.PIPELINE:UNDERLAY-PROTECTED-ROWS

Kinds: variable

Number of top pane rows holding scrollback that tmux pulled back into view.

Those rows are history, not application canvas: the compositor reverts any
frame paint there to the underlay, so they are never changed, not even
transiently. Bound by the driver per frame together with *UNDERLAY-BUFFER*.

ELMTUI.PIPELINE:DISPLAY-BUFFER

Kinds: function

No documentation metadata.

ELMTUI.PIPELINE:FULL-VIEW-PIPELINE

Kinds: function

No documentation metadata.

ELMTUI.PIPELINE:GENERATE-DSL

Kinds: function

No documentation metadata.

ELMTUI.PIPELINE:PRE-RENDER-TERMINAL-PREP

Kinds: function

No documentation metadata.

ELMTUI.PIPELINE:PROCESS-TREE-STAGE

Kinds: function

No documentation metadata.

ELMTUI.PIPELINE:RENDER-PIPELINE-0-TO-5

Kinds: function

No documentation metadata.

ELMTUI.PIPELINE:RENDER-TO-BUFFER

Kinds: function

No documentation metadata.

ELMTUI.PIPELINE:UNDERLAY-PROTECTED-ROWS

Kinds: function

Pane rows above which a normal-screen view must not paint (see
*UNDERLAY-PROTECTED-ROWS*). Snapshot row Y is shown at physical row Y plus this.

ELMTUI.PLATFORM.API:ACQUIRE-LOCK

Kinds: function

Acquire the synchronization lock associated with a lockable backend object.

ELMTUI.PLATFORM.API:APPLY-STYLE

Kinds: function

Apply a style specification through the selected terminal backend.

ELMTUI.PLATFORM.API:BACKEND-INPUT-DEVICE

Kinds: function

Return the underlying cl-inputs device used for reading input, or NIL if the backend does not expose one.

ELMTUI.PLATFORM.API:BACKEND-INPUT-SOURCE

Kinds: function

Return the cl-inputs input source that the backend created, if any.

ELMTUI.PLATFORM.API:BACKEND-NAME

Kinds: function

Return the implementation name of the active terminal backend.

ELMTUI.PLATFORM.API:BACKEND-VERSION

Kinds: function

Return the backend implementation version when available.

ELMTUI.PLATFORM.API:CLEAR-AREA

Kinds: function

Clear a rectangular screen region using backend-specific operations.

ELMTUI.PLATFORM.API:CLEAR-BELOW-CURSOR

Kinds: function

Clear all content from the cursor position to the end of the screen.

ELMTUI.PLATFORM.API:CLEAR-SCREEN

Kinds: function

Initialize the backend for the specified platform. If PUBLISH-FN is provided, it will be used to publish events.

ELMTUI.PLATFORM.API:DEFAULT-BACKGROUND-COLOR

Kinds: function

Return the backend default background color specification.

ELMTUI.PLATFORM.API:DEFAULT-FOREGROUND-COLOR

Kinds: function

Return the backend default foreground color specification.

ELMTUI.PLATFORM.API:DISABLE-MOUSE-SUPPORT

Kinds: function

Disable reporting of mouse events by the selected backend.

ELMTUI.PLATFORM.API:DRAW-BOX-OUTLINE

Kinds: function

Draw the outline of a rectangle using terminal drawing primitives.

ELMTUI.PLATFORM.API:DRAW-CHAR-AT

Kinds: function

Draw a single character at the requested terminal cell coordinate.

ELMTUI.PLATFORM.API:DRAW-STYLED-BOX

Kinds: function

Draw a rectangular box with the requested backend style.

ELMTUI.PLATFORM.API:DRAW-TEXT-AT

Kinds: function

Draw text at the requested terminal cell coordinates.

ELMTUI.PLATFORM.API:ENABLE-MOUSE-SUPPORT

Kinds: function

Enable mouse event reporting when the backend supports it.

ELMTUI.PLATFORM.API:FILL-RECTANGLE

Kinds: function

Fill a rectangular terminal region with the requested cell content.

ELMTUI.PLATFORM.API:FLUSH-OUTPUT

Kinds: function

Flush pending backend terminal writes to its output destination.

ELMTUI.PLATFORM.API:GET-CURSOR-POSITION

Kinds: function

Query the current terminal cursor row and column, if supported.

ELMTUI.PLATFORM.API:GET-NATIVE-HANDLE

Kinds: function

Return the backend's underlying platform handle.

ELMTUI.PLATFORM.API:GET-SCREEN-DIMENSIONS

Kinds: function

Query the terminal screen width and height in cells.

ELMTUI.PLATFORM.API:HANDLE-BACKEND-RESIZE

Kinds: function

Update backend state when terminal geometry changes.

ELMTUI.PLATFORM.API:HIDE-CURSOR

Kinds: function

Request that the terminal cursor become invisible.

ELMTUI.PLATFORM.API:INITIALIZE-BACKEND

Kinds: function

Initialize the backend for the specified platform. If PUBLISH-FN is provided, it will be used to publish events.

ELMTUI.PLATFORM.API:LOCK-OF

Kinds: function

Return the lock used to guard this lockable backend object.

ELMTUI.PLATFORM.API:LOCKABLE

Kinds: type

Protocol type for objects providing a synchronization lock.

ELMTUI.PLATFORM.API:MAKE-COLOR

Kinds: function

Construct a terminal color specification for the backend styling API.

ELMTUI.PLATFORM.API:MAKE-STYLE

Kinds: function

Construct a terminal style from the supplied attributes.

ELMTUI.PLATFORM.API:MAX-COLORS

Kinds: function

Return the maximum supported palette size for this backend.

ELMTUI.PLATFORM.API:PEEK-INPUT-EVENT

Kinds: function

Inspect the next backend input event without consuming it.

ELMTUI.PLATFORM.API:POLL-INPUT-EVENT

Kinds: function

Poll the next input event from the selected backend.

ELMTUI.PLATFORM.API:QUERY-FEATURE

Kinds: function

Query an optional terminal capability by feature identifier.

ELMTUI.PLATFORM.API:RELEASE-LOCK

Kinds: function

Release a previously acquired synchronization lock.

ELMTUI.PLATFORM.API:SCROLL

Kinds: function

Advance the terminal viewport by N lines. Positive N moves the viewport down (content up), making space below; negative N moves it up (content down).

ELMTUI.PLATFORM.API:SCROLL-LINES

Kinds: function

Scroll the requested terminal lines via the backend interface.

ELMTUI.PLATFORM.API:SET-CELL-STYLE

Kinds: function

Set styling attributes on a terminal cell through the backend.

ELMTUI.PLATFORM.API:SET-CURSOR-POSITION

Kinds: function

Set the cursor position to (X, Y) on the terminal.

ELMTUI.PLATFORM.API:SET-CURSOR-VISIBILITY

Kinds: function

Set cursor visibility using the backend protocol.

ELMTUI.PLATFORM.API:SET-INPUT-MODE

Kinds: function

Configure the terminal input mode through the backend.

ELMTUI.PLATFORM.API:SHOW-CURSOR

Kinds: function

Request that the terminal cursor become visible.

ELMTUI.PLATFORM.API:SHUTDOWN-BACKEND

Kinds: function

Cleanly shut down backend resources and restore terminal state.

ELMTUI.PLATFORM.API:SUPPORTS-MOUSE-P

Kinds: function

Report whether this backend can emit mouse input events.

ELMTUI.PLATFORM.API:SUPPORTS-TRUECOLOR-P

Kinds: function

Report whether this backend supports 24-bit color output.

ELMTUI.PLATFORM.API:SUPPORTS-UNICODE-P

Kinds: function

Report whether the backend supports Unicode cell rendering.

ELMTUI.PLATFORM.API:TERM-H

Kinds: function

Return the backend terminal height in cell rows.

ELMTUI.PLATFORM.API:TERM-STREAM

Kinds: function

Return the backend terminal output stream.

ELMTUI.PLATFORM.API:TERM-STYLE

Kinds: function

Return the backend terminal style settings.

ELMTUI.PLATFORM.API:TERM-W

Kinds: function

Return the backend terminal width in cell columns.

ELMTUI.PLATFORM.API:WITH-LOCK

Kinds: macro

Execute BODY with the lock of LOCKABLE L acquired.
This macro ensures that the lock is acquired before executing BODY,
and released afterwards, even if an error occurs during execution.
It uses `acquire-lock` and `release-lock` methods to manage the lock.
This is useful for ensuring thread safety when accessing shared resources.

ELMTUI.PLATFORM.BACKEND.COMMON.ANSI-STYLING:ANSI-SEQS

Kinds: function

Return ANSI SGR control strings for requested ATTRS of a TERMINAL-STYLE in argument order. NIL styles return NIL; list styles are interpreted as explicit key/value entries.

ELMTUI.PLATFORM.BACKEND.COMMON.ANSI-STYLING:AS-PLIST

Kinds: function

Convert STYLE to plist representation for terminal rendering.

ELMTUI.PLATFORM.BACKEND.COMMON.ANSI-STYLING:COPY-TERM-COLOR

Kinds: function

Creates a deep copy of a terminal-color instance.

ELMTUI.PLATFORM.BACKEND.COMMON.ANSI-STYLING:COPY-TERM-STYLE

Kinds: function

Creates a deep copy of a terminal-style instance.
   Returns NIL if style is NIL, otherwise always returns a terminal-style.

ELMTUI.PLATFORM.BACKEND.COMMON.ANSI-STYLING:DEEP-COPY-STYLE

Kinds: function

Creates a deep copy of a style plist, including any nested lists like RGB values.

ELMTUI.PLATFORM.BACKEND.COMMON.ANSI-STYLING:EXEC-SEQUENCE

Kinds: function

Write every character of string SEQ as a byte to FD while holding LOCKABLE, then flush FD. Extra ARGS are ignored; stream write errors propagate.

ELMTUI.PLATFORM.BACKEND.COMMON.ANSI-STYLING:FUZZ-COLOR

Kinds: function

Convert various color representations to a terminal-color.
   Supported input formats:
   - terminal-color: returned as-is
   - (:rgb r g b): 24-bit RGB color
   - (:256 n): 256-color palette (n is 0-255)
   - (r g b): raw RGB list
   - (n): raw 256-color palette value
   - integer: 256-color palette value
   - keyword: simple color (:red, :blue, etc.)
   - string: hex color (#FF0000)

ELMTUI.PLATFORM.BACKEND.COMMON.ANSI-STYLING:IS-TERM-STYLE

Kinds: function

Checks if the given style S is a terminal style.

ELMTUI.PLATFORM.BACKEND.COMMON.ANSI-STYLING:MAKE-TERMCOLOR

Kinds: function

Construct a TERMINAL-COLOR using shorthand R, G, B, SIMPLE, BG, and COLOR-256 keyword arguments; return the new color descriptor.

ELMTUI.PLATFORM.BACKEND.COMMON.ANSI-STYLING:MAKE-TERMINAL-COLOR

Kinds: function

Construct a TERMINAL-COLOR with RED, GREEN, BLUE, SIMPLE, BG, and COLOR-256 keyword slots. Unspecified channels remain NIL; no color conversion occurs.

ELMTUI.PLATFORM.BACKEND.COMMON.ANSI-STYLING:MAKE-TERMINAL-STYLE

Kinds: function

Construct a TERMINAL-STYLE with FG-COLOR and BG-COLOR descriptors and independent attribute flags. Every omitted slot starts as NIL.

ELMTUI.PLATFORM.BACKEND.COMMON.ANSI-STYLING:NO-COLOR-P

Kinds: function

Return true if TERMINAL-COLOR has no RGB component, simple keyword, or 256-color index. The BG flag does not count as a color.

ELMTUI.PLATFORM.BACKEND.COMMON.ANSI-STYLING:STYLE-TO-TERMINAL-STYLE

Kinds: function

Converts a style plist to a terminal-style instance, ensuring a valid
   terminal-style object is always returned.
   Args:
   - STYLE-PLIST: A property list containing style attributes.
   Returns:
   - A terminal-style instance with the specified attributes.

ELMTUI.PLATFORM.BACKEND.COMMON.ANSI-STYLING:TERMINAL-COLOR

Kinds: type

A terminal color descriptor holding optional RGB components, a simple color keyword, a 256-color index, and a background-selection flag.

ELMTUI.PLATFORM.BACKEND.COMMON.ANSI-STYLING:TERMINAL-COLOR-BG

Kinds: function

Return the BG flag stored in TERMINAL-COLOR; this flag selects background SGR encoding when no overriding BG argument is supplied.

ELMTUI.PLATFORM.BACKEND.COMMON.ANSI-STYLING:TERMINAL-COLOR-SIMPLE

Kinds: function

Return the SIMPLE color keyword stored in TERMINAL-COLOR, or NIL when its color representation is RGB, indexed, or unspecified.

ELMTUI.PLATFORM.BACKEND.COMMON.ANSI-STYLING:TERMINAL-STYLE

Kinds: type

A mutable terminal style descriptor with foreground and background colors plus bold, italic, underline, faint, blink, inverse, strike, and invisible attributes.

ELMTUI.PLATFORM.BACKEND.COMMON.ANSI-STYLING:TERMINAL-STYLE-BG-COLOR

Kinds: function

Read the BG-COLOR slot of TERMINAL-STYLE. It may contain a TERMINAL-COLOR or NIL and may be changed through the SETF accessor.

ELMTUI.PLATFORM.BACKEND.COMMON.ANSI-STYLING:TERMINAL-STYLE-BG-COLOR-VAL

Kinds: function

Extract STYLE background as an RGB integer list, 256-color palette index, or simple color keyword. Return NIL if the background is absent or unrecognized.

Kinds: function

Read or, with SETF, change the BLINK attribute slot of TERMINAL-STYLE. NIL represents an unset or disabled attribute.

ELMTUI.PLATFORM.BACKEND.COMMON.ANSI-STYLING:TERMINAL-STYLE-BOLD

Kinds: function

Read or, with SETF, change the BOLD attribute slot of TERMINAL-STYLE. NIL represents an unset or disabled attribute.

ELMTUI.PLATFORM.BACKEND.COMMON.ANSI-STYLING:TERMINAL-STYLE-FAINT

Kinds: function

Read or, with SETF, change the FAINT attribute slot of TERMINAL-STYLE. NIL represents an unset or disabled attribute.

ELMTUI.PLATFORM.BACKEND.COMMON.ANSI-STYLING:TERMINAL-STYLE-FG-COLOR

Kinds: function

Read the FG-COLOR slot of TERMINAL-STYLE. It may contain a TERMINAL-COLOR or NIL and may be changed through the SETF accessor.

ELMTUI.PLATFORM.BACKEND.COMMON.ANSI-STYLING:TERMINAL-STYLE-FG-COLOR-VAL

Kinds: function

Extract STYLE foreground as an RGB integer list, 256-color palette index, or simple color keyword. Return NIL if the foreground is absent or unrecognized.

ELMTUI.PLATFORM.BACKEND.COMMON.ANSI-STYLING:TERMINAL-STYLE-INVERSE

Kinds: function

Read or, with SETF, change the INVERSE attribute slot of TERMINAL-STYLE. NIL represents an unset or disabled attribute.

ELMTUI.PLATFORM.BACKEND.COMMON.ANSI-STYLING:TERMINAL-STYLE-INVISIBLE

Kinds: function

Read or, with SETF, change the INVISIBLE attribute slot of TERMINAL-STYLE. NIL represents an unset or disabled attribute.

ELMTUI.PLATFORM.BACKEND.COMMON.ANSI-STYLING:TERMINAL-STYLE-ITALIC

Kinds: function

Read or, with SETF, change the ITALIC attribute slot of TERMINAL-STYLE. NIL represents an unset or disabled attribute.

ELMTUI.PLATFORM.BACKEND.COMMON.ANSI-STYLING:TERMINAL-STYLE-KV

Kinds: function

Update one TERMINAL-STYLE slot selected by K using V. Accepted keys are FG, BG, BOLD, ITALIC, UNDERLINE, FAINT, BLINK, INVERSE, STRIKE, and INVISIBLE; unknown keys signal an error.

ELMTUI.PLATFORM.BACKEND.COMMON.ANSI-STYLING:TERMINAL-STYLE-STRIKE

Kinds: function

Read or, with SETF, change the STRIKE attribute slot of TERMINAL-STYLE. NIL represents an unset or disabled attribute.

ELMTUI.PLATFORM.BACKEND.COMMON.ANSI-STYLING:TERMINAL-STYLE-UNDERLINE

Kinds: function

Read or, with SETF, change the UNDERLINE attribute slot of TERMINAL-STYLE. NIL represents an unset or disabled attribute.

ELMTUI.PLATFORM.BACKEND.COMMON.ANSI-STYLING:UPDATE-STYLE!

Kinds: function

Merge UPDATE-STYLE into mutable STYLE and return changed attribute key/value pairs. A NIL STYLE creates a fresh style; raw plist STYLE inputs are ignored and return NIL.

ELMTUI.PLATFORM.BACKEND.COMMON.VIRTUAL-BUFFER:BUFFER-CELL

Kinds: type

Represents a single cell in the virtual terminal buffer.
that is: at this point already a character with a style.

ELMTUI.PLATFORM.BACKEND.COMMON.VIRTUAL-BUFFER:BUFFER-CELL-AT

Kinds: function

Retrieves a *copy* of the cell at (ROW, COL).
Signals INVALID-BUFFER-COORDINATES-ERROR if out of bounds.

ELMTUI.PLATFORM.BACKEND.COMMON.VIRTUAL-BUFFER:BUFFER-CELL-CHAR

Kinds: function

Read or set the single character stored in a virtual terminal cell.

ELMTUI.PLATFORM.BACKEND.COMMON.VIRTUAL-BUFFER:BUFFER-CELL-EQUAL-P

Kinds: function

Compares two BUFFER-CELL instances for equality (char and style).

ELMTUI.PLATFORM.BACKEND.COMMON.VIRTUAL-BUFFER:BUFFER-CELL-GRAPHEME

Kinds: function

No documentation metadata.

ELMTUI.PLATFORM.BACKEND.COMMON.VIRTUAL-BUFFER:BUFFER-CELL-STYLE

Kinds: function

Read or set the terminal style attached to a virtual terminal cell, or NIL.

ELMTUI.PLATFORM.BACKEND.COMMON.VIRTUAL-BUFFER:BUFFER-CELLS

Kinds: function

Returns the raw 2D array of BUFFER-CELL objects.
   Use with caution; prefer cell-level APIs for modification to ensure thread-safety.

ELMTUI.PLATFORM.BACKEND.COMMON.VIRTUAL-BUFFER:BUFFER-CHAR

Kinds: function

Read or set the character at ROW and COL of a virtual terminal buffer; getter delegates to bounded cell access.

ELMTUI.PLATFORM.BACKEND.COMMON.VIRTUAL-BUFFER:BUFFER-ERROR

Kinds: type

Base condition for virtual terminal buffer operations that fail.

ELMTUI.PLATFORM.BACKEND.COMMON.VIRTUAL-BUFFER:BUFFER-HEIGHT

Kinds: function

Returns the height of the BUFFER.

ELMTUI.PLATFORM.BACKEND.COMMON.VIRTUAL-BUFFER:BUFFER-LOCK

Kinds: function

Returns the recursive lock associated with the BUFFER.

ELMTUI.PLATFORM.BACKEND.COMMON.VIRTUAL-BUFFER:BUFFER-STYLE

Kinds: function

Read or set a buffer cell's terminal style by ROW and COL; setter accepts a terminal style, style plist, or NIL.

ELMTUI.PLATFORM.BACKEND.COMMON.VIRTUAL-BUFFER:BUFFER-WIDTH

Kinds: function

Returns the width of the BUFFER.

ELMTUI.PLATFORM.BACKEND.COMMON.VIRTUAL-BUFFER:CLEAR-BUFFER

Kinds: function

Clears the entire buffer by filling it with CHAR and STYLE.
   Returns the modified BUFFER.

ELMTUI.PLATFORM.BACKEND.COMMON.VIRTUAL-BUFFER:COPY-BUFFER-CONTENTS

Kinds: function

Copies the overlapping contents of SOURCE-BUFFER to TARGET-BUFFER.
  Assumes top-left alignment (0,0) for the copy in both buffers.
  Styles are deep-copied via `buffer-cell-at` and `set-buffer-cell-at`.
  Returns the modified TARGET-BUFFER.

ELMTUI.PLATFORM.BACKEND.COMMON.VIRTUAL-BUFFER:COPY-VIRTUAL-BUFFER

Kinds: function

Creates a deep copy of the BUFFER, including a new `cells` array and new `buffer-cell` objects.

ELMTUI.PLATFORM.BACKEND.COMMON.VIRTUAL-BUFFER:DEFAULT-BUFFER-CELL

Kinds: function

Returns a new buffer-cell with default character and specified style.
   If style is nil, no style is applied.

ELMTUI.PLATFORM.BACKEND.COMMON.VIRTUAL-BUFFER:FILL-BUFFER-REGION

Kinds: function

Fills a rectangular region starting at (ROW, COL) with dimensions WIDTH x HEIGHT
with the specified CHAR and STYLE. Handles clipping to buffer boundaries.
The STYLE argument is passed to `set-buffer-cell-at` for each cell, which
handles conversion (e.g. plist to terminal-style) and copying.
Returns the modified BUFFER.

ELMTUI.PLATFORM.BACKEND.COMMON.VIRTUAL-BUFFER:INVALID-BUFFER-COORDINATES-ERROR

Kinds: type

Condition representing out-of-range row or column operations on a virtual terminal buffer.

ELMTUI.PLATFORM.BACKEND.COMMON.VIRTUAL-BUFFER:INVALID-BUFFER-COORDINATES-ERROR-BUFFER

Kinds: function

Return the virtual terminal buffer associated with a coordinate error.

ELMTUI.PLATFORM.BACKEND.COMMON.VIRTUAL-BUFFER:INVALID-BUFFER-COORDINATES-ERROR-COL

Kinds: function

Return the invalid column recorded when a buffer coordinate operation failed.

ELMTUI.PLATFORM.BACKEND.COMMON.VIRTUAL-BUFFER:INVALID-BUFFER-COORDINATES-ERROR-ROW

Kinds: function

Return the invalid row recorded when a buffer coordinate operation failed.

ELMTUI.PLATFORM.BACKEND.COMMON.VIRTUAL-BUFFER:MAKE-BUFFER-CELL

Kinds: function

Construct a new virtual terminal cell with optional :CHAR and :STYLE; supplied style plists are converted or copied.

ELMTUI.PLATFORM.BACKEND.COMMON.VIRTUAL-BUFFER:MAKE-VIRTUAL-BUFFER

Kinds: function

Creates a new VIRTUAL-TERMINAL-BUFFER of specified WIDTH and HEIGHT.
   Initializes cells with initial-char and initial-style.
   The buffer's default-style is also set based on a processed version of initial-style.

ELMTUI.PLATFORM.BACKEND.COMMON.VIRTUAL-BUFFER:NEW-BUFFER

Kinds: function

Creates a new VIRTUAL-TERMINAL-BUFFER of specified WIDTH and HEIGHT.

ELMTUI.PLATFORM.BACKEND.COMMON.VIRTUAL-BUFFER:PRINT-BUFFER-TO-STRING

Kinds: function

Utility for debugging. Renders the buffer content to a string,
optionally including style information.

ELMTUI.PLATFORM.BACKEND.COMMON.VIRTUAL-BUFFER:RESIZE-BUFFER

Kinds: function

Creates a *new* VIRTUAL-TERMINAL-BUFFER of NEW-WIDTH and NEW-HEIGHT.
Copies content from the old BUFFER that fits into the new dimensions.
Fills any new areas (due to expansion) with DEFAULT-CHAR and DEFAULT-STYLE.
Returns the new buffer.

ELMTUI.PLATFORM.BACKEND.COMMON.VIRTUAL-BUFFER:SET-BUFFER-CELL-AT

Kinds: function

Modifies the cell at (ROW, COL) with CHAR and STYLE.
Signals INVALID-BUFFER-COORDINATES-ERROR if out of bounds.
Returns the modified BUFFER.

ELMTUI.PLATFORM.BACKEND.COMMON.VIRTUAL-BUFFER:USE-VALUE

Kinds: function

Transfer control and VALUE to a restart named USE-VALUE, or
return NIL if none exists.

ELMTUI.PLATFORM.BACKEND.COMMON.VIRTUAL-BUFFER:VIRTUAL-TERMINAL-BUFFER

Kinds: type

Represents a 2D grid of styled characters for the terminal screen.

ELMTUI.PLATFORM.BACKEND.COMMON.VIRTUAL-BUFFER:VIRTUAL-TERMINAL-BUFFER-CELLS

Kinds: function

Return the underlying two-dimensional BUFFER-CELL array; direct mutation bypasses the safe accessor and locking APIs.

ELMTUI.PLATFORM.BACKEND.COMMON.VIRTUAL-BUFFER:VIRTUAL-TERMINAL-BUFFER-HEIGHT

Kinds: function

Return the number of rows in a virtual terminal buffer, fixed when the buffer was created.

ELMTUI.PLATFORM.BACKEND.COMMON.VIRTUAL-BUFFER:VIRTUAL-TERMINAL-BUFFER-LOCK

Kinds: function

Return the recursive mutex guarding access to a virtual terminal buffer's cells.

ELMTUI.PLATFORM.BACKEND.COMMON.VIRTUAL-BUFFER:VIRTUAL-TERMINAL-BUFFER-WIDTH

Kinds: function

Return the number of columns in a virtual terminal buffer, fixed when the buffer was created.

ELMTUI.PLATFORM.BACKEND.COMMON.VIRTUAL-BUFFER:WITH-VIRTUAL-BUFFER-LOCK

Kinds: macro

Acquires the lock for BUFFER and executes BODY.

ELMTUI.PLATFORM.BACKEND.COMMON.VIRTUAL-BUFFER:WRITE-STRING-TO-BUFFER

Kinds: function

Writes STRING to the buffer starting at START-ROW, START-COL with STYLE.
  Optional MAX-WIDTH, MAX-HEIGHT for clipping/wrapping.
  If WRAP is true, text wraps within MAX-WIDTH.
  If STYLE is nil, the buffer's `default-style` is used if set, otherwise nil style.
  Returns the modified BUFFER.

ELMTUI.PLATFORM.BACKEND.TERMINAL:TERMINAL-DEBUG-FRAME-ID

Kinds: variable

Current frame ID, bound dynamically during pipeline display.

ELMTUI.PLATFORM.BACKEND.TERMINAL:TERMINAL-DEBUG-OWNED-REGION

Kinds: variable

Current owned region, bound dynamically during pipeline display.

ELMTUI.PLATFORM.BACKEND.TERMINAL:TERMINAL-DEBUG-PHASE

Kinds: variable

Current rendering phase, bound dynamically during pipeline display.

ELMTUI.PLATFORM.BACKEND.TERMINAL:MAKE-TERMINAL-INSTANCE-FOR-DEVICE

Kinds: function

Construct a terminal-instance around a cl-inputs DEVICE.

ELMTUI.PLATFORM.BACKEND.TERMINAL:RESET-TERMINAL-OUTPUT-STATISTICS

Kinds: function

Reset only INSTANCE's output counters. Return an empty snapshot.

ELMTUI.PLATFORM.BACKEND.TERMINAL:SEND-SEQUENCE

Kinds: function

No documentation metadata.

ELMTUI.PLATFORM.BACKEND.TERMINAL:STYLE-TO-TERMINAL-STYLE

Kinds: function

Compatibility entry for terminal style conversion.
Project TUI aliases once and delegate to the shared terminal conversion
implementation; do not maintain a second, subtly different color/attribute
matrix here. NIL input preserves the historical NIL return contract.

ELMTUI.PLATFORM.BACKEND.TERMINAL:TERMINAL-INSTANCE

Kinds: type

No documentation metadata.

ELMTUI.PLATFORM.BACKEND.TERMINAL:TERMINAL-INSTANCE-BACK-BUFFER

Kinds: function

No documentation metadata.

ELMTUI.PLATFORM.BACKEND.TERMINAL:TERMINAL-INSTANCE-CL-DEVICE

Kinds: function

No documentation metadata.

ELMTUI.PLATFORM.BACKEND.TERMINAL:TERMINAL-INSTANCE-CURRENT-STYLE

Kinds: function

No documentation metadata.

ELMTUI.PLATFORM.BACKEND.TERMINAL:TERMINAL-INSTANCE-CURSOR-COL

Kinds: function

Return the integer cursor COLUMN tracked by TERMINAL-INSTANCE, initially zero.

ELMTUI.PLATFORM.BACKEND.TERMINAL:TERMINAL-INSTANCE-CURSOR-ROW

Kinds: function

Return the integer cursor ROW tracked by TERMINAL-INSTANCE, initially zero.

ELMTUI.PLATFORM.BACKEND.TERMINAL:TERMINAL-INSTANCE-CURSOR-VISIBLE-P

Kinds: function

Return the cursor visibility flag stored in TERMINAL-INSTANCE; it is initially true.

ELMTUI.PLATFORM.BACKEND.TERMINAL:TERMINAL-INSTANCE-FRONT-BUFFER

Kinds: function

No documentation metadata.

ELMTUI.PLATFORM.BACKEND.TERMINAL:TERMINAL-INSTANCE-HEIGHT

Kinds: function

Return the current integer HEIGHT stored in TERMINAL-INSTANCE; the default for a new instance is 24 rows.

ELMTUI.PLATFORM.BACKEND.TERMINAL:TERMINAL-INSTANCE-LOCK

Kinds: function

No documentation metadata.

ELMTUI.PLATFORM.BACKEND.TERMINAL:TERMINAL-INSTANCE-STREAM

Kinds: function

Return the optional STREAM slot of a TERMINAL-INSTANCE. It holds the terminal output stream when one is attached.

ELMTUI.PLATFORM.BACKEND.TERMINAL:TERMINAL-INSTANCE-WIDTH

Kinds: function

Return the current integer WIDTH stored in TERMINAL-INSTANCE; the default for a new instance is 80 columns.

ELMTUI.PLATFORM.BACKEND.TERMINAL:TERMINAL-OUTPUT-STATISTICS

Kinds: function

Return an independent snapshot of INSTANCE's successful output counters.

ELMTUI.PLATFORM.BACKEND.TERMINAL:TERMINAL-OUTPUT-STATS-CHARS-WRITTEN

Kinds: function

No documentation metadata.

ELMTUI.PLATFORM.BACKEND.TERMINAL:TERMINAL-OUTPUT-STATS-CURSOR-MOVES-APPLIED

Kinds: function

No documentation metadata.

ELMTUI.PLATFORM.BACKEND.TERMINAL:TERMINAL-OUTPUT-STATS-FORCED-STYLE-RESETS

Kinds: function

No documentation metadata.

ELMTUI.PLATFORM.BACKEND.TERMINAL:TERMINAL-OUTPUT-STATS-OPS-PROCESSED

Kinds: function

No documentation metadata.

ELMTUI.PLATFORM.BACKEND.TERMINAL:TERMINAL-OUTPUT-STATS-STYLE-CHANGES-APPLIED

Kinds: function

No documentation metadata.

ELMTUI.PLATFORM.BACKEND.TERMINAL:WITH-TERMINAL-LOCK

Kinds: macro

No documentation metadata.

ELMTUI.PLATFORM.BACKEND.TERMINAL:WRITE-OUTPUT

Kinds: function

Write output to the terminal
This method should be implemented by subclasses of low-level-terminal.

ELMTUI.PLATFORM.BACKEND.TERMINAL:WRITE-STYLE-RESET-TO-STREAM

Kinds: function

No documentation metadata.

ELMTUI.PLATFORM.BACKEND.TERMINAL:WRITE-STYLE-TO-STREAM

Kinds: function

Write ANSI escape sequences for STYLE to STREAM. STYLE may be a style plist or a terminal-style instance.

ELMTUI.PLATFORM.BACKEND.TERMINAL.DIFF-RENDERER:COMPUTE-BUFFER-DIFF-FIRST-CALL

Kinds: variable

Obsolete first-frame compatibility flag; use :INITIAL-FRAME-P instead.

ELMTUI.PLATFORM.BACKEND.TERMINAL.DIFF-RENDERER:PARK-CURSOR-AFTER-DIFF

Kinds: variable

When a (ROW . COL) cons, move the cursor there after applying a non-empty diff.

Normal-screen apps park the cursor on pane row 0 so a tmux height shrink deletes
rows below it instead of scrolling overlay cells into native history.

ELMTUI.PLATFORM.BACKEND.TERMINAL.DIFF-RENDERER:APPLY-DIFF-TO-BACKEND

Kinds: function

Apply a list of diff operations (DIFF-OPS) to BACKEND-INSTANCE.
DIFF-OPS rows/cols are relative to the canvas origin.
TERMINAL-OFFSET-ROW/COL shift the canvas so its (0,0) lands on the terminal.

ELMTUI.PLATFORM.BACKEND.TERMINAL.DIFF-RENDERER:COMPUTE-BUFFER-DIFF

Kinds: function

Delegate to pure frame diff. Return operations and per-call diff metrics;
no global diagnostics are read or updated.

ELMTUI.PLATFORM.DRIVER:DRIVER-CONTEXT

Kinds: type

No documentation metadata.

ELMTUI.PLATFORM.DRIVER:DRIVER-CONTEXT-BACKEND

Kinds: function

No documentation metadata.

ELMTUI.PLATFORM.DRIVER:DRIVER-CONTEXT-DEVICE

Kinds: function

No documentation metadata.

ELMTUI.PLATFORM.DRIVER:DRIVER-CONTEXT-INPUT-SOURCE

Kinds: function

No documentation metadata.

ELMTUI.PLATFORM.DRIVER:DRIVER-CONTEXT-INPUT-THREAD

Kinds: function

No documentation metadata.

ELMTUI.PLATFORM.DRIVER:DRIVER-CONTEXT-PUBLISH-FN

Kinds: function

No documentation metadata.

ELMTUI.PLATFORM.DRIVER:DRIVER-CONTEXT-STOP-FLAG

Kinds: function

No documentation metadata.

ELMTUI.PLATFORM.DRIVER:EXECUTE-RENDER-COMMAND

Kinds: function

No documentation metadata.

ELMTUI.PLATFORM.DRIVER:MAKE-DRIVER-CONTEXT

Kinds: function

No documentation metadata.

ELMTUI.PLATFORM.DRIVER:RUN-APP-PLATFORM

Kinds: function

Main entry point for running an application on the platform.
  Arguments:
    APP-SPEC (list): Application specification plist.
    BACKEND-TYPE (keyword): Backend type, e.g., :terminal.
    TTY-PATH (or string null): Path to TTY device, or NIL.
    Platform-specific options are supplied in the validated PLATFORM-OPTIONS plist.
  Returns:
    NIL
  Example:
    (run-app-platform my-app-spec :backend-type :terminal)
  Type: (list, &key keyword (or string null)) => nil
  Side-effects: Initializes backend, starts input thread, runs app loop, cleans up on shutdown.

ELMTUI.PLATFORM.DRIVER:START-DRIVER-INPUT-LOOP

Kinds: function

Begin the driver input thread; returns the thread object.

ELMTUI.PLATFORM.DRIVER:STOP-DRIVER-INPUT-LOOP

Kinds: function

Signal the driver input loop to stop and leave the stop flag set until teardown completes.

ELMTUI.PLATFORM.INPUT:CL-INPUTS-TOKEN->EVENT

Kinds: function

Convert a cl-inputs token to an elmtui event structure. Returns NIL when unsupported.

ELMTUI.PLATFORM.INPUT:START-READER

Kinds: function

Spawns a thread that continuously pulls cl-inputs tokens from BACKEND-INSTANCE
and publishes mapped events using the provided EVENT-HANDLER.

Args:
  backend-instance: The initialized backend (e.g., terminal-instance) to poll for input.
  event-handler: A function to call with the polled event.

Returns:
  Multiple values: the thread object and the symbol name of the function
  generated by `with-interruptable-signal` to stop this reader thread (e.g., 'interrupt-reader-fn').

ELMTUI.PLATFORM.INPUT:STOP-READER

Kinds: function

Stops the input reader thread.

Args:
  stop-signal-function: The function or symbol of the function generated by `with-interruptable-signal`
                        (e.g., 'interrupt-reader-fn) to signal the thread.
  thread-handle: Optional. The thread object returned by `start-reader`. If provided,
                 this function will attempt to join the thread after signaling.

Returns:
  T if the signal function was called, NIL otherwise.

ELMTUI.PLATFORM.TMUX:TMUX-SOCKET

Kinds: variable

When non-NIL, the socket path of the tmux server to query instead of the
ambient one named by $TMUX. This lets callers (and tests) capture from a
server they own without being inside tmux themselves.

ELMTUI.PLATFORM.TMUX:TMUX-TARGET

Kinds: variable

When non-NIL, the tmux target pane passed as -t to capture commands instead
of the ambient pane ($TMUX_PANE).

ELMTUI.PLATFORM.TMUX:CAPTURE-LINES

Kinds: function

Capture tmux output and return a vector of lines.

ELMTUI.PLATFORM.TMUX:CAPTURE-PANE-STRING

Kinds: function

Capture the current tmux pane (MODE :pane or :screen) and return it as a string.
The -e flag ensures escape sequences are included for style preservation.

ELMTUI.PLATFORM.TMUX:CAPTURE-SCREEN-STRING

Kinds: function

Return ANSI-styled tmux pane content including scrollback via
CAPTURE-PANE-STRING with MODE :SCREEN. Read-only; potentially larger than the
visible pane.

ELMTUI.PLATFORM.TMUX:CLEAR-SAVED-TMUX-CAPTURE

Kinds: function

Clear the saved tmux capture.

ELMTUI.PLATFORM.TMUX:HAS-SAVED-TMUX-CAPTURE

Kinds: function

Check if there is a saved tmux capture available for restoration.

ELMTUI.PLATFORM.TMUX:MAKE-BUFFER-FROM-TMUX

Kinds: function

Create a virtual buffer populated from tmux output.

ELMTUI.PLATFORM.TMUX:MAKE-BUFFER-FROM-TMUX-STYLED

Kinds: function

Return a new WIDTH-by-HEIGHT styled visible-pane cell grid, or NIL outside tmux.
Captures only; does not repaint cells or restore history.

ELMTUI.PLATFORM.TMUX:MAKE-NORMAL-SCREEN-LEDGER

Kinds: function

Start a ledger from SAVED, the styled visible pane captured before launch.

ELMTUI.PLATFORM.TMUX:NORMAL-SCREEN-LEDGER

Kinds: type

Logical normal-screen underlay rows and the tmux history size at launch.

ELMTUI.PLATFORM.TMUX:NORMAL-SCREEN-LEDGER-LAUNCH-HISTORY

Kinds: function

Return the pane's tmux history size when the ledger was created, or NIL.

ELMTUI.PLATFORM.TMUX:NORMAL-SCREEN-LEDGER-LOGICAL-HEIGHT

Kinds: function

Return the row count of LEDGER's logical underlay (pulled rows + launch capture).

ELMTUI.PLATFORM.TMUX:NORMAL-SCREEN-LEDGER-P

Kinds: function

Return true when OBJECT is a NORMAL-SCREEN-LEDGER.

ELMTUI.PLATFORM.TMUX:NORMAL-SCREEN-LEDGER-PREPEND-ROWS

Kinds: function

Prepend the top COUNT rows of ROWS as pristine lines tmux pulled from history.

ELMTUI.PLATFORM.TMUX:NORMAL-SCREEN-LEDGER-PULLED

Kinds: function

Return how many history rows tmux has pulled back into the visible pane.

ELMTUI.PLATFORM.TMUX:NORMAL-SCREEN-OVERFLOW-CHUNKS

Kinds: function

Return logical rows beyond a HEIGHT-row pane as WIDTH-wide buffers of at most
HEIGHT rows each, in order.

These are rows a shrink deleted from the bottom of the pane. Shutdown appends
each chunk by scrolling the pane, which moves the rows above into history.

ELMTUI.PLATFORM.TMUX:NORMAL-SCREEN-RECONCILE-HISTORY

Kinds: function

Account for scrollback rows that tmux pulled onto the top of the pane.

LIVE is a fresh capture of the current pane. Rows pulled since the last call are
the top rows of LIVE: they come straight from history and were never painted.

ELMTUI.PLATFORM.TMUX:NORMAL-SCREEN-UNDERLAY

Kinds: function

Return the WIDTHxHEIGHT pane view of LEDGER's logical underlay.

Cells outside the logical rows or columns come from FALLBACK (a buffer of the
same size, normally the live pane) when given, and are blank otherwise.

ELMTUI.PLATFORM.TMUX:PARSE-ANSI-SGR

Kinds: function

Parse an ANSI SGR (Select Graphic Rendition) sequence into a style plist.
Returns NIL if the sequence is a reset, or a plist with :fg, :bg, :attrs keys.

ELMTUI.PLATFORM.TMUX:PARSE-ANSI-STRING

Kinds: function

Parse safe SGR style runs; non-SGR terminal controls are never replayed.
A combined reset/set such as ESC[0;31m clears old attributes first.

ELMTUI.PLATFORM.TMUX:PREFILL-BACKEND-FROM-TMUX

Kinds: function

Prefill BACKEND from styled visible tmux cells and return an independent cell
snapshot. No full history is saved, so this does not guarantee resize-safe quit.

ELMTUI.PLATFORM.TMUX:PREFILL-BACKEND-FROM-TMUX-STYLED

Kinds: function

Fill terminal backend front/back buffers from visible pane SGR cells and return
a separate styled snapshot. No scrollback history is replayed or protected from
shrink.

ELMTUI.PLATFORM.TMUX:PREFILL-BUFFER-FROM-STRING

Kinds: function

Fill BUFFER (virtual-terminal-buffer) with CONTENT text.

ELMTUI.PLATFORM.TMUX:PREFILL-BUFFER-FROM-STYLED-CONTENT

Kinds: function

Fill BUFFER with the terminal-visible tail of styled RUNS, preserving SGR.
The two bounded passes count terminal rows then render only the last HEIGHT.
No scrollback-sized intermediate buffer or terminal I/O is required.

ELMTUI.PLATFORM.TMUX:RESTORE-TO-TMUX-CAPTURE

Kinds: function

Copy the overlapping saved cell rectangle into virtual BUFFER, returning it.
Any newly exposed rows/columns after a resize remain untouched; a saved visible
pane cannot reconstruct them. This never repaints the physical terminal or
recovers native scrollback.

ELMTUI.PLATFORM.TMUX:SAVE-TMUX-CAPTURE

Kinds: function

Copy a bounded visible-pane cell BUFFER into the saved slot. This does not
snapshot tmux scrollback or protect history from later resize-induced
displacement.

ELMTUI.PLATFORM.TMUX:SAVED-TMUX-CAPTURE

Kinds: function

Return the saved visible-pane capture buffer or NIL. Callers must treat it as
read-only: it is the immutable underlay used for compositing and restoration.

ELMTUI.PLATFORM.TMUX:SPLIT-BY-ANSI-SEQUENCES

Kinds: function

Split terminal text into literal runs and complete ESC controls.
This scanner recognizes CSI, OSC, DCS, SOS, PM, APC and designations instead
of stopping at an alphabetic byte. All controls remain distinct segments;
PARSE-ANSI-STRING interprets only SGR, never control payloads or titles.
Unterminated controls are kept together to be discarded by the parser.

ELMTUI.PLATFORM.TMUX:TMUX-AVAILABLE-P

Kinds: function

Return true when tmux is available and a tmux server can be addressed:
either *TMUX-SOCKET* is set or the process is running inside tmux.

ELMTUI.PLATFORM.TMUX:TMUX-HISTORY-SIZE

Kinds: function

Return the scrollback line count of the target pane, or NIL when unknown.

ELMTUI.PLATFORM.TREE-RENDERER:RENDER-LAID-OUT-TREE-TO-BUFFER

Kinds: function

No documentation metadata.

ELMTUI.PLATFORM.TREE-RENDERER:STYLE-PROPERTY-CAPABILITY

Kinds: function

Return PROPERTY's ElmTUI terminal support tier, or NIL for unknown keys.
Also accepts registered cl-styles aliases. This is terminal-specific:
OPACITY is 0=hidden, 0<alpha<1=SGR faint, 1=opaque (no alpha blending);
Z-INDEX is stable sibling stacking, not full CSS stacking contexts.

ELMTUI.PLATFORM.TREE-RENDERER:STYLE-PROPERTY-CAPABILITY-REPORT

Kinds: function

Return fresh (PROPERTY . TIER) pairs, including all registered properties.

ELMTUI.RENDER.DIFF:BUFFERS-NOT-COMPATIBLE-ERROR

Kinds: type

Condition signaled when two virtual terminal buffers cannot be compared during incremental diff generation.

ELMTUI.RENDER.DIFF:BUFFERS-NOT-COMPATIBLE-ERROR-BACK

Kinds: function

Return the destination buffer retained by a buffer-compatibility condition.

ELMTUI.RENDER.DIFF:BUFFERS-NOT-COMPATIBLE-ERROR-FRONT

Kinds: function

Return the prior rendered buffer retained by a buffer-compatibility condition.

ELMTUI.RENDER.DIFF:BUFFERS-NOT-COMPATIBLE-ERROR-REASON

Kinds: function

Return the explanation for a buffer-compatibility failure.

ELMTUI.RENDER.DIFF:COMPUTE-BUFFER-DIFF

Kinds: function

Compute (values operations metrics) without mutating either frame or globals.
INITIAL-FRAME-P is explicit: only styled/painted cells of BACK are emitted.
Incremental comparisons require compatible FRONT and BACK dimensions.
Operations carry zero-based frame coordinates and batched :WRITE-CHARS values.

ELMTUI.RENDER.DIFF:DIFF-METRICS

Kinds: type

Structure recording compared cells, changed cells, emitted batches, and full redraw count for one diff.

ELMTUI.RENDER.DIFF:DIFF-METRICS-BATCHES

Kinds: function

Return how many write batches were emitted by a buffer-diff computation.

ELMTUI.RENDER.DIFF:DIFF-METRICS-CELLS-CHANGED

Kinds: function

Return the number of terminal cells requiring output in a buffer-diff computation.

ELMTUI.RENDER.DIFF:DIFF-METRICS-CELLS-COMPARED

Kinds: function

Return the number of cells examined during a buffer-diff computation.

ELMTUI.RENDER.DIFF:DIFF-METRICS-FULL-REDRAWS

Kinds: function

Return how many full redraw frames were accounted for by a buffer-diff computation.

ELMTUI.RENDER.PRESENTATION:CLEAR-RECORDINGS

Kinds: function

Discard recorded presentations and return PRESENTER.

ELMTUI.RENDER.PRESENTATION:COMPUTE-FRAME-OPERATIONS

Kinds: function

Return pure (values operations metrics) for NEXT relative to PREVIOUS.
Missing front and incompatible sizes explicitly request initial-frame logic;
no global first-call flag, allocations of dummy front buffers or terminal I/O.

ELMTUI.RENDER.PRESENTATION:MAKE-RECORDING-PRESENTER

Kinds: function

No documentation metadata.

ELMTUI.RENDER.PRESENTATION:PRESENT-DIFF

Kinds: function

Apply OPERATIONS at the zero-based origin; return true only after success.

ELMTUI.RENDER.PRESENTATION:PRESENT-FRAME

Kinds: function

Present only changed cells. Return (values OPERATIONS T DIFF-METRICS).
Callers may commit their front frame only after successful acknowledgement.
No-operation frames never call PRESENT-DIFF and cannot write to the backend.

ELMTUI.RENDER.PRESENTATION:PRESENTER-READY-P

Kinds: function

Whether PRESENTER can accept a diff now. Unsupported presenters return NIL.

ELMTUI.RENDER.PRESENTATION:RECORDED-PRESENTATIONS

Kinds: function

Return recording entries in presentation order, without consuming the log.

ELMTUI.RENDER.PRESENTATION:RECORDING-PRESENTER

Kinds: type

No documentation metadata.

ELMTUI.RUNTIME.CONTEXT:INVALIDATE-RUNTIME-CONTEXT

Kinds: function

Invalidate CONTEXT so late async work can detect that its owning runtime has ended.

ELMTUI.RUNTIME.CONTEXT:MAKE-RUNTIME-CONTEXT

Kinds: function

Construct a per-application runtime context. Defaults to phase :BOOTING, active true, shutdown false and a fresh generation token; other slots accept keyword initialization.

ELMTUI.RUNTIME.CONTEXT:RUNTIME-CONTEXT

Kinds: type

Per-application runtime ownership boundary. Compatibility globals may mirror these slots, but new runtime work should be scoped to this object.

ELMTUI.RUNTIME.CONTEXT:RUNTIME-CONTEXT-ACTIVE-P

Kinds: function

Read or set whether this runtime context accepts work; INVALIDATE-RUNTIME-CONTEXT clears this flag.

ELMTUI.RUNTIME.CONTEXT:RUNTIME-CONTEXT-APP-SENDER

Kinds: function

Read or replace the callback used to send messages into this application runtime.

ELMTUI.RUNTIME.CONTEXT:RUNTIME-CONTEXT-APP-SPEC

Kinds: function

Return or replace the application specification owned by this runtime context.

ELMTUI.RUNTIME.CONTEXT:RUNTIME-CONTEXT-BACKEND

Kinds: function

Return or replace the platform backend instance attached to this application runtime.

ELMTUI.RUNTIME.CONTEXT:RUNTIME-CONTEXT-FOCUS-MANAGER

Kinds: function

Return or replace the focus manager associated with this runtime context.

ELMTUI.RUNTIME.CONTEXT:RUNTIME-CONTEXT-GENERATION

Kinds: function

Return or replace the unique generation token used to reject late asynchronous completions.

ELMTUI.RUNTIME.CONTEXT:RUNTIME-CONTEXT-INPUT-CONTEXT

Kinds: function

Return or replace runtime-owned input context state used by input dispatch.

ELMTUI.RUNTIME.CONTEXT:RUNTIME-CONTEXT-LAST-CONTEXT

Kinds: function

Return or replace the last context snapshot stored for this application runtime.

ELMTUI.RUNTIME.CONTEXT:RUNTIME-CONTEXT-MESSAGE-PROCESSOR

Kinds: function

Return or replace the application's message processing callback.

ELMTUI.RUNTIME.CONTEXT:RUNTIME-CONTEXT-MODEL

Kinds: function

Return or replace the application model held by this runtime context.

ELMTUI.RUNTIME.CONTEXT:RUNTIME-CONTEXT-PHASE

Kinds: function

Read or set the runtime lifecycle phase; the constructor starts at :BOOTING and invalidation sets :STOPPED.

ELMTUI.RUNTIME.CONTEXT:RUNTIME-CONTEXT-PREVIOUS-FRAME-BUFFER

Kinds: function

Return or replace the prior rendered frame buffer retained for subsequent presentation.

ELMTUI.RUNTIME.CONTEXT:RUNTIME-CONTEXT-ROOT-VIEWPORT-ID-PATH

Kinds: function

Return or replace the root viewport identifier path for this application context.

ELMTUI.RUNTIME.CONTEXT:RUNTIME-CONTEXT-SHUTDOWN-REQUESTED-P

Kinds: function

Read or set the shutdown request flag; invalidating a runtime sets it true.

ELMTUI.RUNTIME.CONTEXT:RUNTIME-CONTEXT-SUBSCRIPTIONS

Kinds: function

Return or replace the runtime's subscription registry, by default an EQUAL hash table.

ELMTUI.RUNTIME.CONTEXT:RUNTIME-CONTEXT-VALID-GENERATION-P

Kinds: function

Return true when GENERATION still identifies the active CONTEXT instance.

ELMTUI.RUNTIME.EFFECTS:APPLY-UPDATE-EFFECTS

Kinds: function

Apply command execution and subscription reconciliation for one update.

This function is the runtime effect-manager boundary used by the driver.

ELMTUI.RUNTIME.EFFECTS:CLEAR-SUBSCRIPTION-REGISTRY

Kinds: function

Cancel and clear all active subscription handles in ACTIVE-SUBSCRIPTIONS.

ELMTUI.RUNTIME.EFFECTS:NORMALIZE-SUBSCRIPTIONS

Kinds: function

Normalize SUBS to a list of recognized subscription descriptors.

ELMTUI.RUNTIME.EFFECTS:RECONCILE-MODEL-SUBSCRIPTIONS

Kinds: function

Reconcile ACTIVE-SUBSCRIPTIONS against SUBSCRIPTIONS-FN evaluated on MODEL.

ELMTUI.RUNTIME.EFFECTS:RUN-COMMANDS-WITH-POLICY

Kinds: function

Execute COMMANDS using runtime policy callbacks.

Render commands run synchronously through RENDER-COMMAND-FN before all
other commands. Non-render commands are executed through
COMMAND-PROCESSOR-FN when provided, otherwise through
FALLBACK-COMMAND-INTERPRETER.

ELMTUI.RUNTIME.EFFECTS:SPLIT-RENDER-COMMANDS

Kinds: function

Split COMMANDS into two values: render commands and non-render commands.

ELMTUI.RUNTIME.PROTOCOL:DISPATCH-ROOT-MESSAGE

Kinds: function

Deliver MSG to the component tree rooted at ROOT-ID.
Returns two values: PATCHES and COMMANDS.

ELMTUI.STATE.API:UPDATE-CONTRACTS

Kinds: variable

Registry of update function contracts for documentation and validation.

ELMTUI.STATE.API:INVOKE-UPDATE

Kinds: function

Invoke UPDATE-FN with an update context and return an UPDATE-RESULT.

Malformed return shapes consistently signal MALFORMED-UPDATE-RESULT-ERROR so
callers can inspect the function designator, reason, and original values.

ELMTUI.STATE.API:MAKE-UPDATE-RESULT

Kinds: function

No documentation metadata.

ELMTUI.STATE.API:PATCH*

Kinds: function

Like PATCH but also accepts :COMMANDS.

ELMTUI.STATE.API:PLIST-TO-APPLICATION-STATE

Kinds: function

Convert a plist to an application-state with BACKEND.

ELMTUI.STATE.API:PPRINC-APPLICATION-STATE

Kinds: function

Pretty print the application state.

ELMTUI.STATE.API:QUIT-RESULT

Kinds: function

Return an update-result that signals application shutdown.

ELMTUI.STATE.API:REMOVE-COMPONENT-AT-PATH

Kinds: function

Remove COMPONENT-ID-PATH through the normal state transaction protocol.

ELMTUI.STATE.API:SET-STATE-REF

Kinds: function

Set VALUE at PATH in STATE.

ELMTUI.STATE.API:STORE-COMPONENT-AT-PATH

Kinds: function

Store VALUE at COMPONENT-ID-PATH through the normal state transaction protocol.

ELMTUI.STATE.API:UPDATE-RESULT

Kinds: type

Represents the result of an update operation, containing patches and commands.

ELMTUI.STATE.API:UR-ADD-COMMAND

Kinds: function

Adds a command to the update result.

ELMTUI.STATE.API:UR-COMMANDS

Kinds: function

No documentation metadata.

ELMTUI.STATE.API:UR-HANDLED

Kinds: function

No documentation metadata.

ELMTUI.STATE.API:UR-HAS-COMMAND-P

Kinds: function

Checks if the update result contains a specific command.

ELMTUI.STATE.API:UR-PATCHES

Kinds: function

No documentation metadata.

ELMTUI.STATE.MODEL:STATE-SCHEMAS

Kinds: variable

Registry of defined state schemas with their validation rules

ELMTUI.STATE.MODEL:ADD-STATE-OBSERVER

Kinds: function

Adds an observer function for a state model

ELMTUI.STATE.MODEL:APPLY-STATE-PATCHES

Kinds: function

Applies a list of state patches to a state, returning the new state

ELMTUI.STATE.MODEL:DEFMODEL

Kinds: macro

Backward compatible defmodel (delegates to defmodel-contracted)

ELMTUI.STATE.MODEL:DEFMODEL-CONTRACTED

Kinds: macro

Defines a contract-enforced state model with validation, transactions, and observers

ELMTUI.STATE.MODEL:DEFPATCH

Kinds: macro

Defines a named state patch operation with validation

ELMTUI.STATE.MODEL:DEFTRANSACTION

Kinds: macro

Defines a transactional state update with rollback capability

ELMTUI.STATE.MODEL:DIFF-STATES

Kinds: function

Computes the differences between two states

ELMTUI.STATE.MODEL:FORM-STATE-EMAIL

Kinds: function

Safely accesses EMAIL from FORM-STATE state

ELMTUI.STATE.MODEL:FORM-STATE-FOCUS-MANAGER

Kinds: function

Safely accesses FOCUS-MANAGER from FORM-STATE state

ELMTUI.STATE.MODEL:FORM-STATE-LAST-MODIFIED

Kinds: function

Safely accesses LAST-MODIFIED from FORM-STATE state

ELMTUI.STATE.MODEL:FORM-STATE-MESSAGE

Kinds: function

Safely accesses MESSAGE from FORM-STATE state

ELMTUI.STATE.MODEL:FORM-STATE-NAME

Kinds: function

Safely accesses NAME from FORM-STATE state

ELMTUI.STATE.MODEL:FORM-STATE-SCHEMA

Kinds: variable

Generated state-schema metadata describing the FORM-STATE model, its declared slots, validation and lifecycle configuration.

ELMTUI.STATE.MODEL:FORM-STATE-SUBJECT

Kinds: function

Safely accesses SUBJECT from FORM-STATE state

ELMTUI.STATE.MODEL:FORM-STATE-SUBMITTED

Kinds: function

Safely accesses SUBMITTED from FORM-STATE state

ELMTUI.STATE.MODEL:FORM-STATE-VALIDATION-ERRORS

Kinds: function

Safely accesses VALIDATION-ERRORS from FORM-STATE state

ELMTUI.STATE.MODEL:GET-STATE-SCHEMA

Kinds: function

Retrieves the schema for a state model

ELMTUI.STATE.MODEL:GET-STATE-VALUE

Kinds: function

Gets a value from state using a path (list of keywords)

ELMTUI.STATE.MODEL:MAKE-FORM-STATE

Kinds: function

Creates a new FORM-STATE instance with validation and proper defaults

ELMTUI.STATE.MODEL:MAKE-STATE-PATCH

Kinds: function

Construct a state patch record, including a path, value, operation, validator, timestamp, source and metadata.

ELMTUI.STATE.MODEL:MAKE-TRANSACTION

Kinds: function

Construct a state transaction record holding identifier, patches, hooks, rollback data, status and description.

ELMTUI.STATE.MODEL:MERGE-STATE-UPDATES

Kinds: function

Merges multiple state updates into a new state

ELMTUI.STATE.MODEL:NOTIFY-STATE-OBSERVERS

Kinds: function

Notifies all observers of a state change

ELMTUI.STATE.MODEL:REMOVE-STATE-OBSERVER

Kinds: function

Removes an observer function for a state model

ELMTUI.STATE.MODEL:SET-STATE-VALUE

Kinds: function

Sets a value in state using a path (returns new state)

ELMTUI.STATE.MODEL:STATE-PATCH

Kinds: type

Represents a single atomic state change

ELMTUI.STATE.MODEL:STATE-PATCH-P

Kinds: function

Return true if the supplied value is a STATE-PATCH structure, otherwise false.

ELMTUI.STATE.MODEL:TRANSACTION

Kinds: type

Represents a group of state patches applied atomically

ELMTUI.STATE.MODEL:TRANSACTION-DESCRIPTION

Kinds: function

Read or set the human-readable description of a state transaction.

ELMTUI.STATE.MODEL:TRANSACTION-ID

Kinds: function

Read or set the transaction identifier used for tracing and audit purposes.

ELMTUI.STATE.MODEL:TRANSACTION-P

Kinds: function

Return true if the supplied value is a TRANSACTION structure, otherwise false.

ELMTUI.STATE.MODEL:TRANSACTION-PATCHES

Kinds: function

Read or set the ordered list of state patches grouped by a transaction.

ELMTUI.STATE.MODEL:TRANSACTION-POST-HOOKS

Kinds: function

Read or set the callbacks invoked after a transaction applies successfully.

ELMTUI.STATE.MODEL:TRANSACTION-PRE-HOOKS

Kinds: function

Read or set the callbacks evaluated before a transaction applies its patches.

ELMTUI.STATE.MODEL:TRANSACTION-ROLLBACK

Kinds: function

Read or set the original-state snapshot or rollback metadata retained by a transaction.

ELMTUI.STATE.MODEL:TRANSACTION-STATUS

Kinds: function

Read or set a transaction's lifecycle status, such as :PENDING, :COMMITTED, :ROLLED-BACK or :FAILED.

ELMTUI.STATE.MODEL:TRANSACTION-TIMESTAMP

Kinds: function

Read or set the timestamp recorded for a state transaction.

ELMTUI.STATE.MODEL:UPDATE-FORM-STATE

Kinds: function

Updates FORM-STATE state with validation

ELMTUI.STATE.MODEL:UPDATE-STATE-VALUE

Kinds: function

Updates a value in state using a function (returns new state)

ELMTUI.STATE.MODEL:VALIDATE-FORM-STATE

Kinds: function

Validates FORM-STATE state against its schema with detailed error reporting

ELMTUI.STATE.MODEL:VALIDATE-STATE-INSTANCE

Kinds: function

Validates a state instance against its schema

ELMTUI.STATE.MODEL:VALIDATE-STATE-SCHEMA

Kinds: function

Validates that a state schema is properly defined

ELMTUI.STATE.MSG:ACTIVATEUSER-APPMSG-P

Kinds: function

Predicate for ACTIVATEUSER variant of APPMSG.

ELMTUI.STATE.MSG:ARG-DEF

Kinds: type

Represents a single argument in a variant definition.

ELMTUI.STATE.MSG:ARG-DEF-KEYWORD

Kinds: function

Return the keyword naming an argument in a declared message variant.

ELMTUI.STATE.MSG:ARG-DEF-TYPE

Kinds: function

Return the type specifier required for an argument in a declared message variant.

ELMTUI.STATE.MSG:ASYNCPROGRESSUPDATE-APPMSG-P

Kinds: function

Predicate for ASYNCPROGRESSUPDATE variant of APPMSG.

ELMTUI.STATE.MSG:CANONICALIZE-MESSAGE-VARIANT

Kinds: function

Return MESSAGE-INSTANCE with canonical keyword variant head for MESSAGE-TYPE.
Accepts symbol heads from any package as long as their names match a declared variant.
Returns NIL when MESSAGE-INSTANCE is not a recognized variant for MESSAGE-TYPE.

ELMTUI.STATE.MSG:CURSORPOSITION-APPMSG-P

Kinds: function

Predicate for CURSORPOSITION variant of APPMSG.

ELMTUI.STATE.MSG:DEACTIVATEUSER-APPMSG-P

Kinds: function

Predicate for DEACTIVATEUSER variant of APPMSG.

ELMTUI.STATE.MSG:DECREMENTCOUNTER-APPMSG-P

Kinds: function

Predicate for DECREMENTCOUNTER variant of APPMSG.

ELMTUI.STATE.MSG:DEFMSG

Kinds: macro

Define a message type NAME with variants and auto-generated constructors.

ELMTUI.STATE.MSG:FOCUSNEXT-APPMSG-P

Kinds: function

Predicate for FOCUSNEXT variant of APPMSG.

ELMTUI.STATE.MSG:FOCUSPREVIOUS-APPMSG-P

Kinds: function

Predicate for FOCUSPREVIOUS variant of APPMSG.

ELMTUI.STATE.MSG:INCREMENTCOUNTER-APPMSG-P

Kinds: function

Predicate for INCREMENTCOUNTER variant of APPMSG.

ELMTUI.STATE.MSG:KEYEVENT-APPMSG-P

Kinds: function

Predicate for KEYEVENT variant of APPMSG.

ELMTUI.STATE.MSG:MAKE-ACTIVATEUSER-APPMSG

Kinds: function

Constructor for ACTIVATEUSER variant of APPMSG.

ELMTUI.STATE.MSG:MAKE-ASYNCPROGRESSUPDATE-APPMSG

Kinds: function

Constructor for ASYNCPROGRESSUPDATE variant of APPMSG.

ELMTUI.STATE.MSG:MAKE-CURSORPOSITION-APPMSG

Kinds: function

Constructor for CURSORPOSITION variant of APPMSG.

ELMTUI.STATE.MSG:MAKE-DEACTIVATEUSER-APPMSG

Kinds: function

Constructor for DEACTIVATEUSER variant of APPMSG.

ELMTUI.STATE.MSG:MAKE-DECREMENTCOUNTER-APPMSG

Kinds: function

Constructor for DECREMENTCOUNTER variant of APPMSG.

ELMTUI.STATE.MSG:MAKE-FOCUSNEXT-APPMSG

Kinds: function

Constructor for FOCUSNEXT variant of APPMSG.

ELMTUI.STATE.MSG:MAKE-FOCUSPREVIOUS-APPMSG

Kinds: function

Constructor for FOCUSPREVIOUS variant of APPMSG.

ELMTUI.STATE.MSG:MAKE-INCREMENTCOUNTER-APPMSG

Kinds: function

Constructor for INCREMENTCOUNTER variant of APPMSG.

ELMTUI.STATE.MSG:MAKE-KEYEVENT-APPMSG

Kinds: function

Constructor for KEYEVENT variant of APPMSG.

ELMTUI.STATE.MSG:MAKE-MOUSEEVENT-APPMSG

Kinds: function

Constructor for MOUSEEVENT variant of APPMSG.

ELMTUI.STATE.MSG:MAKE-REQUESTFOCUS-APPMSG

Kinds: function

Constructor for REQUESTFOCUS variant of APPMSG.

ELMTUI.STATE.MSG:MAKE-SCROLL-APPMSG

Kinds: function

Constructor for SCROLL variant of APPMSG.

ELMTUI.STATE.MSG:MAKE-SETCOUNTERLABEL-APPMSG

Kinds: function

Constructor for SETCOUNTERLABEL variant of APPMSG.

ELMTUI.STATE.MSG:MAKE-SETTHEME-APPMSG

Kinds: function

Constructor for SETTHEME variant of APPMSG.

ELMTUI.STATE.MSG:MAKE-STATECHANGED-APPMSG

Kinds: function

Constructor for STATECHANGED variant of APPMSG.

ELMTUI.STATE.MSG:MAKE-UPDATEFOCUSABLEIDS-APPMSG

Kinds: function

Constructor for UPDATEFOCUSABLEIDS variant of APPMSG.

ELMTUI.STATE.MSG:MAKE-WINDOWRESIZE-APPMSG

Kinds: function

Constructor for WINDOWRESIZE variant of APPMSG.

ELMTUI.STATE.MSG:MESSAGE-SCHEMA

Kinds: type

Represents the schema for a message type defined by defmsg.

ELMTUI.STATE.MSG:MESSAGE-SCHEMA-DOCSTRING

Kinds: function

Return the source docstring recorded for a declared message schema.

ELMTUI.STATE.MSG:MESSAGE-SCHEMA-NAME

Kinds: function

Return the symbol naming the message type represented by this schema.

ELMTUI.STATE.MSG:MESSAGE-SCHEMA-VARIANTS

Kinds: function

Return the list of declared variant definitions belonging to a message schema.

ELMTUI.STATE.MSG:MESSAGE-VARIANT-P

Kinds: function

Check whether MESSAGE-INSTANCE uses a registered variant keyword for MESSAGE-TYPE.

ELMTUI.STATE.MSG:MOUSEEVENT-APPMSG-P

Kinds: function

Predicate for MOUSEEVENT variant of APPMSG.

ELMTUI.STATE.MSG:MSG-DATA

Kinds: function

Return the data part of message MSG.
If KEY is provided, return the value for KEY in the plist (cdr MSG),
or DEFAULT if KEY is not present. If KEY is not provided, return the plist itself.

ELMTUI.STATE.MSG:MSG-TYPE

Kinds: function

Returns the type of the message MSG.

ELMTUI.STATE.MSG:REQUESTFOCUS-APPMSG-P

Kinds: function

Predicate for REQUESTFOCUS variant of APPMSG.

ELMTUI.STATE.MSG:SCROLL-APPMSG-P

Kinds: function

Predicate for SCROLL variant of APPMSG.

ELMTUI.STATE.MSG:SETCOUNTERLABEL-APPMSG-P

Kinds: function

Predicate for SETCOUNTERLABEL variant of APPMSG.

ELMTUI.STATE.MSG:SETTHEME-APPMSG-P

Kinds: function

Predicate for SETTHEME variant of APPMSG.

ELMTUI.STATE.MSG:STATECHANGED-APPMSG-P

Kinds: function

Predicate for STATECHANGED variant of APPMSG.

ELMTUI.STATE.MSG:UPDATEFOCUSABLEIDS-APPMSG-P

Kinds: function

Predicate for UPDATEFOCUSABLEIDS variant of APPMSG.

ELMTUI.STATE.MSG:VARIANT-DEFINITION

Kinds: type

Represents a single message variant definition.

ELMTUI.STATE.MSG:VARIANT-DEFINITION-ARG-SPEC

Kinds: function

Return the optional raw argument specification recorded for a message variant.

ELMTUI.STATE.MSG:VARIANT-DEFINITION-ARGS

Kinds: function

Return the ordered argument descriptors for a declared message variant.

ELMTUI.STATE.MSG:VARIANT-DEFINITION-CONSTRUCTOR-NAME

Kinds: function

Return the symbol naming the constructor generated for this message variant.

ELMTUI.STATE.MSG:VARIANT-DEFINITION-NAME

Kinds: function

Return the canonical keyword name of a declared message variant.

ELMTUI.STATE.MSG:WINDOWRESIZE-APPMSG-P

Kinds: function

Predicate for WINDOWRESIZE variant of APPMSG.

ELMTUI.STATE.UPDATE:LOG-UPDATE-RESULTS

Kinds: variable

When T, logs the patches and commands returned by update functions.

ELMTUI.STATE.UPDATE:CMD

Kinds: function

Alias for SEND-COMMAND.

ELMTUI.STATE.UPDATE:CONTEXT-COMMANDS

Kinds: function

Return recorded commands in original order.

ELMTUI.STATE.UPDATE:CONTEXT-PATCHES

Kinds: function

Return recorded patches in original order.

ELMTUI.STATE.UPDATE:DEFUPDATE

Kinds: macro

Define an Elm-style update function.

ELMTUI.STATE.UPDATE:DISPATCH-TO-TOPIC

Kinds: function

Create a command that dispatches a payload to a specific topic.

ELMTUI.STATE.UPDATE:HANDLE-ASYNC-COMMAND

Kinds: function

No documentation metadata.

ELMTUI.STATE.UPDATE:MAKE-UPDATE-CONTEXT

Kinds: function

Create an update context with a mutation-isolated draft.

The draft is a deep copy of CL-STATE's supported container graph, not merely a
plist view. UPDATE code may therefore use SREF/SAPPLY/SDELETE destructively on
its draft without changing the model supplied by the runtime. Custom mutable
leaf objects remain application-owned atoms and must be treated as immutable or
copied by the application when strict value semantics are required.

ELMTUI.STATE.UPDATE:MALFORMED-UPDATE-RESULT-ERROR

Kinds: type

Describe an invalid update return without discarding the original values or function designator.

ELMTUI.STATE.UPDATE:MALFORMED-UPDATE-RESULT-FN-NAME

Kinds: function

No documentation metadata.

ELMTUI.STATE.UPDATE:MALFORMED-UPDATE-RESULT-REASON

Kinds: function

No documentation metadata.

ELMTUI.STATE.UPDATE:MALFORMED-UPDATE-RESULT-VALUES

Kinds: function

No documentation metadata.

ELMTUI.STATE.UPDATE:PROCESS-UPDATE-RESULT

Kinds: function

Validate and process values returned by an update function.

ELMTUI.STATE.UPDATE:SAPPLY

Kinds: function

Apply FN to the current value at PATH and store the result.

ELMTUI.STATE.UPDATE:SDELETE

Kinds: function

Delete PATH in the update context.

ELMTUI.STATE.UPDATE:SEND-COMMAND

Kinds: function

Record a command in the update context.

ELMTUI.STATE.UPDATE:SREF

Kinds: function

No documentation metadata.

ELMTUI.STATE.UPDATE:UPDATE-CONTEXT

Kinds: type

No documentation metadata.

ELMTUI.STYLE.MANAGER:COMPUTE-ACTIVE-STYLESHEET

Kinds: function

Build the effective stylesheet for this frame from STATE.
   Sources (priority high→low):
   - state :current-stylesheet if it is a cl-styles sheet
   - otherwise a default empty sheet
   Variables can be provided at (:style-variables ...) in STATE.

ELMTUI.STYLE.MANAGER:DEFAULT-STYLESHEET

Kinds: function

No documentation metadata.

ELMTUI.STYLE.PRESETS:DARK-THEME

Kinds: variable

Predefined dark theme style rules.

ELMTUI.STYLE.PRESETS:LIGHT-THEME

Kinds: variable

Predefined light theme style rules.

ELMTUI.UI.API:+COMPONENT-STATE-ROOT+

Kinds: variable

Canonical root path for component state in app-state.

ELMTUI.UI.API:COMPONENT

Kinds: type

Base class for UI components.
    Arguments:
      ID -- (list) Path list uniquely identifying this component instance.
    Returns:
      COMPONENT instance.
    Example:
      (make-instance 'component :id '(:my-app :main-layout :submit-button))
    (list) => component (pure, no side-effects)
    Side-effects: none (must be pure)

ELMTUI.UI.API:COMPONENT-CHILDREN

Kinds: function

Returns a list of child component *IDs* or *instances*.
   Reads from the :children key in the component's state map in app-state,
   located at (append '(:components) id-path '(:children)).

ELMTUI.UI.API:COMPONENT-HEIGHT

Kinds: function

Returns the height of the component.
   Reads from the :height key in the component's state map in app-state,
   located at (append '(:components) id-path '(:height)).

ELMTUI.UI.API:COMPONENT-ID

Kinds: function

No documentation metadata.

ELMTUI.UI.API:COMPONENT-STATE-MAP-PATH

Kinds: function

Generates a path list for accessing the entire state map of a component.
   `id-path`: The path to the component's state within the :components map (e.g., '(:my-comp)).
   Path: '(:components . id-path)

   Arguments:
    `id-path`: A list of keywords/symbols representing the unique path to this component's state map within the `(:components ...)` section of the app-state.
   Returns:
    A list representing the path to the component's state map, starting with '(:components . id-path).

   Example:
    (component-state-map-path '(:my-app :main-layout :submit-button))
    => '(:components :my-app :main-layout :submit-button

ELMTUI.UI.API:COMPONENT-STATE-PATH

Kinds: function

Generates a path list for accessing/updating a specific component property within app-state.

   Arguments:
     ID-PATH      -- (list) Path to the component's state within the :components map.
     PROPERTY-KEY -- (keyword) The key for the specific property.

   Returns:
     (list) Path to the component's property, starting with '(:components . id-path) and ending with the property-key.

   Example:
     (component-state-path '(:my-app :main-layout :submit-button) :label)
     ;; => '(:components :my-app :main-layout :submit-button :label)

   (list, keyword) => list (pure, no side-effects)
   Side-effects: none (must be pure)

ELMTUI.UI.API:COMPONENT-TYPE

Kinds: function

Returns a symbol representing the type of the component.

   Arguments:
     COMPONENT -- (component) The component instance.

   Returns:
     (symbol) The type of the component, used for namespacing state and type-specific logic.

   Example:
     (component-type my-component) ; => :button

   (component) => symbol (pure, no side-effects)
   Side-effects: none (must be pure)

ELMTUI.UI.API:COMPONENT-WIDTH

Kinds: function

Returns the width of the component.
   Reads from the :width key in the component's state map in app-state,
   located at (append '(:components) id-path '(:width)).

ELMTUI.UI.API:DESTROY

Kinds: function

Prepares patches and commands to remove a component and its children from the app-state.
   Returns (values patches commands).

ELMTUI.UI.API:GET-COMPONENT-PROPERTY

Kinds: function

Retrieves a specific property for a component from its namespaced state in global app-state.
   `app-state`: The global application state.
   `id-path`: The path to the component's state within the :components map.
   `property-key`: The key for the specific property.
   Returns the value or default-value.

ELMTUI.UI.API:ID

Kinds: function

Returns the ID of a component or UI node.

   Arguments:
     OBJECT -- (component or ui-node) The object to query.

   Returns:
     (list) The ID path of the object.

   Example:
     (id my-component) ; => '(:my-app :main-layout :submit-button)

   (component|ui-node) => list (pure, no side-effects)
   Side-effects: none (must be pure)

ELMTUI.UI.API:ID-FROM-PATH

Kinds: function

Extracts the last ID from a path list.
   Assumes the last element is the ID keyword or symbol.

ELMTUI.UI.API:INIT

Kinds: function

Initializes a component instance after it has been created.
   This method is responsible for setting up the component's own behavioral state
   in the global application state and for initializing any child components it manages.
   `component`: The component instance (already created by make-instance).
   `id-path`: A list of keywords/symbols representing the unique path to this component's
              state map within the `(:components ...)` section of the app-state.
              Example: '(:my-app :main-layout :submit-button)
   `initargs`: Other initargs passed during component creation.
   Returns (values component patches commands).

   Example usage:
   (init my-component :id-path '(:my-app :main-layout :submit-button)
         :dsl '(:button :label "Submit" :on-click #'submit-handler))

ELMTUI.UI.API:INITIALIZE-COMPONENTS-FROM-DSL

Kinds: function

Recursively traverses a component DSL, instantiates components,
   and returns the accumulated patches and commands.

ELMTUI.UI.API:INSTANTIATE-COMPONENT-FROM-DSL

Kinds: function

No documentation metadata.

ELMTUI.UI.API:MAKE-STATE-PATCH

Kinds: function

Creates a single entry for a state patch list: (list path value).

ELMTUI.UI.API:NORMALIZE-UPDATE-ARGS

Kinds: function

Normalize UPDATE arguments so callers may pass either (msg app-state) or (app-state msg).

ELMTUI.UI.API:RESOLVE-COMPONENT-NODE

Kinds: function

Resolves a component into a concrete UI node for layout and rendering.

ELMTUI.UI.API:UPDATE

Kinds: function

Processes a message for a component instance. Returns an `update-result` struct.

ELMTUI.UI.API:VIEW

Kinds: function

Generates a view representation (DSL spec) for a component instance.

ELMTUI.UI.API:WITH-UPDATE-PATCH

Kinds: macro

No documentation metadata.

ELMTUI.UI.COMPONENT-METACLASS:CLASS-METADATA

Kinds: function

No documentation metadata.

ELMTUI.UI.COMPONENT-METACLASS:COMPONENT-CLASS

Kinds: type

Metaclass for component classes that stores metadata
                   in the class metaobject itself instead of a static registry.

ELMTUI.UI.COMPONENT-METACLASS:MAKE-METADATA

Kinds: function

Create a metadata structure for component classes.

   Arguments:
     PROPS        -- A plist of component properties (e.g., '(:label "Button" :width 100))
     DOCUMENTATION -- A string describing the component
     EXAMPLES     -- A list of example DSL forms showing usage

   Returns:
     A plist containing the metadata fields.

   Example:
     (make-metadata
       :props '(:text "Click me"
                 :on-click handle-click)
       :documentation "A clickable button component"
       :examples '((:button :text "Submit"
                           :on-click submit-form)))

ELMTUI.UI.DEFCOMPONENT:CCLASS-NAME

Kinds: function

Returns a keyword symbol representing the component class type, e.g., :my-button.

ELMTUI.UI.DEFCOMPONENT:DEFCOMPONENT

Kinds: macro

Defines a new UI component class with declarative state, init, update, and view logic.

SYNTAX:
(defcomponent component-name (superclass1 superclass2 ...)
  (:state (slot1-name initial-value1 &key type doc)
          (slot2-name initial-value2 &key type doc)
          ...)

  (:init (props self-id-path)
    (values '(:slot1-name val1) nil))

  ;; or with destructuring:
  (:init ((label count &key style) self-id-path)
    (values `(:label ,label :count ,count :style ,style) nil))

  (:update (msg state app-state id-path)
    (:increment (amount)
      (values `(:count ,(+ (getf state :count 0) amount)) nil)))

  (:view (local-state-map app-state self-id-path children)
    `(:label :id (elmtui.ui.api:id-from-path self-id-path)
             :text (getf local-state-map :text "Default Text View")))

  ...other-class-options...)

ELMTUI.UI.DSL-RESOLUTION:DSL-TYPE-REGISTRY

Kinds: variable

Registry mapping DSL type keywords to their component class names.
Consulted by KNOWN-DSL-TYPE-P to decide whether a keyword names a DSL
node type (as opposed to a property key) during argument splitting.
Entries are added at load time by REGISTER-DSL-TYPE, which is called
automatically by defcomponent and defcomponent-dsl expansions.

ELMTUI.UI.DSL-RESOLUTION:KNOWN-DSL-TYPE-P

Kinds: function

Return non-NIL if KEYWORD is a registered DSL node type.
Returns the associated class (or T when no class was recorded), NIL otherwise.

ELMTUI.UI.DSL-RESOLUTION:REGISTER-DSL-TYPE

Kinds: function

Register KEYWORD as a known DSL node type, optionally mapping to CLASS.
Registration is idempotent: calling with the same KEYWORD and CLASS
has no additional effect.

ELMTUI.UI.DSL-RESOLUTION:RESOLVE-DSL-TYPE

Kinds: function

Resolve ITEM to a component class with accumulated PROPS.

Returns (values class final-props).

ITEM can be:
- a keyword  : look up via dsl-type generic (recurses)
- a list     : (car list) is the type, (cdr list) are extra props
- a symbol   : it's a class (terminates)

This is the main entry point for DSL resolution. It handles the
initial dispatch based on the type of ITEM.

Examples:
  (resolve-dsl-type 'my-widget)              => MY-WIDGET, NIL
  (resolve-dsl-type :my-variant)             => (via dsl-type method), props
  (resolve-dsl-type '(:my-variant :x 1))     => (via dsl-type method), (:x 1 . props)

When chaining, props are accumulated from right to left:
  (resolve-dsl-type '(:outer :inner)) calls
  (dsl-type :inner) then appends (:outer) to result

ELMTUI.UI.STYLES:STYLE-REGISTRY

Kinds: variable

Global registry mapping keyword names to style property lists.
Styles are typically registered at load time via DEFSTYLE.

ELMTUI.UI.STYLES:APPLY-THEME

Kinds: function

Register a batch of named styles from a theme plist.

THEME-STYLES is a plist of (NAME STYLE-PLIST ...) pairs.  Each NAME is
registered as a style class, overwriting any previous definition with that
name.

Example:
  (apply-theme '(:title  (:bold t :fg :cyan)
                 :muted  (:dim t :fg :white)))

ELMTUI.UI.STYLES:CLEAR-STYLE-REGISTRY

Kinds: function

Remove all entries from the style registry.  Intended for testing.

ELMTUI.UI.STYLES:DEFSTYLE

Kinds: macro

Register a named style class.  NAME must be a keyword; STYLE-PLIST is a
property list of style properties.

Example:
  (defstyle :flex-column (:display :flex :flex-direction :column))

ELMTUI.UI.STYLES:MERGE-STYLES

Kinds: function

Merge class-resolved styles with inline styles.  Inline wins on conflict.

Both arguments are property lists.  Returns a fresh property list.

ELMTUI.UI.STYLES:RESOLVE-NODE-STYLES

Kinds: function

Given a DSL node's property list PROPS, resolve any :CLASS specification
and merge it with the explicit :STYLE.  Returns a new property list where
:STYLE contains the merged result and :CLASS has been consumed.

If PROPS has no :CLASS key the property list is returned unchanged.

ELMTUI.UI.STYLES:RESOLVE-STYLE-CLASS

Kinds: function

Look up a named style class.  Signals an error if NAME is not registered.

ELMTUI.UI.STYLES:RESOLVE-STYLE-CLASSES

Kinds: function

Resolve a class specification to a merged style plist.

CLASS-SPEC is either a keyword (single class) or a list of keywords.
When multiple classes are given, later classes override earlier ones on
property conflict.

ELMTUI.UI.WIDGETS.BUTTON:BUTTON

Kinds: type

A clickable button widget, refactored to the new defcomponent style.

ELMTUI.UI.WIDGETS.DRAWABLE-CONTENT:DRAWABLE-CONTENT

Kinds: type

A component that represents directly renderable content, like a string of text.
Its state (content, style) is stored in the application state.

ELMTUI.UI.WIDGETS.DRAWABLE-CONTENT:MAKE-DRAWABLE-CONTENT

Kinds: function

No documentation metadata.

ELMTUI.UI.WIDGETS.DRAWABLE-CONTENT:MSG-SET-DRAWABLE-CONTENT

Kinds: variable

No documentation metadata.

ELMTUI.UI.WIDGETS.DRAWABLE-CONTENT:MSG-SET-DRAWABLE-STYLE

Kinds: variable

No documentation metadata.

ELMTUI.UI.WIDGETS.LABEL:LABEL

Kinds: type

A text label widget, refactored to the new defcomponent style.

ELMTUI.UI.WIDGETS.LAYOUT:LAYOUT

Kinds: type

A versatile component that arranges child components using flexbox or grid layouts, controlled by the :display property.

ELMTUI.UI.WIDGETS.LISTBOX:INIT-LISTBOX

Kinds: function

Initializes a new listbox model.
   Returns (values listbox-model initial-command).

ELMTUI.UI.WIDGETS.LISTBOX:LISTBOX-MODEL

Kinds: type

Model for a listbox widget.
   ID: Unique identifier.
   ITEMS: List of items to display.
   SELECTED-INDEX: Index of the currently selected item.
   SCROLL-OFFSET: Index of first visible item.
   HEIGHT: Number of visible items.
   ON-SELECT: Message to dispatch when item selected.

ELMTUI.UI.WIDGETS.LISTBOX:LISTBOX-MODEL-HEIGHT

Kinds: function

Return or set the number of visible listbox rows used for paging and scroll calculations.

ELMTUI.UI.WIDGETS.LISTBOX:LISTBOX-MODEL-ID

Kinds: function

Return the identity used to associate this listbox model with its UI widget.

ELMTUI.UI.WIDGETS.LISTBOX:LISTBOX-MODEL-ITEMS

Kinds: function

Return or set the ordered list of items displayed by the listbox.

ELMTUI.UI.WIDGETS.LISTBOX:LISTBOX-MODEL-ON-SELECT

Kinds: function

Return or set the message template dispatched by the listbox when selection changes.

ELMTUI.UI.WIDGETS.LISTBOX:LISTBOX-MODEL-SCROLL-OFFSET

Kinds: function

Return or set the zero-based index of the first visible listbox item.

ELMTUI.UI.WIDGETS.LISTBOX:LISTBOX-MODEL-SELECTED-INDEX

Kinds: function

Return or set the selected zero-based item index, or NIL for no selection.

ELMTUI.UI.WIDGETS.LISTBOX:MSG-LISTBOX-KEY-PRESS

Kinds: variable

Message-type constant :LISTBOX-KEY-PRESS; accepts a :KEY field for Up, Down, Home, End and paging navigation.

ELMTUI.UI.WIDGETS.LISTBOX:MSG-LISTBOX-SCROLL-DOWN

Kinds: variable

Message-type constant :LISTBOX-SCROLL-DOWN; the optional :AMOUNT determines downward scroll steps.

ELMTUI.UI.WIDGETS.LISTBOX:MSG-LISTBOX-SCROLL-UP

Kinds: variable

Message-type constant :LISTBOX-SCROLL-UP; the optional :AMOUNT determines upward scroll steps.

ELMTUI.UI.WIDGETS.LISTBOX:MSG-LISTBOX-SELECT-INDEX

Kinds: variable

Message-type constant :LISTBOX-SELECT-INDEX; supply :INDEX to select an item directly.

ELMTUI.UI.WIDGETS.LISTBOX:MSG-LISTBOX-SET-ITEMS

Kinds: variable

Message-type constant :LISTBOX-SET-ITEMS; supply :ITEMS to replace the list and clamp selection and scroll offset.

ELMTUI.UI.WIDGETS.LISTBOX:UPDATE-LISTBOX

Kinds: function

Updates the listbox model based on a message.
   Returns (values new-listbox-model command-list).

ELMTUI.UI.WIDGETS.LISTBOX:VIEW-LISTBOX

Kinds: function

Creates a UI representation of a listbox.
   APP-STATE: The application state.
   WIDGET-ID: The unique ID for this listbox (required).
   ITEMS: List of items to display. Each item can be a string or a plist with :label.
   HEIGHT: Number of items to display at once.
   SELECTED-INDEX: Index of the currently selected item.
   ON-SELECT: Message to dispatch when an item is selected.
   EMPTY-TEXT: Text to display when the list is empty.
   TOOLTIP: Optional tooltip text to display on hover.
   ARIA-LABEL: Accessibility label for screen readers.
   CLASS: Additional CSS classes to apply.
   WIDTH: Width in columns.

Usage:
   (view-listbox app-state
                   :widget-id :my-listbox
                   :items '("Item 1" "Item 2" "Item 3")
                   :height 5
                   :selected-index 1
                   :on-select (list :msg-type :item-selected)
                   :empty-text "No items available"
                   :tooltip "Select an item"
                   :aria-label "List of items"
                   :class "custom-listbox"
                   :width 20)

ELMTUI.UI.WIDGETS.MODAL-DIALOG:MODAL-DIALOG

Kinds: type

No documentation metadata.

ELMTUI.UI.WIDGETS.MODAL-DIALOG:MODAL-DIALOG-INPUT

Kinds: function

No documentation metadata.

ELMTUI.UI.WIDGETS.MODAL-DIALOG:MODAL-DIALOG-KIND

Kinds: function

No documentation metadata.

ELMTUI.UI.WIDGETS.MODAL-DIALOG:MODAL-DIALOG-LINES

Kinds: function

Return five printable, bounded rows. Designed to work even without z-index
or compositor-level overlays; can replace five host content rows.

ELMTUI.UI.WIDGETS.MODAL-DIALOG:MODAL-DIALOG-P

Kinds: function

No documentation metadata.

ELMTUI.UI.WIDGETS.MODAL-DIALOG:MODAL-DIALOG-RETURN-FOCUS

Kinds: function

No documentation metadata.

ELMTUI.UI.WIDGETS.MODAL-DIALOG:MODAL-DIALOG-VIEW

Kinds: function

Return five :TEXT DSL nodes for rendering in a normal host layout.
Use the parent update to trap events; these nodes intentionally do not
claim a compositor overlay or implicit focus manager integration.

ELMTUI.UI.WIDGETS.MODAL-DIALOG:MODAL-HANDLE-KEY

Kinds: function

Return (values updated-dialog result). RESULT is NIL while editing,
otherwise a plist with :ACTION, :VALUE and :RETURN-FOCUS.
The parent must not dispatch this key to the application if DIALOG exists.

ELMTUI.UI.WIDGETS.MODAL-DIALOG:OPEN-MODAL-DIALOG

Kinds: function

Create an independent modal session. CHOICES is ((character . action) ...).
A prompt resolves as :ACCEPT with the typed string. Enter on confirmation
resolves as :CANCEL. The parent must route keys here while modal is active.

ELMTUI.UI.WIDGETS.ROOT-VIEWPORT:COMPUTE-VIEW-SIZE

Kinds: function

Return three values:
   1) width - available width for the viewport
   2) height - available height for the viewport
   3) offset-y - vertical offset from top of terminal

ELMTUI.UI.WIDGETS.ROOT-VIEWPORT:MAKE-ROOT-VIEWPORT

Kinds: function

No documentation metadata.

ELMTUI.UI.WIDGETS.ROOT-VIEWPORT:ROOT-VIEWPORT

Kinds: type

Stateless root viewport: keeps all runtime in external state via patches.

ELMTUI.UI.WIDGETS.SCROLL-PANEL:MAKE-SCROLL-PANEL

Kinds: function

Create a scroll-panel component instance.

  Parameters:
    ID - Keyword identifier for the component
    INITARGS - Initialization arguments (width, height, content-height, etc.)

ELMTUI.UI.WIDGETS.SCROLL-PANEL:SCROLL-PANEL

Kinds: type

A panel with virtual scrolling - content moves, terminal doesn't scroll.

ELMTUI.UI.WIDGETS.SCROLLABLE-CONTAINER:INIT-SCROLLABLE-CONTAINER

Kinds: function

Initializes a new scrollable container model.
   Returns (values scrollable-container-model initial-command).

ELMTUI.UI.WIDGETS.SCROLLABLE-CONTAINER:MSG-SCROLL-CONTAINER-KEY-PRESS

Kinds: variable

Message tag :SCROLL-CONTAINER-KEY-PRESS; a :KEY field handles arrows, page movement, Home and End.

ELMTUI.UI.WIDGETS.SCROLLABLE-CONTAINER:MSG-SCROLL-CONTAINER-SCROLL

Kinds: variable

Message tag :SCROLL-CONTAINER-SCROLL; :DELTA-X and :DELTA-Y adjust scroll offsets before clamping.

ELMTUI.UI.WIDGETS.SCROLLABLE-CONTAINER:MSG-SCROLL-CONTAINER-SET-SCROLL

Kinds: variable

Message tag :SCROLL-CONTAINER-SET-SCROLL; optional :X and :Y replace horizontal and vertical offsets.

ELMTUI.UI.WIDGETS.SCROLLABLE-CONTAINER:MSG-SCROLL-CONTAINER-UPDATE-DIMENSIONS

Kinds: variable

Message tag :SCROLL-CONTAINER-UPDATE-DIMENSIONS; new viewport and content dimensions recompute legal scroll ranges.

ELMTUI.UI.WIDGETS.SCROLLABLE-CONTAINER:SCROLLABLE-CONTAINER-MODEL

Kinds: type

Model for a scrollable container widget.
   ID: Unique identifier.
   SCROLL-TOP: Vertical scroll position.
   SCROLL-LEFT: Horizontal scroll position.
   VIEWPORT-WIDTH: Visible width of the container.
   VIEWPORT-HEIGHT: Visible height of the container.
   CONTENT-WIDTH: Total width of the content.
   CONTENT-HEIGHT: Total height of the content.
   DISABLED: Whether scrolling is disabled.
   SHOW-SCROLLBAR-X: When to show horizontal scrollbar (:auto, :always, :never).
   SHOW-SCROLLBAR-Y: When to show vertical scrollbar (:auto, :always, :never).
   ON-SCROLL: Message to send when scroll position changes.

ELMTUI.UI.WIDGETS.SCROLLABLE-CONTAINER:SCROLLABLE-CONTAINER-MODEL-CONTENT-HEIGHT

Kinds: function

Read or set the total vertical extent of content within a scrollable container.

ELMTUI.UI.WIDGETS.SCROLLABLE-CONTAINER:SCROLLABLE-CONTAINER-MODEL-CONTENT-WIDTH

Kinds: function

Read or set the total horizontal extent of content within a scrollable container.

ELMTUI.UI.WIDGETS.SCROLLABLE-CONTAINER:SCROLLABLE-CONTAINER-MODEL-DISABLED

Kinds: function

Read or set whether update requests are ignored by the scrollable container model.

ELMTUI.UI.WIDGETS.SCROLLABLE-CONTAINER:SCROLLABLE-CONTAINER-MODEL-ID

Kinds: function

Return the identity associated with this scrollable container widget.

ELMTUI.UI.WIDGETS.SCROLLABLE-CONTAINER:SCROLLABLE-CONTAINER-MODEL-ON-SCROLL

Kinds: function

Read or replace the message template emitted when the scroll offset changes.

ELMTUI.UI.WIDGETS.SCROLLABLE-CONTAINER:SCROLLABLE-CONTAINER-MODEL-SCROLL-LEFT

Kinds: function

Read or set the zero-based horizontal offset, clamped against content and viewport width during updates.

ELMTUI.UI.WIDGETS.SCROLLABLE-CONTAINER:SCROLLABLE-CONTAINER-MODEL-SCROLL-TOP

Kinds: function

Read or set the zero-based vertical offset, clamped against content and viewport height during updates.

ELMTUI.UI.WIDGETS.SCROLLABLE-CONTAINER:SCROLLABLE-CONTAINER-MODEL-SHOW-SCROLLBAR-X

Kinds: function

Read or set horizontal scrollbar policy, commonly :AUTO, :ALWAYS or :NEVER.

ELMTUI.UI.WIDGETS.SCROLLABLE-CONTAINER:SCROLLABLE-CONTAINER-MODEL-SHOW-SCROLLBAR-Y

Kinds: function

Read or set vertical scrollbar policy, commonly :AUTO, :ALWAYS or :NEVER.

ELMTUI.UI.WIDGETS.SCROLLABLE-CONTAINER:SCROLLABLE-CONTAINER-MODEL-VIEWPORT-HEIGHT

Kinds: function

Read or set the number of visible rows inside the scrollable container viewport.

ELMTUI.UI.WIDGETS.SCROLLABLE-CONTAINER:SCROLLABLE-CONTAINER-MODEL-VIEWPORT-WIDTH

Kinds: function

Read or set the number of visible columns inside the scrollable container viewport.

ELMTUI.UI.WIDGETS.SCROLLABLE-CONTAINER:UPDATE-SCROLLABLE-CONTAINER

Kinds: function

Updates the scrollable container model based on a message.
   MSG: The message to process.
   MODEL: The current scrollable-container-model instance.
   Returns (values new-model command-list).

ELMTUI.UI.WIDGETS.SCROLLABLE-CONTAINER:VIEW-SCROLLABLE-CONTAINER

Kinds: function

Creates a UI representation of a scrollable container.
   APP-STATE: The application state.
   WIDGET-ID: The unique ID for this container (required).
   SCROLL-TOP: Vertical scroll position.
   SCROLL-LEFT: Horizontal scroll position.
   VIEWPORT-WIDTH: Visible width of the container.
   VIEWPORT-HEIGHT: Visible height of the container.
   CONTENT-WIDTH: Total width of the content.
   CONTENT-HEIGHT: Total height of the content.
   SHOW-SCROLLBAR-X: When to show horizontal scrollbar (:auto, :always, :never).
   SHOW-SCROLLBAR-Y: When to show vertical scrollbar (:auto, :always, :never).
   DISABLED: Whether scrolling is disabled.
   ON-SCROLL: Message to send when scroll position changes.
   TOOLTIP: Optional tooltip text to display on hover.
   ARIA-LABEL: Accessibility label for screen readers.
   CLASS: Additional CSS classes to apply.
   CHILDREN: Content to be scrolled.

ELMTUI.UI.WIDGETS.TEXTINPUT:MAKE-TEXTINPUT

Kinds: function

Create a text input component; initialize its state through INIT.

ELMTUI.UI.WIDGETS.TEXTINPUT:MSG-TEXTINPUT-KEY-PRESS

Kinds: variable

No documentation metadata.

ELMTUI.UI.WIDGETS.TEXTINPUT:MSG-TEXTINPUT-SET-VALUE

Kinds: variable

No documentation metadata.

ELMTUI.UI.WIDGETS.TEXTINPUT:MSG-TEXTINPUT-SUBMIT

Kinds: variable

No documentation metadata.

ELMTUI.UI.WIDGETS.TEXTINPUT:TEXTINPUT

Kinds: type

Externally stored text input with a character-index cursor.
Updates return patches and optional on-change/on-submit commands. Stored callback
commands pass through unchanged; on-change runs only when the value changes.

ELMTUI.UI.WIDGETS.UTILS:DEFWIDGET-VIEW

Kinds: macro

Define a standardized widget view function.

   Arguments:
   - NAME: The name of the view function to define.
   - APP-STATE-VAR: Symbol to bind to the application state.
   - WIDGET-ID-VAR: Symbol to bind to the widget ID (defaults to 'widget-id).
   - MODEL-VAR: Symbol to bind to the model (defaults to 'model).
   - MODEL-PATH: Optional path within app-state to locate the model.
   - ADD-ARGS: Additional arguments to include in the function signature.
   - DOCUMENTATION: Documentation string for the function.
   - BODY: The body of the view function.

   Example:
   (defwidget-view view-button (app-state :model-path 'buttons
                                        :add-args (&key label disabled)
                                        :documentation "Render a button widget.")
     (make-styled-node :type :button
                      :props (list :id widget-id
                                  :label (or label (button-model-label model))
                                  :disabled disabled
                                  :focused is-focused)))

ELMTUI.UI.WIDGETS.UTILS:GET-WIDGET-MODEL

Kinds: function

Retrieves the model for a widget from application state.
   APP-STATE: The application state.
   WIDGET-ID: The ID of the widget to retrieve.
   MODEL-PATH: Optional path to navigate within the app-state.

   Returns the widget model or nil if not found.

ELMTUI.UI.WIDGETS.UTILS:WIDGET-FOCUSED-P

Kinds: function

Determines if a widget currently has focus.
   APP-STATE: The application state.
   WIDGET-ID: The ID of the widget to check.

   Returns t if the widget has focus, nil otherwise.

ELMTUI.UI.WIDGETS.UTILS:WITH-WIDGET-MODEL

Kinds: macro

Binds VAR to the widget model retrieved from app-state and executes BODY.
   Also binds is-focused to whether the widget has focus.

   Example:
     (with-widget-model (button-model app-state widget-id)
       (make-styled-node :type :button :props (list :label (button-model-label button-model))))

ELMTUI.UI.WIDGETS.VIEWPORT:MAKE-VIEWPORT

Kinds: function

No documentation metadata.

ELMTUI.UI.WIDGETS.VIEWPORT:VIEWPORT

Kinds: type

A component that manages a scrollable view of a single child component.
Its behavioral state (offsets, dimensions) is in app-state.
It stores the ID of its child component in app-state under :child.

ELMTUI.UTILS:AS

Kinds: function

Convert OBJECT to ENFORCED-TYPE, or return DEFAULT.

ELMTUI.UTILS:BLANK-STRING-P

Kinds: function

Return true when VALUE is NIL, empty, or contains only whitespace.

ELMTUI.UTILS:COERCE-FN

Kinds: function

Quote a symbolic or lambda function designator for macro expansion.

ELMTUI.UTILS:COPY-HASH-TABLE

Kinds: function

Return a shallow copy of TABLE that preserves its hash-table policy.

ELMTUI.UTILS:ENSURE-KEYWORD

Kinds: function

Return VALUE as an uppercase keyword.

ELMTUI.UTILS:ENSURE-LIST

Kinds: function

Return VALUE as a list; NIL remains NIL.

ELMTUI.UTILS:FORMAT-DURATION

Kinds: function

Format SECONDS as a compact human-readable duration.

ELMTUI.UTILS:FORMAT-PERCENTAGE

Kinds: function

Format VALUE as a percentage of TOTAL.

ELMTUI.UTILS:GET-PATH

Kinds: function

Read PATH from DATA through cl-state's canonical path API.

ELMTUI.UTILS:HEX-STR-TO-RGB

Kinds: function

Parse a #RRGGBB string and return (R G B), or NIL for invalid input.

ELMTUI.UTILS:PARSE-PLIST-AND-CHILDREN

Kinds: function

Compatibility alias for SPLIT-PROPS/CHILDREN.

ELMTUI.UTILS:REMOVE-PATH

Kinds: function

Remove PATH through cl-state and return UPDATED-DATA, REMOVEDP.

ELMTUI.UTILS:SET-PATH

Kinds: function

Store VALUE at PATH using cl-state's canonical path implementation.

For an APPLICATION-STATE, update its data slot and return the state.  For raw
containers, return the updated container.

ELMTUI.UTILS:SPLIT-PROPS/CHILDREN

Kinds: function

Split leading keyword/value pairs from positional child forms.

An explicit :CHILDREN property replaces positional children, including when its
value is NIL.

ELMTUI.UTILS:SPLIT-STRING-LITERAL

Kinds: function

Split VALUE on literal SEPARATOR, optionally limiting the number of fields.

LIMIT follows CL-STR's field-count convention: a limit of three performs at
most two splits. Empty fields, including a trailing field, are preserved unless
OMIT-EMPTY is true.

ELMTUI.UTILS:STRING-PREFIX-P

Kinds: function

Return true when VALUE starts with PREFIX according to TEST.

ELMTUI.UTILS:STRUCT->PLIST

Kinds: function

Return OBJECT's effective slots and values as a property list.

ELMTUI.UTILS:TRIM-STRING

Kinds: function

Remove surrounding whitespace from VALUE, preserving NIL.

ELMTUI.VIEW.API:APPLY-DIFF

Kinds: function

Apply DIFF-OPS to the physical terminal via BACKEND.

   Arguments:
     BACKEND         -- (object) Backend instance responsible for IO.
     DIFF-OPS        -- (list) Result of DIFF-BUFFER.
     TERMINAL-ORIGIN -- (list) (x y) top-left corner offset when drawing.

   Returns:
     Implementation-defined (often NIL).

   Example:
     (apply-diff backend diff-ops '(0 0))
     ;; => NIL

   (object, list, list) => any (side-effect: terminal IO)

   Side-effects:
     - May write to terminal or device.

   Purity: impure (performs IO)

ELMTUI.VIEW.API:APPLY-STYLE

Kinds: function

Normalise and merge style information for a tree of UI nodes.

   Arguments:
     RICH-TREE -- (list) Tree produced by RENDER-VIEW.

   Returns:
     Tree of STYLED-UI-NODE objects whose STYLE-MAP slot is complete.
     Must not change tree topology.

   Example:
     (apply-style rich-tree)
     ;; => (STYLED-UI-NODE ...)

   (list) => list[styled-ui-node] (pure, no side-effects)

   Side-effects: none (must be pure)

ELMTUI.VIEW.API:DIFF-BUFFER

Kinds: function

Compute minimal diff operations to transform PREV-BUFFER into CURR-BUFFER.

   Arguments:
     PREV-BUFFER -- (object) Previous back-buffer state.
     CURR-BUFFER -- (object) Current back-buffer state.

   Returns:
     A list or stream of diff operations understood by APPLY-DIFF.

   Example:
     (diff-buffer prev curr)
     ;; => ((:replace ...))

   (object, object) => list[diff-op] (pure, no side-effects)

   Side-effects: none (must be pure)

ELMTUI.VIEW.API:RENDER-TO-BUFFER

Kinds: function

Emit drawing commands into BACKBUFFER from a fully laid-out UI tree.

   Arguments:
     LAID-OUT-TREE -- (list) Fully laid-out tree from LAYOUT-VIEW.
     BACKBUFFER    -- (object) Mutable device-buffer object.

   Returns:
     Implementation-defined (usually BACKBUFFER or NIL).

   Example:
     (render-to-buffer laid-out-tree my-backbuffer)
     ;; => my-backbuffer

   (list, object) => object (side-effect: modifies BACKBUFFER)

   Side-effects:
     - BACKBUFFER contents are updated in-place.

   Purity: impure (mutates BACKBUFFER)

ELMTUI.VIEW.API:RENDER-VIEW

Kinds: function

High-level entry point of the View-pipeline.

   Arguments:
     APP-STATE -- (object) The current application state/model.

   Returns:
     A tree of UI-NODE instances in their rich form (labels, list-boxes, etc).

   Example:
     (render-view my-app-state)
     ;; => (UI-NODE ...)

   (object) => list[ui-node] (pure, no side-effects)

   Side-effects: none (must be pure)

ELMTUI.VIEW.BASE-ELEMENTS:BASE-DSL-ERROR

Kinds: type

Public base dsl error type used to represent structured asynchronous tasks, styles or UI elements.

ELMTUI.VIEW.BASE-ELEMENTS:BASE-DSL-P

Kinds: function

Report whether a value is a valid base declarative UI expression.

ELMTUI.VIEW.BASE-ELEMENTS:BASE-ELEMENT

Kinds: type

Abstract *stateless* layout element.  Concrete
  subclasses add their own slots but never mutate them after
  initialisation.

ELMTUI.VIEW.BASE-ELEMENTS:BASE-ELEMENT-P

Kinds: function

Report whether an object is an ElmTUI base UI element.

ELMTUI.VIEW.BASE-ELEMENTS:COMPUTE-LAYOUT

Kinds: function

Idempotent layout: if the resulting rect matches, return NODE; else return LAID.

ELMTUI.VIEW.BASE-ELEMENTS:CONTAINER-ELEMENT

Kinds: type

Generic layout container holding *children*.  All
  sizing / spacing attributes are purely declarative.

ELMTUI.VIEW.BASE-ELEMENTS:COPY-ELEMENT

Kinds: function

Create a copy of a UI element, preserving its declared properties.

ELMTUI.VIEW.BASE-ELEMENTS:DESCRIBE-ELEMENT-TYPE

Kinds: function

Return descriptive metadata for an element type in the UI DSL.

ELMTUI.VIEW.BASE-ELEMENTS:DSL->OBJECTS

Kinds: function

Translate an Elm-TUI style DSL (a plist/tree of keywords) into
   concrete instances of BASE-ELEMENT subclasses.

   • strings / numbers are left untouched
   • a list that begins with a keyword denotes *one* element
   • a proper list whose first item is *not* a keyword is treated
     as a sequence of sibling elements

ELMTUI.VIEW.BASE-ELEMENTS:DSL-CHILDREN

Kinds: function

Return child DSL forms belonging to the supplied element declaration.

ELMTUI.VIEW.BASE-ELEMENTS:DSL-ELEMENT-TYPE

Kinds: function

Return the element-type keyword encoded in a DSL form.

ELMTUI.VIEW.BASE-ELEMENTS:DSL-PROPERTIES

Kinds: function

Return the property list encoded in a DSL element declaration.

ELMTUI.VIEW.BASE-ELEMENTS:DSL-STATISTICS

Kinds: function

Summarize element kinds and counts in a DSL tree.

ELMTUI.VIEW.BASE-ELEMENTS:ELEMENT-CHILDREN

Kinds: function

Return the children recorded in the element representation.

ELMTUI.VIEW.BASE-ELEMENTS:ELEMENT-CLASS

Kinds: function

Return the concrete CLOS class that implements TYPE, or NIL.

ELMTUI.VIEW.BASE-ELEMENTS:ELEMENT-CONTENT-MODEL

Kinds: function

Return the content model recorded in the element representation.

ELMTUI.VIEW.BASE-ELEMENTS:ELEMENT-ID

Kinds: function

Return the id recorded in the element representation.

ELMTUI.VIEW.BASE-ELEMENTS:ELEMENT-LAYOUT

Kinds: function

Return the layout recorded in the element representation.

ELMTUI.VIEW.BASE-ELEMENTS:ELEMENT-LAYOUT-RECT

Kinds: function

Return the layout rect recorded in the element representation.

ELMTUI.VIEW.BASE-ELEMENTS:ELEMENT-SIZE

Kinds: function

Return the size recorded in the element representation.

ELMTUI.VIEW.BASE-ELEMENTS:ELEMENT-STYLE

Kinds: function

Return the style recorded in the element representation.

ELMTUI.VIEW.BASE-ELEMENTS:ELEMENT-TYPE-P

Kinds: function

Report whether the given element has the expected type.

ELMTUI.VIEW.BASE-ELEMENTS:EXPAND-BASE-DSL

Kinds: function

Expand a base DSL declaration into element data for the rendering tree.

ELMTUI.VIEW.BASE-ELEMENTS:EXPAND-DSL-ELEMENT

Kinds: function

Expand a single DSL element and its child declarations.

ELMTUI.VIEW.BASE-ELEMENTS:FIND-ELEMENT-BY-ID

Kinds: function

Find an element with the requested identifier in a descendant tree.

ELMTUI.VIEW.BASE-ELEMENTS:FIND-ELEMENTS-BY-TYPE

Kinds: function

Find descendant elements of the requested element type.

ELMTUI.VIEW.BASE-ELEMENTS:MAKE-DSL-ELEMENT

Kinds: function

Construct a declarative UI element from its type and properties.

ELMTUI.VIEW.BASE-ELEMENTS:MAP-DSL-ELEMENTS

Kinds: function

Recursively apply FUNCTION to each node in the DSL tree, transforming it.
   Returns a new, transformed tree.

ELMTUI.VIEW.BASE-ELEMENTS:MAP-ELEMENTS

Kinds: function

Apply FN to ELEMENT and recurse into CHILDREN (depth-first).

ELMTUI.VIEW.BASE-ELEMENTS:NORMALIZE-BASE-DSL

Kinds: function

Normalize a base UI DSL form to its canonical representation.

ELMTUI.VIEW.BASE-ELEMENTS:RECT=

Kinds: function

Return true when rectangles A and B are equal within EPSILON tolerance.

ELMTUI.VIEW.BASE-ELEMENTS:SEPARATOR-ELEMENT

Kinds: type

Visual line used to divide regions.

ELMTUI.VIEW.BASE-ELEMENTS:SEPARATOR-ORIENTATION

Kinds: function

Return the orientation recorded in the separator representation.

ELMTUI.VIEW.BASE-ELEMENTS:SEPARATOR-THICKNESS

Kinds: function

Return the thickness recorded in the separator representation.

ELMTUI.VIEW.BASE-ELEMENTS:SET-ELEMENT-LAYOUT

Kinds: function

Assign computed layout information to a rendered UI element.

ELMTUI.VIEW.BASE-ELEMENTS:SPACER-ELEMENT

Kinds: type

Empty area for fine-grained layout control.

ELMTUI.VIEW.BASE-ELEMENTS:SPACER-HEIGHT

Kinds: function

Return the height recorded in the spacer representation.

ELMTUI.VIEW.BASE-ELEMENTS:SPACER-WIDTH

Kinds: function

Return the width recorded in the spacer representation.

ELMTUI.VIEW.BASE-ELEMENTS:TEXT-ALIGN

Kinds: function

Return the align recorded in the text representation.

ELMTUI.VIEW.BASE-ELEMENTS:TEXT-COLOR

Kinds: function

Return the color recorded in the text representation.

ELMTUI.VIEW.BASE-ELEMENTS:TEXT-CONTENT

Kinds: function

Return the content recorded in the text representation.

ELMTUI.VIEW.BASE-ELEMENTS:TEXT-ELEMENT

Kinds: type

Plain text node.

ELMTUI.VIEW.BASE-ELEMENTS:TEXT-WRAP

Kinds: function

Return the wrap recorded in the text representation.

ELMTUI.VIEW.BASE-ELEMENTS:TO-DSL

Kinds: function

Render ELEMENT back to the canonical DSL plist
  representation (keywords + properties). Useful for debugging or
  when external code still assumes the old representation.

ELMTUI.VIEW.BASE-ELEMENTS:UPDATE-DSL-ELEMENT

Kinds: function

Update a declarative element with the supplied changed properties.

ELMTUI.VIEW.BASE-ELEMENTS:VALID-PROPERTY-P

Kinds: function

Checks if PROPERTY is a valid initarg for the class corresponding to ELEMENT-TYPE.

ELMTUI.VIEW.BASE-ELEMENTS:VALIDATE-BASE-DSL

Kinds: function

Validate class-backed base DSL nodes (objects or keyword-form elements).

ELMTUI.VIEW.BASE-ELEMENTS:VALIDATE-CHILDREN

Kinds: function

Validate whether the supplied child elements satisfy their parent model.

ELMTUI.VIEW.BASE-ELEMENTS:VALIDATE-CONTENT-MODEL

Kinds: function

Validate an element's allowed content model and constraints.

ELMTUI.VIEW.BASE-ELEMENTS:VALIDATE-DSL-ELEMENT

Kinds: function

Validate one keyword-form DSL element.

ELMTUI.VIEW.BASE-ELEMENTS:VALIDATE-DSL-TREE

Kinds: function

Validate structural correctness of a nested declarative UI tree.

ELMTUI.VIEW.CORE:APPLY-DIFF

Kinds: function

Apply a view diff to a node.

ELMTUI.VIEW.CORE:DEFVIEW

Kinds: macro

Define a pure view function: Model → UiTree.
   Contract: view returns a tree of ui-node objects.

ELMTUI.VIEW.CORE:VIEW-DIFF

Kinds: function

Compatibility-only whole-tree replacement operation, not a minimal diff.
The terminal's *buffer differ* is a distinct optimized facility. This view
function ignores OLD-NODE and returns a closure replacing any supplied tree
with NEW-NODE; use the renderer for efficient physical terminal changes.

ELMTUI.VIEW.CORE:WITH-ARIA

Kinds: macro

Add ARIA attributes to NODE.

ELMTUI.VIEW.CORE:WITH-CHILDREN

Kinds: macro

Set children of NODE.

ELMTUI.VIEW.CORE:WITH-PROPS

Kinds: macro

Add or override properties on NODE.

ELMTUI.VIEW.CORE:WITH-VIEW-CONTEXT

Kinds: macro

Establish a view context with default properties.

ELMTUI.VIEW.DSL:DEFCOMPONENT-DSL

Kinds: macro

Register a new DSL component type and define a helper function for node creation.

DSL-TYPE is a keyword representing the component type (e.g., :root-viewport).
CLASS-NAME is the symbol naming the class associated with this component.

This macro:
+ Defines a dsl-type method for DSL-TYPE that returns CLASS-NAME.
+ Defines a helper function named DSL-TYPE-VIEW (e.g., ROOT-VIEWPORT-VIEW) that constructs a DSL node of this type.
+ Exports the helper function from the current package.

The generated helper function has the signature:
  (DSL-TYPE-VIEW id &rest args &key &allow-other-keys)
where:
  id   -- the identifier for the DSL node
  args -- additional keyword arguments for the node

Example:
  (defcomponent-dsl :root-viewport elmtui.view.base-elements:RootViewport)
  (ROOT-VIEWPORT-VIEW "main" :width 800 :height 600)
  ;; => (:ROOT-VIEWPORT :ID "main" :WIDTH 800 :HEIGHT 600)

This macro is useful for building extensible DSLs, especially for UI or data structure construction.

ELMTUI.VIEW.DSL:DSL->UI-NODE

Kinds: function

No documentation metadata.

ELMTUI.VIEW.DSL:RENDER-DSL-TO-RESOLVED-TREE

Kinds: function

Resolve DSL to a tree. Only recurse into *children*. Prop values are opaque data.
   Treat a list as a DSL node only if its head keyword is a *known* DSL tag.

ELMTUI.VIEW.ELEMENT:EL/CHILDREN

Kinds: function

Return or replace children of a BASE-ELEMENT via the element protocol.

ELMTUI.VIEW.ELEMENT:EL/CONTENT

Kinds: function

Return the text/content slot exposed by an element; for text elements this is the text-content slot.

ELMTUI.VIEW.ELEMENT:EL/DISPLAY

Kinds: function

Return the element's :DISPLAY style property or :BLOCK when no explicit display style is set.

ELMTUI.VIEW.ELEMENT:EL/ID

Kinds: function

Return the application-defined identity associated with an element instance.

ELMTUI.VIEW.ELEMENT:EL/LAYOUT-RECT

Kinds: function

Return the assigned layout rectangle or NIL before layout; NIL must not be confused with a zero-sized rectangle.

ELMTUI.VIEW.ELEMENT:EL/PROPS

Kinds: function

Return a plist of bound declarative slot values, excluding internal children, layout and content bookkeeping.

ELMTUI.VIEW.ELEMENT:EL/SIZE

Kinds: function

Return or assign the element's intrinsic sizing record; a two-element list is accepted by the setter.

ELMTUI.VIEW.ELEMENT:EL/STYLES

Kinds: function

Return or replace the style plist of an element instance.

ELMTUI.VIEW.ELEMENT:EL/STYLES-OF

Kinds: function

Look up one named style property in an element's style plist or a raw plist; return DEFAULT if absent.

ELMTUI.VIEW.ELEMENT:EL/TYPE

Kinds: function

Return the declarative element type associated with an element object.

ELMTUI.VIEW.ELEMENT:ELEMENT-P

Kinds: function

Return true for instances of BASE-ELEMENT and false for arbitrary non-element values.

ELMTUI.VIEW.ELEMENT:ENSURE-ELEMENT

Kinds: function

Return X if element-p, otherwise try to adapt or error.

ELMTUI.VIEW.ELEMENT:INTRINSIC-SIZE-OF

Kinds: function

Return a SIZE for NODE based on its content (text length, etc.).

ELMTUI.VIEW.ELEMENT:WITH-ELEMENT

Kinds: macro

Assert OBJ is an element (via protocol); bind VAR to OBJ for BODY.

ELMTUI.VIEW.GEO:=?

Kinds: function

Generic equality check. Adapts behavior based on type.

ELMTUI.VIEW.GEO:AREA

Kinds: function

AREA (OBJ)
Arguments: OBJ -- a size or rectangle
Returns: Area as integer
Example: (area (make-size :w 3 :h 4)) ; => 12
Type: (size|rectangle) => integer
Side-effects: None
Calculate the area of the object (size or rectangle).

ELMTUI.VIEW.GEO:AREA<

Kinds: function

Check if the area of obj1 is less than the area of obj2.

ELMTUI.VIEW.GEO:BORDER

Kinds: function

Return a list of border rectangles within RECTANGLE, optionally selecting :TOP, :BOTTOM, :LEFT or :RIGHT and WIDTH. The :ALL case excludes NIL intersections; invalid side signals an error.

ELMTUI.VIEW.GEO:CLAMP

Kinds: function

Clamps VALUE to be within the range [MIN, MAX].

ELMTUI.VIEW.GEO:CONTAINS-P

Kinds: function

Test whether a rectangle contains a position, two-element (x y) list, or another rectangle. Point right/bottom bounds are exclusive; a contained rectangle uses its full extents.

ELMTUI.VIEW.GEO:CORNER

Kinds: function

Return a new POS at the selected rectangle corner :TOP-LEFT, :TOP-RIGHT, :BOTTOM-LEFT or :BOTTOM-RIGHT. Invalid corner signals an error.

ELMTUI.VIEW.GEO:DIM

Kinds: function

DIM (OBJ DIMENSION)
Arguments: OBJ -- pos, size, or rectangle; DIMENSION -- :x, :y, :w, :h, 0, or 1
Returns: Value of the specified dimension
Type: (pos|size|rectangle, keyword|integer) => integer
Side-effects: None
Get the value of a specific dimension for pos, size, or rectangle.

ELMTUI.VIEW.GEO:DIM-LENGTH

Kinds: function

DIM-LENGTH (RECTANGLE DIMENSION)
Arguments: RECTANGLE -- rectangle, DIMENSION -- :w or :h
Returns: Value of the length component
Type: (rectangle, keyword|integer) => integer
Side-effects: None
Get the length component (:w or :h) of a rectangle's dimension.

ELMTUI.VIEW.GEO:DIM-POS

Kinds: function

DIM-POS (RECTANGLE DIMENSION)
Arguments: RECTANGLE -- rectangle, DIMENSION -- :x or :y
Returns: Value of the position component
Type: (rectangle, keyword|integer) => integer
Side-effects: None
Get the position component (:x or :y) of a rectangle's dimension.

ELMTUI.VIEW.GEO:GROW-VIEW!

Kinds: function

Mutate RECTANGLE using RESIZE-DIMENSION! with positive AMOUNT on SIDE. The actual edge adjustment follows RESIZE-DIMENSION!; inspect :LEFT/:TOP semantics rather than assuming an outward move.

ELMTUI.VIEW.GEO:H

Kinds: function

H (OBJ)
Arguments: OBJ -- a size or rectangle
Returns: Height as integer
Type: (size|rectangle) => integer
Side-effects: None
Get the height of the object (size or rectangle).

ELMTUI.VIEW.GEO:LINE

Kinds: function

Return a one-cell-thick bounding rectangle through two POS endpoints, including both endpoints. Diagonal points signal an error.

ELMTUI.VIEW.GEO:MAKE-POS

Kinds: function

Construct a POS with :X and :Y coordinates, defaulting both to zero. Coordinates use nonnegative integer slots.

ELMTUI.VIEW.GEO:MAKE-RECTANGLE

Kinds: function

Construct a RECTANGLE with :POS and :SIZE slots. Each defaults to the corresponding zero-valued structure.

ELMTUI.VIEW.GEO:MAKE-SIZE

Kinds: function

Construct a SIZE with nonnegative integer :W width and :H height slots, defaulting to zero.

ELMTUI.VIEW.GEO:MOVE!

Kinds: function

Move the object to absolute (x, y) then by relative (dx, dy) (mutating).

ELMTUI.VIEW.GEO:NORMALIZE!

Kinds: function

Adjust a rectangle with negative width or height by shifting its origin and negating the affected dimension; return the mutated rectangle.

ELMTUI.VIEW.GEO:OVERLAP

Kinds: function

Return a newly constructed rectangle for the positive-area intersection of R1 and R2, or NIL if their interiors do not intersect.

ELMTUI.VIEW.GEO:POS

Kinds: function, type

POS (OBJ)
Arguments: OBJ -- a rectangle
Returns: The pos struct of the rectangle
Type: (rectangle) => pos
Side-effects: None
Get the pos struct of the object (rectangle).

ELMTUI.VIEW.GEO:POS-X

Kinds: function

Read the X coordinate of a POS. Its nonnegative integer slot may be updated through (SETF POS-X) .

ELMTUI.VIEW.GEO:POS-Y

Kinds: function

Read the Y coordinate of a POS. Its nonnegative integer slot may be updated through (SETF POS-Y) .

ELMTUI.VIEW.GEO:RECT-DIFF

Kinds: function

Return zero to four rectangles covering the area of R1 outside its intersection with R2. Without overlap, return a list containing R1.

ELMTUI.VIEW.GEO:RECTANGLE

Kinds: type

A RECTANGLE struct represents a rectangle in 2D space.
Arguments: SIZE, POS
Fields:
  SIZE -- A size struct (width/height)
  POS -- A pos struct (x/y)
Example: (make-rectangle :pos (make-pos :x 1 :y 2) :size (make-size :w 3 :h 4))
Type: (rectangle)
Side-effects: None

ELMTUI.VIEW.GEO:RECTANGLE-POS

Kinds: function

Read the POS structure owned by a RECTANGLE. Mutating its slots changes the rectangle origin.

ELMTUI.VIEW.GEO:RECTANGLE-SIZE

Kinds: function

Read the SIZE structure owned by a RECTANGLE. Mutating its slots changes the rectangle dimensions.

ELMTUI.VIEW.GEO:RECTANGLE-UNION

Kinds: function

Return a new bounding rectangle enclosing two input rectangles; this is a bounding box, not a disjoint-region union.

ELMTUI.VIEW.GEO:RECTANGLE-UNION-LIST

Kinds: function

Calculate the union of a list of rectangles.

ELMTUI.VIEW.GEO:RESIZE-DIMENSION!

Kinds: function

Mutate a rectangle edge selected by :SIDE and :AMOUNT. :RIGHT/:BOTTOM add amount to width/height; :LEFT/:TOP shift the origin by amount and subtract it from width/height. Negative resulting dimensions signal an error.

ELMTUI.VIEW.GEO:SHRINK-VIEW!

Kinds: function

Call RESIZE-DIMENSION! with negated AMOUNT on the selected side and return the same rectangle, mutated.

ELMTUI.VIEW.GEO:SIZE

Kinds: function, type

SIZE (OBJ)
Arguments: OBJ -- a rectangle
Returns: The size struct of the rectangle
Type: (rectangle) => size
Side-effects: None
Get the size struct of the object (rectangle).

ELMTUI.VIEW.GEO:VALID-P

Kinds: function

Check if the object (size or rectangle) is valid (non-negative dimensions).

ELMTUI.VIEW.GEO:W

Kinds: function

W (OBJ)
Arguments: OBJ -- a size or rectangle
Returns: Width as integer
Type: (size|rectangle) => integer
Side-effects: None
Get the width of the object (size or rectangle).

ELMTUI.VIEW.GEO:X

Kinds: function

X (OBJ)
Arguments: OBJ -- a pos or rectangle
Returns: X coordinate as integer
Type: (pos|rectangle) => integer
Side-effects: None
Get the x-coordinate of the object (pos or rectangle).

ELMTUI.VIEW.GEO:X2

Kinds: function

X2 (RECTANGLE)
Arguments: RECTANGLE -- rectangle
Returns: X2 coordinate (x + width)
Type: (rectangle) => integer
Side-effects: None
Get the x2 coordinate (x + width) of the rectangle.

ELMTUI.VIEW.GEO:Y

Kinds: function

Y (OBJ)
Arguments: OBJ -- a pos or rectangle
Returns: Y coordinate as integer
Type: (pos|rectangle) => integer
Side-effects: None
Get the y-coordinate of the object (pos or rectangle).

ELMTUI.VIEW.GEO:Y2

Kinds: function

Y2 (RECTANGLE)
Arguments: RECTANGLE -- rectangle
Returns: Y2 coordinate (y + height)
Type: (rectangle) => integer
Side-effects: None
Get the y2 coordinate (y + height) of the rectangle.

ELMTUI.VIEW.LAYOUT:DISPATCH-LAYOUT

Kinds: function

Dispatches to the appropriate layout algorithm based on display type.

  DISPLAY is a keyword (e.g., :grid, :flex) or NIL for block fallback.
  NODE is the element to layout.
  AVAILABLE-RECT is the rectangle available for NODE.
  PARENT-STYLES is the style plist of the parent element, if needed for layout
  algorithms.

ELMTUI.VIEW.LAYOUT:LAYOUT-NODE

Kinds: function

Compute layout for NODE within AVAILABLE-RECT.

ELMTUI.VIEW.LAYOUT:STYLE-VALUE

Kinds: function

No documentation metadata.

ELMTUI.VIEW.LAYOUT.FLEX:COMPUTE-FLEX-LAYOUT

Kinds: function

No documentation metadata.

ELMTUI.VIEW.LAYOUT.FLEX:CONTENT-BOX

Kinds: function

Content box = outer minus border and paddings (margins are external).

ELMTUI.VIEW.LAYOUT.GRID:COMPUTE-GRID-LAYOUT

Kinds: function

No documentation metadata.

ELMTUI.VIEW.LAYOUT.SIZE-UTILS:COMPUTE-LAYOUT

Kinds: function

Compute the layout for a node based on its style and available rect.
   Returns the node with its layout rect set.

ELMTUI.VIEW.LAYOUT.SIZE-UTILS:COMPUTE-SIZE

Kinds: function

Compute border-box size for EL under optional parent CONTENT size (size struct).

ELMTUI.VIEW.LAYOUT.SIZE-UTILS:CONTENT-RECT-OF

Kinds: function

Return ELEMENT’s content box rectangle given its OUTER-RECT.
  OUTER-RECT is a border-box; this subtracts paddings and borders from OUTER-RECT
  and returns the inner content rectangle used for child layout. Does not perform
  any measurement; purely geometric.

ELMTUI.VIEW.LAYOUT.SIZE-UTILS:MEASURE-NODE-INTRINSIC-SIZE

Kinds: function

Return 4 values: (minw maxw minh maxh). Never NIL.
   Rules:
   - number         → that number (clamped)
   - "NN%"        → NN% of container axis (clamped), non-numeric container ⇒ 0
   - :auto | :fill → min-content (min-width/min-height)
   - text           → width≈string length (or wrapped to container-w); height≥1

ELMTUI.VIEW.LAYOUT.SIZE-UTILS:TERMINAL-GLYPH-WIDTH

Kinds: function

Conservative wcwidth-like width shared by layout, painter and diff.
Grapheme clusters with ZWJ/emoji modifiers require a separate cluster model.

ELMTUI.VIEW.LAYOUT.SIZE-UTILS:TERMINAL-GRAPHEMES

Kinds: function

Return ordered (STRING . CELL-WIDTH) clusters.
Handles combining/variation marks, emoji modifiers, ZWJ sequences and paired
regional indicators. Widths are terminal estimates; font-specific shaping
is outside a portable TUI's control.

ELMTUI.VIEW.LAYOUT.SIZE-UTILS:TERMINAL-STRING-SLICE

Kinds: function

Slice a single line by display cells in [START, END), preserving graphemes.
A wide cluster cut at either boundary becomes spaces. Tabs use eight-cell stops;
a newline ends the line. END defaults to the line's display width.

ELMTUI.VIEW.LAYOUT.SIZE-UTILS:TERMINAL-STRING-WIDTH

Kinds: function

Measure the widest line's display cells, with conventional tab stops.

ELMTUI.VIEW.MEMO:CLEAR-MEMOIZATION-CACHE

Kinds: function

Invalidate memoized results. With FUNCTION, clear that original function's
or wrapper's MEMO caches; without FUNCTION, clear all MEMO and MEMOIZE caches.
Existing wrappers stay callable and their hit/miss statistics are retained.

ELMTUI.VIEW.MEMO:DEFINE-MEMOIZED-COMPONENT

Kinds: macro

Define a memoized component

ELMTUI.VIEW.MEMO:DEFMEMO

Kinds: macro

Define a memoized function

ELMTUI.VIEW.MEMO:MEMO

Kinds: function

Return a memoizing wrapper around FN, caching its primary return value.

:KEY receives a list of FN's arguments and defaults to IDENTITY; :TEST is
the hash-table equality predicate and defaults to EQUAL. Each wrapper has its
own cache. Repeated argument keys return the cached primary value, including
NIL; multiple return values are not preserved. With memoization disabled,
FN executes normally and no entry is cached.

CLEAR-MEMOIZATION-CACHE accepts either FN or the returned wrapper, or no
argument to invalidate every live wrapper. Hit/miss statistics for FN remain
available separately.

ELMTUI.VIEW.MEMO:MEMOIZE

Kinds: function

Memoize a one-argument component with PROPS in the legacy shared cache.
When memoization is disabled, invoke COMPONENT without storing the result.
The legacy :TEST keyword is accepted but the shared cache uses EQUAL.

ELMTUI.VIEW.MEMO:MEMOIZE-COMPONENT

Kinds: function

Wrap COMPONENT while retaining its first PROPS argument as one argument.
Additional arguments are forwarded unchanged. Cache invalidation accepts
the original function or the returned wrapper.

ELMTUI.VIEW.MEMO:WITH-MEMO-STATS

Kinds: macro

Execute BODY and optionally report memoization statistics

ELMTUI.VIEW.MEMO:WITH-MEMOIZATION

Kinds: macro

Execute BODY with memoization enabled

ELMTUI.VIEW.POSITION:COPY-ELEMENT-GRID-COORDINATES

Kinds: function

Return a distinct copy of an element grid coordinate structure, preserving row, column and spans.

ELMTUI.VIEW.POSITION:COPY-ELEMENT-POSITION

Kinds: function

Return a distinct copy of an element's absolute position and dimensions.

ELMTUI.VIEW.POSITION:DIRECTION-TO-POSITION

Kinds: function

Determines the primary direction from one position to another.
Returns one of :up, :down, :left, :right, or nil if positions are identical.

ELMTUI.VIEW.POSITION:ELEMENT-GRID-COORDINATES

Kinds: function, type

Get the grid coordinates for a UI element.
Returns an element-grid-coordinates struct or nil if grid position is not available.

ELMTUI.VIEW.POSITION:ELEMENT-GRID-COORDINATES-COL

Kinds: function

Read or set the starting zero-based grid column in an element grid coordinate record.

ELMTUI.VIEW.POSITION:ELEMENT-GRID-COORDINATES-COL-SPAN

Kinds: function

Read or set the number of grid columns occupied by an element; defaults to one.

ELMTUI.VIEW.POSITION:ELEMENT-GRID-COORDINATES-ROW

Kinds: function

Read or set the starting zero-based grid row in an element grid coordinate record.

ELMTUI.VIEW.POSITION:ELEMENT-GRID-COORDINATES-ROW-SPAN

Kinds: function

Read or set the number of grid rows occupied by an element; defaults to one.

ELMTUI.VIEW.POSITION:ELEMENT-POSITION

Kinds: function, type

Get the position data for a UI element.
Returns an element-position struct or nil if position is not available.

ELMTUI.VIEW.POSITION:ELEMENT-POSITION-BOTTOM

Kinds: function

Get the bottom edge y-coordinate of the element position.

ELMTUI.VIEW.POSITION:ELEMENT-POSITION-CENTER-X

Kinds: function

Get the horizontal center coordinate of the element position.

ELMTUI.VIEW.POSITION:ELEMENT-POSITION-CENTER-Y

Kinds: function

Get the vertical center coordinate of the element position.

ELMTUI.VIEW.POSITION:ELEMENT-POSITION-HEIGHT

Kinds: function

Read or set an element's height in its absolute rectangle, in terminal-cell coordinates.

ELMTUI.VIEW.POSITION:ELEMENT-POSITION-RIGHT

Kinds: function

Get the right edge x-coordinate of the element position.

ELMTUI.VIEW.POSITION:ELEMENT-POSITION-WIDTH

Kinds: function

Read or set an element's width in its absolute rectangle, in terminal-cell coordinates.

ELMTUI.VIEW.POSITION:ELEMENT-POSITION-X

Kinds: function

Read or set an element rectangle's leftmost x coordinate, in terminal-cell units.

ELMTUI.VIEW.POSITION:ELEMENT-POSITION-Y

Kinds: function

Read or set an element rectangle's topmost y coordinate, in terminal-cell units.

ELMTUI.VIEW.POSITION:FIND-NEAREST-IN-DIRECTION

Kinds: function

Finds the nearest element in the given direction from the from-element.
elements: List of UI elements with position information
from-element: The reference element
direction: One of :up, :down, :left, :right
Returns: The nearest element in that direction or nil if none found

ELMTUI.VIEW.POSITION:MAKE-ELEMENT-GRID-COORDINATES

Kinds: function

Create an element grid coordinate record with :ROW, :COL, :ROW-SPAN and :COL-SPAN; defaults are 0, 0, 1, 1.

ELMTUI.VIEW.POSITION:MAKE-ELEMENT-POSITION

Kinds: function

Create an absolute element rectangle from optional :X, :Y, :WIDTH and :HEIGHT integer fields, defaulting to zero.

ELMTUI.VIEW.POSITION:POSITION-CONTAINS-P

Kinds: function

Returns true if container-pos fully contains element-pos.

ELMTUI.VIEW.POSITION:POSITION-DISTANCE

Kinds: function

Calculates the Euclidean distance between the centers of two positions.

ELMTUI.VIEW.POSITION:POSITIONS-OVERLAP-P

Kinds: function

Returns true if the two positions overlap.

ELMTUI.VIEW.REACTIVE:BOUNCE

Kinds: function

No documentation metadata.

ELMTUI.VIEW.REACTIVE:CREATE-ANIMATION

Kinds: function

Creates and registers a new animation.

   DURATION: Duration in seconds.
   UPDATE-FN: Function called on each frame with progress (0.0-1.0).
   EASING-FN: Optional easing function to transform progress.
   COMPLETE-FN: Optional function called when animation completes.

   Returns the animation structure.

ELMTUI.VIEW.REACTIVE:CREATE-REACTIVE-VIEW

Kinds: function

Creates a new reactive view that updates when its dependencies change.

   ID: Unique identifier for the view.
   APP-STATE: The application state to observe.
   RENDER-FN: Function that renders the view (app-state -> ui-node).

   Returns the reactive-view instance.

ELMTUI.VIEW.REACTIVE:EASE-IN

Kinds: function

No documentation metadata.

ELMTUI.VIEW.REACTIVE:EASE-IN-OUT

Kinds: function

No documentation metadata.

ELMTUI.VIEW.REACTIVE:EASE-OUT

Kinds: function

No documentation metadata.

ELMTUI.VIEW.REACTIVE:ELASTIC

Kinds: function

No documentation metadata.

ELMTUI.VIEW.REACTIVE:INVALIDATE-VIEW

Kinds: function

Mark VIEW invalid and enqueue one debounced render request.

Observer callbacks call this function directly, outside the Elm command
interpreter.  The debounce therefore uses CL-EVENTS.ASYNC:SCHEDULE-AFTER rather
than constructing a CMD-ASYNC value that nobody would execute.

Returns the active debounce thread when one is pending, otherwise NIL.

ELMTUI.VIEW.REACTIVE:LINEAR-EASING

Kinds: function

No documentation metadata.

ELMTUI.VIEW.REACTIVE:MAKE-VIEW-TASK

Kinds: function

Creates a task function that handles rendering for a reactive view.

   VIEW: The reactive-view instance.
   DISPATCH-FN: Function to dispatch messages from the view.

   Returns a function that can be run in a worker thread.

ELMTUI.VIEW.REACTIVE:NEXT-FRAME-CMD

Kinds: function

Return a command that asynchronously sleeps for 1/FPS seconds, then emits MESSAGE.
   Use via (nconc commands (list (reactive:next-frame-cmd :fps 60 :message :tick))).

ELMTUI.VIEW.REACTIVE:PROCESS-ANIMATIONS

Kinds: function

Processes all active animations, updating their progress.
   Should be called on each frame with the time elapsed since the last frame.

ELMTUI.VIEW.REACTIVE:REGISTER-VIEW-DEPENDENCY

Kinds: function

Registers a state path that the view depends on.
   When the state at this path changes, the view will be invalidated.

   VIEW: The reactive-view instance.
   STATE-PATH: A keyword, symbol, or list representing the path in the app-state.

ELMTUI.VIEW.REACTIVE:VIEW-INVALIDATED-P

Kinds: function

No documentation metadata.

ELMTUI.VIEW.REACTIVE:WITH-REACTIVE-RENDERING

Kinds: macro

Executes body with a reactive view that updates when its dependencies change.

   VIEW-VAR: Symbol to bind to the reactive view instance.
   APP-STATE: The application state to observe.
   RENDER-FN: Function that renders the view (app-state -> ui-node).
   DISPATCH-FN: Function to dispatch messages from the view.
   DEPENDENCIES: List of state paths that the view depends on.

   Example:
     (with-reactive-rendering (counter-view app-state #'render-counter dispatch-fn
                                          :dependencies '(counter-model))
       (add-view-to-layout counter-view main-layout)
       (process-events))

ELMTUI.VIEW.STYLED:APPLY-STYLESHEET-TO-TREE

Kinds: function

Recursively applies styles from STYLESHEET to NODE and its descendants.
    Returns a NEW tree of styled-ui-nodes with styles computed.
    PARENT is the already processed parent for the current NODE.

ELMTUI.VIEW.STYLED:STYLED-UI-NODE

Kinds: type

UI node after stylesheet cascade expansion and normalisation.

ELMTUI.VIEW.STYLED:UI-NODE-CHILDREN

Kinds: function

No documentation metadata.

ELMTUI.VIEW.STYLED:UI-NODE-PROPS

Kinds: function

No documentation metadata.

ELMTUI.VIEW.TREE-TRANSFORMS:LAYOUT-TREE-TOP-DOWN

Kinds: function

Top-down layout: lay out NODE in PARENT-RECT; recurse passing each CHILD'S OWN rect.
   Critical: each child receives its own computed rect, not the parent's rect. If a child
   rect is missing, fall back to the parent's content box once.

ELMTUI.VIEW.TREE-TRANSFORMS:PROCESS-TREE

Kinds: function

Pipeline: resolve → expand styles → measure(top-down) → layout(top-down) → mark-dirty.

   Return the fully processed tree or NIL if resolution failed.

   ARGS:
     ROOT - root node of the tree to process
     :CTX - application context (elmtui.contracts:app-context)
     :ROOT-RECT - rectangle to use as the root layout rectangle; if NIL,
                  ctx.viewport-rect is used.

   STEPS:
     1) Resolve components: convert DSL to base-element instances
     2) Expand element styles: normalize style plists
     3) Measure tree top-down: compute intrinsic sizes
     4) Layout tree top-down: compute layout rects
     5) Mark dirty nodes: flag nodes that changed during processing

   NOTES:
     - If a stylesheet is present in CTX, apply it after style expansion.
     - If ROOT-RECT is not provided, CTX's viewport rectangle is used.
     - If component resolution fails (returns NIL), the entire process aborts
       and NIL is returned.

   RETURNS:
     The fully processed tree with layout information, or NIL if resolution failed.

ELMTUI.VIEW.TREE-TRANSFORMS:RESOLVE-COMPONENTS

Kinds: function

Normalize NODE to object tree: if it's already a base-element tree, return it;
   if it's DSL, resolve components and convert to objects.