WMApp: A DockApp Graphics Library
WMApp is a C++ based library for writing WindowMaker-style dockapps. To write a dockapp, it is generally necessary to perform some magic Xlib incantations, supply a clipping mask, and set up X event checking. Like larger graphics libraries such as GTK+ and Qt, WMApp automates this process by providing the classes and functions necessary for widget creation and callbacks. The library provides numerous widgets, all with the traditional dockapp appearance. Many common dockapps could already be rewritten to use this library.
WMApp is made available to you under the GNU General Public License, version 2 or later, at your option.
Here are screenshots of
wmatc, a couple of example
dockapps written with the library (and included with the source
code). Clicking the check box with different mouse buttons
causes several things to toggle, as shown in the first two
images below. Pressing the X button
(when it's active) exits the app. The third image shows
how easily the appearance of the dockapp may be changed; just
two lines of code were edited to produce this effect.
The fourth image shows the
results of pressing the swirl button: a miniature paint
program. WMApp allows a dockapp
to have several different states, with each state having a
different layout and functionality. Finally, on the far right
is a screenshot of
wmatc, a small dockapp game
showing the potential of the WMApp library.
WMApp widgets available (most shown above) include:
- WMText, a text widget with three available font sizes (two are shown).
- WMLED, for creating the cutesy blinkenlights beloved by authors of PPP/Ethernet status dockapps.
- WMHistory, for showing the history of some quantity.
- WMMeterBar, for showing the quantity's instantaneous value. Available in three different styles.
- WMSlider, a subclass of WMMeterBar. This class lets you change a value by clicking or scrolling the mouse wheel over the widget.
- WMImage (not shown), a box with the capability to display a pixmap.
- WMButton. Buttons may have one or more callback functions attached.
- Or, inherit from WMCallback in order to give any other widget the ability to run callback functions.
- WMCanvas, a subclass of WMImage that lets you draw directly onto the dockapp.
- WMEllipse; inherit from this widget to create rounded buttons, images, etc.
- WMFrame. These container widgets may be nested to create the desired layout.
- WMWindow (one instance for each possible state of the dockapp). These contain all the other widgets for that state. WMWindows may have callback functions attached that execute every so often. These could be used, for instance, to update a clock or progress bar, or to "time out" an Internet connection.
With all these great features, what is the catch? First of all, you obviously need to write your dockapp in C++. Since WMApp is written in C++, it will not make a good dynamic library until the g++ authors stabilize the C++ ABI. Until then, the best way to use it is as a bunch of classes in a separate directory of your dockapp source tree. As a result, dockapp executables built with the library will be larger than other dockapps.
Due to the extreme alpha state of this project, there are still many bugs and limitations. The API is probably not even close to stable. Numerous other types of widget will be added. Other issues are listed in the FAQ and the README file in the source tree. If you want to contribute, please get in touch with me.