Mac OS 9
CMTypes.h
Go to the documentation of this file.
1 
20 #ifndef __CMTYPES__
21 #define __CMTYPES__
22 
23 #ifndef __MACTYPES__
24 #include <MacTypes.h>
25 #endif
26 
27 #ifndef __MIXEDMODE__
28 #include <MixedMode.h>
29 #endif
30 
31 /* Standard type for ColorSync and other system error codes */
32 
33 #if PRAGMA_ONCE
34 #pragma once
35 #endif
36 
37 #ifdef __cplusplus
38 extern "C"
39 {
40 #endif
41 
42 #if PRAGMA_IMPORT
43 #pragma import on
44 #endif
45 
46 #if PRAGMA_STRUCT_ALIGN
47 #pragma options align = mac68k
48 #elif PRAGMA_STRUCT_PACKPUSH
49 #pragma pack(push, 2)
50 #elif PRAGMA_STRUCT_PACK
51 #pragma pack(2)
52 #endif
53 
54  typedef long CMError;
55  /* Abstract data type for memory-based Profile */
56  typedef struct OpaqueCMProfileRef *CMProfileRef;
57  /* Abstract data type for Profile search result */
58  typedef struct OpaqueCMProfileSearchRef *CMProfileSearchRef;
59  /* Abstract data type for BeginMatching(�) reference */
60  typedef struct OpaqueCMMatchRef *CMMatchRef;
61  /* Abstract data type for ColorWorld reference */
62  typedef struct OpaqueCMWorldRef *CMWorldRef;
63  /* Data type for ColorSync DisplayID reference */
64  /* On 8 & 9 this is a AVIDType */
65  /* On X this is a CGSDisplayID */
66  typedef UInt32 CMDisplayIDType;
67 
68  /* Caller-supplied flatten function */
69  typedef CALLBACK_API(OSErr, CMFlattenProcPtr)(long command, long *size,
70  void *data, void *refCon);
71  /* Caller-supplied progress function for Bitmap & PixMap matching routines */
72  typedef CALLBACK_API(Boolean, CMBitmapCallBackProcPtr)(long progress,
73  void *refCon);
74  /* Caller-supplied progress function for NCMMConcatInit & NCMMNewLinkProfile
75  * routines */
76  typedef CALLBACK_API(Boolean, CMConcatCallBackProcPtr)(long progress,
77  void *refCon);
78  /* Caller-supplied filter function for Profile search */
79  typedef CALLBACK_API(Boolean, CMProfileFilterProcPtr)(CMProfileRef prof,
80  void *refCon);
81  /* Caller-supplied function for profile access */
82  typedef CALLBACK_API(OSErr, CMProfileAccessProcPtr)(long command, long offset,
83  long *size, void *data,
84  void *refCon);
85  typedef STACK_UPP_TYPE(CMFlattenProcPtr) CMFlattenUPP;
86  typedef STACK_UPP_TYPE(CMBitmapCallBackProcPtr) CMBitmapCallBackUPP;
87  typedef STACK_UPP_TYPE(CMConcatCallBackProcPtr) CMConcatCallBackUPP;
88  typedef STACK_UPP_TYPE(CMProfileFilterProcPtr) CMProfileFilterUPP;
89  typedef STACK_UPP_TYPE(CMProfileAccessProcPtr) CMProfileAccessUPP;
98  CMFlattenUPP
99  NewCMFlattenUPP(CMFlattenProcPtr userRoutine);
100 #if !OPAQUE_UPP_TYPES
101  enum
102  {
103  uppCMFlattenProcInfo = 0x00003FE0
104  }; /* pascal 2_bytes Func(4_bytes, 4_bytes, 4_bytes, 4_bytes) */
105 #ifdef __cplusplus
106  inline CMFlattenUPP NewCMFlattenUPP(CMFlattenProcPtr userRoutine)
107  {
108  return (CMFlattenUPP)NewRoutineDescriptor(
109  (ProcPtr)(userRoutine), uppCMFlattenProcInfo, GetCurrentArchitecture());
110  }
111 #else
112 #define NewCMFlattenUPP(userRoutine) \
113  (CMFlattenUPP) NewRoutineDescriptor( \
114  (ProcPtr)(userRoutine), uppCMFlattenProcInfo, GetCurrentArchitecture())
115 #endif
116 #endif
117 
126  CMBitmapCallBackUPP
127  NewCMBitmapCallBackUPP(CMBitmapCallBackProcPtr userRoutine);
128 #if !OPAQUE_UPP_TYPES
129  enum
130  {
131  uppCMBitmapCallBackProcInfo = 0x000003D0
132  }; /* pascal 1_byte Func(4_bytes, 4_bytes) */
133 #ifdef __cplusplus
134  inline CMBitmapCallBackUPP
135  NewCMBitmapCallBackUPP(CMBitmapCallBackProcPtr userRoutine)
136  {
137  return (CMBitmapCallBackUPP)NewRoutineDescriptor((ProcPtr)(userRoutine),
138  uppCMBitmapCallBackProcInfo,
139  GetCurrentArchitecture());
140  }
141 #else
142 #define NewCMBitmapCallBackUPP(userRoutine) \
143  (CMBitmapCallBackUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), \
144  uppCMBitmapCallBackProcInfo, \
145  GetCurrentArchitecture())
146 #endif
147 #endif
148 
157  CMConcatCallBackUPP
158  NewCMConcatCallBackUPP(CMConcatCallBackProcPtr userRoutine);
159 #if !OPAQUE_UPP_TYPES
160  enum
161  {
162  uppCMConcatCallBackProcInfo = 0x000003D0
163  }; /* pascal 1_byte Func(4_bytes, 4_bytes) */
164 #ifdef __cplusplus
165  inline CMConcatCallBackUPP
166  NewCMConcatCallBackUPP(CMConcatCallBackProcPtr userRoutine)
167  {
168  return (CMConcatCallBackUPP)NewRoutineDescriptor((ProcPtr)(userRoutine),
169  uppCMConcatCallBackProcInfo,
170  GetCurrentArchitecture());
171  }
172 #else
173 #define NewCMConcatCallBackUPP(userRoutine) \
174  (CMConcatCallBackUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), \
175  uppCMConcatCallBackProcInfo, \
176  GetCurrentArchitecture())
177 #endif
178 #endif
179 
188  CMProfileFilterUPP
189  NewCMProfileFilterUPP(CMProfileFilterProcPtr userRoutine);
190 #if !OPAQUE_UPP_TYPES
191  enum
192  {
193  uppCMProfileFilterProcInfo = 0x000003D0
194  }; /* pascal 1_byte Func(4_bytes, 4_bytes) */
195 #ifdef __cplusplus
196  inline CMProfileFilterUPP
197  NewCMProfileFilterUPP(CMProfileFilterProcPtr userRoutine)
198  {
199  return (CMProfileFilterUPP)NewRoutineDescriptor((ProcPtr)(userRoutine),
200  uppCMProfileFilterProcInfo,
201  GetCurrentArchitecture());
202  }
203 #else
204 #define NewCMProfileFilterUPP(userRoutine) \
205  (CMProfileFilterUPP) \
206  NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMProfileFilterProcInfo, \
207  GetCurrentArchitecture())
208 #endif
209 #endif
210 
219  CMProfileAccessUPP
220  NewCMProfileAccessUPP(CMProfileAccessProcPtr userRoutine);
221 #if !OPAQUE_UPP_TYPES
222  enum
223  {
224  uppCMProfileAccessProcInfo = 0x0000FFE0
225  }; /* pascal 2_bytes Func(4_bytes, 4_bytes, 4_bytes, 4_bytes, 4_bytes) */
226 #ifdef __cplusplus
227  inline CMProfileAccessUPP
228  NewCMProfileAccessUPP(CMProfileAccessProcPtr userRoutine)
229  {
230  return (CMProfileAccessUPP)NewRoutineDescriptor((ProcPtr)(userRoutine),
231  uppCMProfileAccessProcInfo,
232  GetCurrentArchitecture());
233  }
234 #else
235 #define NewCMProfileAccessUPP(userRoutine) \
236  (CMProfileAccessUPP) \
237  NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMProfileAccessProcInfo, \
238  GetCurrentArchitecture())
239 #endif
240 #endif
241 
250  void
251  DisposeCMFlattenUPP(CMFlattenUPP userUPP);
252 #if !OPAQUE_UPP_TYPES
253 #ifdef __cplusplus
254  inline void DisposeCMFlattenUPP(CMFlattenUPP userUPP)
255  {
256  DisposeRoutineDescriptor((UniversalProcPtr)userUPP);
257  }
258 #else
259 #define DisposeCMFlattenUPP(userUPP) DisposeRoutineDescriptor(userUPP)
260 #endif
261 #endif
262 
271  void
272  DisposeCMBitmapCallBackUPP(CMBitmapCallBackUPP userUPP);
273 #if !OPAQUE_UPP_TYPES
274 #ifdef __cplusplus
275  inline void DisposeCMBitmapCallBackUPP(CMBitmapCallBackUPP userUPP)
276  {
277  DisposeRoutineDescriptor((UniversalProcPtr)userUPP);
278  }
279 #else
280 #define DisposeCMBitmapCallBackUPP(userUPP) DisposeRoutineDescriptor(userUPP)
281 #endif
282 #endif
283 
292  void
293  DisposeCMConcatCallBackUPP(CMConcatCallBackUPP userUPP);
294 #if !OPAQUE_UPP_TYPES
295 #ifdef __cplusplus
296  inline void DisposeCMConcatCallBackUPP(CMConcatCallBackUPP userUPP)
297  {
298  DisposeRoutineDescriptor((UniversalProcPtr)userUPP);
299  }
300 #else
301 #define DisposeCMConcatCallBackUPP(userUPP) DisposeRoutineDescriptor(userUPP)
302 #endif
303 #endif
304 
313  void
314  DisposeCMProfileFilterUPP(CMProfileFilterUPP userUPP);
315 #if !OPAQUE_UPP_TYPES
316 #ifdef __cplusplus
317  inline void DisposeCMProfileFilterUPP(CMProfileFilterUPP userUPP)
318  {
319  DisposeRoutineDescriptor((UniversalProcPtr)userUPP);
320  }
321 #else
322 #define DisposeCMProfileFilterUPP(userUPP) DisposeRoutineDescriptor(userUPP)
323 #endif
324 #endif
325 
334  void
335  DisposeCMProfileAccessUPP(CMProfileAccessUPP userUPP);
336 #if !OPAQUE_UPP_TYPES
337 #ifdef __cplusplus
338  inline void DisposeCMProfileAccessUPP(CMProfileAccessUPP userUPP)
339  {
340  DisposeRoutineDescriptor((UniversalProcPtr)userUPP);
341  }
342 #else
343 #define DisposeCMProfileAccessUPP(userUPP) DisposeRoutineDescriptor(userUPP)
344 #endif
345 #endif
346 
355  OSErr
356  InvokeCMFlattenUPP(long command, long *size, void *data, void *refCon,
357  CMFlattenUPP userUPP);
358 #if !OPAQUE_UPP_TYPES
359 #ifdef __cplusplus
360  inline OSErr InvokeCMFlattenUPP(long command, long *size, void *data,
361  void *refCon, CMFlattenUPP userUPP)
362  {
363  return (OSErr)CALL_FOUR_PARAMETER_UPP(userUPP, uppCMFlattenProcInfo, command,
364  size, data, refCon);
365  }
366 #else
367 #define InvokeCMFlattenUPP(command, size, data, refCon, userUPP) \
368  (OSErr) CALL_FOUR_PARAMETER_UPP((userUPP), uppCMFlattenProcInfo, (command), \
369  (size), (data), (refCon))
370 #endif
371 #endif
372 
381  Boolean
382  InvokeCMBitmapCallBackUPP(long progress, void *refCon,
383  CMBitmapCallBackUPP userUPP);
384 #if !OPAQUE_UPP_TYPES
385 #ifdef __cplusplus
386  inline Boolean InvokeCMBitmapCallBackUPP(long progress, void *refCon,
387  CMBitmapCallBackUPP userUPP)
388  {
389  return (Boolean)CALL_TWO_PARAMETER_UPP(userUPP, uppCMBitmapCallBackProcInfo,
390  progress, refCon);
391  }
392 #else
393 #define InvokeCMBitmapCallBackUPP(progress, refCon, userUPP) \
394  (Boolean) CALL_TWO_PARAMETER_UPP((userUPP), uppCMBitmapCallBackProcInfo, \
395  (progress), (refCon))
396 #endif
397 #endif
398 
407  Boolean
408  InvokeCMConcatCallBackUPP(long progress, void *refCon,
409  CMConcatCallBackUPP userUPP);
410 #if !OPAQUE_UPP_TYPES
411 #ifdef __cplusplus
412  inline Boolean InvokeCMConcatCallBackUPP(long progress, void *refCon,
413  CMConcatCallBackUPP userUPP)
414  {
415  return (Boolean)CALL_TWO_PARAMETER_UPP(userUPP, uppCMConcatCallBackProcInfo,
416  progress, refCon);
417  }
418 #else
419 #define InvokeCMConcatCallBackUPP(progress, refCon, userUPP) \
420  (Boolean) CALL_TWO_PARAMETER_UPP((userUPP), uppCMConcatCallBackProcInfo, \
421  (progress), (refCon))
422 #endif
423 #endif
424 
433  Boolean
434  InvokeCMProfileFilterUPP(CMProfileRef prof, void *refCon,
435  CMProfileFilterUPP userUPP);
436 #if !OPAQUE_UPP_TYPES
437 #ifdef __cplusplus
438  inline Boolean InvokeCMProfileFilterUPP(CMProfileRef prof, void *refCon,
439  CMProfileFilterUPP userUPP)
440  {
441  return (Boolean)CALL_TWO_PARAMETER_UPP(userUPP, uppCMProfileFilterProcInfo,
442  prof, refCon);
443  }
444 #else
445 #define InvokeCMProfileFilterUPP(prof, refCon, userUPP) \
446  (Boolean) CALL_TWO_PARAMETER_UPP((userUPP), uppCMProfileFilterProcInfo, \
447  (prof), (refCon))
448 #endif
449 #endif
450 
459  OSErr
460  InvokeCMProfileAccessUPP(long command, long offset, long *size, void *data,
461  void *refCon, CMProfileAccessUPP userUPP);
462 #if !OPAQUE_UPP_TYPES
463 #ifdef __cplusplus
464  inline OSErr InvokeCMProfileAccessUPP(long command, long offset, long *size,
465  void *data, void *refCon,
466  CMProfileAccessUPP userUPP)
467  {
468  return (OSErr)CALL_FIVE_PARAMETER_UPP(userUPP, uppCMProfileAccessProcInfo,
469  command, offset, size, data, refCon);
470  }
471 #else
472 #define InvokeCMProfileAccessUPP(command, offset, size, data, refCon, userUPP) \
473  (OSErr) \
474  CALL_FIVE_PARAMETER_UPP((userUPP), uppCMProfileAccessProcInfo, \
475  (command), (offset), (size), (data), (refCon))
476 #endif
477 #endif
478 
479 #if CALL_NOT_IN_CARBON || OLDROUTINENAMES
480 /* support for pre-Carbon UPP routines: New...Proc and Call...Proc */
481 #define NewCMFlattenProc(userRoutine) NewCMFlattenUPP(userRoutine)
482 #define NewCMBitmapCallBackProc(userRoutine) NewCMBitmapCallBackUPP(userRoutine)
483 #define NewCMConcatCallBackProc(userRoutine) NewCMConcatCallBackUPP(userRoutine)
484 #define NewCMProfileFilterProc(userRoutine) NewCMProfileFilterUPP(userRoutine)
485 #define NewCMProfileAccessProc(userRoutine) NewCMProfileAccessUPP(userRoutine)
486 #define CallCMFlattenProc(userRoutine, command, size, data, refCon) \
487  InvokeCMFlattenUPP(command, size, data, refCon, userRoutine)
488 #define CallCMBitmapCallBackProc(userRoutine, progress, refCon) \
489  InvokeCMBitmapCallBackUPP(progress, refCon, userRoutine)
490 #define CallCMConcatCallBackProc(userRoutine, progress, refCon) \
491  InvokeCMConcatCallBackUPP(progress, refCon, userRoutine)
492 #define CallCMProfileFilterProc(userRoutine, prof, refCon) \
493  InvokeCMProfileFilterUPP(prof, refCon, userRoutine)
494 #define CallCMProfileAccessProc(userRoutine, command, offset, size, data, \
495  refCon) \
496  InvokeCMProfileAccessUPP(command, offset, size, data, refCon, userRoutine)
497 #endif /* CALL_NOT_IN_CARBON */
498 
499 #if PRAGMA_STRUCT_ALIGN
500 #pragma options align = reset
501 #elif PRAGMA_STRUCT_PACKPUSH
502 #pragma pack(pop)
503 #elif PRAGMA_STRUCT_PACK
504 #pragma pack()
505 #endif
506 
507 #ifdef PRAGMA_IMPORT_OFF
508 #pragma import off
509 #elif PRAGMA_IMPORT
510 #pragma import reset
511 #endif
512 
513 #ifdef __cplusplus
514 }
515 #endif
516 
517 #endif /* __CMTYPES__ */
void DisposeCMBitmapCallBackUPP(CMBitmapCallBackUPP userUPP)
OSErr InvokeCMFlattenUPP(long command, long *size, void *data, void *refCon, CMFlattenUPP userUPP)
CMProfileFilterUPP NewCMProfileFilterUPP(CMProfileFilterProcPtr userRoutine)
CMBitmapCallBackUPP NewCMBitmapCallBackUPP(CMBitmapCallBackProcPtr userRoutine)
void DisposeCMProfileAccessUPP(CMProfileAccessUPP userUPP)
CMProfileAccessUPP NewCMProfileAccessUPP(CMProfileAccessProcPtr userRoutine)
void DisposeCMProfileFilterUPP(CMProfileFilterUPP userUPP)
Boolean InvokeCMConcatCallBackUPP(long progress, void *refCon, CMConcatCallBackUPP userUPP)
Boolean InvokeCMProfileFilterUPP(CMProfileRef prof, void *refCon, CMProfileFilterUPP userUPP)
OSErr InvokeCMProfileAccessUPP(long command, long offset, long *size, void *data, void *refCon, CMProfileAccessUPP userUPP)
void DisposeCMConcatCallBackUPP(CMConcatCallBackUPP userUPP)
Boolean InvokeCMBitmapCallBackUPP(long progress, void *refCon, CMBitmapCallBackUPP userUPP)
CMFlattenUPP NewCMFlattenUPP(CMFlattenProcPtr userRoutine)
void DisposeCMFlattenUPP(CMFlattenUPP userUPP)
CMConcatCallBackUPP NewCMConcatCallBackUPP(CMConcatCallBackProcPtr userRoutine)
Basic Macintosh data types.
unsigned char Boolean
Definition: MacTypes.h:318
Mixed Mode Manager Interfaces.
void DisposeRoutineDescriptor(UniversalProcPtr theUPP)
#define STACK_UPP_TYPE(name)
Definition: MixedMode.h:734
UniversalProcPtr NewRoutineDescriptor(ProcPtr theProc, ProcInfoType theProcInfo, ISAType theISA)