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: Text /
Chapter 3 - QuickDraw Text / Using QuickDraw Text


Preparing to Use QuickDraw

The QuickDraw text-handling routines rely on both QuickDraw and the Script Manager. Therefore, before you call any of these routines, you need to determine what versions of QuickDraw and the Script Manager are installed, and initialize QuickDraw. For more information about determining the version of the Script Manager, see the chapter "Script Manager" in this book.

Determining the Version and Initializing QuickDraw

To determine the current version of QuickDraw, you call the Gestalt function with the gestaltQuickdrawVersion selector. The gestaltQuickdrawVersion selector returns a 2-byte value indicating the version of QuickDraw currently present. The high-order byte of that number represents the major revision number, and the low-order byte represents the minor revision number. These are the currently defined values for the QuickDraw selector.
ConstantValue
gestaltOriginalQD$000
gestaltOriginalQD1$001
gestalt8BitQD$100
gestalt32BitQD$200
gestalt32BitQD11$210
gestalt32BitQD12$220
gestalt32BitQD13$230

Gestalt returns a 4-byte value in its response parameter; the low-order word contains QuickDraw version data. In that low-order word, the high-order byte gives the major revision number and the low-order byte the minor revision. Major revisions currently defined are the original QuickDraw, the original Color QuickDraw, and the current 32-Bit QuickDraw with direct-pixel capability.

Values having a major revision number of 1 or 2 indicate that Color QuickDraw is available in either the 8-bit or 32-bit version. These results do not, however, indicate whether a color monitor is attached to the system. You need to use high-level QuickDraw routines to obtain that information.

Many Macintosh applications don't care what version of QuickDraw is available on the user's system: they don't use color at all, use only the basic QuickDraw color model, or specify all their colors abstractly, in RGB form. If your application does depend on a specific version of QuickDraw, you can check the version at run time and adapt to make best use of the available hardware (or at least inform the user gracefully that your program's graphics needs aren't being met).

For more information about the Gestalt function, see the chapter "Gestalt Manager" in Inside Macintosh: OSUtilities.

Initialize QuickDraw at the beginning of your program before any other parts of the Toolbox. To do so, call the InitGraf procedure. For more information about the InitGraf procedure, see Inside Macintosh: Imaging.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996