CMCalibrator.h
上传用户:xjjlds
上传日期:2015-12-05
资源大小:22823k
文件大小:10k
源码类别:

多媒体编程

开发平台:

Visual C++

  1. /*
  2.      File:       CMCalibrator.h
  3.  
  4.      Contains:   ColorSync Calibration API
  5.  
  6.      Version:    Technology: ColorSync 2.5
  7.                  Release:    QuickTime 6.0.2
  8.  
  9.      Copyright:  (c) 1998-2001 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:      For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __CMCALIBRATOR__
  18. #define __CMCALIBRATOR__
  19. #ifndef __CMAPPLICATION__
  20. #include "CMApplication.h"
  21. #endif
  22. #ifndef __DISPLAYS__
  23. #include "Displays.h"
  24. #endif
  25. #ifndef __MACERRORS__
  26. #include "MacErrors.h"
  27. #endif
  28. #if PRAGMA_ONCE
  29. #pragma once
  30. #endif
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif
  34. #if PRAGMA_IMPORT
  35. #pragma import on
  36. #endif
  37. #if PRAGMA_STRUCT_ALIGN
  38.     #pragma options align=mac68k
  39. #elif PRAGMA_STRUCT_PACKPUSH
  40.     #pragma pack(push, 2)
  41. #elif PRAGMA_STRUCT_PACK
  42.     #pragma pack(2)
  43. #endif
  44. typedef CALLBACK_API( void , CalibrateEventProcPtr )(EventRecord *event);
  45. typedef STACK_UPP_TYPE(CalibrateEventProcPtr)                   CalibrateEventUPP;
  46. /* Interface for new ColorSync monitor calibrators (ColorSync 2.6 and greater) */
  47. enum {
  48.     kCalibratorNamePrefix       = FOUR_CHAR_CODE('cali')
  49. };
  50. struct CalibratorInfo {
  51.     UInt32                          dataSize;                   /* Size of this structure - compatibility */
  52.     AVIDType                        displayID;                  /* Contains an hDC on Win32 */
  53.     UInt32                          profileLocationSize;        /* Max size for returned profile location */
  54.     CMProfileLocation *             profileLocationPtr;         /* For returning the profile */
  55.     CalibrateEventUPP               eventProc;                  /* Ignored on Win32 */
  56.     Boolean                         isGood;                     /* true or false */
  57. };
  58. typedef struct CalibratorInfo           CalibratorInfo;
  59. typedef CALLBACK_API( Boolean , CanCalibrateProcPtr )(AVIDType displayID, Str255 errMessage);
  60. typedef CALLBACK_API( OSErr , CalibrateProcPtr )(CalibratorInfo *theInfo);
  61. typedef STACK_UPP_TYPE(CanCalibrateProcPtr)                     CanCalibrateUPP;
  62. typedef STACK_UPP_TYPE(CalibrateProcPtr)                        CalibrateUPP;
  63. #if OPAQUE_UPP_TYPES
  64.     EXTERN_API(CalibrateEventUPP)
  65.     NewCalibrateEventUPP           (CalibrateEventProcPtr   userRoutine);
  66.     EXTERN_API(CanCalibrateUPP)
  67.     NewCanCalibrateUPP             (CanCalibrateProcPtr     userRoutine);
  68.     EXTERN_API(CalibrateUPP)
  69.     NewCalibrateUPP                (CalibrateProcPtr        userRoutine);
  70.     EXTERN_API(void)
  71.     DisposeCalibrateEventUPP       (CalibrateEventUPP       userUPP);
  72.     EXTERN_API(void)
  73.     DisposeCanCalibrateUPP         (CanCalibrateUPP         userUPP);
  74.     EXTERN_API(void)
  75.     DisposeCalibrateUPP            (CalibrateUPP            userUPP);
  76.     EXTERN_API(void)
  77.     InvokeCalibrateEventUPP        (EventRecord *           event,
  78.                                     CalibrateEventUPP       userUPP);
  79.     EXTERN_API(Boolean)
  80.     InvokeCanCalibrateUPP          (AVIDType                displayID,
  81.                                     Str255                  errMessage,
  82.                                     CanCalibrateUPP         userUPP);
  83.     EXTERN_API(OSErr)
  84.     InvokeCalibrateUPP             (CalibratorInfo *        theInfo,
  85.                                     CalibrateUPP            userUPP);
  86. #else
  87.     enum { uppCalibrateEventProcInfo = 0x000000C0 };                /* pascal no_return_value Func(4_bytes) */
  88.     enum { uppCanCalibrateProcInfo = 0x000003D0 };                  /* pascal 1_byte Func(4_bytes, 4_bytes) */
  89.     enum { uppCalibrateProcInfo = 0x000000E0 };                     /* pascal 2_bytes Func(4_bytes) */
  90.     #define NewCalibrateEventUPP(userRoutine)                       (CalibrateEventUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCalibrateEventProcInfo, GetCurrentArchitecture())
  91.     #define NewCanCalibrateUPP(userRoutine)                         (CanCalibrateUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCanCalibrateProcInfo, GetCurrentArchitecture())
  92.     #define NewCalibrateUPP(userRoutine)                            (CalibrateUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCalibrateProcInfo, GetCurrentArchitecture())
  93.     #define DisposeCalibrateEventUPP(userUPP)                       DisposeRoutineDescriptor(userUPP)
  94.     #define DisposeCanCalibrateUPP(userUPP)                         DisposeRoutineDescriptor(userUPP)
  95.     #define DisposeCalibrateUPP(userUPP)                            DisposeRoutineDescriptor(userUPP)
  96.     #define InvokeCalibrateEventUPP(event, userUPP)                 CALL_ONE_PARAMETER_UPP((userUPP), uppCalibrateEventProcInfo, (event))
  97.     #define InvokeCanCalibrateUPP(displayID, errMessage, userUPP)   (Boolean)CALL_TWO_PARAMETER_UPP((userUPP), uppCanCalibrateProcInfo, (displayID), (errMessage))
  98.     #define InvokeCalibrateUPP(theInfo, userUPP)                    (OSErr)CALL_ONE_PARAMETER_UPP((userUPP), uppCalibrateProcInfo, (theInfo))
  99. #endif
  100. /* support for pre-Carbon UPP routines: NewXXXProc and CallXXXProc */
  101. #define NewCalibrateEventProc(userRoutine)                      NewCalibrateEventUPP(userRoutine)
  102. #define NewCanCalibrateProc(userRoutine)                        NewCanCalibrateUPP(userRoutine)
  103. #define NewCalibrateProc(userRoutine)                           NewCalibrateUPP(userRoutine)
  104. #define CallCalibrateEventProc(userRoutine, event)              InvokeCalibrateEventUPP(event, userRoutine)
  105. #define CallCanCalibrateProc(userRoutine, displayID, errMessage) InvokeCanCalibrateUPP(displayID, errMessage, userRoutine)
  106. #define CallCalibrateProc(userRoutine, theInfo)                 InvokeCalibrateUPP(theInfo, userRoutine)
  107. #if OLDROUTINENAMES
  108. /* Interface for original ColorSync monitor calibrators (ColorSync 2.5.x) */
  109. enum {
  110.     kOldCalibratorNamePrefix    = FOUR_CHAR_CODE('Cali')
  111. };
  112. struct OldCalibratorInfo {
  113.     AVIDType                        displayID;                  /* Contains an hDC on Win32 */
  114.     CMProfileLocation               profileLocation;
  115.     CalibrateEventUPP               eventProc;                  /* Ignored on Win32 */
  116.     UInt32                          reserved;                   /* Unused */
  117.     UInt32                          flags;                      /* Unused */
  118.     Boolean                         isGood;                     /* true or false */
  119.     SInt8                           byteFiller;                 /* Unused */
  120. };
  121. typedef struct OldCalibratorInfo        OldCalibratorInfo;
  122. typedef CALLBACK_API( Boolean , OldCanCalibrateProcPtr )(AVIDType displayID);
  123. typedef CALLBACK_API( OSErr , OldCalibrateProcPtr )(OldCalibratorInfo *theInfo);
  124. typedef STACK_UPP_TYPE(OldCanCalibrateProcPtr)                  OldCanCalibrateUPP;
  125. typedef STACK_UPP_TYPE(OldCalibrateProcPtr)                     OldCalibrateUPP;
  126. #if OPAQUE_UPP_TYPES
  127. #if CALL_NOT_IN_CARBON
  128.     EXTERN_API(OldCanCalibrateUPP)
  129.     NewOldCanCalibrateUPP          (OldCanCalibrateProcPtr  userRoutine);
  130.     EXTERN_API(OldCalibrateUPP)
  131.     NewOldCalibrateUPP             (OldCalibrateProcPtr     userRoutine);
  132.     EXTERN_API(void)
  133.     DisposeOldCanCalibrateUPP      (OldCanCalibrateUPP      userUPP);
  134.     EXTERN_API(void)
  135.     DisposeOldCalibrateUPP         (OldCalibrateUPP         userUPP);
  136.     EXTERN_API(Boolean)
  137.     InvokeOldCanCalibrateUPP       (AVIDType                displayID,
  138.                                     OldCanCalibrateUPP      userUPP);
  139.     EXTERN_API(OSErr)
  140.     InvokeOldCalibrateUPP          (OldCalibratorInfo *     theInfo,
  141.                                     OldCalibrateUPP         userUPP);
  142. #endif  /* CALL_NOT_IN_CARBON */
  143. #else
  144.     enum { uppOldCanCalibrateProcInfo = 0x000000D0 };               /* pascal 1_byte Func(4_bytes) */
  145.     enum { uppOldCalibrateProcInfo = 0x000000E0 };                  /* pascal 2_bytes Func(4_bytes) */
  146.     #define NewOldCanCalibrateUPP(userRoutine)                      (OldCanCalibrateUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppOldCanCalibrateProcInfo, GetCurrentArchitecture())
  147.     #define NewOldCalibrateUPP(userRoutine)                         (OldCalibrateUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppOldCalibrateProcInfo, GetCurrentArchitecture())
  148.     #define DisposeOldCanCalibrateUPP(userUPP)                      DisposeRoutineDescriptor(userUPP)
  149.     #define DisposeOldCalibrateUPP(userUPP)                         DisposeRoutineDescriptor(userUPP)
  150.     #define InvokeOldCanCalibrateUPP(displayID, userUPP)            (Boolean)CALL_ONE_PARAMETER_UPP((userUPP), uppOldCanCalibrateProcInfo, (displayID))
  151.     #define InvokeOldCalibrateUPP(theInfo, userUPP)                 (OSErr)CALL_ONE_PARAMETER_UPP((userUPP), uppOldCalibrateProcInfo, (theInfo))
  152. #endif
  153. /* support for pre-Carbon UPP routines: NewXXXProc and CallXXXProc */
  154. #define NewOldCanCalibrateProc(userRoutine)                     NewOldCanCalibrateUPP(userRoutine)
  155. #define NewOldCalibrateProc(userRoutine)                        NewOldCalibrateUPP(userRoutine)
  156. #define CallOldCanCalibrateProc(userRoutine, displayID)         InvokeOldCanCalibrateUPP(displayID, userRoutine)
  157. #define CallOldCalibrateProc(userRoutine, theInfo)              InvokeOldCalibrateUPP(theInfo, userRoutine)
  158. #endif  /* OLDROUTINENAMES */
  159. #if PRAGMA_STRUCT_ALIGN
  160.     #pragma options align=reset
  161. #elif PRAGMA_STRUCT_PACKPUSH
  162.     #pragma pack(pop)
  163. #elif PRAGMA_STRUCT_PACK
  164.     #pragma pack()
  165. #endif
  166. #ifdef PRAGMA_IMPORT_OFF
  167. #pragma import off
  168. #elif PRAGMA_IMPORT
  169. #pragma import reset
  170. #endif
  171. #ifdef __cplusplus
  172. }
  173. #endif
  174. #endif /* __CMCALIBRATOR__ */