Important: The information in this document is obsolete and should not be used for new development.
You can create a filter function that handles intercepted QuickDraw GX drawing calls. The filter function must have a prototype of this form:
MyViewPortFilter
void MyViewPortFilter(gxShape toFilter, gxViewPort portOrder, long refCon);
toFilter- A reference to the shape to be filtered--that is, the shape that would have been drawn to the view port specified in the
portOrderparameter.portOrder- A reference to the view port in which this filter function has been installed.
refCon- A reference constant that your filter function can use in any manner.
DESCRIPTION
Once this filter function is installed, QuickDraw GX calls it any time a function is executed that draws a shape in the view port referenced by theportOrderparameter. Instead of drawing the shape, QuickDraw GX passes the shape to this function. Your filter function can perform actions other than drawing (such as spooling), or it can otherwise modify or process the shape.Your application installs this filter function by providing a pointer to it when calling the
GXSetViewPortFilterfunction. When your application calls the functionGXSetViewPortFilter, it also provides therefConvalue that will be passed to this filter function.The value passed to you in the
refConparameter can be used for any purpose; for example, it might contain a reference to a different view port for drawing to, a pointer to a buffer for collecting spooled data, or anything else useful to the filter function. TheportOrderparameter allows you to identify the view port being intercepted, in case the filter function is installed on more than one view port.Your application can get a pointer to this installed filter function at any time by calling the
GXGetViewPortFilterfunction. After you are finished intercepting drawing calls, your application can remove the filter function by calling theGXSetViewPortFilterfunction with anilfilter-function pointer.SEE ALSO
TheGXSetViewPortFilterfunction is described on page 1-31. The toGXGetViewPortFilterfunction is described on page 1-32.