Important: The information in this document is obsolete and should not be used for new development.
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 theSendMessage
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. TheGXCountPages
message has the following interface:
OSErr GXCountPages (gxSpoolFile thePrintFile, long* numPages);You can use theForwardThisMessage
function to forward the current message to the next message handler.
anErr = ForwardThisMessage(gxCountPages, thePrintFile, &numPages);All the QuickDraw GXForward_xxx
functions, wherexxx
is the QuickDraw GX printing message to forward, are in-line aliases to theForwardThisMessage
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);TheSendMessage
function is described on page 6-23. TheForwardMessage
function is described on page 6-24. TheForwardThisMessage
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.