System-dependent part.

From the very beginning we decided to make the implementation of the core classes completely platform-independent. To facilitate this, an additional layer of C code was created to hide the specificities of a particular windowing system. This layer implements the gory details of creating windows, requesting device or graphics contexts, allocating colors and managing pens, brushes, and the like.

Ideally, the system-dependent API should be completely unaware of the fact that PRIMA itself is just a collection of Perl modules. This requirement was mostly met. However, the existing system-dependent API closely resembles the organization of PRIMA core classes. This is neccesary partly because, in all supported platforms, the top-level windows are very different from normal widgets: they are created in a different way, they have external decorations which are under control of a window manager rather than an application program, etc. Hence the separate low-level functions for creating generic widgets and top-level windows.

All platform-dependent functions have apc_ prefix in their names. APC stands for apricot, the name of the master include file in PRIMA. It is difficult to say now what ``apricot'' itself stands for, but ``pri' definitely stands for PRIMA.

The vast majority of apc functions take as a first parameter the handle (in reality just a pointer to) of a PRIMA object. Apc functions are allowed to use C-level fields of objects and even call methods, though this practice is frowned upon because of the possible side effects and a deep recursion problem.

A great effort was made to achieve the unification of the API. On the whole the result differs from every supported platform, with different parts of APC resembling different systems. For example, APC borrowed bottom-left origin from OS/2, bitmapped masks to control shapes of widgets came from X, and colorful pointers are Win32 heritage.

To control the size of the system-dependent parts of PRIMA, the standard widgets provided with some of the supported systems were not used. With the exception of the general window management and graphics, only a few other features are implemented at the low level. They are: clipboard/cut buffers support, pull-down and popup menus, timers support and printing support (not available in X version at the moment).