Important: The information in this document is obsolete and should not be used for new development.
You can create a shape-spooling function that handles QuickDraw drawing commands that have been translated into QuickDraw GX shapes. The shape-spooling function must have a prototype of this form:
MyShapeSpooler
OSErr MyShapeSpooler(gxShape toSpool, void *refCon);
toSpool- A reference to the shape just translated by the translator.
refCon- A pointer to a reference constant, passed to your spool function by the translator, that you can use for any purpose.
- function result
- An result code of type
OSErr. You should pass 0 if no error occurs.DESCRIPTION
When you install the QuickDraw-to-QuickDraw GX translator with theGXInstallQDTranslatorfunction, the translator intercepts all subsequent QuickDraw drawing commands, converts them to QuickDraw GX shapes, and passes those shapes to this shape-spooling function. Your shape-spooling function can draw each shape, add it to a picture, or perform any other action you wish.You install this function by providing a pointer to it when you call the
GXInstallQDTranslatorfunction. When you callGXInstallQDTranslator, you also provide therefConvalue that will be passed to this filter function. TherefConvalue can be used for any purpose; for example, it might contain a view port reference for drawing, a pointer to a buffer for collecting spooled data, or anything else useful to the shape-spooling function.After your application has finished intercepting and converting QuickDraw calls and passing them to this shape-spooling function, your application must remove the translator by calling the
GXRemoveQDTranslatorfunction.If your shape-spooling function encounters an error during processing, it should return a nonzero value (usually the error code). If the shape-spooling function returns a nonzero value, the translator ceases translating QuickDraw commands. If an error occurs, your application must still call the
GXRemoveQDTranslatorfunction to remove the translator.SEE ALSO
TheGXInstallQDTranslatorfunction is described on page 1-36. TheGXRemoveQDTranslatorfunction is described on page 1-39.For a general description of the QuickDraw-to-QuickDraw GX translator, see the section "Using the QuickDraw-to-QuickDraw GX Translator" beginning on page 1-10.