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: QuickDraw GX Environment and Utilities /
Chapter 6 - Message Manager / Using the Message Manager


Sending and Forwarding Messages

Message objects can send a printing message to other clients in the message chain. When a message is sent, QuickDraw GX receives it and sends it to the first message handler in the chain. In Figure 6-2 this is the application.

QuickDraw GX provides two methods of sending messages. You can use a statement with the format:

anErr = Send_GXMessageName(arguments);
A typical example is

anErr = Send_GXCompleteSpoolFile(theSpoolFile);
Alternatively, you can use the SendMessage function to send a specified message to the top of the message chain.

You can use the ForwardMessage function to specify the message to be forwarded to the next message handler. This function takes a selector that indicates the message to be forwarded and has parameters that are message-specific.

For example, a four-up printing extension that maps four document pages onto one physical page at print time may require that the GXCountPages message be forwarded. The GXCountPages message has the following interface:

OSErr GXCountPages (gxSpoolFile thePrintFile, long* numPages);
You can use the ForwardThisMessage function to forward the current message to the next message handler.

anErr = ForwardThisMessage(gxCountPages, thePrintFile, &numPages);
All the QuickDraw GX Forward_xxx functions, where xxx is the QuickDraw GX printing message to forward, are in-line aliases to the ForwardThisMessage function with the message-specific parameters added for type-checking purposes. An example of the recommended format for forwarding a message is:

anErr = Forward_GXCountPages(thePrintFile, &numPages);
The SendMessage function is described on page 6-23. The ForwardMessage function is described on page 6-24. The ForwardThisMessage function is described on page 6-25.

Printing messages are described in the "Printing Messages" chapter of Inside Macintosh: QuickDraw GX Printing Extensions and Drivers.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996