Apple PowerBook 520 Technical Information Page 95

  • Download
  • Add to my manuals
  • Print
  • Page
    / 144
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 94
CHAPTER 5
Software
Adding Control Strip Modules 81
Contents of Module Files 5
The only required resource in a module file is a resource containing the code necessary
for the module to interact with the control strip. A module file may contain more than
one code resource if it is to provide multifunctional support. In that case, each module in
the file is loaded and initialized separately and treated as an independent entity.
If a file contains only a single code resource, the resource may be unnamed, and the
module will be referenced by its filename. If more than one module is contained within a
module file, each module is required to have a unique name describing its functionality.
All other resources in a module file are optional, but there are several that are
recommended in order to support a custom icon and version information. The
recommended resources are
'BNDL'
'FREF'
'ICN#', 'icl4', 'icl8', 'ics#', 'ics4', 'ics8'
signature resource (same type as file’s creator)
'vers', ID=1
Developers should confine their resources to the range 256–32767.
Module Interface 5
The module’s interface to the control strip consists of a code resource of type 'sdev'.
This code is responsible for performing all of the functions required by the control strip
(see below) as well as any functions that are custom to the module itself. The module’s
entry point is at the beginning of the resource and is defined as
pascal long ControlStripModule(long message,
long params,
Rect *statusRect,
GrafPtr statusPort);
Interactions between a module and the control strip are managed by passing messages to
the module to tell it what to do or to obtain information about the module and its
capabilities. Each module is required to observe Pascal register saving conventions. A
module may trash registers D0, D1, D2, A0, and A1, but must preserve all other registers
across its call.
Field descriptions
message A message number, from the list in the section “Control Strip
Module Messages”, that tells the module what action to perform.
params This is the result returned by the initialize call to the module. This
would typically be the handle to the module’s private variables
since modules can’t have global variables. It will be passed to the
module on all subsequent calls.
Page view 94
1 2 ... 90 91 92 93 94 95 96 97 98 99 100 ... 143 144

Comments to this Manuals

No comments