52
Chapter 7: Flash Application Layout
TI
-
89 / TI
-
92 Plus Developer Guide
Not for Distribution
Beta Version January 26, 2001
Run the FDL compiler to produce a header file suitable for defining your API call
macros and attribute names.
C>FDL fileio.fdl
Resulting header file fileio.h includes among other things:
/* Frame slot number assignments */
#define OO_PLAYER_FILE_TABLE_COUNT (65536)
➊
#define OO_PLAYER_FILE_TABLE (65537)
#define OO_PLAYER_FILE_OPEN (65538)
#define OO_PLAYER_FILE_READ (65539)
#define OO_PLAYER_FILE_WRITE (65540)
#define OO_PLAYER_FILE_CLOSE (65541)
/* Accessor/mutator macros */
GetPlayerFileTableCount(appid)
➋
SetPlayerFileTableCount(appid, int)
GetPlayerFileTable(appid)
SetPlayerFileTable(appid, FILE *)
/* Function call macros */
PlayerFileOpen(appid, name)
➌
PlayerFileRead(appid, handle, buff, size)
PlayerFileWrite(appid, handle, buff, size)
PlayerFileClose(appid, handle)
➊
FDL creates names for attribute slots by converting your variable and method names to upper
case and adding “OO_” prefix.
➋
FDL creates a Set/Get pair of macros for each variable.
➌
These macros hide the details of method dispatch and better demonstrate in your source your
intent to call a library function.
Include fileio.h in your app source so you can use the frame slot assignment
macros in your ATTR declarations.
FRAME(playerObj, OO_SYSTEM_FRAME, 0, OO_APP_FLAGS, . . .)
ATTR(OO_APP_FLAGS, . . .)
.
.
.
ATTR(OO_PLAYER_FILE_TABLE_COUNT, &fileTableCount)
ATTR(OO_PLAYER_FILE_TABLE, fileTable)
ATTR(OO_PLAYER_FILE_OPEN, fileOpen)
ATTR(OO_PLAYER_FILE_READ, fileRead)
ATTR(OO_PLAYER_FILE_WRITE, fileWrite)
ATTR(OO_PLAYER_FILE_CLOSE, fileClose)
ENDFRAME