Important: The information in this document is obsolete and should not be used for new development.
Testing for the Presence and Version of QuickDraw GX
You can use theGestalt
function in your application to determine which parts of QuickDraw GX are installed and their version numbers. TheGestalt
function returns a 32-bit value that indicates the version of QuickDraw GX that is installed. The graphics and typography part of QuickDraw GX has one version number, the printing part of QuickDraw GX has another, and there is an overall version number that applies to all of QuickDraw GX. In addition, you can determine if the debugging version or the non-debugging version of QuickDraw GX is installed, and if the installed version is native to PowerPC system software.To determine the current version of QuickDraw GX in general, you call the
Gestalt
function with thegestaltGXVersion
selector. The function returns a value indicating the version of QuickDraw GX printing currently installed. For version 1.0, the value returned is 0x00010000.To determine the current version of the graphics and typography parts of QuickDraw GX, you call the
Gestalt
function with thegestaltGraphicsVersion
selector. The function returns a value indicating the version of QuickDraw GX graphics and typography currently installed. For version 1.0, the value returned is 0x00010000.To determine the current version of the printing part of QuickDraw GX, you call the
Gestalt
function with thegestaltPrintingMgrVersion
selector. The function returns a value indicating the version of QuickDraw GX printing currently installed. For version 1.0, the value returned is 0x00010000.To determine if the debugging or non-debugging version of QuickDraw GX is currently installed, or if the installed version is native to PowerPC system software, you call the
Gestalt
function with thegestaltGraphicsAttr
selector. ThegestaltGraphicsisDebugging
attribute value is returned if the debugging version of QuickDraw GX is installed. ThegestaltGraphicsisLoaded
attribute value is returned if the non-debugging version of QuickDraw GX is installed. The gestaltGraphicsIsPowerPC attribute value is returned if the installed version of QuickDraw GX is PowerPC-native. The return value can be any combination of those attributes.Listing 1-1 uses the
gestaltGraphicsVersion
andgestaltPrintingMgrVersion
selectors to determine whether QuickDraw GX graphics and typography as well as QuickDraw GX printing are installed. This listing also uses thegestaltGraphicsAttr
selector to determine whether the installed version of QuickDraw GX is the debugging or non-debugging version.Listing 1-1 Determining the presence and features of QuickDraw GX
Boolean QuickDrawGXAvailable(Boolean *pIsDebugging) { Boolean returnValue = false; long theFeature, flags; if(Gestalt(gestaltGraphicsVersion, &theFeature) == noErr) { returnValue = true; if (Gestalt(gestaltPrintingMgrVersion, &theFeature) == noErr) gQDGXPrintingInstalled = true; } else returnValue = false; if (Gestalt(gestaltGraphicsAttr, &theFeature) == noErr) { if (flags & gestaltGraphicsisDebugging) pIsDebugging = true; else pIsDebugging = false; } return returnValue; }For additional details concerning the use of theGestalt
function to determine features of the QuickDraw GX environment, see the chapter "Gestalt Manager" in Inside Macintosh: Operating System Utilities.