Chapter 7: Flash Application Layout
61
TI
-
89 / TI
-
92 Plus Developer Guide
Not for Distribution
Beta Version January 26, 2001
system frame
00
app attributes & strings
0
hook frame
localizer strings
observer frame
0
ACB
localizer frames
system frame
00
app attributes & strings
0
hook frame
localizer strings
observer frame
0
ACB
localizer frames
Figure 7.4: Redirected App Frame
The ACB now points to the hook frame installed in RAM by the localizer app with
a call to
OO_InstallAppHookByName
. Now when
XR_stringPtr
looks up a
string, it starts with the hook frame in RAM. Since the hook frame has no
attributes, the search continues down the prototype chain to the localizer app’s
frames. The translated string is found in the localizer’s string frame.
Not all strings need to be translated. If searching the localizer prototype chain
proves unsuccessful, the search continues with the parent of the hook frame,
picking up the search again in the app’s prototype chain.
The search is quick — the header of each frame indicates the range of attributes
in the frame body. No need to search a frame if the header says the sought
attribute is not there. Disjoint ranges of string numbers can be placed in different
frames and linked together through their prototype fields.
The observer frame at the bottom of the figure above lets the localizer app peek
at every event sent to the target app. The localizer app uninstalls its language
hook when it sees the target app is about to be deleted or moved. It can reinstall
its hook when it sees the target app has finished a move.