•  Back 
  •  AES 
  •  Index 
  •  Tree View 
  •  Cross references 
  •  %About 
  •  Show info about hypertext 
  •  View a new file 
Topic       : The ATARI Compendium
Author      : Scott Sanders / JAY Software
Version     : 1.25 (20/6/2003)
Subject     : Documentation
Nodes       : 1117
Index Size  : 32614
HCP-Version : 6
Compiled on : Atari
@charset    : UTF-8
@lang       : en
@default    : 
@help       : %About
@options    : +g -i -t4 +y +z
@width      : 100
View Ref-File
                                Applications


When an application is launched, GEM allocates all remaining system
memory and loads the application into this areaTOS 5.0 does allow the user to set
limits on the amount memory allowed
to an application.
. It is the responsibility
of the application to free whatever memory it doesn't immediately need for
its text, data, bss, and stack area. Most high level languages do this for
you in the startup stub linked with every application.

GEM applications begin with an appl_init() function call. This call will
return a valid application ID if the process can be successfully
registered or a -1 if it fails. If the call fails, the application should
immediately exit without making any AES calls. Upon success, however, the
ID should be stored for future use within the application. Applications
running under MultiTOS should call menu_register() to display the program
title in the application list rather than the filename.

The next steps a GEM application will follow are variable, however, most
GEM applications will initialize themselves further by performing some or
all of the following steps:

   ∙ Open a VDI workstation.

   ∙ Verify that the computer the application is being run on has the
     minimum requirements (screen resolution, OS versions, memory needs,
     hardware features) necessary to continue.

   ∙ Load the application '.RSC' file and fix it up as necessary.

   ∙ Display the menu bar.

   ∙ Change the mouse form to an arrow (the AES defaults to a BUSY_BEE
     shape).

   ∙ Enter the application's main event loop.

The following code  represents a basic skeleton for an AES application.

The Command Line

GEM applications, like TOS applications, may be started with a command
line (for a detailed description of command line processing, see Chapter 2:
GEMDOS). '.PRG' files and '.APP' files will have items on the command
line if a document file which was registered with the application was
double-clicked or if a valid document file was dropped over the
application's icon in the Desktop. Launching a '.GTP' application will
cause the Desktop to prompt the user for a command line in the same manner
as '.TTP' programs are handled. Applications which find one or more valid
document names on their command line should automatically load them on
program start.