docs/driver.rst
author Radek Brich <radek.brich@devl.cz>
Fri, 18 Jan 2013 22:36:50 +0100
changeset 62 2f61931520c9
parent 55 1ab0edd5d784
permissions -rw-r--r--
Rework layouts: Layout is now normal Container which places its children upon resize event. Drop TopWindow, top is now any subclass of Container. Add floater concept: floaters are widgets drawn over normal widgets, not clipped by parent. Add HScrollbar and Scrollbar abstract base class.

Driver
======

Tuikit driver is the lowest part of the kit - it actually draws characters on screen,
receives user events and forwards them to widgets.

Any dirty details of actual graphical toolkit should be hidden by this driver.
Though it's not hardware driver, nowhere near that. Tuikit driver is expected to use
pretty high-level libraries, it's low-level only in Tuikit perpective.

Currently there are three drivers: Dummy, Curses, SDL


Dummy driver
------------

This driver shows and documents complete interface required from any driver.

It does not draw anything and immediately emits keypress event for 'q' char and 'escape' key,
which should exit application.

All methods of dummy driver just report they where being called - into log file.


Curses driver
-------------

Default driver for Text User Interface in any terminal supporting required features.
Uses curses module from Python.


SDL driver
----------

Creates graphical window and draws characters here. This has less limits than curses,
we can use any colors, fonts and possibly even draw images.

Though by default, it just emulates terminal with curses.

SDL application is more portable than curses one, which means that Tuikit application
using SDL driver may work in non-unix OS like Windows (does not currently,
due to unconditional use of fontconfig).

SDL driver requires sdlterm module for Python, which must be compiled from C++.
See sdlterm directory in Tuikit distribution.