Mac OS 9
CMDeviceIntegration.h
Go to the documentation of this file.
1 
19 #ifndef __CMDEVICEINTEGRATION__
20 #define __CMDEVICEINTEGRATION__
21 
22 #ifndef __MACTYPES__
23 #include <MacTypes.h>
24 #endif
25 
26 #ifndef __CMAPPLICATION__
27 #include <CMApplication.h>
28 #endif
29 
30 #ifndef __CMICCPROFILE__
31 #include <CMICCProfile.h>
32 #endif
33 
34 #ifndef __CFSTRING__
35 #include <CFString.h>
36 #endif
37 
38 #if PRAGMA_ONCE
39 #pragma once
40 #endif
41 
42 #ifdef __cplusplus
43 extern "C"
44 {
45 #endif
46 
47 #if PRAGMA_IMPORT
48 #pragma import on
49 #endif
50 
51 #if PRAGMA_STRUCT_ALIGN
52 #pragma options align = mac68k
53 #elif PRAGMA_STRUCT_PACKPUSH
54 #pragma pack(push, 2)
55 #elif PRAGMA_STRUCT_PACK
56 #pragma pack(2)
57 #endif
58 
59 #if TARGET_API_MAC_OSX
64  enum
65  {
66  cmDeviceInfoVersion1 = 0x00010000,
67  cmDeviceProfileInfoVersion1 = 0x00010000
68  };
69 
70  enum
71  {
72  cmCurrentDeviceInfoVersion = cmDeviceInfoVersion1,
73  cmCurrentProfileInfoVersion = cmDeviceProfileInfoVersion1
74  };
75 
80  enum
81  {
82  cmDefaultDeviceID = 0,
83  cmDefaultProfileID = 0
84  };
85 
90  enum
91  {
92  cmDeviceStateDefault = 0x00000000,
93  cmDeviceStateOffline = 0x00000001,
94  cmDeviceStateBusy = 0x00000002,
95  cmDeviceStateForceNotify = (long)0x80000000,
96  cmDeviceStateDeviceRsvdBits = 0x00FF0000,
97  cmDeviceStateAppleRsvdBits = (long)0xFF00FFFF
98  };
99 
125  enum
126  {
127  cmIterateFactoryDeviceProfiles = 0x00000001,
128  cmIterateCustomDeviceProfiles = 0x00000002,
129  cmIterateCurrentDeviceProfiles = 0x00000003,
130  cmIterateDeviceProfilesMask = cmIterateCurrentDeviceProfiles
131  };
132 
133  enum
134  {
135  kMaxDeviceNameLength = 256,
136  kMaxProfileNameLength = 256
137  };
138 
142  enum
143  {
144  cmDeviceDBNotFoundErr = -4227,
145  cmDeviceAlreadyRegistered = -4228,
146  cmDeviceNotRegistered = -4229,
147  cmDeviceProfilesNotFound = -4230,
148  cmInternalCFErr = -4231
149  };
150 
163 #define kCMDeviceRegisteredNotification CFSTR("CMDeviceRegisteredNotification")
164 #define kCMDeviceUnregisteredNotification \
165  CFSTR("CMDeviceUnregisteredNotification")
166 #define kCMDeviceOnlineNotification CFSTR("CMDeviceOnlineNotification")
167 #define kCMDeviceOfflineNotification CFSTR("CMDeviceOfflineNotification")
168 #define kCMDeviceStateNotification CFSTR("CMDeviceStateNotification")
169 #define kCMDefaultDeviceNotification CFSTR("CMDefaultDeviceNotification")
170 #define kCMDeviceProfilesNotification CFSTR("CMDeviceProfilesNotification")
171 #define kCMDefaultDeviceProfileNotification \
172  CFSTR("CMDefaultDeviceProfileNotification")
173 
177  typedef UInt32 CMDeviceState;
181  typedef UInt32 CMDeviceID;
185  typedef UInt32 CMDeviceProfileID;
189  enum
190  {
191  cmScannerDeviceClass = FOUR_CHAR_CODE('scnr'),
192  cmCameraDeviceClass = FOUR_CHAR_CODE('cmra'),
193  cmDisplayDeviceClass = FOUR_CHAR_CODE('mntr'),
194  cmPrinterDeviceClass = FOUR_CHAR_CODE('prtr'),
195  cmProofDeviceClass = FOUR_CHAR_CODE('pruf')
196  };
197 
198  typedef OSType CMDeviceClass;
203  struct CMDeviceScope
204  {
205  CFStringRef deviceUser;
206  CFStringRef deviceHost;
207  };
208  typedef struct CMDeviceScope CMDeviceScope;
213  struct CMDeviceInfo
214  {
215  UInt32 dataVersion;
216  CMDeviceClass deviceClass;
217  CMDeviceID deviceID;
218  CMDeviceScope deviceScope;
219  CMDeviceState deviceState;
220  CMDeviceProfileID defaultProfileID;
221  CFDictionaryRef *deviceName;
223  UInt32 profileCount;
224  UInt32 reserved;
225  };
226  typedef struct CMDeviceInfo CMDeviceInfo;
227  typedef CMDeviceInfo *CMDeviceInfoPtr;
232  struct CMDeviceProfileInfo
233  {
234  UInt32 dataVersion;
235  CMDeviceProfileID profileID;
236  CMProfileLocation profileLoc;
237  CFDictionaryRef profileName;
238  UInt32 reserved;
239  };
240  typedef struct CMDeviceProfileInfo CMDeviceProfileInfo;
245  struct CMDeviceProfileArray
246  {
247  UInt32 profileCount;
248  CMDeviceProfileInfo profiles[1];
249  };
250  typedef struct CMDeviceProfileArray CMDeviceProfileArray;
251  typedef CMDeviceProfileArray *CMDeviceProfileArrayPtr;
255  typedef CALLBACK_API_C(OSErr, CMIterateDeviceInfoProcPtr)(
256  const CMDeviceInfo *deviceInfo, void *refCon);
257  typedef CALLBACK_API_C(OSErr, CMIterateDeviceProfileProcPtr)(
258  const CMDeviceInfo *deviceInfo, const CMDeviceProfileInfo *profileData,
259  void *refCon);
271  CMError
272  CMRegisterColorDevice(CMDeviceClass deviceClass, CMDeviceID deviceID,
273  CFDictionaryRef deviceName,
274  const CMDeviceScope *deviceScope);
275 
284  CMError
285  CMUnregisterColorDevice(CMDeviceClass deviceClass, CMDeviceID deviceID);
286 
298  CMError
299  CMSetDefaultDevice(CMDeviceClass deviceClass, CMDeviceID deviceID);
300 
309  CMError
310  CMGetDefaultDevice(CMDeviceClass deviceClass, CMDeviceID *deviceID);
311 
323  CMError
324  CMSetDeviceFactoryProfiles(CMDeviceClass deviceClass, CMDeviceID deviceID,
325  CMDeviceProfileID defaultProfID,
326  const CMDeviceProfileArray *deviceProfiles);
327 
336  CMError
337  CMGetDeviceFactoryProfiles(CMDeviceClass deviceClass, CMDeviceID deviceID,
338  CMDeviceProfileID *defaultProfID, UInt32 *arraySize,
339  CMDeviceProfileArray *deviceProfiles);
340 
349  CMError
350  CMSetDeviceProfiles(CMDeviceClass deviceClass, CMDeviceID deviceID,
351  const CMDeviceScope *profileScope,
352  const CMDeviceProfileArray *deviceProfiles);
353 
362  CMError
363  CMGetDeviceProfiles(CMDeviceClass deviceClass, CMDeviceID deviceID,
364  UInt32 *arraySize, CMDeviceProfileArray *deviceProfiles);
365 
374  CMError
375  CMSetDeviceDefaultProfileID(CMDeviceClass deviceClass, CMDeviceID deviceID,
376  CMDeviceProfileID defaultProfID);
377 
386  CMError
387  CMGetDeviceDefaultProfileID(CMDeviceClass deviceClass, CMDeviceID deviceID,
388  CMDeviceProfileID *defaultProfID);
389 
398  CMError
399  CMGetDeviceProfile(CMDeviceClass deviceClass, CMDeviceID deviceID,
400  CMDeviceProfileID profileID,
401  CMProfileLocation *deviceProfLoc);
402 
411  CMError
412  CMSetDeviceProfile(CMDeviceClass deviceClass, CMDeviceID deviceID,
413  const CMDeviceScope *profileScope,
414  CMDeviceProfileID profileID,
415  const CMProfileLocation *deviceProfLoc);
416 
428  CMError
429  CMSetDeviceState(CMDeviceClass deviceClass, CMDeviceID deviceID,
430  CMDeviceState deviceState);
431 
440  CMError
441  CMGetDeviceState(CMDeviceClass deviceClass, CMDeviceID deviceID,
442  CMDeviceState *deviceState);
443 
452  CMError
453  CMGetDeviceInfo(CMDeviceClass deviceClass, CMDeviceID deviceID,
454  CMDeviceInfo *deviceInfo);
455 
467  CMError
468  CMIterateColorDevices(CMIterateDeviceInfoProcPtr proc, UInt32 *seed,
469  UInt32 *count, void *refCon);
470 
479  CMError
480  CMIterateDeviceProfiles(CMIterateDeviceProfileProcPtr proc, UInt32 *seed,
481  UInt32 *count, UInt32 flags, void *refCon);
482 
483 #endif
485 #if PRAGMA_STRUCT_ALIGN
486 #pragma options align = reset
487 #elif PRAGMA_STRUCT_PACKPUSH
488 #pragma pack(pop)
489 #elif PRAGMA_STRUCT_PACK
490 #pragma pack()
491 #endif
492 
493 #ifdef PRAGMA_IMPORT_OFF
494 #pragma import off
495 #elif PRAGMA_IMPORT
496 #pragma import reset
497 #endif
498 
499 #ifdef __cplusplus
500 }
501 #endif
502 
503 #endif
Color Matching Interfaces.
ICC Profile Format Definitions.
Basic Macintosh data types.
Definition: CMApplication.h:636