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: Imaging With QuickDraw /
Chapter 3 - QuickDraw Drawing


Summary of QuickDraw Drawing

Pascal Summary

Constants

CONST
   {basic QuickDraw colors}
   whiteColor     = 30;
   blackColor     = 33;
   yellowColor    = 69;
   magentaColor   = 137;
   redColor       = 205;
   cyanColor      = 273;
   greenColor     = 341;
   blueColor      = 409;

   {source modes for basic graphics ports}
   srcCopy        = 0;  {where source pixel is black, force destination }
                        { pixel black; where source pixel is white, force }
                        { destination pixel white}
   srcOr          = 1;  {where source pixel is black, force destination }
                        { pixel black; where source pixel is white, leave }
                        { destination pixel unaltered}
   srcXor         = 2;  {where source pixel is black, invert destination }
                        { pixel; where source pixel is white, leave }
                        { destination pixel unaltered}
   srcBic         = 3;  {where source pixel is black, force destination }
                        { pixel white; where source pixel is white, leave }
                        { destination pixel unaltered}
   notSrcCopy     = 4;  {where source pixel is black, force destination }
                        { pixel white; where source pixel is white, force }
                        { destination pixel black}
   notSrcOr       = 5;  {where source pixel is black, leave destination }
                        { pixel unaltered; where source pixel is white, }
                        { force destination pixel black}
notSrcXor      = 6;  {where source pixel is black, leave destination }
                        { pixel unaltered; where source pixel is white, }
                        { invert destination pixel}
   notSrcBic      = 7;  {where source pixel is black, leave destination }
                        { pixel unaltered; where source pixel is white, }
                        { force destination pixel white}

   {pattern modes}
   patCopy        = 8;  {where pattern pixel is black, apply foreground }
                        { color to destination pixel; where pattern pixel }
                        { is white, apply background color to destination }
                        { pixel}
   patOr          = 9;  {where pattern pixel is black, invert destination }
                        { pixel; where pattern pixel is white, leave }
                        { destination pixel unaltered}
   patXor         = 10; {where pattern pixel is black, invert destination }
                        { pixel; where pattern pixel is white, leave }
                        { destination pixel unaltered}
   patBic         = 11; {where pattern pixel is black, apply background }
                        { color to destination pixel; where pattern pixel }
                        { is white, leave destination pixel unaltered}
   notPatCopy     = 12; {where pattern pixel is black, apply background }
                        { color to destination pixel; where pattern pixel }
                        { is white, apply foreground color to destination }
                        { pixel}
   notPatOr       = 13; {where pattern pixel is black, leave destination }
                        { pixel unaltered; where pattern pixel is white, }
                        { apply foreground color to destination pixel}
   notPatXor      = 14; {where pattern pixel is black, leave destination }
                        { pixel unaltered; where pattern pixel is white, }
                        { invert destination pixel}
   notPatBic      = 15; {where pattern pixel is black, leave destination }
                        { pixel unaltered; where pattern pixel is white, }
                        { apply background color to destination pixel}
ditherCopy     = 64; {add to source mode for dithering}
{pattern list resource ID for patterns in the System file}
   sysPatListID = 0;

Data Types

TYPE PolyPtr   = ^Polygon;
PolyHandle     = ^PolyPtr;
Polygon        =  
RECORD
   polySize:   Integer;                {size in bytes}
   polyBBox:   Rect;                   {bounding rectangle}
   polyPoints: ARRAY[0..0] OF Point;   {vertices for polygon}
