•  Back 
  •  XCONTROL 
  •  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
                              CPX  Flavors


Boot Initialization

Any CPX which has its _cpxhead.bootinit flag set will have its cpx_init()
function called when XCONTROL initializes upon bootup. This provides a way
for CPX's to set system configuration from data the user has saved in
previous sessions.

cpx_init() is always called each time the user selects your CPX from the
XCONTROL CPX list prior to calling cpx_call(). If the CPX is being
initialized at boot time, the xcpb->booting flag will be TRUE.

Resident CPX's

CPX's which have their _cpxhead.resident flag set will be retained in
memory after being initialized at bootup. In general, this option should
not be used unless absolutely necessary.

Resident CPX's should be aware that variables stored in their DATA and
BSS segments will not be reinitialized each time the CPX is called.
Set-Only CPX's

Set-Only CPX's

Set-Only CPX's are designed to initialize system configuration options
each time XCONTROL initializes (during boot-ups and resolution changes)
by calling the cpx_init() function. These CPX's will not appear in the
XCONTROL list of CPX's.

Form CPX's

Every CPX must be either a 'Form' or 'Event' CPX. Most CPX's will be
Form CPX's.

In a Form CPX, XCONTROL handles most user-interaction and messaging by
relaying messages through a callback function. XCONTROL is responsible for
redraws (although the CPX does have a hook to do non-AES object redraws)
and form handling. A simple 'C' outline for a Form CPX follows:

Example Form CPX Skeleton

Event CPX's

CPX's which are not possible as Form CPX's may be designed as Event CPX's.

Event CPX's accomplish most of their work in several callback functions
identified to the Control Panel by the CPXINFO structure and called when
the appropriate message is received. An outline for a typical Event CPX
follows:

Example Event CPX Skeleton