Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: More Macintosh Toolbox /
Chapter 7 - Translation Manager / Using the Translation Manager

Checking for the Translation Manager

Macintosh Easy Open and the Translation Manager are not available in all system software versions. You can use the Gestalt function to determine whether the services you need are available before calling them. To get information about the Translation Manager, you pass Gestalt the selector gestaltTranslationAttr.

   gestaltTranslationAttr        = 'xlat';   {Translation Manager}
Gestalt returns in the response parameter a bit field that encodes information about the Translation Manager. Currently only 1 bit is used:

   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 the response parameter for the Standard File Package, the Edition Manager, and the Scrap Manager.

Listing 7-1 Translation-specific selectors and response bit for Gestalt

   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 the Gestalt function, see the chapter "Gestalt Manager" in Inside Macintosh: Operating System Utilities.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996