END;
PenState =
RECORD
   pnLoc:   Point;      {pen location}
   pnSize:  Point;      {pen size}
   pnMode:  Integer;    {pen's pattern mode}
   pnPat:   Pattern;    {pen pattern}
END;
QDProcsPtr     = ^QDProcs;
QDProcs        =
RECORD
   textProc:      Ptr;  {text drawing}
   lineProc:      Ptr;  {line drawing}
   rectProc:      Ptr;  {rectangle drawing}
   rRectProc:     Ptr;  {roundRect drawing}
   ovalProc:      Ptr;  {oval drawing}
   arcProc:       Ptr;  {arc/wedge drawing}
   rgnProc:       Ptr;  {region drawing}
   bitsProc:      Ptr;  {bit transfer}
   commentProc:   Ptr;  {picture comment processing}
   txMeasProc:    Ptr;  {text width measurement}
   getPicProc:    Ptr;  {picture retrieval}
   putPicProc:    Ptr;  {picture saving}
END;
GrafVerb = (frame,paint,erase,invert,fill);
PatPtr            = ^Pattern;
PatHandle         = ^PatPtr;
Pattern           = PACKED ARRAY[0..7] OF 0..255;

Routines

Managing the Graphics Pen

PROCEDURE HidePen;
PROCEDURE ShowPen;
PROCEDURE GetPen        (VAR pt: Point);
PROCEDURE GetPenState   (VAR pnState: PenState);
PROCEDURE SetPenState   (pnState: PenState);
PROCEDURE PenSize       (width,height: Integer);
PROCEDURE PenMode       (mode: Integer);
PROCEDURE PenPat        (pat: Pattern);
PROCEDURE PenNormal;

Changing the Background Bit Pattern

PROCEDURE BackPat       (pat: Pattern); 

Drawing Lines

PROCEDURE MoveTo        (h,v: Integer);
PROCEDURE Move          (dh,dv: Integer);
PROCEDURE LineTo        (h,v: Integer);
PROCEDURE Line          (dh,dv: Integer);

Creating and Managing Rectangles

PROCEDURE SetRect       (VAR r: Rect; left,top,right,bottom: Integer);
PROCEDURE OffsetRect    (VAR r: Rect; dh,dv: Integer);
PROCEDURE InsetRect     (VAR r: Rect; dh,dv: Integer);
FUNCTION SectRect       (src1,src2: Rect; VAR dstRect: Rect): Boolean;
PROCEDURE UnionRect     (src1,src2: Rect; VAR dstRect: Rect);
FUNCTION PtInRect       (pt: Point; r: Rect): Boolean;
PROCEDURE Pt2Rect       (pt1,pt2: Point; VAR dstRect: Rect);
PROCEDURE PtToAngle     (r: Rect; pt: Point; VAR angle: Integer);
FUNCTION EqualRect      (rect1,rect2: Rect): Boolean;
FUNCTION EmptyRect      (r:  Rect): Boolean;

Drawing Rectangles

PROCEDURE FrameRect     (r: Rect);
PROCEDURE PaintRect     (r: Rect);
PROCEDURE FillRect      (r: Rect; pat: Pattern);
PROCEDURE EraseRect     (r: Rect);
PROCEDURE InvertRect    (r: Rect);

Drawing Rounded Rectangles

PROCEDURE FrameRoundRect  (r: Rect; ovalWidth,ovalHeight: Integer);
PROCEDURE PaintRoundRect  (r: Rect; ovalWidth,ovalHeight: Integer);
PROCEDURE FillRoundRect   (r: Rect; ovalWidth,ovalHeight: Integer; 
                           pat: Pattern);
PROCEDURE EraseRoundRect  (r: Rect; ovalWidth,ovalHeight: Integer);
PROCEDURE InvertRoundRect (r: Rect; ovalWidth,ovalHeight: Integer);

Drawing Ovals

PROCEDURE FrameOval     (r: Rect);
PROCEDURE PaintOval     (r: Rect);
PROCEDURE FillOval      (r: Rect; pat: Pattern);
PROCEDURE EraseOval     (r: Rect);
PROCEDURE InvertOval    (r: Rect);

Drawing Arcs and Wedges

PROCEDURE FrameArc      (r: Rect; startAngle,arcAngle: Integer);
PROCEDURE PaintArc      (r: Rect; startAngle,arcAngle: Integer);
PROCEDURE FillArc       (r: Rect; startAngle,arcAngle: Integer; 
                         pat: Pattern);
PROCEDURE EraseArc      (r: Rect; startAngle,arcAngle: Integer);
PROCEDURE InvertArc     (r: Rect; startAngle,arcAngle: Integer);

Creating and Managing Polygons

FUNCTION OpenPoly  : PolyHandle;
PROCEDURE ClosePoly;
PROCEDURE OffsetPoly    (poly: PolyHandle; dh,dv: Integer);
PROCEDURE KillPoly      (poly: PolyHandle);

Drawing Polygons

PROCEDURE FramePoly     (poly: PolyHandle);
PROCEDURE PaintPoly     (poly: PolyHandle);
PROCEDURE FillPoly      (poly: PolyHandle; pat: Pattern);
PROCEDURE ErasePoly     (poly: PolyHandle);
PROCEDURE InvertPoly    (poly: PolyHandle);

Creating and Managing Regions

FUNCTION NewRgn : RgnHandle;
PROCEDURE OpenRgn;
PROCEDURE CloseRgn      (dstRgn: rgnHandle);
PROCEDURE DisposeRgn    (rgn: RgnHandle);
PROCEDURE CopyRgn       (srcRgn,dstRgn: RgnHandle);
PROCEDURE SetEmptyRgn   (rgn: RgnHandle);
PROCEDURE SetRectRgn    (rgn: RgnHandle; 
                         left,top,right,bottom: Integer);
PROCEDURE RectRgn       (rgn: RgnHandle; r: Rect);
PROCEDURE OffsetRgn     (rgn: RgnHandle; dh,dv: Integer);
PROCEDURE InsetRgn      (rgn: RgnHandle; dh,dv: Integer);
PROCEDURE SectRgn       (srcRgnA,srcRgnB,dstRgn: RgnHandle);
PROCEDURE UnionRgn      (srcRgnA,srcRgnB,dstRgn: RgnHandle);
PROCEDURE DiffRgn       (srcRgnA,srcRgnB,dstRgn: RgnHandle);
PROCEDURE XorRgn        (srcRgnA,srcRgnB,dstRgn: RgnHandle);
FUNCTION PtInRgn        (pt: Point; rgn: RgnHandle): Boolean;
FUNCTION RectInRgn      (r: Rect; rgn: RgnHandle): Boolean;
FUNCTION EqualRgn       (rgnA,rgnB: RgnHandle): Boolean;
FUNCTION EmptyRgn       (rgn: RgnHandle): Boolean;

Drawing Regions

PROCEDURE FrameRgn      (rgn: RgnHandle);
PROCEDURE PaintRgn      (rgn: RgnHandle);
PROCEDURE FillRgn       (rgn: RgnHandle; pat: Pattern);
PROCEDURE EraseRgn      (rgn: RgnHandle);
PROCEDURE InvertRgn     (rgn: RgnHandle);

Scaling and Mapping Points, Rectangles, Polygons, and Regions

PROCEDURE ScalePt       (VAR pt: Point; srcRect,dstRect: Rect);
PROCEDURE MapPt         (VAR pt: Point; srcRect,dstRect: Rect);
PROCEDURE MapRect       (VAR r: Rect; srcRect,dstRect: Rect);
PROCEDURE MapRgn        (rgn: RgnHandle; srcRect,dstRect: Rect);
PROCEDURE MapPoly       (poly: PolyHandle; srcRect,dstRect: Rect);

Calculating Black-and-White Fills

PROCEDURE SeedFill      (srcPtr,dstPtr: Ptr; 
                         srcRow,dstRow,height,words,
                         seedH,seedV: Integer);
PROCEDURE CalcMask      (srcPtr,dstPtr: Ptr; 
                         srcRow,dstRow,height,words: Integer);

Copying Images

PROCEDURE CopyBits      (srcBits,dstBits: BitMap; 
                         srcRect,dstRect: Rect; mode: Integer; 
                         maskRgn: RgnHandle);
PROCEDURE CopyMask      (srcBits,maskBits,dstBits: BitMap; 
                         srcRect,maskRect,dstRect: Rect);
PROCEDURE CopyDeepMask  (srcBits: BitMap; maskBits: BitMap; 
                         dstBits: BitMap; srcRect: Rect; 
                         maskRect: Rect; dstRect: Rect; 
                         mode: Integer; maskRgn: RgnHandle);

Drawing With the Eight-Color System

PROCEDURE ForeColor     (color: LongInt);
PROCEDURE BackColor     (color: LongInt);
PROCEDURE ColorBit      (whichBit: Integer);

Determining Whether QuickDraw Has Finished Drawing

FUNCTION QDDone         (port: GrafPtr): Boolean;

Getting Pattern Resources

FUNCTION GetPattern     (patID: Integer): PatHandle;
PROCEDURE GetIndPattern (VAR thePattern: Pattern; patListID: Integer; 
                         index: Integer);

Customizing QuickDraw Operations

PROCEDURE SetStdProcs   (VAR procs: QDProcs);
PROCEDURE StdText       (byteCount: Integer; textBuf: Ptr; 
                         numer,denom: Point);
PROCEDURE StdLine       (newPt: Point);
PROCEDURE StdRect       (verb: GrafVerb; r: Rect);
PROCEDURE StdRRect      (verb: GrafVerb; r: Rect; 
                         ovalwidth,ovalHeight: Integer);
PROCEDURE StdOval       (verb: GrafVerb; r: Rect);
PROCEDURE StdArc        (verb: GrafVerb; r: Rect; 
                         startAngle,arcAngle: Integer);
PROCEDURE StdPoly       (verb: GrafVerb; poly: PolyHandle);
PROCEDURE StdRgn        (verb: GrafVerb; rgn: RgnHandle);
PROCEDURE StdBits       (VAR srcBits: BitMap; 
                         VAR srcRect,dstRect: Rect; mode: Integer; 
                         maskRgn: RgnHandle);
PROCEDURE StdComment    (kind,dataSize: Integer; dataHandle: Handle);
FUNCTION StdTxtMeas     (byteCount: Integer; textAddr: Ptr; 
                         VAR numer, denom: Point; 
                         VAR info: FontInfo): Integer;
PROCEDURE StdGetPic     (dataPtr: Ptr; byteCount: Integer);
PROCEDURE StdPutPic     (dataPtr: Ptr; byteCount: Integer);

C Summary

Constants

enum {
   /* basic QuickDraw colors */
   whiteColor     = 30;
   blackColor     = 33;
   yellowColor    = 69;
   magentaColor   = 137;
   redColor       = 205;
   cyanColor      = 273;
   greenColor     = 341;
   blueColor      = 409;

/* source modes */
   srcCopy        = 0,  /* where source pixel is black, force destination 
                        pixel black; where source pixel is white, force
                        destination pixel white */
   srcOr          = 1,  /* where source pixel is black, force destination 
                        pixel black; where source pixel is white, leave 
                        destination pixel unaltered */
   srcXor         = 2,  /* where source pixel is black, invert destination
                        pixel; where source pixel is white, leave 
                        destination pixel unaltered */
   srcBic         = 3,  /* where source pixel is black, force destination 
                        pixel white; where source pixel is white, leave
                        destination pixel unaltered */
   notSrcCopy     = 4,  /* where source pixel is black, force destination
                        pixel white; where source pixel is white, force
                        destination pixel black */
   notSrcOr       = 5,  /* where source pixel is black, leave destination
                        pixel unaltered; where source pixel is white,
                        force destination pixel black */
   notSrcXor      = 6,  /* where source pixel is black, leave destination 
                        pixel unaltered; where source pixel is white, 
                        invert destination pixel*/
   notSrcBic      = 7,  /* where source pixel is black, leave destination
                        pixel unaltered; where source pixel is white,
                        force destination pixel white */

   /* pattern modes */
   patCopy        = 8,  /* where pattern pixel is black, apply foreground
                        color to destination pixel; where pattern pixel 
                        is white, apply background color to destination 
                        pixel */
   patOr          = 9,  /* where pattern pixel is black, invert destination 
                        pixel; where pattern pixel is white, leave
                        destination pixel unaltered */
   patXor         = 10; /* where pattern pixel is black, invert destination
                        pixel; where pattern pixel is white, leave
                        destination pixel unaltered */
   patBic         = 11; /* where pattern pixel is black, apply background
                        color to destination pixel; where pattern pixel
                        is white, leave destination pixel unaltered */
notPatCopy     = 12; /* where pattern pixel is black, apply background 
                        color to destination pixel; where pattern pixel 
                        is white, apply foreground color to destination 
                        pixel */
   notPatOr       = 13; /* where pattern pixel is black, leave destination
                        pixel unaltered; where pattern pixel is white,
                        apply foreground color to destination pixel */
   notPatXor      = 14; /* where pattern pixel is black, leave destination 
                        pixel unaltered; where pattern pixel is white,
                        invert destination pixel */
   notPatBic      = 15; /* where pattern pixel is black, leave destination 
                        pixel unaltered; where pattern pixel is white,
                        apply background color to destination pixel */
ditherCopy     = 64, /* add to source mode for dithering */
/* pattern list resource ID for patterns in the System file */
   sysPatListID = 0
};

Data Types

struct Polygon {
   short polySize;      /* size in bytes */
   Rect  polyBBox;      /* bounding rectangle */
   Point polyPoints[1]; /* vertices for polygon */
};
typedef struct Polygon Polygon;
typedef Polygon *PolyPtr, **PolyHandle;
struct PenState {
   Point    pnLoc;      /* pen location */
   Point    pnSize;     /* pen size */
   short    pnMode;     /* pen's pattern mode */
   Pattern  pnPat;      /* pen pattern */
};
typedef struct PenState PenState;
struct QDProcs {
   Ptr textProc;        /* text drawing */
   Ptr lineProc;        /* line drawing */
   Ptr rectProc;        /* rectangle drawing */
   Ptr rRectProc;       /* roundRect drawing */
   Ptr ovalProc;        /* oval drawing */
   Ptr arcProc;         /* arc and wedge drawing */
   Ptr polyProc;        /* region drawing */
   Ptr rgnProc;         /* region drawing */
   Ptr bitsProc;        /* bit transfer */
   Ptr commentProc;     /* picture comment processing */
   Ptr txMeasProc;      /* text width measurement */
   Ptr getPicProc;      /* picture retrieval */
   Ptr putPicProc;      /* picture saving */
};
typedef struct QDProcs QDProcs;
typedef QDProcs *QDProcsPtr;
enum {frame,paint,erase,invert,fill};
typedef unsigned char GrafVerb;
struct Pattern{
   unsigned char pat[8];
};
typedef struct Pattern Pattern;
typedef Pattern *PatPtr;
typedef const unsigned char *ConstPatternParam;
typedef PatPtr *PatHandle;

Functions

Managing the Graphics Pen

pascal void HidePen         (void);
pascal void ShowPen         (void);
pascal void GetPen          (Point *pt);
pascal void GetPenState     (PenState *pnState);
pascal void SetPenState     (const PenState *pnState);
pascal void PenSize         (short width, short height);
pascal void PenMode         (short mode);
pascal void PenPat          (ConstPatternParam pat);
pascal void PenNormal       (void);

Changing the Background Bit Pattern

pascal void BackPat         (ConstPatternParam pat); 

Drawing Lines

pascal void MoveTo          (short h, short v);
pascal void Move            (short dh, short dv);
pascal void LineTo          (short h, short v);
pascal void Line            (short dh, short dv);

Creating and Managing Rectangles

pascal void SetRect         (Rect *r, short left, short top, short right, 
                             short bottom);
pascal void OffsetRect      (Rect *r, short dh, short dv);
pascal void InsetRect       (Rect *r, short dh, short dv);
pascal Boolean SectRect     (const Rect *src1, const Rect *src2, 
                             Rect *dstRect);
pascal void UnionRect       (const Rect *src1, const Rect *src2, 
                             Rect *dstRect);
pascal Boolean PtInRect     (Point pt, const Rect *r);
pascal void Pt2Rect         (Point pt1, Point pt2, Rect *dstRect);
pascal void PtToAngle       (const Rect *r, Point pt, short *angle);
pascal Boolean EqualRect    (const Rect *rect1, const Rect *rect2);
pascal Boolean EmptyRect    (const Rect *r);

Drawing Rectangles

pascal void FrameRect       (const Rect *r);
pascal void PaintRect       (const Rect *r);
pascal void FillRect        (const Rect *r, ConstPatternParam pat);
pascal void EraseRect       (const Rect *r);
pascal void InvertRect      (const Rect *r);

Drawing Rounded Rectangles

pascal void FrameRoundRect  (const Rect *r, short ovalWidth, 
                             short ovalHeight);
pascal void PaintRoundRect  (const Rect *r, short ovalWidth,
                             short ovalHeight);
pascal void FillRoundRect   (const Rect *r, short ovalWidth,
                             short ovalHeight, ConstPatternParam pat);
pascal void EraseRoundRect  (const Rect *r, short ovalWidth, 
                             short ovalHeight);
pascal void InvertRoundRect
                            (const Rect *r, short ovalWidth,
                             short ovalHeight);

Drawing Ovals

pascal void FrameOval       (const Rect *r);
pascal void PaintOval       (const Rect *r);
pascal void FillOval        (const Rect *r, ConstPatternParam pat);
pascal void EraseOval       (const Rect *r);
pascal void InvertOval      (const Rect *r);

Drawing Arcs and Wedges

pascal void FrameArc        (const Rect *r, short startAngle,
                             short arcAngle);
pascal void PaintArc        (const Rect *r, short startAngle,
                             short arcAngle);
pascal void FillArc         (const Rect *r, short startAngle, 
                             short arcAngle, ConstPatternParam pat);
pascal void EraseArc        (const Rect *r, short startAngle,
                             short arcAngle);
pascal void InvertArc       (const Rect *r, short startAngle,
                             short arcAngle);

Creating and Managing Polygons

pascal PolyHandle OpenPoly  (void);
pascal void ClosePoly       (void);
pascal void OffsetPoly      (PolyHandle poly, short dh, short dv);
pascal void KillPoly        (PolyHandle poly);

Drawing and Painting Polygons

pascal void FramePoly       (PolyHandle poly);
pascal void PaintPoly       (PolyHandle poly);
pascal void FillPoly        (PolyHandle poly, ConstPatternParam pat);
pascal void ErasePoly       (PolyHandle poly);
pascal void InvertPoly      (PolyHandle poly);

Creating and Managing Regions

pascal RgnHandle NewRgn     (void);
pascal void OpenRgn         (void);
pascal void CloseRgn        (RgnHandle dstRgn);
pascal void DisposeRgn      (RgnHandle rgn);
pascal void CopyRgn         (RgnHandle srcRgn, RgnHandle dstRgn);
pascal void SetEmptyRgn     (RgnHandle rgn);
pascal void SetRectRgn      (RgnHandle rgn, short left, short top, 
                             short right, short bottom);
pascal void RectRgn         (RgnHandle rgn, const Rect *r);
pascal void OffsetRgn       (RgnHandle rgn, short dh, short dv);
pascal void InsetRgn        (RgnHandle rgn, short dh, short dv);
pascal void SectRgn         (RgnHandle srcRgnA, RgnHandle srcRgnB,
                             RgnHandle dstRgn);
pascal void UnionRgn        (RgnHandle srcRgnA, RgnHandle srcRgnB,
                             RgnHandle dstRgn);
pascal void DiffRgn         (RgnHandle srcRgnA, RgnHandle srcRgnB,
                             RgnHandle dstRgn);
pascal void XorRgn          (RgnHandle srcRgnA, RgnHandle srcRgnB, 
                             RgnHandle dstRgn);
pascal Boolean PtInRgn      (Point pt, RgnHandle rgn);
pascal Boolean RectInRgn    (const Rect *r, RgnHandle rgn);
pascal Boolean EqualRgn     (RgnHandle rgnA, RgnHandle rgnB);
pascal Boolean EmptyRgn     (RgnHandle rgn);

Drawing Regions

pascal void FrameRgn        (RgnHandle rgn);
pascal void PaintRgn        (RgnHandle rgn);
pascal void FillRgn         (RgnHandle rgn, ConstPatternParam pat);
pascal void EraseRgn        (RgnHandle rgn);
pascal void InvertRgn       (RgnHandle rgn);

Scaling and Mapping Points, Rectangles, Polygons, and Regions

pascal void ScalePt         (Point *pt, const Rect *srcRect,
                             const Rect *dstRect);
pascal void MapPt           (Point *pt, const Rect *srcRect,
                             const Rect *dstRect);
pascal void MapRect         (Rect *r, const Rect *srcRect,
                             const Rect *dstRect);
pascal void MapRgn          (RgnHandle rgn, const Rect *srcRect,
                             const Rect *dstRect);
pascal void MapPoly         (PolyHandle poly, const Rect *srcRect,
                             const Rect *dstRect);

Calculating Black-and-White Fills

pascal void SeedFill        (const void *srcPtr, void *dstPtr, 
                             short srcRow, short dstRow, short height,
                             short words, short seedH, short seedV);
pascal void CalcMask        (const void *srcPtr, void *dstPtr, 
                             short srcRow, short dstRow, short height,
                             short words);

Copying Images

pascal void CopyBits        (const BitMap *srcBits, 
                             const BitMap *dstBits, const Rect *srcRect, 
                             const Rect *dstRect, short mode, 
                             RgnHandle maskRgn);
pascal void CopyMask        (const BitMap *srcBits, 
                             const BitMap *maskBits, const BitMap *dstBits, 
                             const Rect *srcRect, const Rect *maskRect, 
                             const Rect *dstRect);
pascal void CopyDeepMask    (const BitMap *srcBits, const BitMap *maskBits, 
                             const BitMap *dstBits, const Rect *srcRect, 
                             const Rect *maskRect, const Rect *dstRect, 
                             short mode, RgnHandle maskRgn);

Drawing With the Eight-Color System

pascal void ForeColor       (long color);
pascal void BackColor       (long color);
pascal void ColorBit        (short whichBit);

Determining Whether QuickDraw Has Finished Drawing

pascal Boolean QDDone       (GrafPtr port);

Getting Pattern Resources

pascal PatHandle GetPattern
                            (short patternID);
pascal void GetIndPattern   (Pattern thePat, short patternListID, 
                             short index);

Customizing QuickDraw Operations

pascal void SetStdProcs     (QDProcs *procs);
pascal void StdText         (short count, const void *textAddr, 
                             Point numer, Point denom);
pascal void StdLine         (Point newPt);
pascal void StdRect         (GrafVerb verb, const Rect *r);
pascal void StdRRect        (GrafVerb verb, const Rect *r, 
                             short ovalWidth, short ovalHeight);
pascal void StdOval         (GrafVerb verb, const Rect *r);
pascal void StdArc          (GrafVerb verb, const Rect *r, 
                             short startAngle, short arcAngle);
pascal void StdPoly         (GrafVerb verb, PolyHandle poly);
pascal void StdRgn          (GrafVerb verb, RgnHandle rgn);
pascal void StdBits         (const BitMap *srcBits, 
                             const Rect *srcRect, const Rect *dstRect,
                             short mode, RgnHandle maskRgn);
pascal void StdComment      (short kind, short dataSize, Handle dataHandle);
pascal short StdTxtMeas     (short byteCount, const void *textAddr, 
                             Point *numer, Point *denom, FontInfo *info);
pascal void StdGetPic       (void *dataPtr, short byteCount);
pascal void StdPutPic       (const void *dataPtr, short byteCount);

Assembly-Language Summary

Data Structures

Polygon Data Structure
0polySizewordtotal bytes in this structure
2polyBBox8 bytesbounding rectangle
10polyPointsvariablevertices, each consisting of a long (point)

PenState Data Structure
0psLoclongpen location
4psSizelongpen size
8psModewordpattern mode
10psPat8 bytespattern

QDProcs Data Structure
0textProclongpointer to text-drawing routine
4lineProclongpointer to line-drawing routine
8rectProclongpointer to rectangle-drawing routine
12rRectProclongpointer to rounded rectangle-drawing routine
16ovalProclongpointer to oval-drawing routine
20arcProclongpointer to arc/wedge-drawing routine
24polyProclongpointer to polygon-drawing routine
28rgnProclongpointer to region-drawing routine
32bitsProclongpointer to bit transfer routine
36commentProclongpointer to picture comment-processing routine
40txMeasProclongpointer to text-width measurement routine
44getPicProclongpointer to picture retrieval routine
48putPicProclongpointer to picture-saving routine

Trap Macro Requiring Routine Selector

_QDExtensions
SelectorRoutine
$00040013QDDone

Global Variables
blackAll-black pattern.
dkGray75% gray pattern.
gray50% gray pattern.
ltGray25% gray pattern.
whiteAll-white pattern.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996