Skip to content
bjornstahl edited this page Sep 11, 2017 · 7 revisions

TUI

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.

The idea and status thus far is covered in two blog posts:

  1. Dreaming of a terminal-free CLI
  2. Dawn of a new Command Line Interface

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 argument being 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, internationalization, IPC (clipboard, drag and drop, ...), are error-prone and inefficient due to the weak separation of contents/metadata, and legacy ridden due to the reliance on terminal protocols such as vt100.

The core benefits are many when the command-line/shell can take advantage of the features in the shmif API, things like copy/saving/restoring environment state between windows, complex input (Escape doesn't have to become ^ESC), split out into new windows that follow the current window management scheme, having popups that act as popups, more efficient drawing, separating shell input from the normal history (no more gdb prompt), creating pipes between windows even if they are on different systems, custom tagging cells with own metadata, mixing contents like images without crazy encoding schemes, handing over the drawing primitives to new clients plan9- style and so on.

TUIs primary development and testing target right now is the LLDB debugger, the default terminal frameserver and the translators in the Senseye- sister project, along with Lua based bindings.

The big action points for this API are roughly:

  1. Finish basic / intermediate Lua bindings (see tools/ltui for examples on using and integrating).
  2. Split out the graphics and event platforms into a separate library (arcan-abc) that can be used to access system-level graphics and input without the main Arcan server alive.
  3. Patch TUI so that it can use arcan-abc to activate display and input even if there is no display server around.

A command line shell that uses these bindings ('Lash') is also in the process of being developed, which also act as a baseline for testing more advanced features. When those have been brought up a decent level, the API as such will be versioned, documented and split out from the normal code-base into its project.

With documentation still pending, so far, please refer to shmif/arcan_tui.h for the C library header, src/tools/ltui for playing around with the Lua bindings, and tests/frameserver/tui_test for a C based skeleton for the API itself. In addition, the terminal frameserver itself, src/frameserver/terminal/default is also built around the API.