Summary of QuickDraw Drawing

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}

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);
PROCEDURE UnionRect     (src1,src2: Rect; VAR dstRect: Rect);
PROCEDURE Pt2Rect       (pt1,pt2: Point; VAR dstRect: Rect);
PROCEDURE PtToAngle     (r: Rect; pt: Point; VAR angle: Integer);
FUNCTION SectRect       (src1,src2: Rect; VAR dstRect: Rect): Boolean;
FUNCTION PtInRect       (pt: Point; r: Rect): Boolean;
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);