Join GitHub today
TUI is a developer facing API built upon the SHMIF libraries in order to provide a stable interface (SHMIF itself isn't intended to be used directly outside the Arcan project) for creating text-oriented applications while taking advantage of most of the features exposed by SHMIF.
Its purpose is to provide a middle ground between the common high-level UI frameworks (HTML5, GTK, QT, ...) and glyph-based NCurses/Turbo-Vision like "character-stream" APIs.
The idea and status thus far is covered in two blog posts:
The core argument is that the UI frameworks are much too complex, expensive and complicated to use, while the curses- like text user interfaces lack system integration for things like popups, window decorations, interactive IPC (clipboard, drag and drop, ...), and are error-prone and inefficient due to the weak separation of contents and metadata. The terminal legacy blocks them from having an input model which match the rest of the system, colors lacks semantics and certain keypresses are nothing more than clever guesswork. Race conditions glitches are everywhere, blocking latency improvements, and attaching other media providers to the cell layout, are, at best, unscalable hacks.
There is currently only a single implementation and renderer for the TUI api, and that is the one in shmif/arcan itself. Language bindings for the API itself will be kept / tracked in a separate repository, tui-bindings.
Basic widgets have started to appear; currently a generic text/hex viewer and a list-like component. These can be found in src/shmif/arcan_tui_listwnd.h and arcan_tui_bufferwnd.h respectively.
There are a few key applications that drive the development forward and to help finding rough edges in the API itself. The biggest, and most useful one, at the moment is the built-in terminal emulator. See the source-code in:
While not a particularly complex application, it shows how to get the basic loop and event handlers going.
With documentation still pending, so far, please refer to
for the C library header,
src/tools/ltui for playing around with the Lua
bindings (with documentation in doc/lua-tui.md).
When all components have matured sufficiently, TUI and the related projects will move out of the main Arcan source repository into one of its own.
Big items currently missing are:
- Handover / embed launch for invoking afsrv_decode
- "readline" like widget missing
- Lua bindings incomplete still
- Renderer backend refactor to allow server-side text rendering
- Helper- code for localisation