home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 April: Mac OS SDK / Dev.CD Apr 00 SDK1.toast / Development Kits / Mac OS / ColorSync 3.0 Mac SDK / Interfaces / CMScriptingPlugin.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-10-28  |  28.7 KB  |  561 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        CMScriptingPlugin.h
  3.  
  4.      Contains:    ColorSync Scripting Plugin API
  5.  
  6.      Version:    Technology:    ColorSync 2.5
  7.                  Release:    ColorSync 3.0 SDK for use with Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1998-1999 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 __CMSCRIPTINGPLUGIN__
  18. #define __CMSCRIPTINGPLUGIN__
  19.  
  20. #ifndef __FILES__
  21. #include <Files.h>
  22. #endif
  23.  
  24. #ifndef __CMAPPLICATION__
  25. #include <CMApplication.h>
  26. #endif
  27.  
  28. #ifndef __CODEFRAGMENTS__
  29. #include <CodeFragments.h>
  30. #endif
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37. #if PRAGMA_ONCE
  38. #pragma once
  39. #endif
  40.  
  41. #ifdef __cplusplus
  42. extern "C" {
  43. #endif
  44.  
  45. #if PRAGMA_IMPORT
  46. #pragma import on
  47. #endif
  48.  
  49. #if PRAGMA_STRUCT_ALIGN
  50.     #pragma options align=mac68k
  51. #elif PRAGMA_STRUCT_PACKPUSH
  52.     #pragma pack(push, 2)
  53. #elif PRAGMA_STRUCT_PACK
  54.     #pragma pack(2)
  55. #endif
  56.  
  57. enum {
  58.                                                                 /* ColorSync Scripting AppleEvent Errors */
  59.     cmspInvalidImageFile        = -4220,                        /* Plugin cannot handle this image file type */
  60.     cmspInvalidImageSpace        = -4221,                        /* Plugin cannot create an image file of this colorspace */
  61.     cmspInvalidProfileEmbed        = -4222,                        /* Specific invalid profile errors */
  62.     cmspInvalidProfileSource    = -4223,
  63.     cmspInvalidProfileDest        = -4224,
  64.     cmspInvalidProfileProof        = -4225,
  65.     cmspInvalidProfileLink        = -4226
  66. };
  67.  
  68.  
  69. /**** embedFlags field  ****/
  70. /* reserved for future use: currently 0 */
  71.  
  72. /**** matchFlags field  ****/
  73. enum {
  74.     cmspFavorEmbeddedMask        = 0x00000001                    /* if bit 0 is 0 then use srcProf profile, if 1 then use profile embedded in image if present*/
  75. };
  76.  
  77.  
  78. /**** scripting plugin entry points  ****/
  79. typedef CALLBACK_API_C( CMError , ValidateImageProcPtr )(const FSSpec *spec);
  80. typedef CALLBACK_API_C( CMError , GetImageSpaceProcPtr )(const FSSpec *spec, OSType *space);
  81. typedef CALLBACK_API_C( CMError , ValidateSpaceProcPtr )(const FSSpec *spec, OSType *space);
  82. typedef CALLBACK_API_C( CMError , EmbedImageProcPtr )(const FSSpec *specFrom, const FSSpec *specInto, CMProfileRef embedProf, UInt32 embedFlags);
  83. typedef CALLBACK_API_C( CMError , UnembedImageProcPtr )(const FSSpec *specFrom, const FSSpec *specInto);
  84. typedef CALLBACK_API_C( CMError , MatchImageProcPtr )(const FSSpec *specFrom, const FSSpec *specInto, UInt32 qual, UInt32 srcIntent, CMProfileRef srcProf, CMProfileRef dstProf, CMProfileRef prfProf, UInt32 matchFlags);
  85. typedef CALLBACK_API_C( CMError , CountImageProfilesProcPtr )(const FSSpec *spec, UInt32 *count);
  86. typedef CALLBACK_API_C( CMError , GetIndImageProfileProcPtr )(const FSSpec *spec, UInt32 index, CMProfileRef *prof);
  87. typedef CALLBACK_API_C( CMError , SetIndImageProfileProcPtr )(const FSSpec *specFrom, const FSSpec *specInto, UInt32 index, CMProfileRef prof, UInt32 embedFlags);
  88. /**** CSScriptingLib entry points  ****/
  89. typedef CALLBACK_API_C( CMError , CMValidImageProcPtr )(const FSSpec *spec);
  90. typedef CALLBACK_API_C( CMError , CMGetImageSpaceProcPtr )(const FSSpec *spec, OSType *space);
  91. typedef CALLBACK_API_C( CMError , CMEmbedImageProcPtr )(const FSSpec *specFrom, const FSSpec *specInto, Boolean repl, CMProfileRef embProf);
  92. typedef CALLBACK_API_C( CMError , CMUnembedImageProcPtr )(const FSSpec *specFrom, const FSSpec *specInto, Boolean repl);
  93. typedef CALLBACK_API_C( CMError , CMMatchImageProcPtr )(const FSSpec *specFrom, const FSSpec *specInto, Boolean repl, UInt32 qual, CMProfileRef srcProf, UInt32 srcIntent, CMProfileRef dstProf);
  94. typedef CALLBACK_API_C( CMError , CMProofImageProcPtr )(const FSSpec *specFrom, const FSSpec *specInto, Boolean repl, UInt32 qual, CMProfileRef srcProf, UInt32 srcIntent, CMProfileRef dstProf, CMProfileRef prfProf);
  95. typedef CALLBACK_API_C( CMError , CMLinkImageProcPtr )(const FSSpec *specFrom, const FSSpec *specInto, Boolean repl, UInt32 qual, CMProfileRef lnkProf, UInt32 lnkIntent);
  96. typedef CALLBACK_API_C( CMError , CMCountImageProfilesProcPtr )(const FSSpec *spec, UInt32 *count);
  97. typedef CALLBACK_API_C( CMError , CMGetIndImageProfileProcPtr )(const FSSpec *spec, UInt32 index, CMProfileRef *prof);
  98. typedef CALLBACK_API_C( CMError , CMSetIndImageProfileProcPtr )(const FSSpec *specFrom, const FSSpec *specInto, Boolean repl, UInt32 index, CMProfileRef prof);
  99. typedef STACK_UPP_TYPE(ValidateImageProcPtr)                     ValidateImageUPP;
  100. typedef STACK_UPP_TYPE(GetImageSpaceProcPtr)                     GetImageSpaceUPP;
  101. typedef STACK_UPP_TYPE(ValidateSpaceProcPtr)                     ValidateSpaceUPP;
  102. typedef STACK_UPP_TYPE(EmbedImageProcPtr)                         EmbedImageUPP;
  103. typedef STACK_UPP_TYPE(UnembedImageProcPtr)                     UnembedImageUPP;
  104. typedef STACK_UPP_TYPE(MatchImageProcPtr)                         MatchImageUPP;
  105. typedef STACK_UPP_TYPE(CountImageProfilesProcPtr)                 CountImageProfilesUPP;
  106. typedef STACK_UPP_TYPE(GetIndImageProfileProcPtr)                 GetIndImageProfileUPP;
  107. typedef STACK_UPP_TYPE(SetIndImageProfileProcPtr)                 SetIndImageProfileUPP;
  108. typedef STACK_UPP_TYPE(CMValidImageProcPtr)                     CMValidImageUPP;
  109. typedef STACK_UPP_TYPE(CMGetImageSpaceProcPtr)                     CMGetImageSpaceUPP;
  110. typedef STACK_UPP_TYPE(CMEmbedImageProcPtr)                     CMEmbedImageUPP;
  111. typedef STACK_UPP_TYPE(CMUnembedImageProcPtr)                     CMUnembedImageUPP;
  112. typedef STACK_UPP_TYPE(CMMatchImageProcPtr)                     CMMatchImageUPP;
  113. typedef STACK_UPP_TYPE(CMProofImageProcPtr)                     CMProofImageUPP;
  114. typedef STACK_UPP_TYPE(CMLinkImageProcPtr)                         CMLinkImageUPP;
  115. typedef STACK_UPP_TYPE(CMCountImageProfilesProcPtr)             CMCountImageProfilesUPP;
  116. typedef STACK_UPP_TYPE(CMGetIndImageProfileProcPtr)             CMGetIndImageProfileUPP;
  117. typedef STACK_UPP_TYPE(CMSetIndImageProfileProcPtr)             CMSetIndImageProfileUPP;
  118. #if OPAQUE_UPP_TYPES
  119.     EXTERN_API(ValidateImageUPP)
  120.     NewValidateImageUPP               (ValidateImageProcPtr    userRoutine);
  121.  
  122.     EXTERN_API(GetImageSpaceUPP)
  123.     NewGetImageSpaceUPP               (GetImageSpaceProcPtr    userRoutine);
  124.  
  125.     EXTERN_API(ValidateSpaceUPP)
  126.     NewValidateSpaceUPP               (ValidateSpaceProcPtr    userRoutine);
  127.  
  128.     EXTERN_API(EmbedImageUPP)
  129.     NewEmbedImageUPP               (EmbedImageProcPtr        userRoutine);
  130.  
  131.     EXTERN_API(UnembedImageUPP)
  132.     NewUnembedImageUPP               (UnembedImageProcPtr        userRoutine);
  133.  
  134.     EXTERN_API(MatchImageUPP)
  135.     NewMatchImageUPP               (MatchImageProcPtr        userRoutine);
  136.  
  137.     EXTERN_API(CountImageProfilesUPP)
  138.     NewCountImageProfilesUPP       (CountImageProfilesProcPtr userRoutine);
  139.  
  140.     EXTERN_API(GetIndImageProfileUPP)
  141.     NewGetIndImageProfileUPP       (GetIndImageProfileProcPtr userRoutine);
  142.  
  143.     EXTERN_API(SetIndImageProfileUPP)
  144.     NewSetIndImageProfileUPP       (SetIndImageProfileProcPtr userRoutine);
  145.  
  146.     EXTERN_API(CMValidImageUPP)
  147.     NewCMValidImageUPP               (CMValidImageProcPtr        userRoutine);
  148.  
  149.     EXTERN_API(CMGetImageSpaceUPP)
  150.     NewCMGetImageSpaceUPP           (CMGetImageSpaceProcPtr    userRoutine);
  151.  
  152.     EXTERN_API(CMEmbedImageUPP)
  153.     NewCMEmbedImageUPP               (CMEmbedImageProcPtr        userRoutine);
  154.  
  155.     EXTERN_API(CMUnembedImageUPP)
  156.     NewCMUnembedImageUPP           (CMUnembedImageProcPtr    userRoutine);
  157.  
  158.     EXTERN_API(CMMatchImageUPP)
  159.     NewCMMatchImageUPP               (CMMatchImageProcPtr        userRoutine);
  160.  
  161.     EXTERN_API(CMProofImageUPP)
  162.     NewCMProofImageUPP               (CMProofImageProcPtr        userRoutine);
  163.  
  164.     EXTERN_API(CMLinkImageUPP)
  165.     NewCMLinkImageUPP               (CMLinkImageProcPtr        userRoutine);
  166.  
  167.     EXTERN_API(CMCountImageProfilesUPP)
  168.     NewCMCountImageProfilesUPP       (CMCountImageProfilesProcPtr userRoutine);
  169.  
  170.     EXTERN_API(CMGetIndImageProfileUPP)
  171.     NewCMGetIndImageProfileUPP       (CMGetIndImageProfileProcPtr userRoutine);
  172.  
  173.     EXTERN_API(CMSetIndImageProfileUPP)
  174.     NewCMSetIndImageProfileUPP       (CMSetIndImageProfileProcPtr userRoutine);
  175.  
  176.     EXTERN_API(void)
  177.     DisposeValidateImageUPP           (ValidateImageUPP        userUPP);
  178.  
  179.     EXTERN_API(void)
  180.     DisposeGetImageSpaceUPP           (GetImageSpaceUPP        userUPP);
  181.  
  182.     EXTERN_API(void)
  183.     DisposeValidateSpaceUPP           (ValidateSpaceUPP        userUPP);
  184.  
  185.     EXTERN_API(void)
  186.     DisposeEmbedImageUPP           (EmbedImageUPP            userUPP);
  187.  
  188.     EXTERN_API(void)
  189.     DisposeUnembedImageUPP           (UnembedImageUPP            userUPP);
  190.  
  191.     EXTERN_API(void)
  192.     DisposeMatchImageUPP           (MatchImageUPP            userUPP);
  193.  
  194.     EXTERN_API(void)
  195.     DisposeCountImageProfilesUPP    (CountImageProfilesUPP    userUPP);
  196.  
  197.     EXTERN_API(void)
  198.     DisposeGetIndImageProfileUPP    (GetIndImageProfileUPP    userUPP);
  199.  
  200.     EXTERN_API(void)
  201.     DisposeSetIndImageProfileUPP    (SetIndImageProfileUPP    userUPP);
  202.  
  203.     EXTERN_API(void)
  204.     DisposeCMValidImageUPP           (CMValidImageUPP            userUPP);
  205.  
  206.     EXTERN_API(void)
  207.     DisposeCMGetImageSpaceUPP       (CMGetImageSpaceUPP        userUPP);
  208.  
  209.     EXTERN_API(void)
  210.     DisposeCMEmbedImageUPP           (CMEmbedImageUPP            userUPP);
  211.  
  212.     EXTERN_API(void)
  213.     DisposeCMUnembedImageUPP       (CMUnembedImageUPP        userUPP);
  214.  
  215.     EXTERN_API(void)
  216.     DisposeCMMatchImageUPP           (CMMatchImageUPP            userUPP);
  217.  
  218.     EXTERN_API(void)
  219.     DisposeCMProofImageUPP           (CMProofImageUPP            userUPP);
  220.  
  221.     EXTERN_API(void)
  222.     DisposeCMLinkImageUPP           (CMLinkImageUPP            userUPP);
  223.  
  224.     EXTERN_API(void)
  225.     DisposeCMCountImageProfilesUPP    (CMCountImageProfilesUPP userUPP);
  226.  
  227.     EXTERN_API(void)
  228.     DisposeCMGetIndImageProfileUPP    (CMGetIndImageProfileUPP userUPP);
  229.  
  230.     EXTERN_API(void)
  231.     DisposeCMSetIndImageProfileUPP    (CMSetIndImageProfileUPP userUPP);
  232.  
  233.     EXTERN_API(CMError)
  234.     InvokeValidateImageUPP           (const FSSpec *            spec,
  235.                                     ValidateImageUPP        userUPP);
  236.  
  237.     EXTERN_API(CMError)
  238.     InvokeGetImageSpaceUPP           (const FSSpec *            spec,
  239.                                     OSType *                space,
  240.                                     GetImageSpaceUPP        userUPP);
  241.  
  242.     EXTERN_API(CMError)
  243.     InvokeValidateSpaceUPP           (const FSSpec *            spec,
  244.                                     OSType *                space,
  245.                                     ValidateSpaceUPP        userUPP);
  246.  
  247.     EXTERN_API(CMError)
  248.     InvokeEmbedImageUPP               (const FSSpec *            specFrom,
  249.                                     const FSSpec *            specInto,
  250.                                     CMProfileRef            embedProf,
  251.                                     UInt32                    embedFlags,
  252.                                     EmbedImageUPP            userUPP);
  253.  
  254.     EXTERN_API(CMError)
  255.     InvokeUnembedImageUPP           (const FSSpec *            specFrom,
  256.                                     const FSSpec *            specInto,
  257.                                     UnembedImageUPP            userUPP);
  258.  
  259.     EXTERN_API(CMError)
  260.     InvokeMatchImageUPP               (const FSSpec *            specFrom,
  261.                                     const FSSpec *            specInto,
  262.                                     UInt32                    qual,
  263.                                     UInt32                    srcIntent,
  264.                                     CMProfileRef            srcProf,
  265.                                     CMProfileRef            dstProf,
  266.                                     CMProfileRef            prfProf,
  267.                                     UInt32                    matchFlags,
  268.                                     MatchImageUPP            userUPP);
  269.  
  270.     EXTERN_API(CMError)
  271.     InvokeCountImageProfilesUPP       (const FSSpec *            spec,
  272.                                     UInt32 *                count,
  273.                                     CountImageProfilesUPP    userUPP);
  274.  
  275.     EXTERN_API(CMError)
  276.     InvokeGetIndImageProfileUPP       (const FSSpec *            spec,
  277.                                     UInt32                    index,
  278.                                     CMProfileRef *            prof,
  279.                                     GetIndImageProfileUPP    userUPP);
  280.  
  281.     EXTERN_API(CMError)
  282.     InvokeSetIndImageProfileUPP       (const FSSpec *            specFrom,
  283.                                     const FSSpec *            specInto,
  284.                                     UInt32                    index,
  285.                                     CMProfileRef            prof,
  286.                                     UInt32                    embedFlags,
  287.                                     SetIndImageProfileUPP    userUPP);
  288.  
  289.     EXTERN_API(CMError)
  290.     InvokeCMValidImageUPP           (const FSSpec *            spec,
  291.                                     CMValidImageUPP            userUPP);
  292.  
  293.     EXTERN_API(CMError)
  294.     InvokeCMGetImageSpaceUPP       (const FSSpec *            spec,
  295.                                     OSType *                space,
  296.                                     CMGetImageSpaceUPP        userUPP);
  297.  
  298.     EXTERN_API(CMError)
  299.     InvokeCMEmbedImageUPP           (const FSSpec *            specFrom,
  300.                                     const FSSpec *            specInto,
  301.                                     Boolean                    repl,
  302.                                     CMProfileRef            embProf,
  303.                                     CMEmbedImageUPP            userUPP);
  304.  
  305.     EXTERN_API(CMError)
  306.     InvokeCMUnembedImageUPP           (const FSSpec *            specFrom,
  307.                                     const FSSpec *            specInto,
  308.                                     Boolean                    repl,
  309.                                     CMUnembedImageUPP        userUPP);
  310.  
  311.     EXTERN_API(CMError)
  312.     InvokeCMMatchImageUPP           (const FSSpec *            specFrom,
  313.                                     const FSSpec *            specInto,
  314.                                     Boolean                    repl,
  315.                                     UInt32                    qual,
  316.                                     CMProfileRef            srcProf,
  317.                                     UInt32                    srcIntent,
  318.                                     CMProfileRef            dstProf,
  319.                                     CMMatchImageUPP            userUPP);
  320.  
  321.     EXTERN_API(CMError)
  322.     InvokeCMProofImageUPP           (const FSSpec *            specFrom,
  323.                                     const FSSpec *            specInto,
  324.                                     Boolean                    repl,
  325.                                     UInt32                    qual,
  326.                                     CMProfileRef            srcProf,
  327.                                     UInt32                    srcIntent,
  328.                                     CMProfileRef            dstProf,
  329.                                     CMProfileRef            prfProf,
  330.                                     CMProofImageUPP            userUPP);
  331.  
  332.     EXTERN_API(CMError)
  333.     InvokeCMLinkImageUPP           (const FSSpec *            specFrom,
  334.                                     const FSSpec *            specInto,
  335.                                     Boolean                    repl,
  336.                                     UInt32                    qual,
  337.                                     CMProfileRef            lnkProf,
  338.                                     UInt32                    lnkIntent,
  339.                                     CMLinkImageUPP            userUPP);
  340.  
  341.     EXTERN_API(CMError)
  342.     InvokeCMCountImageProfilesUPP    (const FSSpec *        spec,
  343.                                     UInt32 *                count,
  344.                                     CMCountImageProfilesUPP    userUPP);
  345.  
  346.     EXTERN_API(CMError)
  347.     InvokeCMGetIndImageProfileUPP    (const FSSpec *        spec,
  348.                                     UInt32                    index,
  349.                                     CMProfileRef *            prof,
  350.                                     CMGetIndImageProfileUPP    userUPP);
  351.  
  352.     EXTERN_API(CMError)
  353.     InvokeCMSetIndImageProfileUPP    (const FSSpec *        specFrom,
  354.                                     const FSSpec *            specInto,
  355.                                     Boolean                    repl,
  356.                                     UInt32                    index,
  357.                                     CMProfileRef            prof,
  358.                                     CMSetIndImageProfileUPP    userUPP);
  359.  
  360. #else
  361.     enum { uppValidateImageProcInfo = 0x000000F1 };                 /* 4_bytes Func(4_bytes) */
  362.     enum { uppGetImageSpaceProcInfo = 0x000003F1 };                 /* 4_bytes Func(4_bytes, 4_bytes) */
  363.     enum { uppValidateSpaceProcInfo = 0x000003F1 };                 /* 4_bytes Func(4_bytes, 4_bytes) */
  364.     enum { uppEmbedImageProcInfo = 0x00003FF1 };                     /* 4_bytes Func(4_bytes, 4_bytes, 4_bytes, 4_bytes) */
  365.     enum { uppUnembedImageProcInfo = 0x000003F1 };                     /* 4_bytes Func(4_bytes, 4_bytes) */
  366.     enum { uppMatchImageProcInfo = 0x003FFFF1 };                     /* 4_bytes Func(4_bytes, 4_bytes, 4_bytes, 4_bytes, 4_bytes, 4_bytes, 4_bytes, 4_bytes) */
  367.     enum { uppCountImageProfilesProcInfo = 0x000003F1 };             /* 4_bytes Func(4_bytes, 4_bytes) */
  368.     enum { uppGetIndImageProfileProcInfo = 0x00000FF1 };             /* 4_bytes Func(4_bytes, 4_bytes, 4_bytes) */
  369.     enum { uppSetIndImageProfileProcInfo = 0x0000FFF1 };             /* 4_bytes Func(4_bytes, 4_bytes, 4_bytes, 4_bytes, 4_bytes) */
  370.     enum { uppCMValidImageProcInfo = 0x000000F1 };                     /* 4_bytes Func(4_bytes) */
  371.     enum { uppCMGetImageSpaceProcInfo = 0x000003F1 };                 /* 4_bytes Func(4_bytes, 4_bytes) */
  372.     enum { uppCMEmbedImageProcInfo = 0x000037F1 };                     /* 4_bytes Func(4_bytes, 4_bytes, 1_byte, 4_bytes) */
  373.     enum { uppCMUnembedImageProcInfo = 0x000007F1 };                 /* 4_bytes Func(4_bytes, 4_bytes, 1_byte) */
  374.     enum { uppCMMatchImageProcInfo = 0x000FF7F1 };                     /* 4_bytes Func(4_bytes, 4_bytes, 1_byte, 4_bytes, 4_bytes, 4_bytes, 4_bytes) */
  375.     enum { uppCMProofImageProcInfo = 0x003FF7F1 };                     /* 4_bytes Func(4_bytes, 4_bytes, 1_byte, 4_bytes, 4_bytes, 4_bytes, 4_bytes, 4_bytes) */
  376.     enum { uppCMLinkImageProcInfo = 0x0003F7F1 };                     /* 4_bytes Func(4_bytes, 4_bytes, 1_byte, 4_bytes, 4_bytes, 4_bytes) */
  377.     enum { uppCMCountImageProfilesProcInfo = 0x000003F1 };             /* 4_bytes Func(4_bytes, 4_bytes) */
  378.     enum { uppCMGetIndImageProfileProcInfo = 0x00000FF1 };             /* 4_bytes Func(4_bytes, 4_bytes, 4_bytes) */
  379.     enum { uppCMSetIndImageProfileProcInfo = 0x0000F7F1 };             /* 4_bytes Func(4_bytes, 4_bytes, 1_byte, 4_bytes, 4_bytes) */
  380.     #define NewValidateImageUPP(userRoutine)                         (ValidateImageUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppValidateImageProcInfo, GetCurrentArchitecture())
  381.     #define NewGetImageSpaceUPP(userRoutine)                         (GetImageSpaceUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppGetImageSpaceProcInfo, GetCurrentArchitecture())
  382.     #define NewValidateSpaceUPP(userRoutine)                         (ValidateSpaceUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppValidateSpaceProcInfo, GetCurrentArchitecture())
  383.     #define NewEmbedImageUPP(userRoutine)                             (EmbedImageUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppEmbedImageProcInfo, GetCurrentArchitecture())
  384.     #define NewUnembedImageUPP(userRoutine)                         (UnembedImageUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppUnembedImageProcInfo, GetCurrentArchitecture())
  385.     #define NewMatchImageUPP(userRoutine)                             (MatchImageUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppMatchImageProcInfo, GetCurrentArchitecture())
  386.     #define NewCountImageProfilesUPP(userRoutine)                     (CountImageProfilesUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCountImageProfilesProcInfo, GetCurrentArchitecture())
  387.     #define NewGetIndImageProfileUPP(userRoutine)                     (GetIndImageProfileUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppGetIndImageProfileProcInfo, GetCurrentArchitecture())
  388.     #define NewSetIndImageProfileUPP(userRoutine)                     (SetIndImageProfileUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppSetIndImageProfileProcInfo, GetCurrentArchitecture())
  389.     #define NewCMValidImageUPP(userRoutine)                         (CMValidImageUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMValidImageProcInfo, GetCurrentArchitecture())
  390.     #define NewCMGetImageSpaceUPP(userRoutine)                         (CMGetImageSpaceUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMGetImageSpaceProcInfo, GetCurrentArchitecture())
  391.     #define NewCMEmbedImageUPP(userRoutine)                         (CMEmbedImageUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMEmbedImageProcInfo, GetCurrentArchitecture())
  392.     #define NewCMUnembedImageUPP(userRoutine)                         (CMUnembedImageUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMUnembedImageProcInfo, GetCurrentArchitecture())
  393.     #define NewCMMatchImageUPP(userRoutine)                         (CMMatchImageUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMMatchImageProcInfo, GetCurrentArchitecture())
  394.     #define NewCMProofImageUPP(userRoutine)                         (CMProofImageUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMProofImageProcInfo, GetCurrentArchitecture())
  395.     #define NewCMLinkImageUPP(userRoutine)                             (CMLinkImageUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMLinkImageProcInfo, GetCurrentArchitecture())
  396.     #define NewCMCountImageProfilesUPP(userRoutine)                 (CMCountImageProfilesUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMCountImageProfilesProcInfo, GetCurrentArchitecture())
  397.     #define NewCMGetIndImageProfileUPP(userRoutine)                 (CMGetIndImageProfileUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMGetIndImageProfileProcInfo, GetCurrentArchitecture())
  398.     #define NewCMSetIndImageProfileUPP(userRoutine)                 (CMSetIndImageProfileUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMSetIndImageProfileProcInfo, GetCurrentArchitecture())
  399.     #define DisposeValidateImageUPP(userUPP)                         DisposeRoutineDescriptor(userUPP)
  400.     #define DisposeGetImageSpaceUPP(userUPP)                         DisposeRoutineDescriptor(userUPP)
  401.     #define DisposeValidateSpaceUPP(userUPP)                         DisposeRoutineDescriptor(userUPP)
  402.     #define DisposeEmbedImageUPP(userUPP)                             DisposeRoutineDescriptor(userUPP)
  403.     #define DisposeUnembedImageUPP(userUPP)                         DisposeRoutineDescriptor(userUPP)
  404.     #define DisposeMatchImageUPP(userUPP)                             DisposeRoutineDescriptor(userUPP)
  405.     #define DisposeCountImageProfilesUPP(userUPP)                     DisposeRoutineDescriptor(userUPP)
  406.     #define DisposeGetIndImageProfileUPP(userUPP)                     DisposeRoutineDescriptor(userUPP)
  407.     #define DisposeSetIndImageProfileUPP(userUPP)                     DisposeRoutineDescriptor(userUPP)
  408.     #define DisposeCMValidImageUPP(userUPP)                         DisposeRoutineDescriptor(userUPP)
  409.     #define DisposeCMGetImageSpaceUPP(userUPP)                         DisposeRoutineDescriptor(userUPP)
  410.     #define DisposeCMEmbedImageUPP(userUPP)                         DisposeRoutineDescriptor(userUPP)
  411.     #define DisposeCMUnembedImageUPP(userUPP)                         DisposeRoutineDescriptor(userUPP)
  412.     #define DisposeCMMatchImageUPP(userUPP)                         DisposeRoutineDescriptor(userUPP)
  413.     #define DisposeCMProofImageUPP(userUPP)                         DisposeRoutineDescriptor(userUPP)
  414.     #define DisposeCMLinkImageUPP(userUPP)                             DisposeRoutineDescriptor(userUPP)
  415.     #define DisposeCMCountImageProfilesUPP(userUPP)                 DisposeRoutineDescriptor(userUPP)
  416.     #define DisposeCMGetIndImageProfileUPP(userUPP)                 DisposeRoutineDescriptor(userUPP)
  417.     #define DisposeCMSetIndImageProfileUPP(userUPP)                 DisposeRoutineDescriptor(userUPP)
  418.     #define InvokeValidateImageUPP(spec, userUPP)                     (CMError)CALL_ONE_PARAMETER_UPP((userUPP), uppValidateImageProcInfo, (spec))
  419.     #define InvokeGetImageSpaceUPP(spec, space, userUPP)             (CMError)CALL_TWO_PARAMETER_UPP((userUPP), uppGetImageSpaceProcInfo, (spec), (space))
  420.     #define InvokeValidateSpaceUPP(spec, space, userUPP)             (CMError)CALL_TWO_PARAMETER_UPP((userUPP), uppValidateSpaceProcInfo, (spec), (space))
  421.     #define InvokeEmbedImageUPP(specFrom, specInto, embedProf, embedFlags, userUPP)  (CMError)CALL_FOUR_PARAMETER_UPP((userUPP), uppEmbedImageProcInfo, (specFrom), (specInto), (embedProf), (embedFlags))
  422.     #define InvokeUnembedImageUPP(specFrom, specInto, userUPP)         (CMError)CALL_TWO_PARAMETER_UPP((userUPP), uppUnembedImageProcInfo, (specFrom), (specInto))
  423.     #define InvokeMatchImageUPP(specFrom, specInto, qual, srcIntent, srcProf, dstProf, prfProf, matchFlags, userUPP)  (CMError)CALL_EIGHT_PARAMETER_UPP((userUPP), uppMatchImageProcInfo, (specFrom), (specInto), (qual), (srcIntent), (srcProf), (dstProf), (prfProf), (matchFlags))
  424.     #define InvokeCountImageProfilesUPP(spec, count, userUPP)         (CMError)CALL_TWO_PARAMETER_UPP((userUPP), uppCountImageProfilesProcInfo, (spec), (count))
  425.     #define InvokeGetIndImageProfileUPP(spec, index, prof, userUPP)  (CMError)CALL_THREE_PARAMETER_UPP((userUPP), uppGetIndImageProfileProcInfo, (spec), (index), (prof))
  426.     #define InvokeSetIndImageProfileUPP(specFrom, specInto, index, prof, embedFlags, userUPP)  (CMError)CALL_FIVE_PARAMETER_UPP((userUPP), uppSetIndImageProfileProcInfo, (specFrom), (specInto), (index), (prof), (embedFlags))
  427.     #define InvokeCMValidImageUPP(spec, userUPP)                     (CMError)CALL_ONE_PARAMETER_UPP((userUPP), uppCMValidImageProcInfo, (spec))
  428.     #define InvokeCMGetImageSpaceUPP(spec, space, userUPP)             (CMError)CALL_TWO_PARAMETER_UPP((userUPP), uppCMGetImageSpaceProcInfo, (spec), (space))
  429.     #define InvokeCMEmbedImageUPP(specFrom, specInto, repl, embProf, userUPP)  (CMError)CALL_FOUR_PARAMETER_UPP((userUPP), uppCMEmbedImageProcInfo, (specFrom), (specInto), (repl), (embProf))
  430.     #define InvokeCMUnembedImageUPP(specFrom, specInto, repl, userUPP)  (CMError)CALL_THREE_PARAMETER_UPP((userUPP), uppCMUnembedImageProcInfo, (specFrom), (specInto), (repl))
  431.     #define InvokeCMMatchImageUPP(specFrom, specInto, repl, qual, srcProf, srcIntent, dstProf, userUPP)  (CMError)CALL_SEVEN_PARAMETER_UPP((userUPP), uppCMMatchImageProcInfo, (specFrom), (specInto), (repl), (qual), (srcProf), (srcIntent), (dstProf))
  432.     #define InvokeCMProofImageUPP(specFrom, specInto, repl, qual, srcProf, srcIntent, dstProf, prfProf, userUPP)  (CMError)CALL_EIGHT_PARAMETER_UPP((userUPP), uppCMProofImageProcInfo, (specFrom), (specInto), (repl), (qual), (srcProf), (srcIntent), (dstProf), (prfProf))
  433.     #define InvokeCMLinkImageUPP(specFrom, specInto, repl, qual, lnkProf, lnkIntent, userUPP)  (CMError)CALL_SIX_PARAMETER_UPP((userUPP), uppCMLinkImageProcInfo, (specFrom), (specInto), (repl), (qual), (lnkProf), (lnkIntent))
  434.     #define InvokeCMCountImageProfilesUPP(spec, count, userUPP)     (CMError)CALL_TWO_PARAMETER_UPP((userUPP), uppCMCountImageProfilesProcInfo, (spec), (count))
  435.     #define InvokeCMGetIndImageProfileUPP(spec, index, prof, userUPP)  (CMError)CALL_THREE_PARAMETER_UPP((userUPP), uppCMGetIndImageProfileProcInfo, (spec), (index), (prof))
  436.     #define InvokeCMSetIndImageProfileUPP(specFrom, specInto, repl, index, prof, userUPP)  (CMError)CALL_FIVE_PARAMETER_UPP((userUPP), uppCMSetIndImageProfileProcInfo, (specFrom), (specInto), (repl), (index), (prof))
  437. #endif
  438. /* support for pre-Carbon UPP routines: NewXXXProc and CallXXXProc */
  439. #define NewValidateImageProc(userRoutine)                         NewValidateImageUPP(userRoutine)
  440. #define NewGetImageSpaceProc(userRoutine)                         NewGetImageSpaceUPP(userRoutine)
  441. #define NewValidateSpaceProc(userRoutine)                         NewValidateSpaceUPP(userRoutine)
  442. #define NewEmbedImageProc(userRoutine)                             NewEmbedImageUPP(userRoutine)
  443. #define NewUnembedImageProc(userRoutine)                         NewUnembedImageUPP(userRoutine)
  444. #define NewMatchImageProc(userRoutine)                             NewMatchImageUPP(userRoutine)
  445. #define NewCountImageProfilesProc(userRoutine)                     NewCountImageProfilesUPP(userRoutine)
  446. #define NewGetIndImageProfileProc(userRoutine)                     NewGetIndImageProfileUPP(userRoutine)
  447. #define NewSetIndImageProfileProc(userRoutine)                     NewSetIndImageProfileUPP(userRoutine)
  448. #define NewCMValidImageProc(userRoutine)                         NewCMValidImageUPP(userRoutine)
  449. #define NewCMGetImageSpaceProc(userRoutine)                     NewCMGetImageSpaceUPP(userRoutine)
  450. #define NewCMEmbedImageProc(userRoutine)                         NewCMEmbedImageUPP(userRoutine)
  451. #define NewCMUnembedImageProc(userRoutine)                         NewCMUnembedImageUPP(userRoutine)
  452. #define NewCMMatchImageProc(userRoutine)                         NewCMMatchImageUPP(userRoutine)
  453. #define NewCMProofImageProc(userRoutine)                         NewCMProofImageUPP(userRoutine)
  454. #define NewCMLinkImageProc(userRoutine)                         NewCMLinkImageUPP(userRoutine)
  455. #define NewCMCountImageProfilesProc(userRoutine)                 NewCMCountImageProfilesUPP(userRoutine)
  456. #define NewCMGetIndImageProfileProc(userRoutine)                 NewCMGetIndImageProfileUPP(userRoutine)
  457. #define NewCMSetIndImageProfileProc(userRoutine)                 NewCMSetIndImageProfileUPP(userRoutine)
  458. #define CallValidateImageProc(userRoutine, spec)                InvokeValidateImageUPP(spec, userRoutine)
  459. #define CallGetImageSpaceProc(userRoutine, spec, space)            InvokeGetImageSpaceUPP(spec, space, userRoutine)
  460. #define CallValidateSpaceProc(userRoutine, spec, space)            InvokeValidateSpaceUPP(spec, space, userRoutine)
  461. #define CallEmbedImageProc(userRoutine, specFrom, specInto, embedProf, embedFlags) InvokeEmbedImageUPP(specFrom, specInto, embedProf, embedFlags, userRoutine)
  462. #define CallUnembedImageProc(userRoutine, specFrom, specInto)    InvokeUnembedImageUPP(specFrom, specInto, userRoutine)
  463. #define CallMatchImageProc(userRoutine, specFrom, specInto, qual, srcIntent, srcProf, dstProf, prfProf, matchFlags) InvokeMatchImageUPP(specFrom, specInto, qual, srcIntent, srcProf, dstProf, prfProf, matchFlags, userRoutine)
  464. #define CallCountImageProfilesProc(userRoutine, spec, count)    InvokeCountImageProfilesUPP(spec, count, userRoutine)
  465. #define CallGetIndImageProfileProc(userRoutine, spec, index, prof) InvokeGetIndImageProfileUPP(spec, index, prof, userRoutine)
  466. #define CallSetIndImageProfileProc(userRoutine, specFrom, specInto, index, prof, embedFlags) InvokeSetIndImageProfileUPP(specFrom, specInto, index, prof, embedFlags, userRoutine)
  467. #define CallCMValidImageProc(userRoutine, spec)                    InvokeCMValidImageUPP(spec, userRoutine)
  468. #define CallCMGetImageSpaceProc(userRoutine, spec, space)        InvokeCMGetImageSpaceUPP(spec, space, userRoutine)
  469. #define CallCMEmbedImageProc(userRoutine, specFrom, specInto, repl, embProf) InvokeCMEmbedImageUPP(specFrom, specInto, repl, embProf, userRoutine)
  470. #define CallCMUnembedImageProc(userRoutine, specFrom, specInto, repl) InvokeCMUnembedImageUPP(specFrom, specInto, repl, userRoutine)
  471. #define CallCMMatchImageProc(userRoutine, specFrom, specInto, repl, qual, srcProf, srcIntent, dstProf) InvokeCMMatchImageUPP(specFrom, specInto, repl, qual, srcProf, srcIntent, dstProf, userRoutine)
  472. #define CallCMProofImageProc(userRoutine, specFrom, specInto, repl, qual, srcProf, srcIntent, dstProf, prfProf) InvokeCMProofImageUPP(specFrom, specInto, repl, qual, srcProf, srcIntent, dstProf, prfProf, userRoutine)
  473. #define CallCMLinkImageProc(userRoutine, specFrom, specInto, repl, qual, lnkProf, lnkIntent) InvokeCMLinkImageUPP(specFrom, specInto, repl, qual, lnkProf, lnkIntent, userRoutine)
  474. #define CallCMCountImageProfilesProc(userRoutine, spec, count)    InvokeCMCountImageProfilesUPP(spec, count, userRoutine)
  475. #define CallCMGetIndImageProfileProc(userRoutine, spec, index, prof) InvokeCMGetIndImageProfileUPP(spec, index, prof, userRoutine)
  476. #define CallCMSetIndImageProfileProc(userRoutine, specFrom, specInto, repl, index, prof) InvokeCMSetIndImageProfileUPP(specFrom, specInto, repl, index, prof, userRoutine)
  477. /**** CSScriptingLib API  ****/
  478.  
  479. EXTERN_API_C( CMError )
  480. CMValidImage                    (const FSSpec *            spec);
  481.  
  482. EXTERN_API_C( CMError )
  483. CMGetImageSpace                    (const FSSpec *            spec,
  484.                                  OSType *                space);
  485.  
  486. EXTERN_API_C( CMError )
  487. CMEmbedImage                    (const FSSpec *            specFrom,
  488.                                  const FSSpec *            specInto,
  489.                                  Boolean                 repl,
  490.                                  CMProfileRef             embProf);
  491.  
  492. EXTERN_API_C( CMError )
  493. CMUnembedImage                    (const FSSpec *            specFrom,
  494.                                  const FSSpec *            specInto,
  495.                                  Boolean                 repl);
  496.  
  497. EXTERN_API_C( CMError )
  498. CMMatchImage                    (const FSSpec *            specFrom,
  499.                                  const FSSpec *            specInto,
  500.                                  Boolean                 repl,
  501.                                  UInt32                 qual,
  502.                                  CMProfileRef             srcProf,
  503.                                  UInt32                 srcIntent,
  504.                                  CMProfileRef             dstProf);
  505.  
  506. EXTERN_API_C( CMError )
  507. CMProofImage                    (const FSSpec *            specFrom,
  508.                                  const FSSpec *            specInto,
  509.                                  Boolean                 repl,
  510.                                  UInt32                 qual,
  511.                                  CMProfileRef             srcProf,
  512.                                  UInt32                 srcIntent,
  513.                                  CMProfileRef             dstProf,
  514.                                  CMProfileRef             prfProf);
  515.  
  516. EXTERN_API_C( CMError )
  517. CMLinkImage                        (const FSSpec *            specFrom,
  518.                                  const FSSpec *            specInto,
  519.                                  Boolean                 repl,
  520.                                  UInt32                 qual,
  521.                                  CMProfileRef             lnkProf,
  522.                                  UInt32                 lnkIntent);
  523.  
  524. EXTERN_API_C( CMError )
  525. CMCountImageProfiles            (const FSSpec *            spec,
  526.                                  UInt32 *                count);
  527.  
  528. EXTERN_API_C( CMError )
  529. CMGetIndImageProfile            (const FSSpec *            spec,
  530.                                  UInt32                 index,
  531.                                  CMProfileRef *            prof);
  532.  
  533. EXTERN_API_C( CMError )
  534. CMSetIndImageProfile            (const FSSpec *            specFrom,
  535.                                  const FSSpec *            specInto,
  536.                                  Boolean                 repl,
  537.                                  UInt32                 index,
  538.                                  CMProfileRef             prof);
  539.  
  540.  
  541. #if PRAGMA_STRUCT_ALIGN
  542.     #pragma options align=reset
  543. #elif PRAGMA_STRUCT_PACKPUSH
  544.     #pragma pack(pop)
  545. #elif PRAGMA_STRUCT_PACK
  546.     #pragma pack()
  547. #endif
  548.  
  549. #ifdef PRAGMA_IMPORT_OFF
  550. #pragma import off
  551. #elif PRAGMA_IMPORT
  552. #pragma import reset
  553. #endif
  554.  
  555. #ifdef __cplusplus
  556. }
  557. #endif
  558.  
  559. #endif /* __CMSCRIPTINGPLUGIN__ */
  560.  
  561.