September 94 - Adding QuickDraw GX Printing to QuickDraw Applications
Adding QuickDraw GX Printing to QuickDraw Applications
DAVE HERSEY
Now that QuickDraw GX has been released, you may be wondering what to do with your
older QuickDraw applications. The good news is that by adding a relatively small
percentage of code to your existing applications, you can support all the new features
of the QuickDraw GX printing architecture and still retain full compatibility with
non-QuickDraw GX systems.
Compatibility with the existing application base was a primary concern during
thedevelopment of QuickDraw GX; only the most hardened "print criminals" shouldhave
compatibility problems. Since a pre-QuickDraw GX application should work in both
QuickDraw GX and non-QuickDraw GX environments, you may think that leaving your
code as it stands is good enough. Becoming compatible probably doesn't require any
revisions to your existing software, and the fact that your application will perform
with or without QuickDraw GX sounds like a pretty good deal. Where's the catch?
Here it is: A non-QuickDraw GX application doesn't have access to several key features
of QuickDraw GX, so its users can't take advantage of many of the new printing
features. For example, with QuickDraw GX a user can:
• Redirect print jobs using the new Print dialog.
• Choose page-by-page formatting, so that page 1 prints on US Letter, page
2 prints on #10 envelope, page 3 prints on landscape-oriented US Legal, and
so on, instead of printing the entire document in a single format.
• Work with the new QuickDraw GX printing dialogs (shown in Figure 1)
instead of the dialogs provided for compatibility with non-QuickDraw GX
applications.
• Use features provided by printing extensions. Printing extensions can add
items to the QuickDraw GX printing dialogs, but not to the compatibility
dialogs. (Added items show up as icons in the column on the left side of each
dialog.)
• Print a single copy of a document with the new Print One Copy command.
• Print documents by dragging them to desktop printers.
Page Setup dialog
Custom Page Setup dialog
Print dialog
Figure 1. The new QuickDraw GX printing dialogs
Users are shut out from all these features if they're using a non-QuickDraw GX
application. In this article, you'll see how to increase an application's level of
QuickDraw GX support. I'll take a QuickDraw application and convert it step by step
into an application that fully supports both the QuickDraw and QuickDraw GX printing
architectures. First, we'll consider some definitions and background information.
DIFFERENT LEVELS OF QUICKDRAW GX SUPPORT
To begin, let's define the different levels of QuickDraw GX support (from lowest to
highest) that an application can have:
• QuickDraw GX unaware: The application doesn't implement any
QuickDraw GX code, and QuickDraw GX translates all QuickDraw printing and