Freedom2 consists internally of two parts:

  1. A main part that runs as a parallel application or accessory and waits to be activated via a defined interface (consisting of a set of AES messages). This server can open any number of non-modal alert boxes, file selectors, and control panel windows (limited only by memory space and available window handles). It registers at startup via the XAcc protocol and carries in its extended XAcc name (rather grandly) "XFileSelect\0XFontAck".
  2. An interceptor part that "takes over" from applications wanting to output a file selector or alert box, sends a corresponding request to the server (which it starts in parallel if necessary), and waits in an event loop for the server's response message. Within this event loop, handling of various other messages (window redraw, move, size, top, lower) is simultaneously carried out during the active alert/file selector, and the calling program's menu bar is disabled and re-enabled. Through sophisticated programming, this part is up to 8 times reentrant, meaning up to 8 different applications can have an alert or file selector open before the trap handler ignores a file selector call or passes an alert through to the system. This part also handles, if necessary, the conversion of server responses into one of the 3 Selectric protocols. The resulting problem that there is only one Selectric cookie but potentially multiple applications communicating through it simultaneously has been minimized...

F.1 About the Interceptor Part

Since the interceptor part receives messages on behalf of the file selector-calling application, all messages that make sense are passed on to the application. The following are explicitly 'swallowed':

 (AC_CLOSE)      ; Wegen Problemen mit dem Chameleon )o:
   AC_OPEN

   MN_SELECTED,

   WM_CLOSED, WM_FULLED, WM_ARROWED, WM_MOVED,
   WM_HSLID, WM_VSLID, WM_SIZED, WM_UNTOPPED, WM_TOPPED, WM_ONTOP,
   WM_NEWTOP, WM_ICONIFY, WM_UNICONIFY, WM_BOTTOMED

   VA_START, VA_STARTED, VA_DRAGACCWIND

   AV_SENDKEY     ; AV-Server sollten das Freedom-Protkoll
   AV_STARTPROG   ; unterstützen, wenn sie einen Dateiselektor
   AV_OPENWIND    ; aufrufen
   AV_OPENCONSOLE ;

   AP_DRAGDROP    ; wird mit DD_NAK beantwortet

To live up to its name, the interceptor part of Freedom2 hooks into the following AES calls via Liberty:

The latter three are to enforce consideration of the window rectangle list when operating normal CPX modules in the background. This is necessary because no CPX known to us does this on its own, even though Atari offered two functions (Get_First_Rect and Get_Next_Rect) specifically for this purpose in its XCONTROL interface. The reason for this probably lies mainly in the faulty example sources from some widespread CPX programming courses (such as the one in the "Profibuch").

'objc_draw', 'objc_change' and 'graf_watchbox' calls from CPX modules are simply redirected by Freedom2 to a routine that handles the drawing while respecting the rectangle list of the calling CPX's window.

CPX modules also receive a quasi-application status. They are assigned a unique AES application ID and can then be found via 'appl_find', receive messages via 'appl_write', and be started via 'shel_write'.

F.2 EPX Module Interface

Freedom2 features an impressive module interface that includes almost all EnhancedGEM2.25 functions and thus qualifies as a 'Shared Library'. Applications that were already developed with EnhancedGEM can be relatively easily converted into memory-efficient EPX modules, while authors who choose to write a new EPX are enabled to achieve particularly fast, effective, and secure module development based on the provided example sources and the many useful interface functions [Advertisement off ;-)].