Technical overview

TekUI is not a binding to an existing GUI library, and it makes no attempt to conform to the looks of a host's native GUI (although this can be emulated to a certain degree – see below for details). The implementation comes straight to the point, and it is comparatively fast and resource-friendly, despite its script-heavy nature. Among the benefits for developers are its transparency and modularity; in particular, custom interface elements can be created with little effort. Note, however, that the programming interfaces are nowhere complete and fully stable yet, so be prepared for structural and API changes.

Selected features

  • Automatic layouting and scalability, themes
  • Font-sensitivity, support for antialiased fonts
  • Full Unicode (UTF-8) support
  • Allows for multi-windowed and fullscreen applications
  • Fully incremental refresh logic, backbuffers are not required
  • Concurrency thanks to inbuilt support for dispatching to coroutines
  • Supplied with a documentation system supporting tekUI's object model
  • Works with stock (double precision), single precision and integer versions of the Lua VM

Supported interface elements

  • Canvas (smoothly scrolling)
  • Checkmark
  • Directory lister (file chooser included)
  • Floating text
  • Gauge
  • Group (horizontal, vertical, grids, in pages, scrollable)
  • Handle, for group balancing
  • Image gadget (only vector images at the moment)
  • List, also multi-column and multi-selection
  • Menu (popup and window), also nested
  • Popup item, also nested
  • Popup list ('combo box')
  • Radio button
  • Slider
  • Spacer
  • Text gadget (and label), also multi-line
  • Text input (single line)

Plans for development and deployment

The only language currently supported for writing applications in is Lua, and application programmers will have to use existing Lua modules or create their own C bindings for communicating with their host. (Fortunately, creating C bindings is an easy and well-documented task in Lua, and the tekUI package contains numerous examples.)

Our next development target is to fold the tekUI framework into a freestanding C library, which enables applications to create asynchronous GUI objects, communicating with their main program using an application-level protocol. From this, we envision the following benefits:

  • GUIs integrate smoothly even into I/O-burdened applications (clients, servers)
  • strict separation of GUI and functionality; the GUI runs in a thread or process of its own
  • Faulty GUI application code, as it is written in a safe language, cannot corrupt the heap or otherwise crash the device, even if it is without a MMU.

Lua would continue to act as the toolkit's internal scripting language, which can be used for complex interconnections between GUI elements as well as simple application tasks.

Themes

The only admission to a more common appearance is that tekUI tries to import the color scheme found in a GTK+ configuration file. It can be conveniently created in the KDE configuration panel; thus, if you are using KDE and check the appropriate option, KDE, GTK+ and tekUI applications can all share the same color scheme.

The current default theme tries to be as conservative and minimal as possible. Custom themes can be created by modifying (or deriving from) the Theme class.

C library

The C library is based on the TEKlib middleware project. All required modules are contained in tekUI's source code distribution, to reduce the hassle of building and installing the software.

The C library isolates from the host and provides a few performance-critical routines. Rendering and input handling are isolated in the form of display drivers, which allow for easy exchangeability. Display drivers currently supported are for X11 and DirectFB.

Aside from the display driver interface, the C library features OS-like facilities such as portable threads and a timer device. Depending on your application and its kind of deployment, it can be extended with more input drivers, a virtual filesystem, file format codecs, etc.

Lua, C and object model

Regardless whether classes are written in Lua or C, they share a common, single-inheritance object model, which is determined by the Lua virtual machine and provides a referencing scheme and automatic memory management.

Most user interface elements are currently implemented in Lua, which is beneficial for fast prototyping of custom classes and styles, and generally in early stages of development.

Documentation system

TekUI comes with a documentation generator supporting its own object model. It is capable of generating a function reference and hierarchical class index from specially crafted comments in the source code. To regenerate the full documentation, invoke

# make docs

Note that you need LuaFileSystem for the document generator to process the file system hierarchy.