wt - a, SDL Based, C++ widget toolkit
The library is licensed under the LGPL (see COPYING.LIB). The configure
scripts are GPL, except otherwise stated (see COPYING for the GPL)
This project is hosted in sourceforge.
The libwt is based on the library 'libwftk' known as the Worldforge
toolkit. which was based on the library 'libuta', by Karsten O.
Laux. libwftk began as a fork of libuta 0.4.4.
libwt contains almost no code from the original libwftk, with region.*
being the exception.
See AUTHORS for the people involved.
libwt depends on the following libraries:
In a future version we will offer smpeg or ffmpeg wrappers for
- libsigc (for signals and slots)
- libSDL_ttf (requires freetype)
- libSDL_image (requires libpng, libz)
- libSDL_gfx (for rotozoom)
- libSDL_mixer (optional, requires smpeg for mp3 support)
- libsSDL_Net (via Net2 for network access)
Note that smpeg is not available on modern (8.0 and later) versions of
Red Hat Linux.
If the SDL_mixer library is present, wt uses it for sound and music
playback. SDL_mixer's site is http://www.libsdl.org/projects/SDL_mixer/
MP3 and OGG support are available through SDL_mixer.
Rationale & Features
It all began when I was looking for a SDL toolkit. There were lots of
them. The main problem for me was that there was no layout
manager. The only toolkits that had one, were libwftk and Agar.
Agar is C based and I am not so hot about doing widgets in C, so I
turned to libwftk.
libwftk was ok. It had a reasonable API but it had also a fatal
problem. It was extremely slow. The reason of the perceived slowness
was excessive redrawing. libwftk didn't optimize redraws in order to
redundant repaints. Actually in order to do that a fully asynchronous
event system was required.
So I implemented one, and a layout manager and a Qt like API to bind
all this together. Why a Qt API you may ask? Well, for starters Qt has
a really nice API, very close to the libwftk one, so it was not big
departure for me. Secondly, I already have a hands on experience with
the Qt API and I find it coherent and internally consistent.
So libwt offers the following features:
signal and slots made right (in the C++ way via libsigc++-2.0)
layout manager generic class
vertical or horizontal layout
to force space between managed widgets
that you can subclass from
a widget with a frame
a widget with a box layou
a widget with a grid layout
a widget with a cascade layout
to draw stuff (lines and rects) in a widget
takes over the event loop
for playing and mixing sounds
wraps SDL_ttf for font support
- generic SDL wrapper classes
all widget can be transparent
Future work should be around the following areas:
- python bindings (via swig)
- multimedia playback (via smpeg or ffmpeg)
- more graphics primitives i.e. circles, ellipses, brushes etc.
- more widgets
- more platforms (win32, freebsd)
libwt demos and tests are in the subdirectory 'tests' and are not built
by default - to build them, run 'make tests'.
Documentation comes in two flavors. User guide is built with doxygen if
it exists if you run 'make doc' in toplevel directory. However if you
want programmer's guide you need to 'cd doc; make pguide'. The
resulting subdirectories are doc/uguide and doc/pguide respectively.
The documentation is generated by doxygen and we haven't document a lot
of things yet.