| Framework | ApplicationServices/ApplicationServices.h |
| Companion guide | |
| Declared in | IOMacOSTypes.h ImageCompression.k.h QDOffscreen.h QDPictToCGContext.h QuickTimeComponents.k.h Quickdraw.h QuickdrawAPI.h QuickdrawTypes.h X.h |
QuickDraw is the legacy 2D drawing engine for Macintosh computers. QuickDraw provides routines for drawing, manipulating, and displaying graphic objects such as lines, arcs, rectangles, ovals, regions, and bitmap images. Carbon supports most of the classic QuickDraw programming interface.
Note: QuickDraw has been deprecated for deployment targets Mac OS X version 10.4 and later. The replacement API is Quartz 2D. Because of the fundamental differences in the imaging models and design goals between QuickDraw and Quartz, there is no direct correspondence between QuickDraw and Quartz concepts and interfaces. For certain purposes, some QuickDraw functions may still be needed during a transition period; nevertheless, most of them have been deprecated to express the overriding goal of eliminating the use of QuickDraw in the future.
QDPictCreateWithProvider
QDPictCreateWithURL
QDPictDrawToCGContext
QDPictGetBounds
QDPictGetResolution
QDPictRetain
QDPictRelease
QDBeginCGContext
QDEndCGContext
ClipCGContextToRegion Deprecated in Mac OS X v10.4
CreateCGContextForPort Deprecated in Mac OS X v10.4
SyncCGContextOriginWithPort Deprecated in Mac OS X v10.4
QDGetCGDirectDisplayID
CreateNewPortForCGDisplayID Deprecated in Mac OS X v10.4
LockPortBits Deprecated in Mac OS X v10.4
QDFlushPortBuffer Deprecated in Mac OS X v10.4
UnlockPortBits Deprecated in Mac OS X v10.4
AllocCursor Deprecated in Mac OS X v10.4
DisposeCCursor Deprecated in Mac OS X v10.4
GetCCursor Deprecated in Mac OS X v10.4
SetCCursor Deprecated in Mac OS X v10.4
BackPat Deprecated in Mac OS X v10.4
BackPixPat Deprecated in Mac OS X v10.4
PackBits Deprecated in Mac OS X v10.4
UnpackBits Deprecated in Mac OS X v10.4
CopyBits Deprecated in Mac OS X v10.4
CopyDeepMask Deprecated in Mac OS X v10.4
CopyMask Deprecated in Mac OS X v10.4
NewGWorld
DisposeGWorld Deprecated in Mac OS X v10.4
DisposeScreenBuffer Deprecated in Mac OS X v10.4
NewScreenBuffer Deprecated in Mac OS X v10.4
NewTempScreenBuffer Deprecated in Mac OS X v10.4
UpdateGWorld Deprecated in Mac OS X v10.4
DisposeCTable Deprecated in Mac OS X v10.4
GetCTable Deprecated in Mac OS X v10.4
ClosePicture Deprecated in Mac OS X v10.4
KillPicture Deprecated in Mac OS X v10.4
OpenCPicture Deprecated in Mac OS X v10.4
OpenPicture Deprecated in Mac OS X v10.4
PicComment Deprecated in Mac OS X v10.4
CopyPixPat Deprecated in Mac OS X v10.4
DisposePixPat Deprecated in Mac OS X v10.4
GetPixPat Deprecated in Mac OS X v10.4
MakeRGBPat Deprecated in Mac OS X v10.4
NewPixPat Deprecated in Mac OS X v10.4
ClosePoly Deprecated in Mac OS X v10.4
KillPoly Deprecated in Mac OS X v10.4
OffsetPoly Deprecated in Mac OS X v10.4
OpenPoly Deprecated in Mac OS X v10.4
CopyRgn
DiffRgn
DisposeRgn
EmptyRgn
EqualRgn
InsetRgn
NewRgn
OffsetRgn
PtInRgn
RectInRgn
RectRgn
SectRgn
SetEmptyRgn
SetRectRgn
UnionRgn
XorRgn
CloseRgn Deprecated in Mac OS X v10.4
OpenRgn Deprecated in Mac OS X v10.4
DisposeGDevice Deprecated in Mac OS X v10.4
InitGDevice Deprecated in Mac OS X v10.4
NewGDevice Deprecated in Mac OS X v10.4
SetDeviceAttribute Deprecated in Mac OS X v10.4
SetGDevice Deprecated in Mac OS X v10.4
CopyPixMap Deprecated in Mac OS X v10.4
DisposePixMap Deprecated in Mac OS X v10.4
NewPixMap Deprecated in Mac OS X v10.4
SetPortPix Deprecated in Mac OS X v10.4
SetStdCProcs Deprecated in Mac OS X v10.4
SetStdProcs Deprecated in Mac OS X v10.4
StdArc Deprecated in Mac OS X v10.4
StdBits Deprecated in Mac OS X v10.4
StdComment Deprecated in Mac OS X v10.4
StdGetPic Deprecated in Mac OS X v10.4
StdLine Deprecated in Mac OS X v10.4
StdOval Deprecated in Mac OS X v10.4
StdPoly Deprecated in Mac OS X v10.4
StdPutPic Deprecated in Mac OS X v10.4
StdRect Deprecated in Mac OS X v10.4
StdRgn Deprecated in Mac OS X v10.4
StdRRect Deprecated in Mac OS X v10.4
GetBackColor Deprecated in Mac OS X v10.4
GetCPixel Deprecated in Mac OS X v10.4
GetForeColor Deprecated in Mac OS X v10.4
DeviceLoop Deprecated in Mac OS X v10.4
ScreenRes Deprecated in Mac OS X v10.4
TestDeviceAttribute Deprecated in Mac OS X v10.4
QDDone Deprecated in Mac OS X v10.4
EraseArc Deprecated in Mac OS X v10.4
FillArc Deprecated in Mac OS X v10.4
FrameArc Deprecated in Mac OS X v10.4
InvertArc Deprecated in Mac OS X v10.4
PaintArc Deprecated in Mac OS X v10.4
Line Deprecated in Mac OS X v10.4
LineTo Deprecated in Mac OS X v10.4
Move Deprecated in Mac OS X v10.4
MoveTo Deprecated in Mac OS X v10.4
EraseOval Deprecated in Mac OS X v10.4
FillOval Deprecated in Mac OS X v10.4
FrameOval Deprecated in Mac OS X v10.4
InvertOval Deprecated in Mac OS X v10.4
PaintOval Deprecated in Mac OS X v10.4
DrawPicture Deprecated in Mac OS X v10.4
GetPicture Deprecated in Mac OS X v10.4
ErasePoly Deprecated in Mac OS X v10.4
FillPoly Deprecated in Mac OS X v10.4
FramePoly Deprecated in Mac OS X v10.4
InvertPoly Deprecated in Mac OS X v10.4
PaintPoly Deprecated in Mac OS X v10.4
EraseRect Deprecated in Mac OS X v10.4
FillRect Deprecated in Mac OS X v10.4
FrameRect Deprecated in Mac OS X v10.4
InvertRect Deprecated in Mac OS X v10.4
PaintRect Deprecated in Mac OS X v10.4
EraseRgn Deprecated in Mac OS X v10.4
FillRgn Deprecated in Mac OS X v10.4
FrameRgn Deprecated in Mac OS X v10.4
InvertRgn Deprecated in Mac OS X v10.4
PaintRgn Deprecated in Mac OS X v10.4
EraseRoundRect Deprecated in Mac OS X v10.4
FillRoundRect Deprecated in Mac OS X v10.4
FrameRoundRect Deprecated in Mac OS X v10.4
InvertRoundRect Deprecated in Mac OS X v10.4
PaintRoundRect Deprecated in Mac OS X v10.4
FillCArc Deprecated in Mac OS X v10.4
FillCOval Deprecated in Mac OS X v10.4
FillCPoly Deprecated in Mac OS X v10.4
FillCRect Deprecated in Mac OS X v10.4
FillCRgn Deprecated in Mac OS X v10.4
FillCRoundRect Deprecated in Mac OS X v10.4
HiliteColor Deprecated in Mac OS X v10.4
OpColor Deprecated in Mac OS X v10.4
RGBBackColor Deprecated in Mac OS X v10.4
RGBForeColor Deprecated in Mac OS X v10.4
SetCPixel Deprecated in Mac OS X v10.4
BackColor Deprecated in Mac OS X v10.4
ColorBit Deprecated in Mac OS X v10.4
ForeColor Deprecated in Mac OS X v10.4
GetIndPattern Deprecated in Mac OS X v10.4
GetPattern Deprecated in Mac OS X v10.4
GetDeviceList Deprecated in Mac OS X v10.4
GetGDevice Deprecated in Mac OS X v10.4
GetMainDevice Deprecated in Mac OS X v10.4
GetMaxDevice Deprecated in Mac OS X v10.4
GetNextDevice Deprecated in Mac OS X v10.4
PenPixPat Deprecated in Mac OS X v10.4
GetPixBaseAddr
AllowPurgePixels Deprecated in Mac OS X v10.4
GetGWorldPixMap Deprecated in Mac OS X v10.4
GetPixelsState Deprecated in Mac OS X v10.4
LockPixels Deprecated in Mac OS X v10.4
NoPurgePixels Deprecated in Mac OS X v10.4
PixMap32Bit Deprecated in Mac OS X v10.4
SetPixelsState Deprecated in Mac OS X v10.4
UnlockPixels Deprecated in Mac OS X v10.4
GetClip
SetClip
BitMapToRegion Deprecated in Mac OS X v10.4
ClipRect Deprecated in Mac OS X v10.4
MovePortTo Deprecated in Mac OS X v10.4
PortSize Deprecated in Mac OS X v10.4
ScrollRect Deprecated in Mac OS X v10.4
SetOrigin Deprecated in Mac OS X v10.4
SetPortBits Deprecated in Mac OS X v10.4
GetCTSeed Deprecated in Mac OS X v10.4
ProtectEntry Deprecated in Mac OS X v10.4
ReserveEntry Deprecated in Mac OS X v10.4
RestoreEntries Deprecated in Mac OS X v10.4
SaveEntries Deprecated in Mac OS X v10.4
SetEntries Deprecated in Mac OS X v10.4
Color2Index Deprecated in Mac OS X v10.4
GetSubTable Deprecated in Mac OS X v10.4
Index2Color Deprecated in Mac OS X v10.4
InvertColor Deprecated in Mac OS X v10.4
MakeITable Deprecated in Mac OS X v10.4
RealColor Deprecated in Mac OS X v10.4
GetPen Deprecated in Mac OS X v10.4
GetPenState Deprecated in Mac OS X v10.4
HidePen Deprecated in Mac OS X v10.4
PenMode Deprecated in Mac OS X v10.4
PenNormal Deprecated in Mac OS X v10.4
PenPat Deprecated in Mac OS X v10.4
PenSize Deprecated in Mac OS X v10.4
SetPenState Deprecated in Mac OS X v10.4
ShowPen Deprecated in Mac OS X v10.4
AddPt
EqualPt
SetPt
SubPt
DeltaPoint Deprecated in Mac OS X v10.4
GetPixel Deprecated in Mac OS X v10.4
GlobalToLocal Deprecated in Mac OS X v10.4
LocalToGlobal Deprecated in Mac OS X v10.4
Random Deprecated in Mac OS X v10.4
AddComp Deprecated in Mac OS X v10.4
AddSearch Deprecated in Mac OS X v10.4
DelComp Deprecated in Mac OS X v10.4
DelSearch Deprecated in Mac OS X v10.4
SetClientID Deprecated in Mac OS X v10.4
CTabChanged Deprecated in Mac OS X v10.4
GDeviceChanged Deprecated in Mac OS X v10.4
PixPatChanged Deprecated in Mac OS X v10.4
PortChanged Deprecated in Mac OS X v10.4
QDError Deprecated in Mac OS X v10.4
GetGWorld
SetGWorld
GetGWorldDevice Deprecated in Mac OS X v10.4
GetRegionBounds
HandleToRgn
IsRegionRectangular
IsValidRgnHandle
QDRegionToRects
RgnToHandle
CloseCursorComponent Deprecated in Mac OS X v10.4
CreateNewPort Deprecated in Mac OS X v10.4
CursorComponentChanged Deprecated in Mac OS X v10.4
CursorComponentSetData Deprecated in Mac OS X v10.4
deltapoint Deprecated in Mac OS X v10.4
DisposeColorComplementUPP Deprecated in Mac OS X v10.4
DisposeColorSearchUPP Deprecated in Mac OS X v10.4
DisposeDeviceLoopDrawingUPP Deprecated in Mac OS X v10.4
DisposeDragGrayRgnUPP Deprecated in Mac OS X v10.4
DisposePort Deprecated in Mac OS X v10.4
DisposeQDArcUPP Deprecated in Mac OS X v10.4
DisposeQDBitsUPP Deprecated in Mac OS X v10.4
DisposeQDCommentUPP Deprecated in Mac OS X v10.4
DisposeQDGetPicUPP Deprecated in Mac OS X v10.4
DisposeQDJShieldCursorUPP Deprecated in Mac OS X v10.4
DisposeQDLineUPP Deprecated in Mac OS X v10.4
DisposeQDOpcodeUPP Deprecated in Mac OS X v10.4
DisposeQDOvalUPP Deprecated in Mac OS X v10.4
DisposeQDPolyUPP Deprecated in Mac OS X v10.4
DisposeQDPutPicUPP Deprecated in Mac OS X v10.4
DisposeQDRectUPP Deprecated in Mac OS X v10.4
DisposeQDRgnUPP Deprecated in Mac OS X v10.4
DisposeQDRRectUPP Deprecated in Mac OS X v10.4
DisposeQDStdGlyphsUPP Deprecated in Mac OS X v10.4
DisposeQDTextUPP Deprecated in Mac OS X v10.4
DisposeQDTxMeasUPP Deprecated in Mac OS X v10.4
DisposeRegionToRectsUPP Deprecated in Mac OS X v10.4
GetMaskTable Deprecated in Mac OS X v10.4
GetPixBounds Deprecated in Mac OS X v10.4
GetPixDepth Deprecated in Mac OS X v10.4
GetPixRowBytes Deprecated in Mac OS X v10.4
GetPortBackColor Deprecated in Mac OS X v10.4
GetPortBackPixPat Deprecated in Mac OS X v10.4
GetPortBitMapForCopyBits Deprecated in Mac OS X v10.4
GetPortBounds Deprecated in Mac OS X v10.4
GetPortChExtra Deprecated in Mac OS X v10.4
GetPortClipRegion Deprecated in Mac OS X v10.4
GetPortCustomXFerProc Deprecated in Mac OS X v10.4
GetPortFillPixPat Deprecated in Mac OS X v10.4
GetPortForeColor Deprecated in Mac OS X v10.4
GetPortFracHPenLocation Deprecated in Mac OS X v10.4
GetPortGrafProcs Deprecated in Mac OS X v10.4
GetPortHiliteColor Deprecated in Mac OS X v10.4
GetPortOpColor Deprecated in Mac OS X v10.4
GetPortPenLocation Deprecated in Mac OS X v10.4
GetPortPenMode Deprecated in Mac OS X v10.4
GetPortPenPixPat Deprecated in Mac OS X v10.4
GetPortPenSize Deprecated in Mac OS X v10.4
GetPortPenVisibility Deprecated in Mac OS X v10.4
GetPortPixMap Deprecated in Mac OS X v10.4
GetPortSpExtra Deprecated in Mac OS X v10.4
GetPortTextFace Deprecated in Mac OS X v10.4
GetPortTextFont Deprecated in Mac OS X v10.4
GetPortTextMode Deprecated in Mac OS X v10.4
GetPortTextSize Deprecated in Mac OS X v10.4
GetPortVisibleRegion Deprecated in Mac OS X v10.4
GetQDGlobalsArrow Deprecated in Mac OS X v10.4
GetQDGlobalsBlack Deprecated in Mac OS X v10.4
GetQDGlobalsDarkGray Deprecated in Mac OS X v10.4
GetQDGlobalsGray Deprecated in Mac OS X v10.4
GetQDGlobalsLightGray Deprecated in Mac OS X v10.4
GetQDGlobalsRandomSeed Deprecated in Mac OS X v10.4
GetQDGlobalsScreenBits Deprecated in Mac OS X v10.4
GetQDGlobalsThePort Deprecated in Mac OS X v10.4
GetQDGlobalsWhite Deprecated in Mac OS X v10.4
GrafDevice Deprecated in Mac OS X v10.4
InvokeColorComplementUPP Deprecated in Mac OS X v10.4
InvokeColorSearchUPP Deprecated in Mac OS X v10.4
InvokeDeviceLoopDrawingUPP Deprecated in Mac OS X v10.4
InvokeDragGrayRgnUPP Deprecated in Mac OS X v10.4
InvokeQDArcUPP Deprecated in Mac OS X v10.4
InvokeQDBitsUPP Deprecated in Mac OS X v10.4
InvokeQDCommentUPP Deprecated in Mac OS X v10.4
InvokeQDGetPicUPP Deprecated in Mac OS X v10.4
InvokeQDJShieldCursorUPP Deprecated in Mac OS X v10.4
InvokeQDLineUPP Deprecated in Mac OS X v10.4
InvokeQDOpcodeUPP Deprecated in Mac OS X v10.4
InvokeQDOvalUPP Deprecated in Mac OS X v10.4
InvokeQDPolyUPP Deprecated in Mac OS X v10.4
InvokeQDPutPicUPP Deprecated in Mac OS X v10.4
InvokeQDRectUPP Deprecated in Mac OS X v10.4
InvokeQDRgnUPP Deprecated in Mac OS X v10.4
InvokeQDRRectUPP Deprecated in Mac OS X v10.4
InvokeQDStdGlyphsUPP Deprecated in Mac OS X v10.4
InvokeQDTextUPP Deprecated in Mac OS X v10.4
InvokeQDTxMeasUPP Deprecated in Mac OS X v10.4
InvokeRegionToRectsUPP Deprecated in Mac OS X v10.4
IsPortClipRegionEmpty Deprecated in Mac OS X v10.4
IsPortColor Deprecated in Mac OS X v10.4
IsPortOffscreen Deprecated in Mac OS X v10.4
IsPortPictureBeingDefined Deprecated in Mac OS X v10.4
IsPortPolyBeingDefined Deprecated in Mac OS X v10.4
IsPortRegionBeingDefined Deprecated in Mac OS X v10.4
IsPortVisibleRegionEmpty Deprecated in Mac OS X v10.4
IsValidPort Deprecated in Mac OS X v10.4
LMGetCursorNew Deprecated in Mac OS X v10.4
LMGetDeviceList Deprecated in Mac OS X v10.4
LMGetFractEnable Deprecated in Mac OS X v10.4
LMGetHiliteMode Deprecated in Mac OS X v10.4
LMGetHiliteRGB Deprecated in Mac OS X v10.4
LMGetLastFOND Deprecated in Mac OS X v10.4
LMGetLastSPExtra Deprecated in Mac OS X v10.4
LMGetMainDevice Deprecated in Mac OS X v10.4
LMGetQDColors Deprecated in Mac OS X v10.4
LMGetScrHRes Deprecated in Mac OS X v10.4
LMGetScrVRes Deprecated in Mac OS X v10.4
LMGetTheGDevice Deprecated in Mac OS X v10.4
LMGetWidthListHand Deprecated in Mac OS X v10.4
LMGetWidthPtr Deprecated in Mac OS X v10.4
LMGetWidthTabHandle Deprecated in Mac OS X v10.4
LMSetCursorNew Deprecated in Mac OS X v10.4
LMSetDeviceList Deprecated in Mac OS X v10.4
LMSetFractEnable Deprecated in Mac OS X v10.4
LMSetHiliteMode Deprecated in Mac OS X v10.4
LMSetHiliteRGB Deprecated in Mac OS X v10.4
LMSetLastFOND Deprecated in Mac OS X v10.4
LMSetLastSPExtra Deprecated in Mac OS X v10.4
LMSetMainDevice Deprecated in Mac OS X v10.4
LMSetQDColors Deprecated in Mac OS X v10.4
LMSetScrHRes Deprecated in Mac OS X v10.4
LMSetScrVRes Deprecated in Mac OS X v10.4
LMSetTheGDevice Deprecated in Mac OS X v10.4
LMSetWidthListHand Deprecated in Mac OS X v10.4
LMSetWidthPtr Deprecated in Mac OS X v10.4
LMSetWidthTabHandle Deprecated in Mac OS X v10.4
NewColorComplementUPP Deprecated in Mac OS X v10.4
NewColorSearchUPP Deprecated in Mac OS X v10.4
NewDeviceLoopDrawingUPP Deprecated in Mac OS X v10.4
NewDragGrayRgnUPP Deprecated in Mac OS X v10.4
NewGWorldFromPtr Deprecated in Mac OS X v10.4
NewQDArcUPP Deprecated in Mac OS X v10.4
NewQDBitsUPP Deprecated in Mac OS X v10.4
NewQDCommentUPP Deprecated in Mac OS X v10.4
NewQDGetPicUPP Deprecated in Mac OS X v10.4
NewQDJShieldCursorUPP Deprecated in Mac OS X v10.4
NewQDLineUPP Deprecated in Mac OS X v10.4
NewQDOpcodeUPP Deprecated in Mac OS X v10.4
NewQDOvalUPP Deprecated in Mac OS X v10.4
NewQDPolyUPP Deprecated in Mac OS X v10.4
NewQDPutPicUPP Deprecated in Mac OS X v10.4
NewQDRectUPP Deprecated in Mac OS X v10.4
NewQDRgnUPP Deprecated in Mac OS X v10.4
NewQDRRectUPP Deprecated in Mac OS X v10.4
NewQDStdGlyphsUPP Deprecated in Mac OS X v10.4
NewQDTextUPP Deprecated in Mac OS X v10.4
NewQDTxMeasUPP Deprecated in Mac OS X v10.4
NewRegionToRectsUPP Deprecated in Mac OS X v10.4
OffscreenVersion Deprecated in Mac OS X v10.4
OpenCursorComponent Deprecated in Mac OS X v10.4
QDAddRectToDirtyRegion Deprecated in Mac OS X v10.4
QDAddRegionToDirtyRegion Deprecated in Mac OS X v10.4
QDDisplayWaitCursor Deprecated in Mac OS X v10.4
QDDisposeRegionBits Deprecated in Mac OS X v10.4
QDGetCursorData Deprecated in Mac OS X v10.4
QDGetDirtyRegion Deprecated in Mac OS X v10.4
QDGetPatternOrigin Deprecated in Mac OS X v10.4
QDGetPictureBounds Deprecated in Mac OS X v10.4
QDGlobalToLocalPoint Deprecated in Mac OS X v10.4
QDGlobalToLocalRect Deprecated in Mac OS X v10.4
QDGlobalToLocalRegion Deprecated in Mac OS X v10.4
QDIsNamedPixMapCursorRegistered Deprecated in Mac OS X v10.4
QDIsPortBufferDirty Deprecated in Mac OS X v10.4
QDIsPortBuffered Deprecated in Mac OS X v10.4
QDLocalToGlobalPoint Deprecated in Mac OS X v10.4
QDLocalToGlobalRect Deprecated in Mac OS X v10.4
QDLocalToGlobalRegion Deprecated in Mac OS X v10.4
QDRegisterNamedPixMapCursor Deprecated in Mac OS X v10.4
QDRestoreRegionBits Deprecated in Mac OS X v10.4
QDSaveRegionBits Deprecated in Mac OS X v10.4
QDSetCursorScale Deprecated in Mac OS X v10.4
QDSetDirtyRegion Deprecated in Mac OS X v10.4
QDSetNamedPixMapCursor Deprecated in Mac OS X v10.4
QDSetPatternOrigin Deprecated in Mac OS X v10.4
QDSwapPort Deprecated in Mac OS X v10.4
QDSwapPortTextFlags Deprecated in Mac OS X v10.4
QDSwapTextFlags Deprecated in Mac OS X v10.4
QDUnregisterNamedPixMapCursor Deprecated in Mac OS X v10.4
SectRegionWithPortClipRegion Deprecated in Mac OS X v10.4
SectRegionWithPortVisibleRegion Deprecated in Mac OS X v10.4
SetCursorComponent Deprecated in Mac OS X v10.4
SetPortBackPixPat Deprecated in Mac OS X v10.4
SetPortBounds Deprecated in Mac OS X v10.4
SetPortClipRegion Deprecated in Mac OS X v10.4
SetPortCustomXFerProc Deprecated in Mac OS X v10.4
SetPortFillPixPat Deprecated in Mac OS X v10.4
SetPortFracHPenLocation Deprecated in Mac OS X v10.4
SetPortGrafProcs Deprecated in Mac OS X v10.4
SetPortOpColor Deprecated in Mac OS X v10.4
SetPortPenMode Deprecated in Mac OS X v10.4
SetPortPenPixPat Deprecated in Mac OS X v10.4
SetPortPenSize Deprecated in Mac OS X v10.4
SetPortTextFace Deprecated in Mac OS X v10.4
SetPortTextFont Deprecated in Mac OS X v10.4
SetPortTextMode Deprecated in Mac OS X v10.4
SetPortTextSize Deprecated in Mac OS X v10.4
SetPortVisibleRegion Deprecated in Mac OS X v10.4
SetQDError Deprecated in Mac OS X v10.4
SetQDGlobalsArrow Deprecated in Mac OS X v10.4
SetQDGlobalsRandomSeed Deprecated in Mac OS X v10.4
StdOpcode Deprecated in Mac OS X v10.4
StuffHex Deprecated in Mac OS X v10.4
SwapPortPicSaveHandle Deprecated in Mac OS X v10.4
SwapPortPolySaveHandle Deprecated in Mac OS X v10.4
SwapPortRegionSaveHandle Deprecated in Mac OS X v10.4
Adds the coordinates of two points.
void AddPt ( Point src, Point *dst );
A point, the coordinates of which are to be added to the point in the dstPt parameter.
A pointer to a point, the coordinates of which are to be added to the point in the srcPt parameter. On return, this value contains the result of adding the coordinates of the points you supplied in the srcPt and dstPt parameters.
The AddPt function adds the coordinates of the point specified in the srcPt parameter to the coordinates of the point specified in the dstPt parameter, and returns the result in the dstPt parameter.
QuickdrawAPI.h
Converts a slope value to an angle value.
short AngleFromSlope ( Fixed slope );
The slope, defined as Dx/Dy, which is the horizontal change divided by the vertical change between any two points on a line with the slope.
The angle corresponding to the slope specified in the slope parameter treated MOD 180. Angles are defined in clockwise degrees from 12 o’clock. The negative y-axis is defined as being at 12 o’clock, and the positive y-axis at 6 o’clock. The x-axis is defined as usual, with the positive side defined as being at 3 o’clock.
The AngleFromSlope function is most useful when you require speed more than accuracy in performing the calculation. The integer result is within 1 degree of the correct answer, but not necessarily within half a degree.
QuickdrawAPI.h
Makes a copy of a region.
void CopyRgn ( RgnHandle srcRgn, RgnHandle dstRgn );
A handle to the region to copy.
A handle to the region to receive the copy.
The CopyRgn function copies the mathematical structure of the region whose handle you pass in the srcRgn parameter into the region whose handle you pass in the dstRgn parameter; that is, CopyRgn makes a duplicate copy of srcRgn. When calling CopyRgn, pass handles that have been returned by the NewRgn function in the srcRgn and dstRgn parameters.
Once this is done, the region indicated by srcRgn may be altered (or even disposed of) without affecting the region indicated by dstRgn. The CopyRgn function does not create the destination region; space must already have been allocated for it by using the NewRgn function.
The CopyRgn function may move or purge memory blocks in the application heap; do not call this function at interrupt time.
QuickdrawAPI.h
Subtracts one region from another.
void DiffRgn ( RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn );
A handle to the region to subtract from.
A handle to the region to subtract.
On return, a handle to the region holding the resulting area. If the first source region is empty, DiffRgn sets the destination to the empty region defined by the rectangle (0,0,0,0).
The DiffRgn function does not create the destination region; you must have already allocated memory for it by using the NewRgn function.
The destination region may be one of the source regions, if desired.
The DiffRgn procedure subtracts the region whose handle you pass in the srcRgnB parameter from the region whose handle you pass in the srcRgnA parameter and places the difference in the region whose handle you pass in the dstRgn parameter. If the first source region is empty, DiffRgn sets the destination to the empty region defined by the rectangle (0,0,0,0).
The DiffRgn procedure does not create the destination region; you must have already allocated memory for it by using the NewRgn function. The destination region may be one of the source regions, if desired.
The DiffRgn function may temporarily use heap space that’s twice the size of the two input regions.
QuickdrawAPI.h
Releases the memory occupied by a region.
void DisposeRgn ( RgnHandle rgn );
A handle to the region to dispose. This handle should be a region handle returned by the NewRgn function.
Use DisposeRgn only after you are completely through with a region.
The DisposeRgn function may move or purge memory blocks in the application heap; do not call this function at interrupt time.
QuickdrawAPI.h
Determines whether a rectangle is an empty rectangle.
Boolean EmptyRect ( const Rect *r );
The rectangle to examine.
TRUE if the rectangle that you specify in the r parameter is an empty rectangle, FALSE if it is not. A rectangle is considered empty if the bottom coordinate is less than or equal to the top coordinate or if the right coordinate is less than or equal to the left.
If the points or rectangles supplied to this function are defined in a graphics port other than your current graphics port, you must convert them to the local coordinate system of your current graphics port. You can accomplish this by using the SetPort function to change to the graphics port containing the points or rectangles, using the LocalGlobal function to convert their locations to global coordinates, using SetPort to return to your starting graphics port, and then using the GlobalToLocal function to convert the locations of points or rectangles to the local coordinates of your current graphics port.
QuickdrawAPI.h
Determines whether a region is empty.
Boolean EmptyRgn ( RgnHandle rgn );
A handle to the region to test for emptiness.
TRUE if the region whose handle you pass in the rgn parameter is an empty region or FALSE if it is not.
The EmptyRgn function does not create an empty region. To create an empty region, you can perform any of the following operations:
Use NewRgn.
Pass the handle to an empty region to CopyRgn.
Pass an empty rectangle to either SetRectRgn or RectRgn.
Call CloseRgn without performing any drawing after calling OpenRgn.
Pass an empty region to OffsetRgn.
Pass an empty region or too large an inset to InsetRgn
Pass two nonintersecting regions to SectRgn.
Pass two empty regions to UnionRgn.
Pass two identical or nonintersecting regions to DiffRgn or XorRgn.
QuickdrawAPI.h
Determines whether the coordinates of two given points are equal.
Boolean EqualPt ( Point pt1, Point pt2 );
The first of two points to be compared.
The second of two points to be compared.
TRUE if the coordinates of the two points are equal, or FALSE if they are not.
The EqualPt function compares the points specified in the pt1 and pt2 parameters and returns TRUE if their coordinates are equal or FALSE if they are not.
QuickdrawAPI.h
Determines whether two rectangles are equal.
Boolean EqualRect ( const Rect * rect1, const Rect * rect2 );
The first of two rectangles to compare.
The second of two rectangles to compare.
TRUE if the rectangles are equal, FALSE if they are not.
If the points or rectangles supplied to this function are defined in a graphics port other than your current graphics port, you must convert them to the local coordinate system of your current graphics port. You can accomplish this by using the SetPort function to change to the graphics port containing the points or rectangles, using the LocalGlobal function to convert their locations to global coordinates, using SetPort to return to your starting graphics port, and then using the GlobalToLocal function to convert the locations of points or rectangles to the local coordinates of your current graphics port.
QuickdrawAPI.h
Determines whether two regions have identical sizes, shapes, and locations.
Boolean EqualRgn ( RgnHandle rgnA, RgnHandle rgnB );
A handle to the first of two regions to compare.
A handle to the second of two regions to compare.
TRUE if the two regions are equal; FALSE if they are not. The two regions must have identical sizes, shapes, and locations to be considered equal. Any two empty regions are always equal.
The EqualRgn function compares the two regions whose handles you pass in the rgnA and rgnB parameters and returns TRUE if they’re equal or FALSE if they’re not.
The two regions must have identical sizes, shapes, and locations to be considered equal. Any two empty regions are always equal.
QuickdrawAPI.h
Saves the clipping region of the current graphics port (basic or color). (Deprecated. Use Quartz 2D instead; see Quartz Programming Guide for QuickDraw Developers.)
void GetClip ( RgnHandle rgn );
A handle to the region to be clipped. The GetClip function changes this region to one that’s equivalent to the clipping region of the current graphics port. The GetClip function doesn’t change the region handle.
You can use the GetClip and SetClip functions to preserve the current clipping region: use GetClip to save the current port’s clipping region, and use SetClip to restore it. If, for example, you want to draw a half-circle on the screen, you can set the clipping region to half of the square that would enclose the whole circle, and then draw the whole circle. Only the half within the clipping region is actually drawn in the graphics port.
The GetClip function may move or purge memory blocks in the application heap. Your application should not call this function at interrupt time.
ImageCompression.k.h
Saves the current graphics port (basic, color, or offscreen) and the current GDevice structure. (Deprecated. Use Quartz 2D instead; see Quartz Programming Guide for QuickDraw Developers.)
void GetGWorld ( CGrafPtr *port, GDHandle *gdh );
On return, a pointer to the current graphics port in the port parameter. This parameter can return values of type GrafPtr, CGrafPtr, or GWorldPtr, depending on whether the current graphics port is a basic graphics port, color graphics port, or offscreen graphics world.
On return, a pointer to a handle to the GDevice structure for the current device.
After using GetGWorld to save a graphics port and a GDevice structure, use the SetGWorld function to restore them.
The GetGWorld function may move or purge memory blocks in the application heap. Your application should not call this function at interrupt time.
ImageCompression.k.h
Obtains a pointer to an offscreen pixel map.
Ptr GetPixBaseAddr ( PixMapHandle pm );
A handle to an offscreen pixel map. To get a handle to an offscreen pixel map, use the GetGWorldPixMap function.
A 32-bit pointer to the beginning of a pixel image. If the offscreen buffer has been purged, GetPixBaseAddr returns NULL.
The baseAddr field of the PixMap structure for an offscreen graphics world contains a handle instead of a pointer, which is what the baseAddr field for an onscreen pixel map contains. You must use the GetPixBaseAddr function to obtain a pointer to the PixMap structure for an offscreen graphics world.
Your application should never directly access the baseAddr field of the PixMap structure for an offscreen graphics world; instead, always use GetPixBaseAddr. If your application is using 24-bit mode, use the PixMap32Bit function to determine whether a pixel map requires 32-bit addressing mode for access to its pixel image.
Any QuickDraw functions that your application uses after calling GetPixBaseAddr may change the base address for the offscreen pixel image.
The GetPixBaseAddr function may move or purge memory blocks in the application heap; do not call this function at interrupt time.
QDOffscreen.h
Rect * GetRegionBounds ( RgnHandle region, Rect *bounds );
QuickdrawAPI.h
void HandleToRgn ( Handle oldRegion, RgnHandle region );
QuickdrawAPI.h
Hides the cursor if it is visible on the screen.
void HideCursor ( void );
The HideCursor function removes the cursor from the screen, restores the bits under the cursor image, and decrements the cursor level (which InitCursor initialized to 0). You might want to use HideCursor when the user is using the keyboard to create content in one of your application’s windows. Every call to HideCursor should be balanced by a subsequent call to the ShowCursor function.
QuickdrawAPI.h
Sets the cursor to the standard arrow and makes the cursor visible.
void InitCursor ( void );
This function initializes the standard arrow cursor, sets the current cursor to the standard arrow, and makes the cursor visible. Classic Mac OS applications need to call this function when launching because the system sets the cursor to the watch cursor. Carbon applications running in Mac OS 9 or Mac OS X do not need to call this function.
QuickdrawAPI.h
Shrinks or expands a rectangle.
void InsetRect ( Rect * r, short dh, short dv );
A pointer to the rectangle to alter.
The horizontal distance to move the left and right sides in toward or outward from the center of the rectangle.
The vertical distance to move the top and bottom sides in toward or outward from the center of the rectangle.
The InsetRect function shrinks or expands the rectangle that you specify in the r parameter: the left and right sides are moved in by the amount you specify in the dh parameter; the top and bottom are moved toward the center by the amount you specify in the dv parameter. If the value you pass in dh or dv is negative, the appropriate pair of sides is moved outward instead of inward. The effect is to alter the size by 2*dh horizontally and 2*dv vertically, with the rectangle remaining centered in the same place on the coordinate plane.
If the resulting width or height becomes less than 1, the rectangle is set to the empty rectangle (0,0,0,0).
If the points or rectangles supplied to this function are defined in a graphics port other than your current graphics port, you must convert them to the local coordinate system of your current graphics port. You can accomplish this by using the SetPort function to change to the graphics port containing the points or rectangles, using the LocalGlobal function to convert their locations to global coordinates, using SetPort to return to your starting graphics port, and then using the GlobalToLocal function to convert the locations of points or rectangles to the local coordinates of your current graphics port.
QuickdrawAPI.h
Shrinks or expands a region.
void InsetRgn ( RgnHandle rgn, short dh, short dv );
A handle to the region to alter.
The horizontal distance to move points on the left and right boundaries in toward or outward from the center.
The vertical distance to move points on the top and bottom boundaries in toward or outward from the center.
The InsetRgn function moves all points on the region boundary of the region whose handle you pass in the rgn parameter inward by the vertical distance that you specify in the dv parameter and by the horizontal distance that you specify in the dh parameter. If you specify negative values for dh or dv, the InsetRgn function moves the points outward in that direction.
The InsetRgn function leaves the region’s center at the same position, but moves the outline in (for positive values of dh and dv) or out (for negative values of dh and dv). Using InsetRgn on a rectangular region has the same effect as using the InsetRect function.
The InsetRgn function temporarily uses heap space that’s twice the size of the original region.
The InsetRgn function may move or purge memory blocks in the application heap; do not call this function at interrupt time.
QuickdrawAPI.h
Boolean IsRegionRectangular ( RgnHandle region );
QuickdrawAPI.h
Boolean IsValidRgnHandle ( RgnHandle rgn );
QuickdrawAPI.h
Maps a point in one rectangle to an equivalent position in another rectangle.
void MapPt ( Point *pt, const Rect *srcRect, const Rect *dstRect );
Upon input, a pointer to the point in the source rectangle to map; upon completion, a pointer to its mapped position in the destination rectangle.
The source rectangle containing the original point.
The destination rectangle in which the point will be mapped.
The MapPt function maps a point in one rectangle to an equivalent position in another rectangle.
In the pt parameter, you specify a point that lies within the rectangle that you specify in the srcRect parameter. The MapPt function maps this point to a similarly located point within the rectangle that you specify in the dstRect parameter—that is, to where it would fall if it were part of a drawing being expanded or shrunk to fit the destination rectangle. The MapPt function returns the location of the mapped point in the pt parameter. For example, a corner point of the source rectangle would be mapped to the corresponding corner point of the destination rectangle in dstRect, and the center of the source rectangle would be mapped to the center of destination rectangle.
The source and destination rectangles may overlap, and the point you specify need not actually lie within the source rectangle.
If you are going to draw inside the destination rectangle, you’ll probably also want to scale the graphics pen size accordingly with ScalePt.
If the points or rectangles supplied to this function are defined in a graphics port other than your current graphics port, you must convert them to the local coordinate system of your current graphics port. You can accomplish this by using the SetPort function to change to the graphics port containing the points or rectangles, using the LocalGlobal function to convert their locations to global coordinates, using SetPort to return to your starting graphics port, and then using the GlobalToLocal function to convert the locations of points or rectangles to the local coordinates of your current graphics port.
QuickdrawAPI.h
Maps and scales a rectangle within one rectangle to another rectangle.
void MapRect ( Rect *r, const Rect *srcRect, const Rect *dstRect );
Upon input, a pointer to the rectangle to map; upon completion, the mapped rectangle.
The rectangle containing the rectangle to map.
The rectangle in which the new rectangle will be mapped.
The MapRect function takes a rectangle within one rectangle and maps and scales it to another rectangle. In the r parameter, you specify a rectangle that lies within the rectangle that you specify in the srcRect parameter. By calling the MapPt function to map the upper-left and lower-right corners of the rectangle in the r parameter, MapRect maps and scales it to the rectangle that you specify in the dstRect parameter. The MapRect function returns the newly mapped rectangle in the r parameter.
If the points or rectangles supplied to this function are defined in a graphics port other than your current graphics port, you must convert them to the local coordinate system of your current graphics port. You can accomplish this by using the SetPort function to change to the graphics port containing the points or rectangles, using the LocalGlobal function to convert their locations to global coordinates, using SetPort to return to your starting graphics port, and then using the GlobalToLocal function to convert the locations of points or rectangles to the local coordinates of your current graphics port.
QuickdrawAPI.h
Maps and scales a region within one rectangle to another rectangle.
void MapRgn ( RgnHandle rgn, const Rect *srcRect, const Rect *dstRect );
A handle to a region. Upon input, this is the region to map. Upon completion, this region is the one mapped to a new location.
The rectangle containing the region to map.
The rectangle in which the new region will be mapped.
The MapRgn function takes a region within one rectangle and maps and scales it to another rectangle. In the rgn parameter, you specify a handle to a region that lies within the rectangle that you specify in the srcRect parameter. By calling the MapPt function to map all the points of the region in the rgn parameter, MapRgn maps and scales it to the rectangle that you specify in the dstRect parameter. The MapRgn function returns the result in the region whose handle you initially passed in the rgn parameter.
The MapRgn function is useful for determining whether a region operation will exceed available memory. By mapping a large region into a smaller one and performing the operation (without actually drawing), you can estimate how much memory will be required by the anticipated operation.
If the points or rectangles supplied to this function are defined in a graphics port other than your current graphics port, you must convert them to the local coordinate system of your current graphics port. You can accomplish this by using the SetPort function to change to the graphics port containing the points or rectangles, using the LocalGlobal function to convert their locations to global coordinates, using SetPort to return to your starting graphics port, and then using the GlobalToLocal function to convert the locations of points or rectangles to the local coordinates of your current graphics port.
The MapRgn function may move or purge memory blocks in the application heap; do not call this function at interrupt time.
QuickdrawAPI.h
Creates an offscreen graphics world. (Deprecated. Use Quartz 2D instead; see Quartz Programming Guide for QuickDraw Developers.)
QDErr NewGWorld ( GWorldPtr *offscreenGWorld, short PixelDepth, const Rect *boundsRect, CTabHandle cTable, GDHandle aGDevice, GWorldFlags flags );
On return, a pointer to the offscreen graphics world created by this function. You use this pointer when referring to this new offscreen world in other QuickDraw functions.
The pixel depth of the offscreen world; possible depths are 1, 2, 4, 8, 16, and 32 bits per pixel. The default parameter (0) uses the pixel depth of the screen with the greatest pixel depth from among all screens whose boundary rectangles intersect the rectangle that you specify in the boundsRect parameter. If you specify 0 in this parameter, NewGWorld also uses the GDevice structure from this device instead of creating a new GDevice structure for the offscreen world. If you use NewGWorld on a computer that supports only basic QuickDraw, you may specify only 0 or 1 in this parameter.
The boundary rectangle and port rectangle for the offscreen pixel map. This becomes the boundary rectangle for the GDevice structure, if NewGWorld creates one. If you specify 0 in the pixelDepth parameter, NewGWorld interprets the boundaries in global coordinates that it uses to determine which screens intersect the rectangle. NewGWorld then uses the pixel depth, color table, and GDevice structure from the screen with the greatest pixel depth from among all screens whose boundary rectangles intersect this rectangle. Typically, your application supplies this parameter with the port rectangle for the onscreen window into which your application will copy the pixel image from this offscreen world.
A handle to a ColorTable structure. If you pass NULL in this parameter, NewGWorld uses the default color table for the pixel depth that you specify in the pixelDepth parameter. If you set the pixelDepth parameter to 0, NewGWorld ignores the cTable parameter and instead copies and uses the color table of the graphics device with the greatest pixel depth among all graphics devices whose boundary rectangles intersect the rectangle that you specify in the boundsRect parameter. If you use NewGWorld on a computer that supports only basic QuickDraw, you may specify only NULL in this parameter.
A handle to a GDevice structure that is used only when you specify the noNewDevice flag in the flags parameter, in which case NewGWorld attaches this GDevice structure to the new offscreen graphics world. If you set the pixelDepth parameter to 0, or if you do not set the noNewDevice flag, NewGWorld ignores the aGDevice parameter, so set it to NULL. If you set the pixelDepth parameter to 0, NewGWorld uses the GDevice structure for the graphics device with the greatest pixel depth among all graphics devices whose boundary rectangles intersect the rectangle that you specify in the boundsRect parameter. You should pass NULL in this parameter if the computer supports only basic QuickDraw. Generally, your application should never create GDevice structures for offscreen graphics worlds.
Options available to your application. You can set a combination of the flags pixPurge, noNewDevice, useTempMem, and keepLocal. If you don’t wish to use any of these flags, specify 0 in this parameter to accept the default behavior for NewGWorld. The default behavior creates an offscreen graphics world where the base address for the offscreen pixel image is unpurgeable, it uses an existing GDevice structure (if you pass 0 in the depth parameter) or creates a new GDevice structure, it uses memory in your application heap, and it allows graphics accelerators to cache the offscreen pixel image. See “Graphics World Flags” for a description of the values you can use here.
A result code.
Typically, you pass 0 in the pixelDepth parameter, a window’s port rectangle in the boundsRect parameter, NULL in the cTable and aGDevice parameters, and in the flags parameter a 0. This provides your application with the default behavior of NewGWorld, and it supports computers running basic QuickDraw. This also allows QuickDraw to optimize the CopyBits, CopyMask, and CopyDeepMask functions when your application copies the image in an offscreen graphics world into an onscreen graphics port.
The NewGWorld function allocates memory for an offscreen graphics port and its pixel map. On computers that support only basic QuickDraw, NewGWorld creates a 1-bit pixel map that your application can manipulate using other relevant functions described in this chapter. Your application can copy this 1-bit pixel map into basic graphics ports.
Unless you specify 0 in the pixelDepth parameter–or pass the noNewDevice flag in the flags parameter and supply a GDevice structure in the aGDevice parameter– NewGWorld also allocates a new offscreen GDevice structure.
When creating an image, use the NewGWorld function to create an offscreen graphics world that is optimized for an image’s characteristics—for example, its best pixel depth. After creating the image, use the CopyBits, CopyMask, or CopyDeepMask function to copy that image to an onscreen graphics port. Color QuickDraw automatically renders the image at the best available pixel depth for the screen. Creating an image in an offscreen graphics port and then copying it to the screen in this way prevents the visual choppiness that would otherwise occur if your application were to build a complex image directly onscreen.
The NewGWorld function initializes the offscreen graphics port by calling the OpenCPort function. The NewGWorld function sets the offscreen graphics port’s visible region to a rectangular region coincident with its boundary rectangle. The NewGWorld function generates an inverse table with the Color Manager function MakeITable, unless one of the GDevice structures for the screens has the same color table as the GDevice structure for the offscreen world, in which case NewGWorld uses the inverse table from that GDevice structure.
The address of the offscreen pixel image is not directly accessible from the PixMap structure for the offscreen graphics world. However, you can use the GetPixBaseAddr function to get a pointer to the beginning of the offscreen pixel image.
For purposes of estimating memory use, you can compute the size of the offscreen pixel image by using this formula:
rowBytes * (boundsRect.bottom – boundsRect.top)
In the flags parameter, you can specify several options. If you don’t want to use any of these options, pass 0 in the flags parameter:
If you specify the pixPurge flag, NewGWorld stores the offscreen pixel image in a purgeable block of memory. In this case, before drawing to or from the offscreen pixel image, your application should call the LockPixels function and ensure that it returns TRUE. If LockPixels returns FALSE, the memory for the pixel image has been purged, and your application should either call UpdateGWorld to reallocate it and then reconstruct the pixel image, or draw directly in a window instead of preparing the image in an offscreen graphics world. Never draw to or copy from an offscreen pixel image that has been purged without reallocating its memory and then reconstructing it.
If you specify the noNewDevice flag, NewGWorld does not create a new offscreen GDevice structure. Instead, it uses the GDevice structure that you specify in the aGDevice parameter–and its associated pixel depth and color table–to create the offscreen graphics world. (If you set the pixelDepth parameter to 0, NewGWorld uses the GDevice structure for the screen with the greatest pixel depth among all the screens whose boundary rectangles intersect the rectangle that you specify in the boundsRect parameter–even if you specify the noNewDevice flag.) The NewGWorld function keeps a reference to the GDevice structure for the offscreen graphics world, and the SetGWorld function uses that structure to set the current graphics device.
If you set the useTempMem flag, NewGWorld creates the base address for an offscreen pixel image in temporary memory. You generally would not use this flag, because you should use temporary memory only for fleeting purposes and only with the AllowPurgePixels function.
If you specify the keepLocal flag, your offscreen pixel image is kept in Macintosh main memory and is not cached to a graphics accelerator card. use this flag carefully, as it negates the advantages provided by any graphics acceleration card that might be present.
If your application needs to change the pixel depth, boundary rectangle, or color table for an offscreen graphics world, use the UpdateGWorld function.
If you supply a handle to a ColorTable structure in the cTable parameter, NewGWorld makes a copy of the structure and stores its handle in the offscreen PixMap structure. It is your application’s responsibility to make sure that the ColorTable structure you specify in the cTable parameter is valid for the offscreen graphics port’s pixel depth.
If when using NewGWorld you specify a pixel depth, color table, or GDevice structure that differs from those used by the window into which you copy your offscreen image, the CopyBits, CopyMask, and CopyDeepMask functions require extra time to complete.
To use a custom color table in an offscreen graphics world, you need to create the associated offscreen GDevice structure, because Color QuickDraw needs its inverse table.
The NewGWorld function may move or purge memory blocks in the application heap; do not call this function at interrupt time.
QuickTimeComponents.k.h
Begins creating a new region.
RgnHandle NewRgn ( void );
A handle to the new region.
The NewRgn function allocates space for a new, variable-size region and initializes it to the empty region defined by the rectangle (0,0,0,0). This is the only function that creates a new region; other functions merely alter the size or shape of existing regions.
To begin defining a region, use the OpenRgn function.
If the points or rectangles supplied to this function are defined in a graphics port other than your current graphics port, you must convert them to the local coordinate system of your current graphics port. You can accomplish this by using the SetPort function to change to the graphics port containing the points or rectangles, using the LocalGlobal function to convert their locations to global coordinates, using SetPort to return to your starting graphics port, and then using the GlobalToLocal function to convert the locations of points or rectangles to the local coordinates of your current graphics port.
The NewRgn function may move or purge memory blocks in the application heap; do not call this function at interrupt time.
Use the Memory Manager function MaxMem to determine whether the memory for the region is valid before using NewRgn.
Ensure that the memory for a region is valid before calling this function to manipulate that region if there isn’t sufficient memory, the system may crash. Regions are limited to 32 KB in size in basic QuickDraw and 64 KB in color QuickDraw. Before defining a region, you can use the Memory Manager function MaxMem to determine whether the memory for the region is valid. You can determine the current size of an existing region by calling the Memory Manager function GetHandleSize. When you record drawing operations in an open region, the resulting region description may overflow the 32 KB or 64 KB limit. Should this happen in color QuickDraw, the QDError function returns the result code regionTooBigError.
QuickdrawAPI.h
Hides the cursor until the next time the user moves the mouse.
void ObscureCursor ( void );
Your application normally calls ObscureCursor when the user begins to type. Unlike HideCursor , ObscureCursor has no effect on the cursor level and must not be balanced by a call to ShowCursor.
QuickdrawAPI.h
Moves a rectangle.
void OffsetRect ( Rect * r, short dh, short dv );
A pointer to the rectangle to move.
The horizontal distance to move the rectangle.
The vertical distance to move the rectangle.
The OffsetRect function moves the rectangle that you specify in the r parameter by adding the value you specify in the dh parameter to each of its horizontal coordinates and the value you specify in the dv parameter to each of its vertical coordinates. If the dh and dv parameters are positive, the movement is to the right and down; if either is negative, the corresponding movement is in the opposite direction. The rectangle retains its shape and size; it is merely moved on the coordinate plane. The movement does not affect the screen unless you subsequently call a function to draw within the rectangle.
If the points or rectangles supplied to this function are defined in a graphics port other than your current graphics port, you must convert them to the local coordinate system of your current graphics port. You can accomplish this by using the SetPort function to change to the graphics port containing the points or rectangles, using the LocalGlobal function to convert their locations to global coordinates, using SetPort to return to your starting graphics port, and then using the GlobalToLocal function to convert the locations of points or rectangles to the local coordinates of your current graphics port.
QuickdrawAPI.h
Moves a region.
void OffsetRgn ( RgnHandle rgn, short dh, short dv );
A handle to the region to move.
The horizontal distance to move the region.
The vertical distance to move the region.
The OffsetRgn function moves the region whose handle you pass in the rgn parameter by adding the value you specify in the dh parameter to the horizontal coordinates of all points of its region boundary, and by adding the value you specify in the dv parameter to the vertical coordinates of all points of its region boundary. If the values of dh and dv are positive, the movement is to the right and down; if either is negative, the corresponding movement is in the opposite direction. The region retains its size and shape. This does not affect the screen unless you subsequently call a function to draw the region.
The OffsetRgn function is an especially efficient operation, because most of the data defining a region is stored relative to the rgnBBox field in its Region structure and so is not actually changed by OffsetRgn.
QuickdrawAPI.h
Determines the smallest rectangle that encloses two given points.
void Pt2Rect ( Point pt1, Point pt2, Rect *dstRect );
The first of two points to enclose.
The second of two points to enclose.
On return, a pointer to the smallest rectangle that can enclose them.
If the points or rectangles supplied to this function are defined in a graphics port other than your current graphics port, you must convert them to the local coordinate system of your current graphics port. You can accomplish this by using the SetPort function to change to the graphics port containing the points or rectangles, using the LocalGlobal function to convert their locations to global coordinates, using SetPort to return to your starting graphics port, and then using the GlobalToLocal function to convert the locations of points or rectangles to the local coordinates of your current graphics port.
QuickdrawAPI.h
Determines whether a pixel below is enclosed in a rectangle.
Boolean PtInRect ( Point pt, const Rect * r );
The point to test.
The rectangle to test.
TRUE if the pixel below and to the right of the point specified in the pt parameter is enclosed in the rectangle specified in the r parameter. FALSE if it is not.
If the points or rectangles supplied to this function are defined in a graphics port other than your current graphics port, you must convert them to the local coordinate system of your current graphics port. You can accomplish this by using the SetPort function to change to the graphics port containing the points or rectangles, using the LocalGlobal function to convert their locations to global coordinates, using SetPort to return to your starting graphics port, and then using the GlobalToLocal function to convert the locations of points or rectangles to the local coordinates of your current graphics port.
QuickdrawAPI.h
Determines whether a pixel is within a region.
Boolean PtInRgn ( Point pt, RgnHandle rgn );
The point whose pixel is to be checked.
A handle to the region to test.
TRUE if the pixel below and to the right of the point specified in the pt parameter is within the region whose handle is specified in the rgn parameter. FALSE if it is not.
If the points or rectangles supplied to this function are defined in a graphics port other than your current graphics port, you must convert them to the local coordinate system of your current graphics port. You can accomplish this by using the SetPort function to change to the graphics port containing the points or rectangles, using the LocalGlobal function to convert their locations to global coordinates, using SetPort to return to your starting graphics port, and then using the GlobalToLocal function to convert the locations of points or rectangles to the local coordinates of your current graphics port.
QuickdrawAPI.h
Calculates an angle between a vertical line pointing straight up from the center of a rectangle and a line from the center to a given point.
void PtToAngle ( const Rect *r, Point pt, short *angle );
The rectangle to examine.
The point to which an angle is to be calculated.
On return, a pointer to the resulting angle.
The result returned in the angle parameter is specified in degrees from 0 to 359, measured clockwise from 12 o’clock, with 90 at 3 o’clock, 180 at 6 o’clock, and 270 at 9 o’clock. Other angles are measured relative to the rectangle. If the line to the given point goes through the upper-right corner of the rectangle, the angle returned is 45, even if the rectangle is not square if it goes through the lower-right corner, the angle is 135, and so on.
The angle returned can be used as input to one of the functions that manipulate arcs and wedges, in “Drawing Arcs and Wedges”.
If the points or rectangles supplied to this function are defined in a graphics port other than your current graphics port, you must convert them to the local coordinate system of your current graphics port. You can accomplish this by using the SetPort function to change to the graphics port containing the points or rectangles, using the LocalGlobal function to convert their locations to global coordinates, using SetPort to return to your starting graphics port, and then using the GlobalToLocal function to convert the locations of points or rectangles to the local coordinates of your current graphics port.
QuickdrawAPI.h
Returns a Quartz 2D drawing environment associated with a graphics port.
OSStatus QDBeginCGContext ( CGrafPtr inPort, CGContextRef *outContext );
A color graphics port in which to draw. Offscreen graphics worlds with pixel depths of 1, 2, 4, and 8 are not supported. When using Quartz 2D to draw in a offscreen graphics world, alpha information is always ignored.
A pointer to your storage for a Quartz context. Upon completion, contextPtr points to a context associated with the port. The context matches the port’s pixel depth, width, and height. Otherwise the context is in a default state and does not necessarily match other port attributes such as foreground color, background color, or clip region.
You should not retain or release the context. When you are finished using the context, you should call QDEndCGContext.
A result code. If noErr, the context was successfully initiated.
Applications running in Mac OS X can use Quartz 2D to draw in a QuickDraw graphics port. When you call this function, you obtain a Quartz context that’s associated with the specified port. To improve performance, contexts returned by this function are cached and reused during subsequent calls whenever possible.
Each block of Quartz 2D drawing code in your application should be surrounded by calls to this function and QDEndCGContext. Nested calls to this function for the same graphics port are not permitted—that is, for a given port you should not call this function more than once without an intervening call to QDEndCGContext.
While the Quartz context is in use, all Quickdraw imaging operations in the associated graphics port are disabled. This is done because the operations would fail during printing.
For information about how to use a Quartz context, see Quartz 2D Programming Guide.
QuickdrawAPI.h
Terminates a Quartz 2D drawing environment associated with a graphics port.
OSStatus QDEndCGContext ( CGrafPtr inPort, CGContextRef *inoutContext );
A graphics port specified in a preceding call to QDBeginCGContext.
A pointer to the context obtained in the preceding call to QDBeginCGContext for the port. Upon completion, the storage pointed to by contextPtr is set to NULL.
A result code. If noErr, the context is terminated.
After you finish using Quartz 2D to draw in a graphics port, you should call this function to terminate the context. For more information, see QDBeginCGContext.
Before calling this function, you should do one of the following:
Call CGContextSynchronize to mark the affected areas of the port for update.
Call CGContextFlush to immediately update the destination device.
QuickdrawAPI.hReturns the Quartz display ID that corresponds to a QuickDraw graphics device.
CGDirectDisplayID QDGetCGDirectDisplayID ( GDHandle inGDevice );
A QuickDraw graphics device.
A Quartz display ID, or NULL if the inGDevice parameter does not represent a display. For information about using a display ID, see Quartz Display Services Reference.
QuickdrawAPI.h
Creates a QDPict picture, using QuickDraw picture data supplied with a Quartz data provider.
QDPictRef QDPictCreateWithProvider ( CGDataProviderRef provider );
A Quartz data provider that supplies QuickDraw picture data. The picture data must begin at either the first byte or the 513th byte in the data provider. The picture bounds must not be an empty rectangle.
QuickDraw retains the data provider you pass in, and you may safely release it after this function returns.
A new QDPict picture, or NULL if the picture data is not valid. The initial retain count is 1. After you finish using the picture, you should release it by calling QDPictRelease.
This function creates a QDPict picture that you can draw in a Quartz context. For general information about QDPict pictures, see QDPictRef.
QDPictToCGContext.h
Creates a QDPict picture, using QuickDraw picture data specified with a Core Foundation URL.
QDPictRef QDPictCreateWithURL ( CFURLRef url );
A Core Foundation URL that specifies a PICT file containing the QuickDraw picture data. The picture header data must begin at either the first byte or the 513th byte in the PICT file. The picture bounds must not be an empty rectangle.
A new QDPict picture, or NULL if the picture data is not valid. The initial retain count is 1. After you finish using the picture, you should release it by calling QDPictRelease.
This function creates a QDPict picture that you can draw in a Quartz context. For general information about QDPict pictures, see QDPictRef.
QDPictToCGContext.h
Draws a QuickDraw picture in a Quartz context.
OSStatus QDPictDrawToCGContext ( CGContextRef ctx, CGRect rect, QDPictRef pictRef );
The Quartz context in which to draw.
The rectangular area in which to draw the picture. You should specify the origin and size of this rectangle in user space units. The origin is the lower left corner of the picture when drawn. If necessary, the picture is scaled to fit inside this rectangle. To get unscaled results, you should pass the rectangle returned by QDPictGetBounds. For additional information about scaling, see the discussion below.
A QDPict picture.
A result code. A non-zero result indicates that the picture was not successfully drawn.
This function converts the picture data in a QDPict picture into an equivalent sequence of Quartz 2D graphics operations. Conceptually this is the same processing path taken when an application running in Mac OS X draws into a QuickDraw printing port.
When drawing a QDPict picture in a Quartz context, there are two ways to change the horizontal or vertical scale of the picture:
Construct the drawing rectangle (see the rect parameter) by applying the change of scale to the bounds rectangle returned by QDPictGetBounds. In this case, QuickDraw scales all the graphic elements in the picture except for patterns—the same behavior as DrawPicture.
Prior to calling QDPictDrawToCGContext, apply the change of scale to the current transformation matrix in the Quartz context—for example, by calling CGContextScaleCTM. In this case, QuickDraw scales the entire picture including patterns.
In a bitmap-based context, the picture is rendered into the bitmap. In a PDF-based context, the picture is converted into a PDF content stream. If the picture uses transfer modes such as srcXor that do not have an analog in Quartz 2D, the PDF representation may not match the original exactly.
QDPictToCGContext.h
Returns the intended location and size of a QDPict picture.
CGRect QDPictGetBounds ( QDPictRef pictRef );
A QDPict picture.
A Quartz rectangle that represents the intended location and size of the picture. The rectangle is in default user space with one unit = 1/72 inch, and the origin is the lower-left corner of the picture.
If the native resolution in the picture data is not 72 pixels per inch, the bounding rectangle returned by this function is scaled as follows:
width = width in pixels * 72 / horizontal resolution |
height = height in pixels * 72 / vertical resolution |
QDPictToCGContext.h
Returns the horizontal and vertical resolution of a QDPict picture.
void QDPictGetResolution ( QDPictRef pictRef, float *xRes, float *yRes );
A QDPict picture.
A pointer to your storage for a return value. Upon completion, the value is the picture’s horizontal resolution in pixels per inch.
A pointer to your storage for a return value. Upon completion, the value is the picture’s vertical resolution in pixels per inch.
This function returns resolution data that you can use—together with the rectangle returned by QDPictGetBounds—to compute the picture’s size in pixels.
QDPictToCGContext.h
Releases a QDPict picture.
void QDPictRelease ( QDPictRef pictRef );
A QDPict picture which you created or retained.
After you finish using a QDPict picture that you created or retained, you should call this function to release the picture. If the picture’s retain count becomes 0, this function frees the picture and any associated resources such as the picture’s data provider.
QDPictToCGContext.hRetains a QDPict picture.
QDPictRef QDPictRetain ( QDPictRef pictRef );
A QDPict picture.
The retained picture.
You should call this function when you obtain a QDPict picture that you did not create and you want to retain the picture for later use. When you no longer need the retained picture, you should call QDPictRelease to release it.
QDPictToCGContext.h
OSStatus QDRegionToRects ( RgnHandle rgn, QDRegionParseDirection dir, RegionToRectsUPP proc, void *userData );
QuickdrawAPI.h
Determines whether a rectangle intersects a region.
Boolean RectInRgn ( const Rect *r, RgnHandle rgn );
The rectangle to check for intersection.
A handle to the region to check.
TRUE if the rectangle specified in the r parameter intersects the region whose handle is specified in the rgn parameter. The RectInRgn function returns TRUE if the intersection encloses at least 1 bit or FALSE if it does not.
If the points or rectangles supplied to this function are defined in a graphics port other than your current graphics port, you must convert them to the local coordinate system of your current graphics port. You can accomplish this by using the SetPort function to change to the graphics port containing the points or rectangles, using the LocalGlobal function to convert their locations to global coordinates, using SetPort to return to your starting graphics port, and then using the GlobalToLocal function to convert the locations of points or rectangles to the local coordinates of your current graphics port.
The RectInRgn function sometimes returns TRUE when the rectangle merely intersects the region’s bounding rectangle. If you need to know exactly whether a given rectangle intersects the actual region, use RectRgn to set the rectangle to a region, and call SectRgn to see whether the two regions intersect. If the result of SectRgn is an empty region, then the rectangle does not intersect the region.
QuickdrawAPI.h
Changes the structure of an existing region to that of a rectangle.
void RectRgn ( RgnHandle rgn, const Rect *r );
A handle to the region to restructure as a rectangle.
The rectangle structure to use.
The RectRgn function destroys the previous structure of the SetRectRgn function, and it then sets the new structure to a rectangle that you specify in the r parameter.
As an alternative to the RectRgn function, use the SetRectRgn function, which accepts as parameters four coordinates instead of a rectangle.
If the points or rectangles supplied to this function are defined in a graphics port other than your current graphics port, you must convert them to the local coordinate system of your current graphics port. You can accomplish this by using the SetPort function to change to the graphics port containing the points or rectangles, using the LocalGlobal function to convert their locations to global coordinates, using SetPort to return to your starting graphics port, and then using the GlobalToLocal function to convert the locations of points or rectangles to the local coordinates of your current graphics port.
The RectRgn function may move or purge memory blocks in the application heap; do not call this function at interrupt time.
QuickdrawAPI.h
void RgnToHandle ( RgnHandle region, Handle flattenedRgnDataHdl );
QuickdrawAPI.h
Scales a height and width according to the proportions of two rectangles.
void ScalePt ( Point *pt, const Rect *srcRect, const Rect *dstRect );
On input, a pointer to an initial height and width (specified in the two fields of a Point structure) to scale; on return, vertical and horizontal scaling factors derived by multiplying the height and width by ratios of the height and width of the rectangle in the srcRect parameter to the height and width of the rectangle in the dstRect parameter.
You do not pass coordinates in this parameter. Instead, you pass an initial height to scale in the v (or vertical) field of the Point structure, and you pass an initial width to scale in the h (or horizontal) field.
The ScalePt function scales these measurements by multiplying the initial height by the ratio of the height of the rectangle you specify in the dstRect parameter to the height of the rectangle you specify in the srcRect parameter, and by multiplying the initial width by the ratio of the width of the dstRect rectangle to the width of the srcRect rectangle.
A rectangle. The ratio of this rectangle’s height to the height of the rectangle in the dstRect parameter provides the vertical scaling factor, and the ratio of this rectangle’s width to the width of the rectangle in the dstRect parameter provides the horizontal scaling factor.
A rectangle compared to the rectangle in the srcRect parameter to determine vertical and horizontal scaling factors.
The ScalePt function produces horizontal and vertical scaling factors from the proportions of two rectangles. Use ScalePt, for example, to scale the dimensions of the graphics pen.
Where the width of the dstRect rectangle is twice the width of the srcRect rectangle, and its height is three times the height of srcRect, ScalePt scales the width of the graphics pen from 3 to 6 and scales its height from 2 to 6.
The minimum value ScalePt returns is (1,1).
If the points or rectangles supplied to this function are defined in a graphics port other than your current graphics port, you must convert them to the local coordinate system of your current graphics port. You can accomplish this by using the SetPort function to change to the graphics port containing the points or rectangles, using the LocalGlobal function to convert their locations to global coordinates, using SetPort to return to your starting graphics port, and then using the GlobalToLocal function to convert the locations of points or rectangles to the local coordinates of your current graphics port.
QuickdrawAPI.h
Determines whether two rectangles intersect.
Boolean SectRect ( const Rect *src1, const Rect *src2, Rect *dstRect );
The first of two rectangles to test for intersection.
The second of two rectangles to test for intersection.
On return, a pointer to the rectangle marking the intersection of the first two rectangles.
TRUE if the specified rectangles intersect or FALSE if they do not.
The SectRect function calculates the rectangle that delineates the intersection of the two rectangles you specify in the src1 and src2 parameters. Rectangles that touch at a line or a point are not considered intersecting, because their intersection rectangle (actually, in this case, an intersection line or point) does not enclose any pixels in the bit image.
If the rectangles do not intersect, the destination rectangle is set to (0,0,0,0). The SectRect function works correctly even if one of the source rectangles is also the destination.
If the points or rectangles supplied to this function are defined in a graphics port other than your current graphics port, you must convert them to the local coordinate system of your current graphics port. You can accomplish this by using the SetPort function to change to the graphics port containing the points or rectangles, using the LocalGlobal function to convert their locations to global coordinates, using SetPort to return to your starting graphics port, and then using the GlobalToLocal function to convert the locations of points or rectangles to the local coordinates of your current graphics port.
QuickdrawAPI.h
Calculates the intersection of two regions.
void SectRgn ( RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn );
A handle to the first of two regions whose intersection is to be determined.
A handle to the second of two regions whose intersection is to be determined.
On return, a handle to the region holding the intersection area. If the regions do not intersect, or one of the regions is empty, SectRgn sets the destination to the empty region defined by the rectangle (0,0,0,0).
The SectRgn function does not create a destination region; you must have already allocated memory for it by using the NewRgn function.
The destination region may be one of the source regions, if desired.
The SectRgn procedure calculates the intersection of the two regions whose handles you pass in the srcRgnA and srcRgnB parameters, and it places the intersection in the region whose handle you pass in the dstRgn parameter. If the regions do not intersect, or one of the regions is empty, SectRgn sets the destination to the empty region defined by the rectangle (0,0,0,0).
The SectRgn procedure does not create a destination region; you must have already allocated memory for it by using the NewRgn function.
The destination region may be one of the source regions, if desired.
The SectRgn function may temporarily use heap space that’s twice the size of the two input regions.
The SectRgn function may move or purge memory blocks in the application heap; do not call this function at interrupt time.
QuickdrawAPI.h
Changes the clipping region of the current graphics port (basic or color) to a region you specify. (Deprecated. Use Quartz 2D instead; see Quartz Programming Guide for QuickDraw Developers.)
void SetClip ( RgnHandle rgn );
A handle to a region. The SetClip function makes this region the clipping region of the current graphics port. The SetClip function doesn’t change the region handle, but instead affects the clipping region itself.
Since SetClip copies the specified region into the current graphics port’s clipping region, any subsequent changes you make to the region specified in the rgn parameter do not affect the clipping region of the graphics port.
The initial clipping region of a graphics port is an arbitrarily large rectangle. You can set the clipping region to any arbitrary region, to aid you in drawing inside the graphics port—for example, to avoid drawing over scroll bars when drawing into a window, you could define a clipping region that excludes the scroll bars.
You can use the GetClip and SetClip functions to preserve the current clipping region: use GetClip to save the current port’s clipping region, and use SetClip to restore it.
All other system software functions preserve the current clipping region.
The SetClip function may move or purge memory blocks in the application heap. Your application should not call this function at interrupt time.
ImageCompression.k.h
Sets an existing region to be empty.
void SetEmptyRgn ( RgnHandle rgn );
A handle to the region to be made empty.
The SetEmptyRgn function destroys the previous structure of the region whose handle you pass in the rgn parameter; it then sets the new structure to the empty region defined by the rectangle (0,0,0,0).
The SetEmptyRgn function may move or purge memory blocks in the application heap; do not call this function at interrupt time.
QuickdrawAPI.h
Changes the current graphics port (basic, color, or offscreen). (Deprecated. Use Quartz 2D instead; see Quartz Programming Guide for QuickDraw Developers.)
void SetGWorld ( CGrafPtr port, GDHandle gdh );
A pointer to an offscreen graphics world, color graphics port, or basic graphics port. Specify values of type GrafPtr, CGrafPtr, or GWorldPtr, depending on whether you want to set the current graphics port to be a basic graphics port, color graphics port, or offscreen graphics world. Any drawing your application performs then occurs in this graphics port.
A handle to a GDevice structure. If you pass a pointer to an offscreen graphics world in the port parameter, set this parameter to NULL, because SetGWorld ignores this parameter and sets the current device to the device attached to the offscreen graphics world.
The SetGWorld function sets the current graphics port to the one specified by the port parameter and—unless you set the current graphics port to be an offscreen graphics world—sets the current device to that specified by the gdh parameter.
The SetGWorld function may move or purge memory blocks in the application heap; do not call this function at interrupt time.
ImageCompression.k.h
Assigns two coordinates to a point.
void SetPt ( Point *pt, short h, short v );
A pointer to the point to be given new coordinates. On return, this point is assigned the horizontal coordinate you specify in the h parameter and the vertical coordinate you specify in the v parameter.
The horizontal value of the new coordinates.
The vertical value of the new coordinates.
The SetPt procedure assigns the horizontal coordinate specified in the h parameter and the vertical coordinate specified in the v parameter to the point returned in the pt parameter.
QuickdrawAPI.h
Assigns coordinates to a rectangle.
void SetRect ( Rect * r, short left, short top, short right, short bottom );
A pointer to the rectangle to set.
The horizontal coordinate of the new upper-left corner of the rectangle.
The vertical coordinate of the new upper-left corner of the rectangle.
The horizontal coordinate of the new lower-right corner of the rectangle.
The vertical coordinate of the new lower-right corner of the rectangle.
The SetRect function assigns the coordinates you specify in the left, top, right, and bottom parameters to the rectangle that you specify in the r parameter. This function is provided to help you shorten your program text. If you want a more readable text, at the expense of source text length, you can instead assign integers (or points) directly into the fields of a Rect structure.
You can use a rectangle to specify locations and sizes for various graphics operations.
If the points or rectangles supplied to this function are defined in a graphics port other than your current graphics port, you must convert them to the local coordinate system of your current graphics port. You can accomplish this by using the SetPort function to change to the graphics port containing the points or rectangles, using the LocalGlobal function to convert their locations to global coordinates, using SetPort to return to your starting graphics port, and then using the GlobalToLocal function to convert the locations of points or rectangles to the local coordinates of your current graphics port.
QuickdrawAPI.h
Changes the structure of an existing region to that of a rectangle.
void SetRectRgn ( RgnHandle rgn, short left, short top, short right, short bottom );
A handle to the region to restructure as a rectangle.
The horizontal coordinate of the upper-left corner of the rectangle to set as the new region.
The vertical coordinate of the upper-left corner of the rectangle to set as the new region.
The horizontal coordinate of the lower-right corner of the rectangle to set as the new region.
The vertical coordinate of the lower-right corner of the rectangle to set as the new region.
The SetRectRgn function destroys the previous structure of the region whose handle you pass in the rgn parameter, and it then sets the new structure to the rectangle that you specify in the left, top, right, and bottom parameters. If you specify an empty rectangle (that is, right is greater than or equal to left or bottom = top), the SetRectRgn function sets the region to the empty region defined by the rectangle (0,0,0,0).
As an alternative to the SetRectRgn function, you can change the structure of an existing region to that of a rectangle by using the RectRgn function, which accepts as a parameter a rectangle instead of four coordinates.
If the points or rectangles supplied to this function are defined in a graphics port other than your current graphics port, you must convert them to the local coordinate system of your current graphics port. You can accomplish this by using the SetPort function to change to the graphics port containing the points or rectangles, using the LocalGlobal function to convert their locations to global coordinates, using SetPort to return to your starting graphics port, and then using the GlobalToLocal function to convert the locations of points or rectangles to the local coordinates of your current graphics port.
The SetRectRgn function may move or purge memory blocks in the application heap; do not call this function at interrupt time.
QuickdrawAPI.h
Hides the cursor in a rectangle.
void ShieldCursor ( const Rect *shieldRect, Point offsetPt );
A rectangle in which the cursor is hidden whenever the cursor intersects the rectangle. The rectangle may be specified in global or local coordinates. If you are using global coordinates, pass (0,0) in the offsetPt parameter. If you are using the local coordinates of a graphics port, pass the coordinates for the upper-left corner of the graphics port’s boundary rectangle in the offsetPt parameter.
A point value for the offset of the rectangle. Like the basic QuickDraw function LocalToGlobal, the ShieldCursor function offsets the coordinates of the rectangle by the coordinates of this point.
If the cursor and the given rectangle intersect, ShieldCursor hides the cursor. If they do not intersect, the cursor remains visible while the mouse is not moving, but is hidden when the mouse moves. Use this function with a feature such as QuickTime to display content in a specified rectangle. When a QuickTime movie is animating, the cursor should not be visible in front of the movie.
The ShieldCursor function decrements the cursor level and should be balanced by a call to the ShowCursor function.
QuickdrawAPI.h
Displays a cursor hidden by the HideCursor or ShieldCursor functions.
void ShowCursor ( void );
ShowCursor increments the cursor level, which has been decremented by the HideCursor or ShieldCursor function and displays the cursor on the screen when the level is 0. A call to the ShowCursor function balances each previous call to the HideCursor or ShieldCursor function. The level is not incremented beyond 0, so extra calls to ShowCursor have no effect.
Low-level interrupt-driven functions link the cursor with the mouse position, so that if the cursor level is 0 and visible, the cursor automatically follows the mouse.
If the cursor has been changed with the SetCursor function while hidden, ShowCursor displays the new cursor.
QuickdrawAPI.h
Converts an angle value to a slope value.
Fixed SlopeFromAngle ( short angle );
The angle, expressed in clockwise degrees from 12 o’clock and treated MOD 180. (90 degrees is thus at 3 o’clock and –90 degrees is at 9 o’clock.
The slope corresponding to the angle specified in the angle parameter. Slopes are defined as Dx/Dy, the horizontal change divided by the vertical change between any two points on a line with the given angle. The negative y-axis is defined as being at 12 o’clock, and the positive y-axis at 6 o’clock. The x-axis is defined as usual, with the positive side defined as being at 3 o’clock.
QuickdrawAPI.h
Subtracts the coordinates of one point from another.
void SubPt ( Point src, Point *dst );
A point, the coordinates of which are to be subtracted from the coordinates of the point specified in the dst parameter.
The address of a point. Upon completion, the coordinates of this point contain the differences between the coordinates of the two points specified in the entry parameters.
If you pass NULL in the dst parameter, this function sets the QDError result code to paramErr and returns.
QuickdrawAPI.h
Calculates the smallest rectangle that encloses two rectangles.
void UnionRect ( const Rect * src1, const Rect * src2, Rect * dstRect );
The first of two rectangles to enclose.
The second of two rectangles to enclose.
On return, a pointer to the smallest rectangle that encloses both of the rectangles you specify in the src1 and src2 parameters. One of the source rectangles may also be the destination.
If the points or rectangles supplied to this function are defined in a graphics port other than your current graphics port, you must convert them to the local coordinate system of your current graphics port. You can accomplish this by using the SetPort function to change to the graphics port containing the points or rectangles, using the LocalGlobal function to convert their locations to global coordinates, using SetPort to return to your starting graphics port, and then using the GlobalToLocal function to convert the locations of points or rectangles to the local coordinates of your current graphics port.
QuickdrawAPI.h
Calculates the union of two regions.
void UnionRgn ( RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn );
A handle to the first of two regions whose union is to be determined.
A handle to the second of two regions whose union is to be determined.
On return, a handle to the region holding the resulting union area. If both regions are empty, UnionRgn sets the destination to the empty region defined by the rectangle (0,0,0,0).
The UnionRgn function does not create the destination region; you must have already allocated memory for it by using the NewRgn function.
The destination region may be one of the source regions, if desired.
The UnionRgn procedure calculates the union of the two regions whose handles you pass in the srcRgnA and srcRgnB parameters, and it places the union in the region whose handle you pass in the dstRgn parameter. If both regions are empty, UnionRgn sets the destination to the empty region defined by the rectangle (0,0,0,0).
The UnionRgn function may temporarily use heap space that’s twice the size of the two input regions.
The UnionRgn function may move or purge memory blocks in the application heap; do not call this function at interrupt time.
QuickdrawAPI.h
Calculates the difference between the union and the intersection of two regions.
void XorRgn ( RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn );
A handle to the first of two regions to compare.
A handle to the second of two regions to compare.
On return, a handle to the region holding the result.
This does not create the destination region; you must have already allocated memory for it by using the NewRgn function.
If the regions are coincident, XorRgn sets the destination region to the empty region defined by the rectangle (0,0,0,0).
The XorRgn procedure calculates the difference between the union and the intersection of the regions whose handles you pass in the srcRgnA and srcRgnB parameters and places the result in the region whose handle you pass in the dstRgn parameter.
The XorRgn function may temporarily use heap space that’s twice the size of the two input regions.
The XorRgn function may move or purge memory blocks in the application heap; do not call this function at interrupt time.
QuickdrawAPI.hDefines a pointer to a color inversion callback function that overrides the Color Manager’s color inversion method.
typedef Boolean (*ColorComplementProcPtr) ( RGBColor * rgb );
If you name your function MyColorComplementProc, you would declare it like this:
Boolean ColorComplementProcPtr ( RGBColor * rgb );
A pointer to the RGBColor data structure. Change it to reflect the inverted value.
QuickdrawTypes.hDefines a pointer to a color search callback function that overrides the Color Manager’s code for inverse table mapping.
typedef Boolean (*ColorSearchProcPtr) ( RGBColor * rgb, long * position );
If you name your function MyColorSearchProc, you would declare it like this:
Boolean ColorSearchProcPtr ( RGBColor * rgb, long * position );
A pointer to the RGBColor data structure passed to your search function. Your function should set the ColorSpec.value field to the index corresponding to the color indicated here.
A pointer to the index of the best-mapping color your function finds.
True if your function succeeds, false if your function cannot find a match.
Your MyColorSearchCallback function should examine the RGBColor data structure passed to it by the Color Manager and return the index to the best-mapping color in the current GDevice data structure.
The Color Manager specifies the desired color in the RGBColor field of a ColorSpec data structure and passes it by a pointer on the stack. Your function should return the corresponding index in the ColorSpec.value field. If your function cannot handle the search, return false as the function value, and pass the RGBColor data structure back to the Color Manager in the rgb parameter.
The Color Manager calls each search function in the list until one returns the Boolean value true. If no search function installed in the linked list returns true, the Color Manager calls the default search function.
QuickdrawTypes.htypedef void (*CustomXFerProcPtr) ( CustomXFerRecPtr info );
If you name your function MyCustomXFerProc, you would declare it like this:
void CustomXFerProcPtr ( CustomXFerRecPtr info );
QuickdrawAPI.htypedef void (*DeviceLoopDrawingProcPtr) ( short depth, short deviceFlags, GDHandle targetDevice, long userData );
If you name your function MyDeviceLoopDrawingProc, you would declare it like this:
void DeviceLoopDrawingProcPtr ( short depth, short deviceFlags, GDHandle targetDevice, long userData );
The pixel depth of the graphics device.
Constants which represent bits that are set to 1 in the gdFlags field of the GDevice structure for the current device. See “Device Attribute Constants” for a description of the values which you can receive in this parameter.
A handle to the GDevice structure for the current device.
A value that your application supplies to the DeviceLoop function, which in turn passes the value to your drawing function for whatever purpose you deem useful.
For each video device that intersects a drawing region that you define (generally, the update region of a window), DeviceLoop calls your drawing function. Your drawing function should analyze the pixel depth passed in the depth parameter and the values passed in the deviceFlags parameter, and then draw in a manner that is optimized for the current device.
When highlighting, for example, your application might invert black and white when drawing onto a 1-bit video device but use magenta as the highlight color when drawing onto a color video device. In this case, even were your window to span both a black-and-white and a color screen, the user sees the selection inverted on the black-and-white screen, while magenta would be used to highlight the selection on the color screen.
You must provide a pointer to your MyDeviceLoopDrawingCallback function in the drawingProc parameter for DeviceLoop.
QuickdrawTypes.htypedef void (*DragGrayRgnProcPtr) ( );
If you name your function MyDragGrayRgnProc, you would declare it like this:
void DragGrayRgnProcPtr ();
QuickdrawTypes.htypedef void (*QDArcProcPtr) ( GrafVerb verb, const Rect * r, short startAngle, short arcAngle );
If you name your function MyQDArcProc, you would declare it like this:
void QDArcProcPtr ( GrafVerb verb, const Rect * r, short startAngle, short arcAngle );
QuickdrawTypes.htypedef void (*QDBitsProcPtr) ( const BitMap * srcBits, const Rect * srcRect, const Rect * dstRect, short mode, RgnHandle maskRgn );
If you name your function MyQDBitsProc, you would declare it like this:
void QDBitsProcPtr ( const BitMap * srcBits, const Rect * srcRect, const Rect * dstRect, short mode, RgnHandle maskRgn );
QuickdrawTypes.htypedef void (*QDCommentProcPtr) ( short kind, short dataSize, Handle dataHandle );
If you name your function MyQDCommentProc, you would declare it like this:
void QDCommentProcPtr ( short kind, short dataSize, Handle dataHandle );
QuickdrawTypes.htypedef void (*QDGetPicProcPtr) ( void * dataPtr, short byteCount );
If you name your function MyQDGetPicProc, you would declare it like this:
void QDGetPicProcPtr ( void * dataPtr, short byteCount );
QuickdrawTypes.htypedef void (*QDJShieldCursorProcPtr) ( short left, short top, short right, short bottom );
If you name your function MyQDJShieldCursorProc, you would declare it like this:
void QDJShieldCursorProcPtr ( short left, short top, short right, short bottom );
QuickdrawTypes.htypedef void (*QDLineProcPtr) ( Point newPt );
If you name your function MyQDLineProc, you would declare it like this:
void QDLineProcPtr ( Point newPt );
QuickdrawTypes.htypedef void (*QDOpcodeProcPtr) ( const Rect * fromRect, const Rect * toRect, UInt16 opcode, SInt16 version );
If you name your function MyQDOpcodeProc, you would declare it like this:
void QDOpcodeProcPtr ( const Rect * fromRect, const Rect * toRect, UInt16 opcode, SInt16 version );
QuickdrawTypes.htypedef void (*QDOvalProcPtr) ( GrafVerb verb, const Rect * r );
If you name your function MyQDOvalProc, you would declare it like this:
void QDOvalProcPtr ( GrafVerb verb, const Rect * r );
QuickdrawTypes.htypedef void (*QDPolyProcPtr) ( GrafVerb verb, PolyHandle poly );
If you name your function MyQDPolyProc, you would declare it like this:
void QDPolyProcPtr ( GrafVerb verb, PolyHandle poly );
QuickdrawTypes.htypedef OSStatus (*QDPrinterStatusProcPtr) ( PrinterStatusOpcode opcode, CGrafPtr currentPort, void * printerStatus );
If you name your function MyQDPrinterStatusProc, you would declare it like this:
OSStatus QDPrinterStatusProcPtr ( PrinterStatusOpcode opcode, CGrafPtr currentPort, void * printerStatus );
QuickdrawTypes.htypedef void (*QDPutPicProcPtr) ( const void * dataPtr, short byteCount );
If you name your function MyQDPutPicProc, you would declare it like this:
void QDPutPicProcPtr ( const void * dataPtr, short byteCount );
QuickdrawTypes.htypedef void (*QDRectProcPtr) ( GrafVerb verb, const Rect * r );
If you name your function MyQDRectProc, you would declare it like this:
void QDRectProcPtr ( GrafVerb verb, const Rect * r );
QuickdrawTypes.htypedef void (*QDRgnProcPtr) ( GrafVerb verb, RgnHandle rgn );
If you name your function MyQDRgnProc, you would declare it like this:
void QDRgnProcPtr ( GrafVerb verb, RgnHandle rgn );
QuickdrawTypes.htypedef void (*QDRRectProcPtr) ( GrafVerb verb, const Rect * r, short ovalWidth, short ovalHeight );
If you name your function MyQDRRectProc, you would declare it like this:
void QDRRectProcPtr ( GrafVerb verb, const Rect * r, short ovalWidth, short ovalHeight );
QuickdrawTypes.htypedef OSStatus (*QDStdGlyphsProcPtr) ( void * dataStream, ByteCount size );
If you name your function MyQDStdGlyphsProc, you would declare it like this:
OSStatus QDStdGlyphsProcPtr ( void * dataStream, ByteCount size );
QuickdrawTypes.htypedef void (*QDTextProcPtr) ( short byteCount, const void * textBuf, Point numer, Point denom );
If you name your function MyQDTextProc, you would declare it like this:
void QDTextProcPtr ( short byteCount, const void * textBuf, Point numer, Point denom );
QuickdrawTypes.htypedef short (*QDTxMeasProcPtr) ( short byteCount, const void * textAddr, Point * numer, Point * denom, FontInfo * info );
If you name your function MyQDTxMeasProc, you would declare it like this:
short QDTxMeasProcPtr ( short byteCount, const void * textAddr, Point * numer, Point * denom, FontInfo * info );
QuickdrawTypes.htypedef OSStatus (*RegionToRectsProcPtr) ( UInt16 message, RgnHandle rgn, const Rect * rect, void * refCon );
If you name your function MyRegionToRectsProc, you would declare it like this:
OSStatus RegionToRectsProcPtr ( UInt16 message, RgnHandle rgn, const Rect * rect, void * refCon );
QuickdrawAPI.h
struct BitMap {
Ptr baseAddr;
short rowBytes;
Rect bounds;
};
typedef struct BitMap BitMap;
typedef BitMap * BitMapPtr;
baseAddrA pointer to the beginning of the bit image.
rowBytesThe offset in bytes from one row of the image to the next. The value of the rowBytes field must be less than $4000.
boundsThe bitmap’s boundary rectangle by default, the entire main screen.
A bitmap, which is a data structure of type BitMap, defines a bit image in terms of the QuickDraw coordinate plane. (A bit image is a collection of bits in memory that form a grid.)
A bitmap has three parts: a pointer to a bit image, the row width of that image, and a boundary rectangle that links the local coordinate system of a graphics port to QuickDraw’s global coordinate system and defines the area of the bit image into which QuickDraw can draw.
The width of the boundary rectangle determines how many bits of one row are logically owned by the bitmap. This width must not exceed the number of bits in each row of the bit image. The height of the boundary rectangle determines how many rows of the image are logically owned by the bitmap. The number of rows enclosed by the boundary rectangle must not exceed the number of rows in the bit image.
The boundary rectangle defines the local coordinate system used by the port rectangle for a graphics port (described next). The upper-left corner (which for a window is called the window origin) of the port rectangle usually has a vertical coordinate of 0 and a horizontal coordinate of 0, although you can use the function SetOrigin to change the coordinates of the window origin.
QuickdrawTypes.h
typedef short Bits16[16];
The Bits16 array is used by the Cursor structure to hold a black-and-white, 16-by-16 pixel square image.
QuickdrawTypes.h
struct CCrsr {
short crsrType;
PixMapHandle crsrMap;
Handle crsrData;
Handle crsrXData;
short crsrXValid;
Handle crsrXHandle;
Bits16 crsr1Data;
Bits16 crsrMask;
Point crsrHotSpot;
long crsrXTable;
long crsrID;
};
typedef struct CCrsr CCrsr;
typedef CCrsr * CCrsrPtr;
crsrTypeThe type of cursor. Possible values are $8000 for a black-and-white cursor and $8001 for a color cursor.
crsrMapA handle to the PixMap structure defining the cursor’s characteristics. When the screen depth is greater than 2 bits per pixel, the crsrMap field and the crsrData field define the image. The pixels within the mask replace the destination pixels. Color QuickDraw transfers the pixels outside the mask into the destination pixels using the XOR Boolean transfer mode. Therefore, if pixels outside the mask are white, the destination pixels aren’t changed. If pixels outside the mask are all black, the destination pixels are inverted. All other values outside of the mask cause unpredictable results.
crsrDataA handle to the cursor’s pixel data. To work properly, a color cursor’s image should contain white pixels (R=G=
B=$FFFF) for the transparent part of the image, and black pixels (R=G=B=$0000) for the part of the image to be inverted, in addition to the other colors in the cursor’s image. Thus, to define a cursor that contains two colors, it’s necessary to use a 2-bit cursor image (that is, a four-color image.
crsrXDataA handle to the expanded pixel image used internally by Color QuickDraw.
crsrXValidThe depth of the expanded cursor image. If you change the cursor’s data or color table, set this field to 0 to cause the cursor to be re-expanded. Never set it to any other values.
crsrXHandleReserved for future use.
crsr1DataA 16-by-16 pixel image with a pixel depth of 1 to be displayed when the cursor is on screens with pixel depths of 1 or 2 bits.
crsrMaskThe cursor’s mask data. QuickDraw uses the mask to crop the cursor’s outline into a background color or pattern. QuickDraw then draws the cursor into this shape. The same 1-bit mask is used with images specified by the crsrData and crsr1Data fields.
crsrHotSpotThe cursor’s hot spot.
crsrXTableReserved for future use.
crsrIDThe color table seed for the cursor.
Your application typically does not create CCrsr structures. Although you can create a CCrsr structure, it is usually easier to create a color cursor in a color cursor resource, ‘crsr’.
A color cursor is a 256-pixel color image in a 16-by-16 pixel square defined in a color cursor ( 'crsr') resource. When your application uses the GetCCursor function to get a color cursor from a 'crsr' resource, GetCCursor loads the resource into memory as a CCrsr structure. Your application can then display the color cursor by using the SetCCursor function.
CCrsr is substantially different from the Cursor structure. The fields crsr1Data, crsrMask, and crsrHotSpot in the CCrsr structure are the only ones that have counterparts in the Cursor structure.
The first four fields of the CCrsr structure are similar to the first four fields of the PixPat record, and are used in the same manner by QuickDraw.
The display of a cursor involves a relationship between a mask, stored in the crsrMask field with the same format used for 1-bit cursor masks, and an image. There are two possible sources for a color cursor’s image. When the cursor is on a screen whose depth is 1 or 2 bits per pixel, the image for the cursor is taken from the crsr1Data field, which contains bitmap cursor data, similar to the bitmap in a 'CURS' resource.
QuickdrawTypes.h
struct CGrafPort {
SInt16 device;
PixMapHandle portPixMap;
SInt16 portVersion;
Handle grafVars;
SInt16 chExtra;
SInt16 pnLocHFrac;
Rect portRect;
RgnHandle visRgn;
RgnHandle clipRgn;
PixPatHandle bkPixPat;
RGBColor rgbFgColor;
RGBColor rgbBkColor;
Point pnLoc;
Point pnSize;
SInt16 pnMode;
PixPatHandle pnPixPat;
PixPatHandle fillPixPat;
SInt16 pnVis;
SInt16 txFont;
StyleField txFace;
SInt16 txMode;
SInt16 txSize;
Fixed spExtra;
SInt32 fgColor;
SInt32 bkColor;
SInt16 colrBit;
SInt16 patStretch;
Handle picSave;
Handle rgnSave;
Handle polySave;
CQDProcsPtr grafProcs;
};
typedef GrafPtr CGrafPtr;
QuickdrawTypes.h
typedef ColorComplementProcPtr ColorComplementUPP;
QuickdrawTypes.h
typedef ColorSearchProcPtr ColorSearchUPP;
QuickdrawTypes.h
struct ColorSpec {
short value;
RGBColor rgb;
};
typedef struct ColorSpec ColorSpec;
typedef ColorSpec * ColorSpecPtr;
valueThe pixel value assigned by QuickDraw for the color specified in the rgb field of this structure. QuickDraw assigns a pixel value based on the capabilities of the user’s screen. For indexed devices, the pixel value is an index number assigned by QuickDraw to the closest color available on the indexed device for direct devices, this value expresses the best available red, green, and blue values for the color on the direct device.
rgbAn RGBColor structure that fully specifies the color whose approximation QuickDraw specifies in the value field.
When creating a PixMap structure for an indexed device, QuickDraw creates a ColorTable structure that defines the best colors available for the pixel image on that graphics device. QuickDraw also stores a ColorTable structure for the currently available colors in the graphics device’s CLUT.
One of the fields in a ColorTable structure requires a value of type cSpecArray, which is defined as an array of ColorSpec structures. Typically, your application never needs to create ColorTable structures or ColorSpec structures. For completeness, the data structure of type ColorSpec is shown here.
IOMacOSTypes.h
struct ColorTable {
long ctSeed;
short ctFlags;
short ctSize;
CSpecArray ctTable;
};
typedef struct ColorTable ColorTable;
typedef ColorTable * CTabPtr;
typedef CTabPtr * CTabHandle;
ctSeedIdentifies a particular instance of a color table. QuickDraw uses the ctSeed value to compare an indexed device’s color table with its associated inverse table (a table it uses for fast color lookup). When the color table for a graphics device has been changed, QuickDraw needs to rebuild the inverse table.
ctFlagsFlags that distinguish pixel map color tables from color tables in GDevice structures.
ctSizeOne less than the number of entries in the table.
ctTableAn array of ColorSpec entries, each containing a pixel value and a color specified by an RGBColor structure.
When creating a PixMap structure for a particular graphics device, QuickDraw creates a ColorTable structure that defines the best colors available for the pixel image on that particular graphics device. QuickDraw also creates a ColorTable structure of all available colors for use by the CLUT on indexed devices.
Typically, your application needs to create ColorTable structures only if it uses the Palette Manager.
Your application should never need to directly change the fields of a ColorTable structure. If you find it absolutely necessary for your application to do so, immediately use the CTabChanged function to notify QuickDraw that your application has changed the ColorTable structure.
QuickdrawTypes.h
typedef const Pattern* ConstPatternParam;
QuickdrawTypes.h
struct CProcRec {
Handle nxtComp;
ColorComplementUPP compProc;
};
typedef struct CProcRec CProcRec;
typedef CProcRec * CProcPtr;
nxtCompA handle to the next CPRocRec data structure in the list.
compProcA pointer to a complement function, as described in ColorComplementProcPtr.
The CProcRec data structure contains a pointer to a custom complement function and a pointer to the next complement function in the list.
QuickdrawTypes.h
struct CQDProcs {
QDTextUPP textProc;
QDLineUPP lineProc;
QDRectUPP rectProc;
QDRRectUPP rRectProc;
QDOvalUPP ovalProc;
QDArcUPP arcProc;
QDPolyUPP polyProc;
QDRgnUPP rgnProc;
QDBitsUPP bitsProc;
QDCommentUPP commentProc;
QDTxMeasUPP txMeasProc;
QDGetPicUPP getPicProc;
QDPutPicUPP putPicProc;
QDOpcodeUPP opcodeProc;
UniversalProcPtr newProc1;
QDStdGlyphsUPP glyphsProc;
QDPrinterStatusUPP printerStatusProc;
UniversalProcPtr newProc4;
UniversalProcPtr newProc5;
UniversalProcPtr newProc6;
};
typedef struct CQDProcs CQDProcs;
typedef CQDProcs * CQDProcsPtr;
textProcA pointer to the low-level function that draws text. The standard QuickDraw function is the StdText function.
lineProcA pointer to the low-level function that draws lines. The standard QuickDraw function is the StdLine function.
rectProcA pointer to the low-level function that draws rectangles. The standard QuickDraw function is the StdRect function.
rRectProcA pointer to the low-level function that draws rounded rectangles. The standard QuickDraw function is the StdRRect function.
ovalProcA pointer to the low-level function that draws ovals. The standard QuickDraw function is the StdOval function.
arcProcA pointer to the low-level function that draws arcs. The standard QuickDraw function is the StdArc function.
polyProcA pointer to the low-level function that draws polygons. The standard QuickDraw function is the StdPoly function.
rgnProcA pointer to the low-level function that draws regions. The standard QuickDraw function is the StdRgn function.
bitsProcA pointer to the low-level function that copies bitmaps. The standard QuickDraw function is the StdBits function.
commentProcA pointer to the low-level function for processing a picture comment. The standard QuickDraw function is the StdComment function.
txMeasProcA pointer to the low-level function for measuring text width. The standard QuickDraw function is the StdTxMeas function.
getPicProcA pointer to the low-level function for retrieving information from the definition of a picture. The standard QuickDraw function is the StdGetPic function.
putPicProcA pointer to the low-level function for saving information as the definition of a picture. The standard QuickDraw function is the StdPutPic function.
opcodeProcReserved for future use.
newProc1Reserved for future use.
glyphsProcReserved for future use.
printerStatusProcReserved for future use.
newProc4Reserved for future use.
newProc5Reserved for future use.
newProc6Reserved for future use.
Use the CQDProcs structure only if you customize one or more of QuickDraw’s standard low-level drawing functions. Use the SetStdCProcs function to create a CQDProcs structure.
QuickdrawTypes.h
typedef ColorSpec CSpecArray[1];
QuickdrawTypes.h
struct Cursor {
Bits16 data;
Bits16 mask;