|
Mac OS 9
|
Interface to Quickdraw Graphics. More...
#include <Components.h>#include <MacTypes.h>#include <MixedMode.h>#include <QuickdrawText.h>#include <CGContext.h>#include <Quickdraw.h>#include <Memory.h>Go to the source code of this file.
Data Structures | |
| struct | Pattern |
| struct | PrinterFontStatus |
| struct | PrinterScalingStatus |
| struct | BitMap |
| struct | Cursor |
| struct | PenState |
| struct | MacRegion |
| struct | Picture |
| struct | MacPolygon |
| struct | QDProcs |
| struct | GrafPort |
| struct | RGBColor |
| struct | ColorSpec |
| struct | ColorTable |
| struct | xColorSpec |
| struct | MatchRec |
| struct | PixMap |
| struct | PixPat |
| struct | CCrsr |
| struct | GammaTbl |
| struct | ITab |
| struct | SProcRec |
| struct | CProcRec |
| struct | GDevice |
| struct | GrafVars |
| struct | CQDProcs |
| struct | CGrafPort |
| struct | ReqListRec |
| struct | OpenCPicParams |
| struct | CursorImageRec |
| struct | QDGlobals |
| struct | CustomXFerRec |
| struct | CursorInfo |
Macros | |
| #define | NewQDTextUPP(userRoutine) |
| #define | NewQDLineUPP(userRoutine) |
| #define | NewQDRectUPP(userRoutine) |
| #define | NewQDRRectUPP(userRoutine) |
| #define | NewQDOvalUPP(userRoutine) |
| #define | NewQDArcUPP(userRoutine) |
| #define | NewQDPolyUPP(userRoutine) |
| #define | NewQDRgnUPP(userRoutine) |
| #define | NewQDBitsUPP(userRoutine) |
| #define | NewQDCommentUPP(userRoutine) |
| #define | NewQDTxMeasUPP(userRoutine) |
| #define | NewQDGetPicUPP(userRoutine) |
| #define | NewQDPutPicUPP(userRoutine) |
| #define | NewQDOpcodeUPP(userRoutine) |
| #define | NewQDStdGlyphsUPP(userRoutine) |
| #define | NewQDJShieldCursorUPP(userRoutine) |
| #define | DisposeQDTextUPP(userUPP) DisposeRoutineDescriptor(userUPP) |
| #define | DisposeQDLineUPP(userUPP) DisposeRoutineDescriptor(userUPP) |
| #define | DisposeQDRectUPP(userUPP) DisposeRoutineDescriptor(userUPP) |
| #define | DisposeQDRRectUPP(userUPP) DisposeRoutineDescriptor(userUPP) |
| #define | DisposeQDOvalUPP(userUPP) DisposeRoutineDescriptor(userUPP) |
| #define | DisposeQDArcUPP(userUPP) DisposeRoutineDescriptor(userUPP) |
| #define | DisposeQDPolyUPP(userUPP) DisposeRoutineDescriptor(userUPP) |
| #define | DisposeQDRgnUPP(userUPP) DisposeRoutineDescriptor(userUPP) |
| #define | DisposeQDBitsUPP(userUPP) DisposeRoutineDescriptor(userUPP) |
| #define | DisposeQDCommentUPP(userUPP) DisposeRoutineDescriptor(userUPP) |
| #define | DisposeQDTxMeasUPP(userUPP) DisposeRoutineDescriptor(userUPP) |
| #define | DisposeQDGetPicUPP(userUPP) DisposeRoutineDescriptor(userUPP) |
| #define | DisposeQDPutPicUPP(userUPP) DisposeRoutineDescriptor(userUPP) |
| #define | DisposeQDOpcodeUPP(userUPP) DisposeRoutineDescriptor(userUPP) |
| #define | DisposeQDStdGlyphsUPP(userUPP) DisposeRoutineDescriptor(userUPP) |
| #define | DisposeQDJShieldCursorUPP(userUPP) DisposeRoutineDescriptor(userUPP) |
| #define | InvokeQDTextUPP(byteCount, textBuf, numer, denom, userUPP) |
| #define | InvokeQDLineUPP(newPt, userUPP) CALL_ONE_PARAMETER_UPP((userUPP), uppQDLineProcInfo, (newPt)) |
| #define | InvokeQDRectUPP(verb, r, userUPP) CALL_TWO_PARAMETER_UPP((userUPP), uppQDRectProcInfo, (verb), (r)) |
| #define | InvokeQDRRectUPP(verb, r, ovalWidth, ovalHeight, userUPP) |
| #define | InvokeQDOvalUPP(verb, r, userUPP) CALL_TWO_PARAMETER_UPP((userUPP), uppQDOvalProcInfo, (verb), (r)) |
| #define | InvokeQDArcUPP(verb, r, startAngle, arcAngle, userUPP) |
| #define | InvokeQDPolyUPP(verb, poly, userUPP) CALL_TWO_PARAMETER_UPP((userUPP), uppQDPolyProcInfo, (verb), (poly)) |
| #define | InvokeQDRgnUPP(verb, rgn, userUPP) CALL_TWO_PARAMETER_UPP((userUPP), uppQDRgnProcInfo, (verb), (rgn)) |
| #define | InvokeQDBitsUPP(srcBits, srcRect, dstRect, mode, maskRgn, userUPP) |
| #define | InvokeQDCommentUPP(kind, dataSize, dataHandle, userUPP) |
| #define | InvokeQDTxMeasUPP(byteCount, textAddr, numer, denom, info, userUPP) |
| #define | InvokeQDGetPicUPP(dataPtr, byteCount, userUPP) CALL_TWO_PARAMETER_UPP((userUPP), uppQDGetPicProcInfo, (dataPtr), (byteCount)) |
| #define | InvokeQDPutPicUPP(dataPtr, byteCount, userUPP) CALL_TWO_PARAMETER_UPP((userUPP), uppQDPutPicProcInfo, (dataPtr), (byteCount)) |
| #define | InvokeQDOpcodeUPP(fromRect, toRect, opcode, version, userUPP) |
| #define | InvokeQDStdGlyphsUPP(dataStream, size, userUPP) |
| #define | InvokeQDJShieldCursorUPP(left, top, right, bottom, userUPP) |
| #define | NewQDTextProc(userRoutine) NewQDTextUPP(userRoutine) |
| #define | NewQDLineProc(userRoutine) NewQDLineUPP(userRoutine) |
| #define | NewQDRectProc(userRoutine) NewQDRectUPP(userRoutine) |
| #define | NewQDRRectProc(userRoutine) NewQDRRectUPP(userRoutine) |
| #define | NewQDOvalProc(userRoutine) NewQDOvalUPP(userRoutine) |
| #define | NewQDArcProc(userRoutine) NewQDArcUPP(userRoutine) |
| #define | NewQDPolyProc(userRoutine) NewQDPolyUPP(userRoutine) |
| #define | NewQDRgnProc(userRoutine) NewQDRgnUPP(userRoutine) |
| #define | NewQDBitsProc(userRoutine) NewQDBitsUPP(userRoutine) |
| #define | NewQDCommentProc(userRoutine) NewQDCommentUPP(userRoutine) |
| #define | NewQDTxMeasProc(userRoutine) NewQDTxMeasUPP(userRoutine) |
| #define | NewQDGetPicProc(userRoutine) NewQDGetPicUPP(userRoutine) |
| #define | NewQDPutPicProc(userRoutine) NewQDPutPicUPP(userRoutine) |
| #define | NewQDOpcodeProc(userRoutine) NewQDOpcodeUPP(userRoutine) |
| #define | NewQDStdGlyphsProc(userRoutine) NewQDStdGlyphsUPP(userRoutine) |
| #define | NewQDJShieldCursorProc(userRoutine) NewQDJShieldCursorUPP(userRoutine) |
| #define | CallQDTextProc(userRoutine, byteCount, textBuf, numer, denom) InvokeQDTextUPP(byteCount, textBuf, numer, denom, userRoutine) |
| #define | CallQDLineProc(userRoutine, newPt) InvokeQDLineUPP(newPt, userRoutine) |
| #define | CallQDRectProc(userRoutine, verb, r) InvokeQDRectUPP(verb, r, userRoutine) |
| #define | CallQDRRectProc(userRoutine, verb, r, ovalWidth, ovalHeight) InvokeQDRRectUPP(verb, r, ovalWidth, ovalHeight, userRoutine) |
| #define | CallQDOvalProc(userRoutine, verb, r) InvokeQDOvalUPP(verb, r, userRoutine) |
| #define | CallQDArcProc(userRoutine, verb, r, startAngle, arcAngle) InvokeQDArcUPP(verb, r, startAngle, arcAngle, userRoutine) |
| #define | CallQDPolyProc(userRoutine, verb, poly) InvokeQDPolyUPP(verb, poly, userRoutine) |
| #define | CallQDRgnProc(userRoutine, verb, rgn) InvokeQDRgnUPP(verb, rgn, userRoutine) |
| #define | CallQDBitsProc(userRoutine, srcBits, srcRect, dstRect, mode, maskRgn) InvokeQDBitsUPP(srcBits, srcRect, dstRect, mode, maskRgn, userRoutine) |
| #define | CallQDCommentProc(userRoutine, kind, dataSize, dataHandle) InvokeQDCommentUPP(kind, dataSize, dataHandle, userRoutine) |
| #define | CallQDTxMeasProc(userRoutine, byteCount, textAddr, numer, denom, info) InvokeQDTxMeasUPP(byteCount, textAddr, numer, denom, info, userRoutine) |
| #define | CallQDGetPicProc(userRoutine, dataPtr, byteCount) InvokeQDGetPicUPP(dataPtr, byteCount, userRoutine) |
| #define | CallQDPutPicProc(userRoutine, dataPtr, byteCount) InvokeQDPutPicUPP(dataPtr, byteCount, userRoutine) |
| #define | CallQDOpcodeProc(userRoutine, fromRect, toRect, opcode, version) InvokeQDOpcodeUPP(fromRect, toRect, opcode, version, userRoutine) |
| #define | CallQDStdGlyphsProc(userRoutine, dataStream, size) InvokeQDStdGlyphsUPP(dataStream, size, userRoutine) |
| #define | CallQDJShieldCursorProc(userRoutine, left, top, right, bottom) InvokeQDJShieldCursorUPP(left, top, right, bottom, userRoutine) |
| #define | NewDragGrayRgnUPP(userRoutine) |
| #define | NewColorSearchUPP(userRoutine) |
| #define | NewColorComplementUPP(userRoutine) |
| #define | DisposeDragGrayRgnUPP(userUPP) DisposeRoutineDescriptor(userUPP) |
| #define | DisposeColorSearchUPP(userUPP) DisposeRoutineDescriptor(userUPP) |
| #define | DisposeColorComplementUPP(userUPP) DisposeRoutineDescriptor(userUPP) |
| #define | InvokeDragGrayRgnUPP(userUPP) CALL_ZERO_PARAMETER_UPP((userUPP), uppDragGrayRgnProcInfo) |
| #define | InvokeColorSearchUPP(rgb, position, userUPP) |
| #define | InvokeColorComplementUPP(rgb, userUPP) (Boolean) CALL_ONE_PARAMETER_UPP((userUPP), uppColorComplementProcInfo, (rgb)) |
| #define | NewDragGrayRgnProc(userRoutine) NewDragGrayRgnUPP(userRoutine) |
| #define | NewColorSearchProc(userRoutine) NewColorSearchUPP(userRoutine) |
| #define | NewColorComplementProc(userRoutine) NewColorComplementUPP(userRoutine) |
| #define | CallDragGrayRgnProc(userRoutine) InvokeDragGrayRgnUPP(userRoutine) |
| #define | CallColorSearchProc(userRoutine, rgb, position) InvokeColorSearchUPP(rgb, position, userRoutine) |
| #define | CallColorComplementProc(userRoutine, rgb) InvokeColorComplementUPP(rgb, userRoutine) |
| #define | OLDPIXMAPSTRUCT 0 |
| #define | GETPIXMAPPIXELFORMAT(pm) (((pm)->pixelFormat != 0) ? (pm)->pixelFormat : (pm)->pixelSize) |
| #define | NON_MAC_PIXEL_FORMATS 1 |
| #define | OLDGDEVICESTRUCT 0 |
| #define | NewQDPrinterStatusUPP(userRoutine) |
| #define | NewDeviceLoopDrawingUPP(userRoutine) |
| #define | DisposeQDPrinterStatusUPP(userUPP) DisposeRoutineDescriptor(userUPP) |
| #define | DisposeDeviceLoopDrawingUPP(userUPP) DisposeRoutineDescriptor(userUPP) |
| #define | InvokeQDPrinterStatusUPP(opcode, currentPort, printerStatus, userUPP) |
| #define | InvokeDeviceLoopDrawingUPP(depth, deviceFlags, targetDevice, userData, userUPP) |
| #define | NewQDPrinterStatusProc(userRoutine) NewQDPrinterStatusUPP(userRoutine) |
| #define | NewDeviceLoopDrawingProc(userRoutine) NewDeviceLoopDrawingUPP(userRoutine) |
| #define | CallQDPrinterStatusProc(userRoutine, opcode, currentPort, printerStatus) InvokeQDPrinterStatusUPP(opcode, currentPort, printerStatus, userRoutine) |
| #define | CallDeviceLoopDrawingProc(userRoutine, depth, deviceFlags, targetDevice, userData) |
| #define | NewRegionToRectsUPP(userRoutine) |
| #define | DisposeRegionToRectsUPP(userUPP) DisposeRoutineDescriptor(userUPP) |
| #define | InvokeRegionToRectsUPP(message, rgn, rect, refCon, userUPP) |
| #define | NewRegionToRectsProc(userRoutine) NewRegionToRectsUPP(userRoutine) |
| #define | CallRegionToRectsProc(userRoutine, message, rgn, rect, refCon) InvokeRegionToRectsUPP(message, rgn, rect, refCon, userRoutine) |
Typedefs | |
| typedef SInt8 | GrafVerb |
| typedef SInt8 | PixelType |
| typedef short | Bits16[16] |
| typedef struct Pattern | Pattern |
| typedef const Pattern * | ConstPatternParam |
| typedef Pattern * | PatPtr |
| typedef PatPtr * | PatHandle |
| typedef SignedByte | QDByte |
| typedef QDByte * | QDPtr |
| typedef QDPtr * | QDHandle |
| typedef short | QDErr |
| typedef unsigned long | DeviceLoopFlags |
| typedef SInt32 | PrinterStatusOpcode |
| typedef struct PrinterFontStatus | PrinterFontStatus |
| typedef struct PrinterScalingStatus | PrinterScalingStatus |
| typedef struct BitMap | BitMap |
| typedef BitMap * | BitMapPtr |
| typedef BitMapPtr * | BitMapHandle |
| typedef struct Cursor | Cursor |
| typedef Cursor * | CursPtr |
| typedef CursPtr * | CursHandle |
| typedef struct PenState | PenState |
| typedef struct MacRegion | MacRegion |
| typedef MacRegion * | RgnPtr |
| typedef RgnPtr * | RgnHandle |
| typedef struct Picture | Picture |
| typedef Picture * | PicPtr |
| typedef PicPtr * | PicHandle |
| typedef struct MacPolygon | MacPolygon |
| typedef MacPolygon * | PolyPtr |
| typedef PolyPtr * | PolyHandle |
| typedef const void * | textBuf |
| typedef const void Point | numer |
| typedef const void Point Point | denom |
| typedef const Rect * | r |
| typedef const Rect short | ovalWidth |
| typedef const Rect short short | ovalHeight |
| typedef const Rect short | startAngle |
| typedef const Rect short short | arcAngle |
| typedef PolyHandle | poly |
| typedef RgnHandle | rgn |
| typedef const Rect * | srcRect |
| typedef const Rect const Rect * | dstRect |
| typedef const Rect const Rect short | mode |
| typedef const Rect const Rect short RgnHandle | maskRgn |
| typedef short | dataSize |
| typedef short Handle | dataHandle |
| typedef const void * | textAddr |
| typedef const void Point Point FontInfo * | info |
| typedef short | byteCount |
| typedef const Rect * | toRect |
| typedef const Rect UInt16 | opcode |
| typedef const Rect UInt16 SInt16 | version |
| typedef ByteCount | size |
| typedef short | top |
| typedef short short | right |
| typedef short short short | bottom |
| typedef struct QDProcs | QDProcs |
| typedef QDProcs * | QDProcsPtr |
| typedef struct GrafPort | GrafPort |
| typedef GrafPort * | GrafPtr |
| typedef GrafPtr | WindowPtr |
| typedef WindowPtr | DialogPtr |
| typedef WindowPtr | WindowRef |
| typedef UInt16 | DragConstraint |
| typedef struct RGBColor | RGBColor |
| typedef RGBColor * | RGBColorPtr |
| typedef RGBColorPtr * | RGBColorHdl |
| typedef long * | position |
| typedef struct ColorSpec | ColorSpec |
| typedef ColorSpec * | ColorSpecPtr |
| typedef ColorSpec | CSpecArray[1] |
| typedef struct ColorTable | ColorTable |
| typedef ColorTable * | CTabPtr |
| typedef CTabPtr * | CTabHandle |
| typedef struct xColorSpec | xColorSpec |
| typedef xColorSpec * | xColorSpecPtr |
| typedef xColorSpec | xCSpecArray[1] |
| typedef struct MatchRec | MatchRec |
| typedef struct PixMap | PixMap |
| typedef PixMap * | PixMapPtr |
| typedef PixMapPtr * | PixMapHandle |
| typedef struct PixPat | PixPat |
| typedef PixPat * | PixPatPtr |
| typedef PixPatPtr * | PixPatHandle |
| typedef struct CCrsr | CCrsr |
| typedef CCrsr * | CCrsrPtr |
| typedef CCrsrPtr * | CCrsrHandle |
| typedef struct GammaTbl | GammaTbl |
| typedef GammaTbl * | GammaTblPtr |
| typedef GammaTblPtr * | GammaTblHandle |
| typedef struct ITab | ITab |
| typedef ITab * | ITabPtr |
| typedef ITabPtr * | ITabHandle |
| typedef struct SProcRec | SProcRec |
| typedef SProcRec * | SProcPtr |
| typedef SProcPtr * | SProcHndl |
| typedef struct CProcRec | CProcRec |
| typedef CProcRec * | CProcPtr |
| typedef CProcPtr * | CProcHndl |
| typedef struct GDevice | GDevice |
| typedef GDevice * | GDPtr |
| typedef GDPtr * | GDHandle |
| typedef struct GrafVars | GrafVars |
| typedef GrafVars * | GVarPtr |
| typedef GVarPtr * | GVarHandle |
| typedef struct CGrafPort | CGrafPort |
| typedef CGrafPort * | CGrafPtr |
| typedef CGrafPtr | currentPort |
| typedef CGrafPtr void * | printerStatus |
| typedef struct CQDProcs | CQDProcs |
| typedef CQDProcs * | CQDProcsPtr |
| typedef CGrafPtr | CWindowPtr |
| typedef struct ReqListRec | ReqListRec |
| typedef struct OpenCPicParams | OpenCPicParams |
| typedef struct CursorImageRec | CursorImageRec |
| typedef CursorImageRec * | CursorImagePtr |
| typedef short | deviceFlags |
| typedef short GDHandle | targetDevice |
| typedef short GDHandle long | userData |
| typedef struct QDGlobals | QDGlobals |
| typedef QDGlobals * | QDGlobalsPtr |
| typedef QDGlobalsPtr * | QDGlobalsHdl |
| typedef SInt32 | QDRegionParseDirection |
| typedef RgnHandle const Rect * | rect |
| typedef RgnHandle const Rect void * | refCon |
| typedef struct CustomXFerRec | CustomXFerRec |
| typedef CustomXFerRec * | CustomXFerRecPtr |
| typedef struct CursorInfo | CursorInfo |
| typedef struct OpaqueQDRegionBitsRef * | QDRegionBitsRef |
Functions | |
| typedef | CALLBACK_API (void, QDTextProcPtr)(short byteCount |
| typedef | CALLBACK_API (void, QDLineProcPtr)(Point new Pt) |
| typedef | CALLBACK_API (void, QDRectProcPtr)(GrafVerb verb |
| typedef | CALLBACK_API (void, QDRRectProcPtr)(GrafVerb verb |
| typedef | CALLBACK_API (void, QDOvalProcPtr)(GrafVerb verb |
| typedef | CALLBACK_API (void, QDArcProcPtr)(GrafVerb verb |
| typedef | CALLBACK_API (void, QDPolyProcPtr)(GrafVerb verb |
| typedef | CALLBACK_API (void, QDRgnProcPtr)(GrafVerb verb |
| typedef | CALLBACK_API (void, QDBitsProcPtr)(const BitMap *srcBits |
| typedef | CALLBACK_API (void, QDCommentProcPtr)(short kind |
| typedef | CALLBACK_API (short, QDTxMeasProcPtr)(short byteCount |
| typedef | CALLBACK_API (void, QDGetPicProcPtr)(void *dataPtr |
| typedef | CALLBACK_API (void, QDPutPicProcPtr)(const void *dataPtr |
| typedef | CALLBACK_API (void, QDOpcodeProcPtr)(const Rect *fromRect |
| typedef | CALLBACK_API_C (OSStatus, QDStdGlyphsProcPtr)(void *dataStream |
| typedef | CALLBACK_API (void, QDJShieldCursorProcPtr)(short left |
| typedef | STACK_UPP_TYPE (QDTextProcPtr) QDTextUPP |
| typedef | STACK_UPP_TYPE (QDLineProcPtr) QDLineUPP |
| typedef | STACK_UPP_TYPE (QDRectProcPtr) QDRectUPP |
| typedef | STACK_UPP_TYPE (QDRRectProcPtr) QDRRectUPP |
| typedef | STACK_UPP_TYPE (QDOvalProcPtr) QDOvalUPP |
| typedef | STACK_UPP_TYPE (QDArcProcPtr) QDArcUPP |
| typedef | STACK_UPP_TYPE (QDPolyProcPtr) QDPolyUPP |
| typedef | STACK_UPP_TYPE (QDRgnProcPtr) QDRgnUPP |
| typedef | STACK_UPP_TYPE (QDBitsProcPtr) QDBitsUPP |
| typedef | STACK_UPP_TYPE (QDCommentProcPtr) QDCommentUPP |
| typedef | STACK_UPP_TYPE (QDTxMeasProcPtr) QDTxMeasUPP |
| typedef | STACK_UPP_TYPE (QDGetPicProcPtr) QDGetPicUPP |
| typedef | STACK_UPP_TYPE (QDPutPicProcPtr) QDPutPicUPP |
| typedef | STACK_UPP_TYPE (QDOpcodeProcPtr) QDOpcodeUPP |
| typedef | STACK_UPP_TYPE (QDStdGlyphsProcPtr) QDStdGlyphsUPP |
| typedef | STACK_UPP_TYPE (QDJShieldCursorProcPtr) QDJShieldCursorUPP |
| QDTextUPP | NewQDTextUPP (QDTextProcPtr userRoutine) |
| QDLineUPP | NewQDLineUPP (QDLineProcPtr userRoutine) |
| QDRectUPP | NewQDRectUPP (QDRectProcPtr userRoutine) |
| QDRRectUPP | NewQDRRectUPP (QDRRectProcPtr userRoutine) |
| QDOvalUPP | NewQDOvalUPP (QDOvalProcPtr userRoutine) |
| QDArcUPP | NewQDArcUPP (QDArcProcPtr userRoutine) |
| QDPolyUPP | NewQDPolyUPP (QDPolyProcPtr userRoutine) |
| QDRgnUPP | NewQDRgnUPP (QDRgnProcPtr userRoutine) |
| QDBitsUPP | NewQDBitsUPP (QDBitsProcPtr userRoutine) |
| QDCommentUPP | NewQDCommentUPP (QDCommentProcPtr userRoutine) |
| QDTxMeasUPP | NewQDTxMeasUPP (QDTxMeasProcPtr userRoutine) |
| QDGetPicUPP | NewQDGetPicUPP (QDGetPicProcPtr userRoutine) |
| QDPutPicUPP | NewQDPutPicUPP (QDPutPicProcPtr userRoutine) |
| QDOpcodeUPP | NewQDOpcodeUPP (QDOpcodeProcPtr userRoutine) |
| QDStdGlyphsUPP | NewQDStdGlyphsUPP (QDStdGlyphsProcPtr userRoutine) |
| QDJShieldCursorUPP | NewQDJShieldCursorUPP (QDJShieldCursorProcPtr userRoutine) |
| void | DisposeQDTextUPP (QDTextUPP userUPP) |
| void | DisposeQDLineUPP (QDLineUPP userUPP) |
| void | DisposeQDRectUPP (QDRectUPP userUPP) |
| void | DisposeQDRRectUPP (QDRRectUPP userUPP) |
| void | DisposeQDOvalUPP (QDOvalUPP userUPP) |
| void | DisposeQDArcUPP (QDArcUPP userUPP) |
| void | DisposeQDPolyUPP (QDPolyUPP userUPP) |
| void | DisposeQDRgnUPP (QDRgnUPP userUPP) |
| void | DisposeQDBitsUPP (QDBitsUPP userUPP) |
| void | DisposeQDCommentUPP (QDCommentUPP userUPP) |
| void | DisposeQDTxMeasUPP (QDTxMeasUPP userUPP) |
| void | DisposeQDGetPicUPP (QDGetPicUPP userUPP) |
| void | DisposeQDPutPicUPP (QDPutPicUPP userUPP) |
| void | DisposeQDOpcodeUPP (QDOpcodeUPP userUPP) |
| void | DisposeQDStdGlyphsUPP (QDStdGlyphsUPP userUPP) |
| void | DisposeQDJShieldCursorUPP (QDJShieldCursorUPP userUPP) |
| void | InvokeQDTextUPP (short byteCount, const void *textBuf, Point numer, Point denom, QDTextUPP userUPP) |
| void | InvokeQDLineUPP (Point newPt, QDLineUPP userUPP) |
| void | InvokeQDRectUPP (GrafVerb verb, const Rect *r, QDRectUPP userUPP) |
| void | InvokeQDRRectUPP (GrafVerb verb, const Rect *r, short ovalWidth, short ovalHeight, QDRRectUPP userUPP) |
| void | InvokeQDOvalUPP (GrafVerb verb, const Rect *r, QDOvalUPP userUPP) |
| void | InvokeQDArcUPP (GrafVerb verb, const Rect *r, short startAngle, short arcAngle, QDArcUPP userUPP) |
| void | InvokeQDPolyUPP (GrafVerb verb, PolyHandle poly, QDPolyUPP userUPP) |
| void | InvokeQDRgnUPP (GrafVerb verb, RgnHandle rgn, QDRgnUPP userUPP) |
| void | InvokeQDBitsUPP (const BitMap *srcBits, const Rect *srcRect, const Rect *dstRect, short mode, RgnHandle maskRgn, QDBitsUPP userUPP) |
| void | InvokeQDCommentUPP (short kind, short dataSize, Handle dataHandle, QDCommentUPP userUPP) |
| short | InvokeQDTxMeasUPP (short byteCount, const void *textAddr, Point *numer, Point *denom, FontInfo *info, QDTxMeasUPP userUPP) |
| void | InvokeQDGetPicUPP (void *dataPtr, short byteCount, QDGetPicUPP userUPP) |
| void | InvokeQDPutPicUPP (const void *dataPtr, short byteCount, QDPutPicUPP userUPP) |
| void | InvokeQDOpcodeUPP (const Rect *fromRect, const Rect *toRect, UInt16 opcode, SInt16 version, QDOpcodeUPP userUPP) |
| OSStatus | InvokeQDStdGlyphsUPP (void *dataStream, ByteCount size, QDStdGlyphsUPP userUPP) |
| void | InvokeQDJShieldCursorUPP (short left, short top, short right, short bottom, QDJShieldCursorUPP userUPP) |
| typedef | CALLBACK_API (void, DragGrayRgnProcPtr)(void) |
| typedef | CALLBACK_API (Boolean, ColorSearchProcPtr)(RGBColor *rgb |
| typedef | CALLBACK_API (Boolean, ColorComplementProcPtr)(RGBColor *rgb) |
| typedef | STACK_UPP_TYPE (DragGrayRgnProcPtr) DragGrayRgnUPP |
| typedef | STACK_UPP_TYPE (ColorSearchProcPtr) ColorSearchUPP |
| typedef | STACK_UPP_TYPE (ColorComplementProcPtr) ColorComplementUPP |
| DragGrayRgnUPP | NewDragGrayRgnUPP (DragGrayRgnProcPtr userRoutine) |
| ColorSearchUPP | NewColorSearchUPP (ColorSearchProcPtr userRoutine) |
| ColorComplementUPP | NewColorComplementUPP (ColorComplementProcPtr userRoutine) |
| void | DisposeDragGrayRgnUPP (DragGrayRgnUPP userUPP) |
| void | DisposeColorSearchUPP (ColorSearchUPP userUPP) |
| void | DisposeColorComplementUPP (ColorComplementUPP userUPP) |
| void | InvokeDragGrayRgnUPP (DragGrayRgnUPP userUPP) |
| Boolean | InvokeColorSearchUPP (RGBColor *rgb, long *position, ColorSearchUPP userUPP) |
| Boolean | InvokeColorComplementUPP (RGBColor *rgb, ColorComplementUPP userUPP) |
| typedef | CALLBACK_API_C (OSStatus, QDPrinterStatusProcPtr)(PrinterStatusOpcode opcode |
| typedef | STACK_UPP_TYPE (QDPrinterStatusProcPtr) QDPrinterStatusUPP |
| typedef | CALLBACK_API (void, DeviceLoopDrawingProcPtr)(short depth |
| typedef | STACK_UPP_TYPE (DeviceLoopDrawingProcPtr) DeviceLoopDrawingUPP |
| QDPrinterStatusUPP | NewQDPrinterStatusUPP (QDPrinterStatusProcPtr userRoutine) |
| DeviceLoopDrawingUPP | NewDeviceLoopDrawingUPP (DeviceLoopDrawingProcPtr userRoutine) |
| void | DisposeQDPrinterStatusUPP (QDPrinterStatusUPP userUPP) |
| void | DisposeDeviceLoopDrawingUPP (DeviceLoopDrawingUPP userUPP) |
| OSStatus | InvokeQDPrinterStatusUPP (PrinterStatusOpcode opcode, CGrafPtr currentPort, void *printerStatus, QDPrinterStatusUPP userUPP) |
| void | InvokeDeviceLoopDrawingUPP (short depth, short deviceFlags, GDHandle targetDevice, long userData, DeviceLoopDrawingUPP userUPP) |
| void | InitGraf (void *globalPtr) |
| void | OpenPort (GrafPtr port) |
| void | InitPort (GrafPtr port) |
| void | ClosePort (GrafPtr port) |
| OSErr | LockPortBits (GrafPtr port) |
| OSErr | UnlockPortBits (GrafPtr port) |
| typedef | CALLBACK_API_C (OSStatus, RegionToRectsProcPtr)(UInt16 message |
| typedef | STACK_UPP_TYPE (RegionToRectsProcPtr) RegionToRectsUPP |
| RegionToRectsUPP | NewRegionToRectsUPP (RegionToRectsProcPtr userRoutine) |
| void | DisposeRegionToRectsUPP (RegionToRectsUPP userUPP) |
| OSStatus | InvokeRegionToRectsUPP (UInt16 message, RgnHandle rgn, const Rect *rect, void *refCon, RegionToRectsUPP userUPP) |
| OSStatus | QDRegionToRects (RgnHandle rgn, QDRegionParseDirection dir, RegionToRectsUPP proc, void *userData) |
| OSErr | UpdatePort (GrafPtr port) |
| void * | GetPortNativeWindow (GrafPtr macPort) |
| Find which GrafPort is currently active. More... | |
| GrafPtr | GetNativeWindowPort (void *nativeWindow) |
| void * | MacRegionToNativeRegion (RgnHandle macRegion) |
| RgnHandle | NativeRegionToMacRegion (void *nativeRegion) |
| void | MacSetPort (GrafPtr port) |
| void | GetPort (GrafPtr *port) |
| Boolean | QDSwapPort (CGrafPtr inNewPort, CGrafPtr *outOldPort) |
| void | GrafDevice (short device) |
| Set the device field for a GrafPort. More... | |
| The third line above correctly adjusts for the required word alignment Example | OffScreenDraw (short rWide, short rHigh, Rect rDest) |
| Assigns a new bit map to the active GrafPort. More... | |
| void | SetPenState (const PenState *pnState) |
| Set the pen location, size, pattern and mode. More... | |
| void | PenSize (short width, short height) |
| Set dimensions of pen for current GrafPort. More... | |
| void | PenMode (short mode) |
| Set the graphics pen pattern transfer mode. More... | |
| void | PenPat (const Pattern *pat) |
| void | PenNormal (void) |
| void | MoveTo (short h, short v) |
| Set pen location without drawing. More... | |
| void | Move (short dh, short dv) |
| the pen relative to its current location More... | |
| void | MacLineTo (short h, short v) |
| void | Line (short dh, short dv) |
| void | ForeColor (long color) |
| void | BackColor (long color) |
| void | ColorBit (short whichBit) |
| Select color plane for subsequent drawing. More... | |
| void | MacSetRect (Rect *r, short left, short top, short right, short bottom) |
| void | MacOffsetRect (Rect *r, short dh, short dv) |
| void | MacInsetRect (Rect *r, short dh, short dv) |
| Boolean | SectRect (const Rect *src1, const Rect *src2, Rect *dstRect) |
| Get the intersection of two rectangles; check for overlap. More... | |
| void | MacUnionRect (const Rect *src1, const Rect *src2, Rect *dstRect) |
| Boolean | MacEqualRect (const Rect *rect1, const Rect *rect2) |
| Boolean | EmptyRect (const Rect *r) |
| Determine if a rectangle is empty. More... | |
| void | MacFrameRect (const Rect *r) |
| void | PaintRect (const Rect *r) |
| void | EraseRect (const Rect *r) |
| void | MacInvertRect (const Rect *r) |
| void | MacFillRect (const Rect *r, const Pattern *pat) |
| void | FrameOval (const Rect *r) |
| void | PaintOval (const Rect *r) |
| void | EraseOval (const Rect *r) |
| void | InvertOval (const Rect *r) |
| void | FillOval (const Rect *r, const Pattern *pat) |
| void | FrameRoundRect (const Rect *r, short ovalWidth, short ovalHeight) |
| void | PaintRoundRect (const Rect *r, short ovalWidth, short ovalHeight) |
| void | EraseRoundRect (const Rect *r, short ovalWidth, short ovalHeight) |
| void | InvertRoundRect (const Rect *r, short ovalWidth, short ovalHeight) |
| void | FillRoundRect (const Rect *r, short ovalWidth, short ovalHeight, const Pattern *pat) |
| void | FrameArc (const Rect *r, short startAngle, short arcAngle) |
| void | PaintArc (const Rect *r, short startAngle, short arcAngle) |
| void | EraseArc (const Rect *r, short startAngle, short arcAngle) |
| void | InvertArc (const Rect *r, short startAngle, short arcAngle) |
| void | FillArc (const Rect *r, short startAngle, short arcAngle, const Pattern *pat) |
| RgnHandle | NewRgn (void) |
| void | OpenRgn (void) |
| void | CloseRgn (RgnHandle dstRgn) |
| OSErr | BitMapToRegion (RgnHandle region, const BitMap *bMap) |
| void | HandleToRgn (Handle oldRegion, RgnHandle region) |
| void | RgnToHandle (RgnHandle region, Handle flattenedRgnDataHdl) |
| void | DisposeRgn (RgnHandle rgn) |
| void | MacCopyRgn (RgnHandle srcRgn, RgnHandle dstRgn) |
| void | SetEmptyRgn (RgnHandle rgn) |
| void | MacSetRectRgn (RgnHandle rgn, short left, short top, short right, short bottom) |
| void | RectRgn (RgnHandle rgn, const Rect *r) |
| void | MacOffsetRgn (RgnHandle rgn, short dh, short dv) |
| void | InsetRgn (RgnHandle rgn, short dh, short dv) |
| void | SectRgn (RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn) |
| void | MacUnionRgn (RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn) |
| void | DiffRgn (RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn) |
| void | MacXorRgn (RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn) |
| Boolean | RectInRgn (const Rect *r, RgnHandle rgn) |
| Check if a rectangle intersects a region. More... | |
| Boolean | MacEqualRgn (RgnHandle rgnA, RgnHandle rgnB) |
| Boolean | EmptyRgn (RgnHandle rgn) |
| Determine if a Region is empty. More... | |
| void | MacFrameRgn (RgnHandle rgn) |
| void | MacPaintRgn (RgnHandle rgn) |
| void | EraseRgn (RgnHandle rgn) |
| void | MacInvertRgn (RgnHandle rgn) |
| void | MacFillRgn (RgnHandle rgn, const Pattern *pat) |
| void | ScrollRect (const Rect *r, short dh, short dv, RgnHandle updateRgn) |
| void | CopyBits (const BitMap *srcBits, const BitMap *dstBits, const Rect *srcRect, const Rect *dstRect, short mode, RgnHandle maskRgn) |
| void | SeedFill (const void *srcPtr, void *dstPtr, short srcRow, short dstRow, short height, short words, short seedH, short seedV) |
| Calculate a mask for use in CopyMask. More... | |
| void | CalcMask (const void *srcPtr, void *dstPtr, short srcRow, short dstRow, short height, short words) |
| void | CopyMask (const BitMap *srcBits, const BitMap *maskBits, const BitMap *dstBits, const Rect *srcRect, const Rect *maskRect, const Rect *dstRect) |
| PicHandle | OpenPicture (const Rect *picFrame) |
| void | PicComment (short kind, short dataSize, Handle dataHandle) |
| void | ClosePicture (void) |
| void | DrawPicture (PicHandle myPicture, const Rect *dstRect) |
| void | KillPicture (PicHandle myPicture) |
| PolyHandle | OpenPoly (void) |
| void | ClosePoly (void) |
| void | KillPoly (PolyHandle poly) |
| void | OffsetPoly (PolyHandle poly, short dh, short dv) |
| Move a polygon. More... | |
| void | FramePoly (PolyHandle poly) |
| void | PaintPoly (PolyHandle poly) |
| void | ErasePoly (PolyHandle poly) |
| void | InvertPoly (PolyHandle poly) |
| void | FillPoly (PolyHandle poly, const Pattern *pat) |
| void | SetPt (Point *pt, short h, short v) |
| Pack horizontal and vertical coordinates into Point. More... | |
| SubPt (localPt, &tmpPt) | |
| OffsetPoly (thePoly, tmpPt.h, tmpPt.v) | |
| if (ctlCode==inThumb) } This function is also used as an intermediate step in converting between coordinates of two different grafPorts(e.g. | |
| LocalToGlobal & | topLeft (theRect) |
| LocalToGlobal & | botRight (theRect) |
| SetPort (windowB) | |
| The Quickdraw global variable randSeed can also be used as a seed to start a pseudo random sequence Example unsigned short | RangedRdm (unsigned short min, unsigned short max) |
| void | StuffHex (void *thingPtr, ConstStr255Param s) |
| Convert a string of hex digits to binary data. More... | |
| Boolean | MacGetPixel (short h, short v) |
| void | ScalePt (Point *pt, const Rect *srcRect, const Rect *dstRect) |
| Resize coordinate pair to ratio of two rectangles. More... | |
| void | MapRect (Rect *r, const Rect *srcRect, const Rect *dstRect) |
| Scale and reposition a rectangle. More... | |
| void | MapRgn (RgnHandle rgn, const Rect *srcRect, const Rect *dstRect) |
| void | MapPoly (PolyHandle poly, const Rect *srcRect, const Rect *dstRect) |
| Scale and reposition a polygon. More... | |
| pascal short | myCommentProc (void) |
| Set graphProcs field to point to custom routines. More... | |
| void | StdRect (GrafVerb verb, const Rect *r) |
| void | StdRRect (GrafVerb verb, const Rect *r, short ovalWidth, short ovalHeight) |
| void | StdOval (GrafVerb verb, const Rect *r) |
| void | StdArc (GrafVerb verb, const Rect *r, short startAngle, short arcAngle) |
| void | StdPoly (GrafVerb verb, PolyHandle poly) |
| void | StdRgn (GrafVerb verb, RgnHandle rgn) |
| void | StdBits (const BitMap *srcBits, const Rect *srcRect, const Rect *dstRect, short mode, RgnHandle maskRgn) |
| void | StdComment (short kind, short dataSize, Handle dataHandle) |
| void | StdGetPic (void *dataPtr, short byteCount) |
| The default Quickdraw picture-retrieving routine. More... | |
| void | StdPutPic (const void *dataPtr, short byteCount) |
| void | StdOpcode (const Rect *fromRect, const Rect *toRect, UInt16 opcode, SInt16 version) |
| void | AddPt (Point src, Point *dst) |
| Add coordinates of two points. More... | |
| Boolean | MacPtInRect (Point pt, const Rect *r) |
| void | Pt2Rect (Point pt1, Point pt2, Rect *dstRect) |
| Find smallest rectangle enclosing two points. More... | |
| void | PtToAngle (const Rect *r, Point pt, short *angle) |
| Obtain angle between point and rectangle center. More... | |
| void | SubPt (Point src, Point *dst) |
| Subtract coordinates of one point from another. More... | |
| void | StdLine (Point newPt) |
| void | OpenCPort (CGrafPtr port) |
| void | InitCPort (CGrafPtr port) |
| void | CloseCPort (CGrafPtr port) |
| PixMapHandle | NewPixMap (void) |
| void | DisposePixMap (PixMapHandle pm) |
| void | CopyPixMap (PixMapHandle srcPM, PixMapHandle dstPM) |
| Duplicate pixMap's structure to an existing pixmap. More... | |
| PixPatHandle | NewPixPat (void) |
| void | DisposePixPat (PixPatHandle pp) |
| void | CopyPixPat (PixPatHandle srcPP, PixPatHandle dstPP) |
| Duplicate pixPat's structure to an existing region. More... | |
| void | PenPixPat (PixPatHandle pp) |
| void | BackPixPat (PixPatHandle pp) |
| PixPatHandle | GetPixPat (short patID) |
| void | MakeRGBPat (PixPatHandle pp, const RGBColor *myColor) |
| Provides best possible RGB match on current device. More... | |
| void | FillCRect (const Rect *r, PixPatHandle pp) |
| void | FillCOval (const Rect *r, PixPatHandle pp) |
| void | FillCRoundRect (const Rect *r, short ovalWidth, short ovalHeight, PixPatHandle pp) |
| void | FillCArc (const Rect *r, short startAngle, short arcAngle, PixPatHandle pp) |
| void | FillCRgn (RgnHandle rgn, PixPatHandle pp) |
| void | FillCPoly (PolyHandle poly, PixPatHandle pp) |
| void | RGBForeColor (const RGBColor *color) |
| void | RGBBackColor (const RGBColor *color) |
| void | SetCPixel (short h, short v, const RGBColor *cPix) |
| void | SetPortPix (PixMapHandle pm) |
| Replaces a portPixMap of the active CGrafPort with a handle. More... | |
| void | GetCPixel (short h, short v, RGBColor *cPix) |
| Find the RGB of a specified pixel. More... | |
| void | GetForeColor (RGBColor *color) |
| Obtain foreground color set in current port. More... | |
| void | GetBackColor (RGBColor *color) |
| Obtain foreground color set in current port. More... | |
| void | SeedCFill (const BitMap *srcBits, const BitMap *dstBits, const Rect *srcRect, const Rect *dstRect, short seedH, short seedV, ColorSearchUPP matchProc, long matchData) |
| Calculate a mask for use in CopyMask or CopyBits. More... | |
| void | CalcCMask (const BitMap *srcBits, const BitMap *dstBits, const Rect *srcRect, const Rect *dstRect, const RGBColor *seedRGB, ColorSearchUPP matchProc, long matchData) |
| Calculate a mask for use in CopyMask. More... | |
| PicHandle | OpenCPicture (const OpenCPicParams *newHeader) |
| void | OpColor (const RGBColor *color) |
| Set RGB values used by addPin, subPin and blend modes. More... | |
| void | HiliteColor (const RGBColor *color) |
| Choose new highlighting color. More... | |
| void | DisposeCTable (CTabHandle cTable) |
| CTabHandle | GetCTable (short ctID) |
| CCrsrHandle | GetCCursor (short crsrID) |
| void | SetCCursor (CCrsrHandle cCrsr) |
| void | AllocCursor (void) |
| void | DisposeCCursor (CCrsrHandle cCrsr) |
| void | SetStdCProcs (CQDProcs *procs) |
| Set graphProcs field to point to custom routines. More... | |
| GDHandle | GetMaxDevice (const Rect *globalRect) |
| Gives a handle to device with the deepest pixMap. More... | |
| long | GetCTSeed (void) |
| Get unique seed value for color table. More... | |
| GDHandle | GetDeviceList (void) |
| Provides a handle to the first gDevice in the DeviceList. More... | |
| GDHandle | GetMainDevice (void) |
| Provides a handle to the startup gDevice. More... | |
| GDHandle | GetNextDevice (GDHandle curDevice) |
| Boolean | TestDeviceAttribute (GDHandle gdh, short attribute) |
| TestDeviceAttribute Check whether or not an attribute is set. More... | |
| void | SetDeviceAttribute (GDHandle gdh, short attribute, Boolean value) |
| SetDeviceAttribute Set the device's display characteristics. More... | |
| void | InitGDevice (short qdRefNum, long mode, GDHandle gdh) |
| GDHandle | NewGDevice (short refNum, long mode) |
| void | DisposeGDevice (GDHandle gdh) |
| void | SetGDevice (GDHandle gd) |
| Set the current device to the specified device. More... | |
| GDHandle | GetGDevice (void) |
| Get handle to current GDevice. More... | |
| long | Color2Index (const RGBColor *myColor) |
| void | Index2Color (long index, RGBColor *aColor) |
| Find specific RGB. More... | |
| void | InvertColor (RGBColor *myColor) |
| Find a color's complement. More... | |
| Boolean | RealColor (const RGBColor *color) |
| void | GetSubTable (CTabHandle myColors, short iTabRes, CTabHandle targetTbl) |
| void | MakeITable (CTabHandle cTabH, ITabHandle iTabH, short res) |
| void | AddSearch (ColorSearchUPP searchProc) |
| void | AddComp (ColorComplementUPP compProc) |
| void | DelSearch (ColorSearchUPP searchProc) |
| void | DelComp (ColorComplementUPP compProc) |
| void | SetClientID (short id) |
| Identify this client to search and complement procedures. More... | |
| void | ProtectEntry (short index, Boolean protect) |
| Protect or un-protect color table entry. More... | |
| void | ReserveEntry (short index, Boolean reserve) |
| Reserve or dereserve color table entry. More... | |
| void | SetEntries (short start, short count, CSpecArray aTable) |
| Set a group of color table entries for the current gDevice. More... | |
| void | SaveEntries (CTabHandle srcTable, CTabHandle resultTable, ReqListRec *selection) |
| Saves selected entries to a result table. More... | |
| void | RestoreEntries (CTabHandle srcTable, CTabHandle dstTable, ReqListRec *selection) |
| Sets entries into dstTable without rebuilding inverse table. More... | |
| short | QDError (void) |
| Return error result from last QuickDraw call. More... | |
| void | CopyDeepMask (const BitMap *srcBits, const BitMap *maskBits, const BitMap *dstBits, const Rect *srcRect, const Rect *maskRect, const Rect *dstRect, short mode, RgnHandle maskRgn) |
| void | DeviceLoop (RgnHandle drawingRgn, DeviceLoopDrawingUPP drawingProc, long userData, DeviceLoopFlags flags) |
| Ptr | GetMaskTable (void) |
| Get table of masks from ROM. More... | |
| PatHandle | GetPattern (short patternID) |
| CursHandle | MacGetCursor (short cursorID) |
| PicHandle | GetPicture (short pictureID) |
| long | DeltaPoint (Point ptA, Point ptB) |
| Calculate distance between two points. More... | |
| An alternative method is to convert shieldRect to global | coordinates (via LocalToGlobal) before the call |
| Hide cursor while moving (or while in) a rectangle. More... | |
| An alternative method is to convert shieldRect to global and pass(0, 0) as offsetPt.</pre > *@par Copyright void | ScreenRes (short *scrnHRes, short *scrnVRes) |
| Obtain screen resolution in pixels-per-inch. More... | |
| void | GetIndPattern (Pattern *thePat, short patternListID, short index) |
| Boolean | ptinrect (const Point *pt, const Rect *r) |
| void | pt2rect (const Point *pt1, const Point *pt2, Rect *destRect) |
| void | pttoangle (const Rect *r, const Point *pt, short *angle) |
| Boolean | ptinrgn (const Point *pt, RgnHandle rgn) |
| void | addpt (const Point *src, Point *dst) |
| void | subpt (const Point *src, Point *dst) |
| Boolean | equalpt (const Point *pt1, const Point *pt2) |
| void | stuffhex (void *thingPtr, const char *s) |
| void | stdline (const Point *newPt) |
| void | shieldcursor (const Rect *shieldRect, Point *offsetPt) |
| long | deltapoint (Point *ptA, Point *ptB) |
| void | UnpackBits (Ptr *srcPtr, Ptr *dstPtr, short dstBytes) |
| Uncompress data stored via PackBits. More... | |
| MoveTo (startPt.h, startPt.v) | |
| Line (dh, dv) | |
| typedef | CALLBACK_API (void, CustomXFerProcPtr)(CustomXFerRecPtr info) |
| OSErr | GetPortCustomXFerProc (CGrafPtr port, CustomXFerProcPtr *proc, UInt32 *flags, UInt32 *refCon) |
| OSErr | SetPortCustomXFerProc (CGrafPtr port, CustomXFerProcPtr proc, UInt32 flags, UInt32 refCon) |
| OSErr | OpenCursorComponent (Component c, ComponentInstance *ci) |
| OSErr | CloseCursorComponent (ComponentInstance ci) |
| OSErr | SetCursorComponent (ComponentInstance ci) |
| OSErr | CursorComponentChanged (ComponentInstance ci) |
| OSErr | CursorComponentSetData (ComponentInstance ci, long data) |
| Boolean | IsValidPort (CGrafPtr port) |
| Boolean | QDIsPortBuffered (CGrafPtr port) |
| Boolean | QDIsPortBufferDirty (CGrafPtr port) |
| void | QDFlushPortBuffer (CGrafPtr port, RgnHandle region) |
| OSStatus | QDGetDirtyRegion (CGrafPtr port, RgnHandle rgn) |
| OSStatus | QDSetDirtyRegion (CGrafPtr port, RgnHandle rgn) |
| OSStatus | QDAddRectToDirtyRegion (CGrafPtr inPort, const Rect *inBounds) |
| OSStatus | QDAddRegionToDirtyRegion (CGrafPtr inPort, RgnHandle inRegion) |
| OSStatus | CreateCGContextForPort (CGrafPtr inPort, CGContextRef *outContext) |
| OSStatus | ClipCGContextToRegion (CGContextRef gc, const Rect *portRect, RgnHandle region) |
| OSStatus | SyncCGContextOriginWithPort (CGContextRef inContext, CGrafPtr port) |
| OSStatus | QDBeginCGContext (CGrafPtr inPort, CGContextRef *outContext) |
| OSStatus | QDEndCGContext (CGrafPtr inPort, CGContextRef *inoutContext) |
| QDRegionBitsRef | QDSaveRegionBits (RgnHandle region) |
| OSStatus | QDRestoreRegionBits (RgnHandle region, QDRegionBitsRef regionBits) |
| OSStatus | QDDisposeRegionBits (QDRegionBitsRef regionBits) |
| CGrafPtr | CreateNewPortForCGDisplayID (UInt32 inCGDisplayID) |
| void | QDDisplayWaitCursor (Boolean forceWaitCursor) |
| void | QDSetPatternOrigin (Point origin) |
| void | QDGetPatternOrigin (Point *origin) |
| SInt16 | LMGetScrVRes (void) |
| void | LMSetScrVRes (SInt16 value) |
| SInt16 | LMGetScrHRes (void) |
| void | LMSetScrHRes (SInt16 value) |
| GDHandle | LMGetMainDevice (void) |
| void | LMSetMainDevice (GDHandle value) |
| GDHandle | LMGetDeviceList (void) |
| void | LMSetDeviceList (GDHandle value) |
| Handle | LMGetQDColors (void) |
| void | LMSetQDColors (Handle value) |
| Handle | LMGetWidthListHand (void) |
| void | LMSetWidthListHand (Handle value) |
| UInt8 | LMGetHiliteMode (void) |
| void | LMSetHiliteMode (UInt8 value) |
| Ptr | LMGetWidthPtr (void) |
| void | LMSetWidthPtr (Ptr value) |
| Handle | LMGetWidthTabHandle (void) |
| void | LMSetWidthTabHandle (Handle value) |
| SInt32 | LMGetLastSPExtra (void) |
| void | LMSetLastSPExtra (SInt32 value) |
| Handle | LMGetLastFOND (void) |
| void | LMSetLastFOND (Handle value) |
| UInt8 | LMGetFractEnable (void) |
| void | LMSetFractEnable (UInt8 value) |
| GDHandle | LMGetTheGDevice (void) |
| void | LMSetTheGDevice (GDHandle value) |
| void | LMGetHiliteRGB (RGBColor *hiliteRGBValue) |
| void | LMSetHiliteRGB (const RGBColor *hiliteRGBValue) |
| Boolean | LMGetCursorNew (void) |
| void | LMSetCursorNew (Boolean value) |
Variables | |
| QDGlobals | qd |
| </pre > *par | Copyright |
| Check if a specified pixel is enclosed by a region. More... | |
| LocalToGlobal & | tmpPt |
| Obtain global (screen) value of local point. More... | |
| ctlCode = FindControl(myEvent.where, myWindow, &myCtl) | |
| Obtain local coordinates of global point. More... | |
| windows For | instance |
| windows For to convert the position of rectangle theRect from the coordinates of windowA to the coordinates of | windowB |
| To convert between the coordinates of regions and | polygons |
| theRand = Random() | |
| Obtain pseudo-random signed integer. More... | |
| w1 = r1.right - r1.left | |
| Map point relative to two rectangles. More... | |
| w2 = r2.right - r2.left | |
| thePoint | h = (thePoint.h * w1) / w2 |
| SetStdProcs & | myQDProcs |
| myQDProcs | commentProc = (QDPtr)myCommentProc |
| thePort | grafProcs = &myQDProcs |
| they are equal or the more | efficient |
| Check if two points are identical. More... | |
| they are equal or the more Point | pt2 |
| </pre > *par Ptr * | dstPtr |
| </pre > *par Ptr short | srcBytes |
| dv = startPt.v - endPt.v | |
| Calculate slope given an angle. More... | |
| dh = FixRound(FixMul(INT2FIX(dv), theSlope)) | |
| Fixed | theSlope = FixRatio(INT2FIX(dh), INT2FIX(dv)) |
| Calculate angle given slope. More... | |
| Point | startPt |
| Point | endPt |
| short | theAngle = AngleFromSlope(theSlope) |
| in CarbonLib and later *par Mac OS | X |
Interface to Quickdraw Graphics.
Version: Universal Interfaces 3.4.1
For bug reports, consult the following page on the World Wide Web:
http://developer.apple.com/bugreporter/
| #define CallDeviceLoopDrawingProc | ( | userRoutine, | |
| depth, | |||
| deviceFlags, | |||
| targetDevice, | |||
| userData | |||
| ) |
| #define InvokeColorSearchUPP | ( | rgb, | |
| position, | |||
| userUPP | |||
| ) |
| #define InvokeDeviceLoopDrawingUPP | ( | depth, | |
| deviceFlags, | |||
| targetDevice, | |||
| userData, | |||
| userUPP | |||
| ) |
| #define InvokeQDArcUPP | ( | verb, | |
| r, | |||
| startAngle, | |||
| arcAngle, | |||
| userUPP | |||
| ) |
| #define InvokeQDBitsUPP | ( | srcBits, | |
| srcRect, | |||
| dstRect, | |||
| mode, | |||
| maskRgn, | |||
| userUPP | |||
| ) |
| #define InvokeQDCommentUPP | ( | kind, | |
| dataSize, | |||
| dataHandle, | |||
| userUPP | |||
| ) |
| #define InvokeQDJShieldCursorUPP | ( | left, | |
| top, | |||
| right, | |||
| bottom, | |||
| userUPP | |||
| ) |
| #define InvokeQDOpcodeUPP | ( | fromRect, | |
| toRect, | |||
| opcode, | |||
| version, | |||
| userUPP | |||
| ) |
| #define InvokeQDPrinterStatusUPP | ( | opcode, | |
| currentPort, | |||
| printerStatus, | |||
| userUPP | |||
| ) |
| #define InvokeQDRRectUPP | ( | verb, | |
| r, | |||
| ovalWidth, | |||
| ovalHeight, | |||
| userUPP | |||
| ) |
| #define InvokeQDStdGlyphsUPP | ( | dataStream, | |
| size, | |||
| userUPP | |||
| ) |
| #define InvokeQDTextUPP | ( | byteCount, | |
| textBuf, | |||
| numer, | |||
| denom, | |||
| userUPP | |||
| ) |
| #define InvokeQDTxMeasUPP | ( | byteCount, | |
| textAddr, | |||
| numer, | |||
| denom, | |||
| info, | |||
| userUPP | |||
| ) |
| #define InvokeRegionToRectsUPP | ( | message, | |
| rgn, | |||
| rect, | |||
| refCon, | |||
| userUPP | |||
| ) |
| #define NewColorComplementUPP | ( | userRoutine | ) |
| #define NewColorSearchUPP | ( | userRoutine | ) |
| #define NewDeviceLoopDrawingUPP | ( | userRoutine | ) |
| #define NewDragGrayRgnUPP | ( | userRoutine | ) |
| #define NewQDArcUPP | ( | userRoutine | ) |
| #define NewQDBitsUPP | ( | userRoutine | ) |
| #define NewQDCommentUPP | ( | userRoutine | ) |
| #define NewQDGetPicUPP | ( | userRoutine | ) |
| #define NewQDJShieldCursorUPP | ( | userRoutine | ) |
| #define NewQDLineUPP | ( | userRoutine | ) |
| #define NewQDOpcodeUPP | ( | userRoutine | ) |
| #define NewQDOvalUPP | ( | userRoutine | ) |
| #define NewQDPolyUPP | ( | userRoutine | ) |
| #define NewQDPrinterStatusUPP | ( | userRoutine | ) |
| #define NewQDPutPicUPP | ( | userRoutine | ) |
| #define NewQDRectUPP | ( | userRoutine | ) |
| #define NewQDRgnUPP | ( | userRoutine | ) |
| #define NewQDRRectUPP | ( | userRoutine | ) |
| #define NewQDStdGlyphsUPP | ( | userRoutine | ) |
| #define NewQDTextUPP | ( | userRoutine | ) |
| #define NewQDTxMeasUPP | ( | userRoutine | ) |
| #define NewRegionToRectsUPP | ( | userRoutine | ) |
| #define OLDGDEVICESTRUCT 0 |
| #define OLDPIXMAPSTRUCT 0 |
QuickTime 3.0 makes PixMap data structure available on non-Mac OS's. In order to implement PixMap in these alternate environments, the PixMap had to be extended. The pmReserved field was changed to pmExt which is a Handle to extra info. The planeBytes field was changed to pixelFormat.
In OS X, Quickdraw also uses the new PixMap data structure.
| typedef const Pattern* ConstPatternParam |
| typedef MacPolygon* PolyPtr |
The type name "Polygon" has a name space collision on Win32. Use MacPolygon to be cross-platfrom safe.
| typedef SInt32 PrinterStatusOpcode |
PrinterStatusOpcode. For communication with downloading and printing services.
| typedef struct OpaqueQDRegionBitsRef* QDRegionBitsRef |
The following routines are implemented in CarbonLib, and on Mac OS X in QD proper. They save the pixel data of a region in a packed format for quick save/restore without using a lot of memory to do a large, hollow region, such as the region used when drag hiliting (which is where this is used).
| typedef const TQARect * rect |
The type name "Region" has a name space collision on Win32. Use MacRegion to be cross-platfrom safe.
This set of definitions "belongs" in Windows. But, there is a circularity in the headers where Windows includes Controls and Controls includes Windows. To break the circle, the information needed by Controls is moved from Windows to Quickdraw.
| void AddComp | ( | ColorComplementUPP | compProc | ) |
Availability:
Availability:
Add coordinates of two points.
AddPt adds the coordinates of two Points, storing the result into the second. srcPtis a 4-byte Point structure. Its low word is the horizontal coordinate and its high word is the vertical coordinate. destPtis the address of a 4-byte Point structure. Upon return, it will contain the sums (srcPt.h+destPt.h) and (srcPt.v+destPt.v).
none
AddPt is functionally equivalent to: destPt.h += srcPt.h; destPt.v += srcPt.v; Use SubPt or DeltaPoint to calculate the difference between two Points.
| void AddSearch | ( | ColorSearchUPP | searchProc | ) |
Availability:
| void AllocCursor | ( | void | ) |
Availability:
| void BackColor | ( | long | color | ) |
Availability:
| void BackPixPat | ( | PixPatHandle | pp | ) |
Availability:
Availability:
| void CalcCMask | ( | const BitMap * | srcBits, |
| const BitMap * | dstBits, | ||
| const Rect * | srcRect, | ||
| const Rect * | dstRect, | ||
| const RGBColor * | seedRGB, | ||
| ColorSearchUPP | matchProc, | ||
| long | matchData | ||
| ) |
Calculate a mask for use in CopyMask.
| matchProc | custom matching routine; NIL = default CalcCMask examines a portion of a bitmap and creates a mask that can be used with CopyMask . It finds the outermost outline of any figure in the bitmap (as in the lasso tool of many paint programs) and creates a mask having 1s in the places where paint would "leak" were you to pour it inside the figure. The object of this procedure is the reverse of SeedCFill in that it protects areas from being filled with color. srcMap is the address (srcBits) of a rectangle inside a BitMap or PixMap data area. CalcCMask examines this rectangle as it floods portions of the destination bitMap. destMap is the address (destBits) of a rectangle inside a BitMap or PixMap data area. CalcCMask fills all or part of this rectangle with 1s. srcRect and . . . destRect are the rectangles within the BitMap or PixMap into which srcMap ␅ and destMap, respectively point; i.e., the function will add this value to its current address pointer to move "down one line" in the BitMap. seedRGB is the RGBvalue of the pixel from which calculations begin. matchProc is a pointer to a custom routine to be used instead of the default searchProc. It should return 1's for RGB values that define the edges of the mask and 0's for values that do not. Pass NIL in this parameter to use the default searchProc. See Custom Search and Complement Procedures for more on writing a custom searchProc. matchData holds application specific data. Pass 0 in this parameter to obtain the default behavior. |
none
Use CalcCMask to build a mask which can be used in conjunction with CopyMask to implement the "lasso" tool of many paint programs. CalcCMask creates an area into which paint won't flow. By default, paint can leak to all adjacent pixels whose RGB values don't match that of the
| void CalcMask | ( | const void * | srcPtr, |
| void * | dstPtr, | ||
| short | srcRow, | ||
| short | dstRow, | ||
| short | height, | ||
| short | words | ||
| ) |
Availability:
Availability:
| void CloseCPort | ( | CGrafPtr | port | ) |
Availability:
| OSErr CloseCursorComponent | ( | ComponentInstance | ci | ) |
Availability:
| void ClosePicture | ( | void | ) |
Availability:
| void ClosePoly | ( | void | ) |
Availability:
| void ClosePort | ( | GrafPtr | port | ) |
Availability:
| void CloseRgn | ( | RgnHandle | dstRgn | ) |
Availability:
| long Color2Index | ( | const RGBColor * | myColor | ) |
Availability:
| void ColorBit | ( | short | whichBit | ) |
Select color plane for subsequent drawing.
ColorBit selects the "color plane" to which Quickdraw should direct subsequent drawing operations. This function is part of the "old model" Quickdraw color support. whichPlane specifies the plane number. Black-and-white devices have only one color plane (plane 0). Quickdraw supports drawing to devices that can interpret up to 32 planes of color information.
none
This sets the value of the colrBit field of the current GrafPort structure. It is used for drawing in color while remaining compatible with pre-MacII Macs. It may also be used in sophisticated applications for creating overlays.
| An alternative method is to convert shieldRect to global coordinates | ( | via | LocalToGlobal | ) |
Hide cursor while moving (or while in) a rectangle.
ShieldCursor ( &shieldRect, thePort->portBits.bounds.topLeft );: ShowCursor ();/* when you no longer need to shield
| void CopyBits | ( | const BitMap * | srcBits, |
| const BitMap * | dstBits, | ||
| const Rect * | srcRect, | ||
| const Rect * | dstRect, | ||
| short | mode, | ||
| RgnHandle | maskRgn | ||
| ) |
Availability:
| void CopyDeepMask | ( | const BitMap * | srcBits, |
| const BitMap * | maskBits, | ||
| const BitMap * | dstBits, | ||
| const Rect * | srcRect, | ||
| const Rect * | maskRect, | ||
| const Rect * | dstRect, | ||
| short | mode, | ||
| RgnHandle | maskRgn | ||
| ) |
Availability:
| void CopyMask | ( | const BitMap * | srcBits, |
| const BitMap * | maskBits, | ||
| const BitMap * | dstBits, | ||
| const Rect * | srcRect, | ||
| const Rect * | maskRect, | ||
| const Rect * | dstRect | ||
| ) |
Availability:
| void CopyPixMap | ( | PixMapHandle | srcPM, |
| PixMapHandle | dstPM | ||
| ) |
Duplicate pixMap's structure to an existing pixmap.
CopyPixMap copies the data of one pixel map into another. srcPm is the handle of an existing pixel map you wish to duplicate. destPm is the handle of destination pixel map.
none
CopyPixMap copies the contents of the color table, giving the destination PixMap its own. The image is not copied -- only the pointer that is the pixMap's baseAddr field (base address).
| void CopyPixPat | ( | PixPatHandle | srcPP, |
| PixPatHandle | dstPP | ||
| ) |
Duplicate pixPat's structure to an existing region.
CopyPixPat copies the data of one pixPat into another. srcPP is the handle of an existing pixPat you wish to duplicate. destPP is the handle of destination pixPat.
none
CopyPixPat copies the entire contents of the pixel pattern, including color table, data handle, expanded data handle, expanded map, and pixMap handle.
| OSStatus CreateCGContextForPort | ( | CGrafPtr | inPort, |
| CGContextRef * | outContext | ||
| ) |
Availability:
| CGrafPtr CreateNewPortForCGDisplayID | ( | UInt32 | inCGDisplayID | ) |
Developers need a way to go from a CGDirectDisplay environment to Quickdraw. The following is equivalent to CreateNewPort(), but instead of taking the portPixMap from the current GDevice, it uses the GDevice corresponding to the CGSDisplayID passed in. If the CGSDisplayID is invalid, the mainDevice is used instead. CreateNewPortForCGDisplayID()
Availability:
| OSErr CursorComponentChanged | ( | ComponentInstance | ci | ) |
Availability:
| OSErr CursorComponentSetData | ( | ComponentInstance | ci, |
| long | data | ||
| ) |
Availability:
| void DelComp | ( | ColorComplementUPP | compProc | ) |
Availability:
| void DelSearch | ( | ColorSearchUPP | searchProc | ) |
Availability:
Availability:
Calculate distance between two points.
| aPt | any Point |
| bPt | any other point, same coordinate system DeltaPoint returns the distance between two points, returned as a 32-bit value with the high-order word being the vertical distance and the low-order word being the horizontal distance. aPtand . . . bPtare any two points, expressed in the same coordinate system. |
a 32-bit long integer; it identifies the distance between aPt and bPt. The high word is the vertical offset and the low word is the horizontal offset. Negative values indicate that bPt is above and to the left of aPt ; positive values indicate below and to the right.
This performs the same function as SubPt, except the difference is given as the returned value instead of stored into a variable.
| void DeviceLoop | ( | RgnHandle | drawingRgn, |
| DeviceLoopDrawingUPP | drawingProc, | ||
| long | userData, | ||
| DeviceLoopFlags | flags | ||
| ) |
Availability:
Availability:
| void DisposeCCursor | ( | CCrsrHandle | cCrsr | ) |
Availability:
| void DisposeColorComplementUPP | ( | ColorComplementUPP | userUPP | ) |
Availability:
| void DisposeColorSearchUPP | ( | ColorSearchUPP | userUPP | ) |
Availability:
| void DisposeCTable | ( | CTabHandle | cTable | ) |
Availability:
| void DisposeDeviceLoopDrawingUPP | ( | DeviceLoopDrawingUPP | userUPP | ) |
Availability:
| void DisposeDragGrayRgnUPP | ( | DragGrayRgnUPP | userUPP | ) |
Availability:
| void DisposeGDevice | ( | GDHandle | gdh | ) |
Availability:
| void DisposePixMap | ( | PixMapHandle | pm | ) |
Availability:
| void DisposePixPat | ( | PixPatHandle | pp | ) |
Availability:
| void DisposeQDArcUPP | ( | QDArcUPP | userUPP | ) |
Availability:
| void DisposeQDBitsUPP | ( | QDBitsUPP | userUPP | ) |
Availability:
| void DisposeQDCommentUPP | ( | QDCommentUPP | userUPP | ) |
Availability:
| void DisposeQDGetPicUPP | ( | QDGetPicUPP | userUPP | ) |
Availability:
| void DisposeQDJShieldCursorUPP | ( | QDJShieldCursorUPP | userUPP | ) |
Availability:
| void DisposeQDLineUPP | ( | QDLineUPP | userUPP | ) |
Availability:
| void DisposeQDOpcodeUPP | ( | QDOpcodeUPP | userUPP | ) |
Availability:
| void DisposeQDOvalUPP | ( | QDOvalUPP | userUPP | ) |
Availability:
| void DisposeQDPolyUPP | ( | QDPolyUPP | userUPP | ) |
Availability:
| void DisposeQDPrinterStatusUPP | ( | QDPrinterStatusUPP | userUPP | ) |
Availability:
| void DisposeQDPutPicUPP | ( | QDPutPicUPP | userUPP | ) |
Availability:
| void DisposeQDRectUPP | ( | QDRectUPP | userUPP | ) |
Availability:
| void DisposeQDRgnUPP | ( | QDRgnUPP | userUPP | ) |
Availability:
| void DisposeQDRRectUPP | ( | QDRRectUPP | userUPP | ) |
Availability:
| void DisposeQDStdGlyphsUPP | ( | QDStdGlyphsUPP | userUPP | ) |
Availability:
| void DisposeQDTextUPP | ( | QDTextUPP | userUPP | ) |
Availability:
| void DisposeQDTxMeasUPP | ( | QDTxMeasUPP | userUPP | ) |
Availability:
| void DisposeRegionToRectsUPP | ( | RegionToRectsUPP | userUPP | ) |
Availability:
| void DisposeRgn | ( | RgnHandle | rgn | ) |
Availability:
Availability:
Determine if a rectangle is empty.
EmptyRect tests to see if a rectangle is empty; i.e., if the bottom border is less than or equal to the top, or the right border is less than or equal to the left. theRectis the address of an 8-byte Rect structure.
a Boolean indicating whether the rectangle is empty . It is one of: FALSENot empty; encloses at least one pixel TRUEEmpty
This is functionally equivalent to the following equality test: ( (theRect.bottom <= theRect.top) || (theRect.right <= theRect.left) ) When a Toolbox function returns "the empty rectangle", it returns a rectangle with borders (0,0)(0,0). However, in this function, the meaning is broader, including all rectangles not enclosing any pixels.
Determine if a Region is empty.
EmptyRgn returns an indication of whether a region is empty. theRgnis the handle of a region, in local or global coordinates.
a Boolean value indicating whether the region is empty. It is one of: FALSENot empty, encloses at least one pixel TRUEEmpty
Use this after performing region calculations. For instance:
SectRgn ( srcRgnA, srcRgnB, destRgn );
if ( EmptyRgn ( destRgn ) ) {. ... no intersection ...}
This is also useful after InsetRgn to see if the region has been shrunk
infinitely small. Or, you might use this to check up on GrafPort structure
fields such as visRgn or clipRgn.
Availability:
| void EraseArc | ( | const Rect * | r, |
| short | startAngle, | ||
| short | arcAngle | ||
| ) |
Availability:
| void EraseOval | ( | const Rect * | r | ) |
Availability:
| void ErasePoly | ( | PolyHandle | poly | ) |
Availability:
| void EraseRect | ( | const Rect * | r | ) |
Availability:
| void EraseRgn | ( | RgnHandle | rgn | ) |
Availability:
| void EraseRoundRect | ( | const Rect * | r, |
| short | ovalWidth, | ||
| short | ovalHeight | ||
| ) |
Availability:
Availability:
| void FillCArc | ( | const Rect * | r, |
| short | startAngle, | ||
| short | arcAngle, | ||
| PixPatHandle | pp | ||
| ) |
Availability:
| void FillCOval | ( | const Rect * | r, |
| PixPatHandle | pp | ||
| ) |
Availability:
| void FillCPoly | ( | PolyHandle | poly, |
| PixPatHandle | pp | ||
| ) |
Availability:
| void FillCRect | ( | const Rect * | r, |
| PixPatHandle | pp | ||
| ) |
Availability:
| void FillCRgn | ( | RgnHandle | rgn, |
| PixPatHandle | pp | ||
| ) |
Availability:
| void FillCRoundRect | ( | const Rect * | r, |
| short | ovalWidth, | ||
| short | ovalHeight, | ||
| PixPatHandle | pp | ||
| ) |
Availability:
Availability:
| void FillPoly | ( | PolyHandle | poly, |
| const Pattern * | pat | ||
| ) |
Availability:
Availability:
| void ForeColor | ( | long | color | ) |
Availability:
| void FrameArc | ( | const Rect * | r, |
| short | startAngle, | ||
| short | arcAngle | ||
| ) |
Availability:
| void FrameOval | ( | const Rect * | r | ) |
Availability:
| void FramePoly | ( | PolyHandle | poly | ) |
Availability:
| void FrameRoundRect | ( | const Rect * | r, |
| short | ovalWidth, | ||
| short | ovalHeight | ||
| ) |
Availability:
| void GetBackColor | ( | RGBColor * | color | ) |
Obtain foreground color set in current port.
GetBackColor is used to obtain the red, green and blue, components of the foreground color in the current port. color is the address of either the rgbBkColor field or the global variable QDColors , depending on whether the current port is a grafPort or a cGrafPort.
none Notes :GetBackColor works regardless of whether the current port is a grafPort or a cGrafPort. The difference is that for CGrafPort , the value comes from the rgbBkColor field while GrafPort colors are specific values set by the global variable QDColors . In turn, QDColors is a pointer to a table where Quickdraw colors are stored as follows: Value Color Red Green Blue 0 black 0x0000 0x0000 0x0000 1 yellow 0xFC00 0xF37D 0x052F 2 magenta 0xF2D7 0x0856 0x84EC 3 red 0xDD6B 0x08C2 0x06A2 4 cyan 0x0241 0xAB54 0xEAFF 5 green 0x0000 0x8000 0x11B0 6 blue 0x0000 0x0000 0xD400 7 white 0xFFFF 0xFFFF 0xFFFF
| CCrsrHandle GetCCursor | ( | short | crsrID | ) |
Availability:
| void GetCPixel | ( | short | h, |
| short | v, | ||
| RGBColor * | cPix | ||
| ) |
Find the RGB of a specified pixel.
GetCPixel obtains the RGB of a pixel associated with a coordinate pair. horizand . . . vert identify the pixel in question (which hangs below and to the right of the specified point). These are expressed in the coordinate system of the current CGrafPort . color is the RGB color of the pixel.
none
| CTabHandle GetCTable | ( | short | ctID | ) |
Availability:
| long GetCTSeed | ( | void | ) |
Get unique seed value for color table.
GetCTSeed returns a seed value unique to the application's color table and is for use in its ctSeed field.
a 32-bit long; a value greater than that stored in minSeed.
GetCTSeed distinquishes the color table from the destination and ensures proper color table translation.
| GDHandle GetDeviceList | ( | void | ) |
Provides a handle to the first gDevice in the DeviceList.
GetDeviceList can be used to show which device is first on the Device list. Returns: a GDHandle ; a handle to the first gDevice.
A handle to the first item in the device list can be found in the DeviceList global variable.
| void GetForeColor | ( | RGBColor * | color | ) |
Obtain foreground color set in current port.
GetForeColor is used to obtain the red, green, and blue complements of the foreground color in the current port. color is the address of either the rgbFgColor field or the global variable QDColors , depending on whether the current port is a grafPort or a cGrafPort.
none Notes :GetForeColor works regardless of whether the current port is a grafPort or a cGrafPort. The difference is that for CGrafPort , the value comes from the rgbFgColor field while GrafPort colors are specific values set by the global variable QDColors . In turn, QDColors is a pointer to a table where Quickdraw colors are stored as follows: Value Color Red Green Blue 0 black 0x0000 0x0000 0x0000 1 yellow 0xFC00 0xF37D 0x052F 2 magenta 0xF2D7 0x0856 0x84EC 3 red 0xDD6B 0x08C2 0x06A2 4 cyan 0x0241 0xAB54 0xEAFF 5 green 0x0000 0x8000 0x11B0 6 blue 0x0000 0x0000 0xD400 7 white 0xFFFF 0xFFFF 0xFFFF
| GDHandle GetGDevice | ( | void | ) |
Get handle to current GDevice.
GetGDevice returns a handle to the current GDevice. You can use the functions GetDeviceList and GetNextDevice to step through all devices.
| void GetIndPattern | ( | Pattern * | thePat, |
| short | patternListID, | ||
| short | index | ||
| ) |
Availability:
| GDHandle GetMainDevice | ( | void | ) |
Provides a handle to the startup gDevice.
GetMainDevice can be used to show which device is listed as the monitor with the menu bar. GetMainDevice gets this value from the MainDevice global variable. Returns: a GDHandle ; a handle to the gDevice that carries the menu bar.
Contains information on the size and depth of the gDevice of the monitor containing the menu bar. Unless a different screen has been called out in parameter RAM as the main device, this is the screen with its video card in the lowest-numbered slot.
| Ptr GetMaskTable | ( | void | ) |
Get table of masks from ROM.
GetMaskTable returns a pointer to a ROM table containing the following useful masks: 0x0000, 0x8000, 0xC000, 0xE000 Table of 16 right masks 0xF000, 0xF800, 0xFC00, 0xFE00 0xFF00, 0xFF80, 0xFFC0, 0xFFE0 0xFFF0, 0xFFF8, 0xFFFC, 0xFFFE 0xFFFF, 0x7FFF, 0x3FFF, 0x1FFF Table of 16 left masks 0x0FFF, 0x07FF, 0x03FF, 0x01FF 0x00FF, 0x007F, 0x003F, 0x001F 0X000F, 0x0007, 0x0003, 0x0001 0x8000, 0x4000, 0x2000, 0x1000 Table of 16 bit masks 0x0800, 0x0400, 0x0200, 0x0100 0x0080, 0x0040, 0x0020, 0x0010 0x0008, 0x0004, 0x0002, 0x0001
a pointer to a table of 48 masks
Gives a handle to device with the deepest pixMap.
| CGrafPort | and 5) call SetGDevice yet again to bring back the formerly GetMaxDevice provides a handle to the greatest pixel-depth gDevice in the entire global rectangle. globalRect is the rectangle in global coordinates. |
a GDHandle ; a handle leading to the device in the list with the most available colors.
You can use this routine when creating an offscreen PixMap for subsequent transfer to visible display areas. Alternatively, you might want control of a drawing's colors, especially if it's going to be printed on a device with a different color table than the screen. In either case, you need control of the color and, hence, the gDevices. In either case, if your application spans devices with varying color capabilities, GetMaxDevice lets you use a PixMap to set up the colors to take advantage of the best color table from among all the devices. If you decide to use a PixMap as for a device with the greatest pixel depth, you have to obtain an offscreen CGrafPort for that particular monitor. What's involved in that is: 1)save the current gDevice with the GetGDevice procedure; 2) call GetMaxDevice ; 3) use SetGDevice to make the new choice the currently active screen; 4) call OpenCPort to create the new CGrafPort ; and 5) call SetGDevice yet again to bring back the formerly active gDevice. Because OpenCPort uses the global theGDevice to initialize its PixMap the current CGrafPort and the deepest screen become one and the same. All of the above, however, is simply preparation. Now you get storage for the pixels by defining the PixMap's boundaries to the image's height and width, and setting the rowBytes to take into account the particular pixel size being used on that device--( ( width* portPixMap ^^.pixSize )+ 15 )DIV 16 2 --always bearing in mind that rowBytes has to be even to work at all and a multiple of 4 to work best. Now define the interior of the PixMap by setting portRect . The amount of storage is now height times the value of rowBytes . If you allocate the storage as a handle, then your application can lock the handle and place a pointer to it in the PixMap's base address. Next, in order to draw to the CGrafPort , you save the current gDevice, set theGDevice to be the maximum device, and restore theGDevice when the drawing operation is complete. After you've done all of this preparation, be sure to protect it since all of the above can be brought to nothing if the user changes the depth of the
| GrafPtr GetNativeWindowPort | ( | void * | nativeWindow | ) |
Availability:
Availability:
| PatHandle GetPattern | ( | short | patternID | ) |
Availability:
| PicHandle GetPicture | ( | short | pictureID | ) |
Availability:
| PixPatHandle GetPixPat | ( | short | patID | ) |
Availability:
| void GetPort | ( | GrafPtr * | port | ) |
Availability:
| OSErr GetPortCustomXFerProc | ( | CGrafPtr | port, |
| CustomXFerProcPtr * | proc, | ||
| UInt32 * | flags, | ||
| UInt32 * | refCon | ||
| ) |
Availability:
| void* GetPortNativeWindow | ( | GrafPtr | macPort | ) |
Find which GrafPort is currently active.
GetPort copies a pointer to the current active GrafPort into a local variable. savePort is the address of a GrafPtr. Upon return, it will contain a copy of the global variable thePort (i.e., a pointer to the current active GrafPort ).
none
GetPort is often used to save the value of the current GrafPort before activating a different one. See SetPort for an example. You may prefer to access the global variable thePort directly: GetPort ( &savePort ); ... is synonymous with ... savePort = thePort;
| void GetSubTable | ( | CTabHandle | myColors, |
| short | iTabRes, | ||
| CTabHandle | targetTbl | ||
| ) |
Availability:
| void GrafDevice | ( | short | device | ) |
Set the device field for a GrafPort.
GrafDevice is used in communications between Quickdraw and the Font Manager. It sets device-specific information that affects the way characters are drawn. theDevice is a device specific value. It is broken into 2 bytes as follows: high byte device driver reference number (always negative) low byte device-dependent modifier code
none
This stores theDevice into the device field of the current GrafPort . You will not use this function in normal applications.
| void HandleToRgn | ( | Handle | oldRegion, |
| RgnHandle | region | ||
| ) |
Availability:
| void HiliteColor | ( | const RGBColor * | color | ) |
Choose new highlighting color.
HiliteColor lets you change the highlighting color used by current cGrafPort. RGBColor is a record type which specifies a color's red, green, and blue components as 16-bit unsigned integers.
none
Highlight color is used whenever a drawing operation uses the highlight transfer mode. A cGrafPort's highlight colors are initialized from the HiliteRGB global variable stored in the port's grafVars handle.
| void Index2Color | ( | long | index, |
| RGBColor * | aColor | ||
| ) |
Find specific RGB.
Index2Color finds the RGB color that matches an indexed value on a color table. indexis the padded pixel value rgbis the RGB read from the current device
none
Index2Color is a color conversion procedure that finds the RGB color that best matches a given color table index. This color does not have to be the same color originally requested through RGBForeColor , RGBBackColor , SetCPixel , or Color2Index since it is the RGB that is available from the current gDevice.
| void InitCPort | ( | CGrafPtr | port | ) |
Availability:
| void InitGDevice | ( | short | qdRefNum, |
| long | mode, | ||
| GDHandle | gdh | ||
| ) |
Availability:
| void InitGraf | ( | void * | globalPtr | ) |
Availability:
| void InitPort | ( | GrafPtr | port | ) |
Availability:
| void InsetRgn | ( | RgnHandle | rgn, |
| short | dh, | ||
| short | dv | ||
| ) |
Availability:
| void InvertArc | ( | const Rect * | r, |
| short | startAngle, | ||
| short | arcAngle | ||
| ) |
Availability:
| void InvertColor | ( | RGBColor * | myColor | ) |
Find a color's complement.
InvertColor finds the RGB color that complements a specified color theColor is an RGB's complement
none
InvertColor' s default procedure for finding a color's complement is to use the 1's complement of each component of the requested color.
| void InvertOval | ( | const Rect * | r | ) |
Availability:
| void InvertPoly | ( | PolyHandle | poly | ) |
Availability:
| void InvertRoundRect | ( | const Rect * | r, |
| short | ovalWidth, | ||
| short | ovalHeight | ||
| ) |
Availability:
Availability:
Availability:
| void InvokeDeviceLoopDrawingUPP | ( | short | depth, |
| short | deviceFlags, | ||
| GDHandle | targetDevice, | ||
| long | userData, | ||
| DeviceLoopDrawingUPP | userUPP | ||
| ) |
Availability:
| void InvokeDragGrayRgnUPP | ( | DragGrayRgnUPP | userUPP | ) |
Availability:
| void InvokeQDArcUPP | ( | GrafVerb | verb, |
| const Rect * | r, | ||
| short | startAngle, | ||
| short | arcAngle, | ||
| QDArcUPP | userUPP | ||
| ) |
Availability:
| void InvokeQDBitsUPP | ( | const BitMap * | srcBits, |
| const Rect * | srcRect, | ||
| const Rect * | dstRect, | ||
| short | mode, | ||
| RgnHandle | maskRgn, | ||
| QDBitsUPP | userUPP | ||
| ) |
Availability:
| void InvokeQDCommentUPP | ( | short | kind, |
| short | dataSize, | ||
| Handle | dataHandle, | ||
| QDCommentUPP | userUPP | ||
| ) |
Availability:
| void InvokeQDGetPicUPP | ( | void * | dataPtr, |
| short | byteCount, | ||
| QDGetPicUPP | userUPP | ||
| ) |
Availability:
| void InvokeQDJShieldCursorUPP | ( | short | left, |
| short | top, | ||
| short | right, | ||
| short | bottom, | ||
| QDJShieldCursorUPP | userUPP | ||
| ) |
Availability:
| void InvokeQDLineUPP | ( | Point | newPt, |
| QDLineUPP | userUPP | ||
| ) |
Availability:
| void InvokeQDOpcodeUPP | ( | const Rect * | fromRect, |
| const Rect * | toRect, | ||
| UInt16 | opcode, | ||
| SInt16 | version, | ||
| QDOpcodeUPP | userUPP | ||
| ) |
Availability:
| void InvokeQDOvalUPP | ( | GrafVerb | verb, |
| const Rect * | r, | ||
| QDOvalUPP | userUPP | ||
| ) |
Availability:
| void InvokeQDPolyUPP | ( | GrafVerb | verb, |
| PolyHandle | poly, | ||
| QDPolyUPP | userUPP | ||
| ) |
Availability:
| OSStatus InvokeQDPrinterStatusUPP | ( | PrinterStatusOpcode | opcode, |
| CGrafPtr | currentPort, | ||
| void * | printerStatus, | ||
| QDPrinterStatusUPP | userUPP | ||
| ) |
Availability:
| void InvokeQDPutPicUPP | ( | const void * | dataPtr, |
| short | byteCount, | ||
| QDPutPicUPP | userUPP | ||
| ) |
Availability:
| void InvokeQDRectUPP | ( | GrafVerb | verb, |
| const Rect * | r, | ||
| QDRectUPP | userUPP | ||
| ) |
Availability:
| void InvokeQDRgnUPP | ( | GrafVerb | verb, |
| RgnHandle | rgn, | ||
| QDRgnUPP | userUPP | ||
| ) |
Availability:
| void InvokeQDRRectUPP | ( | GrafVerb | verb, |
| const Rect * | r, | ||
| short | ovalWidth, | ||
| short | ovalHeight, | ||
| QDRRectUPP | userUPP | ||
| ) |
Availability:
| OSStatus InvokeQDStdGlyphsUPP | ( | void * | dataStream, |
| ByteCount | size, | ||
| QDStdGlyphsUPP | userUPP | ||
| ) |
Availability:
| void InvokeQDTextUPP | ( | short | byteCount, |
| const void * | textBuf, | ||
| Point | numer, | ||
| Point | denom, | ||
| QDTextUPP | userUPP | ||
| ) |
Availability:
| short InvokeQDTxMeasUPP | ( | short | byteCount, |
| const void * | textAddr, | ||
| Point * | numer, | ||
| Point * | denom, | ||
| FontInfo * | info, | ||
| QDTxMeasUPP | userUPP | ||
| ) |
Availability:
| OSStatus InvokeRegionToRectsUPP | ( | UInt16 | message, |
| RgnHandle | rgn, | ||
| const Rect * | rect, | ||
| void * | refCon, | ||
| RegionToRectsUPP | userUPP | ||
| ) |
Availability:
Availability:
| void KillPicture | ( | PicHandle | myPicture | ) |
Availability:
| void KillPoly | ( | PolyHandle | poly | ) |
Availability:
| void Line | ( | short | dh, |
| short | dv | ||
| ) |
Availability:
| Boolean LMGetCursorNew | ( | void | ) |
Availability:
| GDHandle LMGetDeviceList | ( | void | ) |
Availability:
| UInt8 LMGetFractEnable | ( | void | ) |
Availability:
| UInt8 LMGetHiliteMode | ( | void | ) |
Availability:
| void LMGetHiliteRGB | ( | RGBColor * | hiliteRGBValue | ) |
Availability:
| Handle LMGetLastFOND | ( | void | ) |
Availability:
| SInt32 LMGetLastSPExtra | ( | void | ) |
Availability:
| GDHandle LMGetMainDevice | ( | void | ) |
Availability:
| Handle LMGetQDColors | ( | void | ) |
Availability:
| SInt16 LMGetScrHRes | ( | void | ) |
Availability:
| SInt16 LMGetScrVRes | ( | void | ) |
LowMem accessor functions previously in LowMem.h LMGetScrVRes()
Availability:
| GDHandle LMGetTheGDevice | ( | void | ) |
Availability:
| Handle LMGetWidthListHand | ( | void | ) |
Availability:
| Ptr LMGetWidthPtr | ( | void | ) |
Availability:
| Handle LMGetWidthTabHandle | ( | void | ) |
Availability:
| void LMSetCursorNew | ( | Boolean | value | ) |
Availability:
| void LMSetDeviceList | ( | GDHandle | value | ) |
Availability:
| void LMSetFractEnable | ( | UInt8 | value | ) |
Availability:
| void LMSetHiliteMode | ( | UInt8 | value | ) |
Availability:
| void LMSetHiliteRGB | ( | const RGBColor * | hiliteRGBValue | ) |
Availability:
| void LMSetLastFOND | ( | Handle | value | ) |
Availability:
| void LMSetLastSPExtra | ( | SInt32 | value | ) |
Availability:
| void LMSetMainDevice | ( | GDHandle | value | ) |
Availability:
| void LMSetQDColors | ( | Handle | value | ) |
Availability:
| void LMSetScrHRes | ( | SInt16 | value | ) |
Availability:
| void LMSetScrVRes | ( | SInt16 | value | ) |
Availability:
| void LMSetTheGDevice | ( | GDHandle | value | ) |
Availability:
| void LMSetWidthListHand | ( | Handle | value | ) |
Availability:
| void LMSetWidthPtr | ( | Ptr | value | ) |
Availability:
| void LMSetWidthTabHandle | ( | Handle | value | ) |
Availability:
| OSErr LockPortBits | ( | GrafPtr | port | ) |
These are Carbon only routines. They do nothing at all on Mac OS 8, but work flawlessly on Mac OS X. LockPortBits()
Availability:
[Mac]CopyRgn()
Availability:
[Mac]EqualRect()
Availability:
[Mac]EqualRgn()
Availability:
[Mac]FillRect()
Availability:
[Mac]FillRgn()
Availability:
| void MacFrameRect | ( | const Rect * | r | ) |
[Mac]FrameRect()
Availability:
| void MacFrameRgn | ( | RgnHandle | rgn | ) |
[Mac]FrameRgn()
Availability:
| CursHandle MacGetCursor | ( | short | cursorID | ) |
[Mac]GetCursor()
Availability:
| Boolean MacGetPixel | ( | short | h, |
| short | v | ||
| ) |
[Mac]GetPixel()
Availability:
| void MacInsetRect | ( | Rect * | r, |
| short | dh, | ||
| short | dv | ||
| ) |
[Mac]InsetRect()
Availability:
| void MacInvertRect | ( | const Rect * | r | ) |
[Mac]InvertRect()
Availability:
| void MacInvertRgn | ( | RgnHandle | rgn | ) |
[Mac]InvertRgn()
Availability:
| void MacLineTo | ( | short | h, |
| short | v | ||
| ) |
[Mac]LineTo()
Availability:
| void MacOffsetRect | ( | Rect * | r, |
| short | dh, | ||
| short | dv | ||
| ) |
[Mac]OffsetRect()
Availability:
| void MacOffsetRgn | ( | RgnHandle | rgn, |
| short | dh, | ||
| short | dv | ||
| ) |
[Mac]OffsetRgn()
Availability:
| void MacPaintRgn | ( | RgnHandle | rgn | ) |
[Mac]PaintRgn()
Availability:
[Mac]PtInRect()
Availability:
| void* MacRegionToNativeRegion | ( | RgnHandle | macRegion | ) |
Availability:
| void MacSetPort | ( | GrafPtr | port | ) |
[Mac]SetPort()
Availability:
| void MacSetRect | ( | Rect * | r, |
| short | left, | ||
| short | top, | ||
| short | right, | ||
| short | bottom | ||
| ) |
[Mac]SetRect()
Availability:
| void MacSetRectRgn | ( | RgnHandle | rgn, |
| short | left, | ||
| short | top, | ||
| short | right, | ||
| short | bottom | ||
| ) |
[Mac]SetRectRgn()
Availability:
[Mac]UnionRect()
Availability:
[Mac]UnionRgn()
Availability:
[Mac]XorRgn()
Availability:
| void MakeITable | ( | CTabHandle | cTabH, |
| ITabHandle | iTabH, | ||
| short | res | ||
| ) |
Availability:
| void MakeRGBPat | ( | PixPatHandle | pp, |
| const RGBColor * | myColor | ||
| ) |
Provides best possible RGB match on current device.
MakeRGBPat generates a pixPat that approximates the requested color. thePpat is the handle of the pixel pattern to create in memory. myColor is the closest match to the requested RGB currently available.
none
MakeRGBPat generates the closest possible color match to the requested RGB, given the current equipment. On a device with 4 bits per pixel, MakeRGBPat will yield 125 possible colors -- as opposed to 16 colors on the same device if you'd just set the foreground color and commenced drawing. MakeRGBPat makes more colors theoretically possible by alternating between four colors in a pattern. While this gives you an increased range of colors, the alternating color selection doesn't allow for a very solid pattern and should be avoided when using elements that are one pixel wide. Each 8-by-8 pattern component is composed of computed colors. Colors are arranged in an RGB pattern as follows (with pattern map boundary always containing (0,0,8,8) and the rowbytes equal to 2: 01 23 Value RGB 0computed RGB color 1computed RGB color 2computed RGB color
| void MapPoly | ( | PolyHandle | poly, |
| const Rect * | srcRect, | ||
| const Rect * | dstRect | ||
| ) |
Scale and reposition a polygon.
MapPoly resizes and repositions a polygon, converting its coordinates by the size-ratio and offset of two rectangles. Use this to scale and reposition a polygon. thePoly is a handle leading to a variable-length Polygon structure. On entry, it describes a polygon within srcRect that you wish to remap. Upon return, all its vertex coordinates have been recalculated relative to the size and position of destRect . srcRect and . . . destRect are the addresses of two 8-byte Rect structures. For typical operations, thePoly is enclosed by srcRect . It gets mapped to a similar position within destRect .
none
Use this function to resize and reposition a polygon that you wish to expand or shrink as you move it from one rectangular area to another (typically smaller or larger) one. srcRect destRect thePoly is expanded or shrunk by the ratio of the sizes of srcRect and destRect. It is moved to a similarly-located position within destRect . This is a purely mathematical operation and has no effect on the screen unless thePoly is subsequently drawn or filled.
Scale and reposition a rectangle.
MapRect maps the corner points of a rectangle, converting them by a size ratio and offset of two other rectangles. Use this to scale or reposition an object that is being moved to a larger or smaller rectangle. theRectis the address of an 8-byte Rect structure. On entry, it describes a rectangle within srcRect that you wish to remap. Upon return, its corner points have been recalculated relative to the size and position of destRect . srcRect and . . . destRect are the addresses of two 8-byte Rect structures. For typical operations, theRect is an element of an object enclosed by srcRect . It gets mapped to a similar position within destRect .
none
Use this function to resize and reposition a rectangle that you wish to expand or shrink as you move it from one rectangular area to another (typically smaller or larger) one. theRect is expanded or shrunk by the ratio of the sizes of srcRect and destRect. It is moved to a similarly-located position within destRect . This is a purely mathematical operation and has no effect on the screen until theRect is subsequently drawn or filled. This call is functionally equivalent to: MapPt( & topleft(theRect), &srcRect, &destRect ); MapPt( & bottomRight(theRect), &srcRect, &destRect );
Availability:
| void Move | ( | short | dh, |
| short | dv | ||
| ) |
the pen relative to its current location
Move moves the pen a specified distance from its current location. It does not perform any drawing. distHoriz is the distance, in pixels, to move the pen horizontally. Positive values move to the right; negative to the left. distVert is the distance, in pixels, to move the pen vertically. Positive values move down; negative move up.
none
MoveTo is functionally identical to: MoveTo ( thePort->pnLoc.h+distHoriz , thePort->pnLoc.v+distVert ); This does not do any drawing. Use Line or LineTo draw as the pen is moved.
| void MoveTo | ( | short | h, |
| short | v | ||
| ) |
Set pen location without drawing.
MoveTo moves the pen to the specified location, in local coordinates. This does no drawing. horizand . . . vertare a location in local coordinates of the current GrafPort .
none
The pen is repositioned at the selected point without performing any drawing. The position is "absolute" as it relates to the origin of the current GrafPort . Use Move to move the pen to a position relative to its current position. Use Line or LineTo to draw a line as the pen is moved.
| pascal short myCommentProc | ( | void | ) |
Set graphProcs field to point to custom routines.
SetStdProcs stores the addresses of the standard Quickdraw procedures into a structure intended to be used in a GrafPort . ll_procs is the address of a 52-byte QDProcs structure. Upon return, all fields of the structure have been set to contain the addresses of the standard low-level routines used by Quickdraw.
none
SetStdProcs is used by applications that want to intercept selected low-level routines (e.g., the picture-comment handler) while continuing to use the other standard routines. Since Quickdraw lives up to its name, most applications won't need to replace its code. If you do wish to install a custom Quickdraw function handler (sometimes called a "bottleneck" routine), follow these steps: •Create a function that accepts the same parameters in the same order as one of Quickdraw's StdXxx functions. •Open a GrafPort (OpenPort or NewWindow ) •Create a standard QDProcs structure by allocating it and then using SetStdProcs to initialize it. •Store the address of your custom procedure into the appropriate field of the QDProcs structure. •Store the address of your QDProcs structure into the grafProcs field of the desired GrafPort . Now, when your application invokes a Quickdraw function that passes through the intercepted bottleneck, your custom handler will get control. You need not replace all the functionality of a bottleneck-you may choose to simply pre-process the parameters passed to you and then invoke the original handler, as illustrated in the following example: Example #include < Quickdraw.h > #define MY_COMMENT 1234 QDProcs myQDProcs; /* uninitialized data structure
| RgnHandle NativeRegionToMacRegion | ( | void * | nativeRegion | ) |
Availability:
| ColorComplementUPP NewColorComplementUPP | ( | ColorComplementProcPtr | userRoutine | ) |
Availability:
| ColorSearchUPP NewColorSearchUPP | ( | ColorSearchProcPtr | userRoutine | ) |
Availability:
| DeviceLoopDrawingUPP NewDeviceLoopDrawingUPP | ( | DeviceLoopDrawingProcPtr | userRoutine | ) |
Availability:
| DragGrayRgnUPP NewDragGrayRgnUPP | ( | DragGrayRgnProcPtr | userRoutine | ) |
Availability:
| GDHandle NewGDevice | ( | short | refNum, |
| long | mode | ||
| ) |
Availability:
| PixMapHandle NewPixMap | ( | void | ) |
Availability:
| PixPatHandle NewPixPat | ( | void | ) |
Availability:
| QDArcUPP NewQDArcUPP | ( | QDArcProcPtr | userRoutine | ) |
Availability:
| QDBitsUPP NewQDBitsUPP | ( | QDBitsProcPtr | userRoutine | ) |
Availability:
| QDCommentUPP NewQDCommentUPP | ( | QDCommentProcPtr | userRoutine | ) |
Availability:
| QDGetPicUPP NewQDGetPicUPP | ( | QDGetPicProcPtr | userRoutine | ) |
Availability:
| QDJShieldCursorUPP NewQDJShieldCursorUPP | ( | QDJShieldCursorProcPtr | userRoutine | ) |
Availability:
| QDLineUPP NewQDLineUPP | ( | QDLineProcPtr | userRoutine | ) |
Availability:
| QDOpcodeUPP NewQDOpcodeUPP | ( | QDOpcodeProcPtr | userRoutine | ) |
Availability:
| QDOvalUPP NewQDOvalUPP | ( | QDOvalProcPtr | userRoutine | ) |
Availability:
| QDPolyUPP NewQDPolyUPP | ( | QDPolyProcPtr | userRoutine | ) |
Availability:
| QDPrinterStatusUPP NewQDPrinterStatusUPP | ( | QDPrinterStatusProcPtr | userRoutine | ) |
Availability:
| QDPutPicUPP NewQDPutPicUPP | ( | QDPutPicProcPtr | userRoutine | ) |
Availability:
| QDRectUPP NewQDRectUPP | ( | QDRectProcPtr | userRoutine | ) |
Availability:
| QDRgnUPP NewQDRgnUPP | ( | QDRgnProcPtr | userRoutine | ) |
Availability:
| QDRRectUPP NewQDRRectUPP | ( | QDRRectProcPtr | userRoutine | ) |
Availability:
| QDStdGlyphsUPP NewQDStdGlyphsUPP | ( | QDStdGlyphsProcPtr | userRoutine | ) |
Availability:
| QDTextUPP NewQDTextUPP | ( | QDTextProcPtr | userRoutine | ) |
Availability:
| QDTxMeasUPP NewQDTxMeasUPP | ( | QDTxMeasProcPtr | userRoutine | ) |
Availability:
| RegionToRectsUPP NewRegionToRectsUPP | ( | RegionToRectsProcPtr | userRoutine | ) |
Availability:
| RgnHandle NewRgn | ( | void | ) |
Availability:
| The third line above correctly adjusts for the required word alignment Example OffScreenDraw | ( | short | rWide, |
| short | rHigh, | ||
| Rect | rDest | ||
| ) |
Assigns a new bit map to the active GrafPort.
SetPortBits replaces the portBits field of the active GrafPort with a new value, effectively changing the entire contents of the port.
none
SetPortBits is useful for performing off-screen drawing. For instance, you can use a series of Quickdraw calls to create an image in an off-screen memory buffer, then use CopyBits to copy the bit-mapped image into the normal screen. Be sure that newBitMap is fully prepared before using this call; that is, the memory for the bit-image has been allocated and the baseAddr , rowBytes , and bounds fields have been set up. Note that BitMap.rowBytes must be an even number and that it must be as large or larger, in bits, than the width of the BitMap.bounds. The total amount of memory needed for the off-screen bitMap is the product of the height of the rectangle times the bytes-per-row. Here's a formula that performs the calculation: rectHigh = bounds.bottom - bounds.top; rectWide = bounds.right - bounds.left; rowBytes = ((rectWide -1) / 16) + 1) * 2; buffSize = rowBytes * rectHigh; /* size in bytes
Change height and width of current GrafPort
PortSize modifies the width and height of the current GrafPort 's portRect . It is normally called by the Window Manager for window-sizing functions. newWidth and . . . newHeight are the desired width and height for the portRect.
none
This is a simple way to extend the size of the current port's portRect - the active area of the current GrafPort . The portRect.top and portRect.left fields stay the same. The portRect.right and portRect.bottom change to reflect the desired newWidth and newHeight . Note that this does not affect other fields of the GrafPort ; drawing continues to be clipped to the intersection of portRect , visRgn, and clipRgn.
Change position of top-left corner of portRect
MovePortTo repositions the portRect of the current GrafPort . It is used by the Window Manager to reposition windows. leftGlobal and . . . topGlobal are the desired coordinates for the top and left fields of the GrafPort 's portRect .
none
This changes the position at which subsequent drawing will appear for the active GrafPort . It effectively moves the active area of the GrafPort by adding offsets to all fields of the portRect such that the top-left corner is moved to the global coordinate pair leftGlobal , topGlobal . The height and width of the portRect remain the same and the local coordinate system is not changed. As with PortSize , this does not affect other fields of the GrafPort ; drawing continues to be clipped to the intersection of portRect , visRgn, and clipRgn. Unlike SetOrigin , this has no effect on the local coordinate system. It moves the port to a different part of the BitMap.
SetOrigin()
Availability:
SetClip()
Availability:
GetClip()
Availability:
ClipRect()
Availability:
BackPat()
Availability:
Initialize cursor to the standard arrow
InitCursor sets the cursor shape to the standard arrow cursor and sets the cursor level to 0, making it visible. It is normally called once, in the early part of a program.
none
The 68-byte Cursor structure for the standard arrow cursor can be found in the Quickdraw data area. Its symbolic name is arrow.
[Mac]SetCursor()
Availability:
\brief Remove the mouse cursor from the screen <pre>
Each use of HideCursor must be balanced with a subsequent call to ShowCursor . This call decrements the cursor level: the cursor level is set to 0 when you call InitCursor , and is decremented by each call to HideCursor and incremented by each call to ShowCursor . It is visible only when the cursor level is at 0. An alternative to this call, ShieldCursor , hides the cursor only if it is currently positioned within a specified rectangle. A related function, ObscureCursor , hides the cursor until the mouse is moved.
[Mac]ShowCursor()
Availability:
Hide cursor until mouse moves
\brief Make subsequent pen motion invisible <pre>HidePen decrements the "pen level". If the level is set to a value other than
0, the pen is hidden and subsequent draw operations are not visible.
none
HidePen manipulates the pnVis field of the current GrafPort . Using HidePen decrements the field and ShowPen increments it. When pnVis is not equal 0, then the pen is hidden and drawing functions ( LineTo, FrameRect , etc.) do not affect the BitMap. The pnVis field is set to 0 when the GrafPort is initialized. The decrement/increment system makes it easy to nest drawing functions. Always balance a HidePen call with ShowPen , and vice versa. You can get the current "pen level" by reading the field directly from the GrafPort structure. Note that it is not a Boolean field; the pen is visible only when pnVis==0. The OpenRgn , OpenPicture , and OpenPoly functions automatically call HidePen so, by default, subsequent drawing activities are hidden.
\brief Balance a previous HidePen ; make pen visible <pre>HidePen decrements the field and ShowPen increments it. When the
pnVis field is not equal 0, the pen is hidden and drawing functions ( LineTo, FrameRect , etc.) do not affect the bitMap. The pnVis field is set to 0 (visible) when the GrafPort is initialized. The decrement/increment system makes it easy to nest drawing functions. Always balance a HidePen call with ShowPen , and vice versa. You can get the current "pen level" by reading the pnVis field directly from the GrafPort structure. Note that it is not a Boolean field; the pen is visible only when pnVis == 0. The CloseRgn , ClosePicture , and ClosePoly functions automatically call ShowPen to balance the previous automatic call to HidePen .
\brief Obtain current pen position <pre>GetPen obtains the current pen position, in local coordinates.
penPtis the address of a 4-byte Point structure. Upon return, it will contain the pen position of the current GrafPort , in local coordinates.
none
This stores the Point into a local variable, e.g.: PointthePt; GetPen( &thePt ); You can obtain this and other pen-related information via GetPenState . You can position the pen via MoveTo .
\brief Obtain current location, size, and mode of pen <pre>GetPenState fills a structure with pen-related information, including the
pen location, size, transfer mode, and pattern. It is useful in writing nested drawing functions. thePnState is the address of an 18-byte PenState structure. Upon return, the structure is filled with information about the pen of the current GrafPort .
none
The PenState structure receives information copied directly from the current GrafPort ; pnLoc, pnSize, pnMode, and pnPat. Nested drawing procedures can use this function to obtain the current status of the pen, in order to restore the state later. This may be coupled with ShowPen ...HidePen to fully implement invisible nesting. Example #include < Quickdraw.h > DrawSomething() { PenState savePenState; GetPenState ( &savePenState ); /* save current state
| void OffsetPoly | ( | PolyHandle | poly, |
| short | dh, | ||
| short | dv | ||
| ) |
Move a polygon.
OffsetPoly modifies a polygon's definition, moving it in any direction on the coordinate plane. Note that this does not have any visible effect on the screen, until such time as the polygon is drawn or filled. thePoly is a handle leading to a variable-length Polygon structure. It is typically a value obtained via OpenPoly . distHoriz specifies the horizontal distance, in pixels, to move the polygon. Positive values move to the right; negative to the left. distVert specifies the vertical distance, in pixels, to move the polygon. Positive values move downward; negative upward.
none
The polygon retains its shape and size. Use MapPoly to shrink or expand the polygon. This is an especially efficient operation, since it changes only the value in the polyBBox field of the Polygon structure; all endpoints that make up the bulk of the data are stored relative to first point.
| void OpColor | ( | const RGBColor * | color | ) |
Set RGB values used by addPin, subPin and blend modes.
OpColor sets the red, green, and blue values used by addPin, subPin, and blend modes. RGBColor is a record type which specifies a color's red, green, and blue components as 16-bit unsigned integers.
none
This sets drawing mode color values, which are stored in the grafVars handle in the CGrafPort . This procedure will have no effect unless the current port is a cGrafPort.
| PicHandle OpenCPicture | ( | const OpenCPicParams * | newHeader | ) |
Availability:
| void OpenCPort | ( | CGrafPtr | port | ) |
Availability:
| OSErr OpenCursorComponent | ( | Component | c, |
| ComponentInstance * | ci | ||
| ) |
Availability:
Availability:
| PolyHandle OpenPoly | ( | void | ) |
Availability:
| void OpenPort | ( | GrafPtr | port | ) |
Availability:
| void OpenRgn | ( | void | ) |
Availability:
| void PaintArc | ( | const Rect * | r, |
| short | startAngle, | ||
| short | arcAngle | ||
| ) |
Availability:
| void PaintOval | ( | const Rect * | r | ) |
Availability:
| void PaintPoly | ( | PolyHandle | poly | ) |
Availability:
| void PaintRect | ( | const Rect * | r | ) |
Availability:
| void PaintRoundRect | ( | const Rect * | r, |
| short | ovalWidth, | ||
| short | ovalHeight | ||
| ) |
Availability:
| void PenMode | ( | short | mode | ) |
Set the graphics pen pattern transfer mode.
PenMode selects the pattern transfer mode to be used in pen drawing and painting operations. newPnMode is a short and may be one of the following constants defined in Quickdraw.h : patCopy 8overwrite background entirely patOr9overwrite where pattern is black patXor10invert where pattern and bkgd are both black patBic11force white where pattern is black notPatCopy 12invert pattern, then patCopy notPatOr 13invert pattern, then patOr notPatXor 14invert pattern, then patXor notPatBic 15invert pattern, then patBic
none
This function modifies the pnMode field of the current GrafPort structure. It affects all drawing operations such as LineTo and FrameRect , as well as painting operations such as PaintOval , PaintRoundRect , etc. See Transfer Modes for a graphic depiction of the effect of the various pen modes. You can obtain the current setting by accessing the pnMode field of a GrafPort : curPnMode = thePort->pnMode; This function does not affect how text is drawn. Use TextMode to modify the text-drawing pen's transfer mode.
| void PenNormal | ( | void | ) |
Availability:
| void PenPat | ( | const Pattern * | pat | ) |
Availability:
| void PenPixPat | ( | PixPatHandle | pp | ) |
Availability:
| void PenSize | ( | short | width, |
| short | height | ||
| ) |
Set dimensions of pen for current GrafPort.
PenSize selects the height and width, in pixels, of the graphics pen for the current GrafPort . The initial pen size is (1,1). wideand . . . highare the desired width and height of the pen. A setting of (0,0) - or setting either parameter less than 0 - makes the pen invisible
none
The wide and high values are stored in pnSize field of the current GrafPort structure, except that if either value is less than 0, then both parts of pnSize are set to 0, making the pen invisible. You can also set the pen size and other pen-related parameters via the SetPenState function. You can may obtain the size of the pen by accessing the pnSize field of the current GrafPort ; e.g.: short width, height; width = thePort -> pnSize.h; height = thePort -> pnSize.v; You can obtain this and related information via GetPenState .
| void PicComment | ( | short | kind, |
| short | dataSize, | ||
| Handle | dataHandle | ||
| ) |
Availability:
| void ProtectEntry | ( | short | index, |
| Boolean | protect | ||
| ) |
Protect or un-protect color table entry.
ProtectEntry is used by the Color Manager to provide protection or remove protection from a color table entry. indexis the identification of the entry to be affected by this procedure. protectFlag specifies whether to protect the entry or remove its protection . It must be one of: FALSEremove protection from any specified entry TRUEprotect entry, returns a protection error if entry is already protected.
none
Once an entry is protected, other clients cannot affect it.
Availability:
Find smallest rectangle enclosing two points.
Pt2Rect determines the coordinates of the smallest rectangle that will enclose the pixels represented by two points. pt1and . . . pt2are any two 4-byte Point structures. resultRect is the address of an 8-byte Rect structure. Upon return it will contain the coordinates of a rectangle that encloses pt1 and pt2 .
none
If pt1 or pt2 have the same horizontal or vertical coordinate resultRect is set to the empty rectangle (0,0)(0,0). The points may be in any order. The points are stored into the correct part of the Rect structure; i.e., the highest vertical coordinate of either point is stored as resultRect.top, and so forth.
Availability:
Availability:
Availability:
Obtain angle between point and rectangle center.
PtToAngle determines an angular measure between the vertical center of a rectangle and a specified point. theRectis the address of an 8-byte Rect structure. thePtis a point, in the same coordinate system as theRect . angleis the address of an integer. Upon return, it will contain an angle measured from a line extending from the center of theRect to the middle of its top line. See the diagram, below.
none
This can be used to obtain an angle value for use in any of the arc paint and fill functions that require an angle parameter. The angle is not a true mathematical angle in circular degrees; as with arc and wedge functions, all angles are based on the corners of a rectangle as shown: Thus, the angles are distorted to match the shape of the rectangle. For instance: In the figures, both "angles" are 45 °, even though the one on the right is
Availability:
Availability:
| OSStatus QDBeginCGContext | ( | CGrafPtr | inPort, |
| CGContextRef * | outContext | ||
| ) |
Summary: Allow CoreGraphics drawing in a CGrafPort
Discussion: So far, CreateCGContextForPort() was used to create a CGContext for CG drawing from a CGrafPort. However, if the current port is a printing port, the CreateCGContextForPort fails; consequently, there was no way to mix Quickdraw and CoreGraphics drawing and still print it. If, instead, the CoreGraphics drawing is bracketed by QDBeginCGContext/QDEndCGContext calls, the drawing will also appear in print. There are some restrictions on the usage of QDBeginCGContext/QDEndCGContext:
Parameters:
inPort: The current port
outContext: The CGContextRef to be used for CG drawing
Availability:
| void QDDisplayWaitCursor | ( | Boolean | forceWaitCursor | ) |
In Mac OS X, developers should be able to turn the WaitCursor (spinning wheel) on and off. QDDisplayWaitCursor() keeps track of nested calls. Passing FALSE will resume automatic wait cursor operation. Call this function only from an application in the foreground. QDDisplayWaitCursor()
Availability:
| OSStatus QDDisposeRegionBits | ( | QDRegionBitsRef | regionBits | ) |
Availability:
| OSStatus QDEndCGContext | ( | CGrafPtr | inPort, |
| CGContextRef * | inoutContext | ||
| ) |
Availability:
| short QDError | ( | void | ) |
Return error result from last QuickDraw call.
The QDError function, introduced with Color QuickDraw returns the error result from the last Color QuickDraw or Color Manager call. It has a number of new result codes, and it has also been modified so that it does not fail on a black-and-white system (where it always returns FALSE). Its format is the same:
the error result from the last Color QuickDraw or Color Manager call
QuickDraw uses stack space for work buffers. For complex operations such as depth conversion, dithering, and image resizing, stack space may not be sufficient. Color QuickDraw now attempts to get temporary memory from other parts of the system. If that is still not enough, QDError returns this code: mfStackErr (-149)Insufficient stack If your application receives this result code, divide the operation-for example, divide the image into left and right halves-and try again. When you record drawing operations in an open region, the resulting region description may overflow the 64 KB limit. Should this happen, QDError returns -147. regionTooBigError (-147)Region too big or complex Since the resulting region is potentially corrupt, the closeRgn procedure returns an empty region if it detects QDError has been set to -147. A similar error can occur during conversion of a bitmap to a region. rgnTooBigErr (-500)Bitmap would convert to a region greater than 64 KB The BitMapToRegion function can also generate an error if a pixel map is supplied that is greater than 1 bit per pixel. pixmapTooDeepErr (-148)Pixel map record is deeper than 1 bit per pixel You may be able to recover from this problem by imaging your too-deep pixel map into a 1-bit pixel map and calling BitMapToRegion again.
Availability:
Availability:
| void QDGetPatternOrigin | ( | Point * | origin | ) |
Summary: Returns the pattern origin of the current port.
Parameters:
origin: On exit, contains the current port's pattern origin.
Availability:
Availability:
Routines available on Mac OS X to flush buffered window ports... These calls do nothing on Mac OS 8/9. QDIsPortBuffered will always return false there. QDIsPortBuffered()
Availability:
| OSStatus QDRegionToRects | ( | RgnHandle | rgn, |
| QDRegionParseDirection | dir, | ||
| RegionToRectsUPP | proc, | ||
| void * | userData | ||
| ) |
Availability:
| OSStatus QDRestoreRegionBits | ( | RgnHandle | region, |
| QDRegionBitsRef | regionBits | ||
| ) |
Availability:
| QDRegionBitsRef QDSaveRegionBits | ( | RgnHandle | region | ) |
Availability:
Availability:
| void QDSetPatternOrigin | ( | Point | origin | ) |
Summary: Sets the pattern origin for the current port.
Discussion: When a QuickDraw drawing operation uses a pattern (either a black&white pattern or a PixPat), the pattern's image is aligned with port origin, modified by the pattern origin of the port. For example, if the background pattern is a 10x10 image, and a rectangle with coordinates (3, 3, 10, 10) is filled with that pattern, then only the bottom right 7x7 portion of the pattern image will be drawn into the rectangle. When drawing a pattern, QuickDraw always starts with the port origin and then adjusts it by the pattern origin to determine the actual origin point of pattern drawing. QDSetPatternOrigin can be used to set the pattern origin relative to the port origin. It is often used in conjuction with SetOrigin to maintain the pattern alignment at (0,0) in a window's content area, regardless of the port origin; for example, after changing the port's origin to (10,10), an application might change the port's pattern origin to (-10, -10) so that patterns are still aligned with the window's content area.
Parameters:
origin: The new pattern origin of the port.
Availability:
Availability:
Availability:
Check if a rectangle intersects a region.
RectInRgn returns an indication of whether any pixel enclosed by a specified rectangle intersects with a specified region. theRectis the address of an 8-byte Rect structure, defined in local or global coordinates. theRgnis a handle to a region. It should be defined in the same coordinate system as theRect .
a Boolean value indicating whether the rectangle intersects with the region. It is one of: FALSENo intersection TRUEAt least one pixel is in both areas
Remember that the outlines of theRect and theRgn are infinitely thin, so just sharing a line or point does not constitute an intersection. This returns TRUE when a pixel (the dot below and to the right of the point coordinates) is enclosed by both areas. An error in the early ROMs occasionally causes this function to incorrectly return TRUE when the enclosing coordinates overlap (even though they do not share any pixels). You may need to convert the rectangle to a region (RectRgn ) and intersect the regions ( SectRgn ) to be real sure of the answer here. Later versions of the ROMs work correctly.
Availability:
| void ReserveEntry | ( | short | index, |
| Boolean | reserve | ||
| ) |
Reserve or dereserve color table entry.
ReserveEntry is used by the Color Manager to provide selective protection or remove reservation from a color table entry. indexis the identification of the entry to be affected by this procedure. ReserveFlag specifies whether to reserve the entry or remove its reservation . It must be one of: FALSEdereserve any specified entry TRUEReserve an entry so another client's search procedure won't be able to match it and it won't be returned to another client by Color2Index , RGBForeColor , RGBBackColor , etc.
none
ReserveEntry acts like selective protection by copying the low byte of gdID into the low byte of colorSpec .value while leaving the high byte alone. It won't allow changes if the current gdID is different than the one in the colorSpec .value field of the reserved entry. Returns a protection error if a requested match is already reserved. All entries are subject to being dereserved.
| void RestoreEntries | ( | CTabHandle | srcTable, |
| CTabHandle | dstTable, | ||
| ReqListRec * | selection | ||
| ) |
Sets entries into dstTable without rebuilding inverse table.
RestoreEntries saves selected entries so you can put them back later scrTable is the source of the entries to be saved. dstTable is the table in which the restorable entries are placed. selection is the parameter enumerating the entries for saving and retrieval.
none
RestoreEntries lets you change the color table without changing its ctSeed. You can then execute an application and restore the original colors. What may happen, however, is that the background will be in the wrong color after restoration since it is not redrawn. Getting around this means having the application build its own new inverse table and redrawing the background colors. That, in turn, means that the ctSeed would have to be explicitly changed. The dstTable entries are listed in the selection parameter (see ReqListRec ) and the source and selection are assumed to have the same number of entries. If a requested entry can't be found, its position on the list is set to colReqErr and an error is returned. A NIL for dstTable updates the gDevice's color table (as will a pointer to the device color table), which updates the hardware to the new colors. The seed doesn't change and the results are valid but the RGBForeColor may change. RestoreEntries ignores color table protection and reservation. Since Palette Manager was designed to give applications their own set of colors, you'll likely have little need for RestoreEntries .
| void RGBBackColor | ( | const RGBColor * | color | ) |
Availability:
| void RGBForeColor | ( | const RGBColor * | color | ) |
Availability:
| void RgnToHandle | ( | RgnHandle | region, |
| Handle | flattenedRgnDataHdl | ||
| ) |
Availability:
| void SaveEntries | ( | CTabHandle | srcTable, |
| CTabHandle | resultTable, | ||
| ReqListRec * | selection | ||
| ) |
Saves selected entries to a result table.
SaveEntries saves selected entries from a source table to a result table scrTable is the source of the entries to be saved. ResultTable is the table in which the saved entries are placed. selection is the parameter enumerating the entries to be saved.
none
If an entry is missing from the source table, its position on the request list part of the ReqListRec data structure is set to colReqErr , and that position of the result table has random values returned. When an entry can't be found, an error is posted to QDError , but every entry that is found yields valid values in the result table. The source table and the selection parameter are always assumed to have the same number of entries. You can have a NIL as the source table parameter but if you do, the active gDevice's color table is used as the source. SaveEntries ' output is identical to RestoreEntries ' input.
Resize coordinate pair to ratio of two rectangles.
ScalePt converts each coordinate of a point to a value calculated as the ratio of the sizes of two rectangles. You could use this function to scale an object (such as a pen size or a character rectangle) to match the size of a smaller or larger window. thePoint is the address of the point to convert. Upon return, its horizontal coordinates has been scaled by the ratio of the two rectangles' widths and the vertical coordinates has been scaled relative to the heights. It will never be set less than (1,1). numerRect and . . . denomRect are addresses of rectangles. Their location is irrelevant; their widths and heights are used to calculate ratios, which are applied to the coordinates of thePoint .
none
Since a point is an undimensional object, you can't really scale it. The ScalePt function treats thePoint as if it were the bottom-right corner of a rectangle whose top-left corner is at (0,0). That imaginary rectangle is scaled to the ratio of numerRect divided by denomRect . This call is functionally equivalent to: numerWide = numerRect.right - numerRect.left; denomWide = denomRect.right - denomRect.left; numerHigh = numerRect.bottom - numerRect.top; denomHigh = denomRect.bottom - denomRect.top; thePoint.h = (thePoint.h * numerWide) / denomWide; thePoint.v = (thePoint.v * numerHigh) / denomHigh; Note: thePoint will never be set smaller than (1,1). Use MapPt to perform the more common operation of finding the coordinates of a point inside one rectangle that corresponds to a similarly-located point within another.
| An alternative method is to convert shieldRect to global and pass (0, 0) as offsetPt.</ pre> * @par Copyright void ScreenRes | ( | short * | scrnHRes, |
| short * | scrnVRes | ||
| ) |
Obtain screen resolution in pixels-per-inch.
ScreenRes lets you obtain the screen resolution in pixels-per-inch. It can be useful in scaling objects to make maximum use of the screen real estate. horizPPI and . . . vertPPI are the addresses of a 16-bit integers. Upon return, they will contain the screen resolution, expressed in pixels-per-inch.
none
This function just copies the values of the low-memory variables ScrHRes and ScrVRes to your own variables. The addresses of these variables are defined in Quickdraw.h. Thus, ScreenRes is functionally equivalent to: horizPPI = ScrHRes; vertPPI = ScrVRes; A more-often needed value is the total size of the screen, in pixels. Obtain that by reading the bounds field from the screenBits BitMap: horizPixels = screenBits .bounds.right; vertPixels = screenBits .bounds.bottom; The global variable, GrayRgn (a RgnHandle ) describes the size and shape of the desktop. This is especially handy to take advantage of Macs that have more than one screen.
Availability:
Get the intersection of two rectangles; check for overlap.
| *rect1 | addresses of two Rect ... |
| *rect2 | ... structures to intersect SectRect checks to see if two rectangles share any points in common and obtains the coordinates of the intersecting rectangle rect1and . . . rect2are addresses of two 8-byte Rect structures. They should use the same coordinate system. resultRect is the address of a third Rect structure. Upon return, it will contain the coordinates of the intersection of rect1 and rect2 . If rect1 and rect2 share no common points, this returns as the empty rectangle (0,0)(0,0). |
a Boolean value indicating whether or not rect1 and rect2 share any common points. It is one of: FALSENo overlap TRUESome overlap; resultRect is non-empty.
The figures below illustrate: In the figure on the left, the intersection of rectangles A and B is shown in black, labeled as rectangle C. The call to SectRect will return TRUE, and resultRect will contain the coordinates of rectangle C. The figure on the right illustrates an important concept: a shared border or a single shared point are not considered as part of the mathematical intersection of two rectangles. Rectangles D and E are right next to each other and share a common border. However, their "overlap" area is a single mathematical line, enclosing no bits of the bitMap. The call to SectRect would return FALSE, and resultRect would be set to (0,0)(0,0). It is OK to specify resultRect as the same rectangle as either of rect1 or rect2 . For instance, the following line would find the intersection of rectangles A and B, and store its coordinates into rectangle A, overwriting the original value. SectRect ( &rA, &rB, &rA );
Availability:
| void SeedCFill | ( | const BitMap * | srcBits, |
| const BitMap * | dstBits, | ||
| const Rect * | srcRect, | ||
| const Rect * | dstRect, | ||
| short | seedH, | ||
| short | seedV, | ||
| ColorSearchUPP | matchProc, | ||
| long | matchData | ||
| ) |
Calculate a mask for use in CopyMask or CopyBits.
| matchProc | pointer to match seed RGB values SeedCFill examines a portion of a source bitMap or pixMap and fills a portion of a destination bitMap or pixMap with 1s where paint can flow. It finds an enclosed area surrounding a specified point in the source (seed), and floods that area in the destination with 1s (RGB value equals that of seed). Use this function as one step in implementing a "paint bucket" tool. srcMap is the address (srcBits) of a rectangle inside a bitMap or pixMap data area. SeedCFill examines this rectangle as it floods portions of the destination bitMap. destMap is the address (destBits) of a rectangle inside a bitMap or pixMap data area. SeedCFill fills all or part of this rectangle with 1s. srcRect and . . . destRect are the rectangles within the BitMap or PixMap into which srcMap and destMap, respectively point; i.e., the function will add this value to its current address pointer to move "down one line" in the bitMap. seedH and... seedV identify the point to start flooding. matchProc returns 0s for RGB values to be filled -- returns 1s when the values should not be filled. matchData returns the value assigned. |
none
The default setting for SeedCFill allows paint to flow from the seed position to all positions that touch it and whose RGB value equals that of the seed. Setting matchProc and matchData to zero calls the default mode. Use SeedCFill to flood an area of a destination bitMap pixMap with paint (i.e., 1s) in the exact color of the source. The flooded area will match the inside and boundary of a section of the source which is enclosed by RGB pixels. To flood with some other pattern requires intermediate steps of using
| void SeedFill | ( | const void * | srcPtr, |
| void * | dstPtr, | ||
| short | srcRow, | ||
| short | dstRow, | ||
| short | height, | ||
| short | words, | ||
| short | seedH, | ||
| short | seedV | ||
| ) |
Calculate a mask for use in CopyMask.
| srcPtr | address within a BitMap of place to start calculating |
| destPtr | address within a BitMap of where to store 1s and 0s SeedFill examines a portion of a source bitmap and fills a portion of a destination bitMap with 1s. It finds an enclosed area surrounding a specified point in the source, and floods that area in the destination (as in the lasso tool of many paint programs) with 1s (black paint). Use this function as one step in implementing a "paint bucket" tool. srcPtris the address of a 16-bit word inside a bitMap data area. SeedFill will use this as if it were the upper left corner of a rectangle, as defined by height and wrdsWide . It will examine this implied rectangle as it floods portions of the destination bitMap. destPtris the address of a 16-bit word inside a bitMap data area. SeedFill will use this as if it were the upper left corner of a rectangle, as defined by height and wrdsWide . It will fill all or part of this "rectangle" with 1s. Note: Both srcPtr and destPtr must point to even (word) addresses. srcRowBytes and . . . destRowBytes are the widths of the BitMap into which srcPtr and destPtr, respectively point; i.e., the function will add this value to its current address pointer to move "down one line" in the bitMap. heightis the height, in pixels, of both the source data area and the destination area. wrdsWide is the width, in 16-bit words , of both the source and destination data area. seedH and... seedVidentify the point to start flooding. These are offsets, in pixels, from the boundary of the implied rectangle defined by srcPtr , height, and wrdsWide . |
none
Use SeedFill to flood an area of a destination bitMap with black paint (i.e., 1s). The flooded area will match the inside and boundary of a section of the source that is enclosed by black pixels. Note that destPtr and srcPtr
| void SetCCursor | ( | CCrsrHandle | cCrsr | ) |
Availability:
| void SetClientID | ( | short | id | ) |
Identify this client to search and complement procedures.
SetClientID sets the gdID field in the device record so that its search and complement procedures will recognize this particular client program. idis the client program being given identification
none
| void SetCPixel | ( | short | h, |
| short | v, | ||
| const RGBColor * | cPix | ||
| ) |
Availability:
| OSErr SetCursorComponent | ( | ComponentInstance | ci | ) |
Availability:
SetDeviceAttribute Set the device's display characteristics.
Use SetDeviceAttribute to set a device's display characteristics. This routine is rarely called by applications. gdhis the handle that communicates with the gDevice record. attribute is one of seven graphics device characteristics that can be on or off. valueis a Boolean value that indicates whether the specified attribute is set (TRUE) or not (FALSE) as follows: gdDevType: TRUE = Color; FALSE = Monochrome ramInit: TRUE = Device initialized from RAM mainScreen: TRUE = Device is startup screen allInit:TRUE = Device initialized from 'scrn' resource (see below) screenDevice: TRUE = Device is a display monitor noDriver: TRUE = No driver for device screenActive: TRUE = Active device
none For more information, see The 'scrn' Resource .
| void SetEmptyRgn | ( | RgnHandle | rgn | ) |
Availability:
| void SetEntries | ( | short | start, |
| short | count, | ||
| CSpecArray | aTable | ||
| ) |
Set a group of color table entries for the current gDevice.
SetEntries sets the enumerated color table entries for the current gDevice. startis the given position where the specified number of entries begin. count yields the total number of color table entries in the group being set. aTableis a cSpecArray, not a color table
none
SetEntries sets many color table entries to the current gDevice. Its aTable parameter points to a cSpecArray (rather than a color table) in which the colorSpec .value field of the entries has to fall within the logical range for the gDevice's assigned pixel depth. For example, if the gDevice lists a 4-bit pixel size, the colorSpec .value fields must be in the 1 to 15 range and, if the device has 8-bit pixels, the colorSpec .value fields range from 0 to 255. All values are zero-based so setting three entries means that you pass a 2 in the count parameter. Since SetEntries lists its positional information in terms of logical space instead of memory locations as used by the gDevice, specifying a color table change won't necessarily get you a change in the hardware's color table--but it will be correctly reflected in the colors on the screen. There are actually two SetEntries modes-- index mode and sequence mode. For the latter, the distinguishing characteristic is a specified start position and a length. Index mode SetEntries , on the other hand, leave the specifying of where the data will be installed up to the cSpecArray (which handles such chores on an individual basis for each entry). While sequence mode loads new colors in the same order they appear in the aTable, with clientID fields for changed entries copied from the gDevice's gdID field, index mode installs each entry based on a position specified by its colorSpec .value field in the cSpecArray . Then, in the gDevice's color table, all changed entries' colorSpec .value fields get the gdID value. You initiate the index mode by passing -1 for the start position, with a valid count and pointer to the cSpecArray . Changing a color table entry invalidates all cached fonts as well as the seed number, meaning that the inverse table will be rebuilt by the next drawing operation. If any requested entry is protected or out of range, you get a protection error and nothing else. If a requested entry is reserved, the gDevice's gdID has to match the low byte of the intended colorSpec .value
| void SetGDevice | ( | GDHandle | gd | ) |
Set the current device to the specified device.
SetGDevice sets the specified graphics device record as the current device. Your application won't generally need to use this procedure except to draw offscreen graphics devices.
| void SetPenState | ( | const PenState * | pnState | ) |
Set the pen location, size, pattern and mode.
SetPenState sets the location, size, pattern and transfer mode of the pen of the current GrafPort . It is typically used to restore the pen characteristics after they were saved via a prior call to GetPenState .
none
You can reset the pen characteristics to their initial state via PenNormal .
| OSErr SetPortCustomXFerProc | ( | CGrafPtr | port, |
| CustomXFerProcPtr | proc, | ||
| UInt32 | flags, | ||
| UInt32 | refCon | ||
| ) |
Availability:
| void SetPortPix | ( | PixMapHandle | pm | ) |
Replaces a portPixMap of the active CGrafPort with a handle.
SetPortPix replaces the portPixMap field of the active CGrafPort with a new value, effectively changing the entire contents of the port.
none
This is the Color Quickdraw equivalent of the SetPortBits procedure that QuickDraw uses on GrafPorts. SetPortPix cannot be used at all on old-style GrafPort s. Conversely, a SetPortBits call used in conjunction with a cGrafPort , will likewise yield nothing. Like its predecessor, SetPortPix is useful for performing off-screen drawing. For instance, you can use a series of Color Quickdraw calls to create an image in an off-screen memory buffer, then use CopyBits to copy the bit-mapped image into the normal screen.
| void SetPt | ( | Point * | pt, |
| short | h, | ||
| short | v | ||
| ) |
Pack horizontal and vertical coordinates into Point.
SetPt stores two coordinate values into a Point structure. thePoint is the address of a 4-byte Point structure. Upon return, it will contain the coordinates specified by horiz and vert . horizand . . . vertare coordinate values, ranging from -32767 to 32767. Negative values are upward and toward the left; positive values are downward and toward the right.
none
SetPt is functionally equivalent to the faster: thePoint-> h = horiz; thePoint-> v = vert;
| void SetStdCProcs | ( | CQDProcs * | procs | ) |
Set graphProcs field to point to custom routines.
SetStdCProcs stores the addresses of the standard Quickdraw procedures into a structure intended to be used in a CGrafPort . cProcsis the address a CQDProcs structure. Upon return, all fields of the structure have been set to contain the addresses of the standard low-level routines used by Color Quickdraw.
none
This is used by applications that wish to intercept selected low-level routines (e.g., the picture-comment handler) while continuing to use the other standard routines. SetStdCProcs has to be used in place of the older SetStdProcs whenever your application is drawing in a cGrafPort . Most applications won't need to replace code. If you do wish to install a custom Color Quickdraw function handler (sometimes called a "bottleneck" routine), follow these steps: •Create a function which accepts the same parameters in the same order as one of Color Quickdraw's StdXxx functions. •Open a CGrafPort (OpenCPort or NewCWindow ). •Create a standard CQDProcs structure by allocating it and then using SetStdCProcs to initialize it. •Store the address of your custom procedure into the appropriate field of the CQDProcs structure. •Store the address of your CQDProcs structure into the cGrafProcs field of the desired CGrafPort . Now, when your application invokes a Color Quickdraw function that passes through the intercepted bottleneck, your custom handler will get control. You need not replace all the functionality of a bottleneck -- you may choose to simply pre-process the parameters passed to you and then invoke the original handler.
Availability:
| void StdArc | ( | GrafVerb | verb, |
| const Rect * | r, | ||
| short | startAngle, | ||
| short | arcAngle | ||
| ) |
Availability:
| void StdBits | ( | const BitMap * | srcBits, |
| const Rect * | srcRect, | ||
| const Rect * | dstRect, | ||
| short | mode, | ||
| RgnHandle | maskRgn | ||
| ) |
Availability:
| void StdComment | ( | short | kind, |
| short | dataSize, | ||
| Handle | dataHandle | ||
| ) |
Availability:
| void StdGetPic | ( | void * | dataPtr, |
| short | byteCount | ||
| ) |
The default Quickdraw picture-retrieving routine.
| destPtr | where to store the picture definition data |
Use StdGetPic only if your applicatin intercepts the Quickdraw bottleneck routines (see SetStdProcs ). This is a bottleneck routine that is frequently intercepted by application programs. By creating a custom version of StdGetPic and StdPutPic that is able to access a disk file, you can store and retrieve pictures larger than the maximum limits set by Quickdraw.
| void stdline | ( | const Point * | newPt | ) |
Availability:
| void StdLine | ( | Point | newPt | ) |
Availability:
Availability:
| void StdOval | ( | GrafVerb | verb, |
| const Rect * | r | ||
| ) |
Availability:
| void StdPoly | ( | GrafVerb | verb, |
| PolyHandle | poly | ||
| ) |
Availability:
| void StdPutPic | ( | const void * | dataPtr, |
| short | byteCount | ||
| ) |
Availability:
| void StdRect | ( | GrafVerb | verb, |
| const Rect * | r | ||
| ) |
Availability:
| void StdRgn | ( | GrafVerb | verb, |
| RgnHandle | rgn | ||
| ) |
Availability:
| void StdRRect | ( | GrafVerb | verb, |
| const Rect * | r, | ||
| short | ovalWidth, | ||
| short | ovalHeight | ||
| ) |
Availability:
| void stuffhex | ( | void * | thingPtr, |
| const char * | s | ||
| ) |
Availability:
| void StuffHex | ( | void * | thingPtr, |
| ConstStr255Param | s | ||
| ) |
Convert a string of hex digits to binary data.
| destPtr | generic pointer; address of any data type StuffHex reads a pascal-style string of hexadecimal digits, converts them to binary data and stores the result into any data type. destPtris the address of any type of data object; typically the address of a Pattern or Cursor, even a BitMap. Upon return, the memory pointed to by destPtr will be overwritten with binary data. hexString is the address of a Pascal-style string (a length-prefixed array of characters). Following the length byte, all characters must be in the range '0' to '9' and 'A' to 'F'. |
none
This call performs no range checking , so make sure that the buffer at destPtr is large enough to receive all the binary data defined in hexString . The destination buffer may need to be as large as 127 bytes. This function can be useful during program development, but it is rarely needed in a finished program - your compiler is capable of converting hex digits into binary data. For instance, the sequence: StuffHex ( &myPat, "\p0103070F1F3F7FFF" ) can be eliminated by defining the pattern at compile time; e.g., Pattern myPat = { 0x1, 0x3, 0x7, 0xF, 0x1F, 0x3F, 0x7F, 0xFF }; Furthermore, most objects that you might wish to pack with binary data should probably be predefined and available as a program resource.
Availability:
Subtract coordinates of one point from another.
SubPt subtracts the coordinates of one Point from another, storing the result into the second. srcPtis a 4-byte Point structure. Its low word is the horizontal coordinate and its high word is the vertical coordinate. destPtis the address of a 4-byte Point structure. Upon return, it will contain the differences: (destPt.h-srcPt.h) and (destPt.v-destPt.v).
none
The SubPt operation separates the horizontal coordinate from the vertical coordinates before calculating the difference. It is functionally equivalent to: destPt.h -= srcPt. h; destPt.v -= srcPt. v; Perhaps more useful is DeltaPoint , which returns the difference as the return value of the function.
| OSStatus SyncCGContextOriginWithPort | ( | CGContextRef | inContext, |
| CGrafPtr | port | ||
| ) |
Availability:
TestDeviceAttribute Check whether or not an attribute is set.
TestDeviceAttribute returns an indication as to what kind of gDevice you have and whether or not it is set. curDevice is the handle that leads to the device being tested in the gDevice record. attribute is one of seven graphics device characteristics that can be on or off.
a Boolean value indicating the status of a particular attribute It is one of: FALSE Not set TRUE Attribute set
Scanning through a device list, TestDeviceAttribute tells you if your device is a display and if it's active. It does not necessarily tell if the monitor is turned on, or if there is a monitor attached to the card.
| OSErr UnlockPortBits | ( | GrafPtr | port | ) |
Availability:
| void UnpackBits | ( | Ptr * | srcPtr, |
| Ptr * | dstPtr, | ||
| short | dstBytes | ||
| ) |
Uncompress data stored via PackBits.
restoring it via UnpackBits . Since the destLen value must be known in advance, any generalized packed-data save/restore procedure would need to have this value accompany the compressed data.
| OSErr UpdatePort | ( | GrafPtr | port | ) |
Availability:
| </ pre> * par Copyright |
Check if a specified pixel is enclosed by a region.
Perform RLL byte compression on arbitrary data.
PtInRgn returns an indication of whether or not a point (actually, the pixel below and to the right of a mathematical coordinate) is enclosed by the outline of a region. thePtis a Point, expressed in local or global coordinates. theRgnis the handle of a region, in the same coordinate system as thePt.
a Boolean value indicating whether the point is inside of the region. It is one of: FALSENot in the region TRUEIn the region
This is useful in determining if a mouse-down event has occurred while the cursor was positioned in the area of a region. Note that since the EventRecord .where field is expressed in global coordinates, so you may need to convert as follows: GetNextEvent ( everyEvent , &theEvent );: GlobalToLocal ( &theEvent.where ); if (PtInRgn ( theEvent.where, theRgn ) { ... /* yes, it was in that region From ToolUtils.iPackBits compresses up to 32,768 bytes of data by replacing sequences of 3 or more identical bytes with a 2-byte code. It is most often used to compress image data, as found in a BitMap or a PixMap. The worst case compression can be calculated using the formula: (srcLen + (srcLen + 126) / 127). srcPtris the address of a pointer to some data to be compressed. Upon return, the pointer has been adjusted to just beyond the data that has been compressed; i.e., ready for the next call. destPtris the address of a pointer to a buffer to hold the compressed data. Upon return, it has been adjusted to just beyond the end of the compressed data. srcLenis the size, in bytes, of the data to be compressed.
none
Since image data is often full of "white-space", this is ideal for packing data for long-term RAM storage and before writing it to disk or storing it in a resource. It is not quite so useful for compressing text or other data. Note the misnomer: PackBits does not pack bits; it packs sequences of bytes. PackBits was formerly limited to compressing data in 127 bytes blocks. To compress more than 127 bytes, a programmer would have to break the data up and make multiple calls to PackBits . Starting with System Software version 6.0.2, this restriction has been lifted. If you want your program to run on Systems prior to version 6.0.2, you must obey the 127-byte limit. Typical usage is to pack each line of a BitMap or PixMap separately, as in the example below. The example procedure, PackScreen, typically compresses a black and white screen image from 32K down to about 4K or 5K. Example #include < ToolUtils.h > PtrsavePtr; longmapSize, PackScreen( Ptr); mapSize = (long) screenBits .bounds.bottom * screenBits .rowBytes; savePtr = NewPtr ( mapSize + 1 ); /* allocate storage buffer
| ctlCode = FindControl(myEvent.where, myWindow, &myCtl) |
Obtain local coordinates of global point.
GlobalToLocal converts a point from global (screen) coordinates to values expressed in coordinates of the current GrafPort . It is used to obtain the local address of a mouse-down event and as a step in converting between coordinates of two different grafPorts. thePoint is the address of a 4-byte Point structure, expressed in global (screen) coordinates. Upon return, it will contain the coordinates of that same position, expressed in the coordinate system of the current GrafPort .
none
The specified Point is converted, in place. Upon return, it is the same physical location, expressed in global coordinates. For instance, mouse-down events are reported in global coordinates, but TextEdit and the Control Manager functions expect local (window-relative) coordinates. Thus, a typical sequence may include: EventRecord myEvent; ControlHandle myCtl; short ctlCode; GetNextEvent ( everyEvent , &myEvent ); if ( myEvent.what ) == mouseDown { GlobalToLocal ( &myEvent. where );/* get local equivalent
| short dv = startPt.v - endPt.v |
Calculate slope given an angle.
theSlope = SlopeFromAngle ( 17 ); /* get slope of 17 ° angle
| they are equal or the more efficient |
Check if two points are identical.
EqualPt compares the coordinates of two points and returns an indication whether they are identical. This function is used if you have no need whatsoever of execution speed. point1and . . . point2are 4-byte Point structures.
a Boolean indicating whether the points are identical. It is one of: FALSENot the same TRUEExactly the same
EqualPt can be used to make your code more readable. The sequence:
if (EqualPt ( point1, point2 ) {
... they are equal ...
}
is functionally equivalent to:
if ( (pt1.h == pt2.h) && (pt1.v==pt2.v) ) { /* compare shorts twice
| theRand = Random() |
Obtain pseudo-random signed integer.
Random generates and returns a different pseudo-random number each time it is called. The return value ranges from -32767 to 32767.
a signed integer; the next in a sequence of pseudo-random values, uniformly distributed over the range -32767 to 32767.
To obtain a number within a selected range multiply the return value by the range, divide by 65536, and add the desired minimum value. See the Example, below. The numbers are generated in a sequence based upon the starting, or "seed" value, which is stored in the global 32-bit variable randSeed . The seed is initialized to 1 by InitGraf . If you start a sequence by storing a value in randSeed , you can restart the same sequence by setting randSeed to the same value. A more typical operation is to start the sequence with some relatively unguessable value, such as the system time: GetDateTime ( &randSeed ); /* store 32-bit value in seed
Calculate angle given slope.
vertical change between any two points on the line) AngleFromSlope calculates the angle of that line. The calculation is approximate to the nearest degree. theSlope a 4-byte Fixed value; the dh/dv ratio of points on a line.
a signed short integer representing the angle most closely matching the specified slope ratio. Positive values are clockwise from vertical and negative values are counterclockwise.
The returned angle is expressed in circular degrees, going clockwise with 12 o'clock at 0 °, 3 o'clock at 90 °, etc. Negative values are counterclockwise from straight up; e.g., 9 o'clock is -90 °. The following example calculates the slope of a line represented by two endpoints and uses AngleFromSlope to derive the angle of the line. Example #include < ToolUtils.h > #define INT2FIX(i) ((long) i << 16 )/* short to Fixed conversion macro
| LocalToGlobal& tmpPt |
Obtain global (screen) value of local point.
LocalToGlobal converts the coordinates of a local point (relative to the current GrafPort origin) to global (screen) coordinates. It can then be compared to other global points or converted to the local coordinates of a different GrafPort . thePoint is the address of a 4-byte Point structure, expressed in coordinates of the current GrafPort . Upon return, it will contain the coordinates of that same position, expressed to the global, screen coordinates.
none
The result of the conversion is based relative to coordinate (0,0) of the device's BitMap; typically the screen. To convert the coordinates of a rectangle from local to global, you can apply this call to both corners; e.g.: RecttheRect; LocalToGlobal ( & topleft(theRect); LocalToGlobal ( &.botRight(theRect) ); Rectangles and other graphic elements (regions and polygons) can be converted to the global coordinate system via a 3-step sequence: 1Use LocalToGlobal to obtain the global coordinates of one corner of a local item. 2Use SubPt or DeltaPoint to determine the difference between the local and global coordinate systems. 3Use OffsetXxx to reposition the item. For instance, the following sequence converts a local Polygon to global coordinates: Point tmpPt,localPt; PolyHandle thePoly; tmpPt=localPt=topLeft( (thePoly)-> polyBBox );/ get corner
| w1 = r1.right - r1.left |
Map point relative to two rectangles.
MapPt maps a point within one rectangle to a similarly-located position in a different rectangle. Use this to scale individual points of an object being moved to a larger or smaller rectangle. thePoint is the address of a 4-byte Point structure. On entry, it is the coordinates of a point, relative to srcRect that you wish to convert; upon return, it contains the coordinates of a point relative to the size and position of destRect . srcRect and . . . destRect are the addresses of two 8-byte Rect structures. For typical operations, thePoint is an element of an object enclosed by srcRect . It gets mapped to a similar position within destRect .
none
This function is typically used to convert individual points of an object (e.g., a "freehand" drawing) within one rectangle to similar positions within a larger or smaller rectangle. Other tools exist to scale rectangles (MapRect ), regions ( MapRgn ), and polygons ( MapPoly ). For instance, a corner of srcRect will map exactly to the corresponding corner of destRect ; similarly, the center of srcRect maps to the center of destRect . Other points will be positioned at distances from the edges relative to the ratio of the sizes of the rectangles. srcRect destRect It is OK if the two rectangles overlap, and thePoint need not be enclosed by srcRect (in that case, its remapped position will be outside of destRect ). This call is functionally equivalent to the long-winded: h1=r1.bottom-r1.top; h2=r2.bottom - r2.top; /* calc heights