Quickdraw.h
上传用户:xjjlds
上传日期:2015-12-05
资源大小:22823k
文件大小:128k
- /*
- File: Quickdraw.h
-
- Contains: Interface to Quickdraw Graphics
-
- Version: Technology: Mac OS 9
- Release: QuickTime 6.0.2
-
- Copyright: (c) 1985-2001 by Apple Computer, Inc., all rights reserved
-
- Bugs?: For bug reports, consult the following page on
- the World Wide Web:
-
- http://developer.apple.com/bugreporter/
-
- */
- #ifndef __QUICKDRAW__
- #define __QUICKDRAW__
- #ifndef __COMPONENTS__
- #include "Components.h"
- #endif
- #ifndef __MACTYPES__
- #include "MacTypes.h"
- #endif
- #ifndef __MIXEDMODE__
- #include "MixedMode.h"
- #endif
- #ifndef __QUICKDRAWTEXT__
- #include "QuickdrawText.h"
- #endif
- #if PRAGMA_ONCE
- #pragma once
- #endif
- #ifdef __cplusplus
- extern "C" {
- #endif
- #if PRAGMA_IMPORT
- #pragma import on
- #endif
- #if PRAGMA_STRUCT_ALIGN
- #pragma options align=mac68k
- #elif PRAGMA_STRUCT_PACKPUSH
- #pragma pack(push, 2)
- #elif PRAGMA_STRUCT_PACK
- #pragma pack(2)
- #endif
- enum {
- invalColReq = -1 /*invalid color table request*/
- };
- enum {
- /* transfer modes */
- srcCopy = 0, /*the 16 transfer modes*/
- srcOr = 1,
- srcXor = 2,
- srcBic = 3,
- notSrcCopy = 4,
- notSrcOr = 5,
- notSrcXor = 6,
- notSrcBic = 7,
- patCopy = 8,
- patOr = 9,
- patXor = 10,
- patBic = 11,
- notPatCopy = 12,
- notPatOr = 13,
- notPatXor = 14,
- notPatBic = 15, /* Special Text Transfer Mode */
- grayishTextOr = 49,
- hilitetransfermode = 50,
- hilite = 50, /* Arithmetic transfer modes */
- blend = 32,
- addPin = 33,
- addOver = 34,
- subPin = 35,
- addMax = 37,
- adMax = 37,
- subOver = 38,
- adMin = 39,
- ditherCopy = 64, /* Transparent mode constant */
- transparent = 36
- };
- enum {
- italicBit = 1,
- ulineBit = 2,
- outlineBit = 3,
- shadowBit = 4,
- condenseBit = 5,
- extendBit = 6
- };
- enum {
- /* QuickDraw color separation constants */
- normalBit = 0, /*normal screen mapping*/
- inverseBit = 1, /*inverse screen mapping*/
- redBit = 4, /*RGB additive mapping*/
- greenBit = 3,
- blueBit = 2,
- cyanBit = 8, /*CMYBk subtractive mapping*/
- magentaBit = 7,
- yellowBit = 6,
- blackBit = 5
- };
- enum {
- blackColor = 33, /*colors expressed in these mappings*/
- whiteColor = 30,
- redColor = 205,
- greenColor = 341,
- blueColor = 409,
- cyanColor = 273,
- magentaColor = 137,
- yellowColor = 69
- };
- enum {
- picLParen = 0, /*standard picture comments*/
- picRParen = 1,
- clutType = 0, /*0 if lookup table*/
- fixedType = 1, /*1 if fixed table*/
- directType = 2, /*2 if direct values*/
- gdDevType = 0 /*0 = monochrome 1 = color*/
- };
- enum {
- interlacedDevice = 2, /* 1 if single pixel lines look bad */
- roundedDevice = 5, /* 1 if device has been "rounded" into the GrayRgn */
- hasAuxMenuBar = 6, /* 1 if device has an aux menu bar on it */
- burstDevice = 7,
- ext32Device = 8,
- ramInit = 10, /*1 if initialized from 'scrn' resource*/
- mainScreen = 11, /* 1 if main screen */
- allInit = 12, /* 1 if all devices initialized */
- screenDevice = 13, /*1 if screen device [not used]*/
- noDriver = 14, /* 1 if no driver for this GDevice */
- screenActive = 15, /*1 if in use*/
- hiliteBit = 7, /*flag bit in HiliteMode (lowMem flag)*/
- pHiliteBit = 0, /*flag bit in HiliteMode used with BitClr procedure*/
- defQDColors = 127, /*resource ID of clut for default QDColors*/
- /* pixel type */
- RGBDirect = 16, /* 16 & 32 bits/pixel pixelType value */
- /* pmVersion values */
- baseAddr32 = 4 /*pixmap base address is 32-bit address*/
- };
- enum {
- sysPatListID = 0,
- iBeamCursor = 1,
- crossCursor = 2,
- plusCursor = 3,
- watchCursor = 4
- };
- enum {
- kQDGrafVerbFrame = 0,
- kQDGrafVerbPaint = 1,
- kQDGrafVerbErase = 2,
- kQDGrafVerbInvert = 3,
- kQDGrafVerbFill = 4
- };
- #if OLDROUTINENAMES
- enum {
- frame = kQDGrafVerbFrame,
- paint = kQDGrafVerbPaint,
- erase = kQDGrafVerbErase,
- invert = kQDGrafVerbInvert,
- fill = kQDGrafVerbFill
- };
- #endif /* OLDROUTINENAMES */
- typedef SInt8 GrafVerb;
- enum {
- chunky = 0,
- chunkyPlanar = 1,
- planar = 2
- };
- typedef SInt8 PixelType;
- typedef short Bits16[16];
- /*************** IMPORTANT NOTE REGARDING Pattern **************************************
- Patterns were originally defined as:
-
- C: typedef unsigned char Pattern[8];
- Pascal: Pattern = PACKED ARRAY [0..7] OF 0..255;
-
- The old array definition of Pattern would cause 68000 based CPU's to crash in certain circum-
- stances. The new struct definition is safe, but may require source code changes to compile.
-
- *********************************************************************************************/
- struct Pattern {
- UInt8 pat[8];
- };
- typedef struct Pattern Pattern;
- /*
- ConstPatternParam is no longer needed. It was first created when Pattern was an array.
- Now that Pattern is a struct, it is more straight forward to just add the "const" qualifier
- on the parameter type (e.g. "const Pattern * pat" instead of "ConstPatternParam pat").
- */
- typedef const Pattern * ConstPatternParam;
- typedef Pattern * PatPtr;
- typedef PatPtr * PatHandle;
- typedef SignedByte QDByte;
- typedef QDByte * QDPtr;
- typedef QDPtr * QDHandle;
- typedef short QDErr;
- enum {
- singleDevicesBit = 0,
- dontMatchSeedsBit = 1,
- allDevicesBit = 2
- };
- enum {
- singleDevices = 1 << singleDevicesBit,
- dontMatchSeeds = 1 << dontMatchSeedsBit,
- allDevices = 1 << allDevicesBit
- };
- typedef unsigned long DeviceLoopFlags;
- /*
- PrinterStatusOpcode. For communication with downloading and printing services.
- */
- typedef SInt32 PrinterStatusOpcode;
- enum {
- kPrinterFontStatus = 0,
- kPrinterScalingStatus = 1
- };
- struct PrinterFontStatus {
- SInt32 oResult;
- SInt16 iFondID;
- Style iStyle;
- };
- typedef struct PrinterFontStatus PrinterFontStatus;
- struct PrinterScalingStatus {
- Point oScalingFactors;
- };
- typedef struct PrinterScalingStatus PrinterScalingStatus;
- struct BitMap {
- Ptr baseAddr;
- short rowBytes;
- Rect bounds;
- };
- typedef struct BitMap BitMap;
- typedef BitMap * BitMapPtr;
- typedef BitMapPtr * BitMapHandle;
- struct Cursor {
- Bits16 data;
- Bits16 mask;
- Point hotSpot;
- };
- typedef struct Cursor Cursor;
- typedef Cursor * CursPtr;
- typedef CursPtr * CursHandle;
- struct PenState {
- Point pnLoc;
- Point pnSize;
- short pnMode;
- Pattern pnPat;
- };
- typedef struct PenState PenState;
- #if !OPAQUE_TOOLBOX_STRUCTS
- struct MacRegion {
- unsigned short rgnSize; /*size in bytes*/
- Rect rgnBBox; /*enclosing rectangle*/
- };
- typedef struct MacRegion MacRegion;
- /*
- The type name "Region" has a name space collision on Win32.
- Use MacRegion to be cross-platfrom safe.
- */
- #if TARGET_OS_MAC
- typedef MacRegion Region;
- #endif /* TARGET_OS_MAC */
- typedef MacRegion * RgnPtr;
- typedef RgnPtr * RgnHandle;
- #else
- typedef struct OpaqueRgnHandle* RgnHandle;
- #endif /* !OPAQUE_TOOLBOX_STRUCTS */
- struct Picture {
- short picSize;
- Rect picFrame;
- };
- typedef struct Picture Picture;
- typedef Picture * PicPtr;
- typedef PicPtr * PicHandle;
- struct MacPolygon {
- short polySize;
- Rect polyBBox;
- Point polyPoints[1];
- };
- typedef struct MacPolygon MacPolygon;
- /*
- The type name "Polygon" has a name space collision on Win32.
- Use MacPolygon to be cross-platfrom safe.
- */
- #if TARGET_OS_MAC
- typedef MacPolygon Polygon;
- #endif /* TARGET_OS_MAC */
- typedef MacPolygon * PolyPtr;
- typedef PolyPtr * PolyHandle;
- typedef CALLBACK_API( void , QDTextProcPtr )(short byteCount, Ptr textBuf, Point numer, Point denom);
- typedef CALLBACK_API( void , QDLineProcPtr )(Point newPt);
- typedef CALLBACK_API( void , QDRectProcPtr )(GrafVerb verb, Rect *r);
- typedef CALLBACK_API( void , QDRRectProcPtr )(GrafVerb verb, Rect *r, short ovalWidth, short ovalHeight);
- typedef CALLBACK_API( void , QDOvalProcPtr )(GrafVerb verb, Rect *r);
- typedef CALLBACK_API( void , QDArcProcPtr )(GrafVerb verb, Rect *r, short startAngle, short arcAngle);
- typedef CALLBACK_API( void , QDPolyProcPtr )(GrafVerb verb, PolyHandle poly);
- typedef CALLBACK_API( void , QDRgnProcPtr )(GrafVerb verb, RgnHandle rgn);
- typedef CALLBACK_API( void , QDBitsProcPtr )(BitMap *srcBits, Rect *srcRect, Rect *dstRect, short mode, RgnHandle maskRgn);
- typedef CALLBACK_API( void , QDCommentProcPtr )(short kind, short dataSize, Handle dataHandle);
- typedef CALLBACK_API( short , QDTxMeasProcPtr )(short byteCount, Ptr textAddr, Point *numer, Point *denom, FontInfo *info);
- typedef CALLBACK_API( void , QDGetPicProcPtr )(Ptr dataPtr, short byteCount);
- typedef CALLBACK_API( void , QDPutPicProcPtr )(Ptr dataPtr, short byteCount);
- typedef CALLBACK_API( void , QDOpcodeProcPtr )(Rect *fromRect, Rect *toRect, short opcode, short version);
- typedef CALLBACK_API_C( OSStatus , QDStdGlyphsProcPtr )(void *dataStream, ByteCount size);
- typedef CALLBACK_API( void , QDJShieldCursorProcPtr )(short left, short top, short right, short bottom);
- 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;
- struct QDProcs {
- QDTextUPP textProc;
- QDLineUPP lineProc;
- QDRectUPP rectProc;
- QDRRectUPP rRectProc;
- QDOvalUPP ovalProc;
- QDArcUPP arcProc;
- QDPolyUPP polyProc;
- QDRgnUPP rgnProc;
- QDBitsUPP bitsProc;
- QDCommentUPP commentProc;
- QDTxMeasUPP txMeasProc;
- QDGetPicUPP getPicProc;
- QDPutPicUPP putPicProc;
- };
- typedef struct QDProcs QDProcs;
- typedef QDProcs * QDProcsPtr;
- #if OPAQUE_UPP_TYPES
- EXTERN_API(QDTextUPP)
- NewQDTextUPP (QDTextProcPtr userRoutine);
- EXTERN_API(QDLineUPP)
- NewQDLineUPP (QDLineProcPtr userRoutine);
- EXTERN_API(QDRectUPP)
- NewQDRectUPP (QDRectProcPtr userRoutine);
- EXTERN_API(QDRRectUPP)
- NewQDRRectUPP (QDRRectProcPtr userRoutine);
- EXTERN_API(QDOvalUPP)
- NewQDOvalUPP (QDOvalProcPtr userRoutine);
- EXTERN_API(QDArcUPP)
- NewQDArcUPP (QDArcProcPtr userRoutine);
- EXTERN_API(QDPolyUPP)
- NewQDPolyUPP (QDPolyProcPtr userRoutine);
- EXTERN_API(QDRgnUPP)
- NewQDRgnUPP (QDRgnProcPtr userRoutine);
- EXTERN_API(QDBitsUPP)
- NewQDBitsUPP (QDBitsProcPtr userRoutine);
- EXTERN_API(QDCommentUPP)
- NewQDCommentUPP (QDCommentProcPtr userRoutine);
- EXTERN_API(QDTxMeasUPP)
- NewQDTxMeasUPP (QDTxMeasProcPtr userRoutine);
- EXTERN_API(QDGetPicUPP)
- NewQDGetPicUPP (QDGetPicProcPtr userRoutine);
- EXTERN_API(QDPutPicUPP)
- NewQDPutPicUPP (QDPutPicProcPtr userRoutine);
- EXTERN_API(QDOpcodeUPP)
- NewQDOpcodeUPP (QDOpcodeProcPtr userRoutine);
- EXTERN_API(QDStdGlyphsUPP)
- NewQDStdGlyphsUPP (QDStdGlyphsProcPtr userRoutine);
- EXTERN_API(QDJShieldCursorUPP)
- NewQDJShieldCursorUPP (QDJShieldCursorProcPtr userRoutine);
- EXTERN_API(void)
- DisposeQDTextUPP (QDTextUPP userUPP);
- EXTERN_API(void)
- DisposeQDLineUPP (QDLineUPP userUPP);
- EXTERN_API(void)
- DisposeQDRectUPP (QDRectUPP userUPP);
- EXTERN_API(void)
- DisposeQDRRectUPP (QDRRectUPP userUPP);
- EXTERN_API(void)
- DisposeQDOvalUPP (QDOvalUPP userUPP);
- EXTERN_API(void)
- DisposeQDArcUPP (QDArcUPP userUPP);
- EXTERN_API(void)
- DisposeQDPolyUPP (QDPolyUPP userUPP);
- EXTERN_API(void)
- DisposeQDRgnUPP (QDRgnUPP userUPP);
- EXTERN_API(void)
- DisposeQDBitsUPP (QDBitsUPP userUPP);
- EXTERN_API(void)
- DisposeQDCommentUPP (QDCommentUPP userUPP);
- EXTERN_API(void)
- DisposeQDTxMeasUPP (QDTxMeasUPP userUPP);
- EXTERN_API(void)
- DisposeQDGetPicUPP (QDGetPicUPP userUPP);
- EXTERN_API(void)
- DisposeQDPutPicUPP (QDPutPicUPP userUPP);
- EXTERN_API(void)
- DisposeQDOpcodeUPP (QDOpcodeUPP userUPP);
- EXTERN_API(void)
- DisposeQDStdGlyphsUPP (QDStdGlyphsUPP userUPP);
- EXTERN_API(void)
- DisposeQDJShieldCursorUPP (QDJShieldCursorUPP userUPP);
- EXTERN_API(void)
- InvokeQDTextUPP (short byteCount,
- Ptr textBuf,
- Point numer,
- Point denom,
- QDTextUPP userUPP);
- EXTERN_API(void)
- InvokeQDLineUPP (Point newPt,
- QDLineUPP userUPP);
- EXTERN_API(void)
- InvokeQDRectUPP (GrafVerb verb,
- Rect * r,
- QDRectUPP userUPP);
- EXTERN_API(void)
- InvokeQDRRectUPP (GrafVerb verb,
- Rect * r,
- short ovalWidth,
- short ovalHeight,
- QDRRectUPP userUPP);
- EXTERN_API(void)
- InvokeQDOvalUPP (GrafVerb verb,
- Rect * r,
- QDOvalUPP userUPP);
- EXTERN_API(void)
- InvokeQDArcUPP (GrafVerb verb,
- Rect * r,
- short startAngle,
- short arcAngle,
- QDArcUPP userUPP);
- EXTERN_API(void)
- InvokeQDPolyUPP (GrafVerb verb,
- PolyHandle poly,
- QDPolyUPP userUPP);
- EXTERN_API(void)
- InvokeQDRgnUPP (GrafVerb verb,
- RgnHandle rgn,
- QDRgnUPP userUPP);
- EXTERN_API(void)
- InvokeQDBitsUPP (BitMap * srcBits,
- Rect * srcRect,
- Rect * dstRect,
- short mode,
- RgnHandle maskRgn,
- QDBitsUPP userUPP);
- EXTERN_API(void)
- InvokeQDCommentUPP (short kind,
- short dataSize,
- Handle dataHandle,
- QDCommentUPP userUPP);
- EXTERN_API(short)
- InvokeQDTxMeasUPP (short byteCount,
- Ptr textAddr,
- Point * numer,
- Point * denom,
- FontInfo * info,
- QDTxMeasUPP userUPP);
- EXTERN_API(void)
- InvokeQDGetPicUPP (Ptr dataPtr,
- short byteCount,
- QDGetPicUPP userUPP);
- EXTERN_API(void)
- InvokeQDPutPicUPP (Ptr dataPtr,
- short byteCount,
- QDPutPicUPP userUPP);
- EXTERN_API(void)
- InvokeQDOpcodeUPP (Rect * fromRect,
- Rect * toRect,
- short opcode,
- short version,
- QDOpcodeUPP userUPP);
- EXTERN_API(OSStatus)
- InvokeQDStdGlyphsUPP (void * dataStream,
- ByteCount size,
- QDStdGlyphsUPP userUPP);
- EXTERN_API(void)
- InvokeQDJShieldCursorUPP (short left,
- short top,
- short right,
- short bottom,
- QDJShieldCursorUPP userUPP);
- #else
- enum { uppQDTextProcInfo = 0x00003F80 }; /* pascal no_return_value Func(2_bytes, 4_bytes, 4_bytes, 4_bytes) */
- enum { uppQDLineProcInfo = 0x000000C0 }; /* pascal no_return_value Func(4_bytes) */
- enum { uppQDRectProcInfo = 0x00000340 }; /* pascal no_return_value Func(1_byte, 4_bytes) */
- enum { uppQDRRectProcInfo = 0x00002B40 }; /* pascal no_return_value Func(1_byte, 4_bytes, 2_bytes, 2_bytes) */
- enum { uppQDOvalProcInfo = 0x00000340 }; /* pascal no_return_value Func(1_byte, 4_bytes) */
- enum { uppQDArcProcInfo = 0x00002B40 }; /* pascal no_return_value Func(1_byte, 4_bytes, 2_bytes, 2_bytes) */
- enum { uppQDPolyProcInfo = 0x00000340 }; /* pascal no_return_value Func(1_byte, 4_bytes) */
- enum { uppQDRgnProcInfo = 0x00000340 }; /* pascal no_return_value Func(1_byte, 4_bytes) */
- enum { uppQDBitsProcInfo = 0x0000EFC0 }; /* pascal no_return_value Func(4_bytes, 4_bytes, 4_bytes, 2_bytes, 4_bytes) */
- enum { uppQDCommentProcInfo = 0x00000E80 }; /* pascal no_return_value Func(2_bytes, 2_bytes, 4_bytes) */
- enum { uppQDTxMeasProcInfo = 0x0000FFA0 }; /* pascal 2_bytes Func(2_bytes, 4_bytes, 4_bytes, 4_bytes, 4_bytes) */
- enum { uppQDGetPicProcInfo = 0x000002C0 }; /* pascal no_return_value Func(4_bytes, 2_bytes) */
- enum { uppQDPutPicProcInfo = 0x000002C0 }; /* pascal no_return_value Func(4_bytes, 2_bytes) */
- enum { uppQDOpcodeProcInfo = 0x00002BC0 }; /* pascal no_return_value Func(4_bytes, 4_bytes, 2_bytes, 2_bytes) */
- enum { uppQDStdGlyphsProcInfo = 0x000003F1 }; /* 4_bytes Func(4_bytes, 4_bytes) */
- enum { uppQDJShieldCursorProcInfo = 0x00002A80 }; /* pascal no_return_value Func(2_bytes, 2_bytes, 2_bytes, 2_bytes) */
- #define NewQDTextUPP(userRoutine) (QDTextUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppQDTextProcInfo, GetCurrentArchitecture())
- #define NewQDLineUPP(userRoutine) (QDLineUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppQDLineProcInfo, GetCurrentArchitecture())
- #define NewQDRectUPP(userRoutine) (QDRectUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppQDRectProcInfo, GetCurrentArchitecture())
- #define NewQDRRectUPP(userRoutine) (QDRRectUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppQDRRectProcInfo, GetCurrentArchitecture())
- #define NewQDOvalUPP(userRoutine) (QDOvalUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppQDOvalProcInfo, GetCurrentArchitecture())
- #define NewQDArcUPP(userRoutine) (QDArcUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppQDArcProcInfo, GetCurrentArchitecture())
- #define NewQDPolyUPP(userRoutine) (QDPolyUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppQDPolyProcInfo, GetCurrentArchitecture())
- #define NewQDRgnUPP(userRoutine) (QDRgnUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppQDRgnProcInfo, GetCurrentArchitecture())
- #define NewQDBitsUPP(userRoutine) (QDBitsUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppQDBitsProcInfo, GetCurrentArchitecture())
- #define NewQDCommentUPP(userRoutine) (QDCommentUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppQDCommentProcInfo, GetCurrentArchitecture())
- #define NewQDTxMeasUPP(userRoutine) (QDTxMeasUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppQDTxMeasProcInfo, GetCurrentArchitecture())
- #define NewQDGetPicUPP(userRoutine) (QDGetPicUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppQDGetPicProcInfo, GetCurrentArchitecture())
- #define NewQDPutPicUPP(userRoutine) (QDPutPicUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppQDPutPicProcInfo, GetCurrentArchitecture())
- #define NewQDOpcodeUPP(userRoutine) (QDOpcodeUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppQDOpcodeProcInfo, GetCurrentArchitecture())
- #define NewQDStdGlyphsUPP(userRoutine) (QDStdGlyphsUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppQDStdGlyphsProcInfo, GetCurrentArchitecture())
- #define NewQDJShieldCursorUPP(userRoutine) (QDJShieldCursorUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppQDJShieldCursorProcInfo, GetCurrentArchitecture())
- #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) CALL_FOUR_PARAMETER_UPP((userUPP), uppQDTextProcInfo, (byteCount), (textBuf), (numer), (denom))
- #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) CALL_FOUR_PARAMETER_UPP((userUPP), uppQDRRectProcInfo, (verb), (r), (ovalWidth), (ovalHeight))
- #define InvokeQDOvalUPP(verb, r, userUPP) CALL_TWO_PARAMETER_UPP((userUPP), uppQDOvalProcInfo, (verb), (r))
- #define InvokeQDArcUPP(verb, r, startAngle, arcAngle, userUPP) CALL_FOUR_PARAMETER_UPP((userUPP), uppQDArcProcInfo, (verb), (r), (startAngle), (arcAngle))
- #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) CALL_FIVE_PARAMETER_UPP((userUPP), uppQDBitsProcInfo, (srcBits), (srcRect), (dstRect), (mode), (maskRgn))
- #define InvokeQDCommentUPP(kind, dataSize, dataHandle, userUPP) CALL_THREE_PARAMETER_UPP((userUPP), uppQDCommentProcInfo, (kind), (dataSize), (dataHandle))
- #define InvokeQDTxMeasUPP(byteCount, textAddr, numer, denom, info, userUPP) (short)CALL_FIVE_PARAMETER_UPP((userUPP), uppQDTxMeasProcInfo, (byteCount), (textAddr), (numer), (denom), (info))
- #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) CALL_FOUR_PARAMETER_UPP((userUPP), uppQDOpcodeProcInfo, (fromRect), (toRect), (opcode), (version))
- #define InvokeQDStdGlyphsUPP(dataStream, size, userUPP) (OSStatus)CALL_TWO_PARAMETER_UPP((userUPP), uppQDStdGlyphsProcInfo, (dataStream), (size))
- #define InvokeQDJShieldCursorUPP(left, top, right, bottom, userUPP) CALL_FOUR_PARAMETER_UPP((userUPP), uppQDJShieldCursorProcInfo, (left), (top), (right), (bottom))
- #endif
- /* support for pre-Carbon UPP routines: NewXXXProc and CallXXXProc */
- #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)
- #if !OPAQUE_TOOLBOX_STRUCTS
- struct GrafPort {
- short device;
- BitMap portBits;
- Rect portRect;
- RgnHandle visRgn;
- RgnHandle clipRgn;
- Pattern bkPat;
- Pattern fillPat;
- Point pnLoc;
- Point pnSize;
- short pnMode;
- Pattern pnPat;
- short pnVis;
- short txFont;
- StyleField txFace; /*StyleField occupies 16-bits, but only first 8-bits are used*/
- UInt8 txFlags; /* QuickTime uses second 8 bits of StyleField for txFlags */
- short txMode;
- short txSize;
- Fixed spExtra;
- long fgColor;
- long bkColor;
- short colrBit;
- short patStretch;
- Handle picSave;
- Handle rgnSave;
- Handle polySave;
- QDProcsPtr grafProcs;
- };
- typedef struct GrafPort GrafPort;
- typedef GrafPort * GrafPtr;
- /*
- * 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.
- */
- typedef GrafPtr WindowPtr;
- typedef WindowPtr DialogPtr;
- #else
- typedef struct OpaqueWindowPtr* WindowPtr;
- typedef struct OpaqueDialogPtr* DialogPtr;
- typedef struct OpaqueGrafPtr* GrafPtr;
- #endif /* !OPAQUE_TOOLBOX_STRUCTS */
- typedef WindowPtr WindowRef;
- /* DragConstraint constants to pass to DragGray,DragTheRgn, or ConstrainedDragRgn*/
- typedef UInt16 DragConstraint;
- enum {
- kNoConstraint = 0,
- kVerticalConstraint = 1,
- kHorizontalConstraint = 2
- };
- typedef CALLBACK_API( void , DragGrayRgnProcPtr )(void );
- /*
- * Here ends the list of things that "belong" in Windows.
- */
- struct RGBColor {
- unsigned short red; /*magnitude of red component*/
- unsigned short green; /*magnitude of green component*/
- unsigned short blue; /*magnitude of blue component*/
- };
- typedef struct RGBColor RGBColor;
- typedef RGBColor * RGBColorPtr;
- typedef RGBColorPtr * RGBColorHdl;
- typedef CALLBACK_API( Boolean , ColorSearchProcPtr )(RGBColor *rgb, long *position);
- 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;
- #if OPAQUE_UPP_TYPES
- EXTERN_API(DragGrayRgnUPP)
- NewDragGrayRgnUPP (DragGrayRgnProcPtr userRoutine);
- EXTERN_API(ColorSearchUPP)
- NewColorSearchUPP (ColorSearchProcPtr userRoutine);
- EXTERN_API(ColorComplementUPP)
- NewColorComplementUPP (ColorComplementProcPtr userRoutine);
- EXTERN_API(void)
- DisposeDragGrayRgnUPP (DragGrayRgnUPP userUPP);
- EXTERN_API(void)
- DisposeColorSearchUPP (ColorSearchUPP userUPP);
- EXTERN_API(void)
- DisposeColorComplementUPP (ColorComplementUPP userUPP);
- EXTERN_API(void)
- InvokeDragGrayRgnUPP (DragGrayRgnUPP userUPP);
- EXTERN_API(Boolean)
- InvokeColorSearchUPP (RGBColor * rgb,
- long * position,
- ColorSearchUPP userUPP);
- EXTERN_API(Boolean)
- InvokeColorComplementUPP (RGBColor * rgb,
- ColorComplementUPP userUPP);
- #else
- enum { uppDragGrayRgnProcInfo = 0x00000000 }; /* pascal no_return_value Func() */
- enum { uppColorSearchProcInfo = 0x000003D0 }; /* pascal 1_byte Func(4_bytes, 4_bytes) */
- enum { uppColorComplementProcInfo = 0x000000D0 }; /* pascal 1_byte Func(4_bytes) */
- #define NewDragGrayRgnUPP(userRoutine) (DragGrayRgnUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppDragGrayRgnProcInfo, GetCurrentArchitecture())
- #define NewColorSearchUPP(userRoutine) (ColorSearchUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppColorSearchProcInfo, GetCurrentArchitecture())
- #define NewColorComplementUPP(userRoutine) (ColorComplementUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppColorComplementProcInfo, GetCurrentArchitecture())
- #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) (Boolean)CALL_TWO_PARAMETER_UPP((userUPP), uppColorSearchProcInfo, (rgb), (position))
- #define InvokeColorComplementUPP(rgb, userUPP) (Boolean)CALL_ONE_PARAMETER_UPP((userUPP), uppColorComplementProcInfo, (rgb))
- #endif
- /* support for pre-Carbon UPP routines: NewXXXProc and CallXXXProc */
- #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)
- struct ColorSpec {
- short value; /*index or other value*/
- RGBColor rgb; /*true color*/
- };
- typedef struct ColorSpec ColorSpec;
- typedef ColorSpec * ColorSpecPtr;
- typedef ColorSpec CSpecArray[1];
- struct ColorTable {
- long ctSeed; /*unique identifier for table*/
- short ctFlags; /*high bit: 0 = PixMap; 1 = device*/
- short ctSize; /*number of entries in CTTable*/
- CSpecArray ctTable; /*array [0..0] of ColorSpec*/
- };
- typedef struct ColorTable ColorTable;
- typedef ColorTable * CTabPtr;
- typedef CTabPtr * CTabHandle;
- struct xColorSpec {
- short value; /*index or other value*/
- RGBColor rgb; /*true color*/
- short xalpha;
- };
- typedef struct xColorSpec xColorSpec;
- typedef xColorSpec * xColorSpecPtr;
- typedef xColorSpec xCSpecArray[1];
- struct MatchRec {
- unsigned short red;
- unsigned short green;
- unsigned short blue;
- long matchData;
- };
- typedef struct MatchRec MatchRec;
- /*
- 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.
- */
- #ifndef OLDPIXMAPSTRUCT
- #if TARGET_OS_MAC && TARGET_API_MAC_OS8
- #define OLDPIXMAPSTRUCT 1
- #else
- #define OLDPIXMAPSTRUCT 0
- #endif /* TARGET_OS_MAC && TARGET_API_MAC_OS8 */
- #endif /* !defined(OLDPIXMAPSTRUCT) */
- #if OLDPIXMAPSTRUCT
- #define GETPIXMAPPIXELFORMAT(pm) ( (pm)->pixelSize )
- #else
- #define GETPIXMAPPIXELFORMAT(pm) ( ((pm)->pixelFormat != 0) ? (pm)->pixelFormat : (pm)->pixelSize )
- #endif
- #if TARGET_OS_MAC && !TARGET_RT_LITTLE_ENDIAN
- #define NON_MAC_PIXEL_FORMATS 0
- #else
- #define NON_MAC_PIXEL_FORMATS 1
- #endif
- /* pixel formats*/
- enum {
- k1MonochromePixelFormat = 0x00000001, /* 1 bit indexed*/
- k2IndexedPixelFormat = 0x00000002, /* 2 bit indexed*/
- k4IndexedPixelFormat = 0x00000004, /* 4 bit indexed*/
- k8IndexedPixelFormat = 0x00000008, /* 8 bit indexed*/
- k16BE555PixelFormat = 0x00000010, /* 16 bit BE rgb 555 (Mac)*/
- k24RGBPixelFormat = 0x00000018, /* 24 bit rgb */
- k32ARGBPixelFormat = 0x00000020, /* 32 bit argb (Mac)*/
- k1IndexedGrayPixelFormat = 0x00000021, /* 1 bit indexed gray*/
- k2IndexedGrayPixelFormat = 0x00000022, /* 2 bit indexed gray*/
- k4IndexedGrayPixelFormat = 0x00000024, /* 4 bit indexed gray*/
- k8IndexedGrayPixelFormat = 0x00000028 /* 8 bit indexed gray*/
- };
- /* values for PixMap.pixelFormat*/
- enum {
- k16LE555PixelFormat = FOUR_CHAR_CODE('L555'), /* 16 bit LE rgb 555 (PC)*/
- k16LE5551PixelFormat = FOUR_CHAR_CODE('5551'), /* 16 bit LE rgb 5551*/
- k16BE565PixelFormat = FOUR_CHAR_CODE('B565'), /* 16 bit BE rgb 565*/
- k16LE565PixelFormat = FOUR_CHAR_CODE('L565'), /* 16 bit LE rgb 565*/
- k24BGRPixelFormat = FOUR_CHAR_CODE('24BG'), /* 24 bit bgr */
- k32BGRAPixelFormat = FOUR_CHAR_CODE('BGRA'), /* 32 bit bgra (Matrox)*/
- k32ABGRPixelFormat = FOUR_CHAR_CODE('ABGR'), /* 32 bit abgr */
- k32RGBAPixelFormat = FOUR_CHAR_CODE('RGBA'), /* 32 bit rgba */
- kYUVSPixelFormat = FOUR_CHAR_CODE('yuvs'), /* YUV 4:2:2 byte ordering 16-unsigned = 'YUY2'*/
- kYUVUPixelFormat = FOUR_CHAR_CODE('yuvu'), /* YUV 4:2:2 byte ordering 16-signed*/
- kYVU9PixelFormat = FOUR_CHAR_CODE('YVU9'), /* YVU9 Planar 9*/
- kYUV411PixelFormat = FOUR_CHAR_CODE('Y411'), /* YUV 4:1:1 Interleaved 16*/
- kYVYU422PixelFormat = FOUR_CHAR_CODE('YVYU'), /* YVYU 4:2:2 byte ordering 16*/
- kUYVY422PixelFormat = FOUR_CHAR_CODE('UYVY'), /* UYVY 4:2:2 byte ordering 16*/
- kYUV211PixelFormat = FOUR_CHAR_CODE('Y211'), /* YUV 2:1:1 Packed 8*/
- k2vuyPixelFormat = FOUR_CHAR_CODE('2vuy') /* UYVY 4:2:2 byte ordering 16*/
- };
- #if !OLDPIXMAPSTRUCT
- struct PixMapExtension {
- long extSize; /*size of struct, duh!*/
- unsigned long pmBits; /*pixmap attributes bitfield*/
- void * pmGD; /*this is a GDHandle*/
- long pmSeed;
- Fixed gammaLevel; /*pixmap gammalevel*/
- Fixed requestedGammaLevel;
- unsigned long reserved2;
- long longRowBytes; /*used when rowBytes > 16382*/
- unsigned long signature;
- Handle baseAddrHandle;
- };
- typedef struct PixMapExtension PixMapExtension;
- typedef PixMapExtension * PixMapExtPtr;
- typedef PixMapExtPtr * PixMapExtHandle;
- #endif /* !OLDPIXMAPSTRUCT */
- struct PixMap {
- Ptr baseAddr; /*pointer to pixels*/
- short rowBytes; /*offset to next line*/
- Rect bounds; /*encloses bitmap*/
- short pmVersion; /*pixMap version number*/
- short packType; /*defines packing format*/
- long packSize; /*length of pixel data*/
- Fixed hRes; /*horiz. resolution (ppi)*/
- Fixed vRes; /*vert. resolution (ppi)*/
- short pixelType; /*defines pixel type*/
- short pixelSize; /*# bits in pixel*/
- short cmpCount; /*# components in pixel*/
- short cmpSize; /*# bits per component*/
- #if OLDPIXMAPSTRUCT
- long planeBytes; /*offset to next plane*/
- CTabHandle pmTable; /*color map for this pixMap*/
- long pmReserved;
- #else
- OSType pixelFormat; /*fourCharCode representation*/
- CTabHandle pmTable; /*color map for this pixMap*/
- PixMapExtHandle pmExt; /*Handle to pixMap extension*/
- #endif
- };
- typedef struct PixMap PixMap;
- typedef PixMap * PixMapPtr;
- typedef PixMapPtr * PixMapHandle;
- struct PixPat {
- short patType; /*type of pattern*/
- PixMapHandle patMap; /*the pattern's pixMap*/
- Handle patData; /*pixmap's data*/
- Handle patXData; /*expanded Pattern data*/
- short patXValid; /*flags whether expanded Pattern valid*/
- Handle patXMap; /*Handle to expanded Pattern data*/
- Pattern pat1Data; /*old-Style pattern/RGB color*/
- };
- typedef struct PixPat PixPat;
- typedef PixPat * PixPatPtr;
- typedef PixPatPtr * PixPatHandle;
- struct CCrsr {
- short crsrType; /*type of cursor*/
- PixMapHandle crsrMap; /*the cursor's pixmap*/
- Handle crsrData; /*cursor's data*/
- Handle crsrXData; /*expanded cursor data*/
- short crsrXValid; /*depth of expanded data (0 if none)*/
- Handle crsrXHandle; /*future use*/
- Bits16 crsr1Data; /*one-bit cursor*/
- Bits16 crsrMask; /*cursor's mask*/
- Point crsrHotSpot; /*cursor's hotspot*/
- long crsrXTable; /*private*/
- long crsrID; /*private*/
- };
- typedef struct CCrsr CCrsr;
- typedef CCrsr * CCrsrPtr;
- typedef CCrsrPtr * CCrsrHandle;
- struct GammaTbl {
- short gVersion; /*gamma version number*/
- short gType; /*gamma data type*/
- short gFormulaSize; /*Formula data size*/
- short gChanCnt; /*number of channels of data*/
- short gDataCnt; /*number of values/channel*/
- short gDataWidth; /*bits/corrected value (data packed to next larger byte size)*/
- short gFormulaData[1]; /*data for formulas followed by gamma values*/
- };
- typedef struct GammaTbl GammaTbl;
- typedef GammaTbl * GammaTblPtr;
- typedef GammaTblPtr * GammaTblHandle;
- struct ITab {
- long iTabSeed; /*copy of CTSeed from source CTable*/
- short iTabRes; /*bits/channel resolution of iTable*/
- Byte iTTable[1]; /*byte colortable index values*/
- };
- typedef struct ITab ITab;
- typedef ITab * ITabPtr;
- typedef ITabPtr * ITabHandle;
- struct SProcRec {
- Handle nxtSrch; /*SProcHndl Handle to next SProcRec*/
- ColorSearchUPP srchProc; /*search procedure proc ptr*/
- };
- typedef struct SProcRec SProcRec;
- typedef SProcRec * SProcPtr;
- typedef SProcPtr * SProcHndl;
- struct CProcRec {
- Handle nxtComp; /*CProcHndl Handle to next CProcRec*/
- ColorComplementUPP compProc; /*complement procedure proc ptr*/
- };
- typedef struct CProcRec CProcRec;
- typedef CProcRec * CProcPtr;
- typedef CProcPtr * CProcHndl;
- /*
- QuickTime 3.0 makes GDevice data structure available on non-Mac OS's.
- In order to implement GDevice in these alternate environments, the GDevice
- had to be extended. The gdReserved field was changed to gdExt which is
- a Handle to extra info.
- */
- #ifndef OLDGDEVICESTRUCT
- #if TARGET_OS_MAC && TARGET_API_MAC_OS8
- #define OLDGDEVICESTRUCT 1
- #else
- #define OLDGDEVICESTRUCT 0
- #endif /* TARGET_OS_MAC && TARGET_API_MAC_OS8 */
- #endif /* !defined(OLDGDEVICESTRUCT) */
- typedef struct GDevice GDevice;
- typedef GDevice * GDPtr;
- typedef GDPtr * GDHandle;
- struct GDevice {
- short gdRefNum; /*driver's unit number*/
- short gdID; /*client ID for search procs*/
- short gdType; /*fixed/CLUT/direct*/
- ITabHandle gdITable; /*Handle to inverse lookup table*/
- short gdResPref; /*preferred resolution of GDITable*/
- SProcHndl gdSearchProc; /*search proc list head*/
- CProcHndl gdCompProc; /*complement proc list*/
- short gdFlags; /*grafDevice flags word*/
- PixMapHandle gdPMap; /*describing pixMap*/
- long gdRefCon; /*reference value*/
- GDHandle gdNextGD; /*GDHandle Handle of next gDevice*/
- Rect gdRect; /* device's bounds in global coordinates*/
- long gdMode; /*device's current mode*/
- short gdCCBytes; /*depth of expanded cursor data*/
- short gdCCDepth; /*depth of expanded cursor data*/
- Handle gdCCXData; /*Handle to cursor's expanded data*/
- Handle gdCCXMask; /*Handle to cursor's expanded mask*/
- #if OLDGDEVICESTRUCT
- long gdReserved; /*future use. MUST BE 0*/
- #else
- Handle gdExt; /*QuickTime 3.0 private info*/
- #endif
- };
- struct GrafVars {
- RGBColor rgbOpColor; /*color for addPin subPin and average*/
- RGBColor rgbHiliteColor; /*color for hiliting*/
- Handle pmFgColor; /*palette Handle for foreground color*/
- short pmFgIndex; /*index value for foreground*/
- Handle pmBkColor; /*palette Handle for background color*/
- short pmBkIndex; /*index value for background*/
- short pmFlags; /*flags for Palette Manager*/
- };
- typedef struct GrafVars GrafVars;
- typedef GrafVars * GVarPtr;
- typedef GVarPtr * GVarHandle;
- #if OPAQUE_TOOLBOX_STRUCTS
- typedef GrafPtr CGrafPtr;
- #else
- typedef struct CGrafPort CGrafPort;
- typedef CGrafPort * CGrafPtr;
- #endif /* OPAQUE_TOOLBOX_STRUCTS */
- typedef CALLBACK_API_C( OSStatus , QDPrinterStatusProcPtr )(PrinterStatusOpcode opcode, CGrafPtr currentPort, void *printerStatus);
- typedef STACK_UPP_TYPE(QDPrinterStatusProcPtr) QDPrinterStatusUPP;
- struct CQDProcs {
- QDTextUPP textProc;
- QDLineUPP lineProc;
- QDRectUPP rectProc;
- QDRRectUPP rRectProc;
- QDOvalUPP ovalProc;
- QDArcUPP arcProc;
- QDPolyUPP polyProc;
- QDRgnUPP rgnProc;
- QDBitsUPP bitsProc;
- QDCommentUPP commentProc;
- QDTxMeasUPP txMeasProc;
- QDGetPicUPP getPicProc;
- QDPutPicUPP putPicProc;
- QDOpcodeUPP opcodeProc;
- UniversalProcPtr newProc1; /* this is the StdPix bottleneck -- see ImageCompression.h */
- QDStdGlyphsUPP glyphsProc; /* was newProc2; now used in Unicode text drawing */
- QDPrinterStatusUPP printerStatusProc; /* was newProc3; now used to communicate status between Printing code and System imaging code */
- UniversalProcPtr newProc4;
- UniversalProcPtr newProc5;
- UniversalProcPtr newProc6;
- };
- typedef struct CQDProcs CQDProcs;
- typedef CQDProcs * CQDProcsPtr;
- #if !OPAQUE_TOOLBOX_STRUCTS
- struct CGrafPort {
- short device;
- PixMapHandle portPixMap; /*port's pixel map*/
- short portVersion; /*high 2 bits always set*/
- Handle grafVars; /*Handle to more fields*/
- short chExtra; /*character extra*/
- short pnLocHFrac; /*pen fraction*/
- Rect portRect;
- RgnHandle visRgn;
- RgnHandle clipRgn;
- PixPatHandle bkPixPat; /*background pattern*/
- RGBColor rgbFgColor; /*RGB components of fg*/
- RGBColor rgbBkColor; /*RGB components of bk*/
- Point pnLoc;
- Point pnSize;
- short pnMode;
- PixPatHandle pnPixPat; /*pen's pattern*/
- PixPatHandle fillPixPat; /*fill pattern*/
- short pnVis;
- short txFont;
- StyleField txFace; /*StyleField occupies 16-bits, but only first 8-bits are used*/
- UInt8 txFlags; /* QuickTime uses second 8 bits of StyleField for txFlags */
- short txMode;
- short txSize;
- Fixed spExtra;
- long fgColor;
- long bkColor;
- short colrBit;
- short patStretch;
- Handle picSave;
- Handle rgnSave;
- Handle polySave;
- CQDProcsPtr grafProcs;
- };
- #endif /* !OPAQUE_TOOLBOX_STRUCTS */
- #if OPAQUE_TOOLBOX_STRUCTS
- typedef WindowPtr CWindowPtr;
- #else
- typedef CGrafPtr CWindowPtr;
- #endif /* OPAQUE_TOOLBOX_STRUCTS */
- struct ReqListRec {
- short reqLSize; /*request list size*/
- short reqLData[1]; /*request list data*/
- };
- typedef struct ReqListRec ReqListRec;
- struct OpenCPicParams {
- Rect srcRect;
- Fixed hRes;
- Fixed vRes;
- short version;
- short reserved1;
- long reserved2;
- };
- typedef struct OpenCPicParams OpenCPicParams;
- enum {
- kCursorImageMajorVersion = 0x0001,
- kCursorImageMinorVersion = 0x0000
- };
- struct CursorImageRec {
- UInt16 majorVersion;
- UInt16 minorVersion;
- PixMapHandle cursorPixMap;
- BitMapHandle cursorBitMask;
- };
- typedef struct CursorImageRec CursorImageRec;
- typedef CursorImageRec * CursorImagePtr;
- typedef CALLBACK_API( void , DeviceLoopDrawingProcPtr )(short depth, short deviceFlags, GDHandle targetDevice, long userData);
- typedef STACK_UPP_TYPE(DeviceLoopDrawingProcPtr) DeviceLoopDrawingUPP;
- #if OPAQUE_UPP_TYPES
- #if CALL_NOT_IN_CARBON
- EXTERN_API(QDPrinterStatusUPP)
- NewQDPrinterStatusUPP (QDPrinterStatusProcPtr userRoutine);
- #endif /* CALL_NOT_IN_CARBON */
- EXTERN_API(DeviceLoopDrawingUPP)
- NewDeviceLoopDrawingUPP (DeviceLoopDrawingProcPtr userRoutine);
- #if CALL_NOT_IN_CARBON
- EXTERN_API(void)
- DisposeQDPrinterStatusUPP (QDPrinterStatusUPP userUPP);
- #endif /* CALL_NOT_IN_CARBON */
- EXTERN_API(void)
- DisposeDeviceLoopDrawingUPP (DeviceLoopDrawingUPP userUPP);
- #if CALL_NOT_IN_CARBON
- EXTERN_API(OSStatus)
- InvokeQDPrinterStatusUPP (PrinterStatusOpcode opcode,
- CGrafPtr currentPort,
- void * printerStatus,
- QDPrinterStatusUPP userUPP);
- #endif /* CALL_NOT_IN_CARBON */
- EXTERN_API(void)
- InvokeDeviceLoopDrawingUPP (short depth,
- short deviceFlags,
- GDHandle targetDevice,
- long userData,
- DeviceLoopDrawingUPP userUPP);
- #else
- enum { uppQDPrinterStatusProcInfo = 0x00000FF1 }; /* 4_bytes Func(4_bytes, 4_bytes, 4_bytes) */
- enum { uppDeviceLoopDrawingProcInfo = 0x00003E80 }; /* pascal no_return_value Func(2_bytes, 2_bytes, 4_bytes, 4_bytes) */
- #define NewQDPrinterStatusUPP(userRoutine) (QDPrinterStatusUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppQDPrinterStatusProcInfo, GetCurrentArchitecture())
- #define NewDeviceLoopDrawingUPP(userRoutine) (DeviceLoopDrawingUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppDeviceLoopDrawingProcInfo, GetCurrentArchitecture())
- #define DisposeQDPrinterStatusUPP(userUPP) DisposeRoutineDescriptor(userUPP)
- #define DisposeDeviceLoopDrawingUPP(userUPP) DisposeRoutineDescriptor(userUPP)
- #define InvokeQDPrinterStatusUPP(opcode, currentPort, printerStatus, userUPP) (OSStatus)CALL_THREE_PARAMETER_UPP((userUPP), uppQDPrinterStatusProcInfo, (opcode), (currentPort), (printerStatus))
- #define InvokeDeviceLoopDrawingUPP(depth, deviceFlags, targetDevice, userData, userUPP) CALL_FOUR_PARAMETER_UPP((userUPP), uppDeviceLoopDrawingProcInfo, (depth), (deviceFlags), (targetDevice), (userData))
- #endif
- /* support for pre-Carbon UPP routines: NewXXXProc and CallXXXProc */
- #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) InvokeDeviceLoopDrawingUPP(depth, deviceFlags, targetDevice, userData, userRoutine)
- #if !OPAQUE_TOOLBOX_STRUCTS
- /* In Carbon, use the QDGlobals accessors such as GetQDGlobalsThePort() */
- struct QDGlobals {
- char privates[76];
- long randSeed;
- BitMap screenBits;
- Cursor arrow;
- Pattern dkGray;
- Pattern ltGray;
- Pattern gray;
- Pattern black;
- Pattern white;
- GrafPtr thePort;
- };
- typedef struct QDGlobals QDGlobals;
- typedef QDGlobals * QDGlobalsPtr;
- typedef QDGlobalsPtr * QDGlobalsHdl;
- extern QDGlobals qd;
- #endif /* !OPAQUE_TOOLBOX_STRUCTS */
- #if CALL_NOT_IN_CARBON
- EXTERN_API( void )
- InitGraf (void * globalPtr) ONEWORDINLINE(0xA86E);
- EXTERN_API( void )
- OpenPort (GrafPtr port) ONEWORDINLINE(0xA86F);
- EXTERN_API( void )
- InitPort (GrafPtr port) ONEWORDINLINE(0xA86D);
- EXTERN_API( void )
- ClosePort (GrafPtr port) ONEWORDINLINE(0xA87D);
- /*
- These are Carbon only routines. They do nothing at all on
- Mac OS 8, but work flawlessly on Mac OS X.
- */
- #endif /* CALL_NOT_IN_CARBON */
- EXTERN_API( OSErr )
- LockPortBits (GrafPtr port);
- EXTERN_API( OSErr )
- UnlockPortBits (GrafPtr port);
- /* Break a region up into rectangles.*/
- enum {
- kQDParseRegionFromTop = (1 << 0),
- kQDParseRegionFromBottom = (1 << 1),
- kQDParseRegionFromLeft = (1 << 2),
- kQDParseRegionFromRight = (1 << 3),
- kQDParseRegionFromTopLeft = kQDParseRegionFromTop | kQDParseRegionFromLeft,
- kQDParseRegionFromBottomRight = kQDParseRegionFromBottom | kQDParseRegionFromRight
- };
- typedef SInt32 QDRegionParseDirection;
- enum {
- kQDRegionToRectsMsgInit = 1,
- kQDRegionToRectsMsgParse = 2,
- kQDRegionToRectsMsgTerminate = 3
- };
- typedef CALLBACK_API_C( OSStatus , RegionToRectsProcPtr )(UInt16 message, RgnHandle rgn, const Rect *rect, void *refCon);
- typedef STACK_UPP_TYPE(RegionToRectsProcPtr) RegionToRectsUPP;
- #if OPAQUE_UPP_TYPES
- EXTERN_API(RegionToRectsUPP)
- NewRegionToRectsUPP (RegionToRectsProcPtr userRoutine);
- EXTERN_API(void)
- DisposeRegionToRectsUPP (RegionToRectsUPP userUPP);
- EXTERN_API(OSStatus)
- InvokeRegionToRectsUPP (UInt16 message,
- RgnHandle rgn,
- const Rect * rect,
- void * refCon,
- RegionToRectsUPP userUPP);
- #else
- enum { uppRegionToRectsProcInfo = 0x00003FB1 }; /* 4_bytes Func(2_bytes, 4_bytes, 4_bytes, 4_bytes) */
- #define NewRegionToRectsUPP(userRoutine) (RegionToRectsUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppRegionToRectsProcInfo, GetCurrentArchitecture())
- #define DisposeRegionToRectsUPP(userUPP) DisposeRoutineDescriptor(userUPP)
- #define InvokeRegionToRectsUPP(message, rgn, rect, refCon, userUPP) (OSStatus)CALL_FOUR_PARAMETER_UPP((userUPP), uppRegionToRectsProcInfo, (message), (rgn), (rect), (refCon))
- #endif
- /* support for pre-Carbon UPP routines: NewXXXProc and CallXXXProc */
- #define NewRegionToRectsProc(userRoutine) NewRegionToRectsUPP(userRoutine)
- #define CallRegionToRectsProc(userRoutine, message, rgn, rect, refCon) InvokeRegionToRectsUPP(message, rgn, rect, refCon, userRoutine)
- EXTERN_API_C( OSStatus )
- QDRegionToRects (RgnHandle rgn,
- QDRegionParseDirection dir,
- RegionToRectsUPP proc,
- void * userData);
- #if !TARGET_OS_MAC || TARGET_API_MAC_OSX
- #if CALL_NOT_IN_CARBON
- EXTERN_API( OSErr )
- UpdatePort (GrafPtr port);
- EXTERN_API( void *)
- GetPortNativeWindow (GrafPtr macPort);
- EXTERN_API( GrafPtr )
- GetNativeWindowPort (void * nativeWindow);
- EXTERN_API( void *)
- MacRegionToNativeRegion (RgnHandle macRegion);
- EXTERN_API( RgnHandle )
- NativeRegionToMacRegion (void * nativeRegion);
- #endif /* CALL_NOT_IN_CARBON */
- #endif /* !TARGET_OS_MAC || TARGET_API_MAC_OSX */
- #if TARGET_OS_WIN32
- #if CALL_NOT_IN_CARBON
- EXTERN_API( void *)
- GetPortHWND (GrafPtr port);