Brennan's Wasabi Coding FAQ
This FAQ is about using Wasabi. Setting up and actually using the SDK files is
covered in the SDK FAQ.
Where is everything? How do I get started reading the code?
Take a look at the file contents.txt. That will give you a description of each
top-level directory in the sdk.
In general, the code is built in layers. The bottom layer is the Std layer.
This is the platform-independence layer. #include <bfc/std.h> covers most
of the "standard wasabi environment" includes.
Then, there is BFC. This is the foundation class collection. There are various
code heirarchies in here. It implements
most of the basic C++ data structures we use, as templates whenever possible.
It's not trying to be as big and full-featured as the STL, though. Just
simple basic often-needed tools, like PtrList<>, String, and MemBlock<>.
Another important BFC heirarchy is the BaseWnd heirarchy. This implements our
OS-independent windowing system code. The main players are:
- RootWnd: this is an interface-only class. This is the minimal
window class interface required to be implemented to be able to be attached
to a parent window and have child windows attached to you.
- BaseWnd: this is an implementation of RootWnd for local OS windows. This
class will call into the hosting OS to create a window. You need at least one
BaseWnd class to put up a UI. The rest can be virtual.
- VirtualWnd: this is a purely 'virtual' window implementation, in that
it does not create a corresponding OS window. It attaches to its parent
and renders directly into the parent's 32-bit color buffer, which allows
full 8-bit alpha blending or other filtering operations to take place. This
window actually derives from BaseWnd for implementation, which means you
can actually switch a window between "real" and virtual on the fly with
BaseWnd::setVirtual(). Neat, huh.
All the other windows are derived from either BaseWnd or VirtualWnd and are located in bfc/wnds. Well, they also derive from each other, esp. TreeWnd and ListWnd which derive from ScrlBkgWnd, which implements generic scrolling for a window.
Do I need to #include <windows.h>?
No. Please don't! In general, all .cpp files should include <bfc/std.h>, which
will take care of the standard includes for the platform. Remember, the
less you refer to Windows, the more magically portable your code will be.
Should I include common.h?
No. This is now included automatically by platform.h.
How do I make my own service type?
Read this. It
also discusses how Dispatchable works, a little bit. (mirror)
How do I make an edit box hide its input (for passwords)?
Just put password="1" as one if its XML parameters.
back to main wasabi page