Important: The information in this document is obsolete and should not be used for new development.
Checking for the Translation Manager
Macintosh Easy Open and the Translation Manager are not available in all system software versions. You can use theGestalt
function to determine whether the services you need are available before calling them. To get information about the Translation Manager, you passGestalt
the selectorgestaltTranslationAttr
.
CONST gestaltTranslationAttr = 'xlat'; {Translation Manager}Gestalt
returns in theresponse
parameter a bit field that encodes information about the Translation Manager. Currently only 1 bit is used:
CONST gestaltTranslationMgrExists = 0; {TM is present}If the indicated bit (bit 0) is set, the Translation Manager is available and you can safely call the routines it provides. Otherwise, if that bit is clear, the Translation Manager is not available.As you have seen, Macintosh Easy Open works with the Standard File Package, the Edition Manager, and the Scrap Manager to translate files and scraps implicitly. In most cases, you don't need to know that a file or scrap has been implicitly translated, but in some cases you might need this information. You can use
Gestalt
to determine whether these other system software parts are capable of supporting the capabilities of Macintosh Easy Open. Listing 7-1 lists the translation-specific Gestalt selectors and bit numbers of theresponse
parameter for the Standard File Package, the Edition Manager, and the Scrap Manager.Listing 7-1 Translation-specific selectors and response bit for
Gestalt
CONST gestaltStandardFileAttr = 'stdf'; {Standard File Package} gestaltStandardFileTranslationAware = 1; gestaltStandardFileHasColorIcons = 2; gestaltEditionMgrAttr = 'edtn'; {Edition Manager} gestaltEditionMgrTranslationAware = 1; gestaltScrapMgrAttr = 'scra'; {Scrap Manager} gestaltScrapMgrTranslationAware = 0;For complete information about theGestalt
function, see the chapter "Gestalt Manager" in Inside Macintosh: Operating System Utilities.