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: Advanced Color Imaging on the Mac OS /
Chapter 4 - Developing ColorSync-Supportive Applications / Developing Your ColorSync-Supportive Application


Determining if the ColorSync Manager Is Available

To determine whether version 2.x of the ColorSync Manager is available on a 68K-based or a PowerPC-based Macintosh system, you use the Gestalt function with the gestaltColorMatchingVersion selector. The function shown in Listing 4-1 returns a Boolean value of true if version 2.0 or later of the ColorSync Manager is installed and false if not.

Listing 4-1 Determining if ColorSync 2.x is available

Boolean ColorSync2xAvailable (void)
{
   Boolean haveColorSync2x = false;
   long  version;

   if (Gestalt(gestaltColorMatchingVersion, &version) == noErr)
   { 
      if (version >= gestaltColorSync20)
      {
         haveColorSync2x = true;
      }
   }
   return haveColorSync2x;
}
If your application depends on features added for version 2.1 of the ColorSync Manager, substitute gestaltColorSync21 for gestaltColorSync20 in the previous function. If you need to identify earlier versions of ColorSync, use any of the ColorSync Gestalt selector constants described in "Constants for ColorSync Manager Gestalt Selectors and Responses" (page 3-7) in Advanced Color Imaging Reference.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
13 NOV 1996