Architecture

MGUI is coded in ANSI C and consists currently of about 35.000 source code lines. A small portion (8% - 10%) is highly system dependent, while the remaing 90% - 92% is completely system independent. The system specific code implements the interface between the specific graphic environment and the library Objects. This design makes MGUI easy to evolve and easy to port in other environments.
MGUI programming is similar, at least in the flow control, to the Unix X-Toolkit environment, so Unix users should easily familiarize with MGUI.

There are four main functional blocks in the library structure:

The first block handles all the system generated events:
When one of the above event occurs, the SEM block generates an event and passes it to the TWM block. The DOS implementation uses a polling tecnique to handle mouse events, so mouse clicks and moves occurring while the program is not waiting for input are lost.

The TWM block's major task is to handle all those events the system notifies to a window. Any system window owned by the application has a MGUI Object bound to, events are received by this Object (SHELL) and propagated to the destination Widget following the layout hierarchy. Since the DOS O.S. does not provide a Window Manager, the TWM block in the DOS implementation also handles window movement and focus delivery.

The GRM block offers the API for the display functions: color and font management and drawing primitives.

Last block, the greater and system independent one, contains the MGUI Widgets' API.

In the remainder of this guide details about Widgets are described as well as the programming tecnique for a strict MGUI application. Refer to MGUI C++ API or C API documentation for more details about all available library functions.

Every example mentioned in this guide can be obviously compiled and executed without changes in any of the supported platforms.

Back