|
Table 1-1 shows the four conceptual layers: the wxWidgets public API, each major port, the platform API used by that port, and finally the underlying operating system.
The following are the main wxWidgets ports that exist at the time of writing. wxMSWThis port compiles and runs on all 32-bit and 64-bit variants of the Microsoft Windows operating system, including Windows 95, Windows 98, Windows ME, Windows NT, Windows 2000, Windows XP and Windows 2003. It can also be compiled to use Winelib under Linux, and has a configuration that works on Windows CE (see "wxWinCE"). wxMSW can be configured to use the wxUniversal widgets instead of the regular Win32 ones. wxGTKwxWidgets for GTK+ can use versions 1.x or 2.x of the GTK+ widget set, on any Unix variant that supports X11 and GTK+ (for example, Linux, Solaris, HP-UX, IRIX, FreeBSD, OpenBSD, AIX, and others). It can also run on embedded platforms with sufficient resourcesfor example, under the GPE Palmtop Environment (see Figure 1-4). wxGTK is the recommended port for Unix-based systems. Figure 1-4. The wxWidgets "Life!" demo under GPE on an iPAQ PDAwxX11wxWidgets for X11 uses the wxUniversal widget set and runs directly on Xlib with no native widget set. This makes the port suitable for embedded systems, but it can also be used for desktop applications where it is undesirable to link with GTK+. This is supported on any Unix system running X11. wxX11 is not as mature as the wxGTK port. Figure 1-5 shows the Life! demo compiled under wxX11 and running on Familiar Linux /TinyX on an iPAQ PDA. Figure 1-5. The wxWidgets "Life!" demo running on embedded wxX11wxMotifThis port can use Motif, OpenMotif, or Lesstif on most Unix systems. Sun Microsystems is putting its weight behind GNOME and GTK+, so Motif is no longer an attractive option for most developers and users. wxMacwxMac targets Mac OS 9 (from 9.1 upwards) and Mac OS X (from 10.2.8 upwards). For Mac OS 9 builds, you need the Metrowerks CodeWarrior tools, and for Mac OS X, you can use either Metrowerks CodeWarrior or Apple tools. When using Apple's tools, you should use Xcode 1.5 or higher, orif you are just using command line toolsGCC 3.3 or higher. wxCocoaA port in progress, this targets the Cocoa API of Mac OS X. Although the functionality of Carbon and Cocoa is similar, this port has the potential for supporting GNUStep running on platforms other than a Mac. wxWinCEThe Windows CE port encompasses various SDKs based on the Windows CE platform, including Pocket PC and Smartphone. The bulk of this port consists of the wxMSW Win32 port, with some omissions and additions for the smaller platform. Figure 1-6 shows the wxWidgets Life! demo running on the Pocket PC 2003 emulator. Figure 1-7 shows four screens from the wxWidgets dialog demo running on Smartphone 2003 with a 176 x 220 pixel display. User interface adaptations done by wxWidgets for this restricted platform include constructing a nested menu in place of the usual menu bar because Smartphone only supports two menu buttons. Some additional application hints are required, such as calling SetLeftMenu and SetRightMenu instead of adding conventional OK and Cancel buttons to a dialog. Figure 1-6. The wxWidgets "Life!" demo on Pocket PC 2003Figure 1-7. The wxWidgets "dialogs" demo on Smartphone 2003wxPalmOSThis is a port to Palm OS 6 (Cobalt). At the time of writing, the port is in its infancy but can be used to compile and run a simple sample in the Palm OS 6 simulator (see Figure 1-8). Figure 1-8. A wxWidgets sample under Palm OS 6wxOS2wxOS2 is a Presentation Manager port for OS/2 or eComStation. wxMGLThis port targets the MGL low-level graphics layer from SciTech Software, Inc., and uses the wxUniversal widget set. Internal OrganizationInternally, the wxWidgets code base is broadly separated into six layers:
Each port takes what it needs from these layers to implement the wxWidgets API. How does wxWidgets know which classes to use when you're compiling your application? When you include a wxWidgets header file, such as wx/textctrl.h, you're actually including a platform-specific file such as wx/msw/textctrl.h, due to directives in wx/textctrl.h that conditionally include the appropriate declarations. You then link your application against a library that has been compiled with suitable settings for the platform in question. You can have several configurations available at once, in particular Debug and Release versions, and you can normally link either statically or dynamically to the wxWidgets code. If you want, you can disable components in a wxWidgets build, or make choices such as Unicode versus ANSI, by editing the file setup.h or using configure options depending on compiler. For more details, please see Appendix A, "Installing wxWidgets." Note that although wxWidgets is a wrapper around each native API, you are not prevented from writing platform-specific code in that native API if you need to, although this is seldom necessary. |
|