How benjcal/zltt works
ZLTT is a Lua-scriptable text UI: a user launches a Lua program, which uses the host’s text-output API while the application renders the interface and forwards key events to the script. The README documents multiline main text, a bottom-line subtitle, and keydown callbacks. Source excerpts cover only the Cairo/SDL bridge, so internal Zig call wiring is necessarily conservative.
Main entry points: app.zig Application · lua.zig Lua bridge · cairo.zig Cairo layer · cairosdl.c Cairo-SDL bridge
Components 15
Zig host
- Program entry
src/main.zig - Application
src/app.zig - Lua bridge
src/lua.zig - C bindings
src/c.zig
Lua programs
- Lua API
lua/init.lua - Todo example
lua/examples/todo/init.lua - RPN example
lua/examples/rpn/init.lua
Rendering
- SDL layer
src/sdl.zig - Cairo layer
src/cairo.zig - Cairo-SDL bridge
libs/cairosdl/cairosdl.c
Other components
- User
- LuaJIT
- SDL2
- Cairo
- fontconfig
Connections 17
- User → Program entry: launches
- Program entry → Application: starts
- Application → Lua bridge: uses
- Lua bridge → LuaJIT: embeds
- Lua bridge → Lua API: exposes
- User → Todo example: runs example
- User → RPN example: runs example
- Todo example → Lua API: uses API
- RPN example → Lua API: uses API
- Application → SDL layer: renders with
- Application → Lua bridge: forwards keydown
- SDL layer → SDL2: uses
- Cairo layer → Cairo: uses
- Cairo layer → Cairo-SDL bridge: uses
- Cairo-SDL bridge → SDL2: binds surfaces
- Cairo-SDL bridge → Cairo: creates surfaces
- Cairo layer → fontconfig: loads fonts