[ about | news | buildinit | download | screenshots | information | gadgets ]
Latest is wg-0.9.8 and wgbuilder-0.6.4
Window Gadgets (WG) is my effort (so-far) at writing a toolkit for X11. It started life when I was writing gametest and decided a simple toolkit was needed (for menus and suchlike). Around that point I stopped working on gametest and went flat-out on WG.
WG is written in C++ (although a rehack into C is still on the cards) and requires X11. Most of the code is 2-3 years old, it's just been lurking on my fs along with vague promises to people about getting it on the net. It would appear that my coding style has changed since then (for the better). Respect to GNU indent. My preferred runes are `-bap -ts8 -i8 -br -ce -nbc -l180'.
Window Gadgets Builder (WGBuilder) is an ``integrated rapid application development environment'' for the X Window System. This basically means that it's a drag-and-drop style graphical design thing. It uses the WG toolkit fairly extensively -- using WG itself, and generating output which uses WG. WGBuilder also used itself fairly extensively during development.
Important note (!): The copyright of Window Gadgets (WG) is owned exclusively by Frederick Barnes (apart from bits of code with appropiately acknowledged sources and the bits written by David Reeve). The copyright of WGBuilder is owned by the University of Kent, Frederick Barnes and David Reeve, with sections owned by Paul Rogers, Steven Fagg and Karim Saykali. WGBuilder was our final-year CS undergraduate project, hence the ownership by the university. However, due to the GPL-age of WG, it can't generate any money in itself -- unless the uni were to buy WG off me (not going to happen).. These, and all associated programs, files, etc. are released under the GNU General Public License (GPL) license. See the Free Software Foundation's website for more information. In essence:
You can use, modify and/or sell this (freely available) software, but the copyright and licensing must be perserved, as per the terms of the GPL. Due to the licensing of WG, any applications created which use it (ie, linked against it) which you wish to make available, must have the sources made publically available (including things like .hpd files, etc.). The other authors and myself would get very unhappy/lawyers if we found parts of this software used in non-GPL software. This can only change if I re-license WG under the LGPL, which would allow it to be linked with non-free software. I'm not planning on doing this however, as I would like it and any decendants to remain fully free software. For private-only use, you may do what you like with it -- just don't make any of it (verbatim or modified) public without freely available sources.
Even though other email addresses appear in the code, etc., all queries/etc. should be sent to me (Fred Barnes) since I'm the only one actively doing anything to it ;).
buildinit is a program which generates C++ code to create some gadget (and its children) from a Hierarchical Program Description (HPD) file. HPD files describe an interface in terms of a gadget hierarchy and the properties of those gadgets. Each gadget has an associated mapping (.wgm) file which describes how to set the various properties, what callbacks exist, and what needs to be #include'd to use the gadget. Buildinit combines an HPD file with the various mappings to produce code which will create the interface at run-time.
In order to use buildinit successfully, you'll need the ``mapping.wgm'' file -- I usually park it in the `lib/' directory, but wherever you like really.
Code tarballs:
Other needed/useful stuff:
Older stuff:
Note: the above downloads will be replaced by a more `together' distribution at some point, but these bits will do for now.. Also, better download the wg_prefs file and put it in `~/.wg_prefs', if you want stuff to look half decent ;).
To build, install, etc., download wg-0.9.tar.gz and newtest-0.9.tar.gz (as above). Create a `~/wg/' directory (or wherever you want to put it), and ungzip/untar the tarballs in there, thus you should end up with `~/wg/wg-0.9/' and `~/wg/newtest-0.9/'. Then configure, make, and install wg; configure and make newtest:
[host]:/home/me/wg$ cd wg-0.9
[host]:/home/me/wg/wg-0.9$ ./configure --prefix=/home/me/wg
... output from configure ...
[host]:/home/me/wg/wg-0.9$ make
... compile stuff ...
[host]:/home/me/wg/wg-0.9$ make install
... installs into /home/me/wg/lib/ ...
[host]:/home/me/wg/wg-0.9$ cd ../newtest-0.9
[host]:/home/me/wg/newtest-0.9$ ./configure --prefix=/home/me/wg
... output from configure ...
[host]:/home/me/wg/newtest-0.9$ make
... compile stuff ...
[host]:/home/me/wg/newtest-0.9$ ./newtest
... newtest should run! ...
Buildinit is not actually needed to build newtest, since the buildinit'd .hpd files are included in the distribution. However, if you want to change anything, you'll need to grab, configure, make and install buildinit-1.1.1.tar.gz. The command I used to create the _init.[ch] files for newtest was:
[host]:/home/me/wg/newtest-0.9$ ../bin/buildinit -m ~/wg/lib/mapping.wgm -s ./newtest.hpd
obviously, you'll need mapping.wgm to do this.
For WGBuilder, download and unpack it somewhere, then configure it with the same prefix as used for WG. Make and install in the usual way. For example:
[host]:/home/me/wgbuilder-0.6.3$ ./configure --prefix=/home/me/wg
... output from configure ...
[host]:/home/me/wgbuilder-0.6.3$ make
... compile stuff (takes a while) ...
[host]:/home/me/wgbuilder-0.6.3$ make install
... installs into /home/me/wg/lib and /home/me/wg/bin ...
When you start WGBuilder for the first time, it will prompt you to supply some libraries and bring up the ``User Preferences'' window. Go to the ``Libraries'' tab and supply the libraries ``make install'' left in /home/me/wg/lib. You'll need to supply full paths to these things. The default libraries (and prefixes) are:
| Library | Prefix | Description |
| wgb_gadgets_visual.so | visual | Selection of WG visual gadgets |
| wgb_gadgets_extra.so | extra | Selection of WG extra gadgets |
| wgb_supplib.so | supp | Example not-in-WG gadget |
Here's a collection of various screenshots (click on the images for a full-size version):
![]() | ![]() | |
| newtest WG demo application | WGBuilder 0.6.3 (build 677) just after launching | |
![]() | ![]() | |
| After importing the splash window .hpd file | Imported even more, plus showing object information for one of the gadgets |
Here's a quick run-down of some WG features:
WG comprises of a pile of C++ classes for the most part. The choice of C++ was for inheritance and the handy subtyping mechanisms, not for the (non-)merits of OO. Below is a picture showing the object heirarchy:
Essentially, everything ultimately descends from `WGObject', which implements some basic stuff to make life easy for everything. This includes a pointer to the `XConnection' class and some functions which handle timeouts and message passing. There's also a pointer to some identifying string. Visual (ie, on-the-screen) gadgets descend from the `WGVisual' class, and non-visual (eg, sockets, etc.) gadgets descent from the `WGNVisual' class.
The main bulk of the WG core is contained in the `XConnection' class. The majority of this is managing gadgets at run-time, largely processing the incomming X events and handing them to a particular gadget. There's also all the stuff to deal with message passing, timers, signal handling, handling the little popup `hint-window', etc. Various server classes exist (`X...Server') which provide services to gadgets. The `XDisplayServer' class, for instance, handles the actual connection to the X server. The `XFontServer' is used to manage fonts, and so on.
The seperation between `XConnection' and `XDisplayServer' is to allow a single WG application to run on multiple X servers. This isn't quite finished yet, but the results could be quite interesting.
Since gadgets only need to descend from `WGNVisual' if they use blocking file-descriptors, etc., there are some non-visual gadgets which descend directly from `WGObject'.
Here is the current list of gadgets. The `state' refers to the current development state of the gadget, ie, `nearly-there', `more-hacking' or `not-started'. WG as a whole is not nearly-there yet however. There's still some stuff which might get changed or removed in the near future.
| Gadget | State | Library | Description |
| WG3DRender | more-hacking | visual | Simple 3D rendering thing |
| WGBevel | more-hacking | visual | Provides lines / box which can appear raised/sunken |
| WGBitBtn | more-hacking | visual | Button with little image |
| WGButton | more-hacking | visual | Button (and IE style) |
| WGCanvas | more-hacking | visual | Canvas (drawing thing) |
| WGCDUtil | not-started | non-visual | CD-player controller thing (PD) |
| WGCMessageWin | more-hacking | visual | Coloured multi-line message box |
| WGCheckBox | more-hacking | visual | Check-box |
| WGColorDlg | not-started | composite | 'Color' dialogue box |
| WGComboBox | more-hacking | visual | Drop-down combo box |
| WGContainer | more-hacking | visual | Simple container with optional 3 borders for use with WGTabTops |
| WGDave | more-hacking | extra | 64 x 64 gray-scale piccy of Dave |
| WGDirOutline | not-started | extra | Directory outline tree thing |
| WGDude | more-hacking | extra | 64 x 64 little dude that does stuff :) |
| WGEdit | more-hacking | visual | Single-line edit box |
| WGFileList | not-started | extra | File list box |
| WGFileListImg | not-started | extra | File list box with pretty images showing file type |
| WGFindDlg | not-started | composite | 'Find'/search dialogue box |
| WGFontDlg | not-started | composite | 'Font' dialogue box |
| WGFred | nearly-there | extra | 64 x 64 gray-scale piccy of me (Fred) |
| WGGauge | more-hacking | visual | %-bar gauge |
| WGGroupBox | more-hacking | visual | Border with a label |
| WGHPScan | more-hacking | extra | HP SCSI scanner toy thing (PD) |
| WGHeader | not-started | extra | Sectioned visual control (status windows at screen bottoms) |
| WGISockCli | nearly-there | non-visual | Internet socket client |
| WGISockSvr | more-hacking | non-visual | Internet socket server |
| WGIUDPCli | not-started | non-visual | Internet datagram client |
| WGIUDPSvr | not-started | non-visual | Internet datagram server |
| WGImage | more-hacking | visual | Displays an image / piccy thing |
| WGIniFile | more-hacking | non-visual | ini file access type thing |
| WGKarim | more-hacking | extra | 64 x 64 gray-scale piccy of Karim |
| WGLabel | more-hacking | visual | Simple label |
| WGLcarsButton | more-hacking | extra | Star-trek style lcars button |
| WGLcarsEButton | more-hacking | extra | Star-trek style lcars button with a bit for an lcars-panel |
| WGLcarsPanel | more-hacking | extra | Star-trek style lcars panel |
| WGLcarsSection | more-hacking | extra | Star-trek style lcars section header |
| WGLcarsSplit | more-hacking | extra | Star-trek style lcars split-thing (for RHS of lcars-panel) |
| WGLcarsTitle | more-hacking | extra | Star-trek style lcars title bit (for top of an lcars-panel) |
| WGLinked | not-started | non-visual | Generic linked-list |
| WGListBox | more-hacking | visual | List box - select one or many |
| WGMSQL | not-started | non-visual | MSQL database client bit (would require MSQL API) |
| WGMainMenu | more-hacking | visual | For displaying across-the-top menus on WGWindow's |
| WGManaged | more-hacking | visual | Managed window (for building window-manager type things) |
| WGMaskEdit | not-started | extra | Masked edit box (for dates, etc.) |
| WGMemo | not-started | extra | Multi-line edit box |
| WGMessageDlg | more-hacking | composite | Simple message dialogue (with optional icons :)) |
| WGMessageWin | more-hacking | visual | Multi-line message box |
| WGMitShm | more-hacking | extra | MIT-SHM gadget (provides raster, plus shading thing and plasma-generator) |
| WGNVisual | nearly-there | core | Ancestor of all non-visual objects |
| WGNotebook | not-started | visual | Stack of pages, with one at the top (hence visible) |
| WGObject | nearly-there | core | Utter ancestor for all objects |
| WGOpenDlg | not-started | composite | 'Open' dialogue box |
| WGOutline | more-hacking | extra | Outline thing - see directory trees in 95 |
| WGPOP3 | not-started | non-visual | POP3 client |
| WGPanel | more-hacking | visual | Panel |
| WGPaul | more-hacking | extra | 64 x 64 gray-scale piccy of Paul |
| WGPicture | more-hacking | visual | Picture (like an image, but with borders) |
| WGPipe | more-hacking | non-visual | Unix named-pipe |
| WGPopup | more-hacking | visual | For displaying drop-down menus on any visual component |
| WGQueue | more-hacking | non-visual | Generic queue |
| WGRadio | more-hacking | visual | Radio-button (mutually exclusive) |
| WGRadioBtn | more-hacking | visual | Radio-style image buttons |
| WGRecordSet | more-hacking | non-visual | Record-set for holding data |
| WGSMTP | not-started | non-visual | SMTP client |
| WGSaveDlg | not-started | composite | 'Save' dialogue box |
| WGScrollBar | more-hacking | visual | Scroll-bar, both horizontal and vertical |
| WGScrollBox | not-started | extra | Scrollable window (basically) |
| WGSpeedButton | more-hacking | visual | Button with only image |
| WGStack | more-hacking | non-visual | Generic stack |
| WGSteve | more-hacking | extra | 64 x 64 gray-scale piccy of Steve |
| WGStringGrid | not-started | extra | String grid, for displaying spread-sheet like things |
| WGStringList | more-hacking | non-visual | String list |
| WGStringTree | more-hacking | non-visual | String tree |
| WGTabTops | more-hacking | visual | The little tab-bits (like in a file) |
| WGTerminal | not-started | non-visual | The TTY thing (for our controlling one) |
| WGTimer | more-hacking | non-visual | Interval timer (or alarm-clock) - implementation requires thought |
| WGUSockCli | not-started | non-visual | Unix socket client |
| WGUSockSvr | not-started | non-visual | Unix socket server |
| WGVisual | nearly-there | core | Ancestor of all visual objects |
| WGWatcher | nearly-there | non-visual | Simple thing that watches file-descriptors for activity |
| WGWinGauge | more-hacking | visual | Win-95 'little-boxes' style gauge |
| WGWindow | more-hacking | visual | Top-level application window (border and borderless) |
| XColorServer | nearly-there | core | Color handling routines |
| XConnection | nearly-there | core | What everything sits on |
| XDisplayServer | nearly-there | core | Visual link-up |
| XFontServer | nearly-there | core | Font handling routines |
| XPixmapServer | nearly-there | core | Pixmap handling routines |
| XUtilServer | nearly-there | core | General handy routines |
Last modified: Sat Nov 1 17:06:21 2003 by Fred Barnes.