/* File: PIGeneral.h Copyright 1992 by Adobe Systems, Inc. All rights reserved. This file describes the elements common to all plug-in interfaces. */ #ifndef __PIGeneral__ #define __PIGeneral__ #include "PITypes.h" #ifdef __powerc #include #endif #pragma options align=mac68k typedef struct PlugInInfo { short version; /* The version number of the interface supported. */ short subVersion; /* The sub-version number. */ short priority; /* The plug-in's priority. */ short generalInfoSize; /* The size of the general info. */ short typeInfoSize; /* The size of the type specific info. */ short supportsMode; /* A bit mask indicating supported image modes. */ OSType requireHost; /* A required host if any. */ } PlugInInfo; typedef struct PSBuffer *BufferID; #define kPIGeneralInfoSize 16 /* Image modes */ #define plugInModeBitmap 0 #define plugInModeGrayScale 1 #define plugInModeIndexedColor 2 #define plugInModeRGBColor 3 #define plugInModeCMYKColor 4 #define plugInModeHSLColor 5 #define plugInModeHSBColor 6 #define plugInModeMultichannel 7 #define plugInModeDuotone 8 #define plugInModeLabColor 9 #define plugInModeGray16 10 #define plugInModeRGB48 11 /* The Window procID for a Moveable Modal Dialog window that can be used * under System 6. WDEF(128) is part of Photoshop. */ #define PSmovableDBoxProc (128*16+5) /* Other commonly used structures */ typedef short PlaneMap [16]; typedef struct PlugInMonitor { Fixed gamma; Fixed redX; Fixed redY; Fixed greenX; Fixed greenY; Fixed blueX; Fixed blueY; Fixed whiteX; Fixed whiteY; Fixed ambient; } PlugInMonitor; typedef struct PSPixelMap { int32 version; VRect bounds; int32 imageMode; int32 rowBytes; int32 colBytes; int32 planeBytes; void *baseAddr; } PSPixelMap; #ifdef __cplusplus extern "C" { #endif typedef MACPASCAL Boolean (*TestAbortProc) (void); typedef MACPASCAL void (*ProgressProc) (int32 done, int32 total); typedef MACPASCAL void (*HostProc) (int16 selector, int32 *data); typedef MACPASCAL int32 (*SpaceProc) (void); typedef MACPASCAL Handle (*NewPIHandleProc) (int32 size); typedef MACPASCAL void (*DisposePIHandleProc) (Handle h); typedef MACPASCAL int32 (*GetPIHandleSizeProc) (Handle h); typedef MACPASCAL OSErr (*SetPIHandleSizeProc) (Handle h, int32 newSize); typedef MACPASCAL Ptr (*LockPIHandleProc) (Handle h, Boolean moveHigh); typedef MACPASCAL void (*UnlockPIHandleProc) (Handle h); typedef MACPASCAL OSErr (*AllocateBufferProc) (int32 size, BufferID *bufferID); typedef MACPASCAL Ptr (*LockBufferProc) (BufferID bufferID, Boolean moveHigh); typedef MACPASCAL void (*UnlockBufferProc) (BufferID bufferID); typedef MACPASCAL void (*FreeBufferProc) (BufferID bufferID); typedef MACPASCAL int32 (*BufferSpaceProc) (void); typedef MACPASCAL int16 (*CountPIResourcesProc) (ResType type); typedef MACPASCAL Handle (*GetPIResourceProc) (ResType type, int16 index); typedef MACPASCAL void (*DeletePIResourceProc) (ResType type, int16 index); typedef MACPASCAL OSErr (*AddPIResourceProc) (ResType type, Handle data); typedef MACPASCAL void (*ProcessEventProc) (void *event); typedef MACPASCAL OSErr (*DisplayPixelsProc) (const PSPixelMap *source, const VRect *srcRect, int32 dstRow, int32 dstCol, unsigned32 platformContext); #ifdef __powerc enum { uppTestAbortProcInfo = kPascalStackBased | RESULT_SIZE(SIZE_CODE(sizeof(Boolean))), uppProgressProcInfo = kPascalStackBased | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(int32))) | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(int32))), uppHostProcInfo = kPascalStackBased | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(int16))) | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(int32 *))), uppSpaceProcInfo = kPascalStackBased | RESULT_SIZE(SIZE_CODE(sizeof(int32))), uppNewPIHandleProcInfo = kPascalStackBased | RESULT_SIZE(SIZE_CODE(sizeof(Handle))) | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(int32))), uppDisposePIHandleProcInfo = kPascalStackBased | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(Handle))), uppGetPIHandleSizeProcInfo = kPascalStackBased | RESULT_SIZE(SIZE_CODE(sizeof(int32))) | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(Handle))), uppSetPIHandleSizeProcInfo = kPascalStackBased | RESULT_SIZE(SIZE_CODE(sizeof(OSErr))) | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(Handle))) | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(int32))), uppLockPIHandleProcInfo = kPascalStackBased | RESULT_SIZE(SIZE_CODE(sizeof(Ptr))) | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(Handle))) | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(Boolean))), uppUnlockPIHandleProcInfo = kPascalStackBased | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(Handle))), uppAllocateBufferProcInfo = kPascalStackBased | RESULT_SIZE(SIZE_CODE(sizeof(OSErr))) | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(int32))) | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(BufferID *))), uppLockBufferProcInfo = kPascalStackBased | RESULT_SIZE(SIZE_CODE(sizeof(Ptr))) | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(BufferID))) | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(Boolean))), uppUnlockBufferProcInfo = kPascalStackBased | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(BufferID))), uppFreeBufferProcInfo = kPascalStackBased | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(BufferID))), uppBufferSpaceProcInfo = kPascalStackBased | RESULT_SIZE(SIZE_CODE(sizeof(int32))), uppCountPIResourcesProcInfo = kPascalStackBased | RESULT_SIZE(SIZE_CODE(sizeof(int16))) | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(ResType))), uppGetPIResourceProcInfo = kPascalStackBased | RESULT_SIZE(SIZE_CODE(sizeof(Handle))) | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(ResType))) | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(int16))), uppDeletePIResourceProcInfo = kPascalStackBased | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(ResType))) | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(int16))), uppAddPIResourceProcInfo = kPascalStackBased | RESULT_SIZE(SIZE_CODE(sizeof(OSErr))) | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(ResType))) | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(Handle))), uppProcessEventProcInfo = kPascalStackBased | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(void *))), uppDisplayPixelsProcInfo = kPascalStackBased | RESULT_SIZE(SIZE_CODE(sizeof(OSErr))) | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(PSPixelMap *))) | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(VRect *))) | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(int32))) | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(int32))) | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(unsigned32))) }; #endif #ifdef __cplusplus }; #endif #define kCurrentBufferProcsVersion 2 typedef struct BufferProcs { int16 bufferProcsVersion; int16 numBufferProcs; AllocateBufferProc allocateProc; LockBufferProc lockProc; UnlockBufferProc unlockProc; FreeBufferProc freeProc; BufferSpaceProc spaceProc; } BufferProcs; #define kCurrentBufferProcsCount \ ((sizeof(BufferProcs) - offsetof(BufferProcs, allocateProc)) / sizeof(void *)) #define kCurrentResourceProcsVersion 3 typedef struct ResourceProcs { int16 resourceProcsVersion; int16 numResourceProcs; CountPIResourcesProc countProc; GetPIResourceProc getProc; DeletePIResourceProc deleteProc; AddPIResourceProc addProc; } ResourceProcs; #define kCurrentResourceProcsCount \ ((sizeof(ResourceProcs) - offsetof(ResourceProcs, countProc)) / sizeof(void *)) #define kCurrentHandleProcsVersion 1 typedef struct HandleProcs { int16 handleProcsVersion; int16 numHandleProcs; NewPIHandleProc newProc; DisposePIHandleProc disposeProc; GetPIHandleSizeProc getSizeProc; SetPIHandleSizeProc setSizeProc; LockPIHandleProc lockProc; UnlockPIHandleProc unlockProc; } HandleProcs; #define kCurrentHandleProcsCount \ ((sizeof(HandleProcs) - offsetof(HandleProcs, newProc)) / sizeof(void *)) #pragma options align=reset #endif