Important: The information in this document is obsolete and should not be used for new development.
Customizing QuickDraw Operations
For each shape that QuickDraw can draw, there are procedures that perform these basic graphics operations on the shape: frame, paint, erase, invert, and fill. Those procedures in turn call a low-level drawing routine for the shape. For example, theFrameOval
,PaintOval
,EraseOval
,InvertOval
, andFillOval
procedures all call the low-level procedureStdOval
, which draws the oval.Other low-level routines defined by QuickDraw are:
For each type of object QuickDraw can draw, including text and lines, there's a pointer to one of these low-level routines.
- The procedure called by
CopyBits
that performs bit and pixel transfer.- The function that measures the width of text and is called by the QuickDraw text routines
CharWidth
,StringWidth
, andTextWidth
. (These QuickDraw text routines are described in the chapter "QuickDraw Text" in Inside Macintosh: Text.)- The procedure that processes picture comments. The standard procedure ignores picture comments. (Picture comments are described in Appendix B.)
- The procedure that saves drawing commands as the definition of a picture, and the procedure that retrieves them. These two enable your application to draw on remote devices, print to the disk, get picture input from the disk, and support large pictures.
The
grafProcs
field of aGrafPort
orCGrafPort
record determines which low-level routines are called. If that field contains the value ofNIL
, the standard routines are called. You can set thegrafProcs
field to point to a record of pointers to your own routines. For a basic graphics port, this record of pointers is defined by aQDProcs
record. As described in the chapter "Color QuickDraw," these pointers are contained
in aCQDProcs
record for a color graphics port. By changing these pointers, you can install your own routines, and either completely override the standard ones or call them after your routines have modified their parameters as necessary.To assist you in setting up a record, basic QuickDraw provides the
SetStdProcs
procedure, which is described in the next section. You can use theSetStdProcs
procedure to get aQDProcs
record with fields that point to basic QuickDraw's standard low-level routines. You can then reset the routines with which you are concerned. By pointing to your modifiedQDProcs
record in thegrafProcs
field of aGrafPort
record, you can replace some or all of basic QuickDraw's standard low-level routines.The standard QuickDraw low-level routines are described in the rest of this section. These low-level routines should be called only from your customized routines.
Subtopics
- SetStdProcs
- StdText
- StdLine
- StdRect
- StdRRect
- StdOval
- StdArc
- StdPoly
- StdRgn
- StdBits
- StdComment
- StdTxtMeas
- StdGetPic
- StdPutPic