How rockorager/libvaxis works
libvaxis is a Zig terminal UI library with a low-level terminal API and a higher-level widget framework. A typical framework application supplies a root widget; the framework runtime manages events, focus, mouse handling, and drawing. The low-level API also supports applications that manage their own event loop and screen cells. The README documents terminal capability detection and protocol features. Source excerpts were limited to the C API header, so uncertain internal call relationships are omitted.
Main entry points: Vaxis.zig Low-level API · Loop.zig Event loop · Window.zig Window drawing · Parser.zig Input parser
Components 18
Terminal Runtime
- Low-level API
src/Vaxis.zig - Event loop
src/Loop.zig - TTY access
src/tty.zig - Input parser
src/Parser.zig - Events and keys
src/event.zig
Screen and Graphics
- Screen state
src/Screen.zig - Window drawing
src/Window.zig - Cells and graphemes
src/Cell.zig - Terminal images
src/Image.zig - Unicode width
src/unicode.zig
Widget Framework
- Framework runtime
src/vxfw/App.zig - Framework widgets
src/vxfw - Widgets
src/widgets - Terminal widgets
src/widgets/terminal
Additional APIs
- C API
src/c_api.zig
Other components
- TUI application
- Terminal
- C application
Connections 17
- TUI application → Framework runtime: starts
- Framework runtime → Framework widgets: dispatches
- TUI application → Low-level API: uses
- Low-level API → Event loop: uses
- Event loop → TTY access: reads input
- Event loop → Input parser: parses input
- Input parser → Events and keys: produces
- Terminal → TTY access: input and output
- Low-level API → Screen state: manages
- Screen state → Window drawing: creates
- Window drawing → Cells and graphemes: draws
- Cells and graphemes → Unicode width: uses widths
- Window drawing → Terminal images: draws images
- TUI application → Widgets: may use
- TUI application → Terminal widgets: may use
- C application → C API: calls
- C API → Low-level API: exposes