2003/09/21 10:25:34
[org.ibex.core.git] / src / org / xwt / plat / DarwinCarbonHeaders.h
1 // stuff needed from Mac OS headers that ARE NOT in /usr/include
2 // this stuff usually comes from /System/Library/Frameworks/*/Headers
3
4
5 typedef u_int8_t uint8_t;
6 typedef u_int16_t uint16_t;
7 typedef u_int32_t uint32_t;
8 typedef u_int64_t uint64_t;
9
10
11
12 typedef int8_t int_least8_t;
13 typedef int16_t int_least16_t;
14 typedef int32_t int_least32_t;
15 typedef int64_t int_least64_t;
16 typedef uint8_t uint_least8_t;
17 typedef uint16_t uint_least16_t;
18 typedef uint32_t uint_least32_t;
19 typedef uint64_t uint_least64_t;
20
21
22
23 typedef int8_t int_fast8_t;
24 typedef int16_t int_fast16_t;
25 typedef int32_t int_fast32_t;
26 typedef int64_t int_fast64_t;
27 typedef uint8_t uint_fast8_t;
28 typedef uint16_t uint_fast16_t;
29 typedef uint32_t uint_fast32_t;
30 typedef uint64_t uint_fast64_t;
31 typedef long long intmax_t;
32 typedef unsigned long long uintmax_t;
33
34
35
36 extern "C" {
37
38
39 typedef unsigned char UInt8;
40 typedef signed char SInt8;
41 typedef unsigned short UInt16;
42 typedef signed short SInt16;
43 typedef unsigned long UInt32;
44 typedef signed long SInt32;
45
46 struct wide {
47   SInt32 hi;
48   UInt32 lo;
49 };
50 typedef struct wide wide;
51 struct UnsignedWide {
52   UInt32 hi;
53   UInt32 lo;
54 };
55 typedef struct UnsignedWide UnsignedWide;
56       typedef signed long long SInt64;
57         typedef unsigned long long UInt64;
58 typedef long Fixed;
59 typedef Fixed * FixedPtr;
60 typedef long Fract;
61 typedef Fract * FractPtr;
62 typedef unsigned long UnsignedFixed;
63 typedef UnsignedFixed * UnsignedFixedPtr;
64 typedef short ShortFixed;
65 typedef ShortFixed * ShortFixedPtr;
66 typedef float Float32;
67 typedef double Float64;
68 struct Float80 {
69     SInt16 exp;
70     UInt16 man[4];
71 };
72 typedef struct Float80 Float80;
73
74 struct Float96 {
75     SInt16 exp[2];
76     UInt16 man[4];
77 };
78 typedef struct Float96 Float96;
79 struct Float32Point {
80     Float32 x;
81     Float32 y;
82 };
83 typedef struct Float32Point Float32Point;
84 typedef char * Ptr;
85 typedef Ptr * Handle;
86 typedef long Size;
87 typedef SInt16 OSErr;
88 typedef SInt32 OSStatus;
89 typedef void * LogicalAddress;
90 typedef const void * ConstLogicalAddress;
91 typedef void * PhysicalAddress;
92 typedef UInt8 * BytePtr;
93 typedef UInt32 ByteCount;
94 typedef UInt32 ByteOffset;
95 typedef SInt32 Duration;
96 typedef UnsignedWide AbsoluteTime;
97 typedef UInt32 OptionBits;
98 typedef UInt32 ItemCount;
99 typedef UInt32 PBVersion;
100 typedef SInt16 ScriptCode;
101 typedef SInt16 LangCode;
102 typedef SInt16 RegionCode;
103 typedef unsigned long FourCharCode;
104 typedef FourCharCode OSType;
105 typedef FourCharCode ResType;
106 typedef OSType * OSTypePtr;
107 typedef ResType * ResTypePtr;
108 typedef unsigned char Boolean;
109 typedef long ( * ProcPtr)();
110 typedef void ( * Register68kProcPtr)();
111
112
113
114
115 typedef ProcPtr UniversalProcPtr;
116
117
118 typedef ProcPtr * ProcHandle;
119 typedef UniversalProcPtr * UniversalProcHandle;
120 enum {
121   noErr = 0
122 };
123
124 enum {
125   kNilOptions = 0
126 };
127
128
129 enum {
130   kVariableLengthArray = 1
131 };
132
133 enum {
134   kUnknownType = 0x3F3F3F3F
135 };
136 typedef UInt32 UnicodeScalarValue;
137 typedef UInt32 UTF32Char;
138 typedef UInt16 UniChar;
139 typedef UInt16 UTF16Char;
140 typedef UInt8 UTF8Char;
141 typedef UniChar * UniCharPtr;
142 typedef UInt32 UniCharCount;
143 typedef UniCharCount * UniCharCountPtr;
144 typedef unsigned char Str255[256];
145 typedef unsigned char Str63[64];
146 typedef unsigned char Str32[33];
147 typedef unsigned char Str31[32];
148 typedef unsigned char Str27[28];
149 typedef unsigned char Str15[16];
150 typedef unsigned char Str32Field[34];
151 typedef Str63 StrFileName;
152 typedef unsigned char * StringPtr;
153 typedef StringPtr * StringHandle;
154 typedef const unsigned char * ConstStringPtr;
155 typedef const unsigned char * ConstStr255Param;
156 typedef const unsigned char * ConstStr63Param;
157 typedef const unsigned char * ConstStr32Param;
158 typedef const unsigned char * ConstStr31Param;
159 typedef const unsigned char * ConstStr27Param;
160 typedef const unsigned char * ConstStr15Param;
161 typedef ConstStr63Param ConstStrFileNameParam;
162
163 inline unsigned char StrLength(ConstStr255Param string) { return (*string); }
164 struct Point {
165   short v;
166   short h;
167 };
168 typedef struct Point Point;
169 typedef Point * PointPtr;
170 struct Rect {
171   short top;
172   short left;
173   short bottom;
174   short right;
175 };
176 typedef struct Rect Rect;
177 typedef Rect * RectPtr;
178 struct FixedPoint {
179   Fixed x;
180   Fixed y;
181 };
182 typedef struct FixedPoint FixedPoint;
183 struct FixedRect {
184   Fixed left;
185   Fixed top;
186   Fixed right;
187   Fixed bottom;
188 };
189 typedef struct FixedRect FixedRect;
190
191 typedef short CharParameter;
192 enum {
193   normal = 0,
194   bold = 1,
195   italic = 2,
196   underline = 4,
197   outline = 8,
198   shadow = 0x10,
199   condense = 0x20,
200   extend = 0x40
201 };
202
203 typedef unsigned char Style;
204 typedef short StyleParameter;
205 typedef Style StyleField;
206 typedef long TimeValue;
207 typedef long TimeScale;
208 typedef wide CompTimeValue;
209 typedef SInt64 TimeValue64;
210 typedef struct TimeBaseRecord* TimeBase;
211 struct TimeRecord {
212   CompTimeValue value;
213   TimeScale scale;
214   TimeBase base;
215 };
216 typedef struct TimeRecord TimeRecord;
217 struct NumVersion {
218
219   UInt8 majorRev;
220   UInt8 minorAndBugRev;
221   UInt8 stage;
222   UInt8 nonRelRev;
223 };
224 typedef struct NumVersion NumVersion;
225 enum {
226
227   developStage = 0x20,
228   alphaStage = 0x40,
229   betaStage = 0x60,
230   finalStage = 0x80
231 };
232
233 union NumVersionVariant {
234
235   NumVersion parts;
236   unsigned long whole;
237 };
238 typedef union NumVersionVariant NumVersionVariant;
239 typedef NumVersionVariant * NumVersionVariantPtr;
240 typedef NumVersionVariantPtr * NumVersionVariantHandle;
241 struct VersRec {
242
243   NumVersion numericVersion;
244   short countryCode;
245   Str255 shortVersion;
246   Str255 reserved;
247 };
248 typedef struct VersRec VersRec;
249 typedef VersRec * VersRecPtr;
250 typedef VersRecPtr * VersRecHndl;
251
252
253
254
255
256 typedef UInt8 Byte;
257 typedef SInt8 SignedByte;
258 typedef wide * WidePtr;
259 typedef UnsignedWide * UnsignedWidePtr;
260 typedef Float80 extended80;
261 typedef Float96 extended96;
262 typedef SInt8 VHSelect;
263 extern void
264 Debugger(void) ;
265 extern void
266 DebugStr(ConstStr255Param debuggerMsg) ;
267 extern void
268 SysBreak(void) ;
269 extern void
270 SysBreakStr(ConstStr255Param debuggerMsg) ;
271 extern void
272 SysBreakFunc(ConstStr255Param debuggerMsg) ;
273
274
275 }
276 extern "C" {
277 extern double kCFCoreFoundationVersionNumber;
278
279
280
281
282
283
284
285 typedef UInt32 CFTypeID;
286 typedef UInt32 CFOptionFlags;
287 typedef UInt32 CFHashCode;
288 typedef SInt32 CFIndex;
289
290
291 typedef const void * CFTypeRef;
292
293 typedef const struct __CFString * CFStringRef;
294 typedef struct __CFString * CFMutableStringRef;
295
296
297
298
299
300
301 typedef CFTypeRef CFPropertyListRef;
302
303
304 typedef enum {
305     kCFCompareLessThan = -1,
306     kCFCompareEqualTo = 0,
307     kCFCompareGreaterThan = 1
308 } CFComparisonResult;
309
310
311 typedef CFComparisonResult (*CFComparatorFunction)(const void *val1, const void *val2, void *context);
312
313
314
315 enum {
316     kCFNotFound = -1
317 };
318
319
320
321 typedef struct {
322     CFIndex location;
323     CFIndex length;
324 } CFRange;
325
326
327 static __inline__ CFRange CFRangeMake(CFIndex loc, CFIndex len) {
328     CFRange range;
329     range.location = loc;
330     range.length = len;
331     return range;
332 }
333
334
335
336
337
338 extern
339 CFRange __CFRangeMake(CFIndex loc, CFIndex len);
340
341
342
343
344
345 typedef const struct __CFNull * CFNullRef;
346
347 extern
348 CFTypeID CFNullGetTypeID(void);
349
350 extern
351 const CFNullRef kCFNull;
352 typedef const struct __CFAllocator * CFAllocatorRef;
353
354
355 extern
356 const CFAllocatorRef kCFAllocatorDefault;
357
358
359 extern
360 const CFAllocatorRef kCFAllocatorSystemDefault;
361
362
363
364
365
366
367
368 extern
369 const CFAllocatorRef kCFAllocatorMalloc;
370
371
372
373
374
375 extern
376 const CFAllocatorRef kCFAllocatorNull;
377
378
379
380
381
382 extern
383 const CFAllocatorRef kCFAllocatorUseContext;
384
385 typedef const void * (*CFAllocatorRetainCallBack)(const void *info);
386 typedef void (*CFAllocatorReleaseCallBack)(const void *info);
387 typedef CFStringRef (*CFAllocatorCopyDescriptionCallBack)(const void *info);
388 typedef void * (*CFAllocatorAllocateCallBack)(CFIndex allocSize, CFOptionFlags hint, void *info);
389 typedef void * (*CFAllocatorReallocateCallBack)(void *ptr, CFIndex newsize, CFOptionFlags hint, void *info);
390 typedef void (*CFAllocatorDeallocateCallBack)(void *ptr, void *info);
391 typedef CFIndex (*CFAllocatorPreferredSizeCallBack)(CFIndex size, CFOptionFlags hint, void *info);
392 typedef struct {
393     CFIndex version;
394     void * info;
395     CFAllocatorRetainCallBack retain;
396     CFAllocatorReleaseCallBack release;
397     CFAllocatorCopyDescriptionCallBack copyDescription;
398     CFAllocatorAllocateCallBack allocate;
399     CFAllocatorReallocateCallBack reallocate;
400     CFAllocatorDeallocateCallBack deallocate;
401     CFAllocatorPreferredSizeCallBack preferredSize;
402 } CFAllocatorContext;
403
404 extern
405 CFTypeID CFAllocatorGetTypeID(void);
406 extern
407 void CFAllocatorSetDefault(CFAllocatorRef allocator);
408
409 extern
410 CFAllocatorRef CFAllocatorGetDefault(void);
411
412 extern
413 CFAllocatorRef CFAllocatorCreate(CFAllocatorRef allocator, CFAllocatorContext *context);
414
415 extern
416 void *CFAllocatorAllocate(CFAllocatorRef allocator, CFIndex size, CFOptionFlags hint);
417
418 extern
419 void *CFAllocatorReallocate(CFAllocatorRef allocator, void *ptr, CFIndex newsize, CFOptionFlags hint);
420
421 extern
422 void CFAllocatorDeallocate(CFAllocatorRef allocator, void *ptr);
423
424 extern
425 CFIndex CFAllocatorGetPreferredSizeForSize(CFAllocatorRef allocator, CFIndex size, CFOptionFlags hint);
426
427 extern
428 void CFAllocatorGetContext(CFAllocatorRef allocator, CFAllocatorContext *context);
429
430
431
432
433 extern
434 CFTypeID CFGetTypeID(CFTypeRef cf);
435
436 extern
437 CFStringRef CFCopyTypeIDDescription(CFTypeID type_id);
438
439 extern
440 CFTypeRef CFRetain(CFTypeRef cf);
441
442 extern
443 void CFRelease(CFTypeRef cf);
444
445 extern
446 CFIndex CFGetRetainCount(CFTypeRef cf);
447
448 extern
449 Boolean CFEqual(CFTypeRef cf1, CFTypeRef cf2);
450
451 extern
452 CFHashCode CFHash(CFTypeRef cf);
453
454 extern
455 CFStringRef CFCopyDescription(CFTypeRef cf);
456
457 extern
458 CFAllocatorRef CFGetAllocator(CFTypeRef cf);
459
460
461 }
462 extern "C" {
463 typedef const void * (*CFArrayRetainCallBack)(CFAllocatorRef allocator, const void *value);
464 typedef void (*CFArrayReleaseCallBack)(CFAllocatorRef allocator, const void *value);
465 typedef CFStringRef (*CFArrayCopyDescriptionCallBack)(const void *value);
466 typedef Boolean (*CFArrayEqualCallBack)(const void *value1, const void *value2);
467 typedef struct {
468     CFIndex version;
469     CFArrayRetainCallBack retain;
470     CFArrayReleaseCallBack release;
471     CFArrayCopyDescriptionCallBack copyDescription;
472     CFArrayEqualCallBack equal;
473 } CFArrayCallBacks;
474
475
476
477
478
479
480 extern
481 const CFArrayCallBacks kCFTypeArrayCallBacks;
482 typedef void (*CFArrayApplierFunction)(const void *value, void *context);
483
484
485
486
487
488 typedef const struct __CFArray * CFArrayRef;
489
490
491
492
493
494 typedef struct __CFArray * CFMutableArrayRef;
495
496
497
498
499
500 extern
501 CFTypeID CFArrayGetTypeID(void);
502 extern
503 CFArrayRef CFArrayCreate(CFAllocatorRef allocator, const void **values, CFIndex numValues, const CFArrayCallBacks *callBacks);
504 extern
505 CFArrayRef CFArrayCreateCopy(CFAllocatorRef allocator, CFArrayRef theArray);
506 extern
507 CFMutableArrayRef CFArrayCreateMutable(CFAllocatorRef allocator, CFIndex capacity, const CFArrayCallBacks *callBacks);
508 extern
509 CFMutableArrayRef CFArrayCreateMutableCopy(CFAllocatorRef allocator, CFIndex capacity, CFArrayRef theArray);
510 extern
511 CFIndex CFArrayGetCount(CFArrayRef theArray);
512 extern
513 CFIndex CFArrayGetCountOfValue(CFArrayRef theArray, CFRange range, const void *value);
514 extern
515 Boolean CFArrayContainsValue(CFArrayRef theArray, CFRange range, const void *value);
516 extern
517 const void *CFArrayGetValueAtIndex(CFArrayRef theArray, CFIndex idx);
518 extern
519 void CFArrayGetValues(CFArrayRef theArray, CFRange range, const void **values);
520 extern
521 void CFArrayApplyFunction(CFArrayRef theArray, CFRange range, CFArrayApplierFunction applier, void *context);
522 extern
523 CFIndex CFArrayGetFirstIndexOfValue(CFArrayRef theArray, CFRange range, const void *value);
524 extern
525 CFIndex CFArrayGetLastIndexOfValue(CFArrayRef theArray, CFRange range, const void *value);
526 extern
527 CFIndex CFArrayBSearchValues(CFArrayRef theArray, CFRange range, const void *value, CFComparatorFunction comparator, void *context);
528 extern
529 void CFArrayAppendValue(CFMutableArrayRef theArray, const void *value);
530 extern
531 void CFArrayInsertValueAtIndex(CFMutableArrayRef theArray, CFIndex idx, const void *value);
532 extern
533 void CFArraySetValueAtIndex(CFMutableArrayRef theArray, CFIndex idx, const void *value);
534 extern
535 void CFArrayRemoveValueAtIndex(CFMutableArrayRef theArray, CFIndex idx);
536 extern
537 void CFArrayRemoveAllValues(CFMutableArrayRef theArray);
538 extern
539 void CFArrayReplaceValues(CFMutableArrayRef theArray, CFRange range, const void **newValues, CFIndex newCount);
540 extern
541 void CFArrayExchangeValuesAtIndices(CFMutableArrayRef theArray, CFIndex idx1, CFIndex idx2);
542 extern
543 void CFArraySortValues(CFMutableArrayRef theArray, CFRange range, CFComparatorFunction comparator, void *context);
544 extern
545 void CFArrayAppendArray(CFMutableArrayRef theArray, CFArrayRef otherArray, CFRange otherRange);
546
547
548 }
549 extern "C" {
550
551
552 typedef const void * (*CFBagRetainCallBack)(CFAllocatorRef allocator, const void *value);
553 typedef void (*CFBagReleaseCallBack)(CFAllocatorRef allocator, const void *value);
554 typedef CFStringRef (*CFBagCopyDescriptionCallBack)(const void *value);
555 typedef Boolean (*CFBagEqualCallBack)(const void *value1, const void *value2);
556 typedef CFHashCode (*CFBagHashCallBack)(const void *value);
557 typedef struct {
558     CFIndex version;
559     CFBagRetainCallBack retain;
560     CFBagReleaseCallBack release;
561     CFBagCopyDescriptionCallBack copyDescription;
562     CFBagEqualCallBack equal;
563     CFBagHashCallBack hash;
564 } CFBagCallBacks;
565
566 extern
567 const CFBagCallBacks kCFTypeBagCallBacks;
568 extern
569 const CFBagCallBacks kCFCopyStringBagCallBacks;
570
571 typedef void (*CFBagApplierFunction)(const void *value, void *context);
572
573 typedef const struct __CFBag * CFBagRef;
574 typedef struct __CFBag * CFMutableBagRef;
575
576 extern
577 CFTypeID CFBagGetTypeID(void);
578
579 extern
580 CFBagRef CFBagCreate(CFAllocatorRef allocator, const void **values, CFIndex numValues, const CFBagCallBacks *callBacks);
581
582 extern
583 CFBagRef CFBagCreateCopy(CFAllocatorRef allocator, CFBagRef theBag);
584
585 extern
586 CFMutableBagRef CFBagCreateMutable(CFAllocatorRef allocator, CFIndex capacity, const CFBagCallBacks *callBacks);
587
588 extern
589 CFMutableBagRef CFBagCreateMutableCopy(CFAllocatorRef allocator, CFIndex capacity, CFBagRef theBag);
590
591 extern
592 CFIndex CFBagGetCount(CFBagRef theBag);
593
594 extern
595 CFIndex CFBagGetCountOfValue(CFBagRef theBag, const void *value);
596
597 extern
598 Boolean CFBagContainsValue(CFBagRef theBag, const void *value);
599
600 extern
601 const void *CFBagGetValue(CFBagRef theBag, const void *value);
602
603 extern
604 Boolean CFBagGetValueIfPresent(CFBagRef theBag, const void *candidate, const void **value);
605
606 extern
607 void CFBagGetValues(CFBagRef theBag, const void **values);
608
609 extern
610 void CFBagApplyFunction(CFBagRef theBag, CFBagApplierFunction applier, void *context);
611
612 extern
613 void CFBagAddValue(CFMutableBagRef theBag, const void *value);
614
615 extern
616 void CFBagReplaceValue(CFMutableBagRef theBag, const void *value);
617
618 extern
619 void CFBagSetValue(CFMutableBagRef theBag, const void *value);
620
621 extern
622 void CFBagRemoveValue(CFMutableBagRef theBag, const void *value);
623
624 extern
625 void CFBagRemoveAllValues(CFMutableBagRef theBag);
626
627
628 }
629 extern "C" {
630
631
632 typedef const struct __CFData * CFDataRef;
633 typedef struct __CFData * CFMutableDataRef;
634
635 extern
636 CFTypeID CFDataGetTypeID(void);
637
638 extern
639 CFDataRef CFDataCreate(CFAllocatorRef allocator, const UInt8 *bytes, CFIndex length);
640
641 extern
642 CFDataRef CFDataCreateWithBytesNoCopy(CFAllocatorRef allocator, const UInt8 *bytes, CFIndex length, CFAllocatorRef bytesDeallocator);
643
644
645 extern
646 CFDataRef CFDataCreateCopy(CFAllocatorRef allocator, CFDataRef theData);
647
648 extern
649 CFMutableDataRef CFDataCreateMutable(CFAllocatorRef allocator, CFIndex capacity);
650
651 extern
652 CFMutableDataRef CFDataCreateMutableCopy(CFAllocatorRef allocator, CFIndex capacity, CFDataRef theData);
653
654 extern
655 CFIndex CFDataGetLength(CFDataRef theData);
656
657 extern
658 const UInt8 *CFDataGetBytePtr(CFDataRef theData);
659
660 extern
661 UInt8 *CFDataGetMutableBytePtr(CFMutableDataRef theData);
662
663 extern
664 void CFDataGetBytes(CFDataRef theData, CFRange range, UInt8 *buffer);
665
666 extern
667 void CFDataSetLength(CFMutableDataRef theData, CFIndex length);
668
669 extern
670 void CFDataIncreaseLength(CFMutableDataRef theData, CFIndex extraLength);
671
672 extern
673 void CFDataAppendBytes(CFMutableDataRef theData, const UInt8 *bytes, CFIndex length);
674
675 extern
676 void CFDataReplaceBytes(CFMutableDataRef theData, CFRange range, const UInt8 *newBytes, CFIndex newLength);
677
678 extern
679 void CFDataDeleteBytes(CFMutableDataRef theData, CFRange range);
680
681
682 }
683
684
685 extern "C" {
686
687
688
689
690
691
692 typedef const struct __CFCharacterSet * CFCharacterSetRef;
693
694
695
696
697
698 typedef struct __CFCharacterSet * CFMutableCharacterSetRef;
699
700
701
702
703
704 typedef enum {
705     kCFCharacterSetControl = 1,
706     kCFCharacterSetWhitespace,
707     kCFCharacterSetWhitespaceAndNewline,
708     kCFCharacterSetDecimalDigit,
709     kCFCharacterSetLetter,
710     kCFCharacterSetLowercaseLetter,
711     kCFCharacterSetUppercaseLetter,
712     kCFCharacterSetNonBase,
713     kCFCharacterSetDecomposable,
714     kCFCharacterSetAlphaNumeric,
715     kCFCharacterSetPunctuation,
716     kCFCharacterSetIllegal
717
718     ,
719     kCFCharacterSetCapitalizedLetter
720
721 } CFCharacterSetPredefinedSet;
722
723
724
725
726
727 extern
728 CFTypeID CFCharacterSetGetTypeID(void);
729 extern
730 CFCharacterSetRef CFCharacterSetGetPredefined(CFCharacterSetPredefinedSet theSetIdentifier);
731 extern
732 CFCharacterSetRef CFCharacterSetCreateWithCharactersInRange(CFAllocatorRef alloc, CFRange theRange);
733 extern
734 CFCharacterSetRef CFCharacterSetCreateWithCharactersInString(CFAllocatorRef alloc, CFStringRef theString);
735 extern
736 CFCharacterSetRef CFCharacterSetCreateWithBitmapRepresentation(CFAllocatorRef alloc, CFDataRef theData);
737 extern CFCharacterSetRef CFCharacterSetCreateInvertedSet(CFAllocatorRef alloc, CFCharacterSetRef theSet);
738 extern Boolean CFCharacterSetIsSupersetOfSet(CFCharacterSetRef theSet, CFCharacterSetRef theOtherset);
739 extern Boolean CFCharacterSetHasMemberInPlane(CFCharacterSetRef theSet, CFIndex thePlane);
740 extern
741 CFMutableCharacterSetRef CFCharacterSetCreateMutable(CFAllocatorRef alloc);
742 extern
743 CFMutableCharacterSetRef CFCharacterSetCreateMutableCopy(CFAllocatorRef alloc, CFCharacterSetRef theSet);
744 extern
745 Boolean CFCharacterSetIsCharacterMember(CFCharacterSetRef theSet, UniChar theChar);
746 extern Boolean CFCharacterSetIsLongCharacterMember(CFCharacterSetRef theSet, UTF32Char theChar);
747 extern
748 CFDataRef CFCharacterSetCreateBitmapRepresentation(CFAllocatorRef alloc, CFCharacterSetRef theSet);
749 extern
750 void CFCharacterSetAddCharactersInRange(CFMutableCharacterSetRef theSet, CFRange theRange);
751 extern
752 void CFCharacterSetRemoveCharactersInRange(CFMutableCharacterSetRef theSet, CFRange theRange);
753 extern
754 void CFCharacterSetAddCharactersInString(CFMutableCharacterSetRef theSet, CFStringRef theString);
755 extern
756 void CFCharacterSetRemoveCharactersInString(CFMutableCharacterSetRef theSet, CFStringRef theString);
757 extern
758 void CFCharacterSetUnion(CFMutableCharacterSetRef theSet, CFCharacterSetRef theOtherSet);
759 extern
760 void CFCharacterSetIntersect(CFMutableCharacterSetRef theSet, CFCharacterSetRef theOtherSet);
761 extern
762 void CFCharacterSetInvert(CFMutableCharacterSetRef theSet);
763
764
765 }
766
767 extern "C" {
768
769
770 typedef double CFTimeInterval;
771 typedef CFTimeInterval CFAbsoluteTime;
772
773
774
775 extern
776 CFAbsoluteTime CFAbsoluteTimeGetCurrent(void);
777
778 extern
779 const CFTimeInterval kCFAbsoluteTimeIntervalSince1970;
780 extern
781 const CFTimeInterval kCFAbsoluteTimeIntervalSince1904;
782
783 typedef const struct __CFDate * CFDateRef;
784
785 extern
786 CFTypeID CFDateGetTypeID(void);
787
788 extern
789 CFDateRef CFDateCreate(CFAllocatorRef allocator, CFAbsoluteTime at);
790
791 extern
792 CFAbsoluteTime CFDateGetAbsoluteTime(CFDateRef theDate);
793
794 extern
795 CFTimeInterval CFDateGetTimeIntervalSinceDate(CFDateRef theDate, CFDateRef otherDate);
796
797 extern
798 CFComparisonResult CFDateCompare(CFDateRef theDate, CFDateRef otherDate, void *context);
799
800 typedef const struct __CFTimeZone * CFTimeZoneRef;
801
802 typedef struct {
803     SInt32 year;
804     SInt8 month;
805     SInt8 day;
806     SInt8 hour;
807     SInt8 minute;
808     double second;
809 } CFGregorianDate;
810
811 typedef struct {
812     SInt32 years;
813     SInt32 months;
814     SInt32 days;
815     SInt32 hours;
816     SInt32 minutes;
817     double seconds;
818 } CFGregorianUnits;
819
820 typedef enum {
821     kCFGregorianUnitsYears = (1 << 0),
822     kCFGregorianUnitsMonths = (1 << 1),
823     kCFGregorianUnitsDays = (1 << 2),
824     kCFGregorianUnitsHours = (1 << 3),
825     kCFGregorianUnitsMinutes = (1 << 4),
826     kCFGregorianUnitsSeconds = (1 << 5),
827
828
829
830
831     kCFGregorianAllUnits = 0x00FFFFFF
832 } CFGregorianUnitFlags;
833
834 extern
835 Boolean CFGregorianDateIsValid(CFGregorianDate gdate, CFOptionFlags unitFlags);
836
837 extern
838 CFAbsoluteTime CFGregorianDateGetAbsoluteTime(CFGregorianDate gdate, CFTimeZoneRef tz);
839
840 extern
841 CFGregorianDate CFAbsoluteTimeGetGregorianDate(CFAbsoluteTime at, CFTimeZoneRef tz);
842
843 extern
844 CFAbsoluteTime CFAbsoluteTimeAddGregorianUnits(CFAbsoluteTime at, CFTimeZoneRef tz, CFGregorianUnits units);
845
846 extern
847 CFGregorianUnits CFAbsoluteTimeGetDifferenceAsGregorianUnits(CFAbsoluteTime at1, CFAbsoluteTime at2, CFTimeZoneRef tz, CFOptionFlags unitFlags);
848
849 extern
850 SInt32 CFAbsoluteTimeGetDayOfWeek(CFAbsoluteTime at, CFTimeZoneRef tz);
851
852 extern
853 SInt32 CFAbsoluteTimeGetDayOfYear(CFAbsoluteTime at, CFTimeZoneRef tz);
854
855 extern
856 SInt32 CFAbsoluteTimeGetWeekOfYear(CFAbsoluteTime at, CFTimeZoneRef tz);
857
858
859 }
860 extern "C" {
861 typedef const void * (*CFDictionaryRetainCallBack)(CFAllocatorRef allocator, const void *value);
862 typedef void (*CFDictionaryReleaseCallBack)(CFAllocatorRef allocator, const void *value);
863 typedef CFStringRef (*CFDictionaryCopyDescriptionCallBack)(const void *value);
864 typedef Boolean (*CFDictionaryEqualCallBack)(const void *value1, const void *value2);
865 typedef CFHashCode (*CFDictionaryHashCallBack)(const void *value);
866 typedef struct {
867     CFIndex version;
868     CFDictionaryRetainCallBack retain;
869     CFDictionaryReleaseCallBack release;
870     CFDictionaryCopyDescriptionCallBack copyDescription;
871     CFDictionaryEqualCallBack equal;
872     CFDictionaryHashCallBack hash;
873 } CFDictionaryKeyCallBacks;
874
875
876
877
878
879
880
881 extern
882 const CFDictionaryKeyCallBacks kCFTypeDictionaryKeyCallBacks;
883 extern
884 const CFDictionaryKeyCallBacks kCFCopyStringDictionaryKeyCallBacks;
885 typedef struct {
886     CFIndex version;
887     CFDictionaryRetainCallBack retain;
888     CFDictionaryReleaseCallBack release;
889     CFDictionaryCopyDescriptionCallBack copyDescription;
890     CFDictionaryEqualCallBack equal;
891 } CFDictionaryValueCallBacks;
892
893
894
895
896
897
898
899 extern
900 const CFDictionaryValueCallBacks kCFTypeDictionaryValueCallBacks;
901 typedef void (*CFDictionaryApplierFunction)(const void *key, const void *value, void *context);
902
903
904
905
906
907 typedef const struct __CFDictionary * CFDictionaryRef;
908
909
910
911
912
913 typedef struct __CFDictionary * CFMutableDictionaryRef;
914
915
916
917
918
919 extern
920 CFTypeID CFDictionaryGetTypeID(void);
921 extern
922 CFDictionaryRef CFDictionaryCreate(CFAllocatorRef allocator, const void **keys, const void **values, CFIndex numValues, const CFDictionaryKeyCallBacks *keyCallBacks, const CFDictionaryValueCallBacks *valueCallBacks);
923 extern
924 CFDictionaryRef CFDictionaryCreateCopy(CFAllocatorRef allocator, CFDictionaryRef theDict);
925 extern
926 CFMutableDictionaryRef CFDictionaryCreateMutable(CFAllocatorRef allocator, CFIndex capacity, const CFDictionaryKeyCallBacks *keyCallBacks, const CFDictionaryValueCallBacks *valueCallBacks);
927 extern
928 CFMutableDictionaryRef CFDictionaryCreateMutableCopy(CFAllocatorRef allocator, CFIndex capacity, CFDictionaryRef theDict);
929 extern
930 CFIndex CFDictionaryGetCount(CFDictionaryRef theDict);
931 extern
932 CFIndex CFDictionaryGetCountOfKey(CFDictionaryRef theDict, const void *key);
933 extern
934 CFIndex CFDictionaryGetCountOfValue(CFDictionaryRef theDict, const void *value);
935 extern
936 Boolean CFDictionaryContainsKey(CFDictionaryRef theDict, const void *key);
937 extern
938 Boolean CFDictionaryContainsValue(CFDictionaryRef theDict, const void *value);
939 extern
940 const void *CFDictionaryGetValue(CFDictionaryRef theDict, const void *key);
941 extern
942 Boolean CFDictionaryGetValueIfPresent(CFDictionaryRef theDict, const void *key, const void **value);
943 extern
944 void CFDictionaryGetKeysAndValues(CFDictionaryRef theDict, const void **keys, const void **values);
945 extern
946 void CFDictionaryApplyFunction(CFDictionaryRef theDict, CFDictionaryApplierFunction applier, void *context);
947 extern
948 void CFDictionaryAddValue(CFMutableDictionaryRef theDict, const void *key, const void *value);
949 extern
950 void CFDictionarySetValue(CFMutableDictionaryRef theDict, const void *key, const void *value);
951 extern
952 void CFDictionaryReplaceValue(CFMutableDictionaryRef theDict, const void *key, const void *value);
953 extern
954 void CFDictionaryRemoveValue(CFMutableDictionaryRef theDict, const void *key);
955 extern
956 void CFDictionaryRemoveAllValues(CFMutableDictionaryRef theDict);
957
958
959 }
960 extern "C" {
961
962
963 typedef const struct __CFBoolean * CFBooleanRef;
964
965 extern
966 const CFBooleanRef kCFBooleanTrue;
967 extern
968 const CFBooleanRef kCFBooleanFalse;
969
970 extern
971 CFTypeID CFBooleanGetTypeID(void);
972
973 extern
974 Boolean CFBooleanGetValue(CFBooleanRef boolean);
975
976 typedef enum {
977
978     kCFNumberSInt8Type = 1,
979     kCFNumberSInt16Type = 2,
980     kCFNumberSInt32Type = 3,
981     kCFNumberSInt64Type = 4,
982     kCFNumberFloat32Type = 5,
983     kCFNumberFloat64Type = 6,
984
985     kCFNumberCharType = 7,
986     kCFNumberShortType = 8,
987     kCFNumberIntType = 9,
988     kCFNumberLongType = 10,
989     kCFNumberLongLongType = 11,
990     kCFNumberFloatType = 12,
991     kCFNumberDoubleType = 13,
992
993     kCFNumberCFIndexType = 14,
994     kCFNumberMaxType = 14
995 } CFNumberType;
996
997 typedef const struct __CFNumber * CFNumberRef;
998
999 extern
1000 const CFNumberRef kCFNumberPositiveInfinity;
1001 extern
1002 const CFNumberRef kCFNumberNegativeInfinity;
1003 extern
1004 const CFNumberRef kCFNumberNaN;
1005
1006 extern
1007 CFTypeID CFNumberGetTypeID(void);
1008 extern
1009 CFNumberRef CFNumberCreate(CFAllocatorRef allocator, CFNumberType theType, const void *valuePtr);
1010
1011
1012
1013
1014
1015 extern
1016 CFNumberType CFNumberGetType(CFNumberRef number);
1017
1018
1019
1020
1021 extern
1022 CFIndex CFNumberGetByteSize(CFNumberRef number);
1023
1024
1025
1026
1027
1028 extern
1029 Boolean CFNumberIsFloatType(CFNumberRef number);
1030 extern
1031 Boolean CFNumberGetValue(CFNumberRef number, CFNumberType theType, void *valuePtr);
1032 extern
1033 CFComparisonResult CFNumberCompare(CFNumberRef number, CFNumberRef otherNumber, void *context);
1034
1035
1036 }
1037 typedef __builtin_va_list __gnuc_va_list;
1038 typedef __gnuc_va_list va_list;
1039
1040
1041 extern "C" {
1042 typedef UInt32 CFStringEncoding;
1043
1044
1045
1046
1047
1048 typedef enum {
1049     kCFStringEncodingMacRoman = 0,
1050     kCFStringEncodingWindowsLatin1 = 0x0500,
1051     kCFStringEncodingISOLatin1 = 0x0201,
1052     kCFStringEncodingNextStepLatin = 0x0B01,
1053     kCFStringEncodingASCII = 0x0600,
1054     kCFStringEncodingUnicode = 0x0100,
1055     kCFStringEncodingUTF8 = 0x08000100,
1056     kCFStringEncodingNonLossyASCII = 0x0BFF
1057 } CFStringBuiltInEncodings;
1058
1059
1060 extern
1061 CFTypeID CFStringGetTypeID(void);
1062 extern
1063 CFStringRef CFStringCreateWithPascalString(CFAllocatorRef alloc, ConstStr255Param pStr, CFStringEncoding encoding);
1064
1065 extern
1066 CFStringRef CFStringCreateWithCString(CFAllocatorRef alloc, const char *cStr, CFStringEncoding encoding);
1067
1068 extern
1069 CFStringRef CFStringCreateWithCharacters(CFAllocatorRef alloc, const UniChar *chars, CFIndex numChars);
1070 extern
1071 CFStringRef CFStringCreateWithPascalStringNoCopy(CFAllocatorRef alloc, ConstStr255Param pStr, CFStringEncoding encoding, CFAllocatorRef contentsDeallocator);
1072
1073 extern
1074 CFStringRef CFStringCreateWithCStringNoCopy(CFAllocatorRef alloc, const char *cStr, CFStringEncoding encoding, CFAllocatorRef contentsDeallocator);
1075
1076 extern
1077 CFStringRef CFStringCreateWithCharactersNoCopy(CFAllocatorRef alloc, const UniChar *chars, CFIndex numChars, CFAllocatorRef contentsDeallocator);
1078
1079
1080
1081 extern
1082 CFStringRef CFStringCreateWithSubstring(CFAllocatorRef alloc, CFStringRef str, CFRange range);
1083
1084 extern
1085 CFStringRef CFStringCreateCopy(CFAllocatorRef alloc, CFStringRef theString);
1086
1087
1088
1089 extern
1090 CFStringRef CFStringCreateWithFormat(CFAllocatorRef alloc, CFDictionaryRef formatOptions, CFStringRef format, ...);
1091
1092 extern
1093 CFStringRef CFStringCreateWithFormatAndArguments(CFAllocatorRef alloc, CFDictionaryRef formatOptions, CFStringRef format, va_list arguments);
1094
1095
1096
1097 extern
1098 CFMutableStringRef CFStringCreateMutable(CFAllocatorRef alloc, CFIndex maxLength);
1099
1100 extern
1101 CFMutableStringRef CFStringCreateMutableCopy(CFAllocatorRef alloc, CFIndex maxLength, CFStringRef theString);
1102
1103
1104
1105
1106
1107
1108
1109 extern
1110 CFMutableStringRef CFStringCreateMutableWithExternalCharactersNoCopy(CFAllocatorRef alloc, UniChar *chars, CFIndex numChars, CFIndex capacity, CFAllocatorRef externalCharactersAllocator);
1111
1112
1113
1114
1115
1116 extern
1117 CFIndex CFStringGetLength(CFStringRef theString);
1118
1119
1120
1121
1122
1123
1124 extern
1125 UniChar CFStringGetCharacterAtIndex(CFStringRef theString, CFIndex idx);
1126
1127 extern
1128 void CFStringGetCharacters(CFStringRef theString, CFRange range, UniChar *buffer);
1129 extern
1130 Boolean CFStringGetPascalString(CFStringRef theString, StringPtr buffer, CFIndex bufferSize, CFStringEncoding encoding);
1131
1132 extern
1133 Boolean CFStringGetCString(CFStringRef theString, char *buffer, CFIndex bufferSize, CFStringEncoding encoding);
1134
1135
1136
1137
1138
1139
1140 extern
1141 ConstStringPtr CFStringGetPascalStringPtr(CFStringRef theString, CFStringEncoding encoding);
1142
1143 extern
1144 const char *CFStringGetCStringPtr(CFStringRef theString, CFStringEncoding encoding);
1145
1146 extern
1147 const UniChar *CFStringGetCharactersPtr(CFStringRef theString);
1148 extern
1149 CFIndex CFStringGetBytes(CFStringRef theString, CFRange range, CFStringEncoding encoding, UInt8 lossByte, Boolean isExternalRepresentation, UInt8 *buffer, CFIndex maxBufLen, CFIndex *usedBufLen);
1150
1151
1152
1153
1154
1155
1156
1157 extern
1158 CFStringRef CFStringCreateWithBytes(CFAllocatorRef alloc, const UInt8 *bytes, CFIndex numBytes, CFStringEncoding encoding, Boolean isExternalRepresentation);
1159
1160
1161
1162
1163
1164
1165
1166 extern
1167 CFStringRef CFStringCreateFromExternalRepresentation(CFAllocatorRef alloc, CFDataRef data, CFStringEncoding encoding);
1168
1169 extern
1170 CFDataRef CFStringCreateExternalRepresentation(CFAllocatorRef alloc, CFStringRef theString, CFStringEncoding encoding, UInt8 lossByte);
1171
1172
1173
1174 extern
1175 CFStringEncoding CFStringGetSmallestEncoding(CFStringRef theString);
1176
1177 extern
1178 CFStringEncoding CFStringGetFastestEncoding(CFStringRef theString);
1179
1180
1181
1182 extern
1183 CFStringEncoding CFStringGetSystemEncoding(void);
1184
1185 extern
1186 CFIndex CFStringGetMaximumSizeForEncoding(CFIndex length, CFStringEncoding encoding);
1187
1188
1189
1190
1191
1192
1193 typedef enum {
1194     kCFCompareCaseInsensitive = 1,
1195     kCFCompareBackwards = 4,
1196     kCFCompareAnchored = 8,
1197     kCFCompareNonliteral = 16,
1198     kCFCompareLocalized = 32,
1199     kCFCompareNumerically = 64
1200 } CFStringCompareFlags;
1201
1202
1203
1204
1205
1206
1207 extern
1208 CFComparisonResult CFStringCompareWithOptions(CFStringRef theString1, CFStringRef theString2, CFRange rangeToCompare, CFOptionFlags compareOptions);
1209
1210
1211
1212
1213
1214 extern
1215 CFComparisonResult CFStringCompare(CFStringRef theString1, CFStringRef theString2, CFOptionFlags compareOptions);
1216
1217
1218
1219
1220
1221 extern
1222 Boolean CFStringFindWithOptions(CFStringRef theString, CFStringRef stringToFind, CFRange rangeToSearch, CFOptionFlags searchOptions, CFRange *result);
1223 extern
1224 CFArrayRef CFStringCreateArrayWithFindResults(CFAllocatorRef alloc, CFStringRef theString, CFStringRef stringToFind, CFRange rangeToSearch, CFOptionFlags compareOptions);
1225
1226
1227
1228 extern
1229 CFRange CFStringFind(CFStringRef theString, CFStringRef stringToFind, CFOptionFlags compareOptions);
1230
1231 extern
1232 Boolean CFStringHasPrefix(CFStringRef theString, CFStringRef prefix);
1233
1234 extern
1235 Boolean CFStringHasSuffix(CFStringRef theString, CFStringRef suffix);
1236 extern CFRange CFStringGetRangeOfComposedCharactersAtIndex(CFStringRef theString, CFIndex theIndex);
1237 extern Boolean CFStringFindCharacterFromSet(CFStringRef theString, CFCharacterSetRef theSet, CFRange rangeToSearch, CFOptionFlags searchOptions, CFRange *result);
1238 extern
1239 void CFStringGetLineBounds(CFStringRef theString, CFRange range, CFIndex *lineBeginIndex, CFIndex *lineEndIndex, CFIndex *contentsEndIndex);
1240
1241
1242
1243 extern
1244 CFStringRef CFStringCreateByCombiningStrings(CFAllocatorRef alloc, CFArrayRef theArray, CFStringRef separatorString);
1245
1246 extern
1247 CFArrayRef CFStringCreateArrayBySeparatingStrings(CFAllocatorRef alloc, CFStringRef theString, CFStringRef separatorString);
1248
1249
1250
1251 extern
1252 SInt32 CFStringGetIntValue(CFStringRef str);
1253
1254 extern
1255 double CFStringGetDoubleValue(CFStringRef str);
1256 extern
1257 void CFStringAppend(CFMutableStringRef theString, CFStringRef appendedString);
1258
1259 extern
1260 void CFStringAppendCharacters(CFMutableStringRef theString, const UniChar *chars, CFIndex numChars);
1261
1262 extern
1263 void CFStringAppendPascalString(CFMutableStringRef theString, ConstStr255Param pStr, CFStringEncoding encoding);
1264
1265 extern
1266 void CFStringAppendCString(CFMutableStringRef theString, const char *cStr, CFStringEncoding encoding);
1267
1268 extern
1269 void CFStringAppendFormat(CFMutableStringRef theString, CFDictionaryRef formatOptions, CFStringRef format, ...);
1270
1271 extern
1272 void CFStringAppendFormatAndArguments(CFMutableStringRef theString, CFDictionaryRef formatOptions, CFStringRef format, va_list arguments);
1273
1274 extern
1275 void CFStringInsert(CFMutableStringRef str, CFIndex idx, CFStringRef insertedStr);
1276
1277 extern
1278 void CFStringDelete(CFMutableStringRef theString, CFRange range);
1279
1280 extern
1281 void CFStringReplace(CFMutableStringRef theString, CFRange range, CFStringRef replacement);
1282
1283 extern
1284 void CFStringReplaceAll(CFMutableStringRef theString, CFStringRef replacement);
1285 extern
1286 CFIndex CFStringFindAndReplace(CFMutableStringRef theString, CFStringRef stringToFind, CFStringRef replacementString, CFRange rangeToSearch, CFOptionFlags compareOptions);
1287 extern
1288 void CFStringSetExternalCharactersNoCopy(CFMutableStringRef theString, UniChar *chars, CFIndex length, CFIndex capacity);
1289 extern
1290 void CFStringPad(CFMutableStringRef theString, CFStringRef padString, CFIndex length, CFIndex indexIntoPad);
1291
1292 extern
1293 void CFStringTrim(CFMutableStringRef theString, CFStringRef trimString);
1294
1295 extern
1296 void CFStringTrimWhitespace(CFMutableStringRef theString);
1297
1298 extern
1299 void CFStringLowercase(CFMutableStringRef theString, const void *localeTBD);
1300
1301 extern
1302 void CFStringUppercase(CFMutableStringRef theString, const void *localeTBD);
1303
1304 extern
1305 void CFStringCapitalize(CFMutableStringRef theString, const void *localeTBD);
1306
1307
1308
1309
1310
1311
1312
1313 typedef enum {
1314         kCFStringNormalizationFormD = 0,
1315         kCFStringNormalizationFormKD,
1316         kCFStringNormalizationFormC,
1317         kCFStringNormalizationFormKC
1318 } CFStringNormalizationForm;
1319 extern void CFStringNormalize(CFMutableStringRef theString, CFStringNormalizationForm theForm);
1320
1321
1322
1323
1324 extern
1325 Boolean CFStringIsEncodingAvailable(CFStringEncoding encoding);
1326
1327
1328
1329 extern
1330 const CFStringEncoding *CFStringGetListOfAvailableEncodings(void);
1331
1332
1333
1334 extern
1335 CFStringRef CFStringGetNameOfEncoding(CFStringEncoding encoding);
1336
1337
1338
1339 extern
1340 UInt32 CFStringConvertEncodingToNSStringEncoding(CFStringEncoding encoding);
1341
1342 extern
1343 CFStringEncoding CFStringConvertNSStringEncodingToEncoding(UInt32 encoding);
1344
1345
1346
1347 extern
1348 UInt32 CFStringConvertEncodingToWindowsCodepage(CFStringEncoding encoding);
1349
1350 extern
1351 CFStringEncoding CFStringConvertWindowsCodepageToEncoding(UInt32 codepage);
1352
1353
1354
1355 extern
1356 CFStringEncoding CFStringConvertIANACharSetNameToEncoding(CFStringRef theString);
1357
1358 extern
1359 CFStringRef CFStringConvertEncodingToIANACharSetName(CFStringEncoding encoding);
1360
1361
1362
1363
1364
1365 extern
1366 CFStringEncoding CFStringGetMostCompatibleMacStringEncoding(CFStringEncoding encoding);
1367 typedef struct {
1368     UniChar buffer[64];
1369     CFStringRef theString;
1370     const UniChar *directBuffer;
1371     CFRange rangeToBuffer;
1372     CFIndex bufferedRangeStart;
1373     CFIndex bufferedRangeEnd;
1374 } CFStringInlineBuffer;
1375
1376
1377 static __inline__ void CFStringInitInlineBuffer(CFStringRef str, CFStringInlineBuffer *buf, CFRange range) {
1378     buf->theString = str;
1379     buf->rangeToBuffer = range;
1380     buf->directBuffer = CFStringGetCharactersPtr(str);
1381     buf->bufferedRangeStart = buf->bufferedRangeEnd = 0;
1382 }
1383
1384 static __inline__ UniChar CFStringGetCharacterFromInlineBuffer(CFStringInlineBuffer *buf, CFIndex idx) {
1385     if (buf->directBuffer) return buf->directBuffer[idx + buf->rangeToBuffer.location];
1386     if (idx >= buf->bufferedRangeEnd || idx < buf->bufferedRangeStart) {
1387         if (idx < 0 || idx > buf->rangeToBuffer.length) return 0;
1388         if ((buf->bufferedRangeStart = idx - 4) < 0) buf->bufferedRangeStart = 0;
1389         buf->bufferedRangeEnd = buf->bufferedRangeStart + 64;
1390         if (buf->bufferedRangeEnd > buf->rangeToBuffer.length) buf->bufferedRangeEnd = buf->rangeToBuffer.length;
1391         CFStringGetCharacters(buf->theString, CFRangeMake(buf->rangeToBuffer.location + buf->bufferedRangeStart, buf->bufferedRangeEnd - buf->bufferedRangeStart), buf->buffer);
1392     }
1393     return buf->buffer[idx - buf->bufferedRangeStart];
1394 }
1395 extern
1396 void CFShow(CFTypeRef obj);
1397
1398 extern
1399 void CFShowStr(CFStringRef str);
1400
1401
1402 extern
1403 CFStringRef __CFStringMakeConstantString(const char *cStr);
1404
1405
1406 }
1407 extern "C" {
1408
1409
1410 typedef enum {
1411     kCFURLPOSIXPathStyle = 0,
1412     kCFURLHFSPathStyle,
1413     kCFURLWindowsPathStyle
1414 } CFURLPathStyle;
1415
1416 typedef const struct __CFURL * CFURLRef;
1417 extern
1418 CFTypeID CFURLGetTypeID(void);
1419
1420
1421
1422 extern
1423 CFURLRef CFURLCreateWithBytes(CFAllocatorRef allocator, const UInt8 *URLBytes, CFIndex length, CFStringEncoding encoding, CFURLRef baseURL);
1424
1425
1426
1427
1428
1429 extern
1430 CFDataRef CFURLCreateData(CFAllocatorRef allocator, CFURLRef url, CFStringEncoding encoding, Boolean escapeWhitespace);
1431
1432
1433 extern
1434 CFURLRef CFURLCreateWithString(CFAllocatorRef allocator, CFStringRef URLString, CFURLRef baseURL);
1435
1436
1437
1438
1439
1440
1441
1442 extern
1443 CFURLRef CFURLCreateWithFileSystemPath(CFAllocatorRef allocator, CFStringRef filePath, CFURLPathStyle pathStyle, Boolean isDirectory);
1444
1445 extern
1446 CFURLRef CFURLCreateFromFileSystemRepresentation(CFAllocatorRef allocator, const UInt8 *buffer, CFIndex bufLen, Boolean isDirectory);
1447
1448 extern
1449 CFURLRef CFURLCreateWithFileSystemPathRelativeToBase(CFAllocatorRef allocator, CFStringRef filePath, CFURLPathStyle pathStyle, Boolean isDirectory, CFURLRef baseURL);
1450
1451 extern
1452 CFURLRef CFURLCreateFromFileSystemRepresentationRelativeToBase(CFAllocatorRef allocator, const UInt8 *buffer, CFIndex bufLen, Boolean isDirectory, CFURLRef baseURL);
1453 extern
1454 Boolean CFURLGetFileSystemRepresentation(CFURLRef url, Boolean resolveAgainstBase, UInt8 *buffer, CFIndex maxBufLen);
1455
1456
1457 extern
1458 CFURLRef CFURLCopyAbsoluteURL(CFURLRef relativeURL);
1459
1460
1461 extern
1462 CFStringRef CFURLGetString(CFURLRef anURL);
1463
1464
1465 extern
1466 CFURLRef CFURLGetBaseURL(CFURLRef anURL);
1467 extern
1468 Boolean CFURLCanBeDecomposed(CFURLRef anURL);
1469
1470
1471
1472 extern
1473 CFStringRef CFURLCopyScheme(CFURLRef anURL);
1474
1475
1476 extern
1477 CFStringRef CFURLCopyNetLocation(CFURLRef anURL);
1478 extern
1479 CFStringRef CFURLCopyPath(CFURLRef anURL);
1480
1481 extern
1482 CFStringRef CFURLCopyStrictPath(CFURLRef anURL, Boolean *isAbsolute);
1483
1484 extern
1485 CFStringRef CFURLCopyFileSystemPath(CFURLRef anURL, CFURLPathStyle pathStyle);
1486
1487
1488
1489 extern
1490 Boolean CFURLHasDirectoryPath(CFURLRef anURL);
1491
1492
1493
1494 extern
1495 CFStringRef CFURLCopyResourceSpecifier(CFURLRef anURL);
1496
1497 extern
1498 CFStringRef CFURLCopyHostName(CFURLRef anURL);
1499
1500 extern
1501 SInt32 CFURLGetPortNumber(CFURLRef anURL);
1502
1503 extern
1504 CFStringRef CFURLCopyUserName(CFURLRef anURL);
1505
1506 extern
1507 CFStringRef CFURLCopyPassword(CFURLRef anURL);
1508
1509
1510
1511
1512
1513
1514 extern
1515 CFStringRef CFURLCopyParameterString(CFURLRef anURL, CFStringRef charactersToLeaveEscaped);
1516
1517 extern
1518 CFStringRef CFURLCopyQueryString(CFURLRef anURL, CFStringRef charactersToLeaveEscaped);
1519
1520 extern
1521 CFStringRef CFURLCopyFragment(CFURLRef anURL, CFStringRef charactersToLeaveEscaped);
1522
1523 extern
1524 CFStringRef CFURLCopyLastPathComponent(CFURLRef url);
1525
1526 extern
1527 CFStringRef CFURLCopyPathExtension(CFURLRef url);
1528
1529
1530
1531
1532
1533 extern
1534 CFURLRef CFURLCreateCopyAppendingPathComponent(CFAllocatorRef allocator, CFURLRef url, CFStringRef pathComponent, Boolean isDirectory);
1535
1536 extern
1537 CFURLRef CFURLCreateCopyDeletingLastPathComponent(CFAllocatorRef allocator, CFURLRef url);
1538
1539 extern
1540 CFURLRef CFURLCreateCopyAppendingPathExtension(CFAllocatorRef allocator, CFURLRef url, CFStringRef extension);
1541
1542 extern
1543 CFURLRef CFURLCreateCopyDeletingPathExtension(CFAllocatorRef allocator, CFURLRef url);
1544 extern
1545 CFStringRef CFURLCreateStringByReplacingPercentEscapes(CFAllocatorRef allocator, CFStringRef originalString, CFStringRef charactersToLeaveEscaped);
1546 extern
1547 CFStringRef CFURLCreateStringByAddingPercentEscapes(CFAllocatorRef allocator, CFStringRef originalString, CFStringRef charactersToLeaveUnescaped, CFStringRef legalURLCharactersToBeEscaped, CFStringEncoding encoding);
1548
1549
1550
1551 struct FSRef;
1552
1553 extern
1554 CFURLRef CFURLCreateFromFSRef(CFAllocatorRef allocator, const struct FSRef *fsRef);
1555
1556 extern
1557 Boolean CFURLGetFSRef(CFURLRef url, struct FSRef *fsRef);
1558
1559
1560
1561 }
1562 typedef int boolean_t;
1563 typedef unsigned int natural_t;
1564 typedef int integer_t;
1565
1566
1567
1568
1569
1570 typedef natural_t vm_offset_t;
1571
1572
1573
1574
1575
1576
1577 typedef natural_t vm_size_t;
1578
1579
1580
1581
1582 typedef unsigned int space_t;
1583 typedef natural_t port_name_t;
1584 typedef port_name_t *port_name_array_t;
1585
1586
1587 typedef port_name_t port_t;
1588 typedef port_t mach_port_t;
1589 typedef port_t *mach_port_array_t;
1590 typedef port_name_t mach_port_name_t;
1591 typedef mach_port_name_t *mach_port_name_array_t;
1592 typedef natural_t mach_port_right_t;
1593 typedef natural_t mach_port_type_t;
1594 typedef mach_port_type_t *mach_port_type_array_t;
1595 typedef natural_t mach_port_urefs_t;
1596 typedef integer_t mach_port_delta_t;
1597
1598
1599
1600 typedef natural_t mach_port_seqno_t;
1601 typedef natural_t mach_port_mscount_t;
1602 typedef natural_t mach_port_msgcount_t;
1603 typedef natural_t mach_port_rights_t;
1604
1605
1606
1607
1608
1609
1610 typedef unsigned int mach_port_srights_t;
1611
1612 typedef struct mach_port_status {
1613         mach_port_name_t mps_pset;
1614         mach_port_seqno_t mps_seqno;
1615         mach_port_mscount_t mps_mscount;
1616         mach_port_msgcount_t mps_qlimit;
1617         mach_port_msgcount_t mps_msgcount;
1618         mach_port_rights_t mps_sorights;
1619         boolean_t mps_srights;
1620         boolean_t mps_pdrequest;
1621         boolean_t mps_nsrequest;
1622         unsigned int mps_flags;
1623 } mach_port_status_t;
1624
1625
1626
1627
1628 typedef struct mach_port_limits {
1629         mach_port_msgcount_t mpl_qlimit;
1630 } mach_port_limits_t;
1631
1632 typedef integer_t *mach_port_info_t;
1633
1634
1635 typedef int mach_port_flavor_t;
1636 typedef struct mach_port_qos {
1637         boolean_t name:1;
1638         boolean_t prealloc:1;
1639         boolean_t pad1:30;
1640         natural_t len;
1641 } mach_port_qos_t;
1642
1643
1644
1645 extern "C" {
1646
1647
1648
1649
1650
1651
1652 typedef struct __CFRunLoop * CFRunLoopRef;
1653
1654
1655
1656
1657
1658 typedef struct __CFRunLoopSource * CFRunLoopSourceRef;
1659
1660
1661
1662
1663
1664 typedef struct __CFRunLoopObserver * CFRunLoopObserverRef;
1665
1666
1667
1668
1669
1670 typedef struct __CFRunLoopTimer * CFRunLoopTimerRef;
1671
1672
1673 enum {
1674     kCFRunLoopRunFinished = 1,
1675     kCFRunLoopRunStopped = 2,
1676     kCFRunLoopRunTimedOut = 3,
1677     kCFRunLoopRunHandledSource = 4
1678 };
1679
1680
1681 typedef enum {
1682     kCFRunLoopEntry = (1 << 0),
1683     kCFRunLoopBeforeTimers = (1 << 1),
1684     kCFRunLoopBeforeSources = (1 << 2),
1685     kCFRunLoopBeforeWaiting = (1 << 5),
1686     kCFRunLoopAfterWaiting = (1 << 6),
1687     kCFRunLoopExit = (1 << 7),
1688     kCFRunLoopAllActivities = 0x0FFFFFFFU
1689 } CFRunLoopActivity;
1690
1691 extern const CFStringRef kCFRunLoopDefaultMode;
1692 extern const CFStringRef kCFRunLoopCommonModes;
1693
1694
1695
1696
1697
1698 extern CFTypeID CFRunLoopGetTypeID(void);
1699
1700
1701
1702
1703
1704
1705 extern CFRunLoopRef CFRunLoopGetCurrent(void);
1706 extern CFStringRef CFRunLoopCopyCurrentMode(CFRunLoopRef rl);
1707
1708
1709
1710
1711
1712
1713
1714 extern CFArrayRef CFRunLoopCopyAllModes(CFRunLoopRef rl);
1715 extern void CFRunLoopAddCommonMode(CFRunLoopRef rl, CFStringRef mode);
1716 extern CFAbsoluteTime CFRunLoopGetNextTimerFireDate(CFRunLoopRef rl, CFStringRef mode);
1717
1718
1719
1720
1721
1722 extern void CFRunLoopRun(void);
1723 extern SInt32 CFRunLoopRunInMode(CFStringRef mode, CFTimeInterval seconds, Boolean returnAfterSourceHandled);
1724 extern Boolean CFRunLoopIsWaiting(CFRunLoopRef rl);
1725 extern void CFRunLoopWakeUp(CFRunLoopRef rl);
1726 extern void CFRunLoopStop(CFRunLoopRef rl);
1727
1728 extern Boolean CFRunLoopContainsSource(CFRunLoopRef rl, CFRunLoopSourceRef source, CFStringRef mode);
1729 extern void CFRunLoopAddSource(CFRunLoopRef rl, CFRunLoopSourceRef source, CFStringRef mode);
1730 extern void CFRunLoopRemoveSource(CFRunLoopRef rl, CFRunLoopSourceRef source, CFStringRef mode);
1731
1732 extern Boolean CFRunLoopContainsObserver(CFRunLoopRef rl, CFRunLoopObserverRef observer, CFStringRef mode);
1733 extern void CFRunLoopAddObserver(CFRunLoopRef rl, CFRunLoopObserverRef observer, CFStringRef mode);
1734 extern void CFRunLoopRemoveObserver(CFRunLoopRef rl, CFRunLoopObserverRef observer, CFStringRef mode);
1735
1736 extern Boolean CFRunLoopContainsTimer(CFRunLoopRef rl, CFRunLoopTimerRef timer, CFStringRef mode);
1737 extern void CFRunLoopAddTimer(CFRunLoopRef rl, CFRunLoopTimerRef timer, CFStringRef mode);
1738 extern void CFRunLoopRemoveTimer(CFRunLoopRef rl, CFRunLoopTimerRef timer, CFStringRef mode);
1739 typedef struct {
1740     CFIndex version;
1741     void * info;
1742     const void *(*retain)(const void *info);
1743     void (*release)(const void *info);
1744     CFStringRef (*copyDescription)(const void *info);
1745     Boolean (*equal)(const void *info1, const void *info2);
1746     CFHashCode (*hash)(const void *info);
1747     void (*schedule)(void *info, CFRunLoopRef rl, CFStringRef mode);
1748     void (*cancel)(void *info, CFRunLoopRef rl, CFStringRef mode);
1749     void (*perform)(void *info);
1750 } CFRunLoopSourceContext;
1751
1752
1753 typedef struct {
1754     CFIndex version;
1755     void * info;
1756     const void *(*retain)(const void *info);
1757     void (*release)(const void *info);
1758     CFStringRef (*copyDescription)(const void *info);
1759     Boolean (*equal)(const void *info1, const void *info2);
1760     CFHashCode (*hash)(const void *info);
1761     mach_port_t (*getPort)(void *info);
1762     void * (*perform)(void *msg, CFIndex size, CFAllocatorRef allocator, void *info);
1763 } CFRunLoopSourceContext1;
1764
1765
1766
1767
1768
1769
1770 extern CFTypeID CFRunLoopSourceGetTypeID(void);
1771 extern CFRunLoopSourceRef CFRunLoopSourceCreate(CFAllocatorRef allocator, CFIndex order, CFRunLoopSourceContext *context);
1772
1773
1774
1775
1776
1777
1778
1779 extern CFIndex CFRunLoopSourceGetOrder(CFRunLoopSourceRef source);
1780 extern void CFRunLoopSourceInvalidate(CFRunLoopSourceRef source);
1781
1782
1783
1784
1785
1786
1787
1788 extern Boolean CFRunLoopSourceIsValid(CFRunLoopSourceRef source);
1789 extern void CFRunLoopSourceGetContext(CFRunLoopSourceRef source, CFRunLoopSourceContext *context);
1790 extern void CFRunLoopSourceSignal(CFRunLoopSourceRef source);
1791
1792 typedef struct {
1793     CFIndex version;
1794     void * info;
1795     const void *(*retain)(const void *info);
1796     void (*release)(const void *info);
1797     CFStringRef (*copyDescription)(const void *info);
1798 } CFRunLoopObserverContext;
1799
1800 typedef void (*CFRunLoopObserverCallBack)(CFRunLoopObserverRef observer, CFRunLoopActivity activity, void *info);
1801
1802
1803
1804
1805
1806 extern CFTypeID CFRunLoopObserverGetTypeID(void);
1807
1808 extern CFRunLoopObserverRef CFRunLoopObserverCreate(CFAllocatorRef allocator, CFOptionFlags activities, Boolean repeats, CFIndex order, CFRunLoopObserverCallBack callout, CFRunLoopObserverContext *context);
1809
1810 extern CFOptionFlags CFRunLoopObserverGetActivities(CFRunLoopObserverRef observer);
1811 extern Boolean CFRunLoopObserverDoesRepeat(CFRunLoopObserverRef observer);
1812 extern CFIndex CFRunLoopObserverGetOrder(CFRunLoopObserverRef observer);
1813 extern void CFRunLoopObserverInvalidate(CFRunLoopObserverRef observer);
1814 extern Boolean CFRunLoopObserverIsValid(CFRunLoopObserverRef observer);
1815 extern void CFRunLoopObserverGetContext(CFRunLoopObserverRef observer, CFRunLoopObserverContext *context);
1816
1817 typedef struct {
1818     CFIndex version;
1819     void * info;
1820     const void *(*retain)(const void *info);
1821     void (*release)(const void *info);
1822     CFStringRef (*copyDescription)(const void *info);
1823 } CFRunLoopTimerContext;
1824
1825 typedef void (*CFRunLoopTimerCallBack)(CFRunLoopTimerRef timer, void *info);
1826
1827
1828
1829
1830
1831 extern CFTypeID CFRunLoopTimerGetTypeID(void);
1832
1833 extern CFRunLoopTimerRef CFRunLoopTimerCreate(CFAllocatorRef allocator, CFAbsoluteTime fireDate, CFTimeInterval interval, CFOptionFlags flags, CFIndex order, CFRunLoopTimerCallBack callout, CFRunLoopTimerContext *context);
1834 extern CFAbsoluteTime CFRunLoopTimerGetNextFireDate(CFRunLoopTimerRef timer);
1835 extern void CFRunLoopTimerSetNextFireDate(CFRunLoopTimerRef timer, CFAbsoluteTime fireDate);
1836 extern CFTimeInterval CFRunLoopTimerGetInterval(CFRunLoopTimerRef timer);
1837 extern Boolean CFRunLoopTimerDoesRepeat(CFRunLoopTimerRef timer);
1838 extern CFIndex CFRunLoopTimerGetOrder(CFRunLoopTimerRef timer);
1839 extern void CFRunLoopTimerInvalidate(CFRunLoopTimerRef timer);
1840 extern Boolean CFRunLoopTimerIsValid(CFRunLoopTimerRef timer);
1841 extern void CFRunLoopTimerGetContext(CFRunLoopTimerRef timer, CFRunLoopTimerContext *context);
1842
1843
1844 }
1845 extern "C" {
1846
1847
1848
1849
1850
1851
1852 typedef int CFSocketNativeHandle;
1853
1854 typedef struct __CFSocket * CFSocketRef;
1855 typedef enum {
1856     kCFSocketSuccess = 0,
1857     kCFSocketError = -1,
1858     kCFSocketTimeout = -2
1859 } CFSocketError;
1860
1861 typedef struct {
1862     SInt32 protocolFamily;
1863     SInt32 socketType;
1864     SInt32 protocol;
1865     CFDataRef address;
1866 } CFSocketSignature;
1867
1868 typedef enum {
1869     kCFSocketNoCallBack = 0,
1870     kCFSocketReadCallBack = 1,
1871     kCFSocketAcceptCallBack = 2,
1872     kCFSocketDataCallBack = 3,
1873     kCFSocketConnectCallBack = 4
1874
1875     ,
1876     kCFSocketWriteCallBack = 8
1877
1878 } CFSocketCallBackType;
1879
1880
1881
1882 enum {
1883     kCFSocketAutomaticallyReenableReadCallBack = 1,
1884     kCFSocketAutomaticallyReenableAcceptCallBack = 2,
1885     kCFSocketAutomaticallyReenableDataCallBack = 3,
1886     kCFSocketAutomaticallyReenableWriteCallBack = 8,
1887     kCFSocketCloseOnInvalidate = 128
1888 };
1889
1890
1891 typedef void (*CFSocketCallBack)(CFSocketRef s, CFSocketCallBackType type, CFDataRef address, const void *data, void *info);
1892
1893
1894 typedef struct {
1895     CFIndex version;
1896     void * info;
1897     const void *(*retain)(const void *info);
1898     void (*release)(const void *info);
1899     CFStringRef (*copyDescription)(const void *info);
1900 } CFSocketContext;
1901
1902 extern CFTypeID CFSocketGetTypeID(void);
1903
1904 extern CFSocketRef CFSocketCreate(CFAllocatorRef allocator, SInt32 protocolFamily, SInt32 socketType, SInt32 protocol, CFOptionFlags callBackTypes, CFSocketCallBack callout, const CFSocketContext *context);
1905 extern CFSocketRef CFSocketCreateWithNative(CFAllocatorRef allocator, CFSocketNativeHandle sock, CFOptionFlags callBackTypes, CFSocketCallBack callout, const CFSocketContext *context);
1906 extern CFSocketRef CFSocketCreateWithSocketSignature(CFAllocatorRef allocator, const CFSocketSignature *signature, CFOptionFlags callBackTypes, CFSocketCallBack callout, const CFSocketContext *context);
1907 extern CFSocketRef CFSocketCreateConnectedToSocketSignature(CFAllocatorRef allocator, const CFSocketSignature *signature, CFOptionFlags callBackTypes, CFSocketCallBack callout, const CFSocketContext *context, CFTimeInterval timeout);
1908
1909
1910 extern CFSocketError CFSocketSetAddress(CFSocketRef s, CFDataRef address);
1911 extern CFSocketError CFSocketConnectToAddress(CFSocketRef s, CFDataRef address, CFTimeInterval timeout);
1912 extern void CFSocketInvalidate(CFSocketRef s);
1913
1914 extern Boolean CFSocketIsValid(CFSocketRef s);
1915 extern CFDataRef CFSocketCopyAddress(CFSocketRef s);
1916 extern CFDataRef CFSocketCopyPeerAddress(CFSocketRef s);
1917 extern void CFSocketGetContext(CFSocketRef s, CFSocketContext *context);
1918 extern CFSocketNativeHandle CFSocketGetNative(CFSocketRef s);
1919
1920 extern CFRunLoopSourceRef CFSocketCreateRunLoopSource(CFAllocatorRef allocator, CFSocketRef s, CFIndex order);
1921
1922
1923 extern CFOptionFlags CFSocketGetSocketFlags(CFSocketRef s);
1924 extern void CFSocketSetSocketFlags(CFSocketRef s, CFOptionFlags flags);
1925 extern void CFSocketDisableCallBacks(CFSocketRef s, CFOptionFlags callBackTypes);
1926 extern void CFSocketEnableCallBacks(CFSocketRef s, CFOptionFlags callBackTypes);
1927
1928
1929
1930 extern CFSocketError CFSocketSendData(CFSocketRef s, CFDataRef address, CFDataRef data, CFTimeInterval timeout);
1931 extern CFSocketError CFSocketRegisterValue(const CFSocketSignature *nameServerSignature, CFTimeInterval timeout, CFStringRef name, CFPropertyListRef value);
1932 extern CFSocketError CFSocketCopyRegisteredValue(const CFSocketSignature *nameServerSignature, CFTimeInterval timeout, CFStringRef name, CFPropertyListRef *value, CFDataRef *nameServerAddress);
1933
1934 extern CFSocketError CFSocketRegisterSocketSignature(const CFSocketSignature *nameServerSignature, CFTimeInterval timeout, CFStringRef name, const CFSocketSignature *signature);
1935 extern CFSocketError CFSocketCopyRegisteredSocketSignature(const CFSocketSignature *nameServerSignature, CFTimeInterval timeout, CFStringRef name, CFSocketSignature *signature, CFDataRef *nameServerAddress);
1936
1937 extern CFSocketError CFSocketUnregister(const CFSocketSignature *nameServerSignature, CFTimeInterval timeout, CFStringRef name);
1938
1939 extern void CFSocketSetDefaultNameRegistryPortNumber(UInt16 port);
1940 extern UInt16 CFSocketGetDefaultNameRegistryPortNumber(void);
1941
1942
1943 extern const CFStringRef kCFSocketCommandKey;
1944 extern const CFStringRef kCFSocketNameKey;
1945 extern const CFStringRef kCFSocketValueKey;
1946 extern const CFStringRef kCFSocketResultKey;
1947 extern const CFStringRef kCFSocketErrorKey;
1948 extern const CFStringRef kCFSocketRegisterCommand;
1949 extern const CFStringRef kCFSocketRetrieveCommand;
1950
1951
1952 }
1953
1954
1955 extern "C" {
1956
1957
1958 typedef enum {
1959     kCFStreamStatusNotOpen = 0,
1960     kCFStreamStatusOpening,
1961     kCFStreamStatusOpen,
1962     kCFStreamStatusReading,
1963     kCFStreamStatusWriting,
1964     kCFStreamStatusAtEnd,
1965     kCFStreamStatusClosed,
1966     kCFStreamStatusError
1967 } CFStreamStatus;
1968
1969 typedef enum {
1970     kCFStreamErrorDomainCustom = -1,
1971     kCFStreamErrorDomainPOSIX = 1,
1972     kCFStreamErrorDomainMacOSStatus
1973 } CFStreamErrorDomain;
1974
1975 typedef struct {
1976     CFStreamErrorDomain domain;
1977     SInt32 error;
1978 } CFStreamError;
1979
1980 typedef enum {
1981     kCFStreamEventNone = 0,
1982     kCFStreamEventOpenCompleted = 1,
1983     kCFStreamEventHasBytesAvailable = 2,
1984     kCFStreamEventCanAcceptBytes = 4,
1985     kCFStreamEventErrorOccurred = 8,
1986     kCFStreamEventEndEncountered = 16
1987 } CFStreamEventType;
1988
1989 typedef struct {
1990     CFIndex version;
1991     void *info;
1992     void *(*retain)(void *info);
1993     void (*release)(void *info);
1994     CFStringRef (*copyDescription)(void *info);
1995 } CFStreamClientContext;
1996
1997 typedef struct __CFReadStream * CFReadStreamRef;
1998 typedef struct __CFWriteStream * CFWriteStreamRef;
1999
2000 typedef void (*CFReadStreamClientCallBack)(CFReadStreamRef stream, CFStreamEventType type, void *clientCallBackInfo);
2001 typedef void (*CFWriteStreamClientCallBack)(CFWriteStreamRef stream, CFStreamEventType type, void *clientCallBackInfo);
2002
2003 extern
2004 CFTypeID CFReadStreamGetTypeID(void);
2005 extern
2006 CFTypeID CFWriteStreamGetTypeID(void);
2007
2008
2009
2010
2011 extern
2012 const CFStringRef kCFStreamPropertyDataWritten;
2013
2014
2015 extern
2016 CFReadStreamRef CFReadStreamCreateWithBytesNoCopy(CFAllocatorRef alloc, const UInt8 *bytes, CFIndex length, CFAllocatorRef bytesDeallocator);
2017
2018
2019 extern
2020 CFWriteStreamRef CFWriteStreamCreateWithBuffer(CFAllocatorRef alloc, UInt8 *buffer, CFIndex bufferCapacity);
2021
2022
2023 extern
2024 CFWriteStreamRef CFWriteStreamCreateWithAllocatedBuffers(CFAllocatorRef alloc, CFAllocatorRef bufferAllocator);
2025
2026
2027 extern
2028 CFReadStreamRef CFReadStreamCreateWithFile(CFAllocatorRef alloc, CFURLRef fileURL);
2029 extern
2030 CFWriteStreamRef CFWriteStreamCreateWithFile(CFAllocatorRef alloc, CFURLRef fileURL);
2031
2032
2033
2034 extern
2035 const CFStringRef kCFStreamPropertyAppendToFile;
2036
2037
2038
2039
2040
2041 extern
2042 const CFStringRef kCFStreamPropertySocketNativeHandle;
2043
2044
2045 extern
2046 const CFStringRef kCFStreamPropertySocketRemoteHostName;
2047
2048
2049 extern
2050 const CFStringRef kCFStreamPropertySocketRemotePortNumber;
2051
2052
2053 extern
2054 void CFStreamCreatePairWithSocket(CFAllocatorRef alloc, CFSocketNativeHandle sock, CFReadStreamRef *readStream, CFWriteStreamRef *writeStream);
2055 extern
2056 void CFStreamCreatePairWithSocketToHost(CFAllocatorRef alloc, CFStringRef host, UInt32 port, CFReadStreamRef *readStream, CFWriteStreamRef *writeStream);
2057
2058 extern
2059 void CFStreamCreatePairWithPeerSocketSignature(CFAllocatorRef alloc, const CFSocketSignature *signature, CFReadStreamRef *readStream, CFWriteStreamRef *writeStream);
2060
2061
2062
2063
2064 extern
2065 CFStreamStatus CFReadStreamGetStatus(CFReadStreamRef stream);
2066 extern
2067 CFStreamStatus CFWriteStreamGetStatus(CFWriteStreamRef stream);
2068
2069
2070
2071
2072 extern
2073 CFStreamError CFReadStreamGetError(CFReadStreamRef stream);
2074 extern
2075 CFStreamError CFWriteStreamGetError(CFWriteStreamRef stream);
2076
2077
2078
2079
2080
2081
2082 extern
2083 Boolean CFReadStreamOpen(CFReadStreamRef stream);
2084 extern
2085 Boolean CFWriteStreamOpen(CFWriteStreamRef stream);
2086
2087
2088
2089
2090 extern
2091 void CFReadStreamClose(CFReadStreamRef stream);
2092 extern
2093 void CFWriteStreamClose(CFWriteStreamRef stream);
2094
2095
2096
2097 extern
2098 Boolean CFReadStreamHasBytesAvailable(CFReadStreamRef stream);
2099 extern
2100 CFIndex CFReadStreamRead(CFReadStreamRef stream, UInt8 *buffer, CFIndex bufferLength);
2101 extern
2102 const UInt8 *CFReadStreamGetBuffer(CFReadStreamRef stream, CFIndex maxBytesToRead, CFIndex *numBytesRead);
2103
2104
2105
2106 extern
2107 Boolean CFWriteStreamCanAcceptBytes(CFWriteStreamRef stream);
2108
2109
2110
2111
2112
2113
2114 extern
2115 CFIndex CFWriteStreamWrite(CFWriteStreamRef stream, const UInt8 *buffer, CFIndex bufferLength);
2116 extern
2117 CFTypeRef CFReadStreamCopyProperty(CFReadStreamRef stream, CFStringRef propertyName);
2118 extern
2119 CFTypeRef CFWriteStreamCopyProperty(CFWriteStreamRef stream, CFStringRef propertyName);
2120
2121
2122
2123
2124 extern
2125 Boolean CFReadStreamSetProperty(CFReadStreamRef stream, CFStringRef propertyName, CFTypeRef propertyValue);
2126 extern
2127 Boolean CFWriteStreamSetProperty(CFWriteStreamRef stream, CFStringRef propertyName, CFTypeRef propertyValue);
2128 extern
2129 Boolean CFReadStreamSetClient(CFReadStreamRef stream, CFOptionFlags streamEvents, CFReadStreamClientCallBack clientCB, CFStreamClientContext *clientContext);
2130 extern
2131 Boolean CFWriteStreamSetClient(CFWriteStreamRef stream, CFOptionFlags streamEvents, CFWriteStreamClientCallBack clientCB, CFStreamClientContext *clientContext);
2132
2133 extern
2134 void CFReadStreamScheduleWithRunLoop(CFReadStreamRef stream, CFRunLoopRef runLoop, CFStringRef runLoopMode);
2135 extern
2136 void CFWriteStreamScheduleWithRunLoop(CFWriteStreamRef stream, CFRunLoopRef runLoop, CFStringRef runLoopMode);
2137
2138 extern
2139 void CFReadStreamUnscheduleFromRunLoop(CFReadStreamRef stream, CFRunLoopRef runLoop, CFStringRef runLoopMode);
2140 extern
2141 void CFWriteStreamUnscheduleFromRunLoop(CFWriteStreamRef stream, CFRunLoopRef runLoop, CFStringRef runLoopMode);
2142
2143
2144 }
2145
2146
2147 extern "C" {
2148
2149
2150 typedef enum {
2151     kCFPropertyListImmutable = 0,
2152     kCFPropertyListMutableContainers,
2153     kCFPropertyListMutableContainersAndLeaves
2154 } CFPropertyListMutabilityOptions;
2155 extern
2156 CFPropertyListRef CFPropertyListCreateFromXMLData(CFAllocatorRef allocator, CFDataRef xmlData, CFOptionFlags mutabilityOption, CFStringRef *errorString);
2157 extern
2158 CFDataRef CFPropertyListCreateXMLData(CFAllocatorRef allocator, CFPropertyListRef propertyList);
2159
2160
2161
2162
2163
2164
2165
2166 extern
2167 CFPropertyListRef CFPropertyListCreateDeepCopy(CFAllocatorRef allocator, CFPropertyListRef propertyList, CFOptionFlags mutabilityOption);
2168
2169
2170
2171 typedef enum {
2172     kCFPropertyListOpenStepFormat = 1,
2173     kCFPropertyListXMLFormat_v1_0 = 100,
2174     kCFPropertyListBinaryFormat_v1_0 = 200
2175 } CFPropertyListFormat;
2176
2177 extern
2178 Boolean CFPropertyListIsValid(CFPropertyListRef plist, CFPropertyListFormat format);
2179
2180
2181
2182
2183
2184
2185
2186 extern
2187 CFIndex CFPropertyListWriteToStream(CFPropertyListRef propertyList, CFWriteStreamRef stream, CFPropertyListFormat format, CFStringRef *errorString);
2188 extern
2189 CFPropertyListRef CFPropertyListCreateFromStream(CFAllocatorRef allocator, CFReadStreamRef stream, CFIndex streamLength, CFOptionFlags mutabilityOption, CFPropertyListFormat *format, CFStringRef *errorString);
2190 }
2191 extern "C" {
2192 typedef const void * (*CFSetRetainCallBack)(CFAllocatorRef allocator, const void *value);
2193
2194
2195
2196
2197
2198
2199
2200 typedef void (*CFSetReleaseCallBack)(CFAllocatorRef allocator, const void *value);
2201
2202
2203
2204
2205
2206
2207
2208 typedef CFStringRef (*CFSetCopyDescriptionCallBack)(const void *value);
2209 typedef Boolean (*CFSetEqualCallBack)(const void *value1, const void *value2);
2210
2211
2212
2213
2214
2215
2216
2217 typedef CFHashCode (*CFSetHashCallBack)(const void *value);
2218 typedef struct {
2219     CFIndex version;
2220     CFSetRetainCallBack retain;
2221     CFSetReleaseCallBack release;
2222     CFSetCopyDescriptionCallBack copyDescription;
2223     CFSetEqualCallBack equal;
2224     CFSetHashCallBack hash;
2225 } CFSetCallBacks;
2226
2227
2228
2229
2230
2231
2232 extern
2233 const CFSetCallBacks kCFTypeSetCallBacks;
2234
2235
2236
2237
2238
2239
2240
2241 extern
2242 const CFSetCallBacks kCFCopyStringSetCallBacks;
2243 typedef void (*CFSetApplierFunction)(const void *value, void *context);
2244
2245
2246
2247
2248
2249 typedef const struct __CFSet * CFSetRef;
2250
2251
2252
2253
2254
2255 typedef struct __CFSet * CFMutableSetRef;
2256
2257
2258
2259
2260
2261 extern
2262 CFTypeID CFSetGetTypeID(void);
2263 extern
2264 CFSetRef CFSetCreate(CFAllocatorRef allocator, const void **values, CFIndex numValues, const CFSetCallBacks *callBacks);
2265 extern
2266 CFSetRef CFSetCreateCopy(CFAllocatorRef allocator, CFSetRef theSet);
2267 extern
2268 CFMutableSetRef CFSetCreateMutable(CFAllocatorRef allocator, CFIndex capacity, const CFSetCallBacks *callBacks);
2269 extern
2270 CFMutableSetRef CFSetCreateMutableCopy(CFAllocatorRef allocator, CFIndex capacity, CFSetRef theSet);
2271 extern
2272 CFIndex CFSetGetCount(CFSetRef theSet);
2273 extern
2274 CFIndex CFSetGetCountOfValue(CFSetRef theSet, const void *value);
2275 extern
2276 Boolean CFSetContainsValue(CFSetRef theSet, const void *value);
2277 extern
2278 const void *CFSetGetValue(CFSetRef theSet, const void *value);
2279 extern
2280 Boolean CFSetGetValueIfPresent(CFSetRef theSet, const void *candidate, const void **value);
2281 extern
2282 void CFSetGetValues(CFSetRef theSet, const void **values);
2283 extern
2284 void CFSetApplyFunction(CFSetRef theSet, CFSetApplierFunction applier, void *context);
2285 extern
2286 void CFSetAddValue(CFMutableSetRef theSet, const void *value);
2287 extern
2288 void CFSetReplaceValue(CFMutableSetRef theSet, const void *value);
2289 extern
2290 void CFSetSetValue(CFMutableSetRef theSet, const void *value);
2291 extern
2292 void CFSetRemoveValue(CFMutableSetRef theSet, const void *value);
2293 extern
2294 void CFSetRemoveAllValues(CFMutableSetRef theSet);
2295
2296
2297 }
2298
2299 extern "C" {
2300
2301
2302 extern
2303 CFTypeID CFTimeZoneGetTypeID(void);
2304
2305 extern
2306 CFTimeZoneRef CFTimeZoneCopySystem(void);
2307
2308 extern
2309 void CFTimeZoneResetSystem(void);
2310
2311 extern
2312 CFTimeZoneRef CFTimeZoneCopyDefault(void);
2313
2314 extern
2315 void CFTimeZoneSetDefault(CFTimeZoneRef tz);
2316
2317 extern
2318 CFArrayRef CFTimeZoneCopyKnownNames(void);
2319
2320 extern
2321 CFDictionaryRef CFTimeZoneCopyAbbreviationDictionary(void);
2322
2323 extern
2324 void CFTimeZoneSetAbbreviationDictionary(CFDictionaryRef dict);
2325
2326 extern
2327 CFTimeZoneRef CFTimeZoneCreate(CFAllocatorRef allocator, CFStringRef name, CFDataRef data);
2328
2329 extern
2330 CFTimeZoneRef CFTimeZoneCreateWithTimeIntervalFromGMT(CFAllocatorRef allocator, CFTimeInterval ti);
2331
2332 extern
2333 CFTimeZoneRef CFTimeZoneCreateWithName(CFAllocatorRef allocator, CFStringRef name, Boolean tryAbbrev);
2334
2335 extern
2336 CFStringRef CFTimeZoneGetName(CFTimeZoneRef tz);
2337
2338 extern
2339 CFDataRef CFTimeZoneGetData(CFTimeZoneRef tz);
2340
2341 extern
2342 CFTimeInterval CFTimeZoneGetSecondsFromGMT(CFTimeZoneRef tz, CFAbsoluteTime at);
2343
2344 extern
2345 CFStringRef CFTimeZoneCopyAbbreviation(CFTimeZoneRef tz, CFAbsoluteTime at);
2346
2347 extern
2348 Boolean CFTimeZoneIsDaylightSavingTime(CFTimeZoneRef tz, CFAbsoluteTime at);
2349
2350
2351 }
2352 extern "C" {
2353 typedef const void * (*CFTreeRetainCallBack)(const void *info);
2354
2355
2356
2357
2358
2359
2360
2361 typedef void (*CFTreeReleaseCallBack)(const void *info);
2362 typedef CFStringRef (*CFTreeCopyDescriptionCallBack)(const void *info);
2363 typedef struct {
2364     CFIndex version;
2365     void * info;
2366     CFTreeRetainCallBack retain;
2367     CFTreeReleaseCallBack release;
2368     CFTreeCopyDescriptionCallBack copyDescription;
2369 } CFTreeContext;
2370 typedef void (*CFTreeApplierFunction)(const void *value, void *context);
2371
2372
2373
2374
2375
2376 typedef struct __CFTree * CFTreeRef;
2377
2378
2379
2380
2381
2382 extern
2383 CFTypeID CFTreeGetTypeID(void);
2384 extern
2385 CFTreeRef CFTreeCreate(CFAllocatorRef allocator, const CFTreeContext *context);
2386 extern
2387 CFTreeRef CFTreeGetParent(CFTreeRef tree);
2388 extern
2389 CFTreeRef CFTreeGetNextSibling(CFTreeRef tree);
2390 extern
2391 CFTreeRef CFTreeGetFirstChild(CFTreeRef tree);
2392 extern
2393 void CFTreeGetContext(CFTreeRef tree, CFTreeContext *context);
2394 extern
2395 CFIndex CFTreeGetChildCount(CFTreeRef tree);
2396 extern
2397 CFTreeRef CFTreeGetChildAtIndex(CFTreeRef tree, CFIndex idx);
2398 extern
2399 void CFTreeGetChildren(CFTreeRef tree, CFTreeRef *children);
2400 extern
2401 void CFTreeApplyFunctionToChildren(CFTreeRef tree, CFTreeApplierFunction applier, void *context);
2402 extern
2403 CFTreeRef CFTreeFindRoot(CFTreeRef tree);
2404 extern
2405 void CFTreeSetContext(CFTreeRef tree, const CFTreeContext *context);
2406 extern
2407 void CFTreePrependChild(CFTreeRef tree, CFTreeRef newChild);
2408 extern
2409 void CFTreeAppendChild(CFTreeRef tree, CFTreeRef newChild);
2410 extern
2411 void CFTreeInsertSibling(CFTreeRef tree, CFTreeRef newSibling);
2412
2413
2414
2415
2416
2417
2418
2419 extern
2420 void CFTreeRemove(CFTreeRef tree);
2421
2422
2423
2424
2425
2426
2427
2428 extern
2429 void CFTreeRemoveAllChildren(CFTreeRef tree);
2430 extern
2431 void CFTreeSortChildren(CFTreeRef tree, CFComparatorFunction comparator, void *context);
2432
2433
2434 }
2435
2436 extern "C" {
2437
2438
2439 enum {
2440         kCFXMLNodeCurrentVersion = 1
2441 };
2442
2443 typedef const struct __CFXMLNode * CFXMLNodeRef;
2444 typedef CFTreeRef CFXMLTreeRef;
2445 typedef enum {
2446     kCFXMLNodeTypeDocument = 1,
2447     kCFXMLNodeTypeElement = 2,
2448     kCFXMLNodeTypeAttribute = 3,
2449     kCFXMLNodeTypeProcessingInstruction = 4,
2450     kCFXMLNodeTypeComment = 5,
2451     kCFXMLNodeTypeText = 6,
2452     kCFXMLNodeTypeCDATASection = 7,
2453     kCFXMLNodeTypeDocumentFragment = 8,
2454     kCFXMLNodeTypeEntity = 9,
2455     kCFXMLNodeTypeEntityReference = 10,
2456     kCFXMLNodeTypeDocumentType = 11,
2457     kCFXMLNodeTypeWhitespace = 12,
2458     kCFXMLNodeTypeNotation = 13,
2459     kCFXMLNodeTypeElementTypeDeclaration = 14,
2460     kCFXMLNodeTypeAttributeListDeclaration = 15
2461 } CFXMLNodeTypeCode;
2462
2463 typedef struct {
2464     CFDictionaryRef attributes;
2465     CFArrayRef attributeOrder;
2466     Boolean isEmpty;
2467     char _reserved[3];
2468 } CFXMLElementInfo;
2469
2470 typedef struct {
2471     CFStringRef dataString;
2472 } CFXMLProcessingInstructionInfo;
2473
2474 typedef struct {
2475     CFURLRef sourceURL;
2476     CFStringEncoding encoding;
2477 } CFXMLDocumentInfo;
2478
2479 typedef struct {
2480     CFURLRef systemID;
2481     CFStringRef publicID;
2482 } CFXMLExternalID;
2483
2484 typedef struct {
2485     CFXMLExternalID externalID;
2486 } CFXMLDocumentTypeInfo;
2487
2488 typedef struct {
2489     CFXMLExternalID externalID;
2490 } CFXMLNotationInfo;
2491
2492 typedef struct {
2493
2494     CFStringRef contentDescription;
2495 } CFXMLElementTypeDeclarationInfo;
2496
2497 typedef struct {
2498
2499     CFStringRef attributeName;
2500     CFStringRef typeString;
2501     CFStringRef defaultString;
2502 } CFXMLAttributeDeclarationInfo;
2503
2504 typedef struct {
2505     CFIndex numberOfAttributes;
2506     CFXMLAttributeDeclarationInfo *attributes;
2507 } CFXMLAttributeListDeclarationInfo;
2508
2509 typedef enum {
2510     kCFXMLEntityTypeParameter,
2511     kCFXMLEntityTypeParsedInternal,
2512     kCFXMLEntityTypeParsedExternal,
2513     kCFXMLEntityTypeUnparsed,
2514     kCFXMLEntityTypeCharacter
2515 } CFXMLEntityTypeCode;
2516
2517 typedef struct {
2518     CFXMLEntityTypeCode entityType;
2519     CFStringRef replacementText;
2520     CFXMLExternalID entityID;
2521     CFStringRef notationName;
2522 } CFXMLEntityInfo;
2523
2524 typedef struct {
2525     CFXMLEntityTypeCode entityType;
2526 } CFXMLEntityReferenceInfo;
2527 extern
2528 CFTypeID CFXMLNodeGetTypeID(void);
2529
2530
2531 extern
2532 CFXMLNodeRef CFXMLNodeCreate(CFAllocatorRef alloc, CFXMLNodeTypeCode xmlType, CFStringRef dataString, const void *additionalInfoPtr, CFIndex version);
2533
2534
2535 extern
2536 CFXMLNodeRef CFXMLNodeCreateCopy(CFAllocatorRef alloc, CFXMLNodeRef origNode);
2537
2538 extern
2539 CFXMLNodeTypeCode CFXMLNodeGetTypeCode(CFXMLNodeRef node);
2540
2541 extern
2542 CFStringRef CFXMLNodeGetString(CFXMLNodeRef node);
2543
2544 extern
2545 const void *CFXMLNodeGetInfoPtr(CFXMLNodeRef node);
2546
2547 extern
2548 CFIndex CFXMLNodeGetVersion(CFXMLNodeRef node);
2549
2550
2551
2552
2553 extern
2554 CFXMLTreeRef CFXMLTreeCreateWithNode(CFAllocatorRef allocator, CFXMLNodeRef node);
2555
2556
2557 extern
2558 CFXMLNodeRef CFXMLTreeGetNode(CFXMLTreeRef xmlTree);
2559
2560
2561 }
2562 extern "C" {
2563
2564
2565 typedef struct __CFXMLParser * CFXMLParserRef;
2566 typedef enum {
2567     kCFXMLParserValidateDocument = (1 << 0),
2568     kCFXMLParserSkipMetaData = (1 << 1),
2569     kCFXMLParserReplacePhysicalEntities = (1 << 2),
2570     kCFXMLParserSkipWhitespace = (1 << 3),
2571     kCFXMLParserResolveExternalEntities = (1 << 4),
2572     kCFXMLParserAddImpliedAttributes = (1 << 5),
2573     kCFXMLParserAllOptions = 0x00FFFFFF,
2574     kCFXMLParserNoOptions = 0
2575 } CFXMLParserOptions;
2576
2577
2578 typedef enum {
2579     kCFXMLStatusParseNotBegun = -2,
2580     kCFXMLStatusParseInProgress = -1,
2581     kCFXMLStatusParseSuccessful = 0,
2582     kCFXMLErrorUnexpectedEOF = 1,
2583     kCFXMLErrorUnknownEncoding,
2584     kCFXMLErrorEncodingConversionFailure,
2585     kCFXMLErrorMalformedProcessingInstruction,
2586     kCFXMLErrorMalformedDTD,
2587     kCFXMLErrorMalformedName,
2588     kCFXMLErrorMalformedCDSect,
2589     kCFXMLErrorMalformedCloseTag,
2590     kCFXMLErrorMalformedStartTag,
2591     kCFXMLErrorMalformedDocument,
2592     kCFXMLErrorElementlessDocument,
2593     kCFXMLErrorMalformedComment,
2594     kCFXMLErrorMalformedCharacterReference,
2595     kCFXMLErrorMalformedParsedCharacterData,
2596     kCFXMLErrorNoData
2597 } CFXMLParserStatusCode;
2598 typedef void * (*CFXMLParserCreateXMLStructureCallBack)(CFXMLParserRef parser, CFXMLNodeRef nodeDesc, void *info);
2599 typedef void (*CFXMLParserAddChildCallBack)(CFXMLParserRef parser, void *parent, void *child, void *info);
2600 typedef void (*CFXMLParserEndXMLStructureCallBack)(CFXMLParserRef parser, void *xmlType, void *info);
2601 typedef CFDataRef (*CFXMLParserResolveExternalEntityCallBack)(CFXMLParserRef parser, CFXMLExternalID *extID, void *info);
2602 typedef Boolean (*CFXMLParserHandleErrorCallBack)(CFXMLParserRef parser, CFXMLParserStatusCode error, void *info);
2603 typedef struct {
2604     CFIndex version;
2605     CFXMLParserCreateXMLStructureCallBack createXMLStructure;
2606     CFXMLParserAddChildCallBack addChild;
2607     CFXMLParserEndXMLStructureCallBack endXMLStructure;
2608     CFXMLParserResolveExternalEntityCallBack resolveExternalEntity;
2609     CFXMLParserHandleErrorCallBack handleError;
2610 } CFXMLParserCallBacks;
2611
2612 typedef const void * (*CFXMLParserRetainCallBack)(const void *info);
2613 typedef void (*CFXMLParserReleaseCallBack)(const void *info);
2614 typedef CFStringRef (*CFXMLParserCopyDescriptionCallBack)(const void *info);
2615 typedef struct {
2616     CFIndex version;
2617     void * info;
2618     CFXMLParserRetainCallBack retain;
2619     CFXMLParserReleaseCallBack release;
2620     CFXMLParserCopyDescriptionCallBack copyDescription;
2621 } CFXMLParserContext;
2622
2623 extern
2624 CFTypeID CFXMLParserGetTypeID(void);
2625 extern
2626 CFXMLParserRef CFXMLParserCreate(CFAllocatorRef allocator, CFDataRef xmlData, CFURLRef dataSource, CFOptionFlags parseOptions, CFIndex versionOfNodes, CFXMLParserCallBacks *callBacks, CFXMLParserContext *context);
2627
2628
2629
2630
2631 extern
2632 CFXMLParserRef CFXMLParserCreateWithDataFromURL(CFAllocatorRef allocator, CFURLRef dataSource, CFOptionFlags parseOptions, CFIndex versionOfNodes, CFXMLParserCallBacks *callBacks, CFXMLParserContext *context);
2633
2634
2635 extern
2636 void CFXMLParserGetContext(CFXMLParserRef parser, CFXMLParserContext *context);
2637
2638 extern
2639 void CFXMLParserGetCallBacks(CFXMLParserRef parser, CFXMLParserCallBacks *callBacks);
2640
2641 extern
2642 CFURLRef CFXMLParserGetSourceURL(CFXMLParserRef parser);
2643
2644
2645 extern
2646 CFIndex CFXMLParserGetLocation(CFXMLParserRef parser);
2647
2648
2649 extern
2650 CFIndex CFXMLParserGetLineNumber(CFXMLParserRef parser);
2651
2652
2653 extern
2654 void *CFXMLParserGetDocument(CFXMLParserRef parser);
2655
2656
2657
2658
2659 extern
2660 CFXMLParserStatusCode CFXMLParserGetStatusCode(CFXMLParserRef parser);
2661
2662 extern
2663 CFStringRef CFXMLParserCopyErrorDescription(CFXMLParserRef parser);
2664
2665
2666
2667
2668 extern
2669 void CFXMLParserAbort(CFXMLParserRef parser, CFXMLParserStatusCode errorCode, CFStringRef errorDescription);
2670
2671
2672
2673
2674
2675
2676 extern
2677 Boolean CFXMLParserParse(CFXMLParserRef parser);
2678
2679
2680
2681
2682
2683
2684
2685 extern
2686 CFXMLTreeRef CFXMLTreeCreateFromData(CFAllocatorRef allocator, CFDataRef xmlData, CFURLRef dataSource, CFOptionFlags parseOptions, CFIndex versionOfNodes);
2687
2688
2689
2690 extern
2691 CFXMLTreeRef CFXMLTreeCreateWithDataFromURL(CFAllocatorRef allocator, CFURLRef dataSource, CFOptionFlags parseOptions, CFIndex versionOfNodes);
2692
2693
2694
2695
2696
2697
2698
2699 extern
2700 CFDataRef CFXMLTreeCreateXMLData(CFAllocatorRef allocator, CFXMLTreeRef xmlTree);
2701
2702
2703 }
2704 extern "C" {
2705 extern void __eprintf (const char *, const char *, unsigned, const char *)
2706     __attribute__ ((noreturn));
2707 }
2708 typedef struct {
2709         rune_t min;
2710         rune_t max;
2711         rune_t map;
2712         unsigned long *types;
2713 } _RuneEntry;
2714
2715 typedef struct {
2716         int nranges;
2717         _RuneEntry *ranges;
2718 } _RuneRange;
2719
2720 typedef struct {
2721         char magic[8];
2722         char encoding[32];
2723
2724         rune_t (*sgetrune)
2725             (const char *, size_t, char const **);
2726         int (*sputrune)
2727             (rune_t, char *, size_t, char **);
2728         rune_t invalid_rune;
2729
2730         unsigned long runetype[(1 <<8 )];
2731         rune_t maplower[(1 <<8 )];
2732         rune_t mapupper[(1 <<8 )];
2733
2734
2735
2736
2737
2738
2739         _RuneRange runetype_ext;
2740         _RuneRange maplower_ext;
2741         _RuneRange mapupper_ext;
2742
2743         void *variable;
2744         int variable_len;
2745 } _RuneLocale;
2746
2747
2748
2749 extern _RuneLocale _DefaultRuneLocale;
2750 extern _RuneLocale *_CurrentRuneLocale;
2751 extern "C" {
2752 int isalnum (int);
2753 int isalpha (int);
2754 int iscntrl (int);
2755 int isdigit (int);
2756 int isgraph (int);
2757 int islower (int);
2758 int isprint (int);
2759 int ispunct (int);
2760 int isspace (int);
2761 int isupper (int);
2762 int isxdigit (int);
2763 int tolower (int);
2764 int toupper (int);
2765
2766
2767 int digittoint (int);
2768 int isascii (int);
2769 int isblank (int);
2770 int ishexnumber (int);
2771 int isideogram (int);
2772 int isnumber (int);
2773 int isphonogram (int);
2774 int isrune (int);
2775 int isspecial (int);
2776 int toascii (int);
2777
2778 }
2779 extern "C" {
2780 unsigned long ___runetype (int);
2781 int ___tolower (int);
2782 int ___toupper (int);
2783 }
2784 static inline int
2785 __maskrune(int _c, unsigned long _f)
2786 {
2787         return ((_c < 0 || _c >= (1 <<8 )) ? ___runetype(_c) :
2788                 _CurrentRuneLocale->runetype[_c]) & _f;
2789 }
2790
2791 static inline int
2792 __istype(int c, unsigned long f)
2793 {
2794         return !!(__maskrune(c, f));
2795 }
2796
2797 static inline int
2798 __isctype(int _c, unsigned long _f)
2799 {
2800         return (_c < 0 || _c >= (1 <<8 )) ? 0 :
2801                 !!(_DefaultRuneLocale.runetype[_c] & _f);
2802 }
2803
2804 static inline int
2805 __toupper(int _c)
2806 {
2807         return (_c < 0 || _c >= (1 <<8 )) ? ___toupper(_c) :
2808                 _CurrentRuneLocale->mapupper[_c];
2809 }
2810
2811 static inline int
2812 __tolower(int _c)
2813 {
2814         return (_c < 0 || _c >= (1 <<8 )) ? ___tolower(_c) :
2815                 _CurrentRuneLocale->maplower[_c];
2816 }
2817 extern "C" {
2818 extern int * __error (void);
2819
2820 }
2821
2822
2823
2824
2825
2826
2827 struct lconv {
2828         char *decimal_point;
2829         char *thousands_sep;
2830         char *grouping;
2831         char *int_curr_symbol;
2832         char *currency_symbol;
2833         char *mon_decimal_point;
2834         char *mon_thousands_sep;
2835         char *mon_grouping;
2836         char *positive_sign;
2837         char *negative_sign;
2838         char int_frac_digits;
2839         char frac_digits;
2840         char p_cs_precedes;
2841         char p_sep_by_space;
2842         char n_cs_precedes;
2843         char n_sep_by_space;
2844         char p_sign_posn;
2845         char n_sign_posn;
2846 };
2847 extern "C" {
2848 struct lconv *localeconv (void);
2849 char *setlocale (int, const char *);
2850 }
2851 extern "C" {
2852
2853
2854
2855
2856
2857
2858 typedef float float_t;
2859 typedef double double_t;
2860 enum {
2861         FP_NAN = 1,
2862         FP_INFINITE = 2,
2863         FP_ZERO = 3,
2864         FP_NORMAL = 4,
2865         FP_SUBNORMAL = 5
2866 };
2867 extern unsigned int __math_errhandling ( void );
2868 extern long __fpclassifyd( double x );
2869 extern long __fpclassifyf( float x );
2870 extern long __fpclassify( long double x );
2871
2872
2873     inline long __fpclassify( long double x ) { return __fpclassifyd((double)( x )); }
2874
2875
2876
2877
2878
2879
2880 extern long __isnormald( double x );
2881 extern long __isnormalf( float x );
2882 extern long __isnormal( long double x );
2883
2884
2885     inline long __isnormal( long double x ) { return __isnormald((double)( x )); }
2886
2887
2888
2889
2890
2891 extern long __isfinited( double x );
2892 extern long __isfinitef( float x );
2893 extern long __isfinite( long double x );
2894
2895
2896     inline long __isfinite( long double x ) { return __isfinited((double)( x )); }
2897
2898
2899
2900
2901
2902
2903 extern long __isinfd( double x );
2904 extern long __isinff( float x );
2905 extern long __isinf( long double x );
2906
2907
2908     inline long __isinf( long double x ) { return __isinfd((double)( x )); }
2909
2910
2911
2912
2913
2914
2915 extern long __isnand( double x );
2916 extern long __isnanf( float x );
2917 extern long __isnan( long double x );
2918
2919
2920     inline long __isnan( long double x ) { return __isnand((double)( x )); }
2921
2922
2923
2924
2925
2926
2927 extern long __signbitd( double x );
2928 extern long __signbitf( float x );
2929 extern long __signbitl( long double x );
2930
2931
2932     inline long __signbitl( long double x ) { return __signbitd((double)( x )); }
2933 extern double acos( double x );
2934 extern double asin( double x );
2935 extern double atan( double x );
2936 extern double atan2( double y, double x );
2937 extern double cos( double x );
2938 extern double sin( double x );
2939 extern double tan( double x );
2940 extern double acosh( double x );
2941 extern double asinh( double x );
2942 extern double atanh( double x );
2943 extern double cosh( double x );
2944 extern double sinh( double x );
2945 extern double tanh( double x );
2946
2947 extern double exp ( double x );
2948 extern double exp2 ( double x );
2949 extern double expm1 ( double x );
2950 extern double log ( double x );
2951 extern double log10 ( double x );
2952 extern double log2 ( double x );
2953 extern double log1p ( double x );
2954
2955 extern double logb ( double x );
2956 extern float logbf ( float x );
2957
2958 extern double modf ( double x, double *iptr );
2959 extern float modff ( float x, float *iptr );
2960
2961 extern double ldexp ( double value, int exp );
2962 extern float ldexpf ( float value, int exp );
2963
2964 extern double frexp ( double value, int *eptr );
2965 extern float frexpf ( float value, int *eptr );
2966
2967 extern int ilogb ( double x );
2968 extern int ilogbf ( float x );
2969
2970 extern double scalbn ( double x, int n );
2971 extern float scalbnf ( float x, int n );
2972
2973 extern double scalbln ( double x, long int n );
2974 extern float scalblnf ( float x, long int n );
2975
2976 extern double fabs( double x );
2977 extern float fabsf( float x );
2978
2979 extern double cbrt( double x );
2980 extern double hypot ( double x, double y );
2981 extern double pow ( double x, double y );
2982 extern double sqrt( double x );
2983
2984 extern double erf( double x );
2985 extern double erfc( double x );
2986 extern double lgamma( double x );
2987 extern double tgamma( double x );
2988
2989 extern double ceil ( double x );
2990 extern float ceilf ( float x );
2991
2992 extern double floor ( double x );
2993 extern float floorf ( float x );
2994
2995 extern double nearbyint ( double x );
2996 extern float nearbyintf ( float x );
2997
2998 extern double rint ( double x );
2999 extern float rintf ( float x );
3000
3001 extern long int lrint ( double x );
3002 extern long int lrintf ( float x );
3003
3004 extern long long int llrint ( double x );
3005 extern long long int llrintf ( float x );
3006
3007 extern double round ( double x );
3008 extern float roundf ( float x );
3009
3010 extern long int lround ( double x );
3011 extern long int lroundf ( float x );
3012
3013 extern long long int llround ( double x );
3014 extern long long int llroundf ( float x );
3015
3016 extern double trunc ( double x );
3017 extern float truncf ( float x );
3018
3019 extern double fmod ( double x, double y );
3020 extern float fmodf ( float x, float y );
3021
3022 extern double remainder ( double x, double y );
3023 extern float remainderf ( float x, float y );
3024
3025 extern double remquo ( double x, double y, int *quo );
3026 extern float remquof ( float x, float y, int *quo );
3027
3028 extern double copysign ( double x, double y );
3029 extern float copysignf ( float x, float y );
3030
3031 extern double nan( const char *tagp );
3032 extern float nanf( const char *tagp );
3033
3034 extern double nextafter ( double x, double y );
3035 extern float nextafterf ( float x, float y );
3036
3037 extern double fdim ( double x, double y );
3038 extern float fdimf ( float x, float y );
3039
3040 extern double fmax ( double x, double y );
3041 extern float fmaxf ( float x, float y );
3042
3043 extern double fmin ( double x, double y );
3044 extern float fminf ( float x, float y );
3045
3046 extern double fma ( double x, double y, double z );
3047 extern float fmaf ( float x, float y, float z );
3048 extern double __inf( void );
3049 extern float __inff( void );
3050 extern float __nan( void );
3051
3052
3053
3054
3055
3056
3057 extern long int rinttol ( double x );
3058
3059 extern long int roundtol ( double x );
3060
3061 typedef struct _complx {
3062         double Real;
3063         double Imag;
3064 } _complex;
3065 extern int signgam;
3066
3067
3068 enum fdversion {fdlibm_ieee = -1, fdlibm_svid, fdlibm_xopen, fdlibm_posix};
3069 extern enum fdversion _fdlib_version;
3070 extern int finite ( double x );
3071
3072 extern double gamma ( double x );
3073
3074 extern double j0 ( double x );
3075 extern double j1 ( double x );
3076 extern double jn ( int n, double x );
3077
3078 extern double y0 ( double x );
3079 extern double y1 ( double x );
3080 extern double yn ( int n, double x );
3081
3082
3083
3084 extern double scalb ( double x, int n );
3085 extern double significand ( double x );
3086
3087
3088
3089
3090 extern double cabs ( _complex z );
3091
3092 extern double drem ( double x, double y );
3093 }
3094
3095
3096
3097
3098
3099
3100
3101 extern double acos (double);
3102 extern double asin (double);
3103 extern double atan (double);
3104 extern double atan2 (double, double);
3105 extern double ceil (double);
3106 extern double cos (double);
3107 extern double cosh (double);
3108 extern double exp (double);
3109 extern double fabs (double);
3110 extern double floor (double);
3111 extern double fmod (double, double);
3112 extern double frexp (double, int *);
3113 extern double ldexp (double, int);
3114 extern double log10 (double);
3115 extern double log (double);
3116 extern double modf (double, double *);
3117 extern double pow (double, double);
3118 extern double sin (double);
3119 extern double sinh (double);
3120 extern double sqrt (double);
3121 extern double tan (double);
3122 extern double tanh (double);
3123
3124
3125 typedef int ptrdiff_t;
3126
3127
3128
3129 struct timespec {
3130         time_t tv_sec;
3131         long tv_nsec;
3132 };
3133
3134
3135 struct tm {
3136         int tm_sec;
3137         int tm_min;
3138         int tm_hour;
3139         int tm_mday;
3140         int tm_mon;
3141         int tm_year;
3142         int tm_wday;
3143         int tm_yday;
3144         int tm_isdst;
3145         long tm_gmtoff;
3146         char *tm_zone;
3147 };
3148 extern char *tzname[];
3149
3150
3151 extern "C" {
3152 char *asctime (const struct tm *);
3153 clock_t clock (void);
3154 char *ctime (const time_t *);
3155 double difftime (time_t, time_t);
3156 struct tm *gmtime (const time_t *);
3157 struct tm *localtime (const time_t *);
3158 time_t mktime (struct tm *);
3159 size_t strftime (char *, size_t, const char *, const struct tm *);
3160 time_t time (time_t *);
3161
3162
3163 void tzset (void);
3164
3165
3166
3167 char *asctime_r (const struct tm *, char *);
3168 char *ctime_r (const time_t *, char *);
3169 struct tm *gmtime_r (const time_t *, struct tm *);
3170 struct tm *localtime_r (const time_t *, struct tm *);
3171 char *strptime (const char *, const char *, struct tm *);
3172 char *timezone (int, int);
3173 void tzsetwall (void);
3174 time_t timelocal (struct tm * const);
3175 time_t timegm (struct tm * const);
3176
3177
3178
3179 int nanosleep (const struct timespec *, struct timespec *);
3180
3181 }
3182 extern "C" {
3183
3184
3185 typedef struct {
3186     CFIndex version;
3187     void * info;
3188     const void *(*retain)(const void *info);
3189     void (*release)(const void *info);
3190     CFStringRef (*copyDescription)(const void *info);
3191 } CFBinaryHeapCompareContext;
3192 typedef struct {
3193     CFIndex version;
3194     const void *(*retain)(CFAllocatorRef allocator, const void *ptr);
3195     void (*release)(CFAllocatorRef allocator, const void *ptr);
3196     CFStringRef (*copyDescription)(const void *ptr);
3197     CFComparisonResult (*compare)(const void *ptr1, const void *ptr2, void *context);
3198 } CFBinaryHeapCallBacks;
3199
3200
3201
3202
3203
3204
3205
3206 extern const CFBinaryHeapCallBacks kCFStringBinaryHeapCallBacks;
3207 typedef void (*CFBinaryHeapApplierFunction)(const void *val, void *context);
3208
3209
3210
3211
3212
3213 typedef struct __CFBinaryHeap * CFBinaryHeapRef;
3214
3215
3216
3217
3218
3219 extern CFTypeID CFBinaryHeapGetTypeID(void);
3220 extern CFBinaryHeapRef CFBinaryHeapCreate(CFAllocatorRef allocator, CFIndex capacity, const CFBinaryHeapCallBacks *callBacks, const CFBinaryHeapCompareContext *compareContext);
3221 extern CFBinaryHeapRef CFBinaryHeapCreateCopy(CFAllocatorRef allocator, CFIndex capacity, CFBinaryHeapRef heap);
3222 extern CFIndex CFBinaryHeapGetCount(CFBinaryHeapRef heap);
3223 extern CFIndex CFBinaryHeapGetCountOfValue(CFBinaryHeapRef heap, const void *value);
3224 extern Boolean CFBinaryHeapContainsValue(CFBinaryHeapRef heap, const void *value);
3225 extern const void * CFBinaryHeapGetMinimum(CFBinaryHeapRef heap);
3226 extern Boolean CFBinaryHeapGetMinimumIfPresent(CFBinaryHeapRef heap, const void **value);
3227 extern void CFBinaryHeapGetValues(CFBinaryHeapRef heap, const void **values);
3228 extern void CFBinaryHeapApplyFunction(CFBinaryHeapRef heap, CFBinaryHeapApplierFunction applier, void *context);
3229 extern void CFBinaryHeapAddValue(CFBinaryHeapRef heap, const void *value);
3230
3231
3232
3233
3234
3235
3236
3237 extern void CFBinaryHeapRemoveMinimumValue(CFBinaryHeapRef heap);
3238 extern void CFBinaryHeapRemoveAllValues(CFBinaryHeapRef heap);
3239
3240
3241 }
3242 extern "C" {
3243
3244
3245 typedef UInt32 CFBit;
3246
3247 typedef const struct __CFBitVector * CFBitVectorRef;
3248 typedef struct __CFBitVector * CFMutableBitVectorRef;
3249
3250 extern CFTypeID CFBitVectorGetTypeID(void);
3251
3252 extern CFBitVectorRef CFBitVectorCreate(CFAllocatorRef allocator, const UInt8 *bytes, CFIndex numBits);
3253 extern CFBitVectorRef CFBitVectorCreateCopy(CFAllocatorRef allocator, CFBitVectorRef bv);
3254 extern CFMutableBitVectorRef CFBitVectorCreateMutable(CFAllocatorRef allocator, CFIndex capacity);
3255 extern CFMutableBitVectorRef CFBitVectorCreateMutableCopy(CFAllocatorRef allocator, CFIndex capacity, CFBitVectorRef bv);
3256
3257 extern CFIndex CFBitVectorGetCount(CFBitVectorRef bv);
3258 extern CFIndex CFBitVectorGetCountOfBit(CFBitVectorRef bv, CFRange range, CFBit value);
3259 extern Boolean CFBitVectorContainsBit(CFBitVectorRef bv, CFRange range, CFBit value);
3260 extern CFBit CFBitVectorGetBitAtIndex(CFBitVectorRef bv, CFIndex idx);
3261 extern void CFBitVectorGetBits(CFBitVectorRef bv, CFRange range, UInt8 *bytes);
3262 extern CFIndex CFBitVectorGetFirstIndexOfBit(CFBitVectorRef bv, CFRange range, CFBit value);
3263 extern CFIndex CFBitVectorGetLastIndexOfBit(CFBitVectorRef bv, CFRange range, CFBit value);
3264
3265 extern void CFBitVectorSetCount(CFMutableBitVectorRef bv, CFIndex count);
3266 extern void CFBitVectorFlipBitAtIndex(CFMutableBitVectorRef bv, CFIndex idx);
3267 extern void CFBitVectorFlipBits(CFMutableBitVectorRef bv, CFRange range);
3268 extern void CFBitVectorSetBitAtIndex(CFMutableBitVectorRef bv, CFIndex idx, CFBit value);
3269 extern void CFBitVectorSetBits(CFMutableBitVectorRef bv, CFRange range, CFBit value);
3270 extern void CFBitVectorSetAllBits(CFMutableBitVectorRef bv, CFBit value);
3271
3272
3273 }
3274 extern "C" {
3275
3276
3277 typedef struct __CFBundle *CFBundleRef;
3278 typedef struct __CFBundle *CFPlugInRef;
3279
3280
3281 extern
3282 const CFStringRef kCFBundleInfoDictionaryVersionKey;
3283
3284 extern
3285 const CFStringRef kCFBundleExecutableKey;
3286
3287 extern
3288 const CFStringRef kCFBundleIdentifierKey;
3289
3290 extern
3291 const CFStringRef kCFBundleVersionKey;
3292
3293
3294 extern
3295 const CFStringRef kCFBundleDevelopmentRegionKey;
3296
3297 extern
3298 const CFStringRef kCFBundleNameKey;
3299
3300
3301 extern
3302 const CFStringRef kCFBundleLocalizationsKey;
3303
3304
3305
3306
3307
3308 extern
3309 CFBundleRef CFBundleGetMainBundle(void);
3310
3311 extern
3312 CFBundleRef CFBundleGetBundleWithIdentifier(CFStringRef bundleID);
3313
3314
3315
3316
3317
3318 extern
3319 CFArrayRef CFBundleGetAllBundles(void);
3320
3321
3322
3323
3324 extern
3325 UInt32 CFBundleGetTypeID(void);
3326
3327 extern
3328 CFBundleRef CFBundleCreate(CFAllocatorRef allocator, CFURLRef bundleURL);
3329
3330
3331 extern
3332 CFArrayRef CFBundleCreateBundlesFromDirectory(CFAllocatorRef allocator, CFURLRef directoryURL, CFStringRef bundleType);
3333
3334
3335
3336
3337
3338 extern
3339 CFURLRef CFBundleCopyBundleURL(CFBundleRef bundle);
3340
3341 extern
3342 CFTypeRef CFBundleGetValueForInfoDictionaryKey(CFBundleRef bundle, CFStringRef key);
3343
3344
3345 extern
3346 CFDictionaryRef CFBundleGetInfoDictionary(CFBundleRef bundle);
3347
3348
3349
3350 extern
3351 CFDictionaryRef CFBundleGetLocalInfoDictionary(CFBundleRef bundle);
3352
3353
3354 extern
3355 void CFBundleGetPackageInfo(CFBundleRef bundle, UInt32 *packageType, UInt32 *packageCreator);
3356
3357 extern
3358 CFStringRef CFBundleGetIdentifier(CFBundleRef bundle);
3359
3360 extern
3361 UInt32 CFBundleGetVersionNumber(CFBundleRef bundle);
3362
3363 extern
3364 CFStringRef CFBundleGetDevelopmentRegion(CFBundleRef bundle);
3365
3366 extern
3367 CFURLRef CFBundleCopySupportFilesDirectoryURL(CFBundleRef bundle);
3368
3369 extern
3370 CFURLRef CFBundleCopyResourcesDirectoryURL(CFBundleRef bundle);
3371
3372 extern
3373 CFURLRef CFBundleCopyPrivateFrameworksURL(CFBundleRef bundle);
3374
3375 extern
3376 CFURLRef CFBundleCopySharedFrameworksURL(CFBundleRef bundle);
3377
3378 extern
3379 CFURLRef CFBundleCopySharedSupportURL(CFBundleRef bundle);
3380
3381 extern
3382 CFURLRef CFBundleCopyBuiltInPlugInsURL(CFBundleRef bundle);
3383
3384
3385
3386
3387 extern
3388 CFDictionaryRef CFBundleCopyInfoDictionaryInDirectory(CFURLRef bundleURL);
3389
3390 extern
3391 Boolean CFBundleGetPackageInfoInDirectory(CFURLRef url, UInt32 *packageType, UInt32 *packageCreator);
3392
3393
3394
3395 extern
3396 CFURLRef CFBundleCopyResourceURL(CFBundleRef bundle, CFStringRef resourceName, CFStringRef resourceType, CFStringRef subDirName);
3397
3398 extern
3399 CFArrayRef CFBundleCopyResourceURLsOfType(CFBundleRef bundle, CFStringRef resourceType, CFStringRef subDirName);
3400
3401 extern
3402 CFStringRef CFBundleCopyLocalizedString(CFBundleRef bundle, CFStringRef key, CFStringRef value, CFStringRef tableName);
3403 extern
3404 CFURLRef CFBundleCopyResourceURLInDirectory(CFURLRef bundleURL, CFStringRef resourceName, CFStringRef resourceType, CFStringRef subDirName);
3405
3406 extern
3407 CFArrayRef CFBundleCopyResourceURLsOfTypeInDirectory(CFURLRef bundleURL, CFStringRef resourceType, CFStringRef subDirName);
3408
3409
3410
3411
3412
3413
3414 extern
3415 CFArrayRef CFBundleCopyBundleLocalizations(CFBundleRef bundle);
3416
3417
3418 extern
3419 CFArrayRef CFBundleCopyPreferredLocalizationsFromArray(CFArrayRef locArray);
3420
3421
3422
3423
3424
3425
3426
3427 extern
3428 CFArrayRef CFBundleCopyLocalizationsForPreferences(CFArrayRef locArray, CFArrayRef prefArray);
3429 extern
3430 CFURLRef CFBundleCopyResourceURLForLocalization(CFBundleRef bundle, CFStringRef resourceName, CFStringRef resourceType, CFStringRef subDirName, CFStringRef localizationName);
3431
3432 extern
3433 CFArrayRef CFBundleCopyResourceURLsOfTypeForLocalization(CFBundleRef bundle, CFStringRef resourceType, CFStringRef subDirName, CFStringRef localizationName);
3434
3435
3436
3437
3438
3439 extern
3440 CFDictionaryRef CFBundleCopyInfoDictionaryForURL(CFURLRef url);
3441
3442
3443
3444
3445
3446 extern
3447 CFArrayRef CFBundleCopyLocalizationsForURL(CFURLRef url);
3448 extern
3449 CFURLRef CFBundleCopyExecutableURL(CFBundleRef bundle);
3450
3451 extern
3452 Boolean CFBundleIsExecutableLoaded(CFBundleRef bundle);
3453
3454 extern
3455 Boolean CFBundleLoadExecutable(CFBundleRef bundle);
3456
3457 extern
3458 void CFBundleUnloadExecutable(CFBundleRef bundle);
3459
3460 extern
3461 void *CFBundleGetFunctionPointerForName(CFBundleRef bundle, CFStringRef functionName);
3462
3463 extern
3464 void CFBundleGetFunctionPointersForNames(CFBundleRef bundle, CFArrayRef functionNames, void *ftbl[]);
3465
3466 extern
3467 void *CFBundleGetDataPointerForName(CFBundleRef bundle, CFStringRef symbolName);
3468
3469 extern
3470 void CFBundleGetDataPointersForNames(CFBundleRef bundle, CFArrayRef symbolNames, void *stbl[]);
3471
3472 extern
3473 CFURLRef CFBundleCopyAuxiliaryExecutableURL(CFBundleRef bundle, CFStringRef executableName);
3474 extern
3475 CFPlugInRef CFBundleGetPlugIn(CFBundleRef bundle);
3476
3477
3478
3479 extern
3480 short CFBundleOpenBundleResourceMap(CFBundleRef bundle);
3481
3482
3483
3484
3485
3486
3487 extern
3488 SInt32 CFBundleOpenBundleResourceFiles(CFBundleRef bundle, short *refNum, short *localizedRefNum);
3489
3490
3491
3492 extern
3493 void CFBundleCloseBundleResourceMap(CFBundleRef bundle, short refNum);
3494
3495
3496 }
3497 extern "C" {
3498
3499
3500 typedef enum __CFByteOrder {
3501     CFByteOrderUnknown,
3502     CFByteOrderLittleEndian,
3503     CFByteOrderBigEndian
3504 } CFByteOrder;
3505
3506 static __inline__ CFByteOrder CFByteOrderGetCurrent(void) {
3507     uint32_t x = (CFByteOrderBigEndian << 24) | CFByteOrderLittleEndian;
3508     return (CFByteOrder)*((UInt8 *)&x);
3509 }
3510
3511 static __inline__ uint16_t CFSwapInt16(uint16_t arg) {
3512
3513
3514
3515
3516
3517     uint16_t result;
3518     __asm__ volatile("lhbrx %0, 0, %1" : "=r" (result) : "r" (&arg) : "r0");
3519     return result;
3520 }
3521
3522 static __inline__ uint32_t CFSwapInt32(uint32_t arg) {
3523
3524
3525
3526
3527
3528     uint32_t result;
3529     __asm__ volatile("lwbrx %0, 0, %1" : "=r" (result) : "r" (&arg) : "r0");
3530     return result;
3531 }
3532
3533 static __inline__ uint64_t CFSwapInt64(uint64_t arg) {
3534     union CFSwap {
3535         uint64_t sv;
3536         UInt8 uc[8];
3537     } result, *argp = (union CFSwap *)&arg;
3538     result.uc[0] = argp->uc[7];
3539     result.uc[1] = argp->uc[6];
3540     result.uc[2] = argp->uc[5];
3541     result.uc[3] = argp->uc[4];
3542     result.uc[4] = argp->uc[3];
3543     result.uc[5] = argp->uc[2];
3544     result.uc[6] = argp->uc[1];
3545     result.uc[7] = argp->uc[0];
3546     return result.sv;
3547
3548 }
3549
3550 static __inline__ uint16_t CFSwapInt16BigToHost(uint16_t arg) {
3551
3552     return arg;
3553
3554
3555
3556 }
3557
3558 static __inline__ uint32_t CFSwapInt32BigToHost(uint32_t arg) {
3559
3560     return arg;
3561
3562
3563
3564 }
3565
3566 static __inline__ uint64_t CFSwapInt64BigToHost(uint64_t arg) {
3567
3568     return arg;
3569
3570
3571
3572 }
3573
3574 static __inline__ uint16_t CFSwapInt16HostToBig(uint16_t arg) {
3575
3576     return arg;
3577
3578
3579
3580 }
3581
3582 static __inline__ uint32_t CFSwapInt32HostToBig(uint32_t arg) {
3583
3584     return arg;
3585
3586
3587
3588 }
3589
3590 static __inline__ uint64_t CFSwapInt64HostToBig(uint64_t arg) {
3591
3592     return arg;
3593
3594
3595
3596 }
3597
3598 static __inline__ uint16_t CFSwapInt16LittleToHost(uint16_t arg) {
3599
3600
3601
3602     return CFSwapInt16(arg);
3603
3604 }
3605
3606 static __inline__ uint32_t CFSwapInt32LittleToHost(uint32_t arg) {
3607
3608
3609
3610     return CFSwapInt32(arg);
3611
3612 }
3613
3614 static __inline__ uint64_t CFSwapInt64LittleToHost(uint64_t arg) {
3615
3616
3617
3618     return CFSwapInt64(arg);
3619
3620 }
3621
3622 static __inline__ uint16_t CFSwapInt16HostToLittle(uint16_t arg) {
3623
3624
3625
3626     return CFSwapInt16(arg);
3627
3628 }
3629
3630 static __inline__ uint32_t CFSwapInt32HostToLittle(uint32_t arg) {
3631
3632
3633
3634     return CFSwapInt32(arg);
3635
3636 }
3637
3638 static __inline__ uint64_t CFSwapInt64HostToLittle(uint64_t arg) {
3639
3640
3641
3642     return CFSwapInt64(arg);
3643
3644 }
3645
3646 typedef struct {uint32_t v;} CFSwappedFloat32;
3647 typedef struct {uint64_t v;} CFSwappedFloat64;
3648
3649 static __inline__ CFSwappedFloat32 CFConvertFloat32HostToSwapped(Float32 arg) {
3650     union CFSwap {
3651         Float32 v;
3652         CFSwappedFloat32 sv;
3653     } result;
3654     result.v = arg;
3655
3656
3657
3658     return result.sv;
3659 }
3660
3661 static __inline__ Float32 CFConvertFloat32SwappedToHost(CFSwappedFloat32 arg) {
3662     union CFSwap {
3663         Float32 v;
3664         CFSwappedFloat32 sv;
3665     } result;
3666     result.sv = arg;
3667
3668
3669
3670     return result.v;
3671 }
3672
3673 static __inline__ CFSwappedFloat64 CFConvertFloat64HostToSwapped(Float64 arg) {
3674     union CFSwap {
3675         Float64 v;
3676         CFSwappedFloat64 sv;
3677     } result;
3678     result.v = arg;
3679
3680
3681
3682     return result.sv;
3683 }
3684
3685 static __inline__ Float64 CFConvertFloat64SwappedToHost(CFSwappedFloat64 arg) {
3686     union CFSwap {
3687         Float64 v;
3688         CFSwappedFloat64 sv;
3689     } result;
3690     result.sv = arg;
3691
3692
3693
3694     return result.v;
3695 }
3696
3697 static __inline__ CFSwappedFloat32 CFConvertFloatHostToSwapped(float arg) {
3698     union CFSwap {
3699         float v;
3700         CFSwappedFloat32 sv;
3701     } result;
3702     result.v = arg;
3703
3704
3705
3706     return result.sv;
3707 }
3708
3709 static __inline__ float CFConvertFloatSwappedToHost(CFSwappedFloat32 arg) {
3710     union CFSwap {
3711         float v;
3712         CFSwappedFloat32 sv;
3713     } result;
3714     result.sv = arg;
3715
3716
3717
3718     return result.v;
3719 }
3720
3721 static __inline__ CFSwappedFloat64 CFConvertDoubleHostToSwapped(double arg) {
3722     union CFSwap {
3723         double v;
3724         CFSwappedFloat64 sv;
3725     } result;
3726     result.v = arg;
3727
3728
3729
3730     return result.sv;
3731 }
3732
3733 static __inline__ double CFConvertDoubleSwappedToHost(CFSwappedFloat64 arg) {
3734     union CFSwap {
3735         double v;
3736         CFSwappedFloat64 sv;
3737     } result;
3738     result.sv = arg;
3739
3740
3741
3742     return result.v;
3743 }
3744
3745
3746 }
3747 extern "C" {
3748
3749
3750 typedef const struct __CFUUID * CFUUIDRef;
3751
3752 typedef struct {
3753     UInt8 byte0;
3754     UInt8 byte1;
3755     UInt8 byte2;
3756     UInt8 byte3;
3757     UInt8 byte4;
3758     UInt8 byte5;
3759     UInt8 byte6;
3760     UInt8 byte7;
3761     UInt8 byte8;
3762     UInt8 byte9;
3763     UInt8 byte10;
3764     UInt8 byte11;
3765     UInt8 byte12;
3766     UInt8 byte13;
3767     UInt8 byte14;
3768     UInt8 byte15;
3769 } CFUUIDBytes;
3770
3771
3772
3773
3774
3775
3776 extern
3777 CFTypeID CFUUIDGetTypeID(void);
3778
3779 extern
3780 CFUUIDRef CFUUIDCreate(CFAllocatorRef alloc);
3781
3782
3783 extern
3784 CFUUIDRef CFUUIDCreateWithBytes(CFAllocatorRef alloc, UInt8 byte0, UInt8 byte1, UInt8 byte2, UInt8 byte3, UInt8 byte4, UInt8 byte5, UInt8 byte6, UInt8 byte7, UInt8 byte8, UInt8 byte9, UInt8 byte10, UInt8 byte11, UInt8 byte12, UInt8 byte13, UInt8 byte14, UInt8 byte15);
3785
3786
3787 extern
3788 CFUUIDRef CFUUIDCreateFromString(CFAllocatorRef alloc, CFStringRef uuidStr);
3789
3790
3791 extern
3792 CFStringRef CFUUIDCreateString(CFAllocatorRef alloc, CFUUIDRef uuid);
3793
3794
3795 extern
3796 CFUUIDRef CFUUIDGetConstantUUIDWithBytes(CFAllocatorRef alloc, UInt8 byte0, UInt8 byte1, UInt8 byte2, UInt8 byte3, UInt8 byte4, UInt8 byte5, UInt8 byte6, UInt8 byte7, UInt8 byte8, UInt8 byte9, UInt8 byte10, UInt8 byte11, UInt8 byte12, UInt8 byte13, UInt8 byte14, UInt8 byte15);
3797
3798
3799 extern
3800 CFUUIDBytes CFUUIDGetUUIDBytes(CFUUIDRef uuid);
3801
3802 extern
3803 CFUUIDRef CFUUIDCreateFromUUIDBytes(CFAllocatorRef alloc, CFUUIDBytes bytes);
3804
3805
3806 }
3807
3808
3809 extern "C" {
3810
3811
3812
3813
3814 extern
3815 const CFStringRef kCFPlugInDynamicRegistrationKey;
3816 extern
3817 const CFStringRef kCFPlugInDynamicRegisterFunctionKey;
3818 extern
3819 const CFStringRef kCFPlugInUnloadFunctionKey;
3820 extern
3821 const CFStringRef kCFPlugInFactoriesKey;
3822 extern
3823 const CFStringRef kCFPlugInTypesKey;
3824
3825
3826
3827
3828 typedef void (*CFPlugInDynamicRegisterFunction)(CFPlugInRef plugIn);
3829 typedef void (*CFPlugInUnloadFunction)(CFPlugInRef plugIn);
3830 typedef void *(*CFPlugInFactoryFunction)(CFAllocatorRef allocator, CFUUIDRef typeUUID);
3831
3832
3833
3834 extern
3835 UInt32 CFPlugInGetTypeID(void);
3836
3837 extern
3838 CFPlugInRef CFPlugInCreate(CFAllocatorRef allocator, CFURLRef plugInURL);
3839
3840
3841 extern
3842 CFBundleRef CFPlugInGetBundle(CFPlugInRef plugIn);
3843
3844
3845
3846
3847
3848
3849
3850 extern
3851 void CFPlugInSetLoadOnDemand(CFPlugInRef plugIn, Boolean flag);
3852
3853 extern
3854 Boolean CFPlugInIsLoadOnDemand(CFPlugInRef plugIn);
3855
3856
3857
3858
3859
3860 extern
3861 CFArrayRef CFPlugInFindFactoriesForPlugInType(CFUUIDRef typeUUID);
3862
3863
3864 extern
3865 CFArrayRef CFPlugInFindFactoriesForPlugInTypeInPlugIn(CFUUIDRef typeUUID, CFPlugInRef plugIn);
3866
3867
3868 extern
3869 void *CFPlugInInstanceCreate(CFAllocatorRef allocator, CFUUIDRef factoryUUID, CFUUIDRef typeUUID);
3870
3871
3872
3873
3874
3875
3876 extern
3877 Boolean CFPlugInRegisterFactoryFunction(CFUUIDRef factoryUUID, CFPlugInFactoryFunction func);
3878
3879 extern
3880 Boolean CFPlugInRegisterFactoryFunctionByName(CFUUIDRef factoryUUID, CFPlugInRef plugIn, CFStringRef functionName);
3881
3882 extern
3883 Boolean CFPlugInUnregisterFactory(CFUUIDRef factoryUUID);
3884
3885 extern
3886 Boolean CFPlugInRegisterPlugInType(CFUUIDRef factoryUUID, CFUUIDRef typeUUID);
3887
3888 extern
3889 Boolean CFPlugInUnregisterPlugInType(CFUUIDRef factoryUUID, CFUUIDRef typeUUID);
3890
3891
3892
3893
3894
3895 extern
3896 void CFPlugInAddInstanceForFactory(CFUUIDRef factoryID);
3897
3898 extern
3899 void CFPlugInRemoveInstanceForFactory(CFUUIDRef factoryID);
3900
3901
3902
3903
3904 typedef struct __CFPlugInInstance *CFPlugInInstanceRef;
3905
3906 typedef Boolean (*CFPlugInInstanceGetInterfaceFunction)(CFPlugInInstanceRef instance, CFStringRef interfaceName, void **ftbl);
3907 typedef void (*CFPlugInInstanceDeallocateInstanceDataFunction)(void *instanceData);
3908
3909 extern
3910 Boolean CFPlugInInstanceGetInterfaceFunctionTable(CFPlugInInstanceRef instance, CFStringRef interfaceName, void **ftbl);
3911 extern
3912 CFStringRef CFPlugInInstanceGetFactoryName(CFPlugInInstanceRef instance);
3913 extern
3914 void *CFPlugInInstanceGetInstanceData(CFPlugInInstanceRef instance);
3915 extern
3916 UInt32 CFPlugInInstanceGetTypeID(void);
3917 extern
3918 CFPlugInInstanceRef CFPlugInInstanceCreateWithInstanceDataSize(CFAllocatorRef allocator, CFIndex instanceDataSize, CFPlugInInstanceDeallocateInstanceDataFunction deallocateInstanceFunction, CFStringRef factoryName, CFPlugInInstanceGetInterfaceFunction getInterfaceFunction);
3919
3920
3921 }
3922 extern "C" {
3923 extern
3924 Boolean CFURLCreateDataAndPropertiesFromResource(CFAllocatorRef alloc, CFURLRef url, CFDataRef *resourceData, CFDictionaryRef *properties, CFArrayRef desiredProperties, SInt32 *errorCode);
3925 extern
3926 Boolean CFURLWriteDataAndPropertiesToResource(CFURLRef url, CFDataRef dataToWrite, CFDictionaryRef propertiesToWrite, SInt32 *errorCode);
3927
3928
3929
3930 extern
3931 Boolean CFURLDestroyResource(CFURLRef url, SInt32 *errorCode);
3932
3933
3934
3935 extern
3936 CFTypeRef CFURLCreatePropertyFromResource(CFAllocatorRef alloc, CFURLRef url, CFStringRef property, SInt32 *errorCode);
3937
3938
3939 typedef enum {
3940     kCFURLUnknownError = -10,
3941     kCFURLUnknownSchemeError = -11,
3942     kCFURLResourceNotFoundError = -12,
3943     kCFURLResourceAccessViolationError = -13,
3944     kCFURLRemoteHostUnavailableError = -14,
3945     kCFURLImproperArgumentsError = -15,
3946     kCFURLUnknownPropertyKeyError = -16,
3947     kCFURLPropertyKeyUnavailableError = -17,
3948     kCFURLTimeoutError = -18
3949 } CFURLError;
3950
3951
3952
3953 extern
3954 const CFStringRef kCFURLFileExists;
3955 extern
3956 const CFStringRef kCFURLFileDirectoryContents;
3957 extern
3958 const CFStringRef kCFURLFileLength;
3959 extern
3960 const CFStringRef kCFURLFileLastModificationTime;
3961 extern
3962 const CFStringRef kCFURLFilePOSIXMode;
3963 extern
3964 const CFStringRef kCFURLFileOwnerID;
3965 extern
3966 const CFStringRef kCFURLHTTPStatusCode;
3967 extern
3968 const CFStringRef kCFURLHTTPStatusLine;
3969 }
3970
3971
3972
3973 extern "C" {
3974
3975
3976 typedef struct __CFMachPort * CFMachPortRef;
3977
3978 typedef struct {
3979     CFIndex version;
3980     void * info;
3981     const void *(*retain)(const void *info);
3982     void (*release)(const void *info);
3983     CFStringRef (*copyDescription)(const void *info);
3984 } CFMachPortContext;
3985
3986 typedef void (*CFMachPortCallBack)(CFMachPortRef port, void *msg, CFIndex size, void *info);
3987 typedef void (*CFMachPortInvalidationCallBack)(CFMachPortRef port, void *info);
3988
3989 extern CFTypeID CFMachPortGetTypeID(void);
3990
3991 extern CFMachPortRef CFMachPortCreate(CFAllocatorRef allocator, CFMachPortCallBack callout, CFMachPortContext *context, Boolean *shouldFreeInfo);
3992 extern CFMachPortRef CFMachPortCreateWithPort(CFAllocatorRef allocator, mach_port_t portNum, CFMachPortCallBack callout, CFMachPortContext *context, Boolean *shouldFreeInfo);
3993
3994 extern mach_port_t CFMachPortGetPort(CFMachPortRef port);
3995 extern void CFMachPortGetContext(CFMachPortRef port, CFMachPortContext *context);
3996 extern void CFMachPortInvalidate(CFMachPortRef port);
3997 extern Boolean CFMachPortIsValid(CFMachPortRef port);
3998 extern CFMachPortInvalidationCallBack CFMachPortGetInvalidationCallBack(CFMachPortRef port);
3999 extern void CFMachPortSetInvalidationCallBack(CFMachPortRef port, CFMachPortInvalidationCallBack callout);
4000
4001 extern CFRunLoopSourceRef CFMachPortCreateRunLoopSource(CFAllocatorRef allocator, CFMachPortRef port, CFIndex order);
4002
4003
4004 }
4005 extern "C" {
4006
4007
4008 typedef struct __CFMessagePort * CFMessagePortRef;
4009
4010 enum {
4011     kCFMessagePortSuccess = 0,
4012     kCFMessagePortSendTimeout = -1,
4013     kCFMessagePortReceiveTimeout = -2,
4014     kCFMessagePortIsInvalid = -3,
4015     kCFMessagePortTransportError = -4
4016 };
4017
4018 typedef struct {
4019     CFIndex version;
4020     void * info;
4021     const void *(*retain)(const void *info);
4022     void (*release)(const void *info);
4023     CFStringRef (*copyDescription)(const void *info);
4024 } CFMessagePortContext;
4025
4026 typedef CFDataRef (*CFMessagePortCallBack)(CFMessagePortRef local, SInt32 msgid, CFDataRef data, void *info);
4027
4028 typedef void (*CFMessagePortInvalidationCallBack)(CFMessagePortRef ms, void *info);
4029
4030 extern CFTypeID CFMessagePortGetTypeID(void);
4031
4032 extern CFMessagePortRef CFMessagePortCreateLocal(CFAllocatorRef allocator, CFStringRef name, CFMessagePortCallBack callout, CFMessagePortContext *context, Boolean *shouldFreeInfo);
4033 extern CFMessagePortRef CFMessagePortCreateRemote(CFAllocatorRef allocator, CFStringRef name);
4034
4035 extern Boolean CFMessagePortIsRemote(CFMessagePortRef ms);
4036 extern CFStringRef CFMessagePortGetName(CFMessagePortRef ms);
4037 extern Boolean CFMessagePortSetName(CFMessagePortRef ms, CFStringRef newName);
4038 extern void CFMessagePortGetContext(CFMessagePortRef ms, CFMessagePortContext *context);
4039 extern void CFMessagePortInvalidate(CFMessagePortRef ms);
4040 extern Boolean CFMessagePortIsValid(CFMessagePortRef ms);
4041 extern CFMessagePortInvalidationCallBack CFMessagePortGetInvalidationCallBack(CFMessagePortRef ms);
4042 extern void CFMessagePortSetInvalidationCallBack(CFMessagePortRef ms, CFMessagePortInvalidationCallBack callout);
4043
4044
4045 extern SInt32 CFMessagePortSendRequest(CFMessagePortRef remote, SInt32 msgid, CFDataRef data, CFTimeInterval sendTimeout, CFTimeInterval rcvTimeout, CFStringRef replyMode, CFDataRef *returnData);
4046
4047 extern CFRunLoopSourceRef CFMessagePortCreateRunLoopSource(CFAllocatorRef allocator, CFMessagePortRef local, CFIndex order);
4048
4049
4050 }
4051
4052
4053
4054
4055
4056
4057 extern "C" {
4058
4059
4060 typedef struct __CFNotificationCenter * CFNotificationCenterRef;
4061
4062 typedef void (*CFNotificationCallback)(CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef userInfo);
4063
4064 typedef enum {
4065     CFNotificationSuspensionBehaviorDrop = 1,
4066
4067     CFNotificationSuspensionBehaviorCoalesce = 2,
4068
4069     CFNotificationSuspensionBehaviorHold = 3,
4070
4071     CFNotificationSuspensionBehaviorDeliverImmediately = 4
4072
4073 } CFNotificationSuspensionBehavior;
4074
4075 extern CFTypeID CFNotificationCenterGetTypeID(void);
4076
4077
4078 extern CFNotificationCenterRef CFNotificationCenterGetDistributedCenter(void);
4079
4080
4081 extern void CFNotificationCenterAddObserver(CFNotificationCenterRef center, const void *observer, CFNotificationCallback callBack, CFStringRef name, const void *object, CFNotificationSuspensionBehavior suspensionBehavior);
4082
4083 extern void CFNotificationCenterRemoveObserver(CFNotificationCenterRef center, const void *observer, CFStringRef name, const void *object);
4084 extern void CFNotificationCenterRemoveEveryObserver(CFNotificationCenterRef center, const void *observer);
4085
4086
4087 extern void CFNotificationCenterPostNotification(CFNotificationCenterRef center, CFStringRef name, const void *object, CFDictionaryRef userInfo, Boolean deliverImmediately);
4088
4089
4090 }
4091 extern "C" {
4092
4093
4094 extern
4095 const CFStringRef kCFPreferencesAnyApplication;
4096 extern
4097 const CFStringRef kCFPreferencesCurrentApplication;
4098 extern
4099 const CFStringRef kCFPreferencesAnyHost;
4100 extern
4101 const CFStringRef kCFPreferencesCurrentHost;
4102 extern
4103 const CFStringRef kCFPreferencesAnyUser;
4104 extern
4105 const CFStringRef kCFPreferencesCurrentUser;
4106 extern
4107 CFPropertyListRef CFPreferencesCopyAppValue(CFStringRef key, CFStringRef applicationID);
4108
4109
4110
4111
4112 extern
4113 Boolean CFPreferencesGetAppBooleanValue(CFStringRef key, CFStringRef applicationID, Boolean *keyExistsAndHasValidFormat);
4114
4115
4116
4117
4118 extern
4119 CFIndex CFPreferencesGetAppIntegerValue(CFStringRef key, CFStringRef applicationID, Boolean *keyExistsAndHasValidFormat);
4120
4121
4122
4123
4124 extern
4125 void CFPreferencesSetAppValue(CFStringRef key, CFPropertyListRef value, CFStringRef applicationID);
4126
4127
4128
4129
4130
4131 extern
4132 void CFPreferencesAddSuitePreferencesToApp(CFStringRef applicationID, CFStringRef suiteID);
4133
4134 extern
4135 void CFPreferencesRemoveSuitePreferencesFromApp(CFStringRef applicationID, CFStringRef suiteID);
4136
4137
4138
4139 extern
4140 Boolean CFPreferencesAppSynchronize(CFStringRef applicationID);
4141
4142
4143
4144
4145
4146 extern
4147 CFPropertyListRef CFPreferencesCopyValue(CFStringRef key, CFStringRef applicationID, CFStringRef userName, CFStringRef hostName);
4148
4149
4150
4151
4152
4153 extern
4154 CFDictionaryRef CFPreferencesCopyMultiple(CFArrayRef keysToFetch, CFStringRef applicationID, CFStringRef userName, CFStringRef hostName);
4155
4156
4157
4158 extern
4159 void CFPreferencesSetValue(CFStringRef key, CFPropertyListRef value, CFStringRef applicationID, CFStringRef userName, CFStringRef hostName);
4160
4161
4162
4163 extern
4164 void CFPreferencesSetMultiple(CFDictionaryRef keysToSet, CFArrayRef keysToRemove, CFStringRef applicationID, CFStringRef userName, CFStringRef hostName);
4165
4166 extern
4167 Boolean CFPreferencesSynchronize(CFStringRef applicationID, CFStringRef userName, CFStringRef hostName);
4168
4169
4170
4171
4172
4173 extern
4174 CFArrayRef CFPreferencesCopyApplicationList(CFStringRef userName, CFStringRef hostName);
4175
4176
4177
4178
4179 extern
4180 CFArrayRef CFPreferencesCopyKeyList(CFStringRef applicationID, CFStringRef userName, CFStringRef hostName);
4181
4182
4183
4184
4185
4186
4187
4188 extern
4189 Boolean CFPreferencesAppValueIsForced(CFStringRef key, CFStringRef applicationID);
4190
4191
4192
4193
4194 }
4195
4196 extern "C" {
4197
4198
4199 typedef enum {
4200
4201     kCFStringEncodingMacJapanese = 1,
4202     kCFStringEncodingMacChineseTrad = 2,
4203     kCFStringEncodingMacKorean = 3,
4204     kCFStringEncodingMacArabic = 4,
4205     kCFStringEncodingMacHebrew = 5,
4206     kCFStringEncodingMacGreek = 6,
4207     kCFStringEncodingMacCyrillic = 7,
4208     kCFStringEncodingMacDevanagari = 9,
4209     kCFStringEncodingMacGurmukhi = 10,
4210     kCFStringEncodingMacGujarati = 11,
4211     kCFStringEncodingMacOriya = 12,
4212     kCFStringEncodingMacBengali = 13,
4213     kCFStringEncodingMacTamil = 14,
4214     kCFStringEncodingMacTelugu = 15,
4215     kCFStringEncodingMacKannada = 16,
4216     kCFStringEncodingMacMalayalam = 17,
4217     kCFStringEncodingMacSinhalese = 18,
4218     kCFStringEncodingMacBurmese = 19,
4219     kCFStringEncodingMacKhmer = 20,
4220     kCFStringEncodingMacThai = 21,
4221     kCFStringEncodingMacLaotian = 22,
4222     kCFStringEncodingMacGeorgian = 23,
4223     kCFStringEncodingMacArmenian = 24,
4224     kCFStringEncodingMacChineseSimp = 25,
4225     kCFStringEncodingMacTibetan = 26,
4226     kCFStringEncodingMacMongolian = 27,
4227     kCFStringEncodingMacEthiopic = 28,
4228     kCFStringEncodingMacCentralEurRoman = 29,
4229     kCFStringEncodingMacVietnamese = 30,
4230     kCFStringEncodingMacExtArabic = 31,
4231
4232     kCFStringEncodingMacSymbol = 33,
4233     kCFStringEncodingMacDingbats = 34,
4234     kCFStringEncodingMacTurkish = 35,
4235     kCFStringEncodingMacCroatian = 36,
4236     kCFStringEncodingMacIcelandic = 37,
4237     kCFStringEncodingMacRomanian = 38,
4238     kCFStringEncodingMacCeltic = 39,
4239     kCFStringEncodingMacGaelic = 40,
4240
4241     kCFStringEncodingMacFarsi = 0x8C,
4242
4243     kCFStringEncodingMacUkrainian = 0x98,
4244
4245     kCFStringEncodingMacInuit = 0xEC,
4246     kCFStringEncodingMacVT100 = 0xFC,
4247
4248     kCFStringEncodingMacHFS = 0xFF,
4249
4250
4251
4252
4253
4254
4255     kCFStringEncodingISOLatin2 = 0x0202,
4256     kCFStringEncodingISOLatin3 = 0x0203,
4257     kCFStringEncodingISOLatin4 = 0x0204,
4258     kCFStringEncodingISOLatinCyrillic = 0x0205,
4259     kCFStringEncodingISOLatinArabic = 0x0206,
4260     kCFStringEncodingISOLatinGreek = 0x0207,
4261     kCFStringEncodingISOLatinHebrew = 0x0208,
4262     kCFStringEncodingISOLatin5 = 0x0209,
4263     kCFStringEncodingISOLatin6 = 0x020A,
4264     kCFStringEncodingISOLatinThai = 0x020B,
4265     kCFStringEncodingISOLatin7 = 0x020D,
4266     kCFStringEncodingISOLatin8 = 0x020E,
4267     kCFStringEncodingISOLatin9 = 0x020F,
4268
4269
4270     kCFStringEncodingDOSLatinUS = 0x0400,
4271     kCFStringEncodingDOSGreek = 0x0405,
4272     kCFStringEncodingDOSBalticRim = 0x0406,
4273     kCFStringEncodingDOSLatin1 = 0x0410,
4274     kCFStringEncodingDOSGreek1 = 0x0411,
4275     kCFStringEncodingDOSLatin2 = 0x0412,
4276     kCFStringEncodingDOSCyrillic = 0x0413,
4277     kCFStringEncodingDOSTurkish = 0x0414,
4278     kCFStringEncodingDOSPortuguese = 0x0415,
4279     kCFStringEncodingDOSIcelandic = 0x0416,
4280     kCFStringEncodingDOSHebrew = 0x0417,
4281     kCFStringEncodingDOSCanadianFrench = 0x0418,
4282     kCFStringEncodingDOSArabic = 0x0419,
4283     kCFStringEncodingDOSNordic = 0x041A,
4284     kCFStringEncodingDOSRussian = 0x041B,
4285     kCFStringEncodingDOSGreek2 = 0x041C,
4286     kCFStringEncodingDOSThai = 0x041D,
4287     kCFStringEncodingDOSJapanese = 0x0420,
4288     kCFStringEncodingDOSChineseSimplif = 0x0421,
4289     kCFStringEncodingDOSKorean = 0x0422,
4290     kCFStringEncodingDOSChineseTrad = 0x0423,
4291
4292     kCFStringEncodingWindowsLatin2 = 0x0501,
4293     kCFStringEncodingWindowsCyrillic = 0x0502,
4294     kCFStringEncodingWindowsGreek = 0x0503,
4295     kCFStringEncodingWindowsLatin5 = 0x0504,
4296     kCFStringEncodingWindowsHebrew = 0x0505,
4297     kCFStringEncodingWindowsArabic = 0x0506,
4298     kCFStringEncodingWindowsBalticRim = 0x0507,
4299     kCFStringEncodingWindowsKoreanJohab = 0x0510,
4300     kCFStringEncodingWindowsVietnamese = 0x0508,
4301
4302
4303
4304     kCFStringEncodingJIS_X0201_76 = 0x0620,
4305     kCFStringEncodingJIS_X0208_83 = 0x0621,
4306     kCFStringEncodingJIS_X0208_90 = 0x0622,
4307     kCFStringEncodingJIS_X0212_90 = 0x0623,
4308     kCFStringEncodingJIS_C6226_78 = 0x0624,
4309     kCFStringEncodingShiftJIS_X0213_00 = 0x0628,
4310     kCFStringEncodingGB_2312_80 = 0x0630,
4311     kCFStringEncodingGBK_95 = 0x0631,
4312     kCFStringEncodingGB_18030_2000 = 0x0632,
4313     kCFStringEncodingKSC_5601_87 = 0x0640,
4314     kCFStringEncodingKSC_5601_92_Johab = 0x0641,
4315     kCFStringEncodingCNS_11643_92_P1 = 0x0651,
4316     kCFStringEncodingCNS_11643_92_P2 = 0x0652,
4317     kCFStringEncodingCNS_11643_92_P3 = 0x0653,
4318
4319
4320     kCFStringEncodingISO_2022_JP = 0x0820,
4321     kCFStringEncodingISO_2022_JP_2 = 0x0821,
4322     kCFStringEncodingISO_2022_JP_1 = 0x0822,
4323     kCFStringEncodingISO_2022_JP_3 = 0x0823,
4324     kCFStringEncodingISO_2022_CN = 0x0830,
4325     kCFStringEncodingISO_2022_CN_EXT = 0x0831,
4326     kCFStringEncodingISO_2022_KR = 0x0840,
4327
4328
4329     kCFStringEncodingEUC_JP = 0x0920,
4330     kCFStringEncodingEUC_CN = 0x0930,
4331     kCFStringEncodingEUC_TW = 0x0931,
4332     kCFStringEncodingEUC_KR = 0x0940,
4333
4334
4335     kCFStringEncodingShiftJIS = 0x0A01,
4336     kCFStringEncodingKOI8_R = 0x0A02,
4337     kCFStringEncodingBig5 = 0x0A03,
4338     kCFStringEncodingMacRomanLatin1 = 0x0A04,
4339     kCFStringEncodingHZ_GB_2312 = 0x0A05,
4340     kCFStringEncodingBig5_HKSCS_1999 = 0x0A06,
4341
4342
4343
4344
4345
4346     kCFStringEncodingEBCDIC_US = 0x0C01,
4347     kCFStringEncodingEBCDIC_CP037 = 0x0C02
4348 } CFStringEncodings;
4349
4350
4351 }
4352 extern "C" {
4353
4354
4355 typedef struct __CFUserNotification * CFUserNotificationRef;
4356 typedef void (*CFUserNotificationCallBack)(CFUserNotificationRef userNotification, CFOptionFlags responseFlags);
4357
4358 extern
4359 CFTypeID CFUserNotificationGetTypeID(void);
4360
4361 extern
4362 CFUserNotificationRef CFUserNotificationCreate(CFAllocatorRef allocator, CFTimeInterval timeout, CFOptionFlags flags, SInt32 *error, CFDictionaryRef dictionary);
4363
4364 extern
4365 SInt32 CFUserNotificationReceiveResponse(CFUserNotificationRef userNotification, CFTimeInterval timeout, CFOptionFlags *responseFlags);
4366
4367 extern
4368 CFStringRef CFUserNotificationGetResponseValue(CFUserNotificationRef userNotification, CFStringRef key, CFIndex idx);
4369
4370 extern
4371 CFDictionaryRef CFUserNotificationGetResponseDictionary(CFUserNotificationRef userNotification);
4372
4373 extern
4374 SInt32 CFUserNotificationUpdate(CFUserNotificationRef userNotification, CFTimeInterval timeout, CFOptionFlags flags, CFDictionaryRef dictionary);
4375
4376 extern
4377 SInt32 CFUserNotificationCancel(CFUserNotificationRef userNotification);
4378
4379 extern
4380 CFRunLoopSourceRef CFUserNotificationCreateRunLoopSource(CFAllocatorRef allocator, CFUserNotificationRef userNotification, CFUserNotificationCallBack callout, CFIndex order);
4381
4382
4383
4384
4385 extern
4386 SInt32 CFUserNotificationDisplayNotice(CFTimeInterval timeout, CFOptionFlags flags, CFURLRef iconURL, CFURLRef soundURL, CFURLRef localizationURL, CFStringRef alertHeader, CFStringRef alertMessage, CFStringRef defaultButtonTitle);
4387
4388 extern
4389 SInt32 CFUserNotificationDisplayAlert(CFTimeInterval timeout, CFOptionFlags flags, CFURLRef iconURL, CFURLRef soundURL, CFURLRef localizationURL, CFStringRef alertHeader, CFStringRef alertMessage, CFStringRef defaultButtonTitle, CFStringRef alternateButtonTitle, CFStringRef otherButtonTitle, CFOptionFlags *responseFlags);
4390
4391
4392
4393
4394 enum {
4395     kCFUserNotificationStopAlertLevel = 0,
4396     kCFUserNotificationNoteAlertLevel = 1,
4397     kCFUserNotificationCautionAlertLevel = 2,
4398     kCFUserNotificationPlainAlertLevel = 3
4399 };
4400
4401 enum {
4402     kCFUserNotificationDefaultResponse = 0,
4403     kCFUserNotificationAlternateResponse = 1,
4404     kCFUserNotificationOtherResponse = 2,
4405     kCFUserNotificationCancelResponse = 3
4406 };
4407
4408 enum {
4409     kCFUserNotificationNoDefaultButtonFlag = (1 << 5),
4410     kCFUserNotificationUseRadioButtonsFlag = (1 << 6)
4411 };
4412
4413 static __inline__ CFOptionFlags CFUserNotificationCheckBoxChecked(CFIndex i) {return (1 << (8 + i));}
4414 static __inline__ CFOptionFlags CFUserNotificationSecureTextField(CFIndex i) {return (1 << (16 + i));}
4415 static __inline__ CFOptionFlags CFUserNotificationPopUpSelection(CFIndex n) {return (n << 24);}
4416
4417
4418
4419
4420 extern
4421 const CFStringRef kCFUserNotificationIconURLKey;
4422
4423 extern
4424 const CFStringRef kCFUserNotificationSoundURLKey;
4425
4426 extern
4427 const CFStringRef kCFUserNotificationLocalizationURLKey;
4428
4429 extern
4430 const CFStringRef kCFUserNotificationAlertHeaderKey;
4431
4432 extern
4433 const CFStringRef kCFUserNotificationAlertMessageKey;
4434
4435 extern
4436 const CFStringRef kCFUserNotificationDefaultButtonTitleKey;
4437
4438 extern
4439 const CFStringRef kCFUserNotificationAlternateButtonTitleKey;
4440
4441 extern
4442 const CFStringRef kCFUserNotificationOtherButtonTitleKey;
4443
4444 extern
4445 const CFStringRef kCFUserNotificationProgressIndicatorValueKey;
4446
4447 extern
4448 const CFStringRef kCFUserNotificationPopUpTitlesKey;
4449
4450 extern
4451 const CFStringRef kCFUserNotificationTextFieldTitlesKey;
4452
4453 extern
4454 const CFStringRef kCFUserNotificationCheckBoxTitlesKey;
4455
4456 extern
4457 const CFStringRef kCFUserNotificationTextFieldValuesKey;
4458
4459
4460 }
4461
4462
4463 enum {
4464   kClippingCreator = 'drag',
4465   kClippingPictureType = 'clpp',
4466   kClippingTextType = 'clpt',
4467   kClippingSoundType = 'clps',
4468   kClippingUnknownType = 'clpu'
4469 };
4470
4471
4472
4473 enum {
4474   kInternetLocationCreator = 'drag',
4475   kInternetLocationHTTP = 'ilht',
4476   kInternetLocationFTP = 'ilft',
4477   kInternetLocationFile = 'ilfi',
4478   kInternetLocationMail = 'ilma',
4479   kInternetLocationNNTP = 'ilnw',
4480   kInternetLocationAFP = 'ilaf',
4481   kInternetLocationAppleTalk = 'ilat',
4482   kInternetLocationNSL = 'ilns',
4483   kInternetLocationGeneric = 'ilge'
4484 };
4485
4486
4487
4488 enum {
4489   kCustomIconResource = -16455
4490 };
4491
4492
4493
4494
4495
4496
4497 enum {
4498   kCustomBadgeResourceType = 'badg',
4499   kCustomBadgeResourceID = kCustomIconResource,
4500   kCustomBadgeResourceVersion = 0
4501 };
4502
4503 struct CustomBadgeResource {
4504   SInt16 version;
4505   SInt16 customBadgeResourceID;
4506
4507   OSType customBadgeType;
4508   OSType customBadgeCreator;
4509   OSType windowBadgeType;
4510   OSType windowBadgeCreator;
4511
4512   OSType overrideType;
4513   OSType overrideCreator;
4514 };
4515 typedef struct CustomBadgeResource CustomBadgeResource;
4516 typedef CustomBadgeResource * CustomBadgeResourcePtr;
4517 typedef CustomBadgeResourcePtr * CustomBadgeResourceHandle;
4518 enum {
4519   kRoutingResourceType = 'rout',
4520   kRoutingResourceID = 0
4521 };
4522
4523 struct RoutingResourceEntry {
4524   OSType creator;
4525   OSType fileType;
4526   OSType targetFolder;
4527   OSType destinationFolder;
4528   OSType reservedField;
4529 };
4530 typedef struct RoutingResourceEntry RoutingResourceEntry;
4531 typedef RoutingResourceEntry * RoutingResourcePtr;
4532 typedef RoutingResourcePtr * RoutingResourceHandle;
4533
4534
4535 enum {
4536   kContainerFolderAliasType = 'fdrp',
4537   kContainerTrashAliasType = 'trsh',
4538   kContainerHardDiskAliasType = 'hdsk',
4539   kContainerFloppyAliasType = 'flpy',
4540   kContainerServerAliasType = 'srvr',
4541   kApplicationAliasType = 'adrp',
4542   kContainerAliasType = 'drop',
4543   kDesktopPrinterAliasType = 'dtpa',
4544   kContainerCDROMAliasType = 'cddr',
4545   kApplicationCPAliasType = 'acdp',
4546   kApplicationDAAliasType = 'addp',
4547   kPackageAliasType = 'fpka',
4548   kAppPackageAliasType = 'fapa'
4549 };
4550
4551
4552 enum {
4553   kSystemFolderAliasType = 'fasy',
4554   kAppleMenuFolderAliasType = 'faam',
4555   kStartupFolderAliasType = 'fast',
4556   kPrintMonitorDocsFolderAliasType = 'fapn',
4557   kPreferencesFolderAliasType = 'fapf',
4558   kControlPanelFolderAliasType = 'fact',
4559   kExtensionFolderAliasType = 'faex'
4560 };
4561
4562
4563 enum {
4564   kExportedFolderAliasType = 'faet',
4565   kDropFolderAliasType = 'fadr',
4566   kSharedFolderAliasType = 'fash',
4567   kMountedFolderAliasType = 'famn'
4568 };
4569
4570
4571
4572
4573
4574 enum {
4575   kIsOnDesk = 0x0001,
4576   kColor = 0x000E,
4577
4578   kIsShared = 0x0040,
4579
4580
4581
4582   kHasNoINITs = 0x0080,
4583
4584   kHasBeenInited = 0x0100,
4585
4586
4587
4588
4589
4590   kHasCustomIcon = 0x0400,
4591   kIsStationery = 0x0800,
4592   kNameLocked = 0x1000,
4593   kHasBundle = 0x2000,
4594   kIsInvisible = 0x4000,
4595   kIsAlias = 0x8000
4596 };
4597
4598
4599 enum {
4600   fOnDesk = kIsOnDesk,
4601   fHasBundle = kHasBundle,
4602   fInvisible = kIsInvisible
4603 };
4604
4605
4606 enum {
4607   fTrash = -3,
4608   fDesktop = -2,
4609   fDisk = 0
4610 };
4611 enum {
4612   kExtendedFlagsAreInvalid = 0x8000,
4613   kExtendedFlagHasCustomBadge = 0x0100,
4614   kExtendedFlagHasRoutingInfo = 0x0004
4615 };
4616 enum {
4617   kFirstMagicBusyFiletype = 'bzy ',
4618   kLastMagicBusyFiletype = 'bzy?'
4619 };
4620
4621
4622
4623
4624
4625
4626 enum {
4627   kMagicBusyCreationDate = 0x4F3AFDB0
4628 };
4629 struct FileInfo {
4630   OSType fileType;
4631   OSType fileCreator;
4632   UInt16 finderFlags;
4633   Point location;
4634
4635   UInt16 reservedField;
4636 };
4637 typedef struct FileInfo FileInfo;
4638 struct FolderInfo {
4639   Rect windowBounds;
4640   UInt16 finderFlags;
4641   Point location;
4642
4643   UInt16 reservedField;
4644 };
4645 typedef struct FolderInfo FolderInfo;
4646 struct ExtendedFileInfo {
4647   SInt16 reserved1[4];
4648   UInt16 extendedFinderFlags;
4649   SInt16 reserved2;
4650   SInt32 putAwayFolderID;
4651 };
4652 typedef struct ExtendedFileInfo ExtendedFileInfo;
4653 struct ExtendedFolderInfo {
4654   Point scrollPosition;
4655   SInt32 reserved1;
4656   UInt16 extendedFinderFlags;
4657   SInt16 reserved2;
4658   SInt32 putAwayFolderID;
4659 };
4660 typedef struct ExtendedFolderInfo ExtendedFolderInfo;
4661 struct FInfo {
4662   OSType fdType;
4663   OSType fdCreator;
4664   UInt16 fdFlags;
4665   Point fdLocation;
4666
4667   SInt16 fdFldr;
4668 };
4669 typedef struct FInfo FInfo;
4670
4671
4672
4673
4674
4675
4676
4677 struct FXInfo {
4678   SInt16 fdIconID;
4679   SInt16 fdReserved[3];
4680   SInt8 fdScript;
4681   SInt8 fdXFlags;
4682   SInt16 fdComment;
4683   SInt32 fdPutAway;
4684 };
4685 typedef struct FXInfo FXInfo;
4686
4687
4688
4689
4690
4691
4692 struct DInfo {
4693   Rect frRect;
4694   UInt16 frFlags;
4695   Point frLocation;
4696
4697   SInt16 frView;
4698 };
4699 typedef struct DInfo DInfo;
4700
4701
4702
4703
4704
4705
4706
4707 struct DXInfo {
4708   Point frScroll;
4709   SInt32 frOpenChain;
4710   SInt8 frScript;
4711   SInt8 frXFlags;
4712   SInt16 frComment;
4713   SInt32 frPutAway;
4714 };
4715 typedef struct DXInfo DXInfo;
4716
4717
4718
4719
4720
4721 extern "C" {
4722 extern Fixed
4723 FixRatio(
4724   short numer,
4725   short denom) ;
4726 extern Fixed
4727 FixMul(
4728   Fixed a,
4729   Fixed b) ;
4730 extern short
4731 FixRound(Fixed x) ;
4732 extern Fract
4733 Fix2Frac(Fixed x) ;
4734 extern long
4735 Fix2Long(Fixed x) ;
4736 extern Fixed
4737 Long2Fix(long x) ;
4738 extern Fixed
4739 Frac2Fix(Fract x) ;
4740 extern Fract
4741 FracMul(
4742   Fract x,
4743   Fract y) ;
4744 extern Fixed
4745 FixDiv(
4746   Fixed x,
4747   Fixed y) ;
4748 extern Fract
4749 FracDiv(
4750   Fract x,
4751   Fract y) ;
4752 extern Fract
4753 FracSqrt(Fract x) ;
4754 extern Fract
4755 FracSin(Fixed x) ;
4756 extern Fract
4757 FracCos(Fixed x) ;
4758 extern Fixed
4759 FixATan2(
4760   long x,
4761   long y) ;
4762 extern double
4763 Frac2X(Fract x) ;
4764 extern double
4765 Fix2X(Fixed x) ;
4766 extern Fixed
4767 X2Fix(double x) ;
4768 extern Fract
4769 X2Frac(double x) ;
4770 extern short
4771 WideCompare(
4772   const wide * target,
4773   const wide * source) ;
4774 extern wide *
4775 WideAdd(
4776   wide * target,
4777   const wide * source) ;
4778 extern wide *
4779 WideSubtract(
4780   wide * target,
4781   const wide * source) ;
4782 extern wide *
4783 WideNegate(wide * target) ;
4784 extern wide *
4785 WideShift(
4786   wide * target,
4787   long shift) ;
4788 extern unsigned long
4789 WideSquareRoot(const wide * source) ;
4790 extern wide *
4791 WideMultiply(
4792   long multiplicand,
4793   long multiplier,
4794   wide * target) ;
4795 extern long
4796 WideDivide(
4797   const wide * dividend,
4798   long divisor,
4799   long * remainder) ;
4800 extern wide *
4801 WideWideDivide(
4802   wide * dividend,
4803   long divisor,
4804   long * remainder) ;
4805 extern wide *
4806 WideBitShift(
4807   wide * src,
4808   long shift) ;
4809
4810
4811
4812
4813
4814
4815
4816 }
4817
4818
4819
4820
4821 enum {
4822
4823   itlcShowIcon = 7,
4824   itlcDualCaret = 6,
4825
4826   itlcSysDirection = 15
4827 };
4828
4829 enum {
4830
4831   itlcDisableKeyScriptSync = 3
4832 };
4833
4834 enum {
4835
4836   itlcDisableKeyScriptSyncMask = 1 << itlcDisableKeyScriptSync
4837 };
4838
4839
4840 enum {
4841   tokLeftQuote = 1,
4842   tokRightQuote = 2,
4843   tokLeadPlacer = 3,
4844   tokLeader = 4,
4845   tokNonLeader = 5,
4846   tokZeroLead = 6,
4847   tokPercent = 7,
4848   tokPlusSign = 8,
4849   tokMinusSign = 9,
4850   tokThousands = 10,
4851   tokReserved = 11,
4852   tokSeparator = 12,
4853   tokEscape = 13,
4854   tokDecPoint = 14,
4855   tokEPlus = 15,
4856   tokEMinus = 16,
4857   tokMaxSymbols = 31,
4858   curNumberPartsVersion = 1
4859 };
4860
4861 enum {
4862   currSymLead = 16,
4863   currNegSym = 32,
4864   currTrailingZ = 64,
4865   currLeadingZ = 128
4866 };
4867
4868 enum {
4869   mdy = 0,
4870   dmy = 1,
4871   ymd = 2,
4872   myd = 3,
4873   dym = 4,
4874   ydm = 5
4875 };
4876
4877 typedef SInt8 DateOrders;
4878 enum {
4879   timeCycle24 = 0,
4880   timeCycleZero = 1,
4881   timeCycle12 = 255,
4882   zeroCycle = 1,
4883   longDay = 0,
4884   longWeek = 1,
4885   longMonth = 2,
4886   longYear = 3,
4887   supDay = 1,
4888   supWeek = 2,
4889   supMonth = 4,
4890   supYear = 8,
4891   dayLdingZ = 32,
4892   mntLdingZ = 64,
4893   century = 128,
4894   secLeadingZ = 32,
4895   minLeadingZ = 64,
4896   hrLeadingZ = 128
4897 };
4898
4899
4900 struct OffPair {
4901   short offFirst;
4902   short offSecond;
4903 };
4904 typedef struct OffPair OffPair;
4905 typedef OffPair OffsetTable[3];
4906 struct Intl0Rec {
4907   char decimalPt;
4908   char thousSep;
4909   char listSep;
4910   char currSym1;
4911   char currSym2;
4912   char currSym3;
4913   UInt8 currFmt;
4914   UInt8 dateOrder;
4915   UInt8 shrtDateFmt;
4916   char dateSep;
4917   UInt8 timeCycle;
4918   UInt8 timeFmt;
4919   char mornStr[4];
4920   char eveStr[4];
4921   char timeSep;
4922   char time1Suff;
4923   char time2Suff;
4924   char time3Suff;
4925   char time4Suff;
4926   char time5Suff;
4927   char time6Suff;
4928   char time7Suff;
4929   char time8Suff;
4930   UInt8 metricSys;
4931   short intl0Vers;
4932 };
4933 typedef struct Intl0Rec Intl0Rec;
4934 typedef Intl0Rec * Intl0Ptr;
4935 typedef Intl0Ptr * Intl0Hndl;
4936 struct Intl1Rec {
4937   Str15 days[7];
4938   Str15 months[12];
4939   UInt8 suppressDay;
4940   UInt8 lngDateFmt;
4941   UInt8 dayLeading0;
4942   UInt8 abbrLen;
4943   char st0[4];
4944   char st1[4];
4945   char st2[4];
4946   char st3[4];
4947   char st4[4];
4948   short intl1Vers;
4949   short localRtn[1];
4950 };
4951 typedef struct Intl1Rec Intl1Rec;
4952 typedef Intl1Rec * Intl1Ptr;
4953 typedef Intl1Ptr * Intl1Hndl;
4954
4955 struct Itl1ExtRec {
4956   Intl1Rec base;
4957   short version;
4958   short format;
4959   short calendarCode;
4960   long extraDaysTableOffset;
4961   long extraDaysTableLength;
4962   long extraMonthsTableOffset;
4963   long extraMonthsTableLength;
4964   long abbrevDaysTableOffset;
4965   long abbrevDaysTableLength;
4966   long abbrevMonthsTableOffset;
4967   long abbrevMonthsTableLength;
4968   long extraSepsTableOffset;
4969   long extraSepsTableLength;
4970   short tables[1];
4971 };
4972 typedef struct Itl1ExtRec Itl1ExtRec;
4973 struct UntokenTable {
4974   short len;
4975   short lastToken;
4976   short index[256];
4977 };
4978 typedef struct UntokenTable UntokenTable;
4979 typedef UntokenTable * UntokenTablePtr;
4980 typedef UntokenTablePtr * UntokenTableHandle;
4981 union WideChar {
4982   char a[2];
4983   short b;
4984 };
4985 typedef union WideChar WideChar;
4986 struct WideCharArr {
4987   short size;
4988   WideChar data[10];
4989 };
4990 typedef struct WideCharArr WideCharArr;
4991 struct NumberParts {
4992   short version;
4993   WideChar data[31];
4994   WideCharArr pePlus;
4995   WideCharArr peMinus;
4996   WideCharArr peMinusPlus;
4997   WideCharArr altNumTable;
4998   char reserved[20];
4999 };
5000 typedef struct NumberParts NumberParts;
5001 typedef NumberParts * NumberPartsPtr;
5002
5003 struct Itl4Rec {
5004   short flags;
5005   long resourceType;
5006   short resourceNum;
5007   short version;
5008   long resHeader1;
5009   long resHeader2;
5010   short numTables;
5011   long mapOffset;
5012   long strOffset;
5013   long fetchOffset;
5014   long unTokenOffset;
5015   long defPartsOffset;
5016   long resOffset6;
5017   long resOffset7;
5018   long resOffset8;
5019 };
5020 typedef struct Itl4Rec Itl4Rec;
5021 typedef Itl4Rec * Itl4Ptr;
5022 typedef Itl4Ptr * Itl4Handle;
5023
5024 struct NItl4Rec {
5025   short flags;
5026   long resourceType;
5027   short resourceNum;
5028   short version;
5029   short format;
5030   short resHeader;
5031   long resHeader2;
5032   short numTables;
5033   long mapOffset;
5034   long strOffset;
5035   long fetchOffset;
5036   long unTokenOffset;
5037   long defPartsOffset;
5038   long whtSpListOffset;
5039   long resOffset7;
5040   long resOffset8;
5041   short resLength1;
5042   short resLength2;
5043   short resLength3;
5044   short unTokenLength;
5045   short defPartsLength;
5046   short whtSpListLength;
5047   short resLength7;
5048   short resLength8;
5049 };
5050 typedef struct NItl4Rec NItl4Rec;
5051 typedef NItl4Rec * NItl4Ptr;
5052 typedef NItl4Ptr * NItl4Handle;
5053
5054 struct TableDirectoryRecord {
5055   OSType tableSignature;
5056   unsigned long reserved;
5057   unsigned long tableStartOffset;
5058   unsigned long tableSize;
5059 };
5060 typedef struct TableDirectoryRecord TableDirectoryRecord;
5061 struct Itl5Record {
5062   Fixed versionNumber;
5063   unsigned short numberOfTables;
5064   unsigned short reserved[3];
5065   TableDirectoryRecord tableDirectory[1];
5066 };
5067 typedef struct Itl5Record Itl5Record;
5068 struct RuleBasedTrslRecord {
5069   short sourceType;
5070   short targetType;
5071   short formatNumber;
5072   short propertyFlag;
5073   short numberOfRules;
5074 };
5075 typedef struct RuleBasedTrslRecord RuleBasedTrslRecord;
5076
5077 struct ItlcRecord {
5078   short itlcSystem;
5079   short itlcReserved;
5080   SInt8 itlcFontForce;
5081   SInt8 itlcIntlForce;
5082   SInt8 itlcOldKybd;
5083   SInt8 itlcFlags;
5084   short itlcIconOffset;
5085   SInt8 itlcIconSide;
5086   SInt8 itlcIconRsvd;
5087   short itlcRegionCode;
5088   short itlcSysFlags;
5089   SInt8 itlcReserved4[32];
5090 };
5091 typedef struct ItlcRecord ItlcRecord;
5092 struct ItlbRecord {
5093   short itlbNumber;
5094   short itlbDate;
5095   short itlbSort;
5096   short itlbFlags;
5097   short itlbToken;
5098   short itlbEncoding;
5099   short itlbLang;
5100   SInt8 itlbNumRep;
5101   SInt8 itlbDateRep;
5102   short itlbKeys;
5103   short itlbIcon;
5104 };
5105 typedef struct ItlbRecord ItlbRecord;
5106
5107 struct ItlbExtRecord {
5108   ItlbRecord base;
5109   long itlbLocalSize;
5110   short itlbMonoFond;
5111   short itlbMonoSize;
5112   short itlbPrefFond;
5113   short itlbPrefSize;
5114   short itlbSmallFond;
5115   short itlbSmallSize;
5116   short itlbSysFond;
5117   short itlbSysSize;
5118   short itlbAppFond;
5119   short itlbAppSize;
5120   short itlbHelpFond;
5121   short itlbHelpSize;
5122   Style itlbValidStyles;
5123   Style itlbAliasStyle;
5124 };
5125 typedef struct ItlbExtRecord ItlbExtRecord;
5126
5127
5128
5129 extern "C" {
5130
5131
5132
5133
5134 enum {
5135   smSystemScript = -1,
5136   smCurrentScript = -2,
5137   smAllScripts = -3
5138 };
5139 enum {
5140   smRoman = 0,
5141   smJapanese = 1,
5142   smTradChinese = 2,
5143   smKorean = 3,
5144   smArabic = 4,
5145   smHebrew = 5,
5146   smGreek = 6,
5147   smCyrillic = 7,
5148   smRSymbol = 8,
5149   smDevanagari = 9,
5150   smGurmukhi = 10,
5151   smGujarati = 11,
5152   smOriya = 12,
5153   smBengali = 13,
5154   smTamil = 14,
5155   smTelugu = 15,
5156   smKannada = 16,
5157   smMalayalam = 17,
5158   smSinhalese = 18,
5159   smBurmese = 19,
5160   smKhmer = 20,
5161   smThai = 21,
5162   smLao = 22,
5163   smGeorgian = 23,
5164   smArmenian = 24,
5165   smSimpChinese = 25,
5166   smTibetan = 26,
5167   smMongolian = 27,
5168   smEthiopic = 28,
5169   smGeez = 28,
5170   smCentralEuroRoman = 29,
5171   smVietnamese = 30,
5172   smExtArabic = 31,
5173   smUninterp = 32
5174 };
5175
5176
5177 enum {
5178   smUnicodeScript = 0x7E
5179 };
5180
5181
5182 enum {
5183   smChinese = 2,
5184   smRussian = 7,
5185
5186   smLaotian = 22,
5187   smAmharic = 28,
5188   smSlavic = 29,
5189   smEastEurRoman = 29,
5190   smSindhi = 31,
5191   smKlingon = 32
5192 };
5193
5194
5195
5196
5197
5198
5199 enum {
5200   langEnglish = 0,
5201   langFrench = 1,
5202   langGerman = 2,
5203   langItalian = 3,
5204   langDutch = 4,
5205   langSwedish = 5,
5206   langSpanish = 6,
5207   langDanish = 7,
5208   langPortuguese = 8,
5209   langNorwegian = 9,
5210   langHebrew = 10,
5211   langJapanese = 11,
5212   langArabic = 12,
5213   langFinnish = 13,
5214   langGreek = 14,
5215   langIcelandic = 15,
5216   langMaltese = 16,
5217   langTurkish = 17,
5218   langCroatian = 18,
5219   langTradChinese = 19,
5220   langUrdu = 20,
5221   langHindi = 21,
5222   langThai = 22,
5223   langKorean = 23
5224 };
5225
5226 enum {
5227   langLithuanian = 24,
5228   langPolish = 25,
5229   langHungarian = 26,
5230   langEstonian = 27,
5231   langLatvian = 28,
5232   langSami = 29,
5233   langFaroese = 30,
5234   langFarsi = 31,
5235   langPersian = 31,
5236   langRussian = 32,
5237   langSimpChinese = 33,
5238   langFlemish = 34,
5239   langIrishGaelic = 35,
5240   langAlbanian = 36,
5241   langRomanian = 37,
5242   langCzech = 38,
5243   langSlovak = 39,
5244   langSlovenian = 40,
5245   langYiddish = 41,
5246   langSerbian = 42,
5247   langMacedonian = 43,
5248   langBulgarian = 44,
5249   langUkrainian = 45,
5250   langByelorussian = 46,
5251   langBelorussian = 46
5252 };
5253
5254 enum {
5255   langUzbek = 47,
5256   langKazakh = 48,
5257   langAzerbaijani = 49,
5258   langAzerbaijanAr = 50,
5259   langArmenian = 51,
5260   langGeorgian = 52,
5261   langMoldavian = 53,
5262   langKirghiz = 54,
5263   langTajiki = 55,
5264   langTurkmen = 56,
5265   langMongolian = 57,
5266   langMongolianCyr = 58,
5267   langPashto = 59,
5268   langKurdish = 60,
5269   langKashmiri = 61,
5270   langSindhi = 62,
5271   langTibetan = 63,
5272   langNepali = 64,
5273   langSanskrit = 65,
5274   langMarathi = 66,
5275   langBengali = 67,
5276   langAssamese = 68,
5277   langGujarati = 69,
5278   langPunjabi = 70
5279 };
5280
5281 enum {
5282   langOriya = 71,
5283   langMalayalam = 72,
5284   langKannada = 73,
5285   langTamil = 74,
5286   langTelugu = 75,
5287   langSinhalese = 76,
5288   langBurmese = 77,
5289   langKhmer = 78,
5290   langLao = 79,
5291   langVietnamese = 80,
5292   langIndonesian = 81,
5293   langTagalog = 82,
5294   langMalayRoman = 83,
5295   langMalayArabic = 84,
5296   langAmharic = 85,
5297   langTigrinya = 86,
5298   langOromo = 87,
5299   langSomali = 88,
5300   langSwahili = 89,
5301   langKinyarwanda = 90,
5302   langRuanda = 90,
5303   langRundi = 91,
5304   langNyanja = 92,
5305   langChewa = 92,
5306   langMalagasy = 93,
5307   langEsperanto = 94
5308 };
5309
5310 enum {
5311   langWelsh = 128,
5312   langBasque = 129,
5313   langCatalan = 130,
5314   langLatin = 131,
5315   langQuechua = 132,
5316   langGuarani = 133,
5317   langAymara = 134,
5318   langTatar = 135,
5319   langUighur = 136,
5320   langDzongkha = 137,
5321   langJavaneseRom = 138,
5322   langSundaneseRom = 139,
5323   langGalician = 140,
5324   langAfrikaans = 141
5325 };
5326
5327 enum {
5328   langBreton = 142,
5329   langInuktitut = 143,
5330   langScottishGaelic = 144,
5331   langManxGaelic = 145,
5332   langIrishGaelicScript = 146,
5333   langTongan = 147,
5334   langGreekPoly = 148,
5335   langGreenlandic = 149,
5336   langAzerbaijanRoman = 150
5337 };
5338
5339 enum {
5340   langUnspecified = 32767
5341 };
5342
5343
5344
5345
5346
5347 enum {
5348   langPortugese = 8,
5349   langMalta = 16,
5350   langYugoslavian = 18,
5351   langChinese = 19,
5352   langLettish = 28,
5353   langLapponian = 29,
5354   langLappish = 29,
5355   langSaamisk = 29,
5356   langFaeroese = 30,
5357   langIrish = 35,
5358   langGalla = 87,
5359   langAfricaans = 141
5360 };
5361 enum {
5362
5363   verUS = 0,
5364   verFrance = 1,
5365   verBritain = 2,
5366   verGermany = 3,
5367   verItaly = 4,
5368   verNetherlands = 5,
5369   verFlemish = 6,
5370   verSweden = 7,
5371   verSpain = 8,
5372   verDenmark = 9,
5373   verPortugal = 10,
5374   verFrCanada = 11,
5375   verNorway = 12,
5376   verIsrael = 13,
5377   verJapan = 14,
5378   verAustralia = 15,
5379   verArabic = 16,
5380   verFinland = 17,
5381   verFrSwiss = 18,
5382   verGrSwiss = 19,
5383   verGreece = 20,
5384   verIceland = 21,
5385   verMalta = 22,
5386   verCyprus = 23,
5387   verTurkey = 24,
5388   verYugoCroatian = 25
5389 };
5390
5391 enum {
5392   verNetherlandsComma = 26,
5393   verBelgiumLuxPoint = 27,
5394   verCanadaComma = 28,
5395   verCanadaPoint = 29,
5396   vervariantPortugal = 30,
5397   vervariantNorway = 31,
5398   vervariantDenmark = 32
5399 };
5400
5401 enum {
5402   verIndiaHindi = 33,
5403   verPakistanUrdu = 34,
5404   verTurkishModified = 35,
5405   verItalianSwiss = 36,
5406   verInternational = 37,
5407
5408   verRomania = 39,
5409   verGreecePoly = 40,
5410   verLithuania = 41,
5411   verPoland = 42,
5412   verHungary = 43,
5413   verEstonia = 44,
5414   verLatvia = 45,
5415   verSami = 46,
5416   verFaroeIsl = 47,
5417   verIran = 48,
5418   verRussia = 49,
5419   verIreland = 50,
5420   verKorea = 51,
5421   verChina = 52,
5422   verTaiwan = 53,
5423   verThailand = 54,
5424   verScriptGeneric = 55,
5425   verCzech = 56,
5426   verSlovak = 57,
5427   verFarEastGeneric = 58,
5428   verMagyar = 59,
5429   verBengali = 60,
5430   verByeloRussian = 61
5431 };
5432
5433 enum {
5434   verUkraine = 62,
5435
5436   verGreeceAlt = 64,
5437   verSerbian = 65,
5438   verSlovenian = 66,
5439   verMacedonian = 67,
5440   verCroatia = 68,
5441
5442   verGermanReformed = 70,
5443   verBrazil = 71,
5444   verBulgaria = 72,
5445   verCatalonia = 73,
5446   verMultilingual = 74,
5447   verScottishGaelic = 75,
5448   verManxGaelic = 76,
5449   verBreton = 77,
5450   verNunavut = 78,
5451   verWelsh = 79,
5452
5453   verIrishGaelicScript = 81,
5454   verEngCanada = 82,
5455   verBhutan = 83,
5456   verArmenian = 84,
5457   verGeorgian = 85,
5458   verSpLatinAmerica = 86,
5459
5460   verTonga = 88,
5461
5462
5463   verFrenchUniversal = 91,
5464   verAustria = 92,
5465
5466   verGujarati = 94,
5467   verPunjabi = 95,
5468   verIndiaUrdu = 96,
5469   verVietnam = 97
5470 };
5471
5472 enum {
5473   verFrBelgium = 98,
5474   verUzbek = 99,
5475   verSingapore = 100,
5476   verNynorsk = 101,
5477   verAfrikaans = 102,
5478   verEsperanto = 103,
5479   verMarathi = 104,
5480   verTibetan = 105,
5481   verNepal = 106,
5482   verGreenland = 107,
5483   verIrelandEnglish = 108
5484 };
5485 enum {
5486   verFrBelgiumLux = 6,
5487   verBelgiumLux = 6,
5488   verArabia = 16,
5489   verYugoslavia = 25,
5490   verIndia = 33,
5491   verPakistan = 34,
5492   verRumania = 39,
5493   verGreekAncient = 40,
5494   verLapland = 46,
5495   verFaeroeIsl = 47,
5496   verGenericFE = 58,
5497   verBelarus = 61,
5498   verUkrania = 62,
5499   verAlternateGr = 64,
5500   verSerbia = 65,
5501   verSlovenia = 66,
5502   verMacedonia = 67,
5503   verBrittany = 77,
5504   verWales = 79,
5505   verArmenia = 84,
5506   verGeorgia = 85,
5507   verAustriaGerman = 92,
5508   verTibet = 105
5509 };
5510
5511 enum {
5512   minCountry = verUS,
5513   maxCountry = verGreenland
5514 };
5515
5516 enum {
5517
5518   calGregorian = 0,
5519   calArabicCivil = 1,
5520   calArabicLunar = 2,
5521   calJapanese = 3,
5522   calJewish = 4,
5523   calCoptic = 5,
5524   calPersian = 6
5525 };
5526
5527 enum {
5528
5529   intWestern = 0,
5530   intArabic = 1,
5531   intRoman = 2,
5532   intJapanese = 3,
5533   intEuropean = 4,
5534   intOutputMask = 0x8000
5535 };
5536
5537 enum {
5538
5539   smSingleByte = 0,
5540   smFirstByte = -1,
5541   smLastByte = 1,
5542   smMiddleByte = 2
5543 };
5544
5545 enum {
5546
5547   smcTypeMask = 0x000F,
5548   smcReserved = 0x00F0,
5549   smcClassMask = 0x0F00,
5550   smcOrientationMask = 0x1000,
5551   smcRightMask = 0x2000,
5552   smcUpperMask = 0x4000,
5553   smcDoubleMask = 0x8000
5554 };
5555
5556 enum {
5557
5558   smCharPunct = 0x0000,
5559   smCharAscii = 0x0001,
5560   smCharEuro = 0x0007,
5561   smCharExtAscii = 0x0007,
5562
5563   smCharKatakana = 0x0002,
5564   smCharHiragana = 0x0003,
5565   smCharIdeographic = 0x0004,
5566   smCharTwoByteGreek = 0x0005,
5567   smCharTwoByteRussian = 0x0006,
5568   smCharBidirect = 0x0008,
5569   smCharContextualLR = 0x0009,
5570   smCharNonContextualLR = 0x000A,
5571   smCharHangul = 0x000C,
5572   smCharJamo = 0x000D,
5573   smCharBopomofo = 0x000E,
5574   smCharGanaKana = 0x000F,
5575
5576   smCharFISKana = 0x0002,
5577   smCharFISGana = 0x0003,
5578   smCharFISIdeo = 0x0004
5579 };
5580
5581 enum {
5582   smCharFISGreek = 0x0005,
5583   smCharFISRussian = 0x0006,
5584
5585   smPunctNormal = 0x0000,
5586   smPunctNumber = 0x0100,
5587   smPunctSymbol = 0x0200,
5588   smPunctBlank = 0x0300,
5589   smPunctRepeat = 0x0400,
5590   smPunctGraphic = 0x0500,
5591
5592   smKanaSmall = 0x0100,
5593   smKanaHardOK = 0x0200,
5594   smKanaSoftOK = 0x0300,
5595
5596   smIdeographicLevel1 = 0x0000,
5597   smIdeographicLevel2 = 0x0100,
5598   smIdeographicUser = 0x0200,
5599
5600   smFISClassLvl1 = 0x0000,
5601   smFISClassLvl2 = 0x0100,
5602   smFISClassUser = 0x0200,
5603
5604   smJamoJaeum = 0x0000,
5605   smJamoBogJaeum = 0x0100,
5606   smJamoMoeum = 0x0200,
5607   smJamoBogMoeum = 0x0300
5608 };
5609
5610 enum {
5611
5612   smCharHorizontal = 0x0000,
5613   smCharVertical = 0x1000,
5614
5615   smCharLeft = 0x0000,
5616   smCharRight = 0x2000,
5617   smCharLower = 0x0000,
5618   smCharUpper = 0x4000,
5619   smChar1byte = 0x0000,
5620   smChar2byte = 0x8000
5621 };
5622
5623 enum {
5624
5625   smTransAscii = 0,
5626   smTransNative = 1,
5627   smTransCase = 0xFE,
5628   smTransSystem = 0xFF,
5629
5630   smTransAscii1 = 2,
5631   smTransAscii2 = 3,
5632   smTransKana1 = 4,
5633   smTransKana2 = 5
5634 };
5635
5636 enum {
5637   smTransGana2 = 7,
5638   smTransHangul2 = 8,
5639   smTransJamo2 = 9,
5640   smTransBopomofo2 = 10,
5641
5642   smTransLower = 0x4000,
5643   smTransUpper = 0x8000,
5644
5645   smTransRuleBaseFormat = 1,
5646   smTransHangulFormat = 2,
5647
5648   smTransPreDoubleByting = 1,
5649   smTransPreLowerCasing = 2
5650 };
5651
5652 enum {
5653
5654   smMaskAll = (long)0xFFFFFFFF,
5655
5656   smMaskAscii = 0x00000001,
5657   smMaskNative = 0x00000002,
5658
5659   smMaskAscii1 = 0x00000004,
5660   smMaskAscii2 = 0x00000008,
5661   smMaskKana1 = 0x00000010,
5662   smMaskKana2 = 0x00000020,
5663   smMaskGana2 = 0x00000080,
5664   smMaskHangul2 = 0x00000100,
5665   smMaskJamo2 = 0x00000200,
5666   smMaskBopomofo2 = 0x00000400
5667 };
5668
5669 enum {
5670
5671   smNotInstalled = 0,
5672   smBadVerb = -1,
5673   smBadScript = -2
5674 };
5675
5676 enum {
5677
5678   smRedrawChar = 0,
5679   smRedrawWord = 1,
5680   smRedrawLine = -1
5681 };
5682
5683 enum {
5684
5685   smVersion = 0,
5686   smMunged = 2,
5687   smEnabled = 4,
5688   smBidirect = 6,
5689   smFontForce = 8,
5690   smIntlForce = 10,
5691   smForced = 12,
5692   smDefault = 14,
5693   smPrint = 16,
5694   smSysScript = 18,
5695   smLastScript = 20,
5696   smKeyScript = 22,
5697   smSysRef = 24,
5698   smKeyCache = 26,
5699   smKeySwap = 28,
5700   smGenFlags = 30,
5701   smOverride = 32,
5702   smCharPortion = 34,
5703
5704   smDoubleByte = 36,
5705   smKCHRCache = 38,
5706   smRegionCode = 40,
5707   smKeyDisableState = 42
5708 };
5709
5710 enum {
5711
5712
5713
5714   smScriptVersion = 0,
5715   smScriptMunged = 2,
5716   smScriptEnabled = 4,
5717   smScriptRight = 6,
5718   smScriptJust = 8,
5719   smScriptRedraw = 10,
5720   smScriptSysFond = 12,
5721   smScriptAppFond = 14,
5722   smScriptBundle = 16,
5723   smScriptNumber = 16,
5724   smScriptDate = 18,
5725   smScriptSort = 20,
5726   smScriptFlags = 22,
5727   smScriptToken = 24,
5728   smScriptEncoding = 26,
5729   smScriptLang = 28
5730 };
5731
5732 enum {
5733   smScriptNumDate = 30,
5734   smScriptKeys = 32,
5735   smScriptIcon = 34,
5736   smScriptPrint = 36,
5737   smScriptTrap = 38,
5738   smScriptCreator = 40,
5739   smScriptFile = 42,
5740   smScriptName = 44,
5741
5742
5743   smScriptMonoFondSize = 78,
5744   smScriptPrefFondSize = 80,
5745   smScriptSmallFondSize = 82,
5746   smScriptSysFondSize = 84,
5747   smScriptAppFondSize = 86,
5748   smScriptHelpFondSize = 88,
5749   smScriptValidStyles = 90,
5750   smScriptAliasStyle = 92
5751 };
5752
5753
5754
5755 enum {
5756
5757   smLayoutCache = -309,
5758   smOldVerbSupport = -311,
5759   smSetKashidas = -291,
5760   smSetKashProp = -287,
5761   smScriptSysBase = -281,
5762   smScriptAppBase = -283,
5763   smScriptFntBase = -285,
5764   smScriptLigatures = -263,
5765   smScriptNumbers = -267
5766 };
5767
5768 enum {
5769
5770   iuSystemScript = -1,
5771   iuCurrentScript = -2
5772 };
5773
5774 enum {
5775
5776   smKeyNextScript = -1,
5777   smKeySysScript = -2,
5778   smKeySwapScript = -3,
5779
5780   smKeyNextKybd = -4,
5781   smKeySwapKybd = -5,
5782   smKeyDisableKybds = -6,
5783   smKeyEnableKybds = -7,
5784   smKeyToggleInline = -8,
5785   smKeyToggleDirection = -9,
5786   smKeyNextInputMethod = -10,
5787   smKeySwapInputMethod = -11,
5788   smKeyDisableKybdSwitch = -12,
5789   smKeySetDirLeftRight = -15,
5790   smKeySetDirRightLeft = -16,
5791   smKeyRoman = -17
5792 };
5793
5794
5795 enum {
5796
5797   smfDisableKeyScriptSync = 27
5798 };
5799
5800 enum {
5801
5802   smfDisableKeyScriptSyncMask = 1L << smfDisableKeyScriptSync
5803 };
5804
5805 enum {
5806
5807   smKeyForceKeyScriptBit = 7,
5808   smKeyForceKeyScriptMask = 1 << smKeyForceKeyScriptBit
5809 };
5810
5811 enum {
5812
5813
5814   smsfIntellCP = 0,
5815   smsfSingByte = 1,
5816   smsfNatCase = 2,
5817   smsfContext = 3,
5818   smsfNoForceFont = 4,
5819   smsfB0Digits = 5,
5820   smsfAutoInit = 6,
5821   smsfUnivExt = 7,
5822   smsfSynchUnstyledTE = 8,
5823   smsfForms = 13,
5824   smsfLigatures = 14,
5825   smsfReverse = 15,
5826
5827
5828   smfShowIcon = 31,
5829   smfDualCaret = 30,
5830   smfNameTagEnab = 29,
5831   smfUseAssocFontInfo = 28
5832 };
5833
5834 enum {
5835
5836
5837
5838   romanSysFond = 0x3FFF,
5839   romanAppFond = 3,
5840   romanFlags = 0x0007,
5841
5842   smFondStart = 0x4000,
5843   smFondEnd = 0xC000,
5844
5845   smUprHalfCharSet = 0x80
5846 };
5847
5848 enum {
5849
5850   diaeresisUprY = 0xD9,
5851   fraction = 0xDA,
5852   intlCurrency = 0xDB,
5853   leftSingGuillemet = 0xDC,
5854   rightSingGuillemet = 0xDD,
5855   fiLigature = 0xDE,
5856   flLigature = 0xDF,
5857   dblDagger = 0xE0,
5858   centeredDot = 0xE1,
5859   baseSingQuote = 0xE2,
5860   baseDblQuote = 0xE3,
5861   perThousand = 0xE4,
5862   circumflexUprA = 0xE5,
5863   circumflexUprE = 0xE6,
5864   acuteUprA = 0xE7,
5865   diaeresisUprE = 0xE8,
5866   graveUprE = 0xE9,
5867   acuteUprI = 0xEA,
5868   circumflexUprI = 0xEB,
5869   diaeresisUprI = 0xEC,
5870   graveUprI = 0xED,
5871   acuteUprO = 0xEE,
5872   circumflexUprO = 0xEF,
5873   appleLogo = 0xF0,
5874   graveUprO = 0xF1,
5875   acuteUprU = 0xF2,
5876   circumflexUprU = 0xF3,
5877   graveUprU = 0xF4,
5878   dotlessLwrI = 0xF5,
5879   circumflex = 0xF6,
5880   tilde = 0xF7,
5881   macron = 0xF8,
5882   breveMark = 0xF9,
5883   overDot = 0xFA,
5884   ringMark = 0xFB,
5885   cedilla = 0xFC,
5886   doubleAcute = 0xFD,
5887   ogonek = 0xFE,
5888   hachek = 0xFF
5889 };
5890
5891 enum {
5892
5893   tokenIntl = 4,
5894   tokenEmpty = -1
5895 };
5896
5897 enum {
5898   tokenUnknown = 0,
5899   tokenWhite = 1,
5900   tokenLeftLit = 2,
5901   tokenRightLit = 3,
5902   tokenAlpha = 4,
5903   tokenNumeric = 5,
5904   tokenNewLine = 6,
5905   tokenLeftComment = 7,
5906   tokenRightComment = 8,
5907   tokenLiteral = 9,
5908   tokenEscape = 10,
5909   tokenAltNum = 11,
5910   tokenRealNum = 12,
5911   tokenAltReal = 13,
5912   tokenReserve1 = 14,
5913   tokenReserve2 = 15,
5914   tokenLeftParen = 16,
5915   tokenRightParen = 17,
5916   tokenLeftBracket = 18,
5917   tokenRightBracket = 19
5918 };
5919
5920 enum {
5921   tokenLeftCurly = 20,
5922   tokenRightCurly = 21,
5923   tokenLeftEnclose = 22,
5924   tokenRightEnclose = 23,
5925   tokenPlus = 24,
5926   tokenMinus = 25,
5927   tokenAsterisk = 26,
5928   tokenDivide = 27,
5929   tokenPlusMinus = 28,
5930   tokenSlash = 29,
5931   tokenBackSlash = 30,
5932   tokenLess = 31,
5933   tokenGreat = 32,
5934   tokenEqual = 33,
5935   tokenLessEqual2 = 34,
5936   tokenLessEqual1 = 35,
5937   tokenGreatEqual2 = 36,
5938   tokenGreatEqual1 = 37,
5939   token2Equal = 38,
5940   tokenColonEqual = 39
5941 };
5942
5943 enum {
5944   tokenNotEqual = 40,
5945   tokenLessGreat = 41,
5946   tokenExclamEqual = 42,
5947   tokenExclam = 43,
5948   tokenTilde = 44,
5949   tokenComma = 45,
5950   tokenPeriod = 46,
5951   tokenLeft2Quote = 47,
5952   tokenRight2Quote = 48,
5953   tokenLeft1Quote = 49,
5954   tokenRight1Quote = 50,
5955   token2Quote = 51,
5956   token1Quote = 52,
5957   tokenSemicolon = 53,
5958   tokenPercent = 54,
5959   tokenCaret = 55,
5960   tokenUnderline = 56,
5961   tokenAmpersand = 57,
5962   tokenAtSign = 58,
5963   tokenBar = 59
5964 };
5965
5966 enum {
5967   tokenQuestion = 60,
5968   tokenPi = 61,
5969   tokenRoot = 62,
5970   tokenSigma = 63,
5971   tokenIntegral = 64,
5972   tokenMicro = 65,
5973   tokenCapPi = 66,
5974   tokenInfinity = 67,
5975   tokenColon = 68,
5976   tokenHash = 69,
5977   tokenDollar = 70,
5978   tokenNoBreakSpace = 71,
5979   tokenFraction = 72,
5980   tokenIntlCurrency = 73,
5981   tokenLeftSingGuillemet = 74,
5982   tokenRightSingGuillemet = 75,
5983   tokenPerThousand = 76,
5984   tokenEllipsis = 77,
5985   tokenCenterDot = 78,
5986   tokenNil = 127
5987 };
5988
5989 enum {
5990   delimPad = -2,
5991   tokenTilda = 44,
5992   tokenCarat = 55
5993 };
5994
5995 enum {
5996
5997   smWordSelectTable = 0,
5998   smWordWrapTable = 1,
5999   smNumberPartsTable = 2,
6000   smUnTokenTable = 3,
6001   smWhiteSpaceList = 4,
6002   iuWordSelectTable = 0,
6003   iuWordWrapTable = 1,
6004   iuNumberPartsTable = 2,
6005   iuUnTokenTable = 3,
6006   iuWhiteSpaceList = 4
6007 };
6008
6009
6010 enum {
6011   tokenOK = 0,
6012   tokenOverflow = 1,
6013   stringOverflow = 2,
6014   badDelim = 3,
6015   badEnding = 4,
6016   crash = 5
6017 };
6018
6019 typedef SInt8 TokenResults;
6020 typedef char CharByteTable[256];
6021
6022 typedef short ScriptTokenType;
6023 typedef ScriptTokenType DelimType[2];
6024 typedef ScriptTokenType CommentType[4];
6025 struct TokenRec {
6026   ScriptTokenType theToken;
6027   Ptr position;
6028   long length;
6029   StringPtr stringPosition;
6030 };
6031 typedef struct TokenRec TokenRec;
6032 typedef TokenRec * TokenRecPtr;
6033 struct TokenBlock {
6034   Ptr source;
6035   long sourceLength;
6036   Ptr tokenList;
6037   long tokenLength;
6038   long tokenCount;
6039   Ptr stringList;
6040   long stringLength;
6041   long stringCount;
6042   Boolean doString;
6043   Boolean doAppend;
6044   Boolean doAlphanumeric;
6045   Boolean doNest;
6046   ScriptTokenType leftDelims[2];
6047   ScriptTokenType rightDelims[2];
6048   ScriptTokenType leftComment[4];
6049   ScriptTokenType rightComment[4];
6050   ScriptTokenType escapeCode;
6051   ScriptTokenType decimalCode;
6052   Handle itlResource;
6053   long reserved[8];
6054 };
6055 typedef struct TokenBlock TokenBlock;
6056 typedef TokenBlock * TokenBlockPtr;
6057 extern short
6058 GetSysDirection(void) ;
6059 extern void
6060 SetSysDirection(short value) ;
6061 extern short
6062 FontScript(void) ;
6063 extern short
6064 IntlScript(void) ;
6065 extern short
6066 FontToScript(short fontNumber) ;
6067 extern long
6068 GetScriptManagerVariable(short selector) ;
6069 extern OSErr
6070 SetScriptManagerVariable(
6071   short selector,
6072   long param) ;
6073 extern long
6074 GetScriptVariable(
6075   short script,
6076   short selector) ;
6077 extern OSErr
6078 SetScriptVariable(
6079   short script,
6080   short selector,
6081   long param) ;
6082 extern short
6083 CharacterByteType(
6084   Ptr textBuf,
6085   short textOffset,
6086   ScriptCode script) ;
6087 extern short
6088 CharacterType(
6089   Ptr textBuf,
6090   short textOffset,
6091   ScriptCode script) ;
6092 extern OSErr
6093 TransliterateText(
6094   Handle srcHandle,
6095   Handle dstHandle,
6096   short target,
6097   long srcMask,
6098   ScriptCode script) ;
6099 extern Boolean
6100 FillParseTable(
6101   CharByteTable table,
6102   ScriptCode script) ;
6103 extern Handle
6104 GetIntlResource(short theID) ;
6105 extern void
6106 ClearIntlResourceCache(void) ;
6107 extern void
6108 GetIntlResourceTable(
6109   ScriptCode script,
6110   short tableCode,
6111   Handle * itlHandle,
6112   long * offset,
6113   long * length) ;
6114 extern TokenResults
6115 IntlTokenize(TokenBlockPtr tokenParam) ;
6116
6117
6118 }
6119
6120
6121
6122 extern "C" {
6123
6124
6125 enum {
6126   paramErr = -50,
6127   noHardwareErr = -200,
6128   notEnoughHardwareErr = -201,
6129   userCanceledErr = -128,
6130   qErr = -1,
6131   vTypErr = -2,
6132   corErr = -3,
6133   unimpErr = -4,
6134   SlpTypeErr = -5,
6135   seNoDB = -8,
6136   controlErr = -17,
6137   statusErr = -18,
6138   readErr = -19,
6139   writErr = -20,
6140   badUnitErr = -21,
6141   unitEmptyErr = -22,
6142   openErr = -23,
6143   closErr = -24,
6144   dRemovErr = -25,
6145   dInstErr = -26
6146 };
6147
6148 enum {
6149   abortErr = -27,
6150   iIOAbortErr = -27,
6151   notOpenErr = -28,
6152   unitTblFullErr = -29,
6153   dceExtErr = -30,
6154   slotNumErr = -360,
6155   gcrOnMFMErr = -400,
6156   dirFulErr = -33,
6157   dskFulErr = -34,
6158   nsvErr = -35,
6159   ioErr = -36,
6160   bdNamErr = -37,
6161   fnOpnErr = -38,
6162   eofErr = -39,
6163   posErr = -40,
6164   mFulErr = -41,
6165   tmfoErr = -42,
6166   fnfErr = -43,
6167   wPrErr = -44,
6168   fLckdErr = -45
6169 };
6170
6171 enum {
6172   vLckdErr = -46,
6173   fBsyErr = -47,
6174   dupFNErr = -48,
6175   opWrErr = -49,
6176   rfNumErr = -51,
6177   gfpErr = -52,
6178   volOffLinErr = -53,
6179   permErr = -54,
6180   volOnLinErr = -55,
6181   nsDrvErr = -56,
6182   noMacDskErr = -57,
6183   extFSErr = -58,
6184   fsRnErr = -59,
6185   badMDBErr = -60,
6186   wrPermErr = -61,
6187   dirNFErr = -120,
6188   tmwdoErr = -121,
6189   badMovErr = -122,
6190   wrgVolTypErr = -123,
6191   volGoneErr = -124
6192 };
6193
6194 enum {
6195   fidNotFound = -1300,
6196   fidExists = -1301,
6197   notAFileErr = -1302,
6198   diffVolErr = -1303,
6199   catChangedErr = -1304,
6200   desktopDamagedErr = -1305,
6201   sameFileErr = -1306,
6202   badFidErr = -1307,
6203   notARemountErr = -1308,
6204   fileBoundsErr = -1309,
6205   fsDataTooBigErr = -1310,
6206   volVMBusyErr = -1311,
6207   badFCBErr = -1327,
6208   errFSUnknownCall = -1400,
6209   errFSBadFSRef = -1401,
6210   errFSBadForkName = -1402,
6211   errFSBadBuffer = -1403,
6212   errFSBadForkRef = -1404,
6213   errFSBadInfoBitmap = -1405,
6214   errFSMissingCatInfo = -1406,
6215   errFSNotAFolder = -1407,
6216   errFSForkNotFound = -1409,
6217   errFSNameTooLong = -1410,
6218   errFSMissingName = -1411,
6219   errFSBadPosMode = -1412,
6220   errFSBadAllocFlags = -1413,
6221   errFSNoMoreItems = -1417,
6222   errFSBadItemCount = -1418,
6223   errFSBadSearchParams = -1419,
6224   errFSRefsDifferent = -1420,
6225   errFSForkExists = -1421,
6226   errFSBadIteratorFlags = -1422,
6227   errFSIteratorNotFound = -1423,
6228   errFSIteratorNotSupported = -1424,
6229   errFSQuotaExceeded = -1425,
6230   envNotPresent = -5500,
6231   envBadVers = -5501,
6232   envVersTooBig = -5502,
6233   fontDecError = -64,
6234   fontNotDeclared = -65,
6235   fontSubErr = -66,
6236   fontNotOutlineErr = -32615,
6237   firstDskErr = -84,
6238   lastDskErr = -64,
6239   noDriveErr = -64,
6240   offLinErr = -65,
6241   noNybErr = -66
6242 };
6243
6244 enum {
6245   noAdrMkErr = -67,
6246   dataVerErr = -68,
6247   badCksmErr = -69,
6248   badBtSlpErr = -70,
6249   noDtaMkErr = -71,
6250   badDCksum = -72,
6251   badDBtSlp = -73,
6252   wrUnderrun = -74,
6253   cantStepErr = -75,
6254   tk0BadErr = -76,
6255   initIWMErr = -77,
6256   twoSideErr = -78,
6257   spdAdjErr = -79,
6258   seekErr = -80,
6259   sectNFErr = -81,
6260   fmt1Err = -82,
6261   fmt2Err = -83,
6262   verErr = -84,
6263   clkRdErr = -85,
6264   clkWrErr = -86,
6265   prWrErr = -87,
6266   prInitErr = -88,
6267   rcvrErr = -89,
6268   breakRecd = -90
6269 };
6270
6271 enum {
6272
6273   noScrapErr = -100,
6274   noTypeErr = -102
6275 };
6276
6277 enum {
6278
6279   eLenErr = -92,
6280   eMultiErr = -91
6281 };
6282
6283 enum {
6284   ddpSktErr = -91,
6285   ddpLenErr = -92,
6286   noBridgeErr = -93,
6287   lapProtErr = -94,
6288   excessCollsns = -95,
6289   portNotPwr = -96,
6290   portInUse = -97,
6291   portNotCf = -98
6292 };
6293
6294 enum {
6295
6296   memROZWarn = -99,
6297   memROZError = -99,
6298   memROZErr = -99,
6299   memFullErr = -108,
6300   nilHandleErr = -109,
6301   memWZErr = -111,
6302   memPurErr = -112,
6303   memAdrErr = -110,
6304   memAZErr = -113,
6305   memPCErr = -114,
6306   memBCErr = -115,
6307   memSCErr = -116,
6308   memLockedErr = -117
6309 };
6310
6311 enum {
6312
6313   iMemFullErr = -108,
6314   iIOAbort = -27
6315 };
6316
6317
6318 enum {
6319   resourceInMemory = -188,
6320   writingPastEnd = -189,
6321   inputOutOfBounds = -190,
6322   resNotFound = -192,
6323   resFNotFound = -193,
6324   addResFailed = -194,
6325   addRefFailed = -195,
6326   rmvResFailed = -196,
6327   rmvRefFailed = -197,
6328   resAttrErr = -198,
6329   mapReadErr = -199,
6330   CantDecompress = -186,
6331   badExtResource = -185,
6332   noMemForPictPlaybackErr = -145,
6333   rgnOverflowErr = -147,
6334   rgnTooBigError = -147,
6335   pixMapTooDeepErr = -148,
6336   insufficientStackErr = -149,
6337   nsStackErr = -149
6338 };
6339
6340 enum {
6341   evtNotEnb = 1
6342 };
6343
6344
6345 enum {
6346   cMatchErr = -150,
6347   cTempMemErr = -151,
6348   cNoMemErr = -152,
6349   cRangeErr = -153,
6350   cProtectErr = -154,
6351   cDevErr = -155,
6352   cResErr = -156,
6353   cDepthErr = -157,
6354   rgnTooBigErr = -500,
6355   updPixMemErr = -125,
6356   pictInfoVersionErr = -11000,
6357   pictInfoIDErr = -11001,
6358   pictInfoVerbErr = -11002,
6359   cantLoadPickMethodErr = -11003,
6360   colorsRequestedErr = -11004,
6361   pictureDataErr = -11005
6362 };
6363
6364
6365 enum {
6366
6367   cmProfileError = -170,
6368   cmMethodError = -171,
6369   cmMethodNotFound = -175,
6370   cmProfileNotFound = -176,
6371   cmProfilesIdentical = -177,
6372   cmCantConcatenateError = -178,
6373   cmCantXYZ = -179,
6374   cmCantDeleteProfile = -180,
6375   cmUnsupportedDataType = -181,
6376   cmNoCurrentProfile = -182
6377 };
6378
6379
6380 enum {
6381
6382   noHardware = noHardwareErr,
6383   notEnoughHardware = notEnoughHardwareErr,
6384   queueFull = -203,
6385   resProblem = -204,
6386   badChannel = -205,
6387   badFormat = -206,
6388   notEnoughBufferSpace = -207,
6389   badFileFormat = -208,
6390   channelBusy = -209,
6391   buffersTooSmall = -210,
6392   channelNotBusy = -211,
6393   noMoreRealTime = -212,
6394   siVBRCompressionNotSupported = -213,
6395   siNoSoundInHardware = -220,
6396   siBadSoundInDevice = -221,
6397   siNoBufferSpecified = -222,
6398   siInvalidCompression = -223,
6399   siHardDriveTooSlow = -224,
6400   siInvalidSampleRate = -225,
6401   siInvalidSampleSize = -226,
6402   siDeviceBusyErr = -227,
6403   siBadDeviceName = -228,
6404   siBadRefNum = -229,
6405   siInputDeviceErr = -230,
6406   siUnknownInfoType = -231,
6407   siUnknownQuality = -232
6408 };
6409
6410
6411 enum {
6412   noSynthFound = -240,
6413   synthOpenFailed = -241,
6414   synthNotReady = -242,
6415   bufTooSmall = -243,
6416   voiceNotFound = -244,
6417   incompatibleVoice = -245,
6418   badDictFormat = -246,
6419   badInputText = -247
6420 };
6421
6422
6423 enum {
6424   midiNoClientErr = -250,
6425   midiNoPortErr = -251,
6426   midiTooManyPortsErr = -252,
6427   midiTooManyConsErr = -253,
6428   midiVConnectErr = -254,
6429   midiVConnectMade = -255,
6430   midiVConnectRmvd = -256,
6431   midiNoConErr = -257,
6432   midiWriteErr = -258,
6433   midiNameLenErr = -259,
6434   midiDupIDErr = -260,
6435   midiInvalidCmdErr = -261
6436 };
6437
6438
6439 enum {
6440   nmTypErr = -299
6441 };
6442
6443
6444 enum {
6445   siInitSDTblErr = 1,
6446   siInitVBLQsErr = 2,
6447   siInitSPTblErr = 3,
6448   sdmJTInitErr = 10,
6449   sdmInitErr = 11,
6450   sdmSRTInitErr = 12,
6451   sdmPRAMInitErr = 13,
6452   sdmPriInitErr = 14
6453 };
6454
6455 enum {
6456   smSDMInitErr = -290,
6457   smSRTInitErr = -291,
6458   smPRAMInitErr = -292,
6459   smPriInitErr = -293,
6460   smEmptySlot = -300,
6461   smCRCFail = -301,
6462   smFormatErr = -302,
6463   smRevisionErr = -303,
6464   smNoDir = -304,
6465   smDisabledSlot = -305,
6466   smNosInfoArray = -306
6467 };
6468
6469
6470 enum {
6471   smResrvErr = -307,
6472   smUnExBusErr = -308,
6473   smBLFieldBad = -309,
6474   smFHBlockRdErr = -310,
6475   smFHBlkDispErr = -311,
6476   smDisposePErr = -312,
6477   smNoBoardSRsrc = -313,
6478   smGetPRErr = -314,
6479   smNoBoardId = -315,
6480   smInitStatVErr = -316,
6481   smInitTblVErr = -317,
6482   smNoJmpTbl = -318,
6483   smReservedSlot = -318,
6484   smBadBoardId = -319,
6485   smBusErrTO = -320,
6486
6487   svTempDisable = -32768L,
6488   svDisabled = -32640,
6489   smBadRefId = -330,
6490   smBadsList = -331,
6491   smReservedErr = -332,
6492   smCodeRevErr = -333
6493 };
6494
6495 enum {
6496   smCPUErr = -334,
6497   smsPointerNil = -335,
6498   smNilsBlockErr = -336,
6499   smSlotOOBErr = -337,
6500   smSelOOBErr = -338,
6501   smNewPErr = -339,
6502   smBlkMoveErr = -340,
6503   smCkStatusErr = -341,
6504   smGetDrvrNamErr = -342,
6505   smDisDrvrNamErr = -343,
6506   smNoMoresRsrcs = -344,
6507   smsGetDrvrErr = -345,
6508   smBadsPtrErr = -346,
6509   smByteLanesErr = -347,
6510   smOffsetErr = -348,
6511   smNoGoodOpens = -349,
6512   smSRTOvrFlErr = -350,
6513   smRecNotFnd = -351
6514 };
6515
6516
6517 enum {
6518
6519   notBTree = -410,
6520   btNoSpace = -413,
6521   btDupRecErr = -414,
6522   btRecNotFnd = -415,
6523   btKeyLenErr = -416,
6524   btKeyAttrErr = -417,
6525   unknownInsertModeErr = -20000,
6526   recordDataTooBigErr = -20001,
6527   invalidIndexErr = -20002
6528 };
6529
6530
6531
6532
6533
6534 enum {
6535   fsmFFSNotFoundErr = -431,
6536   fsmBusyFFSErr = -432,
6537   fsmBadFFSNameErr = -433,
6538   fsmBadFSDLenErr = -434,
6539   fsmDuplicateFSIDErr = -435,
6540   fsmBadFSDVersionErr = -436,
6541   fsmNoAlternateStackErr = -437,
6542   fsmUnknownFSMMessageErr = -438
6543 };
6544
6545
6546 enum {
6547
6548   editionMgrInitErr = -450,
6549   badSectionErr = -451,
6550   notRegisteredSectionErr = -452,
6551   badEditionFileErr = -453,
6552   badSubPartErr = -454,
6553   multiplePublisherWrn = -460,
6554   containerNotFoundWrn = -461,
6555   containerAlreadyOpenWrn = -462,
6556   notThePublisherWrn = -463
6557 };
6558
6559 enum {
6560   teScrapSizeErr = -501,
6561   hwParamErr = -502,
6562   driverHardwareGoneErr = -503
6563 };
6564
6565 enum {
6566
6567   procNotFound = -600,
6568   memFragErr = -601,
6569   appModeErr = -602,
6570   protocolErr = -603,
6571   hardwareConfigErr = -604,
6572   appMemFullErr = -605,
6573   appIsDaemon = -606,
6574   bufferIsSmall = -607,
6575   noOutstandingHLE = -608,
6576   connectionInvalid = -609,
6577   noUserInteractionAllowed = -610
6578 };
6579
6580 enum {
6581
6582   wrongApplicationPlatform = -875,
6583   appVersionTooOld = -876,
6584   notAppropriateForClassic = -877
6585 };
6586
6587
6588 enum {
6589   threadTooManyReqsErr = -617,
6590   threadNotFoundErr = -618,
6591   threadProtocolErr = -619
6592 };
6593
6594 enum {
6595   threadBadAppContextErr = -616
6596 };
6597
6598
6599 enum {
6600   notEnoughMemoryErr = -620,
6601   notHeldErr = -621,
6602   cannotMakeContiguousErr = -622,
6603   notLockedErr = -623,
6604   interruptsMaskedErr = -624,
6605   cannotDeferErr = -625,
6606   noMMUErr = -626
6607 };
6608
6609
6610 enum {
6611   vmMorePhysicalThanVirtualErr = -628,
6612   vmKernelMMUInitErr = -629,
6613   vmOffErr = -630,
6614   vmMemLckdErr = -631,
6615   vmBadDriver = -632,
6616   vmNoVectorErr = -633
6617 };
6618
6619
6620 enum {
6621   vmInvalidBackingFileIDErr = -640,
6622   vmMappingPrivilegesErr = -641,
6623   vmBusyBackingFileErr = -642,
6624   vmNoMoreBackingFilesErr = -643,
6625   vmInvalidFileViewIDErr = -644,
6626   vmFileViewAccessErr = -645,
6627   vmNoMoreFileViewsErr = -646,
6628   vmAddressNotInFileViewErr = -647,
6629   vmInvalidOwningProcessErr = -648
6630 };
6631
6632
6633 enum {
6634   rcDBNull = -800,
6635   rcDBValue = -801,
6636   rcDBError = -802,
6637   rcDBBadType = -803,
6638   rcDBBreak = -804,
6639   rcDBExec = -805,
6640   rcDBBadSessID = -806,
6641   rcDBBadSessNum = -807,
6642   rcDBBadDDEV = -808,
6643   rcDBAsyncNotSupp = -809,
6644   rcDBBadAsyncPB = -810,
6645   rcDBNoHandler = -811,
6646   rcDBWrongVersion = -812,
6647   rcDBPackNotInited = -813
6648 };
6649
6650
6651
6652 enum {
6653   hmHelpDisabled = -850,
6654   hmBalloonAborted = -853,
6655   hmSameAsLastBalloon = -854,
6656   hmHelpManagerNotInited = -855,
6657   hmSkippedBalloon = -857,
6658   hmWrongVersion = -858,
6659   hmUnknownHelpType = -859,
6660   hmOperationUnsupported = -861,
6661   hmNoBalloonUp = -862,
6662   hmCloseViewActive = -863
6663 };
6664
6665
6666
6667 enum {
6668
6669   notInitErr = -900,
6670   nameTypeErr = -902,
6671   noPortErr = -903,
6672
6673
6674   noGlobalsErr = -904,
6675   localOnlyErr = -905,
6676   destPortErr = -906,
6677   sessTableErr = -907,
6678   noSessionErr = -908,
6679   badReqErr = -909,
6680   portNameExistsErr = -910,
6681   noUserNameErr = -911,
6682   userRejectErr = -912,
6683   noMachineNameErr = -913,
6684   noToolboxNameErr = -914,
6685   noResponseErr = -915,
6686   portClosedErr = -916,
6687   sessClosedErr = -917,
6688   badPortNameErr = -919,
6689   noDefaultUserErr = -922,
6690   notLoggedInErr = -923,
6691   noUserRefErr = -924,
6692   networkErr = -925,
6693   noInformErr = -926,
6694   authFailErr = -927,
6695   noUserRecErr = -928,
6696   badServiceMethodErr = -930,
6697   badLocNameErr = -931,
6698   guestNotAllowedErr = -932
6699 };
6700
6701
6702 enum {
6703   kFMIterationCompleted = -980L,
6704   kFMInvalidFontFamilyErr = -981L,
6705   kFMInvalidFontErr = -982L,
6706   kFMIterationScopeModifiedErr = -983L,
6707   kFMFontTableAccessErr = -984L,
6708   kFMFontContainerAccessErr = -985L
6709 };
6710
6711 enum {
6712   noMaskFoundErr = -1000
6713 };
6714
6715 enum {
6716   nbpBuffOvr = -1024,
6717   nbpNoConfirm = -1025,
6718   nbpConfDiff = -1026,
6719   nbpDuplicate = -1027,
6720   nbpNotFound = -1028,
6721   nbpNISErr = -1029
6722 };
6723
6724 enum {
6725   aspBadVersNum = -1066,
6726   aspBufTooSmall = -1067,
6727   aspNoMoreSess = -1068,
6728   aspNoServers = -1069,
6729   aspParamErr = -1070,
6730   aspServerBusy = -1071,
6731   aspSessClosed = -1072,
6732   aspSizeErr = -1073,
6733   aspTooMany = -1074,
6734   aspNoAck = -1075
6735 };
6736
6737 enum {
6738   reqFailed = -1096,
6739   tooManyReqs = -1097,
6740   tooManySkts = -1098,
6741   badATPSkt = -1099,
6742   badBuffNum = -1100,
6743   noRelErr = -1101,
6744   cbNotFound = -1102,
6745   noSendResp = -1103,
6746   noDataArea = -1104,
6747   reqAborted = -1105
6748 };
6749
6750
6751 enum {
6752
6753   errRefNum = -1280,
6754   errAborted = -1279,
6755   errState = -1278,
6756   errOpening = -1277,
6757   errAttention = -1276,
6758   errFwdReset = -1275,
6759   errDSPQueueSize = -1274,
6760   errOpenDenied = -1273
6761 };
6762
6763
6764
6765
6766
6767
6768 enum {
6769   errAECoercionFail = -1700,
6770   errAEDescNotFound = -1701,
6771   errAECorruptData = -1702,
6772   errAEWrongDataType = -1703,
6773   errAENotAEDesc = -1704,
6774   errAEBadListItem = -1705,
6775   errAENewerVersion = -1706,
6776   errAENotAppleEvent = -1707,
6777   errAEEventNotHandled = -1708,
6778   errAEReplyNotValid = -1709,
6779   errAEUnknownSendMode = -1710,
6780   errAEWaitCanceled = -1711,
6781   errAETimeout = -1712,
6782   errAENoUserInteraction = -1713,
6783   errAENotASpecialFunction = -1714,
6784   errAEParamMissed = -1715,
6785   errAEUnknownAddressType = -1716,
6786   errAEHandlerNotFound = -1717,
6787   errAEReplyNotArrived = -1718,
6788   errAEIllegalIndex = -1719,
6789   errAEImpossibleRange = -1720,
6790   errAEWrongNumberArgs = -1721,
6791   errAEAccessorNotFound = -1723,
6792   errAENoSuchLogical = -1725,
6793   errAEBadTestKey = -1726,
6794   errAENotAnObjSpec = -1727,
6795   errAENoSuchObject = -1728,
6796   errAENegativeCount = -1729,
6797   errAEEmptyListContainer = -1730,
6798   errAEUnknownObjectType = -1731,
6799   errAERecordingIsAlreadyOn = -1732,
6800   errAEReceiveTerminate = -1733,
6801   errAEReceiveEscapeCurrent = -1734,
6802   errAEEventFiltered = -1735,
6803   errAEDuplicateHandler = -1736,
6804   errAEStreamBadNesting = -1737,
6805   errAEStreamAlreadyConverted = -1738,
6806   errAEDescIsNull = -1739,
6807   errAEBuildSyntaxError = -1740,
6808   errAEBufferTooSmall = -1741
6809 };
6810
6811 enum {
6812   errOSASystemError = -1750,
6813   errOSAInvalidID = -1751,
6814   errOSABadStorageType = -1752,
6815   errOSAScriptError = -1753,
6816   errOSABadSelector = -1754,
6817   errOSASourceNotAvailable = -1756,
6818   errOSANoSuchDialect = -1757,
6819   errOSADataFormatObsolete = -1758,
6820   errOSADataFormatTooNew = -1759,
6821   errOSACorruptData = errAECorruptData,
6822   errOSARecordingIsAlreadyOn = errAERecordingIsAlreadyOn,
6823   errOSAComponentMismatch = -1761,
6824   errOSACantOpenComponent = -1762
6825 };
6826
6827
6828
6829
6830 enum {
6831   errOffsetInvalid = -1800,
6832   errOffsetIsOutsideOfView = -1801,
6833   errTopOfDocument = -1810,
6834   errTopOfBody = -1811,
6835   errEndOfDocument = -1812,
6836   errEndOfBody = -1813
6837 };
6838
6839
6840 enum {
6841
6842   badDragRefErr = -1850,
6843   badDragItemErr = -1851,
6844   badDragFlavorErr = -1852,
6845   duplicateFlavorErr = -1853,
6846   cantGetFlavorErr = -1854,
6847   duplicateHandlerErr = -1855,
6848   handlerNotFoundErr = -1856,
6849   dragNotAcceptedErr = -1857,
6850   unsupportedForPlatformErr = -1858,
6851   noSuitableDisplaysErr = -1859,
6852   badImageRgnErr = -1860,
6853   badImageErr = -1861,
6854   nonDragOriginatorErr = -1862
6855 };
6856
6857
6858
6859 enum {
6860   couldNotResolveDataRef = -2000,
6861   badImageDescription = -2001,
6862   badPublicMovieAtom = -2002,
6863   cantFindHandler = -2003,
6864   cantOpenHandler = -2004,
6865   badComponentType = -2005,
6866   noMediaHandler = -2006,
6867   noDataHandler = -2007,
6868   invalidMedia = -2008,
6869   invalidTrack = -2009,
6870   invalidMovie = -2010,
6871   invalidSampleTable = -2011,
6872   invalidDataRef = -2012,
6873   invalidHandler = -2013,
6874   invalidDuration = -2014,
6875   invalidTime = -2015,
6876   cantPutPublicMovieAtom = -2016,
6877   badEditList = -2017,
6878   mediaTypesDontMatch = -2018,
6879   progressProcAborted = -2019,
6880   movieToolboxUninitialized = -2020,
6881   noRecordOfApp = movieToolboxUninitialized,
6882   wfFileNotFound = -2021,
6883   cantCreateSingleForkFile = -2022,
6884   invalidEditState = -2023,
6885   nonMatchingEditState = -2024,
6886   staleEditState = -2025,
6887   userDataItemNotFound = -2026,
6888   maxSizeToGrowTooSmall = -2027,
6889   badTrackIndex = -2028,
6890   trackIDNotFound = -2029,
6891   trackNotInMovie = -2030,
6892   timeNotInTrack = -2031,
6893   timeNotInMedia = -2032,
6894   badEditIndex = -2033,
6895   internalQuickTimeError = -2034,
6896   cantEnableTrack = -2035,
6897   invalidRect = -2036,
6898   invalidSampleNum = -2037,
6899   invalidChunkNum = -2038,
6900   invalidSampleDescIndex = -2039,
6901   invalidChunkCache = -2040,
6902   invalidSampleDescription = -2041,
6903   dataNotOpenForRead = -2042,
6904   dataNotOpenForWrite = -2043,
6905   dataAlreadyOpenForWrite = -2044,
6906   dataAlreadyClosed = -2045,
6907   endOfDataReached = -2046,
6908   dataNoDataRef = -2047,
6909   noMovieFound = -2048,
6910   invalidDataRefContainer = -2049,
6911   badDataRefIndex = -2050,
6912   noDefaultDataRef = -2051,
6913   couldNotUseAnExistingSample = -2052,
6914   featureUnsupported = -2053,
6915   noVideoTrackInMovieErr = -2054,
6916   noSoundTrackInMovieErr = -2055,
6917   soundSupportNotAvailableErr = -2056,
6918   unsupportedAuxiliaryImportData = -2057,
6919   auxiliaryExportDataUnavailable = -2058,
6920   samplesAlreadyInMediaErr = -2059,
6921   noSourceTreeFoundErr = -2060,
6922   sourceNotFoundErr = -2061,
6923   movieTextNotFoundErr = -2062,
6924   missingRequiredParameterErr = -2063,
6925   invalidSpriteWorldPropertyErr = -2064,
6926   invalidSpritePropertyErr = -2065,
6927   gWorldsNotSameDepthAndSizeErr = -2066,
6928   invalidSpriteIndexErr = -2067,
6929   invalidImageIndexErr = -2068,
6930   invalidSpriteIDErr = -2069
6931 };
6932
6933 enum {
6934   internalComponentErr = -2070,
6935   notImplementedMusicOSErr = -2071,
6936   cantSendToSynthesizerOSErr = -2072,
6937   cantReceiveFromSynthesizerOSErr = -2073,
6938   illegalVoiceAllocationOSErr = -2074,
6939   illegalPartOSErr = -2075,
6940   illegalChannelOSErr = -2076,
6941   illegalKnobOSErr = -2077,
6942   illegalKnobValueOSErr = -2078,
6943   illegalInstrumentOSErr = -2079,
6944   illegalControllerOSErr = -2080,
6945   midiManagerAbsentOSErr = -2081,
6946   synthesizerNotRespondingOSErr = -2082,
6947   synthesizerOSErr = -2083,
6948   illegalNoteChannelOSErr = -2084,
6949   noteChannelNotAllocatedOSErr = -2085,
6950   tunePlayerFullOSErr = -2086,
6951   tuneParseOSErr = -2087,
6952   noExportProcAvailableErr = -2089,
6953   videoOutputInUseErr = -2090
6954 };
6955
6956 enum {
6957   componentDllLoadErr = -2091,
6958   componentDllEntryNotFoundErr = -2092,
6959   qtmlDllLoadErr = -2093,
6960   qtmlDllEntryNotFoundErr = -2094,
6961   qtmlUninitialized = -2095,
6962   unsupportedOSErr = -2096,
6963   unsupportedProcessorErr = -2097
6964 };
6965
6966 enum {
6967   cannotFindAtomErr = -2101,
6968   notLeafAtomErr = -2102,
6969   atomsNotOfSameTypeErr = -2103,
6970   atomIndexInvalidErr = -2104,
6971   duplicateAtomTypeAndIDErr = -2105,
6972   invalidAtomErr = -2106,
6973   invalidAtomContainerErr = -2107,
6974   invalidAtomTypeErr = -2108,
6975   cannotBeLeafAtomErr = -2109,
6976   pathTooLongErr = -2110,
6977   emptyPathErr = -2111,
6978   noPathMappingErr = -2112,
6979   pathNotVerifiedErr = -2113,
6980   unknownFormatErr = -2114,
6981   wackBadFileErr = -2115,
6982   wackForkNotFoundErr = -2116,
6983   wackBadMetaDataErr = -2117,
6984   qfcbNotFoundErr = -2118,
6985   qfcbNotCreatedErr = -2119,
6986   AAPNotCreatedErr = -2120,
6987   AAPNotFoundErr = -2121,
6988   ASDBadHeaderErr = -2122,
6989   ASDBadForkErr = -2123,
6990   ASDEntryNotFoundErr = -2124,
6991   fileOffsetTooBigErr = -2125,
6992   notAllowedToSaveMovieErr = -2126,
6993   qtNetworkAlreadyAllocatedErr = -2127,
6994   urlDataHHTTPProtocolErr = -2129,
6995   urlDataHHTTPNoNetDriverErr = -2130,
6996   urlDataHHTTPURLErr = -2131,
6997   urlDataHHTTPRedirectErr = -2132,
6998   urlDataHFTPProtocolErr = -2133,
6999   urlDataHFTPShutdownErr = -2134,
7000   urlDataHFTPBadUserErr = -2135,
7001   urlDataHFTPBadPasswordErr = -2136,
7002   urlDataHFTPServerErr = -2137,
7003   urlDataHFTPDataConnectionErr = -2138,
7004   urlDataHFTPNoDirectoryErr = -2139,
7005   urlDataHFTPQuotaErr = -2140,
7006   urlDataHFTPPermissionsErr = -2141,
7007   urlDataHFTPFilenameErr = -2142,
7008   urlDataHFTPNoNetDriverErr = -2143,
7009   urlDataHFTPBadNameListErr = -2144,
7010   urlDataHFTPNeedPasswordErr = -2145,
7011   urlDataHFTPNoPasswordErr = -2146,
7012   urlDataHFTPServerDisconnectedErr = -2147,
7013   urlDataHFTPURLErr = -2148,
7014   notEnoughDataErr = -2149,
7015   qtActionNotHandledErr = -2157,
7016   qtXMLParseErr = -2158,
7017   qtXMLApplicationErr = -2159
7018 };
7019
7020
7021 enum {
7022   digiUnimpErr = -2201,
7023   qtParamErr = -2202,
7024   matrixErr = -2203,
7025   notExactMatrixErr = -2204,
7026   noMoreKeyColorsErr = -2205,
7027   notExactSizeErr = -2206,
7028   badDepthErr = -2207,
7029   noDMAErr = -2208,
7030   badCallOrderErr = -2209
7031 };
7032
7033
7034
7035 enum {
7036   kernelIncompleteErr = -2401,
7037   kernelCanceledErr = -2402,
7038   kernelOptionsErr = -2403,
7039   kernelPrivilegeErr = -2404,
7040   kernelUnsupportedErr = -2405,
7041   kernelObjectExistsErr = -2406,
7042   kernelWritePermissionErr = -2407,
7043   kernelReadPermissionErr = -2408,
7044   kernelExecutePermissionErr = -2409,
7045   kernelDeletePermissionErr = -2410,
7046   kernelExecutionLevelErr = -2411,
7047   kernelAttributeErr = -2412,
7048   kernelAsyncSendLimitErr = -2413,
7049   kernelAsyncReceiveLimitErr = -2414,
7050   kernelTimeoutErr = -2415,
7051   kernelInUseErr = -2416,
7052   kernelTerminatedErr = -2417,
7053   kernelExceptionErr = -2418,
7054   kernelIDErr = -2419,
7055   kernelAlreadyFreeErr = -2421,
7056   kernelReturnValueErr = -2422,
7057   kernelUnrecoverableErr = -2499
7058 };
7059
7060
7061
7062 enum {
7063
7064   tsmComponentNoErr = 0,
7065   tsmUnsupScriptLanguageErr = -2500,
7066   tsmInputMethodNotFoundErr = -2501,
7067   tsmNotAnAppErr = -2502,
7068   tsmAlreadyRegisteredErr = -2503,
7069   tsmNeverRegisteredErr = -2504,
7070   tsmInvalidDocIDErr = -2505,
7071   tsmTSMDocBusyErr = -2506,
7072   tsmDocNotActiveErr = -2507,
7073   tsmNoOpenTSErr = -2508,
7074   tsmCantOpenComponentErr = -2509,
7075   tsmTextServiceNotFoundErr = -2510,
7076   tsmDocumentOpenErr = -2511,
7077   tsmUseInputWindowErr = -2512,
7078   tsmTSHasNoMenuErr = -2513,
7079   tsmTSNotOpenErr = -2514,
7080   tsmComponentAlreadyOpenErr = -2515,
7081   tsmInputMethodIsOldErr = -2516,
7082   tsmScriptHasNoIMErr = -2517,
7083   tsmUnsupportedTypeErr = -2518,
7084   tsmUnknownErr = -2519,
7085   tsmInvalidContext = -2520,
7086   tsmNoHandler = -2521,
7087   tsmNoMoreTokens = -2522,
7088   tsmNoStem = -2523,
7089   tsmDefaultIsNotInputMethodErr = -2524,
7090   tsmDocPropertyNotFoundErr = -2528,
7091   tsmDocPropertyBufferTooSmallErr = -2529,
7092   tsmCantChangeForcedClassStateErr = -2530
7093 };
7094
7095
7096 enum {
7097
7098   mmInternalError = -2526
7099 };
7100
7101
7102 enum {
7103   nrLockedErr = -2536,
7104   nrNotEnoughMemoryErr = -2537,
7105   nrInvalidNodeErr = -2538,
7106   nrNotFoundErr = -2539,
7107   nrNotCreatedErr = -2540,
7108   nrNameErr = -2541,
7109   nrNotSlotDeviceErr = -2542,
7110   nrDataTruncatedErr = -2543,
7111   nrPowerErr = -2544,
7112   nrPowerSwitchAbortErr = -2545,
7113   nrTypeMismatchErr = -2546,
7114   nrNotModifiedErr = -2547,
7115   nrOverrunErr = -2548,
7116   nrResultCodeBase = -2549,
7117   nrPathNotFound = -2550,
7118   nrPathBufferTooSmall = -2551,
7119   nrInvalidEntryIterationOp = -2552,
7120   nrPropertyAlreadyExists = -2553,
7121   nrIterationDone = -2554,
7122   nrExitedIteratorScope = -2555,
7123   nrTransactionAborted = -2556,
7124   nrCallNotSupported = -2557
7125 };
7126
7127
7128 enum {
7129   invalidIconRefErr = -2580,
7130   noSuchIconErr = -2581,
7131   noIconDataAvailableErr = -2582
7132 };
7133 enum {
7134   errOSACantCoerce = errAECoercionFail,
7135   errOSACantAccess = errAENoSuchObject,
7136   errOSACantAssign = -10006,
7137   errOSAGeneralError = -2700,
7138   errOSADivideByZero = -2701,
7139   errOSANumericOverflow = -2702,
7140   errOSACantLaunch = -2703,
7141   errOSAAppNotHighLevelEventAware = -2704,
7142   errOSACorruptTerminology = -2705,
7143   errOSAStackOverflow = -2706,
7144   errOSAInternalTableOverflow = -2707,
7145   errOSADataBlockTooLarge = -2708,
7146   errOSACantGetTerminology = -2709,
7147   errOSACantCreate = -2710
7148 };
7149 enum {
7150   errOSATypeError = errAEWrongDataType,
7151   OSAMessageNotUnderstood = errAEEventNotHandled,
7152   OSAUndefinedHandler = errAEHandlerNotFound,
7153   OSAIllegalAccess = errAEAccessorNotFound,
7154   OSAIllegalIndex = errAEIllegalIndex,
7155   OSAIllegalRange = errAEImpossibleRange,
7156   OSAIllegalAssign = -10003,
7157   OSASyntaxError = -2740,
7158   OSASyntaxTypeError = -2741,
7159   OSATokenTooLong = -2742,
7160   OSAMissingParameter = errAEDescNotFound,
7161   OSAParameterMismatch = errAEWrongNumberArgs,
7162   OSADuplicateParameter = -2750,
7163   OSADuplicateProperty = -2751,
7164   OSADuplicateHandler = -2752,
7165   OSAUndefinedVariable = -2753,
7166   OSAInconsistentDeclarations = -2754,
7167   OSAControlFlowError = -2755
7168 };
7169 enum {
7170   errASCantConsiderAndIgnore = -2720,
7171   errASCantCompareMoreThan32k = -2721,
7172   errASTerminologyNestingTooDeep = -2760,
7173   errASIllegalFormalParameter = -2761,
7174   errASParameterNotForEvent = -2762,
7175   errASNoResultReturned = -2763,
7176   errASInconsistentNames = -2780
7177 };
7178
7179
7180
7181 enum {
7182   cfragFirstErrCode = -2800,
7183   cfragContextIDErr = -2800,
7184   cfragConnectionIDErr = -2801,
7185   cfragNoSymbolErr = -2802,
7186   cfragNoSectionErr = -2803,
7187   cfragNoLibraryErr = -2804,
7188   cfragDupRegistrationErr = -2805,
7189   cfragFragmentFormatErr = -2806,
7190   cfragUnresolvedErr = -2807,
7191   cfragNoPositionErr = -2808,
7192   cfragNoPrivateMemErr = -2809,
7193   cfragNoClientMemErr = -2810,
7194   cfragNoIDsErr = -2811,
7195   cfragInitOrderErr = -2812,
7196   cfragImportTooOldErr = -2813,
7197   cfragImportTooNewErr = -2814,
7198   cfragInitLoopErr = -2815,
7199   cfragInitAtBootErr = -2816,
7200   cfragLibConnErr = -2817,
7201   cfragCFMStartupErr = -2818,
7202   cfragCFMInternalErr = -2819,
7203   cfragFragmentCorruptErr = -2820,
7204   cfragInitFunctionErr = -2821,
7205   cfragNoApplicationErr = -2822,
7206   cfragArchitectureErr = -2823,
7207   cfragFragmentUsageErr = -2824,
7208   cfragFileSizeErr = -2825,
7209   cfragNotClosureErr = -2826,
7210   cfragNoRegistrationErr = -2827,
7211   cfragContainerIDErr = -2828,
7212   cfragClosureIDErr = -2829,
7213   cfragAbortClosureErr = -2830,
7214   cfragOutputLengthErr = -2831,
7215   cfragLastErrCode = -2899
7216 };
7217
7218 enum {
7219
7220   cfragFirstReservedCode = -2897,
7221   cfragReservedCode_3 = -2897,
7222   cfragReservedCode_2 = -2898,
7223   cfragReservedCode_1 = -2899
7224 };
7225 enum {
7226   invalidComponentID = -3000,
7227   validInstancesExist = -3001,
7228   componentNotCaptured = -3002,
7229   componentDontRegister = -3003,
7230   unresolvedComponentDLLErr = -3004,
7231   retryComponentRegistrationErr = -3005
7232 };
7233
7234
7235 enum {
7236   invalidTranslationPathErr = -3025,
7237   couldNotParseSourceFileErr = -3026,
7238   noTranslationPathErr = -3030,
7239   badTranslationSpecErr = -3031,
7240   noPrefAppErr = -3032
7241 };
7242
7243 enum {
7244   buf2SmallErr = -3101,
7245   noMPPErr = -3102,
7246   ckSumErr = -3103,
7247   extractErr = -3104,
7248   readQErr = -3105,
7249   atpLenErr = -3106,
7250   atpBadRsp = -3107,
7251   recNotFnd = -3108,
7252   sktClosedErr = -3109
7253 };
7254
7255
7256
7257 enum {
7258   kOTNoError = 0,
7259   kOTOutOfMemoryErr = -3211,
7260   kOTNotFoundErr = -3201,
7261   kOTDuplicateFoundErr = -3216,
7262   kOTBadAddressErr = -3150,
7263   kOTBadOptionErr = -3151,
7264   kOTAccessErr = -3152,
7265   kOTBadReferenceErr = -3153,
7266   kOTNoAddressErr = -3154,
7267   kOTOutStateErr = -3155,
7268   kOTBadSequenceErr = -3156,
7269   kOTSysErrorErr = -3157,
7270   kOTLookErr = -3158,
7271   kOTBadDataErr = -3159,
7272   kOTBufferOverflowErr = -3160,
7273   kOTFlowErr = -3161,
7274   kOTNoDataErr = -3162,
7275   kOTNoDisconnectErr = -3163,
7276   kOTNoUDErrErr = -3164,
7277   kOTBadFlagErr = -3165,
7278   kOTNoReleaseErr = -3166,
7279   kOTNotSupportedErr = -3167,
7280   kOTStateChangeErr = -3168,
7281   kOTNoStructureTypeErr = -3169,
7282   kOTBadNameErr = -3170,
7283   kOTBadQLenErr = -3171,
7284   kOTAddressBusyErr = -3172,
7285   kOTIndOutErr = -3173,
7286   kOTProviderMismatchErr = -3174,
7287   kOTResQLenErr = -3175,
7288   kOTResAddressErr = -3176,
7289   kOTQFullErr = -3177,
7290   kOTProtocolErr = -3178,
7291   kOTBadSyncErr = -3179,
7292   kOTCanceledErr = -3180,
7293   kEPERMErr = -3200,
7294   kENOENTErr = -3201,
7295   kENORSRCErr = -3202,
7296   kEINTRErr = -3203,
7297   kEIOErr = -3204,
7298   kENXIOErr = -3205,
7299   kEBADFErr = -3208,
7300   kEAGAINErr = -3210,
7301   kENOMEMErr = -3211,
7302   kEACCESErr = -3212,
7303   kEFAULTErr = -3213,
7304   kEBUSYErr = -3215,
7305   kEEXISTErr = -3216,
7306   kENODEVErr = -3218,
7307   kEINVALErr = -3221,
7308   kENOTTYErr = -3224,
7309   kEPIPEErr = -3231,
7310   kERANGEErr = -3233,
7311   kEWOULDBLOCKErr = -3234,
7312   kEDEADLKErr = -3234,
7313   kEALREADYErr = -3236,
7314   kENOTSOCKErr = -3237,
7315   kEDESTADDRREQErr = -3238,
7316   kEMSGSIZEErr = -3239,
7317   kEPROTOTYPEErr = -3240,
7318   kENOPROTOOPTErr = -3241,
7319   kEPROTONOSUPPORTErr = -3242,
7320   kESOCKTNOSUPPORTErr = -3243,
7321   kEOPNOTSUPPErr = -3244,
7322   kEADDRINUSEErr = -3247,
7323   kEADDRNOTAVAILErr = -3248,
7324   kENETDOWNErr = -3249,
7325   kENETUNREACHErr = -3250,
7326   kENETRESETErr = -3251,
7327   kECONNABORTEDErr = -3252,
7328   kECONNRESETErr = -3253,
7329   kENOBUFSErr = -3254,
7330   kEISCONNErr = -3255,
7331   kENOTCONNErr = -3256,
7332   kESHUTDOWNErr = -3257,
7333   kETOOMANYREFSErr = -3258,
7334   kETIMEDOUTErr = -3259,
7335   kECONNREFUSEDErr = -3260,
7336   kEHOSTDOWNErr = -3263,
7337   kEHOSTUNREACHErr = -3264,
7338   kEPROTOErr = -3269,
7339   kETIMEErr = -3270,
7340   kENOSRErr = -3271,
7341   kEBADMSGErr = -3272,
7342   kECANCELErr = -3273,
7343   kENOSTRErr = -3274,
7344   kENODATAErr = -3275,
7345   kEINPROGRESSErr = -3276,
7346   kESRCHErr = -3277,
7347   kENOMSGErr = -3278,
7348   kOTClientNotInittedErr = -3279,
7349   kOTPortHasDiedErr = -3280,
7350   kOTPortWasEjectedErr = -3281,
7351   kOTBadConfigurationErr = -3282,
7352   kOTConfigurationChangedErr = -3283,
7353   kOTUserRequestedErr = -3284,
7354   kOTPortLostConnection = -3285
7355 };
7356
7357
7358
7359 enum {
7360   kQDNoPalette = -3950,
7361   kQDNoColorHWCursorSupport = -3951,
7362   kQDCursorAlreadyRegistered = -3952,
7363   kQDCursorNotRegistered = -3953,
7364   kQDCorruptPICTDataErr = -3954
7365 };
7366
7367
7368
7369
7370 enum {
7371   firstPickerError = -4000,
7372   invalidPickerType = firstPickerError,
7373   requiredFlagsDontMatch = -4001,
7374   pickerResourceError = -4002,
7375   cantLoadPicker = -4003,
7376   cantCreatePickerWindow = -4004,
7377   cantLoadPackage = -4005,
7378   pickerCantLive = -4006,
7379   colorSyncNotInstalled = -4007,
7380   badProfileError = -4008,
7381   noHelpForItem = -4009
7382 };
7383
7384
7385
7386
7387 enum {
7388   kNSL68kContextNotSupported = -4170,
7389   kNSLSchedulerError = -4171,
7390   kNSLBadURLSyntax = -4172,
7391   kNSLNoCarbonLib = -4173,
7392   kNSLUILibraryNotAvailable = -4174,
7393   kNSLNotImplementedYet = -4175,
7394   kNSLErrNullPtrError = -4176,
7395   kNSLSomePluginsFailedToLoad = -4177,
7396   kNSLNullNeighborhoodPtr = -4178,
7397   kNSLNoPluginsForSearch = -4179,
7398   kNSLSearchAlreadyInProgress = -4180,
7399   kNSLNoPluginsFound = -4181,
7400   kNSLPluginLoadFailed = -4182,
7401   kNSLBadProtocolTypeErr = -4183,
7402   kNSLNullListPtr = -4184,
7403   kNSLBadClientInfoPtr = -4185,
7404   kNSLCannotContinueLookup = -4186,
7405   kNSLBufferTooSmallForData = -4187,
7406   kNSLNoContextAvailable = -4188,
7407   kNSLRequestBufferAlreadyInList = -4189,
7408   kNSLInvalidPluginSpec = -4190,
7409   kNSLNoSupportForService = -4191,
7410   kNSLBadNetConnection = -4192,
7411   kNSLBadDataTypeErr = -4193,
7412   kNSLBadServiceTypeErr = -4194,
7413   kNSLBadReferenceErr = -4195,
7414   kNSLNoElementsInList = -4196,
7415   kNSLInsufficientOTVer = -4197,
7416   kNSLInsufficientSysVer = -4198,
7417   kNSLNotInitialized = -4199,
7418   kNSLInitializationFailed = -4200
7419 };
7420
7421
7422
7423
7424 enum {
7425   kDTPHoldJobErr = -4200,
7426   kDTPStopQueueErr = -4201,
7427   kDTPTryAgainErr = -4202,
7428   kDTPAbortJobErr = 128
7429 };
7430
7431
7432
7433 enum {
7434
7435   cmElementTagNotFound = -4200,
7436   cmIndexRangeErr = -4201,
7437   cmCantDeleteElement = -4202,
7438   cmFatalProfileErr = -4203,
7439   cmInvalidProfile = -4204,
7440   cmInvalidProfileLocation = -4205,
7441   cmCantCopyModifiedV1Profile = -4215,
7442
7443   cmInvalidSearch = -4206,
7444   cmSearchError = -4207,
7445   cmErrIncompatibleProfile = -4208,
7446   cmInvalidColorSpace = -4209,
7447   cmInvalidSrcMap = -4210,
7448   cmInvalidDstMap = -4211,
7449   cmNoGDevicesError = -4212,
7450   cmInvalidProfileComment = -4213,
7451   cmRangeOverFlow = -4214,
7452   cmNamedColorNotFound = -4216,
7453   cmCantGamutCheckError = -4217
7454 };
7455
7456
7457 enum {
7458   badFolderDescErr = -4270,
7459   duplicateFolderDescErr = -4271,
7460   noMoreFolderDescErr = -4272,
7461   invalidFolderTypeErr = -4273,
7462   duplicateRoutingErr = -4274,
7463   routingNotFoundErr = -4275,
7464   badRoutingSizeErr = -4276
7465 };
7466
7467
7468
7469 enum {
7470   coreFoundationUnknownErr = -4960
7471 };
7472
7473
7474 enum {
7475   internalScrapErr = -4988,
7476   duplicateScrapFlavorErr = -4989,
7477   badScrapRefErr = -4990,
7478   processStateIncorrectErr = -4991,
7479   scrapPromiseNotKeptErr = -4992,
7480   noScrapPromiseKeeperErr = -4993,
7481   nilScrapFlavorDataErr = -4994,
7482   scrapFlavorFlagsMismatchErr = -4995,
7483   scrapFlavorSizeMismatchErr = -4996,
7484   illegalScrapFlavorFlagsErr = -4997,
7485   illegalScrapFlavorTypeErr = -4998,
7486   illegalScrapFlavorSizeErr = -4999,
7487   scrapFlavorNotFoundErr = -102,
7488   needClearScrapErr = -100
7489 };
7490
7491
7492 enum {
7493
7494   afpAccessDenied = -5000,
7495   afpAuthContinue = -5001,
7496   afpBadUAM = -5002,
7497   afpBadVersNum = -5003,
7498   afpBitmapErr = -5004,
7499   afpCantMove = -5005,
7500   afpDenyConflict = -5006,
7501   afpDirNotEmpty = -5007,
7502   afpDiskFull = -5008,
7503   afpEofError = -5009,
7504   afpFileBusy = -5010,
7505   afpFlatVol = -5011,
7506   afpItemNotFound = -5012,
7507   afpLockErr = -5013,
7508   afpMiscErr = -5014,
7509   afpNoMoreLocks = -5015,
7510   afpNoServer = -5016,
7511   afpObjectExists = -5017,
7512   afpObjectNotFound = -5018,
7513   afpParmErr = -5019,
7514   afpRangeNotLocked = -5020,
7515   afpRangeOverlap = -5021,
7516   afpSessClosed = -5022,
7517   afpUserNotAuth = -5023,
7518   afpCallNotSupported = -5024,
7519   afpObjectTypeErr = -5025,
7520   afpTooManyFilesOpen = -5026,
7521   afpServerGoingDown = -5027,
7522   afpCantRename = -5028,
7523   afpDirNotFound = -5029,
7524   afpIconTypeError = -5030,
7525   afpVolLocked = -5031,
7526   afpObjectLocked = -5032,
7527   afpContainsSharedErr = -5033,
7528   afpIDNotFound = -5034,
7529   afpIDExists = -5035,
7530   afpDiffVolErr = -5036,
7531   afpCatalogChanged = -5037,
7532   afpSameObjectErr = -5038,
7533   afpBadIDErr = -5039,
7534   afpPwdSameErr = -5040,
7535   afpPwdTooShortErr = -5041,
7536   afpPwdExpiredErr = -5042,
7537   afpInsideSharedErr = -5043,
7538
7539   afpInsideTrashErr = -5044,
7540
7541   afpPwdNeedsChangeErr = -5045,
7542   afpPwdPolicyErr = -5046,
7543   afpAlreadyLoggedInErr = -5047,
7544   afpCallNotAllowed = -5048
7545 };
7546
7547 enum {
7548
7549   afpBadDirIDType = -5060,
7550   afpCantMountMoreSrvre = -5061,
7551   afpAlreadyMounted = -5062,
7552   afpSameNodeErr = -5063
7553 };
7554
7555
7556
7557
7558
7559
7560 enum {
7561   numberFormattingNotANumberErr = -5200,
7562   numberFormattingOverflowInDestinationErr = -5201,
7563   numberFormattingBadNumberFormattingObjectErr = -5202,
7564   numberFormattingSpuriousCharErr = -5203,
7565   numberFormattingLiteralMissingErr = -5204,
7566   numberFormattingDelimiterMissingErr = -5205,
7567   numberFormattingEmptyFormatErr = -5206,
7568   numberFormattingBadFormatErr = -5207,
7569   numberFormattingBadOptionsErr = -5208,
7570   numberFormattingBadTokenErr = -5209,
7571   numberFormattingUnOrderedCurrencyRangeErr = -5210,
7572   numberFormattingBadCurrencyPositionErr = -5211,
7573   numberFormattingNotADigitErr = -5212,
7574   numberFormattingUnOrdredCurrencyRangeErr = -5210,
7575   numberFortmattingNotADigitErr = -5212
7576 };
7577
7578
7579 enum {
7580   textParserBadParamErr = -5220,
7581   textParserObjectNotFoundErr = -5221,
7582   textParserBadTokenValueErr = -5222,
7583   textParserBadParserObjectErr = -5223,
7584   textParserParamErr = -5224,
7585   textParserNoMoreTextErr = -5225,
7586   textParserBadTextLanguageErr = -5226,
7587   textParserBadTextEncodingErr = -5227,
7588   textParserNoSuchTokenFoundErr = -5228,
7589   textParserNoMoreTokensErr = -5229
7590 };
7591
7592 enum {
7593   errUnknownAttributeTag = -5240,
7594   errMarginWilllNotFit = -5241,
7595   errNotInImagingMode = -5242,
7596   errAlreadyInImagingMode = -5243,
7597   errEngineNotFound = -5244,
7598   errIteratorReachedEnd = -5245,
7599   errInvalidRange = -5246,
7600   errOffsetNotOnElementBounday = -5247,
7601   errNoHiliteText = -5248,
7602   errEmptyScrap = -5249,
7603   errReadOnlyText = -5250,
7604   errUnknownElement = -5251,
7605   errNonContiuousAttribute = -5252,
7606   errCannotUndo = -5253
7607 };
7608
7609
7610
7611 enum {
7612   hrHTMLRenderingLibNotInstalledErr = -5360,
7613   hrMiscellaneousExceptionErr = -5361,
7614   hrUnableToResizeHandleErr = -5362,
7615   hrURLNotHandledErr = -5363
7616 };
7617
7618
7619
7620 enum {
7621   errIANoErr = 0,
7622   errIAUnknownErr = -5380,
7623   errIAAllocationErr = -5381,
7624   errIAParamErr = -5382,
7625   errIANoMoreItems = -5383,
7626   errIABufferTooSmall = -5384,
7627   errIACanceled = -5385,
7628   errIAInvalidDocument = -5386,
7629   errIATextExtractionErr = -5387,
7630   errIAEndOfTextRun = -5388
7631 };
7632
7633
7634
7635 enum {
7636   qtsBadSelectorErr = -5400,
7637   qtsBadStateErr = -5401,
7638   qtsBadDataErr = -5402,
7639   qtsUnsupportedDataTypeErr = -5403,
7640   qtsUnsupportedRateErr = -5404,
7641   qtsUnsupportedFeatureErr = -5405,
7642   qtsTooMuchDataErr = -5406,
7643   qtsUnknownValueErr = -5407,
7644   qtsTimeoutErr = -5408,
7645   qtsConnectionFailedErr = -5420,
7646   qtsAddressBusyErr = -5421
7647 };
7648
7649
7650 enum {
7651
7652   gestaltUnknownErr = -5550,
7653   gestaltUndefSelectorErr = -5551,
7654   gestaltDupSelectorErr = -5552,
7655   gestaltLocationErr = -5553
7656 };
7657
7658
7659
7660 enum {
7661   menuPropertyInvalidErr = -5603,
7662   menuPropertyInvalid = menuPropertyInvalidErr,
7663   menuPropertyNotFoundErr = -5604,
7664   menuNotFoundErr = -5620,
7665   menuUsesSystemDefErr = -5621,
7666   menuItemNotFoundErr = -5622,
7667   menuInvalidErr = -5623
7668 };
7669
7670
7671
7672 enum {
7673   errInvalidWindowPtr = -5600,
7674   errInvalidWindowRef = -5600,
7675   errUnsupportedWindowAttributesForClass = -5601,
7676   errWindowDoesNotHaveProxy = -5602,
7677   errInvalidWindowProperty = -5603,
7678   errWindowPropertyNotFound = -5604,
7679   errUnrecognizedWindowClass = -5605,
7680   errCorruptWindowDescription = -5606,
7681   errUserWantsToDragWindow = -5607,
7682   errWindowsAlreadyInitialized = -5608,
7683   errFloatingWindowsNotInitialized = -5609,
7684   errWindowNotFound = -5610,
7685   errWindowDoesNotFitOnscreen = -5611,
7686   windowAttributeImmutableErr = -5612,
7687   windowAttributesConflictErr = -5613,
7688   windowManagerInternalErr = -5614,
7689   windowWrongStateErr = -5615,
7690   windowGroupInvalidErr = -5616,
7691   windowAppModalStateAlreadyExistsErr = -5617,
7692   windowNoAppModalStateErr = -5618,
7693   errWindowDoesntSupportFocus = -30583,
7694   errWindowRegionCodeInvalid = -30593
7695 };
7696
7697
7698
7699 enum {
7700   dialogNoTimeoutErr = -5640
7701 };
7702
7703
7704
7705 enum {
7706   kNavWrongDialogStateErr = -5694,
7707   kNavWrongDialogClassErr = -5695,
7708   kNavInvalidSystemConfigErr = -5696,
7709   kNavCustomControlMessageFailedErr = -5697,
7710   kNavInvalidCustomControlMessageErr = -5698,
7711   kNavMissingKindStringErr = -5699
7712 };
7713
7714
7715
7716 enum {
7717   collectionItemLockedErr = -5750,
7718   collectionItemNotFoundErr = -5751,
7719   collectionIndexRangeErr = -5752,
7720   collectionVersionErr = -5753
7721 };
7722
7723
7724
7725 enum {
7726   kQTSSUnknownErr = -6150
7727 };
7728
7729
7730 enum {
7731
7732   kDMGenErr = -6220,
7733
7734   kDMMirroringOnAlready = -6221,
7735   kDMWrongNumberOfDisplays = -6222,
7736   kDMMirroringBlocked = -6223,
7737   kDMCantBlock = -6224,
7738   kDMMirroringNotOn = -6225,
7739
7740   kSysSWTooOld = -6226,
7741   kDMSWNotInitializedErr = -6227,
7742   kDMDriverNotDisplayMgrAwareErr = -6228,
7743   kDMDisplayNotFoundErr = -6229,
7744   kDMNotFoundErr = -6229,
7745   kDMDisplayAlreadyInstalledErr = -6230,
7746   kDMMainDisplayCannotMoveErr = -6231,
7747   kDMNoDeviceTableclothErr = -6231,
7748   kDMFoundErr = -6232
7749 };
7750
7751
7752
7753
7754
7755 enum {
7756   laTooSmallBufferErr = -6984,
7757   laEnvironmentBusyErr = -6985,
7758   laEnvironmentNotFoundErr = -6986,
7759   laEnvironmentExistErr = -6987,
7760   laInvalidPathErr = -6988,
7761   laNoMoreMorphemeErr = -6989,
7762   laFailAnalysisErr = -6990,
7763   laTextOverFlowErr = -6991,
7764   laDictionaryNotOpenedErr = -6992,
7765   laDictionaryUnknownErr = -6993,
7766   laDictionaryTooManyErr = -6994,
7767   laPropertyValueErr = -6995,
7768   laPropertyUnknownErr = -6996,
7769   laPropertyIsReadOnlyErr = -6997,
7770   laPropertyNotFoundErr = -6998,
7771   laPropertyErr = -6999,
7772   laEngineNotFoundErr = -7000
7773 };
7774
7775
7776 enum {
7777   kUSBNoErr = 0,
7778   kUSBNoTran = 0,
7779   kUSBNoDelay = 0,
7780   kUSBPending = 1
7781 };
7782 enum {
7783   kUSBNotSent2Err = -6901,
7784   kUSBNotSent1Err = -6902,
7785   kUSBBufUnderRunErr = -6903,
7786   kUSBBufOvrRunErr = -6904,
7787   kUSBRes2Err = -6905,
7788   kUSBRes1Err = -6906,
7789   kUSBUnderRunErr = -6907,
7790   kUSBOverRunErr = -6908,
7791   kUSBWrongPIDErr = -6909,
7792   kUSBPIDCheckErr = -6910,
7793   kUSBNotRespondingErr = -6911,
7794   kUSBEndpointStallErr = -6912,
7795   kUSBDataToggleErr = -6913,
7796   kUSBBitstufErr = -6914,
7797   kUSBCRCErr = -6915,
7798   kUSBLinkErr = -6916
7799 };
7800
7801
7802
7803
7804
7805
7806 enum {
7807   kUSBQueueFull = -6948,
7808   kUSBNotHandled = -6987,
7809   kUSBUnknownNotification = -6949,
7810   kUSBBadDispatchTable = -6950
7811 };
7812
7813
7814
7815
7816
7817
7818
7819 enum {
7820   kUSBInternalReserved10 = -6951,
7821   kUSBInternalReserved9 = -6952,
7822   kUSBInternalReserved8 = -6953,
7823   kUSBInternalReserved7 = -6954,
7824   kUSBInternalReserved6 = -6955,
7825   kUSBInternalReserved5 = -6956,
7826   kUSBInternalReserved4 = -6957,
7827   kUSBInternalReserved3 = -6958,
7828   kUSBInternalReserved2 = -6959,
7829   kUSBInternalReserved1 = -6960
7830 };
7831
7832
7833 enum {
7834   kUSBPortDisabled = -6969,
7835   kUSBQueueAborted = -6970,
7836   kUSBTimedOut = -6971,
7837   kUSBDeviceDisconnected = -6972,
7838   kUSBDeviceNotSuspended = -6973,
7839   kUSBDeviceSuspended = -6974,
7840   kUSBInvalidBuffer = -6975,
7841   kUSBDevicePowerProblem = -6976,
7842   kUSBDeviceBusy = -6977,
7843   kUSBUnknownInterfaceErr = -6978,
7844   kUSBPipeStalledError = -6979,
7845   kUSBPipeIdleError = -6980,
7846   kUSBNoBandwidthError = -6981,
7847   kUSBAbortedError = -6982,
7848   kUSBFlagsError = -6983,
7849   kUSBCompletionError = -6984,
7850   kUSBPBLengthError = -6985,
7851   kUSBPBVersionError = -6986,
7852   kUSBNotFound = -6987,
7853   kUSBOutOfMemoryErr = -6988,
7854   kUSBDeviceErr = -6989,
7855   kUSBNoDeviceErr = -6990,
7856   kUSBAlreadyOpenErr = -6991,
7857   kUSBTooManyTransactionsErr = -6992,
7858   kUSBUnknownRequestErr = -6993,
7859   kUSBRqErr = -6994,
7860   kUSBIncorrectTypeErr = -6995,
7861   kUSBTooManyPipesErr = -6996,
7862   kUSBUnknownPipeErr = -6997,
7863   kUSBUnknownDeviceErr = -6998,
7864   kUSBInternalErr = -6999
7865 };
7866
7867
7868
7869
7870
7871 enum {
7872   dcmParamErr = -7100,
7873   dcmNotDictionaryErr = -7101,
7874   dcmBadDictionaryErr = -7102,
7875   dcmPermissionErr = -7103,
7876   dcmDictionaryNotOpenErr = -7104,
7877   dcmDictionaryBusyErr = -7105,
7878   dcmBlockFullErr = -7107,
7879   dcmNoRecordErr = -7108,
7880   dcmDupRecordErr = -7109,
7881   dcmNecessaryFieldErr = -7110,
7882   dcmBadFieldInfoErr = -7111,
7883   dcmBadFieldTypeErr = -7112,
7884   dcmNoFieldErr = -7113,
7885   dcmBadKeyErr = -7115,
7886   dcmTooManyKeyErr = -7116,
7887   dcmBadDataSizeErr = -7117,
7888   dcmBadFindMethodErr = -7118,
7889   dcmBadPropertyErr = -7119,
7890   dcmProtectedErr = -7121,
7891   dcmNoAccessMethodErr = -7122,
7892   dcmBadFeatureErr = -7124,
7893   dcmIterationCompleteErr = -7126,
7894   dcmBufferOverflowErr = -7127
7895 };
7896
7897
7898
7899 enum {
7900   kRAInvalidParameter = -7100,
7901   kRAInvalidPort = -7101,
7902   kRAStartupFailed = -7102,
7903   kRAPortSetupFailed = -7103,
7904   kRAOutOfMemory = -7104,
7905   kRANotSupported = -7105,
7906   kRAMissingResources = -7106,
7907   kRAIncompatiblePrefs = -7107,
7908   kRANotConnected = -7108,
7909   kRAConnectionCanceled = -7109,
7910   kRAUnknownUser = -7110,
7911   kRAInvalidPassword = -7111,
7912   kRAInternalError = -7112,
7913   kRAInstallationDamaged = -7113,
7914   kRAPortBusy = -7114,
7915   kRAUnknownPortState = -7115,
7916   kRAInvalidPortState = -7116,
7917   kRAInvalidSerialProtocol = -7117,
7918   kRAUserLoginDisabled = -7118,
7919   kRAUserPwdChangeRequired = -7119,
7920   kRAUserPwdEntryRequired = -7120,
7921   kRAUserInteractionRequired = -7121,
7922   kRAInitOpenTransportFailed = -7122,
7923   kRARemoteAccessNotReady = -7123,
7924   kRATCPIPInactive = -7124,
7925   kRATCPIPNotConfigured = -7125,
7926   kRANotPrimaryInterface = -7126,
7927   kRAConfigurationDBInitErr = -7127,
7928   kRAPPPProtocolRejected = -7128,
7929   kRAPPPAuthenticationFailed = -7129,
7930   kRAPPPNegotiationFailed = -7130,
7931   kRAPPPUserDisconnected = -7131,
7932   kRAPPPPeerDisconnected = -7132,
7933   kRAPeerNotResponding = -7133,
7934   kRAATalkInactive = -7134,
7935   kRAExtAuthenticationFailed = -7135,
7936   kRANCPRejectedbyPeer = -7136,
7937   kRADuplicateIPAddr = -7137,
7938   kRACallBackFailed = -7138,
7939   kRANotEnabled = -7139
7940 };
7941 enum {
7942   kATSUInvalidTextLayoutErr = -8790,
7943
7944
7945   kATSUInvalidStyleErr = -8791,
7946
7947
7948   kATSUInvalidTextRangeErr = -8792,
7949
7950
7951   kATSUFontsMatched = -8793,
7952
7953
7954   kATSUFontsNotMatched = -8794,
7955
7956
7957   kATSUNoCorrespondingFontErr = -8795,
7958
7959
7960
7961
7962
7963
7964   kATSUInvalidFontErr = -8796,
7965   kATSUInvalidAttributeValueErr = -8797,
7966
7967   kATSUInvalidAttributeSizeErr = -8798,
7968
7969   kATSUInvalidAttributeTagErr = -8799,
7970
7971   kATSUInvalidCacheErr = -8800,
7972
7973
7974
7975
7976   kATSUNotSetErr = -8801,
7977
7978
7979
7980   kATSUNoStyleRunsAssignedErr = -8802,
7981
7982   kATSUQuickDrawTextErr = -8803,
7983
7984   kATSULowLevelErr = -8804,
7985
7986   kATSUNoFontCmapAvailableErr = -8805,
7987
7988   kATSUNoFontScalerAvailableErr = -8806,
7989
7990   kATSUCoordinateOverflowErr = -8807,
7991
7992   kATSULineBreakInWord = -8808,
7993
7994
7995   kATSUBusyObjectErr = -8809
7996 };
7997 enum {
7998
7999   kTextUnsupportedEncodingErr = -8738,
8000   kTextMalformedInputErr = -8739,
8001   kTextUndefinedElementErr = -8740,
8002   kTECMissingTableErr = -8745,
8003   kTECTableChecksumErr = -8746,
8004   kTECTableFormatErr = -8747,
8005   kTECCorruptConverterErr = -8748,
8006   kTECNoConversionPathErr = -8749,
8007   kTECBufferBelowMinimumSizeErr = -8750,
8008   kTECArrayFullErr = -8751,
8009   kTECBadTextRunErr = -8752,
8010   kTECPartialCharErr = -8753,
8011   kTECUnmappableElementErr = -8754,
8012   kTECIncompleteElementErr = -8755,
8013   kTECDirectionErr = -8756,
8014   kTECGlobalsUnavailableErr = -8770,
8015   kTECItemUnavailableErr = -8771,
8016
8017   kTECUsedFallbacksStatus = -8783,
8018   kTECNeedFlushStatus = -8784,
8019   kTECOutputBufferFullStatus = -8785,
8020
8021   unicodeChecksumErr = -8769,
8022   unicodeNoTableErr = -8768,
8023   unicodeVariantErr = -8767,
8024   unicodeFallbacksErr = -8766,
8025   unicodePartConvertErr = -8765,
8026   unicodeBufErr = -8764,
8027   unicodeCharErr = -8763,
8028   unicodeElementErr = -8762,
8029   unicodeNotFoundErr = -8761,
8030   unicodeTableFormatErr = -8760,
8031   unicodeDirectionErr = -8759,
8032   unicodeContextualErr = -8758,
8033   unicodeTextEncodingDataErr = -8757
8034 };
8035
8036
8037
8038 enum {
8039   kUTCUnderflowErr = -8850,
8040   kUTCOverflowErr = -8851,
8041   kIllegalClockValueErr = -8852
8042 };
8043
8044
8045
8046
8047
8048 enum {
8049   kATSUInvalidFontFallbacksErr = -8900,
8050
8051   kATSUUnsupportedStreamFormatErr = -8901,
8052
8053   kATSUBadStreamErr = -8902,
8054
8055
8056   kATSUOutputBufferTooSmallErr = -8903,
8057
8058   kATSUInvalidCallInsideCallbackErr = -8904,
8059
8060   kATSULastErr = -8959
8061 };
8062
8063
8064
8065 enum {
8066   codecErr = -8960,
8067   noCodecErr = -8961,
8068   codecUnimpErr = -8962,
8069   codecSizeErr = -8963,
8070   codecScreenBufErr = -8964,
8071   codecImageBufErr = -8965,
8072   codecSpoolErr = -8966,
8073   codecAbortErr = -8967,
8074   codecWouldOffscreenErr = -8968,
8075   codecBadDataErr = -8969,
8076   codecDataVersErr = -8970,
8077   codecExtensionNotFoundErr = -8971,
8078   scTypeNotFoundErr = codecExtensionNotFoundErr,
8079   codecConditionErr = -8972,
8080   codecOpenErr = -8973,
8081   codecCantWhenErr = -8974,
8082   codecCantQueueErr = -8975,
8083   codecNothingToBlitErr = -8976,
8084   codecNoMemoryPleaseWaitErr = -8977,
8085   codecDisabledErr = -8978,
8086   codecNeedToFlushChainErr = -8979,
8087   lockPortBitsBadSurfaceErr = -8980,
8088   lockPortBitsWindowMovedErr = -8981,
8089   lockPortBitsWindowResizedErr = -8982,
8090   lockPortBitsWindowClippedErr = -8983,
8091   lockPortBitsBadPortErr = -8984,
8092   lockPortBitsSurfaceLostErr = -8985,
8093   codecParameterDialogConfirm = -8986,
8094   codecNeedAccessKeyErr = -8987,
8095   codecOffscreenFailedErr = -8988,
8096   codecDroppedFrameErr = -8989,
8097   directXObjectAlreadyExists = -8990,
8098   lockPortBitsWrongGDeviceErr = -8991,
8099   codecOffscreenFailedPleaseRetryErr = -8992,
8100   badCodecCharacterizationErr = -8993,
8101   noThumbnailFoundErr = -8994
8102 };
8103
8104
8105
8106 enum {
8107   kBadAdapterErr = -9050,
8108   kBadAttributeErr = -9051,
8109   kBadBaseErr = -9052,
8110   kBadEDCErr = -9053,
8111   kBadIRQErr = -9054,
8112   kBadOffsetErr = -9055,
8113   kBadPageErr = -9056,
8114   kBadSizeErr = -9057,
8115   kBadSocketErr = -9058,
8116   kBadTypeErr = -9059,
8117   kBadVccErr = -9060,
8118   kBadVppErr = -9061,
8119   kBadWindowErr = -9062,
8120   kBadArgLengthErr = -9063,
8121   kBadArgsErr = -9064,
8122   kBadHandleErr = -9065,
8123   kBadCISErr = -9066,
8124   kBadSpeedErr = -9067,
8125   kReadFailureErr = -9068,
8126   kWriteFailureErr = -9069,
8127   kGeneralFailureErr = -9070,
8128   kNoCardErr = -9071,
8129   kUnsupportedFunctionErr = -9072,
8130   kUnsupportedModeErr = -9073,
8131   kBusyErr = -9074,
8132   kWriteProtectedErr = -9075,
8133   kConfigurationLockedErr = -9076,
8134   kInUseErr = -9077,
8135   kNoMoreItemsErr = -9078,
8136   kOutOfResourceErr = -9079,
8137   kNoCardSevicesSocketsErr = -9080,
8138   kInvalidRegEntryErr = -9081,
8139   kBadLinkErr = -9082,
8140   kBadDeviceErr = -9083,
8141   k16BitCardErr = -9084,
8142   kCardBusCardErr = -9085,
8143   kPassCallToChainErr = -9086,
8144   kCantConfigureCardErr = -9087,
8145   kPostCardEventErr = -9088,
8146   kInvalidDeviceNumber = -9089,
8147   kUnsupportedVsErr = -9090,
8148   kInvalidCSClientErr = -9091,
8149   kBadTupleDataErr = -9092,
8150   kBadCustomIFIDErr = -9093,
8151   kNoIOWindowRequestedErr = -9094,
8152   kNoMoreTimerClientsErr = -9095,
8153   kNoMoreInterruptSlotsErr = -9096,
8154   kNoClientTableErr = -9097,
8155   kUnsupportedCardErr = -9098,
8156   kNoCardEnablersFoundErr = -9099,
8157   kNoEnablerForCardErr = -9100,
8158   kNoCompatibleNameErr = -9101,
8159   kClientRequestDenied = -9102,
8160
8161   kNotReadyErr = -9103,
8162   kTooManyIOWindowsErr = -9104,
8163   kAlreadySavedStateErr = -9105,
8164   kAttemptDupCardEntryErr = -9106,
8165   kCardPowerOffErr = -9107,
8166   kNotZVCapableErr = -9108,
8167   kNoCardBusCISErr = -9109
8168 };
8169
8170
8171 enum {
8172   noDeviceForChannel = -9400,
8173   grabTimeComplete = -9401,
8174   cantDoThatInCurrentMode = -9402,
8175   notEnoughMemoryToGrab = -9403,
8176   notEnoughDiskSpaceToGrab = -9404,
8177   couldntGetRequiredComponent = -9405,
8178   badSGChannel = -9406,
8179   seqGrabInfoNotAvailable = -9407,
8180   deviceCantMeetRequest = -9408,
8181   badControllerHeight = -9994,
8182   editingNotAllowed = -9995,
8183   controllerBoundsNotExact = -9996,
8184   cannotSetWidthOfAttachedController = -9997,
8185   controllerHasFixedHeight = -9998,
8186   cannotMoveAttachedController = -9999
8187 };
8188
8189
8190 enum {
8191   errAEBadKeyForm = -10002,
8192   errAECantHandleClass = -10010,
8193   errAECantSupplyType = -10009,
8194   errAECantUndo = -10015,
8195   errAEEventFailed = -10000,
8196   errAEIndexTooLarge = -10007,
8197   errAEInTransaction = -10011,
8198   errAELocalOnly = -10016,
8199   errAENoSuchTransaction = -10012,
8200   errAENotAnElement = -10008,
8201   errAENotASingleObject = -10014,
8202   errAENotModifiable = -10003,
8203   errAENoUserSelection = -10013,
8204   errAEPrivilegeError = -10004,
8205   errAEReadDenied = -10005,
8206   errAETypeError = -10001,
8207   errAEWriteDenied = -10006,
8208   errAENotAnEnumMember = -10023,
8209   errAECantPutThatThere = -10024,
8210   errAEPropertiesClash = -10025
8211 };
8212
8213
8214 enum {
8215   telGenericError = -1,
8216   telNoErr = 0,
8217   telNoTools = 8,
8218   telBadTermErr = -10001,
8219   telBadDNErr = -10002,
8220   telBadCAErr = -10003,
8221   telBadHandErr = -10004,
8222   telBadProcErr = -10005,
8223   telCAUnavail = -10006,
8224   telNoMemErr = -10007,
8225   telNoOpenErr = -10008,
8226   telBadHTypeErr = -10010,
8227   telHTypeNotSupp = -10011,
8228   telBadLevelErr = -10012,
8229   telBadVTypeErr = -10013,
8230   telVTypeNotSupp = -10014,
8231   telBadAPattErr = -10015,
8232   telAPattNotSupp = -10016,
8233   telBadIndex = -10017,
8234   telIndexNotSupp = -10018,
8235   telBadStateErr = -10019,
8236   telStateNotSupp = -10020,
8237   telBadIntExt = -10021,
8238   telIntExtNotSupp = -10022,
8239   telBadDNDType = -10023,
8240   telDNDTypeNotSupp = -10024,
8241   telFeatNotSub = -10030,
8242   telFeatNotAvail = -10031,
8243   telFeatActive = -10032,
8244   telFeatNotSupp = -10033,
8245   telConfLimitErr = -10040,
8246   telConfNoLimit = -10041,
8247   telConfErr = -10042,
8248   telConfRej = -10043,
8249   telTransferErr = -10044,
8250   telTransferRej = -10045,
8251   telCBErr = -10046,
8252   telConfLimitExceeded = -10047,
8253   telBadDNType = -10050,
8254   telBadPageID = -10051,
8255   telBadIntercomID = -10052,
8256   telBadFeatureID = -10053,
8257   telBadFwdType = -10054,
8258   telBadPickupGroupID = -10055,
8259   telBadParkID = -10056,
8260   telBadSelect = -10057,
8261   telBadBearerType = -10058,
8262   telBadRate = -10059,
8263   telDNTypeNotSupp = -10060,
8264   telFwdTypeNotSupp = -10061,
8265   telBadDisplayMode = -10062,
8266   telDisplayModeNotSupp = -10063,
8267   telNoCallbackRef = -10064,
8268   telAlreadyOpen = -10070,
8269   telStillNeeded = -10071,
8270   telTermNotOpen = -10072,
8271   telCANotAcceptable = -10080,
8272   telCANotRejectable = -10081,
8273   telCANotDeflectable = -10082,
8274   telPBErr = -10090,
8275   telBadFunction = -10091,
8276
8277   telNoSuchTool = -10102,
8278   telUnknownErr = -10103,
8279   telNoCommFolder = -10106,
8280   telInitFailed = -10107,
8281   telBadCodeResource = -10108,
8282   telDeviceNotFound = -10109,
8283   telBadProcID = -10110,
8284   telValidateFailed = -10111,
8285   telAutoAnsNotOn = -10112,
8286   telDetAlreadyOn = -10113,
8287   telBadSWErr = -10114,
8288   telBadSampleRate = -10115,
8289   telNotEnoughdspBW = -10116
8290 };
8291
8292 enum {
8293   errTaskNotFound = -10780
8294 };
8295
8296
8297
8298
8299
8300 enum {
8301
8302   pmBusyErr = -13000,
8303   pmReplyTOErr = -13001,
8304   pmSendStartErr = -13002,
8305   pmSendEndErr = -13003,
8306   pmRecvStartErr = -13004,
8307   pmRecvEndErr = -13005
8308 };
8309
8310
8311 enum {
8312   kPowerHandlerExistsForDeviceErr = -13006,
8313   kPowerHandlerNotFoundForDeviceErr = -13007,
8314   kPowerHandlerNotFoundForProcErr = -13008,
8315   kPowerMgtMessageNotHandled = -13009,
8316   kPowerMgtRequestDenied = -13010,
8317   kCantReportProcessorTemperatureErr = -13013,
8318   kProcessorTempRoutineRequiresMPLib2 = -13014,
8319   kNoSuchPowerSource = -13020,
8320   kBridgeSoftwareRunningCantSleep = -13038
8321 };
8322
8323
8324
8325 enum {
8326   debuggingExecutionContextErr = -13880,
8327   debuggingDuplicateSignatureErr = -13881,
8328   debuggingDuplicateOptionErr = -13882,
8329   debuggingInvalidSignatureErr = -13883,
8330   debuggingInvalidOptionErr = -13884,
8331   debuggingInvalidNameErr = -13885,
8332   debuggingNoCallbackErr = -13886,
8333   debuggingNoMatchErr = -13887
8334 };
8335
8336
8337
8338 enum {
8339   kHIDVersionIncompatibleErr = -13909,
8340   kHIDDeviceNotReady = -13910
8341 };
8342
8343
8344
8345 enum {
8346   kHIDSuccess = 0,
8347   kHIDInvalidRangePageErr = -13923,
8348   kHIDReportIDZeroErr = -13924,
8349   kHIDReportCountZeroErr = -13925,
8350   kHIDReportSizeZeroErr = -13926,
8351   kHIDUnmatchedDesignatorRangeErr = -13927,
8352   kHIDUnmatchedStringRangeErr = -13928,
8353   kHIDInvertedUsageRangeErr = -13929,
8354   kHIDUnmatchedUsageRangeErr = -13930,
8355   kHIDInvertedPhysicalRangeErr = -13931,
8356   kHIDInvertedLogicalRangeErr = -13932,
8357   kHIDBadLogicalMaximumErr = -13933,
8358   kHIDBadLogicalMinimumErr = -13934,
8359   kHIDUsagePageZeroErr = -13935,
8360   kHIDEndOfDescriptorErr = -13936,
8361   kHIDNotEnoughMemoryErr = -13937,
8362   kHIDBadParameterErr = -13938,
8363   kHIDNullPointerErr = -13939,
8364   kHIDInvalidReportLengthErr = -13940,
8365   kHIDInvalidReportTypeErr = -13941,
8366   kHIDBadLogPhysValuesErr = -13942,
8367   kHIDIncompatibleReportErr = -13943,
8368   kHIDInvalidPreparsedDataErr = -13944,
8369   kHIDNotValueArrayErr = -13945,
8370   kHIDUsageNotFoundErr = -13946,
8371   kHIDValueOutOfRangeErr = -13947,
8372   kHIDBufferTooSmallErr = -13948,
8373   kHIDNullStateErr = -13949,
8374   kHIDBaseError = -13950
8375 };
8376
8377
8378
8379 enum {
8380   kModemOutOfMemory = -14000,
8381   kModemPreferencesMissing = -14001,
8382   kModemScriptMissing = -14002
8383 };
8384
8385
8386
8387
8388 enum {
8389   kTXNEndIterationErr = -22000,
8390   kTXNCannotAddFrameErr = -22001,
8391   kTXNInvalidFrameIDErr = -22002,
8392   kTXNIllegalToCrossDataBoundariesErr = -22003,
8393   kTXNUserCanceledOperationErr = -22004,
8394   kTXNBadDefaultFileTypeWarning = -22005,
8395   kTXNCannotSetAutoIndentErr = -22006,
8396   kTXNRunIndexOutofBoundsErr = -22007,
8397   kTXNNoMatchErr = -22008,
8398   kTXNAttributeTagInvalidForRunErr = -22009,
8399   kTXNSomeOrAllTagsInvalidForRunErr = -22010,
8400   kTXNInvalidRunIndex = -22011,
8401   kTXNAlreadyInitializedErr = -22012,
8402   kTXNCannotTurnTSMOffWhenUsingUnicodeErr = -22013,
8403   kTXNCopyNotAllowedInEchoModeErr = -22014,
8404   kTXNDataTypeNotAllowedErr = -22015,
8405   kTXNATSUIIsNotInstalledErr = -22016,
8406   kTXNOutsideOfLineErr = -22017,
8407   kTXNOutsideOfFrameErr = -22018
8408 };
8409
8410
8411
8412
8413
8414 enum {
8415   printerStatusOpCodeNotSupportedErr = -25280
8416 };
8417
8418
8419
8420 enum {
8421   errKCNotAvailable = -25291,
8422   errKCReadOnly = -25292,
8423   errKCAuthFailed = -25293,
8424   errKCNoSuchKeychain = -25294,
8425   errKCInvalidKeychain = -25295,
8426   errKCDuplicateKeychain = -25296,
8427   errKCDuplicateCallback = -25297,
8428   errKCInvalidCallback = -25298,
8429   errKCDuplicateItem = -25299,
8430   errKCItemNotFound = -25300,
8431   errKCBufferTooSmall = -25301,
8432   errKCDataTooLarge = -25302,
8433   errKCNoSuchAttr = -25303,
8434   errKCInvalidItemRef = -25304,
8435   errKCInvalidSearchRef = -25305,
8436   errKCNoSuchClass = -25306,
8437   errKCNoDefaultKeychain = -25307,
8438   errKCInteractionNotAllowed = -25308,
8439   errKCReadOnlyAttr = -25309,
8440   errKCWrongKCVersion = -25310,
8441   errKCKeySizeNotAllowed = -25311,
8442   errKCNoStorageModule = -25312,
8443   errKCNoCertificateModule = -25313,
8444   errKCNoPolicyModule = -25314,
8445   errKCInteractionRequired = -25315,
8446   errKCDataNotAvailable = -25316,
8447   errKCDataNotModifiable = -25317,
8448   errKCCreateChainFailed = -25318
8449 };
8450
8451
8452
8453 enum {
8454   kUCOutputBufferTooSmall = -25340,
8455   kUCTextBreakLocatorMissingType = -25341
8456 };
8457
8458 enum {
8459   kUCTSNoKeysAddedToObjectErr = -25342,
8460   kUCTSSearchListErr = -25343
8461 };
8462
8463
8464 enum {
8465   kMPIterationEndErr = -29275,
8466   kMPPrivilegedErr = -29276,
8467   kMPProcessCreatedErr = -29288,
8468   kMPProcessTerminatedErr = -29289,
8469   kMPTaskCreatedErr = -29290,
8470   kMPTaskBlockedErr = -29291,
8471   kMPTaskStoppedErr = -29292,
8472   kMPBlueBlockingErr = -29293,
8473   kMPDeletedErr = -29295,
8474   kMPTimeoutErr = -29296,
8475   kMPTaskAbortedErr = -29297,
8476   kMPInsufficientResourcesErr = -29298,
8477   kMPInvalidIDErr = -29299
8478 };
8479
8480 enum {
8481   kMPNanokernelNeedsMemoryErr = -29294
8482 };
8483
8484
8485 enum {
8486   kCollateAttributesNotFoundErr = -29500,
8487   kCollateInvalidOptions = -29501,
8488   kCollateMissingUnicodeTableErr = -29502,
8489   kCollateUnicodeConvertFailedErr = -29503,
8490   kCollatePatternNotFoundErr = -29504,
8491   kCollateInvalidChar = -29505,
8492   kCollateBufferTooSmall = -29506,
8493   kCollateInvalidCollationRef = -29507
8494 };
8495
8496
8497
8498 enum {
8499   kFNSInvalidReferenceErr = -29580,
8500   kFNSBadReferenceVersionErr = -29581,
8501   kFNSInvalidProfileErr = -29582,
8502   kFNSBadProfileVersionErr = -29583,
8503   kFNSDuplicateReferenceErr = -29584,
8504   kFNSMismatchErr = -29585,
8505   kFNSInsufficientDataErr = -29586,
8506   kFNSBadFlattenedSizeErr = -29587,
8507   kFNSNameNotFoundErr = -29589
8508 };
8509
8510
8511
8512
8513 enum {
8514   kLocalesBufferTooSmallErr = -30001,
8515   kLocalesTableFormatErr = -30002,
8516   kLocalesDefaultDisplayStatus = -30029
8517 };
8518
8519
8520
8521 enum {
8522   kALMInternalErr = -30049,
8523   kALMGroupNotFoundErr = -30048,
8524   kALMNoSuchModuleErr = -30047,
8525   kALMModuleCommunicationErr = -30046,
8526   kALMDuplicateModuleErr = -30045,
8527   kALMInstallationErr = -30044,
8528   kALMDeferSwitchErr = -30043,
8529   kALMRebootFlagsLevelErr = -30042
8530 };
8531
8532 enum {
8533   kALMLocationNotFoundErr = kALMGroupNotFoundErr
8534 };
8535
8536
8537
8538 enum {
8539   kSSpInternalErr = -30340,
8540   kSSpVersionErr = -30341,
8541   kSSpCantInstallErr = -30342,
8542   kSSpParallelUpVectorErr = -30343,
8543   kSSpScaleToZeroErr = -30344
8544 };
8545
8546
8547
8548 enum {
8549   kNSpInitializationFailedErr = -30360,
8550   kNSpAlreadyInitializedErr = -30361,
8551   kNSpTopologyNotSupportedErr = -30362,
8552   kNSpPipeFullErr = -30364,
8553   kNSpHostFailedErr = -30365,
8554   kNSpProtocolNotAvailableErr = -30366,
8555   kNSpInvalidGameRefErr = -30367,
8556   kNSpInvalidParameterErr = -30369,
8557   kNSpOTNotPresentErr = -30370,
8558   kNSpOTVersionTooOldErr = -30371,
8559   kNSpMemAllocationErr = -30373,
8560   kNSpAlreadyAdvertisingErr = -30374,
8561   kNSpNotAdvertisingErr = -30376,
8562   kNSpInvalidAddressErr = -30377,
8563   kNSpFreeQExhaustedErr = -30378,
8564   kNSpRemovePlayerFailedErr = -30379,
8565   kNSpAddressInUseErr = -30380,
8566   kNSpFeatureNotImplementedErr = -30381,
8567   kNSpNameRequiredErr = -30382,
8568   kNSpInvalidPlayerIDErr = -30383,
8569   kNSpInvalidGroupIDErr = -30384,
8570   kNSpNoPlayersErr = -30385,
8571   kNSpNoGroupsErr = -30386,
8572   kNSpNoHostVolunteersErr = -30387,
8573   kNSpCreateGroupFailedErr = -30388,
8574   kNSpAddPlayerFailedErr = -30389,
8575   kNSpInvalidDefinitionErr = -30390,
8576   kNSpInvalidProtocolRefErr = -30391,
8577   kNSpInvalidProtocolListErr = -30392,
8578   kNSpTimeoutErr = -30393,
8579   kNSpGameTerminatedErr = -30394,
8580   kNSpConnectFailedErr = -30395,
8581   kNSpSendFailedErr = -30396,
8582   kNSpMessageTooBigErr = -30397,
8583   kNSpCantBlockErr = -30398,
8584   kNSpJoinFailedErr = -30399
8585 };
8586
8587
8588
8589 enum {
8590   kISpInternalErr = -30420,
8591   kISpSystemListErr = -30421,
8592   kISpBufferToSmallErr = -30422,
8593   kISpElementInListErr = -30423,
8594   kISpElementNotInListErr = -30424,
8595   kISpSystemInactiveErr = -30425,
8596   kISpDeviceInactiveErr = -30426,
8597   kISpSystemActiveErr = -30427,
8598   kISpDeviceActiveErr = -30428,
8599   kISpListBusyErr = -30429
8600 };
8601
8602
8603 enum {
8604   kDSpNotInitializedErr = -30440L,
8605   kDSpSystemSWTooOldErr = -30441L,
8606   kDSpInvalidContextErr = -30442L,
8607   kDSpInvalidAttributesErr = -30443L,
8608   kDSpContextAlreadyReservedErr = -30444L,
8609   kDSpContextNotReservedErr = -30445L,
8610   kDSpContextNotFoundErr = -30446L,
8611   kDSpFrameRateNotReadyErr = -30447L,
8612   kDSpConfirmSwitchWarning = -30448L,
8613   kDSpInternalErr = -30449L,
8614   kDSpStereoContextErr = -30450L
8615 };
8616
8617
8618
8619
8620
8621
8622
8623 enum {
8624   kFBCvTwinExceptionErr = -30500,
8625   kFBCnoIndexesFound = -30501,
8626   kFBCallocFailed = -30502,
8627   kFBCbadParam = -30503,
8628   kFBCfileNotIndexed = -30504,
8629   kFBCbadIndexFile = -30505,
8630   kFBCcompactionFailed = -30506,
8631   kFBCvalidationFailed = -30507,
8632   kFBCindexingFailed = -30508,
8633   kFBCcommitFailed = -30509,
8634   kFBCdeletionFailed = -30510,
8635   kFBCmoveFailed = -30511,
8636   kFBCtokenizationFailed = -30512,
8637   kFBCmergingFailed = -30513,
8638   kFBCindexCreationFailed = -30514,
8639   kFBCaccessorStoreFailed = -30515,
8640   kFBCaddDocFailed = -30516,
8641   kFBCflushFailed = -30517,
8642   kFBCindexNotFound = -30518,
8643   kFBCnoSearchSession = -30519,
8644   kFBCindexingCanceled = -30520,
8645   kFBCaccessCanceled = -30521,
8646   kFBCindexFileDestroyed = -30522,
8647   kFBCindexNotAvailable = -30523,
8648   kFBCsearchFailed = -30524,
8649   kFBCsomeFilesNotIndexed = -30525,
8650   kFBCillegalSessionChange = -30526,
8651
8652   kFBCanalysisNotAvailable = -30527,
8653   kFBCbadIndexFileVersion = -30528,
8654   kFBCsummarizationCanceled = -30529,
8655   kFBCindexDiskIOFailed = -30530,
8656   kFBCbadSearchSession = -30531,
8657   kFBCnoSuchHit = -30532
8658 };
8659
8660
8661
8662 enum {
8663   notAQTVRMovieErr = -30540,
8664   constraintReachedErr = -30541,
8665   callNotSupportedByNodeErr = -30542,
8666   selectorNotSupportedByNodeErr = -30543,
8667   invalidNodeIDErr = -30544,
8668   invalidViewStateErr = -30545,
8669   timeNotInViewErr = -30546,
8670   propertyNotSupportedByNodeErr = -30547,
8671   settingNotSupportedByNodeErr = -30548,
8672   limitReachedErr = -30549,
8673   invalidNodeFormatErr = -30550,
8674   invalidHotSpotIDErr = -30551,
8675   noMemoryNodeFailedInitialize = -30552,
8676   streamingNodeNotReadyErr = -30553,
8677   qtvrLibraryLoadErr = -30554,
8678   qtvrUninitialized = -30555
8679 };
8680
8681
8682
8683 enum {
8684   themeInvalidBrushErr = -30560,
8685   themeProcessRegisteredErr = -30561,
8686   themeProcessNotRegisteredErr = -30562,
8687   themeBadTextColorErr = -30563,
8688   themeHasNoAccentsErr = -30564,
8689   themeBadCursorIndexErr = -30565,
8690   themeScriptFontNotFoundErr = -30566,
8691   themeMonitorDepthNotSupportedErr = -30567,
8692   themeNoAppropriateBrushErr = -30568
8693 };
8694
8695
8696
8697 enum {
8698   errMessageNotSupported = -30580,
8699   errDataNotSupported = -30581,
8700   errControlDoesntSupportFocus = -30582,
8701   errUnknownControl = -30584,
8702   errCouldntSetFocus = -30585,
8703   errNoRootControl = -30586,
8704   errRootAlreadyExists = -30587,
8705   errInvalidPartCode = -30588,
8706   errControlsAlreadyExist = -30589,
8707   errControlIsNotEmbedder = -30590,
8708   errDataSizeMismatch = -30591,
8709   errControlHiddenOrDisabled = -30592,
8710   errCantEmbedIntoSelf = -30594,
8711   errCantEmbedRoot = -30595,
8712   errItemNotControl = -30596,
8713   controlInvalidDataVersionErr = -30597,
8714   controlPropertyInvalid = -5603,
8715   controlPropertyNotFoundErr = -5604,
8716   controlHandleInvalidErr = -30599
8717 };
8718
8719
8720
8721
8722
8723 enum {
8724   kURLInvalidURLReferenceError = -30770,
8725   kURLProgressAlreadyDisplayedError = -30771,
8726   kURLDestinationExistsError = -30772,
8727   kURLInvalidURLError = -30773,
8728   kURLUnsupportedSchemeError = -30774,
8729   kURLServerBusyError = -30775,
8730   kURLAuthenticationError = -30776,
8731   kURLPropertyNotYetKnownError = -30777,
8732   kURLUnknownPropertyError = -30778,
8733   kURLPropertyBufferTooSmallError = -30779,
8734   kURLUnsettablePropertyError = -30780,
8735   kURLInvalidCallError = -30781,
8736   kURLFileEmptyError = -30783,
8737   kURLExtensionFailureError = -30785,
8738   kURLInvalidConfigurationError = -30786,
8739   kURLAccessNotAvailableError = -30787,
8740   kURL68kNotSupportedError = -30788
8741 };
8742
8743
8744
8745 enum {
8746   badComponentInstance = (long)0x80008001,
8747   badComponentSelector = (long)0x80008002
8748 };
8749
8750
8751
8752 enum {
8753   dsBusError = 1,
8754   dsAddressErr = 2,
8755   dsIllInstErr = 3,
8756   dsZeroDivErr = 4,
8757   dsChkErr = 5,
8758   dsOvflowErr = 6,
8759   dsPrivErr = 7,
8760   dsTraceErr = 8,
8761   dsLineAErr = 9,
8762   dsLineFErr = 10,
8763   dsMiscErr = 11,
8764   dsCoreErr = 12,
8765   dsIrqErr = 13,
8766   dsIOCoreErr = 14,
8767   dsLoadErr = 15,
8768   dsFPErr = 16,
8769   dsNoPackErr = 17,
8770   dsNoPk1 = 18,
8771   dsNoPk2 = 19
8772 };
8773
8774 enum {
8775   dsNoPk3 = 20,
8776   dsNoPk4 = 21,
8777   dsNoPk5 = 22,
8778   dsNoPk6 = 23,
8779   dsNoPk7 = 24,
8780   dsMemFullErr = 25,
8781   dsBadLaunch = 26,
8782   dsFSErr = 27,
8783   dsStknHeap = 28,
8784   negZcbFreeErr = 33,
8785   dsFinderErr = 41,
8786   dsBadSlotInt = 51,
8787   dsBadSANEOpcode = 81,
8788   dsBadPatchHeader = 83,
8789   menuPrgErr = 84,
8790   dsMBarNFnd = 85,
8791   dsHMenuFindErr = 86,
8792   dsWDEFNotFound = 87,
8793   dsCDEFNotFound = 88,
8794   dsMDEFNotFound = 89
8795 };
8796
8797 enum {
8798   dsNoFPU = 90,
8799   dsNoPatch = 98,
8800   dsBadPatch = 99,
8801   dsParityErr = 101,
8802   dsOldSystem = 102,
8803   ds32BitMode = 103,
8804   dsNeedToWriteBootBlocks = 104,
8805   dsNotEnoughRAMToBoot = 105,
8806   dsBufPtrTooLow = 106,
8807   dsVMDeferredFuncTableFull = 112,
8808   dsVMBadBackingStore = 113,
8809   dsCantHoldSystemHeap = 114,
8810   dsSystemRequiresPowerPC = 116,
8811   dsGibblyMovedToDisabledFolder = 117,
8812   dsUnBootableSystem = 118,
8813   dsMustUseFCBAccessors = 119,
8814   dsMacOSROMVersionTooOld = 120,
8815   dsLostConnectionToNetworkDisk = 121,
8816   dsRAMDiskTooBig = 122,
8817   dsWriteToSupervisorStackGuardPage = 128,
8818   dsReinsert = 30,
8819   shutDownAlert = 42,
8820   dsShutDownOrRestart = 20000,
8821   dsSwitchOffOrRestart = 20001,
8822   dsForcedQuit = 20002,
8823   dsRemoveDisk = 20003,
8824   dsDirtyDisk = 20004,
8825   dsShutDownOrResume = 20109,
8826   dsSCSIWarn = 20010,
8827   dsMBSysError = 29200,
8828   dsMBFlpySysError = 29201,
8829   dsMBATASysError = 29202,
8830   dsMBATAPISysError = 29203,
8831   dsMBExternFlpySysError = 29204,
8832   dsPCCardATASysError = 29205
8833 };
8834
8835
8836
8837
8838
8839
8840 enum {
8841   dsNoExtsMacsBug = -1,
8842   dsNoExtsDisassembler = -2,
8843   dsMacsBugInstalled = -10,
8844   dsDisassemblerInstalled = -11,
8845   dsExtensionsDisabled = -13,
8846   dsGreeting = 40,
8847   dsSysErr = 32767,
8848
8849   WDEFNFnd = dsWDEFNotFound
8850 };
8851
8852 enum {
8853   CDEFNFnd = dsCDEFNotFound,
8854   dsNotThe1 = 31,
8855   dsBadStartupDisk = 42,
8856   dsSystemFileErr = 43,
8857   dsHD20Installed = -12,
8858   mBarNFnd = -126,
8859   fsDSIntErr = -127,
8860   hMenuFindErr = -127,
8861   userBreak = -490,
8862   strUserBreak = -491,
8863   exUserBreak = -492
8864 };
8865
8866
8867 enum {
8868
8869   dsBadLibrary = 1010,
8870   dsMixedModeFailure = 1011
8871 };
8872 extern void
8873 SysError(short errorCode) ;
8874
8875
8876
8877
8878
8879
8880 }
8881 extern "C" {
8882
8883
8884
8885
8886 enum {
8887   kUTCDefaultOptions = 0
8888 };
8889
8890
8891 struct UTCDateTime {
8892   UInt16 highSeconds;
8893   UInt32 lowSeconds;
8894   UInt16 fraction;
8895 };
8896 typedef struct UTCDateTime UTCDateTime;
8897 typedef UTCDateTime * UTCDateTimePtr;
8898 typedef UTCDateTimePtr * UTCDateTimeHandle;
8899 struct LocalDateTime {
8900   UInt16 highSeconds;
8901   UInt32 lowSeconds;
8902   UInt16 fraction;
8903 };
8904 typedef struct LocalDateTime LocalDateTime;
8905 typedef LocalDateTime * LocalDateTimePtr;
8906 typedef LocalDateTimePtr * LocalDateTimeHandle;
8907 extern OSStatus
8908 ConvertLocalTimeToUTC(
8909   UInt32 localSeconds,
8910   UInt32 * utcSeconds) ;
8911 extern OSStatus
8912 ConvertUTCToLocalTime(
8913   UInt32 utcSeconds,
8914   UInt32 * localSeconds) ;
8915 extern OSStatus
8916 ConvertUTCToLocalDateTime(
8917   const UTCDateTime * utcDateTime,
8918   LocalDateTime * localDateTime) ;
8919 extern OSStatus
8920 ConvertLocalToUTCDateTime(
8921   const LocalDateTime * localDateTime,
8922   UTCDateTime * utcDateTime) ;
8923 extern OSStatus
8924 GetUTCDateTime(
8925   UTCDateTime * utcDateTime,
8926   OptionBits options) ;
8927 extern OSStatus
8928 SetUTCDateTime(
8929   const UTCDateTime * utcDateTime,
8930   OptionBits options) ;
8931 extern OSStatus
8932 GetLocalDateTime(
8933   LocalDateTime * localDateTime,
8934   OptionBits options) ;
8935 extern OSStatus
8936 SetLocalDateTime(
8937   const LocalDateTime * localDateTime,
8938   OptionBits options) ;
8939
8940
8941
8942
8943
8944 }
8945
8946
8947
8948 extern "C" {
8949
8950
8951
8952
8953
8954 typedef UInt32 TextEncodingBase;
8955 enum {
8956
8957   kTextEncodingMacRoman = 0L,
8958   kTextEncodingMacJapanese = 1,
8959   kTextEncodingMacChineseTrad = 2,
8960   kTextEncodingMacKorean = 3,
8961   kTextEncodingMacArabic = 4,
8962   kTextEncodingMacHebrew = 5,
8963   kTextEncodingMacGreek = 6,
8964   kTextEncodingMacCyrillic = 7,
8965   kTextEncodingMacDevanagari = 9,
8966   kTextEncodingMacGurmukhi = 10,
8967   kTextEncodingMacGujarati = 11,
8968   kTextEncodingMacOriya = 12,
8969   kTextEncodingMacBengali = 13,
8970   kTextEncodingMacTamil = 14,
8971   kTextEncodingMacTelugu = 15,
8972   kTextEncodingMacKannada = 16,
8973   kTextEncodingMacMalayalam = 17,
8974   kTextEncodingMacSinhalese = 18,
8975   kTextEncodingMacBurmese = 19,
8976   kTextEncodingMacKhmer = 20,
8977   kTextEncodingMacThai = 21,
8978   kTextEncodingMacLaotian = 22,
8979   kTextEncodingMacGeorgian = 23,
8980   kTextEncodingMacArmenian = 24,
8981   kTextEncodingMacChineseSimp = 25,
8982   kTextEncodingMacTibetan = 26,
8983   kTextEncodingMacMongolian = 27,
8984   kTextEncodingMacEthiopic = 28,
8985   kTextEncodingMacCentralEurRoman = 29,
8986   kTextEncodingMacVietnamese = 30,
8987   kTextEncodingMacExtArabic = 31,
8988   kTextEncodingMacSymbol = 33,
8989   kTextEncodingMacDingbats = 34,
8990   kTextEncodingMacTurkish = 35,
8991   kTextEncodingMacCroatian = 36,
8992   kTextEncodingMacIcelandic = 37,
8993   kTextEncodingMacRomanian = 38,
8994   kTextEncodingMacCeltic = 39,
8995   kTextEncodingMacGaelic = 40,
8996   kTextEncodingMacKeyboardGlyphs = 41
8997 };
8998
8999
9000 enum {
9001   kTextEncodingMacTradChinese = kTextEncodingMacChineseTrad,
9002   kTextEncodingMacRSymbol = 8,
9003   kTextEncodingMacSimpChinese = kTextEncodingMacChineseSimp,
9004   kTextEncodingMacGeez = kTextEncodingMacEthiopic,
9005   kTextEncodingMacEastEurRoman = kTextEncodingMacCentralEurRoman,
9006   kTextEncodingMacUninterp = 32
9007 };
9008 enum {
9009   kTextEncodingMacUnicode = 0x7E
9010 };
9011
9012
9013 enum {
9014
9015   kTextEncodingMacFarsi = 0x8C,
9016
9017   kTextEncodingMacUkrainian = 0x98,
9018
9019   kTextEncodingMacInuit = 0xEC,
9020   kTextEncodingMacVT100 = 0xFC
9021 };
9022
9023
9024 enum {
9025   kTextEncodingMacHFS = 0xFF
9026 };
9027
9028
9029 enum {
9030   kTextEncodingUnicodeDefault = 0x0100,
9031   kTextEncodingUnicodeV1_1 = 0x0101,
9032   kTextEncodingISO10646_1993 = 0x0101,
9033   kTextEncodingUnicodeV2_0 = 0x0103,
9034   kTextEncodingUnicodeV2_1 = 0x0103,
9035   kTextEncodingUnicodeV3_0 = 0x0104,
9036   kTextEncodingUnicodeV3_1 = 0x0105,
9037   kTextEncodingUnicodeV3_2 = 0x0106
9038 };
9039
9040
9041 enum {
9042   kTextEncodingISOLatin1 = 0x0201,
9043   kTextEncodingISOLatin2 = 0x0202,
9044   kTextEncodingISOLatin3 = 0x0203,
9045   kTextEncodingISOLatin4 = 0x0204,
9046   kTextEncodingISOLatinCyrillic = 0x0205,
9047   kTextEncodingISOLatinArabic = 0x0206,
9048   kTextEncodingISOLatinGreek = 0x0207,
9049   kTextEncodingISOLatinHebrew = 0x0208,
9050   kTextEncodingISOLatin5 = 0x0209,
9051   kTextEncodingISOLatin6 = 0x020A,
9052   kTextEncodingISOLatin7 = 0x020D,
9053   kTextEncodingISOLatin8 = 0x020E,
9054   kTextEncodingISOLatin9 = 0x020F
9055 };
9056
9057
9058 enum {
9059   kTextEncodingDOSLatinUS = 0x0400,
9060   kTextEncodingDOSGreek = 0x0405,
9061   kTextEncodingDOSBalticRim = 0x0406,
9062   kTextEncodingDOSLatin1 = 0x0410,
9063   kTextEncodingDOSGreek1 = 0x0411,
9064   kTextEncodingDOSLatin2 = 0x0412,
9065   kTextEncodingDOSCyrillic = 0x0413,
9066   kTextEncodingDOSTurkish = 0x0414,
9067   kTextEncodingDOSPortuguese = 0x0415,
9068   kTextEncodingDOSIcelandic = 0x0416,
9069   kTextEncodingDOSHebrew = 0x0417,
9070   kTextEncodingDOSCanadianFrench = 0x0418,
9071   kTextEncodingDOSArabic = 0x0419,
9072   kTextEncodingDOSNordic = 0x041A,
9073   kTextEncodingDOSRussian = 0x041B,
9074   kTextEncodingDOSGreek2 = 0x041C,
9075   kTextEncodingDOSThai = 0x041D,
9076   kTextEncodingDOSJapanese = 0x0420,
9077   kTextEncodingDOSChineseSimplif = 0x0421,
9078   kTextEncodingDOSKorean = 0x0422,
9079   kTextEncodingDOSChineseTrad = 0x0423,
9080   kTextEncodingWindowsLatin1 = 0x0500,
9081   kTextEncodingWindowsANSI = 0x0500,
9082   kTextEncodingWindowsLatin2 = 0x0501,
9083   kTextEncodingWindowsCyrillic = 0x0502,
9084   kTextEncodingWindowsGreek = 0x0503,
9085   kTextEncodingWindowsLatin5 = 0x0504,
9086   kTextEncodingWindowsHebrew = 0x0505,
9087   kTextEncodingWindowsArabic = 0x0506,
9088   kTextEncodingWindowsBalticRim = 0x0507,
9089   kTextEncodingWindowsVietnamese = 0x0508,
9090   kTextEncodingWindowsKoreanJohab = 0x0510
9091 };
9092
9093
9094 enum {
9095   kTextEncodingUS_ASCII = 0x0600,
9096   kTextEncodingJIS_X0201_76 = 0x0620,
9097   kTextEncodingJIS_X0208_83 = 0x0621,
9098   kTextEncodingJIS_X0208_90 = 0x0622,
9099   kTextEncodingJIS_X0212_90 = 0x0623,
9100   kTextEncodingJIS_C6226_78 = 0x0624,
9101   kTextEncodingShiftJIS_X0213_00 = 0x0628,
9102   kTextEncodingGB_2312_80 = 0x0630,
9103   kTextEncodingGBK_95 = 0x0631,
9104   kTextEncodingGB_18030_2000 = 0x0632,
9105   kTextEncodingKSC_5601_87 = 0x0640,
9106   kTextEncodingKSC_5601_92_Johab = 0x0641,
9107   kTextEncodingCNS_11643_92_P1 = 0x0651,
9108   kTextEncodingCNS_11643_92_P2 = 0x0652,
9109   kTextEncodingCNS_11643_92_P3 = 0x0653
9110 };
9111
9112
9113 enum {
9114   kTextEncodingISO_2022_JP = 0x0820,
9115   kTextEncodingISO_2022_JP_2 = 0x0821,
9116   kTextEncodingISO_2022_JP_1 = 0x0822,
9117   kTextEncodingISO_2022_JP_3 = 0x0823,
9118   kTextEncodingISO_2022_CN = 0x0830,
9119   kTextEncodingISO_2022_CN_EXT = 0x0831,
9120   kTextEncodingISO_2022_KR = 0x0840
9121 };
9122
9123
9124 enum {
9125   kTextEncodingEUC_JP = 0x0920,
9126   kTextEncodingEUC_CN = 0x0930,
9127   kTextEncodingEUC_TW = 0x0931,
9128   kTextEncodingEUC_KR = 0x0940
9129 };
9130
9131
9132 enum {
9133   kTextEncodingShiftJIS = 0x0A01,
9134   kTextEncodingKOI8_R = 0x0A02,
9135   kTextEncodingBig5 = 0x0A03,
9136   kTextEncodingMacRomanLatin1 = 0x0A04,
9137   kTextEncodingHZ_GB_2312 = 0x0A05,
9138   kTextEncodingBig5_HKSCS_1999 = 0x0A06
9139 };
9140
9141
9142 enum {
9143   kTextEncodingNextStepLatin = 0x0B01,
9144   kTextEncodingNextStepJapanese = 0x0B02
9145 };
9146
9147
9148 enum {
9149   kTextEncodingEBCDIC_US = 0x0C01,
9150   kTextEncodingEBCDIC_CP037 = 0x0C02
9151 };
9152
9153
9154 enum {
9155   kTextEncodingMultiRun = 0x0FFF,
9156   kTextEncodingUnknown = 0xFFFF
9157 };
9158
9159
9160
9161 typedef UInt32 TextEncodingVariant;
9162
9163 enum {
9164   kTextEncodingDefaultVariant = 0
9165 };
9166
9167
9168 enum {
9169   kMacRomanDefaultVariant = 0,
9170   kMacRomanCurrencySignVariant = 1,
9171   kMacRomanEuroSignVariant = 2
9172 };
9173
9174
9175 enum {
9176   kMacCyrillicDefaultVariant = 0,
9177   kMacCyrillicCurrSignStdVariant = 1,
9178   kMacCyrillicCurrSignUkrVariant = 2,
9179   kMacCyrillicEuroSignVariant = 3
9180 };
9181
9182
9183 enum {
9184   kMacIcelandicStdDefaultVariant = 0,
9185   kMacIcelandicTTDefaultVariant = 1,
9186
9187   kMacIcelandicStdCurrSignVariant = 2,
9188   kMacIcelandicTTCurrSignVariant = 3,
9189
9190   kMacIcelandicStdEuroSignVariant = 4,
9191   kMacIcelandicTTEuroSignVariant = 5
9192 };
9193
9194
9195 enum {
9196   kMacCroatianDefaultVariant = 0,
9197   kMacCroatianCurrencySignVariant = 1,
9198   kMacCroatianEuroSignVariant = 2
9199 };
9200
9201
9202
9203 enum {
9204   kMacRomanianDefaultVariant = 0,
9205   kMacRomanianCurrencySignVariant = 1,
9206   kMacRomanianEuroSignVariant = 2
9207 };
9208
9209
9210
9211 enum {
9212   kMacJapaneseStandardVariant = 0,
9213   kMacJapaneseStdNoVerticalsVariant = 1,
9214   kMacJapaneseBasicVariant = 2,
9215   kMacJapanesePostScriptScrnVariant = 3,
9216   kMacJapanesePostScriptPrintVariant = 4,
9217   kMacJapaneseVertAtKuPlusTenVariant = 5
9218 };
9219
9220
9221 enum {
9222   kMacArabicStandardVariant = 0,
9223   kMacArabicTrueTypeVariant = 1,
9224   kMacArabicThuluthVariant = 2,
9225   kMacArabicAlBayanVariant = 3
9226 };
9227
9228
9229 enum {
9230   kMacFarsiStandardVariant = 0,
9231   kMacFarsiTrueTypeVariant = 1
9232 };
9233
9234
9235 enum {
9236   kMacHebrewStandardVariant = 0,
9237   kMacHebrewFigureSpaceVariant = 1
9238 };
9239
9240
9241 enum {
9242   kMacVT100DefaultVariant = 0,
9243   kMacVT100CurrencySignVariant = 1,
9244   kMacVT100EuroSignVariant = 2
9245 };
9246
9247
9248 enum {
9249   kUnicodeNoSubset = 0,
9250   kUnicodeCanonicalDecompVariant = 2,
9251   kUnicodeCanonicalCompVariant = 3,
9252   kUnicodeHFSPlusDecompVariant = 8,
9253   kUnicodeHFSPlusCompVariant = 9
9254 };
9255
9256
9257 enum {
9258   kBig5_BasicVariant = 0,
9259   kBig5_StandardVariant = 1,
9260   kBig5_ETenVariant = 2
9261 };
9262
9263
9264 enum {
9265   kMacRomanLatin1DefaultVariant = 0,
9266   kMacRomanLatin1StandardVariant = 2,
9267   kMacRomanLatin1TurkishVariant = 6,
9268   kMacRomanLatin1CroatianVariant = 8,
9269   kMacRomanLatin1IcelandicVariant = 11,
9270   kMacRomanLatin1RomanianVariant = 14
9271 };
9272
9273
9274 enum {
9275   kUnicodeNoCompatibilityVariant = 1,
9276   kUnicodeNoCorporateVariant = 4
9277 };
9278
9279
9280 enum {
9281   kMacRomanStandardVariant = 0,
9282   kMacIcelandicStandardVariant = 0,
9283   kMacIcelandicTrueTypeVariant = 1,
9284   kJapaneseStandardVariant = 0,
9285   kJapaneseStdNoVerticalsVariant = 1,
9286   kJapaneseBasicVariant = 2,
9287   kJapanesePostScriptScrnVariant = 3,
9288   kJapanesePostScriptPrintVariant = 4,
9289   kJapaneseVertAtKuPlusTenVariant = 5,
9290
9291   kHebrewStandardVariant = 0,
9292   kHebrewFigureSpaceVariant = 1,
9293   kUnicodeMaxDecomposedVariant = 2,
9294   kUnicodeNoComposedVariant = 3,
9295
9296
9297   kJapaneseNoOneByteKanaOption = 0x20,
9298   kJapaneseUseAsciiBackslashOption = 0x40
9299 };
9300
9301
9302 typedef UInt32 TextEncodingFormat;
9303 enum {
9304
9305   kTextEncodingDefaultFormat = 0,
9306   kUnicode16BitFormat = 0,
9307   kUnicodeUTF7Format = 1,
9308   kUnicodeUTF8Format = 2,
9309   kUnicode32BitFormat = 3
9310 };
9311
9312
9313 typedef UInt32 TextEncoding;
9314
9315 typedef UInt32 TextEncodingNameSelector;
9316 enum {
9317   kTextEncodingFullName = 0,
9318   kTextEncodingBaseName = 1,
9319   kTextEncodingVariantName = 2,
9320   kTextEncodingFormatName = 3
9321 };
9322
9323
9324 struct TextEncodingRun {
9325   ByteOffset offset;
9326   TextEncoding textEncoding;
9327 };
9328 typedef struct TextEncodingRun TextEncodingRun;
9329 typedef TextEncodingRun * TextEncodingRunPtr;
9330 typedef const TextEncodingRun * ConstTextEncodingRunPtr;
9331 struct ScriptCodeRun {
9332   ByteOffset offset;
9333   ScriptCode script;
9334 };
9335 typedef struct ScriptCodeRun ScriptCodeRun;
9336 typedef ScriptCodeRun * ScriptCodeRunPtr;
9337 typedef const ScriptCodeRun * ConstScriptCodeRunPtr;
9338 typedef UInt8 * TextPtr;
9339 typedef const UInt8 * ConstTextPtr;
9340
9341 typedef UniChar * UniCharArrayPtr;
9342 typedef const UniChar * ConstUniCharArrayPtr;
9343
9344
9345
9346
9347 typedef UniCharArrayPtr * UniCharArrayHandle;
9348
9349
9350
9351
9352 typedef UInt32 UniCharArrayOffset;
9353
9354 enum {
9355   kTextScriptDontCare = -128,
9356   kTextLanguageDontCare = -128,
9357   kTextRegionDontCare = -128
9358 };
9359
9360
9361
9362 struct TECInfo {
9363   UInt16 format;
9364   UInt16 tecVersion;
9365   UInt32 tecTextConverterFeatures;
9366   UInt32 tecUnicodeConverterFeatures;
9367   UInt32 tecTextCommonFeatures;
9368   Str31 tecTextEncodingsFolderName;
9369   Str31 tecExtensionFileName;
9370   UInt16 tecLowestTEFileVersion;
9371   UInt16 tecHighestTEFileVersion;
9372 };
9373 typedef struct TECInfo TECInfo;
9374 typedef TECInfo * TECInfoPtr;
9375 typedef TECInfoPtr * TECInfoHandle;
9376
9377 enum {
9378   kTECInfoCurrentFormat = 2
9379 };
9380 enum {
9381   kTECKeepInfoFixBit = 0,
9382   kTECFallbackTextLengthFixBit = 1,
9383   kTECTextRunBitClearFixBit = 2,
9384   kTECTextToUnicodeScanFixBit = 3,
9385   kTECAddForceASCIIChangesBit = 4,
9386   kTECPreferredEncodingFixBit = 5,
9387   kTECAddTextRunHeuristicsBit = 6,
9388   kTECAddFallbackInterruptBit = 7
9389 };
9390
9391 enum {
9392   kTECKeepInfoFixMask = 1L << kTECKeepInfoFixBit,
9393   kTECFallbackTextLengthFixMask = 1L << kTECFallbackTextLengthFixBit,
9394   kTECTextRunBitClearFixMask = 1L << kTECTextRunBitClearFixBit,
9395   kTECTextToUnicodeScanFixMask = 1L << kTECTextToUnicodeScanFixBit,
9396   kTECAddForceASCIIChangesMask = 1L << kTECAddForceASCIIChangesBit,
9397   kTECPreferredEncodingFixMask = 1L << kTECPreferredEncodingFixBit,
9398   kTECAddTextRunHeuristicsMask = 1L << kTECAddTextRunHeuristicsBit,
9399   kTECAddFallbackInterruptMask = 1L << kTECAddFallbackInterruptBit
9400 };
9401
9402
9403
9404
9405
9406
9407
9408 enum {
9409   kUnicodeByteOrderMark = 0xFEFF,
9410   kUnicodeObjectReplacement = 0xFFFC,
9411   kUnicodeReplacementChar = 0xFFFD,
9412   kUnicodeSwappedByteOrderMark = 0xFFFE,
9413   kUnicodeNotAChar = 0xFFFF
9414 };
9415
9416
9417
9418
9419
9420
9421 typedef SInt32 UCCharPropertyType;
9422 enum {
9423   kUCCharPropTypeGenlCategory = 1,
9424   kUCCharPropTypeCombiningClass = 2,
9425   kUCCharPropTypeBidiCategory = 3
9426 };
9427
9428 typedef UInt32 UCCharPropertyValue;
9429
9430 enum {
9431
9432   kUCGenlCatOtherNotAssigned = 0,
9433   kUCGenlCatOtherControl = 1,
9434   kUCGenlCatOtherFormat = 2,
9435   kUCGenlCatOtherSurrogate = 3,
9436   kUCGenlCatOtherPrivateUse = 4,
9437   kUCGenlCatMarkNonSpacing = 5,
9438   kUCGenlCatMarkSpacingCombining = 6,
9439   kUCGenlCatMarkEnclosing = 7,
9440   kUCGenlCatNumberDecimalDigit = 8,
9441   kUCGenlCatNumberLetter = 9,
9442   kUCGenlCatNumberOther = 10,
9443   kUCGenlCatSeparatorSpace = 11,
9444   kUCGenlCatSeparatorLine = 12,
9445   kUCGenlCatSeparatorParagraph = 13,
9446   kUCGenlCatLetterUppercase = 14,
9447   kUCGenlCatLetterLowercase = 15,
9448   kUCGenlCatLetterTitlecase = 16,
9449
9450   kUCGenlCatLetterModifier = 17,
9451   kUCGenlCatLetterOther = 18,
9452   kUCGenlCatPunctConnector = 20,
9453   kUCGenlCatPunctDash = 21,
9454   kUCGenlCatPunctOpen = 22,
9455   kUCGenlCatPunctClose = 23,
9456   kUCGenlCatPunctInitialQuote = 24,
9457   kUCGenlCatPunctFinalQuote = 25,
9458   kUCGenlCatPunctOther = 26,
9459   kUCGenlCatSymbolMath = 28,
9460   kUCGenlCatSymbolCurrency = 29,
9461   kUCGenlCatSymbolModifier = 30,
9462   kUCGenlCatSymbolOther = 31
9463 };
9464
9465
9466 enum {
9467   kUCBidiCatNotApplicable = 0,
9468
9469   kUCBidiCatLeftRight = 1,
9470   kUCBidiCatRightLeft = 2,
9471
9472   kUCBidiCatEuroNumber = 3,
9473   kUCBidiCatEuroNumberSeparator = 4,
9474   kUCBidiCatEuroNumberTerminator = 5,
9475   kUCBidiCatArabicNumber = 6,
9476   kUCBidiCatCommonNumberSeparator = 7,
9477
9478   kUCBidiCatBlockSeparator = 8,
9479   kUCBidiCatSegmentSeparator = 9,
9480
9481   kUCBidiCatWhitespace = 10,
9482   kUCBidiCatOtherNeutral = 11,
9483
9484   kUCBidiCatRightLeftArabic = 12,
9485   kUCBidiCatLeftRightEmbedding = 13,
9486   kUCBidiCatRightLeftEmbedding = 14,
9487   kUCBidiCatLeftRightOverride = 15,
9488   kUCBidiCatRightLeftOverride = 16,
9489   kUCBidiCatPopDirectionalFormat = 17,
9490   kUCBidiCatNonSpacingMark = 18,
9491   kUCBidiCatBoundaryNeutral = 19
9492 };
9493 extern TextEncoding
9494 CreateTextEncoding(
9495   TextEncodingBase encodingBase,
9496   TextEncodingVariant encodingVariant,
9497   TextEncodingFormat encodingFormat) ;
9498 extern TextEncodingBase
9499 GetTextEncodingBase(TextEncoding encoding) ;
9500 extern TextEncodingVariant
9501 GetTextEncodingVariant(TextEncoding encoding) ;
9502 extern TextEncodingFormat
9503 GetTextEncodingFormat(TextEncoding encoding) ;
9504 extern TextEncoding
9505 ResolveDefaultTextEncoding(TextEncoding encoding) ;
9506 extern OSStatus
9507 GetTextEncodingName(
9508   TextEncoding iEncoding,
9509   TextEncodingNameSelector iNamePartSelector,
9510   RegionCode iPreferredRegion,
9511   TextEncoding iPreferredEncoding,
9512   ByteCount iOutputBufLen,
9513   ByteCount * oNameLength,
9514   RegionCode * oActualRegion,
9515   TextEncoding * oActualEncoding,
9516   TextPtr oEncodingName) ;
9517 extern OSStatus
9518 TECGetInfo(TECInfoHandle * tecInfo) ;
9519 extern OSStatus
9520 UpgradeScriptInfoToTextEncoding(
9521   ScriptCode iTextScriptID,
9522   LangCode iTextLanguageID,
9523   RegionCode iRegionID,
9524   ConstStr255Param iTextFontname,
9525   TextEncoding * oEncoding) ;
9526 extern OSStatus
9527 RevertTextEncodingToScriptInfo(
9528   TextEncoding iEncoding,
9529   ScriptCode * oTextScriptID,
9530   LangCode * oTextLanguageID,
9531   Str255 oTextFontname) ;
9532 extern OSStatus
9533 GetTextEncodingFromScriptInfo(
9534   ScriptCode iTextScriptID,
9535   LangCode iTextLanguageID,
9536   RegionCode iTextRegionID,
9537   TextEncoding * oEncoding) ;
9538 extern OSStatus
9539 GetScriptInfoFromTextEncoding(
9540   TextEncoding iEncoding,
9541   ScriptCode * oTextScriptID,
9542   LangCode * oTextLanguageID) ;
9543 extern OSStatus
9544 NearestMacTextEncodings(
9545   TextEncoding generalEncoding,
9546   TextEncoding * bestMacEncoding,
9547   TextEncoding * alternateMacEncoding) ;
9548 extern OSStatus
9549 UCGetCharProperty(
9550   const UniChar * charPtr,
9551   UniCharCount textLength,
9552   UCCharPropertyType propType,
9553   UCCharPropertyValue * propValue) ;
9554 enum {
9555   kUCHighSurrogateRangeStart = 0xD800UL,
9556     kUCHighSurrogateRangeEnd = 0xDBFFUL,
9557     kUCLowSurrogateRangeStart = 0xDC00UL,
9558     kUCLowSurrogateRangeEnd = 0xDFFFUL
9559 };
9560 static __inline__ Boolean UCIsSurrogateHighCharacter( UniChar character ) {
9561
9562    return ( ( character & 0xFC00UL ) == kUCHighSurrogateRangeStart );
9563 }
9564
9565
9566
9567
9568
9569
9570
9571 static __inline__ Boolean UCIsSurrogateLowCharacter( UniChar character ) {
9572
9573     return ( ( character & 0xFC00UL ) == kUCLowSurrogateRangeStart );
9574 }
9575 static __inline__ UnicodeScalarValue UCGetUnicodeScalarValueForSurrogatePair( UniChar surrogateHigh, UniChar surrogateLow ) {
9576   return ( ( surrogateHigh - kUCHighSurrogateRangeStart ) << 10 ) + ( surrogateLow - kUCLowSurrogateRangeStart ) + 0x0010000UL;
9577 }
9578
9579
9580
9581
9582
9583 }
9584
9585
9586
9587
9588
9589
9590 enum {
9591   kRoutineDescriptorVersion = 7
9592 };
9593
9594
9595 enum {
9596   _MixedModeMagic = 0xAAFE
9597 };
9598
9599
9600 enum {
9601   kCurrentMixedModeStateRecord = 1
9602 };
9603
9604
9605 typedef unsigned short CallingConventionType;
9606 enum {
9607   kPascalStackBased = 0,
9608   kCStackBased = 1,
9609   kRegisterBased = 2,
9610   kD0DispatchedPascalStackBased = 8,
9611   kD1DispatchedPascalStackBased = 12,
9612   kD0DispatchedCStackBased = 9,
9613   kStackDispatchedPascalStackBased = 14,
9614   kThinkCStackBased = 5
9615 };
9616
9617
9618 typedef SInt8 ISAType;
9619 enum {
9620   kM68kISA = 0,
9621   kPowerPCISA = 1
9622 };
9623
9624 enum {
9625   kX86ISA = 2
9626 };
9627
9628
9629 typedef SInt8 RTAType;
9630 enum {
9631   kOld68kRTA = 0 << 4,
9632   kPowerPCRTA = 0 << 4,
9633   kCFM68kRTA = 1 << 4
9634 };
9635
9636 enum {
9637   kX86RTA = 2 << 4
9638 };
9639 enum {
9640   kRegisterD0 = 0,
9641   kRegisterD1 = 1,
9642   kRegisterD2 = 2,
9643   kRegisterD3 = 3,
9644   kRegisterD4 = 8,
9645   kRegisterD5 = 9,
9646   kRegisterD6 = 10,
9647   kRegisterD7 = 11,
9648   kRegisterA0 = 4,
9649   kRegisterA1 = 5,
9650   kRegisterA2 = 6,
9651   kRegisterA3 = 7,
9652   kRegisterA4 = 12,
9653   kRegisterA5 = 13,
9654   kRegisterA6 = 14,
9655   kCCRegisterCBit = 16,
9656   kCCRegisterVBit = 17,
9657   kCCRegisterZBit = 18,
9658   kCCRegisterNBit = 19,
9659   kCCRegisterXBit = 20
9660 };
9661
9662 typedef unsigned short registerSelectorType;
9663
9664 enum {
9665   kNoByteCode = 0,
9666   kOneByteCode = 1,
9667   kTwoByteCode = 2,
9668   kFourByteCode = 3
9669 };
9670
9671
9672 typedef unsigned long ProcInfoType;
9673
9674 typedef unsigned short RoutineFlagsType;
9675 enum {
9676   kProcDescriptorIsAbsolute = 0x00,
9677   kProcDescriptorIsRelative = 0x01
9678 };
9679
9680 enum {
9681   kFragmentIsPrepared = 0x00,
9682   kFragmentNeedsPreparing = 0x02
9683 };
9684
9685 enum {
9686   kUseCurrentISA = 0x00,
9687   kUseNativeISA = 0x04
9688 };
9689
9690 enum {
9691   kPassSelector = 0x00,
9692   kDontPassSelector = 0x08
9693 };
9694
9695 enum {
9696   kRoutineIsNotDispatchedDefaultRoutine = 0x00,
9697   kRoutineIsDispatchedDefaultRoutine = 0x10
9698 };
9699
9700 enum {
9701   kProcDescriptorIsProcPtr = 0x00,
9702   kProcDescriptorIsIndex = 0x20
9703 };
9704
9705 struct RoutineRecord {
9706   ProcInfoType procInfo;
9707   SInt8 reserved1;
9708   ISAType ISA;
9709   RoutineFlagsType routineFlags;
9710   ProcPtr procDescriptor;
9711   UInt32 reserved2;
9712   UInt32 selector;
9713 };
9714 typedef struct RoutineRecord RoutineRecord;
9715 typedef RoutineRecord * RoutineRecordPtr;
9716 typedef RoutineRecordPtr * RoutineRecordHandle;
9717
9718
9719 typedef UInt8 RDFlagsType;
9720 enum {
9721   kSelectorsAreNotIndexable = 0x00,
9722   kSelectorsAreIndexable = 0x01
9723 };
9724
9725
9726 struct RoutineDescriptor {
9727   UInt16 goMixedModeTrap;
9728   SInt8 version;
9729   RDFlagsType routineDescriptorFlags;
9730   UInt32 reserved1;
9731   UInt8 reserved2;
9732   UInt8 selectorInfo;
9733   UInt16 routineCount;
9734   RoutineRecord routineRecords[1];
9735 };
9736 typedef struct RoutineDescriptor RoutineDescriptor;
9737 typedef RoutineDescriptor * RoutineDescriptorPtr;
9738 typedef RoutineDescriptorPtr * RoutineDescriptorHandle;
9739
9740 struct MixedModeStateRecord {
9741   UInt32 state1;
9742   UInt32 state2;
9743   UInt32 state3;
9744   UInt32 state4;
9745 };
9746 typedef struct MixedModeStateRecord MixedModeStateRecord;
9747 enum {
9748
9749   kCallingConventionWidth = 4,
9750   kCallingConventionPhase = 0,
9751   kCallingConventionMask = 0x0F,
9752   kResultSizeWidth = 2,
9753   kResultSizePhase = kCallingConventionWidth,
9754   kResultSizeMask = 0x30,
9755   kStackParameterWidth = 2,
9756   kStackParameterPhase = (kCallingConventionWidth + kResultSizeWidth),
9757   kStackParameterMask = (long)0xFFFFFFC0,
9758   kRegisterResultLocationWidth = 5,
9759   kRegisterResultLocationPhase = (kCallingConventionWidth + kResultSizeWidth),
9760   kRegisterParameterWidth = 5,
9761   kRegisterParameterPhase = (kCallingConventionWidth + kResultSizeWidth + kRegisterResultLocationWidth),
9762   kRegisterParameterMask = 0x7FFFF800,
9763   kRegisterParameterSizePhase = 0,
9764   kRegisterParameterSizeWidth = 2,
9765   kRegisterParameterWhichPhase = kRegisterParameterSizeWidth,
9766   kRegisterParameterWhichWidth = 3,
9767   kDispatchedSelectorSizeWidth = 2,
9768   kDispatchedSelectorSizePhase = (kCallingConventionWidth + kResultSizeWidth),
9769   kDispatchedParameterPhase = (kCallingConventionWidth + kResultSizeWidth + kDispatchedSelectorSizeWidth),
9770   kSpecialCaseSelectorWidth = 6,
9771   kSpecialCaseSelectorPhase = kCallingConventionWidth,
9772   kSpecialCaseSelectorMask = 0x03F0
9773 };
9774
9775 enum {
9776   kSpecialCase = 0x000F
9777 };
9778
9779 enum {
9780
9781   kSpecialCaseHighHook = 0,
9782   kSpecialCaseCaretHook = 0,
9783   kSpecialCaseEOLHook = 1,
9784   kSpecialCaseWidthHook = 2,
9785   kSpecialCaseTextWidthHook = 2,
9786   kSpecialCaseNWidthHook = 3,
9787   kSpecialCaseDrawHook = 4,
9788   kSpecialCaseHitTestHook = 5,
9789   kSpecialCaseTEFindWord = 6,
9790   kSpecialCaseProtocolHandler = 7,
9791   kSpecialCaseSocketListener = 8,
9792   kSpecialCaseTERecalc = 9,
9793   kSpecialCaseTEDoText = 10,
9794   kSpecialCaseGNEFilterProc = 11,
9795   kSpecialCaseMBarHook = 12
9796 };
9797 extern "C" {
9798
9799
9800
9801
9802
9803
9804 enum {
9805   kCollectionDontWantTag = 0L,
9806   kCollectionDontWantId = 0L,
9807   kCollectionDontWantSize = 0L,
9808   kCollectionDontWantAttributes = 0L,
9809   kCollectionDontWantIndex = 0L,
9810   kCollectionDontWantData = 0L
9811 };
9812
9813
9814
9815 enum {
9816   kCollectionNoAttributes = 0x00000000,
9817   kCollectionAllAttributes = (long)0xFFFFFFFF,
9818   kCollectionUserAttributes = 0x0000FFFF,
9819   kCollectionDefaultAttributes = 0x40000000
9820 };
9821
9822
9823
9824
9825
9826
9827
9828 enum {
9829   kCollectionUser0Bit = 0,
9830   kCollectionUser1Bit = 1,
9831   kCollectionUser2Bit = 2,
9832   kCollectionUser3Bit = 3,
9833   kCollectionUser4Bit = 4,
9834   kCollectionUser5Bit = 5,
9835   kCollectionUser6Bit = 6,
9836   kCollectionUser7Bit = 7,
9837   kCollectionUser8Bit = 8,
9838   kCollectionUser9Bit = 9,
9839   kCollectionUser10Bit = 10,
9840   kCollectionUser11Bit = 11,
9841   kCollectionUser12Bit = 12,
9842   kCollectionUser13Bit = 13,
9843   kCollectionUser14Bit = 14,
9844   kCollectionUser15Bit = 15,
9845   kCollectionReserved0Bit = 16,
9846   kCollectionReserved1Bit = 17,
9847   kCollectionReserved2Bit = 18,
9848   kCollectionReserved3Bit = 19,
9849   kCollectionReserved4Bit = 20,
9850   kCollectionReserved5Bit = 21,
9851   kCollectionReserved6Bit = 22,
9852   kCollectionReserved7Bit = 23,
9853   kCollectionReserved8Bit = 24,
9854   kCollectionReserved9Bit = 25,
9855   kCollectionReserved10Bit = 26,
9856   kCollectionReserved11Bit = 27,
9857   kCollectionReserved12Bit = 28,
9858   kCollectionReserved13Bit = 29,
9859   kCollectionPersistenceBit = 30,
9860   kCollectionLockBit = 31
9861 };
9862
9863
9864
9865 enum {
9866   kCollectionUser0Mask = 1L << kCollectionUser0Bit,
9867   kCollectionUser1Mask = 1L << kCollectionUser1Bit,
9868   kCollectionUser2Mask = 1L << kCollectionUser2Bit,
9869   kCollectionUser3Mask = 1L << kCollectionUser3Bit,
9870   kCollectionUser4Mask = 1L << kCollectionUser4Bit,
9871   kCollectionUser5Mask = 1L << kCollectionUser5Bit,
9872   kCollectionUser6Mask = 1L << kCollectionUser6Bit,
9873   kCollectionUser7Mask = 1L << kCollectionUser7Bit,
9874   kCollectionUser8Mask = 1L << kCollectionUser8Bit,
9875   kCollectionUser9Mask = 1L << kCollectionUser9Bit,
9876   kCollectionUser10Mask = 1L << kCollectionUser10Bit,
9877   kCollectionUser11Mask = 1L << kCollectionUser11Bit,
9878   kCollectionUser12Mask = 1L << kCollectionUser12Bit,
9879   kCollectionUser13Mask = 1L << kCollectionUser13Bit,
9880   kCollectionUser14Mask = 1L << kCollectionUser14Bit,
9881   kCollectionUser15Mask = 1L << kCollectionUser15Bit,
9882   kCollectionReserved0Mask = 1L << kCollectionReserved0Bit,
9883   kCollectionReserved1Mask = 1L << kCollectionReserved1Bit,
9884   kCollectionReserved2Mask = 1L << kCollectionReserved2Bit,
9885   kCollectionReserved3Mask = 1L << kCollectionReserved3Bit,
9886   kCollectionReserved4Mask = 1L << kCollectionReserved4Bit,
9887   kCollectionReserved5Mask = 1L << kCollectionReserved5Bit,
9888   kCollectionReserved6Mask = 1L << kCollectionReserved6Bit,
9889   kCollectionReserved7Mask = 1L << kCollectionReserved7Bit,
9890   kCollectionReserved8Mask = 1L << kCollectionReserved8Bit,
9891   kCollectionReserved9Mask = 1L << kCollectionReserved9Bit,
9892   kCollectionReserved10Mask = 1L << kCollectionReserved10Bit,
9893   kCollectionReserved11Mask = 1L << kCollectionReserved11Bit,
9894   kCollectionReserved12Mask = 1L << kCollectionReserved12Bit,
9895   kCollectionReserved13Mask = 1L << kCollectionReserved13Bit,
9896   kCollectionPersistenceMask = 1L << kCollectionPersistenceBit,
9897   kCollectionLockMask = 1L << kCollectionLockBit
9898 };
9899
9900
9901
9902
9903
9904
9905 typedef struct OpaqueCollection* Collection;
9906
9907 typedef FourCharCode CollectionTag;
9908 typedef OSErr ( * CollectionFlattenProcPtr)(SInt32 size, void *data, void *refCon);
9909 typedef OSErr ( * CollectionExceptionProcPtr)(Collection c, OSErr status);
9910 typedef CollectionFlattenProcPtr CollectionFlattenUPP;
9911 typedef CollectionExceptionProcPtr CollectionExceptionUPP;
9912 extern CollectionFlattenUPP
9913 NewCollectionFlattenUPP(CollectionFlattenProcPtr userRoutine) ;
9914 extern CollectionExceptionUPP
9915 NewCollectionExceptionUPP(CollectionExceptionProcPtr userRoutine) ;
9916 extern void
9917 DisposeCollectionFlattenUPP(CollectionFlattenUPP userUPP) ;
9918 extern void
9919 DisposeCollectionExceptionUPP(CollectionExceptionUPP userUPP) ;
9920 extern OSErr
9921 InvokeCollectionFlattenUPP(
9922   SInt32 size,
9923   void * data,
9924   void * refCon,
9925   CollectionFlattenUPP userUPP) ;
9926 extern OSErr
9927 InvokeCollectionExceptionUPP(
9928   Collection c,
9929   OSErr status,
9930   CollectionExceptionUPP userUPP) ;
9931 extern Collection
9932 NewCollection(void) ;
9933 extern void
9934 DisposeCollection(Collection c) ;
9935 extern Collection
9936 CloneCollection(Collection c) ;
9937 extern SInt32
9938 CountCollectionOwners(Collection c) ;
9939 extern OSStatus
9940 RetainCollection(Collection c) ;
9941 extern OSStatus
9942 ReleaseCollection(Collection c) ;
9943 extern ItemCount
9944 GetCollectionRetainCount(Collection c) ;
9945 extern Collection
9946 CopyCollection(
9947   Collection srcCollection,
9948   Collection dstCollection) ;
9949 extern SInt32
9950 GetCollectionDefaultAttributes(Collection c) ;
9951 extern void
9952 SetCollectionDefaultAttributes(
9953   Collection c,
9954   SInt32 whichAttributes,
9955   SInt32 newAttributes) ;
9956 extern SInt32
9957 CountCollectionItems(Collection c) ;
9958 extern OSErr
9959 AddCollectionItem(
9960   Collection c,
9961   CollectionTag tag,
9962   SInt32 id,
9963   SInt32 itemSize,
9964   const void * itemData) ;
9965 extern OSErr
9966 GetCollectionItem(
9967   Collection c,
9968   CollectionTag tag,
9969   SInt32 id,
9970   SInt32 * itemSize,
9971   void * itemData) ;
9972 extern OSErr
9973 RemoveCollectionItem(
9974   Collection c,
9975   CollectionTag tag,
9976   SInt32 id) ;
9977 extern OSErr
9978 SetCollectionItemInfo(
9979   Collection c,
9980   CollectionTag tag,
9981   SInt32 id,
9982   SInt32 whichAttributes,
9983   SInt32 newAttributes) ;
9984 extern OSErr
9985 GetCollectionItemInfo(
9986   Collection c,
9987   CollectionTag tag,
9988   SInt32 id,
9989   SInt32 * index,
9990   SInt32 * itemSize,
9991   SInt32 * attributes) ;
9992 extern OSErr
9993 ReplaceIndexedCollectionItem(
9994   Collection c,
9995   SInt32 index,
9996   SInt32 itemSize,
9997   const void * itemData) ;
9998 extern OSErr
9999 GetIndexedCollectionItem(
10000   Collection c,
10001   SInt32 index,
10002   SInt32 * itemSize,
10003   void * itemData) ;
10004 extern OSErr
10005 RemoveIndexedCollectionItem(
10006   Collection c,
10007   SInt32 index) ;
10008 extern OSErr
10009 SetIndexedCollectionItemInfo(
10010   Collection c,
10011   SInt32 index,
10012   SInt32 whichAttributes,
10013   SInt32 newAttributes) ;
10014 extern OSErr
10015 GetIndexedCollectionItemInfo(
10016   Collection c,
10017   SInt32 index,
10018   CollectionTag * tag,
10019   SInt32 * id,
10020   SInt32 * itemSize,
10021   SInt32 * attributes) ;
10022 extern Boolean
10023 CollectionTagExists(
10024   Collection c,
10025   CollectionTag tag) ;
10026 extern SInt32
10027 CountCollectionTags(Collection c) ;
10028 extern OSErr
10029 GetIndexedCollectionTag(
10030   Collection c,
10031   SInt32 tagIndex,
10032   CollectionTag * tag) ;
10033 extern SInt32
10034 CountTaggedCollectionItems(
10035   Collection c,
10036   CollectionTag tag) ;
10037 extern OSErr
10038 GetTaggedCollectionItem(
10039   Collection c,
10040   CollectionTag tag,
10041   SInt32 whichItem,
10042   SInt32 * itemSize,
10043   void * itemData) ;
10044 extern OSErr
10045 GetTaggedCollectionItemInfo(
10046   Collection c,
10047   CollectionTag tag,
10048   SInt32 whichItem,
10049   SInt32 * id,
10050   SInt32 * index,
10051   SInt32 * itemSize,
10052   SInt32 * attributes) ;
10053 extern void
10054 PurgeCollection(
10055   Collection c,
10056   SInt32 whichAttributes,
10057   SInt32 matchingAttributes) ;
10058 extern void
10059 PurgeCollectionTag(
10060   Collection c,
10061   CollectionTag tag) ;
10062 extern void
10063 EmptyCollection(Collection c) ;
10064 extern OSErr
10065 FlattenCollection(
10066   Collection c,
10067   CollectionFlattenUPP flattenProc,
10068   void * refCon) ;
10069 extern OSErr
10070 FlattenPartialCollection(
10071   Collection c,
10072   CollectionFlattenUPP flattenProc,
10073   void * refCon,
10074   SInt32 whichAttributes,
10075   SInt32 matchingAttributes) ;
10076 extern OSErr
10077 UnflattenCollection(
10078   Collection c,
10079   CollectionFlattenUPP flattenProc,
10080   void * refCon) ;
10081 extern CollectionExceptionUPP
10082 GetCollectionExceptionProc(Collection c) ;
10083 extern void
10084 SetCollectionExceptionProc(
10085   Collection c,
10086   CollectionExceptionUPP exceptionProc) ;
10087 extern Collection
10088 GetNewCollection(SInt16 collectionID) ;
10089 extern OSErr
10090 AddCollectionItemHdl(
10091   Collection aCollection,
10092   CollectionTag tag,
10093   SInt32 id,
10094   Handle itemData) ;
10095 extern OSErr
10096 GetCollectionItemHdl(
10097   Collection aCollection,
10098   CollectionTag tag,
10099   SInt32 id,
10100   Handle itemData) ;
10101 extern OSErr
10102 ReplaceIndexedCollectionItemHdl(
10103   Collection aCollection,
10104   SInt32 index,
10105   Handle itemData) ;
10106 extern OSErr
10107 GetIndexedCollectionItemHdl(
10108   Collection aCollection,
10109   SInt32 index,
10110   Handle itemData) ;
10111 extern OSErr
10112 FlattenCollectionToHdl(
10113   Collection aCollection,
10114   Handle flattened) ;
10115 extern OSErr
10116 UnflattenCollectionFromHdl(
10117   Collection aCollection,
10118   Handle flattened) ;
10119 }
10120
10121
10122
10123 typedef long BigEndianLong;
10124 typedef unsigned long BigEndianUnsignedLong;
10125 typedef short BigEndianShort;
10126 typedef unsigned short BigEndianUnsignedShort;
10127 typedef Fixed BigEndianFixed;
10128 typedef UnsignedFixed BigEndianUnsignedFixed;
10129 typedef OSType BigEndianOSType;
10130
10131
10132
10133
10134
10135
10136 extern "C" {
10137
10138
10139
10140
10141 typedef OSErr ( * SelectorFunctionProcPtr)(OSType selector, long *response);
10142 typedef SelectorFunctionProcPtr SelectorFunctionUPP;
10143 extern OSErr
10144 Gestalt(
10145   OSType selector,
10146   long * response) ;
10147 extern OSErr
10148 ReplaceGestalt(
10149   OSType selector,
10150   SelectorFunctionUPP gestaltFunction,
10151   SelectorFunctionUPP * oldGestaltFunction) ;
10152 extern OSErr
10153 NewGestalt(
10154   OSType selector,
10155   SelectorFunctionUPP gestaltFunction) ;
10156 extern OSErr
10157 NewGestaltValue(
10158   OSType selector,
10159   long newValue) ;
10160 extern OSErr
10161 ReplaceGestaltValue(
10162   OSType selector,
10163   long replacementValue) ;
10164 extern OSErr
10165 SetGestaltValue(
10166   OSType selector,
10167   long newValue) ;
10168 extern OSErr
10169 DeleteGestaltValue(OSType selector) ;
10170 extern SelectorFunctionUPP
10171 NewSelectorFunctionUPP(SelectorFunctionProcPtr userRoutine) ;
10172 extern void
10173 DisposeSelectorFunctionUPP(SelectorFunctionUPP userUPP) ;
10174 extern OSErr
10175 InvokeSelectorFunctionUPP(
10176   OSType selector,
10177   long * response,
10178   SelectorFunctionUPP userUPP) ;
10179
10180
10181
10182 enum {
10183   gestaltAddressingModeAttr = 'addr',
10184   gestalt32BitAddressing = 0,
10185   gestalt32BitSysZone = 1,
10186   gestalt32BitCapable = 2
10187 };
10188
10189 enum {
10190   gestaltAFPClient = 'afps',
10191   gestaltAFPClientVersionMask = 0x0000FFFF,
10192
10193   gestaltAFPClient3_5 = 0x0001,
10194   gestaltAFPClient3_6 = 0x0002,
10195   gestaltAFPClient3_6_1 = 0x0003,
10196   gestaltAFPClient3_6_2 = 0x0004,
10197   gestaltAFPClient3_6_3 = 0x0005,
10198   gestaltAFPClient3_7 = 0x0006,
10199   gestaltAFPClient3_7_2 = 0x0007,
10200   gestaltAFPClient3_8 = 0x0008,
10201   gestaltAFPClient3_8_1 = 0x0009,
10202   gestaltAFPClient3_8_3 = 0x000A,
10203   gestaltAFPClient3_8_4 = 0x000B,
10204   gestaltAFPClientAttributeMask = (long)0xFFFF0000,
10205
10206   gestaltAFPClientCfgRsrc = 16,
10207   gestaltAFPClientSupportsIP = 29,
10208   gestaltAFPClientVMUI = 30,
10209   gestaltAFPClientMultiReq = 31
10210 };
10211
10212
10213 enum {
10214   gestaltAliasMgrAttr = 'alis',
10215   gestaltAliasMgrPresent = 0,
10216   gestaltAliasMgrSupportsRemoteAppletalk = 1,
10217   gestaltAliasMgrSupportsAOCEKeychain = 2,
10218   gestaltAliasMgrResolveAliasFileWithMountOptions = 3,
10219   gestaltAliasMgrFollowsAliasesWhenResolving = 4,
10220   gestaltAliasMgrSupportsExtendedCalls = 5,
10221   gestaltAliasMgrSupportsFSCalls = 6,
10222   gestaltAliasMgrPrefersPath = 7
10223 };
10224
10225
10226 enum {
10227   gestaltAppearanceAttr = 'appr',
10228   gestaltAppearanceExists = 0,
10229   gestaltAppearanceCompatMode = 1
10230 };
10231
10232
10233
10234
10235
10236
10237
10238 enum {
10239   gestaltAppearanceVersion = 'apvr'
10240 };
10241
10242 enum {
10243   gestaltArbitorAttr = 'arb ',
10244   gestaltSerialArbitrationExists = 0
10245 };
10246
10247 enum {
10248   gestaltAppleScriptVersion = 'ascv'
10249 };
10250
10251 enum {
10252   gestaltAppleScriptAttr = 'ascr',
10253   gestaltAppleScriptPresent = 0,
10254   gestaltAppleScriptPowerPCSupport = 1
10255 };
10256
10257 enum {
10258   gestaltATAAttr = 'ata ',
10259   gestaltATAPresent = 0
10260 };
10261
10262 enum {
10263   gestaltATalkVersion = 'atkv'
10264 };
10265
10266 enum {
10267   gestaltAppleTalkVersion = 'atlk'
10268 };
10269 enum {
10270   gestaltAUXVersion = 'a/ux'
10271 };
10272
10273 enum {
10274   gestaltMacOSCompatibilityBoxAttr = 'bbox',
10275   gestaltMacOSCompatibilityBoxPresent = 0,
10276   gestaltMacOSCompatibilityBoxHasSerial = 1,
10277   gestaltMacOSCompatibilityBoxless = 2
10278 };
10279
10280 enum {
10281   gestaltBusClkSpeed = 'bclk'
10282 };
10283
10284 enum {
10285   gestaltCloseViewAttr = 'BSDa',
10286   gestaltCloseViewEnabled = 0,
10287   gestaltCloseViewDisplayMgrFriendly = 1
10288 };
10289
10290 enum {
10291   gestaltCarbonVersion = 'cbon'
10292 };
10293
10294 enum {
10295   gestaltCFMAttr = 'cfrg',
10296   gestaltCFMPresent = 0,
10297   gestaltCFMPresentMask = 0x0001,
10298   gestaltCFM99Present = 2,
10299   gestaltCFM99PresentMask = 0x0004
10300 };
10301
10302 enum {
10303   gestaltCollectionMgrVersion = 'cltn'
10304 };
10305
10306 enum {
10307   gestaltColorMatchingAttr = 'cmta',
10308   gestaltHighLevelMatching = 0,
10309   gestaltColorMatchingLibLoaded = 1
10310 };
10311
10312 enum {
10313   gestaltColorMatchingVersion = 'cmtc',
10314   gestaltColorSync10 = 0x0100,
10315   gestaltColorSync11 = 0x0110,
10316   gestaltColorSync104 = 0x0104,
10317   gestaltColorSync105 = 0x0105,
10318   gestaltColorSync20 = 0x0200,
10319   gestaltColorSync21 = 0x0210,
10320   gestaltColorSync211 = 0x0211,
10321   gestaltColorSync212 = 0x0212,
10322   gestaltColorSync213 = 0x0213,
10323   gestaltColorSync25 = 0x0250,
10324   gestaltColorSync26 = 0x0260,
10325   gestaltColorSync261 = 0x0261,
10326   gestaltColorSync30 = 0x0300
10327 };
10328
10329 enum {
10330   gestaltControlMgrVersion = 'cmvr'
10331 };
10332
10333 enum {
10334   gestaltControlMgrAttr = 'cntl',
10335   gestaltControlMgrPresent = (1L << 0),
10336
10337
10338   gestaltControlMgrPresentBit = 0,
10339   gestaltControlMsgPresentMask = (1L << gestaltControlMgrPresentBit)
10340 };
10341
10342 enum {
10343   gestaltConnMgrAttr = 'conn',
10344   gestaltConnMgrPresent = 0,
10345   gestaltConnMgrCMSearchFix = 1,
10346   gestaltConnMgrErrorString = 2,
10347   gestaltConnMgrMultiAsyncIO = 3
10348 };
10349
10350 enum {
10351   gestaltColorPickerVersion = 'cpkr',
10352   gestaltColorPicker = 'cpkr'
10353 };
10354
10355 enum {
10356   gestaltComponentMgr = 'cpnt',
10357   gestaltComponentPlatform = 'copl'
10358 };
10359 enum {
10360   gestaltNativeCPUtype = 'cput',
10361   gestaltNativeCPUfamily = 'cpuf',
10362   gestaltCPU68000 = 0,
10363   gestaltCPU68010 = 1,
10364   gestaltCPU68020 = 2,
10365   gestaltCPU68030 = 3,
10366   gestaltCPU68040 = 4,
10367   gestaltCPU601 = 0x0101,
10368   gestaltCPU603 = 0x0103,
10369   gestaltCPU604 = 0x0104,
10370   gestaltCPU603e = 0x0106,
10371   gestaltCPU603ev = 0x0107,
10372   gestaltCPU750 = 0x0108,
10373   gestaltCPU604e = 0x0109,
10374   gestaltCPU604ev = 0x010A,
10375   gestaltCPUG4 = 0x010C,
10376   gestaltCPUG47450 = 0x0110
10377 };
10378
10379 enum {
10380   gestaltCPUApollo = 0x0111,
10381   gestaltCPU750FX = 0x0120
10382 };
10383
10384 enum {
10385
10386   gestaltCPU486 = 'i486',
10387   gestaltCPUPentium = 'i586',
10388   gestaltCPUPentiumPro = 'i5pr',
10389   gestaltCPUPentiumII = 'i5ii',
10390   gestaltCPUX86 = 'ixxx'
10391 };
10392
10393 enum {
10394   gestaltCRMAttr = 'crm ',
10395   gestaltCRMPresent = 0,
10396   gestaltCRMPersistentFix = 1,
10397   gestaltCRMToolRsrcCalls = 2
10398 };
10399
10400 enum {
10401   gestaltControlStripVersion = 'csvr'
10402 };
10403
10404 enum {
10405   gestaltCTBVersion = 'ctbv'
10406 };
10407
10408 enum {
10409   gestaltDBAccessMgrAttr = 'dbac',
10410   gestaltDBAccessMgrPresent = 0
10411 };
10412
10413 enum {
10414   gestaltDiskCacheSize = 'dcsz'
10415 };
10416
10417 enum {
10418   gestaltSDPFindVersion = 'dfnd'
10419 };
10420
10421 enum {
10422   gestaltDictionaryMgrAttr = 'dict',
10423   gestaltDictionaryMgrPresent = 0
10424 };
10425
10426 enum {
10427   gestaltDITLExtAttr = 'ditl',
10428   gestaltDITLExtPresent = 0,
10429   gestaltDITLExtSupportsIctb = 1
10430 };
10431
10432 enum {
10433   gestaltDialogMgrAttr = 'dlog',
10434   gestaltDialogMgrPresent = (1L << 0),
10435
10436
10437   gestaltDialogMgrPresentBit = 0,
10438   gestaltDialogMgrHasAquaAlertBit = 2,
10439   gestaltDialogMgrPresentMask = (1L << gestaltDialogMgrPresentBit),
10440   gestaltDialogMgrHasAquaAlertMask = (1L << gestaltDialogMgrHasAquaAlertBit),
10441   gestaltDialogMsgPresentMask = gestaltDialogMgrPresentMask
10442 };
10443
10444 enum {
10445   gestaltDesktopPicturesAttr = 'dkpx',
10446   gestaltDesktopPicturesInstalled = 0,
10447   gestaltDesktopPicturesDisplayed = 1
10448 };
10449
10450 enum {
10451   gestaltDisplayMgrVers = 'dplv'
10452 };
10453
10454 enum {
10455   gestaltDisplayMgrAttr = 'dply',
10456   gestaltDisplayMgrPresent = 0,
10457   gestaltDisplayMgrCanSwitchMirrored = 2,
10458   gestaltDisplayMgrSetDepthNotifies = 3,
10459   gestaltDisplayMgrCanConfirm = 4,
10460   gestaltDisplayMgrColorSyncAware = 5,
10461   gestaltDisplayMgrGeneratesProfiles = 6,
10462   gestaltDisplayMgrSleepNotifies = 7
10463 };
10464
10465 enum {
10466   gestaltDragMgrAttr = 'drag',
10467   gestaltDragMgrPresent = 0,
10468   gestaltDragMgrFloatingWind = 1,
10469   gestaltPPCDragLibPresent = 2,
10470   gestaltDragMgrHasImageSupport = 3,
10471   gestaltCanStartDragInFloatWindow = 4,
10472   gestaltSetDragImageUpdates = 5
10473 };
10474
10475 enum {
10476   gestaltDrawSprocketVersion = 'dspv'
10477 };
10478
10479 enum {
10480   gestaltDigitalSignatureVersion = 'dsig'
10481 };
10482
10483
10484
10485
10486
10487 enum {
10488   gestaltDTPFeatures = 'dtpf',
10489   kDTPThirdPartySupported = 0x00000004
10490 };
10491
10492
10493
10494
10495
10496
10497 enum {
10498   gestaltDTPInfo = 'dtpx'
10499 };
10500
10501 enum {
10502   gestaltEasyAccessAttr = 'easy',
10503   gestaltEasyAccessOff = 0,
10504   gestaltEasyAccessOn = 1,
10505   gestaltEasyAccessSticky = 2,
10506   gestaltEasyAccessLocked = 3
10507 };
10508
10509 enum {
10510   gestaltEditionMgrAttr = 'edtn',
10511   gestaltEditionMgrPresent = 0,
10512   gestaltEditionMgrTranslationAware = 1
10513 };
10514
10515 enum {
10516   gestaltAppleEventsAttr = 'evnt',
10517   gestaltAppleEventsPresent = 0,
10518   gestaltScriptingSupport = 1,
10519   gestaltOSLInSystem = 2,
10520   gestaltSupportsApplicationURL = 4
10521 };
10522
10523 enum {
10524   gestaltExtensionTableVersion = 'etbl'
10525 };
10526
10527
10528 enum {
10529   gestaltFBCIndexingState = 'fbci',
10530   gestaltFBCindexingSafe = 0,
10531   gestaltFBCindexingCritical = 1
10532 };
10533
10534 enum {
10535   gestaltFBCVersion = 'fbcv',
10536   gestaltFBCCurrentVersion = 0x0011,
10537   gestaltOSXFBCCurrentVersion = 0x0100
10538 };
10539
10540
10541 enum {
10542   gestaltFileMappingAttr = 'flmp',
10543   gestaltFileMappingPresent = 0,
10544   gestaltFileMappingMultipleFilesFix = 1
10545 };
10546
10547 enum {
10548   gestaltFloppyAttr = 'flpy',
10549   gestaltFloppyIsMFMOnly = 0,
10550   gestaltFloppyIsManualEject = 1,
10551   gestaltFloppyUsesDiskInPlace = 2
10552 };
10553
10554 enum {
10555   gestaltFinderAttr = 'fndr',
10556   gestaltFinderDropEvent = 0,
10557   gestaltFinderMagicPlacement = 1,
10558   gestaltFinderCallsAEProcess = 2,
10559   gestaltOSLCompliantFinder = 3,
10560   gestaltFinderSupports4GBVolumes = 4,
10561   gestaltFinderHasClippings = 6,
10562   gestaltFinderFullDragManagerSupport = 7,
10563   gestaltFinderFloppyRootComments = 8,
10564   gestaltFinderLargeAndNotSavedFlavorsOK = 9,
10565   gestaltFinderUsesExtensibleFolderManager = 10,
10566   gestaltFinderUnderstandsRedirectedDesktopFolder = 11
10567 };
10568
10569 enum {
10570   gestaltFindFolderAttr = 'fold',
10571   gestaltFindFolderPresent = 0,
10572   gestaltFolderDescSupport = 1,
10573   gestaltFolderMgrFollowsAliasesWhenResolving = 2,
10574   gestaltFolderMgrSupportsExtendedCalls = 3,
10575   gestaltFolderMgrSupportsDomains = 4,
10576   gestaltFolderMgrSupportsFSCalls = 5
10577 };
10578
10579 enum {
10580   gestaltFindFolderRedirectionAttr = 'fole'
10581 };
10582
10583
10584 enum {
10585   gestaltFontMgrAttr = 'font',
10586   gestaltOutlineFonts = 0
10587 };
10588
10589 enum {
10590   gestaltFPUType = 'fpu ',
10591   gestaltNoFPU = 0,
10592   gestalt68881 = 1,
10593   gestalt68882 = 2,
10594   gestalt68040FPU = 3
10595 };
10596
10597 enum {
10598   gestaltFSAttr = 'fs  ',
10599   gestaltFullExtFSDispatching = 0,
10600   gestaltHasFSSpecCalls = 1,
10601   gestaltHasFileSystemManager = 2,
10602   gestaltFSMDoesDynamicLoad = 3,
10603   gestaltFSSupports4GBVols = 4,
10604   gestaltFSSupports2TBVols = 5,
10605   gestaltHasExtendedDiskInit = 6,
10606   gestaltDTMgrSupportsFSM = 7,
10607   gestaltFSNoMFSVols = 8,
10608   gestaltFSSupportsHFSPlusVols = 9,
10609   gestaltFSIncompatibleDFA82 = 10
10610 };
10611
10612 enum {
10613   gestaltFSSupportsDirectIO = 11
10614 };
10615
10616 enum {
10617   gestaltHasHFSPlusAPIs = 12,
10618   gestaltMustUseFCBAccessors = 13,
10619   gestaltFSUsesPOSIXPathsForConversion = 14,
10620   gestaltFSSupportsExclusiveLocks = 15,
10621   gestaltFSSupportsHardLinkDetection = 16
10622 };
10623
10624 enum {
10625   gestaltAdminFeaturesFlagsAttr = 'fred',
10626   gestaltFinderUsesSpecialOpenFoldersFile = 0
10627 };
10628
10629 enum {
10630   gestaltFSMVersion = 'fsm '
10631 };
10632
10633 enum {
10634   gestaltFXfrMgrAttr = 'fxfr',
10635   gestaltFXfrMgrPresent = 0,
10636   gestaltFXfrMgrMultiFile = 1,
10637   gestaltFXfrMgrErrorString = 2,
10638   gestaltFXfrMgrAsync = 3
10639 };
10640
10641 enum {
10642   gestaltGraphicsAttr = 'gfxa',
10643   gestaltGraphicsIsDebugging = 0x00000001,
10644   gestaltGraphicsIsLoaded = 0x00000002,
10645   gestaltGraphicsIsPowerPC = 0x00000004
10646 };
10647
10648 enum {
10649   gestaltGraphicsVersion = 'grfx',
10650   gestaltCurrentGraphicsVersion = 0x00010200
10651 };
10652
10653 enum {
10654   gestaltHardwareAttr = 'hdwr',
10655   gestaltHasVIA1 = 0,
10656   gestaltHasVIA2 = 1,
10657   gestaltHasASC = 3,
10658   gestaltHasSCC = 4,
10659   gestaltHasSCSI = 7,
10660   gestaltHasSoftPowerOff = 19,
10661   gestaltHasSCSI961 = 21,
10662   gestaltHasSCSI962 = 22,
10663   gestaltHasUniversalROM = 24,
10664   gestaltHasEnhancedLtalk = 30
10665 };
10666
10667 enum {
10668   gestaltHelpMgrAttr = 'help',
10669   gestaltHelpMgrPresent = 0,
10670   gestaltHelpMgrExtensions = 1,
10671   gestaltAppleGuideIsDebug = 30,
10672   gestaltAppleGuidePresent = 31
10673 };
10674
10675 enum {
10676   gestaltHardwareVendorCode = 'hrad',
10677   gestaltHardwareVendorApple = 'Appl'
10678 };
10679
10680 enum {
10681   gestaltCompressionMgr = 'icmp'
10682 };
10683
10684 enum {
10685   gestaltIconUtilitiesAttr = 'icon',
10686   gestaltIconUtilitiesPresent = 0,
10687   gestaltIconUtilitiesHas48PixelIcons = 1,
10688   gestaltIconUtilitiesHas32BitIcons = 2,
10689   gestaltIconUtilitiesHas8BitDeepMasks = 3,
10690   gestaltIconUtilitiesHasIconServices = 4
10691 };
10692
10693 enum {
10694   gestaltInternalDisplay = 'idsp'
10695 };
10696
10697
10698
10699
10700
10701 enum {
10702   gestaltKeyboardType = 'kbd ',
10703   gestaltMacKbd = 1,
10704   gestaltMacAndPad = 2,
10705   gestaltMacPlusKbd = 3,
10706   gestaltExtADBKbd = 4,
10707   gestaltStdADBKbd = 5,
10708   gestaltPrtblADBKbd = 6,
10709   gestaltPrtblISOKbd = 7,
10710   gestaltStdISOADBKbd = 8,
10711   gestaltExtISOADBKbd = 9,
10712   gestaltADBKbdII = 10,
10713   gestaltADBISOKbdII = 11,
10714   gestaltPwrBookADBKbd = 12,
10715   gestaltPwrBookISOADBKbd = 13,
10716   gestaltAppleAdjustKeypad = 14,
10717   gestaltAppleAdjustADBKbd = 15,
10718   gestaltAppleAdjustISOKbd = 16,
10719   gestaltJapanAdjustADBKbd = 17,
10720   gestaltPwrBkExtISOKbd = 20,
10721   gestaltPwrBkExtJISKbd = 21,
10722   gestaltPwrBkExtADBKbd = 24,
10723   gestaltPS2Keyboard = 27,
10724   gestaltPwrBkSubDomKbd = 28,
10725   gestaltPwrBkSubISOKbd = 29,
10726   gestaltPwrBkSubJISKbd = 30,
10727   gestaltPwrBkEKDomKbd = 195,
10728   gestaltPwrBkEKISOKbd = 196,
10729   gestaltPwrBkEKJISKbd = 197,
10730   gestaltUSBCosmoANSIKbd = 198,
10731   gestaltUSBCosmoISOKbd = 199,
10732   gestaltUSBCosmoJISKbd = 200,
10733   gestaltPwrBk99JISKbd = 201,
10734   gestaltUSBAndyANSIKbd = 204,
10735   gestaltUSBAndyISOKbd = 205,
10736   gestaltUSBAndyJISKbd = 206
10737 };
10738
10739
10740 enum {
10741   gestaltPortable2001ANSIKbd = 202,
10742   gestaltPortable2001ISOKbd = 203,
10743   gestaltPortable2001JISKbd = 207
10744 };
10745
10746
10747
10748
10749
10750 enum {
10751   gestaltUDFSupport = 'kudf'
10752 };
10753
10754 enum {
10755   gestaltLowMemorySize = 'lmem'
10756 };
10757
10758 enum {
10759   gestaltLogicalRAMSize = 'lram'
10760 };
10761 enum {
10762   gestaltMachineType = 'mach',
10763   gestaltClassic = 1,
10764   gestaltMacXL = 2,
10765   gestaltMac512KE = 3,
10766   gestaltMacPlus = 4,
10767   gestaltMacSE = 5,
10768   gestaltMacII = 6,
10769   gestaltMacIIx = 7,
10770   gestaltMacIIcx = 8,
10771   gestaltMacSE030 = 9,
10772   gestaltPortable = 10,
10773   gestaltMacIIci = 11,
10774   gestaltPowerMac8100_120 = 12,
10775   gestaltMacIIfx = 13,
10776   gestaltMacClassic = 17,
10777   gestaltMacIIsi = 18,
10778   gestaltMacLC = 19,
10779   gestaltMacQuadra900 = 20,
10780   gestaltPowerBook170 = 21,
10781   gestaltMacQuadra700 = 22,
10782   gestaltClassicII = 23,
10783   gestaltPowerBook100 = 24,
10784   gestaltPowerBook140 = 25,
10785   gestaltMacQuadra950 = 26,
10786   gestaltMacLCIII = 27,
10787   gestaltPerforma450 = gestaltMacLCIII,
10788   gestaltPowerBookDuo210 = 29,
10789   gestaltMacCentris650 = 30,
10790   gestaltPowerBookDuo230 = 32,
10791   gestaltPowerBook180 = 33,
10792   gestaltPowerBook160 = 34,
10793   gestaltMacQuadra800 = 35,
10794   gestaltMacQuadra650 = 36,
10795   gestaltMacLCII = 37,
10796   gestaltPowerBookDuo250 = 38,
10797   gestaltAWS9150_80 = 39,
10798   gestaltPowerMac8100_110 = 40,
10799   gestaltAWS8150_110 = gestaltPowerMac8100_110,
10800   gestaltPowerMac5200 = 41,
10801   gestaltPowerMac5260 = gestaltPowerMac5200,
10802   gestaltPerforma5300 = gestaltPowerMac5200,
10803   gestaltPowerMac6200 = 42,
10804   gestaltPerforma6300 = gestaltPowerMac6200,
10805   gestaltMacIIvi = 44,
10806   gestaltMacIIvm = 45,
10807   gestaltPerforma600 = gestaltMacIIvm,
10808   gestaltPowerMac7100_80 = 47,
10809   gestaltMacIIvx = 48,
10810   gestaltMacColorClassic = 49,
10811   gestaltPerforma250 = gestaltMacColorClassic,
10812   gestaltPowerBook165c = 50,
10813   gestaltMacCentris610 = 52,
10814   gestaltMacQuadra610 = 53,
10815   gestaltPowerBook145 = 54,
10816   gestaltPowerMac8100_100 = 55,
10817   gestaltMacLC520 = 56,
10818   gestaltAWS9150_120 = 57,
10819   gestaltPowerMac6400 = 58,
10820   gestaltPerforma6400 = gestaltPowerMac6400,
10821   gestaltPerforma6360 = gestaltPerforma6400,
10822   gestaltMacCentris660AV = 60,
10823   gestaltMacQuadra660AV = gestaltMacCentris660AV,
10824   gestaltPerforma46x = 62,
10825   gestaltPowerMac8100_80 = 65,
10826   gestaltAWS8150_80 = gestaltPowerMac8100_80,
10827   gestaltPowerMac9500 = 67,
10828   gestaltPowerMac9600 = gestaltPowerMac9500,
10829   gestaltPowerMac7500 = 68,
10830   gestaltPowerMac7600 = gestaltPowerMac7500,
10831   gestaltPowerMac8500 = 69,
10832   gestaltPowerMac8600 = gestaltPowerMac8500,
10833   gestaltAWS8550 = gestaltPowerMac7500,
10834   gestaltPowerBook180c = 71,
10835   gestaltPowerBook520 = 72,
10836   gestaltPowerBook520c = gestaltPowerBook520,
10837   gestaltPowerBook540 = gestaltPowerBook520,
10838   gestaltPowerBook540c = gestaltPowerBook520,
10839   gestaltPowerMac5400 = 74,
10840   gestaltPowerMac6100_60 = 75,
10841   gestaltAWS6150_60 = gestaltPowerMac6100_60,
10842   gestaltPowerBookDuo270c = 77,
10843   gestaltMacQuadra840AV = 78,
10844   gestaltPerforma550 = 80,
10845   gestaltPowerBook165 = 84,
10846   gestaltPowerBook190 = 85,
10847   gestaltMacTV = 88,
10848   gestaltMacLC475 = 89,
10849   gestaltPerforma47x = gestaltMacLC475,
10850   gestaltMacLC575 = 92,
10851   gestaltMacQuadra605 = 94,
10852   gestaltMacQuadra630 = 98,
10853   gestaltMacLC580 = 99,
10854   gestaltPerforma580 = gestaltMacLC580,
10855   gestaltPowerMac6100_66 = 100,
10856   gestaltAWS6150_66 = gestaltPowerMac6100_66,
10857   gestaltPowerBookDuo280 = 102,
10858   gestaltPowerBookDuo280c = 103,
10859   gestaltPowerMacLC475 = 104,
10860   gestaltPowerMacPerforma47x = gestaltPowerMacLC475,
10861   gestaltPowerMacLC575 = 105,
10862   gestaltPowerMacPerforma57x = gestaltPowerMacLC575,
10863   gestaltPowerMacQuadra630 = 106,
10864   gestaltPowerMacLC630 = gestaltPowerMacQuadra630,
10865   gestaltPowerMacPerforma63x = gestaltPowerMacQuadra630,
10866   gestaltPowerMac7200 = 108,
10867   gestaltPowerMac7300 = 109,
10868   gestaltPowerMac7100_66 = 112,
10869   gestaltPowerBook150 = 115,
10870   gestaltPowerMacQuadra700 = 116,
10871   gestaltPowerMacQuadra900 = 117,
10872   gestaltPowerMacQuadra950 = 118,
10873   gestaltPowerMacCentris610 = 119,
10874   gestaltPowerMacCentris650 = 120,
10875   gestaltPowerMacQuadra610 = 121,
10876   gestaltPowerMacQuadra650 = 122,
10877   gestaltPowerMacQuadra800 = 123,
10878   gestaltPowerBookDuo2300 = 124,
10879   gestaltPowerBook500PPCUpgrade = 126,
10880   gestaltPowerBook5300 = 128,
10881   gestaltPowerBook1400 = 310,
10882   gestaltPowerBook3400 = 306,
10883   gestaltPowerBook2400 = 307,
10884   gestaltPowerBookG3Series = 312,
10885   gestaltPowerBookG3 = 313,
10886   gestaltPowerBookG3Series2 = 314,
10887   gestaltPowerMacNewWorld = 406,
10888   gestaltPowerMacG3 = 510,
10889   gestaltPowerMac5500 = 512,
10890   gestalt20thAnniversary = gestaltPowerMac5500,
10891   gestaltPowerMac6500 = 513,
10892   gestaltPowerMac4400_160 = 514,
10893   gestaltPowerMac4400 = 515,
10894   gestaltMacOSCompatibility = 1206
10895 };
10896
10897
10898 enum {
10899   gestaltQuadra605 = gestaltMacQuadra605,
10900   gestaltQuadra610 = gestaltMacQuadra610,
10901   gestaltQuadra630 = gestaltMacQuadra630,
10902   gestaltQuadra650 = gestaltMacQuadra650,
10903   gestaltQuadra660AV = gestaltMacQuadra660AV,
10904   gestaltQuadra700 = gestaltMacQuadra700,
10905   gestaltQuadra800 = gestaltMacQuadra800,
10906   gestaltQuadra840AV = gestaltMacQuadra840AV,
10907   gestaltQuadra900 = gestaltMacQuadra900,
10908   gestaltQuadra950 = gestaltMacQuadra950
10909 };
10910
10911 enum {
10912   kMachineNameStrID = -16395
10913 };
10914
10915 enum {
10916   gestaltSMPMailerVersion = 'malr'
10917 };
10918
10919 enum {
10920   gestaltMediaBay = 'mbeh',
10921   gestaltMBLegacy = 0,
10922   gestaltMBSingleBay = 1,
10923   gestaltMBMultipleBays = 2
10924 };
10925
10926 enum {
10927   gestaltMessageMgrVersion = 'mess'
10928 };
10929
10930
10931
10932 enum {
10933   gestaltMenuMgrAttr = 'menu',
10934   gestaltMenuMgrPresent = (1L << 0),
10935
10936
10937   gestaltMenuMgrPresentBit = 0,
10938   gestaltMenuMgrAquaLayoutBit = 1,
10939   gestaltMenuMgrMultipleItemsWithCommandIDBit = 2,
10940   gestaltMenuMgrRetainsIconRefBit = 3,
10941   gestaltMenuMgrSendsMenuBoundsToDefProcBit = 4,
10942   gestaltMenuMgrMoreThanFiveMenusDeepBit = 5,
10943
10944   gestaltMenuMgrPresentMask = (1L << gestaltMenuMgrPresentBit),
10945   gestaltMenuMgrAquaLayoutMask = (1L << gestaltMenuMgrAquaLayoutBit),
10946   gestaltMenuMgrMultipleItemsWithCommandIDMask = (1L << gestaltMenuMgrMultipleItemsWithCommandIDBit),
10947   gestaltMenuMgrRetainsIconRefMask = (1L << gestaltMenuMgrRetainsIconRefBit),
10948   gestaltMenuMgrSendsMenuBoundsToDefProcMask = (1L << gestaltMenuMgrSendsMenuBoundsToDefProcBit),
10949   gestaltMenuMgrMoreThanFiveMenusDeepMask = (1L << gestaltMenuMgrMoreThanFiveMenusDeepBit)
10950 };
10951
10952
10953 enum {
10954   gestaltMultipleUsersState = 'mfdr'
10955 };
10956
10957
10958 enum {
10959   gestaltMachineIcon = 'micn'
10960 };
10961
10962 enum {
10963   gestaltMiscAttr = 'misc',
10964   gestaltScrollingThrottle = 0,
10965   gestaltSquareMenuBar = 2
10966 };
10967 enum {
10968   gestaltMixedModeVersion = 'mixd'
10969 };
10970
10971 enum {
10972   gestaltMixedModeAttr = 'mixd',
10973   gestaltMixedModePowerPC = 0,
10974   gestaltPowerPCAware = 0,
10975   gestaltMixedModeCFM68K = 1,
10976   gestaltMixedModeCFM68KHasTrap = 2,
10977   gestaltMixedModeCFM68KHasState = 3
10978 };
10979
10980 enum {
10981   gestaltQuickTimeConferencing = 'mtlk'
10982 };
10983
10984 enum {
10985   gestaltMemoryMapAttr = 'mmap',
10986   gestaltMemoryMapSparse = 0
10987 };
10988
10989 enum {
10990   gestaltMMUType = 'mmu ',
10991   gestaltNoMMU = 0,
10992   gestaltAMU = 1,
10993   gestalt68851 = 2,
10994   gestalt68030MMU = 3,
10995   gestalt68040MMU = 4,
10996   gestaltEMMU1 = 5
10997 };
10998
10999 enum {
11000   gestaltUserVisibleMachineName = 'mnam'
11001 };
11002
11003 enum {
11004   gestaltMPCallableAPIsAttr = 'mpsc',
11005   gestaltMPFileManager = 0,
11006   gestaltMPDeviceManager = 1,
11007   gestaltMPTrapCalls = 2
11008 };
11009
11010 enum {
11011   gestaltStdNBPAttr = 'nlup',
11012   gestaltStdNBPPresent = 0,
11013   gestaltStdNBPSupportsAutoPosition = 1
11014 };
11015
11016 enum {
11017   gestaltNotificationMgrAttr = 'nmgr',
11018   gestaltNotificationPresent = 0
11019 };
11020
11021 enum {
11022   gestaltNameRegistryVersion = 'nreg'
11023 };
11024
11025 enum {
11026   gestaltNuBusSlotCount = 'nubs'
11027 };
11028
11029 enum {
11030   gestaltOCEToolboxVersion = 'ocet',
11031   gestaltOCETB = 0x0102,
11032   gestaltSFServer = 0x0100
11033 };
11034
11035 enum {
11036   gestaltOCEToolboxAttr = 'oceu',
11037   gestaltOCETBPresent = 0x01,
11038   gestaltOCETBAvailable = 0x02,
11039   gestaltOCESFServerAvailable = 0x04,
11040   gestaltOCETBNativeGlueAvailable = 0x10
11041 };
11042
11043 enum {
11044   gestaltOpenFirmwareInfo = 'opfw'
11045 };
11046
11047 enum {
11048   gestaltOSAttr = 'os  ',
11049   gestaltSysZoneGrowable = 0,
11050   gestaltLaunchCanReturn = 1,
11051   gestaltLaunchFullFileSpec = 2,
11052   gestaltLaunchControl = 3,
11053   gestaltTempMemSupport = 4,
11054   gestaltRealTempMemory = 5,
11055   gestaltTempMemTracked = 6,
11056   gestaltIPCSupport = 7,
11057   gestaltSysDebuggerSupport = 8,
11058   gestaltNativeProcessMgrBit = 19,
11059   gestaltAltivecRegistersSwappedCorrectlyBit = 20
11060 };
11061
11062 enum {
11063   gestaltOSTable = 'ostt'
11064 };
11065 enum {
11066   gestaltOpenTptNetworkSetup = 'otcf',
11067   gestaltOpenTptNetworkSetupLegacyImport = 0,
11068   gestaltOpenTptNetworkSetupLegacyExport = 1,
11069   gestaltOpenTptNetworkSetupSupportsMultihoming = 2
11070 };
11071
11072 enum {
11073   gestaltOpenTptNetworkSetupVersion = 'otcv'
11074 };
11075
11076
11077
11078
11079
11080
11081
11082 enum {
11083   gestaltOpenTptRemoteAccess = 'otra',
11084   gestaltOpenTptRemoteAccessPresent = 0,
11085   gestaltOpenTptRemoteAccessLoaded = 1,
11086   gestaltOpenTptRemoteAccessClientOnly = 2,
11087   gestaltOpenTptRemoteAccessPServer = 3,
11088   gestaltOpenTptRemoteAccessMPServer = 4,
11089   gestaltOpenTptPPPPresent = 5,
11090   gestaltOpenTptARAPPresent = 6
11091 };
11092
11093 enum {
11094   gestaltOpenTptRemoteAccessVersion = 'otrv'
11095 };
11096
11097
11098
11099
11100
11101 enum {
11102   gestaltOpenTptVersions = 'otvr'
11103 };
11104
11105 enum {
11106   gestaltOpenTpt = 'otan',
11107   gestaltOpenTptPresentMask = 0x00000001,
11108   gestaltOpenTptLoadedMask = 0x00000002,
11109   gestaltOpenTptAppleTalkPresentMask = 0x00000004,
11110   gestaltOpenTptAppleTalkLoadedMask = 0x00000008,
11111   gestaltOpenTptTCPPresentMask = 0x00000010,
11112   gestaltOpenTptTCPLoadedMask = 0x00000020,
11113   gestaltOpenTptIPXSPXPresentMask = 0x00000040,
11114   gestaltOpenTptIPXSPXLoadedMask = 0x00000080,
11115   gestaltOpenTptPresentBit = 0,
11116   gestaltOpenTptLoadedBit = 1,
11117   gestaltOpenTptAppleTalkPresentBit = 2,
11118   gestaltOpenTptAppleTalkLoadedBit = 3,
11119   gestaltOpenTptTCPPresentBit = 4,
11120   gestaltOpenTptTCPLoadedBit = 5,
11121   gestaltOpenTptIPXSPXPresentBit = 6,
11122   gestaltOpenTptIPXSPXLoadedBit = 7
11123 };
11124
11125
11126 enum {
11127   gestaltPCCard = 'pccd',
11128   gestaltCardServicesPresent = 0,
11129   gestaltPCCardFamilyPresent = 1,
11130   gestaltPCCardHasPowerControl = 2,
11131   gestaltPCCardSupportsCardBus = 3
11132 };
11133
11134 enum {
11135   gestaltProcClkSpeed = 'pclk'
11136 };
11137
11138 enum {
11139   gestaltPCXAttr = 'pcxg',
11140   gestaltPCXHas8and16BitFAT = 0,
11141   gestaltPCXHasProDOS = 1,
11142   gestaltPCXNewUI = 2,
11143   gestaltPCXUseICMapping = 3
11144 };
11145
11146 enum {
11147   gestaltLogicalPageSize = 'pgsz'
11148 };
11149 enum {
11150   gestaltScreenCaptureMain = 'pic1',
11151   gestaltScreenCaptureDir = 'pic2'
11152 };
11153
11154 enum {
11155   gestaltGXPrintingMgrVersion = 'pmgr'
11156 };
11157
11158 enum {
11159   gestaltPopupAttr = 'pop!',
11160   gestaltPopupPresent = 0
11161 };
11162
11163 enum {
11164   gestaltPowerMgrAttr = 'powr',
11165   gestaltPMgrExists = 0,
11166   gestaltPMgrCPUIdle = 1,
11167   gestaltPMgrSCC = 2,
11168   gestaltPMgrSound = 3,
11169   gestaltPMgrDispatchExists = 4,
11170   gestaltPMgrSupportsAVPowerStateAtSleepWake = 5
11171 };
11172
11173 enum {
11174   gestaltPowerMgrVers = 'pwrv'
11175 };
11176
11177
11178
11179
11180
11181
11182
11183 enum {
11184   gestaltPPCToolboxAttr = 'ppc ',
11185   gestaltPPCToolboxPresent = 0x0000,
11186   gestaltPPCSupportsRealTime = 0x1000,
11187   gestaltPPCSupportsIncoming = 0x0001,
11188   gestaltPPCSupportsOutGoing = 0x0002,
11189   gestaltPPCSupportsTCP_IP = 0x0004,
11190   gestaltPPCSupportsIncomingAppleTalk = 0x0010,
11191   gestaltPPCSupportsIncomingTCP_IP = 0x0020,
11192   gestaltPPCSupportsOutgoingAppleTalk = 0x0100,
11193   gestaltPPCSupportsOutgoingTCP_IP = 0x0200
11194 };
11195
11196 enum {
11197   gestaltPowerPCProcessorFeatures = 'ppcf',
11198   gestaltPowerPCHasGraphicsInstructions = 0,
11199   gestaltPowerPCHasSTFIWXInstruction = 1,
11200   gestaltPowerPCHasSquareRootInstructions = 2,
11201   gestaltPowerPCHasDCBAInstruction = 3,
11202   gestaltPowerPCHasVectorInstructions = 4,
11203   gestaltPowerPCHasDataStreams = 5
11204 };
11205
11206 enum {
11207   gestaltProcessorType = 'proc',
11208   gestalt68000 = 1,
11209   gestalt68010 = 2,
11210   gestalt68020 = 3,
11211   gestalt68030 = 4,
11212   gestalt68040 = 5
11213 };
11214
11215 enum {
11216   gestaltSDPPromptVersion = 'prpv'
11217 };
11218
11219 enum {
11220   gestaltParityAttr = 'prty',
11221   gestaltHasParityCapability = 0,
11222   gestaltParityEnabled = 1
11223 };
11224
11225 enum {
11226   gestaltQD3DVersion = 'q3v '
11227 };
11228
11229 enum {
11230   gestaltQD3DViewer = 'q3vc',
11231   gestaltQD3DViewerPresent = 0
11232 };
11233 enum {
11234   gestaltQuickdrawVersion = 'qd  ',
11235   gestaltOriginalQD = 0x0000,
11236   gestalt8BitQD = 0x0100,
11237   gestalt32BitQD = 0x0200,
11238   gestalt32BitQD11 = 0x0201,
11239   gestalt32BitQD12 = 0x0220,
11240   gestalt32BitQD13 = 0x0230,
11241   gestaltAllegroQD = 0x0250,
11242   gestaltMacOSXQD = 0x0300
11243 };
11244
11245 enum {
11246   gestaltQD3D = 'qd3d',
11247   gestaltQD3DPresent = 0
11248 };
11249 enum {
11250   gestaltGXVersion = 'qdgx'
11251 };
11252
11253 enum {
11254   gestaltQuickdrawFeatures = 'qdrw',
11255   gestaltHasColor = 0,
11256   gestaltHasDeepGWorlds = 1,
11257   gestaltHasDirectPixMaps = 2,
11258   gestaltHasGrayishTextOr = 3,
11259   gestaltSupportsMirroring = 4,
11260   gestaltQDHasLongRowBytes = 5
11261 };
11262
11263 enum {
11264   gestaltQDTextVersion = 'qdtx',
11265   gestaltOriginalQDText = 0x0000,
11266   gestaltAllegroQDText = 0x0100,
11267   gestaltMacOSXQDText = 0x0200
11268 };
11269
11270 enum {
11271   gestaltQDTextFeatures = 'qdtf',
11272   gestaltWSIISupport = 0,
11273   gestaltSbitFontSupport = 1,
11274   gestaltAntiAliasedTextAvailable = 2,
11275   gestaltOFA2available = 3,
11276   gestaltCreatesAliasFontRsrc = 4,
11277   gestaltNativeType1FontSupport = 5,
11278   gestaltCanUseCGTextRendering = 6
11279 };
11280
11281
11282 enum {
11283   gestaltQuickTimeConferencingInfo = 'qtci'
11284 };
11285
11286 enum {
11287   gestaltQuickTimeVersion = 'qtim',
11288   gestaltQuickTime = 'qtim'
11289 };
11290
11291 enum {
11292   gestaltQuickTimeFeatures = 'qtrs',
11293   gestaltPPCQuickTimeLibPresent = 0
11294 };
11295
11296 enum {
11297   gestaltQuickTimeStreamingFeatures = 'qtsf'
11298 };
11299
11300 enum {
11301   gestaltQuickTimeStreamingVersion = 'qtst'
11302 };
11303
11304 enum {
11305   gestaltQTVRMgrAttr = 'qtvr',
11306   gestaltQTVRMgrPresent = 0,
11307   gestaltQTVRObjMoviesPresent = 1,
11308   gestaltQTVRCylinderPanosPresent = 2,
11309   gestaltQTVRCubicPanosPresent = 3
11310 };
11311
11312 enum {
11313   gestaltQTVRMgrVers = 'qtvv'
11314 };
11315
11316 enum {
11317   gestaltPhysicalRAMSize = 'ram '
11318 };
11319
11320 enum {
11321   gestaltRBVAddr = 'rbv '
11322 };
11323
11324 enum {
11325   gestaltROMSize = 'rom '
11326 };
11327
11328 enum {
11329   gestaltROMVersion = 'romv'
11330 };
11331
11332 enum {
11333   gestaltResourceMgrAttr = 'rsrc',
11334   gestaltPartialRsrcs = 0,
11335   gestaltHasResourceOverrides = 1
11336 };
11337
11338 enum {
11339   gestaltResourceMgrBugFixesAttrs = 'rmbg',
11340   gestaltRMForceSysHeapRolledIn = 0,
11341   gestaltRMFakeAppleMenuItemsRolledIn = 1,
11342   gestaltSanityCheckResourceFiles = 2,
11343   gestaltSupportsFSpResourceFileAlreadyOpenBit = 3,
11344   gestaltRMSupportsFSCalls = 4,
11345   gestaltRMTypeIndexOrderingReverse = 8
11346 };
11347
11348
11349 enum {
11350   gestaltRealtimeMgrAttr = 'rtmr',
11351   gestaltRealtimeMgrPresent = 0
11352 };
11353
11354
11355 enum {
11356   gestaltSafeOFAttr = 'safe',
11357   gestaltVMZerosPagesBit = 0,
11358   gestaltInitHeapZerosOutHeapsBit = 1,
11359   gestaltNewHandleReturnsZeroedMemoryBit = 2,
11360   gestaltNewPtrReturnsZeroedMemoryBit = 3,
11361   gestaltFileAllocationZeroedBlocksBit = 4
11362 };
11363
11364
11365 enum {
11366   gestaltSCCReadAddr = 'sccr'
11367 };
11368
11369 enum {
11370   gestaltSCCWriteAddr = 'sccw'
11371 };
11372
11373 enum {
11374   gestaltScrapMgrAttr = 'scra',
11375   gestaltScrapMgrTranslationAware = 0
11376 };
11377
11378 enum {
11379   gestaltScriptMgrVersion = 'scri'
11380 };
11381
11382 enum {
11383   gestaltScriptCount = 'scr#'
11384 };
11385
11386 enum {
11387   gestaltSCSI = 'scsi',
11388   gestaltAsyncSCSI = 0,
11389   gestaltAsyncSCSIINROM = 1,
11390   gestaltSCSISlotBoot = 2,
11391   gestaltSCSIPollSIH = 3
11392 };
11393
11394 enum {
11395   gestaltControlStripAttr = 'sdev',
11396   gestaltControlStripExists = 0,
11397   gestaltControlStripVersionFixed = 1,
11398   gestaltControlStripUserFont = 2,
11399   gestaltControlStripUserHotKey = 3
11400 };
11401
11402 enum {
11403   gestaltSDPStandardDirectoryVersion = 'sdvr'
11404 };
11405
11406 enum {
11407   gestaltSerialAttr = 'ser ',
11408   gestaltHasGPIaToDCDa = 0,
11409   gestaltHasGPIaToRTxCa = 1,
11410   gestaltHasGPIbToDCDb = 2,
11411   gestaltHidePortA = 3,
11412   gestaltHidePortB = 4,
11413   gestaltPortADisabled = 5,
11414   gestaltPortBDisabled = 6
11415 };
11416
11417 enum {
11418   gestaltShutdownAttributes = 'shut',
11419   gestaltShutdownHassdOnBootVolUnmount = 0
11420 };
11421
11422 enum {
11423   gestaltNuBusConnectors = 'sltc'
11424 };
11425
11426 enum {
11427   gestaltSlotAttr = 'slot',
11428   gestaltSlotMgrExists = 0,
11429   gestaltNuBusPresent = 1,
11430   gestaltSESlotPresent = 2,
11431   gestaltSE30SlotPresent = 3,
11432   gestaltPortableSlotPresent = 4
11433 };
11434
11435 enum {
11436   gestaltFirstSlotNumber = 'slt1'
11437 };
11438
11439 enum {
11440   gestaltSoundAttr = 'snd ',
11441   gestaltStereoCapability = 0,
11442   gestaltStereoMixing = 1,
11443   gestaltSoundIOMgrPresent = 3,
11444   gestaltBuiltInSoundInput = 4,
11445   gestaltHasSoundInputDevice = 5,
11446   gestaltPlayAndRecord = 6,
11447   gestalt16BitSoundIO = 7,
11448   gestaltStereoInput = 8,
11449   gestaltLineLevelInput = 9,
11450
11451   gestaltSndPlayDoubleBuffer = 10,
11452   gestaltMultiChannels = 11,
11453   gestalt16BitAudioSupport = 12
11454 };
11455
11456 enum {
11457   gestaltSplitOSAttr = 'spos',
11458   gestaltSplitOSBootDriveIsNetworkVolume = 0,
11459   gestaltSplitOSAware = 1,
11460   gestaltSplitOSEnablerVolumeIsDifferentFromBootVolume = 2,
11461   gestaltSplitOSMachineNameSetToNetworkNameTemp = 3,
11462   gestaltSplitOSMachineNameStartupDiskIsNonPersistent = 5
11463 };
11464
11465 enum {
11466   gestaltSMPSPSendLetterVersion = 'spsl'
11467 };
11468
11469 enum {
11470   gestaltSpeechRecognitionAttr = 'srta',
11471   gestaltDesktopSpeechRecognition = 1,
11472   gestaltTelephoneSpeechRecognition = 2
11473 };
11474
11475 enum {
11476   gestaltSpeechRecognitionVersion = 'srtb'
11477 };
11478
11479 enum {
11480   gestaltSoftwareVendorCode = 'srad',
11481   gestaltSoftwareVendorApple = 'Appl',
11482   gestaltSoftwareVendorLicensee = 'Lcns'
11483 };
11484
11485 enum {
11486   gestaltStandardFileAttr = 'stdf',
11487   gestaltStandardFile58 = 0,
11488   gestaltStandardFileTranslationAware = 1,
11489   gestaltStandardFileHasColorIcons = 2,
11490   gestaltStandardFileUseGenericIcons = 3,
11491   gestaltStandardFileHasDynamicVolumeAllocation = 4
11492 };
11493
11494 enum {
11495   gestaltSysArchitecture = 'sysa',
11496   gestalt68k = 1,
11497   gestaltPowerPC = 2
11498 };
11499
11500 enum {
11501   gestaltIntel = 10
11502 };
11503
11504 enum {
11505   gestaltSystemUpdateVersion = 'sysu'
11506 };
11507
11508 enum {
11509   gestaltSystemVersion = 'sysv'
11510 };
11511
11512 enum {
11513   gestaltToolboxTable = 'tbtt'
11514 };
11515
11516 enum {
11517   gestaltTextEditVersion = 'te  ',
11518   gestaltTE1 = 1,
11519   gestaltTE2 = 2,
11520   gestaltTE3 = 3,
11521   gestaltTE4 = 4,
11522   gestaltTE5 = 5
11523 };
11524
11525 enum {
11526   gestaltTE6 = 6
11527 };
11528
11529 enum {
11530   gestaltTEAttr = 'teat',
11531   gestaltTEHasGetHiliteRgn = 0,
11532   gestaltTESupportsInlineInput = 1,
11533   gestaltTESupportsTextObjects = 2,
11534   gestaltTEHasWhiteBackground = 3
11535 };
11536
11537 enum {
11538   gestaltTeleMgrAttr = 'tele',
11539   gestaltTeleMgrPresent = 0,
11540   gestaltTeleMgrPowerPCSupport = 1,
11541   gestaltTeleMgrSoundStreams = 2,
11542   gestaltTeleMgrAutoAnswer = 3,
11543   gestaltTeleMgrIndHandset = 4,
11544   gestaltTeleMgrSilenceDetect = 5,
11545   gestaltTeleMgrNewTELNewSupport = 6
11546 };
11547
11548 enum {
11549   gestaltTermMgrAttr = 'term',
11550   gestaltTermMgrPresent = 0,
11551   gestaltTermMgrErrorString = 2
11552 };
11553
11554 enum {
11555   gestaltThreadMgrAttr = 'thds',
11556   gestaltThreadMgrPresent = 0,
11557   gestaltSpecificMatchSupport = 1,
11558   gestaltThreadsLibraryPresent = 2
11559 };
11560
11561 enum {
11562   gestaltTimeMgrVersion = 'tmgr',
11563   gestaltStandardTimeMgr = 1,
11564   gestaltRevisedTimeMgr = 2,
11565   gestaltExtendedTimeMgr = 3,
11566   gestaltNativeTimeMgr = 4
11567 };
11568
11569 enum {
11570   gestaltTSMTEVersion = 'tmTV',
11571   gestaltTSMTE1 = 0x0100,
11572   gestaltTSMTE15 = 0x0150,
11573   gestaltTSMTE152 = 0x0152
11574 };
11575
11576 enum {
11577   gestaltTSMTEAttr = 'tmTE',
11578   gestaltTSMTEPresent = 0,
11579   gestaltTSMTE = 0
11580 };
11581
11582 enum {
11583   gestaltAVLTreeAttr = 'tree',
11584   gestaltAVLTreePresentBit = 0,
11585   gestaltAVLTreeSupportsHandleBasedTreeBit = 1,
11586   gestaltAVLTreeSupportsTreeLockingBit = 2
11587 };
11588
11589 enum {
11590   gestaltALMAttr = 'trip',
11591   gestaltALMPresent = 0,
11592   gestaltALMHasSFGroup = 1,
11593   gestaltALMHasCFMSupport = 2,
11594   gestaltALMHasRescanNotifiers = 3
11595 };
11596
11597 enum {
11598   gestaltALMHasSFLocation = gestaltALMHasSFGroup
11599 };
11600
11601 enum {
11602   gestaltTSMgrVersion = 'tsmv',
11603   gestaltTSMgr15 = 0x0150,
11604   gestaltTSMgr20 = 0x0200
11605 };
11606
11607 enum {
11608   gestaltTSMgrAttr = 'tsma',
11609   gestaltTSMDisplayMgrAwareBit = 0,
11610   gestaltTSMdoesTSMTEBit = 1
11611 };
11612
11613 enum {
11614   gestaltSpeechAttr = 'ttsc',
11615   gestaltSpeechMgrPresent = 0,
11616   gestaltSpeechHasPPCGlue = 1
11617 };
11618
11619 enum {
11620   gestaltTVAttr = 'tv  ',
11621   gestaltHasTVTuner = 0,
11622   gestaltHasSoundFader = 1,
11623   gestaltHasHWClosedCaptioning = 2,
11624   gestaltHasIRRemote = 3,
11625   gestaltHasVidDecoderScaler = 4,
11626   gestaltHasStereoDecoder = 5,
11627   gestaltHasSerialFader = 6,
11628   gestaltHasFMTuner = 7,
11629   gestaltHasSystemIRFunction = 8,
11630   gestaltIRDisabled = 9,
11631   gestaltINeedIRPowerOffConfirm = 10,
11632   gestaltHasZoomedVideo = 11
11633 };
11634
11635
11636 enum {
11637   gestaltATSUVersion = 'uisv',
11638   gestaltOriginalATSUVersion = (1 << 16),
11639   gestaltATSUUpdate1 = (2 << 16),
11640   gestaltATSUUpdate2 = (3 << 16),
11641   gestaltATSUUpdate3 = (4 << 16),
11642   gestaltATSUUpdate4 = (5 << 16),
11643   gestaltATSUUpdate5 = (6 << 16),
11644   gestaltATSUUpdate6 = (7 << 16)
11645 };
11646
11647 enum {
11648   gestaltATSUFeatures = 'uisf',
11649   gestaltATSUTrackingFeature = 0x00000001,
11650   gestaltATSUMemoryFeature = 0x00000001,
11651   gestaltATSUFallbacksFeature = 0x00000001,
11652   gestaltATSUGlyphBoundsFeature = 0x00000001,
11653   gestaltATSULineControlFeature = 0x00000001,
11654   gestaltATSULayoutCreateAndCopyFeature = 0x00000001,
11655   gestaltATSULayoutCacheClearFeature = 0x00000001,
11656   gestaltATSUTextLocatorUsageFeature = 0x00000002,
11657   gestaltATSULowLevelOrigFeatures = 0x00000004,
11658   gestaltATSUFallbacksObjFeatures = 0x00000008,
11659   gestaltATSUIgnoreLeadingFeature = 0x00000008,
11660   gestaltATSUByCharacterClusterFeature = 0x00000010,
11661   gestaltATSUAscentDescentControlsFeature = 0x00000010,
11662   gestaltATSUHighlightInactiveTextFeature = 0x00000010,
11663   gestaltATSUPositionToCursorFeature = 0x00000010,
11664   gestaltATSUBatchBreakLinesFeature = 0x00000010,
11665   gestaltATSUTabSupportFeature = 0x00000010,
11666   gestaltATSUDirectAccess = 0x00000010
11667 };
11668
11669 enum {
11670   gestaltUSBAttr = 'usb ',
11671   gestaltUSBPresent = 0,
11672   gestaltUSBHasIsoch = 1
11673 };
11674
11675 enum {
11676   gestaltUSBVersion = 'usbv'
11677 };
11678
11679 enum {
11680   gestaltVersion = 'vers',
11681   gestaltValueImplementedVers = 5
11682 };
11683
11684 enum {
11685   gestaltVIA1Addr = 'via1'
11686 };
11687
11688 enum {
11689   gestaltVIA2Addr = 'via2'
11690 };
11691
11692 enum {
11693   gestaltVMAttr = 'vm  ',
11694   gestaltVMPresent = 0,
11695   gestaltVMHasLockMemoryForOutput = 1,
11696   gestaltVMFilemappingOn = 3,
11697   gestaltVMHasPagingControl = 4
11698 };
11699
11700 enum {
11701   gestaltVMInfoType = 'vmin',
11702
11703   gestaltVMInfoSizeStorageType = 0,
11704   gestaltVMInfoSizeType = 1,
11705   gestaltVMInfoSimpleType = 2,
11706   gestaltVMInfoNoneType = 3
11707 };
11708
11709 enum {
11710   gestaltVMBackingStoreFileRefNum = 'vmbs'
11711 };
11712
11713
11714
11715 enum {
11716   gestaltALMVers = 'walk'
11717 };
11718
11719 enum {
11720   gestaltWindowMgrAttr = 'wind',
11721   gestaltWindowMgrPresent = (1L << 0),
11722
11723
11724   gestaltWindowMgrPresentBit = 0,
11725   gestaltExtendedWindowAttributes = 1,
11726   gestaltExtendedWindowAttributesBit = 1,
11727   gestaltHasFloatingWindows = 2,
11728   gestaltHasFloatingWindowsBit = 2,
11729   gestaltHasWindowBuffering = 3,
11730   gestaltHasWindowBufferingBit = 3,
11731   gestaltWindowLiveResizeBit = 4,
11732   gestaltWindowMinimizeToDockBit = 5,
11733   gestaltHasWindowShadowsBit = 6,
11734   gestaltSheetsAreWindowModalBit = 7,
11735   gestaltFrontWindowMayBeHiddenBit = 8,
11736
11737   gestaltWindowMgrPresentMask = (1L << gestaltWindowMgrPresentBit),
11738   gestaltExtendedWindowAttributesMask = (1L << gestaltExtendedWindowAttributesBit),
11739   gestaltHasFloatingWindowsMask = (1L << gestaltHasFloatingWindowsBit),
11740   gestaltHasWindowBufferingMask = (1L << gestaltHasWindowBufferingBit),
11741   gestaltWindowLiveResizeMask = (1L << gestaltWindowLiveResizeBit),
11742   gestaltWindowMinimizeToDockMask = (1L << gestaltWindowMinimizeToDockBit),
11743   gestaltHasWindowShadowsMask = (1L << gestaltHasWindowShadowsBit),
11744   gestaltSheetsAreWindowModalMask = (1L << gestaltSheetsAreWindowModalBit),
11745   gestaltFrontWindowMayBeHiddenMask = (1L << gestaltFrontWindowMayBeHiddenBit)
11746 };
11747
11748 enum {
11749   gestaltHasSingleWindowModeBit = 8,
11750   gestaltHasSingleWindowModeMask = (1L << gestaltHasSingleWindowModeBit)
11751 };
11752 enum {
11753   gestaltTranslationAttr = 'xlat',
11754   gestaltTranslationMgrExists = 0,
11755   gestaltTranslationMgrHintOrder = 1,
11756   gestaltTranslationPPCAvail = 2,
11757   gestaltTranslationGetPathAPIAvail = 3
11758 };
11759
11760 enum {
11761   gestaltExtToolboxTable = 'xttt'
11762 };
11763
11764 enum {
11765   gestaltUSBPrinterSharingVersion = 'zak ',
11766   gestaltUSBPrinterSharingVersionMask = 0x0000FFFF,
11767   gestaltUSBPrinterSharingAttr = 'zak ',
11768   gestaltUSBPrinterSharingAttrMask = (long)0xFFFF0000,
11769   gestaltUSBPrinterSharingAttrRunning = (long)0x80000000,
11770   gestaltUSBPrinterSharingAttrBooted = 0x40000000
11771 };
11772
11773
11774 enum {
11775   gestaltWorldScriptIIVersion = 'doub',
11776   gestaltWorldScriptIIAttr = 'wsat',
11777   gestaltWSIICanPrintWithoutPrGeneralBit = 0
11778 };
11779
11780
11781
11782
11783
11784
11785 }
11786
11787
11788
11789 extern "C" {
11790
11791
11792
11793 enum {
11794   maxSize = 0x7FFFFFF0
11795 };
11796
11797 enum {
11798   defaultPhysicalEntryCount = 8
11799 };
11800
11801 enum {
11802
11803   kPageInMemory = 0,
11804   kPageOnDisk = 1,
11805   kNotPaged = 2
11806 };
11807
11808 enum {
11809
11810   k32BitHeap = 1,
11811   kNewStyleHeap = 2,
11812   kNewDebugHeap = 4
11813 };
11814
11815
11816
11817 enum {
11818   kHandleIsResourceBit = 5,
11819   kHandlePurgeableBit = 6,
11820   kHandleLockedBit = 7
11821 };
11822
11823
11824 enum {
11825   kHandleIsResourceMask = 0x20,
11826   kHandlePurgeableMask = 0x40,
11827   kHandleLockedMask = 0x80
11828 };
11829
11830
11831 typedef long ( * GrowZoneProcPtr)(Size cbNeeded);
11832 typedef void ( * PurgeProcPtr)(Handle blockToPurge);
11833 typedef void ( * UserFnProcPtr)(void * parameter);
11834 typedef GrowZoneProcPtr GrowZoneUPP;
11835 typedef PurgeProcPtr PurgeUPP;
11836 typedef UserFnProcPtr UserFnUPP;
11837 struct Zone {
11838   Ptr bkLim;
11839   Ptr purgePtr;
11840   Ptr hFstFree;
11841   long zcbFree;
11842   GrowZoneUPP gzProc;
11843   short moreMast;
11844   short flags;
11845   short cntRel;
11846   short maxRel;
11847   short cntNRel;
11848   SInt8 heapType;
11849   SInt8 unused;
11850   short cntEmpty;
11851   short cntHandles;
11852   long minCBFree;
11853   PurgeUPP purgeProc;
11854   Ptr sparePtr;
11855   Ptr allocPtr;
11856   short heapData;
11857 };
11858 typedef struct Zone Zone;
11859 typedef Zone * THz;
11860 typedef THz * THzPtr;
11861 struct MemoryBlock {
11862   void * address;
11863   unsigned long count;
11864 };
11865 typedef struct MemoryBlock MemoryBlock;
11866 struct LogicalToPhysicalTable {
11867   MemoryBlock logical;
11868   MemoryBlock physical[8];
11869 };
11870 typedef struct LogicalToPhysicalTable LogicalToPhysicalTable;
11871
11872 typedef short PageState;
11873 typedef short StatusRegisterContents;
11874 enum {
11875   kVolumeVirtualMemoryInfoVersion1 = 1
11876 };
11877
11878 struct VolumeVirtualMemoryInfo {
11879   PBVersion version;
11880   SInt16 volumeRefNum;
11881   Boolean inUse;
11882   UInt8 _fill;
11883   UInt32 vmOptions;
11884
11885 };
11886 typedef struct VolumeVirtualMemoryInfo VolumeVirtualMemoryInfo;
11887 typedef VolumeVirtualMemoryInfo * VolumeVirtualMemoryInfoPtr;
11888 extern GrowZoneUPP
11889 NewGrowZoneUPP(GrowZoneProcPtr userRoutine) ;
11890 extern PurgeUPP
11891 NewPurgeUPP(PurgeProcPtr userRoutine) ;
11892 extern UserFnUPP
11893 NewUserFnUPP(UserFnProcPtr userRoutine) ;
11894 extern void
11895 DisposeGrowZoneUPP(GrowZoneUPP userUPP) ;
11896 extern void
11897 DisposePurgeUPP(PurgeUPP userUPP) ;
11898 extern void
11899 DisposeUserFnUPP(UserFnUPP userUPP) ;
11900 extern long
11901 InvokeGrowZoneUPP(
11902   Size cbNeeded,
11903   GrowZoneUPP userUPP) ;
11904 extern void
11905 InvokePurgeUPP(
11906   Handle blockToPurge,
11907   PurgeUPP userUPP) ;
11908 extern void
11909 InvokeUserFnUPP(
11910   void * parameter,
11911   UserFnUPP userUPP) ;
11912 extern Handle
11913 GZSaveHnd(void) ;
11914 extern Ptr
11915 TopMem(void) ;
11916 extern OSErr
11917 MemError(void) ;
11918 extern Handle
11919 NewHandle(Size byteCount) ;
11920 extern Handle
11921 NewHandleClear(Size byteCount) ;
11922 extern Handle
11923 RecoverHandle(Ptr p) ;
11924 extern Ptr
11925 NewPtr(Size byteCount) ;
11926 extern Ptr
11927 NewPtrClear(Size byteCount) ;
11928 extern long
11929 MaxBlock(void) ;
11930 extern long
11931 StackSpace(void) ;
11932 extern Handle
11933 NewEmptyHandle(void) ;
11934 extern void
11935 HLock(Handle h) ;
11936 extern void
11937 HUnlock(Handle h) ;
11938 extern void
11939 HPurge(Handle h) ;
11940 extern void
11941 HNoPurge(Handle h) ;
11942 extern void
11943 HLockHi(Handle h) ;
11944 extern Handle
11945 TempNewHandle(
11946   Size logicalSize,
11947   OSErr * resultCode) ;
11948 extern Size
11949 TempMaxMem(Size * grow) ;
11950 extern long
11951 TempFreeMem(void) ;
11952 extern Size
11953 CompactMem(Size cbNeeded) ;
11954 extern void
11955 PurgeMem(Size cbNeeded) ;
11956 extern long
11957 FreeMem(void) ;
11958 extern void
11959 ReserveMem(Size cbNeeded) ;
11960 extern Size
11961 MaxMem(Size * grow) ;
11962 extern void
11963 SetGrowZone(GrowZoneUPP growZone) ;
11964 extern GrowZoneUPP
11965 GetGrowZone(void) ;
11966 extern void
11967 MoveHHi(Handle h) ;
11968 extern void
11969 DisposePtr(Ptr p) ;
11970 extern Size
11971 GetPtrSize(Ptr p) ;
11972 extern void
11973 SetPtrSize(
11974   Ptr p,
11975   Size newSize) ;
11976 extern void
11977 DisposeHandle(Handle h) ;
11978 extern void
11979 SetHandleSize(
11980   Handle h,
11981   Size newSize) ;
11982 extern Size
11983 GetHandleSize(Handle h) ;
11984 extern void
11985 ReallocateHandle(
11986   Handle h,
11987   Size byteCount) ;
11988 extern void
11989 EmptyHandle(Handle h) ;
11990 extern void
11991 HSetRBit(Handle h) ;
11992 extern void
11993 HClrRBit(Handle h) ;
11994 extern SInt8
11995 HGetState(Handle h) ;
11996 extern void
11997 HSetState(
11998   Handle h,
11999   SInt8 flags) ;
12000 extern void
12001 PurgeSpace(
12002   long * total,
12003   long * contig) ;
12004 extern long
12005 PurgeSpaceTotal(void) ;
12006 extern long
12007 PurgeSpaceContiguous(void) ;
12008 extern void
12009 BlockMove(
12010   const void * srcPtr,
12011   void * destPtr,
12012   Size byteCount) ;
12013 extern void
12014 BlockMoveData(
12015   const void * srcPtr,
12016   void * destPtr,
12017   Size byteCount) ;
12018 extern void
12019 BlockMoveUncached(
12020   const void * srcPtr,
12021   void * destPtr,
12022   Size byteCount) ;
12023 extern void
12024 BlockMoveDataUncached(
12025   const void * srcPtr,
12026   void * destPtr,
12027   Size byteCount) ;
12028 extern void
12029 BlockZero(
12030   void * destPtr,
12031   Size byteCount) ;
12032 extern void
12033 BlockZeroUncached(
12034   void * destPtr,
12035   Size byteCount) ;
12036 extern void
12037 MoreMasters(void) ;
12038 extern void
12039 MoreMasterPointers(UInt32 inCount) ;
12040 extern void
12041 TempHLock(
12042   Handle h,
12043   OSErr * resultCode) ;
12044 extern void
12045 TempHUnlock(
12046   Handle h,
12047   OSErr * resultCode) ;
12048 extern void
12049 TempDisposeHandle(
12050   Handle h,
12051   OSErr * resultCode) ;
12052 extern Ptr
12053 TempTopMem(void) ;
12054 extern OSErr
12055 HoldMemory(
12056   void * address,
12057   unsigned long count) ;
12058 extern OSErr
12059 UnholdMemory(
12060   void * address,
12061   unsigned long count) ;
12062 extern OSErr
12063 MakeMemoryResident(
12064   void * address,
12065   unsigned long count) ;
12066 extern OSErr
12067 ReleaseMemoryData(
12068   void * address,
12069   unsigned long count) ;
12070 extern OSErr
12071 MakeMemoryNonResident(
12072   void * address,
12073   unsigned long count) ;
12074 extern OSErr
12075 FlushMemory(
12076   void * address,
12077   unsigned long count) ;
12078 extern OSErr
12079 HandToHand(Handle * theHndl) ;
12080 extern OSErr
12081 PtrToXHand(
12082   const void * srcPtr,
12083   Handle dstHndl,
12084   long size) ;
12085 extern OSErr
12086 PtrToHand(
12087   const void * srcPtr,
12088   Handle * dstHndl,
12089   long size) ;
12090 extern OSErr
12091 HandAndHand(
12092   Handle hand1,
12093   Handle hand2) ;
12094 extern OSErr
12095 PtrAndHand(
12096   const void * ptr1,
12097   Handle hand2,
12098   long size) ;
12099 extern Boolean
12100 CheckAllHeaps(void) ;
12101 extern Boolean
12102 IsHeapValid(void) ;
12103 extern Boolean
12104 IsHandleValid(Handle h) ;
12105 extern Boolean
12106 IsPointerValid(Ptr p) ;
12107
12108
12109 }
12110
12111
12112
12113 extern "C" {
12114 extern SInt64
12115 S64Max(void);
12116 extern SInt64
12117 S64Min(void);
12118 extern SInt64
12119 S64Add(
12120   SInt64 left,
12121   SInt64 right);
12122 extern SInt64
12123 S64Subtract(
12124   SInt64 left,
12125   SInt64 right);
12126 extern SInt64
12127 S64Negate(SInt64 value);
12128 extern SInt64
12129 S64Multiply(
12130   SInt64 left,
12131   SInt64 right);
12132 extern SInt64
12133 S64Mod(
12134   SInt64 dividend,
12135   SInt64 divisor);
12136 extern SInt64
12137 S64Divide(
12138   SInt64 dividend,
12139   SInt64 divisor,
12140   SInt64 * remainder);
12141 extern SInt64
12142 S64Div(
12143   SInt64 dividend,
12144   SInt64 divisor);
12145 extern SInt64
12146 S64Set(SInt32 value);
12147 extern SInt64
12148 S64SetU(UInt32 value);
12149 extern SInt32
12150 S32Set(SInt64 value);
12151 extern Boolean
12152 S64And(
12153   SInt64 left,
12154   SInt64 right);
12155 extern Boolean
12156 S64Or(
12157   SInt64 left,
12158   SInt64 right);
12159 extern Boolean
12160 S64Eor(
12161   SInt64 left,
12162   SInt64 right);
12163 extern Boolean
12164 S64Not(SInt64 value);
12165 extern SInt32
12166 S64Compare(
12167   SInt64 left,
12168   SInt64 right) ;
12169 extern SInt64
12170 S64BitwiseAnd(
12171   SInt64 left,
12172   SInt64 right);
12173 extern SInt64
12174 S64BitwiseOr(
12175   SInt64 left,
12176   SInt64 right);
12177 extern SInt64
12178 S64BitwiseEor(
12179   SInt64 left,
12180   SInt64 right);
12181 extern SInt64
12182 S64BitwiseNot(SInt64 value);
12183 extern SInt64
12184 S64ShiftRight(
12185   SInt64 value,
12186   UInt32 shift);
12187 extern SInt64
12188 S64ShiftLeft(
12189   SInt64 value,
12190   UInt32 shift);
12191 extern UInt64
12192 U64Max(void);
12193 extern UInt64
12194 U64Add(
12195   UInt64 left,
12196   UInt64 right);
12197 extern UInt64
12198 U64Subtract(
12199   UInt64 left,
12200   UInt64 right);
12201 extern UInt64
12202 U64Multiply(
12203   UInt64 left,
12204   UInt64 right);
12205 extern UInt64
12206 U64Mod(
12207   UInt64 dividend,
12208   UInt64 divisor);
12209 extern UInt64
12210 U64Divide(
12211   UInt64 dividend,
12212   UInt64 divisor,
12213   UInt64 * remainder);
12214 extern UInt64
12215 U64Div(
12216   UInt64 dividend,
12217   UInt64 divisor);
12218 extern UInt64
12219 U64Set(SInt32 value);
12220 extern UInt64
12221 U64SetU(UInt32 value);
12222 extern UInt32
12223 U32SetU(UInt64 value);
12224 extern Boolean
12225 U64And(
12226   UInt64 left,
12227   UInt64 right);
12228 extern Boolean
12229 U64Or(
12230   UInt64 left,
12231   UInt64 right);
12232 extern Boolean
12233 U64Eor(
12234   UInt64 left,
12235   UInt64 right);
12236 extern Boolean
12237 U64Not(UInt64 value);
12238 extern SInt32
12239 U64Compare(
12240   UInt64 left,
12241   UInt64 right) ;
12242 extern UInt64
12243 U64BitwiseAnd(
12244   UInt64 left,
12245   UInt64 right);
12246 extern UInt64
12247 U64BitwiseOr(
12248   UInt64 left,
12249   UInt64 right);
12250 extern UInt64
12251 U64BitwiseEor(
12252   UInt64 left,
12253   UInt64 right);
12254 extern UInt64
12255 U64BitwiseNot(UInt64 value);
12256 extern UInt64
12257 U64ShiftRight(
12258   UInt64 value,
12259   UInt32 shift);
12260 extern UInt64
12261 U64ShiftLeft(
12262   UInt64 value,
12263   UInt32 shift);
12264 extern SInt64
12265 UInt64ToSInt64(UInt64 value);
12266 extern UInt64
12267 SInt64ToUInt64(SInt64 value);
12268 }
12269 extern "C" {
12270
12271
12272 typedef SInt16 ToggleResults;
12273 enum {
12274
12275   toggleUndefined = 0,
12276   toggleOK = 1,
12277   toggleBadField = 2,
12278   toggleBadDelta = 3,
12279   toggleBadChar = 4,
12280   toggleUnknown = 5,
12281   toggleBadNum = 6,
12282   toggleOutOfRange = 7,
12283   toggleErr3 = 7,
12284   toggleErr4 = 8,
12285   toggleErr5 = 9
12286 };
12287
12288 enum {
12289
12290   smallDateBit = 31,
12291   togChar12HourBit = 30,
12292   togCharZCycleBit = 29,
12293   togDelta12HourBit = 28,
12294   genCdevRangeBit = 27,
12295   validDateFields = -1,
12296   maxDateField = 10
12297 };
12298
12299 enum {
12300   eraMask = 0x0001,
12301   yearMask = 0x0002,
12302   monthMask = 0x0004,
12303   dayMask = 0x0008,
12304   hourMask = 0x0010,
12305   minuteMask = 0x0020,
12306   secondMask = 0x0040,
12307   dayOfWeekMask = 0x0080,
12308   dayOfYearMask = 0x0100,
12309   weekOfYearMask = 0x0200,
12310   pmMask = 0x0400,
12311   dateStdMask = 0x007F
12312 };
12313
12314 typedef SInt8 LongDateField;
12315 enum {
12316   eraField = 0,
12317   yearField = 1,
12318   monthField = 2,
12319   dayField = 3,
12320   hourField = 4,
12321   minuteField = 5,
12322   secondField = 6,
12323   dayOfWeekField = 7,
12324   dayOfYearField = 8,
12325   weekOfYearField = 9,
12326   pmField = 10,
12327   res1Field = 11,
12328   res2Field = 12,
12329   res3Field = 13
12330 };
12331
12332 typedef SInt8 DateForm;
12333 enum {
12334   shortDate = 0,
12335   longDate = 1,
12336   abbrevDate = 2
12337 };
12338
12339 enum {
12340
12341   fatalDateTime = 0x8000,
12342   longDateFound = 1,
12343   leftOverChars = 2,
12344   sepNotIntlSep = 4,
12345   fieldOrderNotIntl = 8,
12346   extraneousStrings = 16,
12347   tooManySeps = 32,
12348   sepNotConsistent = 64,
12349   tokenErr = 0x8100,
12350   cantReadUtilities = 0x8200,
12351   dateTimeNotFound = 0x8400,
12352   dateTimeInvalid = 0x8800
12353 };
12354
12355 typedef short StringToDateStatus;
12356 typedef StringToDateStatus String2DateStatus;
12357 struct DateCacheRecord {
12358   short hidden[256];
12359 };
12360 typedef struct DateCacheRecord DateCacheRecord;
12361 typedef DateCacheRecord * DateCachePtr;
12362 struct DateTimeRec {
12363   short year;
12364   short month;
12365   short day;
12366   short hour;
12367   short minute;
12368   short second;
12369   short dayOfWeek;
12370 };
12371 typedef struct DateTimeRec DateTimeRec;
12372
12373 typedef SInt64 LongDateTime;
12374
12375 union LongDateCvt {
12376   SInt64 c;
12377   struct {
12378     UInt32 lHigh;
12379     UInt32 lLow;
12380   } hl;
12381 };
12382 typedef union LongDateCvt LongDateCvt;
12383 union LongDateRec {
12384   struct {
12385     short era;
12386     short year;
12387     short month;
12388     short day;
12389     short hour;
12390     short minute;
12391     short second;
12392     short dayOfWeek;
12393     short dayOfYear;
12394     short weekOfYear;
12395     short pm;
12396     short res1;
12397     short res2;
12398     short res3;
12399   } ld;
12400   short list[14];
12401   struct {
12402     short eraAlt;
12403     DateTimeRec oldDate;
12404   } od;
12405 };
12406 typedef union LongDateRec LongDateRec;
12407
12408 typedef SInt8 DateDelta;
12409 struct TogglePB {
12410   long togFlags;
12411   ResType amChars;
12412   ResType pmChars;
12413   long reserved[4];
12414 };
12415 typedef struct TogglePB TogglePB;
12416 extern OSStatus
12417 UCConvertUTCDateTimeToCFAbsoluteTime(
12418   const UTCDateTime * iUTCDate,
12419   CFAbsoluteTime * oCFTime) ;
12420 extern OSStatus
12421 UCConvertSecondsToCFAbsoluteTime(
12422   UInt32 iSeconds,
12423   CFAbsoluteTime * oCFTime) ;
12424 extern OSStatus
12425 UCConvertLongDateTimeToCFAbsoluteTime(
12426   LongDateTime iLongTime,
12427   CFAbsoluteTime * oCFTime) ;
12428 extern OSStatus
12429 UCConvertCFAbsoluteTimeToUTCDateTime(
12430   CFAbsoluteTime iCFTime,
12431   UTCDateTime * oUTCDate) ;
12432 extern OSStatus
12433 UCConvertCFAbsoluteTimeToSeconds(
12434   CFAbsoluteTime iCFTime,
12435   UInt32 * oSeconds) ;
12436 extern OSStatus
12437 UCConvertCFAbsoluteTimeToLongDateTime(
12438   CFAbsoluteTime iCFTime,
12439   LongDateTime * oLongDate) ;
12440 extern void
12441 DateString(
12442   long dateTime,
12443   DateForm longFlag,
12444   Str255 result,
12445   Handle intlHandle) ;
12446 extern void
12447 TimeString(
12448   long dateTime,
12449   Boolean wantSeconds,
12450   Str255 result,
12451   Handle intlHandle) ;
12452 extern void
12453 LongDateString(
12454   const LongDateTime * dateTime,
12455   DateForm longFlag,
12456   Str255 result,
12457   Handle intlHandle) ;
12458 extern void
12459 LongTimeString(
12460   const LongDateTime * dateTime,
12461   Boolean wantSeconds,
12462   Str255 result,
12463   Handle intlHandle) ;
12464 extern OSErr
12465 InitDateCache(DateCachePtr theCache) ;
12466 extern StringToDateStatus
12467 StringToDate(
12468   Ptr textPtr,
12469   long textLen,
12470   DateCachePtr theCache,
12471   long * lengthUsed,
12472   LongDateRec * dateTime) ;
12473 extern StringToDateStatus
12474 StringToTime(
12475   Ptr textPtr,
12476   long textLen,
12477   DateCachePtr theCache,
12478   long * lengthUsed,
12479   LongDateRec * dateTime) ;
12480 extern void
12481 LongDateToSeconds(
12482   const LongDateRec * lDate,
12483   LongDateTime * lSecs) ;
12484 extern void
12485 LongSecondsToDate(
12486   const LongDateTime * lSecs,
12487   LongDateRec * lDate) ;
12488 extern ToggleResults
12489 ToggleDate(
12490   LongDateTime * lSecs,
12491   LongDateField field,
12492   DateDelta delta,
12493   short ch,
12494   const TogglePB * params) ;
12495 extern short
12496 ValidDate(
12497   const LongDateRec * vDate,
12498   long flags,
12499   LongDateTime * newSecs) ;
12500 extern OSErr
12501 ReadDateTime(unsigned long * time) ;
12502 extern void
12503 GetDateTime(unsigned long * secs) ;
12504 extern OSErr
12505 SetDateTime(unsigned long time) ;
12506 extern void
12507 SetTime(const DateTimeRec * d) ;
12508 extern void
12509 GetTime(DateTimeRec * d) ;
12510 extern void
12511 DateToSeconds(
12512   const DateTimeRec * d,
12513   unsigned long * secs) ;
12514 extern void
12515 SecondsToDate(
12516   unsigned long secs,
12517   DateTimeRec * d) ;
12518
12519
12520 }
12521 extern "C" {
12522
12523
12524
12525 enum {
12526   useFree = 0,
12527   useATalk = 1,
12528   useAsync = 2,
12529   useExtClk = 3,
12530   useMIDI = 4
12531 };
12532
12533 enum {
12534   false32b = 0,
12535   true32b = 1
12536 };
12537
12538 enum {
12539
12540   sortsBefore = -1,
12541   sortsEqual = 0,
12542   sortsAfter = 1
12543 };
12544
12545 enum {
12546   dummyType = 0,
12547   vType = 1,
12548   ioQType = 2,
12549   drvQType = 3,
12550   evType = 4,
12551   fsQType = 5,
12552   sIQType = 6,
12553   dtQType = 7,
12554   nmType = 8
12555 };
12556
12557 typedef SignedByte QTypes;
12558 struct SysParmType {
12559   UInt8 valid;
12560   UInt8 aTalkA;
12561   UInt8 aTalkB;
12562   UInt8 config;
12563   short portA;
12564   short portB;
12565   long alarm;
12566   short font;
12567   short kbdPrint;
12568   short volClik;
12569   short misc;
12570 };
12571 typedef struct SysParmType SysParmType;
12572 typedef SysParmType * SysPPtr;
12573 struct QElem {
12574   struct QElem * qLink;
12575   short qType;
12576   short qData[1];
12577 };
12578 typedef struct QElem QElem;
12579 typedef QElem * QElemPtr;
12580 struct QHdr {
12581   volatile short qFlags;
12582   volatile QElemPtr qHead;
12583   volatile QElemPtr qTail;
12584 };
12585 typedef struct QHdr QHdr;
12586 typedef QHdr * QHdrPtr;
12587 typedef void ( * DeferredTaskProcPtr)(long dtParam);
12588 typedef DeferredTaskProcPtr DeferredTaskUPP;
12589 extern DeferredTaskUPP
12590 NewDeferredTaskUPP(DeferredTaskProcPtr userRoutine) ;
12591 extern void
12592 DisposeDeferredTaskUPP(DeferredTaskUPP userUPP) ;
12593 extern void
12594 InvokeDeferredTaskUPP(
12595   long dtParam,
12596   DeferredTaskUPP userUPP) ;
12597
12598 struct DeferredTask {
12599   volatile QElemPtr qLink;
12600   short qType;
12601   volatile short dtFlags;
12602   DeferredTaskUPP dtAddr;
12603   long dtParam;
12604   long dtReserved;
12605 };
12606 typedef struct DeferredTask DeferredTask;
12607 typedef DeferredTask * DeferredTaskPtr;
12608 struct MachineLocation {
12609     Fract latitude;
12610     Fract longitude;
12611     union {
12612
12613         SInt8 dlsDelta;
12614
12615         long gmtDelta;
12616         struct {
12617
12618
12619
12620             SInt8 Delta;
12621         } dls;
12622     } u;
12623 };
12624 typedef struct MachineLocation MachineLocation;
12625 extern Boolean
12626 IsMetric(void) ;
12627 extern SysPPtr
12628 GetSysPPtr(void) ;
12629 extern OSErr
12630 DTInstall(DeferredTaskPtr dtTaskPtr) ;
12631 extern void
12632 Delay(
12633   unsigned long numTicks,
12634   unsigned long * finalTicks) ;
12635 extern OSErr
12636 WriteParam(void) ;
12637 extern void
12638 Enqueue(
12639   QElemPtr qElement,
12640   QHdrPtr qHeader) ;
12641 extern OSErr
12642 Dequeue(
12643   QElemPtr qElement,
12644   QHdrPtr qHeader) ;
12645 extern long
12646 SetCurrentA5(void) ;
12647 extern long
12648 SetA5(long newA5) ;
12649 extern OSErr
12650 InitUtil(void) ;
12651 extern void
12652 MakeDataExecutable(
12653   void * baseAddress,
12654   unsigned long length) ;
12655 extern void
12656 ReadLocation(MachineLocation * loc) ;
12657 extern void
12658 WriteLocation(const MachineLocation * loc) ;
12659 extern UInt32
12660 TickCount(void) ;
12661 extern CFStringRef
12662 CSCopyUserName(Boolean useShortName) ;
12663 extern CFStringRef
12664 CSCopyMachineName(void) ;
12665 enum {
12666   curSysEnvVers = 2
12667 };
12668
12669 struct SysEnvRec {
12670   short environsVersion;
12671   short machineType;
12672   short systemVersion;
12673   short processor;
12674   Boolean hasFPU;
12675   Boolean hasColorQD;
12676   short keyBoardType;
12677   short atDrvrVersNum;
12678   short sysVRefNum;
12679 };
12680 typedef struct SysEnvRec SysEnvRec;
12681 enum {
12682
12683   envMac = -1,
12684   envXL = -2,
12685   envMachUnknown = 0,
12686   env512KE = 1,
12687   envMacPlus = 2,
12688   envSE = 3,
12689   envMacII = 4,
12690   envMacIIx = 5,
12691   envMacIIcx = 6,
12692   envSE30 = 7,
12693   envPortable = 8,
12694   envMacIIci = 9,
12695   envMacIIfx = 11
12696 };
12697
12698 enum {
12699
12700   envCPUUnknown = 0,
12701   env68000 = 1,
12702   env68010 = 2,
12703   env68020 = 3,
12704   env68030 = 4,
12705   env68040 = 5
12706 };
12707
12708 enum {
12709
12710   envUnknownKbd = 0,
12711   envMacKbd = 1,
12712   envMacAndPad = 2,
12713   envMacPlusKbd = 3,
12714   envAExtendKbd = 4,
12715   envStandADBKbd = 5,
12716   envPrtblADBKbd = 6,
12717   envPrtblISOKbd = 7,
12718   envStdISOADBKbd = 8,
12719   envExtISOADBKbd = 9
12720 };
12721
12722
12723 }
12724 extern "C" {
12725
12726
12727
12728
12729
12730 struct HFSUniStr255 {
12731   UInt16 length;
12732   UniChar unicode[255];
12733 };
12734 typedef struct HFSUniStr255 HFSUniStr255;
12735 typedef const HFSUniStr255 * ConstHFSUniStr255Param;
12736 enum {
12737   fsCurPerm = 0x00,
12738   fsRdPerm = 0x01,
12739   fsWrPerm = 0x02,
12740   fsRdWrPerm = 0x03,
12741   fsRdWrShPerm = 0x04,
12742   fsRdDenyPerm = 0x10,
12743   fsWrDenyPerm = 0x20
12744 };
12745
12746 enum {
12747   fsRtParID = 1,
12748   fsRtDirID = 2
12749 };
12750
12751 enum {
12752   fsAtMark = 0,
12753   fsFromStart = 1,
12754   fsFromLEOF = 2,
12755   fsFromMark = 3
12756 };
12757
12758 enum {
12759
12760   pleaseCacheBit = 4,
12761   pleaseCacheMask = 0x0010,
12762   noCacheBit = 5,
12763   noCacheMask = 0x0020,
12764   rdVerifyBit = 6,
12765   rdVerifyMask = 0x0040,
12766   rdVerify = 64,
12767   forceReadBit = 6,
12768   forceReadMask = 0x0040,
12769   newLineBit = 7,
12770   newLineMask = 0x0080,
12771   newLineCharMask = 0xFF00
12772 };
12773
12774
12775 enum {
12776
12777   fsSBPartialName = 1,
12778   fsSBFullName = 2,
12779   fsSBFlAttrib = 4,
12780   fsSBFlFndrInfo = 8,
12781   fsSBFlLgLen = 32,
12782   fsSBFlPyLen = 64,
12783   fsSBFlRLgLen = 128,
12784   fsSBFlRPyLen = 256,
12785   fsSBFlCrDat = 512,
12786   fsSBFlMdDat = 1024,
12787   fsSBFlBkDat = 2048,
12788   fsSBFlXFndrInfo = 4096,
12789   fsSBFlParID = 8192,
12790   fsSBNegate = 16384,
12791   fsSBDrUsrWds = 8,
12792   fsSBDrNmFls = 16,
12793   fsSBDrCrDat = 512,
12794   fsSBDrMdDat = 1024,
12795   fsSBDrBkDat = 2048,
12796   fsSBDrFndrInfo = 4096,
12797   fsSBDrParID = 8192
12798 };
12799
12800 enum {
12801
12802   fsSBPartialNameBit = 0,
12803   fsSBFullNameBit = 1,
12804   fsSBFlAttribBit = 2,
12805   fsSBFlFndrInfoBit = 3,
12806   fsSBFlLgLenBit = 5,
12807   fsSBFlPyLenBit = 6,
12808   fsSBFlRLgLenBit = 7,
12809   fsSBFlRPyLenBit = 8,
12810   fsSBFlCrDatBit = 9,
12811   fsSBFlMdDatBit = 10,
12812   fsSBFlBkDatBit = 11,
12813   fsSBFlXFndrInfoBit = 12,
12814   fsSBFlParIDBit = 13,
12815   fsSBNegateBit = 14,
12816   fsSBDrUsrWdsBit = 3,
12817   fsSBDrNmFlsBit = 4,
12818   fsSBDrCrDatBit = 9,
12819   fsSBDrMdDatBit = 10,
12820   fsSBDrBkDatBit = 11,
12821   fsSBDrFndrInfoBit = 12,
12822   fsSBDrParIDBit = 13
12823 };
12824
12825 enum {
12826
12827   bLimitFCBs = 31,
12828   bLocalWList = 30,
12829   bNoMiniFndr = 29,
12830   bNoVNEdit = 28,
12831   bNoLclSync = 27,
12832   bTrshOffLine = 26,
12833   bNoSwitchTo = 25,
12834   bNoDeskItems = 20,
12835   bNoBootBlks = 19,
12836   bAccessCntl = 18,
12837   bNoSysDir = 17,
12838   bHasExtFSVol = 16,
12839   bHasOpenDeny = 15,
12840   bHasCopyFile = 14,
12841   bHasMoveRename = 13,
12842   bHasDesktopMgr = 12,
12843   bHasShortName = 11,
12844   bHasFolderLock = 10,
12845   bHasPersonalAccessPrivileges = 9,
12846   bHasUserGroupList = 8,
12847   bHasCatSearch = 7,
12848   bHasFileIDs = 6,
12849   bHasBTreeMgr = 5,
12850   bHasBlankAccessPrivileges = 4,
12851   bSupportsAsyncRequests = 3,
12852   bSupportsTrashVolumeCache = 2
12853 };
12854
12855 enum {
12856
12857   bHasDirectIO = 1
12858 };
12859
12860 enum {
12861
12862   bIsEjectable = 0,
12863   bSupportsHFSPlusAPIs = 1,
12864   bSupportsFSCatalogSearch = 2,
12865   bSupportsFSExchangeObjects = 3,
12866   bSupports2TBFiles = 4,
12867   bSupportsLongNames = 5,
12868   bSupportsMultiScriptNames = 6,
12869   bSupportsNamedForks = 7,
12870   bSupportsSubtreeIterators = 8,
12871   bL2PCanMapFileBlocks = 9
12872 };
12873
12874 enum {
12875
12876   bParentModDateChanges = 10,
12877   bAncestorModDateChanges = 11
12878 };
12879
12880 enum {
12881
12882   bSupportsSymbolicLinks = 13,
12883   bIsAutoMounted = 14,
12884   bAllowCDiDataHandler = 17,
12885   bSupportsExclusiveLocks = 18
12886 };
12887
12888 enum {
12889
12890   kLargeIcon = 1,
12891   kLarge4BitIcon = 2,
12892   kLarge8BitIcon = 3,
12893   kSmallIcon = 4,
12894   kSmall4BitIcon = 5,
12895   kSmall8BitIcon = 6,
12896   kicnsIconFamily = 239
12897 };
12898
12899 enum {
12900   kLargeIconSize = 256,
12901   kLarge4BitIconSize = 512,
12902   kLarge8BitIconSize = 1024,
12903   kSmallIconSize = 64,
12904   kSmall4BitIconSize = 128,
12905   kSmall8BitIconSize = 256
12906 };
12907
12908 enum {
12909
12910   kWidePosOffsetBit = 8,
12911   kUseWidePositioning = (1 << kWidePosOffsetBit),
12912   kMaximumBlocksIn4GB = 0x007FFFFF
12913 };
12914
12915 enum {
12916
12917   fsUnixPriv = 1
12918 };
12919
12920 enum {
12921
12922   kNoUserAuthentication = 1,
12923   kPassword = 2,
12924   kEncryptPassword = 3,
12925   kTwoWayEncryptPassword = 6
12926 };
12927
12928
12929
12930 enum {
12931   kOwnerID2Name = 1,
12932   kGroupID2Name = 2,
12933   kOwnerName2ID = 3,
12934   kGroupName2ID = 4,
12935   kReturnNextUser = 1,
12936   kReturnNextGroup = 2,
12937   kReturnNextUG = 3
12938 };
12939
12940
12941 enum {
12942   kVCBFlagsIdleFlushBit = 3,
12943   kVCBFlagsIdleFlushMask = 0x0008,
12944   kVCBFlagsHFSPlusAPIsBit = 4,
12945   kVCBFlagsHFSPlusAPIsMask = 0x0010,
12946   kVCBFlagsHardwareGoneBit = 5,
12947   kVCBFlagsHardwareGoneMask = 0x0020,
12948   kVCBFlagsVolumeDirtyBit = 15,
12949   kVCBFlagsVolumeDirtyMask = 0x8000
12950 };
12951
12952
12953 enum {
12954   kioVAtrbDefaultVolumeBit = 5,
12955   kioVAtrbDefaultVolumeMask = 0x0020,
12956   kioVAtrbFilesOpenBit = 6,
12957   kioVAtrbFilesOpenMask = 0x0040,
12958   kioVAtrbHardwareLockedBit = 7,
12959   kioVAtrbHardwareLockedMask = 0x0080,
12960   kioVAtrbSoftwareLockedBit = 15,
12961   kioVAtrbSoftwareLockedMask = 0x8000
12962 };
12963
12964
12965 enum {
12966
12967   kioFlAttribLockedBit = 0,
12968   kioFlAttribLockedMask = 0x01,
12969   kioFlAttribResOpenBit = 2,
12970   kioFlAttribResOpenMask = 0x04,
12971   kioFlAttribDataOpenBit = 3,
12972   kioFlAttribDataOpenMask = 0x08,
12973   kioFlAttribDirBit = 4,
12974   kioFlAttribDirMask = 0x10,
12975   ioDirFlg = 4,
12976   ioDirMask = 0x10,
12977   kioFlAttribCopyProtBit = 6,
12978   kioFlAttribCopyProtMask = 0x40,
12979   kioFlAttribFileOpenBit = 7,
12980   kioFlAttribFileOpenMask = 0x80,
12981   kioFlAttribInSharedBit = 2,
12982   kioFlAttribInSharedMask = 0x04,
12983   kioFlAttribMountedBit = 3,
12984   kioFlAttribMountedMask = 0x08,
12985   kioFlAttribSharePointBit = 5,
12986   kioFlAttribSharePointMask = 0x20
12987 };
12988
12989
12990 enum {
12991   kioFCBWriteBit = 8,
12992   kioFCBWriteMask = 0x0100,
12993   kioFCBResourceBit = 9,
12994   kioFCBResourceMask = 0x0200,
12995   kioFCBWriteLockedBit = 10,
12996   kioFCBWriteLockedMask = 0x0400,
12997   kioFCBLargeFileBit = 11,
12998   kioFCBLargeFileMask = 0x0800,
12999   kioFCBSharedWriteBit = 12,
13000   kioFCBSharedWriteMask = 0x1000,
13001   kioFCBFileLockedBit = 13,
13002   kioFCBFileLockedMask = 0x2000,
13003   kioFCBOwnClumpBit = 14,
13004   kioFCBOwnClumpMask = 0x4000,
13005   kioFCBModifiedBit = 15,
13006   kioFCBModifiedMask = 0x8000
13007 };
13008
13009
13010
13011 enum {
13012   kioACUserNoSeeFolderBit = 0,
13013   kioACUserNoSeeFolderMask = 0x01,
13014   kioACUserNoSeeFilesBit = 1,
13015   kioACUserNoSeeFilesMask = 0x02,
13016   kioACUserNoMakeChangesBit = 2,
13017   kioACUserNoMakeChangesMask = 0x04,
13018   kioACUserNotOwnerBit = 7,
13019   kioACUserNotOwnerMask = 0x80
13020 };
13021
13022
13023 enum {
13024   kioACAccessOwnerBit = 31,
13025   kioACAccessOwnerMask = (long)0x80000000,
13026   kioACAccessBlankAccessBit = 28,
13027   kioACAccessBlankAccessMask = 0x10000000,
13028   kioACAccessUserWriteBit = 26,
13029   kioACAccessUserWriteMask = 0x04000000,
13030   kioACAccessUserReadBit = 25,
13031   kioACAccessUserReadMask = 0x02000000,
13032   kioACAccessUserSearchBit = 24,
13033   kioACAccessUserSearchMask = 0x01000000,
13034   kioACAccessEveryoneWriteBit = 18,
13035   kioACAccessEveryoneWriteMask = 0x00040000,
13036   kioACAccessEveryoneReadBit = 17,
13037   kioACAccessEveryoneReadMask = 0x00020000,
13038   kioACAccessEveryoneSearchBit = 16,
13039   kioACAccessEveryoneSearchMask = 0x00010000,
13040   kioACAccessGroupWriteBit = 10,
13041   kioACAccessGroupWriteMask = 0x00000400,
13042   kioACAccessGroupReadBit = 9,
13043   kioACAccessGroupReadMask = 0x00000200,
13044   kioACAccessGroupSearchBit = 8,
13045   kioACAccessGroupSearchMask = 0x00000100,
13046   kioACAccessOwnerWriteBit = 2,
13047   kioACAccessOwnerWriteMask = 0x00000004,
13048   kioACAccessOwnerReadBit = 1,
13049   kioACAccessOwnerReadMask = 0x00000002,
13050   kioACAccessOwnerSearchBit = 0,
13051   kioACAccessOwnerSearchMask = 0x00000001,
13052   kfullPrivileges = 0x00070007,
13053   kownerPrivileges = 0x00000007
13054 };
13055
13056
13057 enum {
13058   knoUser = 0,
13059   kadministratorUser = 1
13060 };
13061
13062 enum {
13063   knoGroup = 0
13064 };
13065
13066
13067 struct GetVolParmsInfoBuffer {
13068   short vMVersion;
13069   long vMAttrib;
13070   Handle vMLocalHand;
13071   long vMServerAdr;
13072
13073   long vMVolumeGrade;
13074   short vMForeignPrivID;
13075
13076   long vMExtendedAttributes;
13077
13078   void * vMDeviceID;
13079
13080   UniCharCount vMMaxNameLength;
13081
13082 };
13083 typedef struct GetVolParmsInfoBuffer GetVolParmsInfoBuffer;
13084 typedef union ParamBlockRec ParamBlockRec;
13085
13086 typedef ParamBlockRec * ParmBlkPtr;
13087 typedef void ( * IOCompletionProcPtr)(ParmBlkPtr paramBlock);
13088 typedef IOCompletionProcPtr IOCompletionUPP;
13089 struct IOParam {
13090   QElemPtr qLink;
13091   short qType;
13092   short ioTrap;
13093   Ptr ioCmdAddr;
13094   IOCompletionUPP ioCompletion;
13095   volatile OSErr ioResult;
13096   StringPtr ioNamePtr;
13097   short ioVRefNum;
13098   short ioRefNum;
13099   SInt8 ioVersNum;
13100   SInt8 ioPermssn;
13101   Ptr ioMisc;
13102   Ptr ioBuffer;
13103   long ioReqCount;
13104   long ioActCount;
13105   short ioPosMode;
13106   long ioPosOffset;
13107 };
13108 typedef struct IOParam IOParam;
13109 typedef IOParam * IOParamPtr;
13110 struct FileParam {
13111   QElemPtr qLink;
13112   short qType;
13113   short ioTrap;
13114   Ptr ioCmdAddr;
13115   IOCompletionUPP ioCompletion;
13116   volatile OSErr ioResult;
13117   StringPtr ioNamePtr;
13118   short ioVRefNum;
13119   short ioFRefNum;
13120   SInt8 ioFVersNum;
13121   SInt8 filler1;
13122   short ioFDirIndex;
13123   SInt8 ioFlAttrib;
13124   SInt8 ioFlVersNum;
13125   FInfo ioFlFndrInfo;
13126   unsigned long ioFlNum;
13127   unsigned short ioFlStBlk;
13128   long ioFlLgLen;
13129   long ioFlPyLen;
13130   unsigned short ioFlRStBlk;
13131   long ioFlRLgLen;
13132   long ioFlRPyLen;
13133   unsigned long ioFlCrDat;
13134   unsigned long ioFlMdDat;
13135 };
13136 typedef struct FileParam FileParam;
13137 typedef FileParam * FileParamPtr;
13138 struct VolumeParam {
13139   QElemPtr qLink;
13140   short qType;
13141   short ioTrap;
13142   Ptr ioCmdAddr;
13143   IOCompletionUPP ioCompletion;
13144   volatile OSErr ioResult;
13145   StringPtr ioNamePtr;
13146   short ioVRefNum;
13147   long filler2;
13148   short ioVolIndex;
13149   unsigned long ioVCrDate;
13150   unsigned long ioVLsBkUp;
13151   unsigned short ioVAtrb;
13152   unsigned short ioVNmFls;
13153   unsigned short ioVDirSt;
13154   short ioVBlLn;
13155   unsigned short ioVNmAlBlks;
13156   unsigned long ioVAlBlkSiz;
13157   unsigned long ioVClpSiz;
13158   unsigned short ioAlBlSt;
13159   unsigned long ioVNxtFNum;
13160   unsigned short ioVFrBlk;
13161 };
13162 typedef struct VolumeParam VolumeParam;
13163 typedef VolumeParam * VolumeParamPtr;
13164 struct CntrlParam {
13165   QElemPtr qLink;
13166   short qType;
13167   short ioTrap;
13168   Ptr ioCmdAddr;
13169   IOCompletionUPP ioCompletion;
13170   volatile OSErr ioResult;
13171   StringPtr ioNamePtr;
13172   short ioVRefNum;
13173   short ioCRefNum;
13174   short csCode;
13175   short csParam[11];
13176 };
13177 typedef struct CntrlParam CntrlParam;
13178 typedef CntrlParam * CntrlParamPtr;
13179 struct SlotDevParam {
13180   QElemPtr qLink;
13181   short qType;
13182   short ioTrap;
13183   Ptr ioCmdAddr;
13184   IOCompletionUPP ioCompletion;
13185   volatile OSErr ioResult;
13186   StringPtr ioNamePtr;
13187   short ioVRefNum;
13188   short ioSRefNum;
13189   SInt8 ioSVersNum;
13190   SInt8 ioSPermssn;
13191   Ptr ioSMix;
13192   short ioSFlags;
13193   SInt8 ioSlot;
13194   SInt8 ioID;
13195 };
13196 typedef struct SlotDevParam SlotDevParam;
13197 typedef SlotDevParam * SlotDevParamPtr;
13198 struct MultiDevParam {
13199   QElemPtr qLink;
13200   short qType;
13201   short ioTrap;
13202   Ptr ioCmdAddr;
13203   IOCompletionUPP ioCompletion;
13204   volatile OSErr ioResult;
13205   StringPtr ioNamePtr;
13206   short ioVRefNum;
13207   short ioMRefNum;
13208   SInt8 ioMVersNum;
13209   SInt8 ioMPermssn;
13210   Ptr ioMMix;
13211   short ioMFlags;
13212   Ptr ioSEBlkPtr;
13213 };
13214 typedef struct MultiDevParam MultiDevParam;
13215 typedef MultiDevParam * MultiDevParamPtr;
13216 union ParamBlockRec {
13217   IOParam ioParam;
13218   FileParam fileParam;
13219   VolumeParam volumeParam;
13220   CntrlParam cntrlParam;
13221   SlotDevParam slotDevParam;
13222   MultiDevParam multiDevParam;
13223 };
13224
13225 struct HFileInfo {
13226   QElemPtr qLink;
13227   short qType;
13228   short ioTrap;
13229   Ptr ioCmdAddr;
13230   IOCompletionUPP ioCompletion;
13231   volatile OSErr ioResult;
13232   StringPtr ioNamePtr;
13233   short ioVRefNum;
13234   short ioFRefNum;
13235   SInt8 ioFVersNum;
13236   SInt8 filler1;
13237   short ioFDirIndex;
13238   SInt8 ioFlAttrib;
13239   SInt8 ioACUser;
13240   FInfo ioFlFndrInfo;
13241   long ioDirID;
13242   unsigned short ioFlStBlk;
13243   long ioFlLgLen;
13244   long ioFlPyLen;
13245   unsigned short ioFlRStBlk;
13246   long ioFlRLgLen;
13247   long ioFlRPyLen;
13248   unsigned long ioFlCrDat;
13249   unsigned long ioFlMdDat;
13250   unsigned long ioFlBkDat;
13251   FXInfo ioFlXFndrInfo;
13252   long ioFlParID;
13253   long ioFlClpSiz;
13254 };
13255 typedef struct HFileInfo HFileInfo;
13256 struct DirInfo {
13257   QElemPtr qLink;
13258   short qType;
13259   short ioTrap;
13260   Ptr ioCmdAddr;
13261   IOCompletionUPP ioCompletion;
13262   volatile OSErr ioResult;
13263   StringPtr ioNamePtr;
13264   short ioVRefNum;
13265   short ioFRefNum;
13266   SInt8 ioFVersNum;
13267   SInt8 filler1;
13268   short ioFDirIndex;
13269   SInt8 ioFlAttrib;
13270   SInt8 ioACUser;
13271   DInfo ioDrUsrWds;
13272   long ioDrDirID;
13273   unsigned short ioDrNmFls;
13274   short filler3[9];
13275   unsigned long ioDrCrDat;
13276   unsigned long ioDrMdDat;
13277   unsigned long ioDrBkDat;
13278   DXInfo ioDrFndrInfo;
13279   long ioDrParID;
13280 };
13281 typedef struct DirInfo DirInfo;
13282 union CInfoPBRec {
13283   HFileInfo hFileInfo;
13284   DirInfo dirInfo;
13285 };
13286 typedef union CInfoPBRec CInfoPBRec;
13287 typedef CInfoPBRec * CInfoPBPtr;
13288 struct XCInfoPBRec {
13289   QElemPtr qLink;
13290   short qType;
13291   short ioTrap;
13292   Ptr ioCmdAddr;
13293   ProcPtr ioCompletion;
13294   volatile OSErr ioResult;
13295   StringPtr ioNamePtr;
13296   short ioVRefNum;
13297   long filler1;
13298   StringPtr ioShortNamePtr;
13299   short filler2;
13300   short ioPDType;
13301   long ioPDAuxType;
13302   long filler3[2];
13303   long ioDirID;
13304 };
13305 typedef struct XCInfoPBRec XCInfoPBRec;
13306 typedef XCInfoPBRec * XCInfoPBPtr;
13307
13308 struct CatPositionRec {
13309   long initialize;
13310   short priv[6];
13311 };
13312 typedef struct CatPositionRec CatPositionRec;
13313 struct FSSpec {
13314   short vRefNum;
13315   long parID;
13316   StrFileName name;
13317 };
13318 typedef struct FSSpec FSSpec;
13319 typedef FSSpec * FSSpecPtr;
13320 typedef FSSpecPtr * FSSpecHandle;
13321
13322 typedef FSSpecPtr FSSpecArrayPtr;
13323
13324
13325
13326
13327 typedef const FSSpec * ConstFSSpecPtr;
13328
13329
13330
13331
13332
13333 typedef OSType VolumeType;
13334 enum {
13335
13336   AppleShareMediaType = 'afpm'
13337 };
13338
13339
13340
13341
13342 struct VolMountInfoHeader {
13343   short length;
13344   VolumeType media;
13345 };
13346 typedef struct VolMountInfoHeader VolMountInfoHeader;
13347 typedef VolMountInfoHeader * VolMountInfoPtr;
13348
13349
13350
13351
13352 struct VolumeMountInfoHeader {
13353   short length;
13354   VolumeType media;
13355   short flags;
13356 };
13357 typedef struct VolumeMountInfoHeader VolumeMountInfoHeader;
13358 typedef VolumeMountInfoHeader * VolumeMountInfoHeaderPtr;
13359
13360 enum {
13361   volMountNoLoginMsgFlagBit = 0,
13362   volMountNoLoginMsgFlagMask = 0x0001,
13363   volMountExtendedFlagsBit = 7,
13364   volMountExtendedFlagsMask = 0x0080,
13365   volMountInteractBit = 15,
13366   volMountInteractMask = 0x8000,
13367   volMountChangedBit = 14,
13368   volMountChangedMask = 0x4000,
13369   volMountFSReservedMask = 0x00FF,
13370   volMountSysReservedMask = 0xFF00
13371 };
13372
13373
13374
13375 struct AFPVolMountInfo {
13376   short length;
13377   VolumeType media;
13378   short flags;
13379   SInt8 nbpInterval;
13380   SInt8 nbpCount;
13381   short uamType;
13382   short zoneNameOffset;
13383   short serverNameOffset;
13384   short volNameOffset;
13385   short userNameOffset;
13386   short userPasswordOffset;
13387   short volPasswordOffset;
13388   char AFPData[144];
13389 };
13390 typedef struct AFPVolMountInfo AFPVolMountInfo;
13391 typedef AFPVolMountInfo * AFPVolMountInfoPtr;
13392
13393
13394
13395 struct AFPXVolMountInfo {
13396   short length;
13397   VolumeType media;
13398   short flags;
13399   SInt8 nbpInterval;
13400   SInt8 nbpCount;
13401   short uamType;
13402   short zoneNameOffset;
13403   short serverNameOffset;
13404   short volNameOffset;
13405   short userNameOffset;
13406   short userPasswordOffset;
13407   short volPasswordOffset;
13408   short extendedFlags;
13409   short uamNameOffset;
13410   short alternateAddressOffset;
13411   char AFPData[176];
13412 };
13413 typedef struct AFPXVolMountInfo AFPXVolMountInfo;
13414 typedef AFPXVolMountInfo * AFPXVolMountInfoPtr;
13415 enum {
13416   kAFPExtendedFlagsAlternateAddressMask = 1
13417 };
13418
13419
13420 enum {
13421
13422   kAFPTagTypeIP = 0x01,
13423   kAFPTagTypeIPPort = 0x02,
13424   kAFPTagTypeDDP = 0x03,
13425   kAFPTagTypeDNS = 0x04
13426 };
13427
13428
13429 enum {
13430
13431   kAFPTagLengthIP = 0x06,
13432   kAFPTagLengthIPPort = 0x08,
13433   kAFPTagLengthDDP = 0x06
13434 };
13435
13436 struct AFPTagData {
13437   UInt8 fLength;
13438   UInt8 fType;
13439   UInt8 fData[1];
13440 };
13441 typedef struct AFPTagData AFPTagData;
13442 struct AFPAlternateAddress {
13443
13444   UInt8 fVersion;
13445   UInt8 fAddressCount;
13446   UInt8 fAddressList[1];
13447 };
13448 typedef struct AFPAlternateAddress AFPAlternateAddress;
13449 struct DTPBRec {
13450   QElemPtr qLink;
13451   short qType;
13452   short ioTrap;
13453   Ptr ioCmdAddr;
13454   IOCompletionUPP ioCompletion;
13455   volatile OSErr ioResult;
13456   StringPtr ioNamePtr;
13457   short ioVRefNum;
13458   short ioDTRefNum;
13459   short ioIndex;
13460   long ioTagInfo;
13461   Ptr ioDTBuffer;
13462   long ioDTReqCount;
13463   long ioDTActCount;
13464   SInt8 ioFiller1;
13465   UInt8 ioIconType;
13466   short ioFiller2;
13467   long ioDirID;
13468   OSType ioFileCreator;
13469   OSType ioFileType;
13470   long ioFiller3;
13471   long ioDTLgLen;
13472   long ioDTPyLen;
13473   short ioFiller4[14];
13474   long ioAPPLParID;
13475 };
13476 typedef struct DTPBRec DTPBRec;
13477 typedef DTPBRec * DTPBPtr;
13478
13479 struct HIOParam {
13480   QElemPtr qLink;
13481   short qType;
13482   short ioTrap;
13483   Ptr ioCmdAddr;
13484   IOCompletionUPP ioCompletion;
13485   volatile OSErr ioResult;
13486   StringPtr ioNamePtr;
13487   short ioVRefNum;
13488   short ioRefNum;
13489   SInt8 ioVersNum;
13490   SInt8 ioPermssn;
13491   Ptr ioMisc;
13492   Ptr ioBuffer;
13493   long ioReqCount;
13494   long ioActCount;
13495   short ioPosMode;
13496   long ioPosOffset;
13497 };
13498 typedef struct HIOParam HIOParam;
13499 typedef HIOParam * HIOParamPtr;
13500 struct HFileParam {
13501   QElemPtr qLink;
13502   short qType;
13503   short ioTrap;
13504   Ptr ioCmdAddr;
13505   IOCompletionUPP ioCompletion;
13506   volatile OSErr ioResult;
13507   StringPtr ioNamePtr;
13508   short ioVRefNum;
13509   short ioFRefNum;
13510   SInt8 ioFVersNum;
13511   SInt8 filler1;
13512   short ioFDirIndex;
13513   SInt8 ioFlAttrib;
13514   SInt8 ioFlVersNum;
13515   FInfo ioFlFndrInfo;
13516   long ioDirID;
13517   unsigned short ioFlStBlk;
13518   long ioFlLgLen;
13519   long ioFlPyLen;
13520   unsigned short ioFlRStBlk;
13521   long ioFlRLgLen;
13522   long ioFlRPyLen;
13523   unsigned long ioFlCrDat;
13524   unsigned long ioFlMdDat;
13525 };
13526 typedef struct HFileParam HFileParam;
13527 typedef HFileParam * HFileParamPtr;
13528 struct HVolumeParam {
13529   QElemPtr qLink;
13530   short qType;
13531   short ioTrap;
13532   Ptr ioCmdAddr;
13533   IOCompletionUPP ioCompletion;
13534   volatile OSErr ioResult;
13535   StringPtr ioNamePtr;
13536   short ioVRefNum;
13537   long filler2;
13538   short ioVolIndex;
13539   unsigned long ioVCrDate;
13540   unsigned long ioVLsMod;
13541   short ioVAtrb;
13542   unsigned short ioVNmFls;
13543   unsigned short ioVBitMap;
13544   unsigned short ioAllocPtr;
13545   unsigned short ioVNmAlBlks;
13546   unsigned long ioVAlBlkSiz;
13547   unsigned long ioVClpSiz;
13548   unsigned short ioAlBlSt;
13549   unsigned long ioVNxtCNID;
13550   unsigned short ioVFrBlk;
13551   unsigned short ioVSigWord;
13552   short ioVDrvInfo;
13553   short ioVDRefNum;
13554   short ioVFSID;
13555   unsigned long ioVBkUp;
13556   short ioVSeqNum;
13557   unsigned long ioVWrCnt;
13558   unsigned long ioVFilCnt;
13559   unsigned long ioVDirCnt;
13560   long ioVFndrInfo[8];
13561 };
13562 typedef struct HVolumeParam HVolumeParam;
13563 typedef HVolumeParam * HVolumeParamPtr;
13564 struct XIOParam {
13565   QElemPtr qLink;
13566   short qType;
13567   short ioTrap;
13568   Ptr ioCmdAddr;
13569   IOCompletionUPP ioCompletion;
13570   volatile OSErr ioResult;
13571   StringPtr ioNamePtr;
13572   short ioVRefNum;
13573   short ioRefNum;
13574   SInt8 ioVersNum;
13575   SInt8 ioPermssn;
13576   Ptr ioMisc;
13577   Ptr ioBuffer;
13578   long ioReqCount;
13579   long ioActCount;
13580   short ioPosMode;
13581   wide ioWPosOffset;
13582 };
13583 typedef struct XIOParam XIOParam;
13584 typedef XIOParam * XIOParamPtr;
13585 struct XVolumeParam {
13586   QElemPtr qLink;
13587   short qType;
13588   short ioTrap;
13589   Ptr ioCmdAddr;
13590   IOCompletionUPP ioCompletion;
13591   volatile OSErr ioResult;
13592   StringPtr ioNamePtr;
13593   short ioVRefNum;
13594   unsigned long ioXVersion;
13595   short ioVolIndex;
13596   unsigned long ioVCrDate;
13597   unsigned long ioVLsMod;
13598   short ioVAtrb;
13599   unsigned short ioVNmFls;
13600   unsigned short ioVBitMap;
13601   unsigned short ioAllocPtr;
13602   unsigned short ioVNmAlBlks;
13603   unsigned long ioVAlBlkSiz;
13604   unsigned long ioVClpSiz;
13605   unsigned short ioAlBlSt;
13606   unsigned long ioVNxtCNID;
13607   unsigned short ioVFrBlk;
13608   unsigned short ioVSigWord;
13609   short ioVDrvInfo;
13610   short ioVDRefNum;
13611   short ioVFSID;
13612   unsigned long ioVBkUp;
13613   short ioVSeqNum;
13614   unsigned long ioVWrCnt;
13615   unsigned long ioVFilCnt;
13616   unsigned long ioVDirCnt;
13617   long ioVFndrInfo[8];
13618   UInt64 ioVTotalBytes;
13619   UInt64 ioVFreeBytes;
13620 };
13621 typedef struct XVolumeParam XVolumeParam;
13622 typedef XVolumeParam * XVolumeParamPtr;
13623 struct AccessParam {
13624   QElemPtr qLink;
13625   short qType;
13626   short ioTrap;
13627   Ptr ioCmdAddr;
13628   IOCompletionUPP ioCompletion;
13629   volatile OSErr ioResult;
13630   StringPtr ioNamePtr;
13631   short ioVRefNum;
13632   short filler3;
13633   short ioDenyModes;
13634   short filler4;
13635   SInt8 filler5;
13636   SInt8 ioACUser;
13637   long filler6;
13638   long ioACOwnerID;
13639   long ioACGroupID;
13640   long ioACAccess;
13641   long ioDirID;
13642 };
13643 typedef struct AccessParam AccessParam;
13644 typedef AccessParam * AccessParamPtr;
13645 struct ObjParam {
13646   QElemPtr qLink;
13647   short qType;
13648   short ioTrap;
13649   Ptr ioCmdAddr;
13650   IOCompletionUPP ioCompletion;
13651   volatile OSErr ioResult;
13652   StringPtr ioNamePtr;
13653   short ioVRefNum;
13654   short filler7;
13655   short ioObjType;
13656   StringPtr ioObjNamePtr;
13657   long ioObjID;
13658 };
13659 typedef struct ObjParam ObjParam;
13660 typedef ObjParam * ObjParamPtr;
13661 struct CopyParam {
13662   QElemPtr qLink;
13663   short qType;
13664   short ioTrap;
13665   Ptr ioCmdAddr;
13666   IOCompletionUPP ioCompletion;
13667   volatile OSErr ioResult;
13668   StringPtr ioNamePtr;
13669   short ioVRefNum;
13670   short ioDstVRefNum;
13671   short filler8;
13672   StringPtr ioNewName;
13673   StringPtr ioCopyName;
13674   long ioNewDirID;
13675   long filler14;
13676   long filler15;
13677   long ioDirID;
13678 };
13679 typedef struct CopyParam CopyParam;
13680 typedef CopyParam * CopyParamPtr;
13681 struct WDParam {
13682   QElemPtr qLink;
13683   short qType;
13684   short ioTrap;
13685   Ptr ioCmdAddr;
13686   IOCompletionUPP ioCompletion;
13687   volatile OSErr ioResult;
13688   StringPtr ioNamePtr;
13689   short ioVRefNum;
13690   short ioWDCreated;
13691   short ioWDIndex;
13692   long ioWDProcID;
13693   short ioWDVRefNum;
13694   short filler10;
13695   long filler11;
13696   long filler12;
13697   long filler13;
13698   long ioWDDirID;
13699 };
13700 typedef struct WDParam WDParam;
13701 typedef WDParam * WDParamPtr;
13702 struct FIDParam {
13703   QElemPtr qLink;
13704   short qType;
13705   short ioTrap;
13706   Ptr ioCmdAddr;
13707   IOCompletionUPP ioCompletion;
13708   volatile OSErr ioResult;
13709   StringPtr ioNamePtr;
13710   short ioVRefNum;
13711   long filler14;
13712   StringPtr ioDestNamePtr;
13713   long filler15;
13714   long ioDestDirID;
13715   long filler16;
13716   long filler17;
13717   long ioSrcDirID;
13718   short filler18;
13719   long ioFileID;
13720 };
13721 typedef struct FIDParam FIDParam;
13722 typedef FIDParam * FIDParamPtr;
13723 struct ForeignPrivParam {
13724   QElemPtr qLink;
13725   short qType;
13726   short ioTrap;
13727   Ptr ioCmdAddr;
13728   IOCompletionUPP ioCompletion;
13729   volatile OSErr ioResult;
13730   StringPtr ioNamePtr;
13731   short ioVRefNum;
13732   long ioFiller21;
13733   long ioFiller22;
13734   Ptr ioForeignPrivBuffer;
13735   long ioForeignPrivActCount;
13736   long ioForeignPrivReqCount;
13737   long ioFiller23;
13738   long ioForeignPrivDirID;
13739   long ioForeignPrivInfo1;
13740   long ioForeignPrivInfo2;
13741   long ioForeignPrivInfo3;
13742   long ioForeignPrivInfo4;
13743 };
13744 typedef struct ForeignPrivParam ForeignPrivParam;
13745 typedef ForeignPrivParam * ForeignPrivParamPtr;
13746 struct CSParam {
13747   QElemPtr qLink;
13748   short qType;
13749   short ioTrap;
13750   Ptr ioCmdAddr;
13751   IOCompletionUPP ioCompletion;
13752   volatile OSErr ioResult;
13753   StringPtr ioNamePtr;
13754   short ioVRefNum;
13755   FSSpecPtr ioMatchPtr;
13756   long ioReqMatchCount;
13757   long ioActMatchCount;
13758   long ioSearchBits;
13759   CInfoPBPtr ioSearchInfo1;
13760   CInfoPBPtr ioSearchInfo2;
13761   long ioSearchTime;
13762   CatPositionRec ioCatPosition;
13763   Ptr ioOptBuffer;
13764   long ioOptBufSize;
13765 };
13766 typedef struct CSParam CSParam;
13767 typedef CSParam * CSParamPtr;
13768 union HParamBlockRec {
13769   HIOParam ioParam;
13770   HFileParam fileParam;
13771   HVolumeParam volumeParam;
13772   AccessParam accessParam;
13773   ObjParam objParam;
13774   CopyParam copyParam;
13775   WDParam wdParam;
13776   FIDParam fidParam;
13777   CSParam csParam;
13778   ForeignPrivParam foreignPrivParam;
13779 };
13780 typedef union HParamBlockRec HParamBlockRec;
13781
13782
13783 typedef HParamBlockRec * HParmBlkPtr;
13784
13785 struct CMovePBRec {
13786   QElemPtr qLink;
13787   short qType;
13788   short ioTrap;
13789   Ptr ioCmdAddr;
13790   IOCompletionUPP ioCompletion;
13791   volatile OSErr ioResult;
13792   StringPtr ioNamePtr;
13793   short ioVRefNum;
13794   long filler1;
13795   StringPtr ioNewName;
13796   long filler2;
13797   long ioNewDirID;
13798   long filler3[2];
13799   long ioDirID;
13800 };
13801 typedef struct CMovePBRec CMovePBRec;
13802 typedef CMovePBRec * CMovePBPtr;
13803 struct WDPBRec {
13804   QElemPtr qLink;
13805   short qType;
13806   short ioTrap;
13807   Ptr ioCmdAddr;
13808   IOCompletionUPP ioCompletion;
13809   volatile OSErr ioResult;
13810   StringPtr ioNamePtr;
13811   short ioVRefNum;
13812   short filler1;
13813   short ioWDIndex;
13814   long ioWDProcID;
13815   short ioWDVRefNum;
13816   short filler2[7];
13817   long ioWDDirID;
13818 };
13819 typedef struct WDPBRec WDPBRec;
13820 typedef WDPBRec * WDPBPtr;
13821 struct FCBPBRec {
13822   QElemPtr qLink;
13823   short qType;
13824   short ioTrap;
13825   Ptr ioCmdAddr;
13826   IOCompletionUPP ioCompletion;
13827   volatile OSErr ioResult;
13828   StringPtr ioNamePtr;
13829   short ioVRefNum;
13830   short ioRefNum;
13831   short filler;
13832   short ioFCBIndx;
13833   short filler1;
13834   long ioFCBFlNm;
13835   short ioFCBFlags;
13836   unsigned short ioFCBStBlk;
13837   long ioFCBEOF;
13838   long ioFCBPLen;
13839   long ioFCBCrPs;
13840   short ioFCBVRefNum;
13841   long ioFCBClpSiz;
13842   long ioFCBParID;
13843 };
13844 typedef struct FCBPBRec FCBPBRec;
13845 typedef FCBPBRec * FCBPBPtr;
13846 struct VCB {
13847   QElemPtr qLink;
13848   short qType;
13849   short vcbFlags;
13850   unsigned short vcbSigWord;
13851   unsigned long vcbCrDate;
13852   unsigned long vcbLsMod;
13853   short vcbAtrb;
13854   unsigned short vcbNmFls;
13855   short vcbVBMSt;
13856   short vcbAllocPtr;
13857   unsigned short vcbNmAlBlks;
13858   long vcbAlBlkSiz;
13859   long vcbClpSiz;
13860   short vcbAlBlSt;
13861   long vcbNxtCNID;
13862   unsigned short vcbFreeBks;
13863   Str27 vcbVN;
13864   short vcbDrvNum;
13865   short vcbDRefNum;
13866   short vcbFSID;
13867   short vcbVRefNum;
13868   Ptr vcbMAdr;
13869   Ptr vcbBufAdr;
13870   short vcbMLen;
13871   short vcbDirIndex;
13872   short vcbDirBlk;
13873   unsigned long vcbVolBkUp;
13874   unsigned short vcbVSeqNum;
13875   long vcbWrCnt;
13876   long vcbXTClpSiz;
13877   long vcbCTClpSiz;
13878   unsigned short vcbNmRtDirs;
13879   long vcbFilCnt;
13880   long vcbDirCnt;
13881   long vcbFndrInfo[8];
13882   unsigned short vcbVCSize;
13883   unsigned short vcbVBMCSiz;
13884   unsigned short vcbCtlCSiz;
13885   unsigned short vcbXTAlBlks;
13886   unsigned short vcbCTAlBlks;
13887   short vcbXTRef;
13888   short vcbCTRef;
13889   Ptr vcbCtlBuf;
13890   long vcbDirIDM;
13891   short vcbOffsM;
13892 };
13893 typedef struct VCB VCB;
13894 typedef VCB * VCBPtr;
13895 struct DrvQEl {
13896   QElemPtr qLink;
13897   short qType;
13898   short dQDrive;
13899   short dQRefNum;
13900   short dQFSID;
13901   unsigned short dQDrvSz;
13902   unsigned short dQDrvSz2;
13903 };
13904 typedef struct DrvQEl DrvQEl;
13905 typedef DrvQEl * DrvQElPtr;
13906 extern IOCompletionUPP
13907 NewIOCompletionUPP(IOCompletionProcPtr userRoutine) ;
13908 extern void
13909 DisposeIOCompletionUPP(IOCompletionUPP userUPP) ;
13910 extern void
13911 InvokeIOCompletionUPP(
13912   ParmBlkPtr paramBlock,
13913   IOCompletionUPP userUPP) ;
13914 extern OSErr PBXGetVolInfoSync(XVolumeParamPtr paramBlock) ;
13915 extern OSErr PBXGetVolInfoAsync(XVolumeParamPtr paramBlock) ;
13916 extern OSErr PBFlushVolSync(ParmBlkPtr paramBlock) ;
13917 extern OSErr PBFlushVolAsync(ParmBlkPtr paramBlock) ;
13918 extern OSErr PBAllocateSync(ParmBlkPtr paramBlock) ;
13919 extern OSErr PBAllocateAsync(ParmBlkPtr paramBlock) ;
13920 extern OSErr PBGetEOFSync(ParmBlkPtr paramBlock) ;
13921 extern OSErr PBGetEOFAsync(ParmBlkPtr paramBlock) ;
13922 extern OSErr PBSetEOFSync(ParmBlkPtr paramBlock) ;
13923 extern OSErr PBSetEOFAsync(ParmBlkPtr paramBlock) ;
13924 extern OSErr PBGetFPosSync(ParmBlkPtr paramBlock) ;
13925 extern OSErr PBGetFPosAsync(ParmBlkPtr paramBlock) ;
13926 extern OSErr PBSetFPosSync(ParmBlkPtr paramBlock) ;
13927 extern OSErr PBSetFPosAsync(ParmBlkPtr paramBlock) ;
13928 extern OSErr PBFlushFileSync(ParmBlkPtr paramBlock) ;
13929 extern OSErr PBFlushFileAsync(ParmBlkPtr paramBlock) ;
13930 extern OSErr PBUnmountVol(ParmBlkPtr paramBlock) ;
13931 extern OSErr PBCatSearchSync(CSParamPtr paramBlock) ;
13932 extern OSErr PBCatSearchAsync(CSParamPtr paramBlock) ;
13933 extern OSErr
13934 UnmountVol(
13935   ConstStr63Param volName,
13936   short vRefNum) ;
13937 extern OSErr
13938 FlushVol(
13939   ConstStr63Param volName,
13940   short vRefNum) ;
13941 extern OSErr
13942 HSetVol(
13943   ConstStr63Param volName,
13944   short vRefNum,
13945   long dirID) ;
13946 extern OSErr
13947 FSClose(short refNum) ;
13948 extern OSErr
13949 FSRead(
13950   short refNum,
13951   long * count,
13952   void * buffPtr) ;
13953 extern OSErr
13954 FSWrite(
13955   short refNum,
13956   long * count,
13957   const void * buffPtr) ;
13958 extern OSErr
13959 Allocate(
13960   short refNum,
13961   long * count) ;
13962 extern OSErr
13963 GetEOF(
13964   short refNum,
13965   long * logEOF) ;
13966 extern OSErr
13967 SetEOF(
13968   short refNum,
13969   long logEOF) ;
13970 extern OSErr
13971 GetFPos(
13972   short refNum,
13973   long * filePos) ;
13974 extern OSErr
13975 SetFPos(
13976   short refNum,
13977   short posMode,
13978   long posOff) ;
13979 extern OSErr
13980 GetVRefNum(
13981   short fileRefNum,
13982   short * vRefNum) ;
13983 extern OSErr PBHSetVolSync(WDPBPtr paramBlock) ;
13984 extern OSErr PBHSetVolAsync(WDPBPtr paramBlock) ;
13985 extern OSErr PBHGetVolSync(WDPBPtr paramBlock) ;
13986 extern OSErr PBHGetVolAsync(WDPBPtr paramBlock) ;
13987 extern OSErr PBCatMoveSync(CMovePBPtr paramBlock) ;
13988 extern OSErr PBCatMoveAsync(CMovePBPtr paramBlock) ;
13989 extern OSErr PBDirCreateSync(HParmBlkPtr paramBlock) ;
13990 extern OSErr PBDirCreateAsync(HParmBlkPtr paramBlock) ;
13991 extern OSErr PBGetFCBInfoSync(FCBPBPtr paramBlock) ;
13992 extern OSErr PBGetFCBInfoAsync(FCBPBPtr paramBlock) ;
13993 extern OSErr PBGetCatInfoSync(CInfoPBPtr paramBlock) ;
13994 extern OSErr PBGetCatInfoAsync(CInfoPBPtr paramBlock) ;
13995 extern OSErr PBSetCatInfoSync(CInfoPBPtr paramBlock) ;
13996 extern OSErr PBSetCatInfoAsync(CInfoPBPtr paramBlock) ;
13997 extern OSErr PBAllocContigSync(ParmBlkPtr paramBlock) ;
13998 extern OSErr PBAllocContigAsync(ParmBlkPtr paramBlock) ;
13999 extern OSErr PBLockRangeSync(ParmBlkPtr paramBlock) ;
14000 extern OSErr PBLockRangeAsync(ParmBlkPtr paramBlock) ;
14001 extern OSErr PBUnlockRangeSync(ParmBlkPtr paramBlock) ;
14002 extern OSErr PBUnlockRangeAsync(ParmBlkPtr paramBlock) ;
14003 extern OSErr PBSetVInfoSync(HParmBlkPtr paramBlock) ;
14004 extern OSErr PBSetVInfoAsync(HParmBlkPtr paramBlock) ;
14005 extern OSErr PBHGetVInfoSync(HParmBlkPtr paramBlock) ;
14006 extern OSErr PBHGetVInfoAsync(HParmBlkPtr paramBlock) ;
14007 extern OSErr PBHOpenSync(HParmBlkPtr paramBlock) ;
14008 extern OSErr PBHOpenAsync(HParmBlkPtr paramBlock) ;
14009 extern OSErr PBHOpenRFSync(HParmBlkPtr paramBlock) ;
14010 extern OSErr PBHOpenRFAsync(HParmBlkPtr paramBlock) ;
14011 extern OSErr PBHOpenDFSync(HParmBlkPtr paramBlock) ;
14012 extern OSErr PBHOpenDFAsync(HParmBlkPtr paramBlock) ;
14013 extern OSErr PBHCreateSync(HParmBlkPtr paramBlock) ;
14014 extern OSErr PBHCreateAsync(HParmBlkPtr paramBlock) ;
14015 extern OSErr PBHDeleteSync(HParmBlkPtr paramBlock) ;
14016 extern OSErr PBHDeleteAsync(HParmBlkPtr paramBlock) ;
14017 extern OSErr PBHRenameSync(HParmBlkPtr paramBlock) ;
14018 extern OSErr PBHRenameAsync(HParmBlkPtr paramBlock) ;
14019 extern OSErr PBHRstFLockSync(HParmBlkPtr paramBlock) ;
14020 extern OSErr PBHRstFLockAsync(HParmBlkPtr paramBlock) ;
14021 extern OSErr PBHSetFLockSync(HParmBlkPtr paramBlock) ;
14022 extern OSErr PBHSetFLockAsync(HParmBlkPtr paramBlock) ;
14023 extern OSErr PBHGetFInfoSync(HParmBlkPtr paramBlock) ;
14024 extern OSErr PBHGetFInfoAsync(HParmBlkPtr paramBlock) ;
14025 extern OSErr PBHSetFInfoSync(HParmBlkPtr paramBlock) ;
14026 extern OSErr PBHSetFInfoAsync(HParmBlkPtr paramBlock) ;
14027 extern OSErr PBMakeFSSpecSync(HParmBlkPtr paramBlock) ;
14028 extern OSErr PBMakeFSSpecAsync(HParmBlkPtr paramBlock) ;
14029 extern OSErr
14030 HGetVol(
14031   StringPtr volName,
14032   short * vRefNum,
14033   long * dirID) ;
14034 extern OSErr
14035 HOpen(
14036   short vRefNum,
14037   long dirID,
14038   ConstStr255Param fileName,
14039   SInt8 permission,
14040   short * refNum) ;
14041 extern OSErr
14042 HOpenDF(
14043   short vRefNum,
14044   long dirID,
14045   ConstStr255Param fileName,
14046   SInt8 permission,
14047   short * refNum) ;
14048 extern OSErr
14049 HOpenRF(
14050   short vRefNum,
14051   long dirID,
14052   ConstStr255Param fileName,
14053   SInt8 permission,
14054   short * refNum) ;
14055 extern OSErr
14056 AllocContig(
14057   short refNum,
14058   long * count) ;
14059 extern OSErr
14060 HCreate(
14061   short vRefNum,
14062   long dirID,
14063   ConstStr255Param fileName,
14064   OSType creator,
14065   OSType fileType) ;
14066 extern OSErr
14067 DirCreate(
14068   short vRefNum,
14069   long parentDirID,
14070   ConstStr255Param directoryName,
14071   long * createdDirID) ;
14072 extern OSErr
14073 HDelete(
14074   short vRefNum,
14075   long dirID,
14076   ConstStr255Param fileName) ;
14077 extern OSErr
14078 HGetFInfo(
14079   short vRefNum,
14080   long dirID,
14081   ConstStr255Param fileName,
14082   FInfo * fndrInfo) ;
14083 extern OSErr
14084 HSetFInfo(
14085   short vRefNum,
14086   long dirID,
14087   ConstStr255Param fileName,
14088   const FInfo * fndrInfo) ;
14089 extern OSErr
14090 HSetFLock(
14091   short vRefNum,
14092   long dirID,
14093   ConstStr255Param fileName) ;
14094 extern OSErr
14095 HRstFLock(
14096   short vRefNum,
14097   long dirID,
14098   ConstStr255Param fileName) ;
14099 extern OSErr
14100 HRename(
14101   short vRefNum,
14102   long dirID,
14103   ConstStr255Param oldName,
14104   ConstStr255Param newName) ;
14105 extern OSErr
14106 CatMove(
14107   short vRefNum,
14108   long dirID,
14109   ConstStr255Param oldName,
14110   long newDirID,
14111   ConstStr255Param newName) ;
14112 extern OSErr PBHGetVolParmsSync(HParmBlkPtr paramBlock) ;
14113 extern OSErr PBHGetVolParmsAsync(HParmBlkPtr paramBlock) ;
14114 extern OSErr PBHGetLogInInfoSync(HParmBlkPtr paramBlock) ;
14115 extern OSErr PBHGetLogInInfoAsync(HParmBlkPtr paramBlock) ;
14116 extern OSErr PBHGetDirAccessSync(HParmBlkPtr paramBlock) ;
14117 extern OSErr PBHGetDirAccessAsync(HParmBlkPtr paramBlock) ;
14118 extern OSErr PBHSetDirAccessSync(HParmBlkPtr paramBlock) ;
14119 extern OSErr PBHSetDirAccessAsync(HParmBlkPtr paramBlock) ;
14120 extern OSErr PBHMapIDSync(HParmBlkPtr paramBlock) ;
14121 extern OSErr PBHMapIDAsync(HParmBlkPtr paramBlock) ;
14122 extern OSErr PBHMapNameSync(HParmBlkPtr paramBlock) ;
14123 extern OSErr PBHMapNameAsync(HParmBlkPtr paramBlock) ;
14124 extern OSErr PBHCopyFileSync(HParmBlkPtr paramBlock) ;
14125 extern OSErr PBHCopyFileAsync(HParmBlkPtr paramBlock) ;
14126 extern OSErr PBHMoveRenameSync(HParmBlkPtr paramBlock) ;
14127 extern OSErr PBHMoveRenameAsync(HParmBlkPtr paramBlock) ;
14128 extern OSErr PBHOpenDenySync(HParmBlkPtr paramBlock) ;
14129 extern OSErr PBHOpenDenyAsync(HParmBlkPtr paramBlock) ;
14130 extern OSErr PBHOpenRFDenySync(HParmBlkPtr paramBlock) ;
14131 extern OSErr PBHOpenRFDenyAsync(HParmBlkPtr paramBlock) ;
14132 extern OSErr PBGetXCatInfoSync(XCInfoPBPtr paramBlock) ;
14133 extern OSErr PBGetXCatInfoAsync(XCInfoPBPtr paramBlock) ;
14134 extern OSErr PBExchangeFilesSync(HParmBlkPtr paramBlock) ;
14135 extern OSErr PBExchangeFilesAsync(HParmBlkPtr paramBlock) ;
14136 extern OSErr PBCreateFileIDRefSync(HParmBlkPtr paramBlock) ;
14137 extern OSErr PBCreateFileIDRefAsync(HParmBlkPtr paramBlock) ;
14138 extern OSErr PBResolveFileIDRefSync(HParmBlkPtr paramBlock) ;
14139 extern OSErr PBResolveFileIDRefAsync(HParmBlkPtr paramBlock) ;
14140 extern OSErr PBDeleteFileIDRefSync(HParmBlkPtr paramBlock) ;
14141 extern OSErr PBDeleteFileIDRefAsync(HParmBlkPtr paramBlock) ;
14142 extern OSErr PBGetForeignPrivsSync(HParmBlkPtr paramBlock) ;
14143 extern OSErr PBGetForeignPrivsAsync(HParmBlkPtr paramBlock) ;
14144 extern OSErr PBSetForeignPrivsSync(HParmBlkPtr paramBlock) ;
14145 extern OSErr PBSetForeignPrivsAsync(HParmBlkPtr paramBlock) ;
14146 extern OSErr PBDTGetPath(DTPBPtr paramBlock) ;
14147 extern OSErr PBDTCloseDown(DTPBPtr paramBlock) ;
14148 extern OSErr PBDTAddIconSync(DTPBPtr paramBlock) ;
14149 extern OSErr PBDTAddIconAsync(DTPBPtr paramBlock) ;
14150 extern OSErr PBDTGetIconSync(DTPBPtr paramBlock) ;
14151 extern OSErr PBDTGetIconAsync(DTPBPtr paramBlock) ;
14152 extern OSErr PBDTGetIconInfoSync(DTPBPtr paramBlock) ;
14153 extern OSErr PBDTGetIconInfoAsync(DTPBPtr paramBlock) ;
14154 extern OSErr PBDTAddAPPLSync(DTPBPtr paramBlock) ;
14155 extern OSErr PBDTAddAPPLAsync(DTPBPtr paramBlock) ;
14156 extern OSErr PBDTRemoveAPPLSync(DTPBPtr paramBlock) ;
14157 extern OSErr PBDTRemoveAPPLAsync(DTPBPtr paramBlock) ;
14158 extern OSErr PBDTGetAPPLSync(DTPBPtr paramBlock) ;
14159 extern OSErr PBDTGetAPPLAsync(DTPBPtr paramBlock) ;
14160 extern OSErr PBDTSetCommentSync(DTPBPtr paramBlock) ;
14161 extern OSErr PBDTSetCommentAsync(DTPBPtr paramBlock) ;
14162 extern OSErr PBDTRemoveCommentSync(DTPBPtr paramBlock) ;
14163 extern OSErr PBDTRemoveCommentAsync(DTPBPtr paramBlock) ;
14164 extern OSErr PBDTGetCommentSync(DTPBPtr paramBlock) ;
14165 extern OSErr PBDTGetCommentAsync(DTPBPtr paramBlock) ;
14166 extern OSErr PBDTFlushSync(DTPBPtr paramBlock) ;
14167 extern OSErr PBDTFlushAsync(DTPBPtr paramBlock) ;
14168 extern OSErr PBDTResetSync(DTPBPtr paramBlock) ;
14169 extern OSErr PBDTResetAsync(DTPBPtr paramBlock) ;
14170 extern OSErr PBDTGetInfoSync(DTPBPtr paramBlock) ;
14171 extern OSErr PBDTGetInfoAsync(DTPBPtr paramBlock) ;
14172 extern OSErr PBDTOpenInform(DTPBPtr paramBlock) ;
14173 extern OSErr PBDTDeleteSync(DTPBPtr paramBlock) ;
14174 extern OSErr PBDTDeleteAsync(DTPBPtr paramBlock) ;
14175 extern OSErr PBGetVolMountInfoSize(ParmBlkPtr paramBlock) ;
14176 extern OSErr PBGetVolMountInfo(ParmBlkPtr paramBlock) ;
14177 extern OSErr PBVolumeMount(ParmBlkPtr paramBlock) ;
14178 extern OSErr
14179 FSMakeFSSpec(
14180   short vRefNum,
14181   long dirID,
14182   ConstStr255Param fileName,
14183   FSSpec * spec) ;
14184 extern OSErr
14185 FSpOpenDF(
14186   const FSSpec * spec,
14187   SInt8 permission,
14188   short * refNum) ;
14189 extern OSErr
14190 FSpOpenRF(
14191   const FSSpec * spec,
14192   SInt8 permission,
14193   short * refNum) ;
14194 extern OSErr
14195 FSpCreate(
14196   const FSSpec * spec,
14197   OSType creator,
14198   OSType fileType,
14199   ScriptCode scriptTag) ;
14200 extern OSErr
14201 FSpDirCreate(
14202   const FSSpec * spec,
14203   ScriptCode scriptTag,
14204   long * createdDirID) ;
14205 extern OSErr
14206 FSpDelete(const FSSpec * spec) ;
14207 extern OSErr
14208 FSpGetFInfo(
14209   const FSSpec * spec,
14210   FInfo * fndrInfo) ;
14211 extern OSErr
14212 FSpSetFInfo(
14213   const FSSpec * spec,
14214   const FInfo * fndrInfo) ;
14215 extern OSErr
14216 FSpSetFLock(const FSSpec * spec) ;
14217 extern OSErr
14218 FSpRstFLock(const FSSpec * spec) ;
14219 extern OSErr
14220 FSpRename(
14221   const FSSpec * spec,
14222   ConstStr255Param newName) ;
14223 extern OSErr
14224 FSpCatMove(
14225   const FSSpec * source,
14226   const FSSpec * dest) ;
14227 extern OSErr
14228 FSpExchangeFiles(
14229   const FSSpec * source,
14230   const FSSpec * dest) ;
14231 extern OSErr PBShareSync(HParmBlkPtr paramBlock) ;
14232 extern OSErr PBShareAsync(HParmBlkPtr paramBlock) ;
14233 extern OSErr PBUnshareSync(HParmBlkPtr paramBlock) ;
14234 extern OSErr PBUnshareAsync(HParmBlkPtr paramBlock) ;
14235 extern OSErr PBGetUGEntrySync(HParmBlkPtr paramBlock) ;
14236 extern OSErr PBGetUGEntryAsync(HParmBlkPtr paramBlock) ;
14237 typedef SInt16 FSVolumeRefNum;
14238 enum {
14239   kFSInvalidVolumeRefNum = 0
14240 };
14241
14242 struct FSRef {
14243   UInt8 hidden[80];
14244 };
14245 typedef struct FSRef FSRef;
14246 typedef FSRef * FSRefPtr;
14247 struct FSPermissionInfo {
14248   UInt32 userID;
14249   UInt32 groupID;
14250   UInt8 reserved1;
14251   UInt8 userAccess;
14252   UInt16 mode;
14253   UInt32 reserved2;
14254 };
14255 typedef struct FSPermissionInfo FSPermissionInfo;
14256
14257
14258 typedef UInt32 FSCatalogInfoBitmap;
14259 enum {
14260   kFSCatInfoNone = 0x00000000,
14261   kFSCatInfoTextEncoding = 0x00000001,
14262   kFSCatInfoNodeFlags = 0x00000002,
14263   kFSCatInfoVolume = 0x00000004,
14264   kFSCatInfoParentDirID = 0x00000008,
14265   kFSCatInfoNodeID = 0x00000010,
14266   kFSCatInfoCreateDate = 0x00000020,
14267   kFSCatInfoContentMod = 0x00000040,
14268   kFSCatInfoAttrMod = 0x00000080,
14269   kFSCatInfoAccessDate = 0x00000100,
14270   kFSCatInfoBackupDate = 0x00000200,
14271   kFSCatInfoPermissions = 0x00000400,
14272   kFSCatInfoFinderInfo = 0x00000800,
14273   kFSCatInfoFinderXInfo = 0x00001000,
14274   kFSCatInfoValence = 0x00002000,
14275   kFSCatInfoDataSizes = 0x00004000,
14276   kFSCatInfoRsrcSizes = 0x00008000,
14277   kFSCatInfoSharingFlags = 0x00010000,
14278   kFSCatInfoUserPrivs = 0x00020000,
14279   kFSCatInfoUserAccess = 0x00080000,
14280   kFSCatInfoAllDates = 0x000003E0,
14281   kFSCatInfoGettableInfo = 0x0003FFFF,
14282   kFSCatInfoSettableInfo = 0x00001FE3,
14283   kFSCatInfoReserved = (long)0xFFFC0000
14284 };
14285
14286
14287 enum {
14288   kFSNodeLockedBit = 0,
14289   kFSNodeLockedMask = 0x0001,
14290   kFSNodeResOpenBit = 2,
14291   kFSNodeResOpenMask = 0x0004,
14292   kFSNodeDataOpenBit = 3,
14293   kFSNodeDataOpenMask = 0x0008,
14294   kFSNodeIsDirectoryBit = 4,
14295   kFSNodeIsDirectoryMask = 0x0010,
14296   kFSNodeCopyProtectBit = 6,
14297   kFSNodeCopyProtectMask = 0x0040,
14298   kFSNodeForkOpenBit = 7,
14299   kFSNodeForkOpenMask = 0x0080,
14300   kFSNodeHardLinkBit = 8,
14301   kFSNodeHardLinkMask = 0x00000100
14302 };
14303
14304
14305 enum {
14306   kFSNodeInSharedBit = 2,
14307   kFSNodeInSharedMask = 0x0004,
14308   kFSNodeIsMountedBit = 3,
14309   kFSNodeIsMountedMask = 0x0008,
14310   kFSNodeIsSharePointBit = 5,
14311   kFSNodeIsSharePointMask = 0x0020
14312 };
14313
14314
14315 struct FSCatalogInfo {
14316   UInt16 nodeFlags;
14317   FSVolumeRefNum volume;
14318   UInt32 parentDirID;
14319   UInt32 nodeID;
14320   UInt8 sharingFlags;
14321   UInt8 userPrivileges;
14322   UInt8 reserved1;
14323   UInt8 reserved2;
14324   UTCDateTime createDate;
14325   UTCDateTime contentModDate;
14326   UTCDateTime attributeModDate;
14327   UTCDateTime accessDate;
14328   UTCDateTime backupDate;
14329
14330   UInt32 permissions[4];
14331
14332   UInt8 finderInfo[16];
14333   UInt8 extFinderInfo[16];
14334
14335   UInt64 dataLogicalSize;
14336   UInt64 dataPhysicalSize;
14337   UInt64 rsrcLogicalSize;
14338   UInt64 rsrcPhysicalSize;
14339
14340   UInt32 valence;
14341   TextEncoding textEncodingHint;
14342 };
14343 typedef struct FSCatalogInfo FSCatalogInfo;
14344 typedef FSCatalogInfo * FSCatalogInfoPtr;
14345 struct FSRefParam {
14346   QElemPtr qLink;
14347   short qType;
14348   short ioTrap;
14349   Ptr ioCmdAddr;
14350   IOCompletionUPP ioCompletion;
14351   volatile OSErr ioResult;
14352   ConstStringPtr ioNamePtr;
14353   short ioVRefNum;
14354
14355   SInt16 reserved1;
14356   UInt8 reserved2;
14357   UInt8 reserved3;
14358
14359   const FSRef * ref;
14360   FSCatalogInfoBitmap whichInfo;
14361   FSCatalogInfo * catInfo;
14362   UniCharCount nameLength;
14363   const UniChar * name;
14364   long ioDirID;
14365   FSSpec * spec;
14366   FSRef * parentRef;
14367   FSRef * newRef;
14368   TextEncoding textEncodingHint;
14369   HFSUniStr255 * outName;
14370 };
14371 typedef struct FSRefParam FSRefParam;
14372 typedef FSRefParam * FSRefParamPtr;
14373 typedef struct OpaqueFSIterator* FSIterator;
14374 enum {
14375   kFSIterateFlat = 0,
14376   kFSIterateSubtree = 1,
14377   kFSIterateDelete = 2,
14378   kFSIterateReserved = (long)0xFFFFFFFC
14379 };
14380
14381 typedef OptionBits FSIteratorFlags;
14382 enum {
14383
14384   fsSBNodeID = 0x00008000,
14385   fsSBAttributeModDate = 0x00010000,
14386   fsSBAccessDate = 0x00020000,
14387   fsSBPermissions = 0x00040000,
14388   fsSBNodeIDBit = 15,
14389   fsSBAttributeModDateBit = 16,
14390   fsSBAccessDateBit = 17,
14391   fsSBPermissionsBit = 18
14392 };
14393
14394 struct FSSearchParams {
14395   Duration searchTime;
14396   OptionBits searchBits;
14397   UniCharCount searchNameLength;
14398   const UniChar * searchName;
14399   FSCatalogInfo * searchInfo1;
14400   FSCatalogInfo * searchInfo2;
14401 };
14402 typedef struct FSSearchParams FSSearchParams;
14403 typedef FSSearchParams * FSSearchParamsPtr;
14404 struct FSCatalogBulkParam {
14405   QElemPtr qLink;
14406   short qType;
14407   short ioTrap;
14408   Ptr ioCmdAddr;
14409   IOCompletionUPP ioCompletion;
14410   volatile OSErr ioResult;
14411   Boolean containerChanged;
14412   UInt8 reserved;
14413
14414   FSIteratorFlags iteratorFlags;
14415   FSIterator iterator;
14416   const FSRef * container;
14417   ItemCount maximumItems;
14418   ItemCount actualItems;
14419   FSCatalogInfoBitmap whichInfo;
14420   FSCatalogInfo * catalogInfo;
14421   FSRef * refs;
14422   FSSpec * specs;
14423   HFSUniStr255 * names;
14424   const FSSearchParams * searchParams;
14425 };
14426 typedef struct FSCatalogBulkParam FSCatalogBulkParam;
14427 typedef FSCatalogBulkParam * FSCatalogBulkParamPtr;
14428 typedef UInt16 FSAllocationFlags;
14429 enum {
14430   kFSAllocDefaultFlags = 0x0000,
14431   kFSAllocAllOrNothingMask = 0x0001,
14432   kFSAllocContiguousMask = 0x0002,
14433   kFSAllocNoRoundUpMask = 0x0004,
14434   kFSAllocReservedMask = 0xFFF8
14435 };
14436
14437 struct FSForkIOParam {
14438   QElemPtr qLink;
14439   short qType;
14440   short ioTrap;
14441   Ptr ioCmdAddr;
14442   IOCompletionUPP ioCompletion;
14443   volatile OSErr ioResult;
14444   void * reserved1;
14445   SInt16 reserved2;
14446   SInt16 forkRefNum;
14447   UInt8 reserved3;
14448   SInt8 permissions;
14449   const FSRef * ref;
14450
14451
14452   Ptr buffer;
14453   UInt32 requestCount;
14454   UInt32 actualCount;
14455   UInt16 positionMode;
14456   SInt64 positionOffset;
14457
14458   FSAllocationFlags allocationFlags;
14459   UInt64 allocationAmount;
14460
14461   UniCharCount forkNameLength;
14462   const UniChar * forkName;
14463
14464   CatPositionRec forkIterator;
14465   HFSUniStr255 * outForkName;
14466 };
14467 typedef struct FSForkIOParam FSForkIOParam;
14468 typedef FSForkIOParam * FSForkIOParamPtr;
14469 struct FSForkInfo {
14470   SInt8 flags;
14471   SInt8 permissions;
14472   FSVolumeRefNum volume;
14473   UInt32 reserved2;
14474   UInt32 nodeID;
14475   UInt32 forkID;
14476   UInt64 currentPosition;
14477   UInt64 logicalEOF;
14478   UInt64 physicalEOF;
14479   UInt64 process;
14480 };
14481 typedef struct FSForkInfo FSForkInfo;
14482 typedef FSForkInfo * FSForkInfoPtr;
14483 struct FSForkCBInfoParam {
14484   QElemPtr qLink;
14485   short qType;
14486   short ioTrap;
14487   Ptr ioCmdAddr;
14488   IOCompletionUPP ioCompletion;
14489   volatile OSErr ioResult;
14490   SInt16 desiredRefNum;
14491   SInt16 volumeRefNum;
14492   SInt16 iterator;
14493   SInt16 actualRefNum;
14494
14495   FSRef * ref;
14496   FSForkInfo * forkInfo;
14497   HFSUniStr255 * forkName;
14498 };
14499 typedef struct FSForkCBInfoParam FSForkCBInfoParam;
14500 typedef FSForkCBInfoParam * FSForkCBInfoParamPtr;
14501 typedef UInt32 FSVolumeInfoBitmap;
14502 enum {
14503   kFSVolInfoNone = 0x0000,
14504   kFSVolInfoCreateDate = 0x0001,
14505   kFSVolInfoModDate = 0x0002,
14506   kFSVolInfoBackupDate = 0x0004,
14507   kFSVolInfoCheckedDate = 0x0008,
14508   kFSVolInfoFileCount = 0x0010,
14509   kFSVolInfoDirCount = 0x0020,
14510   kFSVolInfoSizes = 0x0040,
14511   kFSVolInfoBlocks = 0x0080,
14512   kFSVolInfoNextAlloc = 0x0100,
14513   kFSVolInfoRsrcClump = 0x0200,
14514   kFSVolInfoDataClump = 0x0400,
14515   kFSVolInfoNextID = 0x0800,
14516   kFSVolInfoFinderInfo = 0x1000,
14517   kFSVolInfoFlags = 0x2000,
14518   kFSVolInfoFSInfo = 0x4000,
14519   kFSVolInfoDriveInfo = 0x8000,
14520   kFSVolInfoGettableInfo = 0xFFFF,
14521   kFSVolInfoSettableInfo = 0x3004
14522 };
14523
14524
14525 enum {
14526   kFSVolFlagDefaultVolumeBit = 5,
14527   kFSVolFlagDefaultVolumeMask = 0x0020,
14528   kFSVolFlagFilesOpenBit = 6,
14529   kFSVolFlagFilesOpenMask = 0x0040,
14530   kFSVolFlagHardwareLockedBit = 7,
14531   kFSVolFlagHardwareLockedMask = 0x0080,
14532   kFSVolFlagSoftwareLockedBit = 15,
14533   kFSVolFlagSoftwareLockedMask = 0x8000
14534 };
14535
14536
14537 struct FSVolumeInfo {
14538
14539   UTCDateTime createDate;
14540   UTCDateTime modifyDate;
14541   UTCDateTime backupDate;
14542   UTCDateTime checkedDate;
14543
14544
14545   UInt32 fileCount;
14546   UInt32 folderCount;
14547
14548
14549   UInt64 totalBytes;
14550   UInt64 freeBytes;
14551
14552
14553   UInt32 blockSize;
14554   UInt32 totalBlocks;
14555   UInt32 freeBlocks;
14556   UInt32 nextAllocation;
14557   UInt32 rsrcClumpSize;
14558   UInt32 dataClumpSize;
14559   UInt32 nextCatalogID;
14560   UInt8 finderInfo[32];
14561
14562
14563   UInt16 flags;
14564   UInt16 filesystemID;
14565   UInt16 signature;
14566   UInt16 driveNumber;
14567   short driverRefNum;
14568 };
14569 typedef struct FSVolumeInfo FSVolumeInfo;
14570 typedef FSVolumeInfo * FSVolumeInfoPtr;
14571 struct FSVolumeInfoParam {
14572   QElemPtr qLink;
14573   short qType;
14574   short ioTrap;
14575   Ptr ioCmdAddr;
14576   IOCompletionUPP ioCompletion;
14577   volatile OSErr ioResult;
14578   StringPtr ioNamePtr;
14579   FSVolumeRefNum ioVRefNum;
14580
14581   UInt32 volumeIndex;
14582   FSVolumeInfoBitmap whichInfo;
14583   FSVolumeInfo * volumeInfo;
14584   HFSUniStr255 * volumeName;
14585   FSRef * ref;
14586 };
14587 typedef struct FSVolumeInfoParam FSVolumeInfoParam;
14588 typedef FSVolumeInfoParam * FSVolumeInfoParamPtr;
14589 extern OSErr
14590 FSpMakeFSRef(
14591   const FSSpec * source,
14592   FSRef * newRef) ;
14593 extern OSErr
14594 PBMakeFSRefSync(FSRefParam * paramBlock) ;
14595 extern void
14596 PBMakeFSRefAsync(FSRefParam * paramBlock) ;
14597 extern OSErr
14598 FSMakeFSRefUnicode(
14599   const FSRef * parentRef,
14600   UniCharCount nameLength,
14601   const UniChar * name,
14602   TextEncoding textEncodingHint,
14603   FSRef * newRef) ;
14604 extern OSErr
14605 PBMakeFSRefUnicodeSync(FSRefParam * paramBlock) ;
14606 extern void
14607 PBMakeFSRefUnicodeAsync(FSRefParam * paramBlock) ;
14608 extern OSErr
14609 FSCompareFSRefs(
14610   const FSRef * ref1,
14611   const FSRef * ref2) ;
14612 extern OSErr
14613 PBCompareFSRefsSync(FSRefParam * paramBlock) ;
14614 extern void
14615 PBCompareFSRefsAsync(FSRefParam * paramBlock) ;
14616 extern OSErr
14617 FSCreateFileUnicode(
14618   const FSRef * parentRef,
14619   UniCharCount nameLength,
14620   const UniChar * name,
14621   FSCatalogInfoBitmap whichInfo,
14622   const FSCatalogInfo * catalogInfo,
14623   FSRef * newRef,
14624   FSSpec * newSpec) ;
14625 extern OSErr
14626 PBCreateFileUnicodeSync(FSRefParam * paramBlock) ;
14627 extern void
14628 PBCreateFileUnicodeAsync(FSRefParam * paramBlock) ;
14629 extern OSErr
14630 FSCreateDirectoryUnicode(
14631   const FSRef * parentRef,
14632   UniCharCount nameLength,
14633   const UniChar * name,
14634   FSCatalogInfoBitmap whichInfo,
14635   const FSCatalogInfo * catalogInfo,
14636   FSRef * newRef,
14637   FSSpec * newSpec,
14638   UInt32 * newDirID) ;
14639 extern OSErr
14640 PBCreateDirectoryUnicodeSync(FSRefParam * paramBlock) ;
14641 extern void
14642 PBCreateDirectoryUnicodeAsync(FSRefParam * paramBlock) ;
14643 extern OSErr
14644 FSDeleteObject(const FSRef * ref) ;
14645 extern OSErr
14646 PBDeleteObjectSync(FSRefParam * paramBlock) ;
14647 extern void
14648 PBDeleteObjectAsync(FSRefParam * paramBlock) ;
14649 extern OSErr
14650 FSMoveObject(
14651   const FSRef * ref,
14652   const FSRef * destDirectory,
14653   FSRef * newRef) ;
14654 extern OSErr
14655 PBMoveObjectSync(FSRefParam * paramBlock) ;
14656 extern void
14657 PBMoveObjectAsync(FSRefParam * paramBlock) ;
14658 extern OSErr
14659 FSExchangeObjects(
14660   const FSRef * ref,
14661   const FSRef * destRef) ;
14662 extern OSErr
14663 PBExchangeObjectsSync(FSRefParam * paramBlock) ;
14664 extern void
14665 PBExchangeObjectsAsync(FSRefParam * paramBlock) ;
14666 extern OSErr
14667 FSRenameUnicode(
14668   const FSRef * ref,
14669   UniCharCount nameLength,
14670   const UniChar * name,
14671   TextEncoding textEncodingHint,
14672   FSRef * newRef) ;
14673 extern OSErr
14674 PBRenameUnicodeSync(FSRefParam * paramBlock) ;
14675 extern void
14676 PBRenameUnicodeAsync(FSRefParam * paramBlock) ;
14677 extern OSErr
14678 FSGetCatalogInfo(
14679   const FSRef * ref,
14680   FSCatalogInfoBitmap whichInfo,
14681   FSCatalogInfo * catalogInfo,
14682   HFSUniStr255 * outName,
14683   FSSpec * fsSpec,
14684   FSRef * parentRef) ;
14685 extern OSErr
14686 PBGetCatalogInfoSync(FSRefParam * paramBlock) ;
14687 extern void
14688 PBGetCatalogInfoAsync(FSRefParam * paramBlock) ;
14689 extern OSErr
14690 FSSetCatalogInfo(
14691   const FSRef * ref,
14692   FSCatalogInfoBitmap whichInfo,
14693   const FSCatalogInfo * catalogInfo) ;
14694 extern OSErr
14695 PBSetCatalogInfoSync(FSRefParam * paramBlock) ;
14696 extern void
14697 PBSetCatalogInfoAsync(FSRefParam * paramBlock) ;
14698 extern OSErr
14699 FSOpenIterator(
14700   const FSRef * container,
14701   FSIteratorFlags iteratorFlags,
14702   FSIterator * iterator) ;
14703 extern OSErr
14704 PBOpenIteratorSync(FSCatalogBulkParam * paramBlock) ;
14705 extern void
14706 PBOpenIteratorAsync(FSCatalogBulkParam * paramBlock) ;
14707 extern OSErr
14708 FSCloseIterator(FSIterator iterator) ;
14709 extern OSErr
14710 PBCloseIteratorSync(FSCatalogBulkParam * paramBlock) ;
14711 extern void
14712 PBCloseIteratorAsync(FSCatalogBulkParam * paramBlock) ;
14713 extern OSErr
14714 FSGetCatalogInfoBulk(
14715   FSIterator iterator,
14716   ItemCount maximumObjects,
14717   ItemCount * actualObjects,
14718   Boolean * containerChanged,
14719   FSCatalogInfoBitmap whichInfo,
14720   FSCatalogInfo * catalogInfos,
14721   FSRef * refs,
14722   FSSpec * specs,
14723   HFSUniStr255 * names) ;
14724 extern OSErr
14725 PBGetCatalogInfoBulkSync(FSCatalogBulkParam * paramBlock) ;
14726 extern void
14727 PBGetCatalogInfoBulkAsync(FSCatalogBulkParam * paramBlock) ;
14728 extern OSErr
14729 FSCatalogSearch(
14730   FSIterator iterator,
14731   const FSSearchParams * searchCriteria,
14732   ItemCount maximumObjects,
14733   ItemCount * actualObjects,
14734   Boolean * containerChanged,
14735   FSCatalogInfoBitmap whichInfo,
14736   FSCatalogInfo * catalogInfos,
14737   FSRef * refs,
14738   FSSpec * specs,
14739   HFSUniStr255 * names) ;
14740 extern OSErr
14741 PBCatalogSearchSync(FSCatalogBulkParam * paramBlock) ;
14742 extern void
14743 PBCatalogSearchAsync(FSCatalogBulkParam * paramBlock) ;
14744 extern OSErr
14745 FSCreateFork(
14746   const FSRef * ref,
14747   UniCharCount forkNameLength,
14748   const UniChar * forkName) ;
14749 extern OSErr
14750 PBCreateForkSync(FSForkIOParam * paramBlock) ;
14751 extern void
14752 PBCreateForkAsync(FSForkIOParam * paramBlock) ;
14753 extern OSErr
14754 FSDeleteFork(
14755   const FSRef * ref,
14756   UniCharCount forkNameLength,
14757   const UniChar * forkName) ;
14758 extern OSErr
14759 PBDeleteForkSync(FSForkIOParam * paramBlock) ;
14760 extern void
14761 PBDeleteForkAsync(FSForkIOParam * paramBlock) ;
14762 extern OSErr
14763 FSIterateForks(
14764   const FSRef * ref,
14765   CatPositionRec * forkIterator,
14766   HFSUniStr255 * forkName,
14767   SInt64 * forkSize,
14768   UInt64 * forkPhysicalSize) ;
14769 extern OSErr
14770 PBIterateForksSync(FSForkIOParam * paramBlock) ;
14771 extern void
14772 PBIterateForksAsync(FSForkIOParam * paramBlock) ;
14773 extern OSErr
14774 FSOpenFork(
14775   const FSRef * ref,
14776   UniCharCount forkNameLength,
14777   const UniChar * forkName,
14778   SInt8 permissions,
14779   SInt16 * forkRefNum) ;
14780 extern OSErr
14781 PBOpenForkSync(FSForkIOParam * paramBlock) ;
14782 extern void
14783 PBOpenForkAsync(FSForkIOParam * paramBlock) ;
14784 extern OSErr
14785 FSReadFork(
14786   SInt16 forkRefNum,
14787   UInt16 positionMode,
14788   SInt64 positionOffset,
14789   ByteCount requestCount,
14790   void * buffer,
14791   ByteCount * actualCount) ;
14792 extern OSErr
14793 PBReadForkSync(FSForkIOParam * paramBlock) ;
14794 extern void
14795 PBReadForkAsync(FSForkIOParam * paramBlock) ;
14796 extern OSErr
14797 FSWriteFork(
14798   SInt16 forkRefNum,
14799   UInt16 positionMode,
14800   SInt64 positionOffset,
14801   ByteCount requestCount,
14802   const void * buffer,
14803   ByteCount * actualCount) ;
14804 extern OSErr
14805 PBWriteForkSync(FSForkIOParam * paramBlock) ;
14806 extern void
14807 PBWriteForkAsync(FSForkIOParam * paramBlock) ;
14808 extern OSErr
14809 FSGetForkPosition(
14810   SInt16 forkRefNum,
14811   SInt64 * position) ;
14812 extern OSErr
14813 PBGetForkPositionSync(FSForkIOParam * paramBlock) ;
14814 extern void
14815 PBGetForkPositionAsync(FSForkIOParam * paramBlock) ;
14816 extern OSErr
14817 FSSetForkPosition(
14818   SInt16 forkRefNum,
14819   UInt16 positionMode,
14820   SInt64 positionOffset) ;
14821 extern OSErr
14822 PBSetForkPositionSync(FSForkIOParam * paramBlock) ;
14823 extern void
14824 PBSetForkPositionAsync(FSForkIOParam * paramBlock) ;
14825 extern OSErr
14826 FSGetForkSize(
14827   SInt16 forkRefNum,
14828   SInt64 * forkSize) ;
14829 extern OSErr
14830 PBGetForkSizeSync(FSForkIOParam * paramBlock) ;
14831 extern void
14832 PBGetForkSizeAsync(FSForkIOParam * paramBlock) ;
14833 extern OSErr
14834 FSSetForkSize(
14835   SInt16 forkRefNum,
14836   UInt16 positionMode,
14837   SInt64 positionOffset) ;
14838 extern OSErr
14839 PBSetForkSizeSync(FSForkIOParam * paramBlock) ;
14840 extern void
14841 PBSetForkSizeAsync(FSForkIOParam * paramBlock) ;
14842 extern OSErr
14843 FSAllocateFork(
14844   SInt16 forkRefNum,
14845   FSAllocationFlags flags,
14846   UInt16 positionMode,
14847   SInt64 positionOffset,
14848   UInt64 requestCount,
14849   UInt64 * actualCount) ;
14850 extern OSErr
14851 PBAllocateForkSync(FSForkIOParam * paramBlock) ;
14852 extern void
14853 PBAllocateForkAsync(FSForkIOParam * paramBlock) ;
14854 extern OSErr
14855 FSFlushFork(SInt16 forkRefNum) ;
14856 extern OSErr
14857 PBFlushForkSync(FSForkIOParam * paramBlock) ;
14858 extern void
14859 PBFlushForkAsync(FSForkIOParam * paramBlock) ;
14860 extern OSErr
14861 FSCloseFork(SInt16 forkRefNum) ;
14862 extern OSErr
14863 PBCloseForkSync(FSForkIOParam * paramBlock) ;
14864 extern void
14865 PBCloseForkAsync(FSForkIOParam * paramBlock) ;
14866 extern OSErr
14867 FSGetForkCBInfo(
14868   SInt16 desiredRefNum,
14869   FSVolumeRefNum volume,
14870   SInt16 * iterator,
14871   SInt16 * actualRefNum,
14872   FSForkInfo * forkInfo,
14873   FSRef * ref,
14874   HFSUniStr255 * outForkName) ;
14875 extern OSErr
14876 PBGetForkCBInfoSync(FSForkCBInfoParam * paramBlock) ;
14877 extern void
14878 PBGetForkCBInfoAsync(FSForkCBInfoParam * paramBlock) ;
14879 extern OSErr
14880 FSGetVolumeInfo(
14881   FSVolumeRefNum volume,
14882   ItemCount volumeIndex,
14883   FSVolumeRefNum * actualVolume,
14884   FSVolumeInfoBitmap whichInfo,
14885   FSVolumeInfo * info,
14886   HFSUniStr255 * volumeName,
14887   FSRef * rootDirectory) ;
14888 extern OSErr
14889 PBGetVolumeInfoSync(FSVolumeInfoParam * paramBlock) ;
14890 extern void
14891 PBGetVolumeInfoAsync(FSVolumeInfoParam * paramBlock) ;
14892 extern OSErr
14893 FSSetVolumeInfo(
14894   FSVolumeRefNum volume,
14895   FSVolumeInfoBitmap whichInfo,
14896   const FSVolumeInfo * info) ;
14897 extern OSErr
14898 PBSetVolumeInfoSync(FSVolumeInfoParam * paramBlock) ;
14899 extern void
14900 PBSetVolumeInfoAsync(FSVolumeInfoParam * paramBlock) ;
14901 extern OSErr
14902 FSGetDataForkName(HFSUniStr255 * dataForkName) ;
14903 extern OSErr
14904 FSGetResourceForkName(HFSUniStr255 * resourceForkName) ;
14905 extern OSStatus
14906 FSRefMakePath(
14907   const FSRef * ref,
14908   UInt8 * path,
14909   UInt32 maxPathSize) ;
14910 extern OSStatus
14911 FSPathMakeRef(
14912   const UInt8 * path,
14913   FSRef * ref,
14914   Boolean * isDirectory) ;
14915 typedef UInt32 FNMessage;
14916 enum {
14917   kFNDirectoryModifiedMessage = 1
14918 };
14919 extern OSStatus
14920 FNNotify(
14921   const FSRef * ref,
14922   FNMessage message,
14923   OptionBits flags) ;
14924 extern OSStatus
14925 FNNotifyByPath(
14926   const UInt8 * path,
14927   FNMessage message,
14928   OptionBits flags) ;
14929 extern OSStatus
14930 FNNotifyAll(
14931   FNMessage message,
14932   OptionBits flags) ;
14933 typedef struct OpaqueFNSubscriptionRef* FNSubscriptionRef;
14934
14935
14936
14937
14938
14939 enum {
14940
14941
14942
14943
14944
14945
14946
14947   kFNNoImplicitAllSubscription = (1 << 0)
14948 };
14949 typedef void ( * FNSubscriptionProcPtr)(FNMessage message, OptionBits flags, void *refcon, FNSubscriptionRef subscription);
14950 typedef FNSubscriptionProcPtr FNSubscriptionUPP;
14951 extern FNSubscriptionUPP
14952 NewFNSubscriptionUPP(FNSubscriptionProcPtr userRoutine) ;
14953 extern void
14954 DisposeFNSubscriptionUPP(FNSubscriptionUPP userUPP) ;
14955 extern void
14956 InvokeFNSubscriptionUPP(
14957   FNMessage message,
14958   OptionBits flags,
14959   void * refcon,
14960   FNSubscriptionRef subscription,
14961   FNSubscriptionUPP userUPP) ;
14962 extern OSStatus
14963 FNSubscribe(
14964   const FSRef * directoryRef,
14965   FNSubscriptionUPP callback,
14966   void * refcon,
14967   OptionBits flags,
14968   FNSubscriptionRef * subscription) ;
14969 extern OSStatus
14970 FNSubscribeByPath(
14971   const UInt8 * directoryPath,
14972   FNSubscriptionUPP callback,
14973   void * refcon,
14974   OptionBits flags,
14975   FNSubscriptionRef * subscription) ;
14976 extern OSStatus
14977 FNUnsubscribe(FNSubscriptionRef subscription) ;
14978 extern OSStatus
14979 FNGetDirectoryForSubscription(
14980   FNSubscriptionRef subscription,
14981   FSRef * ref) ;
14982
14983
14984
14985 enum {
14986   kAsyncMountInProgress = 1,
14987   kAsyncMountComplete = 2,
14988   kAsyncUnmountInProgress = 3,
14989   kAsyncUnmountComplete = 4,
14990   kAsyncEjectInProgress = 5,
14991   kAsyncEjectComplete = 6
14992 };
14993
14994 typedef UInt32 FSMountStatus;
14995 typedef UInt32 FSEjectStatus;
14996 typedef UInt32 FSUnmountStatus;
14997 typedef struct OpaqueFSVolumeOperation* FSVolumeOperation;
14998 typedef void ( * FSVolumeMountProcPtr)(FSVolumeOperation volumeOp, void *clientData, OSStatus err, FSVolumeRefNum mountedVolumeRefNum);
14999 typedef void ( * FSVolumeUnmountProcPtr)(FSVolumeOperation volumeOp, void *clientData, OSStatus err, FSVolumeRefNum volumeRefNum, pid_t dissenter);
15000 typedef void ( * FSVolumeEjectProcPtr)(FSVolumeOperation volumeOp, void *clientData, OSStatus err, FSVolumeRefNum volumeRefNum, pid_t dissenter);
15001 typedef FSVolumeMountProcPtr FSVolumeMountUPP;
15002 typedef FSVolumeUnmountProcPtr FSVolumeUnmountUPP;
15003 typedef FSVolumeEjectProcPtr FSVolumeEjectUPP;
15004 extern FSVolumeMountUPP
15005 NewFSVolumeMountUPP(FSVolumeMountProcPtr userRoutine) ;
15006 extern FSVolumeUnmountUPP
15007 NewFSVolumeUnmountUPP(FSVolumeUnmountProcPtr userRoutine) ;
15008 extern FSVolumeEjectUPP
15009 NewFSVolumeEjectUPP(FSVolumeEjectProcPtr userRoutine) ;
15010 extern void
15011 DisposeFSVolumeMountUPP(FSVolumeMountUPP userUPP) ;
15012 extern void
15013 DisposeFSVolumeUnmountUPP(FSVolumeUnmountUPP userUPP) ;
15014 extern void
15015 DisposeFSVolumeEjectUPP(FSVolumeEjectUPP userUPP) ;
15016 extern void
15017 InvokeFSVolumeMountUPP(
15018   FSVolumeOperation volumeOp,
15019   void * clientData,
15020   OSStatus err,
15021   FSVolumeRefNum mountedVolumeRefNum,
15022   FSVolumeMountUPP userUPP) ;
15023 extern void
15024 InvokeFSVolumeUnmountUPP(
15025   FSVolumeOperation volumeOp,
15026   void * clientData,
15027   OSStatus err,
15028   FSVolumeRefNum volumeRefNum,
15029   pid_t dissenter,
15030   FSVolumeUnmountUPP userUPP) ;
15031 extern void
15032 InvokeFSVolumeEjectUPP(
15033   FSVolumeOperation volumeOp,
15034   void * clientData,
15035   OSStatus err,
15036   FSVolumeRefNum volumeRefNum,
15037   pid_t dissenter,
15038   FSVolumeEjectUPP userUPP) ;
15039 extern OSStatus
15040 FSCreateVolumeOperation(FSVolumeOperation * volumeOp) ;
15041 extern OSStatus
15042 FSDisposeVolumeOperation(FSVolumeOperation volumeOp) ;
15043 extern OSStatus
15044 FSMountLocalVolumeSync(
15045   CFStringRef diskID,
15046   CFURLRef mountDir,
15047   FSVolumeRefNum * mountedVolumeRefNum,
15048   OptionBits flags) ;
15049 extern OSStatus
15050 FSMountLocalVolumeAsync(
15051   CFStringRef diskID,
15052   CFURLRef mountDir,
15053   FSVolumeOperation volumeOp,
15054   void * clientData,
15055   OptionBits flags,
15056   FSVolumeMountUPP callback,
15057   CFRunLoopRef runloop,
15058   CFStringRef runloopMode) ;
15059 extern OSStatus
15060 FSMountServerVolumeSync(
15061   CFURLRef url,
15062   CFURLRef mountDir,
15063   CFStringRef user,
15064   CFStringRef password,
15065   FSVolumeRefNum * mountedVolumeRefNum,
15066   OptionBits flags) ;
15067 extern OSStatus
15068 FSMountServerVolumeAsync(
15069   CFURLRef url,
15070   CFURLRef mountDir,
15071   CFStringRef user,
15072   CFStringRef password,
15073   FSVolumeOperation volumeOp,
15074   void * clientData,
15075   OptionBits flags,
15076   FSVolumeMountUPP callback,
15077   CFRunLoopRef runloop,
15078   CFStringRef runloopMode) ;
15079 extern OSStatus
15080 FSGetAsyncMountStatus(
15081   FSVolumeOperation volumeOp,
15082   FSMountStatus * status,
15083   OSStatus * volumeOpStatus,
15084   FSVolumeRefNum * mountedVolumeRefNum,
15085   void ** clientData) ;
15086 extern OSStatus
15087 FSUnmountVolumeSync(
15088   FSVolumeRefNum vRefNum,
15089   OptionBits flags,
15090   pid_t * dissenter) ;
15091 extern OSStatus
15092 FSUnmountVolumeAsync(
15093   FSVolumeRefNum vRefNum,
15094   OptionBits flags,
15095   FSVolumeOperation volumeOp,
15096   void * clientData,
15097   FSVolumeUnmountUPP callback,
15098   CFRunLoopRef runloop,
15099   CFStringRef runloopMode) ;
15100 extern OSStatus
15101 FSGetAsyncUnmountStatus(
15102   FSVolumeOperation volumeOp,
15103   FSUnmountStatus * status,
15104   OSStatus * volumeOpStatus,
15105   FSVolumeRefNum * volumeRefNum,
15106   pid_t * dissenter,
15107   void ** clientData) ;
15108 extern OSStatus
15109 FSCancelVolumeOperation(FSVolumeOperation volumeOp) ;
15110 extern OSStatus
15111 FSEjectVolumeSync(
15112   FSVolumeRefNum vRefNum,
15113   OptionBits flags,
15114   pid_t * dissenter) ;
15115 extern OSStatus
15116 FSEjectVolumeAsync(
15117   FSVolumeRefNum vRefNum,
15118   OptionBits flags,
15119   FSVolumeOperation volumeOp,
15120   void * clientData,
15121   FSVolumeEjectUPP callback,
15122   CFRunLoopRef runloop,
15123   CFStringRef runloopMode) ;
15124 extern OSStatus
15125 FSGetAsyncEjectStatus(
15126   FSVolumeOperation volumeOp,
15127   FSEjectStatus * status,
15128   OSStatus * volumeOpStatus,
15129   FSVolumeRefNum * volumeRefNum,
15130   pid_t * dissenter,
15131   void ** clientData) ;
15132 extern OSStatus
15133 FSCopyDiskIDForVolume(
15134   FSVolumeRefNum vRefNum,
15135   CFStringRef * diskID) ;
15136
15137
15138
15139
15140
15141
15142 }
15143 extern "C" {
15144
15145
15146
15147 enum {
15148   kAppleManufacturer = 'appl',
15149   kComponentResourceType = 'thng',
15150   kComponentAliasResourceType = 'thga'
15151 };
15152
15153 enum {
15154   kAnyComponentType = 0,
15155   kAnyComponentSubType = 0,
15156   kAnyComponentManufacturer = 0,
15157   kAnyComponentFlagsMask = 0
15158 };
15159
15160 enum {
15161   cmpIsMissing = 1L << 29,
15162   cmpWantsRegisterMessage = 1L << 31
15163 };
15164
15165 enum {
15166   kComponentOpenSelect = -1,
15167   kComponentCloseSelect = -2,
15168   kComponentCanDoSelect = -3,
15169   kComponentVersionSelect = -4,
15170   kComponentRegisterSelect = -5,
15171   kComponentTargetSelect = -6,
15172   kComponentUnregisterSelect = -7,
15173   kComponentGetMPWorkFunctionSelect = -8,
15174   kComponentExecuteWiredActionSelect = -9,
15175   kComponentGetPublicResourceSelect = -10
15176 };
15177
15178
15179 enum {
15180   componentDoAutoVersion = (1 << 0),
15181   componentWantsUnregister = (1 << 1),
15182   componentAutoVersionIncludeFlags = (1 << 2),
15183   componentHasMultiplePlatforms = (1 << 3),
15184   componentLoadResident = (1 << 4)
15185 };
15186
15187
15188
15189
15190 enum {
15191   defaultComponentIdentical = 0,
15192   defaultComponentAnyFlags = 1,
15193   defaultComponentAnyManufacturer = 2,
15194   defaultComponentAnySubType = 4,
15195   defaultComponentAnyFlagsAnyManufacturer = (defaultComponentAnyFlags + defaultComponentAnyManufacturer),
15196   defaultComponentAnyFlagsAnyManufacturerAnySubType = (defaultComponentAnyFlags + defaultComponentAnyManufacturer + defaultComponentAnySubType)
15197 };
15198
15199
15200 enum {
15201   registerComponentGlobal = 1,
15202   registerComponentNoDuplicates = 2,
15203   registerComponentAfterExisting = 4,
15204   registerComponentAliasesOnly = 8
15205 };
15206
15207
15208 struct ComponentDescription {
15209   OSType componentType;
15210   OSType componentSubType;
15211   OSType componentManufacturer;
15212   unsigned long componentFlags;
15213   unsigned long componentFlagsMask;
15214 };
15215 typedef struct ComponentDescription ComponentDescription;
15216
15217 struct ResourceSpec {
15218   OSType resType;
15219   short resID;
15220 };
15221 typedef struct ResourceSpec ResourceSpec;
15222 struct ComponentResource {
15223   ComponentDescription cd;
15224   ResourceSpec component;
15225   ResourceSpec componentName;
15226   ResourceSpec componentInfo;
15227   ResourceSpec componentIcon;
15228 };
15229 typedef struct ComponentResource ComponentResource;
15230 typedef ComponentResource * ComponentResourcePtr;
15231 typedef ComponentResourcePtr * ComponentResourceHandle;
15232 struct ComponentPlatformInfo {
15233   long componentFlags;
15234   ResourceSpec component;
15235   short platformType;
15236 };
15237 typedef struct ComponentPlatformInfo ComponentPlatformInfo;
15238 struct ComponentResourceExtension {
15239   long componentVersion;
15240   long componentRegisterFlags;
15241   short componentIconFamily;
15242 };
15243 typedef struct ComponentResourceExtension ComponentResourceExtension;
15244 struct ComponentPlatformInfoArray {
15245   long count;
15246   ComponentPlatformInfo platformArray[1];
15247 };
15248 typedef struct ComponentPlatformInfoArray ComponentPlatformInfoArray;
15249 struct ExtComponentResource {
15250   ComponentDescription cd;
15251   ResourceSpec component;
15252   ResourceSpec componentName;
15253   ResourceSpec componentInfo;
15254   ResourceSpec componentIcon;
15255   long componentVersion;
15256   long componentRegisterFlags;
15257   short componentIconFamily;
15258   long count;
15259   ComponentPlatformInfo platformArray[1];
15260 };
15261 typedef struct ExtComponentResource ExtComponentResource;
15262 typedef ExtComponentResource * ExtComponentResourcePtr;
15263 typedef ExtComponentResourcePtr * ExtComponentResourceHandle;
15264 struct ComponentAliasResource {
15265   ComponentResource cr;
15266   ComponentDescription aliasCD;
15267 };
15268 typedef struct ComponentAliasResource ComponentAliasResource;
15269
15270 struct ComponentParameters {
15271   UInt8 flags;
15272   UInt8 paramSize;
15273   short what;
15274   long params[1];
15275 };
15276 typedef struct ComponentParameters ComponentParameters;
15277 struct ComponentRecord {
15278   long data[1];
15279 };
15280 typedef struct ComponentRecord ComponentRecord;
15281 typedef ComponentRecord * Component;
15282 struct ComponentInstanceRecord {
15283   long data[1];
15284 };
15285 typedef struct ComponentInstanceRecord ComponentInstanceRecord;
15286 typedef ComponentInstanceRecord * ComponentInstance;
15287 struct RegisteredComponentRecord {
15288   long data[1];
15289 };
15290 typedef struct RegisteredComponentRecord RegisteredComponentRecord;
15291 typedef RegisteredComponentRecord * RegisteredComponentRecordPtr;
15292 struct RegisteredComponentInstanceRecord {
15293   long data[1];
15294 };
15295 typedef struct RegisteredComponentInstanceRecord RegisteredComponentInstanceRecord;
15296 typedef RegisteredComponentInstanceRecord * RegisteredComponentInstanceRecordPtr;
15297 typedef long ComponentResult;
15298 enum {
15299   platform68k = 1,
15300   platformPowerPC = 2,
15301   platformInterpreted = 3,
15302   platformWin32 = 4,
15303   platformPowerPCNativeEntryPoint = 5
15304 };
15305
15306 enum {
15307   platformIRIXmips = 1000,
15308   platformSunOSsparc = 1100,
15309   platformSunOSintel = 1101,
15310   platformLinuxppc = 1200,
15311   platformLinuxintel = 1201,
15312   platformAIXppc = 1300,
15313   platformNeXTIntel = 1400,
15314   platformNeXTppc = 1401,
15315   platformNeXTsparc = 1402,
15316   platformNeXT68k = 1403,
15317   platformMacOSx86 = 1500
15318 };
15319
15320 enum {
15321   mpWorkFlagDoWork = (1 << 0),
15322   mpWorkFlagDoCompletion = (1 << 1),
15323   mpWorkFlagCopyWorkBlock = (1 << 2),
15324   mpWorkFlagDontBlock = (1 << 3),
15325   mpWorkFlagGetProcessorCount = (1 << 4),
15326   mpWorkFlagGetIsRunning = (1 << 6)
15327 };
15328
15329 enum {
15330   cmpAliasNoFlags = 0,
15331   cmpAliasOnlyThisFile = 1
15332 };
15333
15334 struct ComponentMPWorkFunctionHeaderRecord {
15335   UInt32 headerSize;
15336   UInt32 recordSize;
15337   UInt32 workFlags;
15338   UInt16 processorCount;
15339   UInt8 unused;
15340   UInt8 isRunning;
15341 };
15342 typedef struct ComponentMPWorkFunctionHeaderRecord ComponentMPWorkFunctionHeaderRecord;
15343 typedef ComponentMPWorkFunctionHeaderRecord * ComponentMPWorkFunctionHeaderRecordPtr;
15344 typedef ComponentResult ( * ComponentMPWorkFunctionProcPtr)(void *globalRefCon, ComponentMPWorkFunctionHeaderRecordPtr header);
15345 typedef ComponentResult ( * ComponentRoutineProcPtr)(ComponentParameters *cp, Handle componentStorage);
15346 typedef OSErr ( * GetMissingComponentResourceProcPtr)(Component c, OSType resType, short resID, void *refCon, Handle *resource);
15347 typedef ComponentMPWorkFunctionProcPtr ComponentMPWorkFunctionUPP;
15348 typedef ComponentRoutineProcPtr ComponentRoutineUPP;
15349 typedef GetMissingComponentResourceProcPtr GetMissingComponentResourceUPP;
15350
15351
15352
15353
15354
15355 typedef UniversalProcPtr ComponentFunctionUPP;
15356 extern ComponentFunctionUPP
15357 NewComponentFunctionUPP(
15358   ProcPtr userRoutine,
15359   ProcInfoType procInfo) ;
15360 extern void
15361 DisposeComponentFunctionUPP(ComponentFunctionUPP userUPP) ;
15362 extern Component
15363 RegisterComponent(
15364   ComponentDescription * cd,
15365   ComponentRoutineUPP componentEntryPoint,
15366   short global,
15367   Handle componentName,
15368   Handle componentInfo,
15369   Handle componentIcon) ;
15370 extern Component
15371 RegisterComponentResource(
15372   ComponentResourceHandle cr,
15373   short global) ;
15374 extern OSErr
15375 UnregisterComponent(Component aComponent) ;
15376 extern Component
15377 FindNextComponent(
15378   Component aComponent,
15379   ComponentDescription * looking) ;
15380 extern long
15381 CountComponents(ComponentDescription * looking) ;
15382 extern OSErr
15383 GetComponentInfo(
15384   Component aComponent,
15385   ComponentDescription * cd,
15386   Handle componentName,
15387   Handle componentInfo,
15388   Handle componentIcon) ;
15389 extern long
15390 GetComponentListModSeed(void) ;
15391 extern long
15392 GetComponentTypeModSeed(OSType componentType) ;
15393 extern OSErr
15394 OpenAComponent(
15395   Component aComponent,
15396   ComponentInstance * ci) ;
15397 extern ComponentInstance
15398 OpenComponent(Component aComponent) ;
15399 extern OSErr
15400 CloseComponent(ComponentInstance aComponentInstance) ;
15401 extern OSErr
15402 GetComponentInstanceError(ComponentInstance aComponentInstance) ;
15403 extern Component
15404 ResolveComponentAlias(Component aComponent) ;
15405 extern OSErr
15406 GetComponentPublicResource(
15407   Component aComponent,
15408   OSType resourceType,
15409   short resourceID,
15410   Handle * theResource) ;
15411 extern OSErr
15412 GetComponentPublicResourceList(
15413   OSType resourceType,
15414   short resourceID,
15415   long flags,
15416   ComponentDescription * cd,
15417   GetMissingComponentResourceUPP missingProc,
15418   void * refCon,
15419   void * atomContainerPtr) ;
15420 extern OSErr
15421 GetComponentPublicIndString(
15422   Component aComponent,
15423   Str255 theString,
15424   short strListID,
15425   short index) ;
15426 extern void
15427 SetComponentInstanceError(
15428   ComponentInstance aComponentInstance,
15429   OSErr theError) ;
15430 extern long
15431 GetComponentRefcon(Component aComponent) ;
15432 extern void
15433 SetComponentRefcon(
15434   Component aComponent,
15435   long theRefcon) ;
15436 extern short
15437 OpenComponentResFile(Component aComponent) ;
15438 extern OSErr
15439 OpenAComponentResFile(
15440   Component aComponent,
15441   short * resRef) ;
15442 extern OSErr
15443 CloseComponentResFile(short refnum) ;
15444 extern OSErr
15445 GetComponentResource(
15446   Component aComponent,
15447   OSType resType,
15448   short resID,
15449   Handle * theResource) ;
15450 extern OSErr
15451 GetComponentIndString(
15452   Component aComponent,
15453   Str255 theString,
15454   short strListID,
15455   short index) ;
15456 extern Handle
15457 GetComponentInstanceStorage(ComponentInstance aComponentInstance) ;
15458 extern void
15459 SetComponentInstanceStorage(
15460   ComponentInstance aComponentInstance,
15461   Handle theStorage) ;
15462 extern long
15463 CountComponentInstances(Component aComponent) ;
15464 extern long
15465 CallComponentFunction(
15466   ComponentParameters * params,
15467   ComponentFunctionUPP func) ;
15468 extern long
15469 CallComponentFunctionWithStorage(
15470   Handle storage,
15471   ComponentParameters * params,
15472   ComponentFunctionUPP func) ;
15473 extern long
15474 CallComponentFunctionWithStorageProcInfo(
15475   Handle storage,
15476   ComponentParameters * params,
15477   ProcPtr func,
15478   ProcInfoType funcProcInfo) ;
15479 extern long
15480 DelegateComponentCall(
15481   ComponentParameters * originalParams,
15482   ComponentInstance ci) ;
15483 extern OSErr
15484 SetDefaultComponent(
15485   Component aComponent,
15486   short flags) ;
15487 extern ComponentInstance
15488 OpenDefaultComponent(
15489   OSType componentType,
15490   OSType componentSubType) ;
15491 extern OSErr
15492 OpenADefaultComponent(
15493   OSType componentType,
15494   OSType componentSubType,
15495   ComponentInstance * ci) ;
15496 extern Component
15497 CaptureComponent(
15498   Component capturedComponent,
15499   Component capturingComponent) ;
15500 extern OSErr
15501 UncaptureComponent(Component aComponent) ;
15502 extern long
15503 RegisterComponentResourceFile(
15504   short resRefNum,
15505   short global) ;
15506 extern OSErr
15507 GetComponentIconSuite(
15508   Component aComponent,
15509   Handle * iconSuite) ;
15510 extern OSErr
15511 RegisterComponentFile(
15512   const FSSpec * spec,
15513   short global) ;
15514 extern OSErr
15515 RegisterComponentFileEntries(
15516   const FSSpec * spec,
15517   short global,
15518   const ComponentDescription * toRegister,
15519   UInt32 registerCount) ;
15520 extern OSErr
15521 RegisterComponentFileRef(
15522   const FSRef * ref,
15523   short global) ;
15524 extern OSErr
15525 RegisterComponentFileRefEntries(
15526   const FSRef * ref,
15527   short global,
15528   const ComponentDescription * toRegister,
15529   UInt32 registerCount) ;
15530 extern long
15531 ComponentFunctionImplemented(
15532   ComponentInstance ci,
15533   short ftnNumber) ;
15534 extern long
15535 GetComponentVersion(ComponentInstance ci) ;
15536 extern long
15537 ComponentSetTarget(
15538   ComponentInstance ci,
15539   ComponentInstance target) ;
15540 extern ComponentResult
15541 CallComponentOpen(
15542   ComponentInstance ci,
15543   ComponentInstance self) ;
15544 extern ComponentResult
15545 CallComponentClose(
15546   ComponentInstance ci,
15547   ComponentInstance self) ;
15548 extern ComponentResult
15549 CallComponentCanDo(
15550   ComponentInstance ci,
15551   short ftnNumber) ;
15552 extern ComponentResult
15553 CallComponentVersion(ComponentInstance ci) ;
15554 extern ComponentResult
15555 CallComponentRegister(ComponentInstance ci) ;
15556 extern ComponentResult
15557 CallComponentTarget(
15558   ComponentInstance ci,
15559   ComponentInstance target) ;
15560 extern ComponentResult
15561 CallComponentUnregister(ComponentInstance ci) ;
15562 extern ComponentResult
15563 CallComponentGetMPWorkFunction(
15564   ComponentInstance ci,
15565   ComponentMPWorkFunctionUPP * workFunction,
15566   void ** refCon) ;
15567 extern ComponentResult
15568 CallComponentGetPublicResource(
15569   ComponentInstance ci,
15570   OSType resourceType,
15571   short resourceID,
15572   Handle * resource) ;
15573 extern ComponentResult
15574 CallComponentDispatch(ComponentParameters * cp) ;
15575 extern ComponentMPWorkFunctionUPP
15576 NewComponentMPWorkFunctionUPP(ComponentMPWorkFunctionProcPtr userRoutine) ;
15577 extern ComponentRoutineUPP
15578 NewComponentRoutineUPP(ComponentRoutineProcPtr userRoutine) ;
15579 extern GetMissingComponentResourceUPP
15580 NewGetMissingComponentResourceUPP(GetMissingComponentResourceProcPtr userRoutine) ;
15581 extern void
15582 DisposeComponentMPWorkFunctionUPP(ComponentMPWorkFunctionUPP userUPP) ;
15583 extern void
15584 DisposeComponentRoutineUPP(ComponentRoutineUPP userUPP) ;
15585 extern void
15586 DisposeGetMissingComponentResourceUPP(GetMissingComponentResourceUPP userUPP) ;
15587 extern ComponentResult
15588 InvokeComponentMPWorkFunctionUPP(
15589   void * globalRefCon,
15590   ComponentMPWorkFunctionHeaderRecordPtr header,
15591   ComponentMPWorkFunctionUPP userUPP) ;
15592 extern ComponentResult
15593 InvokeComponentRoutineUPP(
15594   ComponentParameters * cp,
15595   Handle componentStorage,
15596   ComponentRoutineUPP userUPP) ;
15597 extern OSErr
15598 InvokeGetMissingComponentResourceUPP(
15599   Component c,
15600   OSType resType,
15601   short resID,
15602   void * refCon,
15603   Handle * resource,
15604   GetMissingComponentResourceUPP userUPP) ;
15605
15606
15607
15608
15609 enum {
15610     uppComponentFunctionImplementedProcInfo = 0x000002F0,
15611     uppGetComponentVersionProcInfo = 0x000000F0,
15612     uppComponentSetTargetProcInfo = 0x000003F0,
15613     uppCallComponentOpenProcInfo = 0x000003F0,
15614     uppCallComponentCloseProcInfo = 0x000003F0,
15615     uppCallComponentCanDoProcInfo = 0x000002F0,
15616     uppCallComponentVersionProcInfo = 0x000000F0,
15617     uppCallComponentRegisterProcInfo = 0x000000F0,
15618     uppCallComponentTargetProcInfo = 0x000003F0,
15619     uppCallComponentUnregisterProcInfo = 0x000000F0,
15620     uppCallComponentGetMPWorkFunctionProcInfo = 0x00000FF0,
15621     uppCallComponentGetPublicResourceProcInfo = 0x00003BF0
15622 };
15623
15624
15625
15626
15627
15628
15629
15630
15631
15632 }
15633 extern "C" {
15634
15635
15636
15637 enum {
15638   resSysHeap = 64,
15639   resPurgeable = 32,
15640   resLocked = 16,
15641   resProtected = 8,
15642   resPreload = 4,
15643   resChanged = 2,
15644   mapReadOnly = 128,
15645   mapCompact = 64,
15646   mapChanged = 32
15647 };
15648
15649 enum {
15650   resSysRefBit = 7,
15651   resSysHeapBit = 6,
15652   resPurgeableBit = 5,
15653   resLockedBit = 4,
15654   resProtectedBit = 3,
15655   resPreloadBit = 2,
15656   resChangedBit = 1,
15657   mapReadOnlyBit = 7,
15658   mapCompactBit = 6,
15659   mapChangedBit = 5
15660 };
15661
15662 enum {
15663   kResFileNotOpened = -1,
15664   kSystemResFile = 0
15665 };
15666
15667
15668 typedef void ( * ResErrProcPtr)(OSErr thErr);
15669 typedef ResErrProcPtr ResErrUPP;
15670 extern ResErrUPP
15671 NewResErrUPP(ResErrProcPtr userRoutine) ;
15672 extern void
15673 DisposeResErrUPP(ResErrUPP userUPP) ;
15674 extern void
15675 InvokeResErrUPP(
15676   OSErr thErr,
15677   ResErrUPP userUPP) ;
15678
15679
15680 typedef OSErr ( * ResourceEndianFilterPtr)(Handle theResource, Boolean currentlyNativeEndian);
15681 extern void
15682 CloseResFile(short refNum) ;
15683 extern OSErr
15684 ResError(void) ;
15685 extern short
15686 CurResFile(void) ;
15687 extern short
15688 HomeResFile(Handle theResource) ;
15689 extern void
15690 UseResFile(short refNum) ;
15691 extern short
15692 CountTypes(void) ;
15693 extern short
15694 Count1Types(void) ;
15695 extern void
15696 GetIndType(
15697   ResType * theType,
15698   short index) ;
15699 extern void
15700 Get1IndType(
15701   ResType * theType,
15702   short index) ;
15703 extern void
15704 SetResLoad(Boolean load) ;
15705 extern short
15706 CountResources(ResType theType) ;
15707 extern short
15708 Count1Resources(ResType theType) ;
15709 extern Handle
15710 GetIndResource(
15711   ResType theType,
15712   short index) ;
15713 extern Handle
15714 Get1IndResource(
15715   ResType theType,
15716   short index) ;
15717 extern Handle
15718 GetResource(
15719   ResType theType,
15720   short theID) ;
15721 extern Handle
15722 Get1Resource(
15723   ResType theType,
15724   short theID) ;
15725 extern Handle
15726 GetNamedResource(
15727   ResType theType,
15728   ConstStr255Param name) ;
15729 extern Handle
15730 Get1NamedResource(
15731   ResType theType,
15732   ConstStr255Param name) ;
15733 extern void
15734 LoadResource(Handle theResource) ;
15735 extern void
15736 ReleaseResource(Handle theResource) ;
15737 extern void
15738 DetachResource(Handle theResource) ;
15739 extern short
15740 UniqueID(ResType theType) ;
15741 extern short
15742 Unique1ID(ResType theType) ;
15743 extern short
15744 GetResAttrs(Handle theResource) ;
15745 extern void
15746 GetResInfo(
15747   Handle theResource,
15748   short * theID,
15749   ResType * theType,
15750   Str255 name) ;
15751 extern void
15752 SetResInfo(
15753   Handle theResource,
15754   short theID,
15755   ConstStr255Param name) ;
15756 extern void
15757 AddResource(
15758   Handle theData,
15759   ResType theType,
15760   short theID,
15761   ConstStr255Param name) ;
15762 extern long
15763 GetResourceSizeOnDisk(Handle theResource) ;
15764 extern long
15765 GetMaxResourceSize(Handle theResource) ;
15766 extern void
15767 SetResAttrs(
15768   Handle theResource,
15769   short attrs) ;
15770 extern void
15771 ChangedResource(Handle theResource) ;
15772 extern void
15773 RemoveResource(Handle theResource) ;
15774 extern void
15775 UpdateResFile(short refNum) ;
15776 extern void
15777 WriteResource(Handle theResource) ;
15778 extern void
15779 SetResPurge(Boolean install) ;
15780 extern short
15781 GetResFileAttrs(short refNum) ;
15782 extern void
15783 SetResFileAttrs(
15784   short refNum,
15785   short attrs) ;
15786 extern short
15787 OpenRFPerm(
15788   ConstStr255Param fileName,
15789   short vRefNum,
15790   SInt8 permission) ;
15791 extern short
15792 HOpenResFile(
15793   short vRefNum,
15794   long dirID,
15795   ConstStr255Param fileName,
15796   SInt8 permission) ;
15797 extern void
15798 HCreateResFile(
15799   short vRefNum,
15800   long dirID,
15801   ConstStr255Param fileName) ;
15802 extern short
15803 FSpOpenResFile(
15804   const FSSpec * spec,
15805   SignedByte permission) ;
15806 extern void
15807 FSpCreateResFile(
15808   const FSSpec * spec,
15809   OSType creator,
15810   OSType fileType,
15811   ScriptCode scriptTag) ;
15812 extern void
15813 ReadPartialResource(
15814   Handle theResource,
15815   long offset,
15816   void * buffer,
15817   long count) ;
15818 extern void
15819 WritePartialResource(
15820   Handle theResource,
15821   long offset,
15822   const void * buffer,
15823   long count) ;
15824 extern void
15825 SetResourceSize(
15826   Handle theResource,
15827   long newSize) ;
15828 extern Handle
15829 GetNextFOND(Handle fondHandle) ;
15830 typedef SInt16 RsrcChainLocation;
15831 enum {
15832   kRsrcChainBelowSystemMap = 0,
15833   kRsrcChainBelowApplicationMap = 1,
15834   kRsrcChainAboveApplicationMap = 2,
15835   kRsrcChainAboveAllMaps = 4
15836 };
15837 extern OSErr
15838 InsertResourceFile(
15839   SInt16 refNum,
15840   RsrcChainLocation where) ;
15841 extern OSErr
15842 DetachResourceFile(SInt16 refNum) ;
15843 extern Boolean
15844 FSpResourceFileAlreadyOpen(
15845   const FSSpec * resourceFile,
15846   Boolean * inChain,
15847   SInt16 * refNum) ;
15848 extern OSErr
15849 FSpOpenOrphanResFile(
15850   const FSSpec * spec,
15851   SignedByte permission,
15852   SInt16 * refNum) ;
15853 extern OSErr
15854 GetTopResourceFile(SInt16 * refNum) ;
15855 extern OSErr
15856 GetNextResourceFile(
15857   SInt16 curRefNum,
15858   SInt16 * nextRefNum) ;
15859 extern short
15860 FSOpenResFile(
15861   const FSRef * ref,
15862   SInt8 permission) ;
15863 extern void
15864 FSCreateResFile(
15865   const FSRef * parentRef,
15866   UniCharCount nameLength,
15867   const UniChar * name,
15868   FSCatalogInfoBitmap whichInfo,
15869   const FSCatalogInfo * catalogInfo,
15870   FSRef * newRef,
15871   FSSpec * newSpec) ;
15872 extern Boolean
15873 FSResourceFileAlreadyOpen(
15874   const FSRef * resourceFileRef,
15875   Boolean * inChain,
15876   SInt16 * refNum) ;
15877 extern OSErr
15878 FSCreateResourceFile(
15879   const FSRef * parentRef,
15880   UniCharCount nameLength,
15881   const UniChar * name,
15882   FSCatalogInfoBitmap whichInfo,
15883   const FSCatalogInfo * catalogInfo,
15884   UniCharCount forkNameLength,
15885   const UniChar * forkName,
15886   FSRef * newRef,
15887   FSSpec * newSpec) ;
15888 extern OSErr
15889 FSCreateResourceFork(
15890   const FSRef * ref,
15891   UniCharCount forkNameLength,
15892   const UniChar * forkName,
15893   UInt32 flags) ;
15894 extern OSErr
15895 FSOpenResourceFile(
15896   const FSRef * ref,
15897   UniCharCount forkNameLength,
15898   const UniChar * forkName,
15899   SInt8 permissions,
15900   SInt16 * refNum) ;
15901
15902
15903
15904
15905
15906 typedef short ResFileRefNum;
15907 typedef short ResID;
15908 typedef short ResAttributes;
15909 typedef short ResFileAttributes;
15910 }
15911
15912
15913
15914 extern "C" {
15915
15916
15917 enum {
15918   MPLibrary_MajorVersion = 2,
15919   MPLibrary_MinorVersion = 3,
15920   MPLibrary_Release = 1,
15921   MPLibrary_DevelopmentRevision = 1
15922 };
15923
15924
15925
15926 typedef struct OpaqueMPProcessID* MPProcessID;
15927 typedef struct OpaqueMPTaskID* MPTaskID;
15928 typedef struct OpaqueMPQueueID* MPQueueID;
15929 typedef struct OpaqueMPSemaphoreID* MPSemaphoreID;
15930 typedef struct OpaqueMPCriticalRegionID* MPCriticalRegionID;
15931 typedef struct OpaqueMPTimerID* MPTimerID;
15932 typedef struct OpaqueMPEventID* MPEventID;
15933 typedef struct OpaqueMPAddressSpaceID* MPAddressSpaceID;
15934 typedef struct OpaqueMPNotificationID* MPNotificationID;
15935 typedef struct OpaqueMPCoherenceID* MPCoherenceID;
15936 typedef struct OpaqueMPCpuID* MPCpuID;
15937 typedef struct OpaqueMPAreaID* MPAreaID;
15938 typedef struct OpaqueMPConsoleID* MPConsoleID;
15939 typedef struct OpaqueMPOpaqueID* MPOpaqueID;
15940 enum {
15941
15942   kOpaqueAnyID = 0,
15943   kOpaqueProcessID = 1,
15944   kOpaqueTaskID = 2,
15945   kOpaqueTimerID = 3,
15946   kOpaqueQueueID = 4,
15947   kOpaqueSemaphoreID = 5,
15948   kOpaqueCriticalRegionID = 6,
15949   kOpaqueCpuID = 7,
15950   kOpaqueAddressSpaceID = 8,
15951   kOpaqueEventID = 9,
15952   kOpaqueCoherenceID = 10,
15953   kOpaqueAreaID = 11,
15954   kOpaqueNotificationID = 12,
15955   kOpaqueConsoleID = 13
15956 };
15957
15958 typedef UInt32 MPOpaqueIDClass;
15959
15960 enum {
15961   kMPNoID = 0
15962 };
15963
15964
15965 typedef OptionBits MPTaskOptions;
15966 typedef UInt32 TaskStorageIndex;
15967 typedef UInt32 TaskStorageValue;
15968 typedef ItemCount MPSemaphoreCount;
15969 typedef UInt32 MPTaskWeight;
15970 typedef UInt32 MPEventFlags;
15971 typedef UInt32 MPExceptionKind;
15972 typedef UInt32 MPTaskStateKind;
15973 typedef UInt32 MPPageSizeClass;
15974
15975 enum {
15976   kDurationImmediate = 0L,
15977   kDurationForever = 0x7FFFFFFF,
15978   kDurationMillisecond = 1,
15979   kDurationMicrosecond = -1
15980 };
15981 extern ItemCount
15982 MPProcessors(void) ;
15983 extern ItemCount
15984 MPProcessorsScheduled(void) ;
15985 enum {
15986
15987   kMPCreateTaskSuspendedMask = 1L << 0,
15988   kMPCreateTaskTakesAllExceptionsMask = 1L << 1,
15989   kMPCreateTaskNotDebuggableMask = 1L << 2,
15990   kMPCreateTaskValidOptionsMask = kMPCreateTaskSuspendedMask | kMPCreateTaskTakesAllExceptionsMask | kMPCreateTaskNotDebuggableMask
15991 };
15992
15993
15994
15995
15996
15997
15998
15999 typedef OSStatus ( * TaskProc)(void * parameter);
16000 extern OSStatus
16001 MPCreateTask(
16002   TaskProc entryPoint,
16003   void * parameter,
16004   ByteCount stackSize,
16005   MPQueueID notifyQueue,
16006   void * terminationParameter1,
16007   void * terminationParameter2,
16008   MPTaskOptions options,
16009   MPTaskID * task) ;
16010 extern OSStatus
16011 MPTerminateTask(
16012   MPTaskID task,
16013   OSStatus terminationStatus) ;
16014 extern OSStatus
16015 MPSetTaskWeight(
16016   MPTaskID task,
16017   MPTaskWeight weight) ;
16018 extern Boolean
16019 MPTaskIsPreemptive(MPTaskID taskID) ;
16020 extern void
16021 MPExit(OSStatus status) ;
16022 extern void
16023 MPYield(void) ;
16024 extern MPTaskID
16025 MPCurrentTaskID(void) ;
16026 extern OSStatus
16027 MPSetTaskType(
16028   MPTaskID task,
16029   OSType taskType) ;
16030 extern OSStatus
16031 MPAllocateTaskStorageIndex(TaskStorageIndex * index) ;
16032 extern OSStatus
16033 MPDeallocateTaskStorageIndex(TaskStorageIndex index) ;
16034 extern OSStatus
16035 MPSetTaskStorageValue(
16036   TaskStorageIndex index,
16037   TaskStorageValue value) ;
16038 extern TaskStorageValue
16039 MPGetTaskStorageValue(TaskStorageIndex index) ;
16040 extern OSStatus
16041 MPCreateQueue(MPQueueID * queue) ;
16042 extern OSStatus
16043 MPDeleteQueue(MPQueueID queue) ;
16044 extern OSStatus
16045 MPNotifyQueue(
16046   MPQueueID queue,
16047   void * param1,
16048   void * param2,
16049   void * param3) ;
16050 extern OSStatus
16051 MPWaitOnQueue(
16052   MPQueueID queue,
16053   void ** param1,
16054   void ** param2,
16055   void ** param3,
16056   Duration timeout) ;
16057 extern OSStatus
16058 MPSetQueueReserve(
16059   MPQueueID queue,
16060   ItemCount count) ;
16061 extern OSStatus
16062 MPCreateSemaphore(
16063   MPSemaphoreCount maximumValue,
16064   MPSemaphoreCount initialValue,
16065   MPSemaphoreID * semaphore) ;
16066 extern OSStatus
16067 MPDeleteSemaphore(MPSemaphoreID semaphore) ;
16068 extern OSStatus
16069 MPSignalSemaphore(MPSemaphoreID semaphore) ;
16070 extern OSStatus
16071 MPWaitOnSemaphore(
16072   MPSemaphoreID semaphore,
16073   Duration timeout) ;
16074 extern OSStatus
16075 MPCreateCriticalRegion(MPCriticalRegionID * criticalRegion) ;
16076 extern OSStatus
16077 MPDeleteCriticalRegion(MPCriticalRegionID criticalRegion) ;
16078 extern OSStatus
16079 MPEnterCriticalRegion(
16080   MPCriticalRegionID criticalRegion,
16081   Duration timeout) ;
16082 extern OSStatus
16083 MPExitCriticalRegion(MPCriticalRegionID criticalRegion) ;
16084 extern OSStatus
16085 MPCreateEvent(MPEventID * event) ;
16086 extern OSStatus
16087 MPDeleteEvent(MPEventID event) ;
16088 extern OSStatus
16089 MPSetEvent(
16090   MPEventID event,
16091   MPEventFlags flags) ;
16092 extern OSStatus
16093 MPWaitForEvent(
16094   MPEventID event,
16095   MPEventFlags * flags,
16096   Duration timeout) ;
16097 extern OSStatus
16098 MPCreateNotification(MPNotificationID * notificationID) ;
16099 extern OSStatus
16100 MPDeleteNotification(MPNotificationID notificationID) ;
16101 extern OSStatus
16102 MPModifyNotification(
16103   MPNotificationID notificationID,
16104   MPOpaqueID anID,
16105   void * notifyParam1,
16106   void * notifyParam2,
16107   void * notifyParam3) ;
16108 extern OSStatus
16109 MPModifyNotificationParameters(
16110   MPNotificationID notificationID,
16111   MPOpaqueIDClass kind,
16112   void * notifyParam1,
16113   void * notifyParam2,
16114   void * notifyParam3) ;
16115 extern OSStatus
16116 MPCauseNotification(MPNotificationID notificationID) ;
16117 enum {
16118
16119   kMPPreserveTimerIDMask = 1L << 0,
16120   kMPTimeIsDeltaMask = 1L << 1,
16121   kMPTimeIsDurationMask = 1L << 2
16122 };
16123 extern OSStatus
16124 MPDelayUntil(AbsoluteTime * expirationTime) ;
16125 extern OSStatus
16126 MPCreateTimer(MPTimerID * timerID) ;
16127 extern OSStatus
16128 MPDeleteTimer(MPTimerID timerID) ;
16129 extern OSStatus
16130 MPSetTimerNotify(
16131   MPTimerID timerID,
16132   MPOpaqueID anID,
16133   void * notifyParam1,
16134   void * notifyParam2,
16135   void * notifyParam3) ;
16136 extern OSStatus
16137 MPArmTimer(
16138   MPTimerID timerID,
16139   AbsoluteTime * expirationTime,
16140   OptionBits options) ;
16141 extern OSStatus
16142 MPCancelTimer(
16143   MPTimerID timerID,
16144   AbsoluteTime * timeRemaining) ;
16145 enum {
16146
16147   kMPMaxAllocSize = 1024L * 1024 * 1024
16148 };
16149
16150 enum {
16151
16152   kMPAllocateDefaultAligned = 0,
16153   kMPAllocate8ByteAligned = 3,
16154   kMPAllocate16ByteAligned = 4,
16155   kMPAllocate32ByteAligned = 5,
16156   kMPAllocate1024ByteAligned = 10,
16157   kMPAllocate4096ByteAligned = 12,
16158   kMPAllocateMaxAlignment = 16,
16159   kMPAllocateAltiVecAligned = kMPAllocate16ByteAligned,
16160   kMPAllocateVMXAligned = kMPAllocateAltiVecAligned,
16161   kMPAllocateVMPageAligned = 254,
16162   kMPAllocateInterlockAligned = 255
16163 };
16164
16165
16166
16167 enum {
16168
16169   kMPAllocateClearMask = 0x0001,
16170   kMPAllocateGloballyMask = 0x0002,
16171   kMPAllocateResidentMask = 0x0004,
16172   kMPAllocateNoGrowthMask = 0x0010,
16173   kMPAllocateNoCreateMask = 0x0020
16174 };
16175 extern LogicalAddress
16176 MPAllocateAligned(
16177   ByteCount size,
16178   UInt8 alignment,
16179   OptionBits options) ;
16180 extern LogicalAddress
16181 MPAllocate(ByteCount size) ;
16182 extern void
16183 MPFree(LogicalAddress object) ;
16184 extern ByteCount
16185 MPGetAllocatedBlockSize(LogicalAddress object) ;
16186 extern void
16187 MPBlockCopy(
16188   LogicalAddress source,
16189   LogicalAddress destination,
16190   ByteCount size) ;
16191 extern void
16192 MPBlockClear(
16193   LogicalAddress address,
16194   ByteCount size) ;
16195 extern void
16196 MPDataToCode(
16197   LogicalAddress address,
16198   ByteCount size) ;
16199 enum {
16200
16201   kMPTaskStateRegisters = 0,
16202   kMPTaskStateFPU = 1,
16203   kMPTaskStateVectors = 2,
16204   kMPTaskStateMachine = 3,
16205   kMPTaskState32BitMemoryException = 4,
16206   kMPTaskStateTaskInfo = 5
16207 };
16208
16209
16210
16211 enum {
16212
16213   kMPTaskPropagate = 0,
16214   kMPTaskResumeStep = 1,
16215   kMPTaskResumeBranch = 2,
16216   kMPTaskResumeMask = 0x0000,
16217   kMPTaskPropagateMask = 1 << kMPTaskPropagate,
16218   kMPTaskResumeStepMask = 1 << kMPTaskResumeStep,
16219   kMPTaskResumeBranchMask = 1 << kMPTaskResumeBranch
16220 };
16221
16222
16223
16224 enum {
16225
16226   kMPTaskBlocked = 0,
16227   kMPTaskReady = 1,
16228   kMPTaskRunning = 2
16229 };
16230
16231 enum {
16232
16233   kMPTaskInfoVersion = 3
16234 };
16235
16236
16237 struct MPTaskInfoVersion2 {
16238   PBVersion version;
16239
16240   OSType name;
16241
16242   OSType queueName;
16243   UInt16 runState;
16244   UInt16 lastCPU;
16245   UInt32 weight;
16246
16247   MPProcessID processID;
16248
16249   AbsoluteTime cpuTime;
16250   AbsoluteTime schedTime;
16251   AbsoluteTime creationTime;
16252
16253   ItemCount codePageFaults;
16254   ItemCount dataPageFaults;
16255   ItemCount preemptions;
16256
16257   MPCpuID cpuID;
16258 };
16259 typedef struct MPTaskInfoVersion2 MPTaskInfoVersion2;
16260 struct MPTaskInfo {
16261   PBVersion version;
16262
16263   OSType name;
16264
16265   OSType queueName;
16266   UInt16 runState;
16267   UInt16 lastCPU;
16268   UInt32 weight;
16269
16270   MPProcessID processID;
16271
16272   AbsoluteTime cpuTime;
16273   AbsoluteTime schedTime;
16274   AbsoluteTime creationTime;
16275
16276   ItemCount codePageFaults;
16277   ItemCount dataPageFaults;
16278   ItemCount preemptions;
16279
16280   MPCpuID cpuID;
16281   MPOpaqueID blockedObject;
16282   MPAddressSpaceID spaceID;
16283
16284   LogicalAddress stackBase;
16285   LogicalAddress stackLimit;
16286   LogicalAddress stackCurr;
16287 };
16288 typedef struct MPTaskInfo MPTaskInfo;
16289 extern OSStatus
16290 MPSetExceptionHandler(
16291   MPTaskID task,
16292   MPQueueID exceptionQ) ;
16293 extern OSStatus
16294 MPDisposeTaskException(
16295   MPTaskID task,
16296   OptionBits action) ;
16297 extern OSStatus
16298 MPExtractTaskState(
16299   MPTaskID task,
16300   MPTaskStateKind kind,
16301   void * info) ;
16302 extern OSStatus
16303 MPSetTaskState(
16304   MPTaskID task,
16305   MPTaskStateKind kind,
16306   void * info) ;
16307 extern OSStatus
16308 MPThrowException(
16309   MPTaskID task,
16310   MPExceptionKind kind) ;
16311
16312
16313
16314
16315
16316
16317 typedef UInt32 MPDebuggerLevel;
16318 enum {
16319   kMPLowLevelDebugger = 0x00000000,
16320   kMPMidLevelDebugger = 0x10000000,
16321   kMPHighLevelDebugger = 0x20000000
16322 };
16323 extern OSStatus
16324 MPRegisterDebugger(
16325   MPQueueID queue,
16326   MPDebuggerLevel level) ;
16327 extern OSStatus
16328 MPUnregisterDebugger(MPQueueID queue) ;
16329 typedef void * ( * MPRemoteProcedure)(void * parameter);
16330
16331 typedef UInt8 MPRemoteContext;
16332 enum {
16333   kMPAnyRemoteContext = 0,
16334   kMPOwningProcessRemoteContext = 1,
16335   kMPInterruptRemoteContext = 2,
16336   kMPAsyncInterruptRemoteContext = 3
16337 };
16338 extern void *
16339 MPRemoteCall(
16340   MPRemoteProcedure remoteProc,
16341   void * parameter,
16342   MPRemoteContext context) ;
16343 extern Boolean
16344 _MPIsFullyInitialized(void) ;
16345
16346
16347 typedef Boolean ( * MPIsFullyInitializedProc)(void);
16348 extern void
16349 _MPLibraryVersion(
16350   const char ** versionCString,
16351   UInt32 * major,
16352   UInt32 * minor,
16353   UInt32 * release,
16354   UInt32 * revision) ;
16355 extern Boolean
16356 _MPLibraryIsCompatible(
16357   const char * versionCString,
16358   UInt32 major,
16359   UInt32 minor,
16360   UInt32 release,
16361   UInt32 revision) ;
16362
16363
16364 }
16365 extern "C" {
16366
16367
16368 enum {
16369   kCFragResourceType = 'cfrg',
16370   kCFragResourceID = 0,
16371   kCFragLibraryFileType = 'shlb',
16372   kCFragAllFileTypes = (long)0xFFFFFFFF
16373 };
16374
16375
16376 typedef OSType CFragArchitecture;
16377 enum {
16378
16379   kPowerPCCFragArch = 'pwpc',
16380   kMotorola68KCFragArch = 'm68k',
16381   kAnyCFragArch = 0x3F3F3F3F
16382 };
16383
16384
16385
16386 enum {
16387   kCompiledCFragArch = kPowerPCCFragArch
16388 };
16389 typedef UInt32 CFragVersionNumber;
16390 enum {
16391   kNullCFragVersion = 0,
16392   kWildcardCFragVersion = (long)0xFFFFFFFF
16393 };
16394
16395
16396 typedef UInt8 CFragUsage;
16397 enum {
16398
16399   kImportLibraryCFrag = 0,
16400   kApplicationCFrag = 1,
16401   kDropInAdditionCFrag = 2,
16402   kStubLibraryCFrag = 3,
16403   kWeakStubLibraryCFrag = 4
16404 };
16405
16406
16407 enum {
16408   kIsCompleteCFrag = 0,
16409   kFirstCFragUpdate = 1
16410 };
16411
16412
16413 enum {
16414   kCFragGoesToEOF = 0
16415 };
16416
16417
16418
16419
16420 typedef UInt8 CFragLocatorKind;
16421 enum {
16422
16423   kMemoryCFragLocator = 0,
16424   kDataForkCFragLocator = 1,
16425   kResourceCFragLocator = 2,
16426   kNamedFragmentCFragLocator = 4,
16427   kCFBundleCFragLocator = 5,
16428   kCFBundlePreCFragLocator = 6
16429 };
16430 union CFragUsage1Union {
16431   UInt32 appStackSize;
16432 };
16433 typedef union CFragUsage1Union CFragUsage1Union;
16434 union CFragUsage2Union {
16435   SInt16 appSubdirID;
16436   UInt16 libFlags;
16437 };
16438 typedef union CFragUsage2Union CFragUsage2Union;
16439 enum {
16440
16441   kCFragLibUsageMapPrivatelyMask = 0x0001
16442 };
16443
16444 union CFragWhere1Union {
16445   UInt32 spaceID;
16446 };
16447 typedef union CFragWhere1Union CFragWhere1Union;
16448 union CFragWhere2Union {
16449   UInt16 reserved;
16450 };
16451 typedef union CFragWhere2Union CFragWhere2Union;
16452 enum {
16453   kDefaultCFragNameLen = 16
16454 };
16455
16456
16457 struct CFragResourceMember {
16458   CFragArchitecture architecture;
16459   UInt16 reservedA;
16460   UInt8 reservedB;
16461   UInt8 updateLevel;
16462   CFragVersionNumber currentVersion;
16463   CFragVersionNumber oldDefVersion;
16464   CFragUsage1Union uUsage1;
16465   CFragUsage2Union uUsage2;
16466   CFragUsage usage;
16467   CFragLocatorKind where;
16468   UInt32 offset;
16469   UInt32 length;
16470   CFragWhere1Union uWhere1;
16471   CFragWhere2Union uWhere2;
16472   UInt16 extensionCount;
16473   UInt16 memberSize;
16474   unsigned char name[16];
16475 };
16476 typedef struct CFragResourceMember CFragResourceMember;
16477 typedef CFragResourceMember * CFragResourceMemberPtr;
16478 struct CFragResourceExtensionHeader {
16479   UInt16 extensionKind;
16480   UInt16 extensionSize;
16481 };
16482 typedef struct CFragResourceExtensionHeader CFragResourceExtensionHeader;
16483 typedef CFragResourceExtensionHeader * CFragResourceExtensionHeaderPtr;
16484 struct CFragResourceSearchExtension {
16485   CFragResourceExtensionHeader header;
16486   OSType libKind;
16487   unsigned char qualifiers[1];
16488 };
16489 typedef struct CFragResourceSearchExtension CFragResourceSearchExtension;
16490 typedef CFragResourceSearchExtension * CFragResourceSearchExtensionPtr;
16491 enum {
16492   kCFragResourceSearchExtensionKind = 0x30EE
16493 };
16494
16495
16496 struct CFragResource {
16497   UInt32 reservedA;
16498   UInt32 reservedB;
16499   UInt16 reservedC;
16500   UInt16 version;
16501   UInt32 reservedD;
16502   UInt32 reservedE;
16503   UInt32 reservedF;
16504   UInt32 reservedG;
16505   UInt16 reservedH;
16506   UInt16 memberCount;
16507   CFragResourceMember firstMember;
16508 };
16509 typedef struct CFragResource CFragResource;
16510 typedef CFragResource * CFragResourcePtr;
16511 typedef CFragResourcePtr * CFragResourceHandle;
16512 enum {
16513   kCurrCFragResourceVersion = 1
16514 };
16515 typedef MPProcessID CFragContextID;
16516 typedef struct OpaqueCFragConnectionID* CFragConnectionID;
16517 typedef struct OpaqueCFragClosureID* CFragClosureID;
16518 typedef struct OpaqueCFragContainerID* CFragContainerID;
16519 typedef OptionBits CFragLoadOptions;
16520 enum {
16521
16522   kReferenceCFrag = 0x0001,
16523   kFindCFrag = 0x0002,
16524   kPrivateCFragCopy = 0x0005
16525 };
16526
16527
16528 enum {
16529   kUnresolvedCFragSymbolAddress = 0
16530 };
16531
16532
16533 typedef UInt8 CFragSymbolClass;
16534 enum {
16535
16536   kCodeCFragSymbol = 0,
16537   kDataCFragSymbol = 1,
16538   kTVectorCFragSymbol = 2,
16539   kTOCCFragSymbol = 3,
16540   kGlueCFragSymbol = 4
16541 };
16542 extern OSErr
16543 GetSharedLibrary(
16544   ConstStr63Param libName,
16545   CFragArchitecture archType,
16546   CFragLoadOptions options,
16547   CFragConnectionID * connID,
16548   Ptr * mainAddr,
16549   Str255 errMessage) ;
16550 extern OSErr
16551 GetDiskFragment(
16552   const FSSpec * fileSpec,
16553   UInt32 offset,
16554   UInt32 length,
16555   ConstStr63Param fragName,
16556   CFragLoadOptions options,
16557   CFragConnectionID * connID,
16558   Ptr * mainAddr,
16559   Str255 errMessage) ;
16560 extern OSErr
16561 GetMemFragment(
16562   void * memAddr,
16563   UInt32 length,
16564   ConstStr63Param fragName,
16565   CFragLoadOptions options,
16566   CFragConnectionID * connID,
16567   Ptr * mainAddr,
16568   Str255 errMessage) ;
16569 extern OSErr
16570 CloseConnection(CFragConnectionID * connID) ;
16571 extern OSErr
16572 FindSymbol(
16573   CFragConnectionID connID,
16574   ConstStr255Param symName,
16575   Ptr * symAddr,
16576   CFragSymbolClass * symClass) ;
16577 extern OSErr
16578 CountSymbols(
16579   CFragConnectionID connID,
16580   long * symCount) ;
16581 extern OSErr
16582 GetIndSymbol(
16583   CFragConnectionID connID,
16584   long symIndex,
16585   Str255 symName,
16586   Ptr * symAddr,
16587   CFragSymbolClass * symClass) ;
16588 struct CFragSystem7MemoryLocator {
16589   LogicalAddress address;
16590   UInt32 length;
16591   Boolean inPlace;
16592   UInt8 reservedA;
16593   UInt16 reservedB;
16594 };
16595 typedef struct CFragSystem7MemoryLocator CFragSystem7MemoryLocator;
16596 struct CFragSystem7DiskFlatLocator {
16597   FSSpec * fileSpec;
16598   UInt32 offset;
16599   UInt32 length;
16600 };
16601 typedef struct CFragSystem7DiskFlatLocator CFragSystem7DiskFlatLocator;
16602
16603 struct CFragSystem7SegmentedLocator {
16604   FSSpec * fileSpec;
16605   OSType rsrcType;
16606   SInt16 rsrcID;
16607   UInt16 reservedA;
16608 };
16609 typedef struct CFragSystem7SegmentedLocator CFragSystem7SegmentedLocator;
16610
16611
16612
16613
16614 struct CFragCFBundleLocator {
16615   CFBundleRef fragmentBundle;
16616   UInt32 offset;
16617   UInt32 length;
16618 };
16619 typedef struct CFragCFBundleLocator CFragCFBundleLocator;
16620 struct CFragSystem7Locator {
16621   SInt32 where;
16622   union {
16623     CFragSystem7DiskFlatLocator onDisk;
16624     CFragSystem7MemoryLocator inMem;
16625     CFragSystem7SegmentedLocator inSegs;
16626     CFragCFBundleLocator inBundle;
16627   } u;
16628 };
16629 typedef struct CFragSystem7Locator CFragSystem7Locator;
16630 typedef CFragSystem7Locator * CFragSystem7LocatorPtr;
16631 struct CFragSystem7InitBlock {
16632   CFragContextID contextID;
16633   CFragClosureID closureID;
16634   CFragConnectionID connectionID;
16635   CFragSystem7Locator fragLocator;
16636   StringPtr libName;
16637   UInt32 reservedA;
16638 };
16639 typedef struct CFragSystem7InitBlock CFragSystem7InitBlock;
16640 typedef CFragSystem7InitBlock * CFragSystem7InitBlockPtr;
16641 typedef CFragSystem7InitBlock CFragInitBlock;
16642 typedef CFragSystem7InitBlockPtr CFragInitBlockPtr;
16643
16644 typedef OSErr ( * CFragInitFunction)(const CFragInitBlock * initBlock);
16645 typedef void ( * CFragTermProcedure)(void);
16646 extern OSErr
16647 ConvertBundlePreLocator(CFragSystem7LocatorPtr initBlockLocator) ;
16648 enum {
16649   kLoadCFrag = kReferenceCFrag
16650 };
16651
16652
16653 }
16654
16655
16656
16657 extern "C" {
16658
16659
16660
16661 typedef UInt32 FSAliasInfoBitmap;
16662 enum {
16663   kFSAliasInfoNone = 0x00000000,
16664   kFSAliasInfoVolumeCreateDate = 0x00000001,
16665   kFSAliasInfoTargetCreateDate = 0x00000002,
16666   kFSAliasInfoFinderInfo = 0x00000004,
16667   kFSAliasInfoIsDirectory = 0x00000008,
16668   kFSAliasInfoIDs = 0x00000010,
16669   kFSAliasInfoFSInfo = 0x00000020,
16670   kFSAliasInfoVolumeFlags = 0x00000040
16671 };
16672
16673 enum {
16674   rAliasType = 'alis'
16675 };
16676
16677 enum {
16678
16679   kARMMountVol = 0x00000001,
16680   kARMNoUI = 0x00000002,
16681   kARMMultVols = 0x00000008,
16682   kARMSearch = 0x00000100,
16683   kARMSearchMore = 0x00000200,
16684   kARMSearchRelFirst = 0x00000400,
16685   kARMTryFileIDFirst = 0x00000800
16686 };
16687
16688 enum {
16689
16690   asiZoneName = -3,
16691   asiServerName = -2,
16692   asiVolumeName = -1,
16693   asiAliasName = 0,
16694   asiParentName = 1
16695 };
16696
16697
16698 enum {
16699   kResolveAliasFileNoUI = 0x00000001,
16700   kResolveAliasTryFileIDFirst = 0x00000002
16701 };
16702
16703
16704 struct AliasRecord {
16705   OSType userType;
16706   unsigned short aliasSize;
16707 };
16708 typedef struct AliasRecord AliasRecord;
16709 typedef AliasRecord * AliasPtr;
16710 typedef AliasPtr * AliasHandle;
16711
16712 struct FSAliasInfo {
16713   UTCDateTime volumeCreateDate;
16714   UTCDateTime targetCreateDate;
16715   OSType fileType;
16716   OSType fileCreator;
16717   UInt32 parentDirID;
16718   UInt32 nodeID;
16719   UInt16 filesystemID;
16720   UInt16 signature;
16721   Boolean volumeIsBootVolume;
16722   Boolean volumeIsAutomounted;
16723   Boolean volumeIsEjectable;
16724   Boolean volumeHasPersistentFileIDs;
16725   Boolean isDirectory;
16726 };
16727 typedef struct FSAliasInfo FSAliasInfo;
16728 typedef FSAliasInfo * FSAliasInfoPtr;
16729
16730 typedef short AliasInfoType;
16731 extern OSErr
16732 NewAlias(
16733   const FSSpec * fromFile,
16734   const FSSpec * target,
16735   AliasHandle * alias) ;
16736 extern OSErr
16737 NewAliasMinimal(
16738   const FSSpec * target,
16739   AliasHandle * alias) ;
16740 extern OSErr
16741 NewAliasMinimalFromFullPath(
16742   short fullPathLength,
16743   const void * fullPath,
16744   ConstStr32Param zoneName,
16745   ConstStr31Param serverName,
16746   AliasHandle * alias) ;
16747 extern OSErr
16748 ResolveAlias(
16749   const FSSpec * fromFile,
16750   AliasHandle alias,
16751   FSSpec * target,
16752   Boolean * wasChanged) ;
16753 extern OSErr
16754 GetAliasInfo(
16755   AliasHandle alias,
16756   AliasInfoType index,
16757   Str63 theString) ;
16758 extern OSErr
16759 IsAliasFile(
16760   const FSSpec * fileFSSpec,
16761   Boolean * aliasFileFlag,
16762   Boolean * folderFlag) ;
16763 extern OSErr
16764 ResolveAliasWithMountFlags(
16765   const FSSpec * fromFile,
16766   AliasHandle alias,
16767   FSSpec * target,
16768   Boolean * wasChanged,
16769   unsigned long mountFlags) ;
16770 extern OSErr
16771 ResolveAliasFile(
16772   FSSpec * theSpec,
16773   Boolean resolveAliasChains,
16774   Boolean * targetIsFolder,
16775   Boolean * wasAliased) ;
16776 extern OSErr
16777 ResolveAliasFileWithMountFlags(
16778   FSSpec * theSpec,
16779   Boolean resolveAliasChains,
16780   Boolean * targetIsFolder,
16781   Boolean * wasAliased,
16782   unsigned long mountFlags) ;
16783 extern OSErr
16784 FollowFinderAlias(
16785   const FSSpec * fromFile,
16786   AliasHandle alias,
16787   Boolean logon,
16788   FSSpec * target,
16789   Boolean * wasChanged) ;
16790 extern OSErr
16791 UpdateAlias(
16792   const FSSpec * fromFile,
16793   const FSSpec * target,
16794   AliasHandle alias,
16795   Boolean * wasChanged) ;
16796
16797
16798
16799 typedef Boolean ( * AliasFilterProcPtr)(CInfoPBPtr cpbPtr, Boolean *quitFlag, Ptr myDataPtr);
16800 typedef AliasFilterProcPtr AliasFilterUPP;
16801 extern AliasFilterUPP
16802 NewAliasFilterUPP(AliasFilterProcPtr userRoutine) ;
16803 extern void
16804 DisposeAliasFilterUPP(AliasFilterUPP userUPP) ;
16805 extern Boolean
16806 InvokeAliasFilterUPP(
16807   CInfoPBPtr cpbPtr,
16808   Boolean * quitFlag,
16809   Ptr myDataPtr,
16810   AliasFilterUPP userUPP) ;
16811 extern OSErr
16812 MatchAlias(
16813   const FSSpec * fromFile,
16814   unsigned long rulesMask,
16815   AliasHandle alias,
16816   short * aliasCount,
16817   FSSpecArrayPtr aliasList,
16818   Boolean * needsUpdate,
16819   AliasFilterUPP aliasFilter,
16820   void * yourDataPtr) ;
16821 extern OSErr
16822 ResolveAliasFileWithMountFlagsNoUI(
16823   FSSpec * theSpec,
16824   Boolean resolveAliasChains,
16825   Boolean * targetIsFolder,
16826   Boolean * wasAliased,
16827   unsigned long mountFlags) ;
16828 extern OSErr
16829 MatchAliasNoUI(
16830   const FSSpec * fromFile,
16831   unsigned long rulesMask,
16832   AliasHandle alias,
16833   short * aliasCount,
16834   FSSpecArrayPtr aliasList,
16835   Boolean * needsUpdate,
16836   AliasFilterUPP aliasFilter,
16837   void * yourDataPtr) ;
16838 extern OSErr
16839 FSNewAlias(
16840   const FSRef * fromFile,
16841   const FSRef * target,
16842   AliasHandle * inAlias) ;
16843 extern OSErr
16844 FSNewAliasMinimal(
16845   const FSRef * target,
16846   AliasHandle * inAlias) ;
16847 extern OSErr
16848 FSIsAliasFile(
16849   const FSRef * fileRef,
16850   Boolean * aliasFileFlag,
16851   Boolean * folderFlag) ;
16852 extern OSErr
16853 FSResolveAliasWithMountFlags(
16854   const FSRef * fromFile,
16855   AliasHandle inAlias,
16856   FSRef * target,
16857   Boolean * wasChanged,
16858   unsigned long mountFlags) ;
16859 extern OSErr
16860 FSResolveAlias(
16861   const FSRef * fromFile,
16862   AliasHandle alias,
16863   FSRef * target,
16864   Boolean * wasChanged) ;
16865 extern OSErr
16866 FSResolveAliasFileWithMountFlags(
16867   FSRef * theRef,
16868   Boolean resolveAliasChains,
16869   Boolean * targetIsFolder,
16870   Boolean * wasAliased,
16871   unsigned long mountFlags) ;
16872 extern OSErr
16873 FSResolveAliasFile(
16874   FSRef * theRef,
16875   Boolean resolveAliasChains,
16876   Boolean * targetIsFolder,
16877   Boolean * wasAliased) ;
16878 extern OSErr
16879 FSFollowFinderAlias(
16880   FSRef * fromFile,
16881   AliasHandle alias,
16882   Boolean logon,
16883   FSRef * target,
16884   Boolean * wasChanged) ;
16885 extern OSErr
16886 FSUpdateAlias(
16887   const FSRef * fromFile,
16888   const FSRef * target,
16889   AliasHandle alias,
16890   Boolean * wasChanged) ;
16891 extern OSErr
16892 FSNewAliasUnicode(
16893   const FSRef * fromFile,
16894   const FSRef * targetParentRef,
16895   UniCharCount targetNameLength,
16896   const UniChar * targetName,
16897   AliasHandle * inAlias,
16898   Boolean * isDirectory) ;
16899 extern OSErr
16900 FSNewAliasMinimalUnicode(
16901   const FSRef * targetParentRef,
16902   UniCharCount targetNameLength,
16903   const UniChar * targetName,
16904   AliasHandle * inAlias,
16905   Boolean * isDirectory) ;
16906 extern OSErr
16907 FSMatchAlias(
16908   const FSRef * fromFile,
16909   unsigned long rulesMask,
16910   AliasHandle inAlias,
16911   short * aliasCount,
16912   FSRef * aliasList,
16913   Boolean * needsUpdate,
16914   AliasFilterUPP aliasFilter,
16915   void * yourDataPtr) ;
16916 extern OSErr
16917 FSMatchAliasNoUI(
16918   const FSRef * fromFile,
16919   unsigned long rulesMask,
16920   AliasHandle inAlias,
16921   short * aliasCount,
16922   FSRef * aliasList,
16923   Boolean * needsUpdate,
16924   AliasFilterUPP aliasFilter,
16925   void * yourDataPtr) ;
16926 extern OSStatus
16927 FSCopyAliasInfo(
16928   AliasHandle inAlias,
16929   HFSUniStr255 * targetName,
16930   HFSUniStr255 * volumeName,
16931   CFStringRef * pathString,
16932   FSAliasInfoBitmap * whichInfo,
16933   FSAliasInfo * info) ;
16934
16935
16936
16937
16938
16939
16940 }
16941
16942
16943
16944 extern "C" {
16945
16946
16947 typedef struct OpaqueLocaleRef* LocaleRef;
16948 typedef UInt32 LocalePartMask;
16949 enum {
16950
16951   kLocaleLanguageMask = 1L << 0,
16952   kLocaleLanguageVariantMask = 1L << 1,
16953   kLocaleScriptMask = 1L << 2,
16954   kLocaleScriptVariantMask = 1L << 3,
16955   kLocaleRegionMask = 1L << 4,
16956   kLocaleRegionVariantMask = 1L << 5,
16957   kLocaleAllPartsMask = 0x0000003F
16958 };
16959
16960 typedef FourCharCode LocaleOperationClass;
16961
16962 typedef FourCharCode LocaleOperationVariant;
16963 struct LocaleAndVariant {
16964   LocaleRef locale;
16965   LocaleOperationVariant opVariant;
16966 };
16967 typedef struct LocaleAndVariant LocaleAndVariant;
16968
16969 typedef UInt32 LocaleNameMask;
16970 enum {
16971
16972   kLocaleNameMask = 1L << 0,
16973   kLocaleOperationVariantNameMask = 1L << 1,
16974   kLocaleAndVariantNameMask = 0x00000003
16975 };
16976 extern OSStatus
16977 LocaleRefFromLangOrRegionCode(
16978   LangCode lang,
16979   RegionCode region,
16980   LocaleRef * locale) ;
16981 extern OSStatus
16982 LocaleRefFromLocaleString(
16983   const char localeString[],
16984   LocaleRef * locale) ;
16985 extern OSStatus
16986 LocaleRefGetPartString(
16987   LocaleRef locale,
16988   LocalePartMask partMask,
16989   ByteCount maxStringLen,
16990   char partString[]) ;
16991 extern OSStatus
16992 LocaleStringToLangAndRegionCodes(
16993   const char localeString[],
16994   LangCode * lang,
16995   RegionCode * region) ;
16996 extern OSStatus
16997 LocaleOperationCountLocales(
16998   LocaleOperationClass opClass,
16999   ItemCount * localeCount) ;
17000 extern OSStatus
17001 LocaleOperationGetLocales(
17002   LocaleOperationClass opClass,
17003   ItemCount maxLocaleCount,
17004   ItemCount * actualLocaleCount,
17005   LocaleAndVariant localeVariantList[]) ;
17006 extern OSStatus
17007 LocaleGetName(
17008   LocaleRef locale,
17009   LocaleOperationVariant opVariant,
17010   LocaleNameMask nameMask,
17011   LocaleRef displayLocale,
17012   UniCharCount maxNameLen,
17013   UniCharCount * actualNameLen,
17014   UniChar displayName[]) ;
17015 extern OSStatus
17016 LocaleCountNames(
17017   LocaleRef locale,
17018   LocaleOperationVariant opVariant,
17019   LocaleNameMask nameMask,
17020   ItemCount * nameCount) ;
17021 extern OSStatus
17022 LocaleGetIndName(
17023   LocaleRef locale,
17024   LocaleOperationVariant opVariant,
17025   LocaleNameMask nameMask,
17026   ItemCount nameIndex,
17027   UniCharCount maxNameLen,
17028   UniCharCount * actualNameLen,
17029   UniChar displayName[],
17030   LocaleRef * displayLocale) ;
17031 extern OSStatus
17032 LocaleGetRegionLanguageName(
17033   RegionCode region,
17034   Str255 languageName) ;
17035 extern OSStatus
17036 LocaleOperationGetName(
17037   LocaleOperationClass opClass,
17038   LocaleRef displayLocale,
17039   UniCharCount maxNameLen,
17040   UniCharCount * actualNameLen,
17041   UniChar displayName[]) ;
17042 extern OSStatus
17043 LocaleOperationCountNames(
17044   LocaleOperationClass opClass,
17045   ItemCount * nameCount) ;
17046 extern OSStatus
17047 LocaleOperationGetIndName(
17048   LocaleOperationClass opClass,
17049   ItemCount nameIndex,
17050   UniCharCount maxNameLen,
17051   UniCharCount * actualNameLen,
17052   UniChar displayName[],
17053   LocaleRef * displayLocale) ;
17054
17055
17056
17057
17058
17059 }
17060
17061
17062
17063 extern "C" {
17064 enum {
17065   kBlessedBusErrorBait = 0x68F168F1
17066 };
17067 extern void
17068 DebugAssert(
17069   OSType componentSignature,
17070   UInt32 options,
17071   const char * assertionString,
17072   const char * exceptionLabelString,
17073   const char * errorString,
17074   const char * fileName,
17075   long lineNumber,
17076   void * value) ;
17077
17078
17079
17080
17081
17082 enum {
17083   k68kInterruptLevelMask = 0x00000007,
17084   kInVBLTaskMask = 0x00000010,
17085   kInDeferredTaskMask = 0x00000020,
17086   kInSecondaryIntHandlerMask = 0x00000040,
17087   kInNestedInterruptMask = 0x00000080
17088 };
17089 extern UInt32
17090 TaskLevel(void) ;
17091
17092
17093
17094
17095
17096 enum {
17097   kComponentDebugOption = 0
17098 };
17099
17100 enum {
17101   kGetDebugOption = 1,
17102   kSetDebugOption = 2
17103 };
17104 typedef void ( * DebugComponentCallbackProcPtr)(SInt32 optionSelectorNum, UInt32 command, Boolean *optionSetting);
17105 typedef DebugComponentCallbackProcPtr DebugComponentCallbackUPP;
17106 extern OSStatus
17107 NewDebugComponent(
17108   OSType componentSignature,
17109   ConstStr255Param componentName,
17110   DebugComponentCallbackUPP componentCallback) ;
17111 extern OSStatus
17112 NewDebugOption(
17113   OSType componentSignature,
17114   SInt32 optionSelectorNum,
17115   ConstStr255Param optionName) ;
17116 extern OSStatus
17117 DisposeDebugComponent(OSType componentSignature) ;
17118 extern OSStatus
17119 GetDebugComponentInfo(
17120   UInt32 index,
17121   OSType * componentSignature,
17122   Str255 componentName) ;
17123 extern OSStatus
17124 GetDebugOptionInfo(
17125   UInt32 index,
17126   OSType componentSignature,
17127   SInt32 * optionSelectorNum,
17128   Str255 optionName,
17129   Boolean * optionSetting) ;
17130 extern OSStatus
17131 SetDebugOptionValue(
17132   OSType componentSignature,
17133   SInt32 optionSelectorNum,
17134   Boolean newOptionSetting) ;
17135 typedef void ( * DebugAssertOutputHandlerProcPtr)(OSType componentSignature, UInt32 options, const char *assertionString, const char *exceptionLabelString, const char *errorString, const char *fileName, long lineNumber, void *value, ConstStr255Param outputMsg);
17136 typedef DebugAssertOutputHandlerProcPtr DebugAssertOutputHandlerUPP;
17137 extern void
17138 InstallDebugAssertOutputHandler(DebugAssertOutputHandlerUPP handler) ;
17139 extern DebugComponentCallbackUPP
17140 NewDebugComponentCallbackUPP(DebugComponentCallbackProcPtr userRoutine) ;
17141 extern DebugAssertOutputHandlerUPP
17142 NewDebugAssertOutputHandlerUPP(DebugAssertOutputHandlerProcPtr userRoutine) ;
17143 extern void
17144 DisposeDebugComponentCallbackUPP(DebugComponentCallbackUPP userUPP) ;
17145 extern void
17146 DisposeDebugAssertOutputHandlerUPP(DebugAssertOutputHandlerUPP userUPP) ;
17147 extern void
17148 InvokeDebugComponentCallbackUPP(
17149   SInt32 optionSelectorNum,
17150   UInt32 command,
17151   Boolean * optionSetting,
17152   DebugComponentCallbackUPP userUPP) ;
17153 extern void
17154 InvokeDebugAssertOutputHandlerUPP(
17155   OSType componentSignature,
17156   UInt32 options,
17157   const char * assertionString,
17158   const char * exceptionLabelString,
17159   const char * errorString,
17160   const char * fileName,
17161   long lineNumber,
17162   void * value,
17163   ConstStr255Param outputMsg,
17164   DebugAssertOutputHandlerUPP userUPP) ;
17165
17166
17167
17168 }
17169
17170
17171
17172 extern "C" {
17173 extern short
17174 PLstrcmp(
17175   ConstStr255Param str1,
17176   ConstStr255Param str2) ;
17177 extern short
17178 PLstrncmp(
17179   ConstStr255Param str1,
17180   ConstStr255Param str2,
17181   short num) ;
17182 extern StringPtr
17183 PLstrcpy(
17184   StringPtr str1,
17185   ConstStr255Param str2) ;
17186 extern StringPtr
17187 PLstrncpy(
17188   StringPtr str1,
17189   ConstStr255Param str2,
17190   short num) ;
17191 extern StringPtr
17192 PLstrcat(
17193   StringPtr str1,
17194   ConstStr255Param str2) ;
17195 extern StringPtr
17196 PLstrncat(
17197   StringPtr str1,
17198   ConstStr255Param str2,
17199   short num) ;
17200 extern Ptr
17201 PLstrchr(
17202   ConstStr255Param str1,
17203   short ch1) ;
17204 extern Ptr
17205 PLstrrchr(
17206   ConstStr255Param str1,
17207   short ch1) ;
17208 extern Ptr
17209 PLstrpbrk(
17210   ConstStr255Param str1,
17211   ConstStr255Param str2) ;
17212 extern short
17213 PLstrspn(
17214   ConstStr255Param str1,
17215   ConstStr255Param str2) ;
17216 extern Ptr
17217 PLstrstr(
17218   ConstStr255Param str1,
17219   ConstStr255Param str2) ;
17220 extern short
17221 PLstrlen(ConstStr255Param str) ;
17222 extern short
17223 PLpos(
17224   ConstStr255Param str1,
17225   ConstStr255Param str2) ;
17226
17227
17228
17229
17230
17231 }
17232
17233
17234
17235 extern "C" {
17236 extern Boolean
17237 CompareAndSwap(
17238   UInt32 oldVvalue,
17239   UInt32 newValue,
17240   UInt32 * OldValueAdr) ;
17241 extern Boolean
17242 TestAndClear(
17243   UInt32 bit,
17244   UInt8 * startAddress) ;
17245 extern Boolean
17246 TestAndSet(
17247   UInt32 bit,
17248   UInt8 * startAddress) ;
17249 extern SInt8
17250 IncrementAtomic8(SInt8 * value) ;
17251 extern SInt8
17252 DecrementAtomic8(SInt8 * value) ;
17253 extern SInt8
17254 AddAtomic8(
17255   SInt32 amount,
17256   SInt8 * value) ;
17257 extern UInt8
17258 BitAndAtomic8(
17259   UInt32 mask,
17260   UInt8 * value) ;
17261 extern UInt8
17262 BitOrAtomic8(
17263   UInt32 mask,
17264   UInt8 * value) ;
17265 extern UInt8
17266 BitXorAtomic8(
17267   UInt32 mask,
17268   UInt8 * value) ;
17269 extern SInt16
17270 IncrementAtomic16(SInt16 * value) ;
17271 extern SInt16
17272 DecrementAtomic16(SInt16 * value) ;
17273 extern SInt16
17274 AddAtomic16(
17275   SInt32 amount,
17276   SInt16 * value) ;
17277 extern UInt16
17278 BitAndAtomic16(
17279   UInt32 mask,
17280   UInt16 * value) ;
17281 extern UInt16
17282 BitOrAtomic16(
17283   UInt32 mask,
17284   UInt16 * value) ;
17285 extern UInt16
17286 BitXorAtomic16(
17287   UInt32 mask,
17288   UInt16 * value) ;
17289 extern SInt32
17290 IncrementAtomic(SInt32 * value) ;
17291 extern SInt32
17292 DecrementAtomic(SInt32 * value) ;
17293 extern SInt32
17294 AddAtomic(
17295   SInt32 amount,
17296   SInt32 * value) ;
17297 extern UInt32
17298 BitAndAtomic(
17299   UInt32 mask,
17300   UInt32 * value) ;
17301 extern UInt32
17302 BitOrAtomic(
17303   UInt32 mask,
17304   UInt32 * value) ;
17305 extern UInt32
17306 BitXorAtomic(
17307   UInt32 mask,
17308   UInt32 * value) ;
17309
17310
17311
17312
17313
17314 }
17315
17316
17317
17318
17319
17320
17321
17322
17323
17324
17325 typedef void * RegPropertyValue;
17326
17327 typedef UInt32 RegPropertyValueSize;
17328
17329
17330
17331
17332
17333 typedef struct OpaqueDeviceNodePtr* DeviceNodePtr;
17334 struct RegEntryID {
17335   unsigned short es_ver;
17336   unsigned short es_gen;
17337   DeviceNodePtr es_devid;
17338   unsigned long es_spare1;
17339   unsigned long es_spare2;
17340 };
17341 typedef struct RegEntryID RegEntryID;
17342 typedef RegEntryID * RegEntryIDPtr;
17343
17344
17345
17346
17347 typedef RegEntryID RegEntryRef;
17348 enum {
17349   kRegCStrMaxEntryNameLength = 47
17350 };
17351
17352
17353 typedef char RegCStrEntryName;
17354 typedef char * RegCStrEntryNamePtr;
17355
17356 typedef char RegCStrEntryNameBuf[48];
17357 typedef char RegCStrPathName;
17358 typedef UInt32 RegPathNameSize;
17359 enum {
17360   kRegPathNameSeparator = ':',
17361   kRegEntryNameTerminator = 0x00,
17362   kRegPathNameTerminator = 0x00
17363 };
17364
17365
17366
17367
17368
17369
17370 enum {
17371   kRegMaximumPropertyNameLength = 31,
17372   kRegPropertyNameTerminator = 0x00
17373 };
17374
17375 typedef char RegPropertyNameBuf[32];
17376 typedef char RegPropertyName;
17377 typedef char * RegPropertyNamePtr;
17378 enum {
17379   kRegMaxPropertyNameLength = kRegMaximumPropertyNameLength
17380 };
17381
17382
17383
17384
17385
17386
17387
17388 typedef UInt32 RegIterationOp;
17389 typedef RegIterationOp RegEntryIterationOp;
17390 enum {
17391
17392   kRegIterRoot = 0x00000002,
17393   kRegIterParents = 0x00000003,
17394
17395   kRegIterChildren = 0x00000004,
17396   kRegIterSubTrees = 0x00000005,
17397   kRegIterDescendants = 0x00000005,
17398
17399   kRegIterSibling = 0x00000006,
17400
17401   kRegIterContinue = 0x00000001
17402 };
17403 typedef UInt32 RegModifiers;
17404 typedef RegModifiers RegEntryModifiers;
17405 typedef RegModifiers RegPropertyModifiers;
17406 enum {
17407   kRegNoModifiers = 0x00000000,
17408   kRegUniversalModifierMask = 0x0000FFFF,
17409   kRegNameSpaceModifierMask = 0x00FF0000,
17410   kRegModifierMask = (long)0xFF000000
17411 };
17412
17413
17414 enum {
17415   kRegPropertyValueIsSavedToNVRAM = 0x00000020,
17416   kRegPropertyValueIsSavedToDisk = 0x00000040
17417 };
17418
17419
17420 enum {
17421   LatestNR_PEFVersion = 0x01030000
17422 };
17423
17424
17425
17426
17427
17428
17429
17430 enum {
17431   kSelectRegistryEntryIDInit = 0,
17432   kSelectRegistryEntryIDCompare = 1,
17433   kSelectRegistryEntryIDCopy = 2,
17434   kSelectRegistryEntryIDDispose = 3,
17435   kSelectRegistryCStrEntryCreate = 4,
17436   kSelectRegistryEntryDelete = 5,
17437   kSelectRegistryEntryCopy = 6,
17438   kSelectRegistryEntryIterateCreate = 7,
17439   kSelectRegistryEntryIterateDispose = 8,
17440   kSelectRegistryEntryIterateSet = 9,
17441   kSelectRegistryEntryIterate = 10,
17442   kSelectRegistryEntrySearch = 11,
17443   kSelectRegistryCStrEntryLookup = 12,
17444   kSelectRegistryEntryToPathSize = 13,
17445   kSelectRegistryCStrEntryToPath = 14,
17446   kSelectRegistryCStrEntryToName = 15,
17447   kSelectRegistryPropertyCreate = 16,
17448   kSelectRegistryPropertyDelete = 17,
17449   kSelectRegistryPropertyRename = 18,
17450   kSelectRegistryPropertyIterateCreate = 19,
17451   kSelectRegistryPropertyIterateDispose = 20,
17452   kSelectRegistryPropertyIterate = 21,
17453   kSelectRegistryPropertyGetSize = 22,
17454   kSelectRegistryPropertyGet = 23,
17455   kSelectRegistryPropertySet = 24,
17456   kSelectRegistryEntryGetMod = 25,
17457   kSelectRegistryEntrySetMod = 26,
17458   kSelectRegistryPropertyGetMod = 27,
17459   kSelectRegistryPropertySetMod = 28,
17460   kSelectRegistryEntryMod = 29,
17461   kSelectRegistryEntryPropertyMod = 30,
17462   kSelectRegistryHighestSelector = kSelectRegistryEntryPropertyMod
17463 };
17464 typedef struct OpaqueRegEntryIter* RegEntryIter;
17465 typedef struct OpaqueRegPropertyIter* RegPropertyIter;
17466 extern "C" {
17467
17468
17469
17470
17471 enum {
17472   chooserInitMsg = 11,
17473   newSelMsg = 12,
17474   fillListMsg = 13,
17475   getSelMsg = 14,
17476   selectMsg = 15,
17477   deselectMsg = 16,
17478   terminateMsg = 17,
17479   buttonMsg = 19
17480 };
17481
17482
17483
17484 enum {
17485   chooserID = 1
17486 };
17487
17488
17489
17490 enum {
17491   initMsg = 1,
17492   okMsg = 2,
17493   cancelMsg = 3,
17494   hitMsg = 4,
17495   nulMsg = 5,
17496   updateMsg = 6,
17497   activateMsg = 7,
17498   deactivateMsg = 8,
17499   keyEvtMsg = 9,
17500   superMsg = 10,
17501   normalMsg = 11,
17502   startupMsg = 12
17503 };
17504
17505
17506
17507 enum {
17508   goodbye = -1,
17509   killCode = 1,
17510   accEvent = 64,
17511   accRun = 65,
17512   accCursor = 66,
17513   accMenu = 67,
17514   accUndo = 68,
17515   accCut = 70,
17516   accCopy = 71,
17517   accPaste = 72,
17518   accClear = 73
17519 };
17520
17521
17522
17523
17524
17525 enum {
17526   ioInProgress = 1,
17527   aRdCmd = 2,
17528   aWrCmd = 3,
17529   asyncTrpBit = 10,
17530   noQueueBit = 9
17531 };
17532
17533
17534 enum {
17535   dReadEnable = 0,
17536   dWritEnable = 1,
17537   dCtlEnable = 2,
17538   dStatEnable = 3,
17539   dNeedGoodBye = 4,
17540   dNeedTime = 5,
17541   dNeedLock = 6
17542 };
17543
17544 enum {
17545   dNeedLockMask = 0x4000,
17546   dNeedTimeMask = 0x2000,
17547   dNeedGoodByeMask = 0x1000,
17548   dStatEnableMask = 0x0800,
17549   dCtlEnableMask = 0x0400,
17550   dWritEnableMask = 0x0200,
17551   dReadEnableMask = 0x0100
17552 };
17553
17554
17555
17556 enum {
17557   dVMImmuneBit = 0,
17558   dOpened = 5,
17559   dRAMBased = 6,
17560   drvrActive = 7
17561 };
17562
17563 enum {
17564   dVMImmuneMask = 0x0001,
17565   dOpenedMask = 0x0020,
17566   dRAMBasedMask = 0x0040,
17567   drvrActiveMask = 0x0080
17568 };
17569
17570 struct DRVRHeader {
17571   short drvrFlags;
17572   short drvrDelay;
17573   short drvrEMask;
17574   short drvrMenu;
17575   short drvrOpen;
17576   short drvrPrime;
17577   short drvrCtl;
17578   short drvrStatus;
17579   short drvrClose;
17580   unsigned char drvrName[1];
17581 };
17582 typedef struct DRVRHeader DRVRHeader;
17583 typedef DRVRHeader * DRVRHeaderPtr;
17584 typedef DRVRHeaderPtr * DRVRHeaderHandle;
17585
17586 typedef UInt16 UnitNumber;
17587 typedef UInt32 DriverOpenCount;
17588 typedef SInt16 DriverRefNum;
17589 typedef SInt16 DriverFlags;
17590 typedef UInt32 IOCommandCode;
17591 enum {
17592   kOpenCommand = 0,
17593   kCloseCommand = 1,
17594   kReadCommand = 2,
17595   kWriteCommand = 3,
17596   kControlCommand = 4,
17597   kStatusCommand = 5,
17598   kKillIOCommand = 6,
17599   kInitializeCommand = 7,
17600   kFinalizeCommand = 8,
17601   kReplaceCommand = 9,
17602   kSupersededCommand = 10,
17603   kSuspendCommand = 11,
17604   kResumeCommand = 12
17605 };
17606
17607 enum {
17608
17609   kPowerManagementCommand = 13
17610 };
17611
17612 typedef MPAddressSpaceID AddressSpaceID;
17613 typedef struct OpaqueIOCommandID* IOCommandID;
17614 extern OSErr
17615 PBCloseSync(ParmBlkPtr paramBlock) ;
17616 extern OSErr
17617 PBCloseAsync(ParmBlkPtr paramBlock) ;
17618 extern OSErr
17619 PBReadSync(ParmBlkPtr paramBlock) ;
17620 extern OSErr
17621 PBReadAsync(ParmBlkPtr paramBlock) ;
17622 extern OSErr
17623 PBWriteSync(ParmBlkPtr paramBlock) ;
17624 extern OSErr
17625 PBWriteAsync(ParmBlkPtr paramBlock) ;
17626 extern OSErr
17627 PBWaitIOComplete(
17628   ParmBlkPtr paramBlock,
17629   Duration timeout) ;
17630 typedef OSStatus ( * ShimEntryPoint)(Ptr paramBlock, Ptr refcon);
17631
17632
17633 }
17634
17635
17636
17637 extern "C" {
17638
17639
17640
17641
17642 typedef struct OpaqueAreaID* AreaID;
17643
17644 struct MachineInformationPowerPC {
17645   UnsignedWide CTR;
17646   UnsignedWide LR;
17647   UnsignedWide PC;
17648   unsigned long CR;
17649   unsigned long XER;
17650   unsigned long MSR;
17651   unsigned long MQ;
17652   unsigned long ExceptKind;
17653   unsigned long DSISR;
17654   UnsignedWide DAR;
17655   UnsignedWide Reserved;
17656 };
17657 typedef struct MachineInformationPowerPC MachineInformationPowerPC;
17658 struct RegisterInformationPowerPC {
17659   UnsignedWide R0;
17660   UnsignedWide R1;
17661   UnsignedWide R2;
17662   UnsignedWide R3;
17663   UnsignedWide R4;
17664   UnsignedWide R5;
17665   UnsignedWide R6;
17666   UnsignedWide R7;
17667   UnsignedWide R8;
17668   UnsignedWide R9;
17669   UnsignedWide R10;
17670   UnsignedWide R11;
17671   UnsignedWide R12;
17672   UnsignedWide R13;
17673   UnsignedWide R14;
17674   UnsignedWide R15;
17675   UnsignedWide R16;
17676   UnsignedWide R17;
17677   UnsignedWide R18;
17678   UnsignedWide R19;
17679   UnsignedWide R20;
17680   UnsignedWide R21;
17681   UnsignedWide R22;
17682   UnsignedWide R23;
17683   UnsignedWide R24;
17684   UnsignedWide R25;
17685   UnsignedWide R26;
17686   UnsignedWide R27;
17687   UnsignedWide R28;
17688   UnsignedWide R29;
17689   UnsignedWide R30;
17690   UnsignedWide R31;
17691 };
17692 typedef struct RegisterInformationPowerPC RegisterInformationPowerPC;
17693 struct FPUInformationPowerPC {
17694   UnsignedWide Registers[32];
17695   unsigned long FPSCR;
17696   unsigned long Reserved;
17697 };
17698 typedef struct FPUInformationPowerPC FPUInformationPowerPC;
17699 union Vector128 {
17700
17701
17702
17703   unsigned long l[4];
17704   unsigned short s[8];
17705   unsigned char c[16];
17706 };
17707 typedef union Vector128 Vector128;
17708 struct VectorInformationPowerPC {
17709   Vector128 Registers[32];
17710   Vector128 VSCR;
17711   UInt32 VRsave;
17712 };
17713 typedef struct VectorInformationPowerPC VectorInformationPowerPC;
17714
17715 enum {
17716   kWriteReference = 0,
17717   kReadReference = 1,
17718   kFetchReference = 2,
17719   writeReference = kWriteReference,
17720   readReference = kReadReference,
17721   fetchReference = kFetchReference
17722 };
17723
17724
17725 typedef unsigned long MemoryReferenceKind;
17726 struct MemoryExceptionInformation {
17727   AreaID theArea;
17728   LogicalAddress theAddress;
17729   OSStatus theError;
17730   MemoryReferenceKind theReference;
17731 };
17732 typedef struct MemoryExceptionInformation MemoryExceptionInformation;
17733 enum {
17734   kUnknownException = 0,
17735   kIllegalInstructionException = 1,
17736   kTrapException = 2,
17737   kAccessException = 3,
17738   kUnmappedMemoryException = 4,
17739   kExcludedMemoryException = 5,
17740   kReadOnlyMemoryException = 6,
17741   kUnresolvablePageFaultException = 7,
17742   kPrivilegeViolationException = 8,
17743   kTraceException = 9,
17744   kInstructionBreakpointException = 10,
17745   kDataBreakpointException = 11,
17746   kIntegerException = 12,
17747   kFloatingPointException = 13,
17748   kStackOverflowException = 14,
17749   kTaskTerminationException = 15,
17750   kTaskCreationException = 16,
17751   kDataAlignmentException = 17
17752 };
17753 typedef unsigned long ExceptionKind;
17754 union ExceptionInfo {
17755   MemoryExceptionInformation * memoryInfo;
17756 };
17757 typedef union ExceptionInfo ExceptionInfo;
17758 struct ExceptionInformationPowerPC {
17759   ExceptionKind theKind;
17760   MachineInformationPowerPC * machineState;
17761   RegisterInformationPowerPC * registerImage;
17762   FPUInformationPowerPC * FPUImage;
17763   ExceptionInfo info;
17764   VectorInformationPowerPC * vectorImage;
17765 };
17766 typedef struct ExceptionInformationPowerPC ExceptionInformationPowerPC;
17767
17768 typedef ExceptionInformationPowerPC ExceptionInformation;
17769 typedef MachineInformationPowerPC MachineInformation;
17770 typedef RegisterInformationPowerPC RegisterInformation;
17771 typedef FPUInformationPowerPC FPUInformation;
17772 typedef VectorInformationPowerPC VectorInformation;
17773 typedef OSStatus ( * ExceptionHandlerProcPtr)(ExceptionInformation * theException);
17774 typedef ExceptionHandlerProcPtr ExceptionHandlerUPP;
17775 extern ExceptionHandlerUPP
17776 NewExceptionHandlerUPP(ExceptionHandlerProcPtr userRoutine) ;
17777 extern void
17778 DisposeExceptionHandlerUPP(ExceptionHandlerUPP userUPP) ;
17779 extern OSStatus
17780 InvokeExceptionHandlerUPP(
17781   ExceptionInformation * theException,
17782   ExceptionHandlerUPP userUPP) ;
17783 typedef ExceptionHandlerUPP ExceptionHandlerTPP;
17784 typedef ExceptionHandlerTPP ExceptionHandler;
17785 extern ExceptionHandlerTPP InstallExceptionHandler(ExceptionHandlerTPP theHandler) ;
17786
17787
17788
17789
17790
17791
17792 }
17793 extern "C" {
17794
17795
17796
17797
17798
17799
17800
17801
17802
17803 typedef struct OpaqueIOPreparationID* IOPreparationID;
17804 typedef struct OpaqueSoftwareInterruptID* SoftwareInterruptID;
17805 typedef struct OpaqueTaskID* TaskID;
17806 typedef struct OpaqueTimerID* TimerID;
17807
17808 typedef UInt32 ExecutionLevel;
17809 enum {
17810   kTaskLevel = 0,
17811   kSoftwareInterruptLevel = 1,
17812   kAcceptFunctionLevel = 2,
17813   kKernelLevel = 3,
17814   kSIHAcceptFunctionLevel = 4,
17815   kSecondaryInterruptLevel = 5,
17816   kHardwareInterruptLevel = 6,
17817   kMPTaskLevel = 7
17818 };
17819
17820 typedef void ( * SoftwareInterruptHandler)(void *p1, void *p2);
17821 typedef OSStatus ( * SecondaryInterruptHandler2)(void *p1, void *p2);
17822
17823
17824 struct LogicalAddressRange {
17825   LogicalAddress address;
17826   ByteCount count;
17827 };
17828 typedef struct LogicalAddressRange LogicalAddressRange;
17829 typedef LogicalAddressRange * LogicalAddressRangePtr;
17830 struct PhysicalAddressRange {
17831   PhysicalAddress address;
17832   ByteCount count;
17833 };
17834 typedef struct PhysicalAddressRange PhysicalAddressRange;
17835 typedef PhysicalAddressRange * PhysicalAddressRangePtr;
17836
17837 typedef OptionBits IOPreparationOptions;
17838 enum {
17839   kIOMultipleRanges = 0x00000001,
17840   kIOLogicalRanges = 0x00000002,
17841   kIOMinimalLogicalMapping = 0x00000004,
17842   kIOShareMappingTables = 0x00000008,
17843   kIOIsInput = 0x00000010,
17844   kIOIsOutput = 0x00000020,
17845   kIOCoherentDataPath = 0x00000040,
17846   kIOTransferIsLogical = 0x00000080,
17847   kIOClientIsUserMode = 0x00000080
17848 };
17849
17850 typedef OptionBits IOPreparationState;
17851 enum {
17852   kIOStateDone = 0x00000001
17853 };
17854
17855 enum {
17856   kInvalidPageAddress = (-1)
17857 };
17858
17859 struct AddressRange {
17860   void * base;
17861   ByteCount length;
17862 };
17863 typedef struct AddressRange AddressRange;
17864
17865
17866 typedef LogicalAddress * LogicalMappingTablePtr;
17867 typedef PhysicalAddress * PhysicalMappingTablePtr;
17868 typedef AddressRange * AddressRangeTablePtr;
17869 struct MultipleAddressRange {
17870   ItemCount entryCount;
17871   AddressRangeTablePtr rangeTable;
17872 };
17873 typedef struct MultipleAddressRange MultipleAddressRange;
17874
17875
17876
17877
17878 struct IOPreparationTable {
17879   IOPreparationOptions options;
17880   IOPreparationState state;
17881   IOPreparationID preparationID;
17882   AddressSpaceID addressSpace;
17883   ByteCount granularity;
17884   ByteCount firstPrepared;
17885   ByteCount lengthPrepared;
17886   ItemCount mappingEntryCount;
17887   LogicalMappingTablePtr logicalMapping;
17888   PhysicalMappingTablePtr physicalMapping;
17889   union {
17890     AddressRange range;
17891     MultipleAddressRange multipleRanges;
17892   } rangeInfo;
17893 };
17894 typedef struct IOPreparationTable IOPreparationTable;
17895
17896 typedef OptionBits IOCheckpointOptions;
17897 enum {
17898   kNextIOIsInput = 0x00000001,
17899   kNextIOIsOutput = 0x00000002,
17900   kMoreIOTransfers = 0x00000004
17901 };
17902
17903
17904
17905 typedef UInt32 ProcessorCacheMode;
17906 enum {
17907   kProcessorCacheModeDefault = 0,
17908   kProcessorCacheModeInhibited = 1,
17909   kProcessorCacheModeWriteThrough = 2,
17910   kProcessorCacheModeCopyBack = 3
17911 };
17912
17913
17914
17915
17916
17917
17918 enum {
17919   kPageInformationVersion = 1
17920 };
17921
17922 typedef UInt32 PageStateInformation;
17923 enum {
17924   kPageIsProtected = 0x00000001,
17925   kPageIsProtectedPrivileged = 0x00000002,
17926   kPageIsModified = 0x00000004,
17927   kPageIsReferenced = 0x00000008,
17928   kPageIsLockedResident = 0x00000010,
17929   kPageIsInMemory = 0x00000020,
17930   kPageIsShared = 0x00000040,
17931   kPageIsWriteThroughCached = 0x00000080,
17932   kPageIsCopyBackCached = 0x00000100,
17933   kPageIsHeldResident = 0x00000200,
17934   kPageIsLocked = kPageIsLockedResident,
17935   kPageIsResident = kPageIsInMemory
17936 };
17937
17938 struct PageInformation {
17939   AreaID area;
17940   ItemCount count;
17941   PageStateInformation information[1];
17942 };
17943 typedef struct PageInformation PageInformation;
17944 typedef PageInformation * PageInformationPtr;
17945 typedef LogicalAddress * DeviceLogicalAddressPtr;
17946 enum {
17947   durationMicrosecond = -1L,
17948   durationMillisecond = 1L,
17949   durationSecond = 1000L,
17950   durationMinute = 60000L,
17951   durationHour = 3600000L,
17952   durationDay = 86400000L,
17953   durationNoWait = 0L,
17954   durationForever = 0x7FFFFFFF
17955 };
17956
17957 enum {
17958   k8BitAccess = 0,
17959   k16BitAccess = 1,
17960   k32BitAccess = 2
17961 };
17962
17963 typedef UnsignedWide Nanoseconds;
17964 extern AbsoluteTime
17965 UpTime(void) ;
17966 extern Nanoseconds
17967 AbsoluteToNanoseconds(AbsoluteTime absoluteTime) ;
17968 extern Duration
17969 AbsoluteToDuration(AbsoluteTime absoluteTime) ;
17970 extern AbsoluteTime
17971 NanosecondsToAbsolute(Nanoseconds nanoseconds) ;
17972 extern AbsoluteTime
17973 DurationToAbsolute(Duration duration) ;
17974 extern AbsoluteTime
17975 AddAbsoluteToAbsolute(
17976   AbsoluteTime absoluteTime1,
17977   AbsoluteTime absoluteTime2) ;
17978 extern AbsoluteTime
17979 SubAbsoluteFromAbsolute(
17980   AbsoluteTime leftAbsoluteTime,
17981   AbsoluteTime rightAbsoluteTime) ;
17982 extern AbsoluteTime
17983 AddNanosecondsToAbsolute(
17984   Nanoseconds nanoseconds,
17985   AbsoluteTime absoluteTime) ;
17986 extern AbsoluteTime
17987 AddDurationToAbsolute(
17988   Duration duration,
17989   AbsoluteTime absoluteTime) ;
17990 extern AbsoluteTime
17991 SubNanosecondsFromAbsolute(
17992   Nanoseconds nanoseconds,
17993   AbsoluteTime absoluteTime) ;
17994 extern AbsoluteTime
17995 SubDurationFromAbsolute(
17996   Duration duration,
17997   AbsoluteTime absoluteTime) ;
17998 extern Nanoseconds
17999 AbsoluteDeltaToNanoseconds(
18000   AbsoluteTime leftAbsoluteTime,
18001   AbsoluteTime rightAbsoluteTime) ;
18002 extern Duration
18003 AbsoluteDeltaToDuration(
18004   AbsoluteTime leftAbsoluteTime,
18005   AbsoluteTime rightAbsoluteTime) ;
18006 extern Nanoseconds
18007 DurationToNanoseconds(Duration theDuration) ;
18008 extern Duration
18009 NanosecondsToDuration(Nanoseconds theNanoseconds) ;
18010 typedef struct OpaqueInterruptSetID* InterruptSetID;
18011 typedef long InterruptMemberNumber;
18012 struct InterruptSetMember {
18013   InterruptSetID setID;
18014   InterruptMemberNumber member;
18015 };
18016 typedef struct InterruptSetMember InterruptSetMember;
18017 enum {
18018   kISTChipInterruptSource = 0,
18019   kISTOutputDMAInterruptSource = 1,
18020   kISTInputDMAInterruptSource = 2,
18021   kISTPropertyMemberCount = 3
18022 };
18023
18024 typedef InterruptSetMember ISTProperty[3];
18025
18026
18027 typedef long InterruptReturnValue;
18028 enum {
18029   kFirstMemberNumber = 1,
18030   kIsrIsComplete = 0,
18031   kIsrIsNotComplete = -1,
18032   kMemberNumberParent = -2
18033 };
18034
18035 typedef Boolean InterruptSourceState;
18036 enum {
18037   kSourceWasEnabled = true,
18038   kSourceWasDisabled = false
18039 };
18040
18041
18042 typedef InterruptMemberNumber ( * InterruptHandler)(InterruptSetMember ISTmember, void *refCon, UInt32 theIntCount);
18043 typedef void ( * InterruptEnabler)(InterruptSetMember ISTmember, void *refCon);
18044 typedef InterruptSourceState ( * InterruptDisabler)(InterruptSetMember ISTmember, void *refCon);
18045 enum {
18046   kReturnToParentWhenComplete = 0x00000001,
18047   kReturnToParentWhenNotComplete = 0x00000002
18048 };
18049
18050 typedef OptionBits InterruptSetOptions;
18051
18052
18053 }
18054
18055
18056
18057
18058
18059
18060
18061 extern "C" {
18062
18063
18064 struct NumFormatString {
18065   UInt8 fLength;
18066   UInt8 fVersion;
18067   char data[254];
18068 };
18069 typedef struct NumFormatString NumFormatString;
18070 typedef NumFormatString NumFormatStringRec;
18071 typedef short FormatStatus;
18072 enum {
18073   fVNumber = 0
18074 };
18075
18076 typedef SInt8 FormatClass;
18077 enum {
18078   fPositive = 0,
18079   fNegative = 1,
18080   fZero = 2
18081 };
18082
18083 typedef SInt8 FormatResultType;
18084 enum {
18085   fFormatOK = 0,
18086   fBestGuess = 1,
18087   fOutOfSynch = 2,
18088   fSpuriousChars = 3,
18089   fMissingDelimiter = 4,
18090   fExtraDecimal = 5,
18091   fMissingLiteral = 6,
18092   fExtraExp = 7,
18093   fFormatOverflow = 8,
18094   fFormStrIsNAN = 9,
18095   fBadPartsTable = 10,
18096   fExtraPercent = 11,
18097   fExtraSeparator = 12,
18098   fEmptyFormatString = 13
18099 };
18100
18101 struct FVector {
18102   short start;
18103   short length;
18104 };
18105 typedef struct FVector FVector;
18106
18107 typedef FVector TripleInt[3];
18108 extern void
18109 StringToNum(
18110   ConstStr255Param theString,
18111   long * theNum) ;
18112 extern void
18113 NumToString(
18114   long theNum,
18115   Str255 theString) ;
18116 extern FormatStatus
18117 ExtendedToString(
18118   const extended80 * x,
18119   const NumFormatString * myCanonical,
18120   const NumberParts * partsTable,
18121   Str255 outString) ;
18122 extern FormatStatus
18123 StringToExtended(
18124   ConstStr255Param source,
18125   const NumFormatString * myCanonical,
18126   const NumberParts * partsTable,
18127   extended80 * x) ;
18128 extern FormatStatus
18129 StringToFormatRec(
18130   ConstStr255Param inString,
18131   const NumberParts * partsTable,
18132   NumFormatString * outString) ;
18133 extern FormatStatus
18134 FormatRecToString(
18135   const NumFormatString * myCanonical,
18136   const NumberParts * partsTable,
18137   Str255 outString,
18138   TripleInt positions) ;
18139
18140
18141 }
18142
18143
18144
18145
18146
18147
18148
18149 extern "C" {
18150 enum {
18151
18152   systemCurLang = -2,
18153   systemDefLang = -3,
18154   currentCurLang = -4,
18155   currentDefLang = -5,
18156   scriptCurLang = -6,
18157   scriptDefLang = -7
18158 };
18159
18160
18161 enum {
18162   iuSystemCurLang = systemCurLang,
18163   iuSystemDefLang = systemDefLang,
18164   iuCurrentCurLang = currentCurLang,
18165   iuCurrentDefLang = currentDefLang,
18166   iuScriptCurLang = scriptCurLang,
18167   iuScriptDefLang = scriptDefLang
18168 };
18169 extern short
18170 ReplaceText(
18171   Handle baseText,
18172   Handle substitutionText,
18173   Str15 key) ;
18174 extern short
18175 ScriptOrder(
18176   ScriptCode script1,
18177   ScriptCode script2) ;
18178 extern short
18179 CompareString(
18180   ConstStr255Param aStr,
18181   ConstStr255Param bStr,
18182   Handle itl2Handle) ;
18183 extern short
18184 IdenticalString(
18185   ConstStr255Param aStr,
18186   ConstStr255Param bStr,
18187   Handle itl2Handle) ;
18188 extern short
18189 StringOrder(
18190   ConstStr255Param aStr,
18191   ConstStr255Param bStr,
18192   ScriptCode aScript,
18193   ScriptCode bScript,
18194   LangCode aLang,
18195   LangCode bLang) ;
18196 extern short
18197 CompareText(
18198   const void * aPtr,
18199   const void * bPtr,
18200   short aLen,
18201   short bLen,
18202   Handle itl2Handle) ;
18203 extern short
18204 IdenticalText(
18205   const void * aPtr,
18206   const void * bPtr,
18207   short aLen,
18208   short bLen,
18209   Handle itl2Handle) ;
18210 extern short
18211 TextOrder(
18212   const void * aPtr,
18213   const void * bPtr,
18214   short aLen,
18215   short bLen,
18216   ScriptCode aScript,
18217   ScriptCode bScript,
18218   LangCode aLang,
18219   LangCode bLang) ;
18220 extern short
18221 LanguageOrder(
18222   LangCode language1,
18223   LangCode language2) ;
18224 extern short
18225 RelString(
18226   ConstStr255Param str1,
18227   ConstStr255Param str2,
18228   Boolean caseSensitive,
18229   Boolean diacSensitive) ;
18230 extern Boolean
18231 EqualString(
18232   ConstStr255Param str1,
18233   ConstStr255Param str2,
18234   Boolean caseSensitive,
18235   Boolean diacSensitive) ;
18236 extern short
18237 relstring(
18238   const char * str1,
18239   const char * str2,
18240   Boolean caseSensitive,
18241   Boolean diacSensitive) ;
18242 }
18243
18244
18245
18246 extern "C" {
18247
18248
18249 struct ScriptRunStatus {
18250   SInt8 script;
18251   SInt8 runVariant;
18252 };
18253 typedef struct ScriptRunStatus ScriptRunStatus;
18254 struct BreakTable {
18255   char charTypes[256];
18256   short tripleLength;
18257   short triples[1];
18258 };
18259 typedef struct BreakTable BreakTable;
18260 typedef BreakTable * BreakTablePtr;
18261 struct NBreakTable {
18262   SInt8 flags1;
18263   SInt8 flags2;
18264   short version;
18265   short classTableOff;
18266   short auxCTableOff;
18267   short backwdTableOff;
18268   short forwdTableOff;
18269   short doBackup;
18270   short length;
18271   char charTypes[256];
18272   short tables[1];
18273 };
18274 typedef struct NBreakTable NBreakTable;
18275 typedef NBreakTable * NBreakTablePtr;
18276 extern long
18277 Munger(
18278   Handle h,
18279   long offset,
18280   const void * ptr1,
18281   long len1,
18282   const void * ptr2,
18283   long len2) ;
18284 extern StringHandle
18285 NewString(ConstStr255Param theString) ;
18286 extern void
18287 SetString(
18288   StringHandle theString,
18289   ConstStr255Param strNew) ;
18290 extern StringHandle
18291 GetString(short stringID) ;
18292 extern void
18293 GetIndString(
18294   Str255 theString,
18295   short strListID,
18296   short index) ;
18297 extern void
18298 FindWordBreaks(
18299   Ptr textPtr,
18300   short textLength,
18301   short offset,
18302   Boolean leadingEdge,
18303   BreakTablePtr breaks,
18304   OffsetTable offsets,
18305   ScriptCode script) ;
18306 extern void
18307 LowercaseText(
18308   Ptr textPtr,
18309   short len,
18310   ScriptCode script) ;
18311 extern void
18312 UppercaseText(
18313   Ptr textPtr,
18314   short len,
18315   ScriptCode script) ;
18316 extern void
18317 StripDiacritics(
18318   Ptr textPtr,
18319   short len,
18320   ScriptCode script) ;
18321 extern void
18322 UppercaseStripDiacritics(
18323   Ptr textPtr,
18324   short len,
18325   ScriptCode script) ;
18326 extern ScriptRunStatus
18327 FindScriptRun(
18328   Ptr textPtr,
18329   long textLen,
18330   long * lenUsed) ;
18331 extern void
18332 UpperString(
18333   Str255 theString,
18334   Boolean diacSensitive) ;
18335 extern void
18336 upperstring(
18337   char * theString,
18338   Boolean diacSensitive) ;
18339 extern void
18340 c2pstrcpy(
18341   Str255 dst,
18342   const char * src) ;
18343 extern void
18344 p2cstrcpy(
18345   char * dst,
18346   ConstStr255Param src) ;
18347 extern void
18348 CopyPascalStringToC(
18349   ConstStr255Param src,
18350   char * dst) ;
18351 extern void
18352 CopyCStringToPascal(
18353   const char * src,
18354   Str255 dst) ;
18355
18356
18357 }
18358
18359
18360
18361 extern "C" {
18362
18363
18364 extern Boolean
18365 BitTst(
18366   const void * bytePtr,
18367   long bitNum) ;
18368 extern void
18369 BitSet(
18370   void * bytePtr,
18371   long bitNum) ;
18372 extern void
18373 BitClr(
18374   void * bytePtr,
18375   long bitNum) ;
18376 extern long
18377 BitAnd(
18378   long value1,
18379   long value2) ;
18380 extern long
18381 BitOr(
18382   long value1,
18383   long value2) ;
18384 extern long
18385 BitXor(
18386   long value1,
18387   long value2) ;
18388 extern long
18389 BitNot(long value) ;
18390 extern long
18391 BitShift(
18392   long value,
18393   short count) ;
18394
18395
18396
18397
18398
18399
18400
18401
18402 }
18403
18404
18405
18406
18407
18408
18409
18410 extern "C" {
18411
18412
18413 typedef UInt16 UCKeyOutput;
18414 typedef UInt16 UCKeyCharSeq;
18415 enum {
18416   kUCKeyOutputStateIndexMask = 0x4000,
18417   kUCKeyOutputSequenceIndexMask = 0x8000,
18418   kUCKeyOutputTestForIndexMask = 0xC000,
18419   kUCKeyOutputGetIndexMask = 0x3FFF
18420 };
18421 struct UCKeyStateRecord {
18422   UCKeyCharSeq stateZeroCharData;
18423   UInt16 stateZeroNextState;
18424   UInt16 stateEntryCount;
18425   UInt16 stateEntryFormat;
18426
18427
18428   UInt32 stateEntryData[1];
18429 };
18430 typedef struct UCKeyStateRecord UCKeyStateRecord;
18431
18432
18433
18434
18435 enum {
18436   kUCKeyStateEntryTerminalFormat = 0x0001,
18437   kUCKeyStateEntryRangeFormat = 0x0002
18438 };
18439
18440
18441
18442
18443
18444
18445 struct UCKeyStateEntryTerminal {
18446   UInt16 curState;
18447   UCKeyCharSeq charData;
18448 };
18449 typedef struct UCKeyStateEntryTerminal UCKeyStateEntryTerminal;
18450
18451
18452
18453
18454
18455
18456
18457 struct UCKeyStateEntryRange {
18458   UInt16 curStateStart;
18459   UInt8 curStateRange;
18460   UInt8 deltaMultiplier;
18461   UCKeyCharSeq charData;
18462   UInt16 nextState;
18463 };
18464 typedef struct UCKeyStateEntryRange UCKeyStateEntryRange;
18465 struct UCKeyboardTypeHeader {
18466   UInt32 keyboardTypeFirst;
18467   UInt32 keyboardTypeLast;
18468   ByteOffset keyModifiersToTableNumOffset;
18469   ByteOffset keyToCharTableIndexOffset;
18470   ByteOffset keyStateRecordsIndexOffset;
18471   ByteOffset keyStateTerminatorsOffset;
18472   ByteOffset keySequenceDataIndexOffset;
18473 };
18474 typedef struct UCKeyboardTypeHeader UCKeyboardTypeHeader;
18475 struct UCKeyboardLayout {
18476
18477   UInt16 keyLayoutHeaderFormat;
18478   UInt16 keyLayoutDataVersion;
18479   ByteOffset keyLayoutFeatureInfoOffset;
18480   ItemCount keyboardTypeCount;
18481   UCKeyboardTypeHeader keyboardTypeList[1];
18482 };
18483 typedef struct UCKeyboardLayout UCKeyboardLayout;
18484
18485 struct UCKeyLayoutFeatureInfo {
18486   UInt16 keyLayoutFeatureInfoFormat;
18487   UInt16 reserved;
18488   UniCharCount maxOutputStringLength;
18489 };
18490 typedef struct UCKeyLayoutFeatureInfo UCKeyLayoutFeatureInfo;
18491
18492 struct UCKeyModifiersToTableNum {
18493   UInt16 keyModifiersToTableNumFormat;
18494   UInt16 defaultTableNum;
18495   ItemCount modifiersCount;
18496   UInt8 tableNum[1];
18497
18498
18499 };
18500 typedef struct UCKeyModifiersToTableNum UCKeyModifiersToTableNum;
18501
18502 struct UCKeyToCharTableIndex {
18503   UInt16 keyToCharTableIndexFormat;
18504   UInt16 keyToCharTableSize;
18505   ItemCount keyToCharTableCount;
18506   ByteOffset keyToCharTableOffsets[1];
18507
18508
18509
18510
18511
18512
18513 };
18514 typedef struct UCKeyToCharTableIndex UCKeyToCharTableIndex;
18515
18516 struct UCKeyStateRecordsIndex {
18517   UInt16 keyStateRecordsIndexFormat;
18518   UInt16 keyStateRecordCount;
18519   ByteOffset keyStateRecordOffsets[1];
18520
18521
18522
18523
18524 };
18525 typedef struct UCKeyStateRecordsIndex UCKeyStateRecordsIndex;
18526
18527 struct UCKeyStateTerminators {
18528   UInt16 keyStateTerminatorsFormat;
18529   UInt16 keyStateTerminatorCount;
18530   UCKeyCharSeq keyStateTerminators[1];
18531
18532
18533
18534 };
18535 typedef struct UCKeyStateTerminators UCKeyStateTerminators;
18536
18537 struct UCKeySequenceDataIndex {
18538   UInt16 keySequenceDataIndexFormat;
18539   UInt16 charSequenceCount;
18540   UInt16 charSequenceOffsets[1];
18541
18542
18543
18544
18545
18546 };
18547 typedef struct UCKeySequenceDataIndex UCKeySequenceDataIndex;
18548
18549
18550
18551 enum {
18552   kUCKeyLayoutHeaderFormat = 0x1002,
18553   kUCKeyLayoutFeatureInfoFormat = 0x2001,
18554   kUCKeyModifiersToTableNumFormat = 0x3001,
18555   kUCKeyToCharTableIndexFormat = 0x4001,
18556   kUCKeyStateRecordsIndexFormat = 0x5001,
18557   kUCKeyStateTerminatorsFormat = 0x6001,
18558   kUCKeySequenceDataIndexFormat = 0x7001
18559 };
18560 enum {
18561   kUCKeyActionDown = 0,
18562   kUCKeyActionUp = 1,
18563   kUCKeyActionAutoKey = 2,
18564   kUCKeyActionDisplay = 3
18565 };
18566
18567
18568
18569
18570
18571
18572
18573 enum {
18574   kUCKeyTranslateNoDeadKeysBit = 0
18575 };
18576
18577 enum {
18578   kUCKeyTranslateNoDeadKeysMask = 1L << kUCKeyTranslateNoDeadKeysBit
18579 };
18580
18581
18582
18583
18584
18585
18586
18587 enum {
18588   kUnicodeCollationClass = 'ucol'
18589 };
18590
18591 typedef struct OpaqueCollatorRef* CollatorRef;
18592 typedef UInt32 UCCollateOptions;
18593 enum {
18594
18595   kUCCollateComposeInsensitiveMask = 1L << 1,
18596   kUCCollateWidthInsensitiveMask = 1L << 2,
18597   kUCCollateCaseInsensitiveMask = 1L << 3,
18598   kUCCollateDiacritInsensitiveMask = 1L << 4,
18599   kUCCollatePunctuationSignificantMask = 1L << 15,
18600   kUCCollateDigitsOverrideMask = 1L << 16,
18601   kUCCollateDigitsAsNumberMask = 1L << 17
18602 };
18603
18604 enum {
18605   kUCCollateStandardOptions = kUCCollateComposeInsensitiveMask | kUCCollateWidthInsensitiveMask
18606 };
18607
18608
18609
18610
18611
18612 enum {
18613   kUCCollateTypeHFSExtended = 1
18614 };
18615
18616
18617 enum {
18618   kUCCollateTypeSourceMask = 0x000000FF,
18619   kUCCollateTypeShiftBits = 24
18620 };
18621
18622 enum {
18623   kUCCollateTypeMask = kUCCollateTypeSourceMask << kUCCollateTypeShiftBits
18624 };
18625
18626
18627 typedef UInt32 UCCollationValue;
18628
18629
18630
18631
18632
18633
18634 enum {
18635   kUnicodeTextBreakClass = 'ubrk'
18636 };
18637
18638 typedef struct OpaqueTextBreakLocatorRef* TextBreakLocatorRef;
18639 typedef UInt32 UCTextBreakType;
18640 enum {
18641   kUCTextBreakCharMask = 1L << 0,
18642   kUCTextBreakClusterMask = 1L << 2,
18643   kUCTextBreakWordMask = 1L << 4,
18644   kUCTextBreakLineMask = 1L << 6
18645 };
18646
18647 typedef UInt32 UCTextBreakOptions;
18648 enum {
18649   kUCTextBreakLeadingEdgeMask = 1L << 0,
18650   kUCTextBreakGoBackwardsMask = 1L << 1,
18651   kUCTextBreakIterateMask = 1L << 2
18652 };
18653 extern OSStatus
18654 UCKeyTranslate(
18655   const UCKeyboardLayout * keyLayoutPtr,
18656   UInt16 virtualKeyCode,
18657   UInt16 keyAction,
18658   UInt32 modifierKeyState,
18659   UInt32 keyboardType,
18660   OptionBits keyTranslateOptions,
18661   UInt32 * deadKeyState,
18662   UniCharCount maxStringLength,
18663   UniCharCount * actualStringLength,
18664   UniChar unicodeString[]) ;
18665 extern OSStatus
18666 UCCreateCollator(
18667   LocaleRef locale,
18668   LocaleOperationVariant opVariant,
18669   UCCollateOptions options,
18670   CollatorRef * collatorRef) ;
18671 extern OSStatus
18672 UCGetCollationKey(
18673   CollatorRef collatorRef,
18674   const UniChar * textPtr,
18675   UniCharCount textLength,
18676   ItemCount maxKeySize,
18677   ItemCount * actualKeySize,
18678   UCCollationValue collationKey[]) ;
18679 extern OSStatus
18680 UCCompareCollationKeys(
18681   const UCCollationValue * key1Ptr,
18682   ItemCount key1Length,
18683   const UCCollationValue * key2Ptr,
18684   ItemCount key2Length,
18685   Boolean * equivalent,
18686   SInt32 * order) ;
18687 extern OSStatus
18688 UCCompareText(
18689   CollatorRef collatorRef,
18690   const UniChar * text1Ptr,
18691   UniCharCount text1Length,
18692   const UniChar * text2Ptr,
18693   UniCharCount text2Length,
18694   Boolean * equivalent,
18695   SInt32 * order) ;
18696 extern OSStatus
18697 UCDisposeCollator(CollatorRef * collatorRef) ;
18698 extern OSStatus
18699 UCCompareTextDefault(
18700   UCCollateOptions options,
18701   const UniChar * text1Ptr,
18702   UniCharCount text1Length,
18703   const UniChar * text2Ptr,
18704   UniCharCount text2Length,
18705   Boolean * equivalent,
18706   SInt32 * order) ;
18707 extern OSStatus
18708 UCCompareTextNoLocale(
18709   UCCollateOptions options,
18710   const UniChar * text1Ptr,
18711   UniCharCount text1Length,
18712   const UniChar * text2Ptr,
18713   UniCharCount text2Length,
18714   Boolean * equivalent,
18715   SInt32 * order) ;
18716 extern OSStatus
18717 UCCreateTextBreakLocator(
18718   LocaleRef locale,
18719   LocaleOperationVariant opVariant,
18720   UCTextBreakType breakTypes,
18721   TextBreakLocatorRef * breakRef) ;
18722 extern OSStatus
18723 UCFindTextBreak(
18724   TextBreakLocatorRef breakRef,
18725   UCTextBreakType breakType,
18726   UCTextBreakOptions options,
18727   const UniChar * textPtr,
18728   UniCharCount textLength,
18729   UniCharArrayOffset startOffset,
18730   UniCharArrayOffset * breakOffset) ;
18731 extern OSStatus
18732 UCDisposeTextBreakLocator(TextBreakLocatorRef * breakRef) ;
18733
18734
18735
18736
18737
18738 }
18739
18740
18741
18742 extern double acos (double);
18743 extern double asin (double);
18744 extern double atan (double);
18745 extern double atan2 (double, double);
18746 extern double ceil (double);
18747 extern double cos (double);
18748 extern double cosh (double);
18749 extern double exp (double);
18750 extern double fabs (double);
18751 extern double floor (double);
18752 extern double fmod (double, double);
18753 extern double frexp (double, int *);
18754 extern double ldexp (double, int);
18755 extern double log10 (double);
18756 extern double log (double);
18757 extern double modf (double, double *);
18758 extern double pow (double, double);
18759 extern double sin (double);
18760 extern double sinh (double);
18761 extern double sqrt (double);
18762 extern double tan (double);
18763 extern double tanh (double);
18764 extern "C" {
18765
18766
18767 extern const double_t pi;
18768 extern double_t compound(double_t rate, double_t periods) ;
18769 extern double_t annuity(double_t rate, double_t periods) ;
18770 extern double_t randomx(double_t * x) ;
18771 typedef short relop;
18772 enum {
18773   GREATERTHAN = 0,
18774   LESSTHAN = 1,
18775   EQUALTO = 2,
18776   UNORDERED = 3
18777 };
18778 extern relop relation(double_t x, double_t y) ;
18779 struct decimal {
18780     char sgn;
18781     char unused;
18782     short exp;
18783     struct {
18784         unsigned char length;
18785         unsigned char text[36];
18786         unsigned char unused;
18787     } sig;
18788 };
18789 typedef struct decimal decimal;
18790
18791 struct decform {
18792     char style;
18793     char unused;
18794     short digits;
18795 };
18796 typedef struct decform decform;
18797 extern void num2dec(const decform *f, double_t x, decimal *d) ;
18798 extern double_t dec2num(const decimal * d) ;
18799 extern void dec2str(const decform *f, const decimal *d, char *s) ;
18800 extern void str2dec(const char *s, short *ix, decimal *d, short *vp) ;
18801 extern float dec2f(const decimal * d) ;
18802 extern short dec2s(const decimal * d) ;
18803 extern long dec2l(const decimal * d) ;
18804 extern long double cosl(long double x);
18805
18806
18807     inline long double cosl(long double x) { return (long double) cos((double)(x)); }
18808 extern long double sinl(long double x);
18809
18810
18811     inline long double sinl(long double x) { return (long double) sin((double)(x)); }
18812 extern long double tanl(long double x);
18813
18814
18815     inline long double tanl(long double x) { return (long double) tan((double)(x)); }
18816 extern long double acosl(long double x);
18817
18818
18819     inline long double acosl(long double x) { return (long double) acos((double)(x)); }
18820 extern long double asinl(long double x);
18821
18822
18823     inline long double asinl(long double x) { return (long double) asin((double)(x)); }
18824 extern long double atanl(long double x);
18825
18826
18827     inline long double atanl(long double x) { return (long double) atan((double)(x)); }
18828 extern long double atan2l(long double y, long double x);
18829
18830
18831     inline long double atan2l(long double y, long double x) { return (long double) atan2((double)(y), (double)(x)); }
18832 extern long double coshl(long double x);
18833
18834
18835     inline long double coshl(long double x) { return (long double) cosh((double)(x)); }
18836 extern long double sinhl(long double x);
18837
18838
18839     inline long double sinhl(long double x) { return (long double) sinh((double)(x)); }
18840 extern long double tanhl(long double x);
18841
18842
18843     inline long double tanhl(long double x) { return (long double) tanh((double)(x)); }
18844 extern long double acoshl(long double x);
18845
18846
18847     inline long double acoshl(long double x) { return (long double) acosh((double)(x)); }
18848 extern long double asinhl(long double x);
18849
18850
18851     inline long double asinhl(long double x) { return (long double) asinh((double)(x)); }
18852 extern long double atanhl(long double x);
18853
18854
18855     inline long double atanhl(long double x) { return (long double) atanh((double)(x)); }
18856 extern long double expl(long double x);
18857
18858
18859     inline long double expl(long double x) { return (long double) exp((double)(x)); }
18860 extern long double expm1l(long double x);
18861
18862
18863     inline long double expm1l(long double x) { return (long double) expm1((double)(x)); }
18864 extern long double exp2l(long double x);
18865
18866
18867     inline long double exp2l(long double x) { return (long double) exp2((double)(x)); }
18868 extern long double frexpl(long double x, int *exponent);
18869
18870
18871     inline long double frexpl(long double x, int *exponent) { return (long double) frexp((double)(x), (exponent)); }
18872 extern long double ldexpl(long double x, int n);
18873
18874
18875     inline long double ldexpl(long double x, int n) { return (long double) ldexp((double)(x), (n)); }
18876 extern long double logl(long double x);
18877
18878
18879     inline long double logl(long double x) { return (long double) log((double)(x)); }
18880 extern long double log1pl(long double x);
18881
18882
18883     inline long double log1pl(long double x) { return (long double) log1p((double)(x)); }
18884 extern long double log10l(long double x);
18885
18886
18887     inline long double log10l(long double x) { return (long double) log10((double)(x)); }
18888 extern long double log2l(long double x);
18889
18890
18891     inline long double log2l(long double x) { return (long double) log2((double)(x)); }
18892 extern long double logbl(long double x);
18893
18894
18895     inline long double logbl(long double x) { return (long double) logb((double)(x)); }
18896 extern long double scalbl(long double x, long n);
18897
18898
18899     inline long double scalbl(long double x, long n) { return (long double) scalb((double)(x), (n)); }
18900 extern long double fabsl(long double x);
18901
18902
18903     inline long double fabsl(long double x) { return (long double) fabs((double)(x)); }
18904 extern long double hypotl(long double x, long double y);
18905
18906
18907     inline long double hypotl(long double x, long double y) { return (long double) hypot((double)(x), (double)(y)); }
18908 extern long double powl(long double x, long double y);
18909
18910
18911     inline long double powl(long double x, long double y) { return (long double) pow((double)(x), (double)(y)); }
18912 extern long double sqrtl(long double x);
18913
18914
18915     inline long double sqrtl(long double x) { return (long double) sqrt((double)(x)); }
18916 extern long double erfl(long double x);
18917
18918
18919     inline long double erfl(long double x) { return (long double) erf((double)(x)); }
18920 extern long double erfcl(long double x);
18921
18922
18923     inline long double erfcl(long double x) { return (long double) erfc((double)(x)); }
18924 extern long double gammal(long double x);
18925
18926
18927     inline long double gammal(long double x) { return (long double) gamma((double)(x)); }
18928 extern long double lgammal(long double x);
18929
18930
18931     inline long double lgammal(long double x) { return (long double) lgamma((double)(x)); }
18932 extern long double ceill(long double x);
18933
18934
18935     inline long double ceill(long double x) { return (long double) ceil((double)(x)); }
18936 extern long double floorl(long double x);
18937
18938
18939     inline long double floorl(long double x) { return (long double) floor((double)(x)); }
18940 extern long double rintl(long double x);
18941
18942
18943     inline long double rintl(long double x) { return (long double) rint((double)(x)); }
18944 extern long double nearbyintl(long double x);
18945
18946
18947     inline long double nearbyintl(long double x) { return (long double) nearbyint((double)(x)); }
18948 extern long rinttoll(long double x);
18949
18950
18951     inline long rinttoll(long double x) { return rinttol((double)(x)); }
18952 extern long double roundl(long double x);
18953
18954
18955     inline long double roundl(long double x) { return (long double) round((double)(x)); }
18956 extern long roundtoll(long double x);
18957
18958
18959     inline long roundtoll(long double x) { return roundtol((double)(x)); }
18960 extern long double truncl(long double x);
18961
18962
18963     inline long double truncl(long double x) { return (long double) trunc((double)(x)); }
18964 extern long double remainderl(long double x, long double y);
18965
18966
18967     inline long double remainderl(long double x, long double y) { return (long double) remainder((double)(x), (double)(y)); }
18968 extern long double remquol(long double x, long double y, int *quo);
18969
18970
18971     inline long double remquol(long double x, long double y, int *quo) { return (long double) remquo((double)(x), (double)(y), (quo)); }
18972 extern long double copysignl(long double x, long double y);
18973
18974
18975     inline long double copysignl(long double x, long double y) { return (long double) copysign((double)(x), (double)(y)); }
18976 extern long double fdiml(long double x, long double y);
18977
18978
18979     inline long double fdiml(long double x, long double y) { return (long double) fdim((double)(x), (double)(y)); }
18980 extern long double fmaxl(long double x, long double y);
18981
18982
18983     inline long double fmaxl(long double x, long double y) { return (long double) fmax((double)(x), (double)(y)); }
18984 extern long double fminl(long double x, long double y);
18985
18986
18987     inline long double fminl(long double x, long double y) { return (long double) fmin((double)(x), (double)(y)); }
18988 extern relop relationl(long double x, long double y);
18989
18990
18991     inline relop relationl(long double x, long double y) { return relation((double)(x), (double)(y)); }
18992 extern void num2decl(const decform *f, long double x, decimal *d);
18993
18994
18995     inline void num2decl(const decform *f, long double x, decimal *d) { num2dec((f), (double)(x), (d)); }
18996 extern long double dec2numl(const decimal * d);
18997
18998
18999     inline long double dec2numl(const decimal *d) { return (long double) dec2num(d); }
19000 extern double x80tod(const extended80 * x80) ;
19001 extern void dtox80(const double *x, extended80 *x80) ;
19002 extern void x80told(const extended80 *x80, long double *x);
19003
19004
19005     inline void x80told(const extended80 *x80, long double *x) { *(x) = (long double) x80tod(x80); }
19006 extern void ldtox80(const long double *x, extended80 *x80);
19007
19008
19009     inline void ldtox80(const long double *x, extended80 *x80) { double d = (double) *(x); dtox80(&d, (x80)); }
19010
19011
19012 }
19013
19014
19015 extern "C" {
19016 typedef long fenv_t;
19017 typedef long fexcept_t;
19018
19019
19020 enum {
19021   FE_INEXACT = 0x02000000,
19022   FE_DIVBYZERO = 0x04000000,
19023   FE_UNDERFLOW = 0x08000000,
19024   FE_OVERFLOW = 0x10000000,
19025   FE_INVALID = 0x20000000,
19026   FE_ALL_EXCEPT = 0x3E000000
19027 };
19028
19029
19030
19031 enum {
19032   FE_TONEAREST = 0x00000000,
19033   FE_TOWARDZERO = 0x00000001,
19034   FE_UPWARD = 0x00000002,
19035   FE_DOWNWARD = 0x00000003
19036 };
19037
19038
19039 extern const fenv_t _FE_DFL_ENV;
19040 extern void feclearexcept(int excepts);
19041 extern void fegetexceptflag(fexcept_t *flagp, int excepts);
19042
19043
19044
19045
19046
19047
19048
19049 extern void feraiseexcept(int excepts);
19050 extern void fesetexceptflag(const fexcept_t *flagp, int excepts);
19051 extern int fetestexcept(int excepts);
19052 extern int fegetround(void);
19053 extern int fesetround(int round);
19054
19055
19056
19057
19058
19059
19060
19061 extern void fegetenv(fenv_t * envp);
19062 extern int feholdexcept(fenv_t * envp);
19063 extern void fesetenv(const fenv_t * envp);
19064 extern void feupdateenv(const fenv_t * envp);
19065
19066
19067
19068 }
19069
19070 extern "C" {
19071
19072
19073
19074 typedef OSType TECPluginSignature;
19075 typedef UInt32 TECPluginVersion;
19076
19077 enum {
19078   kTECSignature = 'encv',
19079   kTECUnicodePluginSignature = 'puni',
19080   kTECJapanesePluginSignature = 'pjpn',
19081   kTECChinesePluginSignature = 'pzho',
19082   kTECKoreanPluginSignature = 'pkor'
19083 };
19084
19085
19086
19087 typedef struct OpaqueTECObjectRef* TECObjectRef;
19088 typedef struct OpaqueTECSnifferObjectRef* TECSnifferObjectRef;
19089 typedef OSType TECPluginSig;
19090 struct TECConversionInfo {
19091   TextEncoding sourceEncoding;
19092   TextEncoding destinationEncoding;
19093   UInt16 reserved1;
19094   UInt16 reserved2;
19095 };
19096 typedef struct TECConversionInfo TECConversionInfo;
19097 extern OSStatus
19098 TECCountAvailableTextEncodings(ItemCount * numberEncodings) ;
19099 extern OSStatus
19100 TECGetAvailableTextEncodings(
19101   TextEncoding availableEncodings[],
19102   ItemCount maxAvailableEncodings,
19103   ItemCount * actualAvailableEncodings) ;
19104 extern OSStatus
19105 TECCountDirectTextEncodingConversions(ItemCount * numberOfEncodings) ;
19106 extern OSStatus
19107 TECGetDirectTextEncodingConversions(
19108   TECConversionInfo availableConversions[],
19109   ItemCount maxAvailableConversions,
19110   ItemCount * actualAvailableConversions) ;
19111 extern OSStatus
19112 TECCountDestinationTextEncodings(
19113   TextEncoding inputEncoding,
19114   ItemCount * numberOfEncodings) ;
19115 extern OSStatus
19116 TECGetDestinationTextEncodings(
19117   TextEncoding inputEncoding,
19118   TextEncoding destinationEncodings[],
19119   ItemCount maxDestinationEncodings,
19120   ItemCount * actualDestinationEncodings) ;
19121 extern OSStatus
19122 TECGetTextEncodingInternetName(
19123   TextEncoding textEncoding,
19124   Str255 encodingName) ;
19125 extern OSStatus
19126 TECGetTextEncodingFromInternetName(
19127   TextEncoding * textEncoding,
19128   ConstStr255Param encodingName) ;
19129 extern OSStatus
19130 TECCreateConverter(
19131   TECObjectRef * newEncodingConverter,
19132   TextEncoding inputEncoding,
19133   TextEncoding outputEncoding) ;
19134 extern OSStatus
19135 TECCreateConverterFromPath(
19136   TECObjectRef * newEncodingConverter,
19137   const TextEncoding inPath[],
19138   ItemCount inEncodings) ;
19139 extern OSStatus
19140 TECDisposeConverter(TECObjectRef newEncodingConverter) ;
19141 extern OSStatus
19142 TECClearConverterContextInfo(TECObjectRef encodingConverter) ;
19143 extern OSStatus
19144 TECConvertText(
19145   TECObjectRef encodingConverter,
19146   ConstTextPtr inputBuffer,
19147   ByteCount inputBufferLength,
19148   ByteCount * actualInputLength,
19149   TextPtr outputBuffer,
19150   ByteCount outputBufferLength,
19151   ByteCount * actualOutputLength) ;
19152 extern OSStatus
19153 TECFlushText(
19154   TECObjectRef encodingConverter,
19155   TextPtr outputBuffer,
19156   ByteCount outputBufferLength,
19157   ByteCount * actualOutputLength) ;
19158 extern OSStatus
19159 TECCountSubTextEncodings(
19160   TextEncoding inputEncoding,
19161   ItemCount * numberOfEncodings) ;
19162 extern OSStatus
19163 TECGetSubTextEncodings(
19164   TextEncoding inputEncoding,
19165   TextEncoding subEncodings[],
19166   ItemCount maxSubEncodings,
19167   ItemCount * actualSubEncodings) ;
19168 extern OSStatus
19169 TECGetEncodingList(
19170   TECObjectRef encodingConverter,
19171   ItemCount * numEncodings,
19172   Handle * encodingList) ;
19173 extern OSStatus
19174 TECCreateOneToManyConverter(
19175   TECObjectRef * newEncodingConverter,
19176   TextEncoding inputEncoding,
19177   ItemCount numOutputEncodings,
19178   const TextEncoding outputEncodings[]) ;
19179 extern OSStatus
19180 TECConvertTextToMultipleEncodings(
19181   TECObjectRef encodingConverter,
19182   ConstTextPtr inputBuffer,
19183   ByteCount inputBufferLength,
19184   ByteCount * actualInputLength,
19185   TextPtr outputBuffer,
19186   ByteCount outputBufferLength,
19187   ByteCount * actualOutputLength,
19188   TextEncodingRun outEncodingsBuffer[],
19189   ItemCount maxOutEncodingRuns,
19190   ItemCount * actualOutEncodingRuns) ;
19191 extern OSStatus
19192 TECFlushMultipleEncodings(
19193   TECObjectRef encodingConverter,
19194   TextPtr outputBuffer,
19195   ByteCount outputBufferLength,
19196   ByteCount * actualOutputLength,
19197   TextEncodingRun outEncodingsBuffer[],
19198   ItemCount maxOutEncodingRuns,
19199   ItemCount * actualOutEncodingRuns) ;
19200 extern OSStatus
19201 TECCountWebTextEncodings(
19202   RegionCode locale,
19203   ItemCount * numberEncodings) ;
19204 extern OSStatus
19205 TECGetWebTextEncodings(
19206   RegionCode locale,
19207   TextEncoding availableEncodings[],
19208   ItemCount maxAvailableEncodings,
19209   ItemCount * actualAvailableEncodings) ;
19210 extern OSStatus
19211 TECCountMailTextEncodings(
19212   RegionCode locale,
19213   ItemCount * numberEncodings) ;
19214 extern OSStatus
19215 TECGetMailTextEncodings(
19216   RegionCode locale,
19217   TextEncoding availableEncodings[],
19218   ItemCount maxAvailableEncodings,
19219   ItemCount * actualAvailableEncodings) ;
19220 extern OSStatus
19221 TECCountAvailableSniffers(ItemCount * numberOfEncodings) ;
19222 extern OSStatus
19223 TECGetAvailableSniffers(
19224   TextEncoding availableSniffers[],
19225   ItemCount maxAvailableSniffers,
19226   ItemCount * actualAvailableSniffers) ;
19227 extern OSStatus
19228 TECCreateSniffer(
19229   TECSnifferObjectRef * encodingSniffer,
19230   TextEncoding testEncodings[],
19231   ItemCount numTextEncodings) ;
19232 extern OSStatus
19233 TECSniffTextEncoding(
19234   TECSnifferObjectRef encodingSniffer,
19235   TextPtr inputBuffer,
19236   ByteCount inputBufferLength,
19237   TextEncoding testEncodings[],
19238   ItemCount numTextEncodings,
19239   ItemCount numErrsArray[],
19240   ItemCount maxErrs,
19241   ItemCount numFeaturesArray[],
19242   ItemCount maxFeatures) ;
19243 extern OSStatus
19244 TECDisposeSniffer(TECSnifferObjectRef encodingSniffer) ;
19245 extern OSStatus
19246 TECClearSnifferContextInfo(TECSnifferObjectRef encodingSniffer) ;
19247
19248
19249 }
19250
19251
19252
19253 extern "C" {
19254
19255
19256
19257
19258 typedef struct OpaqueTextToUnicodeInfo* TextToUnicodeInfo;
19259 typedef struct OpaqueUnicodeToTextInfo* UnicodeToTextInfo;
19260 typedef struct OpaqueUnicodeToTextRunInfo* UnicodeToTextRunInfo;
19261 typedef const TextToUnicodeInfo ConstTextToUnicodeInfo;
19262 typedef const UnicodeToTextInfo ConstUnicodeToTextInfo;
19263
19264 typedef SInt32 UnicodeMapVersion;
19265 enum {
19266   kUnicodeUseLatestMapping = -1,
19267   kUnicodeUseHFSPlusMapping = 4
19268 };
19269
19270
19271 struct UnicodeMapping {
19272   TextEncoding unicodeEncoding;
19273   TextEncoding otherEncoding;
19274   UnicodeMapVersion mappingVersion;
19275 };
19276 typedef struct UnicodeMapping UnicodeMapping;
19277 typedef UnicodeMapping * UnicodeMappingPtr;
19278 typedef const UnicodeMapping * ConstUnicodeMappingPtr;
19279
19280 enum {
19281   kUnicodeUseFallbacksBit = 0,
19282   kUnicodeKeepInfoBit = 1,
19283   kUnicodeDirectionalityBits = 2,
19284   kUnicodeVerticalFormBit = 4,
19285   kUnicodeLooseMappingsBit = 5,
19286   kUnicodeStringUnterminatedBit = 6,
19287   kUnicodeTextRunBit = 7,
19288   kUnicodeKeepSameEncodingBit = 8,
19289   kUnicodeForceASCIIRangeBit = 9,
19290   kUnicodeNoHalfwidthCharsBit = 10,
19291   kUnicodeTextRunHeuristicsBit = 11,
19292   kUnicodeMapLineFeedToReturnBit = 12
19293 };
19294
19295 enum {
19296   kUnicodeUseFallbacksMask = 1L << kUnicodeUseFallbacksBit,
19297   kUnicodeKeepInfoMask = 1L << kUnicodeKeepInfoBit,
19298   kUnicodeDirectionalityMask = 3L << kUnicodeDirectionalityBits,
19299   kUnicodeVerticalFormMask = 1L << kUnicodeVerticalFormBit,
19300   kUnicodeLooseMappingsMask = 1L << kUnicodeLooseMappingsBit,
19301   kUnicodeStringUnterminatedMask = 1L << kUnicodeStringUnterminatedBit,
19302   kUnicodeTextRunMask = 1L << kUnicodeTextRunBit,
19303   kUnicodeKeepSameEncodingMask = 1L << kUnicodeKeepSameEncodingBit,
19304   kUnicodeForceASCIIRangeMask = 1L << kUnicodeForceASCIIRangeBit,
19305   kUnicodeNoHalfwidthCharsMask = 1L << kUnicodeNoHalfwidthCharsBit,
19306   kUnicodeTextRunHeuristicsMask = 1L << kUnicodeTextRunHeuristicsBit,
19307   kUnicodeMapLineFeedToReturnMask = 1L << kUnicodeMapLineFeedToReturnBit
19308 };
19309
19310
19311 enum {
19312   kUnicodeDefaultDirection = 0,
19313   kUnicodeLeftToRight = 1,
19314   kUnicodeRightToLeft = 2
19315 };
19316
19317
19318 enum {
19319   kUnicodeDefaultDirectionMask = kUnicodeDefaultDirection << kUnicodeDirectionalityBits,
19320   kUnicodeLeftToRightMask = kUnicodeLeftToRight << kUnicodeDirectionalityBits,
19321   kUnicodeRightToLeftMask = kUnicodeRightToLeft << kUnicodeDirectionalityBits
19322 };
19323 enum {
19324   kUnicodeMatchUnicodeBaseBit = 0,
19325   kUnicodeMatchUnicodeVariantBit = 1,
19326   kUnicodeMatchUnicodeFormatBit = 2,
19327   kUnicodeMatchOtherBaseBit = 3,
19328   kUnicodeMatchOtherVariantBit = 4,
19329   kUnicodeMatchOtherFormatBit = 5
19330 };
19331
19332 enum {
19333   kUnicodeMatchUnicodeBaseMask = 1L << kUnicodeMatchUnicodeBaseBit,
19334   kUnicodeMatchUnicodeVariantMask = 1L << kUnicodeMatchUnicodeVariantBit,
19335   kUnicodeMatchUnicodeFormatMask = 1L << kUnicodeMatchUnicodeFormatBit,
19336   kUnicodeMatchOtherBaseMask = 1L << kUnicodeMatchOtherBaseBit,
19337   kUnicodeMatchOtherVariantMask = 1L << kUnicodeMatchOtherVariantBit,
19338   kUnicodeMatchOtherFormatMask = 1L << kUnicodeMatchOtherFormatBit
19339 };
19340
19341
19342 enum {
19343   kUnicodeFallbackSequencingBits = 0
19344 };
19345
19346 enum {
19347   kUnicodeFallbackSequencingMask = 3L << kUnicodeFallbackSequencingBits,
19348   kUnicodeFallbackInterruptSafeMask = 1L << 2
19349 };
19350
19351
19352 enum {
19353   kUnicodeFallbackDefaultOnly = 0L,
19354   kUnicodeFallbackCustomOnly = 1L,
19355   kUnicodeFallbackDefaultFirst = 2L,
19356   kUnicodeFallbackCustomFirst = 3L
19357 };
19358
19359
19360
19361 typedef OSStatus ( * UnicodeToTextFallbackProcPtr)(UniChar *iSrcUniStr, ByteCount iSrcUniStrLen, ByteCount *oSrcConvLen, TextPtr oDestStr, ByteCount iDestStrLen, ByteCount *oDestConvLen, LogicalAddress iInfoPtr, ConstUnicodeMappingPtr iUnicodeMappingPtr);
19362 typedef UnicodeToTextFallbackProcPtr UnicodeToTextFallbackUPP;
19363 extern UnicodeToTextFallbackUPP
19364 NewUnicodeToTextFallbackUPP(UnicodeToTextFallbackProcPtr userRoutine) ;
19365 extern void
19366 DisposeUnicodeToTextFallbackUPP(UnicodeToTextFallbackUPP userUPP) ;
19367 extern OSStatus
19368 InvokeUnicodeToTextFallbackUPP(
19369   UniChar * iSrcUniStr,
19370   ByteCount iSrcUniStrLen,
19371   ByteCount * oSrcConvLen,
19372   TextPtr oDestStr,
19373   ByteCount iDestStrLen,
19374   ByteCount * oDestConvLen,
19375   LogicalAddress iInfoPtr,
19376   ConstUnicodeMappingPtr iUnicodeMappingPtr,
19377   UnicodeToTextFallbackUPP userUPP) ;
19378 extern OSStatus
19379 CreateTextToUnicodeInfo(
19380   ConstUnicodeMappingPtr iUnicodeMapping,
19381   TextToUnicodeInfo * oTextToUnicodeInfo) ;
19382 extern OSStatus
19383 CreateTextToUnicodeInfoByEncoding(
19384   TextEncoding iEncoding,
19385   TextToUnicodeInfo * oTextToUnicodeInfo) ;
19386 extern OSStatus
19387 CreateUnicodeToTextInfo(
19388   ConstUnicodeMappingPtr iUnicodeMapping,
19389   UnicodeToTextInfo * oUnicodeToTextInfo) ;
19390 extern OSStatus
19391 CreateUnicodeToTextInfoByEncoding(
19392   TextEncoding iEncoding,
19393   UnicodeToTextInfo * oUnicodeToTextInfo) ;
19394 extern OSStatus
19395 CreateUnicodeToTextRunInfo(
19396   ItemCount iNumberOfMappings,
19397   const UnicodeMapping iUnicodeMappings[],
19398   UnicodeToTextRunInfo * oUnicodeToTextInfo) ;
19399 extern OSStatus
19400 CreateUnicodeToTextRunInfoByEncoding(
19401   ItemCount iNumberOfEncodings,
19402   const TextEncoding iEncodings[],
19403   UnicodeToTextRunInfo * oUnicodeToTextInfo) ;
19404 extern OSStatus
19405 CreateUnicodeToTextRunInfoByScriptCode(
19406   ItemCount iNumberOfScriptCodes,
19407   const ScriptCode iScripts[],
19408   UnicodeToTextRunInfo * oUnicodeToTextInfo) ;
19409 extern OSStatus
19410 ChangeTextToUnicodeInfo(
19411   TextToUnicodeInfo ioTextToUnicodeInfo,
19412   ConstUnicodeMappingPtr iUnicodeMapping) ;
19413 extern OSStatus
19414 ChangeUnicodeToTextInfo(
19415   UnicodeToTextInfo ioUnicodeToTextInfo,
19416   ConstUnicodeMappingPtr iUnicodeMapping) ;
19417 extern OSStatus
19418 DisposeTextToUnicodeInfo(TextToUnicodeInfo * ioTextToUnicodeInfo) ;
19419 extern OSStatus
19420 DisposeUnicodeToTextInfo(UnicodeToTextInfo * ioUnicodeToTextInfo) ;
19421 extern OSStatus
19422 DisposeUnicodeToTextRunInfo(UnicodeToTextRunInfo * ioUnicodeToTextRunInfo) ;
19423 extern OSStatus
19424 ConvertFromTextToUnicode(
19425   TextToUnicodeInfo iTextToUnicodeInfo,
19426   ByteCount iSourceLen,
19427   ConstLogicalAddress iSourceStr,
19428   OptionBits iControlFlags,
19429   ItemCount iOffsetCount,
19430   ByteOffset iOffsetArray[],
19431   ItemCount * oOffsetCount,
19432   ByteOffset oOffsetArray[],
19433   ByteCount iOutputBufLen,
19434   ByteCount * oSourceRead,
19435   ByteCount * oUnicodeLen,
19436   UniChar oUnicodeStr[]) ;
19437 extern OSStatus
19438 ConvertFromUnicodeToText(
19439   UnicodeToTextInfo iUnicodeToTextInfo,
19440   ByteCount iUnicodeLen,
19441   const UniChar iUnicodeStr[],
19442   OptionBits iControlFlags,
19443   ItemCount iOffsetCount,
19444   ByteOffset iOffsetArray[],
19445   ItemCount * oOffsetCount,
19446   ByteOffset oOffsetArray[],
19447   ByteCount iOutputBufLen,
19448   ByteCount * oInputRead,
19449   ByteCount * oOutputLen,
19450   LogicalAddress oOutputStr) ;
19451 extern OSStatus
19452 ConvertFromUnicodeToTextRun(
19453   UnicodeToTextRunInfo iUnicodeToTextInfo,
19454   ByteCount iUnicodeLen,
19455   const UniChar iUnicodeStr[],
19456   OptionBits iControlFlags,
19457   ItemCount iOffsetCount,
19458   ByteOffset iOffsetArray[],
19459   ItemCount * oOffsetCount,
19460   ByteOffset oOffsetArray[],
19461   ByteCount iOutputBufLen,
19462   ByteCount * oInputRead,
19463   ByteCount * oOutputLen,
19464   LogicalAddress oOutputStr,
19465   ItemCount iEncodingRunBufLen,
19466   ItemCount * oEncodingRunOutLen,
19467   TextEncodingRun oEncodingRuns[]) ;
19468 extern OSStatus
19469 ConvertFromUnicodeToScriptCodeRun(
19470   UnicodeToTextRunInfo iUnicodeToTextInfo,
19471   ByteCount iUnicodeLen,
19472   const UniChar iUnicodeStr[],
19473   OptionBits iControlFlags,
19474   ItemCount iOffsetCount,
19475   ByteOffset iOffsetArray[],
19476   ItemCount * oOffsetCount,
19477   ByteOffset oOffsetArray[],
19478   ByteCount iOutputBufLen,
19479   ByteCount * oInputRead,
19480   ByteCount * oOutputLen,
19481   LogicalAddress oOutputStr,
19482   ItemCount iScriptRunBufLen,
19483   ItemCount * oScriptRunOutLen,
19484   ScriptCodeRun oScriptCodeRuns[]) ;
19485 extern OSStatus
19486 TruncateForTextToUnicode(
19487   ConstTextToUnicodeInfo iTextToUnicodeInfo,
19488   ByteCount iSourceLen,
19489   ConstLogicalAddress iSourceStr,
19490   ByteCount iMaxLen,
19491   ByteCount * oTruncatedLen) ;
19492 extern OSStatus
19493 TruncateForUnicodeToText(
19494   ConstUnicodeToTextInfo iUnicodeToTextInfo,
19495   ByteCount iSourceLen,
19496   const UniChar iSourceStr[],
19497   OptionBits iControlFlags,
19498   ByteCount iMaxLen,
19499   ByteCount * oTruncatedLen) ;
19500 extern OSStatus
19501 ConvertFromPStringToUnicode(
19502   TextToUnicodeInfo iTextToUnicodeInfo,
19503   ConstStr255Param iPascalStr,
19504   ByteCount iOutputBufLen,
19505   ByteCount * oUnicodeLen,
19506   UniChar oUnicodeStr[]) ;
19507 extern OSStatus
19508 ConvertFromUnicodeToPString(
19509   UnicodeToTextInfo iUnicodeToTextInfo,
19510   ByteCount iUnicodeLen,
19511   const UniChar iUnicodeStr[],
19512   Str255 oPascalStr) ;
19513 extern OSStatus
19514 CountUnicodeMappings(
19515   OptionBits iFilter,
19516   ConstUnicodeMappingPtr iFindMapping,
19517   ItemCount * oActualCount) ;
19518 extern OSStatus
19519 QueryUnicodeMappings(
19520   OptionBits iFilter,
19521   ConstUnicodeMappingPtr iFindMapping,
19522   ItemCount iMaxCount,
19523   ItemCount * oActualCount,
19524   UnicodeMapping oReturnedMappings[]) ;
19525 extern OSStatus
19526 SetFallbackUnicodeToText(
19527   UnicodeToTextInfo iUnicodeToTextInfo,
19528   UnicodeToTextFallbackUPP iFallback,
19529   OptionBits iControlFlags,
19530   LogicalAddress iInfoPtr) ;
19531 extern OSStatus
19532 SetFallbackUnicodeToTextRun(
19533   UnicodeToTextRunInfo iUnicodeToTextRunInfo,
19534   UnicodeToTextFallbackUPP iFallback,
19535   OptionBits iControlFlags,
19536   LogicalAddress iInfoPtr) ;
19537 extern OSStatus
19538 ResetTextToUnicodeInfo(TextToUnicodeInfo ioTextToUnicodeInfo) ;
19539 extern OSStatus
19540 ResetUnicodeToTextInfo(UnicodeToTextInfo ioUnicodeToTextInfo) ;
19541 extern OSStatus
19542 ResetUnicodeToTextRunInfo(UnicodeToTextRunInfo ioUnicodeToTextRunInfo) ;
19543
19544
19545
19546
19547
19548
19549 }
19550
19551
19552
19553 extern "C" {
19554
19555
19556
19557
19558 typedef UInt16 ThreadState;
19559 enum {
19560   kReadyThreadState = 0,
19561   kStoppedThreadState = 1,
19562   kRunningThreadState = 2
19563 };
19564
19565
19566
19567
19568 typedef void * ThreadTaskRef;
19569
19570 typedef UInt32 ThreadStyle;
19571 enum {
19572   kCooperativeThread = 1L << 0,
19573   kPreemptiveThread = 1L << 1
19574 };
19575
19576
19577 typedef UInt32 ThreadID;
19578 enum {
19579   kNoThreadID = 0,
19580   kCurrentThreadID = 1,
19581   kApplicationThreadID = 2
19582 };
19583
19584
19585 typedef UInt32 ThreadOptions;
19586 enum {
19587   kNewSuspend = (1 << 0),
19588   kUsePremadeThread = (1 << 1),
19589   kCreateIfNeeded = (1 << 2),
19590   kFPUNotNeeded = (1 << 3),
19591   kExactMatchThread = (1 << 4)
19592 };
19593
19594
19595 struct SchedulerInfoRec {
19596   UInt32 InfoRecSize;
19597   ThreadID CurrentThreadID;
19598   ThreadID SuggestedThreadID;
19599   ThreadID InterruptedCoopThreadID;
19600 };
19601 typedef struct SchedulerInfoRec SchedulerInfoRec;
19602 typedef SchedulerInfoRec * SchedulerInfoRecPtr;
19603
19604
19605
19606
19607
19608
19609 typedef void * voidPtr;
19610
19611 typedef voidPtr ( * ThreadEntryProcPtr)(void * threadParam);
19612
19613 typedef ThreadID ( * ThreadSchedulerProcPtr)(SchedulerInfoRecPtr schedulerInfo);
19614
19615 typedef void ( * ThreadSwitchProcPtr)(ThreadID threadBeingSwitched, void *switchProcParam);
19616
19617 typedef void ( * ThreadTerminationProcPtr)(ThreadID threadTerminated, void *terminationProcParam);
19618
19619 typedef void ( * DebuggerNewThreadProcPtr)(ThreadID threadCreated);
19620
19621 typedef void ( * DebuggerDisposeThreadProcPtr)(ThreadID threadDeleted);
19622
19623 typedef ThreadID ( * DebuggerThreadSchedulerProcPtr)(SchedulerInfoRecPtr schedulerInfo);
19624 typedef ThreadEntryProcPtr ThreadEntryUPP;
19625 typedef ThreadSchedulerProcPtr ThreadSchedulerUPP;
19626 typedef ThreadSwitchProcPtr ThreadSwitchUPP;
19627 typedef ThreadTerminationProcPtr ThreadTerminationUPP;
19628 typedef DebuggerNewThreadProcPtr DebuggerNewThreadUPP;
19629 typedef DebuggerDisposeThreadProcPtr DebuggerDisposeThreadUPP;
19630 typedef DebuggerThreadSchedulerProcPtr DebuggerThreadSchedulerUPP;
19631 extern ThreadEntryUPP
19632 NewThreadEntryUPP(ThreadEntryProcPtr userRoutine) ;
19633 extern ThreadSchedulerUPP
19634 NewThreadSchedulerUPP(ThreadSchedulerProcPtr userRoutine) ;
19635 extern ThreadSwitchUPP
19636 NewThreadSwitchUPP(ThreadSwitchProcPtr userRoutine) ;
19637 extern ThreadTerminationUPP
19638 NewThreadTerminationUPP(ThreadTerminationProcPtr userRoutine) ;
19639 extern DebuggerNewThreadUPP
19640 NewDebuggerNewThreadUPP(DebuggerNewThreadProcPtr userRoutine) ;
19641 extern DebuggerDisposeThreadUPP
19642 NewDebuggerDisposeThreadUPP(DebuggerDisposeThreadProcPtr userRoutine) ;
19643 extern DebuggerThreadSchedulerUPP
19644 NewDebuggerThreadSchedulerUPP(DebuggerThreadSchedulerProcPtr userRoutine) ;
19645 extern void
19646 DisposeThreadEntryUPP(ThreadEntryUPP userUPP) ;
19647 extern void
19648 DisposeThreadSchedulerUPP(ThreadSchedulerUPP userUPP) ;
19649 extern void
19650 DisposeThreadSwitchUPP(ThreadSwitchUPP userUPP) ;
19651 extern void
19652 DisposeThreadTerminationUPP(ThreadTerminationUPP userUPP) ;
19653 extern void
19654 DisposeDebuggerNewThreadUPP(DebuggerNewThreadUPP userUPP) ;
19655 extern void
19656 DisposeDebuggerDisposeThreadUPP(DebuggerDisposeThreadUPP userUPP) ;
19657 extern void
19658 DisposeDebuggerThreadSchedulerUPP(DebuggerThreadSchedulerUPP userUPP) ;
19659 extern voidPtr
19660 InvokeThreadEntryUPP(
19661   void * threadParam,
19662   ThreadEntryUPP userUPP) ;
19663 extern ThreadID
19664 InvokeThreadSchedulerUPP(
19665   SchedulerInfoRecPtr schedulerInfo,
19666   ThreadSchedulerUPP userUPP) ;
19667 extern void
19668 InvokeThreadSwitchUPP(
19669   ThreadID threadBeingSwitched,
19670   void * switchProcParam,
19671   ThreadSwitchUPP userUPP) ;
19672 extern void
19673 InvokeThreadTerminationUPP(
19674   ThreadID threadTerminated,
19675   void * terminationProcParam,
19676   ThreadTerminationUPP userUPP) ;
19677 extern void
19678 InvokeDebuggerNewThreadUPP(
19679   ThreadID threadCreated,
19680   DebuggerNewThreadUPP userUPP) ;
19681 extern void
19682 InvokeDebuggerDisposeThreadUPP(
19683   ThreadID threadDeleted,
19684   DebuggerDisposeThreadUPP userUPP) ;
19685 extern ThreadID
19686 InvokeDebuggerThreadSchedulerUPP(
19687   SchedulerInfoRecPtr schedulerInfo,
19688   DebuggerThreadSchedulerUPP userUPP) ;
19689 typedef ThreadEntryUPP ThreadEntryTPP;
19690 typedef ThreadSchedulerUPP ThreadSchedulerTPP;
19691 typedef ThreadSwitchUPP ThreadSwitchTPP;
19692 typedef ThreadTerminationUPP ThreadTerminationTPP;
19693 typedef DebuggerNewThreadUPP DebuggerNewThreadTPP;
19694 typedef DebuggerDisposeThreadUPP DebuggerDisposeThreadTPP;
19695 typedef DebuggerThreadSchedulerUPP DebuggerThreadSchedulerTPP;
19696 extern OSErr
19697 NewThread(
19698   ThreadStyle threadStyle,
19699   ThreadEntryTPP threadEntry,
19700   void * threadParam,
19701   Size stackSize,
19702   ThreadOptions options,
19703   void ** threadResult,
19704   ThreadID * threadMade) ;
19705 extern OSErr
19706 SetThreadScheduler(ThreadSchedulerTPP threadScheduler) ;
19707 extern OSErr
19708 SetThreadSwitcher(
19709   ThreadID thread,
19710   ThreadSwitchTPP threadSwitcher,
19711   void * switchProcParam,
19712   Boolean inOrOut) ;
19713 extern OSErr
19714 SetThreadTerminator(
19715   ThreadID thread,
19716   ThreadTerminationTPP threadTerminator,
19717   void * terminationProcParam) ;
19718 extern OSErr
19719 SetDebuggerNotificationProcs(
19720   DebuggerNewThreadTPP notifyNewThread,
19721   DebuggerDisposeThreadTPP notifyDisposeThread,
19722   DebuggerThreadSchedulerTPP notifyThreadScheduler) ;
19723 extern OSErr
19724 CreateThreadPool(
19725   ThreadStyle threadStyle,
19726   SInt16 numToCreate,
19727   Size stackSize) ;
19728 extern OSErr
19729 GetFreeThreadCount(
19730   ThreadStyle threadStyle,
19731   SInt16 * freeCount) ;
19732 extern OSErr
19733 GetSpecificFreeThreadCount(
19734   ThreadStyle threadStyle,
19735   Size stackSize,
19736   SInt16 * freeCount) ;
19737 extern OSErr
19738 GetDefaultThreadStackSize(
19739   ThreadStyle threadStyle,
19740   Size * stackSize) ;
19741 extern OSErr
19742 ThreadCurrentStackSpace(
19743   ThreadID thread,
19744   UInt32 * freeStack) ;
19745 extern OSErr
19746 DisposeThread(
19747   ThreadID threadToDump,
19748   void * threadResult,
19749   Boolean recycleThread) ;
19750 extern OSErr
19751 YieldToThread(ThreadID suggestedThread) ;
19752 extern OSErr
19753 YieldToAnyThread(void) ;
19754 extern OSErr
19755 GetCurrentThread(ThreadID * currentThreadID) ;
19756 extern OSErr
19757 GetThreadState(
19758   ThreadID threadToGet,
19759   ThreadState * threadState) ;
19760 extern OSErr
19761 SetThreadState(
19762   ThreadID threadToSet,
19763   ThreadState newState,
19764   ThreadID suggestedThread) ;
19765 extern OSErr
19766 SetThreadStateEndCritical(
19767   ThreadID threadToSet,
19768   ThreadState newState,
19769   ThreadID suggestedThread) ;
19770 extern OSErr
19771 ThreadBeginCritical(void) ;
19772 extern OSErr
19773 ThreadEndCritical(void) ;
19774 extern OSErr
19775 GetThreadCurrentTaskRef(ThreadTaskRef * threadTRef) ;
19776 extern OSErr
19777 GetThreadStateGivenTaskRef(
19778   ThreadTaskRef threadTRef,
19779   ThreadID threadToGet,
19780   ThreadState * threadState) ;
19781 extern OSErr
19782 SetThreadReadyGivenTaskRef(
19783   ThreadTaskRef threadTRef,
19784   ThreadID threadToSet) ;
19785
19786
19787
19788
19789
19790 }
19791
19792
19793
19794 extern "C" {
19795
19796
19797
19798 enum {
19799   kOnSystemDisk = -32768L,
19800   kOnAppropriateDisk = -32767,
19801
19802
19803   kSystemDomain = -32766,
19804   kLocalDomain = -32765,
19805   kNetworkDomain = -32764,
19806   kUserDomain = -32763,
19807   kClassicDomain = -32762
19808 };
19809
19810
19811
19812
19813
19814 enum {
19815   kLastDomainConstant = kUserDomain
19816 };
19817
19818 enum {
19819   kCreateFolder = true,
19820   kDontCreateFolder = false
19821 };
19822
19823 enum {
19824   kSystemFolderType = 'macs',
19825   kDesktopFolderType = 'desk',
19826   kSystemDesktopFolderType = 'sdsk',
19827   kTrashFolderType = 'trsh',
19828   kSystemTrashFolderType = 'strs',
19829   kWhereToEmptyTrashFolderType = 'empt',
19830   kPrintMonitorDocsFolderType = 'prnt',
19831   kStartupFolderType = 'strt',
19832   kShutdownFolderType = 'shdf',
19833   kAppleMenuFolderType = 'amnu',
19834   kControlPanelFolderType = 'ctrl',
19835   kSystemControlPanelFolderType = 'sctl',
19836   kExtensionFolderType = 'extn',
19837   kFontsFolderType = 'font',
19838   kPreferencesFolderType = 'pref',
19839   kSystemPreferencesFolderType = 'sprf',
19840   kTemporaryFolderType = 'temp'
19841 };
19842 extern OSErr
19843 FindFolder(
19844   short vRefNum,
19845   OSType folderType,
19846   Boolean createFolder,
19847   short * foundVRefNum,
19848   long * foundDirID) ;
19849 extern OSErr
19850 FindFolderExtended(
19851   short vol,
19852   OSType foldType,
19853   Boolean createFolder,
19854   UInt32 flags,
19855   void * data,
19856   short * vRefNum,
19857   long * dirID) ;
19858 extern OSErr
19859 ReleaseFolder(
19860   short vRefNum,
19861   OSType folderType) ;
19862 extern OSErr
19863 FSFindFolder(
19864   short vRefNum,
19865   OSType folderType,
19866   Boolean createFolder,
19867   FSRef * foundRef) ;
19868 extern OSErr
19869 FSFindFolderExtended(
19870   short vol,
19871   OSType foldType,
19872   Boolean createFolder,
19873   UInt32 flags,
19874   void * data,
19875   FSRef * foundRef) ;
19876 enum {
19877   kExtensionDisabledFolderType = 'extD',
19878   kControlPanelDisabledFolderType = 'ctrD',
19879   kSystemExtensionDisabledFolderType = 'macD',
19880   kStartupItemsDisabledFolderType = 'strD',
19881   kShutdownItemsDisabledFolderType = 'shdD',
19882   kApplicationsFolderType = 'apps',
19883   kDocumentsFolderType = 'docs'
19884 };
19885
19886 enum {
19887
19888   kVolumeRootFolderType = 'root',
19889   kChewableItemsFolderType = 'flnt',
19890   kApplicationSupportFolderType = 'asup',
19891   kTextEncodingsFolderType = 'Ätex',
19892   kStationeryFolderType = 'odst',
19893   kOpenDocFolderType = 'odod',
19894   kOpenDocShellPlugInsFolderType = 'odsp',
19895   kEditorsFolderType = 'oded',
19896   kOpenDocEditorsFolderType = 'Äodf',
19897   kOpenDocLibrariesFolderType = 'odlb',
19898   kGenEditorsFolderType = 'Äedi',
19899   kHelpFolderType = 'Ählp',
19900   kInternetPlugInFolderType = 'Änet',
19901   kModemScriptsFolderType = 'Ämod',
19902   kPrinterDescriptionFolderType = 'ppdf',
19903   kPrinterDriverFolderType = 'Äprd',
19904   kScriptingAdditionsFolderType = 'Äscr',
19905   kSharedLibrariesFolderType = 'Älib',
19906   kVoicesFolderType = 'fvoc',
19907   kControlStripModulesFolderType = 'sdev',
19908   kAssistantsFolderType = 'astÄ',
19909   kUtilitiesFolderType = 'utiÄ',
19910   kAppleExtrasFolderType = 'aexÄ',
19911   kContextualMenuItemsFolderType = 'cmnu',
19912   kMacOSReadMesFolderType = 'morÄ',
19913   kALMModulesFolderType = 'walk',
19914   kALMPreferencesFolderType = 'trip',
19915   kALMLocationsFolderType = 'fall',
19916   kColorSyncProfilesFolderType = 'prof',
19917   kThemesFolderType = 'thme',
19918   kFavoritesFolderType = 'favs',
19919   kInternetFolderType = 'intÄ',
19920   kAppearanceFolderType = 'appr',
19921   kSoundSetsFolderType = 'snds',
19922   kDesktopPicturesFolderType = 'dtpÄ',
19923   kInternetSearchSitesFolderType = 'issf',
19924   kFindSupportFolderType = 'fnds',
19925   kFindByContentFolderType = 'fbcf',
19926   kInstallerLogsFolderType = 'ilgf',
19927   kScriptsFolderType = 'scrÄ',
19928   kFolderActionsFolderType = 'fasf',
19929   kLauncherItemsFolderType = 'laun',
19930   kRecentApplicationsFolderType = 'rapp',
19931   kRecentDocumentsFolderType = 'rdoc',
19932   kRecentServersFolderType = 'rsvr',
19933   kSpeakableItemsFolderType = 'spki',
19934   kKeychainFolderType = 'kchn',
19935   kQuickTimeExtensionsFolderType = 'qtex',
19936   kDisplayExtensionsFolderType = 'dspl',
19937   kMultiprocessingFolderType = 'mpxf',
19938   kPrintingPlugInsFolderType = 'pplg'
19939 };
19940
19941
19942
19943
19944 enum {
19945   kDomainTopLevelFolderType = 'dtop',
19946   kDomainLibraryFolderType = 'dlib',
19947   kColorSyncFolderType = 'sync',
19948   kColorSyncCMMFolderType = 'ccmm',
19949   kColorSyncScriptingFolderType = 'cscr',
19950   kPrintersFolderType = 'impr',
19951   kSpeechFolderType = 'spch',
19952   kCarbonLibraryFolderType = 'carb',
19953   kDocumentationFolderType = 'info',
19954   kDeveloperDocsFolderType = 'ddoc',
19955   kDeveloperHelpFolderType = 'devh',
19956   kISSDownloadsFolderType = 'issd',
19957   kUserSpecificTmpFolderType = 'utmp',
19958   kCachedDataFolderType = 'cach',
19959   kFrameworksFolderType = 'fram',
19960   kPrivateFrameworksFolderType = 'pfrm',
19961   kClassicDesktopFolderType = 'sdsk',
19962
19963
19964   kDeveloperFolderType = 'devf',
19965   kSystemSoundsFolderType = 'ssnd',
19966   kComponentsFolderType = 'cmpd',
19967   kQuickTimeComponentsFolderType = 'wcmp',
19968   kCoreServicesFolderType = 'csrv',
19969   kPictureDocumentsFolderType = 'pdoc',
19970   kMovieDocumentsFolderType = 'mdoc',
19971   kMusicDocumentsFolderType = 'µdoc',
19972   kInternetSitesFolderType = 'site',
19973   kPublicFolderType = 'pubb',
19974   kAudioSupportFolderType = 'adio',
19975   kAudioSoundsFolderType = 'asnd',
19976   kAudioSoundBanksFolderType = 'bank',
19977   kAudioAlertSoundsFolderType = 'alrt',
19978   kAudioPlugInsFolderType = 'aplg',
19979   kAudioComponentsFolderType = 'acmp',
19980   kKernelExtensionsFolderType = 'kext',
19981   kDirectoryServicesFolderType = 'dsrv',
19982   kDirectoryServicesPlugInsFolderType = 'dplg',
19983   kInstallerReceiptsFolderType = 'rcpt',
19984   kFileSystemSupportFolderType = 'fsys',
19985   kAppleShareSupportFolderType = 'shar',
19986   kAppleShareAuthenticationFolderType = 'auth',
19987   kMIDIDriversFolderType = 'midi',
19988   kKeyboardLayoutsFolderType = 'klay',
19989   kIndexFilesFolderType = 'indx',
19990   kFindByContentIndexesFolderType = 'fbcx',
19991   kManagedItemsFolderType = 'mang',
19992   kBootTimeStartupItemsFolderType = 'empz'
19993 };
19994
19995 enum {
19996   kLocalesFolderType = 'Äloc',
19997   kFindByContentPluginsFolderType = 'fbcp'
19998 };
19999
20000 enum {
20001   kUsersFolderType = 'usrs',
20002   kCurrentUserFolderType = 'cusr',
20003   kCurrentUserRemoteFolderLocation = 'rusf',
20004   kCurrentUserRemoteFolderType = 'rusr',
20005   kSharedUserDataFolderType = 'sdat',
20006   kVolumeSettingsFolderType = 'vsfd'
20007 };
20008
20009 enum {
20010   kAppleshareAutomountServerAliasesFolderType = 'srvÄ',
20011   kPreMacOS91ApplicationsFolderType = '\8cpps',
20012   kPreMacOS91InstallerLogsFolderType = '\94lgf',
20013   kPreMacOS91AssistantsFolderType = '\8cstÄ',
20014   kPreMacOS91UtilitiesFolderType = '\9ftiÄ',
20015   kPreMacOS91AppleExtrasFolderType = '\8cexÄ',
20016   kPreMacOS91MacOSReadMesFolderType = 'µorÄ',
20017   kPreMacOS91InternetFolderType = '\94ntÄ',
20018   kPreMacOS91AutomountedServersFolderType = '§rvÄ',
20019   kPreMacOS91StationeryFolderType = '¿dst'
20020 };
20021
20022
20023 enum {
20024   kCreateFolderAtBoot = 0x00000002,
20025   kCreateFolderAtBootBit = 1,
20026   kFolderCreatedInvisible = 0x00000004,
20027   kFolderCreatedInvisibleBit = 2,
20028   kFolderCreatedNameLocked = 0x00000008,
20029   kFolderCreatedNameLockedBit = 3,
20030   kFolderCreatedAdminPrivs = 0x00000010,
20031   kFolderCreatedAdminPrivsBit = 4
20032 };
20033
20034 enum {
20035   kFolderInUserFolder = 0x00000020,
20036   kFolderInUserFolderBit = 5,
20037   kFolderTrackedByAlias = 0x00000040,
20038   kFolderTrackedByAliasBit = 6,
20039   kFolderInRemoteUserFolderIfAvailable = 0x00000080,
20040   kFolderInRemoteUserFolderIfAvailableBit = 7,
20041   kFolderNeverMatchedInIdentifyFolder = 0x00000100,
20042   kFolderNeverMatchedInIdentifyFolderBit = 8,
20043   kFolderMustStayOnSameVolume = 0x00000200,
20044   kFolderMustStayOnSameVolumeBit = 9,
20045   kFolderManagerFolderInMacOS9FolderIfMacOSXIsInstalledMask = 0x00000400,
20046   kFolderManagerFolderInMacOS9FolderIfMacOSXIsInstalledBit = 10,
20047   kFolderInLocalOrRemoteUserFolder = kFolderInUserFolder | kFolderInRemoteUserFolderIfAvailable
20048 };
20049
20050 typedef UInt32 FolderDescFlags;
20051
20052 enum {
20053   kRelativeFolder = 'relf',
20054   kSpecialFolder = 'spcf'
20055 };
20056
20057 typedef OSType FolderClass;
20058
20059 enum {
20060   kBlessedFolder = 'blsf',
20061   kRootFolder = 'rotf'
20062 };
20063
20064 enum {
20065   kCurrentUserFolderLocation = 'cusf'
20066 };
20067
20068 typedef OSType FolderType;
20069 typedef OSType FolderLocation;
20070
20071 struct FolderDesc {
20072   Size descSize;
20073   FolderType foldType;
20074   FolderDescFlags flags;
20075   FolderClass foldClass;
20076   FolderType foldLocation;
20077   OSType badgeSignature;
20078   OSType badgeType;
20079   UInt32 reserved;
20080   StrFileName name;
20081 };
20082 typedef struct FolderDesc FolderDesc;
20083 typedef FolderDesc * FolderDescPtr;
20084
20085 typedef UInt32 RoutingFlags;
20086 struct FolderRouting {
20087   Size descSize;
20088   OSType fileType;
20089   FolderType routeFromFolder;
20090   FolderType routeToFolder;
20091   RoutingFlags flags;
20092 };
20093 typedef struct FolderRouting FolderRouting;
20094 typedef FolderRouting * FolderRoutingPtr;
20095
20096
20097 enum {
20098
20099
20100
20101   kFindFolderRedirectionFlagUseDistinctUserFoldersBit = 0,
20102
20103
20104   kFindFolderRedirectionFlagUseGivenVRefAndDirIDAsUserFolderBit = 1,
20105
20106
20107   kFindFolderRedirectionFlagsUseGivenVRefNumAndDirIDAsRemoteUserFolderBit = 2
20108 };
20109
20110 struct FindFolderUserRedirectionGlobals {
20111   UInt32 version;
20112   UInt32 flags;
20113
20114   Str31 userName;
20115   short userNameScript;
20116
20117   short currentUserFolderVRefNum;
20118   long currentUserFolderDirID;
20119
20120   short remoteUserFolderVRefNum;
20121   long remoteUserFolderDirID;
20122 };
20123 typedef struct FindFolderUserRedirectionGlobals FindFolderUserRedirectionGlobals;
20124 typedef FindFolderUserRedirectionGlobals * FindFolderUserRedirectionGlobalsPtr;
20125 enum {
20126   kFolderManagerUserRedirectionGlobalsCurrentVersion = 1
20127 };
20128
20129
20130
20131
20132
20133 enum {
20134   kFindFolderExtendedFlagsDoNotFollowAliasesBit = 0,
20135   kFindFolderExtendedFlagsDoNotUseUserFolderBit = 1,
20136   kFindFolderExtendedFlagsUseOtherUserRecord = 0x01000000
20137 };
20138
20139 typedef OSStatus ( * FolderManagerNotificationProcPtr)(OSType message, void *arg, void *userRefCon);
20140 typedef FolderManagerNotificationProcPtr FolderManagerNotificationUPP;
20141 extern FolderManagerNotificationUPP
20142 NewFolderManagerNotificationUPP(FolderManagerNotificationProcPtr userRoutine) ;
20143 extern void
20144 DisposeFolderManagerNotificationUPP(FolderManagerNotificationUPP userUPP) ;
20145 extern OSStatus
20146 InvokeFolderManagerNotificationUPP(
20147   OSType message,
20148   void * arg,
20149   void * userRefCon,
20150   FolderManagerNotificationUPP userUPP) ;
20151
20152 enum {
20153   kFolderManagerNotificationMessageUserLogIn = 'log+',
20154   kFolderManagerNotificationMessagePreUserLogIn = 'logj',
20155   kFolderManagerNotificationMessageUserLogOut = 'log-',
20156   kFolderManagerNotificationMessagePostUserLogOut = 'logp',
20157   kFolderManagerNotificationDiscardCachedData = 'dche',
20158   kFolderManagerNotificationMessageLoginStartup = 'stup'
20159 };
20160
20161
20162
20163 enum {
20164   kDoNotRemoveWhenCurrentApplicationQuitsBit = 0,
20165   kDoNotRemoveWheCurrentApplicationQuitsBit = kDoNotRemoveWhenCurrentApplicationQuitsBit
20166 };
20167
20168
20169 enum {
20170   kStopIfAnyNotificationProcReturnsErrorBit = 31
20171 };
20172 extern OSErr
20173 AddFolderDescriptor(
20174   FolderType foldType,
20175   FolderDescFlags flags,
20176   FolderClass foldClass,
20177   FolderLocation foldLocation,
20178   OSType badgeSignature,
20179   OSType badgeType,
20180   ConstStrFileNameParam name,
20181   Boolean replaceFlag) ;
20182 extern OSErr
20183 GetFolderDescriptor(
20184   FolderType foldType,
20185   Size descSize,
20186   FolderDesc * foldDesc) ;
20187 extern OSErr
20188 GetFolderTypes(
20189   UInt32 requestedTypeCount,
20190   UInt32 * totalTypeCount,
20191   FolderType * theTypes) ;
20192 extern OSErr
20193 RemoveFolderDescriptor(FolderType foldType) ;
20194 extern OSErr
20195 GetFolderName(
20196   short vRefNum,
20197   OSType foldType,
20198   short * foundVRefNum,
20199   StrFileName name) ;
20200 extern OSErr
20201 AddFolderRouting(
20202   OSType fileType,
20203   FolderType routeFromFolder,
20204   FolderType routeToFolder,
20205   RoutingFlags flags,
20206   Boolean replaceFlag) ;
20207 extern OSErr
20208 RemoveFolderRouting(
20209   OSType fileType,
20210   FolderType routeFromFolder) ;
20211 extern OSErr
20212 FindFolderRouting(
20213   OSType fileType,
20214   FolderType routeFromFolder,
20215   FolderType * routeToFolder,
20216   RoutingFlags * flags) ;
20217 extern OSErr
20218 GetFolderRoutings(
20219   UInt32 requestedRoutingCount,
20220   UInt32 * totalRoutingCount,
20221   Size routingSize,
20222   FolderRouting * theRoutings) ;
20223 extern OSErr
20224 InvalidateFolderDescriptorCache(
20225   short vRefNum,
20226   long dirID) ;
20227 extern OSErr
20228 IdentifyFolder(
20229   short vRefNum,
20230   long dirID,
20231   FolderType * foldType) ;
20232 extern OSErr
20233 FolderManagerRegisterNotificationProc(
20234   FolderManagerNotificationUPP notificationProc,
20235   void * refCon,
20236   UInt32 options) ;
20237 extern OSErr
20238 FolderManagerUnregisterNotificationProc(
20239   FolderManagerNotificationUPP notificationProc,
20240   void * refCon) ;
20241 extern OSStatus
20242 FolderManagerRegisterCallNotificationProcs(
20243   OSType message,
20244   void * arg,
20245   UInt32 options) ;
20246 struct MultiUserGestalt {
20247
20248   short giVersion;
20249   short giReserved0;
20250   short giReserved1;
20251   short giReserved2;
20252   short giReserved3;
20253   FSSpec giReserved4;
20254
20255
20256   short giDocsVRefNum;
20257   long giDocsDirID;
20258   short giForceSaves;
20259   short giForceOpens;
20260   Str31 giSetupName;
20261   Str31 giUserName;
20262   Str31 giFrontAppName;
20263   short giReserved5;
20264   short giIsOn;
20265
20266
20267
20268
20269
20270   short giUserLoggedInType;
20271   char giUserEncryptPwd[16];
20272   short giUserEnvironment;
20273   long giReserved6;
20274   long giReserved7;
20275   Boolean giDisableScrnShots;
20276
20277
20278   Boolean giSupportsAsyncFSCalls;
20279   short giPrefsVRefNum;
20280   long giPrefsDirID;
20281   unsigned long giUserLogInTime;
20282   Boolean giUsingPrintQuotas;
20283   Boolean giUsingDiskQuotas;
20284
20285
20286   Boolean giInSystemAccess;
20287   Boolean giUserFolderEnabled;
20288   short giReserved8;
20289   long giReserved9;
20290   Boolean giInLoginScreen;
20291
20292
20293
20294
20295 };
20296 typedef struct MultiUserGestalt MultiUserGestalt;
20297 typedef MultiUserGestalt * MultiUserGestaltPtr;
20298 typedef MultiUserGestaltPtr * MultiUserGestaltHandle;
20299
20300
20301
20302
20303
20304 }
20305
20306
20307
20308 extern "C" {
20309
20310
20311
20312 enum {
20313
20314   kTMTaskActive = (1L << 15)
20315 };
20316
20317 typedef struct TMTask TMTask;
20318 typedef TMTask * TMTaskPtr;
20319 typedef void ( * TimerProcPtr)(TMTaskPtr tmTaskPtr);
20320 typedef TimerProcPtr TimerUPP;
20321 struct TMTask {
20322   QElemPtr qLink;
20323   short qType;
20324   TimerUPP tmAddr;
20325   long tmCount;
20326   long tmWakeUp;
20327   long tmReserved;
20328 };
20329 extern void
20330 InsTime(QElemPtr tmTaskPtr) ;
20331 extern void
20332 InsXTime(QElemPtr tmTaskPtr) ;
20333 extern void
20334 PrimeTime(
20335   QElemPtr tmTaskPtr,
20336   long count) ;
20337 extern void
20338 RmvTime(QElemPtr tmTaskPtr) ;
20339 extern OSErr
20340 InstallTimeTask(QElemPtr tmTaskPtr) ;
20341 extern OSErr
20342 InstallXTimeTask(QElemPtr tmTaskPtr) ;
20343 extern OSErr
20344 PrimeTimeTask(
20345   QElemPtr tmTaskPtr,
20346   long count) ;
20347 extern OSErr
20348 RemoveTimeTask(QElemPtr tmTaskPtr) ;
20349 extern void
20350 Microseconds(UnsignedWide * microTickCount) ;
20351 extern TimerUPP
20352 NewTimerUPP(TimerProcPtr userRoutine) ;
20353 extern void
20354 DisposeTimerUPP(TimerUPP userUPP) ;
20355 extern void
20356 InvokeTimerUPP(
20357   TMTaskPtr tmTaskPtr,
20358   TimerUPP userUPP) ;
20359
20360
20361
20362
20363
20364
20365 }
20366
20367
20368
20369 enum {
20370
20371   kMPQueueInfoVersion = 1L | (kOpaqueQueueID << 16),
20372   kMPSemaphoreInfoVersion = 1L | (kOpaqueSemaphoreID << 16),
20373   kMPEventInfoVersion = 1L | (kOpaqueEventID << 16),
20374   kMPCriticalRegionInfoVersion = 1L | (kOpaqueCriticalRegionID << 16),
20375   kMPNotificationInfoVersion = 1L | (kOpaqueNotificationID << 16),
20376   kMPAddressSpaceInfoVersion = 1L | (kOpaqueAddressSpaceID << 16)
20377 };
20378
20379
20380 struct MPQueueInfo {
20381   PBVersion version;
20382
20383   MPProcessID processID;
20384   OSType queueName;
20385
20386   ItemCount nWaiting;
20387   MPTaskID waitingTaskID;
20388
20389   ItemCount nMessages;
20390   ItemCount nReserved;
20391
20392   void * p1;
20393   void * p2;
20394   void * p3;
20395 };
20396 typedef struct MPQueueInfo MPQueueInfo;
20397 struct MPSemaphoreInfo {
20398   PBVersion version;
20399
20400   MPProcessID processID;
20401   OSType semaphoreName;
20402
20403   ItemCount nWaiting;
20404   MPTaskID waitingTaskID;
20405
20406   ItemCount maximum;
20407   ItemCount count;
20408 };
20409 typedef struct MPSemaphoreInfo MPSemaphoreInfo;
20410 struct MPEventInfo {
20411   PBVersion version;
20412
20413   MPProcessID processID;
20414   OSType eventName;
20415
20416   ItemCount nWaiting;
20417   MPTaskID waitingTaskID;
20418
20419   MPEventFlags events;
20420 };
20421 typedef struct MPEventInfo MPEventInfo;
20422 struct MPCriticalRegionInfo {
20423   PBVersion version;
20424
20425   MPProcessID processID;
20426   OSType regionName;
20427
20428   ItemCount nWaiting;
20429   MPTaskID waitingTaskID;
20430
20431   MPTaskID owningTask;
20432   ItemCount count;
20433 };
20434 typedef struct MPCriticalRegionInfo MPCriticalRegionInfo;
20435 struct MPNotificationInfo {
20436   PBVersion version;
20437
20438   MPProcessID processID;
20439   OSType notificationName;
20440
20441   MPQueueID queueID;
20442   void * p1;
20443   void * p2;
20444   void * p3;
20445
20446   MPEventID eventID;
20447   MPEventFlags events;
20448
20449   MPSemaphoreID semaphoreID;
20450 };
20451 typedef struct MPNotificationInfo MPNotificationInfo;
20452 struct MPAddressSpaceInfo {
20453   PBVersion version;
20454
20455   MPProcessID processID;
20456   MPCoherenceID groupID;
20457   ItemCount nTasks;
20458   UInt32 vsid[16];
20459 };
20460 typedef struct MPAddressSpaceInfo MPAddressSpaceInfo;
20461 extern "C" {
20462
20463
20464 extern Ptr LMGetMemTop(void) ;
20465 extern void LMSetMemTop(Ptr value) ;
20466 extern Ptr LMGetBufPtr(void) ;
20467 extern void LMSetBufPtr(Ptr value) ;
20468 extern Ptr LMGetHeapEnd(void) ;
20469 extern void LMSetHeapEnd(Ptr value) ;
20470 extern UInt8 LMGetCPUFlag(void) ;
20471 extern void LMSetCPUFlag(UInt8 value) ;
20472 extern SInt32 LMGetRndSeed(void) ;
20473 extern void LMSetRndSeed(SInt32 value) ;
20474 extern UInt8 LMGetSEvtEnb(void) ;
20475 extern void LMSetSEvtEnb(UInt8 value) ;
20476 extern SInt16 LMGetBootDrive(void) ;
20477 extern void LMSetBootDrive(SInt16 value) ;
20478 extern SInt16 LMGetMemErr(void) ;
20479 extern void LMSetMemErr(SInt16 value) ;
20480 extern UInt8 LMGetSdVolume(void) ;
20481 extern void LMSetSdVolume(UInt8 value) ;
20482 extern Ptr LMGetSoundPtr(void) ;
20483 extern void LMSetSoundPtr(Ptr value) ;
20484 extern Ptr LMGetSoundBase(void) ;
20485 extern void LMSetSoundBase(Ptr value) ;
20486 extern UInt8 LMGetSoundLevel(void) ;
20487 extern void LMSetSoundLevel(UInt8 value) ;
20488 extern SInt16 LMGetCurPitch(void) ;
20489 extern void LMSetCurPitch(SInt16 value) ;
20490 extern THz LMGetSysZone(void) ;
20491 extern void LMSetSysZone(THz value) ;
20492 extern THz LMGetApplZone(void) ;
20493 extern void LMSetApplZone(THz value) ;
20494 extern UInt8 LMGetScrDmpEnb(void) ;
20495 extern void LMSetScrDmpEnb(UInt8 value) ;
20496 extern SInt32 LMGetBufTgFNum(void) ;
20497 extern void LMSetBufTgFNum(SInt32 value) ;
20498 extern SInt16 LMGetBufTgFFlg(void) ;
20499 extern void LMSetBufTgFFlg(SInt16 value) ;
20500 extern SInt16 LMGetBufTgFBkNum(void) ;
20501 extern void LMSetBufTgFBkNum(SInt16 value) ;
20502 extern SInt32 LMGetBufTgDate(void) ;
20503 extern void LMSetBufTgDate(SInt32 value) ;
20504 extern SInt32 LMGetMinStack(void) ;
20505 extern void LMSetMinStack(SInt32 value) ;
20506 extern SInt32 LMGetDefltStack(void) ;
20507 extern void LMSetDefltStack(SInt32 value) ;
20508 extern Handle LMGetGZRootHnd(void) ;
20509 extern void LMSetGZRootHnd(Handle value) ;
20510 extern Handle LMGetGZMoveHnd(void) ;
20511 extern void LMSetGZMoveHnd(Handle value) ;
20512 extern UniversalProcPtr LMGetToExtFS(void) ;
20513 extern void LMSetToExtFS(UniversalProcPtr value) ;
20514 extern UniversalProcPtr LMGetJStash(void) ;
20515 extern void LMSetJStash(UniversalProcPtr value) ;
20516 extern SInt16 LMGetCurApRefNum(void) ;
20517 extern void LMSetCurApRefNum(SInt16 value) ;
20518 extern Ptr LMGetCurStackBase(void) ;
20519 extern void LMSetCurStackBase(Ptr value) ;
20520 extern SInt16 LMGetCurPageOption(void) ;
20521 extern void LMSetCurPageOption(SInt16 value) ;
20522 extern SInt16 LMGetPrintErr(void) ;
20523 extern void LMSetPrintErr(SInt16 value) ;
20524 extern SInt16 LMGetApFontID(void) ;
20525 extern void LMSetApFontID(SInt16 value) ;
20526 extern SInt32 LMGetOneOne(void) ;
20527 extern void LMSetOneOne(SInt32 value) ;
20528 extern SInt32 LMGetMinusOne(void) ;
20529 extern void LMSetMinusOne(SInt32 value) ;
20530 extern SInt16 LMGetSysMap(void) ;
20531 extern void LMSetSysMap(SInt16 value) ;
20532 extern UInt8 LMGetResLoad(void) ;
20533 extern void LMSetResLoad(UInt8 value) ;
20534 extern SInt16 LMGetResErr(void) ;
20535 extern void LMSetResErr(SInt16 value) ;
20536 extern UInt8 LMGetTmpResLoad(void) ;
20537 extern void LMSetTmpResLoad(UInt8 value) ;
20538 extern Ptr LMGetIntlSpec(void) ;
20539 extern void LMSetIntlSpec(Ptr value) ;
20540 extern SInt16 LMGetSysFontFam(void) ;
20541 extern void LMSetSysFontFam(SInt16 value) ;
20542 extern SInt16 LMGetSysFontSize(void) ;
20543 extern void LMSetSysFontSize(SInt16 value) ;
20544 extern StringPtr LMGetCurApName(void) ;
20545 extern void LMSetCurApName(ConstStr31Param curApNameValue) ;
20546 extern StringPtr LMGetSysResName(void) ;
20547 extern void LMSetSysResName(ConstStr15Param sysResNameValue) ;
20548 extern StringPtr LMGetFinderName(void) ;
20549 extern void LMSetFinderName(ConstStr15Param finderNameValue) ;
20550 extern Ptr LMGetToolScratch(void) ;
20551 extern void LMSetToolScratch(const void * toolScratchValue) ;
20552 extern UniversalProcPtr LMGetLvl2DT(short vectorNumber) ;
20553 extern void LMSetLvl2DT(UniversalProcPtr Lvl2DTValue, short vectorNumber) ;
20554 extern Ptr LMGetHighHeapMark(void) ;
20555 extern void LMSetHighHeapMark(Ptr value) ;
20556 extern Ptr LMGetStackLowPoint(void) ;
20557 extern void LMSetStackLowPoint(Ptr value) ;
20558 extern Ptr LMGetDiskFormatingHFSDefaults(void) ;
20559 extern void LMSetDiskFormatingHFSDefaults(Ptr value) ;
20560
20561
20562 }
20563
20564
20565
20566 extern "C" {
20567
20568
20569 typedef UInt16 AVLVisitStage;
20570 enum {
20571   kAVLPreOrder = 0,
20572   kAVLInOrder = 1,
20573   kAVLPostOrder = 2
20574 };
20575
20576
20577 typedef UInt16 AVLOrder;
20578 enum {
20579   kLeftToRight = 0,
20580   kRightToLeft = 1
20581 };
20582
20583
20584 typedef UInt16 AVLNodeType;
20585 enum {
20586   kAVLIsTree = 0,
20587   kAVLIsLeftBranch = 1,
20588   kAVLIsRightBranch = 2,
20589   kAVLIsLeaf = 3,
20590   kAVLNullNode = 4
20591 };
20592
20593 enum {
20594   errItemAlreadyInTree = -960,
20595   errNotValidTree = -961,
20596   errItemNotFoundInTree = -962,
20597   errCanNotInsertWhileWalkProcInProgress = -963,
20598   errTreeIsLocked = -964
20599 };
20600
20601
20602 struct AVLTreeStruct {
20603   OSType signature;
20604   unsigned long privateStuff[8];
20605 };
20606 typedef struct AVLTreeStruct AVLTreeStruct;
20607 typedef AVLTreeStruct * AVLTreePtr;
20608
20609
20610
20611
20612
20613
20614
20615 typedef SInt32 ( * AVLCompareItemsProcPtr)(AVLTreePtr tree, const void *i1, const void *i2, AVLNodeType nd_typ);
20616
20617
20618
20619
20620
20621
20622 typedef UInt32 ( * AVLItemSizeProcPtr)(AVLTreePtr tree, const void *itemPtr);
20623
20624
20625
20626
20627
20628
20629 typedef void ( * AVLDisposeItemProcPtr)(AVLTreePtr tree, const void *dataP);
20630 typedef OSErr ( * AVLWalkProcPtr)(AVLTreePtr tree, const void *dataP, AVLVisitStage visitStage, AVLNodeType node, UInt32 level, SInt32 balance, void *refCon);
20631 typedef AVLCompareItemsProcPtr AVLCompareItemsUPP;
20632 typedef AVLItemSizeProcPtr AVLItemSizeUPP;
20633 typedef AVLDisposeItemProcPtr AVLDisposeItemUPP;
20634 typedef AVLWalkProcPtr AVLWalkUPP;
20635 extern AVLCompareItemsUPP
20636 NewAVLCompareItemsUPP(AVLCompareItemsProcPtr userRoutine) ;
20637 extern AVLItemSizeUPP
20638 NewAVLItemSizeUPP(AVLItemSizeProcPtr userRoutine) ;
20639 extern AVLDisposeItemUPP
20640 NewAVLDisposeItemUPP(AVLDisposeItemProcPtr userRoutine) ;
20641 extern AVLWalkUPP
20642 NewAVLWalkUPP(AVLWalkProcPtr userRoutine) ;
20643 extern void
20644 DisposeAVLCompareItemsUPP(AVLCompareItemsUPP userUPP) ;
20645 extern void
20646 DisposeAVLItemSizeUPP(AVLItemSizeUPP userUPP) ;
20647 extern void
20648 DisposeAVLDisposeItemUPP(AVLDisposeItemUPP userUPP) ;
20649 extern void
20650 DisposeAVLWalkUPP(AVLWalkUPP userUPP) ;
20651 extern SInt32
20652 InvokeAVLCompareItemsUPP(
20653   AVLTreePtr tree,
20654   const void * i1,
20655   const void * i2,
20656   AVLNodeType nd_typ,
20657   AVLCompareItemsUPP userUPP) ;
20658 extern UInt32
20659 InvokeAVLItemSizeUPP(
20660   AVLTreePtr tree,
20661   const void * itemPtr,
20662   AVLItemSizeUPP userUPP) ;
20663 extern void
20664 InvokeAVLDisposeItemUPP(
20665   AVLTreePtr tree,
20666   const void * dataP,
20667   AVLDisposeItemUPP userUPP) ;
20668 extern OSErr
20669 InvokeAVLWalkUPP(
20670   AVLTreePtr tree,
20671   const void * dataP,
20672   AVLVisitStage visitStage,
20673   AVLNodeType node,
20674   UInt32 level,
20675   SInt32 balance,
20676   void * refCon,
20677   AVLWalkUPP userUPP) ;
20678 extern OSErr
20679 AVLInit(
20680   UInt32 flags,
20681   AVLCompareItemsUPP compareItemsProc,
20682   AVLItemSizeUPP sizeItemProc,
20683   AVLDisposeItemUPP disposeItemProc,
20684   void * refCon,
20685   AVLTreePtr * tree) ;
20686 extern OSErr
20687 AVLDispose(
20688   AVLTreePtr * tree,
20689   AVLOrder order) ;
20690 extern OSErr
20691 AVLWalk(
20692   AVLTreePtr tree,
20693   AVLWalkUPP walkProc,
20694   AVLOrder order,
20695   void * walkRefCon) ;
20696 extern OSErr
20697 AVLCount(
20698   AVLTreePtr tree,
20699   UInt32 * count) ;
20700 extern OSErr
20701 AVLGetIndItem(
20702   AVLTreePtr tree,
20703   UInt32 index,
20704   void * dataPtr,
20705   UInt32 * itemSize) ;
20706 extern OSErr
20707 AVLInsert(
20708   AVLTreePtr tree,
20709   const void * data) ;
20710 extern OSErr
20711 AVLRemove(
20712   AVLTreePtr tree,
20713   const void * key,
20714   void * dataPtr,
20715   UInt32 * itemSize) ;
20716 extern OSErr
20717 AVLFind(
20718   AVLTreePtr tree,
20719   const void * key,
20720   void * dataPtr,
20721   UInt32 * itemSize) ;
20722 extern OSErr
20723 AVLGetRefcon(
20724   AVLTreePtr tree,
20725   void ** refCon) ;
20726
20727
20728
20729
20730
20731 }
20732
20733
20734
20735 struct PEFContainerHeader {
20736   OSType tag1;
20737   OSType tag2;
20738   OSType architecture;
20739   UInt32 formatVersion;
20740   UInt32 dateTimeStamp;
20741   UInt32 oldDefVersion;
20742   UInt32 oldImpVersion;
20743   UInt32 currentVersion;
20744   UInt16 sectionCount;
20745   UInt16 instSectionCount;
20746   UInt32 reservedA;
20747 };
20748 typedef struct PEFContainerHeader PEFContainerHeader;
20749 enum {
20750   kPEFTag1 = 'Joy!',
20751   kPEFTag2 = 'peff',
20752   kPEFVersion = 0x00000001
20753 };
20754
20755
20756 enum {
20757   kPEFFirstSectionHeaderOffset = sizeof(PEFContainerHeader)
20758 };
20759 struct PEFSectionHeader {
20760   SInt32 nameOffset;
20761   UInt32 defaultAddress;
20762   UInt32 totalLength;
20763   UInt32 unpackedLength;
20764   UInt32 containerLength;
20765   UInt32 containerOffset;
20766   UInt8 sectionKind;
20767   UInt8 shareKind;
20768   UInt8 alignment;
20769   UInt8 reservedA;
20770 };
20771 typedef struct PEFSectionHeader PEFSectionHeader;
20772 enum {
20773
20774
20775   kPEFCodeSection = 0,
20776   kPEFUnpackedDataSection = 1,
20777   kPEFPackedDataSection = 2,
20778   kPEFConstantSection = 3,
20779   kPEFExecDataSection = 6,
20780
20781   kPEFLoaderSection = 4,
20782   kPEFDebugSection = 5,
20783   kPEFExceptionSection = 7,
20784   kPEFTracebackSection = 8
20785 };
20786
20787
20788 enum {
20789
20790   kPEFProcessShare = 1,
20791   kPEFGlobalShare = 4,
20792   kPEFProtectedShare = 5
20793 };
20794 enum {
20795
20796   kPEFPkDataZero = 0,
20797   kPEFPkDataBlock = 1,
20798   kPEFPkDataRepeat = 2,
20799   kPEFPkDataRepeatBlock = 3,
20800   kPEFPkDataRepeatZero = 4
20801 };
20802
20803
20804 enum {
20805   kPEFPkDataOpcodeShift = 5,
20806   kPEFPkDataCount5Mask = 0x1F,
20807   kPEFPkDataMaxCount5 = 31,
20808   kPEFPkDataVCountShift = 7,
20809   kPEFPkDataVCountMask = 0x7F,
20810   kPEFPkDataVCountEndMask = 0x80
20811 };
20812 struct PEFLoaderInfoHeader {
20813   SInt32 mainSection;
20814   UInt32 mainOffset;
20815   SInt32 initSection;
20816   UInt32 initOffset;
20817   SInt32 termSection;
20818   UInt32 termOffset;
20819   UInt32 importedLibraryCount;
20820   UInt32 totalImportedSymbolCount;
20821   UInt32 relocSectionCount;
20822   UInt32 relocInstrOffset;
20823   UInt32 loaderStringsOffset;
20824   UInt32 exportHashOffset;
20825   UInt32 exportHashTablePower;
20826   UInt32 exportedSymbolCount;
20827 };
20828 typedef struct PEFLoaderInfoHeader PEFLoaderInfoHeader;
20829
20830
20831
20832
20833
20834
20835
20836 struct PEFImportedLibrary {
20837   UInt32 nameOffset;
20838   UInt32 oldImpVersion;
20839   UInt32 currentVersion;
20840   UInt32 importedSymbolCount;
20841   UInt32 firstImportedSymbol;
20842   UInt8 options;
20843   UInt8 reservedA;
20844   UInt16 reservedB;
20845 };
20846 typedef struct PEFImportedLibrary PEFImportedLibrary;
20847 enum {
20848
20849   kPEFWeakImportLibMask = 0x40,
20850   kPEFInitLibBeforeMask = 0x80
20851 };
20852 struct PEFImportedSymbol {
20853   UInt32 classAndName;
20854 };
20855 typedef struct PEFImportedSymbol PEFImportedSymbol;
20856 enum {
20857   kPEFImpSymClassShift = 24,
20858   kPEFImpSymNameOffsetMask = 0x00FFFFFF,
20859   kPEFImpSymMaxNameOffset = 0x00FFFFFF
20860 };
20861
20862
20863
20864
20865
20866
20867
20868 enum {
20869
20870   kPEFCodeSymbol = 0x00,
20871   kPEFDataSymbol = 0x01,
20872   kPEFTVectorSymbol = 0x02,
20873   kPEFTOCSymbol = 0x03,
20874   kPEFGlueSymbol = 0x04,
20875   kPEFUndefinedSymbol = 0x0F,
20876   kPEFWeakImportSymMask = 0x80
20877 };
20878 struct PEFExportedSymbolHashSlot {
20879   UInt32 countAndStart;
20880 };
20881 typedef struct PEFExportedSymbolHashSlot PEFExportedSymbolHashSlot;
20882 enum {
20883   kPEFHashSlotSymCountShift = 18,
20884   kPEFHashSlotFirstKeyMask = 0x0003FFFF,
20885   kPEFHashSlotMaxSymbolCount = 0x00003FFF,
20886   kPEFHashSlotMaxKeyIndex = 0x0003FFFF
20887 };
20888 struct PEFSplitHashWord {
20889   UInt16 nameLength;
20890   UInt16 hashValue;
20891 };
20892 typedef struct PEFSplitHashWord PEFSplitHashWord;
20893 struct PEFExportedSymbolKey {
20894   union {
20895     UInt32 fullHashWord;
20896     PEFSplitHashWord splitHashWord;
20897   } u;
20898 };
20899 typedef struct PEFExportedSymbolKey PEFExportedSymbolKey;
20900 enum {
20901   kPEFHashLengthShift = 16,
20902   kPEFHashValueMask = 0x0000FFFF,
20903   kPEFHashMaxLength = 0x0000FFFF
20904 };
20905 struct PEFExportedSymbol {
20906   UInt32 classAndName;
20907   UInt32 symbolValue;
20908   SInt16 sectionIndex;
20909 };
20910 typedef struct PEFExportedSymbol PEFExportedSymbol;
20911 enum {
20912   kPEFExpSymClassShift = 24,
20913   kPEFExpSymNameOffsetMask = 0x00FFFFFF,
20914   kPEFExpSymMaxNameOffset = 0x00FFFFFF
20915 };
20916
20917
20918
20919
20920
20921
20922
20923 enum {
20924
20925   kPEFAbsoluteExport = -2,
20926   kPEFReexportedImport = -3
20927 };
20928 typedef UInt16 PEFRelocChunk;
20929 struct PEFLoaderRelocationHeader {
20930   UInt16 sectionIndex;
20931   UInt16 reservedA;
20932   UInt32 relocCount;
20933   UInt32 firstRelocOffset;
20934 };
20935 typedef struct PEFLoaderRelocationHeader PEFLoaderRelocationHeader;
20936 enum {
20937   kPEFRelocBasicOpcodeRange = 128
20938 };
20939 enum {
20940   kPEFRelocBySectDWithSkip = 0x00,
20941   kPEFRelocBySectC = 0x20,
20942   kPEFRelocBySectD = 0x21,
20943   kPEFRelocTVector12 = 0x22,
20944   kPEFRelocTVector8 = 0x23,
20945   kPEFRelocVTable8 = 0x24,
20946   kPEFRelocImportRun = 0x25,
20947   kPEFRelocSmByImport = 0x30,
20948   kPEFRelocSmSetSectC = 0x31,
20949   kPEFRelocSmSetSectD = 0x32,
20950   kPEFRelocSmBySection = 0x33,
20951   kPEFRelocIncrPosition = 0x40,
20952   kPEFRelocSmRepeat = 0x48,
20953   kPEFRelocSetPosition = 0x50,
20954   kPEFRelocLgByImport = 0x52,
20955   kPEFRelocLgRepeat = 0x58,
20956   kPEFRelocLgSetOrBySection = 0x5A,
20957   kPEFRelocUndefinedOpcode = 0xFF
20958 };
20959 enum {
20960   kPEFRelocLgBySectionSubopcode = 0x00,
20961   kPEFRelocLgSetSectCSubopcode = 0x01,
20962   kPEFRelocLgSetSectDSubopcode = 0x02
20963 };
20964 enum {
20965   kPEFRelocWithSkipMaxSkipCount = 255,
20966   kPEFRelocWithSkipMaxRelocCount = 63
20967 };
20968 enum {
20969   kPEFRelocRunMaxRunLength = 512
20970 };
20971 enum {
20972   kPEFRelocSmIndexMaxIndex = 511
20973 };
20974 enum {
20975   kPEFRelocIncrPositionMaxOffset = 4096
20976 };
20977 enum {
20978   kPEFRelocSmRepeatMaxChunkCount = 16,
20979   kPEFRelocSmRepeatMaxRepeatCount = 256
20980 };
20981 enum {
20982   kPEFRelocSetPosMaxOffset = 0x03FFFFFF
20983 };
20984 enum {
20985   kPEFRelocLgByImportMaxIndex = 0x03FFFFFF
20986 };
20987 enum {
20988   kPEFRelocLgRepeatMaxChunkCount = 16,
20989   kPEFRelocLgRepeatMaxRepeatCount = 0x003FFFFF
20990 };
20991 enum {
20992   kPEFRelocLgSetOrBySectionMaxIndex = 0x003FFFFF
20993 };
20994 struct XLibContainerHeader {
20995
20996
20997
20998   OSType tag1;
20999   OSType tag2;
21000   UInt32 currentFormat;
21001   UInt32 containerStringsOffset;
21002   UInt32 exportHashOffset;
21003   UInt32 exportKeyOffset;
21004   UInt32 exportSymbolOffset;
21005   UInt32 exportNamesOffset;
21006   UInt32 exportHashTablePower;
21007   UInt32 exportedSymbolCount;
21008
21009
21010
21011   UInt32 fragNameOffset;
21012   UInt32 fragNameLength;
21013   UInt32 dylibPathOffset;
21014   UInt32 dylibPathLength;
21015   OSType cpuFamily;
21016   OSType cpuModel;
21017   UInt32 dateTimeStamp;
21018   UInt32 currentVersion;
21019   UInt32 oldDefVersion;
21020   UInt32 oldImpVersion;
21021
21022 };
21023 typedef struct XLibContainerHeader XLibContainerHeader;
21024 enum {
21025   kXLibTag1 = 'ðMac',
21026   kVLibTag2 = 'VLib',
21027   kBLibTag2 = 'BLib',
21028   kXLibVersion = 0x00000001
21029 };
21030
21031
21032
21033 typedef PEFExportedSymbolHashSlot XLibExportedSymbolHashSlot;
21034 typedef PEFExportedSymbolKey XLibExportedSymbolKey;
21035 struct XLibExportedSymbol {
21036   UInt32 classAndName;
21037   UInt32 bpOffset;
21038 };
21039 typedef struct XLibExportedSymbol XLibExportedSymbol;
21040
21041
21042
21043
21044
21045 enum {
21046   kHFSSigWord = 0x4244,
21047   kHFSPlusSigWord = 0x482B,
21048   kHFSPlusVersion = 0x0004,
21049   kHFSPlusMountVersion = '8.10'
21050 };
21051
21052
21053
21054 typedef UInt32 HFSCatalogNodeID;
21055 enum {
21056   kHFSMaxVolumeNameChars = 27,
21057   kHFSMaxFileNameChars = 31,
21058   kHFSPlusMaxFileNameChars = 255
21059 };
21060
21061
21062
21063
21064 struct HFSExtentKey {
21065   UInt8 keyLength;
21066   UInt8 forkType;
21067   HFSCatalogNodeID fileID;
21068   UInt16 startBlock;
21069 };
21070 typedef struct HFSExtentKey HFSExtentKey;
21071
21072 struct HFSPlusExtentKey {
21073   UInt16 keyLength;
21074   UInt8 forkType;
21075   UInt8 pad;
21076   HFSCatalogNodeID fileID;
21077   UInt32 startBlock;
21078 };
21079 typedef struct HFSPlusExtentKey HFSPlusExtentKey;
21080
21081 enum {
21082   kHFSExtentDensity = 3,
21083   kHFSPlusExtentDensity = 8
21084 };
21085
21086
21087 struct HFSExtentDescriptor {
21088   UInt16 startBlock;
21089   UInt16 blockCount;
21090 };
21091 typedef struct HFSExtentDescriptor HFSExtentDescriptor;
21092
21093 struct HFSPlusExtentDescriptor {
21094   UInt32 startBlock;
21095   UInt32 blockCount;
21096 };
21097 typedef struct HFSPlusExtentDescriptor HFSPlusExtentDescriptor;
21098
21099
21100 typedef HFSExtentDescriptor HFSExtentRecord[3];
21101
21102 typedef HFSPlusExtentDescriptor HFSPlusExtentRecord[8];
21103
21104
21105 struct HFSPlusForkData {
21106   UInt64 logicalSize;
21107   UInt32 clumpSize;
21108   UInt32 totalBlocks;
21109   HFSPlusExtentRecord extents;
21110 };
21111 typedef struct HFSPlusForkData HFSPlusForkData;
21112
21113 struct HFSPlusPermissions {
21114   UInt32 ownerID;
21115   UInt32 groupID;
21116   UInt32 permissions;
21117   UInt32 specialDevice;
21118 };
21119 typedef struct HFSPlusPermissions HFSPlusPermissions;
21120
21121 enum {
21122   kHFSRootParentID = 1,
21123   kHFSRootFolderID = 2,
21124   kHFSExtentsFileID = 3,
21125   kHFSCatalogFileID = 4,
21126   kHFSBadBlockFileID = 5,
21127   kHFSAllocationFileID = 6,
21128   kHFSStartupFileID = 7,
21129   kHFSAttributesFileID = 8,
21130   kHFSBogusExtentFileID = 15,
21131   kHFSFirstUserCatalogNodeID = 16
21132 };
21133
21134
21135
21136 struct HFSCatalogKey {
21137   UInt8 keyLength;
21138   UInt8 reserved;
21139   HFSCatalogNodeID parentID;
21140   Str31 nodeName;
21141 };
21142 typedef struct HFSCatalogKey HFSCatalogKey;
21143
21144 struct HFSPlusCatalogKey {
21145   UInt16 keyLength;
21146   HFSCatalogNodeID parentID;
21147   HFSUniStr255 nodeName;
21148 };
21149 typedef struct HFSPlusCatalogKey HFSPlusCatalogKey;
21150
21151
21152 enum {
21153
21154   kHFSFolderRecord = 0x0100,
21155   kHFSFileRecord = 0x0200,
21156   kHFSFolderThreadRecord = 0x0300,
21157   kHFSFileThreadRecord = 0x0400,
21158
21159   kHFSPlusFolderRecord = 1,
21160   kHFSPlusFileRecord = 2,
21161   kHFSPlusFolderThreadRecord = 3,
21162   kHFSPlusFileThreadRecord = 4
21163 };
21164
21165
21166
21167 enum {
21168   kHFSFileLockedBit = 0x0000,
21169   kHFSFileLockedMask = 0x0001,
21170   kHFSThreadExistsBit = 0x0001,
21171   kHFSThreadExistsMask = 0x0002
21172 };
21173
21174
21175
21176 struct HFSCatalogFolder {
21177   SInt16 recordType;
21178   UInt16 flags;
21179   UInt16 valence;
21180   HFSCatalogNodeID folderID;
21181   UInt32 createDate;
21182   UInt32 modifyDate;
21183   UInt32 backupDate;
21184   DInfo userInfo;
21185   DXInfo finderInfo;
21186   UInt32 reserved[4];
21187 };
21188 typedef struct HFSCatalogFolder HFSCatalogFolder;
21189
21190 struct HFSPlusCatalogFolder {
21191   SInt16 recordType;
21192   UInt16 flags;
21193   UInt32 valence;
21194   HFSCatalogNodeID folderID;
21195   UInt32 createDate;
21196   UInt32 contentModDate;
21197   UInt32 attributeModDate;
21198   UInt32 accessDate;
21199   UInt32 backupDate;
21200   HFSPlusPermissions permissions;
21201   DInfo userInfo;
21202   DXInfo finderInfo;
21203   UInt32 textEncoding;
21204   UInt32 reserved;
21205 };
21206 typedef struct HFSPlusCatalogFolder HFSPlusCatalogFolder;
21207
21208 struct HFSCatalogFile {
21209   SInt16 recordType;
21210   UInt8 flags;
21211   SInt8 fileType;
21212   FInfo userInfo;
21213   HFSCatalogNodeID fileID;
21214   UInt16 dataStartBlock;
21215   SInt32 dataLogicalSize;
21216   SInt32 dataPhysicalSize;
21217   UInt16 rsrcStartBlock;
21218   SInt32 rsrcLogicalSize;
21219   SInt32 rsrcPhysicalSize;
21220   UInt32 createDate;
21221   UInt32 modifyDate;
21222   UInt32 backupDate;
21223   FXInfo finderInfo;
21224   UInt16 clumpSize;
21225   HFSExtentRecord dataExtents;
21226   HFSExtentRecord rsrcExtents;
21227   UInt32 reserved;
21228 };
21229 typedef struct HFSCatalogFile HFSCatalogFile;
21230
21231 struct HFSPlusCatalogFile {
21232   SInt16 recordType;
21233   UInt16 flags;
21234   UInt32 reserved1;
21235   HFSCatalogNodeID fileID;
21236   UInt32 createDate;
21237   UInt32 contentModDate;
21238   UInt32 attributeModDate;
21239   UInt32 accessDate;
21240   UInt32 backupDate;
21241   HFSPlusPermissions permissions;
21242   FInfo userInfo;
21243   FXInfo finderInfo;
21244   UInt32 textEncoding;
21245   UInt32 reserved2;
21246
21247
21248   HFSPlusForkData dataFork;
21249   HFSPlusForkData resourceFork;
21250 };
21251 typedef struct HFSPlusCatalogFile HFSPlusCatalogFile;
21252
21253 struct HFSCatalogThread {
21254   SInt16 recordType;
21255   SInt32 reserved[2];
21256   HFSCatalogNodeID parentID;
21257   Str31 nodeName;
21258 };
21259 typedef struct HFSCatalogThread HFSCatalogThread;
21260
21261 struct HFSPlusCatalogThread {
21262   SInt16 recordType;
21263   SInt16 reserved;
21264   HFSCatalogNodeID parentID;
21265   HFSUniStr255 nodeName;
21266 };
21267 typedef struct HFSPlusCatalogThread HFSPlusCatalogThread;
21268
21269
21270
21271
21272
21273 enum {
21274   kHFSPlusAttrInlineData = 0x10,
21275   kHFSPlusAttrForkData = 0x20,
21276   kHFSPlusAttrExtents = 0x30
21277 };
21278 struct HFSPlusAttrInlineData {
21279   UInt32 recordType;
21280   UInt32 reserved;
21281   UInt32 logicalSize;
21282   UInt8 userData[2];
21283 };
21284 typedef struct HFSPlusAttrInlineData HFSPlusAttrInlineData;
21285
21286
21287
21288
21289
21290
21291 struct HFSPlusAttrForkData {
21292   UInt32 recordType;
21293   UInt32 reserved;
21294   HFSPlusForkData theFork;
21295 };
21296 typedef struct HFSPlusAttrForkData HFSPlusAttrForkData;
21297
21298
21299
21300
21301
21302 struct HFSPlusAttrExtents {
21303   UInt32 recordType;
21304   UInt32 reserved;
21305   HFSPlusExtentRecord extents;
21306 };
21307 typedef struct HFSPlusAttrExtents HFSPlusAttrExtents;
21308
21309 union HFSPlusAttrRecord {
21310   UInt32 recordType;
21311   HFSPlusAttrInlineData inlineData;
21312   HFSPlusAttrForkData forkData;
21313   HFSPlusAttrExtents overflowExtents;
21314 };
21315 typedef union HFSPlusAttrRecord HFSPlusAttrRecord;
21316
21317 enum {
21318   kHFSPlusExtentKeyMaximumLength = sizeof(HFSPlusExtentKey) - sizeof(UInt16),
21319   kHFSExtentKeyMaximumLength = sizeof(HFSExtentKey) - sizeof(UInt8),
21320   kHFSPlusCatalogKeyMaximumLength = sizeof(HFSPlusCatalogKey) - sizeof(UInt16),
21321   kHFSPlusCatalogKeyMinimumLength = kHFSPlusCatalogKeyMaximumLength - sizeof(HFSUniStr255) + sizeof(UInt16),
21322   kHFSCatalogKeyMaximumLength = sizeof(HFSCatalogKey) - sizeof(UInt8),
21323   kHFSCatalogKeyMinimumLength = kHFSCatalogKeyMaximumLength - sizeof(Str31) + sizeof(UInt8),
21324   kHFSPlusCatalogMinNodeSize = 4096,
21325   kHFSPlusExtentMinNodeSize = 512,
21326   kHFSPlusAttrMinNodeSize = 4096
21327 };
21328
21329
21330
21331 enum {
21332
21333   kHFSVolumeHardwareLockBit = 7,
21334   kHFSVolumeUnmountedBit = 8,
21335   kHFSVolumeSparedBlocksBit = 9,
21336   kHFSVolumeNoCacheRequiredBit = 10,
21337   kHFSBootVolumeInconsistentBit = 11,
21338
21339   kHFSVolumeSoftwareLockBit = 15,
21340   kHFSVolumeHardwareLockMask = 1 << kHFSVolumeHardwareLockBit,
21341   kHFSVolumeUnmountedMask = 1 << kHFSVolumeUnmountedBit,
21342   kHFSVolumeSparedBlocksMask = 1 << kHFSVolumeSparedBlocksBit,
21343   kHFSVolumeNoCacheRequiredMask = 1 << kHFSVolumeNoCacheRequiredBit,
21344   kHFSBootVolumeInconsistentMask = 1 << kHFSBootVolumeInconsistentBit,
21345   kHFSVolumeSoftwareLockMask = 1 << kHFSVolumeSoftwareLockBit,
21346   kHFSMDBAttributesMask = 0x8380
21347 };
21348
21349 enum {
21350   kHFSCatalogNodeIDsReusedBit = 12,
21351   kHFSCatalogNodeIDsReusedMask = 1 << kHFSCatalogNodeIDsReusedBit
21352 };
21353
21354
21355
21356 struct HFSMasterDirectoryBlock {
21357
21358
21359
21360   UInt16 drSigWord;
21361   UInt32 drCrDate;
21362   UInt32 drLsMod;
21363   UInt16 drAtrb;
21364   UInt16 drNmFls;
21365   UInt16 drVBMSt;
21366   UInt16 drAllocPtr;
21367   UInt16 drNmAlBlks;
21368   UInt32 drAlBlkSiz;
21369   UInt32 drClpSiz;
21370   UInt16 drAlBlSt;
21371   UInt32 drNxtCNID;
21372   UInt16 drFreeBks;
21373   Str27 drVN;
21374
21375
21376
21377   UInt32 drVolBkUp;
21378   UInt16 drVSeqNum;
21379   UInt32 drWrCnt;
21380   UInt32 drXTClpSiz;
21381   UInt32 drCTClpSiz;
21382   UInt16 drNmRtDirs;
21383   UInt32 drFilCnt;
21384   UInt32 drDirCnt;
21385   SInt32 drFndrInfo[8];
21386   UInt16 drEmbedSigWord;
21387   HFSExtentDescriptor drEmbedExtent;
21388   UInt32 drXTFlSize;
21389   HFSExtentRecord drXTExtRec;
21390   UInt32 drCTFlSize;
21391   HFSExtentRecord drCTExtRec;
21392 };
21393 typedef struct HFSMasterDirectoryBlock HFSMasterDirectoryBlock;
21394
21395
21396 struct HFSPlusVolumeHeader {
21397   UInt16 signature;
21398   UInt16 version;
21399   UInt32 attributes;
21400   UInt32 lastMountedVersion;
21401   UInt32 reserved;
21402
21403   UInt32 createDate;
21404   UInt32 modifyDate;
21405   UInt32 backupDate;
21406   UInt32 checkedDate;
21407
21408   UInt32 fileCount;
21409   UInt32 folderCount;
21410
21411   UInt32 blockSize;
21412   UInt32 totalBlocks;
21413   UInt32 freeBlocks;
21414
21415   UInt32 nextAllocation;
21416   UInt32 rsrcClumpSize;
21417   UInt32 dataClumpSize;
21418   HFSCatalogNodeID nextCatalogID;
21419
21420   UInt32 writeCount;
21421   UInt64 encodingsBitmap;
21422
21423   UInt8 finderInfo[32];
21424
21425   HFSPlusForkData allocationFile;
21426   HFSPlusForkData extentsFile;
21427   HFSPlusForkData catalogFile;
21428   HFSPlusForkData attributesFile;
21429   HFSPlusForkData startupFile;
21430 };
21431 typedef struct HFSPlusVolumeHeader HFSPlusVolumeHeader;
21432
21433
21434 struct BTNodeDescriptor {
21435   UInt32 fLink;
21436   UInt32 bLink;
21437   SInt8 kind;
21438   UInt8 height;
21439   UInt16 numRecords;
21440   UInt16 reserved;
21441 };
21442 typedef struct BTNodeDescriptor BTNodeDescriptor;
21443
21444 enum {
21445   kBTLeafNode = -1,
21446   kBTIndexNode = 0,
21447   kBTHeaderNode = 1,
21448   kBTMapNode = 2
21449 };
21450
21451
21452 struct BTHeaderRec {
21453   UInt16 treeDepth;
21454   UInt32 rootNode;
21455   UInt32 leafRecords;
21456   UInt32 firstLeafNode;
21457   UInt32 lastLeafNode;
21458   UInt16 nodeSize;
21459   UInt16 maxKeyLength;
21460   UInt32 totalNodes;
21461   UInt32 freeNodes;
21462   UInt16 reserved1;
21463   UInt32 clumpSize;
21464   UInt8 btreeType;
21465   UInt8 reserved2;
21466   UInt32 attributes;
21467   UInt32 reserved3[16];
21468 };
21469 typedef struct BTHeaderRec BTHeaderRec;
21470
21471 enum {
21472   kBTBadCloseMask = 0x00000001,
21473   kBTBigKeysMask = 0x00000002,
21474   kBTVariableIndexKeysMask = 0x00000004
21475 };
21476
21477
21478
21479
21480
21481
21482 enum {
21483   AIFFID = 'AIFF',
21484   AIFCID = 'AIFC',
21485   FormatVersionID = 'FVER',
21486   CommonID = 'COMM',
21487   FORMID = 'FORM',
21488   SoundDataID = 'SSND',
21489   MarkerID = 'MARK',
21490   InstrumentID = 'INST',
21491   MIDIDataID = 'MIDI',
21492   AudioRecordingID = 'AESD',
21493   ApplicationSpecificID = 'APPL',
21494   CommentID = 'COMT',
21495   NameID = 'NAME',
21496   AuthorID = 'AUTH',
21497   CopyrightID = '(c) ',
21498   AnnotationID = 'ANNO'
21499 };
21500
21501 enum {
21502   NoLooping = 0,
21503   ForwardLooping = 1,
21504   ForwardBackwardLooping = 2
21505 };
21506
21507 enum {
21508
21509   AIFCVersion1 = (long)0xA2805140
21510 };
21511
21512
21513
21514
21515
21516
21517
21518 enum {
21519
21520   NoneType = 'NONE',
21521   ACE2Type = 'ACE2',
21522   ACE8Type = 'ACE8',
21523   MACE3Type = 'MAC3',
21524   MACE6Type = 'MAC6'
21525 };
21526
21527 typedef unsigned long ID;
21528 typedef short MarkerIdType;
21529 struct ChunkHeader {
21530   ID ckID;
21531   long ckSize;
21532 };
21533 typedef struct ChunkHeader ChunkHeader;
21534 struct ContainerChunk {
21535   ID ckID;
21536   long ckSize;
21537   ID formType;
21538 };
21539 typedef struct ContainerChunk ContainerChunk;
21540 struct FormatVersionChunk {
21541   ID ckID;
21542   long ckSize;
21543   unsigned long timestamp;
21544 };
21545 typedef struct FormatVersionChunk FormatVersionChunk;
21546 typedef FormatVersionChunk * FormatVersionChunkPtr;
21547 struct CommonChunk {
21548   ID ckID;
21549   long ckSize;
21550   short numChannels;
21551   unsigned long numSampleFrames;
21552   short sampleSize;
21553   extended80 sampleRate;
21554 };
21555 typedef struct CommonChunk CommonChunk;
21556 typedef CommonChunk * CommonChunkPtr;
21557 struct ExtCommonChunk {
21558   ID ckID;
21559   long ckSize;
21560   short numChannels;
21561   unsigned long numSampleFrames;
21562   short sampleSize;
21563   extended80 sampleRate;
21564   ID compressionType;
21565   char compressionName[1];
21566 };
21567 typedef struct ExtCommonChunk ExtCommonChunk;
21568 typedef ExtCommonChunk * ExtCommonChunkPtr;
21569 struct SoundDataChunk {
21570   ID ckID;
21571   long ckSize;
21572   unsigned long offset;
21573   unsigned long blockSize;
21574 };
21575 typedef struct SoundDataChunk SoundDataChunk;
21576 typedef SoundDataChunk * SoundDataChunkPtr;
21577 struct Marker {
21578   MarkerIdType id;
21579   unsigned long position;
21580   Str255 markerName;
21581 };
21582 typedef struct Marker Marker;
21583 struct MarkerChunk {
21584   ID ckID;
21585   long ckSize;
21586   unsigned short numMarkers;
21587   Marker Markers[1];
21588 };
21589 typedef struct MarkerChunk MarkerChunk;
21590 typedef MarkerChunk * MarkerChunkPtr;
21591 struct AIFFLoop {
21592   short playMode;
21593   MarkerIdType beginLoop;
21594   MarkerIdType endLoop;
21595 };
21596 typedef struct AIFFLoop AIFFLoop;
21597 struct InstrumentChunk {
21598   ID ckID;
21599   long ckSize;
21600   UInt8 baseFrequency;
21601   UInt8 detune;
21602   UInt8 lowFrequency;
21603   UInt8 highFrequency;
21604   UInt8 lowVelocity;
21605   UInt8 highVelocity;
21606   short gain;
21607   AIFFLoop sustainLoop;
21608   AIFFLoop releaseLoop;
21609 };
21610 typedef struct InstrumentChunk InstrumentChunk;
21611 typedef InstrumentChunk * InstrumentChunkPtr;
21612 struct MIDIDataChunk {
21613   ID ckID;
21614   long ckSize;
21615   UInt8 MIDIdata[1];
21616 };
21617 typedef struct MIDIDataChunk MIDIDataChunk;
21618 typedef MIDIDataChunk * MIDIDataChunkPtr;
21619 struct AudioRecordingChunk {
21620   ID ckID;
21621   long ckSize;
21622   UInt8 AESChannelStatus[24];
21623 };
21624 typedef struct AudioRecordingChunk AudioRecordingChunk;
21625 typedef AudioRecordingChunk * AudioRecordingChunkPtr;
21626 struct ApplicationSpecificChunk {
21627   ID ckID;
21628   long ckSize;
21629   OSType applicationSignature;
21630   UInt8 data[1];
21631 };
21632 typedef struct ApplicationSpecificChunk ApplicationSpecificChunk;
21633 typedef ApplicationSpecificChunk * ApplicationSpecificChunkPtr;
21634 struct Comment {
21635   unsigned long timeStamp;
21636   MarkerIdType marker;
21637   unsigned short count;
21638   char text[1];
21639 };
21640 typedef struct Comment Comment;
21641 struct CommentsChunk {
21642   ID ckID;
21643   long ckSize;
21644   unsigned short numComments;
21645   Comment comments[1];
21646 };
21647 typedef struct CommentsChunk CommentsChunk;
21648 typedef CommentsChunk * CommentsChunkPtr;
21649 struct TextChunk {
21650   ID ckID;
21651   long ckSize;
21652   char text[1];
21653 };
21654 typedef struct TextChunk TextChunk;
21655 typedef TextChunk * TextChunkPtr;
21656
21657
21658
21659
21660 struct TECBufferContextRec {
21661   TextPtr textInputBuffer;
21662   TextPtr textInputBufferEnd;
21663   TextPtr textOutputBuffer;
21664   TextPtr textOutputBufferEnd;
21665
21666   TextEncodingRunPtr encodingInputBuffer;
21667   TextEncodingRunPtr encodingInputBufferEnd;
21668   TextEncodingRunPtr encodingOutputBuffer;
21669   TextEncodingRunPtr encodingOutputBufferEnd;
21670 };
21671 typedef struct TECBufferContextRec TECBufferContextRec;
21672 struct TECPluginStateRec {
21673
21674   UInt8 state1;
21675   UInt8 state2;
21676   UInt8 state3;
21677   UInt8 state4;
21678
21679   UInt32 longState1;
21680   UInt32 longState2;
21681   UInt32 longState3;
21682   UInt32 longState4;
21683 };
21684 typedef struct TECPluginStateRec TECPluginStateRec;
21685 struct TECConverterContextRec {
21686
21687
21688   Ptr pluginRec;
21689   TextEncoding sourceEncoding;
21690   TextEncoding destEncoding;
21691   UInt32 reserved1;
21692   UInt32 reserved2;
21693   TECBufferContextRec bufferContext;
21694
21695   UInt32 contextRefCon;
21696   ProcPtr conversionProc;
21697   ProcPtr flushProc;
21698   ProcPtr clearContextInfoProc;
21699   UInt32 options1;
21700   UInt32 options2;
21701   TECPluginStateRec pluginState;
21702 };
21703 typedef struct TECConverterContextRec TECConverterContextRec;
21704 struct TECSnifferContextRec {
21705
21706   Ptr pluginRec;
21707   TextEncoding encoding;
21708   ItemCount maxErrors;
21709   ItemCount maxFeatures;
21710   TextPtr textInputBuffer;
21711   TextPtr textInputBufferEnd;
21712   ItemCount numFeatures;
21713   ItemCount numErrors;
21714
21715   UInt32 contextRefCon;
21716   ProcPtr sniffProc;
21717   ProcPtr clearContextInfoProc;
21718   TECPluginStateRec pluginState;
21719 };
21720 typedef struct TECSnifferContextRec TECSnifferContextRec;
21721
21722
21723
21724
21725
21726
21727 typedef OSStatus ( * TECPluginNewEncodingConverterPtr)(TECObjectRef *newEncodingConverter, TECConverterContextRec *plugContext, TextEncoding inputEncoding, TextEncoding outputEncoding);
21728 typedef OSStatus ( * TECPluginClearContextInfoPtr)(TECObjectRef encodingConverter, TECConverterContextRec *plugContext);
21729 typedef OSStatus ( * TECPluginConvertTextEncodingPtr)(TECObjectRef encodingConverter, TECConverterContextRec *plugContext);
21730 typedef OSStatus ( * TECPluginFlushConversionPtr)(TECObjectRef encodingConverter, TECConverterContextRec *plugContext);
21731 typedef OSStatus ( * TECPluginDisposeEncodingConverterPtr)(TECObjectRef newEncodingConverter, TECConverterContextRec *plugContext);
21732 typedef OSStatus ( * TECPluginNewEncodingSnifferPtr)(TECSnifferObjectRef *encodingSniffer, TECSnifferContextRec *snifContext, TextEncoding inputEncoding);
21733 typedef OSStatus ( * TECPluginClearSnifferContextInfoPtr)(TECSnifferObjectRef encodingSniffer, TECSnifferContextRec *snifContext);
21734 typedef OSStatus ( * TECPluginSniffTextEncodingPtr)(TECSnifferObjectRef encodingSniffer, TECSnifferContextRec *snifContext);
21735 typedef OSStatus ( * TECPluginDisposeEncodingSnifferPtr)(TECSnifferObjectRef encodingSniffer, TECSnifferContextRec *snifContext);
21736 typedef OSStatus ( * TECPluginGetCountAvailableTextEncodingsPtr)(TextEncoding *availableEncodings, ItemCount maxAvailableEncodings, ItemCount *actualAvailableEncodings);
21737 typedef OSStatus ( * TECPluginGetCountAvailableTextEncodingPairsPtr)(TECConversionInfo *availableEncodings, ItemCount maxAvailableEncodings, ItemCount *actualAvailableEncodings);
21738 typedef OSStatus ( * TECPluginGetCountDestinationTextEncodingsPtr)(TextEncoding inputEncoding, TextEncoding *destinationEncodings, ItemCount maxDestinationEncodings, ItemCount *actualDestinationEncodings);
21739 typedef OSStatus ( * TECPluginGetCountSubTextEncodingsPtr)(TextEncoding inputEncoding, TextEncoding subEncodings[], ItemCount maxSubEncodings, ItemCount *actualSubEncodings);
21740 typedef OSStatus ( * TECPluginGetCountAvailableSniffersPtr)(TextEncoding *availableEncodings, ItemCount maxAvailableEncodings, ItemCount *actualAvailableEncodings);
21741 typedef OSStatus ( * TECPluginGetTextEncodingInternetNamePtr)(TextEncoding textEncoding, Str255 encodingName);
21742 typedef OSStatus ( * TECPluginGetTextEncodingFromInternetNamePtr)(TextEncoding *textEncoding, ConstStr255Param encodingName);
21743 typedef OSStatus ( * TECPluginGetCountWebEncodingsPtr)(TextEncoding *availableEncodings, ItemCount maxAvailableEncodings, ItemCount *actualAvailableEncodings);
21744 typedef OSStatus ( * TECPluginGetCountMailEncodingsPtr)(TextEncoding *availableEncodings, ItemCount maxAvailableEncodings, ItemCount *actualAvailableEncodings);
21745
21746
21747
21748
21749
21750
21751 enum {
21752   kTECPluginDispatchTableVersion1 = 0x00010000,
21753   kTECPluginDispatchTableVersion1_1 = 0x00010001,
21754   kTECPluginDispatchTableVersion1_2 = 0x00010002,
21755   kTECPluginDispatchTableCurrentVersion = kTECPluginDispatchTableVersion1_2
21756 };
21757
21758 struct TECPluginDispatchTable {
21759
21760   TECPluginVersion version;
21761   TECPluginVersion compatibleVersion;
21762   TECPluginSignature PluginID;
21763
21764   TECPluginNewEncodingConverterPtr PluginNewEncodingConverter;
21765   TECPluginClearContextInfoPtr PluginClearContextInfo;
21766   TECPluginConvertTextEncodingPtr PluginConvertTextEncoding;
21767   TECPluginFlushConversionPtr PluginFlushConversion;
21768   TECPluginDisposeEncodingConverterPtr PluginDisposeEncodingConverter;
21769
21770   TECPluginNewEncodingSnifferPtr PluginNewEncodingSniffer;
21771   TECPluginClearSnifferContextInfoPtr PluginClearSnifferContextInfo;
21772   TECPluginSniffTextEncodingPtr PluginSniffTextEncoding;
21773   TECPluginDisposeEncodingSnifferPtr PluginDisposeEncodingSniffer;
21774
21775   TECPluginGetCountAvailableTextEncodingsPtr PluginGetCountAvailableTextEncodings;
21776   TECPluginGetCountAvailableTextEncodingPairsPtr PluginGetCountAvailableTextEncodingPairs;
21777   TECPluginGetCountDestinationTextEncodingsPtr PluginGetCountDestinationTextEncodings;
21778   TECPluginGetCountSubTextEncodingsPtr PluginGetCountSubTextEncodings;
21779   TECPluginGetCountAvailableSniffersPtr PluginGetCountAvailableSniffers;
21780   TECPluginGetCountWebEncodingsPtr PluginGetCountWebTextEncodings;
21781   TECPluginGetCountMailEncodingsPtr PluginGetCountMailTextEncodings;
21782
21783   TECPluginGetTextEncodingInternetNamePtr PluginGetTextEncodingInternetName;
21784   TECPluginGetTextEncodingFromInternetNamePtr PluginGetTextEncodingFromInternetName;
21785
21786 };
21787 typedef struct TECPluginDispatchTable TECPluginDispatchTable;
21788 typedef TECPluginDispatchTable * ( * TECPluginGetPluginDispatchTablePtr)(void);
21789
21790
21791
21792
21793
21794
21795
21796
21797
21798
21799
21800 enum {
21801   sbSIGWord = 0x4552,
21802   sbMac = 1
21803 };
21804
21805
21806 enum {
21807   pMapSIG = 0x504D,
21808   pdSigWord = 0x5453,
21809   oldPMSigWord = pdSigWord,
21810   newPMSigWord = pMapSIG
21811 };
21812
21813
21814
21815 struct Block0 {
21816   UInt16 sbSig;
21817   UInt16 sbBlkSize;
21818   UInt32 sbBlkCount;
21819   UInt16 sbDevType;
21820   UInt16 sbDevId;
21821   UInt32 sbData;
21822   UInt16 sbDrvrCount;
21823   UInt32 ddBlock;
21824   UInt16 ddSize;
21825   UInt16 ddType;
21826   UInt16 ddPad[243];
21827 };
21828 typedef struct Block0 Block0;
21829
21830 struct DDMap {
21831   UInt32 ddBlock;
21832   UInt16 ddSize;
21833   UInt16 ddType;
21834 };
21835 typedef struct DDMap DDMap;
21836
21837 enum {
21838   kDriverTypeMacSCSI = 0x0001,
21839   kDriverTypeMacATA = 0x0701,
21840   kDriverTypeMacSCSIChained = 0xFFFF,
21841   kDriverTypeMacATAChained = 0xF8FF
21842 };
21843
21844
21845 struct Partition {
21846   UInt16 pmSig;
21847   UInt16 pmSigPad;
21848   UInt32 pmMapBlkCnt;
21849   UInt32 pmPyPartStart;
21850   UInt32 pmPartBlkCnt;
21851   UInt8 pmPartName[32];
21852   UInt8 pmParType[32];
21853   UInt32 pmLgDataStart;
21854   UInt32 pmDataCnt;
21855   UInt32 pmPartStatus;
21856   UInt32 pmLgBootStart;
21857   UInt32 pmBootSize;
21858   UInt32 pmBootAddr;
21859   UInt32 pmBootAddr2;
21860   UInt32 pmBootEntry;
21861   UInt32 pmBootEntry2;
21862   UInt32 pmBootCksum;
21863   UInt8 pmProcessor[16];
21864   UInt16 pmPad[188];
21865 };
21866 typedef struct Partition Partition;
21867
21868
21869 enum {
21870   kPartitionAUXIsValid = 0x00000001,
21871   kPartitionAUXIsAllocated = 0x00000002,
21872   kPartitionAUXIsInUse = 0x00000004,
21873   kPartitionAUXIsBootValid = 0x00000008,
21874   kPartitionAUXIsReadable = 0x00000010,
21875   kPartitionAUXIsWriteable = 0x00000020,
21876   kPartitionAUXIsBootCodePositionIndependent = 0x00000040,
21877   kPartitionIsWriteable = 0x00000020,
21878   kPartitionIsMountedAtStartup = 0x40000000,
21879   kPartitionIsStartup = (long)0x80000000,
21880   kPartitionIsChainCompatible = 0x00000100,
21881   kPartitionIsRealDeviceDriver = 0x00000200,
21882   kPartitionCanChainToNext = 0x00000400
21883 };
21884
21885
21886
21887
21888
21889 enum {
21890   kPatchDriverSignature = 'ptDR',
21891   kSCSIDriverSignature = 0x00010600,
21892   kATADriverSignature = 'wiki',
21893   kSCSICDDriverSignature = 'CDvr',
21894   kATAPIDriverSignature = 'ATPI',
21895   kDriveSetupHFSSignature = 'DSU1'
21896 };
21897
21898
21899
21900
21901
21902
21903
21904 extern "C" {
21905
21906
21907
21908 enum {
21909
21910   modemOnBit = 0,
21911   ringWakeUpBit = 2,
21912   modemInstalledBit = 3,
21913   ringDetectBit = 4,
21914   modemOnHookBit = 5
21915 };
21916
21917 enum {
21918
21919   modemOnMask = 0x01,
21920   ringWakeUpMask = 0x04,
21921   modemInstalledMask = 0x08,
21922   ringDetectMask = 0x10,
21923   modemOnHookMask = 0x20
21924 };
21925
21926 enum {
21927
21928   chargerConnBit = 0,
21929   hiChargeBit = 1,
21930   chargeOverFlowBit = 2,
21931   batteryDeadBit = 3,
21932   batteryLowBit = 4,
21933   connChangedBit = 5
21934 };
21935
21936 enum {
21937
21938   chargerConnMask = 0x01,
21939   hiChargeMask = 0x02,
21940   chargeOverFlowMask = 0x04,
21941   batteryDeadMask = 0x08,
21942   batteryLowMask = 0x10,
21943   connChangedMask = 0x20
21944 };
21945
21946 enum {
21947
21948   MediaBaySndEnBit = 0,
21949   PCISndEnBit = 1,
21950   ZVSndEnBit = 2,
21951   PCCardSndEnBit = 3
21952 };
21953
21954 enum {
21955
21956   MediaBaySndEnMask = 0x01,
21957   PCISndEnMask = 0x02,
21958   ZVSndEnMask = 0x04,
21959   PCCardSndEnMask = 0x08
21960 };
21961
21962 enum {
21963
21964   kSleepRequest = 1,
21965   kSleepDemand = 2,
21966   kSleepWakeUp = 3,
21967   kSleepRevoke = 4,
21968   kSleepUnlock = 4,
21969   kSleepDeny = 5,
21970   kSleepNow = 6,
21971   kDozeDemand = 7,
21972   kDozeWakeUp = 8,
21973   kDozeRequest = 9,
21974   kEnterStandby = 10,
21975   kEnterRun = 11,
21976   kSuspendRequest = 12,
21977   kSuspendDemand = 13,
21978   kSuspendRevoke = 14,
21979   kSuspendWakeUp = 15,
21980   kGetPowerLevel = 16,
21981   kSetPowerLevel = 17,
21982   kDeviceInitiatedWake = 18,
21983   kWakeToDoze = 19,
21984   kDozeToFullWakeUp = 20,
21985   kGetPowerInfo = 21,
21986   kGetWakeOnNetInfo = 22,
21987   kSuspendWakeToDoze = 23,
21988   kEnterIdle = 24,
21989   kStillIdle = 25,
21990   kExitIdle = 26
21991 };
21992
21993 enum {
21994
21995   sleepRequest = kSleepRequest,
21996   sleepDemand = kSleepDemand,
21997   sleepWakeUp = kSleepWakeUp,
21998   sleepRevoke = kSleepRevoke,
21999   sleepUnlock = kSleepUnlock,
22000   sleepDeny = kSleepDeny,
22001   sleepNow = kSleepNow,
22002   dozeDemand = kDozeDemand,
22003   dozeWakeUp = kDozeWakeUp,
22004   dozeRequest = kDozeRequest,
22005   enterStandby = kEnterStandby,
22006   enterRun = kEnterRun,
22007   suspendRequestMsg = kSuspendRequest,
22008   suspendDemandMsg = kSuspendDemand,
22009   suspendRevokeMsg = kSuspendRevoke,
22010   suspendWakeUpMsg = kSuspendWakeUp,
22011   getPowerLevel = kGetPowerLevel,
22012   setPowerLevel = kSetPowerLevel
22013 };
22014
22015
22016 typedef UInt32 PowerLevel;
22017
22018 enum {
22019   kPMDevicePowerLevel_On = 0,
22020   kPMDevicePowerLevel_D1 = 1,
22021   kPMDevicePowerLevel_D2 = 2,
22022   kPMDevicePowerLevel_Off = 3
22023 };
22024
22025
22026 typedef OSStatus ( * PowerHandlerProcPtr)(UInt32 message, void *param, UInt32 refCon, RegEntryID *regEntryID);
22027 typedef PowerHandlerProcPtr PowerHandlerUPP;
22028 enum {
22029   kUseDefaultMinimumWakeTime = 0,
22030   kPowerSummaryVersion = 1,
22031   kDevicePowerInfoVersion = 1
22032 };
22033
22034 enum {
22035
22036   kPCIPowerOffAllowed = (1L << 0)
22037 };
22038
22039 enum {
22040
22041   kDevicePCIPowerOffAllowed = (1L << 0),
22042   kDeviceSupportsPMIS = (1L << 1),
22043   kDeviceCanAssertPMEDuringSleep = (1L << 2),
22044   kDeviceUsesCommonLogicPower = (1L << 3),
22045   kDeviceDriverPresent = (1L << 4),
22046   kDeviceDriverSupportsPowerMgt = (1L << 5)
22047 };
22048
22049 struct DevicePowerInfo {
22050   UInt32 version;
22051   RegEntryID regID;
22052   OptionBits flags;
22053   UInt32 minimumWakeTime;
22054   UInt32 sleepPowerNeeded;
22055 };
22056 typedef struct DevicePowerInfo DevicePowerInfo;
22057 struct PowerSummary {
22058   UInt32 version;
22059   OptionBits flags;
22060   UInt32 sleepPowerAvailable;
22061   UInt32 sleepPowerNeeded;
22062   UInt32 minimumWakeTime;
22063   ItemCount deviceCount;
22064   DevicePowerInfo devices[1];
22065 };
22066 typedef struct PowerSummary PowerSummary;
22067 enum {
22068
22069   noCalls = 1,
22070   noRequest = 2,
22071   slpQType = 16,
22072   sleepQType = 16
22073 };
22074
22075
22076 enum {
22077
22078   kAEMacPowerMgtEvt = 'pmgt',
22079   kAEMacToWake = 'wake',
22080   kAEMacLowPowerSaveData = 'pmsd',
22081   kAEMacEmergencySleep = 'emsl',
22082   kAEMacEmergencyShutdown = 'emsd'
22083 };
22084
22085
22086
22087
22088
22089
22090
22091 enum {
22092   kDeviceDidNotWakeMachine = 0,
22093   kDeviceRequestsFullWake = 1,
22094   kDeviceRequestsWakeToDoze = 2
22095 };
22096
22097
22098 enum {
22099   hasWakeupTimer = 0,
22100   hasSharedModemPort = 1,
22101   hasProcessorCycling = 2,
22102   mustProcessorCycle = 3,
22103   hasReducedSpeed = 4,
22104   dynamicSpeedChange = 5,
22105   hasSCSIDiskMode = 6,
22106   canGetBatteryTime = 7,
22107   canWakeupOnRing = 8,
22108   hasDimmingSupport = 9,
22109   hasStartupTimer = 10,
22110   hasChargeNotification = 11,
22111   hasDimSuspendSupport = 12,
22112   hasWakeOnNetActivity = 13,
22113   hasWakeOnLid = 14,
22114   canPowerOffPCIBus = 15,
22115   hasDeepSleep = 16,
22116   hasSleep = 17,
22117   supportsServerModeAPIs = 18,
22118   supportsUPSIntegration = 19,
22119   hasAggressiveIdling = 20,
22120   supportsIdleQueue = 21
22121 };
22122
22123
22124 enum {
22125   hasInternalModem = 0,
22126   intModemRingDetect = 1,
22127   intModemOffHook = 2,
22128   intModemRingWakeEnb = 3,
22129   extModemSelected = 4,
22130   modemSetBit = 15
22131 };
22132
22133
22134
22135 enum {
22136   batteryInstalled = 7,
22137   batteryCharging = 6,
22138   chargerConnected = 5,
22139   upsConnected = 4,
22140   upsIsPowerSource = 3
22141 };
22142
22143 enum {
22144   HDPwrQType = 0x4844,
22145   PMgrStateQType = 0x504D
22146 };
22147
22148
22149 enum {
22150   pmSleepTimeoutChanged = 0,
22151   pmSleepEnableChanged = 1,
22152   pmHardDiskTimeoutChanged = 2,
22153   pmHardDiskSpindownChanged = 3,
22154   pmDimmingTimeoutChanged = 4,
22155   pmDimmingEnableChanged = 5,
22156   pmDiskModeAddressChanged = 6,
22157   pmProcessorCyclingChanged = 7,
22158   pmProcessorSpeedChanged = 8,
22159   pmWakeupTimerChanged = 9,
22160   pmStartupTimerChanged = 10,
22161   pmHardDiskPowerRemovedbyUser = 11,
22162   pmChargeStatusChanged = 12,
22163   pmPowerLevelChanged = 13,
22164   pmWakeOnNetActivityChanged = 14
22165 };
22166
22167 enum {
22168   pmSleepTimeoutChangedMask = (1 << pmSleepTimeoutChanged),
22169   pmSleepEnableChangedMask = (1 << pmSleepEnableChanged),
22170   pmHardDiskTimeoutChangedMask = (1 << pmHardDiskTimeoutChanged),
22171   pmHardDiskSpindownChangedMask = (1 << pmHardDiskSpindownChanged),
22172   pmDimmingTimeoutChangedMask = (1 << pmDimmingTimeoutChanged),
22173   pmDimmingEnableChangedMask = (1 << pmDimmingEnableChanged),
22174   pmDiskModeAddressChangedMask = (1 << pmDiskModeAddressChanged),
22175   pmProcessorCyclingChangedMask = (1 << pmProcessorCyclingChanged),
22176   pmProcessorSpeedChangedMask = (1 << pmProcessorSpeedChanged),
22177   pmWakeupTimerChangedMask = (1 << pmWakeupTimerChanged),
22178   pmStartupTimerChangedMask = (1 << pmStartupTimerChanged),
22179   pmHardDiskPowerRemovedbyUserMask = (1 << pmHardDiskPowerRemovedbyUser),
22180   pmChargeStatusChangedMask = (1 << pmChargeStatusChanged),
22181   pmPowerLevelChangedMask = (1 << pmPowerLevelChanged),
22182   pmWakeOnNetActivityChangedMask = (1 << pmWakeOnNetActivityChanged)
22183 };
22184 enum {
22185   OverallAct = 0,
22186   UsrActivity = 1,
22187   NetActivity = 2,
22188   HDActivity = 3,
22189   IdleActivity = 4
22190 };
22191
22192
22193 enum {
22194   kMediaModeOn = 0,
22195   kMediaModeStandBy = 1,
22196   kMediaModeSuspend = 2,
22197   kMediaModeOff = 3
22198 };
22199
22200 enum {
22201   kMediaPowerCSCode = 70
22202 };
22203
22204
22205
22206 enum {
22207   kHDQueuePostBit = 0,
22208   kHDQueuePostMask = (1 << kHDQueuePostBit)
22209 };
22210
22211 struct ActivityInfo {
22212   short ActivityType;
22213   unsigned long ActivityTime;
22214 };
22215 typedef struct ActivityInfo ActivityInfo;
22216
22217 struct BatteryInfo {
22218   UInt8 flags;
22219   UInt8 warningLevel;
22220   UInt8 reserved;
22221   UInt8 batteryLevel;
22222 };
22223 typedef struct BatteryInfo BatteryInfo;
22224
22225 typedef SInt8 ModemByte;
22226 typedef SInt8 BatteryByte;
22227 typedef SInt8 SoundMixerByte;
22228 typedef long PMResultCode;
22229 typedef struct SleepQRec SleepQRec;
22230 typedef SleepQRec * SleepQRecPtr;
22231 typedef struct HDQueueElement HDQueueElement;
22232 typedef struct PMgrQueueElement PMgrQueueElement;
22233 typedef long ( * SleepQProcPtr)(long message, SleepQRecPtr qRecPtr);
22234 typedef void ( * HDSpindownProcPtr)(HDQueueElement * theElement);
22235 typedef void ( * PMgrStateChangeProcPtr)(PMgrQueueElement *theElement, long stateBits);
22236 typedef SleepQProcPtr SleepQUPP;
22237 typedef HDSpindownProcPtr HDSpindownUPP;
22238 typedef PMgrStateChangeProcPtr PMgrStateChangeUPP;
22239 struct SleepQRec {
22240   SleepQRecPtr sleepQLink;
22241   short sleepQType;
22242   SleepQUPP sleepQProc;
22243   short sleepQFlags;
22244 };
22245
22246 struct HDQueueElement {
22247   struct HDQueueElement * hdQLink;
22248   short hdQType;
22249   short hdFlags;
22250   HDSpindownUPP hdProc;
22251   long hdUser;
22252 };
22253
22254 struct PMgrQueueElement {
22255   struct PMgrQueueElement * pmQLink;
22256   short pmQType;
22257   short pmFlags;
22258   long pmNotifyBits;
22259   PMgrStateChangeUPP pmProc;
22260   long pmUser;
22261 };
22262
22263
22264 struct BatteryTimeRec {
22265   unsigned long expectedBatteryTime;
22266   unsigned long minimumBatteryTime;
22267   unsigned long maximumBatteryTime;
22268   unsigned long timeUntilCharged;
22269 };
22270 typedef struct BatteryTimeRec BatteryTimeRec;
22271
22272 struct WakeupTime {
22273   unsigned long wakeTime;
22274   Boolean wakeEnabled;
22275   SInt8 filler;
22276 };
22277 typedef struct WakeupTime WakeupTime;
22278
22279 struct StartupTime {
22280   unsigned long startTime;
22281   Boolean startEnabled;
22282   SInt8 filler;
22283 };
22284 typedef struct StartupTime StartupTime;
22285
22286 enum {
22287   kVersionOnePowerSource = 1,
22288   kVersionTwoPowerSource = 2,
22289   kCurrentPowerSourceVersion = kVersionTwoPowerSource
22290 };
22291
22292
22293
22294 enum {
22295   bSourceIsBattery = 0,
22296   bSourceIsAC = 1,
22297   bSourceCanBeCharged = 2,
22298   bSourceIsUPS = 3,
22299   bSourceProvidesWarnLevels = 4,
22300   kSourceIsBatteryMask = (1 << bSourceIsBattery),
22301   kSourceIsACMask = (1 << bSourceIsAC),
22302   kSourceCanBeChargedMask = (1 << bSourceCanBeCharged),
22303   kSourceIsUPSMask = (1 << bSourceIsUPS),
22304   kSourceProvidesWarnLevelsMask = (1 << bSourceProvidesWarnLevels)
22305 };
22306
22307
22308
22309 enum {
22310   bSourceIsAvailable = 0,
22311   bSourceIsCharging = 1,
22312   bChargerIsAttached = 2,
22313   kSourceIsAvailableMask = (1 << bSourceIsAvailable),
22314   kSourceIsChargingMask = (1 << bSourceIsCharging),
22315   kChargerIsAttachedMask = (1 << bChargerIsAttached)
22316 };
22317
22318
22319
22320 enum {
22321   kCapacityIsActual = 0,
22322   kCapacityIsPercentOfMax = 1
22323 };
22324
22325
22326 enum {
22327   kConfigSupportsWakeOnNetBit = 0,
22328   kWakeOnNetAdminAccessesBit = 1,
22329   kWakeOnAllNetAccessesBit = 2,
22330   kUnmountServersBeforeSleepingBit = 3,
22331   kConfigSupportsWakeOnNetMask = (1 << kConfigSupportsWakeOnNetBit),
22332   kWakeOnNetAdminAccessesMask = (1 << kWakeOnNetAdminAccessesBit),
22333   kWakeOnAllNetAccessesMask = (1 << kWakeOnAllNetAccessesBit),
22334   kUnmountServersBeforeSleepingMask = (1 << kUnmountServersBeforeSleepingBit)
22335 };
22336
22337
22338 enum {
22339   kCurrentCapacityIsActualValue = 0,
22340   kCurrentCapacityIsPercentOfMax = 1
22341 };
22342
22343
22344 typedef SInt16 PowerSourceID;
22345 struct PowerSourceParamBlock {
22346   PowerSourceID sourceID;
22347   UInt16 sourceCapacityUsage;
22348   UInt32 sourceVersion;
22349   OptionBits sourceAttr;
22350   OptionBits sourceState;
22351   UInt32 currentCapacity;
22352
22353   UInt32 maxCapacity;
22354   UInt32 timeRemaining;
22355
22356   UInt32 timeToFullCharge;
22357
22358   UInt32 voltage;
22359   SInt32 current;
22360
22361
22362   UInt32 lowWarnLevel;
22363   UInt32 deadWarnLevel;
22364   UInt32 reserved[16];
22365 };
22366 typedef struct PowerSourceParamBlock PowerSourceParamBlock;
22367 typedef PowerSourceParamBlock * PowerSourceParamBlockPtr;
22368 extern OSErr
22369 DisableWUTime(void) ;
22370 extern OSErr
22371 SetWUTime(long wuTime) ;
22372 extern OSErr
22373 GetWUTime(
22374   long * wuTime,
22375   Byte * wuFlag) ;
22376 extern OSErr
22377 BatteryStatus(
22378   Byte * status,
22379   Byte * power) ;
22380 extern OSErr
22381 ModemStatus(Byte * status) ;
22382 extern long
22383 IdleUpdate(void) ;
22384 extern long
22385 GetCPUSpeed(void) ;
22386 extern void
22387 EnableIdle(void) ;
22388 extern void
22389 DisableIdle(void) ;
22390 extern void
22391 SleepQInstall(SleepQRecPtr qRecPtr) ;
22392 extern void
22393 SleepQRemove(SleepQRecPtr qRecPtr) ;
22394 extern void
22395 AOn(void) ;
22396 extern void
22397 AOnIgnoreModem(void) ;
22398 extern void
22399 BOn(void) ;
22400 extern void
22401 AOff(void) ;
22402 extern void
22403 BOff(void) ;
22404 extern short
22405 PMSelectorCount(void) ;
22406 extern UInt32
22407 PMFeatures(void) ;
22408 extern UInt8
22409 GetSleepTimeout(void) ;
22410 extern void
22411 SetSleepTimeout(UInt8 timeout) ;
22412 extern UInt8
22413 GetHardDiskTimeout(void) ;
22414 extern void
22415 SetHardDiskTimeout(UInt8 timeout) ;
22416 extern Boolean
22417 HardDiskPowered(void) ;
22418 extern void
22419 SpinDownHardDisk(void) ;
22420 extern Boolean
22421 IsSpindownDisabled(void) ;
22422 extern void
22423 SetSpindownDisable(Boolean setDisable) ;
22424 extern OSErr
22425 HardDiskQInstall(HDQueueElement * theElement) ;
22426 extern OSErr
22427 HardDiskQRemove(HDQueueElement * theElement) ;
22428 extern void
22429 GetScaledBatteryInfo(
22430   short whichBattery,
22431   BatteryInfo * theInfo) ;
22432 extern void
22433 AutoSleepControl(Boolean enableSleep) ;
22434 extern UInt32
22435 GetIntModemInfo(void) ;
22436 extern void
22437 SetIntModemState(short theState) ;
22438 extern short
22439 MaximumProcessorSpeed(void) ;
22440 extern short
22441 MinimumProcessorSpeed(void) ;
22442 extern short
22443 CurrentProcessorSpeed(void) ;
22444 extern Boolean
22445 FullProcessorSpeed(void) ;
22446 extern Boolean
22447 SetProcessorSpeed(Boolean fullSpeed) ;
22448 extern short
22449 GetSCSIDiskModeAddress(void) ;
22450 extern void
22451 SetSCSIDiskModeAddress(short scsiAddress) ;
22452 extern void
22453 GetWakeupTimer(WakeupTime * theTime) ;
22454 extern void
22455 SetWakeupTimer(WakeupTime * theTime) ;
22456 extern Boolean
22457 IsProcessorCyclingEnabled(void) ;
22458 extern void
22459 EnableProcessorCycling(Boolean enable) ;
22460 extern short
22461 BatteryCount(void) ;
22462 extern Fixed
22463 GetBatteryVoltage(short whichBattery) ;
22464 extern void
22465 GetBatteryTimes(
22466   short whichBattery,
22467   BatteryTimeRec * theTimes) ;
22468 extern UInt8
22469 GetDimmingTimeout(void) ;
22470 extern void
22471 SetDimmingTimeout(UInt8 timeout) ;
22472 extern void
22473 DimmingControl(Boolean enableSleep) ;
22474 extern Boolean
22475 IsDimmingControlDisabled(void) ;
22476 extern Boolean
22477 IsAutoSlpControlDisabled(void) ;
22478 extern OSErr
22479 PMgrStateQInstall(PMgrQueueElement * theElement) ;
22480 extern OSErr
22481 PMgrStateQRemove(PMgrQueueElement * theElement) ;
22482 extern OSErr
22483 UpdateSystemActivity(UInt8 activity) ;
22484 extern OSErr
22485 DelaySystemIdle(void) ;
22486 extern OSErr
22487 GetStartupTimer(StartupTime * theTime) ;
22488 extern OSErr
22489 SetStartupTimer(StartupTime * theTime) ;
22490 extern OSErr
22491 GetLastActivity(ActivityInfo * theActivity) ;
22492 extern OSErr
22493 GetSoundMixerState(SoundMixerByte * theSoundMixerByte) ;
22494 extern OSErr
22495 SetSoundMixerState(SoundMixerByte * theSoundMixerByte) ;
22496 extern Boolean
22497 GetDimSuspendState(void) ;
22498 extern void
22499 SetDimSuspendState(Boolean dimSuspendState) ;
22500 extern SleepQUPP
22501 NewSleepQUPP(SleepQProcPtr userRoutine) ;
22502 extern HDSpindownUPP
22503 NewHDSpindownUPP(HDSpindownProcPtr userRoutine) ;
22504 extern PMgrStateChangeUPP
22505 NewPMgrStateChangeUPP(PMgrStateChangeProcPtr userRoutine) ;
22506 extern void
22507 DisposeSleepQUPP(SleepQUPP userUPP) ;
22508 extern void
22509 DisposeHDSpindownUPP(HDSpindownUPP userUPP) ;
22510 extern void
22511 DisposePMgrStateChangeUPP(PMgrStateChangeUPP userUPP) ;
22512 extern long
22513 InvokeSleepQUPP(
22514   long message,
22515   SleepQRecPtr qRecPtr,
22516   SleepQUPP userUPP) ;
22517 extern void
22518 InvokeHDSpindownUPP(
22519   HDQueueElement * theElement,
22520   HDSpindownUPP userUPP) ;
22521 extern void
22522 InvokePMgrStateChangeUPP(
22523   PMgrQueueElement * theElement,
22524   long stateBits,
22525   PMgrStateChangeUPP userUPP) ;
22526
22527
22528
22529
22530
22531 }
22532
22533
22534
22535 extern "C" {
22536
22537
22538
22539
22540 enum {
22541   scInc = 1,
22542   scNoInc = 2,
22543   scAdd = 3,
22544   scMove = 4,
22545   scLoop = 5,
22546   scNop = 6,
22547   scStop = 7,
22548   scComp = 8
22549 };
22550
22551
22552 struct SCSIInstr {
22553   unsigned short scOpcode;
22554   long scParam1;
22555   long scParam2;
22556 };
22557 typedef struct SCSIInstr SCSIInstr;
22558 enum {
22559   scsiVERSION = 43
22560 };
22561
22562
22563
22564
22565
22566 typedef void ( * SCSICallbackProcPtr)(void * scsiPB);
22567 typedef SCSICallbackProcPtr SCSICallbackUPP;
22568 extern SCSICallbackUPP
22569 NewSCSICallbackUPP(SCSICallbackProcPtr userRoutine) ;
22570 extern void
22571 DisposeSCSICallbackUPP(SCSICallbackUPP userUPP) ;
22572 extern void
22573 InvokeSCSICallbackUPP(
22574   void * scsiPB,
22575   SCSICallbackUPP userUPP) ;
22576
22577
22578
22579
22580
22581
22582 enum {
22583   SCSINop = 0x00,
22584   SCSIExecIO = 0x01,
22585   SCSIBusInquiry = 0x03,
22586   SCSIReleaseQ = 0x04,
22587   SCSIAbortCommand = 0x10,
22588   SCSIResetBus = 0x11,
22589   SCSIResetDevice = 0x12,
22590   SCSITerminateIO = 0x13
22591 };
22592
22593 enum {
22594   vendorUnique = 0xC0
22595 };
22596
22597
22598
22599 enum {
22600   handshakeDataLength = 8,
22601   maxCDBLength = 16,
22602   vendorIDLength = 16
22603 };
22604
22605
22606 struct DeviceIdent {
22607   UInt8 diReserved;
22608   UInt8 bus;
22609   UInt8 targetID;
22610   UInt8 LUN;
22611 };
22612 typedef struct DeviceIdent DeviceIdent;
22613
22614
22615
22616
22617
22618
22619 enum {
22620   kBusTypeSCSI = 0,
22621   kBusTypeATA = 1,
22622   kBusTypePCMCIA = 2,
22623   kBusTypeMediaBay = 3
22624 };
22625
22626
22627
22628
22629 struct DeviceIdentATA {
22630   UInt8 diReserved;
22631   UInt8 busNum;
22632   UInt8 devNum;
22633   UInt8 diReserved2;
22634 };
22635 typedef struct DeviceIdentATA DeviceIdentATA;
22636
22637
22638
22639 union CDB {
22640   BytePtr cdbPtr;
22641   UInt8 cdbBytes[16];
22642 };
22643 typedef union CDB CDB;
22644 typedef CDB * CDBPtr;
22645
22646 struct SGRecord {
22647   Ptr SGAddr;
22648   UInt32 SGCount;
22649 };
22650 typedef struct SGRecord SGRecord;
22651 struct SCSIHdr {
22652   struct SCSIHdr * qLink;
22653   short scsiReserved1;
22654   UInt16 scsiPBLength;
22655   UInt8 scsiFunctionCode;
22656   UInt8 scsiReserved2;
22657   volatile OSErr scsiResult;
22658   DeviceIdent scsiDevice;
22659   SCSICallbackUPP scsiCompletion;
22660   UInt32 scsiFlags;
22661   BytePtr scsiDriverStorage;
22662   Ptr scsiXPTprivate;
22663   long scsiReserved3;
22664 };
22665 typedef struct SCSIHdr SCSIHdr;
22666 struct SCSI_PB {
22667   SCSIHdr * qLink;
22668   short scsiReserved1;
22669   UInt16 scsiPBLength;
22670   UInt8 scsiFunctionCode;
22671   UInt8 scsiReserved2;
22672   volatile OSErr scsiResult;
22673   DeviceIdent scsiDevice;
22674   SCSICallbackUPP scsiCompletion;
22675   UInt32 scsiFlags;
22676   BytePtr scsiDriverStorage;
22677   Ptr scsiXPTprivate;
22678   long scsiReserved3;
22679 };
22680 typedef struct SCSI_PB SCSI_PB;
22681 struct SCSI_IO {
22682   SCSIHdr * qLink;
22683   short scsiReserved1;
22684   UInt16 scsiPBLength;
22685   UInt8 scsiFunctionCode;
22686   UInt8 scsiReserved2;
22687   volatile OSErr scsiResult;
22688   DeviceIdent scsiDevice;
22689   SCSICallbackUPP scsiCompletion;
22690   UInt32 scsiFlags;
22691   BytePtr scsiDriverStorage;
22692   Ptr scsiXPTprivate;
22693   long scsiReserved3;
22694
22695   UInt16 scsiResultFlags;
22696   UInt16 scsiReserved3pt5;
22697   BytePtr scsiDataPtr;
22698   UInt32 scsiDataLength;
22699   BytePtr scsiSensePtr;
22700   UInt8 scsiSenseLength;
22701   UInt8 scsiCDBLength;
22702   UInt16 scsiSGListCount;
22703   UInt32 scsiReserved4;
22704   UInt8 scsiSCSIstatus;
22705   SInt8 scsiSenseResidual;
22706   UInt16 scsiReserved5;
22707   long scsiDataResidual;
22708   CDB scsiCDB;
22709   long scsiTimeout;
22710   BytePtr scsiReserved5pt5;
22711   UInt16 scsiReserved5pt6;
22712   UInt16 scsiIOFlags;
22713   UInt8 scsiTagAction;
22714   UInt8 scsiReserved6;
22715   UInt16 scsiReserved7;
22716   UInt16 scsiSelectTimeout;
22717   UInt8 scsiDataType;
22718   UInt8 scsiTransferType;
22719   UInt32 scsiReserved8;
22720   UInt32 scsiReserved9;
22721   UInt16 scsiHandshake[8];
22722   UInt32 scsiReserved10;
22723   UInt32 scsiReserved11;
22724   struct SCSI_IO * scsiCommandLink;
22725
22726   UInt8 scsiSIMpublics[8];
22727   UInt8 scsiAppleReserved6[8];
22728
22729
22730
22731   UInt16 scsiCurrentPhase;
22732   short scsiSelector;
22733   OSErr scsiOldCallResult;
22734   UInt8 scsiSCSImessage;
22735   UInt8 XPTprivateFlags;
22736   UInt8 XPTextras[12];
22737 };
22738 typedef struct SCSI_IO SCSI_IO;
22739 typedef SCSI_IO SCSIExecIOPB;
22740
22741 struct SCSIBusInquiryPB {
22742   SCSIHdr * qLink;
22743   short scsiReserved1;
22744   UInt16 scsiPBLength;
22745   UInt8 scsiFunctionCode;
22746   UInt8 scsiReserved2;
22747   volatile OSErr scsiResult;
22748   DeviceIdent scsiDevice;
22749   SCSICallbackUPP scsiCompletion;
22750   UInt32 scsiFlags;
22751   BytePtr scsiDriverStorage;
22752   Ptr scsiXPTprivate;
22753   long scsiReserved3;
22754
22755   UInt16 scsiEngineCount;
22756   UInt16 scsiMaxTransferType;
22757
22758   UInt32 scsiDataTypes;
22759
22760   UInt16 scsiIOpbSize;
22761   UInt16 scsiMaxIOpbSize;
22762
22763   UInt32 scsiFeatureFlags;
22764
22765   UInt8 scsiVersionNumber;
22766   UInt8 scsiHBAInquiry;
22767   UInt8 scsiTargetModeFlags;
22768   UInt8 scsiScanFlags;
22769
22770   UInt32 scsiSIMPrivatesPtr;
22771   UInt32 scsiSIMPrivatesSize;
22772   UInt32 scsiAsyncFlags;
22773
22774   UInt8 scsiHiBusID;
22775   UInt8 scsiInitiatorID;
22776   UInt16 scsiBIReserved0;
22777
22778   UInt32 scsiBIReserved1;
22779   UInt32 scsiFlagsSupported;
22780
22781   UInt16 scsiIOFlagsSupported;
22782   UInt16 scsiWeirdStuff;
22783   UInt16 scsiMaxTarget;
22784   UInt16 scsiMaxLUN;
22785
22786   char scsiSIMVendor[16];
22787   char scsiHBAVendor[16];
22788   char scsiControllerFamily[16];
22789   char scsiControllerType[16];
22790
22791   char scsiXPTversion[4];
22792   char scsiSIMversion[4];
22793   char scsiHBAversion[4];
22794
22795   UInt8 scsiHBAslotType;
22796   UInt8 scsiHBAslotNumber;
22797   UInt16 scsiSIMsRsrcID;
22798
22799   UInt16 scsiBIReserved3;
22800   UInt16 scsiAdditionalLength;
22801 };
22802 typedef struct SCSIBusInquiryPB SCSIBusInquiryPB;
22803
22804 struct SCSIAbortCommandPB {
22805   SCSIHdr * qLink;
22806   short scsiReserved1;
22807   UInt16 scsiPBLength;
22808   UInt8 scsiFunctionCode;
22809   UInt8 scsiReserved2;
22810   volatile OSErr scsiResult;
22811   DeviceIdent scsiDevice;
22812   SCSICallbackUPP scsiCompletion;
22813   UInt32 scsiFlags;
22814   BytePtr scsiDriverStorage;
22815   Ptr scsiXPTprivate;
22816   long scsiReserved3;
22817   SCSI_IO * scsiIOptr;
22818 };
22819 typedef struct SCSIAbortCommandPB SCSIAbortCommandPB;
22820
22821 struct SCSITerminateIOPB {
22822   SCSIHdr * qLink;
22823   short scsiReserved1;
22824   UInt16 scsiPBLength;
22825   UInt8 scsiFunctionCode;
22826   UInt8 scsiReserved2;
22827   volatile OSErr scsiResult;
22828   DeviceIdent scsiDevice;
22829   SCSICallbackUPP scsiCompletion;
22830   UInt32 scsiFlags;
22831   BytePtr scsiDriverStorage;
22832   Ptr scsiXPTprivate;
22833   long scsiReserved3;
22834   SCSI_IO * scsiIOptr;
22835 };
22836 typedef struct SCSITerminateIOPB SCSITerminateIOPB;
22837
22838 struct SCSIResetBusPB {
22839   SCSIHdr * qLink;
22840   short scsiReserved1;
22841   UInt16 scsiPBLength;
22842   UInt8 scsiFunctionCode;
22843   UInt8 scsiReserved2;
22844   volatile OSErr scsiResult;
22845   DeviceIdent scsiDevice;
22846   SCSICallbackUPP scsiCompletion;
22847   UInt32 scsiFlags;
22848   BytePtr scsiDriverStorage;
22849   Ptr scsiXPTprivate;
22850   long scsiReserved3;
22851 };
22852 typedef struct SCSIResetBusPB SCSIResetBusPB;
22853
22854 struct SCSIResetDevicePB {
22855   SCSIHdr * qLink;
22856   short scsiReserved1;
22857   UInt16 scsiPBLength;
22858   UInt8 scsiFunctionCode;
22859   UInt8 scsiReserved2;
22860   volatile OSErr scsiResult;
22861   DeviceIdent scsiDevice;
22862   SCSICallbackUPP scsiCompletion;
22863   UInt32 scsiFlags;
22864   BytePtr scsiDriverStorage;
22865   Ptr scsiXPTprivate;
22866   long scsiReserved3;
22867 };
22868 typedef struct SCSIResetDevicePB SCSIResetDevicePB;
22869
22870 struct SCSIReleaseQPB {
22871   SCSIHdr * qLink;
22872   short scsiReserved1;
22873   UInt16 scsiPBLength;
22874   UInt8 scsiFunctionCode;
22875   UInt8 scsiReserved2;
22876   volatile OSErr scsiResult;
22877   DeviceIdent scsiDevice;
22878   SCSICallbackUPP scsiCompletion;
22879   UInt32 scsiFlags;
22880   BytePtr scsiDriverStorage;
22881   Ptr scsiXPTprivate;
22882   long scsiReserved3;
22883 };
22884 typedef struct SCSIReleaseQPB SCSIReleaseQPB;
22885
22886 struct SCSIGetVirtualIDInfoPB {
22887   SCSIHdr * qLink;
22888   short scsiReserved1;
22889   UInt16 scsiPBLength;
22890   UInt8 scsiFunctionCode;
22891   UInt8 scsiReserved2;
22892   volatile OSErr scsiResult;
22893   DeviceIdent scsiDevice;
22894   SCSICallbackUPP scsiCompletion;
22895   UInt32 scsiFlags;
22896   Ptr scsiDriverStorage;
22897   Ptr scsiXPTprivate;
22898   long scsiReserved3;
22899   UInt16 scsiOldCallID;
22900   Boolean scsiExists;
22901   SInt8 filler;
22902 };
22903 typedef struct SCSIGetVirtualIDInfoPB SCSIGetVirtualIDInfoPB;
22904
22905 struct SCSIDriverPB {
22906   SCSIHdr * qLink;
22907   short scsiReserved1;
22908   UInt16 scsiPBLength;
22909   UInt8 scsiFunctionCode;
22910   UInt8 scsiReserved2;
22911   volatile OSErr scsiResult;
22912   DeviceIdent scsiDevice;
22913   SCSICallbackUPP scsiCompletion;
22914   UInt32 scsiFlags;
22915   Ptr scsiDriverStorage;
22916   Ptr scsiXPTprivate;
22917   long scsiReserved3;
22918   short scsiDriver;
22919   UInt16 scsiDriverFlags;
22920   DeviceIdent scsiNextDevice;
22921 };
22922 typedef struct SCSIDriverPB SCSIDriverPB;
22923
22924 struct SCSILoadDriverPB {
22925   SCSIHdr * qLink;
22926   short scsiReserved1;
22927   UInt16 scsiPBLength;
22928   UInt8 scsiFunctionCode;
22929   UInt8 scsiReserved2;
22930   volatile OSErr scsiResult;
22931   DeviceIdent scsiDevice;
22932   SCSICallbackUPP scsiCompletion;
22933   UInt32 scsiFlags;
22934   Ptr scsiDriverStorage;
22935   Ptr scsiXPTprivate;
22936   long scsiReserved3;
22937   short scsiLoadedRefNum;
22938   Boolean scsiDiskLoadFailed;
22939   SInt8 filler;
22940 };
22941 typedef struct SCSILoadDriverPB SCSILoadDriverPB;
22942
22943
22944 enum {
22945   scsiTransferBlind = 0,
22946   scsiTransferPolled = 1
22947 };
22948
22949 enum {
22950   scsiErrorBase = -7936
22951 };
22952
22953 enum {
22954   scsiRequestInProgress = 1,
22955
22956   scsiRequestAborted = scsiErrorBase + 2,
22957   scsiUnableToAbort = scsiErrorBase + 3,
22958   scsiNonZeroStatus = scsiErrorBase + 4,
22959   scsiUnused05 = scsiErrorBase + 5,
22960   scsiUnused06 = scsiErrorBase + 6,
22961   scsiUnused07 = scsiErrorBase + 7,
22962   scsiUnused08 = scsiErrorBase + 8,
22963   scsiUnableToTerminate = scsiErrorBase + 9,
22964   scsiSelectTimeout = scsiErrorBase + 10,
22965   scsiCommandTimeout = scsiErrorBase + 11,
22966   scsiIdentifyMessageRejected = scsiErrorBase + 12,
22967   scsiMessageRejectReceived = scsiErrorBase + 13,
22968   scsiSCSIBusReset = scsiErrorBase + 14,
22969   scsiParityError = scsiErrorBase + 15,
22970   scsiAutosenseFailed = scsiErrorBase + 16,
22971   scsiUnused11 = scsiErrorBase + 17,
22972   scsiDataRunError = scsiErrorBase + 18,
22973   scsiUnexpectedBusFree = scsiErrorBase + 19,
22974   scsiSequenceFailed = scsiErrorBase + 20,
22975   scsiWrongDirection = scsiErrorBase + 21,
22976   scsiUnused16 = scsiErrorBase + 22,
22977   scsiBDRsent = scsiErrorBase + 23,
22978   scsiTerminated = scsiErrorBase + 24,
22979   scsiNoNexus = scsiErrorBase + 25,
22980   scsiCDBReceived = scsiErrorBase + 26,
22981
22982   scsiTooManyBuses = scsiErrorBase + 48,
22983   scsiBusy = scsiErrorBase + 49,
22984   scsiProvideFail = scsiErrorBase + 50,
22985   scsiDeviceNotThere = scsiErrorBase + 51,
22986   scsiNoHBA = scsiErrorBase + 52,
22987   scsiDeviceConflict = scsiErrorBase + 53,
22988   scsiNoSuchXref = scsiErrorBase + 54,
22989   scsiQLinkInvalid = scsiErrorBase + 55,
22990
22991
22992   scsiPBLengthError = scsiErrorBase + 64,
22993   scsiFunctionNotAvailable = scsiErrorBase + 65,
22994   scsiRequestInvalid = scsiErrorBase + 66,
22995   scsiBusInvalid = scsiErrorBase + 67,
22996   scsiTIDInvalid = scsiErrorBase + 68,
22997   scsiLUNInvalid = scsiErrorBase + 69,
22998   scsiIDInvalid = scsiErrorBase + 70,
22999   scsiDataTypeInvalid = scsiErrorBase + 71,
23000   scsiTransferTypeInvalid = scsiErrorBase + 72,
23001   scsiCDBLengthInvalid = scsiErrorBase + 73
23002 };
23003
23004
23005 enum {
23006   scsiUnused74 = scsiErrorBase + 74,
23007   scsiUnused75 = scsiErrorBase + 75,
23008   scsiBadDataLength = scsiErrorBase + 76,
23009   scsiPartialPrepared = scsiErrorBase + 77,
23010   scsiInvalidMsgType = scsiErrorBase + 78,
23011   scsiUnused79 = scsiErrorBase + 79,
23012   scsiBadConnID = scsiErrorBase + 80,
23013   scsiUnused81 = scsiErrorBase + 81,
23014   scsiIOInProgress = scsiErrorBase + 82,
23015   scsiTargetReserved = scsiErrorBase + 83,
23016   scsiUnused84 = scsiErrorBase + 84,
23017   scsiUnused85 = scsiErrorBase + 85,
23018   scsiBadConnType = scsiErrorBase + 86,
23019   scsiCannotLoadPlugin = scsiErrorBase + 87
23020 };
23021 enum {
23022   scsiFamilyInternalError = scsiErrorBase + 87,
23023   scsiPluginInternalError = scsiErrorBase + 88,
23024   scsiVendorSpecificErrorBase = scsiErrorBase + 128,
23025   scsiVendorSpecificErrorCount = 16
23026 };
23027
23028
23029 enum {
23030   scsiExecutionErrors = scsiErrorBase,
23031   scsiNotExecutedErrors = scsiTooManyBuses,
23032   scsiParameterErrors = scsiPBLengthError
23033 };
23034
23035
23036 enum {
23037   scsiSIMQFrozen = 0x0001,
23038   scsiAutosenseValid = 0x0002,
23039   scsiBusNotFree = 0x0004
23040 };
23041
23042
23043 enum {
23044   kbSCSIDisableAutosense = 29,
23045   kbSCSIFlagReservedA = 28,
23046   kbSCSIFlagReserved0 = 27,
23047   kbSCSICDBLinked = 26,
23048   kbSCSIQEnable = 25,
23049   kbSCSICDBIsPointer = 24,
23050   kbSCSIFlagReserved1 = 23,
23051   kbSCSIInitiateSyncData = 22,
23052   kbSCSIDisableSyncData = 21,
23053   kbSCSISIMQHead = 20,
23054   kbSCSISIMQFreeze = 19,
23055   kbSCSISIMQNoFreeze = 18,
23056   kbSCSIDoDisconnect = 17,
23057   kbSCSIDontDisconnect = 16,
23058   kbSCSIDataReadyForDMA = 15,
23059   kbSCSIFlagReserved3 = 14,
23060   kbSCSIDataPhysical = 13,
23061   kbSCSISensePhysical = 12,
23062   kbSCSIFlagReserved5 = 11,
23063   kbSCSIFlagReserved6 = 10,
23064   kbSCSIFlagReserved7 = 9,
23065   kbSCSIFlagReserved8 = 8,
23066   kbSCSIDataBufferValid = 7,
23067   kbSCSIStatusBufferValid = 6,
23068   kbSCSIMessageBufferValid = 5,
23069   kbSCSIFlagReserved9 = 4
23070 };
23071
23072
23073 enum {
23074   scsiDirectionMask = (long)0xC0000000,
23075   scsiDirectionNone = (long)0xC0000000,
23076   scsiDirectionReserved = 0x00000000,
23077   scsiDirectionOut = (long)0x80000000,
23078   scsiDirectionIn = 0x40000000,
23079   scsiDisableAutosense = 0x20000000,
23080   scsiFlagReservedA = 0x10000000,
23081   scsiFlagReserved0 = 0x08000000,
23082   scsiCDBLinked = 0x04000000,
23083   scsiQEnable = 0x02000000,
23084   scsiCDBIsPointer = 0x01000000,
23085   scsiFlagReserved1 = 0x00800000,
23086   scsiInitiateSyncData = 0x00400000,
23087   scsiDisableSyncData = 0x00200000,
23088   scsiSIMQHead = 0x00100000,
23089   scsiSIMQFreeze = 0x00080000,
23090   scsiSIMQNoFreeze = 0x00040000,
23091   scsiDoDisconnect = 0x00020000,
23092   scsiDontDisconnect = 0x00010000,
23093   scsiDataReadyForDMA = 0x00008000,
23094   scsiFlagReserved3 = 0x00004000,
23095   scsiDataPhysical = 0x00002000,
23096   scsiSensePhysical = 0x00001000,
23097   scsiFlagReserved5 = 0x00000800,
23098   scsiFlagReserved6 = 0x00000400,
23099   scsiFlagReserved7 = 0x00000200,
23100   scsiFlagReserved8 = 0x00000100
23101 };
23102
23103
23104 enum {
23105   scsiNoParityCheck = 0x0002,
23106   scsiDisableSelectWAtn = 0x0004,
23107   scsiSavePtrOnDisconnect = 0x0008,
23108   scsiNoBucketIn = 0x0010,
23109   scsiNoBucketOut = 0x0020,
23110   scsiDisableWide = 0x0040,
23111   scsiInitiateWide = 0x0080,
23112   scsiRenegotiateSense = 0x0100,
23113   scsiDisableDiscipline = 0x0200,
23114   scsiIOFlagReserved0080 = 0x0080,
23115   scsiIOFlagReserved8000 = 0x8000
23116 };
23117
23118
23119
23120 enum {
23121   scsiBusMDP = 0x80,
23122   scsiBusWide32 = 0x40,
23123   scsiBusWide16 = 0x20,
23124   scsiBusSDTR = 0x10,
23125   scsiBusLinkedCDB = 0x08,
23126   scsiBusTagQ = 0x02,
23127   scsiBusSoftReset = 0x01
23128 };
23129
23130
23131 enum {
23132   scsiDataBuffer = 0,
23133   scsiDataTIB = 1,
23134   scsiDataSG = 2,
23135   scsiDataIOTable = 3
23136 };
23137
23138
23139
23140 enum {
23141   scsiBusDataTIB = (1 << scsiDataTIB),
23142   scsiBusDataBuffer = (1 << scsiDataBuffer),
23143   scsiBusDataSG = (1 << scsiDataSG),
23144   scsiBusDataIOTable = (1 << scsiDataIOTable),
23145   scsiBusDataReserved = (long)0x80000000
23146 };
23147
23148
23149 enum {
23150   scsiBusScansDevices = 0x80,
23151   scsiBusScansOnInit = 0x40,
23152   scsiBusLoadsROMDrivers = 0x20
23153 };
23154
23155
23156 enum {
23157   scsiBusLVD = 0x00000400,
23158   scsiBusUltra3SCSI = 0x00000200,
23159   scsiBusUltra2SCSI = 0x00000100,
23160   scsiBusInternalExternalMask = 0x000000C0,
23161   scsiBusInternalExternalUnknown = 0x00000000,
23162   scsiBusInternalExternal = 0x000000C0,
23163   scsiBusInternal = 0x00000080,
23164   scsiBusExternal = 0x00000040,
23165   scsiBusCacheCoherentDMA = 0x00000020,
23166   scsiBusOldCallCapable = 0x00000010,
23167   scsiBusUltraSCSI = 0x00000008,
23168   scsiBusDifferential = 0x00000004,
23169   scsiBusFastSCSI = 0x00000002,
23170   scsiBusDMAavailable = 0x00000001
23171 };
23172
23173
23174 enum {
23175   scsiOddDisconnectUnsafeRead1 = 0x0001,
23176   scsiOddDisconnectUnsafeWrite1 = 0x0002,
23177   scsiBusErrorsUnsafe = 0x0004,
23178   scsiRequiresHandshake = 0x0008,
23179   scsiTargetDrivenSDTRSafe = 0x0010,
23180   scsiOddCountForPhysicalUnsafe = 0x0020,
23181   scsiAbortCmdFixed = 0x0040,
23182   scsiMeshACKTimingFixed = 0x0080
23183 };
23184
23185
23186 enum {
23187   scsiMotherboardBus = 0x00,
23188   scsiNuBus = 0x01,
23189   scsiPDSBus = 0x03,
23190   scsiPCIBus = 0x04,
23191   scsiPCMCIABus = 0x05,
23192   scsiFireWireBridgeBus = 0x06,
23193   scsiUSBBus = 0x07
23194 };
23195
23196
23197 enum {
23198   scsiDeviceSensitive = 0x0001,
23199   scsiDeviceNoOldCallAccess = 0x0002
23200 };
23201
23202
23203
23204
23205
23206
23207 enum {
23208   scsiStatGood = 0x00,
23209   scsiStatCheckCondition = 0x02,
23210   scsiStatConditionMet = 0x04,
23211   scsiStatBusy = 0x08,
23212   scsiStatIntermediate = 0x10,
23213   scsiStatIntermedMet = 0x14,
23214   scsiStatResvConflict = 0x18,
23215   scsiStatTerminated = 0x22,
23216   scsiStatQFull = 0x28
23217 };
23218
23219
23220 enum {
23221   kCmdCompleteMsg = 0,
23222   kExtendedMsg = 1,
23223   kSaveDataPointerMsg = 2,
23224   kRestorePointersMsg = 3,
23225   kDisconnectMsg = 4,
23226   kInitiatorDetectedErrorMsg = 5,
23227   kAbortMsg = 6,
23228   kMsgRejectMsg = 7,
23229   kNoOperationMsg = 8,
23230   kMsgParityErrorMsg = 9,
23231   kLinkedCmdCompleteMsg = 10,
23232   kLinkedCmdCompleteWithFlagMsg = 11,
23233   kBusDeviceResetMsg = 12,
23234   kAbortTagMsg = 13,
23235   kClearQueueMsg = 14,
23236   kInitiateRecoveryMsg = 15,
23237   kReleaseRecoveryMsg = 16,
23238   kTerminateIOProcessMsg = 17,
23239   kSimpleQueueTag = 0x20,
23240   kHeadOfQueueTagMsg = 0x21,
23241   kOrderedQueueTagMsg = 0x22,
23242   kIgnoreWideResidueMsg = 0x23
23243 };
23244 extern OSErr
23245 SCSIAction(SCSI_PB * parameterBlock) ;
23246
23247
23248 }
23249
23250
23251
23252 extern "C" {
23253
23254
23255
23256
23257
23258 enum {
23259   kSystemSoundNoError = 0,
23260   kSystemSoundUnspecifiedError = -1500
23261 };
23262
23263
23264
23265
23266 typedef UInt32 SystemSoundActionID;
23267 extern void
23268 AlertSoundPlay(void) ;
23269 extern void
23270 SystemSoundPlay(SystemSoundActionID inAction) ;
23271 extern OSStatus
23272 SystemSoundGetActionID(
23273   const FSRef * userFile,
23274   SystemSoundActionID * outAction) ;
23275 extern OSStatus
23276 SystemSoundRemoveActionID(SystemSoundActionID inAction) ;
23277
23278
23279
23280
23281 }
23282
23283
23284
23285
23286
23287
23288 enum {
23289   kThumbnail32BitData = 'it32',
23290   kThumbnail8BitMask = 't8mk'
23291 };
23292
23293 enum {
23294   kHuge1BitMask = 'ich#',
23295   kHuge4BitData = 'ich4',
23296   kHuge8BitData = 'ich8',
23297   kHuge32BitData = 'ih32',
23298   kHuge8BitMask = 'h8mk'
23299 };
23300
23301
23302
23303 enum {
23304   kLarge1BitMask = 'ICN#',
23305   kLarge4BitData = 'icl4',
23306   kLarge8BitData = 'icl8',
23307   kLarge32BitData = 'il32',
23308   kLarge8BitMask = 'l8mk',
23309   kSmall1BitMask = 'ics#',
23310   kSmall4BitData = 'ics4',
23311   kSmall8BitData = 'ics8',
23312   kSmall32BitData = 'is32',
23313   kSmall8BitMask = 's8mk',
23314   kMini1BitMask = 'icm#',
23315   kMini4BitData = 'icm4',
23316   kMini8BitData = 'icm8'
23317 };
23318
23319
23320 enum {
23321   large1BitMask = kLarge1BitMask,
23322   large4BitData = kLarge4BitData,
23323   large8BitData = kLarge8BitData,
23324   small1BitMask = kSmall1BitMask,
23325   small4BitData = kSmall4BitData,
23326   small8BitData = kSmall8BitData,
23327   mini1BitMask = kMini1BitMask,
23328   mini4BitData = kMini4BitData,
23329   mini8BitData = kMini8BitData
23330 };
23331 enum {
23332   kIconFamilyType = 'icns'
23333 };
23334
23335
23336 struct IconFamilyElement {
23337   OSType elementType;
23338   Size elementSize;
23339   unsigned char elementData[1];
23340 };
23341 typedef struct IconFamilyElement IconFamilyElement;
23342 struct IconFamilyResource {
23343   OSType resourceType;
23344   Size resourceSize;
23345   IconFamilyElement elements[1];
23346
23347 };
23348 typedef struct IconFamilyResource IconFamilyResource;
23349 typedef IconFamilyResource * IconFamilyPtr;
23350 typedef IconFamilyPtr * IconFamilyHandle;
23351
23352
23353
23354 enum {
23355   kTileIconVariant = 'tile',
23356   kRolloverIconVariant = 'over',
23357   kDropIconVariant = 'drop',
23358   kOpenIconVariant = 'open',
23359   kOpenDropIconVariant = 'odrp'
23360 };
23361
23362
23363
23364
23365
23366 extern "C" {
23367
23368
23369 typedef UInt8 OTUInt8Param;
23370 typedef UInt16 OTUInt16Param;
23371 typedef SInt16 OTSInt16Param;
23372 typedef SInt8 OTSInt8Param;
23373 typedef Boolean OTBooleanParam;
23374 typedef UInt8 uchar_p;
23375 typedef UInt16 ushort_p;
23376 typedef SInt16 short_p;
23377 typedef SInt8 char_p;
23378 typedef Boolean boolean_p;
23379
23380
23381
23382
23383
23384
23385
23386     typedef unsigned int OTByteCount;
23387     typedef unsigned int OTItemCount;
23388     typedef int OTInt32;
23389     typedef unsigned int OTUInt32;
23390
23391
23392 typedef long int_t;
23393 typedef unsigned long uint_t;
23394 enum {
23395   kOTCFMClass = 'otan'
23396 };
23397
23398
23399
23400
23401 typedef UInt32 OTTimeout;
23402
23403 typedef SInt32 OTSequence;
23404
23405 typedef SInt32 OTNameID;
23406
23407
23408
23409
23410 typedef SInt32 OTReason;
23411
23412 typedef UInt32 OTQLen;
23413
23414 typedef UInt8 * OTClientName;
23415
23416 typedef SInt32 OTCommand;
23417
23418 typedef void* OTClient;
23419 typedef UInt32 OTOpenFlags;
23420 enum {
23421   kO_ASYNC = 0x01,
23422   kO_NDELAY = 0x04,
23423   kO_NONBLOCK = 0x04
23424 };
23425 typedef UInt16 OTUnixErr;
23426 typedef UInt16 OTXTIErr;
23427 enum {
23428   TSUCCESS = 0,
23429   TBADADDR = 1,
23430   TBADOPT = 2,
23431   TACCES = 3,
23432   TBADF = 4,
23433   TNOADDR = 5,
23434   TOUTSTATE = 6,
23435   TBADSEQ = 7,
23436   TSYSERR = 8,
23437   TLOOK = 9,
23438   TBADDATA = 10,
23439   TBUFOVFLW = 11,
23440   TFLOW = 12,
23441   TNODATA = 13,
23442   TNODIS = 14,
23443   TNOUDERR = 15,
23444   TBADFLAG = 16,
23445   TNOREL = 17,
23446   TNOTSUPPORT = 18,
23447   TSTATECHNG = 19,
23448   TNOSTRUCTYPE = 20,
23449   TBADNAME = 21,
23450   TBADQLEN = 22,
23451   TADDRBUSY = 23,
23452   TINDOUT = 24,
23453   TPROVMISMATCH = 25,
23454   TRESQLEN = 26,
23455   TRESADDR = 27,
23456   TQFULL = 28,
23457   TPROTO = 29,
23458   TBADSYNC = 30,
23459   TCANCELED = 31,
23460   TLASTXTIERROR = 31
23461 };
23462 typedef SInt32 OTResult;
23463 enum {
23464   kOTGenericName = 0
23465 };
23466
23467 typedef UInt16 OTAddressType;
23468 struct OTAddress {
23469   OTAddressType fAddressType;
23470   UInt8 fAddress[1];
23471 };
23472 typedef struct OTAddress OTAddress;
23473 enum {
23474   T_BIND = 1,
23475   T_OPTMGMT = 2,
23476   T_CALL = 3,
23477   T_DIS = 4,
23478   T_UNITDATA = 5,
23479   T_UDERROR = 6,
23480   T_INFO = 7,
23481   T_REPLYDATA = 8,
23482   T_REQUESTDATA = 9,
23483   T_UNITREQUEST = 10,
23484   T_UNITREPLY = 11
23485 };
23486
23487
23488 typedef UInt32 OTStructType;
23489
23490
23491
23492
23493 enum {
23494   T_ADDR = 0x01,
23495   T_OPT = 0x02,
23496   T_UDATA = 0x04,
23497   T_ALL = 0xFFFF
23498 };
23499
23500 typedef UInt32 OTFieldsType;
23501
23502
23503
23504
23505
23506
23507
23508 typedef UInt32 OTFlags;
23509
23510
23511
23512
23513 enum {
23514   T_MORE = 0x0001,
23515   T_EXPEDITED = 0x0002,
23516   T_ACKNOWLEDGED = 0x0004,
23517   T_PARTIALDATA = 0x0008,
23518   T_NORECEIPT = 0x0010,
23519   T_TIMEDOUT = 0x0020
23520 };
23521
23522
23523
23524 enum {
23525   T_NEGOTIATE = 0x0004,
23526   T_CHECK = 0x0008,
23527   T_DEFAULT = 0x0010,
23528   T_CURRENT = 0x0080
23529 };
23530
23531
23532
23533
23534
23535
23536 enum {
23537   T_SUCCESS = 0x0020,
23538   T_FAILURE = 0x0040,
23539   T_PARTSUCCESS = 0x0100,
23540   T_READONLY = 0x0200,
23541   T_NOTSUPPORT = 0x0400
23542 };
23543 typedef UInt32 OTBand;
23544   typedef class TProvider* ProviderRef;
23545   typedef class TEndpoint* EndpointRef;
23546   typedef class TMapper* MapperRef;
23547 typedef UInt32 OTEventCode;
23548 enum {
23549   T_LISTEN = 0x0001,
23550   T_CONNECT = 0x0002,
23551   T_DATA = 0x0004,
23552   T_EXDATA = 0x0008,
23553   T_DISCONNECT = 0x0010,
23554   T_ERROR = 0x0020,
23555   T_UDERR = 0x0040,
23556   T_ORDREL = 0x0080,
23557   T_GODATA = 0x0100,
23558   T_GOEXDATA = 0x0200,
23559   T_REQUEST = 0x0400,
23560   T_REPLY = 0x0800,
23561   T_PASSCON = 0x1000,
23562   T_RESET = 0x2000,
23563   kPRIVATEEVENT = 0x10000000,
23564   kCOMPLETEEVENT = 0x20000000,
23565   T_BINDCOMPLETE = 0x20000001,
23566   T_UNBINDCOMPLETE = 0x20000002,
23567   T_ACCEPTCOMPLETE = 0x20000003,
23568   T_REPLYCOMPLETE = 0x20000004,
23569   T_DISCONNECTCOMPLETE = 0x20000005,
23570   T_OPTMGMTCOMPLETE = 0x20000006,
23571   T_OPENCOMPLETE = 0x20000007,
23572   T_GETPROTADDRCOMPLETE = 0x20000008,
23573   T_RESOLVEADDRCOMPLETE = 0x20000009,
23574   T_GETINFOCOMPLETE = 0x2000000A,
23575   T_SYNCCOMPLETE = 0x2000000B,
23576   T_MEMORYRELEASED = 0x2000000C,
23577   T_REGNAMECOMPLETE = 0x2000000D,
23578   T_DELNAMECOMPLETE = 0x2000000E,
23579   T_LKUPNAMECOMPLETE = 0x2000000F,
23580   T_LKUPNAMERESULT = 0x20000010,
23581   kOTSyncIdleEvent = 0x20000011,
23582   kSTREAMEVENT = 0x21000000,
23583   kOTReservedEvent1 = 0x21000001,
23584   kGetmsgEvent = 0x21000002,
23585   kStreamReadEvent = 0x21000003,
23586   kStreamWriteEvent = 0x21000004,
23587   kStreamIoctlEvent = 0x21000005,
23588   kOTReservedEvent2 = 0x21000006,
23589   kStreamOpenEvent = 0x21000007,
23590   kPollEvent = 0x21000008,
23591   kOTReservedEvent3 = 0x21000009,
23592   kOTReservedEvent4 = 0x2100000A,
23593   kOTReservedEvent5 = 0x2100000B,
23594   kOTReservedEvent6 = 0x2100000C,
23595   kOTReservedEvent7 = 0x2100000D,
23596   kOTReservedEvent8 = 0x2100000E,
23597   kSIGNALEVENT = 0x22000000,
23598   kPROTOCOLEVENT = 0x23000000,
23599   kOTProviderIsDisconnected = 0x23000001,
23600   kOTProviderIsReconnected = 0x23000002,
23601   kOTProviderWillClose = 0x24000001,
23602   kOTProviderIsClosed = 0x24000002,
23603   kOTPortDisabled = 0x25000001,
23604   kOTPortEnabled = 0x25000002,
23605   kOTPortOffline = 0x25000003,
23606   kOTPortOnline = 0x25000004,
23607   kOTClosePortRequest = 0x25000005,
23608   kOTYieldPortRequest = 0x25000005,
23609   kOTNewPortRegistered = 0x25000006,
23610   kOTPortNetworkChange = 0x25000007,
23611   kOTConfigurationChanged = 0x26000001,
23612   kOTSystemSleep = 0x26000002,
23613   kOTSystemShutdown = 0x26000003,
23614   kOTSystemAwaken = 0x26000004,
23615   kOTSystemIdle = 0x26000005,
23616   kOTSystemSleepPrep = 0x26000006,
23617   kOTSystemShutdownPrep = 0x26000007,
23618   kOTSystemAwakenPrep = 0x26000008,
23619   kOTStackIsLoading = 0x27000001,
23620   kOTStackWasLoaded = 0x27000002,
23621   kOTStackIsUnloading = 0x27000003
23622 };
23623 enum {
23624   kOTDisablePortEvent = 0x21000001,
23625   kStreamCloseEvent = 0x21000006,
23626   kBackgroundStreamEvent = 0x21000009,
23627   kIoctlRecvFdEvent = 0x2100000A,
23628   kOTTryShutdownEvent = 0x2100000B,
23629   kOTScheduleTerminationEvent = 0x2100000C,
23630   kOTEnablePortEvent = 0x2100000D,
23631   kOTNewPortRegisteredEvent = 0x2100000E,
23632   kOTPortOfflineEvent = 0x2100000F,
23633   kOTPortOnlineEvent = 0x21000010,
23634   kOTPortNetworkChangeEvent = 0x21000011
23635 };
23636 enum {
23637   kSIGHUP = 1,
23638   kSIGURG = 16,
23639   kSIGPOLL = 30
23640 };
23641 typedef void ( * OTNotifyProcPtr)(void *contextPtr, OTEventCode code, OTResult result, void *cookie);
23642 typedef OTNotifyProcPtr OTNotifyUPP;
23643 extern OTNotifyUPP
23644 NewOTNotifyUPP(OTNotifyProcPtr userRoutine) ;
23645 extern void
23646 DisposeOTNotifyUPP(OTNotifyUPP userUPP) ;
23647 extern void
23648 InvokeOTNotifyUPP(
23649   void * contextPtr,
23650   OTEventCode code,
23651   OTResult result,
23652   void * cookie,
23653   OTNotifyUPP userUPP) ;
23654
23655
23656
23657 enum {
23658   XTI_GENERIC = 0xFFFF
23659 };
23660
23661 typedef UInt32 OTXTILevel;
23662
23663 typedef UInt32 OTXTIName;
23664
23665 enum {
23666   XTI_DEBUG = 0x0001,
23667   XTI_LINGER = 0x0080,
23668   XTI_RCVBUF = 0x1002,
23669   XTI_RCVLOWAT = 0x1004,
23670   XTI_SNDBUF = 0x1001,
23671   XTI_SNDLOWAT = 0x1003,
23672   XTI_PROTOTYPE = 0x1005,
23673   OPT_CHECKSUM = 0x0600,
23674   OPT_RETRYCNT = 0x0601,
23675   OPT_INTERVAL = 0x0602,
23676   OPT_ENABLEEOM = 0x0603,
23677   OPT_SELFSEND = 0x0604,
23678   OPT_SERVERSTATUS = 0x0605,
23679   OPT_ALERTENABLE = 0x0606,
23680   OPT_KEEPALIVE = 0x0008
23681 };
23682 enum {
23683   MIOC_STREAMIO = 'A',
23684   MIOC_TMOD = 'a',
23685   MIOC_STRLOG = 'b',
23686   MIOC_ND = 'c',
23687   MIOC_ECHO = 'd',
23688   MIOC_TLI = 'e',
23689   MIOC_RESERVEDf = 'f',
23690   MIOC_SAD = 'g',
23691   MIOC_ARP = 'h',
23692   MIOC_HAVOC = 'H',
23693   MIOC_RESERVEDi = 'i',
23694   MIOC_SIOC = 'j',
23695   MIOC_TCP = 'k',
23696   MIOC_DLPI = 'l',
23697   MIOC_SOCKETS = 'm',
23698   MIOC_IPX = 'o',
23699   MIOC_OT = 'O',
23700   MIOC_ATALK = 'T',
23701   MIOC_SRL = 'U',
23702   MIOC_RESERVEDp = 'p',
23703   MIOC_RESERVEDr = 'r',
23704   MIOC_RESERVEDs = 's',
23705   MIOC_CFIG = 'z'
23706 };
23707
23708
23709
23710 enum {
23711   I_OTGetMiscellaneousEvents = ((MIOC_OT << 8) | 1),
23712   I_OTSetFramingType = ((MIOC_OT << 8) | 2),
23713   kOTGetFramingValue = (unsigned long)0xFFFFFFFF,
23714   I_OTSetRawMode = ((MIOC_OT << 8) | 3),
23715   kOTSetRecvMode = 0x01,
23716   kOTSendErrorPacket = 0x02,
23717   I_OTConnect = ((MIOC_OT << 8) | 4),
23718   I_OTDisconnect = ((MIOC_OT << 8) | 5),
23719   I_OTScript = ((MIOC_OT << 8) | 6)
23720 };
23721
23722
23723
23724 struct OTScriptInfo {
23725   UInt32 fScriptType;
23726   void * fTheScript;
23727   UInt32 fScriptLength;
23728 };
23729 typedef struct OTScriptInfo OTScriptInfo;
23730
23731
23732
23733
23734
23735 typedef UInt32 OTXTIStates;
23736 enum {
23737   T_UNINIT = 0,
23738   T_UNBND = 1,
23739   T_IDLE = 2,
23740   T_OUTCON = 3,
23741   T_INCON = 4,
23742   T_DATAXFER = 5,
23743   T_OUTREL = 6,
23744   T_INREL = 7
23745 };
23746
23747
23748
23749
23750
23751
23752 enum {
23753   T_YES = 1,
23754   T_NO = 0,
23755   T_UNUSED = (unsigned long)(-1),
23756   kT_NULL = 0,
23757   T_ABSREQ = 0x8000
23758 };
23759
23760 enum {
23761   kT_UNSPEC = (unsigned long)0xFFFFFFFD,
23762   T_ALLOPT = 0
23763 };
23764 typedef class OTConfiguration* OTConfigurationRef;
23765 struct TOptionHeader {
23766   ByteCount len;
23767
23768
23769   OTXTILevel level;
23770   OTXTIName name;
23771   UInt32 status;
23772 };
23773 typedef struct TOptionHeader TOptionHeader;
23774
23775
23776
23777
23778
23779 struct TOption {
23780   ByteCount len;
23781
23782
23783   OTXTILevel level;
23784   OTXTIName name;
23785   UInt32 status;
23786   UInt32 value[1];
23787 };
23788 typedef struct TOption TOption;
23789
23790 enum {
23791   kOTOptionHeaderSize = sizeof(TOptionHeader),
23792   kOTBooleanOptionDataSize = sizeof(UInt32),
23793   kOTBooleanOptionSize = kOTOptionHeaderSize + kOTBooleanOptionDataSize,
23794   kOTOneByteOptionSize = kOTOptionHeaderSize + 1,
23795   kOTTwoByteOptionSize = kOTOptionHeaderSize + 2,
23796   kOTFourByteOptionSize = kOTOptionHeaderSize + sizeof(UInt32)
23797 };
23798 struct t_kpalive {
23799   SInt32 kp_onoff;
23800   SInt32 kp_timeout;
23801 };
23802 typedef struct t_kpalive t_kpalive;
23803
23804 struct t_linger {
23805   SInt32 l_onoff;
23806   SInt32 l_linger;
23807 };
23808 typedef struct t_linger t_linger;
23809
23810
23811
23812
23813
23814
23815
23816 typedef UInt32 OTServiceType;
23817 enum {
23818   T_COTS = 1,
23819   T_COTS_ORD = 2,
23820   T_CLTS = 3,
23821   T_TRANS = 5,
23822   T_TRANS_ORD = 6,
23823   T_TRANS_CLTS = 7
23824 };
23825
23826
23827
23828 enum {
23829   T_SENDZERO = 0x0001,
23830   T_XPG4_1 = 0x0002,
23831   T_CAN_SUPPORT_MDATA = 0x10000000,
23832   T_CAN_RESOLVE_ADDR = 0x40000000,
23833   T_CAN_SUPPLY_MIB = 0x20000000
23834 };
23835
23836
23837
23838
23839
23840
23841 enum {
23842   T_INFINITE = -1,
23843   T_INVALID = -2
23844 };
23845
23846
23847 typedef SInt32 OTDataSize;
23848
23849 struct TEndpointInfo {
23850   OTDataSize addr;
23851   OTDataSize options;
23852   OTDataSize tsdu;
23853   OTDataSize etsdu;
23854   OTDataSize connect;
23855   OTDataSize discon;
23856   OTServiceType servtype;
23857   UInt32 flags;
23858 };
23859 typedef struct TEndpointInfo TEndpointInfo;
23860 typedef UInt32 OTPortRef;
23861 typedef OTPortRef * OTPortRefPtr;
23862 enum {
23863   kOTInvalidPortRef = 0
23864 };
23865
23866
23867
23868 typedef UInt8 OTBusType;
23869 enum {
23870   kOTUnknownBusPort = 0,
23871   kOTMotherboardBus = 1,
23872   kOTNuBus = 2,
23873   kOTPCIBus = 3,
23874   kOTGeoPort = 4,
23875   kOTPCCardBus = 5,
23876   kOTFireWireBus = 6,
23877   kOTLastBusIndex = 15
23878 };
23879
23880
23881
23882
23883
23884
23885 typedef UInt16 OTDeviceType;
23886 enum {
23887   kOTNoDeviceType = 0,
23888   kOTADEVDevice = 1,
23889   kOTMDEVDevice = 2,
23890   kOTLocalTalkDevice = 3,
23891   kOTIRTalkDevice = 4,
23892   kOTTokenRingDevice = 5,
23893   kOTISDNDevice = 6,
23894   kOTATMDevice = 7,
23895   kOTSMDSDevice = 8,
23896   kOTSerialDevice = 9,
23897   kOTEthernetDevice = 10,
23898   kOTSLIPDevice = 11,
23899   kOTPPPDevice = 12,
23900   kOTModemDevice = 13,
23901   kOTFastEthernetDevice = 14,
23902   kOTFDDIDevice = 15,
23903   kOTIrDADevice = 16,
23904   kOTATMSNAPDevice = 17,
23905   kOTFibreChannelDevice = 18,
23906   kOTFireWireDevice = 19,
23907   kOTPseudoDevice = 1023,
23908   kOTLastDeviceIndex = 1022
23909 };
23910
23911
23912
23913 enum {
23914   kOTLastSlotNumber = 255,
23915   kOTLastOtherNumber = 255
23916 };
23917
23918 typedef UInt16 OTSlotNumber;
23919 extern OTPortRef
23920 OTCreatePortRef(
23921   OTBusType busType,
23922   OTDeviceType devType,
23923   OTSlotNumber slot,
23924   UInt16 other) ;
23925 extern OTDeviceType
23926 OTGetDeviceTypeFromPortRef(OTPortRef ref) ;
23927 extern UInt16
23928 OTGetBusTypeFromPortRef(OTPortRef ref) ;
23929 extern OTSlotNumber
23930 OTGetSlotFromPortRef(
23931   OTPortRef ref,
23932   UInt16 * other) ;
23933 extern OTPortRef
23934 OTSetDeviceTypeInPortRef(
23935   OTPortRef ref,
23936   OTDeviceType devType) ;
23937 extern OTPortRef
23938 OTSetBusTypeInPortRef(
23939   OTPortRef ref,
23940   OTBusType busType) ;
23941 enum {
23942   kMaxModuleNameLength = 31,
23943   kMaxModuleNameSize = kMaxModuleNameLength + 1,
23944   kMaxProviderNameLength = kMaxModuleNameLength + 4,
23945   kMaxProviderNameSize = kMaxProviderNameLength + 1,
23946   kMaxSlotIDLength = 7,
23947   kMaxSlotIDSize = kMaxSlotIDLength + 1,
23948   kMaxResourceInfoLength = 31,
23949   kMaxResourceInfoSize = 32,
23950   kMaxPortNameLength = kMaxModuleNameLength + 4,
23951   kMaxPortNameSize = kMaxPortNameLength + 1
23952 };
23953
23954
23955
23956
23957
23958
23959 enum {
23960   kOTPortIsActive = 0x00000001,
23961   kOTPortIsDisabled = 0x00000002,
23962   kOTPortIsUnavailable = 0x00000004,
23963   kOTPortIsOffline = 0x00000008
23964 };
23965
23966
23967
23968 enum {
23969   kOTPortIsDLPI = 0x00000001,
23970   kOTPortIsTPI = 0x00000002,
23971   kOTPortCanYield = 0x00000004,
23972   kOTPortCanArbitrate = 0x00000008,
23973   kOTPortIsTransitory = 0x00000010,
23974   kOTPortAutoConnects = 0x00000020,
23975   kOTPortIsSystemRegistered = 0x00004000,
23976   kOTPortIsPrivate = 0x00008000,
23977   kOTPortIsAlias = (unsigned long)0x80000000
23978 };
23979 struct OTPortRecord {
23980   OTPortRef fRef;
23981   UInt32 fPortFlags;
23982   UInt32 fInfoFlags;
23983   UInt32 fCapabilities;
23984   ItemCount fNumChildPorts;
23985   OTPortRef * fChildPorts;
23986   char fPortName[36];
23987   char fModuleName[32];
23988   char fSlotID[8];
23989   char fResourceInfo[32];
23990   char fReserved[164];
23991 };
23992 typedef struct OTPortRecord OTPortRecord;
23993 extern Boolean
23994 OTGetIndexedPort(
23995   OTPortRecord * portRecord,
23996   OTItemCount index) ;
23997 extern Boolean
23998 OTFindPort(
23999   OTPortRecord * portRecord,
24000   const char * portName) ;
24001 extern Boolean
24002 OTFindPortByRef(
24003   OTPortRecord * portRecord,
24004   OTPortRef ref) ;
24005 struct TNetbuf {
24006   ByteCount maxlen;
24007   ByteCount len;
24008   UInt8 * buf;
24009 };
24010 typedef struct TNetbuf TNetbuf;
24011 struct strbuf {
24012   SInt32 maxlen;
24013   SInt32 len;
24014   char * buf;
24015 };
24016 typedef struct strbuf strbuf;
24017
24018
24019
24020
24021
24022
24023
24024 struct OTData {
24025   void * fNext;
24026   void * fData;
24027   ByteCount fLen;
24028 };
24029 typedef struct OTData OTData;
24030 enum {
24031   kNetbufDataIsOTData = (unsigned long)0xFFFFFFFE
24032 };
24033 struct OTBuffer {
24034   void * fLink;
24035   void * fLink2;
24036   struct OTBuffer * fNext;
24037   UInt8 * fData;
24038   ByteCount fLen;
24039   void * fSave;
24040   UInt8 fBand;
24041   UInt8 fType;
24042   UInt8 fPad1;
24043   UInt8 fFlags;
24044 };
24045 typedef struct OTBuffer OTBuffer;
24046 enum {
24047   kOTNetbufDataIsOTBufferStar = (unsigned long)0xFFFFFFFD
24048 };
24049
24050
24051
24052
24053
24054
24055 struct OTBufferInfo {
24056   OTBuffer * fBuffer;
24057   ByteCount fOffset;
24058   UInt8 fPad;
24059 };
24060 typedef struct OTBufferInfo OTBufferInfo;
24061 enum {
24062   kOTNetbufIsRawMode = (unsigned long)0xFFFFFFFF
24063 };
24064 struct TBind {
24065   TNetbuf addr;
24066   OTQLen qlen;
24067 };
24068 typedef struct TBind TBind;
24069
24070
24071
24072
24073 struct TDiscon {
24074   TNetbuf udata;
24075   OTReason reason;
24076   OTSequence sequence;
24077 };
24078 typedef struct TDiscon TDiscon;
24079
24080
24081
24082
24083 struct TCall {
24084   TNetbuf addr;
24085   TNetbuf opt;
24086   TNetbuf udata;
24087   OTSequence sequence;
24088 };
24089 typedef struct TCall TCall;
24090
24091 struct TUnitData {
24092   TNetbuf addr;
24093   TNetbuf opt;
24094   TNetbuf udata;
24095 };
24096 typedef struct TUnitData TUnitData;
24097
24098
24099
24100
24101 struct TUDErr {
24102   TNetbuf addr;
24103   TNetbuf opt;
24104   SInt32 error;
24105 };
24106 typedef struct TUDErr TUDErr;
24107
24108 struct TOptMgmt {
24109   TNetbuf opt;
24110   OTFlags flags;
24111 };
24112 typedef struct TOptMgmt TOptMgmt;
24113 struct TRequest {
24114   TNetbuf data;
24115   TNetbuf opt;
24116   OTSequence sequence;
24117 };
24118 typedef struct TRequest TRequest;
24119
24120 struct TReply {
24121   TNetbuf data;
24122   TNetbuf opt;
24123   OTSequence sequence;
24124 };
24125 typedef struct TReply TReply;
24126
24127
24128
24129
24130 struct TUnitRequest {
24131   TNetbuf addr;
24132   TNetbuf opt;
24133   TNetbuf udata;
24134   OTSequence sequence;
24135 };
24136 typedef struct TUnitRequest TUnitRequest;
24137
24138 struct TUnitReply {
24139   TNetbuf opt;
24140   TNetbuf udata;
24141   OTSequence sequence;
24142 };
24143 typedef struct TUnitReply TUnitReply;
24144
24145
24146
24147
24148
24149
24150
24151 struct TRegisterRequest {
24152   TNetbuf name;
24153   TNetbuf addr;
24154   OTFlags flags;
24155 };
24156 typedef struct TRegisterRequest TRegisterRequest;
24157
24158
24159
24160
24161 struct TRegisterReply {
24162   TNetbuf addr;
24163   OTNameID nameid;
24164 };
24165 typedef struct TRegisterReply TRegisterReply;
24166
24167 struct TLookupRequest {
24168   TNetbuf name;
24169   TNetbuf addr;
24170   UInt32 maxcnt;
24171   OTTimeout timeout;
24172   OTFlags flags;
24173 };
24174 typedef struct TLookupRequest TLookupRequest;
24175
24176
24177
24178
24179 struct TLookupReply {
24180   TNetbuf names;
24181   UInt32 rspcount;
24182 };
24183 typedef struct TLookupReply TLookupReply;
24184
24185
24186
24187
24188 struct TLookupBuffer {
24189   UInt16 fAddressLength;
24190   UInt16 fNameLength;
24191   UInt8 fAddressBuffer[1];
24192 };
24193 typedef struct TLookupBuffer TLookupBuffer;
24194 typedef struct OpaqueOTClientContextPtr* OTClientContextPtr;
24195 typedef UInt32 OTInitializationFlags;
24196 enum {
24197   kInitOTForApplicationMask = 1,
24198   kInitOTForExtensionMask = 2
24199 };
24200 extern OSStatus
24201 InitOpenTransportInContext(
24202   OTInitializationFlags flags,
24203   OTClientContextPtr * outClientContext) ;
24204 extern void
24205 CloseOpenTransportInContext(OTClientContextPtr clientContext) ;
24206 extern OSStatus
24207 OTRegisterAsClientInContext(
24208   OTClientName name,
24209   OTNotifyUPP proc,
24210   OTClientContextPtr clientContext) ;
24211 extern OSStatus
24212 OTUnregisterAsClientInContext(OTClientContextPtr clientContext) ;
24213 typedef void ( * OTProcessProcPtr)(void * arg);
24214 typedef OTProcessProcPtr OTProcessUPP;
24215 extern OTProcessUPP
24216 NewOTProcessUPP(OTProcessProcPtr userRoutine) ;
24217 extern void
24218 DisposeOTProcessUPP(OTProcessUPP userUPP) ;
24219 extern void
24220 InvokeOTProcessUPP(
24221   void * arg,
24222   OTProcessUPP userUPP) ;
24223 extern long
24224 OTCreateDeferredTaskInContext(
24225   OTProcessUPP upp,
24226   void * arg,
24227   OTClientContextPtr clientContext) ;
24228 typedef long OTDeferredTaskRef;
24229 extern Boolean
24230 OTScheduleDeferredTask(OTDeferredTaskRef dtCookie) ;
24231 extern OSStatus
24232 OTDestroyDeferredTask(OTDeferredTaskRef dtCookie) ;
24233 typedef long OTSystemTaskRef;
24234 extern Boolean
24235 OTCanMakeSyncCall(void) ;
24236 extern OSStatus
24237 OTCloseProvider(ProviderRef ref) ;
24238 extern SInt32
24239 OTIoctl(
24240   ProviderRef ref,
24241   UInt32 cmd,
24242   void * data) ;
24243 extern OSStatus
24244 OTSetAsynchronous(ProviderRef ref) ;
24245 extern OSStatus
24246 OTSetSynchronous(ProviderRef ref) ;
24247 extern Boolean
24248 OTIsSynchronous(ProviderRef ref) ;
24249 extern OSStatus
24250 OTSetBlocking(ProviderRef ref) ;
24251 extern OSStatus
24252 OTSetNonBlocking(ProviderRef ref) ;
24253 extern Boolean
24254 OTIsBlocking(ProviderRef ref) ;
24255 extern OSStatus
24256 OTInstallNotifier(
24257   ProviderRef ref,
24258   OTNotifyUPP proc,
24259   void * contextPtr) ;
24260 extern OSStatus
24261 OTUseSyncIdleEvents(
24262   ProviderRef ref,
24263   Boolean useEvents) ;
24264 extern void
24265 OTRemoveNotifier(ProviderRef ref) ;
24266 extern void
24267 OTLeaveNotifier(ProviderRef ref) ;
24268 extern Boolean
24269 OTEnterNotifier(ProviderRef ref) ;
24270 extern OSStatus
24271 OTAckSends(ProviderRef ref) ;
24272 extern OSStatus
24273 OTDontAckSends(ProviderRef ref) ;
24274 extern Boolean
24275 OTIsAckingSends(ProviderRef ref) ;
24276 extern OSStatus
24277 OTCancelSynchronousCalls(
24278   ProviderRef ref,
24279   OSStatus err) ;
24280 extern EndpointRef
24281 OTOpenEndpointInContext(
24282   OTConfigurationRef config,
24283   OTOpenFlags oflag,
24284   TEndpointInfo * info,
24285   OSStatus * err,
24286   OTClientContextPtr clientContext) ;
24287 extern OSStatus
24288 OTAsyncOpenEndpointInContext(
24289   OTConfigurationRef config,
24290   OTOpenFlags oflag,
24291   TEndpointInfo * info,
24292   OTNotifyUPP upp,
24293   void * contextPtr,
24294   OTClientContextPtr clientContext) ;
24295 extern OSStatus
24296 OTGetEndpointInfo(
24297   EndpointRef ref,
24298   TEndpointInfo * info) ;
24299 extern OTResult
24300 OTGetEndpointState(EndpointRef ref) ;
24301 extern OTResult
24302 OTLook(EndpointRef ref) ;
24303 extern OTResult
24304 OTCountDataBytes(
24305   EndpointRef ref,
24306   OTByteCount * countPtr) ;
24307 extern OSStatus
24308 OTGetProtAddress(
24309   EndpointRef ref,
24310   TBind * boundAddr,
24311   TBind * peerAddr) ;
24312 extern OSStatus
24313 OTResolveAddress(
24314   EndpointRef ref,
24315   TBind * reqAddr,
24316   TBind * retAddr,
24317   OTTimeout timeOut) ;
24318 extern void *
24319 OTAllocInContext(
24320   EndpointRef ref,
24321   OTStructType structType,
24322   UInt32 fields,
24323   OSStatus * err,
24324   OTClientContextPtr clientContext) ;
24325 extern OTResult
24326 OTFree(
24327   void * ptr,
24328   OTStructType structType) ;
24329 extern OSStatus
24330 OTOptionManagement(
24331   EndpointRef ref,
24332   TOptMgmt * req,
24333   TOptMgmt * ret) ;
24334 extern OSStatus
24335 OTNextOption(
24336   UInt8 * buffer,
24337   UInt32 buflen,
24338   TOption ** prevOptPtr) ;
24339 extern TOption *
24340 OTFindOption(
24341   UInt8 * buffer,
24342   UInt32 buflen,
24343   OTXTILevel level,
24344   OTXTIName name) ;
24345 extern OSStatus
24346 OTBind(
24347   EndpointRef ref,
24348   TBind * reqAddr,
24349   TBind * retAddr) ;
24350 extern OSStatus
24351 OTUnbind(EndpointRef ref) ;
24352 extern OSStatus
24353 OTConnect(
24354   EndpointRef ref,
24355   TCall * sndCall,
24356   TCall * rcvCall) ;
24357 extern OSStatus
24358 OTRcvConnect(
24359   EndpointRef ref,
24360   TCall * call) ;
24361 extern OSStatus
24362 OTListen(
24363   EndpointRef ref,
24364   TCall * call) ;
24365 extern OSStatus
24366 OTAccept(
24367   EndpointRef listener,
24368   EndpointRef worker,
24369   TCall * call) ;
24370 extern OSStatus
24371 OTSndDisconnect(
24372   EndpointRef ref,
24373   TCall * call) ;
24374 extern OSStatus
24375 OTSndOrderlyDisconnect(EndpointRef ref) ;
24376 extern OSStatus
24377 OTRcvDisconnect(
24378   EndpointRef ref,
24379   TDiscon * discon) ;
24380 extern OSStatus
24381 OTRcvOrderlyDisconnect(EndpointRef ref) ;
24382 extern OTResult
24383 OTRcv(
24384   EndpointRef ref,
24385   void * buf,
24386   OTByteCount nbytes,
24387   OTFlags * flags) ;
24388 extern OTResult
24389 OTSnd(
24390   EndpointRef ref,
24391   void * buf,
24392   OTByteCount nbytes,
24393   OTFlags flags) ;
24394 extern OSStatus
24395 OTSndUData(
24396   EndpointRef ref,
24397   TUnitData * udata) ;
24398 extern OSStatus
24399 OTRcvUData(
24400   EndpointRef ref,
24401   TUnitData * udata,
24402   OTFlags * flags) ;
24403 extern OSStatus
24404 OTRcvUDErr(
24405   EndpointRef ref,
24406   TUDErr * uderr) ;
24407 extern OSStatus
24408 OTAsyncOpenMapperInContext(
24409   OTConfigurationRef config,
24410   OTOpenFlags oflag,
24411   OTNotifyUPP upp,
24412   void * contextPtr,
24413   OTClientContextPtr clientContext) ;
24414 extern MapperRef
24415 OTOpenMapperInContext(
24416   OTConfigurationRef config,
24417   OTOpenFlags oflag,
24418   OSStatus * err,
24419   OTClientContextPtr clientContext) ;
24420 extern OSStatus
24421 OTRegisterName(
24422   MapperRef ref,
24423   TRegisterRequest * req,
24424   TRegisterReply * reply) ;
24425 extern OSStatus
24426 OTDeleteName(
24427   MapperRef ref,
24428   TNetbuf * name) ;
24429 extern OSStatus
24430 OTDeleteNameByID(
24431   MapperRef ref,
24432   OTNameID nameID) ;
24433 extern OSStatus
24434 OTLookupName(
24435   MapperRef ref,
24436   TLookupRequest * req,
24437   TLookupReply * reply) ;
24438 extern OTConfigurationRef
24439 OTCreateConfiguration(const char * path) ;
24440 extern OTConfigurationRef
24441 OTCloneConfiguration(OTConfigurationRef cfig) ;
24442 extern void
24443 OTDestroyConfiguration(OTConfigurationRef cfig) ;
24444 extern void *
24445 OTAllocMemInContext(
24446   OTByteCount size,
24447   OTClientContextPtr clientContext) ;
24448 extern void
24449 OTFreeMem(void * mem) ;
24450 extern void
24451 OTDelay(UInt32 seconds) ;
24452 extern void
24453 OTIdle(void) ;
24454 extern void
24455 OTMemcpy(
24456   void * dest,
24457   const void * src,
24458   OTByteCount nBytes) ;
24459 extern Boolean
24460 OTMemcmp(
24461   const void * mem1,
24462   const void * mem2,
24463   OTByteCount nBytes) ;
24464 extern void
24465 OTMemmove(
24466   void * dest,
24467   const void * src,
24468   OTByteCount nBytes) ;
24469 extern void
24470 OTMemzero(
24471   void * dest,
24472   OTByteCount nBytes) ;
24473 extern void
24474 OTMemset(
24475   void * dest,
24476   OTUInt8Param toSet,
24477   OTByteCount nBytes) ;
24478 extern OTByteCount
24479 OTStrLength(const char * str) ;
24480 extern void
24481 OTStrCopy(
24482   char * dest,
24483   const char * src) ;
24484 extern void
24485 OTStrCat(
24486   char * dest,
24487   const char * src) ;
24488 extern Boolean
24489 OTStrEqual(
24490   const char * src1,
24491   const char * src2) ;
24492 typedef UnsignedWide OTTimeStamp;
24493 extern void
24494 OTGetTimeStamp(OTTimeStamp * currentTime) ;
24495 extern OTTimeStamp *
24496 OTSubtractTimeStamps(
24497   OTTimeStamp * result,
24498   OTTimeStamp * startTime,
24499   OTTimeStamp * endEnd) ;
24500 extern UInt32
24501 OTTimeStampInMilliseconds(OTTimeStamp * delta) ;
24502 extern UInt32
24503 OTTimeStampInMicroseconds(OTTimeStamp * delta) ;
24504 extern UInt32
24505 OTElapsedMilliseconds(OTTimeStamp * startTime) ;
24506 extern UInt32
24507 OTElapsedMicroseconds(OTTimeStamp * startTime) ;
24508 extern UInt32
24509 OTGetClockTimeInSecs(void) ;
24510 struct OTLink {
24511   struct OTLink * fNext;
24512
24513
24514
24515
24516
24517    void Init() { fNext = __null; }
24518
24519
24520
24521 };
24522 typedef struct OTLink OTLink;
24523 struct OTLIFO {
24524   OTLink * fHead;
24525
24526
24527
24528
24529
24530   void Init();
24531     void Enqueue(OTLink* link);
24532  OTLink* Dequeue();
24533  OTLink* StealList();
24534    Boolean IsEmpty();
24535
24536
24537
24538 };
24539 typedef struct OTLIFO OTLIFO;
24540 extern void
24541 OTLIFOEnqueue(
24542   OTLIFO * list,
24543   OTLink * link) ;
24544 extern OTLink *
24545 OTLIFODequeue(OTLIFO * list) ;
24546 extern OTLink *
24547 OTLIFOStealList(OTLIFO * list) ;
24548 extern OTLink *
24549 OTReverseList(OTLink * list) ;
24550
24551
24552
24553
24554
24555
24556
24557   inline void OTLIFO::Init() { fHead = __null; }
24558   inline void OTLIFO::Enqueue(OTLink* link) { OTLIFOEnqueue(this, link); }
24559  inline OTLink* OTLIFO::Dequeue() { return OTLIFODequeue(this); }
24560     inline OTLink* OTLIFO::StealList() { return OTLIFOStealList(this); }
24561   inline Boolean OTLIFO::IsEmpty() { return fHead == __null; }
24562 typedef Boolean ( * OTListSearchProcPtr)(const void *ref, OTLink *linkToCheck);
24563 typedef OTListSearchProcPtr OTListSearchUPP;
24564 extern OTListSearchUPP
24565 NewOTListSearchUPP(OTListSearchProcPtr userRoutine) ;
24566 extern void
24567 DisposeOTListSearchUPP(OTListSearchUPP userUPP) ;
24568 extern Boolean
24569 InvokeOTListSearchUPP(
24570   const void * ref,
24571   OTLink * linkToCheck,
24572   OTListSearchUPP userUPP) ;
24573
24574 struct OTList {
24575   OTLink * fHead;
24576
24577
24578
24579
24580   void Init();
24581     Boolean IsEmpty();
24582  void AddFirst(OTLink* link);
24583     void AddLast(OTLink* link);
24584  OTLink* GetFirst();
24585     OTLink* GetLast();
24586  OTLink* RemoveFirst();
24587  OTLink* RemoveLast();
24588   Boolean IsInList(OTLink* link);
24589     OTLink* FindLink(OTListSearchUPP proc, const void* ref);
24590    Boolean RemoveLink(OTLink* link);
24591   OTLink* FindAndRemoveLink(OTListSearchUPP proc, const void* ref);
24592   OTLink* GetIndexedLink(OTItemCount index);
24593
24594
24595
24596 };
24597 typedef struct OTList OTList;
24598 extern void
24599 OTAddFirst(
24600   OTList * list,
24601   OTLink * link) ;
24602 extern void
24603 OTAddLast(
24604   OTList * list,
24605   OTLink * link) ;
24606 extern OTLink *
24607 OTRemoveFirst(OTList * list) ;
24608 extern OTLink *
24609 OTRemoveLast(OTList * list) ;
24610 extern OTLink *
24611 OTGetFirst(OTList * list) ;
24612 extern OTLink *
24613 OTGetLast(OTList * list) ;
24614 extern Boolean
24615 OTIsInList(
24616   OTList * list,
24617   OTLink * link) ;
24618 extern OTLink *
24619 OTFindLink(
24620   OTList * list,
24621   OTListSearchUPP proc,
24622   const void * ref) ;
24623 extern Boolean
24624 OTRemoveLink(
24625   OTList * list,
24626   OTLink * link) ;
24627 extern OTLink *
24628 OTFindAndRemoveLink(
24629   OTList * list,
24630   OTListSearchUPP proc,
24631   const void * ref) ;
24632 extern OTLink *
24633 OTGetIndexedLink(
24634   OTList * list,
24635   OTItemCount index) ;
24636 extern void
24637 OTEnqueue(
24638   void ** listHead,
24639   void * object,
24640   OTByteCount linkOffset) ;
24641 extern void *
24642 OTDequeue(
24643   void ** listHead,
24644   OTByteCount linkOffset) ;
24645
24646
24647
24648
24649
24650
24651   inline void OTList::Init() { fHead = __null; }
24652    inline Boolean OTList::IsEmpty() { return fHead == __null; }
24653   inline void OTList::AddFirst(OTLink* link) { OTAddFirst(this, link); }
24654     inline void OTList::AddLast(OTLink* link) { OTAddLast(this, link); }
24655  inline OTLink* OTList::GetFirst() { return OTGetFirst(this); }
24656    inline OTLink* OTList::GetLast() { return OTGetLast(this); }
24657     inline OTLink* OTList::RemoveFirst() { return OTRemoveFirst(this); }
24658     inline OTLink* OTList::RemoveLast() { return OTRemoveLast(this); }
24659  inline Boolean OTList::IsInList(OTLink* link) { return OTIsInList(this, link); }
24660  inline OTLink* OTList::FindLink(OTListSearchUPP proc, const void* ref)
24661                                                         { return OTFindLink(this, proc, ref); }
24662     inline Boolean OTList::RemoveLink(OTLink* link) { return OTRemoveLink(this, link); }
24663   inline OTLink* OTList::FindAndRemoveLink(OTListSearchUPP proc, const void* ref)
24664                                                        { return OTFindAndRemoveLink(this, proc, ref); }
24665    inline OTLink* OTList::GetIndexedLink(OTItemCount index)
24666                                                       { return OTGetIndexedLink(this, index); }
24667 extern Boolean
24668 OTAtomicSetBit(
24669   UInt8 * bytePtr,
24670   OTByteCount bitNumber) ;
24671 extern Boolean
24672 OTAtomicClearBit(
24673   UInt8 * bytePtr,
24674   OTByteCount bitNumber) ;
24675 extern Boolean
24676 OTAtomicTestBit(
24677   UInt8 * bytePtr,
24678   OTByteCount bitNumber) ;
24679 extern Boolean
24680 OTCompareAndSwapPtr(
24681   void * oldValue,
24682   void * newValue,
24683   void ** dest) ;
24684 extern Boolean
24685 OTCompareAndSwap32(
24686   UInt32 oldValue,
24687   UInt32 newValue,
24688   UInt32 * dest) ;
24689 extern Boolean
24690 OTCompareAndSwap16(
24691   UInt32 oldValue,
24692   UInt32 newValue,
24693   UInt16 * dest) ;
24694 extern Boolean
24695 OTCompareAndSwap8(
24696   UInt32 oldValue,
24697   UInt32 newValue,
24698   UInt8 * dest) ;
24699 extern SInt32
24700 OTAtomicAdd32(
24701   SInt32 toAdd,
24702   SInt32 * dest) ;
24703 extern SInt16
24704 OTAtomicAdd16(
24705   SInt32 toAdd,
24706   SInt16 * dest) ;
24707 extern SInt8
24708 OTAtomicAdd8(
24709   SInt32 toAdd,
24710   SInt8 * dest) ;
24711
24712
24713
24714
24715
24716
24717 typedef UInt8 OTLock;
24718 }
24719 class TProvider
24720 {
24721     private:
24722         void* operator new(size_t);
24723         void operator delete(void*) {}
24724
24725
24726
24727
24728
24729     public:
24730         OSStatus Close() { return OTCloseProvider(this); }
24731
24732         OSStatus SetNonBlocking() { return OTSetNonBlocking(this); }
24733         OSStatus SetBlocking() { return OTSetBlocking(this); }
24734         Boolean IsBlocking() { return OTIsBlocking(this); }
24735         Boolean IsNonBlocking() { return !OTIsBlocking(this); }
24736         OSStatus SetSynchronous() { return OTSetSynchronous(this); }
24737         OSStatus SetAsynchronous() { return OTSetAsynchronous(this); }
24738         Boolean IsSynchronous() { return OTIsSynchronous(this); }
24739         Boolean IsAsynchronous() { return !OTIsSynchronous(this); }
24740
24741         OSStatus AckSends() { return OTAckSends(this); }
24742         OSStatus DontAckSends() { return OTDontAckSends(this); }
24743         Boolean IsAckingSends() { return OTIsAckingSends(this); }
24744
24745         void CancelSynchronousCalls(OSStatus err)
24746                     { (void)OTCancelSynchronousCalls(this, err); }
24747
24748         OSStatus InstallNotifier(OTNotifyUPP proc, void* ptr)
24749                     { return OTInstallNotifier(this, proc, ptr); }
24750
24751         OSStatus UseSyncIdleEvents()
24752                     { return OTUseSyncIdleEvents(this, true); }
24753
24754         OSStatus DontUseSyncIdleEvents()
24755                     { return OTUseSyncIdleEvents(this, false); }
24756
24757         void RemoveNotifier()
24758                     { OTRemoveNotifier(this); }
24759
24760         Boolean EnterNotifier()
24761                     { return OTEnterNotifier(this); }
24762
24763         void LeaveNotifier()
24764                     { OTLeaveNotifier(this); }
24765         SInt32 Ioctl(UInt32 cmd, void* data)
24766                     { return OTIoctl(this, cmd, data); }
24767         SInt32 Ioctl(UInt32 cmd, long data)
24768                     { return OTIoctl(this, cmd, (void*)data); }
24769     public:
24770         void* fData;
24771 };
24772 class TEndpoint : public TProvider
24773 {
24774     public:
24775
24776
24777
24778         OSStatus GetEndpointInfo(TEndpointInfo* info)
24779                     { return OTGetEndpointInfo(this, info); }
24780
24781         OSStatus GetProtAddress(TBind* boundAddr, TBind* peerAddr)
24782                     { return OTGetProtAddress(this, boundAddr, peerAddr); }
24783
24784         OSStatus ResolveAddress(TBind* reqAddr, TBind* retAddr, OTTimeout timeout)
24785                     { return OTResolveAddress(this, reqAddr, retAddr, timeout); }
24786
24787         OTResult GetEndpointState()
24788                     { return OTGetEndpointState(this); }
24789
24790         OTResult Look()
24791                     { return OTLook(this); }
24792         void* AllocInContext(OTStructType structType, UInt32 fields, OSStatus* err = __null, OTClientContextPtr clientContext = __null)
24793                     { return OTAllocInContext(this, structType, fields, err, clientContext); }
24794
24795         void* Alloc(OTStructType structType, UInt32 fields, OSStatus* err = __null)
24796                     {
24797
24798                          return OTAllocInContext(this, structType, fields, err, __null);
24799
24800
24801
24802                     };
24803
24804         OTResult Free(void* ptr, OTStructType structType)
24805                     { return OTFree(ptr, structType); }
24806
24807
24808
24809         OSStatus OptionManagement(TOptMgmt* req, TOptMgmt* ret)
24810                     { return OTOptionManagement(this, req, ret); }
24811
24812
24813
24814         OSStatus Bind(TBind* reqAddr, TBind* retAddr)
24815                     { return OTBind(this, reqAddr, retAddr); }
24816
24817         OSStatus Unbind()
24818                     { return OTUnbind(this); }
24819
24820
24821
24822         OSStatus Connect(TCall* sndCall, TCall* rcvCall)
24823                     { return OTConnect(this, sndCall, rcvCall); }
24824
24825         OSStatus RcvConnect(TCall* call)
24826                     { return OTRcvConnect(this, call); }
24827
24828         OSStatus Listen(TCall* call)
24829                     { return OTListen(this, call); }
24830
24831         OSStatus Accept(EndpointRef resRef, TCall* call)
24832                     { return OTAccept(this, resRef, call); }
24833
24834         OSStatus SndDisconnect(TCall* call)
24835                     { return OTSndDisconnect(this, call); }
24836
24837         OSStatus SndOrderlyDisconnect()
24838                     { return OTSndOrderlyDisconnect(this); }
24839
24840         OSStatus RcvDisconnect(TDiscon* discon)
24841                     { return OTRcvDisconnect(this, discon); }
24842
24843         OSStatus RcvOrderlyDisconnect()
24844                     { return OTRcvOrderlyDisconnect(this); }
24845
24846
24847
24848         OTResult Snd(void* buf, OTByteCount nbytes, OTFlags flags)
24849                     { return OTSnd(this, buf, nbytes, flags); }
24850
24851         OTResult Rcv(void* buf, OTByteCount nbytes, OTFlags* flagP)
24852                     { return OTRcv(this, buf, nbytes, flagP); }
24853
24854
24855
24856         OSStatus SndUData(TUnitData* udata)
24857                     { return OTSndUData(this, udata); }
24858
24859         OSStatus RcvUData(TUnitData* udata, OTFlags* flagP)
24860                     { return OTRcvUData(this, udata, flagP); }
24861
24862         OSStatus RcvUDErr(TUDErr* uderr)
24863                     { return OTRcvUDErr(this, uderr); }
24864         OTResult CountDataBytes(OTByteCount* countPtr)
24865                     { return OTCountDataBytes(this, countPtr); }
24866 };
24867
24868
24869
24870
24871
24872
24873
24874 class TMapper : public TProvider
24875 {
24876     public:
24877         OSStatus RegisterName(TRegisterRequest* req, TRegisterReply* reply)
24878                     { return OTRegisterName(this, req, reply); }
24879
24880         OSStatus DeleteName(TNetbuf* name)
24881                     { return OTDeleteName(this, name); }
24882
24883         OSStatus DeleteName(OTNameID theID)
24884                     { return OTDeleteNameByID(this, theID); }
24885
24886         OSStatus LookupName(TLookupRequest* req, TLookupReply* reply)
24887                     { return OTLookupName(this, req, reply); }
24888 };
24889
24890
24891
24892 extern "C" {
24893
24894
24895 }
24896 extern "C" {
24897
24898
24899 typedef UInt16 InetPort;
24900 typedef UInt32 InetHost;
24901
24902
24903 enum {
24904   AF_DNS = 42
24905 };
24906
24907
24908
24909
24910
24911
24912
24913 enum {
24914   kOTAnyInetAddress = 0
24915 };
24916  typedef class TInternetServices* InetSvcRef;
24917 enum {
24918   INET_IP = 0x00,
24919   INET_TCP = 0x06,
24920   INET_UDP = 0x11
24921 };
24922
24923
24924
24925 enum {
24926   TCP_NODELAY = 0x01,
24927   TCP_MAXSEG = 0x02,
24928   TCP_NOTIFY_THRESHOLD = 0x10,
24929   TCP_ABORT_THRESHOLD = 0x11,
24930   TCP_CONN_NOTIFY_THRESHOLD = 0x12,
24931   TCP_CONN_ABORT_THRESHOLD = 0x13,
24932   TCP_OOBINLINE = 0x14,
24933   TCP_URGENT_PTR_TYPE = 0x15,
24934   TCP_KEEPALIVE = 0x0008
24935 };
24936 enum {
24937   T_GARBAGE = 2
24938 };
24939
24940
24941
24942 enum {
24943   UDP_CHECKSUM = 0x0600,
24944   UDP_RX_ICMP = 0x02
24945 };
24946 enum {
24947   kIP_OPTIONS = 0x01,
24948   kIP_TOS = 0x02,
24949   kIP_TTL = 0x03,
24950   kIP_REUSEADDR = 0x04,
24951   kIP_DONTROUTE = 0x10,
24952   kIP_BROADCAST = 0x20,
24953   kIP_REUSEPORT = 0x0200,
24954   kIP_HDRINCL = 0x1002,
24955   kIP_RCVOPTS = 0x1005,
24956   kIP_RCVDSTADDR = 0x1007,
24957   kIP_MULTICAST_IF = 0x1010,
24958   kIP_MULTICAST_TTL = 0x1011,
24959   kIP_MULTICAST_LOOP = 0x1012,
24960   kIP_ADD_MEMBERSHIP = 0x1013,
24961   kIP_DROP_MEMBERSHIP = 0x1014,
24962   kIP_BROADCAST_IFNAME = 0x1015,
24963   kIP_RCVIFADDR = 0x1016
24964 };
24965
24966
24967
24968
24969
24970
24971
24972 enum {
24973   DVMRP_INIT = 100,
24974   DVMRP_DONE = 101,
24975   DVMRP_ADD_VIF = 102,
24976   DVMRP_DEL_VIF = 103,
24977   DVMRP_ADD_LGRP = 104,
24978   DVMRP_DEL_LGRP = 105,
24979   DVMRP_ADD_MRT = 106,
24980   DVMRP_DEL_MRT = 107
24981 };
24982
24983
24984
24985
24986 enum {
24987   T_ROUTINE = 0,
24988   T_PRIORITY = 1,
24989   T_IMMEDIATE = 2,
24990   T_FLASH = 3,
24991   T_OVERRIDEFLASH = 4,
24992   T_CRITIC_ECP = 5,
24993   T_INETCONTROL = 6,
24994   T_NETCONTROL = 7
24995 };
24996
24997
24998
24999 enum {
25000   T_NOTOS = 0x00,
25001   T_LDELAY = (1 << 4),
25002   T_HITHRPT = (1 << 3),
25003   T_HIREL = (1 << 2)
25004 };
25005
25006
25007
25008
25009 struct TIPAddMulticast {
25010   InetHost multicastGroupAddress;
25011   InetHost interfaceAddress;
25012 };
25013 typedef struct TIPAddMulticast TIPAddMulticast;
25014
25015 enum {
25016   T_DNRSTRINGTOADDRCOMPLETE = kPRIVATEEVENT + 1,
25017   T_DNRADDRTONAMECOMPLETE = kPRIVATEEVENT + 2,
25018   T_DNRSYSINFOCOMPLETE = kPRIVATEEVENT + 3,
25019   T_DNRMAILEXCHANGECOMPLETE = kPRIVATEEVENT + 4,
25020   T_DNRQUERYCOMPLETE = kPRIVATEEVENT + 5
25021 };
25022
25023
25024
25025 struct InetAddress {
25026   OTAddressType fAddressType;
25027   InetPort fPort;
25028   InetHost fHost;
25029   UInt8 fUnused[8];
25030 };
25031 typedef struct InetAddress InetAddress;
25032
25033 enum {
25034   kMaxHostAddrs = 10,
25035   kMaxSysStringLen = 32,
25036   kMaxHostNameLen = 255
25037 };
25038
25039
25040 typedef char InetDomainName[256];
25041 struct InetHostInfo {
25042   InetDomainName name;
25043   InetHost addrs[10];
25044 };
25045 typedef struct InetHostInfo InetHostInfo;
25046 struct InetSysInfo {
25047   char cpuType[32];
25048   char osType[32];
25049 };
25050 typedef struct InetSysInfo InetSysInfo;
25051 struct InetMailExchange {
25052   UInt16 preference;
25053   InetDomainName exchange;
25054 };
25055 typedef struct InetMailExchange InetMailExchange;
25056 struct DNSQueryInfo {
25057   UInt16 qType;
25058   UInt16 qClass;
25059   UInt32 ttl;
25060   InetDomainName name;
25061   UInt16 responseType;
25062   UInt16 resourceLen;
25063   char resourceData[4];
25064 };
25065 typedef struct DNSQueryInfo DNSQueryInfo;
25066 struct DNSAddress {
25067   OTAddressType fAddressType;
25068   InetDomainName fName;
25069 };
25070 typedef struct DNSAddress DNSAddress;
25071
25072 enum {
25073   kDefaultInetInterface = -1
25074 };
25075
25076 enum {
25077   kInetInterfaceInfoVersion = 3
25078 };
25079
25080 struct InetInterfaceInfo {
25081   InetHost fAddress;
25082   InetHost fNetmask;
25083   InetHost fBroadcastAddr;
25084   InetHost fDefaultGatewayAddr;
25085   InetHost fDNSAddr;
25086   UInt16 fVersion;
25087   UInt16 fHWAddrLen;
25088   UInt8 * fHWAddr;
25089   UInt32 fIfMTU;
25090   UInt8 * fReservedPtrs[2];
25091   InetDomainName fDomainName;
25092   UInt32 fIPSecondaryCount;
25093   UInt8 fReserved[252];
25094 };
25095 typedef struct InetInterfaceInfo InetInterfaceInfo;
25096
25097 enum {
25098   kAllDHCPOptions = -1,
25099   kDHCPLongOption = 126,
25100   kDHCPLongOptionReq = 127
25101 };
25102
25103 struct InetDHCPOption {
25104   UInt8 fOptionTag;
25105   UInt8 fOptionLen;
25106   UInt8 fOptionValue;
25107 };
25108 typedef struct InetDHCPOption InetDHCPOption;
25109 extern void
25110 OTInitInetAddress(
25111   InetAddress * addr,
25112   InetPort port,
25113   InetHost host) ;
25114 extern OTByteCount
25115 OTInitDNSAddress(
25116   DNSAddress * addr,
25117   char * str) ;
25118 extern OSStatus
25119 OTInetStringToHost(
25120   const char * str,
25121   InetHost * host) ;
25122 extern void
25123 OTInetHostToString(
25124   InetHost host,
25125   char * str) ;
25126 extern OSStatus
25127 OTInetGetInterfaceInfo(
25128   InetInterfaceInfo * info,
25129   SInt32 val) ;
25130 extern OSStatus
25131 OTInetGetSecondaryAddresses(
25132   InetHost * addr,
25133   UInt32 * count,
25134   SInt32 val) ;
25135 extern InetSvcRef
25136 OTOpenInternetServicesInContext(
25137   OTConfigurationRef cfig,
25138   OTOpenFlags oflag,
25139   OSStatus * err,
25140   OTClientContextPtr clientContext) ;
25141 extern OSStatus
25142 OTAsyncOpenInternetServicesInContext(
25143   OTConfigurationRef cfig,
25144   OTOpenFlags oflag,
25145   OTNotifyUPP upp,
25146   void * contextPtr,
25147   OTClientContextPtr clientContext) ;
25148 extern OSStatus
25149 OTInetStringToAddress(
25150   InetSvcRef ref,
25151   char * name,
25152   InetHostInfo * hinfo) ;
25153 extern OSStatus
25154 OTInetAddressToName(
25155   InetSvcRef ref,
25156   InetHost addr,
25157   InetDomainName name) ;
25158 extern OSStatus
25159 OTInetSysInfo(
25160   InetSvcRef ref,
25161   char * name,
25162   InetSysInfo * sysinfo) ;
25163 extern OSStatus
25164 OTInetMailExchange(
25165   InetSvcRef ref,
25166   char * name,
25167   UInt16 * num,
25168   InetMailExchange * mx) ;
25169 extern OSStatus
25170 OTInetQuery(
25171   InetSvcRef ref,
25172   char * name,
25173   UInt16 qClass,
25174   UInt16 qType,
25175   char * buf,
25176   OTByteCount buflen,
25177   void ** argv,
25178   OTByteCount argvlen,
25179   OTFlags flags) ;
25180
25181
25182
25183 }
25184
25185 class TInternetServices : public TProvider
25186 {
25187     public:
25188             OSStatus StringToAddress(char* name, InetHostInfo* hinfo)
25189                         { return OTInetStringToAddress(this, name, hinfo); }
25190
25191             OSStatus AddressToName(InetHost addr, InetDomainName name)
25192                         { return OTInetAddressToName(this, addr, name); }
25193
25194             OSStatus SysInfo(char* name, InetSysInfo* sysinfo )
25195                         { return OTInetSysInfo(this, name, sysinfo); }
25196
25197             OSStatus MailExchange(char* name, UInt16* num, InetMailExchange* mx)
25198                         { return OTInetMailExchange(this, name, num, mx); }
25199
25200             OSStatus Query(char* name, UInt16 qClass, UInt16 qType,
25201                               char* buf, OTByteCount buflen,
25202                               void** argv, OTByteCount argvlen,
25203                               OTFlags flags)
25204                         { return OTInetQuery(this, name, qClass, qType, buf, buflen, argv, argvlen, flags); }
25205 };
25206
25207 extern "C" {
25208 enum {
25209   ATK_DDP = 'DDP ',
25210   ATK_AARP = 'AARP',
25211   ATK_ATP = 'ATP ',
25212   ATK_ADSP = 'ADSP',
25213   ATK_ASP = 'ASP ',
25214   ATK_PAP = 'PAP ',
25215   ATK_NBP = 'NBP ',
25216   ATK_ZIP = 'ZIP '
25217 };
25218 enum {
25219   DDP_OPT_HOPCOUNT = 0x2100
25220 };
25221
25222 enum {
25223   DDP_OPT_CHECKSUM = 0x0600,
25224   DDP_OPT_SRCADDR = 0x2101,
25225   ATP_OPT_REPLYCNT = 0x2110,
25226   ATP_OPT_DATALEN = 0x2111,
25227   ATP_OPT_RELTIMER = 0x2112,
25228   ATP_OPT_TRANID = 0x2113,
25229   PAP_OPT_OPENRETRY = 0x2120
25230 };
25231 enum {
25232   kAppleTalkEvent = kPROTOCOLEVENT | 0x00010000,
25233   T_GETMYZONECOMPLETE = kAppleTalkEvent + 1,
25234   T_GETLOCALZONESCOMPLETE = kAppleTalkEvent + 2,
25235   T_GETZONELISTCOMPLETE = kAppleTalkEvent + 3,
25236   T_GETATALKINFOCOMPLETE = kAppleTalkEvent + 4,
25237   T_ATALKROUTERDOWNEVENT = kAppleTalkEvent + 51,
25238   T_ATALKROUTERUPEVENT = kAppleTalkEvent + 52,
25239   T_ATALKZONENAMECHANGEDEVENT = kAppleTalkEvent + 53,
25240   T_ATALKCONNECTIVITYCHANGEDEVENT = kAppleTalkEvent + 54,
25241   T_ATALKINTERNETAVAILABLEEVENT = kAppleTalkEvent + 55,
25242   T_ATALKCABLERANGECHANGEDEVENT = kAppleTalkEvent + 56
25243 };
25244
25245 enum {
25246   T_ATALKBADROUTEREVENT = kAppleTalkEvent + 70,
25247   T_ALLNODESTAKENEVENT = kAppleTalkEvent + 71,
25248   T_FIXEDNODETAKENEVENT = kAppleTalkEvent + 72,
25249   T_MPPCOMPATCFIGEVENT = kAppleTalkEvent + 73,
25250   T_FIXEDNODEBADEVENT = kAppleTalkEvent + 74
25251 };
25252
25253 enum {
25254   kAllATalkRoutersDown = 0,
25255   kLocalATalkRoutersDown = -1L,
25256   kARARouterDisconnected = -2L
25257 };
25258
25259 enum {
25260   kARARouterOnline = -1L,
25261   kATalkRouterOnline = 0,
25262   kLocalATalkRouterOnline = -2L
25263 };
25264
25265
25266
25267
25268 enum {
25269   ATALK_IOC_FULLSELFSEND = ((MIOC_ATALK << 8) | 47),
25270   ADSP_IOC_FORWARDRESET = ((MIOC_ATALK << 8) | 60)
25271 };
25272
25273
25274
25275
25276
25277 enum {
25278   kECHO_TSDU = 585
25279 };
25280
25281
25282
25283 enum {
25284   kNBPMaxNameLength = 32,
25285   kNBPMaxTypeLength = 32,
25286   kNBPMaxZoneLength = 32,
25287   kNBPSlushLength = 9,
25288   kNBPMaxEntityLength = (kNBPMaxNameLength + kNBPMaxTypeLength + kNBPMaxZoneLength + 3),
25289   kNBPEntityBufferSize = (kNBPMaxNameLength + kNBPMaxTypeLength + kNBPMaxZoneLength + kNBPSlushLength),
25290   kNBPWildCard = 0x3D,
25291   kNBPImbeddedWildCard = 0xC5,
25292   kNBPDefaultZone = 0x2A
25293 };
25294
25295
25296
25297 enum {
25298   kZIPMaxZoneLength = kNBPMaxZoneLength
25299 };
25300
25301 enum {
25302   kDDPAddressLength = 8,
25303   kNBPAddressLength = kNBPEntityBufferSize,
25304   kAppleTalkAddressLength = kDDPAddressLength + kNBPEntityBufferSize
25305 };
25306     typedef class TAppleTalkServices* ATSvcRef;
25307 extern OSStatus
25308 OTAsyncOpenAppleTalkServicesInContext(
25309   OTConfigurationRef cfig,
25310   OTOpenFlags flags,
25311   OTNotifyUPP proc,
25312   void * contextPtr,
25313   OTClientContextPtr clientContext) ;
25314 extern ATSvcRef
25315 OTOpenAppleTalkServicesInContext(
25316   OTConfigurationRef cfig,
25317   OTOpenFlags flags,
25318   OSStatus * err,
25319   OTClientContextPtr clientContext) ;
25320 extern OSStatus
25321 OTATalkGetMyZone(
25322   ATSvcRef ref,
25323   TNetbuf * zone) ;
25324 extern OSStatus
25325 OTATalkGetLocalZones(
25326   ATSvcRef ref,
25327   TNetbuf * zones) ;
25328 extern OSStatus
25329 OTATalkGetZoneList(
25330   ATSvcRef ref,
25331   TNetbuf * zones) ;
25332 extern OSStatus
25333 OTATalkGetInfo(
25334   ATSvcRef ref,
25335   TNetbuf * info) ;
25336
25337
25338
25339 }
25340
25341 class TAppleTalkServices : public TProvider
25342 {
25343     public:
25344             OSStatus GetMyZone(TNetbuf* zone) { return OTATalkGetMyZone(this, zone); }
25345             OSStatus GetLocalZones(TNetbuf* zones) { return OTATalkGetLocalZones(this, zones); }
25346             OSStatus GetZoneList(TNetbuf* zones) { return OTATalkGetZoneList(this, zones); }
25347             OSStatus GetInfo(TNetbuf* info) { return OTATalkGetInfo(this, info); }
25348 };
25349
25350 extern "C" {
25351 enum {
25352   AF_ATALK_FAMILY = 0x0100,
25353   AF_ATALK_DDP = 0x0100,
25354   AF_ATALK_DDPNBP = AF_ATALK_FAMILY + 1,
25355   AF_ATALK_NBP = AF_ATALK_FAMILY + 2,
25356   AF_ATALK_MNODE = AF_ATALK_FAMILY + 3
25357 };
25358
25359 struct NBPEntity {
25360   UInt8 fEntity[99];
25361 };
25362 typedef struct NBPEntity NBPEntity;
25363 struct DDPAddress {
25364   OTAddressType fAddressType;
25365   UInt16 fNetwork;
25366   UInt8 fNodeID;
25367   UInt8 fSocket;
25368   UInt8 fDDPType;
25369   UInt8 fPad;
25370
25371
25372
25373
25374   void Init(const DDPAddress&);
25375    void Init(UInt16 net, UInt8 node, UInt8 socket);
25376     void Init(UInt16 net, UInt8 node, UInt8 socket, UInt8 type);
25377
25378    void SetSocket(UInt8);
25379   void SetType(UInt8);
25380     void SetNode(UInt8);
25381     void SetNetwork(UInt16);
25382
25383    OTByteCount GetAddressLength() const;
25384   OTAddressType GetAddressType() const;
25385     UInt8 GetSocket() const;
25386  UInt8 GetType() const;
25387    UInt8 GetNode() const;
25388    UInt16 GetNetwork() const;
25389
25390    Boolean operator==(const DDPAddress&) const;
25391    Boolean operator!=(const DDPAddress&) const;
25392    void operator=(const DDPAddress&);
25393
25394
25395
25396 };
25397 typedef struct DDPAddress DDPAddress;
25398 struct NBPAddress {
25399   OTAddressType fAddressType;
25400   UInt8 fNBPNameBuffer[105];
25401
25402
25403
25404
25405   OTByteCount Init();
25406     OTByteCount Init(const NBPEntity&);
25407     OTByteCount Init(const char*);
25408  OTByteCount Init(const char*, OTByteCount len);
25409     Boolean ExtractEntity(NBPEntity&, OTByteCount len);
25410
25411    OTAddressType GetAddressType() const;
25412
25413
25414
25415 };
25416 typedef struct NBPAddress NBPAddress;
25417 struct DDPNBPAddress {
25418   OTAddressType fAddressType;
25419   UInt16 fNetwork;
25420   UInt8 fNodeID;
25421   UInt8 fSocket;
25422   UInt8 fDDPType;
25423   UInt8 fPad;
25424   UInt8 fNBPNameBuffer[105];
25425
25426
25427
25428
25429   void Init(const DDPAddress&);
25430    void Init(UInt16 net, UInt8 node, UInt8 socket);
25431     void Init(UInt16 net, UInt8 node, UInt8 socket, UInt8 type);
25432
25433    void SetSocket(UInt8);
25434   void SetType(UInt8);
25435     void SetNode(UInt8);
25436     void SetNetwork(UInt16);
25437
25438    OTAddressType GetAddressType() const;
25439     UInt8 GetSocket() const;
25440  UInt8 GetType() const;
25441    UInt8 GetNode() const;
25442    UInt16 GetNetwork() const;
25443
25444    Boolean ExtractEntity(NBPEntity&, OTByteCount len);
25445     OTByteCount SetNBPEntity(const NBPEntity&);
25446     OTByteCount SetNBPEntity(const char*);
25447  OTByteCount SetNBPEntity(const char*, OTByteCount len);
25448
25449    Boolean operator==(const DDPAddress&) const;
25450
25451
25452
25453 };
25454 typedef struct DDPNBPAddress DDPNBPAddress;
25455 extern void
25456 OTInitDDPAddress(
25457   DDPAddress * addr,
25458   UInt16 net,
25459   UInt8 node,
25460   UInt8 socket,
25461   UInt8 ddpType) ;
25462 extern OTByteCount
25463 OTInitNBPAddress(
25464   NBPAddress * addr,
25465   const char * name) ;
25466 extern OTByteCount
25467 OTInitDDPNBPAddress(
25468   DDPNBPAddress * addr,
25469   const char * name,
25470   UInt16 net,
25471   UInt8 node,
25472   UInt8 socket,
25473   UInt8 ddpType) ;
25474 extern Boolean
25475 OTCompareDDPAddresses(
25476   const DDPAddress * addr1,
25477   const DDPAddress * addr2) ;
25478 extern void
25479 OTInitNBPEntity(NBPEntity * entity) ;
25480 extern OTByteCount
25481 OTGetNBPEntityLengthAsAddress(const NBPEntity * entity) ;
25482 extern OTByteCount
25483 OTSetAddressFromNBPEntity(
25484   UInt8 * nameBuf,
25485   const NBPEntity * entity) ;
25486 extern OTByteCount
25487 OTSetAddressFromNBPString(
25488   UInt8 * addrBuf,
25489   const char * name,
25490   SInt32 len) ;
25491 extern Boolean
25492 OTSetNBPEntityFromAddress(
25493   NBPEntity * entity,
25494   const UInt8 * addrBuf,
25495   OTByteCount len) ;
25496 extern Boolean
25497 OTSetNBPName(
25498   NBPEntity * entity,
25499   const char * name) ;
25500 extern Boolean
25501 OTSetNBPType(
25502   NBPEntity * entity,
25503   const char * typeVal) ;
25504 extern Boolean
25505 OTSetNBPZone(
25506   NBPEntity * entity,
25507   const char * zone) ;
25508 extern void
25509 OTExtractNBPName(
25510   const NBPEntity * entity,
25511   char * name) ;
25512 extern void
25513 OTExtractNBPType(
25514   const NBPEntity * entity,
25515   char * typeVal) ;
25516 extern void
25517 OTExtractNBPZone(
25518   const NBPEntity * entity,
25519   char * zone) ;
25520
25521
25522
25523
25524
25525
25526 inline void DDPAddress::operator=(const DDPAddress& addr)
25527 {
25528     *(UInt32*)&fAddressType = *(UInt32*)&addr.fAddressType;
25529     *(UInt32*)&fNodeID = *(UInt32*)&addr.fNodeID;
25530 }
25531
25532 inline Boolean DDPAddress::operator==(const DDPAddress& addr) const
25533 {
25534     return OTCompareDDPAddresses(&addr, this);
25535 }
25536
25537 inline Boolean DDPAddress::operator!=(const DDPAddress& addr) const
25538 {
25539     return !OTCompareDDPAddresses(&addr, this);
25540 }
25541
25542 inline void DDPAddress::SetSocket(UInt8 socket)
25543 {
25544     fSocket = socket;
25545 }
25546
25547 inline void DDPAddress::SetNode(UInt8 node)
25548 {
25549     fNodeID = node;
25550 }
25551
25552 inline void DDPAddress::SetType(UInt8 type)
25553 {
25554     fDDPType = type;
25555 }
25556
25557 inline void DDPAddress::SetNetwork(UInt16 net)
25558 {
25559     fNetwork = net;
25560 }
25561
25562 inline OTByteCount DDPAddress::GetAddressLength() const
25563 {
25564     return kDDPAddressLength;
25565 }
25566
25567 inline OTAddressType DDPAddress::GetAddressType() const
25568 {
25569     return fAddressType;
25570 }
25571
25572 inline UInt8 DDPAddress::GetSocket() const
25573 {
25574     return fSocket;
25575 }
25576
25577 inline UInt8 DDPAddress::GetNode() const
25578 {
25579     return fNodeID;
25580 }
25581
25582 inline UInt8 DDPAddress::GetType() const
25583 {
25584     return fDDPType;
25585 }
25586
25587 inline UInt16 DDPAddress::GetNetwork() const
25588 {
25589     return fNetwork;
25590 }
25591
25592 inline void DDPAddress::Init(UInt16 net, UInt8 node,
25593                               UInt8 socket)
25594 {
25595     fAddressType = AF_ATALK_DDP;
25596     SetNetwork(net);
25597     SetNode(node);
25598     SetSocket(socket);
25599     SetType(0);
25600 }
25601
25602 inline void DDPAddress::Init(UInt16 net, UInt8 node,
25603                               UInt8 socket, UInt8 type)
25604 {
25605     fAddressType = AF_ATALK_DDP;
25606     SetNetwork(net);
25607     SetNode(node);
25608     SetSocket(socket);
25609     SetType(type);
25610 }
25611
25612 inline void DDPAddress::Init(const DDPAddress& addr)
25613 {
25614     *(UInt32*)&fAddressType = *(UInt32*)&addr.fAddressType;
25615     *(UInt32*)&fNodeID = *(UInt32*)&addr.fNodeID;
25616 }
25617
25618
25619
25620 inline OTByteCount NBPAddress::Init()
25621 {
25622     fAddressType = AF_ATALK_NBP;
25623     return sizeof(OTAddressType);
25624 }
25625
25626 inline OTByteCount NBPAddress::Init(const NBPEntity& addr)
25627 {
25628     fAddressType = AF_ATALK_NBP;
25629     return sizeof(OTAddressType) + OTSetAddressFromNBPEntity(fNBPNameBuffer, &addr);
25630 }
25631
25632 inline OTByteCount NBPAddress::Init(const char* name)
25633 {
25634     fAddressType = AF_ATALK_NBP;
25635     return sizeof(OTAddressType) + OTSetAddressFromNBPString(fNBPNameBuffer, name, -1);
25636 }
25637
25638 inline OTByteCount NBPAddress::Init(const char* name, OTByteCount len)
25639 {
25640     fAddressType = AF_ATALK_NBP;
25641     return sizeof(OTAddressType) + OTSetAddressFromNBPString(fNBPNameBuffer, name, (SInt32)len);
25642 }
25643
25644 inline Boolean NBPAddress::ExtractEntity(NBPEntity& entity, OTByteCount len)
25645 {
25646     return OTSetNBPEntityFromAddress(&entity, fNBPNameBuffer, len);
25647 }
25648
25649 inline OTAddressType NBPAddress::GetAddressType() const
25650 {
25651     return fAddressType;
25652 }
25653
25654
25655
25656 inline Boolean DDPNBPAddress::operator==(const DDPAddress& addr) const
25657 {
25658     return OTCompareDDPAddresses((const DDPAddress*)this, &addr);
25659 }
25660
25661 inline void DDPNBPAddress::SetSocket(UInt8 socket)
25662 {
25663     fSocket = socket;
25664 }
25665
25666 inline void DDPNBPAddress::SetNode(UInt8 node)
25667 {
25668     fNodeID = node;
25669 }
25670
25671 inline void DDPNBPAddress::SetType(UInt8 type)
25672 {
25673     fDDPType = type;
25674 }
25675
25676 inline void DDPNBPAddress::SetNetwork(UInt16 net)
25677 {
25678     fNetwork = net;
25679 }
25680
25681 inline OTAddressType DDPNBPAddress::GetAddressType() const
25682 {
25683     return fAddressType;
25684 }
25685
25686 inline UInt8 DDPNBPAddress::GetSocket() const
25687 {
25688     return fSocket;
25689 }
25690
25691 inline UInt8 DDPNBPAddress::GetNode() const
25692 {
25693     return fNodeID;
25694 }
25695
25696 inline UInt8 DDPNBPAddress::GetType() const
25697 {
25698     return fDDPType;
25699 }
25700
25701 inline UInt16 DDPNBPAddress::GetNetwork() const
25702 {
25703     return fNetwork;
25704 }
25705
25706 inline void DDPNBPAddress::Init(UInt16 net, UInt8 node,
25707                                 UInt8 socket)
25708 {
25709     fAddressType = AF_ATALK_DDPNBP;
25710     SetNetwork(net);
25711     SetNode(node);
25712     SetSocket(socket);
25713     SetType(0);
25714 }
25715
25716 inline void DDPNBPAddress::Init(UInt16 net, UInt8 node,
25717                                 UInt8 socket, UInt8 type)
25718 {
25719     fAddressType = AF_ATALK_DDPNBP;
25720     SetNetwork(net);
25721     SetNode(node);
25722     SetSocket(socket);
25723     SetType(type);
25724 }
25725
25726 inline void DDPNBPAddress::Init(const DDPAddress& addr)
25727 {
25728     fAddressType = AF_ATALK_DDPNBP;
25729     SetNetwork(addr.GetNetwork());
25730     SetNode(addr.GetNode());
25731     SetSocket(addr.GetSocket());
25732     SetType(addr.GetType());
25733     fNBPNameBuffer[0] = 0;
25734 }
25735
25736 inline OTByteCount DDPNBPAddress::SetNBPEntity(const NBPEntity& entity)
25737 {
25738     return OTSetAddressFromNBPEntity(fNBPNameBuffer, &entity) + kDDPAddressLength;
25739 }
25740
25741 inline OTByteCount DDPNBPAddress::SetNBPEntity(const char* name)
25742 {
25743     return OTSetAddressFromNBPString(fNBPNameBuffer, name, -1) + kDDPAddressLength;
25744 }
25745
25746 inline OTByteCount DDPNBPAddress::SetNBPEntity(const char* name, OTByteCount len)
25747 {
25748     return OTSetAddressFromNBPString(fNBPNameBuffer, name, (SInt32)len) + kDDPAddressLength;
25749 }
25750
25751 inline Boolean DDPNBPAddress::ExtractEntity(NBPEntity& entity, OTByteCount len)
25752 {
25753     return OTSetNBPEntityFromAddress(&entity, fNBPNameBuffer, len);
25754 }
25755
25756
25757
25758
25759 struct AppleTalkInfo {
25760   DDPAddress fOurAddress;
25761   DDPAddress fRouterAddress;
25762   UInt16 fCableRange[2];
25763   UInt16 fFlags;
25764 };
25765 typedef struct AppleTalkInfo AppleTalkInfo;
25766
25767 enum {
25768   kATalkInfoIsExtended = 0x0001,
25769   kATalkInfoHasRouter = 0x0002,
25770   kATalkInfoOneZone = 0x0004
25771 };
25772
25773
25774
25775
25776
25777
25778
25779 enum {
25780   kOTFramingEthernet = 0x01,
25781   kOTFramingEthernetIPX = 0x02,
25782   kOTFraming8023 = 0x04,
25783   kOTFraming8022 = 0x08
25784 };
25785 enum {
25786   kOTRawRcvOn = 0,
25787   kOTRawRcvOff = 1,
25788   kOTRawRcvOnWithTimeStamp = 2
25789 };
25790
25791 enum {
25792   DL_PROMISC_OFF = 0
25793 };
25794
25795
25796
25797
25798
25799 enum {
25800   kT8022ModuleID = 7100,
25801   kEnetModuleID = 7101,
25802   kTokenRingModuleID = 7102,
25803   kFDDIModuleID = 7103
25804 };
25805 enum {
25806   AF_8022 = 8200
25807 };
25808
25809
25810
25811 enum {
25812   LNK_ENET = 'ENET',
25813   LNK_TOKN = 'TOKN',
25814   LNK_FDDI = 'FDDI',
25815   LNK_TPI = 'LTPI'
25816 };
25817
25818
25819
25820 enum {
25821   OPT_ADDMCAST = 0x1000,
25822   OPT_DELMCAST = 0x1001,
25823   OPT_RCVPACKETTYPE = 0x1002,
25824   OPT_RCVDESTADDR = 0x1003,
25825   OPT_SETRAWMODE = 0x1004,
25826   OPT_SETPROMISCUOUS = 0x1005
25827 };
25828
25829 typedef UInt32 OTPacketType;
25830 enum {
25831   kETypeStandard = 0,
25832   kETypeMulticast = 1,
25833   kETypeBroadcast = 2,
25834   kETRawPacketBit = (unsigned long)0x80000000,
25835   kETTimeStampBit = 0x40000000
25836 };
25837
25838
25839
25840 enum {
25841   kMulticastLength = 6,
25842   k48BitAddrLength = 6,
25843   k8022DLSAPLength = 2,
25844   k8022SNAPLength = 5,
25845   kEnetAddressLength = k48BitAddrLength + k8022DLSAPLength,
25846
25847   kSNAPSAP = 0x00AA,
25848   kIPXSAP = 0x00FF,
25849   kMax8022SAP = 0x00FE,
25850   k8022GlobalSAP = 0x00FF,
25851   kMinDIXSAP = 1501,
25852   kMaxDIXSAP = 0xFFFF
25853 };
25854
25855
25856
25857 struct T8022Address {
25858   OTAddressType fAddrFamily;
25859   UInt8 fHWAddr[6];
25860   UInt16 fSAP;
25861   UInt8 fSNAP[5];
25862 };
25863 typedef struct T8022Address T8022Address;
25864 enum {
25865   k8022BasicAddressLength = sizeof(OTAddressType) + k48BitAddrLength + sizeof(UInt16),
25866   k8022SNAPAddressLength = sizeof(OTAddressType) + k48BitAddrLength + sizeof(UInt16) + k8022SNAPLength
25867 };
25868 enum {
25869   kEnetPacketHeaderLength = (2 * k48BitAddrLength) + k8022DLSAPLength,
25870   kEnetTSDU = 1514,
25871   kTokenRingTSDU = 4458,
25872   kFDDITSDU = 4458,
25873   k8022SAPLength = 1,
25874   k8022BasicHeaderLength = 3,
25875
25876   k8022SNAPHeaderLength = k8022SNAPLength + k8022BasicHeaderLength
25877 };
25878
25879
25880
25881
25882 typedef UInt32 EAddrType;
25883 enum {
25884   keaStandardAddress = 0,
25885   keaMulticast = 1,
25886   keaBroadcast = 2,
25887   keaBadAddress = 3,
25888   keaRawPacketBit = (unsigned long)0x80000000,
25889   keaTimeStampBit = 0x40000000
25890 };
25891
25892
25893
25894 struct EnetPacketHeader {
25895   UInt8 fDestAddr[6];
25896   UInt8 fSourceAddr[6];
25897   UInt16 fProto;
25898 };
25899 typedef struct EnetPacketHeader EnetPacketHeader;
25900 struct T8022Header {
25901   UInt8 fDSAP;
25902   UInt8 fSSAP;
25903   UInt8 fCtrl;
25904 };
25905 typedef struct T8022Header T8022Header;
25906 struct T8022SNAPHeader {
25907   UInt8 fDSAP;
25908   UInt8 fSSAP;
25909   UInt8 fCtrl;
25910   UInt8 fSNAP[5];
25911 };
25912 typedef struct T8022SNAPHeader T8022SNAPHeader;
25913 struct T8022FullPacketHeader {
25914   EnetPacketHeader fEnetPart;
25915   T8022SNAPHeader f8022Part;
25916 };
25917 typedef struct T8022FullPacketHeader T8022FullPacketHeader;
25918
25919 enum {
25920   kT8022HeaderLength = 3,
25921   kT8022SNAPHeaderLength = 3 + k8022SNAPLength,
25922   kT8022FullPacketHeaderLength = kEnetPacketHeaderLength + kT8022SNAPHeaderLength
25923 };
25924
25925
25926
25927
25928
25929
25930
25931 enum {
25932   COM_SERIAL = 'SERL'
25933 };
25934 enum {
25935   kSerialABModuleID = 7200
25936 };
25937
25938 enum {
25939   kOTSerialFramingAsync = 0x01,
25940   kOTSerialFramingHDLC = 0x02,
25941   kOTSerialFramingSDLC = 0x04,
25942   kOTSerialFramingAsyncPackets = 0x08,
25943   kOTSerialFramingPPP = 0x10
25944 };
25945
25946
25947
25948 enum {
25949   I_SetSerialDTR = ((MIOC_SRL << 8) | 0),
25950   kOTSerialSetDTROff = 0,
25951   kOTSerialSetDTROn = 1,
25952   I_SetSerialBreak = ((MIOC_SRL << 8) | 1),
25953
25954
25955   kOTSerialSetBreakOn = (unsigned long)0xFFFFFFFF,
25956   kOTSerialSetBreakOff = 0,
25957   I_SetSerialXOffState = ((MIOC_SRL << 8) | 2),
25958   kOTSerialForceXOffTrue = 1,
25959   kOTSerialForceXOffFalse = 0,
25960   I_SetSerialXOn = ((MIOC_SRL << 8) | 3),
25961   kOTSerialSendXOnAlways = 1,
25962   kOTSerialSendXOnIfXOffTrue = 0,
25963   I_SetSerialXOff = ((MIOC_SRL << 8) | 4),
25964   kOTSerialSendXOffAlways = 1,
25965   kOTSerialSendXOffIfXOnTrue = 0
25966 };
25967 enum {
25968   SERIAL_OPT_BAUDRATE = 0x0100,
25969   SERIAL_OPT_DATABITS = 0x0101,
25970   SERIAL_OPT_STOPBITS = 0x0102,
25971   SERIAL_OPT_PARITY = 0x0103,
25972   SERIAL_OPT_STATUS = 0x0104,
25973
25974
25975   SERIAL_OPT_HANDSHAKE = 0x0105,
25976
25977
25978
25979
25980
25981   SERIAL_OPT_RCVTIMEOUT = 0x0106,
25982
25983
25984
25985
25986
25987
25988   SERIAL_OPT_ERRORCHARACTER = 0x0107,
25989   SERIAL_OPT_EXTCLOCK = 0x0108,
25990
25991
25992
25993   SERIAL_OPT_BURSTMODE = 0x0109,
25994
25995
25996   SERIAL_OPT_DUMMY = 0x010A
25997 };
25998
25999 typedef UInt32 ParityOptionValues;
26000 enum {
26001   kOTSerialNoParity = 0,
26002   kOTSerialOddParity = 1,
26003   kOTSerialEvenParity = 2
26004 };
26005
26006 enum {
26007   kOTSerialSwOverRunErr = 0x01,
26008   kOTSerialBreakOn = 0x08,
26009   kOTSerialParityErr = 0x10,
26010   kOTSerialOverrunErr = 0x20,
26011   kOTSerialFramingErr = 0x40,
26012   kOTSerialXOffSent = 0x00010000,
26013   kOTSerialDTRNegated = 0x00020000,
26014   kOTSerialCTLHold = 0x00040000,
26015   kOTSerialXOffHold = 0x00080000,
26016   kOTSerialOutputBreakOn = 0x01000000
26017 };
26018
26019 enum {
26020   kOTSerialXOnOffInputHandshake = 1,
26021   kOTSerialXOnOffOutputHandshake = 2,
26022   kOTSerialCTSInputHandshake = 4,
26023   kOTSerialDTROutputHandshake = 8
26024 };
26025
26026
26027
26028
26029    inline UInt32 OTSerialHandshakeData(UInt16 type, UInt8 onChar, UInt8 offChar)
26030   {
26031       return (((UInt32)type) << 16) | (((UInt32)onChar) << 8) | offChar;
26032  }
26033 inline UInt32 OTSerialSetErrorCharacter(UInt8 rep)
26034 {
26035   return (UInt32)rep & 0x000000ff;
26036 }
26037
26038 inline UInt32 OTSerialSetErrorCharacterWithAlternate(UInt8 rep, UInt8 alternate)
26039 {
26040  return (((rep & 0xff) | ((alternate & 0xff) << 8)) | 0x80000000L);
26041 }
26042 enum {
26043   kOTSerialDefaultBaudRate = 19200,
26044   kOTSerialDefaultDataBits = 8,
26045   kOTSerialDefaultStopBits = 10,
26046   kOTSerialDefaultParity = kOTSerialNoParity,
26047   kOTSerialDefaultHandshake = 0,
26048   kOTSerialDefaultOnChar = ('Q' & 0xFFFFFFBF),
26049   kOTSerialDefaultOffChar = ('S' & 0xFFFFFFBF),
26050   kOTSerialDefaultSndBufSize = 1024,
26051   kOTSerialDefaultRcvBufSize = 1024,
26052   kOTSerialDefaultSndLoWat = 96,
26053   kOTSerialDefaultRcvLoWat = 1,
26054   kOTSerialDefaultRcvTimeout = 10
26055 };
26056
26057
26058
26059
26060
26061
26062
26063 enum {
26064   COM_ISDN = 'ISDN'
26065 };
26066
26067
26068
26069
26070 enum {
26071   kISDNModuleID = 7300
26072 };
26073
26074
26075
26076
26077 enum {
26078   kOTISDNFramingTransparentSupported = 0x0010,
26079   kOTISDNFramingHDLCSupported = 0x0020,
26080   kOTISDNFramingV110Supported = 0x0040,
26081   kOTISDNFramingV14ESupported = 0x0080
26082 };
26083
26084
26085
26086
26087
26088 enum {
26089   kOTISDNUnallocatedNumber = 1,
26090   kOTISDNNoRouteToSpecifiedTransitNetwork = 2,
26091   kOTISDNNoRouteToDestination = 3,
26092   kOTISDNChannelUnacceptable = 6,
26093   kOTISDNNormal = 16,
26094   kOTISDNUserBusy = 17,
26095   kOTISDNNoUserResponding = 18,
26096   kOTISDNNoAnswerFromUser = 19,
26097   kOTISDNCallRejected = 21,
26098   kOTISDNNumberChanged = 22,
26099   kOTISDNNonSelectedUserClearing = 26,
26100   kOTISDNDestinationOutOfOrder = 27,
26101   kOTISDNInvalidNumberFormat = 28,
26102   kOTISDNFacilityRejected = 29,
26103   kOTISDNNormalUnspecified = 31,
26104   kOTISDNNoCircuitChannelAvailable = 34,
26105   kOTISDNNetworkOutOfOrder = 41,
26106   kOTISDNSwitchingEquipmentCongestion = 42,
26107   kOTISDNAccessInformationDiscarded = 43,
26108   kOTISDNRequestedCircuitChannelNotAvailable = 44,
26109   kOTISDNResourceUnavailableUnspecified = 45,
26110   kOTISDNQualityOfServiceUnvailable = 49,
26111   kOTISDNRequestedFacilityNotSubscribed = 50,
26112   kOTISDNBearerCapabilityNotAuthorized = 57,
26113   kOTISDNBearerCapabilityNotPresentlyAvailable = 58,
26114   kOTISDNCallRestricted = 59,
26115   kOTISDNServiceOrOptionNotAvilableUnspecified = 63,
26116   kOTISDNBearerCapabilityNotImplemented = 65,
26117   kOTISDNRequestedFacilityNotImplemented = 69,
26118   kOTISDNOnlyRestrictedDigitalBearer = 70,
26119   kOTISDNServiceOrOptionNotImplementedUnspecified = 79,
26120   kOTISDNCallIdentityNotUsed = 83,
26121   kOTISDNCallIdentityInUse = 84,
26122   kOTISDNNoCallSuspended = 85,
26123   kOTISDNCallIdentityCleared = 86,
26124   kOTISDNIncompatibleDestination = 88,
26125   kOTISDNInvalidTransitNetworkSelection = 91,
26126   kOTISDNInvalidMessageUnspecified = 95,
26127   kOTISDNMandatoryInformationElementIsMissing = 96,
26128   kOTISDNMessageTypeNonExistentOrNotImplemented = 97,
26129   kOTISDNInterworkingUnspecified = 127
26130 };
26131 enum {
26132   kAF_ISDN = 0x2000
26133 };
26134
26135
26136 enum {
26137   kOTISDNMaxPhoneSize = 32,
26138   kOTISDNMaxSubSize = 4
26139 };
26140
26141 struct OTISDNAddress {
26142   OTAddressType fAddressType;
26143   UInt16 fPhoneLength;
26144   char fPhoneNumber[37];
26145 };
26146 typedef struct OTISDNAddress OTISDNAddress;
26147
26148
26149
26150 enum {
26151   MIOC_ISDN = 'U'
26152 };
26153
26154 enum {
26155   I_OTISDNAlerting = ((MIOC_ISDN << 8) | 100),
26156   I_OTISDNSuspend = ((MIOC_ISDN << 8) | 101),
26157
26158   I_OTISDNSuspendAcknowledge = ((MIOC_ISDN << 8) | 102),
26159   I_OTISDNSuspendReject = ((MIOC_ISDN << 8) | 103),
26160   I_OTISDNResume = ((MIOC_ISDN << 8) | 104),
26161
26162   I_OTISDNResumeAcknowledge = ((MIOC_ISDN << 8) | 105),
26163   I_OTISDNResumeReject = ((MIOC_ISDN << 8) | 106),
26164   I_OTISDNFaciltity = ((MIOC_ISDN << 8) | 107)
26165 };
26166
26167
26168
26169 enum {
26170   kOTISDNMaxUserDataSize = 32
26171 };
26172
26173
26174
26175 enum {
26176   ISDN_OPT_COMMTYPE = 0x0200,
26177   ISDN_OPT_FRAMINGTYPE = 0x0201,
26178   ISDN_OPT_56KADAPTATION = 0x0202
26179 };
26180
26181
26182
26183 enum {
26184   kOTISDNTelephoneALaw = 1,
26185   kOTISDNTelephoneMuLaw = 26,
26186   kOTISDNDigital64k = 13,
26187   kOTISDNDigital56k = 37,
26188   kOTISDNVideo64k = 41,
26189   kOTISDNVideo56k = 42
26190 };
26191
26192
26193
26194 enum {
26195   kOTISDNFramingTransparent = 0x0010,
26196   kOTISDNFramingHDLC = 0x0020,
26197   kOTISDNFramingV110 = 0x0040,
26198   kOTISDNFramingV14E = 0x0080
26199 };
26200
26201
26202
26203 enum {
26204   kOTISDNNot56KAdaptation = false,
26205   kOTISDN56KAdaptation = true
26206 };
26207
26208
26209
26210 enum {
26211   kOTISDNDefaultCommType = kOTISDNDigital64k,
26212   kOTISDNDefaultFramingType = kOTISDNFramingHDLC,
26213   kOTISDNDefault56KAdaptation = kOTISDNNot56KAdaptation
26214 };
26215 enum {
26216   COM_PPP = 'PPPC'
26217 };
26218
26219
26220
26221 enum {
26222   kPPPMaxIDLength = 255,
26223   kPPPMaxPasswordLength = 255,
26224   kPPPMaxDTEAddressLength = 127,
26225   kPPPMaxCallInfoLength = 255
26226 };
26227
26228
26229
26230
26231 enum {
26232   kPPPStateInitial = 1,
26233   kPPPStateClosed = 2,
26234   kPPPStateClosing = 3,
26235   kPPPStateOpening = 4,
26236   kPPPStateOpened = 5
26237 };
26238
26239 enum {
26240   kPPPConnectionStatusIdle = 1,
26241   kPPPConnectionStatusConnecting = 2,
26242   kPPPConnectionStatusConnected = 3,
26243   kPPPConnectionStatusDisconnecting = 4
26244 };
26245
26246 enum {
26247   kPPPMinMRU = 0,
26248   kPPPMaxMRU = 4500
26249 };
26250
26251 enum {
26252   kIPCPTCPHdrCompressionDisabled = 0,
26253   kIPCPTCPHdrCompressionEnabled = 1
26254 };
26255
26256 enum {
26257   kPPPCompressionDisabled = 0x00000000,
26258   kPPPProtoCompression = 0x00000001,
26259   kPPPAddrCompression = 0x00000002
26260 };
26261
26262 enum {
26263   kPPPNoOutAuthentication = 0,
26264   kPPPCHAPOrPAPOutAuthentication = 1
26265 };
26266
26267 enum {
26268   kCCReminderTimerDisabled = 0,
26269   kCCIPIdleTimerDisabled = 0
26270 };
26271
26272 enum {
26273   kPPPScriptTypeModem = 1,
26274   kPPPScriptTypeConnect = 2,
26275   kPPPMaxScriptSize = 32000
26276 };
26277
26278 enum {
26279   kE164Address = 1,
26280   kPhoneAddress = 1,
26281   kCompoundPhoneAddress = 2,
26282   kX121Address = 3
26283 };
26284
26285 enum {
26286   kPPPConnectionStatusDialogsFlag = 0x00000001,
26287   kPPPConnectionRemindersFlag = 0x00000002,
26288   kPPPConnectionFlashingIconFlag = 0x00000004,
26289   kPPPOutPasswordDialogsFlag = 0x00000008,
26290   kPPPAllAlertsDisabledFlag = 0x00000000,
26291   kPPPAllAlertsEnabledFlag = 0x0000000F
26292 };
26293
26294 enum {
26295   kPPPAsyncMapCharsNone = 0x00000000,
26296   kPPPAsyncMapCharsXOnXOff = 0x000A0000,
26297   kPPPAsyncMapCharsAll = (unsigned long)0xFFFFFFFF
26298 };
26299
26300
26301
26302
26303 enum {
26304   IPCP_OPT_GETREMOTEPROTOADDR = 0x00007000,
26305   IPCP_OPT_GETLOCALPROTOADDR = 0x00007001,
26306   IPCP_OPT_TCPHDRCOMPRESSION = 0x00007002,
26307   LCP_OPT_PPPCOMPRESSION = 0x00007003,
26308   LCP_OPT_MRU = 0x00007004,
26309   LCP_OPT_RCACCMAP = 0x00007005,
26310   LCP_OPT_TXACCMAP = 0x00007006,
26311   SEC_OPT_OUTAUTHENTICATION = 0x00007007,
26312   SEC_OPT_ID = 0x00007008,
26313   SEC_OPT_PASSWORD = 0x00007009,
26314   CC_OPT_REMINDERTIMER = 0x00007010,
26315   CC_OPT_IPIDLETIMER = 0x00007011,
26316   CC_OPT_DTEADDRESSTYPE = 0x00007012,
26317   CC_OPT_DTEADDRESS = 0x00007013,
26318   CC_OPT_CALLINFO = 0x00007014,
26319   CC_OPT_GETMISCINFO = 0x00007015,
26320   PPP_OPT_GETCURRENTSTATE = 0x00007016,
26321   LCP_OPT_ECHO = 0x00007017,
26322   CC_OPT_SERIALPORTNAME = 0x00007200
26323 };
26324
26325
26326
26327 enum {
26328   kPPPEvent = kPROTOCOLEVENT | 0x000F0000,
26329   kPPPConnectCompleteEvent = kPPPEvent + 1,
26330   kPPPSetScriptCompleteEvent = kPPPEvent + 2,
26331   kPPPDisconnectCompleteEvent = kPPPEvent + 3,
26332   kPPPDisconnectEvent = kPPPEvent + 4,
26333   kPPPIPCPUpEvent = kPPPEvent + 5,
26334   kPPPIPCPDownEvent = kPPPEvent + 6,
26335   kPPPLCPUpEvent = kPPPEvent + 7,
26336   kPPPLCPDownEvent = kPPPEvent + 8,
26337   kPPPLowerLayerUpEvent = kPPPEvent + 9,
26338   kPPPLowerLayerDownEvent = kPPPEvent + 10,
26339   kPPPAuthenticationStartedEvent = kPPPEvent + 11,
26340   kPPPAuthenticationFinishedEvent = kPPPEvent + 12,
26341   kPPPDCEInitStartedEvent = kPPPEvent + 13,
26342   kPPPDCEInitFinishedEvent = kPPPEvent + 14,
26343   kPPPDCECallStartedEvent = kPPPEvent + 15,
26344   kPPPDCECallFinishedEvent = kPPPEvent + 16
26345 };
26346 struct PPPMRULimits {
26347   UInt32 mruSize;
26348   UInt32 upperMRULimit;
26349   UInt32 lowerMRULimit;
26350 };
26351 typedef struct PPPMRULimits PPPMRULimits;
26352
26353
26354
26355
26356 struct CCMiscInfo {
26357   UInt32 connectionStatus;
26358   UInt32 connectionTimeElapsed;
26359   UInt32 connectionTimeRemaining;
26360   UInt32 bytesTransmitted;
26361   UInt32 bytesReceived;
26362   UInt32 reserved;
26363 };
26364 typedef struct CCMiscInfo CCMiscInfo;
26365
26366
26367
26368
26369
26370
26371 struct LCPEcho {
26372   UInt32 retryCount;
26373   UInt32 retryPeriod;
26374 };
26375 typedef struct LCPEcho LCPEcho;
26376
26377
26378
26379
26380 enum {
26381   kRAProductClientOnly = 2,
26382   kRAProductOnePortServer = 3,
26383   kRAProductManyPortServer = 4
26384 };
26385
26386
26387
26388
26389
26390
26391
26392
26393
26394 }
26395 extern "C" {
26396
26397
26398 enum {
26399   I_NREAD = ((MIOC_STREAMIO << 8) | 1),
26400   I_PUSH = ((MIOC_STREAMIO << 8) | 2),
26401   I_POP = ((MIOC_STREAMIO << 8) | 3),
26402   I_LOOK = ((MIOC_STREAMIO << 8) | 4),
26403   I_FLUSH = ((MIOC_STREAMIO << 8) | 5),
26404   I_SRDOPT = ((MIOC_STREAMIO << 8) | 6),
26405   I_GRDOPT = ((MIOC_STREAMIO << 8) | 7),
26406   I_STR = ((MIOC_STREAMIO << 8) | 8),
26407   I_SETSIG = ((MIOC_STREAMIO << 8) | 9),
26408   I_GETSIG = ((MIOC_STREAMIO << 8) | 10),
26409   I_FIND = ((MIOC_STREAMIO << 8) | 11),
26410   I_LINK = ((MIOC_STREAMIO << 8) | 12),
26411   I_UNLINK = ((MIOC_STREAMIO << 8) | 13),
26412   I_PEEK = ((MIOC_STREAMIO << 8) | 15),
26413   I_FDINSERT = ((MIOC_STREAMIO << 8) | 16),
26414   I_SENDFD = ((MIOC_STREAMIO << 8) | 17),
26415   I_RECVFD = ((MIOC_STREAMIO << 8) | 18),
26416   I_FLUSHBAND = ((MIOC_STREAMIO << 8) | 19),
26417   I_SWROPT = ((MIOC_STREAMIO << 8) | 20),
26418   I_GWROPT = ((MIOC_STREAMIO << 8) | 21),
26419   I_LIST = ((MIOC_STREAMIO << 8) | 22),
26420   I_ATMARK = ((MIOC_STREAMIO << 8) | 23),
26421   I_CKBAND = ((MIOC_STREAMIO << 8) | 24),
26422   I_GETBAND = ((MIOC_STREAMIO << 8) | 25),
26423   I_CANPUT = ((MIOC_STREAMIO << 8) | 26),
26424   I_SETCLTIME = ((MIOC_STREAMIO << 8) | 27),
26425   I_GETCLTIME = ((MIOC_STREAMIO << 8) | 28),
26426   I_PLINK = ((MIOC_STREAMIO << 8) | 29),
26427   I_PUNLINK = ((MIOC_STREAMIO << 8) | 30),
26428   I_GETMSG = ((MIOC_STREAMIO << 8) | 40),
26429   I_PUTMSG = ((MIOC_STREAMIO << 8) | 41),
26430   I_POLL = ((MIOC_STREAMIO << 8) | 42),
26431   I_SETDELAY = ((MIOC_STREAMIO << 8) | 43),
26432   I_GETDELAY = ((MIOC_STREAMIO << 8) | 44),
26433   I_RUN_QUEUES = ((MIOC_STREAMIO << 8) | 45),
26434   I_GETPMSG = ((MIOC_STREAMIO << 8) | 46),
26435   I_PUTPMSG = ((MIOC_STREAMIO << 8) | 47),
26436   I_AUTOPUSH = ((MIOC_STREAMIO << 8) | 48),
26437   I_PIPE = ((MIOC_STREAMIO << 8) | 49),
26438   I_HEAP_REPORT = ((MIOC_STREAMIO << 8) | 50),
26439   I_FIFO = ((MIOC_STREAMIO << 8) | 51)
26440 };
26441 enum {
26442   RS_HIPRI = 0x01
26443 };
26444
26445
26446 enum {
26447   MSG_HIPRI = 0x01,
26448   MSG_BAND = 0x02,
26449   MSG_ANY = 0x04
26450 };
26451
26452
26453 enum {
26454   MORECTL = 0x01,
26455   MOREDATA = 0x02
26456 };
26457
26458
26459 enum {
26460   FMNAMESZ = 31
26461 };
26462
26463
26464
26465 enum {
26466   INFTIM = (unsigned long)0xFFFFFFFF
26467 };
26468
26469
26470 enum {
26471   FLUSHR = 0x01,
26472   FLUSHW = 0x02,
26473   FLUSHRW = (FLUSHW | FLUSHR)
26474 };
26475
26476 enum {
26477   FLUSHBAND = 0x40
26478 };
26479 struct bandinfo {
26480   unsigned char bi_pri;
26481   char pad1;
26482   SInt32 bi_flag;
26483 };
26484 typedef struct bandinfo bandinfo;
26485
26486 enum {
26487   ANYMARK = 0x01,
26488   LASTMARK = 0x02
26489 };
26490
26491
26492 enum {
26493   S_INPUT = 0x01,
26494   S_HIPRI = 0x02,
26495   S_OUTPUT = 0x04,
26496   S_MSG = 0x08,
26497   S_RDNORM = 0x10,
26498   S_RDBAND = 0x20,
26499   S_WRNORM = 0x40,
26500   S_WRBAND = 0x80,
26501   S_ERROR = 0x0100,
26502   S_HANGUP = 0x0200,
26503   S_BANDURG = 0x0400
26504 };
26505
26506
26507 enum {
26508   RNORM = 0x01,
26509   RMSGD = 0x02,
26510   RMSGN = 0x04,
26511   RFILL = 0x08
26512 };
26513
26514
26515 enum {
26516   RPROTNORM = 0x10,
26517   RPROTDIS = 0x20,
26518   RPROTDAT = 0x40
26519 };
26520
26521
26522 enum {
26523   SNDZERO = 0x01
26524 };
26525
26526 enum {
26527   MUXID_ALL = -1
26528 };
26529
26530
26531
26532
26533
26534
26535
26536 struct strfdinsert {
26537   strbuf ctlbuf;
26538   strbuf databuf;
26539   long flags;
26540   long fildes;
26541   SInt32 offset;
26542 };
26543 typedef struct strfdinsert strfdinsert;
26544
26545 struct str_mlist {
26546   char l_name[32];
26547 };
26548 typedef struct str_mlist str_mlist;
26549 struct str_list {
26550   SInt32 sl_nmods;
26551   str_mlist * sl_modlist;
26552 };
26553 typedef struct str_list str_list;
26554
26555 struct strpeek {
26556   strbuf ctlbuf;
26557   strbuf databuf;
26558   long flags;
26559 };
26560 typedef struct strpeek strpeek;
26561
26562 struct strpmsg {
26563   strbuf ctlbuf;
26564   strbuf databuf;
26565   SInt32 band;
26566   long flags;
26567 };
26568 typedef struct strpmsg strpmsg;
26569
26570 struct strrecvfd {
26571   long fd;
26572   unsigned short uid;
26573   unsigned short gid;
26574   char fill[8];
26575 };
26576 typedef struct strrecvfd strrecvfd;
26577
26578 struct strioctl {
26579   SInt32 ic_cmd;
26580   SInt32 ic_timout;
26581   SInt32 ic_len;
26582   char * ic_dp;
26583 };
26584 typedef struct strioctl strioctl;
26585
26586
26587 struct log_ctl {
26588   short mid;
26589   short sid;
26590   char level;
26591   char pad1;
26592   short flags;
26593   long ltime;
26594   long ttime;
26595   SInt32 seq_no;
26596 };
26597 typedef struct log_ctl log_ctl;
26598 enum {
26599   SL_FATAL = 0x01,
26600   SL_NOTIFY = 0x02,
26601   SL_ERROR = 0x04,
26602   SL_TRACE = 0x08,
26603   SL_CONSOLE = 0x00,
26604   SL_WARN = 0x20,
26605   SL_NOTE = 0x40
26606 };
26607
26608 struct trace_ids {
26609   short ti_mid;
26610   short ti_sid;
26611   char ti_level;
26612 };
26613 typedef struct trace_ids trace_ids;
26614 enum {
26615   I_TRCLOG = ((MIOC_STRLOG << 8) | 1),
26616   I_ERRLOG = ((MIOC_STRLOG << 8) | 2)
26617 };
26618
26619 enum {
26620   LOGMSGSZ = 128
26621 };
26622 struct OTPortCloseStruct {
26623   OTPortRef fPortRef;
26624   ProviderRef fTheProvider;
26625   OSStatus fDenyReason;
26626 };
26627 typedef struct OTPortCloseStruct OTPortCloseStruct;
26628
26629 struct OTClientList {
26630   ItemCount fNumClients;
26631   UInt8 fBuffer[4];
26632 };
26633 typedef struct OTClientList OTClientList;
26634 typedef long OTTimerTask;
26635 extern long
26636 OTCreateTimerTaskInContext(
26637   OTProcessUPP upp,
26638   void * arg,
26639   OTClientContextPtr clientContext) ;
26640 extern Boolean
26641 OTCancelTimerTask(OTTimerTask timerTask) ;
26642 extern void
26643 OTDestroyTimerTask(OTTimerTask timerTask) ;
26644 extern Boolean
26645 OTScheduleTimerTask(
26646   OTTimerTask timerTask,
26647   OTTimeout milliSeconds) ;
26648 extern OTByteCount
26649 OTBufferDataSize(OTBuffer * buffer) ;
26650 extern Boolean
26651 OTReadBuffer(
26652   OTBufferInfo * buffer,
26653   void * dest,
26654   OTByteCount * len) ;
26655 extern void
26656 OTReleaseBuffer(OTBuffer * buffer) ;
26657 extern OTResult
26658 OTSetFirstClearBit(
26659   UInt8 * bitMap,
26660   OTByteCount startBit,
26661   OTByteCount numBits) ;
26662 extern Boolean
26663 OTClearBit(
26664   UInt8 * bitMap,
26665   OTByteCount bitNo) ;
26666 extern Boolean
26667 OTSetBit(
26668   UInt8 * bitMap,
26669   OTByteCount bitNo) ;
26670 extern Boolean
26671 OTTestBit(
26672   UInt8 * bitMap,
26673   OTByteCount bitNo) ;
26674 typedef UInt32 ( * OTHashProcPtr)(OTLink * linkToHash);
26675 typedef Boolean ( * OTHashSearchProcPtr)(const void *ref, OTLink *linkToCheck);
26676 struct OTHashList {
26677   OTHashProcPtr fHashProc;
26678   ByteCount fHashTableSize;
26679   OTLink ** fHashBuckets;
26680
26681
26682
26683
26684
26685
26686     void Add(OTLink* toAdd);
26687
26688     Boolean RemoveLink(OTLink* toRemove);
26689
26690     OTLink* Remove(OTHashSearchProcPtr proc, const void* refPtr, UInt32 hashValue);
26691
26692     Boolean IsInList(OTLink* toFind);
26693
26694     OTLink* FindLink(OTHashSearchProcPtr proc, const void* refPtr, UInt32 hash);
26695
26696
26697
26698 };
26699 typedef struct OTHashList OTHashList;
26700 typedef Boolean ( * OTGateProcPtr)(OTLink * thisLink);
26701 struct OTGate {
26702   OTLIFO fLIFO;
26703   OTList fList;
26704   OTGateProcPtr fProc;
26705   SInt32 fNumQueued;
26706   SInt32 fInside;
26707 };
26708 typedef struct OTGate OTGate;
26709
26710
26711 }
26712 extern "C" {
26713
26714
26715
26716
26717 enum {
26718   kNSLMinSystemVersion = 0x0900,
26719   kNSLMinOTVersion = 0x0130
26720 };
26721
26722 enum {
26723   kNSLDefaultListSize = 256
26724 };
26725
26726 enum {
26727   kNSLURLDelimiter = ','
26728 };
26729
26730
26731
26732
26733 enum {
26734   kNSLNoContext = 0
26735 };
26736
26737 struct NSLError {
26738   OSStatus theErr;
26739   UInt32 theContext;
26740 };
26741 typedef struct NSLError NSLError;
26742 typedef NSLError * NSLErrorPtr;
26743 enum {
26744
26745
26746
26747
26748   kNSLDuplicateSearchInProgress = 100,
26749   kNSLUserCanceled = userCanceledErr,
26750
26751   kNSLInvalidEnumeratorRef = 0
26752 };
26753
26754 typedef UInt16 NSLSearchState;
26755 enum {
26756
26757   kNSLSearchStateBufferFull = 1,
26758   kNSLSearchStateOnGoing = 2,
26759   kNSLSearchStateComplete = 3,
26760   kNSLSearchStateStalled = 4,
26761   kNSLWaitingForContinue = 5
26762 };
26763
26764 typedef UInt32 NSLEventCode;
26765 enum {
26766
26767   kNSLServicesLookupDataEvent = 6,
26768   kNSLNeighborhoodLookupDataEvent = 7,
26769   kNSLNewDataEvent = 8,
26770   kNSLContinueLookupEvent = 9
26771 };
26772
26773
26774 typedef UInt32 NSLClientRef;
26775 typedef UInt32 NSLRequestRef;
26776 typedef UInt32 NSLOneBasedIndex;
26777 typedef char * NSLPath;
26778 typedef char * NSLServiceType;
26779 typedef Handle NSLServicesList;
26780 typedef unsigned char * NSLNeighborhood;
26781
26782
26783
26784
26785
26786
26787 struct NSLClientAsyncInfo {
26788   void * clientContextPtr;
26789   void * mgrContextPtr;
26790   char * resultBuffer;
26791   long bufferLen;
26792   long maxBufferSize;
26793   UInt32 startTime;
26794   UInt32 intStartTime;
26795   UInt32 maxSearchTime;
26796   UInt32 alertInterval;
26797   UInt32 totalItems;
26798   UInt32 alertThreshold;
26799   NSLSearchState searchState;
26800   NSLError searchResult;
26801   NSLEventCode searchDataType;
26802
26803 };
26804 typedef struct NSLClientAsyncInfo NSLClientAsyncInfo;
26805 typedef NSLClientAsyncInfo * NSLClientAsyncInfoPtr;
26806
26807
26808 struct NSLPluginAsyncInfo {
26809   void * mgrContextPtr;
26810   void * pluginContextPtr;
26811   void * pluginPtr;
26812   char * resultBuffer;
26813   long bufferLen;
26814   long maxBufferSize;
26815   UInt32 maxSearchTime;
26816   UInt32 reserved1;
26817   UInt32 reserved2;
26818   UInt32 reserved3;
26819   NSLClientRef clientRef;
26820   NSLRequestRef requestRef;
26821   NSLSearchState searchState;
26822   OSStatus searchResult;
26823 };
26824 typedef struct NSLPluginAsyncInfo NSLPluginAsyncInfo;
26825 typedef NSLPluginAsyncInfo * NSLPluginAsyncInfoPtr;
26826
26827
26828 typedef void ( * NSLMgrNotifyProcPtr)(NSLPluginAsyncInfo * thePluginAsyncInfo);
26829
26830
26831 typedef void ( * NSLClientNotifyProcPtr)(NSLClientAsyncInfo * theClientAsyncInfo);
26832 typedef NSLMgrNotifyProcPtr NSLMgrNotifyUPP;
26833 typedef NSLClientNotifyProcPtr NSLClientNotifyUPP;
26834 extern NSLMgrNotifyUPP
26835 NewNSLMgrNotifyUPP(NSLMgrNotifyProcPtr userRoutine) ;
26836 extern NSLClientNotifyUPP
26837 NewNSLClientNotifyUPP(NSLClientNotifyProcPtr userRoutine) ;
26838 extern void
26839 DisposeNSLMgrNotifyUPP(NSLMgrNotifyUPP userUPP) ;
26840 extern void
26841 DisposeNSLClientNotifyUPP(NSLClientNotifyUPP userUPP) ;
26842 extern void
26843 InvokeNSLMgrNotifyUPP(
26844   NSLPluginAsyncInfo * thePluginAsyncInfo,
26845   NSLMgrNotifyUPP userUPP) ;
26846 extern void
26847 InvokeNSLClientNotifyUPP(
26848   NSLClientAsyncInfo * theClientAsyncInfo,
26849   NSLClientNotifyUPP userUPP) ;
26850
26851
26852
26853
26854
26855
26856 struct NSLTypedData {
26857   unsigned long dataType;
26858   unsigned long lengthOfData;
26859
26860
26861 };
26862 typedef struct NSLTypedData NSLTypedData;
26863 typedef NSLTypedData * NSLTypedDataPtr;
26864
26865
26866
26867
26868
26869
26870
26871 struct NSLServicesListHeader {
26872   unsigned long numServices;
26873   unsigned long logicalLen;
26874
26875
26876 };
26877 typedef struct NSLServicesListHeader NSLServicesListHeader;
26878 typedef NSLServicesListHeader * NSLServicesListHeaderPtr;
26879 struct NSLPluginData {
26880   long reserved1;
26881   long reserved2;
26882   long reserved3;
26883   Boolean supportsRegistration;
26884   Boolean isPurgeable;
26885   UInt16 totalLen;
26886   UInt16 dataTypeOffset;
26887   UInt16 serviceListOffset;
26888   UInt16 protocolListOffset;
26889   UInt16 commentStringOffset;
26890
26891
26892 };
26893 typedef struct NSLPluginData NSLPluginData;
26894 typedef NSLPluginData * NSLPluginDataPtr;
26895 extern UInt32
26896 NSLLibraryVersion(void) ;
26897
26898
26899
26900
26901
26902      inline Boolean NSLLibraryPresent() { return NSLLibraryVersion != (void*)kUnresolvedCFragSymbolAddress; }
26903 extern NSLError
26904 NSLStandardRegisterURL(
26905   NSLPath urlToRegister,
26906   NSLNeighborhood neighborhoodToRegisterIn) ;
26907 extern NSLError
26908 NSLStandardDeregisterURL(
26909   NSLPath urlToDeregister,
26910   NSLNeighborhood neighborhoodToDeregisterIn) ;
26911 extern OSStatus
26912 NSLHexEncodeText(
26913   const char * rawText,
26914   UInt16 rawTextLen,
26915   char * newTextBuffer,
26916   UInt16 * newTextBufferLen,
26917   Boolean * textChanged) ;
26918 extern OSStatus
26919 NSLHexDecodeText(
26920   const char * encodedText,
26921   UInt16 encodedTextLen,
26922   char * decodedTextBuffer,
26923   UInt16 * decodedTextBufferLen,
26924   Boolean * textChanged) ;
26925 extern NSLServicesList
26926 NSLMakeNewServicesList(const char * initialServiceList) ;
26927 extern NSLError
26928 NSLAddServiceToServicesList(
26929   NSLServicesList serviceList,
26930   NSLServiceType serviceType) ;
26931 extern void
26932 NSLDisposeServicesList(NSLServicesList theList) ;
26933 extern NSLNeighborhood
26934 NSLMakeNewNeighborhood(
26935   const char * name,
26936   const char * protocolList) ;
26937 extern NSLNeighborhood
26938 NSLCopyNeighborhood(NSLNeighborhood neighborhood) ;
26939 extern NSLNeighborhood
26940 NSLFreeNeighborhood(NSLNeighborhood neighborhood) ;
26941 extern void
26942 NSLGetNameFromNeighborhood(
26943   NSLNeighborhood neighborhood,
26944   char ** name,
26945   long * length) ;
26946 extern OSStatus
26947 NSLMakeServicesRequestPB(
26948   NSLServicesList serviceList,
26949   NSLTypedDataPtr * newDataPtr) ;
26950 extern NSLTypedDataPtr
26951 NSLFreeTypedDataPtr(NSLTypedDataPtr nslTypeData) ;
26952 extern Boolean
26953 NSLGetNextUrl(
26954   NSLClientAsyncInfoPtr infoPtr,
26955   char ** urlPtr,
26956   long * urlLength) ;
26957 extern Boolean
26958 NSLGetNextNeighborhood(
26959   NSLClientAsyncInfoPtr infoPtr,
26960   NSLNeighborhood * neighborhood,
26961   long * neighborhoodLength) ;
26962 extern OSStatus
26963 NSLErrorToString(
26964   NSLError theErr,
26965   char * errorString,
26966   char * solutionString) ;
26967 extern OSStatus
26968 NSLOpenNavigationAPI(NSLClientRef * newRef) ;
26969 extern void
26970 NSLCloseNavigationAPI(NSLClientRef theClient) ;
26971 extern NSLError
26972 NSLPrepareRequest(
26973   NSLClientNotifyUPP notifier,
26974   void * contextPtr,
26975   NSLClientRef theClient,
26976   NSLRequestRef * ref,
26977   char * bufPtr,
26978   unsigned long bufLen,
26979   NSLClientAsyncInfoPtr * infoPtr) ;
26980 extern NSLError
26981 NSLStartNeighborhoodLookup(
26982   NSLRequestRef ref,
26983   NSLNeighborhood neighborhood,
26984   NSLClientAsyncInfo * asyncInfo) ;
26985 extern NSLError
26986 NSLStartServicesLookup(
26987   NSLRequestRef ref,
26988   NSLNeighborhood neighborhood,
26989   NSLTypedDataPtr requestData,
26990   NSLClientAsyncInfo * asyncInfo) ;
26991 extern NSLError
26992 NSLContinueLookup(NSLClientAsyncInfo * asyncInfo) ;
26993 extern NSLError
26994 NSLCancelRequest(NSLRequestRef ref) ;
26995 extern NSLError
26996 NSLDeleteRequest(NSLRequestRef ref) ;
26997 extern OSStatus
26998 NSLParseServicesRequestPB(
26999   NSLTypedDataPtr newDataPtr,
27000   char ** serviceListPtr,
27001   UInt16 * serviceListLen) ;
27002 extern OSStatus
27003 NSLParseServiceRegistrationPB(
27004   NSLTypedDataPtr newDataPtr,
27005   NSLNeighborhood * neighborhoodPtr,
27006   UInt16 * neighborhoodLen,
27007   char ** urlPtr,
27008   UInt16 * urlLen) ;
27009 extern OSStatus
27010 NSLGetErrorStringsFromResource(
27011   OSStatus theErr,
27012   const FSSpec * fileSpecPtr,
27013   SInt16 errorResID,
27014   char * errorString,
27015   char * solutionString) ;
27016 extern Boolean
27017 NSLServiceIsInServiceList(
27018   NSLServicesList serviceList,
27019   NSLServiceType svcToFind) ;
27020 extern OSStatus
27021 NSLGetServiceFromURL(
27022   char * theURL,
27023   char ** svcString,
27024   UInt16 * svcLen) ;
27025 extern long
27026 NSLGetNeighborhoodLength(NSLNeighborhood neighborhood) ;
27027 extern OSErr
27028 NSLNewThread(
27029   ThreadStyle threadStyle,
27030   ThreadEntryProcPtr threadEntry,
27031   void * threadParam,
27032   Size stackSize,
27033   ThreadOptions options,
27034   void ** threadResult,
27035   ThreadID * threadMade) ;
27036 extern OSErr
27037 NSLDisposeThread(
27038   ThreadID threadToDump,
27039   void * threadResult,
27040   Boolean recycleThread) ;
27041
27042
27043 }
27044 extern "C" {
27045
27046
27047
27048
27049
27050
27051 typedef struct OpaqueSecKeychainRef* SecKeychainRef;
27052 typedef struct OpaqueSecKeychainItemRef* SecKeychainItemRef;
27053 typedef struct OpaqueSecKeychainSearchRef* SecKeychainSearchRef;
27054 typedef OSType SecKeychainAttrType;
27055 typedef UInt32 SecKeychainStatus;
27056 struct SecKeychainAttribute {
27057   SecKeychainAttrType tag;
27058   UInt32 length;
27059   void * data;
27060 };
27061 typedef struct SecKeychainAttribute SecKeychainAttribute;
27062 typedef SecKeychainAttribute * SecKeychainAttributePtr;
27063 struct SecKeychainAttributeList {
27064   UInt32 count;
27065   SecKeychainAttribute * attr;
27066 };
27067 typedef struct SecKeychainAttributeList SecKeychainAttributeList;
27068
27069
27070 typedef SecKeychainRef KCRef;
27071 typedef SecKeychainItemRef KCItemRef;
27072 typedef SecKeychainSearchRef KCSearchRef;
27073 typedef SecKeychainAttribute KCAttribute;
27074 typedef SecKeychainAttributeList KCAttributeList;
27075 typedef SecKeychainAttrType KCAttrType;
27076 typedef SecKeychainStatus KCStatus;
27077 typedef UInt16 KCEvent;
27078 enum {
27079   kIdleKCEvent = 0,
27080   kLockKCEvent = 1,
27081   kUnlockKCEvent = 2,
27082   kAddKCEvent = 3,
27083   kDeleteKCEvent = 4,
27084   kUpdateKCEvent = 5,
27085   kPasswordChangedKCEvent = 6,
27086   kSystemKCEvent = 8,
27087   kDefaultChangedKCEvent = 9,
27088   kDataAccessKCEvent = 10,
27089   kKeychainListChangedKCEvent = 11
27090 };
27091
27092 typedef UInt16 KCEventMask;
27093 enum {
27094   kIdleKCEventMask = 1 << kIdleKCEvent,
27095   kLockKCEventMask = 1 << kLockKCEvent,
27096   kUnlockKCEventMask = 1 << kUnlockKCEvent,
27097   kAddKCEventMask = 1 << kAddKCEvent,
27098   kDeleteKCEventMask = 1 << kDeleteKCEvent,
27099   kUpdateKCEventMask = 1 << kUpdateKCEvent,
27100   kPasswordChangedKCEventMask = 1 << kPasswordChangedKCEvent,
27101   kSystemEventKCEventMask = 1 << kSystemKCEvent,
27102   kDefaultChangedKCEventMask = 1 << kDefaultChangedKCEvent,
27103   kDataAccessKCEventMask = 1 << kDataAccessKCEvent,
27104   kEveryKCEventMask = 0xFFFF
27105 };
27106
27107 typedef UInt8 AFPServerSignature[16];
27108 typedef UInt8 KCPublicKeyHash[20];
27109 struct KCCallbackInfo {
27110   UInt32 version;
27111   KCItemRef item;
27112   long processID[2];
27113   long event[4];
27114   KCRef keychain;
27115 };
27116 typedef struct KCCallbackInfo KCCallbackInfo;
27117 enum {
27118   kUnlockStateKCStatus = 1,
27119   kRdPermKCStatus = 2,
27120   kWrPermKCStatus = 4
27121 };
27122
27123
27124 enum {
27125   kCertificateKCItemClass = 'cert',
27126   kAppleSharePasswordKCItemClass = 'ashp',
27127   kInternetPasswordKCItemClass = 'inet',
27128   kGenericPasswordKCItemClass = 'genp'
27129 };
27130
27131
27132 typedef FourCharCode KCItemClass;
27133 enum {
27134
27135   kClassKCItemAttr = 'clas',
27136   kCreationDateKCItemAttr = 'cdat',
27137   kModDateKCItemAttr = 'mdat',
27138   kDescriptionKCItemAttr = 'desc',
27139   kCommentKCItemAttr = 'icmt',
27140   kCreatorKCItemAttr = 'crtr',
27141   kTypeKCItemAttr = 'type',
27142   kScriptCodeKCItemAttr = 'scrp',
27143   kLabelKCItemAttr = 'labl',
27144   kInvisibleKCItemAttr = 'invi',
27145   kNegativeKCItemAttr = 'nega',
27146   kCustomIconKCItemAttr = 'cusi',
27147   kAccountKCItemAttr = 'acct',
27148
27149   kServiceKCItemAttr = 'svce',
27150   kGenericKCItemAttr = 'gena',
27151
27152   kSecurityDomainKCItemAttr = 'sdmn',
27153   kServerKCItemAttr = 'srvr',
27154   kAuthTypeKCItemAttr = 'atyp',
27155   kPortKCItemAttr = 'port',
27156   kPathKCItemAttr = 'path',
27157
27158   kVolumeKCItemAttr = 'vlme',
27159   kAddressKCItemAttr = 'addr',
27160   kSignatureKCItemAttr = 'ssig',
27161
27162   kProtocolKCItemAttr = 'ptcl',
27163
27164   kSubjectKCItemAttr = 'subj',
27165   kCommonNameKCItemAttr = 'cn  ',
27166   kIssuerKCItemAttr = 'issu',
27167   kSerialNumberKCItemAttr = 'snbr',
27168   kEMailKCItemAttr = 'mail',
27169   kPublicKeyHashKCItemAttr = 'hpky',
27170   kIssuerURLKCItemAttr = 'iurl',
27171
27172   kEncryptKCItemAttr = 'encr',
27173   kDecryptKCItemAttr = 'decr',
27174   kSignKCItemAttr = 'sign',
27175   kVerifyKCItemAttr = 'veri',
27176   kWrapKCItemAttr = 'wrap',
27177   kUnwrapKCItemAttr = 'unwr',
27178   kStartDateKCItemAttr = 'sdat',
27179   kEndDateKCItemAttr = 'edat'
27180 };
27181
27182 typedef FourCharCode KCItemAttr;
27183 enum {
27184   kKCAuthTypeNTLM = 'ntlm',
27185   kKCAuthTypeMSN = 'msna',
27186   kKCAuthTypeDPA = 'dpaa',
27187   kKCAuthTypeRPA = 'rpaa',
27188   kKCAuthTypeHTTPDigest = 'httd',
27189   kKCAuthTypeDefault = 'dflt'
27190 };
27191
27192 typedef FourCharCode KCAuthType;
27193 enum {
27194   kKCProtocolTypeFTP = 'ftp ',
27195   kKCProtocolTypeFTPAccount = 'ftpa',
27196   kKCProtocolTypeHTTP = 'http',
27197   kKCProtocolTypeIRC = 'irc ',
27198   kKCProtocolTypeNNTP = 'nntp',
27199   kKCProtocolTypePOP3 = 'pop3',
27200   kKCProtocolTypeSMTP = 'smtp',
27201   kKCProtocolTypeSOCKS = 'sox ',
27202   kKCProtocolTypeIMAP = 'imap',
27203   kKCProtocolTypeLDAP = 'ldap',
27204   kKCProtocolTypeAppleTalk = 'atlk',
27205   kKCProtocolTypeAFP = 'afp ',
27206   kKCProtocolTypeTelnet = 'teln'
27207 };
27208
27209 typedef FourCharCode KCProtocolType;
27210 typedef UInt32 KCCertAddOptions;
27211 enum {
27212   kSecOptionReserved = 0x000000FF,
27213   kCertUsageShift = 8,
27214   kCertUsageSigningAdd = 1 << (kCertUsageShift + 0),
27215   kCertUsageSigningAskAndAdd = 1 << (kCertUsageShift + 1),
27216   kCertUsageVerifyAdd = 1 << (kCertUsageShift + 2),
27217   kCertUsageVerifyAskAndAdd = 1 << (kCertUsageShift + 3),
27218   kCertUsageEncryptAdd = 1 << (kCertUsageShift + 4),
27219   kCertUsageEncryptAskAndAdd = 1 << (kCertUsageShift + 5),
27220   kCertUsageDecryptAdd = 1 << (kCertUsageShift + 6),
27221   kCertUsageDecryptAskAndAdd = 1 << (kCertUsageShift + 7),
27222   kCertUsageKeyExchAdd = 1 << (kCertUsageShift + 8),
27223   kCertUsageKeyExchAskAndAdd = 1 << (kCertUsageShift + 9),
27224   kCertUsageRootAdd = 1 << (kCertUsageShift + 10),
27225   kCertUsageRootAskAndAdd = 1 << (kCertUsageShift + 11),
27226   kCertUsageSSLAdd = 1 << (kCertUsageShift + 12),
27227   kCertUsageSSLAskAndAdd = 1 << (kCertUsageShift + 13),
27228   kCertUsageAllAdd = 0x7FFFFF00
27229 };
27230
27231 typedef UInt16 KCVerifyStopOn;
27232 enum {
27233   kPolicyKCStopOn = 0,
27234   kNoneKCStopOn = 1,
27235   kFirstPassKCStopOn = 2,
27236   kFirstFailKCStopOn = 3
27237 };
27238
27239 typedef UInt32 KCCertSearchOptions;
27240 enum {
27241   kCertSearchShift = 0,
27242   kCertSearchSigningIgnored = 0,
27243   kCertSearchSigningAllowed = 1 << (kCertSearchShift + 0),
27244   kCertSearchSigningDisallowed = 1 << (kCertSearchShift + 1),
27245   kCertSearchSigningMask = ((kCertSearchSigningAllowed) | (kCertSearchSigningDisallowed)),
27246   kCertSearchVerifyIgnored = 0,
27247   kCertSearchVerifyAllowed = 1 << (kCertSearchShift + 2),
27248   kCertSearchVerifyDisallowed = 1 << (kCertSearchShift + 3),
27249   kCertSearchVerifyMask = ((kCertSearchVerifyAllowed) | (kCertSearchVerifyDisallowed)),
27250   kCertSearchEncryptIgnored = 0,
27251   kCertSearchEncryptAllowed = 1 << (kCertSearchShift + 4),
27252   kCertSearchEncryptDisallowed = 1 << (kCertSearchShift + 5),
27253   kCertSearchEncryptMask = ((kCertSearchEncryptAllowed) | (kCertSearchEncryptDisallowed)),
27254   kCertSearchDecryptIgnored = 0,
27255   kCertSearchDecryptAllowed = 1 << (kCertSearchShift + 6),
27256   kCertSearchDecryptDisallowed = 1 << (kCertSearchShift + 7),
27257   kCertSearchDecryptMask = ((kCertSearchDecryptAllowed) | (kCertSearchDecryptDisallowed)),
27258   kCertSearchWrapIgnored = 0,
27259   kCertSearchWrapAllowed = 1 << (kCertSearchShift + 8),
27260   kCertSearchWrapDisallowed = 1 << (kCertSearchShift + 9),
27261   kCertSearchWrapMask = ((kCertSearchWrapAllowed) | (kCertSearchWrapDisallowed)),
27262   kCertSearchUnwrapIgnored = 0,
27263   kCertSearchUnwrapAllowed = 1 << (kCertSearchShift + 10),
27264   kCertSearchUnwrapDisallowed = 1 << (kCertSearchShift + 11),
27265   kCertSearchUnwrapMask = ((kCertSearchUnwrapAllowed) | (kCertSearchUnwrapDisallowed)),
27266   kCertSearchPrivKeyRequired = 1 << (kCertSearchShift + 12),
27267   kCertSearchAny = 0
27268 };
27269
27270
27271 enum {
27272   kAnyPort = 0
27273 };
27274
27275 enum {
27276   kAnyProtocol = 0,
27277   kAnyAuthType = 0
27278 };
27279 extern OSStatus
27280 KCGetKeychainManagerVersion(UInt32 * returnVers);
27281     inline Boolean KeychainManagerAvailable() { return true; }
27282 extern OSStatus
27283 KCSetInteractionAllowed(Boolean state) ;
27284 extern Boolean
27285 KCIsInteractionAllowed(void) ;
27286 extern OSStatus
27287 KCMakeKCRefFromFSSpec(
27288   FSSpec * keychainFSSpec,
27289   KCRef * keychain) ;
27290 extern OSStatus
27291 KCMakeKCRefFromAlias(
27292   AliasHandle keychainAlias,
27293   KCRef * keychain) ;
27294 extern OSStatus
27295 KCMakeAliasFromKCRef(
27296   KCRef keychain,
27297   AliasHandle * keychainAlias) ;
27298 extern OSStatus
27299 KCReleaseKeychain(KCRef * keychain) ;
27300 extern OSStatus
27301 KCGetDefaultKeychain(KCRef * keychain) ;
27302 extern OSStatus
27303 KCSetDefaultKeychain(KCRef keychain) ;
27304 extern OSStatus
27305 KCGetStatus(
27306   KCRef keychain,
27307   UInt32 * keychainStatus) ;
27308 extern OSStatus
27309 KCGetKeychain(
27310   KCItemRef item,
27311   KCRef * keychain) ;
27312 extern OSStatus
27313 KCGetKeychainName(
27314   KCRef keychain,
27315   StringPtr keychainName) ;
27316 extern UInt16
27317 KCCountKeychains(void) ;
27318 extern OSStatus
27319 KCGetIndKeychain(
27320   UInt16 index,
27321   KCRef * keychain) ;
27322
27323
27324 typedef OSStatus ( * KCCallbackProcPtr)(KCEvent keychainEvent, KCCallbackInfo *info, void *userContext);
27325 typedef KCCallbackProcPtr KCCallbackUPP;
27326 extern KCCallbackUPP
27327 NewKCCallbackUPP(KCCallbackProcPtr userRoutine) ;
27328 extern void
27329 DisposeKCCallbackUPP(KCCallbackUPP userUPP) ;
27330 extern OSStatus
27331 InvokeKCCallbackUPP(
27332   KCEvent keychainEvent,
27333   KCCallbackInfo * info,
27334   void * userContext,
27335   KCCallbackUPP userUPP) ;
27336 extern OSStatus
27337 KCFindAppleSharePassword(
27338   AFPServerSignature * serverSignature,
27339   StringPtr serverAddress,
27340   StringPtr serverName,
27341   StringPtr volumeName,
27342   StringPtr accountName,
27343   UInt32 maxLength,
27344   void * passwordData,
27345   UInt32 * actualLength,
27346   KCItemRef * item) ;
27347 extern OSStatus
27348 KCFindInternetPassword(
27349   StringPtr serverName,
27350   StringPtr securityDomain,
27351   StringPtr accountName,
27352   UInt16 port,
27353   OSType protocol,
27354   OSType authType,
27355   UInt32 maxLength,
27356   void * passwordData,
27357   UInt32 * actualLength,
27358   KCItemRef * item) ;
27359 extern OSStatus
27360 KCFindInternetPasswordWithPath(
27361   StringPtr serverName,
27362   StringPtr securityDomain,
27363   StringPtr accountName,
27364   StringPtr path,
27365   UInt16 port,
27366   OSType protocol,
27367   OSType authType,
27368   UInt32 maxLength,
27369   void * passwordData,
27370   UInt32 * actualLength,
27371   KCItemRef * item) ;
27372 extern OSStatus
27373 KCFindGenericPassword(
27374   StringPtr serviceName,
27375   StringPtr accountName,
27376   UInt32 maxLength,
27377   void * passwordData,
27378   UInt32 * actualLength,
27379   KCItemRef * item) ;
27380 extern OSStatus
27381 KCAddCallback(
27382   KCCallbackUPP callbackProc,
27383   KCEventMask eventMask,
27384   void * userContext) ;
27385 extern OSStatus
27386 KCRemoveCallback(KCCallbackUPP callbackProc) ;
27387 extern OSStatus
27388 KCNewItem(
27389   KCItemClass itemClass,
27390   OSType itemCreator,
27391   UInt32 length,
27392   const void * data,
27393   KCItemRef * item) ;
27394 extern OSStatus
27395 KCSetAttribute(
27396   KCItemRef item,
27397   KCAttribute * attr) ;
27398 extern OSStatus
27399 KCGetAttribute(
27400   KCItemRef item,
27401   KCAttribute * attr,
27402   UInt32 * actualLength) ;
27403 extern OSStatus
27404 KCSetData(
27405   KCItemRef item,
27406   UInt32 length,
27407   const void * data) ;
27408 extern OSStatus
27409 KCUpdateItem(KCItemRef item) ;
27410 extern OSStatus
27411 KCReleaseItem(KCItemRef * item) ;
27412 extern OSStatus
27413 KCCopyItem(
27414   KCItemRef item,
27415   KCRef destKeychain,
27416   KCItemRef * copy) ;
27417 extern OSStatus
27418 KCFindFirstItem(
27419   KCRef keychain,
27420   const KCAttributeList * attrList,
27421   KCSearchRef * search,
27422   KCItemRef * item) ;
27423 extern OSStatus
27424 KCFindNextItem(
27425   KCSearchRef search,
27426   KCItemRef * item) ;
27427 extern OSStatus
27428 KCReleaseSearch(KCSearchRef * search) ;
27429 extern OSStatus
27430 KCDeleteItem(KCItemRef item) ;
27431 extern OSStatus
27432 KCGetData(
27433   KCItemRef item,
27434   UInt32 maxLength,
27435   void * data,
27436   UInt32 * actualLength) ;
27437 extern OSStatus
27438 KCLock(KCRef keychain) ;
27439 extern OSStatus
27440 kcgetkeychainname(
27441   KCRef keychain,
27442   char * keychainName) ;
27443 extern OSStatus
27444 kcfindapplesharepassword(
27445   AFPServerSignature * serverSignature,
27446   const char * serverAddress,
27447   const char * serverName,
27448   const char * volumeName,
27449   const char * accountName,
27450   UInt32 maxLength,
27451   void * passwordData,
27452   UInt32 * actualLength,
27453   KCItemRef * item) ;
27454 extern OSStatus
27455 kcfindinternetpassword(
27456   const char * serverName,
27457   const char * securityDomain,
27458   const char * accountName,
27459   UInt16 port,
27460   OSType protocol,
27461   OSType authType,
27462   UInt32 maxLength,
27463   void * passwordData,
27464   UInt32 * actualLength,
27465   KCItemRef * item) ;
27466 extern OSStatus
27467 kcfindinternetpasswordwithpath(
27468   const char * serverName,
27469   const char * securityDomain,
27470   const char * accountName,
27471   const char * path,
27472   UInt16 port,
27473   OSType protocol,
27474   OSType authType,
27475   UInt32 maxLength,
27476   void * passwordData,
27477   UInt32 * actualLength,
27478   KCItemRef * item) ;
27479 extern OSStatus
27480 kcfindgenericpassword(
27481   const char * serviceName,
27482   const char * accountName,
27483   UInt32 maxLength,
27484   void * passwordData,
27485   UInt32 * actualLength,
27486   KCItemRef * item) ;
27487
27488
27489
27490
27491
27492 }
27493
27494
27495
27496
27497
27498 extern double acos (double);
27499 extern double asin (double);
27500 extern double atan (double);
27501 extern double atan2 (double, double);
27502 extern double ceil (double);
27503 extern double cos (double);
27504 extern double cosh (double);
27505 extern double exp (double);
27506 extern double fabs (double);
27507 extern double floor (double);
27508 extern double fmod (double, double);
27509 extern double frexp (double, int *);
27510 extern double ldexp (double, int);
27511 extern double log10 (double);
27512 extern double log (double);
27513 extern double modf (double, double *);
27514 extern double pow (double, double);
27515 extern double sin (double);
27516 extern double sinh (double);
27517 extern double sqrt (double);
27518 extern double tan (double);
27519 extern double tanh (double);
27520
27521
27522
27523
27524
27525
27526
27527
27528
27529
27530 extern double acos (double);
27531 extern double asin (double);
27532 extern double atan (double);
27533 extern double atan2 (double, double);
27534 extern double ceil (double);
27535 extern double cos (double);
27536 extern double cosh (double);
27537 extern double exp (double);
27538 extern double fabs (double);
27539 extern double floor (double);
27540 extern double fmod (double, double);
27541 extern double frexp (double, int *);
27542 extern double ldexp (double, int);
27543 extern double log10 (double);
27544 extern double log (double);
27545 extern double modf (double, double *);
27546 extern double pow (double, double);
27547 extern double sin (double);
27548 extern double sinh (double);
27549 extern double sqrt (double);
27550 extern double tan (double);
27551 extern double tanh (double);
27552
27553
27554
27555 extern "C" {
27556
27557
27558
27559
27560
27561 extern const int kCFStreamErrorDomainSSL;
27562 extern const CFStringRef kCFStreamPropertySocketSecurityLevel;
27563 extern const CFStringRef kCFStreamSocketSecurityLevelNone;
27564 extern const CFStringRef kCFStreamSocketSecurityLevelSSLv2;
27565 extern const CFStringRef kCFStreamSocketSecurityLevelSSLv3;
27566 extern const CFStringRef kCFStreamSocketSecurityLevelTLSv1;
27567 extern const CFStringRef kCFStreamSocketSecurityLevelNegotiatedSSL;
27568
27569
27570
27571
27572
27573 extern const int kCFStreamErrorDomainSOCKS;
27574
27575
27576 static __inline__
27577 SInt32 CFSocketStreamSOCKSGetErrorSubdomain(CFStreamError* error) {
27578     return ((error->domain >> 16) & 0x0000FFFF);
27579 }
27580
27581 static __inline__
27582 SInt32 CFSocketStreamSOCKSGetError(CFStreamError* error) {
27583     return (error->domain & 0x0000FFFF);
27584 }
27585
27586
27587 enum {
27588         kCFStreamErrorSOCKSSubDomainNone = 0,
27589         kCFStreamErrorSOCKSSubDomainVersionCode,
27590         kCFStreamErrorSOCKS4SubDomainResponse,
27591         kCFStreamErrorSOCKS5SubDomainUserPass,
27592         kCFStreamErrorSOCKS5SubDomainMethod,
27593     kCFStreamErrorSOCKS5SubDomainResponse
27594 };
27595
27596 enum {
27597
27598         kCFStreamErrorSOCKS5BadResponseAddr = 1,
27599         kCFStreamErrorSOCKS5BadState,
27600         kCFStreamErrorSOCKSUnknownClientVersion,
27601
27602
27603         kCFStreamErrorSOCKS4RequestFailed = 91,
27604         kCFStreamErrorSOCKS4IdentdFailed = 92,
27605         kCFStreamErrorSOCKS4IdConflict = 93,
27606
27607
27608         kSOCKS5NoAcceptableMethod = 0xFF
27609 };
27610 extern const CFStringRef kCFStreamPropertySOCKSProxy;
27611 extern const CFStringRef kCFStreamPropertySOCKSProxyHost;
27612 extern const CFStringRef kCFStreamPropertySOCKSProxyPort;
27613 extern const CFStringRef kCFStreamPropertySOCKSVersion;
27614 extern const CFStringRef kCFStreamSocketSOCKSVersion4;
27615 extern const CFStringRef kCFStreamSocketSOCKSVersion5;
27616 extern const CFStringRef kCFStreamPropertySOCKSUser;
27617 extern const CFStringRef kCFStreamPropertySOCKSPassword;
27618 extern const CFStringRef kCFStreamPropertyShouldCloseNativeSocket;
27619 typedef enum {
27620     kCFStreamSocketSecurityNone = 0,
27621     kCFStreamSocketSecuritySSLv2,
27622     kCFStreamSocketSecuritySSLv3,
27623     kCFStreamSocketSecuritySSLv23,
27624     kCFStreamSocketSecurityTLSv1
27625 } CFStreamSocketSecurityProtocol;
27626 extern
27627 Boolean CFSocketStreamPairSetSecurityProtocol(CFReadStreamRef socketReadStream, CFWriteStreamRef socketWriteStream, CFStreamSocketSecurityProtocol securityProtocol);
27628
27629
27630
27631 }
27632 extern "C" {
27633
27634
27635 extern const CFStringRef kCFHTTPVersion1_0;
27636 extern const CFStringRef kCFHTTPVersion1_1;
27637 extern const CFStringRef kCFHTTPAuthenticationSchemeBasic;
27638 extern const CFStringRef kCFHTTPAuthenticationSchemeDigest;
27639
27640 typedef struct __CFHTTPMessage * CFHTTPMessageRef;
27641
27642 extern
27643 CFTypeID CFHTTPMessageGetTypeID(void);
27644
27645 extern
27646 CFHTTPMessageRef CFHTTPMessageCreateRequest(CFAllocatorRef allocator, CFStringRef requestMethod, CFURLRef url, CFStringRef httpVersion);
27647
27648
27649 extern
27650 CFHTTPMessageRef CFHTTPMessageCreateResponse(CFAllocatorRef allocator, int statusCode, CFStringRef statusDescription, CFStringRef httpVersion);
27651
27652
27653 extern
27654 CFHTTPMessageRef CFHTTPMessageCreateEmpty(CFAllocatorRef allocator, Boolean isRequest);
27655
27656 extern
27657 CFHTTPMessageRef CFHTTPMessageCreateCopy(CFAllocatorRef allocator, CFHTTPMessageRef message);
27658
27659
27660 extern
27661 Boolean CFHTTPMessageIsRequest(CFHTTPMessageRef message);
27662
27663 extern
27664 CFStringRef CFHTTPMessageCopyVersion(CFHTTPMessageRef message);
27665
27666 extern
27667 CFDataRef CFHTTPMessageCopyBody(CFHTTPMessageRef message);
27668
27669 extern
27670 void CFHTTPMessageSetBody(CFHTTPMessageRef message, CFDataRef bodyData);
27671
27672 extern
27673 CFStringRef CFHTTPMessageCopyHeaderFieldValue(CFHTTPMessageRef message, CFStringRef headerField);
27674
27675 extern
27676 CFDictionaryRef CFHTTPMessageCopyAllHeaderFields(CFHTTPMessageRef message);
27677
27678 extern
27679 void CFHTTPMessageSetHeaderFieldValue(CFHTTPMessageRef message, CFStringRef headerField, CFStringRef value);
27680
27681
27682 extern
27683 Boolean CFHTTPMessageAppendBytes(CFHTTPMessageRef message, const UInt8 *newBytes, CFIndex numBytes);
27684
27685
27686 extern
27687 Boolean CFHTTPMessageIsHeaderComplete(CFHTTPMessageRef message);
27688
27689 extern
27690 CFDataRef CFHTTPMessageCopySerializedMessage(CFHTTPMessageRef request);
27691
27692
27693 extern
27694 CFURLRef CFHTTPMessageCopyRequestURL(CFHTTPMessageRef request);
27695
27696 extern
27697 CFStringRef CFHTTPMessageCopyRequestMethod(CFHTTPMessageRef request);
27698
27699
27700
27701
27702
27703
27704 extern
27705 Boolean CFHTTPMessageAddAuthentication(CFHTTPMessageRef request, CFHTTPMessageRef authenticationFailureResponse, CFStringRef username, CFStringRef password, CFStringRef authenticationScheme, Boolean forProxy);
27706
27707
27708
27709 extern
27710 UInt32 CFHTTPMessageGetResponseStatusCode(CFHTTPMessageRef response);
27711
27712 extern
27713 CFStringRef CFHTTPMessageCopyResponseStatusLine(CFHTTPMessageRef response);
27714
27715
27716 }
27717 extern "C" {
27718
27719
27720 extern
27721 const SInt32 kCFStreamErrorDomainHTTP;
27722
27723 typedef enum {
27724     kCFStreamErrorHTTPParseFailure = -1,
27725     kCFStreamErrorHTTPRedirectionLoop = -2,
27726     kCFStreamErrorHTTPBadURL = -3
27727 } CFStreamErrorHTTP;
27728
27729
27730
27731
27732 extern
27733 const CFStringRef kCFStreamPropertyHTTPResponseHeader;
27734
27735
27736 extern
27737 const CFStringRef kCFStreamPropertyHTTPFinalURL;
27738
27739
27740
27741
27742
27743
27744
27745 extern const CFStringRef kCFStreamPropertyHTTPProxy;
27746
27747 extern const CFStringRef kCFStreamPropertyHTTPProxyHost;
27748 extern const CFStringRef kCFStreamPropertyHTTPProxyPort;
27749 extern const CFStringRef kCFStreamPropertyHTTPSProxyHost;
27750 extern const CFStringRef kCFStreamPropertyHTTPSProxyPort;
27751
27752
27753
27754 extern
27755 const CFStringRef kCFStreamPropertyHTTPShouldAutoredirect;
27756
27757
27758 extern
27759 const CFStringRef kCFStreamPropertyHTTPAttemptPersistentConnection;
27760
27761
27762
27763
27764 extern
27765 CFReadStreamRef CFReadStreamCreateForHTTPRequest(CFAllocatorRef alloc, CFHTTPMessageRef request);
27766
27767
27768 extern
27769 CFReadStreamRef CFReadStreamCreateForStreamedHTTPRequest(CFAllocatorRef alloc, CFHTTPMessageRef requestHeaders, CFReadStreamRef requestBody);
27770
27771 extern
27772 void CFHTTPReadStreamSetRedirectsAutomatically(CFReadStreamRef httpStream, Boolean shouldAutoRedirect);
27773
27774 extern
27775 void CFHTTPReadStreamSetProxy(CFReadStreamRef httpStream, CFStringRef proxyHost, CFIndex proxyPort);
27776
27777
27778 }
27779 extern "C" {
27780 extern
27781 const SInt32 kCFStreamErrorDomainNetServices;
27782
27783 extern
27784 const SInt32 kCFStreamErrorDomainMach;
27785
27786
27787 typedef enum {
27788     kCFNetServicesErrorUnknown = -72000,
27789         kCFNetServicesErrorCollision = -72001,
27790         kCFNetServicesErrorNotFound = -72002,
27791         kCFNetServicesErrorInProgress = -72003,
27792         kCFNetServicesErrorBadArgument = -72004,
27793     kCFNetServicesErrorCancel = -72005,
27794     kCFNetServicesErrorInvalid = -72006
27795 } CFNetServicesError;
27796
27797
27798
27799 enum {
27800         kCFNetServiceFlagMoreComing = 1,
27801         kCFNetServiceFlagIsDomain = 2,
27802         kCFNetServiceFlagIsRegistrationDomain = 4,
27803     kCFNetServiceFlagRemove = 8
27804 };
27805
27806
27807 typedef struct {
27808     CFIndex version;
27809     void *info;
27810     void *(*retain)(void *info);
27811     void (*release)(void *info);
27812     CFStringRef (*copyDescription)(void *info);
27813 } CFNetServiceClientContext;
27814
27815
27816 typedef struct __CFNetService* CFNetServiceRef;
27817 typedef void (*CFNetServiceClientCallBack)(CFNetServiceRef theService, CFStreamError* error, void* info);
27818
27819 typedef struct __CFNetServiceBrowser* CFNetServiceBrowserRef;
27820 typedef void (*CFNetServiceBrowserClientCallBack)(CFNetServiceBrowserRef browser, CFOptionFlags flags, CFTypeRef domainOrService, CFStreamError* error, void* info);
27821
27822
27823 extern
27824 CFTypeID CFNetServiceGetTypeID(void);
27825
27826 extern
27827 CFTypeID CFNetServiceBrowserGetTypeID(void);
27828 extern
27829 CFNetServiceRef CFNetServiceCreate(CFAllocatorRef alloc,
27830                                                                    CFStringRef domain,
27831                                                                    CFStringRef type,
27832                                                                    CFStringRef name,
27833                                                                    UInt32 port);
27834 extern
27835 CFStringRef CFNetServiceGetDomain(CFNetServiceRef theService);
27836 extern
27837 CFStringRef CFNetServiceGetType(CFNetServiceRef theService);
27838 extern
27839 CFStringRef CFNetServiceGetName(CFNetServiceRef theService);
27840 extern
27841 CFArrayRef CFNetServiceGetAddressing(CFNetServiceRef theService);
27842 extern
27843 CFStringRef CFNetServiceGetProtocolSpecificInformation(CFNetServiceRef theService);
27844 extern
27845 void CFNetServiceSetProtocolSpecificInformation(CFNetServiceRef theService, CFStringRef theInfo);
27846 extern
27847 Boolean CFNetServiceRegister(CFNetServiceRef theService, CFStreamError* error);
27848 extern
27849 Boolean CFNetServiceResolve(CFNetServiceRef theService, CFStreamError* error);
27850 extern
27851 void CFNetServiceCancel(CFNetServiceRef theService);
27852 extern
27853 Boolean CFNetServiceSetClient(CFNetServiceRef theService,
27854                                                           CFNetServiceClientCallBack clientCB,
27855                                                           CFNetServiceClientContext* clientContext);
27856 extern
27857 void CFNetServiceScheduleWithRunLoop(CFNetServiceRef theService,
27858                                                                          CFRunLoopRef runLoop,
27859                                                                          CFStringRef runLoopMode);
27860 extern
27861 void CFNetServiceUnscheduleFromRunLoop(CFNetServiceRef theService,
27862                                                                            CFRunLoopRef runLoop,
27863                                                                            CFStringRef runLoopMode);
27864 extern
27865 CFNetServiceBrowserRef CFNetServiceBrowserCreate(CFAllocatorRef alloc,
27866                                                                                                  CFNetServiceBrowserClientCallBack clientCB,
27867                                                                                                  CFNetServiceClientContext* clientContext);
27868 extern
27869 void CFNetServiceBrowserInvalidate(CFNetServiceBrowserRef browser);
27870 extern
27871 Boolean CFNetServiceBrowserSearchForDomains(CFNetServiceBrowserRef browser,
27872                                                                                         Boolean registrationDomains,
27873                                             CFStreamError* error);
27874 extern
27875 Boolean CFNetServiceBrowserSearchForServices(CFNetServiceBrowserRef browser,
27876                                                                                          CFStringRef domain,
27877                                                                                          CFStringRef type,
27878                                                                                          CFStreamError* error);
27879 extern
27880 void CFNetServiceBrowserStopSearch(CFNetServiceBrowserRef browser, CFStreamError* error);
27881 extern
27882 void CFNetServiceBrowserScheduleWithRunLoop(CFNetServiceBrowserRef browser,
27883                                                                                     CFRunLoopRef runLoop,
27884                                                                                     CFStringRef runLoopMode);
27885 extern
27886 void CFNetServiceBrowserUnscheduleFromRunLoop(CFNetServiceBrowserRef browser,
27887                                                                                           CFRunLoopRef runLoop,
27888                                                                                           CFStringRef runLoopMode);
27889
27890
27891
27892
27893 }
27894
27895
27896
27897
27898
27899
27900
27901
27902
27903 extern double acos (double);
27904 extern double asin (double);
27905 extern double atan (double);
27906 extern double atan2 (double, double);
27907 extern double ceil (double);
27908 extern double cos (double);
27909 extern double cosh (double);
27910 extern double exp (double);
27911 extern double fabs (double);
27912 extern double floor (double);
27913 extern double fmod (double, double);
27914 extern double frexp (double, int *);
27915 extern double ldexp (double, int);
27916 extern double log10 (double);
27917 extern double log (double);
27918 extern double modf (double, double *);
27919 extern double pow (double, double);
27920 extern double sin (double);
27921 extern double sinh (double);
27922 extern double sqrt (double);
27923 extern double tan (double);
27924 extern double tanh (double);
27925
27926
27927
27928
27929
27930
27931 extern "C" {
27932
27933
27934
27935
27936
27937
27938
27939 enum {
27940   errWSInternalError = -65793L,
27941   errWSTransportError = -65794L,
27942   errWSParseError = -65795L,
27943   errWSTimeoutError = -65796L
27944 };
27945 enum WSTypeID {
27946
27947
27948
27949
27950   eWSUnknownType = 0,
27951
27952
27953
27954
27955   eWSNullType = 1,
27956
27957
27958
27959
27960   eWSBooleanType = 2,
27961
27962
27963
27964
27965   eWSIntegerType = 3,
27966
27967
27968
27969
27970   eWSDoubleType = 4,
27971
27972
27973
27974
27975   eWSStringType = 5,
27976
27977
27978
27979
27980   eWSDateType = 6,
27981
27982
27983
27984
27985   eWSDataType = 7,
27986
27987
27988
27989
27990   eWSArrayType = 8,
27991
27992
27993
27994
27995   eWSDictionaryType = 9
27996 };
27997 typedef enum WSTypeID WSTypeID;
27998 extern WSTypeID
27999 WSGetWSTypeIDFromCFType(CFTypeRef ref) ;
28000 extern CFTypeID
28001 WSGetCFTypeIDFromWSTypeID(WSTypeID typeID) ;
28002
28003
28004 typedef void * ( * WSClientContextRetainCallBackProcPtr)(void * info);
28005 typedef void ( * WSClientContextReleaseCallBackProcPtr)(void * info);
28006 typedef CFStringRef ( * WSClientContextCopyDescriptionCallBackProcPtr)(void * info);
28007 struct WSClientContext {
28008
28009
28010
28011
28012   CFIndex version;
28013
28014
28015
28016
28017   void * info;
28018
28019
28020
28021
28022   WSClientContextRetainCallBackProcPtr retain;
28023
28024
28025
28026
28027   WSClientContextReleaseCallBackProcPtr release;
28028
28029
28030
28031
28032   WSClientContextCopyDescriptionCallBackProcPtr copyDescription;
28033 };
28034 typedef struct WSClientContext WSClientContext;
28035 extern CFStringRef kWSXMLRPCProtocol;
28036 extern CFStringRef kWSSOAP1999Protocol;
28037 extern CFStringRef kWSSOAP2001Protocol;
28038 extern CFStringRef kWSMethodInvocationResult;
28039
28040
28041
28042 extern CFStringRef kWSFaultString;
28043 extern CFStringRef kWSFaultCode;
28044 extern CFStringRef kWSFaultExtra;
28045 extern CFStringRef kWSNetworkStreamFaultString;
28046 extern CFStringRef kWSStreamErrorMessage;
28047 extern CFStringRef kWSStreamErrorDomain;
28048 extern CFStringRef kWSStreamErrorError;
28049 extern CFStringRef kWSHTTPMessage;
28050 extern CFStringRef kWSHTTPResponseMessage;
28051
28052
28053
28054
28055
28056 extern CFStringRef kWSHTTPVersion;
28057 extern CFStringRef kWSHTTPExtraHeaders;
28058 extern CFStringRef kWSHTTPProxy;
28059 extern CFStringRef kWSHTTPFollowsRedirects;
28060 extern CFStringRef kWSDebugOutgoingHeaders;
28061 extern CFStringRef kWSDebugOutgoingBody;
28062 extern CFStringRef kWSDebugIncomingHeaders;
28063 extern CFStringRef kWSDebugIncomingBody;
28064
28065
28066
28067
28068
28069 extern CFStringRef kWSSOAPMethodNamespaceURI;
28070 extern CFStringRef kWSSOAPBodyEncodingStyle;
28071 extern CFStringRef kWSSOAPStyleDoc;
28072 extern CFStringRef kWSSOAPStyleRPC;
28073
28074
28075
28076
28077
28078
28079
28080 extern CFStringRef kWSSOAPMessageHeaders;
28081
28082
28083
28084
28085
28086 extern CFStringRef kWSRecordParameterOrder;
28087 extern CFStringRef kWSRecordNamespaceURI;
28088 extern CFStringRef kWSRecordType;
28089
28090
28091
28092
28093
28094 extern CFStringRef kWSMethodInvocationResultParameterName;
28095
28096
28097
28098
28099
28100
28101 extern CFStringRef kWSMethodInvocationTimeoutValue;
28102 typedef struct OpaqueWSMethodInvocationRef* WSMethodInvocationRef;
28103 extern CFTypeID
28104 WSMethodInvocationGetTypeID(void) ;
28105 extern WSMethodInvocationRef
28106 WSMethodInvocationCreate(
28107   CFURLRef url,
28108   CFStringRef methodName,
28109   CFStringRef protocol) ;
28110 extern WSMethodInvocationRef
28111 WSMethodInvocationCreateFromSerialization(CFDataRef contract) ;
28112 extern CFDataRef
28113 WSMethodInvocationCopySerialization(WSMethodInvocationRef invocation) ;
28114 extern void
28115 WSMethodInvocationSetParameters(
28116   WSMethodInvocationRef invocation,
28117   CFDictionaryRef parameters,
28118   CFArrayRef parameterOrder) ;
28119 extern CFDictionaryRef
28120 WSMethodInvocationCopyParameters(
28121   WSMethodInvocationRef invocation,
28122   CFArrayRef * parameterOrder) ;
28123 extern void
28124 WSMethodInvocationSetProperty(
28125   WSMethodInvocationRef invocation,
28126   CFStringRef propertyName,
28127   CFTypeRef propertyValue) ;
28128 extern CFTypeRef
28129 WSMethodInvocationCopyProperty(
28130   WSMethodInvocationRef invocation,
28131   CFStringRef propertyName) ;
28132 extern CFDictionaryRef
28133 WSMethodInvocationInvoke(WSMethodInvocationRef invocation) ;
28134 typedef void ( * WSMethodInvocationCallBackProcPtr)(WSMethodInvocationRef invocation, void *info, CFDictionaryRef outRef);
28135 extern void
28136 WSMethodInvocationSetCallBack(
28137   WSMethodInvocationRef invocation,
28138   WSMethodInvocationCallBackProcPtr clientCB,
28139   WSClientContext * context) ;
28140 extern void
28141 WSMethodInvocationScheduleWithRunLoop(
28142   WSMethodInvocationRef invocation,
28143   CFRunLoopRef runLoop,
28144   CFStringRef runLoopMode) ;
28145 extern void
28146 WSMethodInvocationUnscheduleFromRunLoop(
28147   WSMethodInvocationRef invocation,
28148   CFRunLoopRef runLoop,
28149   CFStringRef runLoopMode) ;
28150 extern Boolean
28151 WSMethodResultIsFault(CFDictionaryRef methodResult) ;
28152 typedef CFStringRef ( * WSMethodInvocationSerializationProcPtr)(WSMethodInvocationRef invocation, CFTypeRef obj, void *info);
28153 extern void
28154 WSMethodInvocationAddSerializationOverride(
28155   WSMethodInvocationRef invocation,
28156   CFTypeID objType,
28157   WSMethodInvocationSerializationProcPtr serializationProc,
28158   WSClientContext * context) ;
28159 typedef CFTypeRef ( * WSMethodInvocationDeserializationProcPtr)(WSMethodInvocationRef invocation, CFXMLTreeRef msgRoot, CFXMLTreeRef deserializeRoot, void *info);
28160 extern void
28161 WSMethodInvocationAddDeserializationOverride(
28162   WSMethodInvocationRef invocation,
28163   CFStringRef typeNamespace,
28164   CFStringRef typeName,
28165   WSMethodInvocationDeserializationProcPtr deserializationProc,
28166   WSClientContext * context) ;
28167
28168
28169
28170
28171
28172
28173
28174
28175
28176 }
28177
28178
28179
28180 enum {
28181   kAllTypographicFeaturesType = 0,
28182   kLigaturesType = 1,
28183   kCursiveConnectionType = 2,
28184   kLetterCaseType = 3,
28185   kVerticalSubstitutionType = 4,
28186   kLinguisticRearrangementType = 5,
28187   kNumberSpacingType = 6,
28188   kSmartSwashType = 8,
28189   kDiacriticsType = 9,
28190   kVerticalPositionType = 10,
28191   kFractionsType = 11,
28192   kOverlappingCharactersType = 13,
28193   kTypographicExtrasType = 14,
28194   kMathematicalExtrasType = 15,
28195   kOrnamentSetsType = 16,
28196   kCharacterAlternativesType = 17,
28197   kDesignComplexityType = 18,
28198   kStyleOptionsType = 19,
28199   kCharacterShapeType = 20,
28200   kNumberCaseType = 21,
28201   kTextSpacingType = 22,
28202   kTransliterationType = 23,
28203   kAnnotationType = 24,
28204   kKanaSpacingType = 25,
28205   kIdeographicSpacingType = 26,
28206   kUnicodeDecompositionType = 27,
28207   kRubyKanaType = 28,
28208   kCJKSymbolAlternativesType = 29,
28209   kIdeographicAlternativesType = 30,
28210   kCJKVerticalRomanPlacementType = 31,
28211   kItalicCJKRomanType = 32,
28212   kCJKRomanSpacingType = 103,
28213   kLastFeatureType = -1
28214 };
28215
28216
28217
28218
28219
28220
28221 enum {
28222   kAllTypeFeaturesOnSelector = 0,
28223   kAllTypeFeaturesOffSelector = 1
28224 };
28225
28226
28227
28228
28229
28230
28231
28232 enum {
28233   kRequiredLigaturesOnSelector = 0,
28234   kRequiredLigaturesOffSelector = 1,
28235   kCommonLigaturesOnSelector = 2,
28236   kCommonLigaturesOffSelector = 3,
28237   kRareLigaturesOnSelector = 4,
28238   kRareLigaturesOffSelector = 5,
28239   kLogosOnSelector = 6,
28240   kLogosOffSelector = 7,
28241   kRebusPicturesOnSelector = 8,
28242   kRebusPicturesOffSelector = 9,
28243   kDiphthongLigaturesOnSelector = 10,
28244   kDiphthongLigaturesOffSelector = 11,
28245   kSquaredLigaturesOnSelector = 12,
28246   kSquaredLigaturesOffSelector = 13,
28247   kAbbrevSquaredLigaturesOnSelector = 14,
28248   kAbbrevSquaredLigaturesOffSelector = 15,
28249   kSymbolLigaturesOnSelector = 16,
28250   kSymbolLigaturesOffSelector = 17
28251 };
28252
28253
28254
28255
28256
28257
28258 enum {
28259   kUnconnectedSelector = 0,
28260   kPartiallyConnectedSelector = 1,
28261   kCursiveSelector = 2
28262 };
28263
28264
28265
28266
28267
28268
28269 enum {
28270   kUpperAndLowerCaseSelector = 0,
28271   kAllCapsSelector = 1,
28272   kAllLowerCaseSelector = 2,
28273   kSmallCapsSelector = 3,
28274   kInitialCapsSelector = 4,
28275   kInitialCapsAndSmallCapsSelector = 5
28276 };
28277
28278
28279
28280
28281
28282
28283 enum {
28284   kSubstituteVerticalFormsOnSelector = 0,
28285   kSubstituteVerticalFormsOffSelector = 1
28286 };
28287
28288
28289
28290
28291
28292
28293 enum {
28294   kLinguisticRearrangementOnSelector = 0,
28295   kLinguisticRearrangementOffSelector = 1
28296 };
28297
28298
28299
28300
28301
28302
28303 enum {
28304   kMonospacedNumbersSelector = 0,
28305   kProportionalNumbersSelector = 1,
28306   kThirdWidthNumbersSelector = 2,
28307   kQuarterWidthNumbersSelector = 3
28308 };
28309
28310
28311
28312
28313
28314
28315 enum {
28316   kWordInitialSwashesOnSelector = 0,
28317   kWordInitialSwashesOffSelector = 1,
28318   kWordFinalSwashesOnSelector = 2,
28319   kWordFinalSwashesOffSelector = 3,
28320   kLineInitialSwashesOnSelector = 4,
28321   kLineInitialSwashesOffSelector = 5,
28322   kLineFinalSwashesOnSelector = 6,
28323   kLineFinalSwashesOffSelector = 7,
28324   kNonFinalSwashesOnSelector = 8,
28325   kNonFinalSwashesOffSelector = 9
28326 };
28327
28328
28329
28330
28331
28332
28333 enum {
28334   kShowDiacriticsSelector = 0,
28335   kHideDiacriticsSelector = 1,
28336   kDecomposeDiacriticsSelector = 2
28337 };
28338
28339
28340
28341
28342
28343
28344 enum {
28345   kNormalPositionSelector = 0,
28346   kSuperiorsSelector = 1,
28347   kInferiorsSelector = 2,
28348   kOrdinalsSelector = 3
28349 };
28350
28351
28352
28353
28354
28355
28356 enum {
28357   kNoFractionsSelector = 0,
28358   kVerticalFractionsSelector = 1,
28359   kDiagonalFractionsSelector = 2
28360 };
28361
28362
28363
28364
28365
28366
28367 enum {
28368   kPreventOverlapOnSelector = 0,
28369   kPreventOverlapOffSelector = 1
28370 };
28371
28372
28373
28374
28375
28376
28377 enum {
28378   kHyphensToEmDashOnSelector = 0,
28379   kHyphensToEmDashOffSelector = 1,
28380   kHyphenToEnDashOnSelector = 2,
28381   kHyphenToEnDashOffSelector = 3,
28382   kSlashedZeroOnSelector = 4,
28383   kSlashedZeroOffSelector = 5,
28384   kFormInterrobangOnSelector = 6,
28385   kFormInterrobangOffSelector = 7,
28386   kSmartQuotesOnSelector = 8,
28387   kSmartQuotesOffSelector = 9,
28388   kPeriodsToEllipsisOnSelector = 10,
28389   kPeriodsToEllipsisOffSelector = 11
28390 };
28391
28392
28393
28394
28395
28396
28397 enum {
28398   kHyphenToMinusOnSelector = 0,
28399   kHyphenToMinusOffSelector = 1,
28400   kAsteriskToMultiplyOnSelector = 2,
28401   kAsteriskToMultiplyOffSelector = 3,
28402   kSlashToDivideOnSelector = 4,
28403   kSlashToDivideOffSelector = 5,
28404   kInequalityLigaturesOnSelector = 6,
28405   kInequalityLigaturesOffSelector = 7,
28406   kExponentsOnSelector = 8,
28407   kExponentsOffSelector = 9
28408 };
28409
28410
28411
28412
28413
28414
28415 enum {
28416   kNoOrnamentsSelector = 0,
28417   kDingbatsSelector = 1,
28418   kPiCharactersSelector = 2,
28419   kFleuronsSelector = 3,
28420   kDecorativeBordersSelector = 4,
28421   kInternationalSymbolsSelector = 5,
28422   kMathSymbolsSelector = 6
28423 };
28424
28425
28426
28427
28428
28429
28430 enum {
28431   kNoAlternatesSelector = 0
28432 };
28433
28434
28435
28436
28437
28438
28439 enum {
28440   kDesignLevel1Selector = 0,
28441   kDesignLevel2Selector = 1,
28442   kDesignLevel3Selector = 2,
28443   kDesignLevel4Selector = 3,
28444   kDesignLevel5Selector = 4
28445 };
28446
28447
28448
28449
28450
28451
28452 enum {
28453   kNoStyleOptionsSelector = 0,
28454   kDisplayTextSelector = 1,
28455   kEngravedTextSelector = 2,
28456   kIlluminatedCapsSelector = 3,
28457   kTitlingCapsSelector = 4,
28458   kTallCapsSelector = 5
28459 };
28460
28461
28462
28463
28464
28465
28466 enum {
28467   kTraditionalCharactersSelector = 0,
28468   kSimplifiedCharactersSelector = 1,
28469   kJIS1978CharactersSelector = 2,
28470   kJIS1983CharactersSelector = 3,
28471   kJIS1990CharactersSelector = 4,
28472   kTraditionalAltOneSelector = 5,
28473   kTraditionalAltTwoSelector = 6,
28474   kTraditionalAltThreeSelector = 7,
28475   kTraditionalAltFourSelector = 8,
28476   kTraditionalAltFiveSelector = 9,
28477   kExpertCharactersSelector = 10
28478 };
28479
28480
28481
28482
28483
28484
28485 enum {
28486   kLowerCaseNumbersSelector = 0,
28487   kUpperCaseNumbersSelector = 1
28488 };
28489
28490
28491
28492
28493
28494
28495 enum {
28496   kProportionalTextSelector = 0,
28497   kMonospacedTextSelector = 1,
28498   kHalfWidthTextSelector = 2
28499 };
28500
28501
28502
28503
28504
28505
28506 enum {
28507   kNoTransliterationSelector = 0,
28508   kHanjaToHangulSelector = 1,
28509   kHiraganaToKatakanaSelector = 2,
28510   kKatakanaToHiraganaSelector = 3,
28511   kKanaToRomanizationSelector = 4,
28512   kRomanizationToHiraganaSelector = 5,
28513   kRomanizationToKatakanaSelector = 6,
28514   kHanjaToHangulAltOneSelector = 7,
28515   kHanjaToHangulAltTwoSelector = 8,
28516   kHanjaToHangulAltThreeSelector = 9
28517 };
28518
28519
28520
28521
28522
28523
28524 enum {
28525   kNoAnnotationSelector = 0,
28526   kBoxAnnotationSelector = 1,
28527   kRoundedBoxAnnotationSelector = 2,
28528   kCircleAnnotationSelector = 3,
28529   kInvertedCircleAnnotationSelector = 4,
28530   kParenthesisAnnotationSelector = 5,
28531   kPeriodAnnotationSelector = 6,
28532   kRomanNumeralAnnotationSelector = 7,
28533   kDiamondAnnotationSelector = 8,
28534   kInvertedBoxAnnotationSelector = 9,
28535   kInvertedRoundedBoxAnnotationSelector = 10
28536 };
28537
28538
28539
28540
28541
28542
28543 enum {
28544   kFullWidthKanaSelector = 0,
28545   kProportionalKanaSelector = 1
28546 };
28547
28548
28549
28550
28551
28552
28553 enum {
28554   kFullWidthIdeographsSelector = 0,
28555   kProportionalIdeographsSelector = 1,
28556   kHalfWidthIdeographsSelector = 2
28557 };
28558
28559
28560
28561
28562
28563
28564 enum {
28565   kCanonicalCompositionOnSelector = 0,
28566   kCanonicalCompositionOffSelector = 1,
28567   kCompatibilityCompositionOnSelector = 2,
28568   kCompatibilityCompositionOffSelector = 3,
28569   kTranscodingCompositionOnSelector = 4,
28570   kTranscodingCompositionOffSelector = 5
28571 };
28572
28573
28574
28575
28576
28577
28578 enum {
28579   kNoRubyKanaSelector = 0,
28580   kRubyKanaSelector = 1
28581 };
28582
28583
28584
28585
28586
28587
28588 enum {
28589   kNoCJKSymbolAlternativesSelector = 0,
28590   kCJKSymbolAltOneSelector = 1,
28591   kCJKSymbolAltTwoSelector = 2,
28592   kCJKSymbolAltThreeSelector = 3,
28593   kCJKSymbolAltFourSelector = 4,
28594   kCJKSymbolAltFiveSelector = 5
28595 };
28596
28597
28598
28599
28600
28601
28602 enum {
28603   kNoIdeographicAlternativesSelector = 0,
28604   kIdeographicAltOneSelector = 1,
28605   kIdeographicAltTwoSelector = 2,
28606   kIdeographicAltThreeSelector = 3,
28607   kIdeographicAltFourSelector = 4,
28608   kIdeographicAltFiveSelector = 5
28609 };
28610
28611
28612
28613
28614
28615
28616 enum {
28617   kCJKVerticalRomanCenteredSelector = 0,
28618   kCJKVerticalRomanHBaselineSelector = 1
28619 };
28620
28621
28622
28623
28624
28625
28626 enum {
28627   kNoCJKItalicRomanSelector = 0,
28628   kCJKItalicRomanSelector = 1
28629 };
28630
28631
28632
28633
28634
28635
28636 enum {
28637   kHalfWidthCJKRomanSelector = 0,
28638   kProportionalCJKRomanSelector = 1,
28639   kDefaultCJKRomanSelector = 2,
28640   kFullWidthCJKRomanSelector = 3
28641 };
28642
28643
28644
28645
28646
28647 enum {
28648   kSFNTLookupSimpleArray = 0,
28649   kSFNTLookupSegmentSingle = 2,
28650   kSFNTLookupSegmentArray = 4,
28651   kSFNTLookupSingleTable = 6,
28652   kSFNTLookupTrimmedArray = 8
28653 };
28654
28655 typedef UInt16 SFNTLookupTableFormat;
28656 typedef UInt16 SFNTLookupValue;
28657 typedef UInt16 SFNTLookupOffset;
28658 typedef UInt32 SFNTLookupKind;
28659
28660
28661
28662
28663
28664
28665 struct SFNTLookupBinarySearchHeader {
28666   UInt16 unitSize;
28667   UInt16 nUnits;
28668   UInt16 searchRange;
28669   UInt16 entrySelector;
28670   UInt16 rangeShift;
28671 };
28672 typedef struct SFNTLookupBinarySearchHeader SFNTLookupBinarySearchHeader;
28673
28674 struct SFNTLookupArrayHeader {
28675   SFNTLookupValue lookupValues[1];
28676 };
28677 typedef struct SFNTLookupArrayHeader SFNTLookupArrayHeader;
28678
28679 struct SFNTLookupTrimmedArrayHeader {
28680   UInt16 firstGlyph;
28681   UInt16 count;
28682   SFNTLookupValue valueArray[1];
28683 };
28684 typedef struct SFNTLookupTrimmedArrayHeader SFNTLookupTrimmedArrayHeader;
28685
28686
28687
28688
28689
28690
28691 struct SFNTLookupSegment {
28692   UInt16 lastGlyph;
28693   UInt16 firstGlyph;
28694   UInt16 value[1];
28695 };
28696 typedef struct SFNTLookupSegment SFNTLookupSegment;
28697 struct SFNTLookupSegmentHeader {
28698   SFNTLookupBinarySearchHeader binSearch;
28699   SFNTLookupSegment segments[1];
28700 };
28701 typedef struct SFNTLookupSegmentHeader SFNTLookupSegmentHeader;
28702
28703 struct SFNTLookupSingle {
28704   UInt16 glyph;
28705   UInt16 value[1];
28706 };
28707 typedef struct SFNTLookupSingle SFNTLookupSingle;
28708 struct SFNTLookupSingleHeader {
28709   SFNTLookupBinarySearchHeader binSearch;
28710   SFNTLookupSingle entries[1];
28711 };
28712 typedef struct SFNTLookupSingleHeader SFNTLookupSingleHeader;
28713
28714 union SFNTLookupFormatSpecificHeader {
28715   SFNTLookupArrayHeader theArray;
28716   SFNTLookupSegmentHeader segment;
28717   SFNTLookupSingleHeader single;
28718   SFNTLookupTrimmedArrayHeader trimmedArray;
28719 };
28720 typedef union SFNTLookupFormatSpecificHeader SFNTLookupFormatSpecificHeader;
28721
28722 struct SFNTLookupTable {
28723   SFNTLookupTableFormat format;
28724   SFNTLookupFormatSpecificHeader fsHeader;
28725 };
28726 typedef struct SFNTLookupTable SFNTLookupTable;
28727 typedef SFNTLookupTable * SFNTLookupTablePtr;
28728 typedef SFNTLookupTablePtr * SFNTLookupTableHandle;
28729
28730
28731 enum {
28732   kSTClassEndOfText = 0,
28733   kSTClassOutOfBounds = 1,
28734   kSTClassDeletedGlyph = 2,
28735   kSTClassEndOfLine = 3,
28736   kSTSetMark = 0x8000,
28737   kSTNoAdvance = 0x4000,
28738   kSTMarkEnd = 0x2000,
28739   kSTLigActionMask = 0x3FFF,
28740   kSTRearrVerbMask = 0x000F
28741 };
28742
28743 typedef UInt8 STClass;
28744 typedef UInt8 STEntryIndex;
28745 struct STHeader {
28746   UInt8 filler;
28747   STClass nClasses;
28748   UInt16 classTableOffset;
28749   UInt16 stateArrayOffset;
28750   UInt16 entryTableOffset;
28751 };
28752 typedef struct STHeader STHeader;
28753 struct STClassTable {
28754   UInt16 firstGlyph;
28755   UInt16 nGlyphs;
28756   STClass classes[1];
28757 };
28758 typedef struct STClassTable STClassTable;
28759 struct STEntryZero {
28760   UInt16 newState;
28761   UInt16 flags;
28762 };
28763 typedef struct STEntryZero STEntryZero;
28764 struct STEntryOne {
28765   UInt16 newState;
28766   UInt16 flags;
28767   UInt16 offset1;
28768 };
28769 typedef struct STEntryOne STEntryOne;
28770 struct STEntryTwo {
28771   UInt16 newState;
28772   UInt16 flags;
28773   UInt16 offset1;
28774   UInt16 offset2;
28775 };
28776 typedef struct STEntryTwo STEntryTwo;
28777
28778
28779 enum {
28780   kSTXHasLigAction = 0x2000
28781 };
28782
28783
28784 typedef UInt16 STXClass;
28785 typedef UInt16 STXStateIndex;
28786 typedef UInt16 STXEntryIndex;
28787 struct STXHeader {
28788   UInt32 nClasses;
28789   UInt32 classTableOffset;
28790   UInt32 stateArrayOffset;
28791   UInt32 entryTableOffset;
28792 };
28793 typedef struct STXHeader STXHeader;
28794
28795 typedef SFNTLookupTable STXClassTable;
28796 struct STXEntryZero {
28797   STXStateIndex newState;
28798   UInt16 flags;
28799 };
28800 typedef struct STXEntryZero STXEntryZero;
28801 struct STXEntryOne {
28802   STXStateIndex newState;
28803   UInt16 flags;
28804   UInt16 index1;
28805 };
28806 typedef struct STXEntryOne STXEntryOne;
28807 struct STXEntryTwo {
28808   STXStateIndex newState;
28809   UInt16 flags;
28810   UInt16 index1;
28811   UInt16 index2;
28812 };
28813 typedef struct STXEntryTwo STXEntryTwo;
28814
28815
28816
28817 enum {
28818   kLCARTag = 0x6C636172,
28819   kLCARCurrentVersion = 0x00010000,
28820   kLCARLinearFormat = 0,
28821   kLCARCtlPointFormat = 1
28822 };
28823
28824
28825 struct LcarCaretClassEntry {
28826   UInt16 count;
28827   UInt16 partials[1];
28828 };
28829 typedef struct LcarCaretClassEntry LcarCaretClassEntry;
28830 struct LcarCaretTable {
28831   Fixed version;
28832   UInt16 format;
28833   SFNTLookupTable lookup;
28834 };
28835 typedef struct LcarCaretTable LcarCaretTable;
28836 typedef LcarCaretTable * LcarCaretTablePtr;
28837
28838
28839
28840 enum {
28841   kJUSTTag = 0x6A757374,
28842   kJUSTCurrentVersion = 0x00010000,
28843   kJUSTStandardFormat = 0,
28844   kJUSTnoGlyphcode = 0xFFFF,
28845   kJUSTpcDecompositionAction = 0,
28846   kJUSTpcUnconditionalAddAction = 1,
28847   kJUSTpcConditionalAddAction = 2,
28848   kJUSTpcGlyphStretchAction = 3,
28849   kJUSTpcDuctilityAction = 4,
28850   kJUSTpcGlyphRepeatAddAction = 5
28851 };
28852
28853
28854 enum {
28855   kJUSTKashidaPriority = 0,
28856   kJUSTSpacePriority = 1,
28857   kJUSTLetterPriority = 2,
28858   kJUSTNullPriority = 3,
28859   kJUSTPriorityCount = 4
28860 };
28861
28862
28863 enum {
28864   kJUSTOverridePriority = 0x8000,
28865   kJUSTOverrideLimits = 0x4000,
28866   kJUSTOverrideUnlimited = 0x2000,
28867   kJUSTUnlimited = 0x1000,
28868   kJUSTPriorityMask = 0x0003
28869 };
28870
28871
28872 typedef UInt16 JustPCActionType;
28873 typedef UInt16 JustificationFlags;
28874
28875 struct JustPCDecompositionAction {
28876   Fixed lowerLimit;
28877   Fixed upperLimit;
28878   UInt16 order;
28879   UInt16 count;
28880   UInt16 glyphs[1];
28881 };
28882 typedef struct JustPCDecompositionAction JustPCDecompositionAction;
28883
28884
28885 typedef UInt16 JustPCUnconditionalAddAction;
28886
28887
28888
28889
28890
28891 struct JustPCConditionalAddAction {
28892   Fixed substThreshhold;
28893   UInt16 addGlyph;
28894   UInt16 substGlyph;
28895 };
28896 typedef struct JustPCConditionalAddAction JustPCConditionalAddAction;
28897
28898 struct JustPCDuctilityAction {
28899   UInt32 ductilityAxis;
28900   Fixed minimumLimit;
28901   Fixed noStretchValue;
28902   Fixed maximumLimit;
28903 };
28904 typedef struct JustPCDuctilityAction JustPCDuctilityAction;
28905
28906
28907
28908
28909
28910 struct JustPCGlyphRepeatAddAction {
28911   UInt16 flags;
28912   UInt16 glyph;
28913 };
28914 typedef struct JustPCGlyphRepeatAddAction JustPCGlyphRepeatAddAction;
28915
28916 struct JustPCActionSubrecord {
28917   UInt16 theClass;
28918   JustPCActionType theType;
28919   UInt32 length;
28920   UInt32 data;
28921 };
28922 typedef struct JustPCActionSubrecord JustPCActionSubrecord;
28923
28924 struct JustPCAction {
28925   UInt32 actionCount;
28926   JustPCActionSubrecord actions[1];
28927 };
28928 typedef struct JustPCAction JustPCAction;
28929
28930
28931
28932
28933 struct JustWidthDeltaEntry {
28934   UInt32 justClass;
28935   Fixed beforeGrowLimit;
28936   Fixed beforeShrinkLimit;
28937   Fixed afterGrowLimit;
28938   Fixed afterShrinkLimit;
28939   JustificationFlags growFlags;
28940   JustificationFlags shrinkFlags;
28941 };
28942 typedef struct JustWidthDeltaEntry JustWidthDeltaEntry;
28943 struct JustWidthDeltaGroup {
28944   UInt32 count;
28945   JustWidthDeltaEntry entries[1];
28946 };
28947 typedef struct JustWidthDeltaGroup JustWidthDeltaGroup;
28948
28949 struct JustPostcompTable {
28950   SFNTLookupTable lookupTable;
28951
28952 };
28953 typedef struct JustPostcompTable JustPostcompTable;
28954 struct JustDirectionTable {
28955   UInt16 justClass;
28956   UInt16 widthDeltaClusters;
28957   UInt16 postcomp;
28958   SFNTLookupTable lookup;
28959 };
28960 typedef struct JustDirectionTable JustDirectionTable;
28961 struct JustTable {
28962   Fixed version;
28963   UInt16 format;
28964   UInt16 horizHeaderOffset;
28965   UInt16 vertHeaderOffset;
28966 };
28967 typedef struct JustTable JustTable;
28968
28969
28970
28971 enum {
28972   kOPBDTag = 0x6F706264,
28973   kOPBDCurrentVersion = 0x00010000,
28974   kOPBDDistanceFormat = 0,
28975   kOPBDControlPointFormat = 1
28976 };
28977
28978
28979
28980 typedef UInt16 OpbdTableFormat;
28981
28982
28983
28984
28985
28986 struct OpbdSideValues {
28987   SInt16 leftSideShift;
28988   SInt16 topSideShift;
28989   SInt16 rightSideShift;
28990   SInt16 bottomSideShift;
28991 };
28992 typedef struct OpbdSideValues OpbdSideValues;
28993 struct OpbdTable {
28994   Fixed version;
28995   OpbdTableFormat format;
28996   SFNTLookupTable lookupTable;
28997 };
28998 typedef struct OpbdTable OpbdTable;
28999
29000
29001
29002 enum {
29003   kMORTTag = 0x6D6F7274,
29004   kMORTCurrentVersion = 0x00010000,
29005
29006   kMORTCoverVertical = 0x8000,
29007   kMORTCoverDescending = 0x4000,
29008   kMORTCoverIgnoreVertical = 0x2000,
29009   kMORTCoverTypeMask = 0x000F,
29010   kMORTRearrangementType = 0,
29011   kMORTContextualType = 1,
29012   kMORTLigatureType = 2,
29013   kMORTSwashType = 4,
29014   kMORTInsertionType = 5,
29015   kMORTLigLastAction = (long)0x80000000,
29016   kMORTLigStoreLigature = 0x40000000,
29017   kMORTLigFormOffsetMask = 0x3FFFFFFF,
29018   kMORTLigFormOffsetShift = 2,
29019   kMORTraNoAction = 0,
29020   kMORTraxA = 1,
29021   kMORTraDx = 2,
29022   kMORTraDxA = 3,
29023   kMORTraxAB = 4,
29024   kMORTraxBA = 5,
29025   kMORTraCDx = 6,
29026   kMORTraDCx = 7,
29027   kMORTraCDxA = 8,
29028   kMORTraDCxA = 9,
29029   kMORTraDxAB = 10,
29030   kMORTraDxBA = 11,
29031   kMORTraCDxAB = 12,
29032   kMORTraCDxBA = 13,
29033   kMORTraDCxAB = 14,
29034   kMORTraDCxBA = 15,
29035
29036   kMORTDoInsertionsBefore = 0x80,
29037   kMORTIsSplitVowelPiece = 0x40,
29038   kMORTInsertionsCountMask = 0x3F,
29039   kMORTCurrInsertKashidaLike = 0x2000,
29040   kMORTMarkInsertKashidaLike = 0x1000,
29041   kMORTCurrInsertBefore = 0x0800,
29042   kMORTMarkInsertBefore = 0x0400,
29043   kMORTMarkJustTableCountMask = 0x3F80,
29044   kMORTMarkJustTableCountShift = 7,
29045   kMORTCurrJustTableCountMask = 0x007F,
29046   kMORTCurrJustTableCountShift = 0,
29047   kMORTCurrInsertCountMask = 0x03E0,
29048   kMORTCurrInsertCountShift = 5,
29049   kMORTMarkInsertCountMask = 0x001F,
29050   kMORTMarkInsertCountShift = 0
29051 };
29052
29053
29054
29055 typedef UInt32 MortSubtableMaskFlags;
29056 typedef UInt32 MortLigatureActionEntry;
29057 struct MortRearrangementSubtable {
29058   STHeader header;
29059 };
29060 typedef struct MortRearrangementSubtable MortRearrangementSubtable;
29061 struct MortContextualSubtable {
29062   STHeader header;
29063   UInt16 substitutionTableOffset;
29064 };
29065 typedef struct MortContextualSubtable MortContextualSubtable;
29066 struct MortLigatureSubtable {
29067   STHeader header;
29068   UInt16 ligatureActionTableOffset;
29069   UInt16 componentTableOffset;
29070   UInt16 ligatureTableOffset;
29071 };
29072 typedef struct MortLigatureSubtable MortLigatureSubtable;
29073 struct MortSwashSubtable {
29074   SFNTLookupTable lookup;
29075 };
29076 typedef struct MortSwashSubtable MortSwashSubtable;
29077 struct MortInsertionSubtable {
29078   STHeader header;
29079 };
29080 typedef struct MortInsertionSubtable MortInsertionSubtable;
29081 union MortSpecificSubtable {
29082   MortRearrangementSubtable rearrangement;
29083   MortContextualSubtable contextual;
29084   MortLigatureSubtable ligature;
29085   MortSwashSubtable swash;
29086   MortInsertionSubtable insertion;
29087 };
29088 typedef union MortSpecificSubtable MortSpecificSubtable;
29089 struct MortSubtable {
29090   UInt16 length;
29091   UInt16 coverage;
29092   MortSubtableMaskFlags flags;
29093   MortSpecificSubtable u;
29094 };
29095 typedef struct MortSubtable MortSubtable;
29096 struct MortFeatureEntry {
29097   UInt16 featureType;
29098   UInt16 featureSelector;
29099   MortSubtableMaskFlags enableFlags;
29100   MortSubtableMaskFlags disableFlags;
29101 };
29102 typedef struct MortFeatureEntry MortFeatureEntry;
29103 struct MortChain {
29104   MortSubtableMaskFlags defaultFlags;
29105   UInt32 length;
29106   UInt16 nFeatures;
29107   UInt16 nSubtables;
29108   MortFeatureEntry featureEntries[1];
29109
29110 };
29111 typedef struct MortChain MortChain;
29112 struct MortTable {
29113   Fixed version;
29114   UInt32 nChains;
29115   MortChain chains[1];
29116 };
29117 typedef struct MortTable MortTable;
29118
29119
29120
29121 enum {
29122   kMORXTag = 0x6D6F7278,
29123   kMORXCurrentVersion = 0x00020000,
29124
29125   kMORXCoverVertical = (long)0x80000000,
29126   kMORXCoverDescending = 0x40000000,
29127   kMORXCoverIgnoreVertical = 0x20000000,
29128   kMORXCoverTypeMask = 0x000000FF
29129 };
29130
29131
29132 struct MorxRearrangementSubtable {
29133   STXHeader header;
29134 };
29135 typedef struct MorxRearrangementSubtable MorxRearrangementSubtable;
29136 struct MorxContextualSubtable {
29137   STXHeader header;
29138   UInt32 substitutionTableOffset;
29139 };
29140 typedef struct MorxContextualSubtable MorxContextualSubtable;
29141 struct MorxLigatureSubtable {
29142   STXHeader header;
29143   UInt32 ligatureActionTableOffset;
29144   UInt32 componentTableOffset;
29145   UInt32 ligatureTableOffset;
29146 };
29147 typedef struct MorxLigatureSubtable MorxLigatureSubtable;
29148 struct MorxInsertionSubtable {
29149   STXHeader header;
29150   UInt32 insertionGlyphTableOffset;
29151 };
29152 typedef struct MorxInsertionSubtable MorxInsertionSubtable;
29153 union MorxSpecificSubtable {
29154   MorxRearrangementSubtable rearrangement;
29155   MorxContextualSubtable contextual;
29156   MorxLigatureSubtable ligature;
29157   MortSwashSubtable swash;
29158   MorxInsertionSubtable insertion;
29159 };
29160 typedef union MorxSpecificSubtable MorxSpecificSubtable;
29161 struct MorxSubtable {
29162   UInt32 length;
29163   UInt32 coverage;
29164   MortSubtableMaskFlags flags;
29165   MorxSpecificSubtable u;
29166 };
29167 typedef struct MorxSubtable MorxSubtable;
29168 struct MorxChain {
29169   MortSubtableMaskFlags defaultFlags;
29170   UInt32 length;
29171   UInt32 nFeatures;
29172   UInt32 nSubtables;
29173   MortFeatureEntry featureEntries[1];
29174
29175 };
29176 typedef struct MorxChain MorxChain;
29177 struct MorxTable {
29178   Fixed version;
29179   UInt32 nChains;
29180   MorxChain chains[1];
29181 };
29182 typedef struct MorxTable MorxTable;
29183
29184
29185
29186 enum {
29187   kPROPTag = 0x70726F70,
29188   kPROPCurrentVersion = 0x00030000,
29189   kPROPPairOffsetShift = 8,
29190   kPROPPairOffsetSign = 7,
29191   kPROPIsFloaterMask = 0x8000,
29192   kPROPCanHangLTMask = 0x4000,
29193   kPROPCanHangRBMask = 0x2000,
29194   kPROPUseRLPairMask = 0x1000,
29195   kPROPPairOffsetMask = 0x0F00,
29196   kPROPRightConnectMask = 0x0080,
29197   kPROPZeroReserved = 0x0060,
29198   kPROPDirectionMask = 0x001F
29199 };
29200
29201
29202 enum {
29203   kPROPLDirectionClass = 0,
29204   kPROPRDirectionClass = 1,
29205   kPROPALDirectionClass = 2,
29206   kPROPENDirectionClass = 3,
29207   kPROPESDirectionClass = 4,
29208   kPROPETDirectionClass = 5,
29209   kPROPANDirectionClass = 6,
29210   kPROPCSDirectionClass = 7,
29211   kPROPPSDirectionClass = 8,
29212   kPROPSDirectionClass = 9,
29213   kPROPWSDirectionClass = 10,
29214   kPROPONDirectionClass = 11,
29215   kPROPSENDirectionClass = 12,
29216   kPROPLREDirectionClass = 13,
29217   kPROPLRODirectionClass = 14,
29218   kPROPRLEDirectionClass = 15,
29219   kPROPRLODirectionClass = 16,
29220   kPROPPDFDirectionClass = 17,
29221   kPROPNSMDirectionClass = 18,
29222   kPROPBNDirectionClass = 19,
29223   kPROPNumDirectionClasses = 20
29224 };
29225
29226
29227
29228 typedef UInt16 PropCharProperties;
29229 struct PropTable {
29230   Fixed version;
29231   UInt16 format;
29232   PropCharProperties defaultProps;
29233   SFNTLookupTable lookup;
29234 };
29235 typedef struct PropTable PropTable;
29236 struct PropLookupSegment {
29237   UInt16 lastGlyph;
29238   UInt16 firstGlyph;
29239   UInt16 value;
29240 };
29241 typedef struct PropLookupSegment PropLookupSegment;
29242 struct PropLookupSingle {
29243   UInt16 glyph;
29244   PropCharProperties props;
29245 };
29246 typedef struct PropLookupSingle PropLookupSingle;
29247
29248
29249
29250 enum {
29251   kTRAKTag = 0x7472616B,
29252   kTRAKCurrentVersion = 0x00010000,
29253   kTRAKUniformFormat = 0
29254 };
29255
29256
29257
29258 typedef SInt16 TrakValue;
29259 struct TrakTableEntry {
29260   Fixed track;
29261   UInt16 nameTableIndex;
29262   UInt16 sizesOffset;
29263 };
29264 typedef struct TrakTableEntry TrakTableEntry;
29265 struct TrakTableData {
29266   UInt16 nTracks;
29267   UInt16 nSizes;
29268   UInt32 sizeTableOffset;
29269   TrakTableEntry trakTable[1];
29270 };
29271 typedef struct TrakTableData TrakTableData;
29272 struct TrakTable {
29273   Fixed version;
29274   UInt16 format;
29275   UInt16 horizOffset;
29276   UInt16 vertOffset;
29277 };
29278 typedef struct TrakTable TrakTable;
29279
29280
29281
29282 enum {
29283   kKERNTag = 0x6B65726E,
29284   kKERNCurrentVersion = 0x00010000,
29285   kKERNVertical = 0x8000,
29286   kKERNResetCrossStream = 0x8000,
29287   kKERNCrossStream = 0x4000,
29288   kKERNVariation = 0x2000,
29289   kKERNUnusedBits = 0x1F00,
29290   kKERNFormatMask = 0x00FF
29291 };
29292
29293 enum {
29294   kKERNOrderedList = 0,
29295   kKERNStateTable = 1,
29296   kKERNSimpleArray = 2,
29297   kKERNIndexArray = 3
29298 };
29299
29300
29301 enum {
29302   kKERNLineStart = 0x00000001,
29303   kKERNLineEndKerning = 0x00000002,
29304   kKERNNoCrossKerning = 0x00000004,
29305   kKERNNotesRequested = 0x00000008,
29306   kKERNNoStakeNote = 1,
29307   kKERNCrossStreamResetNote = 2,
29308   kKERNNotApplied = 0x00000001
29309 };
29310
29311
29312
29313 typedef UInt8 KernTableFormat;
29314 typedef UInt16 KernSubtableInfo;
29315 typedef SInt16 KernKerningValue;
29316 typedef UInt16 KernArrayOffset;
29317
29318 struct KernVersion0Header {
29319   UInt16 version;
29320   UInt16 nTables;
29321   UInt16 firstSubtable[1];
29322 };
29323 typedef struct KernVersion0Header KernVersion0Header;
29324
29325 struct KernTableHeader {
29326   Fixed version;
29327   SInt32 nTables;
29328   UInt16 firstSubtable[1];
29329 };
29330 typedef struct KernTableHeader KernTableHeader;
29331 typedef KernTableHeader * KernTableHeaderPtr;
29332 typedef KernTableHeaderPtr * KernTableHeaderHandle;
29333 struct KernKerningPair {
29334   UInt16 left;
29335   UInt16 right;
29336 };
29337 typedef struct KernKerningPair KernKerningPair;
29338
29339 struct KernOrderedListEntry {
29340   KernKerningPair pair;
29341   KernKerningValue value;
29342 };
29343 typedef struct KernOrderedListEntry KernOrderedListEntry;
29344 typedef KernOrderedListEntry * KernOrderedListEntryPtr;
29345
29346 struct KernOrderedListHeader {
29347   UInt16 nPairs;
29348   UInt16 searchRange;
29349   UInt16 entrySelector;
29350   UInt16 rangeShift;
29351   UInt16 table[1];
29352 };
29353 typedef struct KernOrderedListHeader KernOrderedListHeader;
29354
29355 struct KernStateHeader {
29356   STHeader header;
29357   UInt16 valueTable;
29358   UInt8 firstTable[1];
29359 };
29360 typedef struct KernStateHeader KernStateHeader;
29361 struct KernStateEntry {
29362   UInt16 newState;
29363   UInt16 flags;
29364 };
29365 typedef struct KernStateEntry KernStateEntry;
29366
29367
29368
29369
29370
29371
29372 struct KernOffsetTable {
29373   UInt16 firstGlyph;
29374   UInt16 nGlyphs;
29375   KernArrayOffset offsetTable[1];
29376 };
29377 typedef struct KernOffsetTable KernOffsetTable;
29378 typedef KernOffsetTable * KernOffsetTablePtr;
29379 struct KernSimpleArrayHeader {
29380   UInt16 rowWidth;
29381   UInt16 leftOffsetTable;
29382   UInt16 rightOffsetTable;
29383   KernArrayOffset theArray;
29384   UInt16 firstTable[1];
29385 };
29386 typedef struct KernSimpleArrayHeader KernSimpleArrayHeader;
29387
29388 struct KernIndexArrayHeader {
29389   UInt16 glyphCount;
29390   UInt8 kernValueCount;
29391   UInt8 leftClassCount;
29392   UInt8 rightClassCount;
29393   UInt8 flags;
29394   SInt16 kernValue[1];
29395   UInt8 leftClass[1];
29396   UInt8 rightClass[1];
29397   UInt8 kernIndex[1];
29398 };
29399 typedef struct KernIndexArrayHeader KernIndexArrayHeader;
29400
29401 union KernFormatSpecificHeader {
29402   KernOrderedListHeader orderedList;
29403   KernStateHeader stateTable;
29404   KernSimpleArrayHeader simpleArray;
29405   KernIndexArrayHeader indexArray;
29406 };
29407 typedef union KernFormatSpecificHeader KernFormatSpecificHeader;
29408
29409 struct KernVersion0SubtableHeader {
29410   UInt16 version;
29411   UInt16 length;
29412   KernSubtableInfo stInfo;
29413   KernFormatSpecificHeader fsHeader;
29414 };
29415 typedef struct KernVersion0SubtableHeader KernVersion0SubtableHeader;
29416
29417 struct KernSubtableHeader {
29418   SInt32 length;
29419   KernSubtableInfo stInfo;
29420   SInt16 tupleIndex;
29421   KernFormatSpecificHeader fsHeader;
29422 };
29423 typedef struct KernSubtableHeader KernSubtableHeader;
29424 typedef KernSubtableHeader * KernSubtableHeaderPtr;
29425
29426
29427
29428 enum {
29429   kBSLNTag = 0x62736C6E,
29430   kBSLNCurrentVersion = 0x00010000,
29431   kBSLNDistanceFormatNoMap = 0,
29432   kBSLNDistanceFormatWithMap = 1,
29433   kBSLNControlPointFormatNoMap = 2,
29434   kBSLNControlPointFormatWithMap = 3
29435 };
29436
29437
29438 enum {
29439   kBSLNRomanBaseline = 0,
29440   kBSLNIdeographicCenterBaseline = 1,
29441   kBSLNIdeographicLowBaseline = 2,
29442   kBSLNHangingBaseline = 3,
29443   kBSLNMathBaseline = 4,
29444   kBSLNLastBaseline = 31,
29445   kBSLNNumBaselineClasses = kBSLNLastBaseline + 1,
29446   kBSLNNoBaselineOverride = 255
29447 };
29448
29449
29450 typedef UInt32 BslnBaselineClass;
29451
29452 typedef Fixed BslnBaselineRecord[32];
29453
29454
29455
29456
29457 struct BslnFormat0Part {
29458   SInt16 deltas[32];
29459 };
29460 typedef struct BslnFormat0Part BslnFormat0Part;
29461
29462 struct BslnFormat1Part {
29463   SInt16 deltas[32];
29464   SFNTLookupTable mappingData;
29465 };
29466 typedef struct BslnFormat1Part BslnFormat1Part;
29467
29468
29469
29470
29471
29472
29473 struct BslnFormat2Part {
29474   UInt16 stdGlyph;
29475   SInt16 ctlPoints[32];
29476 };
29477 typedef struct BslnFormat2Part BslnFormat2Part;
29478
29479
29480
29481
29482
29483 struct BslnFormat3Part {
29484   UInt16 stdGlyph;
29485   SInt16 ctlPoints[32];
29486   SFNTLookupTable mappingData;
29487 };
29488 typedef struct BslnFormat3Part BslnFormat3Part;
29489
29490 union BslnFormatUnion {
29491   BslnFormat0Part fmt0Part;
29492   BslnFormat1Part fmt1Part;
29493   BslnFormat2Part fmt2Part;
29494   BslnFormat3Part fmt3Part;
29495 };
29496 typedef union BslnFormatUnion BslnFormatUnion;
29497
29498
29499 typedef UInt16 BslnTableFormat;
29500
29501 struct BslnTable {
29502   Fixed version;
29503   BslnTableFormat format;
29504   UInt16 defaultBaseline;
29505   BslnFormatUnion parts;
29506 };
29507 typedef struct BslnTable BslnTable;
29508 typedef BslnTable * BslnTablePtr;
29509
29510
29511
29512
29513
29514 extern "C" {
29515
29516
29517
29518 typedef UInt32 FMGeneration;
29519
29520
29521
29522
29523
29524
29525
29526 typedef SInt16 FMFontFamily;
29527 typedef SInt16 FMFontStyle;
29528 typedef SInt16 FMFontSize;
29529
29530
29531
29532
29533
29534
29535
29536 typedef UInt32 FMFont;
29537 struct FMFontFamilyInstance {
29538   FMFontFamily fontFamily;
29539   FMFontStyle fontStyle;
29540 };
29541 typedef struct FMFontFamilyInstance FMFontFamilyInstance;
29542 struct FMFontFamilyIterator {
29543   UInt32 reserved[16];
29544 };
29545 typedef struct FMFontFamilyIterator FMFontFamilyIterator;
29546 struct FMFontIterator {
29547   UInt32 reserved[16];
29548 };
29549 typedef struct FMFontIterator FMFontIterator;
29550 struct FMFontFamilyInstanceIterator {
29551   UInt32 reserved[16];
29552 };
29553 typedef struct FMFontFamilyInstanceIterator FMFontFamilyInstanceIterator;
29554 enum {
29555   kInvalidGeneration = 0L,
29556   kInvalidFontFamily = -1,
29557   kInvalidFont = 0L
29558 };
29559
29560 enum {
29561   kFMCurrentFilterFormat = 0L
29562 };
29563
29564 typedef UInt32 FMFilterSelector;
29565 enum {
29566   kFMFontTechnologyFilterSelector = 1L,
29567   kFMFontContainerFilterSelector = 2L,
29568   kFMGenerationFilterSelector = 3L,
29569   kFMFontFamilyCallbackFilterSelector = 4L,
29570   kFMFontCallbackFilterSelector = 5L,
29571   kFMFontDirectoryFilterSelector = 6L
29572 };
29573
29574 enum {
29575   kFMTrueTypeFontTechnology = 'true',
29576   kFMPostScriptFontTechnology = 'typ1'
29577 };
29578
29579 typedef OSStatus ( * FMFontFamilyCallbackFilterProcPtr)(FMFontFamily iFontFamily, void *iRefCon);
29580 typedef OSStatus ( * FMFontCallbackFilterProcPtr)(FMFont iFont, void *iRefCon);
29581 typedef FMFontFamilyCallbackFilterProcPtr FMFontFamilyCallbackFilterUPP;
29582 typedef FMFontCallbackFilterProcPtr FMFontCallbackFilterUPP;
29583 extern FMFontFamilyCallbackFilterUPP
29584 NewFMFontFamilyCallbackFilterUPP(FMFontFamilyCallbackFilterProcPtr userRoutine) ;
29585 extern FMFontCallbackFilterUPP
29586 NewFMFontCallbackFilterUPP(FMFontCallbackFilterProcPtr userRoutine) ;
29587 extern void
29588 DisposeFMFontFamilyCallbackFilterUPP(FMFontFamilyCallbackFilterUPP userUPP) ;
29589 extern void
29590 DisposeFMFontCallbackFilterUPP(FMFontCallbackFilterUPP userUPP) ;
29591 extern OSStatus
29592 InvokeFMFontFamilyCallbackFilterUPP(
29593   FMFontFamily iFontFamily,
29594   void * iRefCon,
29595   FMFontFamilyCallbackFilterUPP userUPP) ;
29596 extern OSStatus
29597 InvokeFMFontCallbackFilterUPP(
29598   FMFont iFont,
29599   void * iRefCon,
29600   FMFontCallbackFilterUPP userUPP) ;
29601
29602 struct FMFontDirectoryFilter {
29603   SInt16 fontFolderDomain;
29604   UInt32 reserved[2];
29605 };
29606 typedef struct FMFontDirectoryFilter FMFontDirectoryFilter;
29607 struct FMFilter {
29608   UInt32 format;
29609   FMFilterSelector selector;
29610   union {
29611     FourCharCode fontTechnologyFilter;
29612     FSSpec fontContainerFilter;
29613     FMGeneration generationFilter;
29614     FMFontFamilyCallbackFilterUPP fontFamilyCallbackFilter;
29615     FMFontCallbackFilterUPP fontCallbackFilter;
29616     FMFontDirectoryFilter fontDirectoryFilter;
29617   } filter;
29618 };
29619 typedef struct FMFilter FMFilter;
29620
29621 typedef OptionBits ATSOptionFlags;
29622 typedef UInt32 ATSGeneration;
29623 typedef UInt32 ATSFontContainerRef;
29624 typedef UInt32 ATSFontFamilyRef;
29625 typedef UInt32 ATSFontRef;
29626 typedef UInt16 ATSGlyphRef;
29627 typedef Float32 ATSFontSize;
29628 enum {
29629   kATSGenerationUnspecified = 0L,
29630   kATSFontContainerRefUnspecified = 0L,
29631   kATSFontFamilyRefUnspecified = 0L,
29632   kATSFontRefUnspecified = 0L
29633 };
29634
29635 struct ATSFontMetrics {
29636   UInt32 version;
29637   Float32 ascent;
29638
29639   Float32 descent;
29640
29641   Float32 leading;
29642   Float32 avgAdvanceWidth;
29643   Float32 maxAdvanceWidth;
29644   Float32 minLeftSideBearing;
29645   Float32 minRightSideBearing;
29646   Float32 stemWidth;
29647   Float32 stemHeight;
29648   Float32 capHeight;
29649   Float32 xHeight;
29650   Float32 italicAngle;
29651   Float32 underlinePosition;
29652   Float32 underlineThickness;
29653 };
29654 typedef struct ATSFontMetrics ATSFontMetrics;
29655 enum {
29656   kATSItalicQDSkew = (1 << 16) / 4,
29657   kATSBoldQDStretch = (1 << 16) * 3 / 2,
29658   kATSRadiansFactor = 1144
29659 };
29660
29661
29662 typedef UInt16 ATSCurveType;
29663 enum {
29664   kATSCubicCurveType = 0x0001,
29665   kATSQuadCurveType = 0x0002,
29666   kATSOtherCurveType = 0x0003
29667 };
29668
29669
29670
29671
29672
29673
29674 enum {
29675   kATSDeletedGlyphcode = 0xFFFF
29676 };
29677
29678 struct ATSUCurvePath {
29679   UInt32 vectors;
29680   UInt32 controlBits[1];
29681   Float32Point vector[1];
29682 };
29683 typedef struct ATSUCurvePath ATSUCurvePath;
29684 struct ATSUCurvePaths {
29685   UInt32 contours;
29686   ATSUCurvePath contour[1];
29687 };
29688 typedef struct ATSUCurvePaths ATSUCurvePaths;
29689
29690 struct ATSGlyphIdealMetrics {
29691   Float32Point advance;
29692   Float32Point sideBearing;
29693   Float32Point otherSideBearing;
29694 };
29695 typedef struct ATSGlyphIdealMetrics ATSGlyphIdealMetrics;
29696
29697 struct ATSGlyphScreenMetrics {
29698   Float32Point deviceAdvance;
29699   Float32Point topLeft;
29700   UInt32 height;
29701   UInt32 width;
29702   Float32Point sideBearing;
29703   Float32Point otherSideBearing;
29704 };
29705 typedef struct ATSGlyphScreenMetrics ATSGlyphScreenMetrics;
29706
29707
29708 typedef ATSGlyphRef GlyphID;
29709
29710
29711
29712 }
29713 extern "C" {
29714
29715
29716
29717
29718
29719
29720
29721
29722
29723 enum {
29724   kATSUseGlyphAdvance = 0x7FFFFFFF,
29725   kATSUseLineHeight = 0x7FFFFFFF,
29726   kATSNoTracking = (long)0x80000000
29727 };
29728 enum {
29729
29730
29731
29732
29733
29734
29735   kATSUseCaretOrigins = 0,
29736
29737
29738
29739
29740
29741
29742   kATSUseDeviceOrigins = 1,
29743   kATSUseFractionalOrigins = 2,
29744   kATSUseOriginFlags = 3
29745 };
29746 typedef UInt32 ATSULayoutOperationSelector;
29747 enum {
29748
29749
29750
29751
29752   kATSULayoutOperationNone = 0x00000000,
29753
29754
29755
29756
29757   kATSULayoutOperationJustification = 0x00000001,
29758
29759
29760
29761
29762   kATSULayoutOperationMorph = 0x00000002,
29763
29764
29765
29766
29767   kATSULayoutOperationKerningAdjustment = 0x00000004,
29768
29769
29770
29771
29772   kATSULayoutOperationBaselineAdjustment = 0x00000008,
29773
29774
29775
29776
29777   kATSULayoutOperationTrackingAdjustment = 0x00000010,
29778
29779
29780
29781
29782
29783   kATSULayoutOperationPostLayoutAdjustment = 0x00000020,
29784   kATSULayoutOperationAppleReserved = (unsigned long)0xFFFFFFC0
29785 };
29786 typedef UInt32 ATSULayoutOperationCallbackStatus;
29787 enum {
29788
29789
29790
29791
29792
29793
29794   kATSULayoutOperationCallbackStatusHandled = 0x00000000,
29795
29796
29797
29798
29799
29800
29801   kATSULayoutOperationCallbackStatusContinue = 0x00000001
29802 };
29803 typedef UInt32 ATSLineLayoutOptions;
29804 enum {
29805
29806
29807
29808
29809   kATSLineNoLayoutOptions = 0x00000000,
29810
29811
29812
29813
29814   kATSLineIsDisplayOnly = 0x00000001,
29815
29816
29817
29818
29819   kATSLineHasNoHangers = 0x00000002,
29820
29821
29822
29823
29824   kATSLineHasNoOpticalAlignment = 0x00000004,
29825
29826
29827
29828
29829   kATSLineKeepSpacesOutOfMargin = 0x00000008,
29830
29831
29832
29833
29834   kATSLineNoSpecialJustification = 0x00000010,
29835
29836
29837
29838
29839
29840   kATSLineLastNoJustification = 0x00000020,
29841
29842
29843
29844
29845
29846   kATSLineFractDisable = 0x00000040,
29847
29848
29849
29850
29851
29852   kATSLineImposeNoAngleForEnds = 0x00000080,
29853
29854
29855
29856
29857
29858   kATSLineFillOutToWidth = 0x00000100,
29859
29860
29861
29862
29863
29864   kATSLineTabAdjustEnabled = 0x00000200,
29865
29866
29867
29868
29869
29870   kATSLineIgnoreFontLeading = 0x00000400,
29871
29872
29873
29874
29875
29876   kATSLineApplyAntiAliasing = 0x00000800,
29877
29878
29879
29880
29881
29882
29883   kATSLineNoAntiAliasing = 0x00001000,
29884
29885
29886
29887
29888
29889
29890   kATSLineDisableNegativeJustification = 0x00002000,
29891
29892
29893
29894
29895
29896
29897
29898   kATSLineDisableAutoAdjustDisplayPos = 0x00004000,
29899
29900
29901
29902
29903
29904   kATSLineUseQDRendering = 0x00008000,
29905
29906
29907
29908
29909   kATSLineDisableAllJustification = 0x00010000,
29910
29911
29912
29913
29914   kATSLineDisableAllGlyphMorphing = 0x00020000,
29915
29916
29917
29918
29919   kATSLineDisableAllKerningAdjustments = 0x00040000,
29920
29921
29922
29923
29924   kATSLineDisableAllBaselineAdjustments = 0x00080000,
29925
29926
29927
29928
29929   kATSLineDisableAllTrackingAdjustments = 0x00100000,
29930
29931
29932
29933
29934   kATSLineDisableAllLayoutOperations = kATSLineDisableAllJustification | kATSLineDisableAllGlyphMorphing | kATSLineDisableAllKerningAdjustments | kATSLineDisableAllBaselineAdjustments | kATSLineDisableAllTrackingAdjustments,
29935
29936
29937
29938
29939
29940   kATSLineUseDeviceMetrics = 0x01000000,
29941
29942
29943
29944
29945
29946   kATSLineAppleReserved = (unsigned long)0xFEE00000
29947 };
29948 typedef UInt32 ATSStyleRenderingOptions;
29949 enum {
29950
29951
29952
29953
29954   kATSStyleNoOptions = 0x00000000,
29955
29956
29957
29958
29959
29960   kATSStyleNoHinting = 0x00000001,
29961
29962
29963
29964
29965
29966   kATSStyleApplyAntiAliasing = 0x00000002,
29967
29968
29969
29970
29971
29972
29973   kATSStyleNoAntiAliasing = 0x00000004,
29974
29975
29976
29977
29978
29979   kATSStyleAppleReserved = (unsigned long)0xFFFFFFF8,
29980
29981
29982
29983
29984
29985
29986   kATSStyleApplyHints = kATSStyleNoOptions
29987 };
29988 typedef UInt32 ATSGlyphInfoFlags;
29989 enum {
29990
29991
29992
29993
29994
29995   kATSGlyphInfoAppleReserved = 0x1FFBFFE8,
29996
29997
29998
29999
30000   kATSGlyphInfoIsAttachment = (unsigned long)0x80000000,
30001
30002
30003
30004
30005   kATSGlyphInfoIsLTHanger = 0x40000000,
30006
30007
30008
30009
30010   kATSGlyphInfoIsRBHanger = 0x20000000,
30011
30012
30013
30014
30015
30016   kATSGlyphInfoTerminatorGlyph = 0x00080000,
30017
30018
30019
30020
30021   kATSGlyphInfoIsWhiteSpace = 0x00040000,
30022
30023
30024
30025
30026   kATSGlyphInfoHasImposedWidth = 0x00000010,
30027
30028
30029
30030
30031
30032
30033
30034   kATSGlyphInfoByteSizeMask = 0x00000007
30035 };
30036 struct ATSLayoutRecord {
30037
30038
30039
30040
30041   ATSGlyphRef glyphID;
30042
30043
30044
30045
30046   ATSGlyphInfoFlags flags;
30047
30048
30049
30050
30051   ByteCount originalOffset;
30052
30053
30054
30055
30056   Fixed realPos;
30057 };
30058 typedef struct ATSLayoutRecord ATSLayoutRecord;
30059 struct ATSTrapezoid {
30060   FixedPoint upperLeft;
30061   FixedPoint upperRight;
30062   FixedPoint lowerRight;
30063   FixedPoint lowerLeft;
30064 };
30065 typedef struct ATSTrapezoid ATSTrapezoid;
30066 struct ATSJustWidthDeltaEntryOverride {
30067
30068
30069
30070
30071   Fixed beforeGrowLimit;
30072
30073
30074
30075
30076   Fixed beforeShrinkLimit;
30077
30078
30079
30080
30081   Fixed afterGrowLimit;
30082
30083
30084
30085
30086   Fixed afterShrinkLimit;
30087
30088
30089
30090
30091   JustificationFlags growFlags;
30092
30093
30094
30095
30096   JustificationFlags shrinkFlags;
30097 };
30098 typedef struct ATSJustWidthDeltaEntryOverride ATSJustWidthDeltaEntryOverride;
30099
30100 typedef ATSJustWidthDeltaEntryOverride ATSJustPriorityWidthDeltaOverrides[4];
30101 typedef struct ATSGlyphVector* ATSULineRef;
30102 typedef OSStatus ( * ATSUDirectLayoutOperationOverrideProcPtr)(ATSULayoutOperationSelector iCurrentOperation, ATSULineRef iLineRef, UInt32 iRefCon, void *iOperationCallbackParameterPtr, ATSULayoutOperationCallbackStatus *oCallbackStatus);
30103 typedef ATSUDirectLayoutOperationOverrideProcPtr ATSUDirectLayoutOperationOverrideUPP;
30104 extern ATSUDirectLayoutOperationOverrideUPP
30105 NewATSUDirectLayoutOperationOverrideUPP(ATSUDirectLayoutOperationOverrideProcPtr userRoutine) ;
30106 extern void
30107 DisposeATSUDirectLayoutOperationOverrideUPP(ATSUDirectLayoutOperationOverrideUPP userUPP) ;
30108 extern OSStatus
30109 InvokeATSUDirectLayoutOperationOverrideUPP(
30110   ATSULayoutOperationSelector iCurrentOperation,
30111   ATSULineRef iLineRef,
30112   UInt32 iRefCon,
30113   void * iOperationCallbackParameterPtr,
30114   ATSULayoutOperationCallbackStatus * oCallbackStatus,
30115   ATSUDirectLayoutOperationOverrideUPP userUPP) ;
30116 struct ATSULayoutOperationOverrideSpecifier {
30117
30118
30119
30120
30121
30122
30123   ATSULayoutOperationSelector operationSelector;
30124   ATSUDirectLayoutOperationOverrideUPP overrideUPP;
30125
30126 };
30127 typedef struct ATSULayoutOperationOverrideSpecifier ATSULayoutOperationOverrideSpecifier;
30128
30129
30130
30131 }
30132
30133
30134
30135
30136
30137 extern double acos (double);
30138 extern double asin (double);
30139 extern double atan (double);
30140 extern double atan2 (double, double);
30141 extern double ceil (double);
30142 extern double cos (double);
30143 extern double cosh (double);
30144 extern double exp (double);
30145 extern double fabs (double);
30146 extern double floor (double);
30147 extern double fmod (double, double);
30148 extern double frexp (double, int *);
30149 extern double ldexp (double, int);
30150 extern double log10 (double);
30151 extern double log (double);
30152 extern double modf (double, double *);
30153 extern double pow (double, double);
30154 extern double sin (double);
30155 extern double sinh (double);
30156 extern double sqrt (double);
30157 extern double tan (double);
30158 extern double tanh (double);
30159
30160
30161
30162
30163
30164
30165
30166
30167
30168
30169 struct sfntDirectoryEntry {
30170   FourCharCode tableTag;
30171   UInt32 checkSum;
30172   UInt32 offset;
30173   UInt32 length;
30174 };
30175 typedef struct sfntDirectoryEntry sfntDirectoryEntry;
30176
30177 struct sfntDirectory {
30178   FourCharCode format;
30179   UInt16 numOffsets;
30180   UInt16 searchRange;
30181   UInt16 entrySelector;
30182   UInt16 rangeShift;
30183   sfntDirectoryEntry table[1];
30184 };
30185 typedef struct sfntDirectory sfntDirectory;
30186 enum {
30187   sizeof_sfntDirectory = 12
30188 };
30189
30190
30191 enum {
30192   cmapFontTableTag = 'cmap'
30193 };
30194
30195 enum {
30196   kFontUnicodePlatform = 0,
30197   kFontMacintoshPlatform = 1,
30198   kFontReservedPlatform = 2,
30199   kFontMicrosoftPlatform = 3,
30200   kFontCustomPlatform = 4
30201 };
30202
30203 enum {
30204   kFontUnicodeDefaultSemantics = 0,
30205   kFontUnicodeV1_1Semantics = 1,
30206   kFontISO10646_1993Semantics = 2
30207 };
30208
30209 enum {
30210   kFontRomanScript = 0,
30211   kFontJapaneseScript = 1,
30212   kFontTraditionalChineseScript = 2,
30213   kFontChineseScript = kFontTraditionalChineseScript,
30214   kFontKoreanScript = 3,
30215   kFontArabicScript = 4,
30216   kFontHebrewScript = 5,
30217   kFontGreekScript = 6,
30218   kFontCyrillicScript = 7,
30219   kFontRussian = kFontCyrillicScript,
30220   kFontRSymbolScript = 8,
30221   kFontDevanagariScript = 9,
30222   kFontGurmukhiScript = 10,
30223   kFontGujaratiScript = 11,
30224   kFontOriyaScript = 12,
30225   kFontBengaliScript = 13,
30226   kFontTamilScript = 14,
30227   kFontTeluguScript = 15,
30228   kFontKannadaScript = 16,
30229   kFontMalayalamScript = 17,
30230   kFontSinhaleseScript = 18,
30231   kFontBurmeseScript = 19,
30232   kFontKhmerScript = 20,
30233   kFontThaiScript = 21,
30234   kFontLaotianScript = 22,
30235   kFontGeorgianScript = 23,
30236   kFontArmenianScript = 24,
30237   kFontSimpleChineseScript = 25,
30238   kFontTibetanScript = 26,
30239   kFontMongolianScript = 27,
30240   kFontGeezScript = 28,
30241   kFontEthiopicScript = kFontGeezScript,
30242   kFontAmharicScript = kFontGeezScript,
30243   kFontSlavicScript = 29,
30244   kFontEastEuropeanRomanScript = kFontSlavicScript,
30245   kFontVietnameseScript = 30,
30246   kFontExtendedArabicScript = 31,
30247   kFontSindhiScript = kFontExtendedArabicScript,
30248   kFontUninterpretedScript = 32
30249 };
30250
30251 enum {
30252   kFontMicrosoftSymbolScript = 0,
30253   kFontMicrosoftStandardScript = 1,
30254   kFontMicrosoftUCS4Script = 10
30255 };
30256
30257
30258 enum {
30259   kFontCustom8BitScript = 0,
30260   kFontCustom816BitScript = 1,
30261   kFontCustom16BitScript = 2
30262 };
30263
30264
30265 enum {
30266   kFontEnglishLanguage = 0,
30267   kFontFrenchLanguage = 1,
30268   kFontGermanLanguage = 2,
30269   kFontItalianLanguage = 3,
30270   kFontDutchLanguage = 4,
30271   kFontSwedishLanguage = 5,
30272   kFontSpanishLanguage = 6,
30273   kFontDanishLanguage = 7,
30274   kFontPortugueseLanguage = 8,
30275   kFontNorwegianLanguage = 9,
30276   kFontHebrewLanguage = 10,
30277   kFontJapaneseLanguage = 11,
30278   kFontArabicLanguage = 12,
30279   kFontFinnishLanguage = 13,
30280   kFontGreekLanguage = 14,
30281   kFontIcelandicLanguage = 15,
30282   kFontMalteseLanguage = 16,
30283   kFontTurkishLanguage = 17,
30284   kFontCroatianLanguage = 18,
30285   kFontTradChineseLanguage = 19,
30286   kFontUrduLanguage = 20,
30287   kFontHindiLanguage = 21,
30288   kFontThaiLanguage = 22,
30289   kFontKoreanLanguage = 23,
30290   kFontLithuanianLanguage = 24,
30291   kFontPolishLanguage = 25,
30292   kFontHungarianLanguage = 26,
30293   kFontEstonianLanguage = 27,
30294   kFontLettishLanguage = 28,
30295   kFontLatvianLanguage = kFontLettishLanguage,
30296   kFontSaamiskLanguage = 29,
30297   kFontLappishLanguage = kFontSaamiskLanguage,
30298   kFontFaeroeseLanguage = 30,
30299   kFontFarsiLanguage = 31,
30300   kFontPersianLanguage = kFontFarsiLanguage,
30301   kFontRussianLanguage = 32,
30302   kFontSimpChineseLanguage = 33,
30303   kFontFlemishLanguage = 34,
30304   kFontIrishLanguage = 35,
30305   kFontAlbanianLanguage = 36,
30306   kFontRomanianLanguage = 37,
30307   kFontCzechLanguage = 38,
30308   kFontSlovakLanguage = 39,
30309   kFontSlovenianLanguage = 40,
30310   kFontYiddishLanguage = 41,
30311   kFontSerbianLanguage = 42,
30312   kFontMacedonianLanguage = 43,
30313   kFontBulgarianLanguage = 44,
30314   kFontUkrainianLanguage = 45,
30315   kFontByelorussianLanguage = 46,
30316   kFontUzbekLanguage = 47,
30317   kFontKazakhLanguage = 48,
30318   kFontAzerbaijaniLanguage = 49,
30319   kFontAzerbaijanArLanguage = 50,
30320   kFontArmenianLanguage = 51,
30321   kFontGeorgianLanguage = 52,
30322   kFontMoldavianLanguage = 53,
30323   kFontKirghizLanguage = 54,
30324   kFontTajikiLanguage = 55,
30325   kFontTurkmenLanguage = 56,
30326   kFontMongolianLanguage = 57,
30327   kFontMongolianCyrLanguage = 58,
30328   kFontPashtoLanguage = 59,
30329   kFontKurdishLanguage = 60,
30330   kFontKashmiriLanguage = 61,
30331   kFontSindhiLanguage = 62,
30332   kFontTibetanLanguage = 63,
30333   kFontNepaliLanguage = 64,
30334   kFontSanskritLanguage = 65,
30335   kFontMarathiLanguage = 66,
30336   kFontBengaliLanguage = 67,
30337   kFontAssameseLanguage = 68,
30338   kFontGujaratiLanguage = 69,
30339   kFontPunjabiLanguage = 70,
30340   kFontOriyaLanguage = 71,
30341   kFontMalayalamLanguage = 72,
30342   kFontKannadaLanguage = 73,
30343   kFontTamilLanguage = 74,
30344   kFontTeluguLanguage = 75,
30345   kFontSinhaleseLanguage = 76,
30346   kFontBurmeseLanguage = 77,
30347   kFontKhmerLanguage = 78,
30348   kFontLaoLanguage = 79,
30349   kFontVietnameseLanguage = 80,
30350   kFontIndonesianLanguage = 81,
30351   kFontTagalogLanguage = 82,
30352   kFontMalayRomanLanguage = 83,
30353   kFontMalayArabicLanguage = 84,
30354   kFontAmharicLanguage = 85,
30355   kFontTigrinyaLanguage = 86,
30356   kFontGallaLanguage = 87,
30357   kFontOromoLanguage = kFontGallaLanguage,
30358   kFontSomaliLanguage = 88,
30359   kFontSwahiliLanguage = 89,
30360   kFontRuandaLanguage = 90,
30361   kFontRundiLanguage = 91,
30362   kFontChewaLanguage = 92,
30363   kFontMalagasyLanguage = 93,
30364   kFontEsperantoLanguage = 94,
30365   kFontWelshLanguage = 128,
30366   kFontBasqueLanguage = 129,
30367   kFontCatalanLanguage = 130,
30368   kFontLatinLanguage = 131,
30369   kFontQuechuaLanguage = 132,
30370   kFontGuaraniLanguage = 133,
30371   kFontAymaraLanguage = 134,
30372   kFontTatarLanguage = 135,
30373   kFontUighurLanguage = 136,
30374   kFontDzongkhaLanguage = 137,
30375   kFontJavaneseRomLanguage = 138,
30376   kFontSundaneseRomLanguage = 139
30377 };
30378
30379
30380 enum {
30381   kFontNoPlatformCode = (unsigned long)(-1),
30382   kFontNoScriptCode = (unsigned long)(-1),
30383   kFontNoLanguageCode = (unsigned long)(-1)
30384 };
30385
30386 struct sfntCMapSubHeader {
30387   UInt16 format;
30388   UInt16 length;
30389   UInt16 languageID;
30390 };
30391 typedef struct sfntCMapSubHeader sfntCMapSubHeader;
30392 enum {
30393   sizeof_sfntCMapSubHeader = 6
30394 };
30395
30396 struct sfntCMapExtendedSubHeader {
30397   UInt16 format;
30398   UInt16 reserved;
30399   UInt32 length;
30400   UInt32 language;
30401 };
30402 typedef struct sfntCMapExtendedSubHeader sfntCMapExtendedSubHeader;
30403 enum {
30404   sizeof_sfntCMapExtendedSubHeader = 12
30405 };
30406
30407 struct sfntCMapEncoding {
30408   UInt16 platformID;
30409   UInt16 scriptID;
30410   UInt32 offset;
30411 };
30412 typedef struct sfntCMapEncoding sfntCMapEncoding;
30413 enum {
30414   sizeof_sfntCMapEncoding = 8
30415 };
30416
30417 struct sfntCMapHeader {
30418   UInt16 version;
30419   UInt16 numTables;
30420   sfntCMapEncoding encoding[1];
30421 };
30422 typedef struct sfntCMapHeader sfntCMapHeader;
30423 enum {
30424   sizeof_sfntCMapHeader = 4
30425 };
30426
30427
30428 enum {
30429   nameFontTableTag = 'name'
30430 };
30431
30432 enum {
30433   kFontCopyrightName = 0,
30434   kFontFamilyName = 1,
30435   kFontStyleName = 2,
30436   kFontUniqueName = 3,
30437   kFontFullName = 4,
30438   kFontVersionName = 5,
30439   kFontPostscriptName = 6,
30440   kFontTrademarkName = 7,
30441   kFontManufacturerName = 8,
30442   kFontDesignerName = 9,
30443   kFontDescriptionName = 10,
30444   kFontVendorURLName = 11,
30445   kFontDesignerURLName = 12,
30446   kFontLicenseDescriptionName = 13,
30447   kFontLicenseInfoURLName = 14,
30448   kFontLastReservedName = 255
30449 };
30450
30451
30452 enum {
30453   kFontNoNameCode = (unsigned long)(-1)
30454 };
30455
30456 struct sfntNameRecord {
30457   UInt16 platformID;
30458   UInt16 scriptID;
30459   UInt16 languageID;
30460   UInt16 nameID;
30461   UInt16 length;
30462   UInt16 offset;
30463 };
30464 typedef struct sfntNameRecord sfntNameRecord;
30465 enum {
30466   sizeof_sfntNameRecord = 12
30467 };
30468
30469 struct sfntNameHeader {
30470   UInt16 format;
30471   UInt16 count;
30472   UInt16 stringOffset;
30473   sfntNameRecord rec[1];
30474 };
30475 typedef struct sfntNameHeader sfntNameHeader;
30476 enum {
30477   sizeof_sfntNameHeader = 6
30478 };
30479
30480
30481 enum {
30482   variationFontTableTag = 'fvar'
30483 };
30484
30485
30486 struct sfntVariationAxis {
30487   FourCharCode axisTag;
30488   Fixed minValue;
30489   Fixed defaultValue;
30490   Fixed maxValue;
30491   SInt16 flags;
30492   SInt16 nameID;
30493 };
30494 typedef struct sfntVariationAxis sfntVariationAxis;
30495 enum {
30496   sizeof_sfntVariationAxis = 20
30497 };
30498
30499
30500 struct sfntInstance {
30501   SInt16 nameID;
30502   SInt16 flags;
30503   Fixed coord[1];
30504
30505 };
30506 typedef struct sfntInstance sfntInstance;
30507 enum {
30508   sizeof_sfntInstance = 4
30509 };
30510
30511 struct sfntVariationHeader {
30512   Fixed version;
30513   UInt16 offsetToData;
30514   UInt16 countSizePairs;
30515   UInt16 axisCount;
30516   UInt16 axisSize;
30517   UInt16 instanceCount;
30518   UInt16 instanceSize;
30519
30520   sfntVariationAxis axis[1];
30521   sfntInstance instance[1];
30522 };
30523 typedef struct sfntVariationHeader sfntVariationHeader;
30524 enum {
30525   sizeof_sfntVariationHeader = 16
30526 };
30527
30528
30529 enum {
30530   descriptorFontTableTag = 'fdsc'
30531 };
30532
30533 struct sfntFontDescriptor {
30534   FourCharCode name;
30535   Fixed value;
30536 };
30537 typedef struct sfntFontDescriptor sfntFontDescriptor;
30538 struct sfntDescriptorHeader {
30539   Fixed version;
30540   SInt32 descriptorCount;
30541   sfntFontDescriptor descriptor[1];
30542 };
30543 typedef struct sfntDescriptorHeader sfntDescriptorHeader;
30544 enum {
30545   sizeof_sfntDescriptorHeader = 8
30546 };
30547
30548
30549 enum {
30550   featureFontTableTag = 'feat'
30551 };
30552
30553 struct sfntFeatureName {
30554   UInt16 featureType;
30555   UInt16 settingCount;
30556   SInt32 offsetToSettings;
30557   UInt16 featureFlags;
30558   UInt16 nameID;
30559 };
30560 typedef struct sfntFeatureName sfntFeatureName;
30561 struct sfntFontFeatureSetting {
30562   UInt16 setting;
30563   UInt16 nameID;
30564 };
30565 typedef struct sfntFontFeatureSetting sfntFontFeatureSetting;
30566 struct sfntFontRunFeature {
30567   UInt16 featureType;
30568   UInt16 setting;
30569 };
30570 typedef struct sfntFontRunFeature sfntFontRunFeature;
30571 struct sfntFeatureHeader {
30572   SInt32 version;
30573   UInt16 featureNameCount;
30574   UInt16 featureSetCount;
30575   SInt32 reserved;
30576   sfntFeatureName names[1];
30577   sfntFontFeatureSetting settings[1];
30578   sfntFontRunFeature runs[1];
30579 };
30580 typedef struct sfntFeatureHeader sfntFeatureHeader;
30581
30582 enum {
30583   os2FontTableTag = 'OS/2'
30584 };
30585
30586
30587 enum {
30588   nonGlyphID = 65535L
30589 };
30590
30591
30592
30593
30594
30595 enum {
30596   kFontNoPlatform = -1,
30597   kFontNoScript = -1,
30598   kFontNoLanguage = -1,
30599   kFontNoName = -1
30600 };
30601
30602
30603
30604
30605
30606 typedef UInt32 FontNameCode;
30607
30608 typedef UInt32 FontPlatformCode;
30609 typedef UInt32 FontScriptCode;
30610 typedef UInt32 FontLanguageCode;
30611
30612
30613
30614
30615 struct FontVariation {
30616   FourCharCode name;
30617   Fixed value;
30618 };
30619 typedef struct FontVariation FontVariation;
30620
30621 extern "C" {
30622
30623
30624
30625
30626
30627
30628
30629 enum {
30630   kATSOptionFlagsDefault = kNilOptions,
30631   kATSOptionFlagsComposeFontPostScriptName = 1 << 0,
30632   kATSOptionFlagsUseDataForkAsResourceFork = 1 << 8,
30633   kATSOptionFlagsUseResourceFork = 2 << 8,
30634   kATSOptionFlagsUseDataFork = 3 << 8
30635 };
30636
30637 enum {
30638   kATSIterationCompleted = -980L,
30639   kATSInvalidFontFamilyAccess = -981L,
30640   kATSInvalidFontAccess = -982L,
30641   kATSIterationScopeModified = -983L,
30642   kATSInvalidFontTableAccess = -984L,
30643   kATSInvalidFontContainerAccess = -985L
30644 };
30645
30646
30647 typedef UInt32 ATSFontContext;
30648 enum {
30649   kATSFontContextUnspecified = 0,
30650   kATSFontContextGlobal = 1,
30651   kATSFontContextLocal = 2
30652 };
30653
30654 enum {
30655   kATSOptionFlagsDoNotNotify = 0x00000001 << 8,
30656   kATSOptionFlagsIterationScopeMask = 0x00000007 << 12,
30657   kATSOptionFlagsDefaultScope = 0x00000000 << 12,
30658   kATSOptionFlagsUnRestrictedScope = 0x00000001 << 12,
30659   kATSOptionFlagsRestrictedScope = 0x00000002 << 12,
30660   kATSOptionFlagsProcessSubdirectories = 0x00000001 << 6
30661 };
30662
30663
30664 enum {
30665   kATSOptionFlagsIterateByPrecedenceMask = 0x00000001 << 5
30666 };
30667
30668 typedef UInt32 ATSFontFormat;
30669 enum {
30670   kATSFontFormatUnspecified = 0
30671 };
30672
30673 typedef OSStatus ( * ATSFontFamilyApplierFunction)(ATSFontFamilyRef iFamily, void *iRefCon);
30674 typedef OSStatus ( * ATSFontApplierFunction)(ATSFontRef iFont, void *iRefCon);
30675 typedef struct ATSFontFamilyIterator_* ATSFontFamilyIterator;
30676 typedef struct ATSFontIterator_* ATSFontIterator;
30677 enum {
30678   kATSFontFilterCurrentVersion = 0
30679 };
30680
30681 enum ATSFontFilterSelector {
30682   kATSFontFilterSelectorUnspecified = 0,
30683   kATSFontFilterSelectorGeneration = 3,
30684   kATSFontFilterSelectorFontFamily = 7,
30685   kATSFontFilterSelectorFontFamilyApplierFunction = 8,
30686   kATSFontFilterSelectorFontApplierFunction = 9
30687 };
30688 typedef enum ATSFontFilterSelector ATSFontFilterSelector;
30689
30690 struct ATSFontFilter {
30691   UInt32 version;
30692   ATSFontFilterSelector filterSelector;
30693   union {
30694     ATSGeneration generationFilter;
30695     ATSFontFamilyRef fontFamilyFilter;
30696     ATSFontFamilyApplierFunction fontFamilyApplierFunctionFilter;
30697     ATSFontApplierFunction fontApplierFunctionFilter;
30698   } filter;
30699 };
30700 typedef struct ATSFontFilter ATSFontFilter;
30701
30702 typedef struct ATSFontNotificationRef_* ATSFontNotificationRef;
30703 typedef struct ATSFontNotificationInfoRef_* ATSFontNotificationInfoRef;
30704 enum ATSFontNotifyOption {
30705
30706
30707
30708
30709   kATSFontNotifyOptionDefault = 0,
30710   kATSFontNotifyOptionReceiveWhileSuspended = 1L << 0
30711 };
30712 typedef enum ATSFontNotifyOption ATSFontNotifyOption;
30713 enum ATSFontNotifyAction {
30714   kATSFontNotifyActionFontsChanged = 1,
30715   kATSFontNotifyActionDirectoriesChanged = 2
30716 };
30717 typedef enum ATSFontNotifyAction ATSFontNotifyAction;
30718 typedef void ( * ATSNotificationCallback)(ATSFontNotificationInfoRef info, void *refCon);
30719 extern ATSGeneration
30720 ATSGetGeneration(void) ;
30721 extern OSStatus
30722 ATSFontActivateFromFileSpecification(
30723   const FSSpec * iFile,
30724   ATSFontContext iContext,
30725   ATSFontFormat iFormat,
30726   void * iReserved,
30727   ATSOptionFlags iOptions,
30728   ATSFontContainerRef * oContainer) ;
30729 extern OSStatus
30730 ATSFontActivateFromMemory(
30731   LogicalAddress iData,
30732   ByteCount iLength,
30733   ATSFontContext iContext,
30734   ATSFontFormat iFormat,
30735   void * iReserved,
30736   ATSOptionFlags iOptions,
30737   ATSFontContainerRef * oContainer) ;
30738 extern OSStatus
30739 ATSFontDeactivate(
30740   ATSFontContainerRef iContainer,
30741   void * iRefCon,
30742   ATSOptionFlags iOptions) ;
30743 extern OSStatus
30744 ATSFontFamilyApplyFunction(
30745   ATSFontFamilyApplierFunction iFunction,
30746   void * iRefCon) ;
30747 extern OSStatus
30748 ATSFontFamilyIteratorCreate(
30749   ATSFontContext iContext,
30750   const ATSFontFilter * iFilter,
30751   void * iRefCon,
30752   ATSOptionFlags iOptions,
30753   ATSFontFamilyIterator * ioIterator) ;
30754 extern OSStatus
30755 ATSFontFamilyIteratorRelease(ATSFontFamilyIterator * ioIterator) ;
30756 extern OSStatus
30757 ATSFontFamilyIteratorReset(
30758   ATSFontContext iContext,
30759   const ATSFontFilter * iFilter,
30760   void * iRefCon,
30761   ATSOptionFlags iOptions,
30762   ATSFontFamilyIterator * ioIterator) ;
30763 extern OSStatus
30764 ATSFontFamilyIteratorNext(
30765   ATSFontFamilyIterator iIterator,
30766   ATSFontFamilyRef * oFamily) ;
30767 extern ATSFontFamilyRef
30768 ATSFontFamilyFindFromName(
30769   CFStringRef iName,
30770   ATSOptionFlags iOptions) ;
30771 extern ATSGeneration
30772 ATSFontFamilyGetGeneration(ATSFontFamilyRef iFamily) ;
30773 extern OSStatus
30774 ATSFontFamilyGetName(
30775   ATSFontFamilyRef iFamily,
30776   ATSOptionFlags iOptions,
30777   CFStringRef * oName) ;
30778 extern TextEncoding
30779 ATSFontFamilyGetEncoding(ATSFontFamilyRef iFamily) ;
30780 extern OSStatus
30781 ATSFontApplyFunction(
30782   ATSFontApplierFunction iFunction,
30783   void * iRefCon) ;
30784 extern OSStatus
30785 ATSFontIteratorCreate(
30786   ATSFontContext iContext,
30787   const ATSFontFilter * iFilter,
30788   void * iRefCon,
30789   ATSOptionFlags iOptions,
30790   ATSFontIterator * ioIterator) ;
30791 extern OSStatus
30792 ATSFontIteratorRelease(ATSFontIterator * ioIterator) ;
30793 extern OSStatus
30794 ATSFontIteratorReset(
30795   ATSFontContext iContext,
30796   const ATSFontFilter * iFilter,
30797   void * iRefCon,
30798   ATSOptionFlags iOptions,
30799   ATSFontIterator * ioIterator) ;
30800 extern OSStatus
30801 ATSFontIteratorNext(
30802   ATSFontIterator iIterator,
30803   ATSFontRef * oFont) ;
30804 extern ATSFontRef
30805 ATSFontFindFromName(
30806   CFStringRef iName,
30807   ATSOptionFlags iOptions) ;
30808 extern ATSFontRef
30809 ATSFontFindFromPostScriptName(
30810   CFStringRef iName,
30811   ATSOptionFlags iOptions) ;
30812 extern OSStatus
30813 ATSFontFindFromContainer(
30814   ATSFontContainerRef iContainer,
30815   ATSOptionFlags iOptions,
30816   ItemCount iCount,
30817   ATSFontRef ioArray[],
30818   ItemCount * oCount) ;
30819 extern ATSGeneration
30820 ATSFontGetGeneration(ATSFontRef iFont) ;
30821 extern OSStatus
30822 ATSFontGetName(
30823   ATSFontRef iFont,
30824   ATSOptionFlags iOptions,
30825   CFStringRef * oName) ;
30826 extern OSStatus
30827 ATSFontGetPostScriptName(
30828   ATSFontRef iFont,
30829   ATSOptionFlags iOptions,
30830   CFStringRef * oName) ;
30831 extern OSStatus
30832 ATSFontGetTableDirectory(
30833   ATSFontRef iFont,
30834   ByteCount iBufferSize,
30835   void * ioBuffer,
30836   ByteCount * oSize) ;
30837 extern OSStatus
30838 ATSFontGetTable(
30839   ATSFontRef iFont,
30840   FourCharCode iTag,
30841   ByteOffset iOffset,
30842   ByteCount iBufferSize,
30843   void * ioBuffer,
30844   ByteCount * oSize) ;
30845 extern OSStatus
30846 ATSFontGetHorizontalMetrics(
30847   ATSFontRef iFont,
30848   ATSOptionFlags iOptions,
30849   ATSFontMetrics * oMetrics) ;
30850 extern OSStatus
30851 ATSFontGetVerticalMetrics(
30852   ATSFontRef iFont,
30853   ATSOptionFlags iOptions,
30854   ATSFontMetrics * oMetrics) ;
30855 extern ATSFontFamilyRef
30856 ATSFontFamilyFindFromQuickDrawName(ConstStr255Param iName) ;
30857 extern OSStatus
30858 ATSFontFamilyGetQuickDrawName(
30859   ATSFontFamilyRef iFamily,
30860   Str255 oName) ;
30861 extern OSStatus
30862 ATSFontGetFileSpecification(
30863   ATSFontRef iFont,
30864   FSSpec * oFile) ;
30865 extern OSStatus
30866 ATSFontGetFontFamilyResource(
30867   ATSFontRef iFont,
30868   ByteCount iBufferSize,
30869   void * ioBuffer,
30870   ByteCount * oSize) ;
30871 extern OSStatus
30872 ATSFontNotify(
30873   ATSFontNotifyAction action,
30874   void * info) ;
30875 extern OSStatus
30876 ATSFontNotificationSubscribe(
30877   ATSNotificationCallback callback,
30878   ATSFontNotifyOption options,
30879   void * iRefcon,
30880   ATSFontNotificationRef * oNotificationRef) ;
30881 extern OSStatus
30882 ATSFontNotificationUnsubscribe(ATSFontNotificationRef notificationRef) ;
30883 struct ATSFontQuerySourceContext {
30884
30885
30886
30887
30888
30889   UInt32 version;
30890
30891
30892
30893
30894
30895   void * refCon;
30896
30897
30898
30899
30900   CFAllocatorRetainCallBack retain;
30901
30902
30903
30904
30905   CFAllocatorReleaseCallBack release;
30906 };
30907 typedef struct ATSFontQuerySourceContext ATSFontQuerySourceContext;
30908
30909
30910
30911
30912
30913
30914
30915 enum ATSFontQueryMessageID {
30916
30917
30918
30919
30920
30921
30922
30923   kATSQueryActivateFontMessage = 'atsa'
30924 };
30925 typedef enum ATSFontQueryMessageID ATSFontQueryMessageID;
30926 typedef CFPropertyListRef ( * ATSFontQueryCallback)(ATSFontQueryMessageID msgid, CFPropertyListRef data, void *refCon);
30927 extern CFRunLoopSourceRef
30928 ATSCreateFontQueryRunLoopSource(
30929   CFIndex queryOrder,
30930   CFIndex sourceOrder,
30931   ATSFontQueryCallback callout,
30932   const ATSFontQuerySourceContext * context) ;
30933
30934
30935 }
30936
30937
30938
30939
30940
30941
30942
30943
30944
30945 enum {
30946   cexec68K = 0x00000001,
30947   truetypeStreamType = 0x00000001,
30948   type1StreamType = 0x00000002,
30949   type3StreamType = 0x00000004,
30950   type42StreamType = 0x00000008,
30951   type42GXStreamType = 0x00000010,
30952   portableStreamType = 0x00000020,
30953   flattenedStreamType = 0x00000040,
30954   cidType2StreamType = 0x00000080,
30955   cidType0StreamType = 0x00000100,
30956   type1CFFStreamType = 0x00000200,
30957   evenOddModifierStreamType = 0x00008000,
30958   eexecBinaryModifierStreamType = 0x00010000,
30959   unicodeMappingModifierStreamType = 0x00020000,
30960   scalerSpecifcModifierMask = 0x0000F000,
30961   streamTypeModifierMask = (long)0xFFFFF000
30962 };
30963
30964
30965 typedef unsigned long scalerStreamTypeFlag;
30966 enum {
30967   downloadStreamAction = 0,
30968   asciiDownloadStreamAction = 1,
30969   fontSizeQueryStreamAction = 2,
30970   encodingOnlyStreamAction = 3,
30971   prerequisiteQueryStreamAction = 4,
30972   prerequisiteItemStreamAction = 5,
30973   variationQueryStreamAction = 6,
30974   variationPSOperatorStreamAction = 7
30975 };
30976
30977 typedef long scalerStreamAction;
30978 enum {
30979   selectAllVariations = -1
30980 };
30981
30982 struct scalerPrerequisiteItem {
30983   long enumeration;
30984   long size;
30985   unsigned char name[1];
30986 };
30987 typedef struct scalerPrerequisiteItem scalerPrerequisiteItem;
30988 struct scalerStream {
30989   const void * streamRefCon;
30990   const char * targetVersion;
30991   scalerStreamTypeFlag types;
30992   scalerStreamAction action;
30993   unsigned long memorySize;
30994   long variationCount;
30995   const void * variations;
30996   union {
30997
30998     struct {
30999       const unsigned short * encoding;
31000       long * glyphBits;
31001       char * name;
31002     } font;
31003
31004
31005     struct {
31006       long size;
31007       void * list;
31008     } prerequisiteQuery;
31009
31010     long prerequisiteItem;
31011
31012     long variationQueryResult;
31013   } info;
31014 };
31015 typedef struct scalerStream scalerStream;
31016 struct scalerStreamData {
31017   long hexFlag;
31018   long byteCount;
31019   const void * data;
31020 };
31021 typedef struct scalerStreamData scalerStreamData;
31022
31023
31024
31025
31026 extern "C" {
31027 }
31028
31029 typedef struct CGAffineTransform CGAffineTransform;
31030
31031
31032 extern "C" {
31033
31034
31035
31036 struct CGPoint {
31037     float x;
31038     float y;
31039 };
31040 typedef struct CGPoint CGPoint;
31041
31042
31043
31044 struct CGSize {
31045     float width;
31046     float height;
31047 };
31048 typedef struct CGSize CGSize;
31049
31050
31051
31052 struct CGRect {
31053     CGPoint origin;
31054     CGSize size;
31055 };
31056 typedef struct CGRect CGRect;
31057
31058
31059
31060 enum CGRectEdge {
31061     CGRectMinXEdge, CGRectMinYEdge, CGRectMaxXEdge, CGRectMaxYEdge
31062 };
31063 typedef enum CGRectEdge CGRectEdge;
31064
31065
31066
31067 extern const CGPoint CGPointZero;
31068
31069
31070
31071 extern const CGSize CGSizeZero;
31072
31073
31074
31075 extern const CGRect CGRectZero;
31076
31077
31078
31079
31080
31081 extern const CGRect CGRectNull;
31082
31083
31084
31085 static inline CGPoint CGPointMake(float x, float y);
31086
31087
31088
31089 static inline CGSize CGSizeMake(float width, float height);
31090
31091
31092
31093 static inline CGRect CGRectMake(float x, float y, float width, float height);
31094
31095
31096
31097 extern float CGRectGetMinX(CGRect rect);
31098
31099
31100
31101 extern float CGRectGetMidX(CGRect rect);
31102
31103
31104
31105 extern float CGRectGetMaxX(CGRect rect);
31106
31107
31108
31109 extern float CGRectGetMinY(CGRect rect);
31110
31111
31112
31113 extern float CGRectGetMidY(CGRect rect);
31114
31115
31116
31117 extern float CGRectGetMaxY(CGRect rect);
31118
31119
31120
31121 extern float CGRectGetWidth(CGRect rect);
31122
31123
31124
31125 extern float CGRectGetHeight(CGRect rect);
31126
31127
31128
31129 extern int CGPointEqualToPoint(CGPoint point1, CGPoint point2);
31130
31131
31132
31133 extern int CGSizeEqualToSize(CGSize size1, CGSize size2);
31134
31135
31136
31137 extern int CGRectEqualToRect(CGRect rect1, CGRect rect2);
31138
31139
31140
31141
31142 extern CGRect CGRectStandardize(CGRect rect);
31143
31144
31145
31146
31147 extern int CGRectIsEmpty(CGRect rect);
31148
31149
31150
31151
31152 extern int CGRectIsNull(CGRect rect);
31153
31154
31155
31156
31157 extern CGRect CGRectInset(CGRect rect, float dx, float dy);
31158
31159
31160
31161
31162 extern CGRect CGRectIntegral(CGRect rect);
31163
31164
31165
31166 extern CGRect CGRectUnion(CGRect r1, CGRect r2);
31167
31168
31169
31170
31171 extern CGRect CGRectIntersection(CGRect r1, CGRect r2);
31172
31173
31174
31175 extern CGRect CGRectOffset(CGRect rect, float dx, float dy);
31176
31177
31178
31179
31180
31181
31182
31183 extern void CGRectDivide(CGRect rect, CGRect *slice, CGRect *remainder, float amount, CGRectEdge edge);
31184
31185
31186
31187 extern int CGRectContainsPoint(CGRect rect, CGPoint point);
31188
31189
31190
31191
31192
31193 extern int CGRectContainsRect(CGRect rect1, CGRect rect2);
31194
31195
31196
31197
31198
31199 extern int CGRectIntersectsRect(CGRect rect1, CGRect rect2);
31200
31201
31202
31203 static inline CGPoint CGPointMake(float x, float y)
31204 {
31205     CGPoint p; p.x = x; p.y = y; return p;
31206 }
31207
31208 static inline CGSize CGSizeMake(float width, float height)
31209 {
31210     CGSize size; size.width = width; size.height = height; return size;
31211 }
31212
31213 static inline CGRect CGRectMake(float x, float y, float width, float height)
31214 {
31215     CGRect rect;
31216     rect.origin.x = x; rect.origin.y = y;
31217     rect.size.width = width; rect.size.height = height;
31218     return rect;
31219 }
31220
31221 }
31222
31223 extern "C" {
31224
31225 struct CGAffineTransform {
31226     float a, b, c, d;
31227     float tx, ty;
31228 };
31229
31230
31231
31232 extern const CGAffineTransform CGAffineTransformIdentity;
31233
31234
31235
31236 extern CGAffineTransform CGAffineTransformMake(float a, float b, float c, float d, float tx, float ty);
31237
31238
31239
31240
31241 extern CGAffineTransform CGAffineTransformMakeTranslation(float tx, float ty);
31242
31243
31244
31245
31246 extern CGAffineTransform CGAffineTransformMakeScale(float sx, float sy);
31247
31248
31249
31250
31251 extern CGAffineTransform CGAffineTransformMakeRotation(float angle);
31252
31253
31254
31255
31256 extern CGAffineTransform CGAffineTransformTranslate(CGAffineTransform t, float tx, float ty);
31257
31258
31259
31260
31261 extern CGAffineTransform CGAffineTransformScale(CGAffineTransform t, float sx, float sy);
31262
31263
31264
31265
31266 extern CGAffineTransform CGAffineTransformRotate(CGAffineTransform t, float angle);
31267
31268
31269
31270
31271 extern CGAffineTransform CGAffineTransformInvert(CGAffineTransform t);
31272
31273
31274
31275
31276 extern CGAffineTransform CGAffineTransformConcat(CGAffineTransform t1, CGAffineTransform t2);
31277
31278
31279
31280
31281
31282 extern CGPoint CGPointApplyAffineTransform(CGPoint point, CGAffineTransform t);
31283
31284
31285
31286
31287
31288 extern CGSize CGSizeApplyAffineTransform(CGSize size, CGAffineTransform t);
31289
31290
31291
31292 static inline CGAffineTransform
31293 __CGAffineTransformMake(float a, float b, float c, float d, float tx, float ty)
31294 {
31295     CGAffineTransform t;
31296
31297     t.a = a; t.b = b; t.c = c; t.d = d; t.tx = tx; t.ty = ty;
31298     return t;
31299 }
31300
31301
31302
31303 static inline CGPoint
31304 __CGPointApplyAffineTransform(CGPoint point, CGAffineTransform t)
31305 {
31306     CGPoint p;
31307
31308     p.x = t.a * point.x + t.c * point.y + t.tx;
31309     p.y = t.b * point.x + t.d * point.y + t.ty;
31310     return p;
31311 }
31312
31313
31314
31315 static inline CGSize
31316 __CGSizeApplyAffineTransform(CGSize size, CGAffineTransform t)
31317 {
31318     CGSize s;
31319
31320     s.width = t.a * size.width + t.c * size.height;
31321     s.height = t.b * size.width + t.d * size.height;
31322     return s;
31323 }
31324
31325
31326
31327 }
31328 typedef struct CGContext *CGContextRef;
31329
31330
31331
31332 typedef struct CGColorSpace *CGColorSpaceRef;
31333
31334
31335 typedef struct CGDataProvider *CGDataProviderRef;
31336
31337
31338
31339
31340 extern "C" {
31341 struct CGDataProviderCallbacks {
31342     size_t (*getBytes)(void *info, void *buffer, size_t count);
31343     void (*skipBytes)(void *info, size_t count);
31344     void (*rewind)(void *info);
31345     void (*releaseProvider)(void *info);
31346 };
31347 typedef struct CGDataProviderCallbacks CGDataProviderCallbacks;
31348 struct CGDataProviderDirectAccessCallbacks {
31349     const void *(*getBytePointer)(void *info);
31350     void (*releaseBytePointer)(void *info, const void *pointer);
31351     size_t (*getBytes)(void *info, void *buffer, size_t offset, size_t count);
31352     void (*releaseProvider)(void *info);
31353 };
31354 typedef struct CGDataProviderDirectAccessCallbacks CGDataProviderDirectAccessCallbacks;
31355
31356
31357
31358 extern CFTypeID CGDataProviderGetTypeID(void);
31359
31360
31361
31362
31363 extern CGDataProviderRef CGDataProviderCreate(void *info, const CGDataProviderCallbacks *callbacks);
31364
31365
31366
31367
31368 extern CGDataProviderRef CGDataProviderCreateDirectAccess(void *info, size_t size, const CGDataProviderDirectAccessCallbacks *callbacks);
31369
31370
31371
31372
31373
31374 extern CGDataProviderRef CGDataProviderCreateWithData(void *info, const void *data, size_t size, void (*releaseData)(void *info, const void *data, size_t size));
31375
31376
31377
31378 extern CGDataProviderRef CGDataProviderCreateWithURL(CFURLRef url);
31379
31380
31381
31382 extern CGDataProviderRef CGDataProviderRetain(CGDataProviderRef provider);
31383
31384
31385
31386 extern void CGDataProviderRelease(CGDataProviderRef provider);
31387
31388
31389
31390
31391
31392 extern CGDataProviderRef CGDataProviderCreateWithFilename(const char *filename);
31393
31394 }
31395
31396 enum CGColorRenderingIntent {
31397     kCGRenderingIntentDefault,
31398     kCGRenderingIntentAbsoluteColorimetric,
31399     kCGRenderingIntentRelativeColorimetric,
31400     kCGRenderingIntentPerceptual,
31401     kCGRenderingIntentSaturation
31402 };
31403 typedef enum CGColorRenderingIntent CGColorRenderingIntent;
31404
31405
31406
31407
31408
31409 extern "C" {
31410
31411
31412
31413 extern CFTypeID CGColorSpaceGetTypeID(void);
31414
31415
31416
31417
31418
31419 extern CGColorSpaceRef CGColorSpaceCreateDeviceGray(void);
31420
31421
31422
31423 extern CGColorSpaceRef CGColorSpaceCreateDeviceRGB(void);
31424
31425
31426
31427 extern CGColorSpaceRef CGColorSpaceCreateDeviceCMYK(void);
31428 extern CGColorSpaceRef CGColorSpaceCreateCalibratedGray(const float whitePoint[3], const float blackPoint[3], float gamma);
31429 extern CGColorSpaceRef CGColorSpaceCreateCalibratedRGB(const float whitePoint[3], const float blackPoint[3], const float gamma[3], const float matrix[9]);
31430 extern CGColorSpaceRef CGColorSpaceCreateLab(const float whitePoint[3], const float blackPoint[3], const float range[4]);
31431 extern CGColorSpaceRef CGColorSpaceCreateICCBased(size_t nComponents, const float *range, CGDataProviderRef profile, CGColorSpaceRef alternate);
31432 extern CGColorSpaceRef CGColorSpaceCreateIndexed(CGColorSpaceRef baseSpace, size_t lastIndex, const unsigned char *colorTable);
31433
31434
31435
31436
31437
31438
31439 extern CGColorSpaceRef CGColorSpaceCreatePattern(CGColorSpaceRef baseSpace);
31440
31441
31442
31443
31444
31445 extern CGColorSpaceRef CGColorSpaceCreateWithPlatformColorSpace(void *platformColorSpaceReference);
31446
31447
31448
31449 extern CGColorSpaceRef CGColorSpaceCreateWithName(CFStringRef name);
31450
31451
31452
31453
31454
31455 extern size_t CGColorSpaceGetNumberOfComponents(const CGColorSpaceRef cs);
31456
31457
31458
31459
31460
31461 extern CGColorSpaceRef CGColorSpaceRetain(CGColorSpaceRef cs);
31462
31463
31464
31465 extern void CGColorSpaceRelease(CGColorSpaceRef cs);
31466
31467 }
31468 typedef struct CGFont *CGFontRef;
31469 typedef unsigned short CGFontIndex;
31470 typedef CGFontIndex CGGlyph;
31471
31472
31473
31474
31475
31476 enum {
31477     kCGFontIndexMax = ((1 << 16) - 2),
31478     kCGFontIndexInvalid = ((1 << 16) - 1),
31479     kCGGlyphMax = kCGFontIndexMax
31480 };
31481
31482 extern "C" {
31483
31484
31485
31486 extern CFTypeID CGFontGetTypeID(void);
31487
31488
31489
31490
31491
31492 extern CGFontRef CGFontCreateWithPlatformFont(void *platformFontReference);
31493
31494
31495
31496 extern CGFontRef CGFontRetain(CGFontRef font);
31497
31498
31499
31500 extern void CGFontRelease(CGFontRef font);
31501
31502 }
31503
31504
31505
31506 enum {
31507     CGGlyphMin = 0,
31508     CGGlyphMax = kCGGlyphMax
31509 };
31510 typedef struct CGImage *CGImageRef;
31511
31512
31513
31514
31515
31516
31517 extern "C" {
31518
31519 enum CGImageAlphaInfo {
31520     kCGImageAlphaNone,
31521     kCGImageAlphaPremultipliedLast,
31522     kCGImageAlphaPremultipliedFirst,
31523     kCGImageAlphaLast,
31524     kCGImageAlphaFirst,
31525     kCGImageAlphaNoneSkipLast,
31526     kCGImageAlphaNoneSkipFirst
31527 };
31528 typedef enum CGImageAlphaInfo CGImageAlphaInfo;
31529
31530
31531
31532 extern CFTypeID CGImageGetTypeID(void);
31533
31534
31535
31536 extern CGImageRef CGImageCreate(size_t width, size_t height, size_t bitsPerComponent, size_t bitsPerPixel, size_t bytesPerRow, CGColorSpaceRef colorspace, CGImageAlphaInfo alphaInfo, CGDataProviderRef provider, const float decode[], bool shouldInterpolate, CGColorRenderingIntent intent);
31537
31538
31539
31540 extern CGImageRef CGImageMaskCreate(size_t width, size_t height, size_t bitsPerComponent, size_t bitsPerPixel, size_t bytesPerRow, CGDataProviderRef provider, const float decode[], bool shouldInterpolate);
31541
31542
31543
31544 extern CGImageRef CGImageCreateWithJPEGDataProvider(CGDataProviderRef source, const float decode[], bool shouldInterpolate, CGColorRenderingIntent intent);
31545
31546
31547
31548 extern CGImageRef CGImageCreateWithPNGDataProvider(CGDataProviderRef source, const float decode[], bool shouldInterpolate, CGColorRenderingIntent intent);
31549
31550
31551
31552 extern CGImageRef CGImageRetain(CGImageRef image);
31553
31554
31555
31556 extern void CGImageRelease(CGImageRef image);
31557
31558
31559
31560 extern bool CGImageIsMask(CGImageRef image);
31561
31562
31563
31564 extern size_t CGImageGetWidth(CGImageRef image);
31565
31566
31567
31568 extern size_t CGImageGetHeight(CGImageRef image);
31569
31570
31571
31572 extern size_t CGImageGetBitsPerComponent(CGImageRef image);
31573
31574
31575
31576 extern size_t CGImageGetBitsPerPixel(CGImageRef image);
31577
31578
31579
31580 extern size_t CGImageGetBytesPerRow(CGImageRef image);
31581
31582
31583
31584
31585 extern CGColorSpaceRef CGImageGetColorSpace(CGImageRef image);
31586
31587
31588
31589 extern CGImageAlphaInfo CGImageGetAlphaInfo(CGImageRef image);
31590
31591
31592
31593 extern CGDataProviderRef CGImageGetDataProvider(CGImageRef image);
31594
31595
31596
31597 extern const float *CGImageGetDecode(CGImageRef image);
31598
31599
31600
31601 extern bool CGImageGetShouldInterpolate(CGImageRef image);
31602
31603
31604
31605 extern CGColorRenderingIntent CGImageGetRenderingIntent(CGImageRef image);
31606
31607 }
31608 typedef struct CGPath *CGMutablePathRef;
31609 typedef const struct CGPath *CGPathRef;
31610
31611
31612
31613
31614
31615 extern "C" {
31616
31617
31618
31619 extern CFTypeID CGPathGetTypeID(void);
31620
31621
31622
31623 extern CGMutablePathRef CGPathCreateMutable(void);
31624
31625
31626
31627 extern CGPathRef CGPathCreateCopy(CGPathRef path);
31628
31629
31630
31631 extern CGMutablePathRef CGPathCreateMutableCopy(CGPathRef path);
31632
31633
31634
31635 extern CGPathRef CGPathRetain(CGPathRef path);
31636
31637
31638
31639 extern void CGPathRelease(CGPathRef path);
31640
31641
31642
31643 extern bool CGPathEqualToPath(CGPathRef path1, CGPathRef path2);
31644
31645
31646
31647
31648
31649
31650 extern void CGPathMoveToPoint(CGMutablePathRef path, const CGAffineTransform *m, float x, float y);
31651
31652
31653
31654
31655
31656 extern void CGPathAddLineToPoint(CGMutablePathRef path, const CGAffineTransform *m, float x, float y);
31657
31658
31659
31660
31661
31662 extern void CGPathAddQuadCurveToPoint(CGMutablePathRef path, const CGAffineTransform *m, float cpx, float cpy, float x, float y);
31663
31664
31665
31666
31667
31668
31669 extern void CGPathAddCurveToPoint(CGMutablePathRef path, const CGAffineTransform *m, float cp1x, float cp1y, float cp2x, float cp2y, float x, float y);
31670
31671
31672
31673
31674 extern void CGPathCloseSubpath(CGMutablePathRef path);
31675
31676
31677
31678
31679
31680
31681 extern void CGPathAddRect(CGMutablePathRef path, const CGAffineTransform *m, CGRect rect);
31682
31683
31684
31685
31686
31687 extern void CGPathAddRects(CGMutablePathRef path, const CGAffineTransform *m, const CGRect rects[], size_t count);
31688
31689
31690
31691
31692
31693 extern void CGPathAddLines(CGMutablePathRef path, const CGAffineTransform *m, const CGPoint points[], size_t count);
31694 extern void CGPathAddArc(CGMutablePathRef path, const CGAffineTransform *m, float x, float y, float radius, float startAngle, float endAngle, bool clockwise);
31695 extern void CGPathAddArcToPoint(CGMutablePathRef path, const CGAffineTransform *m, float x1, float y1, float x2, float y2, float radius);
31696
31697
31698
31699
31700 extern void CGPathAddPath(CGMutablePathRef path1, const CGAffineTransform *m, CGPathRef path2);
31701
31702
31703
31704
31705
31706 extern bool CGPathIsEmpty(CGPathRef path);
31707
31708
31709
31710 extern bool CGPathIsRect(CGPathRef path, CGRect *rect);
31711
31712
31713
31714
31715 extern CGPoint CGPathGetCurrentPoint(CGPathRef path);
31716
31717
31718
31719
31720
31721
31722 extern CGRect CGPathGetBoundingBox(CGPathRef path);
31723
31724 enum CGPathElementType {
31725     kCGPathElementMoveToPoint,
31726     kCGPathElementAddLineToPoint,
31727     kCGPathElementAddQuadCurveToPoint,
31728     kCGPathElementAddCurveToPoint,
31729     kCGPathElementCloseSubpath
31730 };
31731 typedef enum CGPathElementType CGPathElementType;
31732
31733 struct CGPathElement {
31734     CGPathElementType type;
31735     CGPoint *points;
31736 };
31737 typedef struct CGPathElement CGPathElement;
31738
31739 typedef void (*CGPathApplierFunction)(void *info, const CGPathElement *element);
31740
31741 extern void CGPathApply(CGPathRef path, void *info, CGPathApplierFunction function);
31742
31743 }
31744 typedef struct CGPattern *CGPatternRef;
31745
31746
31747 enum CGPatternTiling {
31748     kCGPatternTilingNoDistortion,
31749     kCGPatternTilingConstantSpacingMinimalDistortion,
31750     kCGPatternTilingConstantSpacing
31751 };
31752 typedef enum CGPatternTiling CGPatternTiling;
31753
31754 extern "C" {
31755 typedef void (*CGPatternDrawPatternCallback)(void *info, CGContextRef c);
31756 typedef void (*CGPatternReleaseInfoCallback)(void *info);
31757
31758 struct CGPatternCallbacks {
31759     unsigned int version;
31760     CGPatternDrawPatternCallback drawPattern;
31761     CGPatternReleaseInfoCallback releaseInfo;
31762 };
31763 typedef struct CGPatternCallbacks CGPatternCallbacks;
31764
31765
31766
31767 extern CFTypeID CGPatternGetTypeID(void);
31768
31769
31770
31771 extern CGPatternRef CGPatternCreate(void *info, CGRect bounds, CGAffineTransform matrix, float xStep, float yStep, CGPatternTiling tiling, bool isColored, const CGPatternCallbacks *callbacks);
31772
31773
31774
31775 extern CGPatternRef CGPatternRetain(CGPatternRef pattern);
31776
31777
31778
31779 extern void CGPatternRelease(CGPatternRef pattern);
31780
31781 }
31782 typedef struct CGPDFDocument *CGPDFDocumentRef;
31783
31784
31785
31786
31787
31788
31789 extern "C" {
31790
31791
31792
31793 extern CFTypeID CGPDFDocumentGetTypeID(void);
31794
31795
31796
31797
31798 extern CGPDFDocumentRef CGPDFDocumentCreateWithProvider(CGDataProviderRef provider);
31799
31800
31801
31802 extern CGPDFDocumentRef CGPDFDocumentCreateWithURL(CFURLRef url);
31803
31804
31805
31806 extern CGPDFDocumentRef CGPDFDocumentRetain(CGPDFDocumentRef document);
31807
31808
31809
31810 extern void CGPDFDocumentRelease(CGPDFDocumentRef document);
31811
31812
31813
31814
31815
31816
31817 extern bool CGPDFDocumentIsEncrypted(CGPDFDocumentRef document);
31818
31819
31820
31821
31822
31823 extern bool CGPDFDocumentUnlockWithPassword(CGPDFDocumentRef document, const char *password);
31824
31825
31826
31827
31828
31829 extern bool CGPDFDocumentIsUnlocked(CGPDFDocumentRef document);
31830
31831
31832
31833
31834
31835
31836 extern bool CGPDFDocumentAllowsPrinting(CGPDFDocumentRef document);
31837
31838
31839
31840
31841
31842
31843 extern bool CGPDFDocumentAllowsCopying(CGPDFDocumentRef document);
31844
31845
31846
31847 extern size_t CGPDFDocumentGetNumberOfPages(CGPDFDocumentRef document);
31848
31849
31850
31851 extern CGRect CGPDFDocumentGetMediaBox(CGPDFDocumentRef document, int page);
31852
31853
31854
31855 extern CGRect CGPDFDocumentGetCropBox(CGPDFDocumentRef document, int page);
31856
31857
31858
31859 extern CGRect CGPDFDocumentGetBleedBox(CGPDFDocumentRef document, int page);
31860
31861
31862
31863 extern CGRect CGPDFDocumentGetTrimBox(CGPDFDocumentRef document, int page);
31864
31865
31866
31867 extern CGRect CGPDFDocumentGetArtBox(CGPDFDocumentRef document, int page);
31868
31869
31870
31871
31872 extern int CGPDFDocumentGetRotationAngle(CGPDFDocumentRef document, int page);
31873
31874 }
31875 typedef struct CGFunction *CGFunctionRef;
31876 typedef void (*CGFunctionEvaluateCallback)(void *info, const float *in, float *out);
31877 typedef void (*CGFunctionReleaseInfoCallback)(void *info);
31878 struct CGFunctionCallbacks {
31879     unsigned int version;
31880     CGFunctionEvaluateCallback evaluate;
31881     CGFunctionReleaseInfoCallback releaseInfo;
31882 };
31883 typedef struct CGFunctionCallbacks CGFunctionCallbacks;
31884
31885 extern "C" {
31886
31887
31888
31889
31890
31891 extern CFTypeID CGFunctionGetTypeID(void);
31892 extern CGFunctionRef CGFunctionCreate(void *info, size_t domainDimension, const float *domain, size_t rangeDimension, const float *range, const CGFunctionCallbacks *callbacks);
31893
31894
31895
31896
31897
31898
31899 extern CGFunctionRef CGFunctionRetain(CGFunctionRef function);
31900
31901
31902
31903
31904
31905
31906 extern void CGFunctionRelease(CGFunctionRef function);
31907
31908 }
31909
31910
31911
31912 typedef struct CGShading *CGShadingRef;
31913
31914 extern "C" {
31915
31916
31917
31918
31919
31920 extern CFTypeID CGShadingGetTypeID(void);
31921 extern CGShadingRef CGShadingCreateAxial(CGColorSpaceRef colorspace, CGPoint start, CGPoint end, CGFunctionRef function, bool extendStart, bool extendEnd);
31922 extern CGShadingRef CGShadingCreateRadial(CGColorSpaceRef colorspace, CGPoint start, float startRadius, CGPoint end, float endRadius, CGFunctionRef function, bool extendStart, bool extendEnd);
31923
31924
31925
31926
31927
31928
31929 extern CGShadingRef CGShadingRetain(CGShadingRef shading);
31930
31931
31932
31933
31934
31935
31936 extern void CGShadingRelease(CGShadingRef shading);
31937
31938 }
31939
31940
31941 extern "C" {
31942
31943
31944
31945 enum CGLineJoin {
31946     kCGLineJoinMiter,
31947     kCGLineJoinRound,
31948     kCGLineJoinBevel
31949 };
31950 typedef enum CGLineJoin CGLineJoin;
31951
31952
31953
31954 enum CGLineCap {
31955     kCGLineCapButt,
31956     kCGLineCapRound,
31957     kCGLineCapSquare
31958 };
31959 typedef enum CGLineCap CGLineCap;
31960
31961
31962
31963 enum CGPathDrawingMode {
31964     kCGPathFill,
31965     kCGPathEOFill,
31966     kCGPathStroke,
31967     kCGPathFillStroke,
31968     kCGPathEOFillStroke
31969 };
31970 typedef enum CGPathDrawingMode CGPathDrawingMode;
31971
31972
31973
31974 enum CGTextDrawingMode {
31975     kCGTextFill,
31976     kCGTextStroke,
31977     kCGTextFillStroke,
31978     kCGTextInvisible,
31979     kCGTextFillClip,
31980     kCGTextStrokeClip,
31981     kCGTextFillStrokeClip,
31982     kCGTextClip
31983 };
31984 typedef enum CGTextDrawingMode CGTextDrawingMode;
31985
31986
31987
31988 enum CGTextEncoding {
31989     kCGEncodingFontSpecific,
31990     kCGEncodingMacRoman
31991 };
31992 typedef enum CGTextEncoding CGTextEncoding;
31993
31994 enum CGInterpolationQuality {
31995     kCGInterpolationDefault,
31996     kCGInterpolationNone,
31997     kCGInterpolationLow,
31998     kCGInterpolationHigh
31999 };
32000 typedef enum CGInterpolationQuality CGInterpolationQuality;
32001
32002
32003
32004 extern CFTypeID CGContextGetTypeID(void);
32005
32006
32007
32008
32009
32010
32011
32012 extern void CGContextSaveGState(CGContextRef c);
32013
32014
32015
32016
32017
32018 extern void CGContextRestoreGState(CGContextRef c);
32019
32020
32021
32022
32023
32024
32025 extern void CGContextScaleCTM(CGContextRef c, float sx, float sy);
32026
32027
32028
32029
32030 extern void CGContextTranslateCTM(CGContextRef c, float tx, float ty);
32031
32032
32033
32034
32035 extern void CGContextRotateCTM(CGContextRef c, float angle);
32036
32037
32038
32039
32040 extern void CGContextConcatCTM(CGContextRef c, CGAffineTransform transform);
32041
32042
32043
32044 extern CGAffineTransform CGContextGetCTM(CGContextRef c);
32045
32046
32047
32048
32049
32050 extern void CGContextSetLineWidth(CGContextRef c, float width);
32051
32052
32053
32054 extern void CGContextSetLineCap(CGContextRef c, CGLineCap cap);
32055
32056
32057
32058 extern void CGContextSetLineJoin(CGContextRef c, CGLineJoin join);
32059
32060
32061
32062 extern void CGContextSetMiterLimit(CGContextRef c, float limit);
32063
32064
32065
32066 extern void CGContextSetLineDash(CGContextRef c, float phase, const float lengths[], size_t count);
32067
32068
32069
32070
32071 extern void CGContextSetFlatness(CGContextRef c, float flatness);
32072
32073
32074
32075 extern void CGContextSetAlpha(CGContextRef c, float alpha);
32076 extern void CGContextBeginPath(CGContextRef c);
32077
32078
32079
32080 extern void CGContextMoveToPoint(CGContextRef c, float x, float y);
32081
32082
32083
32084 extern void CGContextAddLineToPoint(CGContextRef c, float x, float y);
32085
32086
32087
32088
32089 extern void CGContextAddCurveToPoint(CGContextRef c, float cp1x, float cp1y, float cp2x, float cp2y, float x, float y);
32090
32091
32092
32093
32094 extern void CGContextAddQuadCurveToPoint(CGContextRef c, float cpx, float cpy, float x, float y);
32095
32096
32097
32098 extern void CGContextClosePath(CGContextRef c);
32099
32100
32101
32102
32103
32104 extern void CGContextAddRect(CGContextRef c, CGRect rect);
32105
32106
32107
32108 extern void CGContextAddRects(CGContextRef c, const CGRect rects[], size_t count);
32109
32110
32111
32112 extern void CGContextAddLines(CGContextRef c, const CGPoint points[], size_t count);
32113 extern void CGContextAddArc(CGContextRef c, float x, float y, float radius, float startAngle, float endAngle, int clockwise);
32114
32115
32116
32117
32118
32119
32120 extern void CGContextAddArcToPoint(CGContextRef c, float x1, float y1, float x2, float y2, float radius);
32121
32122
32123
32124
32125 extern void CGContextAddPath(CGContextRef context, CGPathRef path);
32126
32127
32128
32129
32130
32131 extern int CGContextIsPathEmpty(CGContextRef c);
32132
32133
32134
32135
32136 extern CGPoint CGContextGetPathCurrentPoint(CGContextRef c);
32137
32138
32139
32140
32141
32142 extern CGRect CGContextGetPathBoundingBox(CGContextRef c);
32143
32144
32145
32146
32147
32148 extern void CGContextDrawPath(CGContextRef c, CGPathDrawingMode mode);
32149
32150
32151
32152
32153
32154
32155 extern void CGContextFillPath(CGContextRef c);
32156
32157
32158
32159
32160 extern void CGContextEOFillPath(CGContextRef c);
32161
32162
32163
32164 extern void CGContextStrokePath(CGContextRef c);
32165
32166
32167
32168 extern void CGContextFillRect(CGContextRef c, CGRect rect);
32169
32170
32171
32172
32173 extern void CGContextFillRects(CGContextRef c, const CGRect rects[], size_t count);
32174
32175
32176
32177 extern void CGContextStrokeRect(CGContextRef c, CGRect rect);
32178
32179
32180
32181
32182 extern void CGContextStrokeRectWithWidth(CGContextRef c, CGRect rect, float width);
32183
32184
32185
32186
32187 extern void CGContextClearRect(CGContextRef c, CGRect rect);
32188
32189
32190
32191
32192
32193
32194
32195 extern void CGContextClip(CGContextRef c);
32196
32197
32198
32199
32200
32201 extern void CGContextEOClip(CGContextRef c);
32202
32203
32204
32205
32206
32207
32208 extern void CGContextClipToRect(CGContextRef c, CGRect rect);
32209
32210
32211
32212
32213
32214 extern void CGContextClipToRects(CGContextRef c, const CGRect rects[], size_t count);
32215
32216
32217
32218
32219
32220
32221
32222 extern void CGContextSetFillColorSpace(CGContextRef c, CGColorSpaceRef colorspace);
32223
32224
32225
32226
32227
32228 extern void CGContextSetStrokeColorSpace(CGContextRef c, CGColorSpaceRef colorspace);
32229 extern void CGContextSetFillColor(CGContextRef c, const float components[]);
32230
32231
32232
32233
32234
32235
32236
32237 extern void CGContextSetStrokeColor(CGContextRef c, const float components[]);
32238 extern void CGContextSetFillPattern(CGContextRef c, CGPatternRef pattern, const float components[]);
32239 extern void CGContextSetStrokePattern(CGContextRef c, CGPatternRef pattern, const float components[]);
32240
32241
32242
32243 extern void CGContextSetPatternPhase(CGContextRef c, CGSize phase);
32244
32245
32246
32247
32248
32249
32250 extern void CGContextSetGrayFillColor(CGContextRef c, float gray, float alpha);
32251
32252
32253
32254
32255 extern void CGContextSetGrayStrokeColor(CGContextRef c, float gray, float alpha);
32256
32257
32258
32259
32260
32261 extern void CGContextSetRGBFillColor(CGContextRef c, float red, float green, float blue, float alpha);
32262
32263
32264
32265
32266
32267 extern void CGContextSetRGBStrokeColor(CGContextRef c, float red, float green, float blue, float alpha);
32268
32269
32270
32271
32272
32273 extern void CGContextSetCMYKFillColor(CGContextRef c, float cyan, float magenta, float yellow, float black, float alpha);
32274
32275
32276
32277
32278
32279 extern void CGContextSetCMYKStrokeColor(CGContextRef c, float cyan, float magenta, float yellow, float black, float alpha);
32280
32281
32282
32283
32284
32285 extern void CGContextSetRenderingIntent(CGContextRef c, CGColorRenderingIntent intent);
32286
32287
32288
32289
32290
32291
32292 extern void CGContextDrawImage(CGContextRef c, CGRect rect, CGImageRef image);
32293
32294
32295
32296
32297
32298
32299
32300 extern CGInterpolationQuality CGContextGetInterpolationQuality(CGContextRef c);
32301
32302
32303
32304 extern void CGContextSetInterpolationQuality(CGContextRef c, CGInterpolationQuality quality);
32305
32306
32307
32308
32309
32310 extern void CGContextDrawShading(CGContextRef c, CGShadingRef shading);
32311
32312
32313
32314
32315
32316
32317
32318 extern void CGContextSetCharacterSpacing(CGContextRef c, float spacing);
32319
32320
32321
32322
32323 extern void CGContextSetTextPosition(CGContextRef c, float x, float y);
32324
32325
32326
32327
32328 extern CGPoint CGContextGetTextPosition(CGContextRef c);
32329
32330
32331
32332 extern void CGContextSetTextMatrix(CGContextRef c, CGAffineTransform t);
32333
32334
32335
32336 extern CGAffineTransform CGContextGetTextMatrix(CGContextRef c);
32337
32338
32339
32340 extern void CGContextSetTextDrawingMode(CGContextRef c, CGTextDrawingMode mode);
32341
32342
32343
32344 extern void CGContextSetFont(CGContextRef c, CGFontRef font);
32345
32346
32347
32348 extern void CGContextSetFontSize(CGContextRef c, float size);
32349
32350
32351
32352
32353
32354 extern void CGContextSelectFont(CGContextRef c, const char *name, float size, CGTextEncoding textEncoding);
32355
32356
32357
32358
32359
32360
32361 extern void CGContextShowText(CGContextRef c, const char *string, size_t length);
32362
32363
32364
32365
32366 extern void CGContextShowGlyphs(CGContextRef c, const CGGlyph g[], size_t count);
32367 extern void CGContextShowTextAtPoint(CGContextRef c, float x, float y, const char *string, size_t length);
32368
32369
32370
32371
32372
32373 extern void CGContextShowGlyphsAtPoint(CGContextRef c, float x, float y, const CGGlyph glyphs[], size_t count);
32374
32375
32376
32377
32378
32379
32380
32381 extern void CGContextDrawPDFDocument(CGContextRef c, CGRect rect, CGPDFDocumentRef document, int page);
32382
32383
32384
32385
32386
32387 extern void CGContextBeginPage(CGContextRef c, const CGRect *mediaBox);
32388
32389
32390
32391 extern void CGContextEndPage(CGContextRef c);
32392
32393
32394
32395
32396
32397 extern CGContextRef CGContextRetain(CGContextRef c);
32398
32399
32400
32401 extern void CGContextRelease(CGContextRef c);
32402
32403
32404
32405 extern void CGContextFlush(CGContextRef c);
32406
32407
32408
32409 extern void CGContextSynchronize(CGContextRef c);
32410
32411
32412
32413
32414
32415
32416 extern void CGContextSetShouldAntialias(CGContextRef c, bool shouldAntialias);
32417
32418
32419
32420
32421
32422
32423 extern void CGContextSetShouldSmoothFonts(CGContextRef c, bool shouldSmoothFonts);
32424
32425 }
32426
32427 extern "C" {
32428 extern CGContextRef CGBitmapContextCreate(void *data, size_t width, size_t height, size_t bitsPerComponent, size_t bytesPerRow, CGColorSpaceRef colorspace, CGImageAlphaInfo alphaInfo);
32429
32430
32431
32432
32433 extern void *CGBitmapContextGetData(CGContextRef c);
32434
32435
32436
32437
32438 extern size_t CGBitmapContextGetWidth(CGContextRef c);
32439
32440
32441
32442
32443 extern size_t CGBitmapContextGetHeight(CGContextRef c);
32444
32445
32446
32447
32448 extern size_t CGBitmapContextGetBitsPerComponent(CGContextRef c);
32449
32450
32451
32452
32453 extern size_t CGBitmapContextGetBitsPerPixel(CGContextRef c);
32454
32455
32456
32457
32458 extern size_t CGBitmapContextGetBytesPerRow(CGContextRef c);
32459
32460
32461
32462
32463 extern CGColorSpaceRef CGBitmapContextGetColorSpace(CGContextRef c);
32464
32465
32466
32467
32468 extern CGImageAlphaInfo CGBitmapContextGetAlphaInfo(CGContextRef c);
32469
32470 }
32471
32472
32473 typedef struct CGDataConsumer *CGDataConsumerRef;
32474
32475
32476
32477
32478 extern "C" {
32479
32480
32481
32482
32483
32484
32485
32486 struct CGDataConsumerCallbacks {
32487     size_t (*putBytes)(void *info, const void *buffer, size_t count);
32488     void (*releaseConsumer)(void *info);
32489 };
32490 typedef struct CGDataConsumerCallbacks CGDataConsumerCallbacks;
32491
32492
32493
32494 extern CFTypeID CGDataConsumerGetTypeID(void);
32495
32496
32497
32498
32499 extern CGDataConsumerRef CGDataConsumerCreate(void *info, const CGDataConsumerCallbacks *callbacks);
32500
32501
32502
32503 extern CGDataConsumerRef CGDataConsumerCreateWithURL(CFURLRef url);
32504
32505
32506
32507 extern CGDataConsumerRef CGDataConsumerRetain(CGDataConsumerRef consumer);
32508
32509
32510
32511 extern void CGDataConsumerRelease(CGDataConsumerRef consumer);
32512
32513 }
32514
32515 extern "C" {
32516
32517
32518 enum _CGError {
32519     kCGErrorSuccess = 0,
32520     kCGErrorFirst = 1000,
32521     kCGErrorFailure = kCGErrorFirst,
32522     kCGErrorIllegalArgument = 1001,
32523     kCGErrorInvalidConnection = 1002,
32524     kCGErrorInvalidContext = 1003,
32525     kCGErrorCannotComplete = 1004,
32526     kCGErrorNameTooLong = 1005,
32527     kCGErrorNotImplemented = 1006,
32528     kCGErrorRangeCheck = 1007,
32529     kCGErrorTypeCheck = 1008,
32530     kCGErrorNoCurrentPoint = 1009,
32531     kCGErrorInvalidOperation = 1010,
32532     kCGErrorNoneAvailable = 1011,
32533
32534
32535         kCGErrorApplicationRequiresNewerSystem = 1015,
32536
32537
32538
32539         kCGErrorApplicationNotPermittedToExecute = 1016,
32540
32541
32542     kCGErrorLast = kCGErrorApplicationRequiresNewerSystem
32543 };
32544 typedef int32_t CGError;
32545
32546 }
32547
32548
32549 extern double acos (double);
32550 extern double asin (double);
32551 extern double atan (double);
32552 extern double atan2 (double, double);
32553 extern double ceil (double);
32554 extern double cos (double);
32555 extern double cosh (double);
32556 extern double exp (double);
32557 extern double fabs (double);
32558 extern double floor (double);
32559 extern double fmod (double, double);
32560 extern double frexp (double, int *);
32561 extern double ldexp (double, int);
32562 extern double log10 (double);
32563 extern double log (double);
32564 extern double modf (double, double *);
32565 extern double pow (double, double);
32566 extern double sin (double);
32567 extern double sinh (double);
32568 extern double sqrt (double);
32569 extern double tan (double);
32570 extern double tanh (double);
32571
32572
32573 extern "C" {
32574
32575 typedef struct _CGDirectDisplayID * CGDirectDisplayID;
32576 typedef struct _CGDirectPaletteRef * CGDirectPaletteRef;
32577 typedef uint32_t CGDisplayCount;
32578 typedef uint32_t CGTableCount;
32579 typedef int32_t CGDisplayCoord;
32580 typedef uint8_t CGByteValue;
32581 typedef uint32_t CGOpenGLDisplayMask;
32582 typedef uint32_t CGBeamPosition;
32583 typedef int32_t CGMouseDelta;
32584 typedef double CGRefreshRate;
32585
32586 typedef CGError CGDisplayErr;
32587 CGDirectDisplayID CGMainDisplayID(void);
32588 CGDisplayErr CGGetDisplaysWithPoint(CGPoint point,
32589                              CGDisplayCount maxDisplays,
32590                              CGDirectDisplayID * dspys,
32591                              CGDisplayCount * dspyCnt);
32592
32593 CGDisplayErr CGGetDisplaysWithRect(CGRect rect,
32594                             CGDisplayCount maxDisplays,
32595                             CGDirectDisplayID * dspys,
32596                             CGDisplayCount * dspyCnt);
32597
32598 CGDisplayErr CGGetDisplaysWithOpenGLDisplayMask(CGOpenGLDisplayMask mask,
32599                             CGDisplayCount maxDisplays,
32600                             CGDirectDisplayID * dspys,
32601                             CGDisplayCount * dspyCnt);
32602 CGDisplayErr CGGetActiveDisplayList(CGDisplayCount maxDisplays,
32603                              CGDirectDisplayID * activeDspys,
32604                              CGDisplayCount * dspyCnt);
32605 CGDisplayErr CGGetOnlineDisplayList(CGDisplayCount maxDisplays,
32606                                     CGDirectDisplayID * onlineDspys,
32607                                     CGDisplayCount * dspyCnt);
32608
32609
32610 CGOpenGLDisplayMask CGDisplayIDToOpenGLDisplayMask(CGDirectDisplayID display);
32611
32612
32613
32614
32615
32616
32617
32618 CGDirectDisplayID CGOpenGLDisplayMaskToDisplayID(CGOpenGLDisplayMask mask);
32619
32620
32621 CGRect CGDisplayBounds(CGDirectDisplayID display);
32622
32623 size_t CGDisplayPixelsWide(CGDirectDisplayID display);
32624 size_t CGDisplayPixelsHigh(CGDirectDisplayID display);
32625 CFArrayRef CGDisplayAvailableModes(CGDirectDisplayID display);
32626 CFDictionaryRef CGDisplayBestModeForParameters(CGDirectDisplayID display, size_t bitsPerPixel, size_t width, size_t height, boolean_t * exactMatch);
32627
32628 CFDictionaryRef CGDisplayBestModeForParametersAndRefreshRate(CGDirectDisplayID display, size_t bitsPerPixel, size_t width, size_t height, CGRefreshRate refresh, boolean_t * exactMatch);
32629
32630 CFDictionaryRef CGDisplayBestModeForParametersAndRefreshRateWithProperty(CGDirectDisplayID display, size_t bitsPerPixel, size_t width, size_t height, CGRefreshRate refresh, CFStringRef property, boolean_t * exactMatch);
32631
32632
32633
32634
32635
32636 CFDictionaryRef CGDisplayCurrentMode(CGDirectDisplayID display);
32637 CGDisplayErr CGDisplaySwitchToMode(CGDirectDisplayID display, CFDictionaryRef mode);
32638
32639
32640 size_t CGDisplayBitsPerPixel(CGDirectDisplayID display);
32641 size_t CGDisplayBitsPerSample(CGDirectDisplayID display);
32642 size_t CGDisplaySamplesPerPixel(CGDirectDisplayID display);
32643 size_t CGDisplayBytesPerRow(CGDirectDisplayID display);
32644 typedef float CGGammaValue;
32645
32646 CGDisplayErr CGSetDisplayTransferByFormula(CGDirectDisplayID display,
32647                                     CGGammaValue redMin,
32648                                     CGGammaValue redMax,
32649                                     CGGammaValue redGamma,
32650                                     CGGammaValue greenMin,
32651                                     CGGammaValue greenMax,
32652                                     CGGammaValue greenGamma,
32653                                     CGGammaValue blueMin,
32654                                     CGGammaValue blueMax,
32655                                     CGGammaValue blueGamma);
32656
32657 CGDisplayErr CGGetDisplayTransferByFormula(CGDirectDisplayID display,
32658                                     CGGammaValue *redMin,
32659                                     CGGammaValue *redMax,
32660                                     CGGammaValue *redGamma,
32661                                     CGGammaValue *greenMin,
32662                                     CGGammaValue *greenMax,
32663                                     CGGammaValue *greenGamma,
32664                                     CGGammaValue *blueMin,
32665                                     CGGammaValue *blueMax,
32666                                     CGGammaValue *blueGamma);
32667 CGDisplayErr CGSetDisplayTransferByTable(CGDirectDisplayID display,
32668                                   CGTableCount tableSize,
32669                                   const CGGammaValue *redTable,
32670                                   const CGGammaValue *greenTable,
32671                                   const CGGammaValue *blueTable);
32672
32673
32674
32675
32676
32677
32678 CGDisplayErr CGGetDisplayTransferByTable(CGDirectDisplayID display,
32679                                   CGTableCount capacity,
32680                                   CGGammaValue *redTable,
32681                                   CGGammaValue *greenTable,
32682                                   CGGammaValue *blueTable,
32683                                   CGTableCount *sampleCount);
32684
32685
32686 CGDisplayErr CGSetDisplayTransferByByteTable(CGDirectDisplayID display,
32687                                       CGTableCount tableSize,
32688                                       const CGByteValue *redTable,
32689                                       const CGByteValue *greenTable,
32690                                       const CGByteValue *blueTable);
32691
32692
32693 void CGDisplayRestoreColorSyncSettings(void);
32694
32695
32696
32697 boolean_t CGDisplayIsCaptured(CGDirectDisplayID display);
32698 CGDisplayErr CGDisplayCapture(CGDirectDisplayID display);
32699 CGDisplayErr CGDisplayRelease(CGDirectDisplayID display);
32700
32701
32702
32703
32704
32705
32706 CGDisplayErr CGCaptureAllDisplays(void);
32707
32708
32709
32710
32711
32712 CGDisplayErr CGReleaseAllDisplays(void);
32713
32714
32715
32716
32717
32718 void * CGShieldingWindowID(CGDirectDisplayID display);
32719
32720
32721
32722
32723
32724
32725 int32_t CGShieldingWindowLevel(void);
32726
32727
32728
32729
32730
32731
32732 void * CGDisplayBaseAddress(CGDirectDisplayID display);
32733
32734
32735
32736
32737
32738
32739
32740 void * CGDisplayAddressForPosition(CGDirectDisplayID display, CGDisplayCoord x, CGDisplayCoord y);
32741
32742
32743
32744 CGDisplayErr CGDisplayHideCursor(CGDirectDisplayID display);
32745 CGDisplayErr CGDisplayShowCursor(CGDirectDisplayID display);
32746
32747
32748
32749
32750
32751
32752
32753 CGDisplayErr CGDisplayMoveCursorToPoint(CGDirectDisplayID display, CGPoint point);
32754
32755
32756
32757
32758
32759 void CGGetLastMouseDelta( CGMouseDelta * deltaX, CGMouseDelta * deltaY );
32760 boolean_t CGDisplayCanSetPalette(CGDirectDisplayID display);
32761 CGDisplayErr CGDisplaySetPalette(CGDirectDisplayID display, const CGDirectPaletteRef palette);
32762 CGDisplayErr CGDisplayWaitForBeamPositionOutsideLines( CGDirectDisplayID display,
32763                                                        CGBeamPosition upperScanLine,
32764                                                        CGBeamPosition lowerScanLine );
32765
32766
32767
32768
32769
32770
32771 CGBeamPosition CGDisplayBeamPosition( CGDirectDisplayID display );
32772
32773 }
32774 extern "C" {
32775
32776 typedef float CGPaletteBlendFraction;
32777
32778
32779
32780
32781
32782
32783
32784 struct _CGDeviceColor
32785 {
32786     float red;
32787     float green;
32788     float blue;
32789 };
32790 typedef struct _CGDeviceColor CGDeviceColor;
32791
32792 struct _CGDeviceByteColor
32793 {
32794     CGByteValue red;
32795     CGByteValue green;
32796     CGByteValue blue;
32797 };
32798 typedef struct _CGDeviceByteColor CGDeviceByteColor;
32799
32800
32801
32802
32803
32804 CGDirectPaletteRef CGPaletteCreateDefaultColorPalette(void);
32805
32806
32807
32808
32809
32810
32811 CGDirectPaletteRef CGPaletteCreateWithDisplay(CGDirectDisplayID display);
32812
32813
32814
32815
32816
32817 CGDirectPaletteRef CGPaletteCreateWithCapacity( CGTableCount capacity );
32818
32819
32820
32821
32822
32823 CGDirectPaletteRef CGPaletteCreateWithSamples(CGDeviceColor * sampleTable, CGTableCount sampleCount);
32824
32825
32826
32827
32828
32829
32830 CGDirectPaletteRef CGPaletteCreateWithByteSamples(CGDeviceByteColor * sampleTable, CGTableCount sampleCount);
32831
32832
32833
32834
32835 void CGPaletteRelease( CGDirectPaletteRef palette );
32836
32837
32838
32839
32840 CGDeviceColor CGPaletteGetColorAtIndex(CGDirectPaletteRef palette, CGTableCount index);
32841
32842
32843
32844
32845
32846
32847 CGTableCount CGPaletteGetIndexForColor(CGDirectPaletteRef palette, CGDeviceColor color);
32848
32849
32850
32851
32852 CGTableCount CGPaletteGetNumberOfSamples(CGDirectPaletteRef palette);
32853
32854
32855
32856
32857
32858 void CGPaletteSetColorAtIndex(CGDirectPaletteRef palette, CGDeviceColor color, CGTableCount index);
32859
32860
32861
32862
32863 CGDirectPaletteRef CGPaletteCreateCopy(CGDirectPaletteRef palette);
32864
32865
32866
32867
32868 Boolean CGPaletteIsEqualToPalette(CGDirectPaletteRef palette1, CGDirectPaletteRef palette2);
32869
32870
32871
32872
32873
32874 CGDirectPaletteRef CGPaletteCreateFromPaletteBlendedWithColor(
32875                                           CGDirectPaletteRef palette,
32876                                           CGPaletteBlendFraction fraction,
32877                                           CGDeviceColor color);
32878
32879 }
32880 extern "C" {
32881 typedef struct _CGDisplayConfigRef * CGDisplayConfigRef;
32882
32883
32884 CGError CGBeginDisplayConfiguration(CGDisplayConfigRef *pConfigRef);
32885 CGError CGConfigureDisplayOrigin(CGDisplayConfigRef configRef,
32886                                  CGDirectDisplayID display,
32887                                  CGDisplayCoord x,
32888                                  CGDisplayCoord y);
32889 CGError CGConfigureDisplayMode(CGDisplayConfigRef configRef,
32890                                 CGDirectDisplayID display,
32891                                 CFDictionaryRef mode);
32892 CGError CGConfigureDisplayMirrorOfDisplay(CGDisplayConfigRef configRef,
32893                                                      CGDirectDisplayID display,
32894                                                      CGDirectDisplayID masterDisplay);
32895
32896
32897 CGError CGCancelDisplayConfiguration(CGDisplayConfigRef configRef);
32898 enum {
32899     kCGConfigureForAppOnly = 0,
32900     kCGConfigureForSession = 1,
32901     kCGConfigurePermanently = 2
32902 };
32903 typedef u_int32_t CGConfigureOption;
32904
32905 CGError CGCompleteDisplayConfiguration( CGDisplayConfigRef configRef, CGConfigureOption option );
32906
32907
32908 void CGRestorePermanentDisplayConfiguration(void);
32909 boolean_t CGDisplayIsActive(CGDirectDisplayID display);
32910
32911
32912 boolean_t CGDisplayIsAsleep(CGDirectDisplayID display);
32913
32914
32915
32916
32917
32918  boolean_t CGDisplayIsOnline(CGDirectDisplayID display);
32919
32920
32921 boolean_t CGDisplayIsMain(CGDirectDisplayID display);
32922
32923
32924 boolean_t CGDisplayIsBuiltin(CGDirectDisplayID display);
32925
32926
32927 boolean_t CGDisplayIsInMirrorSet(CGDirectDisplayID display);
32928
32929
32930 boolean_t CGDisplayIsAlwaysInMirrorSet(CGDirectDisplayID display);
32931
32932
32933 boolean_t CGDisplayIsInHWMirrorSet(CGDirectDisplayID display);
32934
32935
32936 CGDirectDisplayID CGDisplayMirrorsDisplay(CGDirectDisplayID display);
32937
32938
32939 boolean_t CGDisplayUsesOpenGLAcceleration(CGDirectDisplayID display);
32940
32941
32942
32943
32944
32945
32946 CGDirectDisplayID CGDisplayPrimaryDisplay(CGDirectDisplayID display);
32947
32948
32949
32950
32951
32952 uint32_t CGDisplayUnitNumber(CGDirectDisplayID display);
32953 uint32_t CGDisplayVendorNumber(CGDirectDisplayID display);
32954 uint32_t CGDisplayModelNumber(CGDirectDisplayID display);
32955 uint32_t CGDisplaySerialNumber(CGDirectDisplayID display);
32956
32957
32958
32959
32960 }
32961 extern "C" {
32962
32963 typedef uint32_t CGDisplayFadeReservationToken;
32964
32965
32966 typedef float CGDisplayBlendFraction;
32967 typedef float CGDisplayFadeInterval;
32968 CGError CGConfigureDisplayFadeEffect(CGDisplayConfigRef configRef,
32969                                      CGDisplayFadeInterval fadeOutSeconds,
32970                                      CGDisplayFadeInterval fadeInSeconds,
32971                                      float fadeRed,
32972                                      float fadeGreen,
32973                                      float fadeBlue);
32974
32975
32976
32977
32978
32979
32980
32981 typedef float CGDisplayReservationInterval;
32982 CGError CGAcquireDisplayFadeReservation(CGDisplayReservationInterval seconds,
32983                                         CGDisplayFadeReservationToken * pNewToken);
32984 CGError CGReleaseDisplayFadeReservation(CGDisplayFadeReservationToken myToken);
32985 CGError CGDisplayFade(CGDisplayFadeReservationToken myToken,
32986                       CGDisplayFadeInterval seconds,
32987                       CGDisplayBlendFraction startBlend,
32988                       CGDisplayBlendFraction endBlend,
32989                       float redBlend, float greenBlend, float blueBlend,
32990                       boolean_t synchronous );
32991
32992
32993
32994
32995 boolean_t CGDisplayFadeOperationInProgress(void);
32996
32997
32998
32999 }
33000
33001
33002
33003
33004
33005
33006
33007 extern "C" {
33008
33009
33010
33011
33012
33013
33014
33015 extern CGContextRef CGPDFContextCreate(CGDataConsumerRef consumer, const CGRect *mediaBox, CFDictionaryRef auxiliaryInfo);
33016
33017
33018
33019 extern CGContextRef CGPDFContextCreateWithURL(CFURLRef url, const CGRect *mediaBox, CFDictionaryRef auxiliaryInfo);
33020 }
33021
33022 extern "C" {
33023
33024 typedef CGError CGEventErr;
33025 typedef u_int32_t CGRectCount;
33026 typedef void (*CGScreenRefreshCallback)(CGRectCount count, const CGRect * rectArray, void * userParameter);
33027
33028
33029
33030
33031
33032
33033
33034 extern void CGRegisterScreenRefreshCallback( CGScreenRefreshCallback function, void * userParameter );
33035
33036
33037
33038
33039
33040 extern void CGUnregisterScreenRefreshCallback( CGScreenRefreshCallback function, void * userParameter );
33041 extern CGEventErr CGWaitForScreenRefreshRects( CGRect ** pRectArray, CGRectCount * pCount );
33042
33043
33044
33045
33046 extern void CGReleaseScreenRefreshRects( CGRect * rectArray );
33047 typedef u_int32_t CGButtonCount;
33048 extern CGEventErr CGPostMouseEvent( CGPoint mouseCursorPosition,
33049                                         boolean_t updateMouseCursorPosition,
33050                                         CGButtonCount buttonCount,
33051                                         boolean_t mouseButtonDown, ... );
33052 typedef u_int32_t CGWheelCount;
33053 extern CGEventErr CGPostScrollWheelEvent( CGWheelCount wheelCount,
33054                                             int32_t wheel1, ... );
33055 typedef u_int16_t CGCharCode;
33056 typedef u_int16_t CGKeyCode;
33057
33058 extern CGEventErr CGPostKeyboardEvent( CGCharCode keyChar,
33059                                           CGKeyCode virtualKey,
33060                                           boolean_t keyDown );
33061
33062
33063
33064
33065
33066 extern CGEventErr CGWarpMouseCursorPosition( CGPoint newCursorPosition );
33067 extern CGEventErr CGInhibitLocalEvents( boolean_t doInhibit);
33068
33069
33070
33071
33072
33073 extern CGEventErr CGSetLocalEventsSuppressionInterval(CFTimeInterval seconds);
33074 extern CGEventErr CGEnableEventStateCombining(boolean_t doCombineState);
33075 enum
33076 {
33077     kCGEventFilterMaskPermitLocalMouseEvents = 0x00000001,
33078     kCGEventFilterMaskPermitLocalKeyboardEvents = 0x00000002,
33079     kCGEventFilterMaskPermitSystemDefinedEvents = 0x00000004
33080 };
33081 typedef uint32_t CGEventFilterMask;
33082
33083 enum
33084 {
33085     kCGEventSupressionStateSupressionInterval = 0,
33086     kCGEventSupressionStateRemoteMouseDrag,
33087     kCGNumberOfEventSupressionStates
33088 };
33089 typedef uint32_t CGEventSupressionState;
33090
33091
33092
33093
33094
33095 extern CGEventErr CGSetLocalEventsFilterDuringSupressionState(CGEventFilterMask filter,
33096 CGEventSupressionState state);
33097 extern CGEventErr CGAssociateMouseAndMouseCursorPosition(boolean_t connected);
33098 extern CFMachPortRef CGWindowServerCFMachPort(void);
33099
33100
33101 }
33102
33103 extern "C" {
33104 typedef int32_t CGWindowLevel;
33105 typedef int32_t CGWindowLevelKey;
33106
33107 enum _CGCommonWindowLevelKey {
33108     kCGBaseWindowLevelKey = 0,
33109     kCGMinimumWindowLevelKey,
33110     kCGDesktopWindowLevelKey,
33111     kCGBackstopMenuLevelKey,
33112     kCGNormalWindowLevelKey,
33113     kCGFloatingWindowLevelKey,
33114     kCGTornOffMenuWindowLevelKey,
33115     kCGDockWindowLevelKey,
33116     kCGMainMenuWindowLevelKey,
33117     kCGStatusWindowLevelKey,
33118     kCGModalPanelWindowLevelKey,
33119     kCGPopUpMenuWindowLevelKey,
33120     kCGDraggingWindowLevelKey,
33121     kCGScreenSaverWindowLevelKey,
33122     kCGMaximumWindowLevelKey,
33123     kCGOverlayWindowLevelKey,
33124     kCGHelpWindowLevelKey,
33125     kCGUtilityWindowLevelKey,
33126     kCGDesktopIconWindowLevelKey,
33127     kCGCursorWindowLevelKey,
33128     kCGNumberOfWindowLevelKeys
33129 };
33130
33131 CGWindowLevel CGWindowLevelForKey( CGWindowLevelKey key );
33132 }
33133
33134
33135
33136 extern "C" {
33137
33138
33139 typedef long CMError;
33140
33141 typedef struct OpaqueCMProfileRef* CMProfileRef;
33142
33143 typedef struct OpaqueCMProfileSearchRef* CMProfileSearchRef;
33144
33145 typedef struct OpaqueCMMatchRef* CMMatchRef;
33146
33147 typedef struct OpaqueCMWorldRef* CMWorldRef;
33148
33149
33150
33151 typedef UInt32 CMDisplayIDType;
33152
33153
33154 typedef OSErr ( * CMFlattenProcPtr)(long command, long *size, void *data, void *refCon);
33155
33156 typedef Boolean ( * CMBitmapCallBackProcPtr)(long progress, void *refCon);
33157
33158 typedef Boolean ( * CMConcatCallBackProcPtr)(long progress, void *refCon);
33159
33160 typedef Boolean ( * CMProfileFilterProcPtr)(CMProfileRef prof, void *refCon);
33161
33162 typedef OSErr ( * CMProfileAccessProcPtr)(long command, long offset, long *size, void *data, void *refCon);
33163 typedef CMFlattenProcPtr CMFlattenUPP;
33164 typedef CMBitmapCallBackProcPtr CMBitmapCallBackUPP;
33165 typedef CMConcatCallBackProcPtr CMConcatCallBackUPP;
33166 typedef CMProfileFilterProcPtr CMProfileFilterUPP;
33167 typedef CMProfileAccessProcPtr CMProfileAccessUPP;
33168 extern CMFlattenUPP
33169 NewCMFlattenUPP(CMFlattenProcPtr userRoutine) ;
33170 extern CMBitmapCallBackUPP
33171 NewCMBitmapCallBackUPP(CMBitmapCallBackProcPtr userRoutine) ;
33172 extern CMConcatCallBackUPP
33173 NewCMConcatCallBackUPP(CMConcatCallBackProcPtr userRoutine) ;
33174 extern CMProfileFilterUPP
33175 NewCMProfileFilterUPP(CMProfileFilterProcPtr userRoutine) ;
33176 extern CMProfileAccessUPP
33177 NewCMProfileAccessUPP(CMProfileAccessProcPtr userRoutine) ;
33178 extern void
33179 DisposeCMFlattenUPP(CMFlattenUPP userUPP) ;
33180 extern void
33181 DisposeCMBitmapCallBackUPP(CMBitmapCallBackUPP userUPP) ;
33182 extern void
33183 DisposeCMConcatCallBackUPP(CMConcatCallBackUPP userUPP) ;
33184 extern void
33185 DisposeCMProfileFilterUPP(CMProfileFilterUPP userUPP) ;
33186 extern void
33187 DisposeCMProfileAccessUPP(CMProfileAccessUPP userUPP) ;
33188 extern OSErr
33189 InvokeCMFlattenUPP(
33190   long command,
33191   long * size,
33192   void * data,
33193   void * refCon,
33194   CMFlattenUPP userUPP) ;
33195 extern Boolean
33196 InvokeCMBitmapCallBackUPP(
33197   long progress,
33198   void * refCon,
33199   CMBitmapCallBackUPP userUPP) ;
33200 extern Boolean
33201 InvokeCMConcatCallBackUPP(
33202   long progress,
33203   void * refCon,
33204   CMConcatCallBackUPP userUPP) ;
33205 extern Boolean
33206 InvokeCMProfileFilterUPP(
33207   CMProfileRef prof,
33208   void * refCon,
33209   CMProfileFilterUPP userUPP) ;
33210 extern OSErr
33211 InvokeCMProfileAccessUPP(
33212   long command,
33213   long offset,
33214   long * size,
33215   void * data,
33216   void * refCon,
33217   CMProfileAccessUPP userUPP) ;
33218
33219
33220
33221 }
33222
33223
33224
33225
33226
33227 enum {
33228   cmICCProfileVersion4 = 0x04000000,
33229   cmICCProfileVersion2 = 0x02000000,
33230   cmICCProfileVersion21 = 0x02100000,
33231   cmCS2ProfileVersion = cmICCProfileVersion2,
33232   cmCS1ProfileVersion = 0x00000100
33233 };
33234
33235
33236 enum {
33237   cmProfileMajorVersionMask = (long)0xFF000000,
33238   cmCurrentProfileMajorVersion = 0x02000000
33239 };
33240
33241
33242 enum {
33243   cmMagicNumber = 'acsp'
33244 };
33245
33246
33247
33248
33249
33250
33251 enum {
33252   cmICCReservedFlagsMask = 0x0000FFFF,
33253   cmEmbeddedMask = 0x00000001,
33254   cmEmbeddedUseMask = 0x00000002,
33255   cmCMSReservedFlagsMask = (long)0xFFFF0000,
33256   cmQualityMask = 0x00030000,
33257   cmInterpolationMask = 0x00040000,
33258   cmGamutCheckingMask = 0x00080000
33259 };
33260
33261
33262 enum {
33263   cmEmbeddedProfile = 0,
33264   cmEmbeddedUse = 1
33265 };
33266
33267
33268 enum {
33269   cmNormalMode = 0,
33270   cmDraftMode = 1,
33271   cmBestMode = 2
33272 };
33273
33274
33275
33276
33277
33278
33279 enum {
33280   cmReflectiveTransparentMask = 0x00000001,
33281   cmGlossyMatteMask = 0x00000002
33282 };
33283
33284
33285 enum {
33286   cmReflective = 0,
33287   cmGlossy = 1
33288 };
33289
33290
33291
33292 enum {
33293   cmPerceptual = 0,
33294   cmRelativeColorimetric = 1,
33295   cmSaturation = 2,
33296   cmAbsoluteColorimetric = 3
33297 };
33298
33299
33300
33301
33302 enum {
33303   cmAsciiData = 0,
33304   cmBinaryData = 1
33305 };
33306
33307
33308 enum {
33309   cmPrtrDefaultScreens = 0,
33310   cmLinesPer = 1
33311 };
33312
33313
33314 enum {
33315   cmNumHeaderElements = 10
33316 };
33317
33318
33319 enum {
33320   cmAToB0Tag = 'A2B0',
33321   cmAToB1Tag = 'A2B1',
33322   cmAToB2Tag = 'A2B2',
33323   cmBlueColorantTag = 'bXYZ',
33324   cmBlueTRCTag = 'bTRC',
33325   cmBToA0Tag = 'B2A0',
33326   cmBToA1Tag = 'B2A1',
33327   cmBToA2Tag = 'B2A2',
33328   cmCalibrationDateTimeTag = 'calt',
33329   cmChromaticAdaptationTag = 'chad',
33330   cmCharTargetTag = 'targ',
33331   cmCopyrightTag = 'cprt',
33332   cmDeviceMfgDescTag = 'dmnd',
33333   cmDeviceModelDescTag = 'dmdd',
33334   cmGamutTag = 'gamt',
33335   cmGrayTRCTag = 'kTRC',
33336   cmGreenColorantTag = 'gXYZ',
33337   cmGreenTRCTag = 'gTRC',
33338   cmLuminanceTag = 'lumi',
33339   cmMeasurementTag = 'meas',
33340   cmMediaBlackPointTag = 'bkpt',
33341   cmMediaWhitePointTag = 'wtpt',
33342   cmNamedColorTag = 'ncol',
33343   cmNamedColor2Tag = 'ncl2',
33344   cmPreview0Tag = 'pre0',
33345   cmPreview1Tag = 'pre1',
33346   cmPreview2Tag = 'pre2',
33347   cmProfileDescriptionTag = 'desc',
33348   cmProfileSequenceDescTag = 'pseq',
33349   cmPS2CRD0Tag = 'psd0',
33350   cmPS2CRD1Tag = 'psd1',
33351   cmPS2CRD2Tag = 'psd2',
33352   cmPS2CRD3Tag = 'psd3',
33353   cmPS2CSATag = 'ps2s',
33354   cmPS2RenderingIntentTag = 'ps2i',
33355   cmRedColorantTag = 'rXYZ',
33356   cmRedTRCTag = 'rTRC',
33357   cmScreeningDescTag = 'scrd',
33358   cmScreeningTag = 'scrn',
33359   cmTechnologyTag = 'tech',
33360   cmUcrBgTag = 'bfd ',
33361   cmViewingConditionsDescTag = 'vued',
33362   cmViewingConditionsTag = 'view'
33363 };
33364
33365
33366 enum {
33367   cmPS2CRDVMSizeTag = 'psvm',
33368   cmVideoCardGammaTag = 'vcgt',
33369   cmMakeAndModelTag = 'mmod',
33370   cmProfileDescriptionMLTag = 'dscm',
33371   cmNativeDisplayInfoTag = 'ndin'
33372 };
33373
33374
33375 enum {
33376   cmSigCrdInfoType = 'crdi',
33377   cmSigCurveType = 'curv',
33378   cmSigDataType = 'data',
33379   cmSigDateTimeType = 'dtim',
33380   cmSigLut16Type = 'mft2',
33381   cmSigLut8Type = 'mft1',
33382   cmSigMeasurementType = 'meas',
33383   cmSigMultiFunctA2BType = 'mAB ',
33384   cmSigMultiFunctB2AType = 'mBA ',
33385   cmSigNamedColorType = 'ncol',
33386   cmSigNamedColor2Type = 'ncl2',
33387   cmSigParametricCurveType = 'para',
33388   cmSigProfileDescriptionType = 'desc',
33389   cmSigProfileSequenceDescType = 'pseq',
33390   cmSigScreeningType = 'scrn',
33391   cmSigS15Fixed16Type = 'sf32',
33392   cmSigSignatureType = 'sig ',
33393   cmSigTextType = 'text',
33394   cmSigU16Fixed16Type = 'uf32',
33395   cmSigU1Fixed15Type = 'uf16',
33396   cmSigUInt8Type = 'ui08',
33397   cmSigUInt16Type = 'ui16',
33398   cmSigUInt32Type = 'ui32',
33399   cmSigUInt64Type = 'ui64',
33400   cmSigUcrBgType = 'bfd ',
33401   cmSigUnicodeTextType = 'utxt',
33402   cmSigViewingConditionsType = 'view',
33403   cmSigXYZType = 'XYZ '
33404 };
33405
33406
33407 enum {
33408   cmSigPS2CRDVMSizeType = 'psvm',
33409   cmSigVideoCardGammaType = 'vcgt',
33410   cmSigMakeAndModelType = 'mmod',
33411   cmSigNativeDisplayInfoType = 'ndin',
33412   cmSigMultiLocalizedUniCodeType = 'mluc'
33413 };
33414
33415
33416
33417 enum {
33418   cmTechnologyDigitalCamera = 'dcam',
33419   cmTechnologyFilmScanner = 'fscn',
33420   cmTechnologyReflectiveScanner = 'rscn',
33421   cmTechnologyInkJetPrinter = 'ijet',
33422   cmTechnologyThermalWaxPrinter = 'twax',
33423   cmTechnologyElectrophotographicPrinter = 'epho',
33424   cmTechnologyElectrostaticPrinter = 'esta',
33425   cmTechnologyDyeSublimationPrinter = 'dsub',
33426   cmTechnologyPhotographicPaperPrinter = 'rpho',
33427   cmTechnologyFilmWriter = 'fprn',
33428   cmTechnologyVideoMonitor = 'vidm',
33429   cmTechnologyVideoCamera = 'vidc',
33430   cmTechnologyProjectionTelevision = 'pjtv',
33431   cmTechnologyCRTDisplay = 'CRT ',
33432   cmTechnologyPMDisplay = 'PMD ',
33433   cmTechnologyAMDisplay = 'AMD ',
33434   cmTechnologyPhotoCD = 'KPCD',
33435   cmTechnologyPhotoImageSetter = 'imgs',
33436   cmTechnologyGravure = 'grav',
33437   cmTechnologyOffsetLithography = 'offs',
33438   cmTechnologySilkscreen = 'silk',
33439   cmTechnologyFlexography = 'flex'
33440 };
33441
33442
33443
33444
33445 enum {
33446   cmFlare0 = 0x00000000,
33447   cmFlare100 = 0x00000001
33448 };
33449
33450
33451 enum {
33452   cmGeometryUnknown = 0x00000000,
33453   cmGeometry045or450 = 0x00000001,
33454   cmGeometry0dord0 = 0x00000002
33455 };
33456
33457
33458 enum {
33459   cmStdobsUnknown = 0x00000000,
33460   cmStdobs1931TwoDegrees = 0x00000001,
33461   cmStdobs1964TenDegrees = 0x00000002
33462 };
33463
33464
33465 enum {
33466   cmIlluminantUnknown = 0x00000000,
33467   cmIlluminantD50 = 0x00000001,
33468   cmIlluminantD65 = 0x00000002,
33469   cmIlluminantD93 = 0x00000003,
33470   cmIlluminantF2 = 0x00000004,
33471   cmIlluminantD55 = 0x00000005,
33472   cmIlluminantA = 0x00000006,
33473   cmIlluminantEquiPower = 0x00000007,
33474   cmIlluminantF8 = 0x00000008
33475 };
33476
33477
33478 enum {
33479   cmSpotFunctionUnknown = 0,
33480   cmSpotFunctionDefault = 1,
33481   cmSpotFunctionRound = 2,
33482   cmSpotFunctionDiamond = 3,
33483   cmSpotFunctionEllipse = 4,
33484   cmSpotFunctionLine = 5,
33485   cmSpotFunctionSquare = 6,
33486   cmSpotFunctionCross = 7
33487 };
33488
33489
33490 enum {
33491   cmXYZData = 'XYZ ',
33492   cmLabData = 'Lab ',
33493   cmLuvData = 'Luv ',
33494   cmYCbCrData = 'YCbr',
33495   cmYxyData = 'Yxy ',
33496   cmRGBData = 'RGB ',
33497   cmSRGBData = 'sRGB',
33498   cmGrayData = 'GRAY',
33499   cmHSVData = 'HSV ',
33500   cmHLSData = 'HLS ',
33501   cmCMYKData = 'CMYK',
33502   cmCMYData = 'CMY ',
33503   cmMCH5Data = 'MCH5',
33504   cmMCH6Data = 'MCH6',
33505   cmMCH7Data = 'MCH7',
33506   cmMCH8Data = 'MCH8',
33507   cm3CLRData = '3CLR',
33508   cm4CLRData = '4CLR',
33509   cm5CLRData = '5CLR',
33510   cm6CLRData = '6CLR',
33511   cm7CLRData = '7CLR',
33512   cm8CLRData = '8CLR',
33513   cm9CLRData = '9CLR',
33514   cm10CLRData = 'ACLR',
33515   cm11CLRData = 'BCLR',
33516   cm12CLRData = 'CCLR',
33517   cm13CLRData = 'DCLR',
33518   cm14CLRData = 'ECLR',
33519   cm15CLRData = 'FCLR',
33520   cmNamedData = 'NAME'
33521 };
33522
33523
33524 enum {
33525   cmInputClass = 'scnr',
33526   cmDisplayClass = 'mntr',
33527   cmOutputClass = 'prtr',
33528   cmLinkClass = 'link',
33529   cmAbstractClass = 'abst',
33530   cmColorSpaceClass = 'spac',
33531   cmNamedColorClass = 'nmcl'
33532 };
33533
33534
33535 enum {
33536   cmMacintosh = 'APPL',
33537   cmMicrosoft = 'MSFT',
33538   cmSolaris = 'SUNW',
33539   cmSiliconGraphics = 'SGI ',
33540   cmTaligent = 'TGNT'
33541 };
33542
33543
33544 enum {
33545   cmParametricType0 = 0,
33546   cmParametricType1 = 1,
33547   cmParametricType2 = 2,
33548   cmParametricType3 = 3,
33549   cmParametricType4 = 4
33550 };
33551
33552
33553
33554 enum {
33555   cmCS1ChromTag = 'chrm',
33556   cmCS1TRCTag = 'trc ',
33557   cmCS1NameTag = 'name',
33558   cmCS1CustTag = 'cust'
33559 };
33560
33561
33562 struct CMDateTime {
33563   UInt16 year;
33564   UInt16 month;
33565   UInt16 dayOfTheMonth;
33566   UInt16 hours;
33567   UInt16 minutes;
33568   UInt16 seconds;
33569 };
33570 typedef struct CMDateTime CMDateTime;
33571 struct CMFixedXYColor {
33572   Fixed x;
33573   Fixed y;
33574 };
33575 typedef struct CMFixedXYColor CMFixedXYColor;
33576 struct CMFixedXYZColor {
33577   Fixed X;
33578   Fixed Y;
33579   Fixed Z;
33580 };
33581 typedef struct CMFixedXYZColor CMFixedXYZColor;
33582
33583 typedef UInt16 CMXYZComponent;
33584 struct CMXYZColor {
33585   CMXYZComponent X;
33586   CMXYZComponent Y;
33587   CMXYZComponent Z;
33588 };
33589 typedef struct CMXYZColor CMXYZColor;
33590
33591
33592
33593 typedef unsigned char CMProfileMD5[16];
33594 typedef CMProfileMD5 * CMProfileMD5Ptr;
33595
33596
33597
33598
33599
33600
33601
33602   inline Boolean CMProfileMD5AreEqual(CMProfileMD5 a, CMProfileMD5 b)
33603   {
33604     return ((long*)a)[0]==((long*)b)[0] && ((long*)a)[1]==((long*)b)[1] &&
33605          ((long*)a)[2]==((long*)b)[2] && ((long*)a)[3]==((long*)b)[3];
33606   }
33607
33608
33609
33610
33611
33612
33613 struct CM2Header {
33614   UInt32 size;
33615   OSType CMMType;
33616   UInt32 profileVersion;
33617   OSType profileClass;
33618   OSType dataColorSpace;
33619   OSType profileConnectionSpace;
33620   CMDateTime dateTime;
33621   OSType CS2profileSignature;
33622   OSType platform;
33623   UInt32 flags;
33624   OSType deviceManufacturer;
33625   UInt32 deviceModel;
33626   UInt32 deviceAttributes[2];
33627   UInt32 renderingIntent;
33628   CMFixedXYZColor white;
33629   OSType creator;
33630   char reserved[44];
33631 };
33632 typedef struct CM2Header CM2Header;
33633 struct CM4Header {
33634   UInt32 size;
33635   OSType CMMType;
33636   UInt32 profileVersion;
33637   OSType profileClass;
33638   OSType dataColorSpace;
33639   OSType profileConnectionSpace;
33640   CMDateTime dateTime;
33641   OSType CS2profileSignature;
33642   OSType platform;
33643   UInt32 flags;
33644   OSType deviceManufacturer;
33645   UInt32 deviceModel;
33646   UInt32 deviceAttributes[2];
33647   UInt32 renderingIntent;
33648   CMFixedXYZColor white;
33649   OSType creator;
33650   CMProfileMD5 digest;
33651   char reserved[28];
33652 };
33653 typedef struct CM4Header CM4Header;
33654 struct CMTagRecord {
33655   OSType tag;
33656   UInt32 elementOffset;
33657   UInt32 elementSize;
33658 };
33659 typedef struct CMTagRecord CMTagRecord;
33660 struct CMTagElemTable {
33661   UInt32 count;
33662   CMTagRecord tagList[1];
33663 };
33664 typedef struct CMTagElemTable CMTagElemTable;
33665 struct CM2Profile {
33666   CM2Header header;
33667   CMTagElemTable tagTable;
33668   char elemData[1];
33669 };
33670 typedef struct CM2Profile CM2Profile;
33671 typedef CM2Profile * CM2ProfilePtr;
33672 typedef CM2ProfilePtr * CM2ProfileHandle;
33673
33674 struct CMAdaptationMatrixType {
33675   OSType typeDescriptor;
33676   unsigned long reserved;
33677   Fixed adaptationMatrix[9];
33678 };
33679 typedef struct CMAdaptationMatrixType CMAdaptationMatrixType;
33680 struct CMCurveType {
33681   OSType typeDescriptor;
33682   UInt32 reserved;
33683   UInt32 countValue;
33684   UInt16 data[1];
33685 };
33686 typedef struct CMCurveType CMCurveType;
33687 struct CMDataType {
33688   OSType typeDescriptor;
33689   UInt32 reserved;
33690   UInt32 dataFlag;
33691   char data[1];
33692 };
33693 typedef struct CMDataType CMDataType;
33694 struct CMDateTimeType {
33695   OSType typeDescriptor;
33696   UInt32 reserved;
33697   CMDateTime dateTime;
33698 };
33699 typedef struct CMDateTimeType CMDateTimeType;
33700 struct CMLut16Type {
33701   OSType typeDescriptor;
33702   UInt32 reserved;
33703   UInt8 inputChannels;
33704   UInt8 outputChannels;
33705   UInt8 gridPoints;
33706   UInt8 reserved2;
33707   Fixed matrix[3][3];
33708   UInt16 inputTableEntries;
33709   UInt16 outputTableEntries;
33710   UInt16 inputTable[1];
33711 };
33712 typedef struct CMLut16Type CMLut16Type;
33713 struct CMLut8Type {
33714   OSType typeDescriptor;
33715   UInt32 reserved;
33716   UInt8 inputChannels;
33717   UInt8 outputChannels;
33718   UInt8 gridPoints;
33719   UInt8 reserved2;
33720   Fixed matrix[3][3];
33721   UInt8 inputTable[1];
33722 };
33723 typedef struct CMLut8Type CMLut8Type;
33724 struct CMMultiFunctLutType {
33725   OSType typeDescriptor;
33726   UInt32 reserved;
33727   UInt8 inputChannels;
33728   UInt8 outputChannels;
33729   UInt16 reserved2;
33730   UInt32 offsetBcurves;
33731   UInt32 offsetMatrix;
33732   UInt32 offsetMcurves;
33733   UInt32 offsetCLUT;
33734   UInt32 offsetAcurves;
33735   UInt8 data[1];
33736 };
33737 typedef struct CMMultiFunctLutType CMMultiFunctLutType;
33738 typedef CMMultiFunctLutType CMMultiFunctLutA2BType;
33739 typedef CMMultiFunctLutType CMMultiFunctLutB2AType;
33740 struct CMMultiFunctCLUTType {
33741   UInt8 gridPoints[16];
33742   UInt8 entrySize;
33743   UInt8 reserved[3];
33744   UInt8 data[1];
33745 };
33746 typedef struct CMMultiFunctCLUTType CMMultiFunctCLUTType;
33747 struct CMMeasurementType {
33748   OSType typeDescriptor;
33749   UInt32 reserved;
33750   UInt32 standardObserver;
33751   CMFixedXYZColor backingXYZ;
33752   UInt32 geometry;
33753   UInt32 flare;
33754   UInt32 illuminant;
33755 };
33756 typedef struct CMMeasurementType CMMeasurementType;
33757 struct CMNamedColorType {
33758   OSType typeDescriptor;
33759   UInt32 reserved;
33760   UInt32 vendorFlag;
33761   UInt32 count;
33762   UInt8 prefixName[1];
33763 };
33764 typedef struct CMNamedColorType CMNamedColorType;
33765 struct CMNamedColor2EntryType {
33766   UInt8 rootName[32];
33767   UInt16 PCSColorCoords[3];
33768   UInt16 DeviceColorCoords[1];
33769 };
33770 typedef struct CMNamedColor2EntryType CMNamedColor2EntryType;
33771 struct CMNamedColor2Type {
33772   OSType typeDescriptor;
33773   UInt32 reserved;
33774   UInt32 vendorFlag;
33775   UInt32 count;
33776   UInt32 deviceChannelCount;
33777   UInt8 prefixName[32];
33778   UInt8 suffixName[32];
33779   char data[1];
33780 };
33781 typedef struct CMNamedColor2Type CMNamedColor2Type;
33782 struct CMNativeDisplayInfo {
33783   UInt32 dataSize;
33784   CMFixedXYColor redPhosphor;
33785   CMFixedXYColor greenPhosphor;
33786   CMFixedXYColor bluePhosphor;
33787   CMFixedXYColor whitePoint;
33788   Fixed redGammaValue;
33789   Fixed greenGammaValue;
33790   Fixed blueGammaValue;
33791
33792
33793
33794   UInt16 gammaChannels;
33795   UInt16 gammaEntryCount;
33796   UInt16 gammaEntrySize;
33797   char gammaData[1];
33798 };
33799 typedef struct CMNativeDisplayInfo CMNativeDisplayInfo;
33800 struct CMNativeDisplayInfoType {
33801   OSType typeDescriptor;
33802   unsigned long reserved;
33803   CMNativeDisplayInfo nativeDisplayInfo;
33804 };
33805 typedef struct CMNativeDisplayInfoType CMNativeDisplayInfoType;
33806 struct CMParametricCurveType {
33807   OSType typeDescriptor;
33808   UInt32 reserved;
33809   UInt16 functionType;
33810   UInt16 reserved2;
33811   Fixed value[1];
33812 };
33813 typedef struct CMParametricCurveType CMParametricCurveType;
33814 struct CMTextDescriptionType {
33815   OSType typeDescriptor;
33816   UInt32 reserved;
33817   UInt32 ASCIICount;
33818   UInt8 ASCIIName[2];
33819 };
33820 typedef struct CMTextDescriptionType CMTextDescriptionType;
33821 struct CMTextType {
33822   OSType typeDescriptor;
33823   UInt32 reserved;
33824   UInt8 text[1];
33825 };
33826 typedef struct CMTextType CMTextType;
33827 struct CMUnicodeTextType {
33828   OSType typeDescriptor;
33829   UInt32 reserved;
33830   UniChar text[1];
33831 };
33832 typedef struct CMUnicodeTextType CMUnicodeTextType;
33833 struct CMScreeningChannelRec {
33834   Fixed frequency;
33835   Fixed angle;
33836   UInt32 spotFunction;
33837 };
33838 typedef struct CMScreeningChannelRec CMScreeningChannelRec;
33839 struct CMScreeningType {
33840   OSType typeDescriptor;
33841   UInt32 reserved;
33842   UInt32 screeningFlag;
33843   UInt32 channelCount;
33844   CMScreeningChannelRec channelInfo[1];
33845 };
33846 typedef struct CMScreeningType CMScreeningType;
33847 struct CMSignatureType {
33848   OSType typeDescriptor;
33849   UInt32 reserved;
33850   OSType signature;
33851 };
33852 typedef struct CMSignatureType CMSignatureType;
33853 struct CMS15Fixed16ArrayType {
33854   OSType typeDescriptor;
33855   UInt32 reserved;
33856   Fixed value[1];
33857 };
33858 typedef struct CMS15Fixed16ArrayType CMS15Fixed16ArrayType;
33859 struct CMU16Fixed16ArrayType {
33860   OSType typeDescriptor;
33861   UInt32 reserved;
33862   UInt32 value[1];
33863 };
33864 typedef struct CMU16Fixed16ArrayType CMU16Fixed16ArrayType;
33865 struct CMUInt8ArrayType {
33866   OSType typeDescriptor;
33867   UInt32 reserved;
33868   UInt8 value[1];
33869 };
33870 typedef struct CMUInt8ArrayType CMUInt8ArrayType;
33871 struct CMUInt16ArrayType {
33872   OSType typeDescriptor;
33873   UInt32 reserved;
33874   UInt16 value[1];
33875 };
33876 typedef struct CMUInt16ArrayType CMUInt16ArrayType;
33877 struct CMUInt32ArrayType {
33878   OSType typeDescriptor;
33879   UInt32 reserved;
33880   UInt32 value[1];
33881 };
33882 typedef struct CMUInt32ArrayType CMUInt32ArrayType;
33883 struct CMUInt64ArrayType {
33884   OSType typeDescriptor;
33885   UInt32 reserved;
33886   UInt32 value[1];
33887 };
33888 typedef struct CMUInt64ArrayType CMUInt64ArrayType;
33889 struct CMViewingConditionsType {
33890   OSType typeDescriptor;
33891   UInt32 reserved;
33892   CMFixedXYZColor illuminant;
33893   CMFixedXYZColor surround;
33894   UInt32 stdIlluminant;
33895 };
33896 typedef struct CMViewingConditionsType CMViewingConditionsType;
33897 struct CMXYZType {
33898   OSType typeDescriptor;
33899   UInt32 reserved;
33900   CMFixedXYZColor XYZ[1];
33901 };
33902 typedef struct CMXYZType CMXYZType;
33903 struct CMProfileSequenceDescType {
33904   OSType typeDescriptor;
33905   UInt32 reserved;
33906   UInt32 count;
33907   char data[1];
33908 };
33909 typedef struct CMProfileSequenceDescType CMProfileSequenceDescType;
33910 struct CMUcrBgType {
33911   OSType typeDescriptor;
33912   UInt32 reserved;
33913   UInt32 ucrCount;
33914   UInt16 ucrValues[1];
33915 };
33916 typedef struct CMUcrBgType CMUcrBgType;
33917
33918 struct CMIntentCRDVMSize {
33919   long renderingIntent;
33920   UInt32 VMSize;
33921 };
33922 typedef struct CMIntentCRDVMSize CMIntentCRDVMSize;
33923 struct CMPS2CRDVMSizeType {
33924   OSType typeDescriptor;
33925   UInt32 reserved;
33926   UInt32 count;
33927   CMIntentCRDVMSize intentCRD[1];
33928 };
33929 typedef struct CMPS2CRDVMSizeType CMPS2CRDVMSizeType;
33930 enum {
33931   cmVideoCardGammaTableType = 0,
33932   cmVideoCardGammaFormulaType = 1
33933 };
33934
33935 struct CMVideoCardGammaTable {
33936   UInt16 channels;
33937   UInt16 entryCount;
33938   UInt16 entrySize;
33939   char data[1];
33940 };
33941 typedef struct CMVideoCardGammaTable CMVideoCardGammaTable;
33942 struct CMVideoCardGammaFormula {
33943   Fixed redGamma;
33944   Fixed redMin;
33945   Fixed redMax;
33946   Fixed greenGamma;
33947   Fixed greenMin;
33948   Fixed greenMax;
33949   Fixed blueGamma;
33950   Fixed blueMin;
33951   Fixed blueMax;
33952 };
33953 typedef struct CMVideoCardGammaFormula CMVideoCardGammaFormula;
33954 struct CMVideoCardGamma {
33955   UInt32 tagType;
33956   union {
33957     CMVideoCardGammaTable table;
33958     CMVideoCardGammaFormula formula;
33959   } u;
33960 };
33961 typedef struct CMVideoCardGamma CMVideoCardGamma;
33962 struct CMVideoCardGammaType {
33963   OSType typeDescriptor;
33964   UInt32 reserved;
33965   CMVideoCardGamma gamma;
33966 };
33967 typedef struct CMVideoCardGammaType CMVideoCardGammaType;
33968 struct CMMakeAndModel {
33969   OSType manufacturer;
33970   UInt32 model;
33971   UInt32 serialNumber;
33972   UInt32 manufactureDate;
33973   UInt32 reserved1;
33974   UInt32 reserved2;
33975   UInt32 reserved3;
33976   UInt32 reserved4;
33977 };
33978 typedef struct CMMakeAndModel CMMakeAndModel;
33979 struct CMMakeAndModelType {
33980   OSType typeDescriptor;
33981   UInt32 reserved;
33982   CMMakeAndModel makeAndModel;
33983 };
33984 typedef struct CMMakeAndModelType CMMakeAndModelType;
33985 struct CMMultiLocalizedUniCodeEntryRec {
33986   char languageCode[2];
33987   char regionCode[2];
33988   UInt32 textLength;
33989   UInt32 textOffset;
33990 };
33991 typedef struct CMMultiLocalizedUniCodeEntryRec CMMultiLocalizedUniCodeEntryRec;
33992 struct CMMultiLocalizedUniCodeType {
33993   OSType typeDescriptor;
33994   UInt32 reserved;
33995   UInt32 entryCount;
33996   UInt32 entrySize;
33997
33998
33999
34000
34001 };
34002 typedef struct CMMultiLocalizedUniCodeType CMMultiLocalizedUniCodeType;
34003
34004
34005
34006 enum {
34007   cmGrayResponse = 0,
34008   cmRedResponse = 1,
34009   cmGreenResponse = 2,
34010   cmBlueResponse = 3,
34011   cmCyanResponse = 4,
34012   cmMagentaResponse = 5,
34013   cmYellowResponse = 6,
34014   cmUcrResponse = 7,
34015   cmBgResponse = 8,
34016   cmOnePlusLastResponse = 9
34017 };
34018
34019
34020
34021 enum {
34022   cmMonitorDevice = 'mntr',
34023   cmScannerDevice = 'scnr',
34024   cmPrinterDevice = 'prtr'
34025 };
34026
34027
34028 struct CMIString {
34029   ScriptCode theScript;
34030   Str63 theString;
34031 };
34032 typedef struct CMIString CMIString;
34033
34034 enum {
34035   cmPerceptualMatch = 0x0000,
34036   cmColorimetricMatch = 0x0001,
34037   cmSaturationMatch = 0x0002
34038 };
34039
34040
34041 enum {
34042   cmNativeMatchingPreferred = 0x00000001,
34043   cmTurnOffCache = 0x00000002
34044 };
34045
34046
34047 typedef long CMMatchOption;
34048 typedef long CMMatchFlag;
34049 struct CMHeader {
34050   UInt32 size;
34051   OSType CMMType;
34052   UInt32 applProfileVersion;
34053   OSType dataType;
34054   OSType deviceType;
34055   OSType deviceManufacturer;
34056   UInt32 deviceModel;
34057   UInt32 deviceAttributes[2];
34058   UInt32 profileNameOffset;
34059   UInt32 customDataOffset;
34060   CMMatchFlag flags;
34061   CMMatchOption options;
34062   CMXYZColor white;
34063   CMXYZColor black;
34064 };
34065 typedef struct CMHeader CMHeader;
34066 struct CMProfileChromaticities {
34067   CMXYZColor red;
34068   CMXYZColor green;
34069   CMXYZColor blue;
34070   CMXYZColor cyan;
34071   CMXYZColor magenta;
34072   CMXYZColor yellow;
34073 };
34074 typedef struct CMProfileChromaticities CMProfileChromaticities;
34075 struct CMProfileResponse {
34076   UInt16 counts[9];
34077   UInt16 data[1];
34078 };
34079 typedef struct CMProfileResponse CMProfileResponse;
34080 struct CMProfile {
34081   CMHeader header;
34082   CMProfileChromaticities profile;
34083   CMProfileResponse response;
34084   CMIString profileName;
34085   char customData[1];
34086 };
34087 typedef struct CMProfile CMProfile;
34088 typedef CMProfile * CMProfilePtr;
34089 typedef CMProfilePtr * CMProfileHandle;
34090 extern "C" {
34091
34092
34093
34094 enum {
34095   kDefaultCMMSignature = 'appl'
34096 };
34097
34098
34099 enum {
34100   cmTrap = 0xABEE
34101 };
34102
34103
34104
34105 enum {
34106   cmBeginProfile = 220,
34107   cmEndProfile = 221,
34108   cmEnableMatching = 222,
34109   cmDisableMatching = 223,
34110   cmComment = 224
34111 };
34112
34113
34114 enum {
34115   cmBeginProfileSel = 0,
34116   cmContinueProfileSel = 1,
34117   cmEndProfileSel = 2,
34118   cmProfileIdentifierSel = 3
34119 };
34120
34121
34122
34123 enum {
34124   cmMatchCMMType = 0x00000001,
34125   cmMatchApplProfileVersion = 0x00000002,
34126   cmMatchDataType = 0x00000004,
34127   cmMatchDeviceType = 0x00000008,
34128   cmMatchDeviceManufacturer = 0x00000010,
34129   cmMatchDeviceModel = 0x00000020,
34130   cmMatchDeviceAttributes = 0x00000040,
34131   cmMatchFlags = 0x00000080,
34132   cmMatchOptions = 0x00000100,
34133   cmMatchWhite = 0x00000200,
34134   cmMatchBlack = 0x00000400
34135 };
34136
34137
34138 enum {
34139   cmMatchAnyProfile = 0x00000000,
34140   cmMatchProfileCMMType = 0x00000001,
34141   cmMatchProfileClass = 0x00000002,
34142   cmMatchDataColorSpace = 0x00000004,
34143   cmMatchProfileConnectionSpace = 0x00000008,
34144   cmMatchManufacturer = 0x00000010,
34145   cmMatchModel = 0x00000020,
34146   cmMatchAttributes = 0x00000040,
34147   cmMatchProfileFlags = 0x00000080
34148 };
34149
34150
34151
34152 enum {
34153   cmPS7bit = 1,
34154   cmPS8bit = 2
34155 };
34156
34157
34158 enum {
34159   cmEmbedWholeProfile = 0x00000000,
34160   cmEmbedProfileIdentifier = 0x00000001
34161 };
34162
34163
34164 enum {
34165   cmOpenReadSpool = 1,
34166   cmOpenWriteSpool = 2,
34167   cmReadSpool = 3,
34168   cmWriteSpool = 4,
34169   cmCloseSpool = 5
34170 };
34171
34172
34173 enum {
34174   cmOpenReadAccess = 1,
34175   cmOpenWriteAccess = 2,
34176   cmReadAccess = 3,
34177   cmWriteAccess = 4,
34178   cmCloseAccess = 5,
34179   cmCreateNewAccess = 6,
34180   cmAbortWriteAccess = 7,
34181   cmBeginAccess = 8,
34182   cmEndAccess = 9
34183 };
34184
34185
34186
34187 enum {
34188   cmInputUse = 'inpt',
34189   cmOutputUse = 'outp',
34190   cmDisplayUse = 'dply',
34191   cmProofUse = 'pruf'
34192 };
34193
34194
34195
34196 union CMAppleProfileHeader {
34197   CMHeader cm1;
34198   CM2Header cm2;
34199   CM4Header cm4;
34200 };
34201 typedef union CMAppleProfileHeader CMAppleProfileHeader;
34202
34203 struct CMConcatProfileSet {
34204   UInt16 keyIndex;
34205   UInt16 count;
34206   CMProfileRef profileSet[1];
34207 };
34208 typedef struct CMConcatProfileSet CMConcatProfileSet;
34209
34210 struct NCMConcatProfileSpec {
34211   UInt32 renderingIntent;
34212   UInt32 transformTag;
34213   CMProfileRef profile;
34214 };
34215 typedef struct NCMConcatProfileSpec NCMConcatProfileSpec;
34216 struct NCMConcatProfileSet {
34217   OSType cmm;
34218   UInt32 flags;
34219   UInt32 flagsMask;
34220   UInt32 profileCount;
34221   NCMConcatProfileSpec profileSpecs[1];
34222 };
34223 typedef struct NCMConcatProfileSet NCMConcatProfileSet;
34224 enum {
34225   kNoTransform = 0,
34226   kUseAtoB = 1,
34227   kUseBtoA = 2,
34228   kUseBtoB = 3,
34229
34230   kDeviceToPCS = kUseAtoB,
34231   kPCSToDevice = kUseBtoA,
34232   kPCSToPCS = kUseBtoB,
34233   kUseProfileIntent = (long)0xFFFFFFFF
34234 };
34235
34236
34237
34238 struct CMRGBColor {
34239   UInt16 red;
34240   UInt16 green;
34241   UInt16 blue;
34242 };
34243 typedef struct CMRGBColor CMRGBColor;
34244 struct CMCMYKColor {
34245   UInt16 cyan;
34246   UInt16 magenta;
34247   UInt16 yellow;
34248   UInt16 black;
34249 };
34250 typedef struct CMCMYKColor CMCMYKColor;
34251 struct CMCMYColor {
34252   UInt16 cyan;
34253   UInt16 magenta;
34254   UInt16 yellow;
34255 };
34256 typedef struct CMCMYColor CMCMYColor;
34257 struct CMHLSColor {
34258   UInt16 hue;
34259   UInt16 lightness;
34260   UInt16 saturation;
34261 };
34262 typedef struct CMHLSColor CMHLSColor;
34263 struct CMHSVColor {
34264   UInt16 hue;
34265   UInt16 saturation;
34266   UInt16 value;
34267 };
34268 typedef struct CMHSVColor CMHSVColor;
34269 struct CMLabColor {
34270   UInt16 L;
34271   UInt16 a;
34272   UInt16 b;
34273 };
34274 typedef struct CMLabColor CMLabColor;
34275 struct CMLuvColor {
34276   UInt16 L;
34277   UInt16 u;
34278   UInt16 v;
34279 };
34280 typedef struct CMLuvColor CMLuvColor;
34281 struct CMYxyColor {
34282   UInt16 capY;
34283   UInt16 x;
34284   UInt16 y;
34285 };
34286 typedef struct CMYxyColor CMYxyColor;
34287 struct CMGrayColor {
34288   UInt16 gray;
34289 };
34290 typedef struct CMGrayColor CMGrayColor;
34291 struct CMMultichannel5Color {
34292   UInt8 components[5];
34293 };
34294 typedef struct CMMultichannel5Color CMMultichannel5Color;
34295 struct CMMultichannel6Color {
34296   UInt8 components[6];
34297 };
34298 typedef struct CMMultichannel6Color CMMultichannel6Color;
34299 struct CMMultichannel7Color {
34300   UInt8 components[7];
34301 };
34302 typedef struct CMMultichannel7Color CMMultichannel7Color;
34303 struct CMMultichannel8Color {
34304   UInt8 components[8];
34305 };
34306 typedef struct CMMultichannel8Color CMMultichannel8Color;
34307 struct CMNamedColor {
34308   UInt32 namedColorIndex;
34309 };
34310 typedef struct CMNamedColor CMNamedColor;
34311 union CMColor {
34312   CMRGBColor rgb;
34313   CMHSVColor hsv;
34314   CMHLSColor hls;
34315   CMXYZColor XYZ;
34316   CMLabColor Lab;
34317   CMLuvColor Luv;
34318   CMYxyColor Yxy;
34319   CMCMYKColor cmyk;
34320   CMCMYColor cmy;
34321   CMGrayColor gray;
34322   CMMultichannel5Color mc5;
34323   CMMultichannel6Color mc6;
34324   CMMultichannel7Color mc7;
34325   CMMultichannel8Color mc8;
34326   CMNamedColor namedColor;
34327 };
34328 typedef union CMColor CMColor;
34329
34330 struct CMProfileSearchRecord {
34331   CMHeader header;
34332   UInt32 fieldMask;
34333   UInt32 reserved[2];
34334 };
34335 typedef struct CMProfileSearchRecord CMProfileSearchRecord;
34336 typedef CMProfileSearchRecord * CMProfileSearchRecordPtr;
34337 typedef CMProfileSearchRecordPtr * CMProfileSearchRecordHandle;
34338
34339 struct CMSearchRecord {
34340   OSType CMMType;
34341   OSType profileClass;
34342   OSType dataColorSpace;
34343   OSType profileConnectionSpace;
34344   UInt32 deviceManufacturer;
34345   UInt32 deviceModel;
34346   UInt32 deviceAttributes[2];
34347   UInt32 profileFlags;
34348   UInt32 searchMask;
34349   CMProfileFilterUPP filter;
34350 };
34351 typedef struct CMSearchRecord CMSearchRecord;
34352
34353 struct CMMInfo {
34354   UInt32 dataSize;
34355   OSType CMMType;
34356   OSType CMMMfr;
34357   UInt32 CMMVersion;
34358   unsigned char ASCIIName[32];
34359   unsigned char ASCIIDesc[256];
34360   UniCharCount UniCodeNameCount;
34361   UniChar UniCodeName[32];
34362   UniCharCount UniCodeDescCount;
34363   UniChar UniCodeDesc[256];
34364 };
34365 typedef struct CMMInfo CMMInfo;
34366
34367 struct CMMInfoRecord {
34368   OSType CMMType;
34369   long CMMVersion;
34370 };
34371 typedef struct CMMInfoRecord CMMInfoRecord;
34372 struct CMCWInfoRecord {
34373   UInt32 cmmCount;
34374   CMMInfoRecord cmmInfo[2];
34375 };
34376 typedef struct CMCWInfoRecord CMCWInfoRecord;
34377
34378 struct CMProfileIdentifier {
34379   CM2Header profileHeader;
34380   CMDateTime calibrationDate;
34381   UInt32 ASCIIProfileDescriptionLen;
34382   char ASCIIProfileDescription[1];
34383 };
34384 typedef struct CMProfileIdentifier CMProfileIdentifier;
34385 typedef CMProfileIdentifier * CMProfileIdentifierPtr;
34386
34387 enum {
34388   cmColorSpaceSpaceMask = 0x0000003F,
34389   cmColorSpacePremulAlphaMask = 0x00000040,
34390   cmColorSpaceAlphaMask = 0x00000080,
34391   cmColorSpaceSpaceAndAlphaMask = 0x000000FF,
34392   cmColorSpacePackingMask = 0x0000FF00,
34393   cmColorSpaceEncodingMask = 0x000F0000,
34394   cmColorSpaceReservedMask = (long)0xFFF00000
34395 };
34396
34397
34398 enum {
34399   cmNoColorPacking = 0x0000,
34400   cmWord5ColorPacking = 0x0500,
34401   cmWord565ColorPacking = 0x0600,
34402   cmLong8ColorPacking = 0x0800,
34403   cmLong10ColorPacking = 0x0A00,
34404   cmAlphaFirstPacking = 0x1000,
34405   cmOneBitDirectPacking = 0x0B00,
34406   cmAlphaLastPacking = 0x0000,
34407   cm8_8ColorPacking = 0x2800,
34408   cm16_8ColorPacking = 0x2000,
34409   cm24_8ColorPacking = 0x2100,
34410   cm32_8ColorPacking = cmLong8ColorPacking,
34411   cm40_8ColorPacking = 0x2200,
34412   cm48_8ColorPacking = 0x2300,
34413   cm56_8ColorPacking = 0x2400,
34414   cm64_8ColorPacking = 0x2500,
34415   cm32_16ColorPacking = 0x2600,
34416   cm48_16ColorPacking = 0x2900,
34417   cm64_16ColorPacking = 0x2A00,
34418   cm32_32ColorPacking = 0x2700,
34419   cmLittleEndianPacking = 0x4000,
34420   cmReverseChannelPacking = 0x8000
34421 };
34422
34423
34424 enum {
34425   cmSRGB16ChannelEncoding = 0x00010000
34426 };
34427
34428
34429 enum {
34430   cmNoSpace = 0x0000,
34431   cmRGBSpace = 0x0001,
34432   cmCMYKSpace = 0x0002,
34433   cmHSVSpace = 0x0003,
34434   cmHLSSpace = 0x0004,
34435   cmYXYSpace = 0x0005,
34436   cmXYZSpace = 0x0006,
34437   cmLUVSpace = 0x0007,
34438   cmLABSpace = 0x0008,
34439   cmReservedSpace1 = 0x0009,
34440   cmGraySpace = 0x000A,
34441   cmReservedSpace2 = 0x000B,
34442   cmGamutResultSpace = 0x000C,
34443   cmNamedIndexedSpace = 0x0010,
34444   cmMCFiveSpace = 0x0011,
34445   cmMCSixSpace = 0x0012,
34446   cmMCSevenSpace = 0x0013,
34447   cmMCEightSpace = 0x0014,
34448   cmAlphaPmulSpace = 0x0040,
34449   cmAlphaSpace = 0x0080,
34450   cmRGBASpace = cmRGBSpace + cmAlphaSpace,
34451   cmGrayASpace = cmGraySpace + cmAlphaSpace,
34452   cmRGBAPmulSpace = cmRGBASpace + cmAlphaPmulSpace,
34453   cmGrayAPmulSpace = cmGrayASpace + cmAlphaPmulSpace
34454 };
34455
34456
34457
34458
34459 enum {
34460   cmGray8Space = cmGraySpace + cm8_8ColorPacking,
34461   cmGray16Space = cmGraySpace,
34462   cmGray16LSpace = cmGraySpace + cmLittleEndianPacking,
34463   cmGrayA16Space = cmGrayASpace + cm16_8ColorPacking,
34464   cmGrayA32Space = cmGrayASpace,
34465   cmGrayA32LSpace = cmGrayASpace + cmLittleEndianPacking,
34466   cmGrayA16PmulSpace = cmGrayAPmulSpace + cm16_8ColorPacking,
34467   cmGrayA32PmulSpace = cmGrayAPmulSpace,
34468   cmGrayA32LPmulSpace = cmGrayAPmulSpace + cmLittleEndianPacking,
34469   cmRGB16Space = cmRGBSpace + cmWord5ColorPacking,
34470   cmRGB16LSpace = cmRGBSpace + cmWord5ColorPacking + cmLittleEndianPacking,
34471   cmRGB565Space = cmRGBSpace + cmWord565ColorPacking,
34472   cmRGB565LSpace = cmRGBSpace + cmWord565ColorPacking + cmLittleEndianPacking,
34473   cmRGB24Space = cmRGBSpace + cm24_8ColorPacking,
34474   cmRGB32Space = cmRGBSpace + cm32_8ColorPacking,
34475   cmRGB48Space = cmRGBSpace + cm48_16ColorPacking,
34476   cmRGB48LSpace = cmRGBSpace + cm48_16ColorPacking + cmLittleEndianPacking,
34477   cmARGB32Space = cmRGBASpace + cm32_8ColorPacking + cmAlphaFirstPacking,
34478   cmARGB64Space = cmRGBASpace + cm64_16ColorPacking + cmAlphaFirstPacking,
34479   cmARGB64LSpace = cmRGBASpace + cm64_16ColorPacking + cmAlphaFirstPacking + cmLittleEndianPacking,
34480   cmRGBA32Space = cmRGBASpace + cm32_8ColorPacking + cmAlphaLastPacking,
34481   cmRGBA64Space = cmRGBASpace + cm64_16ColorPacking + cmAlphaLastPacking,
34482   cmRGBA64LSpace = cmRGBASpace + cm64_16ColorPacking + cmAlphaLastPacking + cmLittleEndianPacking,
34483   cmARGB32PmulSpace = cmRGBAPmulSpace + cm32_8ColorPacking + cmAlphaFirstPacking,
34484   cmARGB64PmulSpace = cmRGBAPmulSpace + cm64_16ColorPacking + cmAlphaFirstPacking,
34485   cmARGB64LPmulSpace = cmRGBAPmulSpace + cm64_16ColorPacking + cmAlphaFirstPacking + cmLittleEndianPacking,
34486   cmRGBA32PmulSpace = cmRGBAPmulSpace + cm32_8ColorPacking + cmAlphaLastPacking,
34487   cmRGBA64PmulSpace = cmRGBAPmulSpace + cm64_16ColorPacking + cmAlphaLastPacking,
34488   cmRGBA64LPmulSpace = cmRGBAPmulSpace + cm64_16ColorPacking + cmAlphaLastPacking + cmLittleEndianPacking,
34489   cmCMYK32Space = cmCMYKSpace + cm32_8ColorPacking,
34490   cmCMYK64Space = cmCMYKSpace + cm64_16ColorPacking,
34491   cmCMYK64LSpace = cmCMYKSpace + cm64_16ColorPacking + cmLittleEndianPacking,
34492   cmHSV32Space = cmHSVSpace + cmLong10ColorPacking,
34493   cmHLS32Space = cmHLSSpace + cmLong10ColorPacking,
34494   cmYXY32Space = cmYXYSpace + cmLong10ColorPacking,
34495   cmXYZ24Space = cmXYZSpace + cm24_8ColorPacking,
34496   cmXYZ32Space = cmXYZSpace + cmLong10ColorPacking,
34497   cmXYZ48Space = cmXYZSpace + cm48_16ColorPacking,
34498   cmXYZ48LSpace = cmXYZSpace + cm48_16ColorPacking + cmLittleEndianPacking,
34499   cmLUV32Space = cmLUVSpace + cmLong10ColorPacking,
34500   cmLAB24Space = cmLABSpace + cm24_8ColorPacking,
34501   cmLAB32Space = cmLABSpace + cmLong10ColorPacking,
34502   cmLAB48Space = cmLABSpace + cm48_16ColorPacking,
34503   cmLAB48LSpace = cmLABSpace + cm48_16ColorPacking + cmLittleEndianPacking,
34504   cmGamutResult1Space = cmOneBitDirectPacking + cmGamutResultSpace,
34505   cmNamedIndexed32Space = cm32_32ColorPacking + cmNamedIndexedSpace,
34506   cmNamedIndexed32LSpace = cm32_32ColorPacking + cmNamedIndexedSpace + cmLittleEndianPacking,
34507   cmMCFive8Space = cm40_8ColorPacking + cmMCFiveSpace,
34508   cmMCSix8Space = cm48_8ColorPacking + cmMCSixSpace,
34509   cmMCSeven8Space = cm56_8ColorPacking + cmMCSevenSpace,
34510   cmMCEight8Space = cm64_8ColorPacking + cmMCEightSpace
34511 };
34512
34513
34514 typedef UInt32 CMBitmapColorSpace;
34515 struct CMBitmap {
34516   char * image;
34517   long width;
34518   long height;
34519   long rowBytes;
34520   long pixelSize;
34521   CMBitmapColorSpace space;
34522   long user1;
34523   long user2;
34524 };
34525 typedef struct CMBitmap CMBitmap;
34526
34527
34528 typedef UInt32 CMChromaticAdaptation;
34529 enum {
34530   cmUseDefaultChromaticAdaptation = 0,
34531   cmLinearChromaticAdaptation = 1,
34532   cmVonKriesChromaticAdaptation = 2,
34533   cmBradfordChromaticAdaptation = 3
34534 };
34535
34536
34537
34538 enum {
34539   CS_MAX_PATH = 256
34540 };
34541
34542 enum {
34543   cmNoProfileBase = 0,
34544   cmFileBasedProfile = 1,
34545   cmHandleBasedProfile = 2,
34546   cmPtrBasedProfile = 3,
34547   cmProcedureBasedProfile = 4,
34548   cmPathBasedProfile = 5,
34549   cmBufferBasedProfile = 6
34550 };
34551
34552 struct CMFileLocation {
34553   FSSpec spec;
34554 };
34555 typedef struct CMFileLocation CMFileLocation;
34556 struct CMHandleLocation {
34557   Handle h;
34558 };
34559 typedef struct CMHandleLocation CMHandleLocation;
34560 struct CMPtrLocation {
34561   Ptr p;
34562 };
34563 typedef struct CMPtrLocation CMPtrLocation;
34564 struct CMProcedureLocation {
34565   CMProfileAccessUPP proc;
34566   void * refCon;
34567 };
34568 typedef struct CMProcedureLocation CMProcedureLocation;
34569 struct CMPathLocation {
34570   char path[256];
34571 };
34572 typedef struct CMPathLocation CMPathLocation;
34573 struct CMBufferLocation {
34574   void * buffer;
34575   UInt32 size;
34576 };
34577 typedef struct CMBufferLocation CMBufferLocation;
34578 union CMProfLoc {
34579   CMFileLocation fileLoc;
34580   CMHandleLocation handleLoc;
34581   CMPtrLocation ptrLoc;
34582   CMProcedureLocation procLoc;
34583   CMPathLocation pathLoc;
34584   CMBufferLocation bufferLoc;
34585 };
34586 typedef union CMProfLoc CMProfLoc;
34587 struct CMProfileLocation {
34588   short locType;
34589   CMProfLoc u;
34590 };
34591 typedef struct CMProfileLocation CMProfileLocation;
34592 enum {
34593   cmOriginalProfileLocationSize = 72,
34594   cmCurrentProfileLocationSize = 2 + CS_MAX_PATH
34595 };
34596
34597
34598 enum {
34599   cmProfileIterateDataVersion1 = 0x00010000,
34600   cmProfileIterateDataVersion2 = 0x00020000,
34601   cmProfileIterateDataVersion3 = 0x00030000
34602 };
34603
34604 struct CMProfileIterateData {
34605   UInt32 dataVersion;
34606   CM2Header header;
34607   ScriptCode code;
34608   Str255 name;
34609   CMProfileLocation location;
34610   UniCharCount uniCodeNameCount;
34611   UniChar * uniCodeName;
34612   unsigned char * asciiName;
34613   CMMakeAndModel * makeAndModel;
34614   CMProfileMD5 * digest;
34615 };
34616 typedef struct CMProfileIterateData CMProfileIterateData;
34617
34618 typedef OSErr ( * CMProfileIterateProcPtr)(CMProfileIterateData *iterateData, void *refCon);
34619 typedef OSErr ( * CMMIterateProcPtr)(CMMInfo *iterateData, void *refCon);
34620 typedef CMProfileIterateProcPtr CMProfileIterateUPP;
34621 typedef CMMIterateProcPtr CMMIterateUPP;
34622 extern CMProfileIterateUPP
34623 NewCMProfileIterateUPP(CMProfileIterateProcPtr userRoutine) ;
34624 extern CMMIterateUPP
34625 NewCMMIterateUPP(CMMIterateProcPtr userRoutine) ;
34626 extern void
34627 DisposeCMProfileIterateUPP(CMProfileIterateUPP userUPP) ;
34628 extern void
34629 DisposeCMMIterateUPP(CMMIterateUPP userUPP) ;
34630 extern OSErr
34631 InvokeCMProfileIterateUPP(
34632   CMProfileIterateData * iterateData,
34633   void * refCon,
34634   CMProfileIterateUPP userUPP) ;
34635 extern OSErr
34636 InvokeCMMIterateUPP(
34637   CMMInfo * iterateData,
34638   void * refCon,
34639   CMMIterateUPP userUPP) ;
34640 extern CMError
34641 CMNewProfile(
34642   CMProfileRef * prof,
34643   const CMProfileLocation * theProfile) ;
34644 extern CMError
34645 CMOpenProfile(
34646   CMProfileRef * prof,
34647   const CMProfileLocation * theProfile) ;
34648 extern CMError
34649 CMCloseProfile(CMProfileRef prof) ;
34650 extern CMError
34651 CMUpdateProfile(CMProfileRef prof) ;
34652 extern CMError
34653 CMCopyProfile(
34654   CMProfileRef * targetProf,
34655   const CMProfileLocation * targetLocation,
34656   CMProfileRef srcProf) ;
34657 extern CMError
34658 CMValidateProfile(
34659   CMProfileRef prof,
34660   Boolean * valid,
34661   Boolean * preferredCMMnotfound) ;
34662 extern CMError
34663 CMGetProfileLocation(
34664   CMProfileRef prof,
34665   CMProfileLocation * theProfile) ;
34666 extern CMError
34667 NCMGetProfileLocation(
34668   CMProfileRef prof,
34669   CMProfileLocation * theProfile,
34670   UInt32 * locationSize) ;
34671 extern CMError
34672 CMFlattenProfile(
34673   CMProfileRef prof,
34674   UInt32 flags,
34675   CMFlattenUPP proc,
34676   void * refCon,
34677   Boolean * preferredCMMnotfound) ;
34678 extern CMError
34679 CMGetProfileHeader(
34680   CMProfileRef prof,
34681   CMAppleProfileHeader * header) ;
34682 extern CMError
34683 CMSetProfileHeader(
34684   CMProfileRef prof,
34685   const CMAppleProfileHeader * header) ;
34686 extern CMError
34687 CMProfileElementExists(
34688   CMProfileRef prof,
34689   OSType tag,
34690   Boolean * found) ;
34691 extern CMError
34692 CMCountProfileElements(
34693   CMProfileRef prof,
34694   UInt32 * elementCount) ;
34695 extern CMError
34696 CMGetProfileElement(
34697   CMProfileRef prof,
34698   OSType tag,
34699   UInt32 * elementSize,
34700   void * elementData) ;
34701 extern CMError
34702 CMSetProfileElement(
34703   CMProfileRef prof,
34704   OSType tag,
34705   UInt32 elementSize,
34706   const void * elementData) ;
34707 extern CMError
34708 CMSetProfileElementSize(
34709   CMProfileRef prof,
34710   OSType tag,
34711   UInt32 elementSize) ;
34712 extern CMError
34713 CMSetProfileElementReference(
34714   CMProfileRef prof,
34715   OSType elementTag,
34716   OSType referenceTag) ;
34717 extern CMError
34718 CMGetPartialProfileElement(
34719   CMProfileRef prof,
34720   OSType tag,
34721   UInt32 offset,
34722   UInt32 * byteCount,
34723   void * elementData) ;
34724 extern CMError
34725 CMSetPartialProfileElement(
34726   CMProfileRef prof,
34727   OSType tag,
34728   UInt32 offset,
34729   UInt32 byteCount,
34730   const void * elementData) ;
34731 extern CMError
34732 CMGetIndProfileElementInfo(
34733   CMProfileRef prof,
34734   UInt32 index,
34735   OSType * tag,
34736   UInt32 * elementSize,
34737   Boolean * refs) ;
34738 extern CMError
34739 CMGetIndProfileElement(
34740   CMProfileRef prof,
34741   UInt32 index,
34742   UInt32 * elementSize,
34743   void * elementData) ;
34744 extern CMError
34745 CMRemoveProfileElement(
34746   CMProfileRef prof,
34747   OSType tag) ;
34748 extern CMError
34749 CMGetScriptProfileDescription(
34750   CMProfileRef prof,
34751   Str255 name,
34752   ScriptCode * code) ;
34753 extern CMError
34754 CMGetProfileDescriptions(
34755   CMProfileRef prof,
34756   char * aName,
34757   UInt32 * aCount,
34758   Str255 mName,
34759   ScriptCode * mCode,
34760   UniChar * uName,
34761   UniCharCount * uCount) ;
34762 extern CMError
34763 CMSetProfileDescriptions(
34764   CMProfileRef prof,
34765   const char * aName,
34766   UInt32 aCount,
34767   ConstStr255Param mName,
34768   ScriptCode mCode,
34769   const UniChar * uName,
34770   UniCharCount uCount) ;
34771 extern CMError
34772 CMCopyProfileLocalizedStringDictionary(
34773   CMProfileRef prof,
34774   OSType tag,
34775   CFDictionaryRef * theDict) ;
34776 extern CMError
34777 CMSetProfileLocalizedStringDictionary(
34778   CMProfileRef prof,
34779   OSType tag,
34780   CFDictionaryRef theDict) ;
34781 extern CMError
34782 CMCopyProfileLocalizedString(
34783   CMProfileRef prof,
34784   OSType tag,
34785   CFStringRef reqLocale,
34786   CFStringRef * locale,
34787   CFStringRef * str) ;
34788 extern CMError
34789 CMCloneProfileRef(CMProfileRef prof) ;
34790 extern CMError
34791 CMGetProfileRefCount(
34792   CMProfileRef prof,
34793   long * count) ;
34794 extern CMError
34795 CMProfileModified(
34796   CMProfileRef prof,
34797   Boolean * modified) ;
34798 extern CMError
34799 CMGetProfileMD5(
34800   CMProfileRef prof,
34801   CMProfileMD5 digest) ;
34802 extern CMError
34803 CMGetNamedColorInfo(
34804   CMProfileRef prof,
34805   UInt32 * deviceChannels,
34806   OSType * deviceColorSpace,
34807   OSType * PCSColorSpace,
34808   UInt32 * count,
34809   StringPtr prefix,
34810   StringPtr suffix) ;
34811 extern CMError
34812 CMGetNamedColorValue(
34813   CMProfileRef prof,
34814   StringPtr name,
34815   CMColor * deviceColor,
34816   CMColor * PCSColor) ;
34817 extern CMError
34818 CMGetIndNamedColorValue(
34819   CMProfileRef prof,
34820   UInt32 index,
34821   CMColor * deviceColor,
34822   CMColor * PCSColor) ;
34823 extern CMError
34824 CMGetNamedColorIndex(
34825   CMProfileRef prof,
34826   StringPtr name,
34827   UInt32 * index) ;
34828 extern CMError
34829 CMGetNamedColorName(
34830   CMProfileRef prof,
34831   UInt32 index,
34832   StringPtr name) ;
34833 extern CMError
34834 NCWNewColorWorld(
34835   CMWorldRef * cw,
34836   CMProfileRef src,
34837   CMProfileRef dst) ;
34838 extern CMError
34839 CWConcatColorWorld(
34840   CMWorldRef * cw,
34841   CMConcatProfileSet * profileSet) ;
34842 extern CMError
34843 CWNewLinkProfile(
34844   CMProfileRef * prof,
34845   const CMProfileLocation * targetLocation,
34846   CMConcatProfileSet * profileSet) ;
34847 extern CMError
34848 NCWConcatColorWorld(
34849   CMWorldRef * cw,
34850   NCMConcatProfileSet * profileSet,
34851   CMConcatCallBackUPP proc,
34852   void * refCon) ;
34853 extern CMError
34854 NCWNewLinkProfile(
34855   CMProfileRef * prof,
34856   const CMProfileLocation * targetLocation,
34857   NCMConcatProfileSet * profileSet,
34858   CMConcatCallBackUPP proc,
34859   void * refCon) ;
34860 extern void
34861 CWDisposeColorWorld(CMWorldRef cw) ;
34862 extern CMError
34863 CWMatchColors(
34864   CMWorldRef cw,
34865   CMColor * myColors,
34866   UInt32 count) ;
34867 extern CMError
34868 CWCheckColors(
34869   CMWorldRef cw,
34870   CMColor * myColors,
34871   UInt32 count,
34872   UInt32 * result) ;
34873 extern CMError
34874 CWMatchBitmap(
34875   CMWorldRef cw,
34876   CMBitmap * bitmap,
34877   CMBitmapCallBackUPP progressProc,
34878   void * refCon,
34879   CMBitmap * matchedBitmap) ;
34880 extern CMError
34881 CWCheckBitmap(
34882   CMWorldRef cw,
34883   const CMBitmap * bitmap,
34884   CMBitmapCallBackUPP progressProc,
34885   void * refCon,
34886   CMBitmap * resultBitmap) ;
34887 extern CMError
34888 CMCreateProfileIdentifier(
34889   CMProfileRef prof,
34890   CMProfileIdentifierPtr ident,
34891   UInt32 * size) ;
34892 extern CMError
34893 CMGetSystemProfile(CMProfileRef * prof) ;
34894 extern CMError
34895 CMSetSystemProfile(const FSSpec * profileFileSpec) ;
34896 extern CMError
34897 NCMSetSystemProfile(const CMProfileLocation * profLoc) ;
34898 extern CMError
34899 CMGetDefaultProfileBySpace(
34900   OSType dataColorSpace,
34901   CMProfileRef * prof) ;
34902 extern CMError
34903 CMSetDefaultProfileBySpace(
34904   OSType dataColorSpace,
34905   CMProfileRef prof) ;
34906 extern CMError
34907 CMGetProfileByAVID(
34908   CMDisplayIDType theID,
34909   CMProfileRef * prof) ;
34910 extern CMError
34911 CMSetProfileByAVID(
34912   CMDisplayIDType theID,
34913   CMProfileRef prof) ;
34914 extern CMError
34915 CMGetGammaByAVID(
34916   CMDisplayIDType theID,
34917   CMVideoCardGamma * gamma,
34918   UInt32 * size) ;
34919 extern CMError
34920 CMSetGammaByAVID(
34921   CMDisplayIDType theID,
34922   CMVideoCardGamma * gamma) ;
34923 extern CMError
34924 CMGetDefaultProfileByUse(
34925   OSType use,
34926   CMProfileRef * prof) ;
34927 extern CMError
34928 CMSetDefaultProfileByUse(
34929   OSType use,
34930   CMProfileRef prof) ;
34931 extern CMError
34932 CMNewProfileSearch(
34933   CMSearchRecord * searchSpec,
34934   void * refCon,
34935   UInt32 * count,
34936   CMProfileSearchRef * searchResult) ;
34937 extern CMError
34938 CMUpdateProfileSearch(
34939   CMProfileSearchRef search,
34940   void * refCon,
34941   UInt32 * count) ;
34942 extern void
34943 CMDisposeProfileSearch(CMProfileSearchRef search) ;
34944 extern CMError
34945 CMSearchGetIndProfile(
34946   CMProfileSearchRef search,
34947   UInt32 index,
34948   CMProfileRef * prof) ;
34949 extern CMError
34950 CMSearchGetIndProfileFileSpec(
34951   CMProfileSearchRef search,
34952   UInt32 index,
34953   FSSpec * profileFile) ;
34954 extern CMError
34955 CMProfileIdentifierFolderSearch(
34956   CMProfileIdentifierPtr ident,
34957   UInt32 * matchedCount,
34958   CMProfileSearchRef * searchResult) ;
34959 extern CMError
34960 CMProfileIdentifierListSearch(
34961   CMProfileIdentifierPtr ident,
34962   CMProfileRef * profileList,
34963   UInt32 listSize,
34964   UInt32 * matchedCount,
34965   CMProfileRef * matchedList) ;
34966 extern CMError
34967 CMIterateColorSyncFolder(
34968   CMProfileIterateUPP proc,
34969   UInt32 * seed,
34970   UInt32 * count,
34971   void * refCon) ;
34972 extern CMError
34973 NCMUnflattenProfile(
34974   CMProfileLocation * targetLocation,
34975   CMFlattenUPP proc,
34976   void * refCon,
34977   Boolean * preferredCMMnotfound) ;
34978 extern CMError
34979 CMGetColorSyncFolderSpec(
34980   short vRefNum,
34981   Boolean createFolder,
34982   short * foundVRefNum,
34983   long * foundDirID) ;
34984 extern CMError
34985 CMGetCWInfo(
34986   CMWorldRef cw,
34987   CMCWInfoRecord * info) ;
34988 extern CMError
34989 CMGetPreferredCMM(
34990   OSType * cmmType,
34991   Boolean * preferredCMMnotfound) ;
34992 extern CMError
34993 CMIterateCMMInfo(
34994   CMMIterateUPP proc,
34995   UInt32 * count,
34996   void * refCon) ;
34997 extern CMError
34998 CMGetColorSyncVersion(UInt32 * version) ;
34999 extern CMError
35000 CMLaunchControlPanel(UInt32 flags) ;
35001 extern CMError
35002 CMConvertXYZToLab(
35003   const CMColor * src,
35004   const CMXYZColor * white,
35005   CMColor * dst,
35006   UInt32 count) ;
35007 extern CMError
35008 CMConvertLabToXYZ(
35009   const CMColor * src,
35010   const CMXYZColor * white,
35011   CMColor * dst,
35012   UInt32 count) ;
35013 extern CMError
35014 CMConvertXYZToLuv(
35015   const CMColor * src,
35016   const CMXYZColor * white,
35017   CMColor * dst,
35018   UInt32 count) ;
35019 extern CMError
35020 CMConvertLuvToXYZ(
35021   const CMColor * src,
35022   const CMXYZColor * white,
35023   CMColor * dst,
35024   UInt32 count) ;
35025 extern CMError
35026 CMConvertXYZToYxy(
35027   const CMColor * src,
35028   CMColor * dst,
35029   UInt32 count) ;
35030 extern CMError
35031 CMConvertYxyToXYZ(
35032   const CMColor * src,
35033   CMColor * dst,
35034   UInt32 count) ;
35035 extern CMError
35036 CMConvertRGBToHLS(
35037   const CMColor * src,
35038   CMColor * dst,
35039   UInt32 count) ;
35040 extern CMError
35041 CMConvertHLSToRGB(
35042   const CMColor * src,
35043   CMColor * dst,
35044   UInt32 count) ;
35045 extern CMError
35046 CMConvertRGBToHSV(
35047   const CMColor * src,
35048   CMColor * dst,
35049   UInt32 count) ;
35050 extern CMError
35051 CMConvertHSVToRGB(
35052   const CMColor * src,
35053   CMColor * dst,
35054   UInt32 count) ;
35055 extern CMError
35056 CMConvertRGBToGray(
35057   const CMColor * src,
35058   CMColor * dst,
35059   UInt32 count) ;
35060 extern CMError
35061 CMConvertXYZToFixedXYZ(
35062   const CMXYZColor * src,
35063   CMFixedXYZColor * dst,
35064   UInt32 count) ;
35065 extern CMError
35066 CMConvertFixedXYZToXYZ(
35067   const CMFixedXYZColor * src,
35068   CMXYZColor * dst,
35069   UInt32 count) ;
35070 extern CMError
35071 CMConvertXYZToXYZ(
35072   const CMColor * src,
35073   const CMXYZColor * srcIlluminant,
35074   CMColor * dst,
35075   const CMXYZColor * dstIlluminant,
35076   CMChromaticAdaptation method,
35077   UInt32 count) ;
35078 extern CMError
35079 CMGetPS2ColorSpace(
35080   CMProfileRef srcProf,
35081   UInt32 flags,
35082   CMFlattenUPP proc,
35083   void * refCon,
35084   Boolean * preferredCMMnotfound) ;
35085 extern CMError
35086 CMGetPS2ColorRenderingIntent(
35087   CMProfileRef srcProf,
35088   UInt32 flags,
35089   CMFlattenUPP proc,
35090   void * refCon,
35091   Boolean * preferredCMMnotfound) ;
35092 extern CMError
35093 CMGetPS2ColorRendering(
35094   CMProfileRef srcProf,
35095   CMProfileRef dstProf,
35096   UInt32 flags,
35097   CMFlattenUPP proc,
35098   void * refCon,
35099   Boolean * preferredCMMnotfound) ;
35100 extern CMError
35101 CMGetPS2ColorRenderingVMSize(
35102   CMProfileRef srcProf,
35103   CMProfileRef dstProf,
35104   UInt32 * vmSize,
35105   Boolean * preferredCMMnotfound) ;
35106
35107
35108 }
35109
35110
35111
35112
35113
35114
35115
35116 extern "C" {
35117
35118
35119
35120
35121
35122
35123
35124 enum {
35125   cmDeviceInfoVersion1 = 0x00010000,
35126   cmDeviceProfileInfoVersion1 = 0x00010000,
35127   cmDeviceProfileInfoVersion2 = 0x00020000
35128 };
35129
35130 enum {
35131   cmCurrentDeviceInfoVersion = cmDeviceInfoVersion1,
35132   cmCurrentProfileInfoVersion = cmDeviceProfileInfoVersion1
35133 };
35134
35135
35136
35137
35138
35139 enum {
35140   cmDefaultDeviceID = 0,
35141   cmDefaultProfileID = 0
35142 };
35143
35144
35145
35146
35147
35148 enum {
35149   cmDeviceStateDefault = 0x00000000,
35150   cmDeviceStateOffline = 0x00000001,
35151   cmDeviceStateBusy = 0x00000002,
35152   cmDeviceStateForceNotify = (long)0x80000000,
35153   cmDeviceStateDeviceRsvdBits = 0x00FF0000,
35154   cmDeviceStateAppleRsvdBits = (long)0xFF00FFFF
35155 };
35156 enum {
35157   cmIterateFactoryDeviceProfiles = 0x00000001,
35158   cmIterateCustomDeviceProfiles = 0x00000002,
35159   cmIterateCurrentDeviceProfiles = 0x00000003,
35160   cmIterateAllDeviceProfiles = 0x00000004,
35161   cmIterateDeviceProfilesMask = 0x0000000F
35162 };
35163
35164
35165
35166
35167 enum {
35168   cmDeviceDBNotFoundErr = -4227,
35169   cmDeviceAlreadyRegistered = -4228,
35170   cmDeviceNotRegistered = -4229,
35171   cmDeviceProfilesNotFound = -4230,
35172   cmInternalCFErr = -4231
35173 };
35174 typedef UInt32 CMDeviceState;
35175
35176
35177
35178 typedef UInt32 CMDeviceID;
35179
35180
35181
35182 typedef UInt32 CMDeviceProfileID;
35183
35184
35185
35186 enum {
35187   cmScannerDeviceClass = 'scnr',
35188   cmCameraDeviceClass = 'cmra',
35189   cmDisplayDeviceClass = 'mntr',
35190   cmPrinterDeviceClass = 'prtr',
35191   cmProofDeviceClass = 'pruf'
35192 };
35193
35194 typedef OSType CMDeviceClass;
35195
35196
35197
35198
35199 struct CMDeviceScope {
35200   CFStringRef deviceUser;
35201   CFStringRef deviceHost;
35202 };
35203 typedef struct CMDeviceScope CMDeviceScope;
35204 typedef CMDeviceScope CMDeviceProfileScope;
35205
35206
35207
35208
35209 struct CMDeviceInfo {
35210   UInt32 dataVersion;
35211   CMDeviceClass deviceClass;
35212   CMDeviceID deviceID;
35213   CMDeviceScope deviceScope;
35214   CMDeviceState deviceState;
35215   CMDeviceProfileID defaultProfileID;
35216   CFDictionaryRef * deviceName;
35217
35218   UInt32 profileCount;
35219   UInt32 reserved;
35220 };
35221 typedef struct CMDeviceInfo CMDeviceInfo;
35222 typedef CMDeviceInfo * CMDeviceInfoPtr;
35223
35224
35225
35226
35227 struct CMDeviceProfileInfo {
35228   UInt32 dataVersion;
35229   CMDeviceProfileID profileID;
35230   CMProfileLocation profileLoc;
35231   CFDictionaryRef profileName;
35232   UInt32 reserved;
35233 };
35234 typedef struct CMDeviceProfileInfo CMDeviceProfileInfo;
35235 struct NCMDeviceProfileInfo {
35236   UInt32 dataVersion;
35237   CMDeviceProfileID profileID;
35238   CMProfileLocation profileLoc;
35239   CFDictionaryRef profileName;
35240   CMDeviceProfileScope profileScope;
35241   UInt32 reserved;
35242 };
35243 typedef struct NCMDeviceProfileInfo NCMDeviceProfileInfo;
35244
35245
35246
35247
35248 struct CMDeviceProfileArray {
35249   UInt32 profileCount;
35250   CMDeviceProfileInfo profiles[1];
35251 };
35252 typedef struct CMDeviceProfileArray CMDeviceProfileArray;
35253 typedef CMDeviceProfileArray * CMDeviceProfileArrayPtr;
35254
35255
35256
35257 typedef OSErr ( * CMIterateDeviceInfoProcPtr)(const CMDeviceInfo *deviceInfo, void *refCon);
35258 typedef OSErr ( * CMIterateDeviceProfileProcPtr)(const CMDeviceInfo *deviceInfo, const NCMDeviceProfileInfo *profileInfo, void *refCon);
35259 extern CMError
35260 CMRegisterColorDevice(
35261   CMDeviceClass deviceClass,
35262   CMDeviceID deviceID,
35263   CFDictionaryRef deviceName,
35264   const CMDeviceScope * deviceScope) ;
35265 extern CMError
35266 CMUnregisterColorDevice(
35267   CMDeviceClass deviceClass,
35268   CMDeviceID deviceID) ;
35269 extern CMError
35270 CMSetDefaultDevice(
35271   CMDeviceClass deviceClass,
35272   CMDeviceID deviceID) ;
35273 extern CMError
35274 CMGetDefaultDevice(
35275   CMDeviceClass deviceClass,
35276   CMDeviceID * deviceID) ;
35277 extern CMError
35278 CMSetDeviceFactoryProfiles(
35279   CMDeviceClass deviceClass,
35280   CMDeviceID deviceID,
35281   CMDeviceProfileID defaultProfID,
35282   const CMDeviceProfileArray * deviceProfiles) ;
35283 extern CMError
35284 CMGetDeviceFactoryProfiles(
35285   CMDeviceClass deviceClass,
35286   CMDeviceID deviceID,
35287   CMDeviceProfileID * defaultProfID,
35288   UInt32 * arraySize,
35289   CMDeviceProfileArray * deviceProfiles) ;
35290 extern CMError
35291 CMSetDeviceProfiles(
35292   CMDeviceClass deviceClass,
35293   CMDeviceID deviceID,
35294   const CMDeviceProfileScope * profileScope,
35295   const CMDeviceProfileArray * deviceProfiles) ;
35296 extern CMError
35297 CMGetDeviceProfiles(
35298   CMDeviceClass deviceClass,
35299   CMDeviceID deviceID,
35300   UInt32 * arraySize,
35301   CMDeviceProfileArray * deviceProfiles) ;
35302 extern CMError
35303 CMSetDeviceDefaultProfileID(
35304   CMDeviceClass deviceClass,
35305   CMDeviceID deviceID,
35306   CMDeviceProfileID defaultProfID) ;
35307 extern CMError
35308 CMGetDeviceDefaultProfileID(
35309   CMDeviceClass deviceClass,
35310   CMDeviceID deviceID,
35311   CMDeviceProfileID * defaultProfID) ;
35312 extern CMError
35313 CMGetDeviceProfile(
35314   CMDeviceClass deviceClass,
35315   CMDeviceID deviceID,
35316   CMDeviceProfileID profileID,
35317   CMProfileLocation * deviceProfLoc) ;
35318 extern CMError
35319 CMSetDeviceProfile(
35320   CMDeviceClass deviceClass,
35321   CMDeviceID deviceID,
35322   const CMDeviceProfileScope * profileScope,
35323   CMDeviceProfileID profileID,
35324   const CMProfileLocation * deviceProfLoc) ;
35325 extern CMError
35326 CMSetDeviceState(
35327   CMDeviceClass deviceClass,
35328   CMDeviceID deviceID,
35329   CMDeviceState deviceState) ;
35330 extern CMError
35331 CMGetDeviceState(
35332   CMDeviceClass deviceClass,
35333   CMDeviceID deviceID,
35334   CMDeviceState * deviceState) ;
35335 extern CMError
35336 CMGetDeviceInfo(
35337   CMDeviceClass deviceClass,
35338   CMDeviceID deviceID,
35339   CMDeviceInfo * deviceInfo) ;
35340 extern CMError
35341 CMIterateColorDevices(
35342   CMIterateDeviceInfoProcPtr proc,
35343   UInt32 * seed,
35344   UInt32 * count,
35345   void * refCon) ;
35346 extern CMError
35347 CMIterateDeviceProfiles(
35348   CMIterateDeviceProfileProcPtr proc,
35349   UInt32 * seed,
35350   UInt32 * count,
35351   UInt32 flags,
35352   void * refCon) ;
35353
35354
35355
35356
35357
35358 }
35359
35360
35361
35362 enum {
35363   CMMInterfaceVersion = 1
35364 };
35365
35366
35367
35368 enum {
35369
35370   kCMMOpen = -1,
35371   kCMMClose = -2,
35372   kCMMGetInfo = -4,
35373   kNCMMInit = 6,
35374   kCMMMatchColors = 1,
35375   kCMMCheckColors = 2,
35376
35377
35378   kCMMValidateProfile = 8,
35379   kCMMMatchBitmap = 9,
35380   kCMMCheckBitmap = 10,
35381   kCMMConcatenateProfiles = 5,
35382   kCMMConcatInit = 7,
35383   kCMMNewLinkProfile = 16,
35384   kNCMMConcatInit = 18,
35385   kNCMMNewLinkProfile = 19,
35386   kCMMGetPS2ColorSpace = 11,
35387   kCMMGetPS2ColorRenderingIntent = 12,
35388   kCMMGetPS2ColorRendering = 13,
35389   kCMMGetPS2ColorRenderingVMSize = 17,
35390
35391
35392   kCMMFlattenProfile = 14,
35393   kCMMUnflattenProfile = 15,
35394
35395
35396   kCMMInit = 0,
35397   kCMMGetNamedColorInfo = 70,
35398   kCMMGetNamedColorValue = 71,
35399   kCMMGetIndNamedColorValue = 72,
35400   kCMMGetNamedColorIndex = 73,
35401   kCMMGetNamedColorName = 74,
35402
35403
35404   kCMMMatchPixMap = 3,
35405   kCMMCheckPixMap = 4
35406 };
35407
35408
35409
35410 extern "C" {
35411
35412
35413 enum {
35414
35415   cmspInvalidImageFile = -4220,
35416   cmspInvalidImageSpace = -4221,
35417   cmspInvalidProfileEmbed = -4222,
35418   cmspInvalidProfileSource = -4223,
35419   cmspInvalidProfileDest = -4224,
35420   cmspInvalidProfileProof = -4225,
35421   cmspInvalidProfileLink = -4226
35422 };
35423
35424
35425
35426
35427
35428
35429 enum {
35430   cmspFavorEmbeddedMask = 0x00000001
35431 };
35432
35433
35434
35435 typedef CMError ( * ValidateImageProcPtr)(const FSSpec * spec);
35436 typedef CMError ( * GetImageSpaceProcPtr)(const FSSpec *spec, OSType *space);
35437 typedef CMError ( * ValidateSpaceProcPtr)(const FSSpec *spec, OSType *space);
35438 typedef CMError ( * EmbedImageProcPtr)(const FSSpec *specFrom, const FSSpec *specInto, CMProfileRef embedProf, UInt32 embedFlags);
35439 typedef CMError ( * UnembedImageProcPtr)(const FSSpec *specFrom, const FSSpec *specInto);
35440 typedef CMError ( * MatchImageProcPtr)(const FSSpec *specFrom, const FSSpec *specInto, UInt32 qual, UInt32 srcIntent, CMProfileRef srcProf, CMProfileRef dstProf, CMProfileRef prfProf, UInt32 matchFlags);
35441 typedef CMError ( * CountImageProfilesProcPtr)(const FSSpec *spec, UInt32 *count);
35442 typedef CMError ( * GetIndImageProfileProcPtr)(const FSSpec *spec, UInt32 index, CMProfileRef *prof);
35443 typedef CMError ( * SetIndImageProfileProcPtr)(const FSSpec *specFrom, const FSSpec *specInto, UInt32 index, CMProfileRef prof, UInt32 embedFlags);
35444
35445 typedef CMError ( * CMValidImageProcPtr)(const FSSpec * spec);
35446 typedef CMError ( * CMGetImageSpaceProcPtr)(const FSSpec *spec, OSType *space);
35447 typedef CMError ( * CMEmbedImageProcPtr)(const FSSpec *specFrom, const FSSpec *specInto, Boolean repl, CMProfileRef embProf);
35448 typedef CMError ( * CMUnembedImageProcPtr)(const FSSpec *specFrom, const FSSpec *specInto, Boolean repl);
35449 typedef CMError ( * CMMatchImageProcPtr)(const FSSpec *specFrom, const FSSpec *specInto, Boolean repl, UInt32 qual, CMProfileRef srcProf, UInt32 srcIntent, CMProfileRef dstProf);
35450 typedef CMError ( * CMProofImageProcPtr)(const FSSpec *specFrom, const FSSpec *specInto, Boolean repl, UInt32 qual, CMProfileRef srcProf, UInt32 srcIntent, CMProfileRef dstProf, CMProfileRef prfProf);
35451 typedef CMError ( * CMLinkImageProcPtr)(const FSSpec *specFrom, const FSSpec *specInto, Boolean repl, UInt32 qual, CMProfileRef lnkProf, UInt32 lnkIntent);
35452 typedef CMError ( * CMCountImageProfilesProcPtr)(const FSSpec *spec, UInt32 *count);
35453 typedef CMError ( * CMGetIndImageProfileProcPtr)(const FSSpec *spec, UInt32 index, CMProfileRef *prof);
35454 typedef CMError ( * CMSetIndImageProfileProcPtr)(const FSSpec *specFrom, const FSSpec *specInto, Boolean repl, UInt32 index, CMProfileRef prof);
35455 extern CMError
35456 CMValidImage(const FSSpec * spec);
35457 extern CMError
35458 CMGetImageSpace(
35459   const FSSpec * spec,
35460   OSType * space);
35461 extern CMError
35462 CMEmbedImage(
35463   const FSSpec * specFrom,
35464   const FSSpec * specInto,
35465   Boolean repl,
35466   CMProfileRef embProf);
35467 extern CMError
35468 CMUnembedImage(
35469   const FSSpec * specFrom,
35470   const FSSpec * specInto,
35471   Boolean repl);
35472 extern CMError
35473 CMMatchImage(
35474   const FSSpec * specFrom,
35475   const FSSpec * specInto,
35476   Boolean repl,
35477   UInt32 qual,
35478   CMProfileRef srcProf,
35479   UInt32 srcIntent,
35480   CMProfileRef dstProf);
35481 extern CMError
35482 CMProofImage(
35483   const FSSpec * specFrom,
35484   const FSSpec * specInto,
35485   Boolean repl,
35486   UInt32 qual,
35487   CMProfileRef srcProf,
35488   UInt32 srcIntent,
35489   CMProfileRef dstProf,
35490   CMProfileRef prfProf);
35491 extern CMError
35492 CMLinkImage(
35493   const FSSpec * specFrom,
35494   const FSSpec * specInto,
35495   Boolean repl,
35496   UInt32 qual,
35497   CMProfileRef lnkProf,
35498   UInt32 lnkIntent);
35499 extern CMError
35500 CMCountImageProfiles(
35501   const FSSpec * spec,
35502   UInt32 * count);
35503 extern CMError
35504 CMGetIndImageProfile(
35505   const FSSpec * spec,
35506   UInt32 index,
35507   CMProfileRef * prof);
35508 extern CMError
35509 CMSetIndImageProfile(
35510   const FSSpec * specFrom,
35511   const FSSpec * specInto,
35512   Boolean repl,
35513   UInt32 index,
35514   CMProfileRef prof);
35515
35516
35517
35518
35519 }
35520
35521
35522
35523
35524
35525
35526
35527 extern "C" {
35528
35529
35530
35531
35532 enum {
35533   typeBoolean = 'bool',
35534   typeChar = 'TEXT'
35535 };
35536
35537
35538 enum {
35539   typeSInt16 = 'shor',
35540   typeSInt32 = 'long',
35541   typeUInt32 = 'magn',
35542   typeSInt64 = 'comp',
35543   typeIEEE32BitFloatingPoint = 'sing',
35544   typeIEEE64BitFloatingPoint = 'doub',
35545   type128BitFloatingPoint = 'ldbl',
35546   typeDecimalStruct = 'decm'
35547 };
35548
35549
35550 enum {
35551   typeSMInt = typeSInt16,
35552   typeShortInteger = typeSInt16,
35553   typeInteger = typeSInt32,
35554   typeLongInteger = typeSInt32,
35555   typeMagnitude = typeUInt32,
35556   typeComp = typeSInt64,
35557   typeSMFloat = typeIEEE32BitFloatingPoint,
35558   typeShortFloat = typeIEEE32BitFloatingPoint,
35559   typeFloat = typeIEEE64BitFloatingPoint,
35560   typeLongFloat = typeIEEE64BitFloatingPoint,
35561   typeExtended = 'exte'
35562 };
35563
35564
35565 enum {
35566   typeAEList = 'list',
35567   typeAERecord = 'reco',
35568   typeAppleEvent = 'aevt',
35569   typeEventRecord = 'evrc',
35570   typeTrue = 'true',
35571   typeFalse = 'fals',
35572   typeAlias = 'alis',
35573   typeEnumerated = 'enum',
35574   typeType = 'type',
35575   typeAppParameters = 'appa',
35576   typeProperty = 'prop',
35577   typeFSS = 'fss ',
35578   typeFSRef = 'fsrf',
35579   typeFileURL = 'furl',
35580   typeKeyword = 'keyw',
35581   typeSectionH = 'sect',
35582   typeWildCard = '****',
35583   typeApplSignature = 'sign',
35584   typeQDRectangle = 'qdrt',
35585   typeFixed = 'fixd',
35586   typeProcessSerialNumber = 'psn ',
35587   typeApplicationURL = 'aprl',
35588   typeNull = 'null'
35589 };
35590
35591
35592 enum {
35593   typeKernelProcessID = 'kpid',
35594   typeMachPort = 'port'
35595 };
35596
35597
35598 enum {
35599   keyTransactionIDAttr = 'tran',
35600   keyReturnIDAttr = 'rtid',
35601   keyEventClassAttr = 'evcl',
35602   keyEventIDAttr = 'evid',
35603   keyAddressAttr = 'addr',
35604   keyOptionalKeywordAttr = 'optk',
35605   keyTimeoutAttr = 'timo',
35606   keyInteractLevelAttr = 'inte',
35607   keyEventSourceAttr = 'esrc',
35608   keyMissedKeywordAttr = 'miss',
35609   keyOriginalAddressAttr = 'from',
35610   keyAcceptTimeoutAttr = 'actm'
35611 };
35612
35613
35614 enum {
35615   kAEDebugPOSTHeader = (1 << 0),
35616   kAEDebugReplyHeader = (1 << 1),
35617   kAEDebugXMLRequest = (1 << 2),
35618   kAEDebugXMLResponse = (1 << 3),
35619   kAEDebugXMLDebugAll = (long)0xFFFFFFFF
35620 };
35621
35622
35623
35624
35625
35626 enum {
35627   kSOAP1999Schema = 'ss99',
35628   kSOAP2001Schema = 'ss01'
35629 };
35630
35631 enum {
35632
35633   keyUserNameAttr = 'unam',
35634   keyUserPasswordAttr = 'pass',
35635   keyDisableAuthenticationAttr = 'auth',
35636
35637
35638   keyXMLDebuggingAttr = 'xdbg',
35639
35640   kAERPCClass = 'rpc ',
35641   kAEXMLRPCScheme = 'RPC2',
35642   kAESOAPScheme = 'SOAP',
35643   kAESharedScriptHandler = 'wscp',
35644
35645   keyRPCMethodName = 'meth',
35646   keyRPCMethodParam = 'parm',
35647   keyRPCMethodParamOrder = '/ord',
35648
35649   keyAEPOSTHeaderData = 'phed',
35650   keyAEReplyHeaderData = 'rhed',
35651   keyAEXMLRequestData = 'xreq',
35652   keyAEXMLReplyData = 'xrep',
35653
35654   keyAdditionalHTTPHeaders = 'ahed',
35655   keySOAPAction = 'sact',
35656   keySOAPMethodNameSpace = 'mspc',
35657   keySOAPMethodNameSpaceURI = 'mspu',
35658   keySOAPSchemaVersion = 'ssch'
35659 };
35660 enum {
35661   keySOAPStructureMetaData = '/smd',
35662   keySOAPSMDNamespace = 'ssns',
35663   keySOAPSMDNamespaceURI = 'ssnu',
35664   keySOAPSMDType = 'sstp'
35665 };
35666
35667
35668
35669
35670
35671
35672 enum {
35673
35674   kAEUseHTTPProxyAttr = 'xupr',
35675
35676   kAEHTTPProxyPortAttr = 'xhtp',
35677   kAEHTTPProxyHostAttr = 'xhth'
35678 };
35679
35680
35681
35682
35683
35684
35685 enum {
35686   kAESocks4Protocol = 4,
35687   kAESocks5Protocol = 5
35688 };
35689
35690 enum {
35691   kAEUseSocksAttr = 'xscs',
35692
35693   kAESocksProxyAttr = 'xsok',
35694
35695   kAESocksHostAttr = 'xshs',
35696   kAESocksPortAttr = 'xshp',
35697   kAESocksUserAttr = 'xshu',
35698
35699   kAESocksPasswordAttr = 'xshw'
35700 };
35701
35702
35703
35704 enum {
35705   kAEDescListFactorNone = 0,
35706   kAEDescListFactorType = 4,
35707   kAEDescListFactorTypeAndSize = 8
35708 };
35709
35710
35711 enum {
35712
35713   kAutoGenerateReturnID = -1,
35714
35715   kAnyTransactionID = 0
35716 };
35717
35718
35719 typedef ResType DescType;
35720 typedef FourCharCode AEKeyword;
35721
35722 typedef struct OpaqueAEDataStorageType* AEDataStorageType;
35723
35724
35725
35726
35727 typedef AEDataStorageType * AEDataStorage;
35728 struct AEDesc {
35729   DescType descriptorType;
35730   AEDataStorage dataHandle;
35731 };
35732 typedef struct AEDesc AEDesc;
35733 typedef AEDesc * AEDescPtr;
35734 struct AEKeyDesc {
35735   AEKeyword descKey;
35736   AEDesc descContent;
35737 };
35738 typedef struct AEKeyDesc AEKeyDesc;
35739
35740
35741 typedef AEDesc AEDescList;
35742
35743 typedef AEDescList AERecord;
35744
35745 typedef AEDesc AEAddressDesc;
35746
35747 typedef AERecord AppleEvent;
35748 typedef AppleEvent * AppleEventPtr;
35749 typedef SInt16 AEReturnID;
35750 typedef SInt32 AETransactionID;
35751 typedef FourCharCode AEEventClass;
35752 typedef FourCharCode AEEventID;
35753 typedef SInt8 AEArrayType;
35754 enum {
35755   kAEDataArray = 0,
35756   kAEPackedArray = 1,
35757   kAEDescArray = 3,
35758   kAEKeyDescArray = 4
35759 };
35760
35761
35762 enum {
35763   kAEHandleArray = 2
35764 };
35765
35766 union AEArrayData {
35767   short kAEDataArray[1];
35768   char kAEPackedArray[1];
35769   Handle kAEHandleArray[1];
35770   AEDesc kAEDescArray[1];
35771   AEKeyDesc kAEKeyDescArray[1];
35772 };
35773 typedef union AEArrayData AEArrayData;
35774 typedef AEArrayData * AEArrayDataPointer;
35775
35776
35777
35778
35779 typedef SInt16 AESendPriority;
35780 enum {
35781   kAENormalPriority = 0x00000000,
35782   kAEHighPriority = 0x00000001
35783 };
35784
35785
35786 typedef SInt32 AESendMode;
35787 enum {
35788   kAENoReply = 0x00000001,
35789   kAEQueueReply = 0x00000002,
35790   kAEWaitReply = 0x00000003,
35791   kAEDontReconnect = 0x00000080,
35792   kAEWantReceipt = 0x00000200,
35793   kAENeverInteract = 0x00000010,
35794   kAECanInteract = 0x00000020,
35795   kAEAlwaysInteract = 0x00000030,
35796   kAECanSwitchLayer = 0x00000040,
35797   kAEDontRecord = 0x00001000,
35798   kAEDontExecute = 0x00002000,
35799   kAEProcessNonReplyEvents = 0x00008000
35800 };
35801
35802
35803
35804 enum {
35805   kAEDefaultTimeout = -1,
35806   kNoTimeOut = -2
35807 };
35808
35809
35810
35811
35812
35813 typedef OSErr ( * AECoerceDescProcPtr)(const AEDesc *fromDesc, DescType toType, long handlerRefcon, AEDesc *toDesc);
35814 typedef OSErr ( * AECoercePtrProcPtr)(DescType typeCode, const void *dataPtr, Size dataSize, DescType toType, long handlerRefcon, AEDesc *result);
35815 typedef AECoerceDescProcPtr AECoerceDescUPP;
35816 typedef AECoercePtrProcPtr AECoercePtrUPP;
35817 extern AECoerceDescUPP
35818 NewAECoerceDescUPP(AECoerceDescProcPtr userRoutine) ;
35819 extern AECoercePtrUPP
35820 NewAECoercePtrUPP(AECoercePtrProcPtr userRoutine) ;
35821 extern void
35822 DisposeAECoerceDescUPP(AECoerceDescUPP userUPP) ;
35823 extern void
35824 DisposeAECoercePtrUPP(AECoercePtrUPP userUPP) ;
35825 extern OSErr
35826 InvokeAECoerceDescUPP(
35827   const AEDesc * fromDesc,
35828   DescType toType,
35829   long handlerRefcon,
35830   AEDesc * toDesc,
35831   AECoerceDescUPP userUPP) ;
35832 extern OSErr
35833 InvokeAECoercePtrUPP(
35834   DescType typeCode,
35835   const void * dataPtr,
35836   Size dataSize,
35837   DescType toType,
35838   long handlerRefcon,
35839   AEDesc * result,
35840   AECoercePtrUPP userUPP) ;
35841
35842
35843
35844
35845
35846 typedef AECoerceDescUPP AECoercionHandlerUPP;
35847 extern OSErr
35848 AEInstallCoercionHandler(
35849   DescType fromType,
35850   DescType toType,
35851   AECoercionHandlerUPP handler,
35852   long handlerRefcon,
35853   Boolean fromTypeIsDesc,
35854   Boolean isSysHandler) ;
35855 extern OSErr
35856 AERemoveCoercionHandler(
35857   DescType fromType,
35858   DescType toType,
35859   AECoercionHandlerUPP handler,
35860   Boolean isSysHandler) ;
35861 extern OSErr
35862 AEGetCoercionHandler(
35863   DescType fromType,
35864   DescType toType,
35865   AECoercionHandlerUPP * handler,
35866   long * handlerRefcon,
35867   Boolean * fromTypeIsDesc,
35868   Boolean isSysHandler) ;
35869 extern OSErr
35870 AECoercePtr(
35871   DescType typeCode,
35872   const void * dataPtr,
35873   Size dataSize,
35874   DescType toType,
35875   AEDesc * result) ;
35876 extern OSErr
35877 AECoerceDesc(
35878   const AEDesc * theAEDesc,
35879   DescType toType,
35880   AEDesc * result) ;
35881 extern void
35882 AEInitializeDesc(AEDesc * desc) ;
35883
35884
35885
35886
35887     inline void AEInitializeDescInline(AEDesc* d) { d->descriptorType = typeNull; d->dataHandle = __null; };
35888 extern OSErr
35889 AECreateDesc(
35890   DescType typeCode,
35891   const void * dataPtr,
35892   Size dataSize,
35893   AEDesc * result) ;
35894 extern OSErr
35895 AEDisposeDesc(AEDesc * theAEDesc) ;
35896 extern OSErr
35897 AEDuplicateDesc(
35898   const AEDesc * theAEDesc,
35899   AEDesc * result) ;
35900 typedef void ( * AEDisposeExternalProcPtr)(const void *dataPtr, Size dataLength, long refcon);
35901 typedef AEDisposeExternalProcPtr AEDisposeExternalUPP;
35902 extern OSStatus
35903 AECreateDescFromExternalPtr(
35904   OSType descriptorType,
35905   const void * dataPtr,
35906   Size dataLength,
35907   AEDisposeExternalUPP disposeCallback,
35908   long disposeRefcon,
35909   AEDesc * theDesc) ;
35910 extern OSErr
35911 AECreateList(
35912   const void * factoringPtr,
35913   Size factoredSize,
35914   Boolean isRecord,
35915   AEDescList * resultList) ;
35916 extern OSErr
35917 AECountItems(
35918   const AEDescList * theAEDescList,
35919   long * theCount) ;
35920 extern OSErr
35921 AEPutPtr(
35922   AEDescList * theAEDescList,
35923   long index,
35924   DescType typeCode,
35925   const void * dataPtr,
35926   Size dataSize) ;
35927 extern OSErr
35928 AEPutDesc(
35929   AEDescList * theAEDescList,
35930   long index,
35931   const AEDesc * theAEDesc) ;
35932 extern OSErr
35933 AEGetNthPtr(
35934   const AEDescList * theAEDescList,
35935   long index,
35936   DescType desiredType,
35937   AEKeyword * theAEKeyword,
35938   DescType * typeCode,
35939   void * dataPtr,
35940   Size maximumSize,
35941   Size * actualSize) ;
35942 extern OSErr
35943 AEGetNthDesc(
35944   const AEDescList * theAEDescList,
35945   long index,
35946   DescType desiredType,
35947   AEKeyword * theAEKeyword,
35948   AEDesc * result) ;
35949 extern OSErr
35950 AESizeOfNthItem(
35951   const AEDescList * theAEDescList,
35952   long index,
35953   DescType * typeCode,
35954   Size * dataSize) ;
35955 extern OSErr
35956 AEGetArray(
35957   const AEDescList * theAEDescList,
35958   AEArrayType arrayType,
35959   AEArrayDataPointer arrayPtr,
35960   Size maximumSize,
35961   DescType * itemType,
35962   Size * itemSize,
35963   long * itemCount) ;
35964 extern OSErr
35965 AEPutArray(
35966   AEDescList * theAEDescList,
35967   AEArrayType arrayType,
35968   const AEArrayData * arrayPtr,
35969   DescType itemType,
35970   Size itemSize,
35971   long itemCount) ;
35972 extern OSErr
35973 AEDeleteItem(
35974   AEDescList * theAEDescList,
35975   long index) ;
35976 extern Boolean
35977 AECheckIsRecord(const AEDesc * theDesc) ;
35978 extern OSErr
35979 AECreateAppleEvent(
35980   AEEventClass theAEEventClass,
35981   AEEventID theAEEventID,
35982   const AEAddressDesc * target,
35983   AEReturnID returnID,
35984   AETransactionID transactionID,
35985   AppleEvent * result) ;
35986 extern OSErr
35987 AEPutParamPtr(
35988   AppleEvent * theAppleEvent,
35989   AEKeyword theAEKeyword,
35990   DescType typeCode,
35991   const void * dataPtr,
35992   Size dataSize) ;
35993 extern OSErr
35994 AEPutParamDesc(
35995   AppleEvent * theAppleEvent,
35996   AEKeyword theAEKeyword,
35997   const AEDesc * theAEDesc) ;
35998 extern OSErr
35999 AEGetParamPtr(
36000   const AppleEvent * theAppleEvent,
36001   AEKeyword theAEKeyword,
36002   DescType desiredType,
36003   DescType * typeCode,
36004   void * dataPtr,
36005   Size maximumSize,
36006   Size * actualSize) ;
36007 extern OSErr
36008 AEGetParamDesc(
36009   const AppleEvent * theAppleEvent,
36010   AEKeyword theAEKeyword,
36011   DescType desiredType,
36012   AEDesc * result) ;
36013 extern OSErr
36014 AESizeOfParam(
36015   const AppleEvent * theAppleEvent,
36016   AEKeyword theAEKeyword,
36017   DescType * typeCode,
36018   Size * dataSize) ;
36019 extern OSErr
36020 AEDeleteParam(
36021   AppleEvent * theAppleEvent,
36022   AEKeyword theAEKeyword) ;
36023 extern OSErr
36024 AEGetAttributePtr(
36025   const AppleEvent * theAppleEvent,
36026   AEKeyword theAEKeyword,
36027   DescType desiredType,
36028   DescType * typeCode,
36029   void * dataPtr,
36030   Size maximumSize,
36031   Size * actualSize) ;
36032 extern OSErr
36033 AEGetAttributeDesc(
36034   const AppleEvent * theAppleEvent,
36035   AEKeyword theAEKeyword,
36036   DescType desiredType,
36037   AEDesc * result) ;
36038 extern OSErr
36039 AESizeOfAttribute(
36040   const AppleEvent * theAppleEvent,
36041   AEKeyword theAEKeyword,
36042   DescType * typeCode,
36043   Size * dataSize) ;
36044 extern OSErr
36045 AEPutAttributePtr(
36046   AppleEvent * theAppleEvent,
36047   AEKeyword theAEKeyword,
36048   DescType typeCode,
36049   const void * dataPtr,
36050   Size dataSize) ;
36051 extern OSErr
36052 AEPutAttributeDesc(
36053   AppleEvent * theAppleEvent,
36054   AEKeyword theAEKeyword,
36055   const AEDesc * theAEDesc) ;
36056 extern Size
36057 AESizeOfFlattenedDesc(const AEDesc * theAEDesc) ;
36058 extern OSStatus
36059 AEFlattenDesc(
36060   const AEDesc * theAEDesc,
36061   Ptr buffer,
36062   Size bufferSize,
36063   Size * actualSize) ;
36064 extern OSStatus
36065 AEUnflattenDesc(
36066   Ptr buffer,
36067   AEDesc * result) ;
36068 extern OSErr
36069 AEGetDescData(
36070   const AEDesc * theAEDesc,
36071   void * dataPtr,
36072   Size maximumSize) ;
36073 extern Size
36074 AEGetDescDataSize(const AEDesc * theAEDesc) ;
36075 extern OSErr
36076 AEReplaceDescData(
36077   DescType typeCode,
36078   const void * dataPtr,
36079   Size dataSize,
36080   AEDesc * theAEDesc) ;
36081 extern OSStatus
36082 AEGetDescDataRange(
36083   const AEDesc * dataDesc,
36084   void * buffer,
36085   Size offset,
36086   Size length) ;
36087
36088
36089
36090
36091
36092 typedef OSErr ( * AEEventHandlerProcPtr)(const AppleEvent *theAppleEvent, AppleEvent *reply, long handlerRefcon);
36093 typedef AEEventHandlerProcPtr AEEventHandlerUPP;
36094 extern AEDisposeExternalUPP
36095 NewAEDisposeExternalUPP(AEDisposeExternalProcPtr userRoutine) ;
36096 extern AEEventHandlerUPP
36097 NewAEEventHandlerUPP(AEEventHandlerProcPtr userRoutine) ;
36098 extern void
36099 DisposeAEDisposeExternalUPP(AEDisposeExternalUPP userUPP) ;
36100 extern void
36101 DisposeAEEventHandlerUPP(AEEventHandlerUPP userUPP) ;
36102 extern void
36103 InvokeAEDisposeExternalUPP(
36104   const void * dataPtr,
36105   Size dataLength,
36106   long refcon,
36107   AEDisposeExternalUPP userUPP) ;
36108 extern OSErr
36109 InvokeAEEventHandlerUPP(
36110   const AppleEvent * theAppleEvent,
36111   AppleEvent * reply,
36112   long handlerRefcon,
36113   AEEventHandlerUPP userUPP) ;
36114
36115
36116
36117
36118
36119 }
36120
36121
36122
36123 extern "C" {
36124
36125
36126 enum {
36127
36128   keyDirectObject = '----',
36129   keyErrorNumber = 'errn',
36130   keyErrorString = 'errs',
36131   keyProcessSerialNumber = 'psn ',
36132   keyPreDispatch = 'phac',
36133   keySelectProc = 'selh',
36134
36135   keyAERecorderCount = 'recr',
36136
36137   keyAEVersion = 'vers'
36138 };
36139
36140
36141 enum {
36142   kCoreEventClass = 'aevt'
36143 };
36144
36145
36146 enum {
36147   kAEOpenApplication = 'oapp',
36148   kAEOpenDocuments = 'odoc',
36149   kAEPrintDocuments = 'pdoc',
36150   kAEQuitApplication = 'quit',
36151   kAEAnswer = 'ansr',
36152   kAEApplicationDied = 'obit',
36153   kAEShowPreferences = 'pref'
36154 };
36155
36156
36157 enum {
36158   kAEStartRecording = 'reca',
36159   kAEStopRecording = 'recc',
36160   kAENotifyStartRecording = 'rec1',
36161   kAENotifyStopRecording = 'rec0',
36162   kAENotifyRecording = 'recr'
36163 };
36164 typedef SInt8 AEEventSource;
36165 enum {
36166   kAEUnknownSource = 0,
36167   kAEDirectCall = 1,
36168   kAESameProcess = 2,
36169   kAELocalProcess = 3,
36170   kAERemoteProcess = 4
36171 };
36172 extern OSErr
36173 AEInstallEventHandler(
36174   AEEventClass theAEEventClass,
36175   AEEventID theAEEventID,
36176   AEEventHandlerUPP handler,
36177   long handlerRefcon,
36178   Boolean isSysHandler) ;
36179 extern OSErr
36180 AERemoveEventHandler(
36181   AEEventClass theAEEventClass,
36182   AEEventID theAEEventID,
36183   AEEventHandlerUPP handler,
36184   Boolean isSysHandler) ;
36185 extern OSErr
36186 AEGetEventHandler(
36187   AEEventClass theAEEventClass,
36188   AEEventID theAEEventID,
36189   AEEventHandlerUPP * handler,
36190   long * handlerRefcon,
36191   Boolean isSysHandler) ;
36192 extern OSErr
36193 AEInstallSpecialHandler(
36194   AEKeyword functionClass,
36195   AEEventHandlerUPP handler,
36196   Boolean isSysHandler) ;
36197 extern OSErr
36198 AERemoveSpecialHandler(
36199   AEKeyword functionClass,
36200   AEEventHandlerUPP handler,
36201   Boolean isSysHandler) ;
36202 extern OSErr
36203 AEGetSpecialHandler(
36204   AEKeyword functionClass,
36205   AEEventHandlerUPP * handler,
36206   Boolean isSysHandler) ;
36207 extern OSErr
36208 AEManagerInfo(
36209   AEKeyword keyWord,
36210   long * result) ;
36211 }
36212
36213
36214
36215 extern "C" {
36216 extern OSErr
36217 CreateOffsetDescriptor(
36218   long theOffset,
36219   AEDesc * theDescriptor) ;
36220 extern OSErr
36221 CreateCompDescriptor(
36222   DescType comparisonOperator,
36223   AEDesc * operand1,
36224   AEDesc * operand2,
36225   Boolean disposeInputs,
36226   AEDesc * theDescriptor) ;
36227 extern OSErr
36228 CreateLogicalDescriptor(
36229   AEDescList * theLogicalTerms,
36230   DescType theLogicOperator,
36231   Boolean disposeInputs,
36232   AEDesc * theDescriptor) ;
36233 extern OSErr
36234 CreateObjSpecifier(
36235   DescType desiredClass,
36236   AEDesc * theContainer,
36237   DescType keyForm,
36238   AEDesc * keyData,
36239   Boolean disposeInputs,
36240   AEDesc * objSpecifier) ;
36241 extern OSErr
36242 CreateRangeDescriptor(
36243   AEDesc * rangeStart,
36244   AEDesc * rangeStop,
36245   Boolean disposeInputs,
36246   AEDesc * theDescriptor) ;
36247
36248
36249
36250
36251 }
36252
36253
36254
36255 extern "C" {
36256
36257
36258
36259 enum {
36260
36261   kAEAND = 'AND ',
36262   kAEOR = 'OR  ',
36263   kAENOT = 'NOT ',
36264
36265   kAEFirst = 'firs',
36266   kAELast = 'last',
36267   kAEMiddle = 'midd',
36268   kAEAny = 'any ',
36269   kAEAll = 'all ',
36270
36271   kAENext = 'next',
36272   kAEPrevious = 'prev',
36273
36274   keyAECompOperator = 'relo',
36275   keyAELogicalTerms = 'term',
36276   keyAELogicalOperator = 'logc',
36277   keyAEObject1 = 'obj1',
36278   keyAEObject2 = 'obj2',
36279
36280   keyAEDesiredClass = 'want',
36281   keyAEContainer = 'from',
36282   keyAEKeyForm = 'form',
36283   keyAEKeyData = 'seld'
36284 };
36285
36286 enum {
36287
36288   keyAERangeStart = 'star',
36289   keyAERangeStop = 'stop',
36290
36291   keyDisposeTokenProc = 'xtok',
36292   keyAECompareProc = 'cmpr',
36293   keyAECountProc = 'cont',
36294   keyAEMarkTokenProc = 'mkid',
36295   keyAEMarkProc = 'mark',
36296   keyAEAdjustMarksProc = 'adjm',
36297   keyAEGetErrDescProc = 'indc'
36298 };
36299
36300
36301 enum {
36302
36303   formAbsolutePosition = 'indx',
36304   formRelativePosition = 'rele',
36305   formTest = 'test',
36306   formRange = 'rang',
36307   formPropertyID = 'prop',
36308   formName = 'name',
36309
36310   typeObjectSpecifier = 'obj ',
36311   typeObjectBeingExamined = 'exmn',
36312   typeCurrentContainer = 'ccnt',
36313   typeToken = 'toke',
36314   typeRelativeDescriptor = 'rel ',
36315   typeAbsoluteOrdinal = 'abso',
36316   typeIndexDescriptor = 'inde',
36317   typeRangeDescriptor = 'rang',
36318   typeLogicalDescriptor = 'logi',
36319   typeCompDescriptor = 'cmpd',
36320   typeOSLTokenList = 'ostl'
36321 };
36322
36323
36324 enum {
36325   kAEIDoMinimum = 0x0000,
36326   kAEIDoWhose = 0x0001,
36327   kAEIDoMarking = 0x0004,
36328   kAEPassSubDescs = 0x0008,
36329   kAEResolveNestedLists = 0x0010,
36330   kAEHandleSimpleRanges = 0x0020,
36331   kAEUseRelativeIterators = 0x0040
36332 };
36333
36334
36335 enum {
36336   typeWhoseDescriptor = 'whos',
36337   formWhose = 'whos',
36338   typeWhoseRange = 'wrng',
36339   keyAEWhoseRangeStart = 'wstr',
36340   keyAEWhoseRangeStop = 'wstp',
36341   keyAEIndex = 'kidx',
36342   keyAETest = 'ktst'
36343 };
36344
36345
36346
36347
36348
36349
36350
36351 struct ccntTokenRecord {
36352   DescType tokenClass;
36353   AEDesc token;
36354 };
36355 typedef struct ccntTokenRecord ccntTokenRecord;
36356 typedef ccntTokenRecord * ccntTokenRecPtr;
36357 typedef ccntTokenRecPtr * ccntTokenRecHandle;
36358
36359
36360
36361
36362
36363
36364 typedef OSErr ( * OSLAccessorProcPtr)(DescType desiredClass, const AEDesc *container, DescType containerClass, DescType form, const AEDesc *selectionData, AEDesc *value, long accessorRefcon);
36365 typedef OSErr ( * OSLCompareProcPtr)(DescType oper, const AEDesc *obj1, const AEDesc *obj2, Boolean *result);
36366 typedef OSErr ( * OSLCountProcPtr)(DescType desiredType, DescType containerClass, const AEDesc *container, long *result);
36367 typedef OSErr ( * OSLDisposeTokenProcPtr)(AEDesc * unneededToken);
36368 typedef OSErr ( * OSLGetMarkTokenProcPtr)(const AEDesc *dContainerToken, DescType containerClass, AEDesc *result);
36369 typedef OSErr ( * OSLGetErrDescProcPtr)(AEDesc ** appDescPtr);
36370 typedef OSErr ( * OSLMarkProcPtr)(const AEDesc *dToken, const AEDesc *markToken, long index);
36371 typedef OSErr ( * OSLAdjustMarksProcPtr)(long newStart, long newStop, const AEDesc *markToken);
36372 typedef OSLAccessorProcPtr OSLAccessorUPP;
36373 typedef OSLCompareProcPtr OSLCompareUPP;
36374 typedef OSLCountProcPtr OSLCountUPP;
36375 typedef OSLDisposeTokenProcPtr OSLDisposeTokenUPP;
36376 typedef OSLGetMarkTokenProcPtr OSLGetMarkTokenUPP;
36377 typedef OSLGetErrDescProcPtr OSLGetErrDescUPP;
36378 typedef OSLMarkProcPtr OSLMarkUPP;
36379 typedef OSLAdjustMarksProcPtr OSLAdjustMarksUPP;
36380 extern OSLAccessorUPP
36381 NewOSLAccessorUPP(OSLAccessorProcPtr userRoutine) ;
36382 extern OSLCompareUPP
36383 NewOSLCompareUPP(OSLCompareProcPtr userRoutine) ;
36384 extern OSLCountUPP
36385 NewOSLCountUPP(OSLCountProcPtr userRoutine) ;
36386 extern OSLDisposeTokenUPP
36387 NewOSLDisposeTokenUPP(OSLDisposeTokenProcPtr userRoutine) ;
36388 extern OSLGetMarkTokenUPP
36389 NewOSLGetMarkTokenUPP(OSLGetMarkTokenProcPtr userRoutine) ;
36390 extern OSLGetErrDescUPP
36391 NewOSLGetErrDescUPP(OSLGetErrDescProcPtr userRoutine) ;
36392 extern OSLMarkUPP
36393 NewOSLMarkUPP(OSLMarkProcPtr userRoutine) ;
36394 extern OSLAdjustMarksUPP
36395 NewOSLAdjustMarksUPP(OSLAdjustMarksProcPtr userRoutine) ;
36396 extern void
36397 DisposeOSLAccessorUPP(OSLAccessorUPP userUPP) ;
36398 extern void
36399 DisposeOSLCompareUPP(OSLCompareUPP userUPP) ;
36400 extern void
36401 DisposeOSLCountUPP(OSLCountUPP userUPP) ;
36402 extern void
36403 DisposeOSLDisposeTokenUPP(OSLDisposeTokenUPP userUPP) ;
36404 extern void
36405 DisposeOSLGetMarkTokenUPP(OSLGetMarkTokenUPP userUPP) ;
36406 extern void
36407 DisposeOSLGetErrDescUPP(OSLGetErrDescUPP userUPP) ;
36408 extern void
36409 DisposeOSLMarkUPP(OSLMarkUPP userUPP) ;
36410 extern void
36411 DisposeOSLAdjustMarksUPP(OSLAdjustMarksUPP userUPP) ;
36412 extern OSErr
36413 InvokeOSLAccessorUPP(
36414   DescType desiredClass,
36415   const AEDesc * container,
36416   DescType containerClass,
36417   DescType form,
36418   const AEDesc * selectionData,
36419   AEDesc * value,
36420   long accessorRefcon,
36421   OSLAccessorUPP userUPP) ;
36422 extern OSErr
36423 InvokeOSLCompareUPP(
36424   DescType oper,
36425   const AEDesc * obj1,
36426   const AEDesc * obj2,
36427   Boolean * result,
36428   OSLCompareUPP userUPP) ;
36429 extern OSErr
36430 InvokeOSLCountUPP(
36431   DescType desiredType,
36432   DescType containerClass,
36433   const AEDesc * container,
36434   long * result,
36435   OSLCountUPP userUPP) ;
36436 extern OSErr
36437 InvokeOSLDisposeTokenUPP(
36438   AEDesc * unneededToken,
36439   OSLDisposeTokenUPP userUPP) ;
36440 extern OSErr
36441 InvokeOSLGetMarkTokenUPP(
36442   const AEDesc * dContainerToken,
36443   DescType containerClass,
36444   AEDesc * result,
36445   OSLGetMarkTokenUPP userUPP) ;
36446 extern OSErr
36447 InvokeOSLGetErrDescUPP(
36448   AEDesc ** appDescPtr,
36449   OSLGetErrDescUPP userUPP) ;
36450 extern OSErr
36451 InvokeOSLMarkUPP(
36452   const AEDesc * dToken,
36453   const AEDesc * markToken,
36454   long index,
36455   OSLMarkUPP userUPP) ;
36456 extern OSErr
36457 InvokeOSLAdjustMarksUPP(
36458   long newStart,
36459   long newStop,
36460   const AEDesc * markToken,
36461   OSLAdjustMarksUPP userUPP) ;
36462 extern OSErr
36463 AEObjectInit(void) ;
36464 extern OSErr
36465 AESetObjectCallbacks(
36466   OSLCompareUPP myCompareProc,
36467   OSLCountUPP myCountProc,
36468   OSLDisposeTokenUPP myDisposeTokenProc,
36469   OSLGetMarkTokenUPP myGetMarkTokenProc,
36470   OSLMarkUPP myMarkProc,
36471   OSLAdjustMarksUPP myAdjustMarksProc,
36472   OSLGetErrDescUPP myGetErrDescProcPtr) ;
36473 extern OSErr
36474 AEResolve(
36475   const AEDesc * objectSpecifier,
36476   short callbackFlags,
36477   AEDesc * theToken) ;
36478 extern OSErr
36479 AEInstallObjectAccessor(
36480   DescType desiredClass,
36481   DescType containerType,
36482   OSLAccessorUPP theAccessor,
36483   long accessorRefcon,
36484   Boolean isSysHandler) ;
36485 extern OSErr
36486 AERemoveObjectAccessor(
36487   DescType desiredClass,
36488   DescType containerType,
36489   OSLAccessorUPP theAccessor,
36490   Boolean isSysHandler) ;
36491 extern OSErr
36492 AEGetObjectAccessor(
36493   DescType desiredClass,
36494   DescType containerType,
36495   OSLAccessorUPP * accessor,
36496   long * accessorRefcon,
36497   Boolean isSysHandler) ;
36498 extern OSErr
36499 AEDisposeToken(AEDesc * theToken) ;
36500 extern OSErr
36501 AECallObjectAccessor(
36502   DescType desiredClass,
36503   const AEDesc * containerToken,
36504   DescType containerClass,
36505   DescType keyForm,
36506   const AEDesc * keyData,
36507   AEDesc * token) ;
36508
36509
36510
36511
36512
36513
36514 }
36515
36516
36517
36518
36519 enum {
36520   cAEList = 'list',
36521   cApplication = 'capp',
36522   cArc = 'carc',
36523   cBoolean = 'bool',
36524   cCell = 'ccel',
36525   cChar = 'cha ',
36526   cColorTable = 'clrt',
36527   cColumn = 'ccol',
36528   cDocument = 'docu',
36529   cDrawingArea = 'cdrw',
36530   cEnumeration = 'enum',
36531   cFile = 'file',
36532   cFixed = 'fixd',
36533   cFixedPoint = 'fpnt',
36534   cFixedRectangle = 'frct',
36535   cGraphicLine = 'glin',
36536   cGraphicObject = 'cgob',
36537   cGraphicShape = 'cgsh',
36538   cGraphicText = 'cgtx',
36539   cGroupedGraphic = 'cpic'
36540 };
36541
36542 enum {
36543   cInsertionLoc = 'insl',
36544   cInsertionPoint = 'cins',
36545   cIntlText = 'itxt',
36546   cIntlWritingCode = 'intl',
36547   cItem = 'citm',
36548   cLine = 'clin',
36549   cLongDateTime = 'ldt ',
36550   cLongFixed = 'lfxd',
36551   cLongFixedPoint = 'lfpt',
36552   cLongFixedRectangle = 'lfrc',
36553   cLongInteger = 'long',
36554   cLongPoint = 'lpnt',
36555   cLongRectangle = 'lrct',
36556   cMachineLoc = 'mLoc',
36557   cMenu = 'cmnu',
36558   cMenuItem = 'cmen',
36559   cObject = 'cobj',
36560   cObjectSpecifier = 'obj ',
36561   cOpenableObject = 'coob',
36562   cOval = 'covl'
36563 };
36564
36565 enum {
36566   cParagraph = 'cpar',
36567   cPICT = 'PICT',
36568   cPixel = 'cpxl',
36569   cPixelMap = 'cpix',
36570   cPolygon = 'cpgn',
36571   cProperty = 'prop',
36572   cQDPoint = 'QDpt',
36573   cQDRectangle = 'qdrt',
36574   cRectangle = 'crec',
36575   cRGBColor = 'cRGB',
36576   cRotation = 'trot',
36577   cRoundedRectangle = 'crrc',
36578   cRow = 'crow',
36579   cSelection = 'csel',
36580   cShortInteger = 'shor',
36581   cTable = 'ctbl',
36582   cText = 'ctxt',
36583   cTextFlow = 'cflo',
36584   cTextStyles = 'tsty',
36585   cType = 'type'
36586 };
36587
36588 enum {
36589   cVersion = 'vers',
36590   cWindow = 'cwin',
36591   cWord = 'cwor',
36592   enumArrows = 'arro',
36593   enumJustification = 'just',
36594   enumKeyForm = 'kfrm',
36595   enumPosition = 'posi',
36596   enumProtection = 'prtn',
36597   enumQuality = 'qual',
36598   enumSaveOptions = 'savo',
36599   enumStyle = 'styl',
36600   enumTransferMode = 'tran',
36601   formUniqueID = 'ID  ',
36602   kAEAbout = 'abou',
36603   kAEAfter = 'afte',
36604   kAEAliasSelection = 'sali',
36605   kAEAllCaps = 'alcp',
36606   kAEArrowAtEnd = 'aren',
36607   kAEArrowAtStart = 'arst',
36608   kAEArrowBothEnds = 'arbo'
36609 };
36610
36611 enum {
36612   kAEAsk = 'ask ',
36613   kAEBefore = 'befo',
36614   kAEBeginning = 'bgng',
36615   kAEBeginsWith = 'bgwt',
36616   kAEBeginTransaction = 'begi',
36617   kAEBold = 'bold',
36618   kAECaseSensEquals = 'cseq',
36619   kAECentered = 'cent',
36620   kAEChangeView = 'view',
36621   kAEClone = 'clon',
36622   kAEClose = 'clos',
36623   kAECondensed = 'cond',
36624   kAEContains = 'cont',
36625   kAECopy = 'copy',
36626   kAECoreSuite = 'core',
36627   kAECountElements = 'cnte',
36628   kAECreateElement = 'crel',
36629   kAECreatePublisher = 'cpub',
36630   kAECut = 'cut ',
36631   kAEDelete = 'delo'
36632 };
36633
36634 enum {
36635   kAEDoObjectsExist = 'doex',
36636   kAEDoScript = 'dosc',
36637   kAEDrag = 'drag',
36638   kAEDuplicateSelection = 'sdup',
36639   kAEEditGraphic = 'edit',
36640   kAEEmptyTrash = 'empt',
36641   kAEEnd = 'end ',
36642   kAEEndsWith = 'ends',
36643   kAEEndTransaction = 'endt',
36644   kAEEquals = '=   ',
36645   kAEExpanded = 'pexp',
36646   kAEFast = 'fast',
36647   kAEFinderEvents = 'FNDR',
36648   kAEFormulaProtect = 'fpro',
36649   kAEFullyJustified = 'full',
36650   kAEGetClassInfo = 'qobj',
36651   kAEGetData = 'getd',
36652   kAEGetDataSize = 'dsiz',
36653   kAEGetEventInfo = 'gtei',
36654   kAEGetInfoSelection = 'sinf'
36655 };
36656
36657 enum {
36658   kAEGetPrivilegeSelection = 'sprv',
36659   kAEGetSuiteInfo = 'gtsi',
36660   kAEGreaterThan = '>   ',
36661   kAEGreaterThanEquals = '>=  ',
36662   kAEGrow = 'grow',
36663   kAEHidden = 'hidn',
36664   kAEHiQuality = 'hiqu',
36665   kAEImageGraphic = 'imgr',
36666   kAEIsUniform = 'isun',
36667   kAEItalic = 'ital',
36668   kAELeftJustified = 'left',
36669   kAELessThan = '<   ',
36670   kAELessThanEquals = '<=  ',
36671   kAELowercase = 'lowc',
36672   kAEMakeObjectsVisible = 'mvis',
36673   kAEMiscStandards = 'misc',
36674   kAEModifiable = 'modf',
36675   kAEMove = 'move',
36676   kAENo = 'no  ',
36677   kAENoArrow = 'arno'
36678 };
36679
36680 enum {
36681   kAENonmodifiable = 'nmod',
36682   kAEOpen = 'odoc',
36683   kAEOpenSelection = 'sope',
36684   kAEOutline = 'outl',
36685   kAEPageSetup = 'pgsu',
36686   kAEPaste = 'past',
36687   kAEPlain = 'plan',
36688   kAEPrint = 'pdoc',
36689   kAEPrintSelection = 'spri',
36690   kAEPrintWindow = 'pwin',
36691   kAEPutAwaySelection = 'sput',
36692   kAEQDAddOver = 'addo',
36693   kAEQDAddPin = 'addp',
36694   kAEQDAdMax = 'admx',
36695   kAEQDAdMin = 'admn',
36696   kAEQDBic = 'bic ',
36697   kAEQDBlend = 'blnd',
36698   kAEQDCopy = 'cpy ',
36699   kAEQDNotBic = 'nbic',
36700   kAEQDNotCopy = 'ncpy'
36701 };
36702
36703 enum {
36704   kAEQDNotOr = 'ntor',
36705   kAEQDNotXor = 'nxor',
36706   kAEQDOr = 'or  ',
36707   kAEQDSubOver = 'subo',
36708   kAEQDSubPin = 'subp',
36709   kAEQDSupplementalSuite = 'qdsp',
36710   kAEQDXor = 'xor ',
36711   kAEQuickdrawSuite = 'qdrw',
36712   kAEQuitAll = 'quia',
36713   kAERedo = 'redo',
36714   kAERegular = 'regl',
36715   kAEReopenApplication = 'rapp',
36716   kAEReplace = 'rplc',
36717   kAERequiredSuite = 'reqd',
36718   kAERestart = 'rest',
36719   kAERevealSelection = 'srev',
36720   kAERevert = 'rvrt',
36721   kAERightJustified = 'rght',
36722   kAESave = 'save',
36723   kAESelect = 'slct',
36724   kAESetData = 'setd'
36725 };
36726
36727 enum {
36728   kAESetPosition = 'posn',
36729   kAEShadow = 'shad',
36730   kAEShowClipboard = 'shcl',
36731   kAEShutDown = 'shut',
36732   kAESleep = 'slep',
36733   kAESmallCaps = 'smcp',
36734   kAESpecialClassProperties = 'c@#!',
36735   kAEStrikethrough = 'strk',
36736   kAESubscript = 'sbsc',
36737   kAESuperscript = 'spsc',
36738   kAETableSuite = 'tbls',
36739   kAETextSuite = 'TEXT',
36740   kAETransactionTerminated = 'ttrm',
36741   kAEUnderline = 'undl',
36742   kAEUndo = 'undo',
36743   kAEWholeWordEquals = 'wweq',
36744   kAEYes = 'yes ',
36745   kAEZoom = 'zoom'
36746 };
36747
36748
36749 enum {
36750   kAELogOut = 'logo',
36751   kAEReallyLogOut = 'rlgo',
36752   kAEShowRestartDialog = 'rrst',
36753   kAEShowShutdownDialog = 'rsdn'
36754 };
36755
36756
36757 enum {
36758   kAEMouseClass = 'mous',
36759   kAEDown = 'down',
36760   kAEUp = 'up  ',
36761   kAEMoved = 'move',
36762   kAEStoppedMoving = 'stop',
36763   kAEWindowClass = 'wind',
36764   kAEUpdate = 'updt',
36765   kAEActivate = 'actv',
36766   kAEDeactivate = 'dact',
36767   kAECommandClass = 'cmnd',
36768   kAEKeyClass = 'keyc',
36769   kAERawKey = 'rkey',
36770   kAEVirtualKey = 'keyc',
36771   kAENavigationKey = 'nave',
36772   kAEAutoDown = 'auto',
36773   kAEApplicationClass = 'appl',
36774   kAESuspend = 'susp',
36775   kAEResume = 'rsme',
36776   kAEDiskEvent = 'disk',
36777   kAENullEvent = 'null',
36778   kAEWakeUpEvent = 'wake',
36779   kAEScrapEvent = 'scrp',
36780   kAEHighLevel = 'high'
36781 };
36782
36783 enum {
36784   keyAEAngle = 'kang',
36785   keyAEArcAngle = 'parc'
36786 };
36787
36788 enum {
36789   keyAEBaseAddr = 'badd',
36790   keyAEBestType = 'pbst',
36791   keyAEBgndColor = 'kbcl',
36792   keyAEBgndPattern = 'kbpt',
36793   keyAEBounds = 'pbnd',
36794   keyAECellList = 'kclt',
36795   keyAEClassID = 'clID',
36796   keyAEColor = 'colr',
36797   keyAEColorTable = 'cltb',
36798   keyAECurveHeight = 'kchd',
36799   keyAECurveWidth = 'kcwd',
36800   keyAEDashStyle = 'pdst',
36801   keyAEData = 'data',
36802   keyAEDefaultType = 'deft',
36803   keyAEDefinitionRect = 'pdrt',
36804   keyAEDescType = 'dstp',
36805   keyAEDestination = 'dest',
36806   keyAEDoAntiAlias = 'anta',
36807   keyAEDoDithered = 'gdit',
36808   keyAEDoRotate = 'kdrt'
36809 };
36810
36811 enum {
36812   keyAEDoScale = 'ksca',
36813   keyAEDoTranslate = 'ktra',
36814   keyAEEditionFileLoc = 'eloc',
36815   keyAEElements = 'elms',
36816   keyAEEndPoint = 'pend',
36817   keyAEEventClass = 'evcl',
36818   keyAEEventID = 'evti',
36819   keyAEFile = 'kfil',
36820   keyAEFileType = 'fltp',
36821   keyAEFillColor = 'flcl',
36822   keyAEFillPattern = 'flpt',
36823   keyAEFlipHorizontal = 'kfho',
36824   keyAEFlipVertical = 'kfvt',
36825   keyAEFont = 'font',
36826   keyAEFormula = 'pfor',
36827   keyAEGraphicObjects = 'gobs',
36828   keyAEID = 'ID  ',
36829   keyAEImageQuality = 'gqua',
36830   keyAEInsertHere = 'insh',
36831   keyAEKeyForms = 'keyf'
36832 };
36833
36834 enum {
36835   keyAEKeyword = 'kywd',
36836   keyAELevel = 'levl',
36837   keyAELineArrow = 'arro',
36838   keyAEName = 'pnam',
36839   keyAENewElementLoc = 'pnel',
36840   keyAEObject = 'kobj',
36841   keyAEObjectClass = 'kocl',
36842   keyAEOffStyles = 'ofst',
36843   keyAEOnStyles = 'onst',
36844   keyAEParameters = 'prms',
36845   keyAEParamFlags = 'pmfg',
36846   keyAEPenColor = 'ppcl',
36847   keyAEPenPattern = 'pppa',
36848   keyAEPenWidth = 'ppwd',
36849   keyAEPixelDepth = 'pdpt',
36850   keyAEPixMapMinus = 'kpmm',
36851   keyAEPMTable = 'kpmt',
36852   keyAEPointList = 'ptlt',
36853   keyAEPointSize = 'ptsz',
36854   keyAEPosition = 'kpos'
36855 };
36856
36857 enum {
36858   keyAEPropData = 'prdt',
36859   keyAEProperties = 'qpro',
36860   keyAEProperty = 'kprp',
36861   keyAEPropFlags = 'prfg',
36862   keyAEPropID = 'prop',
36863   keyAEProtection = 'ppro',
36864   keyAERenderAs = 'kren',
36865   keyAERequestedType = 'rtyp',
36866   keyAEResult = '----',
36867   keyAEResultInfo = 'rsin',
36868   keyAERotation = 'prot',
36869   keyAERotPoint = 'krtp',
36870   keyAERowList = 'krls',
36871   keyAESaveOptions = 'savo',
36872   keyAEScale = 'pscl',
36873   keyAEScriptTag = 'psct',
36874   keyAEShowWhere = 'show',
36875   keyAEStartAngle = 'pang',
36876   keyAEStartPoint = 'pstp',
36877   keyAEStyles = 'ksty'
36878 };
36879
36880 enum {
36881   keyAESuiteID = 'suit',
36882   keyAEText = 'ktxt',
36883   keyAETextColor = 'ptxc',
36884   keyAETextFont = 'ptxf',
36885   keyAETextPointSize = 'ptps',
36886   keyAETextStyles = 'txst',
36887   keyAETextLineHeight = 'ktlh',
36888   keyAETextLineAscent = 'ktas',
36889   keyAETheText = 'thtx',
36890   keyAETransferMode = 'pptm',
36891   keyAETranslation = 'ptrs',
36892   keyAETryAsStructGraf = 'toog',
36893   keyAEUniformStyles = 'ustl',
36894   keyAEUpdateOn = 'pupd',
36895   keyAEUserTerm = 'utrm',
36896   keyAEWindow = 'wndw',
36897   keyAEWritingCode = 'wrcd'
36898 };
36899
36900 enum {
36901   keyMiscellaneous = 'fmsc',
36902   keySelection = 'fsel',
36903   keyWindow = 'kwnd',
36904
36905   keyWhen = 'when',
36906   keyWhere = 'wher',
36907   keyModifiers = 'mods',
36908   keyKey = 'key ',
36909   keyKeyCode = 'code',
36910   keyKeyboard = 'keyb',
36911   keyDriveNumber = 'drv#',
36912   keyErrorCode = 'err#',
36913   keyHighLevelClass = 'hcls',
36914   keyHighLevelID = 'hid '
36915 };
36916
36917 enum {
36918   pArcAngle = 'parc',
36919   pBackgroundColor = 'pbcl',
36920   pBackgroundPattern = 'pbpt',
36921   pBestType = 'pbst',
36922   pBounds = 'pbnd',
36923   pClass = 'pcls',
36924   pClipboard = 'pcli',
36925   pColor = 'colr',
36926   pColorTable = 'cltb',
36927   pContents = 'pcnt',
36928   pCornerCurveHeight = 'pchd',
36929   pCornerCurveWidth = 'pcwd',
36930   pDashStyle = 'pdst',
36931   pDefaultType = 'deft',
36932   pDefinitionRect = 'pdrt',
36933   pEnabled = 'enbl',
36934   pEndPoint = 'pend',
36935   pFillColor = 'flcl',
36936   pFillPattern = 'flpt',
36937   pFont = 'font'
36938 };
36939
36940 enum {
36941   pFormula = 'pfor',
36942   pGraphicObjects = 'gobs',
36943   pHasCloseBox = 'hclb',
36944   pHasTitleBar = 'ptit',
36945   pID = 'ID  ',
36946   pIndex = 'pidx',
36947   pInsertionLoc = 'pins',
36948   pIsFloating = 'isfl',
36949   pIsFrontProcess = 'pisf',
36950   pIsModal = 'pmod',
36951   pIsModified = 'imod',
36952   pIsResizable = 'prsz',
36953   pIsStationeryPad = 'pspd',
36954   pIsZoomable = 'iszm',
36955   pIsZoomed = 'pzum',
36956   pItemNumber = 'itmn',
36957   pJustification = 'pjst',
36958   pLineArrow = 'arro',
36959   pMenuID = 'mnid',
36960   pName = 'pnam'
36961 };
36962
36963 enum {
36964   pNewElementLoc = 'pnel',
36965   pPenColor = 'ppcl',
36966   pPenPattern = 'pppa',
36967   pPenWidth = 'ppwd',
36968   pPixelDepth = 'pdpt',
36969   pPointList = 'ptlt',
36970   pPointSize = 'ptsz',
36971   pProtection = 'ppro',
36972   pRotation = 'prot',
36973   pScale = 'pscl',
36974   pScript = 'scpt',
36975   pScriptTag = 'psct',
36976   pSelected = 'selc',
36977   pSelection = 'sele',
36978   pStartAngle = 'pang',
36979   pStartPoint = 'pstp',
36980   pTextColor = 'ptxc',
36981   pTextFont = 'ptxf',
36982   pTextItemDelimiters = 'txdl',
36983   pTextPointSize = 'ptps'
36984 };
36985
36986 enum {
36987   pTextStyles = 'txst',
36988   pTransferMode = 'pptm',
36989   pTranslation = 'ptrs',
36990   pUniformStyles = 'ustl',
36991   pUpdateOn = 'pupd',
36992   pUserSelection = 'pusl',
36993   pVersion = 'vers',
36994   pVisible = 'pvis'
36995 };
36996
36997 enum {
36998   typeAEText = 'tTXT',
36999   typeArc = 'carc',
37000   typeBest = 'best',
37001   typeCell = 'ccel',
37002   typeClassInfo = 'gcli',
37003   typeColorTable = 'clrt',
37004   typeColumn = 'ccol',
37005   typeDashStyle = 'tdas',
37006   typeData = 'tdta',
37007   typeDrawingArea = 'cdrw',
37008   typeElemInfo = 'elin',
37009   typeEnumeration = 'enum',
37010   typeEPS = 'EPS ',
37011   typeEventInfo = 'evin'
37012 };
37013
37014 enum {
37015   typeFinderWindow = 'fwin',
37016   typeFixedPoint = 'fpnt',
37017   typeFixedRectangle = 'frct',
37018   typeGraphicLine = 'glin',
37019   typeGraphicText = 'cgtx',
37020   typeGroupedGraphic = 'cpic',
37021   typeInsertionLoc = 'insl',
37022   typeIntlText = 'itxt',
37023   typeIntlWritingCode = 'intl',
37024   typeLongDateTime = 'ldt ',
37025   typeISO8601DateTime = 'isot',
37026   typeLongFixed = 'lfxd',
37027   typeLongFixedPoint = 'lfpt',
37028   typeLongFixedRectangle = 'lfrc',
37029   typeLongPoint = 'lpnt',
37030   typeLongRectangle = 'lrct',
37031   typeMachineLoc = 'mLoc',
37032   typeOval = 'covl',
37033   typeParamInfo = 'pmin',
37034   typePict = 'PICT'
37035 };
37036
37037 enum {
37038   typePixelMap = 'cpix',
37039   typePixMapMinus = 'tpmm',
37040   typePolygon = 'cpgn',
37041   typePropInfo = 'pinf',
37042   typePtr = 'ptr ',
37043   typeQDPoint = 'QDpt',
37044   typeQDRegion = 'Qrgn',
37045   typeRectangle = 'crec',
37046   typeRGB16 = 'tr16',
37047   typeRGB96 = 'tr96',
37048   typeRGBColor = 'cRGB',
37049   typeRotation = 'trot',
37050   typeRoundedRectangle = 'crrc',
37051   typeRow = 'crow',
37052   typeScrapStyles = 'styl',
37053   typeScript = 'scpt',
37054   typeStyledText = 'STXT',
37055   typeSuiteInfo = 'suin',
37056   typeTable = 'ctbl',
37057   typeTextStyles = 'tsty'
37058 };
37059
37060 enum {
37061   typeTIFF = 'TIFF',
37062   typeVersion = 'vers'
37063 };
37064
37065 enum {
37066   kAEMenuClass = 'menu',
37067   kAEMenuSelect = 'mhit',
37068   kAEMouseDown = 'mdwn',
37069   kAEMouseDownInBack = 'mdbk',
37070   kAEKeyDown = 'kdwn',
37071   kAEResized = 'rsiz',
37072   kAEPromise = 'prom'
37073 };
37074
37075 enum {
37076   keyMenuID = 'mid ',
37077   keyMenuItem = 'mitm',
37078   keyCloseAllWindows = 'caw ',
37079   keyOriginalBounds = 'obnd',
37080   keyNewBounds = 'nbnd',
37081   keyLocalWhere = 'lwhr'
37082 };
37083
37084 enum {
37085   typeHIMenu = 'mobj',
37086   typeHIWindow = 'wobj'
37087 };
37088
37089 enum {
37090   kBySmallIcon = 0,
37091   kByIconView = 1,
37092   kByNameView = 2,
37093   kByDateView = 3,
37094   kBySizeView = 4,
37095   kByKindView = 5,
37096   kByCommentView = 6,
37097   kByLabelView = 7,
37098   kByVersionView = 8
37099 };
37100
37101 enum {
37102   kAEInfo = 11,
37103   kAEMain = 0,
37104   kAESharing = 13
37105 };
37106
37107 enum {
37108   kAEZoomIn = 7,
37109   kAEZoomOut = 8
37110 };
37111
37112 enum {
37113   kTextServiceClass = 'tsvc',
37114   kUpdateActiveInputArea = 'updt',
37115   kShowHideInputWindow = 'shiw',
37116   kPos2Offset = 'p2st',
37117   kOffset2Pos = 'st2p',
37118   kUnicodeNotFromInputMethod = 'unim',
37119   kGetSelectedText = 'gtxt',
37120   keyAETSMDocumentRefcon = 'refc',
37121   keyAEServerInstance = 'srvi',
37122   keyAETheData = 'kdat',
37123   keyAEFixLength = 'fixl',
37124   keyAEUpdateRange = 'udng',
37125   keyAECurrentPoint = 'cpos',
37126   keyAEBufferSize = 'buff',
37127   keyAEMoveView = 'mvvw',
37128   keyAENextBody = 'nxbd',
37129   keyAETSMScriptTag = 'sclg',
37130   keyAETSMTextFont = 'ktxf',
37131   keyAETSMTextFMFont = 'ktxm',
37132   keyAETSMTextPointSize = 'ktps',
37133   keyAETSMEventRecord = 'tevt',
37134   keyAETSMEventRef = 'tevr',
37135   keyAETextServiceEncoding = 'tsen',
37136   keyAETextServiceMacEncoding = 'tmen',
37137   keyAETSMGlyphInfoArray = 'tgia',
37138   typeTextRange = 'txrn',
37139   typeComponentInstance = 'cmpi',
37140   typeOffsetArray = 'ofay',
37141   typeTextRangeArray = 'tray',
37142   typeLowLevelEventRecord = 'evtr',
37143   typeGlyphInfoArray = 'glia',
37144   typeEventRef = 'evrf',
37145   typeText = typeChar
37146 };
37147
37148
37149
37150 enum {
37151   kTSMOutsideOfBody = 1,
37152   kTSMInsideOfBody = 2,
37153   kTSMInsideOfActiveInputArea = 3
37154 };
37155
37156 enum {
37157   kNextBody = 1,
37158   kPreviousBody = 2
37159 };
37160
37161 struct TextRange {
37162   long fStart;
37163   long fEnd;
37164   short fHiliteStyle;
37165 };
37166 typedef struct TextRange TextRange;
37167 typedef TextRange * TextRangePtr;
37168 typedef TextRangePtr * TextRangeHandle;
37169 struct TextRangeArray {
37170   short fNumOfRanges;
37171   TextRange fRange[1];
37172 };
37173 typedef struct TextRangeArray TextRangeArray;
37174 typedef TextRangeArray * TextRangeArrayPtr;
37175 typedef TextRangeArrayPtr * TextRangeArrayHandle;
37176 struct OffsetArray {
37177   short fNumOfOffsets;
37178   long fOffset[1];
37179 };
37180 typedef struct OffsetArray OffsetArray;
37181 typedef OffsetArray * OffsetArrayPtr;
37182 typedef OffsetArrayPtr * OffsetArrayHandle;
37183 struct WritingCode {
37184   ScriptCode theScriptCode;
37185   LangCode theLangCode;
37186 };
37187 typedef struct WritingCode WritingCode;
37188 struct IntlText {
37189   ScriptCode theScriptCode;
37190   LangCode theLangCode;
37191   char theText[1];
37192 };
37193 typedef struct IntlText IntlText;
37194
37195
37196 enum {
37197   kCaretPosition = 1,
37198   kRawText = 2,
37199   kSelectedRawText = 3,
37200   kConvertedText = 4,
37201   kSelectedConvertedText = 5,
37202   kBlockFillText = 6,
37203   kOutlineText = 7,
37204   kSelectedText = 8
37205 };
37206
37207 enum {
37208   keyAEHiliteRange = 'hrng',
37209   keyAEPinRange = 'pnrg',
37210   keyAEClauseOffsets = 'clau',
37211   keyAEOffset = 'ofst',
37212   keyAEPoint = 'gpos',
37213   keyAELeftSide = 'klef',
37214   keyAERegionClass = 'rgnc',
37215   keyAEDragging = 'bool'
37216 };
37217 enum {
37218
37219   typeUnicodeText = 'utxt',
37220   typeStyledUnicodeText = 'sutx',
37221   typeUTF8Text = 'utf8',
37222   typeEncodedString = 'encs',
37223   typeCString = 'cstr',
37224   typePString = 'pstr'
37225 };
37226
37227 enum {
37228
37229   typeMeters = 'metr',
37230   typeInches = 'inch',
37231   typeFeet = 'feet',
37232   typeYards = 'yard',
37233   typeMiles = 'mile',
37234   typeKilometers = 'kmtr',
37235   typeCentimeters = 'cmtr',
37236   typeSquareMeters = 'sqrm',
37237   typeSquareFeet = 'sqft',
37238   typeSquareYards = 'sqyd',
37239   typeSquareMiles = 'sqmi',
37240   typeSquareKilometers = 'sqkm',
37241   typeLiters = 'litr',
37242   typeQuarts = 'qrts',
37243   typeGallons = 'galn',
37244   typeCubicMeters = 'cmet',
37245   typeCubicFeet = 'cfet',
37246   typeCubicInches = 'cuin',
37247   typeCubicCentimeter = 'ccmt',
37248   typeCubicYards = 'cyrd',
37249   typeKilograms = 'kgrm',
37250   typeGrams = 'gram',
37251   typeOunces = 'ozs ',
37252   typePounds = 'lbs ',
37253   typeDegreesC = 'degc',
37254   typeDegreesF = 'degf',
37255   typeDegreesK = 'degk'
37256 };
37257
37258 enum {
37259
37260   kFAServerApp = 'ssrv',
37261   kDoFolderActionEvent = 'fola',
37262   kFolderActionCode = 'actn',
37263   kFolderOpenedEvent = 'fopn',
37264   kFolderClosedEvent = 'fclo',
37265   kFolderWindowMovedEvent = 'fsiz',
37266   kFolderItemsAddedEvent = 'fget',
37267   kFolderItemsRemovedEvent = 'flos',
37268   kItemList = 'flst',
37269   kNewSizeParameter = 'fnsz',
37270   kFASuiteCode = 'faco',
37271   kFAAttachCommand = 'atfa',
37272   kFARemoveCommand = 'rmfa',
37273   kFAEditCommand = 'edfa',
37274   kFAFileParam = 'faal',
37275   kFAIndexParam = 'indx'
37276 };
37277
37278
37279 enum {
37280
37281   kAEInternetSuite = 'gurl',
37282   kAEISWebStarSuite = 'WWW½'
37283 };
37284
37285 enum {
37286
37287   kAEISGetURL = 'gurl',
37288   KAEISHandleCGI = 'sdoc'
37289 };
37290
37291 enum {
37292
37293   cURL = 'url ',
37294   cInternetAddress = 'IPAD',
37295   cHTML = 'html',
37296   cFTPItem = 'ftp '
37297 };
37298
37299 enum {
37300
37301   kAEISHTTPSearchArgs = 'kfor',
37302   kAEISPostArgs = 'post',
37303   kAEISMethod = 'meth',
37304   kAEISClientAddress = 'addr',
37305   kAEISUserName = 'user',
37306   kAEISPassword = 'pass',
37307   kAEISFromUser = 'frmu',
37308   kAEISServerName = 'svnm',
37309   kAEISServerPort = 'svpt',
37310   kAEISScriptName = 'scnm',
37311   kAEISContentType = 'ctyp',
37312   kAEISReferrer = 'refr',
37313   kAEISUserAgent = 'Agnt',
37314   kAEISAction = 'Kact',
37315   kAEISActionPath = 'Kapt',
37316   kAEISClientIP = 'Kcip',
37317   kAEISFullRequest = 'Kfrq'
37318 };
37319
37320 enum {
37321
37322   pScheme = 'pusc',
37323   pHost = 'HOST',
37324   pPath = 'FTPc',
37325   pUserName = 'RAun',
37326   pUserPassword = 'RApw',
37327   pDNSForm = 'pDNS',
37328   pURL = 'pURL',
37329   pTextEncoding = 'ptxe',
37330   pFTPKind = 'kind'
37331 };
37332
37333 enum {
37334
37335   eScheme = 'esch',
37336   eurlHTTP = 'http',
37337   eurlHTTPS = 'htps',
37338   eurlFTP = 'ftp ',
37339   eurlMail = 'mail',
37340   eurlFile = 'file',
37341   eurlGopher = 'gphr',
37342   eurlTelnet = 'tlnt',
37343   eurlNews = 'news',
37344   eurlSNews = 'snws',
37345   eurlNNTP = 'nntp',
37346   eurlMessage = 'mess',
37347   eurlMailbox = 'mbox',
37348   eurlMulti = 'mult',
37349   eurlLaunch = 'laun',
37350   eurlAFP = 'afp ',
37351   eurlAT = 'at  ',
37352   eurlEPPC = 'eppc',
37353   eurlRTSP = 'rtsp',
37354   eurlIMAP = 'imap',
37355   eurlNFS = 'unfs',
37356   eurlPOP = 'upop',
37357   eurlLDAP = 'uldp',
37358   eurlUnknown = 'url?'
37359 };
37360
37361 enum {
37362
37363   kConnSuite = 'macc',
37364   cDevSpec = 'cdev',
37365   cAddressSpec = 'cadr',
37366   cADBAddress = 'cadb',
37367   cAppleTalkAddress = 'cat ',
37368   cBusAddress = 'cbus',
37369   cEthernetAddress = 'cen ',
37370   cFireWireAddress = 'cfw ',
37371   cIPAddress = 'cip ',
37372   cLocalTalkAddress = 'clt ',
37373   cSCSIAddress = 'cscs',
37374   cTokenRingAddress = 'ctok',
37375   cUSBAddress = 'cusb',
37376
37377   pDeviceType = 'pdvt',
37378   pDeviceAddress = 'pdva',
37379   pConduit = 'pcon',
37380   pProtocol = 'pprt',
37381   pATMachine = 'patm',
37382   pATZone = 'patz',
37383   pATType = 'patt',
37384   pDottedDecimal = 'pipd',
37385   pDNS = 'pdns',
37386   pPort = 'ppor',
37387   pNetwork = 'pnet',
37388   pNode = 'pnod',
37389   pSocket = 'psoc',
37390   pSCSIBus = 'pscb',
37391   pSCSILUN = 'pslu',
37392
37393   eDeviceType = 'edvt',
37394   eAddressSpec = 'eads',
37395   eConduit = 'econ',
37396   eProtocol = 'epro',
37397   eADB = 'eadb',
37398   eAnalogAudio = 'epau',
37399   eAppleTalk = 'epat',
37400   eAudioLineIn = 'ecai',
37401   eAudioLineOut = 'ecal',
37402   eAudioOut = 'ecao',
37403   eBus = 'ebus',
37404   eCDROM = 'ecd ',
37405   eCommSlot = 'eccm',
37406   eDigitalAudio = 'epda',
37407   eDisplay = 'edds',
37408   eDVD = 'edvd',
37409   eEthernet = 'ecen',
37410   eFireWire = 'ecfw',
37411   eFloppy = 'efd ',
37412   eHD = 'ehd ',
37413   eInfrared = 'ecir',
37414   eIP = 'epip',
37415   eIrDA = 'epir',
37416   eIRTalk = 'epit',
37417   eKeyboard = 'ekbd',
37418   eLCD = 'edlc',
37419   eLocalTalk = 'eclt',
37420   eMacIP = 'epmi',
37421   eMacVideo = 'epmv',
37422   eMicrophone = 'ecmi',
37423   eModemPort = 'ecmp',
37424   eModemPrinterPort = 'empp',
37425   eModem = 'edmm',
37426   eMonitorOut = 'ecmn',
37427   eMouse = 'emou',
37428   eNuBusCard = 'ednb',
37429   eNuBus = 'enub',
37430   ePCcard = 'ecpc',
37431   ePCIbus = 'ecpi',
37432   ePCIcard = 'edpi',
37433   ePDSslot = 'ecpd',
37434   ePDScard = 'epds',
37435   ePointingDevice = 'edpd',
37436   ePostScript = 'epps',
37437   ePPP = 'eppp',
37438   ePrinterPort = 'ecpp',
37439   ePrinter = 'edpr',
37440   eSvideo = 'epsv',
37441   eSCSI = 'ecsc',
37442   eSerial = 'epsr',
37443   eSpeakers = 'edsp',
37444   eStorageDevice = 'edst',
37445   eSVGA = 'epsg',
37446   eTokenRing = 'etok',
37447   eTrackball = 'etrk',
37448   eTrackpad = 'edtp',
37449   eUSB = 'ecus',
37450   eVideoIn = 'ecvi',
37451   eVideoMonitor = 'edvm',
37452   eVideoOut = 'ecvo'
37453 };
37454
37455 enum {
37456
37457   cKeystroke = 'kprs',
37458   pKeystrokeKey = 'kMsg',
37459   pModifiers = 'kMod',
37460   pKeyKind = 'kknd',
37461   eModifiers = 'eMds',
37462   eOptionDown = 'Kopt',
37463   eCommandDown = 'Kcmd',
37464   eControlDown = 'Kctl',
37465   eShiftDown = 'Ksft',
37466   eCapsLockDown = 'Kclk',
37467   eKeyKind = 'ekst',
37468
37469   eEscapeKey = 0x6B733500,
37470   eDeleteKey = 0x6B733300,
37471   eTabKey = 0x6B733000,
37472   eReturnKey = 0x6B732400,
37473   eClearKey = 0x6B734700,
37474   eEnterKey = 0x6B734C00,
37475   eUpArrowKey = 0x6B737E00,
37476   eDownArrowKey = 0x6B737D00,
37477   eLeftArrowKey = 0x6B737B00,
37478   eRightArrowKey = 0x6B737C00,
37479   eHelpKey = 0x6B737200,
37480   eHomeKey = 0x6B737300,
37481   ePageUpKey = 0x6B737400,
37482   ePageDownKey = 0x6B737900,
37483   eForwardDelKey = 0x6B737500,
37484   eEndKey = 0x6B737700,
37485   eF1Key = 0x6B737A00,
37486   eF2Key = 0x6B737800,
37487   eF3Key = 0x6B736300,
37488   eF4Key = 0x6B737600,
37489   eF5Key = 0x6B736000,
37490   eF6Key = 0x6B736100,
37491   eF7Key = 0x6B736200,
37492   eF8Key = 0x6B736400,
37493   eF9Key = 0x6B736500,
37494   eF10Key = 0x6B736D00,
37495   eF11Key = 0x6B736700,
37496   eF12Key = 0x6B736F00,
37497   eF13Key = 0x6B736900,
37498   eF14Key = 0x6B736B00,
37499   eF15Key = 0x6B737100
37500 };
37501
37502
37503
37504
37505
37506
37507 enum {
37508   kAEUserTerminology = 'aeut',
37509   kAETerminologyExtension = 'aete',
37510   kAEScriptingSizeResource = 'scsz',
37511   kAEOSAXSizeResource = 'osiz'
37512 };
37513
37514 enum {
37515   kAEUTHasReturningParam = 31,
37516   kAEUTOptional = 15,
37517   kAEUTlistOfItems = 14,
37518   kAEUTEnumerated = 13,
37519   kAEUTReadWrite = 12,
37520   kAEUTChangesState = 12,
37521   kAEUTTightBindingFunction = 12,
37522
37523   kAEUTEnumsAreTypes = 11,
37524   kAEUTEnumListIsExclusive = 10,
37525   kAEUTReplyIsReference = 9,
37526   kAEUTDirectParamIsReference = 9,
37527   kAEUTParamIsReference = 9,
37528   kAEUTPropertyIsReference = 9,
37529   kAEUTNotDirectParamIsTarget = 8,
37530   kAEUTParamIsTarget = 8,
37531   kAEUTApostrophe = 3,
37532   kAEUTFeminine = 2,
37533   kAEUTMasculine = 1,
37534   kAEUTPlural = 0
37535 };
37536
37537 struct TScriptingSizeResource {
37538   short scriptingSizeFlags;
37539   unsigned long minStackSize;
37540   unsigned long preferredStackSize;
37541   unsigned long maxStackSize;
37542   unsigned long minHeapSize;
37543   unsigned long preferredHeapSize;
37544   unsigned long maxHeapSize;
37545 };
37546 typedef struct TScriptingSizeResource TScriptingSizeResource;
37547 enum {
37548   kLaunchToGetTerminology = (1 << 15),
37549   kDontFindAppBySignature = (1 << 14),
37550   kAlwaysSendSubject = (1 << 13)
37551 };
37552
37553
37554 enum {
37555   kReadExtensionTermsMask = (1 << 15)
37556 };
37557
37558 enum {
37559
37560
37561   kOSIZDontOpenResourceFile = 15,
37562   kOSIZdontAcceptRemoteEvents = 14,
37563   kOSIZOpenWithReadPermission = 13,
37564   kOSIZCodeInSharedLibraries = 11
37565 };
37566
37567
37568
37569
37570
37571 extern "C" {
37572
37573
37574 typedef UInt32 AEBuildErrorCode;
37575 enum {
37576   aeBuildSyntaxNoErr = 0,
37577   aeBuildSyntaxBadToken = 1,
37578   aeBuildSyntaxBadEOF = 2,
37579   aeBuildSyntaxNoEOF = 3,
37580   aeBuildSyntaxBadNegative = 4,
37581   aeBuildSyntaxMissingQuote = 5,
37582   aeBuildSyntaxBadHex = 6,
37583   aeBuildSyntaxOddHex = 7,
37584   aeBuildSyntaxNoCloseHex = 8,
37585   aeBuildSyntaxUncoercedHex = 9,
37586   aeBuildSyntaxNoCloseString = 10,
37587   aeBuildSyntaxBadDesc = 11,
37588   aeBuildSyntaxBadData = 12,
37589   aeBuildSyntaxNoCloseParen = 13,
37590   aeBuildSyntaxNoCloseBracket = 14,
37591   aeBuildSyntaxNoCloseBrace = 15,
37592   aeBuildSyntaxNoKey = 16,
37593   aeBuildSyntaxNoColon = 17,
37594   aeBuildSyntaxCoercedList = 18,
37595   aeBuildSyntaxUncoercedDoubleAt = 19
37596 };
37597
37598
37599
37600 struct AEBuildError {
37601   AEBuildErrorCode fError;
37602   UInt32 fErrorPos;
37603 };
37604 typedef struct AEBuildError AEBuildError;
37605 extern OSStatus
37606 AEBuildDesc(
37607   AEDesc * dst,
37608   AEBuildError * error,
37609   const char * src,
37610   ...) ;
37611 extern OSStatus
37612 vAEBuildDesc(
37613   AEDesc * dst,
37614   AEBuildError * error,
37615   const char * src,
37616   va_list args) ;
37617 extern OSStatus
37618 AEBuildParameters(
37619   AppleEvent * event,
37620   AEBuildError * error,
37621   const char * format,
37622   ...) ;
37623 extern OSStatus
37624 vAEBuildParameters(
37625   AppleEvent * event,
37626   AEBuildError * error,
37627   const char * format,
37628   va_list args) ;
37629 extern OSStatus
37630 AEBuildAppleEvent(
37631   AEEventClass theClass,
37632   AEEventID theID,
37633   DescType addressType,
37634   const void * addressData,
37635   long addressLength,
37636   short returnID,
37637   long transactionID,
37638   AppleEvent * result,
37639   AEBuildError * error,
37640   const char * paramsFmt,
37641   ...) ;
37642 extern OSStatus
37643 vAEBuildAppleEvent(
37644   AEEventClass theClass,
37645   AEEventID theID,
37646   DescType addressType,
37647   const void * addressData,
37648   long addressLength,
37649   short returnID,
37650   long transactionID,
37651   AppleEvent * resultEvt,
37652   AEBuildError * error,
37653   const char * paramsFmt,
37654   va_list args) ;
37655 extern OSStatus
37656 AEPrintDescToHandle(
37657   const AEDesc * desc,
37658   Handle * result) ;
37659 typedef struct OpaqueAEStreamRef* AEStreamRef;
37660 extern AEStreamRef
37661 AEStreamOpen(void) ;
37662 extern OSStatus
37663 AEStreamClose(
37664   AEStreamRef ref,
37665   AEDesc * desc) ;
37666 extern OSStatus
37667 AEStreamOpenDesc(
37668   AEStreamRef ref,
37669   DescType newType) ;
37670 extern OSStatus
37671 AEStreamWriteData(
37672   AEStreamRef ref,
37673   const void * data,
37674   Size length) ;
37675 extern OSStatus
37676 AEStreamCloseDesc(AEStreamRef ref) ;
37677 extern OSStatus
37678 AEStreamWriteDesc(
37679   AEStreamRef ref,
37680   DescType newType,
37681   const void * data,
37682   Size length) ;
37683 extern OSStatus
37684 AEStreamWriteAEDesc(
37685   AEStreamRef ref,
37686   const AEDesc * desc) ;
37687 extern OSStatus
37688 AEStreamOpenList(AEStreamRef ref) ;
37689 extern OSStatus
37690 AEStreamCloseList(AEStreamRef ref) ;
37691 extern OSStatus
37692 AEStreamOpenRecord(
37693   AEStreamRef ref,
37694   DescType newType) ;
37695 extern OSStatus
37696 AEStreamSetRecordType(
37697   AEStreamRef ref,
37698   DescType newType) ;
37699 extern OSStatus
37700 AEStreamCloseRecord(AEStreamRef ref) ;
37701 extern OSStatus
37702 AEStreamWriteKeyDesc(
37703   AEStreamRef ref,
37704   AEKeyword key,
37705   DescType newType,
37706   const void * data,
37707   Size length) ;
37708 extern OSStatus
37709 AEStreamOpenKeyDesc(
37710   AEStreamRef ref,
37711   AEKeyword key,
37712   DescType newType) ;
37713 extern OSStatus
37714 AEStreamWriteKey(
37715   AEStreamRef ref,
37716   AEKeyword key) ;
37717 extern AEStreamRef
37718 AEStreamCreateEvent(
37719   AEEventClass clazz,
37720   AEEventID id,
37721   DescType targetType,
37722   const void * targetData,
37723   long targetLength,
37724   short returnID,
37725   long transactionID) ;
37726 extern AEStreamRef
37727 AEStreamOpenEvent(AppleEvent * event) ;
37728 extern OSStatus
37729 AEStreamOptionalParam(
37730   AEStreamRef ref,
37731   AEKeyword key) ;
37732
37733
37734
37735
37736
37737 }
37738
37739
37740
37741 extern "C" {
37742 enum {
37743   keyReplyPortAttr = 'repp'
37744 };
37745
37746
37747 enum {
37748   typeReplyPortAttr = keyReplyPortAttr
37749 };
37750
37751
37752
37753
37754
37755 }
37756
37757
37758
37759
37760 extern "C" {
37761
37762
37763 extern OSStatus
37764 StandardGlyphs(
37765   void * dataStream,
37766   ByteCount size) ;
37767
37768
37769
37770 enum {
37771
37772   leftCaret = 0,
37773   rightCaret = -1,
37774   kHilite = 1
37775 };
37776
37777 enum {
37778   smLeftCaret = 0,
37779   smRightCaret = -1,
37780   smHilite = 1
37781 };
37782
37783 enum {
37784
37785   onlyStyleRun = 0,
37786   leftStyleRun = 1,
37787   rightStyleRun = 2,
37788   middleStyleRun = 3,
37789   smOnlyStyleRun = 0,
37790   smLeftStyleRun = 1,
37791   smRightStyleRun = 2,
37792   smMiddleStyleRun = 3
37793 };
37794
37795
37796 typedef short JustStyleCode;
37797
37798 typedef short TruncCode;
37799 enum {
37800
37801   truncEnd = 0,
37802   truncMiddle = 0x4000,
37803   smTruncEnd = 0,
37804   smTruncMiddle = 0x4000
37805 };
37806
37807 enum {
37808
37809   notTruncated = 0,
37810   truncated = 1,
37811   truncErr = -1,
37812   smNotTruncated = 0,
37813   smTruncated = 1,
37814   smTruncErr = -1
37815 };
37816
37817 typedef SInt8 StyledLineBreakCode;
37818 enum {
37819   smBreakWord = 0,
37820   smBreakChar = 1,
37821   smBreakOverflow = 2
37822 };
37823
37824
37825 enum {
37826
37827   tfAntiAlias = 1 << 0,
37828   tfUnicode = 1 << 1
37829 };
37830
37831
37832 struct FontInfo {
37833   short ascent;
37834   short descent;
37835   short widMax;
37836   short leading;
37837 };
37838 typedef struct FontInfo FontInfo;
37839
37840 typedef short FormatOrder[1];
37841 typedef FormatOrder * FormatOrderPtr;
37842
37843
37844
37845 typedef Boolean ( * StyleRunDirectionProcPtr)(short styleRunIndex, void *dirParam);
37846 typedef StyleRunDirectionProcPtr StyleRunDirectionUPP;
37847 extern StyleRunDirectionUPP
37848 NewStyleRunDirectionUPP(StyleRunDirectionProcPtr userRoutine) ;
37849 extern void
37850 DisposeStyleRunDirectionUPP(StyleRunDirectionUPP userUPP) ;
37851 extern Boolean
37852 InvokeStyleRunDirectionUPP(
37853   short styleRunIndex,
37854   void * dirParam,
37855   StyleRunDirectionUPP userUPP) ;
37856 extern short
37857 PixelToChar(
37858   Ptr textBuf,
37859   long textLength,
37860   Fixed slop,
37861   Fixed pixelWidth,
37862   Boolean * leadingEdge,
37863   Fixed * widthRemaining,
37864   JustStyleCode styleRunPosition,
37865   Point numer,
37866   Point denom) ;
37867 extern short
37868 CharToPixel(
37869   Ptr textBuf,
37870   long textLength,
37871   Fixed slop,
37872   long offset,
37873   short direction,
37874   JustStyleCode styleRunPosition,
37875   Point numer,
37876   Point denom) ;
37877 extern void
37878 DrawJustified(
37879   Ptr textPtr,
37880   long textLength,
37881   Fixed slop,
37882   JustStyleCode styleRunPosition,
37883   Point numer,
37884   Point denom) ;
37885 extern void
37886 MeasureJustified(
37887   Ptr textPtr,
37888   long textLength,
37889   Fixed slop,
37890   Ptr charLocs,
37891   JustStyleCode styleRunPosition,
37892   Point numer,
37893   Point denom) ;
37894 extern Fixed
37895 PortionLine(
37896   Ptr textPtr,
37897   long textLen,
37898   JustStyleCode styleRunPosition,
37899   Point numer,
37900   Point denom) ;
37901 extern void
37902 HiliteText(
37903   Ptr textPtr,
37904   short textLength,
37905   short firstOffset,
37906   short secondOffset,
37907   OffsetTable offsets) ;
37908 extern long
37909 VisibleLength(
37910   Ptr textPtr,
37911   long textLength) ;
37912 extern void
37913 GetFormatOrder(
37914   FormatOrderPtr ordering,
37915   short firstFormat,
37916   short lastFormat,
37917   Boolean lineRight,
37918   StyleRunDirectionUPP rlDirProc,
37919   Ptr dirParam) ;
37920 extern void
37921 TextFont(short font) ;
37922 extern void
37923 TextFace(StyleParameter face) ;
37924 extern void
37925 TextMode(short mode) ;
37926 extern void
37927 TextSize(short size) ;
37928 extern void
37929 SpaceExtra(Fixed extra) ;
37930 extern void
37931 DrawChar(CharParameter ch) ;
37932 extern void
37933 DrawString(ConstStr255Param s) ;
37934 extern void
37935 DrawText(
37936   const void * textBuf,
37937   short firstByte,
37938   short byteCount) ;
37939 extern short
37940 CharWidth(CharParameter ch) ;
37941 extern short
37942 StringWidth(ConstStr255Param s) ;
37943 extern short
37944 TextWidth(
37945   const void * textBuf,
37946   short firstByte,
37947   short byteCount) ;
37948 extern void
37949 MeasureText(
37950   short count,
37951   const void * textAddr,
37952   void * charLocs) ;
37953 extern void
37954 GetFontInfo(FontInfo * info) ;
37955 extern void
37956 CharExtra(Fixed extra) ;
37957 extern void
37958 StdText(
37959   short count,
37960   const void * textAddr,
37961   Point numer,
37962   Point denom) ;
37963 extern short
37964 StdTxMeas(
37965   short byteCount,
37966   const void * textAddr,
37967   Point * numer,
37968   Point * denom,
37969   FontInfo * info) ;
37970 extern StyledLineBreakCode
37971 StyledLineBreak(
37972   Ptr textPtr,
37973   long textLen,
37974   long textStart,
37975   long textEnd,
37976   long flags,
37977   Fixed * textWidth,
37978   long * textOffset) ;
37979 extern short
37980 TruncString(
37981   short width,
37982   Str255 theString,
37983   TruncCode truncWhere) ;
37984 extern short
37985 TruncText(
37986   short width,
37987   Ptr textPtr,
37988   short * length,
37989   TruncCode truncWhere) ;
37990 extern void
37991 stdtext(
37992   short count,
37993   const void * textAddr,
37994   const Point * numer,
37995   const Point * denom) ;
37996 extern UInt32
37997 SwapQDTextFlags(UInt32 newFlags) ;
37998
37999
38000 }
38001 extern "C" {
38002
38003
38004
38005 enum {
38006   invalColReq = -1
38007 };
38008
38009 enum {
38010
38011   srcCopy = 0,
38012   srcOr = 1,
38013   srcXor = 2,
38014   srcBic = 3,
38015   notSrcCopy = 4,
38016   notSrcOr = 5,
38017   notSrcXor = 6,
38018   notSrcBic = 7,
38019   patCopy = 8,
38020   patOr = 9,
38021   patXor = 10,
38022   patBic = 11,
38023   notPatCopy = 12,
38024   notPatOr = 13,
38025   notPatXor = 14,
38026   notPatBic = 15,
38027   grayishTextOr = 49,
38028   hilitetransfermode = 50,
38029   hilite = 50,
38030   blend = 32,
38031   addPin = 33,
38032   addOver = 34,
38033   subPin = 35,
38034   addMax = 37,
38035   adMax = 37,
38036   subOver = 38,
38037   adMin = 39,
38038   ditherCopy = 64,
38039   transparent = 36
38040 };
38041
38042 enum {
38043   italicBit = 1,
38044   ulineBit = 2,
38045   outlineBit = 3,
38046   shadowBit = 4,
38047   condenseBit = 5,
38048   extendBit = 6
38049 };
38050
38051 enum {
38052
38053   normalBit = 0,
38054   inverseBit = 1,
38055   redBit = 4,
38056   greenBit = 3,
38057   blueBit = 2,
38058   cyanBit = 8,
38059   magentaBit = 7,
38060   yellowBit = 6,
38061   blackBit = 5
38062 };
38063
38064 enum {
38065   blackColor = 33,
38066   whiteColor = 30,
38067   redColor = 205,
38068   greenColor = 341,
38069   blueColor = 409,
38070   cyanColor = 273,
38071   magentaColor = 137,
38072   yellowColor = 69
38073 };
38074
38075 enum {
38076   picLParen = 0,
38077   picRParen = 1,
38078   clutType = 0,
38079   fixedType = 1,
38080   directType = 2,
38081   gdDevType = 0
38082 };
38083
38084 enum {
38085   interlacedDevice = 2,
38086   hwMirroredDevice = 4,
38087   roundedDevice = 5,
38088   hasAuxMenuBar = 6,
38089   burstDevice = 7,
38090   ext32Device = 8,
38091   ramInit = 10,
38092   mainScreen = 11,
38093   allInit = 12,
38094   screenDevice = 13,
38095   noDriver = 14,
38096   screenActive = 15,
38097   hiliteBit = 7,
38098   pHiliteBit = 0,
38099   defQDColors = 127,
38100
38101   RGBDirect = 16,
38102
38103   baseAddr32 = 4
38104 };
38105
38106
38107 enum {
38108   sysPatListID = 0,
38109   iBeamCursor = 1,
38110   crossCursor = 2,
38111   plusCursor = 3,
38112   watchCursor = 4
38113 };
38114
38115 enum {
38116   kQDGrafVerbFrame = 0,
38117   kQDGrafVerbPaint = 1,
38118   kQDGrafVerbErase = 2,
38119   kQDGrafVerbInvert = 3,
38120   kQDGrafVerbFill = 4
38121 };
38122 typedef SInt8 GrafVerb;
38123 enum {
38124   chunky = 0,
38125   chunkyPlanar = 1,
38126   planar = 2
38127 };
38128
38129 typedef SInt8 PixelType;
38130 typedef short Bits16[16];
38131 struct Pattern {
38132   UInt8 pat[8];
38133 };
38134 typedef struct Pattern Pattern;
38135
38136
38137
38138
38139
38140 typedef const Pattern * ConstPatternParam;
38141 typedef Pattern * PatPtr;
38142 typedef PatPtr * PatHandle;
38143 typedef SignedByte QDByte;
38144 typedef QDByte * QDPtr;
38145 typedef QDPtr * QDHandle;
38146 typedef short QDErr;
38147 enum {
38148   singleDevicesBit = 0,
38149   dontMatchSeedsBit = 1,
38150   allDevicesBit = 2
38151 };
38152
38153 enum {
38154   singleDevices = 1 << singleDevicesBit,
38155   dontMatchSeeds = 1 << dontMatchSeedsBit,
38156   allDevices = 1 << allDevicesBit
38157 };
38158
38159 typedef unsigned long DeviceLoopFlags;
38160
38161
38162
38163 typedef SInt32 PrinterStatusOpcode;
38164 enum {
38165   kPrinterFontStatus = 0,
38166   kPrinterScalingStatus = 1
38167 };
38168
38169 struct PrinterFontStatus {
38170   SInt32 oResult;
38171   SInt16 iFondID;
38172   Style iStyle;
38173 };
38174 typedef struct PrinterFontStatus PrinterFontStatus;
38175 struct PrinterScalingStatus {
38176   Point oScalingFactors;
38177 };
38178 typedef struct PrinterScalingStatus PrinterScalingStatus;
38179 struct BitMap {
38180   Ptr baseAddr;
38181   short rowBytes;
38182   Rect bounds;
38183 };
38184 typedef struct BitMap BitMap;
38185 typedef BitMap * BitMapPtr;
38186 typedef BitMapPtr * BitMapHandle;
38187 struct Cursor {
38188   Bits16 data;
38189   Bits16 mask;
38190   Point hotSpot;
38191 };
38192 typedef struct Cursor Cursor;
38193 typedef Cursor * CursPtr;
38194 typedef CursPtr * CursHandle;
38195 struct PenState {
38196   Point pnLoc;
38197   Point pnSize;
38198   short pnMode;
38199   Pattern pnPat;
38200 };
38201 typedef struct PenState PenState;
38202 typedef struct OpaqueRgnHandle* RgnHandle;
38203
38204
38205 struct Picture {
38206   short picSize;
38207   Rect picFrame;
38208 };
38209 typedef struct Picture Picture;
38210 typedef Picture * PicPtr;
38211 typedef PicPtr * PicHandle;
38212 struct MacPolygon {
38213   short polySize;
38214   Rect polyBBox;
38215   Point polyPoints[1];
38216 };
38217 typedef struct MacPolygon MacPolygon;
38218
38219
38220
38221
38222 typedef MacPolygon Polygon;
38223 typedef MacPolygon * PolyPtr;
38224 typedef PolyPtr * PolyHandle;
38225 typedef void ( * QDTextProcPtr)(short byteCount, const void *textBuf, Point numer, Point denom);
38226 typedef void ( * QDLineProcPtr)(Point newPt);
38227 typedef void ( * QDRectProcPtr)(GrafVerb verb, const Rect *r);
38228 typedef void ( * QDRRectProcPtr)(GrafVerb verb, const Rect *r, short ovalWidth, short ovalHeight);
38229 typedef void ( * QDOvalProcPtr)(GrafVerb verb, const Rect *r);
38230 typedef void ( * QDArcProcPtr)(GrafVerb verb, const Rect *r, short startAngle, short arcAngle);
38231 typedef void ( * QDPolyProcPtr)(GrafVerb verb, PolyHandle poly);
38232 typedef void ( * QDRgnProcPtr)(GrafVerb verb, RgnHandle rgn);
38233 typedef void ( * QDBitsProcPtr)(const BitMap *srcBits, const Rect *srcRect, const Rect *dstRect, short mode, RgnHandle maskRgn);
38234 typedef void ( * QDCommentProcPtr)(short kind, short dataSize, Handle dataHandle);
38235 typedef short ( * QDTxMeasProcPtr)(short byteCount, const void *textAddr, Point *numer, Point *denom, FontInfo *info);
38236 typedef void ( * QDGetPicProcPtr)(void *dataPtr, short byteCount);
38237 typedef void ( * QDPutPicProcPtr)(const void *dataPtr, short byteCount);
38238 typedef void ( * QDOpcodeProcPtr)(const Rect *fromRect, const Rect *toRect, UInt16 opcode, SInt16 version);
38239 typedef OSStatus ( * QDStdGlyphsProcPtr)(void *dataStream, ByteCount size);
38240 typedef void ( * QDJShieldCursorProcPtr)(short left, short top, short right, short bottom);
38241 typedef QDTextProcPtr QDTextUPP;
38242 typedef QDLineProcPtr QDLineUPP;
38243 typedef QDRectProcPtr QDRectUPP;
38244 typedef QDRRectProcPtr QDRRectUPP;
38245 typedef QDOvalProcPtr QDOvalUPP;
38246 typedef QDArcProcPtr QDArcUPP;
38247 typedef QDPolyProcPtr QDPolyUPP;
38248 typedef QDRgnProcPtr QDRgnUPP;
38249 typedef QDBitsProcPtr QDBitsUPP;
38250 typedef QDCommentProcPtr QDCommentUPP;
38251 typedef QDTxMeasProcPtr QDTxMeasUPP;
38252 typedef QDGetPicProcPtr QDGetPicUPP;
38253 typedef QDPutPicProcPtr QDPutPicUPP;
38254 typedef QDOpcodeProcPtr QDOpcodeUPP;
38255 typedef QDStdGlyphsProcPtr QDStdGlyphsUPP;
38256 typedef QDJShieldCursorProcPtr QDJShieldCursorUPP;
38257 struct QDProcs {
38258   QDTextUPP textProc;
38259   QDLineUPP lineProc;
38260   QDRectUPP rectProc;
38261   QDRRectUPP rRectProc;
38262   QDOvalUPP ovalProc;
38263   QDArcUPP arcProc;
38264   QDPolyUPP polyProc;
38265   QDRgnUPP rgnProc;
38266   QDBitsUPP bitsProc;
38267   QDCommentUPP commentProc;
38268   QDTxMeasUPP txMeasProc;
38269   QDGetPicUPP getPicProc;
38270   QDPutPicUPP putPicProc;
38271 };
38272 typedef struct QDProcs QDProcs;
38273 typedef QDProcs * QDProcsPtr;
38274 extern QDTextUPP
38275 NewQDTextUPP(QDTextProcPtr userRoutine) ;
38276 extern QDLineUPP
38277 NewQDLineUPP(QDLineProcPtr userRoutine) ;
38278 extern QDRectUPP
38279 NewQDRectUPP(QDRectProcPtr userRoutine) ;
38280 extern QDRRectUPP
38281 NewQDRRectUPP(QDRRectProcPtr userRoutine) ;
38282 extern QDOvalUPP
38283 NewQDOvalUPP(QDOvalProcPtr userRoutine) ;
38284 extern QDArcUPP
38285 NewQDArcUPP(QDArcProcPtr userRoutine) ;
38286 extern QDPolyUPP
38287 NewQDPolyUPP(QDPolyProcPtr userRoutine) ;
38288 extern QDRgnUPP
38289 NewQDRgnUPP(QDRgnProcPtr userRoutine) ;
38290 extern QDBitsUPP
38291 NewQDBitsUPP(QDBitsProcPtr userRoutine) ;
38292 extern QDCommentUPP
38293 NewQDCommentUPP(QDCommentProcPtr userRoutine) ;
38294 extern QDTxMeasUPP
38295 NewQDTxMeasUPP(QDTxMeasProcPtr userRoutine) ;
38296 extern QDGetPicUPP
38297 NewQDGetPicUPP(QDGetPicProcPtr userRoutine) ;
38298 extern QDPutPicUPP
38299 NewQDPutPicUPP(QDPutPicProcPtr userRoutine) ;
38300 extern QDOpcodeUPP
38301 NewQDOpcodeUPP(QDOpcodeProcPtr userRoutine) ;
38302 extern QDStdGlyphsUPP
38303 NewQDStdGlyphsUPP(QDStdGlyphsProcPtr userRoutine) ;
38304 extern QDJShieldCursorUPP
38305 NewQDJShieldCursorUPP(QDJShieldCursorProcPtr userRoutine) ;
38306 extern void
38307 DisposeQDTextUPP(QDTextUPP userUPP) ;
38308 extern void
38309 DisposeQDLineUPP(QDLineUPP userUPP) ;
38310 extern void
38311 DisposeQDRectUPP(QDRectUPP userUPP) ;
38312 extern void
38313 DisposeQDRRectUPP(QDRRectUPP userUPP) ;
38314 extern void
38315 DisposeQDOvalUPP(QDOvalUPP userUPP) ;
38316 extern void
38317 DisposeQDArcUPP(QDArcUPP userUPP) ;
38318 extern void
38319 DisposeQDPolyUPP(QDPolyUPP userUPP) ;
38320 extern void
38321 DisposeQDRgnUPP(QDRgnUPP userUPP) ;
38322 extern void
38323 DisposeQDBitsUPP(QDBitsUPP userUPP) ;
38324 extern void
38325 DisposeQDCommentUPP(QDCommentUPP userUPP) ;
38326 extern void
38327 DisposeQDTxMeasUPP(QDTxMeasUPP userUPP) ;
38328 extern void
38329 DisposeQDGetPicUPP(QDGetPicUPP userUPP) ;
38330 extern void
38331 DisposeQDPutPicUPP(QDPutPicUPP userUPP) ;
38332 extern void
38333 DisposeQDOpcodeUPP(QDOpcodeUPP userUPP) ;
38334 extern void
38335 DisposeQDStdGlyphsUPP(QDStdGlyphsUPP userUPP) ;
38336 extern void
38337 DisposeQDJShieldCursorUPP(QDJShieldCursorUPP userUPP) ;
38338 extern void
38339 InvokeQDTextUPP(
38340   short byteCount,
38341   const void * textBuf,
38342   Point numer,
38343   Point denom,
38344   QDTextUPP userUPP) ;
38345 extern void
38346 InvokeQDLineUPP(
38347   Point newPt,
38348   QDLineUPP userUPP) ;
38349 extern void
38350 InvokeQDRectUPP(
38351   GrafVerb verb,
38352   const Rect * r,
38353   QDRectUPP userUPP) ;
38354 extern void
38355 InvokeQDRRectUPP(
38356   GrafVerb verb,
38357   const Rect * r,
38358   short ovalWidth,
38359   short ovalHeight,
38360   QDRRectUPP userUPP) ;
38361 extern void
38362 InvokeQDOvalUPP(
38363   GrafVerb verb,
38364   const Rect * r,
38365   QDOvalUPP userUPP) ;
38366 extern void
38367 InvokeQDArcUPP(
38368   GrafVerb verb,
38369   const Rect * r,
38370   short startAngle,
38371   short arcAngle,
38372   QDArcUPP userUPP) ;
38373 extern void
38374 InvokeQDPolyUPP(
38375   GrafVerb verb,
38376   PolyHandle poly,
38377   QDPolyUPP userUPP) ;
38378 extern void
38379 InvokeQDRgnUPP(
38380   GrafVerb verb,
38381   RgnHandle rgn,
38382   QDRgnUPP userUPP) ;
38383 extern void
38384 InvokeQDBitsUPP(
38385   const BitMap * srcBits,
38386   const Rect * srcRect,
38387   const Rect * dstRect,
38388   short mode,
38389   RgnHandle maskRgn,
38390   QDBitsUPP userUPP) ;
38391 extern void
38392 InvokeQDCommentUPP(
38393   short kind,
38394   short dataSize,
38395   Handle dataHandle,
38396   QDCommentUPP userUPP) ;
38397 extern short
38398 InvokeQDTxMeasUPP(
38399   short byteCount,
38400   const void * textAddr,
38401   Point * numer,
38402   Point * denom,
38403   FontInfo * info,
38404   QDTxMeasUPP userUPP) ;
38405 extern void
38406 InvokeQDGetPicUPP(
38407   void * dataPtr,
38408   short byteCount,
38409   QDGetPicUPP userUPP) ;
38410 extern void
38411 InvokeQDPutPicUPP(
38412   const void * dataPtr,
38413   short byteCount,
38414   QDPutPicUPP userUPP) ;
38415 extern void
38416 InvokeQDOpcodeUPP(
38417   const Rect * fromRect,
38418   const Rect * toRect,
38419   UInt16 opcode,
38420   SInt16 version,
38421   QDOpcodeUPP userUPP) ;
38422 extern OSStatus
38423 InvokeQDStdGlyphsUPP(
38424   void * dataStream,
38425   ByteCount size,
38426   QDStdGlyphsUPP userUPP) ;
38427 extern void
38428 InvokeQDJShieldCursorUPP(
38429   short left,
38430   short top,
38431   short right,
38432   short bottom,
38433   QDJShieldCursorUPP userUPP) ;
38434 typedef struct OpaqueWindowPtr* WindowPtr;
38435 typedef struct OpaqueDialogPtr* DialogPtr;
38436 typedef struct OpaqueGrafPtr* GrafPtr;
38437
38438
38439 typedef WindowPtr WindowRef;
38440
38441 typedef UInt16 DragConstraint;
38442 enum {
38443   kNoConstraint = 0,
38444   kVerticalConstraint = 1,
38445   kHorizontalConstraint = 2
38446 };
38447
38448
38449 typedef void ( * DragGrayRgnProcPtr)(void);
38450
38451
38452
38453
38454
38455 struct RGBColor {
38456   unsigned short red;
38457   unsigned short green;
38458   unsigned short blue;
38459 };
38460 typedef struct RGBColor RGBColor;
38461 typedef RGBColor * RGBColorPtr;
38462 typedef RGBColorPtr * RGBColorHdl;
38463 typedef Boolean ( * ColorSearchProcPtr)(RGBColor *rgb, long *position);
38464 typedef Boolean ( * ColorComplementProcPtr)(RGBColor * rgb);
38465 typedef DragGrayRgnProcPtr DragGrayRgnUPP;
38466 typedef ColorSearchProcPtr ColorSearchUPP;
38467 typedef ColorComplementProcPtr ColorComplementUPP;
38468 extern DragGrayRgnUPP
38469 NewDragGrayRgnUPP(DragGrayRgnProcPtr userRoutine) ;
38470 extern ColorSearchUPP
38471 NewColorSearchUPP(ColorSearchProcPtr userRoutine) ;
38472 extern ColorComplementUPP
38473 NewColorComplementUPP(ColorComplementProcPtr userRoutine) ;
38474 extern void
38475 DisposeDragGrayRgnUPP(DragGrayRgnUPP userUPP) ;
38476 extern void
38477 DisposeColorSearchUPP(ColorSearchUPP userUPP) ;
38478 extern void
38479 DisposeColorComplementUPP(ColorComplementUPP userUPP) ;
38480 extern void
38481 InvokeDragGrayRgnUPP(DragGrayRgnUPP userUPP) ;
38482 extern Boolean
38483 InvokeColorSearchUPP(
38484   RGBColor * rgb,
38485   long * position,
38486   ColorSearchUPP userUPP) ;
38487 extern Boolean
38488 InvokeColorComplementUPP(
38489   RGBColor * rgb,
38490   ColorComplementUPP userUPP) ;
38491
38492 struct ColorSpec {
38493   short value;
38494   RGBColor rgb;
38495 };
38496 typedef struct ColorSpec ColorSpec;
38497 typedef ColorSpec * ColorSpecPtr;
38498 typedef ColorSpec CSpecArray[1];
38499 struct ColorTable {
38500   long ctSeed;
38501   short ctFlags;
38502   short ctSize;
38503   CSpecArray ctTable;
38504 };
38505 typedef struct ColorTable ColorTable;
38506 typedef ColorTable * CTabPtr;
38507 typedef CTabPtr * CTabHandle;
38508 struct xColorSpec {
38509   short value;
38510   RGBColor rgb;
38511   short xalpha;
38512 };
38513 typedef struct xColorSpec xColorSpec;
38514 typedef xColorSpec * xColorSpecPtr;
38515 typedef xColorSpec xCSpecArray[1];
38516 struct MatchRec {
38517   unsigned short red;
38518   unsigned short green;
38519   unsigned short blue;
38520   long matchData;
38521 };
38522 typedef struct MatchRec MatchRec;
38523 enum {
38524   k1MonochromePixelFormat = 0x00000001,
38525   k2IndexedPixelFormat = 0x00000002,
38526   k4IndexedPixelFormat = 0x00000004,
38527   k8IndexedPixelFormat = 0x00000008,
38528   k16BE555PixelFormat = 0x00000010,
38529   k24RGBPixelFormat = 0x00000018,
38530   k32ARGBPixelFormat = 0x00000020,
38531   k1IndexedGrayPixelFormat = 0x00000021,
38532   k2IndexedGrayPixelFormat = 0x00000022,
38533   k4IndexedGrayPixelFormat = 0x00000024,
38534   k8IndexedGrayPixelFormat = 0x00000028
38535 };
38536
38537
38538
38539 enum {
38540   k16LE555PixelFormat = 'L555',
38541   k16LE5551PixelFormat = '5551',
38542   k16BE565PixelFormat = 'B565',
38543   k16LE565PixelFormat = 'L565',
38544   k24BGRPixelFormat = '24BG',
38545   k32BGRAPixelFormat = 'BGRA',
38546   k32ABGRPixelFormat = 'ABGR',
38547   k32RGBAPixelFormat = 'RGBA',
38548   kYUVSPixelFormat = 'yuvs',
38549   kYUVUPixelFormat = 'yuvu',
38550   kYVU9PixelFormat = 'YVU9',
38551   kYUV411PixelFormat = 'Y411',
38552   kYVYU422PixelFormat = 'YVYU',
38553   kUYVY422PixelFormat = 'UYVY',
38554   kYUV211PixelFormat = 'Y211',
38555   k2vuyPixelFormat = '2vuy'
38556 };
38557
38558
38559 struct PixMap {
38560   Ptr baseAddr;
38561   short rowBytes;
38562   Rect bounds;
38563   short pmVersion;
38564   short packType;
38565   long packSize;
38566   Fixed hRes;
38567   Fixed vRes;
38568   short pixelType;
38569   short pixelSize;
38570   short cmpCount;
38571   short cmpSize;
38572
38573
38574
38575
38576
38577   OSType pixelFormat;
38578     CTabHandle pmTable;
38579   void* pmExt;
38580
38581 };
38582 typedef struct PixMap PixMap;
38583 typedef PixMap * PixMapPtr;
38584 typedef PixMapPtr * PixMapHandle;
38585 struct PixPat {
38586   short patType;
38587   PixMapHandle patMap;
38588   Handle patData;
38589   Handle patXData;
38590   short patXValid;
38591   Handle patXMap;
38592   Pattern pat1Data;
38593 };
38594 typedef struct PixPat PixPat;
38595 typedef PixPat * PixPatPtr;
38596 typedef PixPatPtr * PixPatHandle;
38597 struct CCrsr {
38598   short crsrType;
38599   PixMapHandle crsrMap;
38600   Handle crsrData;
38601   Handle crsrXData;
38602   short crsrXValid;
38603   Handle crsrXHandle;
38604   Bits16 crsr1Data;
38605   Bits16 crsrMask;
38606   Point crsrHotSpot;
38607   long crsrXTable;
38608   long crsrID;
38609 };
38610 typedef struct CCrsr CCrsr;
38611 typedef CCrsr * CCrsrPtr;
38612 typedef CCrsrPtr * CCrsrHandle;
38613 struct GammaTbl {
38614   short gVersion;
38615   short gType;
38616   short gFormulaSize;
38617   short gChanCnt;
38618   short gDataCnt;
38619   short gDataWidth;
38620   short gFormulaData[1];
38621 };
38622 typedef struct GammaTbl GammaTbl;
38623 typedef GammaTbl * GammaTblPtr;
38624 typedef GammaTblPtr * GammaTblHandle;
38625 struct ITab {
38626   long iTabSeed;
38627   short iTabRes;
38628   Byte iTTable[1];
38629 };
38630 typedef struct ITab ITab;
38631 typedef ITab * ITabPtr;
38632 typedef ITabPtr * ITabHandle;
38633 struct SProcRec {
38634   Handle nxtSrch;
38635   ColorSearchUPP srchProc;
38636 };
38637 typedef struct SProcRec SProcRec;
38638 typedef SProcRec * SProcPtr;
38639 typedef SProcPtr * SProcHndl;
38640 struct CProcRec {
38641   Handle nxtComp;
38642   ColorComplementUPP compProc;
38643 };
38644 typedef struct CProcRec CProcRec;
38645 typedef CProcRec * CProcPtr;
38646 typedef CProcPtr * CProcHndl;
38647 typedef struct GDevice GDevice;
38648 typedef GDevice * GDPtr;
38649 typedef GDPtr * GDHandle;
38650 struct GDevice {
38651   short gdRefNum;
38652   short gdID;
38653   short gdType;
38654   ITabHandle gdITable;
38655   short gdResPref;
38656   SProcHndl gdSearchProc;
38657   CProcHndl gdCompProc;
38658   short gdFlags;
38659   PixMapHandle gdPMap;
38660   long gdRefCon;
38661   GDHandle gdNextGD;
38662   Rect gdRect;
38663   long gdMode;
38664   short gdCCBytes;
38665   short gdCCDepth;
38666   Handle gdCCXData;
38667   Handle gdCCXMask;
38668
38669
38670
38671   Handle gdExt;
38672
38673 };
38674
38675 struct GrafVars {
38676   RGBColor rgbOpColor;
38677   RGBColor rgbHiliteColor;
38678   Handle pmFgColor;
38679   short pmFgIndex;
38680   Handle pmBkColor;
38681   short pmBkIndex;
38682   short pmFlags;
38683 };
38684 typedef struct GrafVars GrafVars;
38685 typedef GrafVars * GVarPtr;
38686 typedef GVarPtr * GVarHandle;
38687
38688
38689
38690
38691
38692 typedef GrafPtr CGrafPtr;
38693
38694
38695 typedef OSStatus ( * QDPrinterStatusProcPtr)(PrinterStatusOpcode opcode, CGrafPtr currentPort, void *printerStatus);
38696 typedef QDPrinterStatusProcPtr QDPrinterStatusUPP;
38697
38698 struct CQDProcs {
38699   QDTextUPP textProc;
38700   QDLineUPP lineProc;
38701   QDRectUPP rectProc;
38702   QDRRectUPP rRectProc;
38703   QDOvalUPP ovalProc;
38704   QDArcUPP arcProc;
38705   QDPolyUPP polyProc;
38706   QDRgnUPP rgnProc;
38707   QDBitsUPP bitsProc;
38708   QDCommentUPP commentProc;
38709   QDTxMeasUPP txMeasProc;
38710   QDGetPicUPP getPicProc;
38711   QDPutPicUPP putPicProc;
38712   QDOpcodeUPP opcodeProc;
38713   UniversalProcPtr newProc1;
38714   QDStdGlyphsUPP glyphsProc;
38715   QDPrinterStatusUPP printerStatusProc;
38716   UniversalProcPtr newProc4;
38717   UniversalProcPtr newProc5;
38718   UniversalProcPtr newProc6;
38719 };
38720 typedef struct CQDProcs CQDProcs;
38721 typedef CQDProcs * CQDProcsPtr;
38722 typedef WindowPtr CWindowPtr;
38723
38724
38725
38726
38727 struct ReqListRec {
38728   short reqLSize;
38729   short reqLData[1];
38730 };
38731 typedef struct ReqListRec ReqListRec;
38732 struct OpenCPicParams {
38733   Rect srcRect;
38734   Fixed hRes;
38735   Fixed vRes;
38736   short version;
38737   short reserved1;
38738   long reserved2;
38739 };
38740 typedef struct OpenCPicParams OpenCPicParams;
38741 enum {
38742   kCursorImageMajorVersion = 0x0001,
38743   kCursorImageMinorVersion = 0x0000
38744 };
38745
38746 struct CursorImageRec {
38747   UInt16 majorVersion;
38748   UInt16 minorVersion;
38749   PixMapHandle cursorPixMap;
38750   BitMapHandle cursorBitMask;
38751 };
38752 typedef struct CursorImageRec CursorImageRec;
38753 typedef CursorImageRec * CursorImagePtr;
38754 typedef void ( * DeviceLoopDrawingProcPtr)(short depth, short deviceFlags, GDHandle targetDevice, long userData);
38755 typedef DeviceLoopDrawingProcPtr DeviceLoopDrawingUPP;
38756 extern DeviceLoopDrawingUPP
38757 NewDeviceLoopDrawingUPP(DeviceLoopDrawingProcPtr userRoutine) ;
38758 extern void
38759 DisposeDeviceLoopDrawingUPP(DeviceLoopDrawingUPP userUPP) ;
38760 extern void
38761 InvokeDeviceLoopDrawingUPP(
38762   short depth,
38763   short deviceFlags,
38764   GDHandle targetDevice,
38765   long userData,
38766   DeviceLoopDrawingUPP userUPP) ;
38767 extern OSErr
38768 LockPortBits(GrafPtr port) ;
38769 extern OSErr
38770 UnlockPortBits(GrafPtr port) ;
38771
38772
38773
38774
38775 enum {
38776   kQDParseRegionFromTop = (1 << 0),
38777   kQDParseRegionFromBottom = (1 << 1),
38778   kQDParseRegionFromLeft = (1 << 2),
38779   kQDParseRegionFromRight = (1 << 3),
38780   kQDParseRegionFromTopLeft = kQDParseRegionFromTop | kQDParseRegionFromLeft,
38781   kQDParseRegionFromBottomRight = kQDParseRegionFromBottom | kQDParseRegionFromRight
38782 };
38783
38784 typedef SInt32 QDRegionParseDirection;
38785 enum {
38786   kQDRegionToRectsMsgInit = 1,
38787   kQDRegionToRectsMsgParse = 2,
38788   kQDRegionToRectsMsgTerminate = 3
38789 };
38790
38791 typedef OSStatus ( * RegionToRectsProcPtr)(UInt16 message, RgnHandle rgn, const Rect *rect, void *refCon);
38792 typedef RegionToRectsProcPtr RegionToRectsUPP;
38793 extern RegionToRectsUPP
38794 NewRegionToRectsUPP(RegionToRectsProcPtr userRoutine) ;
38795 extern void
38796 DisposeRegionToRectsUPP(RegionToRectsUPP userUPP) ;
38797 extern OSStatus
38798 InvokeRegionToRectsUPP(
38799   UInt16 message,
38800   RgnHandle rgn,
38801   const Rect * rect,
38802   void * refCon,
38803   RegionToRectsUPP userUPP) ;
38804 extern OSStatus
38805 QDRegionToRects(
38806   RgnHandle rgn,
38807   QDRegionParseDirection dir,
38808   RegionToRectsUPP proc,
38809   void * userData) ;
38810 extern void
38811 SetPort(GrafPtr port) ;
38812 extern void
38813 GetPort(GrafPtr * port) ;
38814 extern Boolean
38815 QDSwapPort(
38816   CGrafPtr inNewPort,
38817   CGrafPtr * outOldPort) ;
38818 extern void
38819 GrafDevice(short device) ;
38820 extern void
38821 SetPortBits(const BitMap * bm) ;
38822 extern void
38823 PortSize(
38824   short width,
38825   short height) ;
38826 extern void
38827 MovePortTo(
38828   short leftGlobal,
38829   short topGlobal) ;
38830 extern void
38831 SetOrigin(
38832   short h,
38833   short v) ;
38834 extern void
38835 SetClip(RgnHandle rgn) ;
38836 extern void
38837 GetClip(RgnHandle rgn) ;
38838 extern void
38839 ClipRect(const Rect * r) ;
38840 extern void
38841 BackPat(const Pattern * pat) ;
38842 extern void
38843 InitCursor(void) ;
38844 extern void
38845 SetCursor(const Cursor * crsr) ;
38846 extern void
38847 HideCursor(void) ;
38848 extern void
38849 ShowCursor(void) ;
38850 extern void
38851 ObscureCursor(void) ;
38852 extern void
38853 HidePen(void) ;
38854 extern void
38855 ShowPen(void) ;
38856 extern void
38857 GetPen(Point * pt) ;
38858 extern void
38859 GetPenState(PenState * pnState) ;
38860 extern void
38861 SetPenState(const PenState * pnState) ;
38862 extern void
38863 PenSize(
38864   short width,
38865   short height) ;
38866 extern void
38867 PenMode(short mode) ;
38868 extern void
38869 PenPat(const Pattern * pat) ;
38870 extern void
38871 PenNormal(void) ;
38872 extern void
38873 MoveTo(
38874   short h,
38875   short v) ;
38876 extern void
38877 Move(
38878   short dh,
38879   short dv) ;
38880 extern void
38881 LineTo(
38882   short h,
38883   short v) ;
38884 extern void
38885 Line(
38886   short dh,
38887   short dv) ;
38888 extern void
38889 ForeColor(long color) ;
38890 extern void
38891 BackColor(long color) ;
38892 extern void
38893 ColorBit(short whichBit) ;
38894 extern void
38895 SetRect(
38896   Rect * r,
38897   short left,
38898   short top,
38899   short right,
38900   short bottom) ;
38901 extern void
38902 OffsetRect(
38903   Rect * r,
38904   short dh,
38905   short dv) ;
38906 extern void
38907 InsetRect(
38908   Rect * r,
38909   short dh,
38910   short dv) ;
38911 extern Boolean
38912 SectRect(
38913   const Rect * src1,
38914   const Rect * src2,
38915   Rect * dstRect) ;
38916 extern void
38917 UnionRect(
38918   const Rect * src1,
38919   const Rect * src2,
38920   Rect * dstRect) ;
38921 extern Boolean
38922 EqualRect(
38923   const Rect * rect1,
38924   const Rect * rect2) ;
38925 extern Boolean
38926 EmptyRect(const Rect * r) ;
38927 extern void
38928 FrameRect(const Rect * r) ;
38929 extern void
38930 PaintRect(const Rect * r) ;
38931 extern void
38932 EraseRect(const Rect * r) ;
38933 extern void
38934 InvertRect(const Rect * r) ;
38935 extern void
38936 FillRect(
38937   const Rect * r,
38938   const Pattern * pat) ;
38939 extern void
38940 FrameOval(const Rect * r) ;
38941 extern void
38942 PaintOval(const Rect * r) ;
38943 extern void
38944 EraseOval(const Rect * r) ;
38945 extern void
38946 InvertOval(const Rect * r) ;
38947 extern void
38948 FillOval(
38949   const Rect * r,
38950   const Pattern * pat) ;
38951 extern void
38952 FrameRoundRect(
38953   const Rect * r,
38954   short ovalWidth,
38955   short ovalHeight) ;
38956 extern void
38957 PaintRoundRect(
38958   const Rect * r,
38959   short ovalWidth,
38960   short ovalHeight) ;
38961 extern void
38962 EraseRoundRect(
38963   const Rect * r,
38964   short ovalWidth,
38965   short ovalHeight) ;
38966 extern void
38967 InvertRoundRect(
38968   const Rect * r,
38969   short ovalWidth,
38970   short ovalHeight) ;
38971 extern void
38972 FillRoundRect(
38973   const Rect * r,
38974   short ovalWidth,
38975   short ovalHeight,
38976   const Pattern * pat) ;
38977 extern void
38978 FrameArc(
38979   const Rect * r,
38980   short startAngle,
38981   short arcAngle) ;
38982 extern void
38983 PaintArc(
38984   const Rect * r,
38985   short startAngle,
38986   short arcAngle) ;
38987 extern void
38988 EraseArc(
38989   const Rect * r,
38990   short startAngle,
38991   short arcAngle) ;
38992 extern void
38993 InvertArc(
38994   const Rect * r,
38995   short startAngle,
38996   short arcAngle) ;
38997 extern void
38998 FillArc(
38999   const Rect * r,
39000   short startAngle,
39001   short arcAngle,
39002   const Pattern * pat) ;
39003 extern RgnHandle
39004 NewRgn(void) ;
39005 extern void
39006 OpenRgn(void) ;
39007 extern void
39008 CloseRgn(RgnHandle dstRgn) ;
39009 extern OSErr
39010 BitMapToRegion(
39011   RgnHandle region,
39012   const BitMap * bMap) ;
39013 extern void
39014 HandleToRgn(
39015   Handle oldRegion,
39016   RgnHandle region) ;
39017 extern void
39018 RgnToHandle(
39019   RgnHandle region,
39020   Handle flattenedRgnDataHdl) ;
39021 extern void
39022 DisposeRgn(RgnHandle rgn) ;
39023 extern void
39024 CopyRgn(
39025   RgnHandle srcRgn,
39026   RgnHandle dstRgn) ;
39027 extern void
39028 SetEmptyRgn(RgnHandle rgn) ;
39029 extern void
39030 SetRectRgn(
39031   RgnHandle rgn,
39032   short left,
39033   short top,
39034   short right,
39035   short bottom) ;
39036 extern void
39037 RectRgn(
39038   RgnHandle rgn,
39039   const Rect * r) ;
39040 extern void
39041 OffsetRgn(
39042   RgnHandle rgn,
39043   short dh,
39044   short dv) ;
39045 extern void
39046 InsetRgn(
39047   RgnHandle rgn,
39048   short dh,
39049   short dv) ;
39050 extern void
39051 SectRgn(
39052   RgnHandle srcRgnA,
39053   RgnHandle srcRgnB,
39054   RgnHandle dstRgn) ;
39055 extern void
39056 UnionRgn(
39057   RgnHandle srcRgnA,
39058   RgnHandle srcRgnB,
39059   RgnHandle dstRgn) ;
39060 extern void
39061 DiffRgn(
39062   RgnHandle srcRgnA,
39063   RgnHandle srcRgnB,
39064   RgnHandle dstRgn) ;
39065 extern void
39066 XorRgn(
39067   RgnHandle srcRgnA,
39068   RgnHandle srcRgnB,
39069   RgnHandle dstRgn) ;
39070 extern Boolean
39071 RectInRgn(
39072   const Rect * r,
39073   RgnHandle rgn) ;
39074 extern Boolean
39075 EqualRgn(
39076   RgnHandle rgnA,
39077   RgnHandle rgnB) ;
39078 extern Boolean
39079 EmptyRgn(RgnHandle rgn) ;
39080 extern void
39081 FrameRgn(RgnHandle rgn) ;
39082 extern void
39083 PaintRgn(RgnHandle rgn) ;
39084 extern void
39085 EraseRgn(RgnHandle rgn) ;
39086 extern void
39087 InvertRgn(RgnHandle rgn) ;
39088 extern void
39089 FillRgn(
39090   RgnHandle rgn,
39091   const Pattern * pat) ;
39092 extern void
39093 ScrollRect(
39094   const Rect * r,
39095   short dh,
39096   short dv,
39097   RgnHandle updateRgn) ;
39098 extern void
39099 CopyBits(
39100   const BitMap * srcBits,
39101   const BitMap * dstBits,
39102   const Rect * srcRect,
39103   const Rect * dstRect,
39104   short mode,
39105   RgnHandle maskRgn) ;
39106 extern void
39107 SeedFill(
39108   const void * srcPtr,
39109   void * dstPtr,
39110   short srcRow,
39111   short dstRow,
39112   short height,
39113   short words,
39114   short seedH,
39115   short seedV) ;
39116 extern void
39117 CalcMask(
39118   const void * srcPtr,
39119   void * dstPtr,
39120   short srcRow,
39121   short dstRow,
39122   short height,
39123   short words) ;
39124 extern void
39125 CopyMask(
39126   const BitMap * srcBits,
39127   const BitMap * maskBits,
39128   const BitMap * dstBits,
39129   const Rect * srcRect,
39130   const Rect * maskRect,
39131   const Rect * dstRect) ;
39132 extern PicHandle
39133 OpenPicture(const Rect * picFrame) ;
39134 extern void
39135 PicComment(
39136   short kind,
39137   short dataSize,
39138   Handle dataHandle) ;
39139 extern void
39140 ClosePicture(void) ;
39141 extern void
39142 DrawPicture(
39143   PicHandle myPicture,
39144   const Rect * dstRect) ;
39145 extern void
39146 KillPicture(PicHandle myPicture) ;
39147 extern PolyHandle
39148 OpenPoly(void) ;
39149 extern void
39150 ClosePoly(void) ;
39151 extern void
39152 KillPoly(PolyHandle poly) ;
39153 extern void
39154 OffsetPoly(
39155   PolyHandle poly,
39156   short dh,
39157   short dv) ;
39158 extern void
39159 FramePoly(PolyHandle poly) ;
39160 extern void
39161 PaintPoly(PolyHandle poly) ;
39162 extern void
39163 ErasePoly(PolyHandle poly) ;
39164 extern void
39165 InvertPoly(PolyHandle poly) ;
39166 extern void
39167 FillPoly(
39168   PolyHandle poly,
39169   const Pattern * pat) ;
39170 extern void
39171 SetPt(
39172   Point * pt,
39173   short h,
39174   short v) ;
39175 extern void
39176 LocalToGlobal(Point * pt) ;
39177 extern void
39178 GlobalToLocal(Point * pt) ;
39179 extern short
39180 Random(void) ;
39181 extern void
39182 StuffHex(
39183   void * thingPtr,
39184   ConstStr255Param s) ;
39185 extern Boolean
39186 GetPixel(
39187   short h,
39188   short v) ;
39189 extern void
39190 ScalePt(
39191   Point * pt,
39192   const Rect * srcRect,
39193   const Rect * dstRect) ;
39194 extern void
39195 MapPt(
39196   Point * pt,
39197   const Rect * srcRect,
39198   const Rect * dstRect) ;
39199 extern void
39200 MapRect(
39201   Rect * r,
39202   const Rect * srcRect,
39203   const Rect * dstRect) ;
39204 extern void
39205 MapRgn(
39206   RgnHandle rgn,
39207   const Rect * srcRect,
39208   const Rect * dstRect) ;
39209 extern void
39210 MapPoly(
39211   PolyHandle poly,
39212   const Rect * srcRect,
39213   const Rect * dstRect) ;
39214 extern void
39215 SetStdProcs(QDProcs * procs) ;
39216 extern void
39217 StdRect(
39218   GrafVerb verb,
39219   const Rect * r) ;
39220 extern void
39221 StdRRect(
39222   GrafVerb verb,
39223   const Rect * r,
39224   short ovalWidth,
39225   short ovalHeight) ;
39226 extern void
39227 StdOval(
39228   GrafVerb verb,
39229   const Rect * r) ;
39230 extern void
39231 StdArc(
39232   GrafVerb verb,
39233   const Rect * r,
39234   short startAngle,
39235   short arcAngle) ;
39236 extern void
39237 StdPoly(
39238   GrafVerb verb,
39239   PolyHandle poly) ;
39240 extern void
39241 StdRgn(
39242   GrafVerb verb,
39243   RgnHandle rgn) ;
39244 extern void
39245 StdBits(
39246   const BitMap * srcBits,
39247   const Rect * srcRect,
39248   const Rect * dstRect,
39249   short mode,
39250   RgnHandle maskRgn) ;
39251 extern void
39252 StdComment(
39253   short kind,
39254   short dataSize,
39255   Handle dataHandle) ;
39256 extern void
39257 StdGetPic(
39258   void * dataPtr,
39259   short byteCount) ;
39260 extern void
39261 StdPutPic(
39262   const void * dataPtr,
39263   short byteCount) ;
39264 extern void
39265 StdOpcode(
39266   const Rect * fromRect,
39267   const Rect * toRect,
39268   UInt16 opcode,
39269   SInt16 version) ;
39270 extern void
39271 AddPt(
39272   Point src,
39273   Point * dst) ;
39274 extern Boolean
39275 EqualPt(
39276   Point pt1,
39277   Point pt2) ;
39278 extern Boolean
39279 PtInRect(
39280   Point pt,
39281   const Rect * r) ;
39282 extern void
39283 Pt2Rect(
39284   Point pt1,
39285   Point pt2,
39286   Rect * dstRect) ;
39287 extern void
39288 PtToAngle(
39289   const Rect * r,
39290   Point pt,
39291   short * angle) ;
39292 extern void
39293 SubPt(
39294   Point src,
39295   Point * dst) ;
39296 extern Boolean
39297 PtInRgn(
39298   Point pt,
39299   RgnHandle rgn) ;
39300 extern void
39301 StdLine(Point newPt) ;
39302 extern PixMapHandle
39303 NewPixMap(void) ;
39304 extern void
39305 DisposePixMap(PixMapHandle pm) ;
39306 extern void
39307 CopyPixMap(
39308   PixMapHandle srcPM,
39309   PixMapHandle dstPM) ;
39310 extern PixPatHandle
39311 NewPixPat(void) ;
39312 extern void
39313 DisposePixPat(PixPatHandle pp) ;
39314 extern void
39315 CopyPixPat(
39316   PixPatHandle srcPP,
39317   PixPatHandle dstPP) ;
39318 extern void
39319 PenPixPat(PixPatHandle pp) ;
39320 extern void
39321 BackPixPat(PixPatHandle pp) ;
39322 extern PixPatHandle
39323 GetPixPat(short patID) ;
39324 extern void
39325 MakeRGBPat(
39326   PixPatHandle pp,
39327   const RGBColor * myColor) ;
39328 extern void
39329 FillCRect(
39330   const Rect * r,
39331   PixPatHandle pp) ;
39332 extern void
39333 FillCOval(
39334   const Rect * r,
39335   PixPatHandle pp) ;
39336 extern void
39337 FillCRoundRect(
39338   const Rect * r,
39339   short ovalWidth,
39340   short ovalHeight,
39341   PixPatHandle pp) ;
39342 extern void
39343 FillCArc(
39344   const Rect * r,
39345   short startAngle,
39346   short arcAngle,
39347   PixPatHandle pp) ;
39348 extern void
39349 FillCRgn(
39350   RgnHandle rgn,
39351   PixPatHandle pp) ;
39352 extern void
39353 FillCPoly(
39354   PolyHandle poly,
39355   PixPatHandle pp) ;
39356 extern void
39357 RGBForeColor(const RGBColor * color) ;
39358 extern void
39359 RGBBackColor(const RGBColor * color) ;
39360 extern void
39361 SetCPixel(
39362   short h,
39363   short v,
39364   const RGBColor * cPix) ;
39365 extern void
39366 SetPortPix(PixMapHandle pm) ;
39367 extern void
39368 GetCPixel(
39369   short h,
39370   short v,
39371   RGBColor * cPix) ;
39372 extern void
39373 GetForeColor(RGBColor * color) ;
39374 extern void
39375 GetBackColor(RGBColor * color) ;
39376 extern void
39377 SeedCFill(
39378   const BitMap * srcBits,
39379   const BitMap * dstBits,
39380   const Rect * srcRect,
39381   const Rect * dstRect,
39382   short seedH,
39383   short seedV,
39384   ColorSearchUPP matchProc,
39385   long matchData) ;
39386 extern void
39387 CalcCMask(
39388   const BitMap * srcBits,
39389   const BitMap * dstBits,
39390   const Rect * srcRect,
39391   const Rect * dstRect,
39392   const RGBColor * seedRGB,
39393   ColorSearchUPP matchProc,
39394   long matchData) ;
39395 extern PicHandle
39396 OpenCPicture(const OpenCPicParams * newHeader) ;
39397 extern void
39398 OpColor(const RGBColor * color) ;
39399 extern void
39400 HiliteColor(const RGBColor * color) ;
39401 extern void
39402 DisposeCTable(CTabHandle cTable) ;
39403 extern CTabHandle
39404 GetCTable(short ctID) ;
39405 extern CCrsrHandle
39406 GetCCursor(short crsrID) ;
39407 extern void
39408 SetCCursor(CCrsrHandle cCrsr) ;
39409 extern void
39410 AllocCursor(void) ;
39411 extern void
39412 DisposeCCursor(CCrsrHandle cCrsr) ;
39413 extern void
39414 SetStdCProcs(CQDProcs * procs) ;
39415 extern GDHandle
39416 GetMaxDevice(const Rect * globalRect) ;
39417 extern long
39418 GetCTSeed(void) ;
39419 extern GDHandle
39420 GetDeviceList(void) ;
39421 extern GDHandle
39422 GetMainDevice(void) ;
39423 extern GDHandle
39424 GetNextDevice(GDHandle curDevice) ;
39425 extern Boolean
39426 TestDeviceAttribute(
39427   GDHandle gdh,
39428   short attribute) ;
39429 extern void
39430 SetDeviceAttribute(
39431   GDHandle gdh,
39432   short attribute,
39433   Boolean value) ;
39434 extern void
39435 InitGDevice(
39436   short qdRefNum,
39437   long mode,
39438   GDHandle gdh) ;
39439 extern GDHandle
39440 NewGDevice(
39441   short refNum,
39442   long mode) ;
39443 extern void
39444 DisposeGDevice(GDHandle gdh) ;
39445 extern void
39446 SetGDevice(GDHandle gd) ;
39447 extern GDHandle
39448 GetGDevice(void) ;
39449 extern long
39450 Color2Index(const RGBColor * myColor) ;
39451 extern void
39452 Index2Color(
39453   long index,
39454   RGBColor * aColor) ;
39455 extern void
39456 InvertColor(RGBColor * myColor) ;
39457 extern Boolean
39458 RealColor(const RGBColor * color) ;
39459 extern void
39460 GetSubTable(
39461   CTabHandle myColors,
39462   short iTabRes,
39463   CTabHandle targetTbl) ;
39464 extern void
39465 MakeITable(
39466   CTabHandle cTabH,
39467   ITabHandle iTabH,
39468   short res) ;
39469 extern void
39470 AddSearch(ColorSearchUPP searchProc) ;
39471 extern void
39472 AddComp(ColorComplementUPP compProc) ;
39473 extern void
39474 DelSearch(ColorSearchUPP searchProc) ;
39475 extern void
39476 DelComp(ColorComplementUPP compProc) ;
39477 extern void
39478 SetClientID(short id) ;
39479 extern void
39480 ProtectEntry(
39481   short index,
39482   Boolean protect) ;
39483 extern void
39484 ReserveEntry(
39485   short index,
39486   Boolean reserve) ;
39487 extern void
39488 SetEntries(
39489   short start,
39490   short count,
39491   CSpecArray aTable) ;
39492 extern void
39493 SaveEntries(
39494   CTabHandle srcTable,
39495   CTabHandle resultTable,
39496   ReqListRec * selection) ;
39497 extern void
39498 RestoreEntries(
39499   CTabHandle srcTable,
39500   CTabHandle dstTable,
39501   ReqListRec * selection) ;
39502 extern short
39503 QDError(void) ;
39504 extern void
39505 CopyDeepMask(
39506   const BitMap * srcBits,
39507   const BitMap * maskBits,
39508   const BitMap * dstBits,
39509   const Rect * srcRect,
39510   const Rect * maskRect,
39511   const Rect * dstRect,
39512   short mode,
39513   RgnHandle maskRgn) ;
39514 extern void
39515 DeviceLoop(
39516   RgnHandle drawingRgn,
39517   DeviceLoopDrawingUPP drawingProc,
39518   long userData,
39519   DeviceLoopFlags flags) ;
39520 extern Ptr
39521 GetMaskTable(void) ;
39522 extern PatHandle
39523 GetPattern(short patternID) ;
39524 extern CursHandle
39525 GetCursor(short cursorID) ;
39526 extern PicHandle
39527 GetPicture(short pictureID) ;
39528 extern long
39529 DeltaPoint(
39530   Point ptA,
39531   Point ptB) ;
39532 extern void
39533 ShieldCursor(
39534   const Rect * shieldRect,
39535   Point offsetPt) ;
39536 extern void
39537 ScreenRes(
39538   short * scrnHRes,
39539   short * scrnVRes) ;
39540 extern void
39541 GetIndPattern(
39542   Pattern * thePat,
39543   short patternListID,
39544   short index) ;
39545 extern long
39546 deltapoint(
39547   Point * ptA,
39548   Point * ptB) ;
39549 extern void
39550 PackBits(
39551   Ptr * srcPtr,
39552   Ptr * dstPtr,
39553   short srcBytes) ;
39554 extern void
39555 UnpackBits(
39556   Ptr * srcPtr,
39557   Ptr * dstPtr,
39558   short dstBytes) ;
39559 extern Fixed
39560 SlopeFromAngle(short angle) ;
39561 extern short
39562 AngleFromSlope(Fixed slope) ;
39563
39564
39565
39566 enum {
39567   colorXorXFer = 52,
39568   noiseXFer = 53,
39569   customXFer = 54
39570 };
39571
39572
39573 enum {
39574   kXFer1PixelAtATime = 0x00000001,
39575   kXFerConvertPixelToRGB32 = 0x00000002
39576 };
39577
39578 struct CustomXFerRec {
39579   UInt32 version;
39580   void * srcPixels;
39581   void * destPixels;
39582   void * resultPixels;
39583   UInt32 refCon;
39584   UInt32 pixelSize;
39585   UInt32 pixelCount;
39586   Point firstPixelHV;
39587   Rect destBounds;
39588 };
39589 typedef struct CustomXFerRec CustomXFerRec;
39590 typedef CustomXFerRec * CustomXFerRecPtr;
39591 typedef void ( * CustomXFerProcPtr)(CustomXFerRecPtr info);
39592 extern OSErr
39593 GetPortCustomXFerProc(
39594   CGrafPtr port,
39595   CustomXFerProcPtr * proc,
39596   UInt32 * flags,
39597   UInt32 * refCon) ;
39598 extern OSErr
39599 SetPortCustomXFerProc(
39600   CGrafPtr port,
39601   CustomXFerProcPtr proc,
39602   UInt32 flags,
39603   UInt32 refCon) ;
39604
39605
39606
39607 enum {
39608   kCursorComponentsVersion = 0x00010001
39609 };
39610
39611 enum {
39612   kCursorComponentType = 'curs'
39613 };
39614
39615
39616 enum {
39617   cursorDoesAnimate = 1L << 0,
39618   cursorDoesHardware = 1L << 1,
39619   cursorDoesUnreadableScreenBits = 1L << 2
39620 };
39621
39622
39623 enum {
39624   kRenderCursorInHardware = 1L << 0,
39625   kRenderCursorInSoftware = 1L << 1
39626 };
39627
39628
39629 struct CursorInfo {
39630   long version;
39631   long capabilities;
39632   long animateDuration;
39633   Rect bounds;
39634   Point hotspot;
39635   long reserved;
39636
39637 };
39638 typedef struct CursorInfo CursorInfo;
39639
39640 enum {
39641   kCursorComponentInit = 0x0001,
39642   kCursorComponentGetInfo = 0x0002,
39643   kCursorComponentSetOutputMode = 0x0003,
39644   kCursorComponentSetData = 0x0004,
39645   kCursorComponentReconfigure = 0x0005,
39646   kCursorComponentDraw = 0x0006,
39647   kCursorComponentErase = 0x0007,
39648   kCursorComponentMove = 0x0008,
39649   kCursorComponentAnimate = 0x0009,
39650   kCursorComponentLastReserved = 0x0050
39651 };
39652 extern OSErr
39653 OpenCursorComponent(
39654   Component c,
39655   ComponentInstance * ci) ;
39656 extern OSErr
39657 CloseCursorComponent(ComponentInstance ci) ;
39658 extern OSErr
39659 SetCursorComponent(ComponentInstance ci) ;
39660 extern OSErr
39661 CursorComponentChanged(ComponentInstance ci) ;
39662 extern OSErr
39663 CursorComponentSetData(
39664   ComponentInstance ci,
39665   long data) ;
39666 extern CMError
39667 CWMatchPixMap(
39668   CMWorldRef cw,
39669   PixMap * myPixMap,
39670   CMBitmapCallBackUPP progressProc,
39671   void * refCon) ;
39672 extern CMError
39673 CWCheckPixMap(
39674   CMWorldRef cw,
39675   PixMap * myPixMap,
39676   CMBitmapCallBackUPP progressProc,
39677   void * refCon,
39678   BitMap * resultBitMap) ;
39679 extern CMError
39680 NCMBeginMatching(
39681   CMProfileRef src,
39682   CMProfileRef dst,
39683   CMMatchRef * myRef) ;
39684 extern void
39685 CMEndMatching(CMMatchRef myRef) ;
39686 extern void
39687 NCMDrawMatchedPicture(
39688   PicHandle myPicture,
39689   CMProfileRef dst,
39690   Rect * myRect) ;
39691 extern void
39692 CMEnableMatchingComment(Boolean enableIt) ;
39693 extern CMError
39694 NCMUseProfileComment(
39695   CMProfileRef prof,
39696   UInt32 flags) ;
39697 extern Boolean
39698 IsValidPort(CGrafPtr port) ;
39699 extern PixMapHandle
39700 GetPortPixMap(CGrafPtr port) ;
39701 extern const BitMap *
39702 GetPortBitMapForCopyBits(CGrafPtr port) ;
39703 extern Rect *
39704 GetPortBounds(
39705   CGrafPtr port,
39706   Rect * rect) ;
39707 extern RGBColor *
39708 GetPortForeColor(
39709   CGrafPtr port,
39710   RGBColor * foreColor) ;
39711 extern RGBColor *
39712 GetPortBackColor(
39713   CGrafPtr port,
39714   RGBColor * backColor) ;
39715 extern RGBColor *
39716 GetPortOpColor(
39717   CGrafPtr port,
39718   RGBColor * opColor) ;
39719 extern RGBColor *
39720 GetPortHiliteColor(
39721   CGrafPtr port,
39722   RGBColor * hiliteColor) ;
39723 extern CQDProcsPtr
39724 GetPortGrafProcs(CGrafPtr port) ;
39725 extern short
39726 GetPortTextFont(CGrafPtr port) ;
39727 extern Style
39728 GetPortTextFace(CGrafPtr port) ;
39729 extern short
39730 GetPortTextMode(CGrafPtr port) ;
39731 extern short
39732 GetPortTextSize(CGrafPtr port) ;
39733 extern short
39734 GetPortChExtra(CGrafPtr port) ;
39735 extern short
39736 GetPortFracHPenLocation(CGrafPtr port) ;
39737 extern Fixed
39738 GetPortSpExtra(CGrafPtr port) ;
39739 extern short
39740 GetPortPenVisibility(CGrafPtr port) ;
39741 extern RgnHandle
39742 GetPortVisibleRegion(
39743   CGrafPtr port,
39744   RgnHandle visRgn) ;
39745 extern RgnHandle
39746 GetPortClipRegion(
39747   CGrafPtr port,
39748   RgnHandle clipRgn) ;
39749 extern PixPatHandle
39750 GetPortBackPixPat(
39751   CGrafPtr port,
39752   PixPatHandle backPattern) ;
39753 extern PixPatHandle
39754 GetPortPenPixPat(
39755   CGrafPtr port,
39756   PixPatHandle penPattern) ;
39757 extern PixPatHandle
39758 GetPortFillPixPat(
39759   CGrafPtr port,
39760   PixPatHandle fillPattern) ;
39761 extern Point *
39762 GetPortPenSize(
39763   CGrafPtr port,
39764   Point * penSize) ;
39765 extern SInt32
39766 GetPortPenMode(CGrafPtr port) ;
39767 extern Point *
39768 GetPortPenLocation(
39769   CGrafPtr port,
39770   Point * penLocation) ;
39771 extern Boolean
39772 IsPortRegionBeingDefined(CGrafPtr port) ;
39773 extern Boolean
39774 IsPortPictureBeingDefined(CGrafPtr port) ;
39775 extern Boolean
39776 IsPortPolyBeingDefined(CGrafPtr port) ;
39777 extern Boolean
39778 IsPortOffscreen(CGrafPtr port) ;
39779 extern Boolean
39780 IsPortColor(CGrafPtr port) ;
39781 extern Boolean
39782 IsPortVisibleRegionEmpty(CGrafPtr port) ;
39783 extern Boolean
39784 IsPortClipRegionEmpty(CGrafPtr port) ;
39785 extern void
39786 SectRegionWithPortClipRegion(
39787   CGrafPtr port,
39788   RgnHandle ioRegion) ;
39789 extern void
39790 SectRegionWithPortVisibleRegion(
39791   CGrafPtr port,
39792   RgnHandle ioRegion) ;
39793 extern Handle
39794 SwapPortPicSaveHandle(
39795   CGrafPtr port,
39796   Handle inPicSaveHdl) ;
39797 extern Handle
39798 SwapPortPolySaveHandle(
39799   CGrafPtr port,
39800   Handle inPolySaveHdl) ;
39801 extern Handle
39802 SwapPortRegionSaveHandle(
39803   CGrafPtr port,
39804   Handle inRegionSaveHdl) ;
39805 extern void
39806 SetPortBounds(
39807   CGrafPtr port,
39808   const Rect * rect) ;
39809 extern void
39810 SetPortOpColor(
39811   CGrafPtr port,
39812   const RGBColor * opColor) ;
39813 extern void
39814 SetPortGrafProcs(
39815   CGrafPtr port,
39816   CQDProcsPtr procs) ;
39817 extern void
39818 SetPortTextFont(
39819   CGrafPtr port,
39820   short txFont) ;
39821 extern void
39822 SetPortTextSize(
39823   CGrafPtr port,
39824   short txSize) ;
39825 extern void
39826 SetPortTextFace(
39827   CGrafPtr port,
39828   StyleParameter face) ;
39829 extern void
39830 SetPortTextMode(
39831   CGrafPtr port,
39832   short mode) ;
39833 extern void
39834 SetPortVisibleRegion(
39835   CGrafPtr port,
39836   RgnHandle visRgn) ;
39837 extern void
39838 SetPortClipRegion(
39839   CGrafPtr port,
39840   RgnHandle clipRgn) ;
39841 extern void
39842 SetPortPenPixPat(
39843   CGrafPtr port,
39844   PixPatHandle penPattern) ;
39845 extern void
39846 SetPortFillPixPat(
39847   CGrafPtr port,
39848   PixPatHandle penPattern) ;
39849 extern void
39850 SetPortBackPixPat(
39851   CGrafPtr port,
39852   PixPatHandle backPattern) ;
39853 extern void
39854 SetPortPenSize(
39855   CGrafPtr port,
39856   Point penSize) ;
39857 extern void
39858 SetPortPenMode(
39859   CGrafPtr port,
39860   SInt32 penMode) ;
39861 extern void
39862 SetPortFracHPenLocation(
39863   CGrafPtr port,
39864   short pnLocHFrac) ;
39865 extern Rect *
39866 GetPixBounds(
39867   PixMapHandle pixMap,
39868   Rect * bounds) ;
39869 extern short
39870 GetPixDepth(PixMapHandle pixMap) ;
39871 extern long
39872 GetQDGlobalsRandomSeed(void) ;
39873 extern BitMap *
39874 GetQDGlobalsScreenBits(BitMap * screenBits) ;
39875 extern Cursor *
39876 GetQDGlobalsArrow(Cursor * arrow) ;
39877 extern Pattern *
39878 GetQDGlobalsDarkGray(Pattern * dkGray) ;
39879 extern Pattern *
39880 GetQDGlobalsLightGray(Pattern * ltGray) ;
39881 extern Pattern *
39882 GetQDGlobalsGray(Pattern * gray) ;
39883 extern Pattern *
39884 GetQDGlobalsBlack(Pattern * black) ;
39885 extern Pattern *
39886 GetQDGlobalsWhite(Pattern * white) ;
39887 extern CGrafPtr
39888 GetQDGlobalsThePort(void) ;
39889 extern void
39890 SetQDGlobalsRandomSeed(long randomSeed) ;
39891 extern void
39892 SetQDGlobalsArrow(const Cursor * arrow) ;
39893 extern Rect *
39894 GetRegionBounds(
39895   RgnHandle region,
39896   Rect * bounds) ;
39897 extern Boolean
39898 IsRegionRectangular(RgnHandle region) ;
39899 extern CGrafPtr
39900 CreateNewPort(void) ;
39901 extern void
39902 DisposePort(CGrafPtr port) ;
39903 extern void
39904 SetQDError(OSErr err) ;
39905 extern Point *
39906 QDLocalToGlobalPoint(
39907   CGrafPtr port,
39908   Point * point) ;
39909 extern Point *
39910 QDGlobalToLocalPoint(
39911   CGrafPtr port,
39912   Point * point) ;
39913 extern Rect *
39914 QDLocalToGlobalRect(
39915   CGrafPtr port,
39916   Rect * bounds) ;
39917 extern Rect *
39918 QDGlobalToLocalRect(
39919   CGrafPtr port,
39920   Rect * bounds) ;
39921 extern RgnHandle
39922 QDLocalToGlobalRegion(
39923   CGrafPtr port,
39924   RgnHandle region) ;
39925 extern RgnHandle
39926 QDGlobalToLocalRegion(
39927   CGrafPtr port,
39928   RgnHandle region) ;
39929 extern Boolean
39930 QDIsPortBuffered(CGrafPtr port) ;
39931 extern Boolean
39932 QDIsPortBufferDirty(CGrafPtr port) ;
39933 extern void
39934 QDFlushPortBuffer(
39935   CGrafPtr port,
39936   RgnHandle region) ;
39937 extern OSStatus
39938 QDGetDirtyRegion(
39939   CGrafPtr port,
39940   RgnHandle rgn) ;
39941 extern OSStatus
39942 QDSetDirtyRegion(
39943   CGrafPtr port,
39944   RgnHandle rgn) ;
39945 extern OSStatus
39946 QDAddRectToDirtyRegion(
39947   CGrafPtr inPort,
39948   const Rect * inBounds) ;
39949 extern OSStatus
39950 QDAddRegionToDirtyRegion(
39951   CGrafPtr inPort,
39952   RgnHandle inRegion) ;
39953 extern OSStatus
39954 CreateCGContextForPort(
39955   CGrafPtr inPort,
39956   CGContextRef * outContext) ;
39957 extern OSStatus
39958 ClipCGContextToRegion(
39959   CGContextRef gc,
39960   const Rect * portRect,
39961   RgnHandle region) ;
39962 extern OSStatus
39963 SyncCGContextOriginWithPort(
39964   CGContextRef inContext,
39965   CGrafPtr port) ;
39966 extern OSStatus
39967 QDBeginCGContext(
39968   CGrafPtr inPort,
39969   CGContextRef * outContext) ;
39970 extern OSStatus
39971 QDEndCGContext(
39972   CGrafPtr inPort,
39973   CGContextRef * inoutContext) ;
39974 typedef struct OpaqueQDRegionBitsRef* QDRegionBitsRef;
39975 extern QDRegionBitsRef
39976 QDSaveRegionBits(RgnHandle region) ;
39977 extern OSStatus
39978 QDRestoreRegionBits(
39979   RgnHandle region,
39980   QDRegionBitsRef regionBits) ;
39981 extern OSStatus
39982 QDDisposeRegionBits(QDRegionBitsRef regionBits) ;
39983 extern CGrafPtr
39984 CreateNewPortForCGDisplayID(UInt32 inCGDisplayID) ;
39985 extern void
39986 QDDisplayWaitCursor(Boolean forceWaitCursor) ;
39987 extern void
39988 QDSetPatternOrigin(Point origin) ;
39989 extern void
39990 QDGetPatternOrigin(Point * origin) ;
39991 extern Boolean
39992 QDIsNamedPixMapCursorRegistered(const char name[128]) ;
39993 extern OSStatus
39994 QDRegisterNamedPixMapCursor(
39995   PixMapHandle crsrData,
39996   PixMapHandle crsrMask,
39997   Point hotSpot,
39998   const char name[128]) ;
39999 extern OSStatus
40000 QDUnregisterNamedPixMapCursur(const char name[128]) ;
40001 extern OSStatus
40002 QDSetNamedPixMapCursor(const char name[128]) ;
40003 extern OSStatus
40004 QDSetCursorScale(float scale) ;
40005
40006
40007
40008
40009 enum {
40010   kQDUseDefaultTextRendering = 0,
40011
40012   kQDUseTrueTypeScalerGlyphs = (1 << 0),
40013   kQDUseCGTextRendering = (1 << 1),
40014   kQDUseCGTextMetrics = (1 << 2),
40015   kQDSupportedFlags = kQDUseTrueTypeScalerGlyphs | kQDUseCGTextRendering | kQDUseCGTextMetrics,
40016   kQDDontChangeFlags = (long)0xFFFFFFFF
40017 };
40018 extern UInt32
40019 QDSwapTextFlags(UInt32 newFlags) ;
40020 extern UInt32
40021 QDSwapPortTextFlags(
40022   CGrafPtr port,
40023   UInt32 newFlags) ;
40024 extern SInt16
40025 LMGetScrVRes(void) ;
40026 extern void
40027 LMSetScrVRes(SInt16 value) ;
40028 extern SInt16
40029 LMGetScrHRes(void) ;
40030 extern void
40031 LMSetScrHRes(SInt16 value) ;
40032 extern GDHandle
40033 LMGetMainDevice(void) ;
40034 extern void
40035 LMSetMainDevice(GDHandle value) ;
40036 extern GDHandle
40037 LMGetDeviceList(void) ;
40038 extern void
40039 LMSetDeviceList(GDHandle value) ;
40040 extern Handle
40041 LMGetQDColors(void) ;
40042 extern void
40043 LMSetQDColors(Handle value) ;
40044 extern Handle
40045 LMGetWidthListHand(void) ;
40046 extern void
40047 LMSetWidthListHand(Handle value) ;
40048 extern UInt8
40049 LMGetHiliteMode(void) ;
40050 extern void
40051 LMSetHiliteMode(UInt8 value) ;
40052 extern Ptr
40053 LMGetWidthPtr(void) ;
40054 extern void
40055 LMSetWidthPtr(Ptr value) ;
40056 extern Handle
40057 LMGetWidthTabHandle(void) ;
40058 extern void
40059 LMSetWidthTabHandle(Handle value) ;
40060 extern SInt32
40061 LMGetLastSPExtra(void) ;
40062 extern void
40063 LMSetLastSPExtra(SInt32 value) ;
40064 extern Handle
40065 LMGetLastFOND(void) ;
40066 extern void
40067 LMSetLastFOND(Handle value) ;
40068 extern UInt8
40069 LMGetFractEnable(void) ;
40070 extern void
40071 LMSetFractEnable(UInt8 value) ;
40072 extern GDHandle
40073 LMGetTheGDevice(void) ;
40074 extern void
40075 LMSetTheGDevice(GDHandle value) ;
40076 extern void
40077 LMGetHiliteRGB(RGBColor * hiliteRGBValue) ;
40078 extern void
40079 LMSetHiliteRGB(const RGBColor * hiliteRGBValue) ;
40080 extern Boolean
40081 LMGetCursorNew(void) ;
40082 extern void
40083 LMSetCursorNew(Boolean value) ;
40084
40085
40086 }
40087
40088
40089
40090 extern "C" {
40091
40092
40093 enum {
40094   pixPurgeBit = 0,
40095   noNewDeviceBit = 1,
40096   useTempMemBit = 2,
40097   keepLocalBit = 3,
40098   useDistantHdwrMemBit = 4,
40099   useLocalHdwrMemBit = 5,
40100   pixelsPurgeableBit = 6,
40101   pixelsLockedBit = 7,
40102   mapPixBit = 16,
40103   newDepthBit = 17,
40104   alignPixBit = 18,
40105   newRowBytesBit = 19,
40106   reallocPixBit = 20,
40107   clipPixBit = 28,
40108   stretchPixBit = 29,
40109   ditherPixBit = 30,
40110   gwFlagErrBit = 31
40111 };
40112
40113 enum {
40114   pixPurge = 1L << pixPurgeBit,
40115   noNewDevice = 1L << noNewDeviceBit,
40116   useTempMem = 1L << useTempMemBit,
40117   keepLocal = 1L << keepLocalBit,
40118   useDistantHdwrMem = 1L << useDistantHdwrMemBit,
40119   useLocalHdwrMem = 1L << useLocalHdwrMemBit,
40120   pixelsPurgeable = 1L << pixelsPurgeableBit,
40121   pixelsLocked = 1L << pixelsLockedBit,
40122   kAllocDirectDrawSurface = 1L << 14,
40123   mapPix = 1L << mapPixBit,
40124   newDepth = 1L << newDepthBit,
40125   alignPix = 1L << alignPixBit,
40126   newRowBytes = 1L << newRowBytesBit,
40127   reallocPix = 1L << reallocPixBit,
40128   clipPix = 1L << clipPixBit,
40129   stretchPix = 1L << stretchPixBit,
40130   ditherPix = 1L << ditherPixBit,
40131   gwFlagErr = 1L << gwFlagErrBit
40132 };
40133
40134 typedef unsigned long GWorldFlags;
40135
40136 typedef CGrafPtr GWorldPtr;
40137 extern QDErr
40138 NewGWorld(
40139   GWorldPtr * offscreenGWorld,
40140   short PixelDepth,
40141   const Rect * boundsRect,
40142   CTabHandle cTable,
40143   GDHandle aGDevice,
40144   GWorldFlags flags) ;
40145
40146
40147
40148 enum {
40149   deviceIsIndirect = (1L << 0),
40150   deviceNeedsLock = (1L << 1),
40151   deviceIsStatic = (1L << 2),
40152   deviceIsExternalBuffer = (1L << 3),
40153   deviceIsDDSurface = (1L << 4),
40154   deviceIsDCISurface = (1L << 5),
40155   deviceIsGDISurface = (1L << 6),
40156   deviceIsAScreen = (1L << 7),
40157   deviceIsOverlaySurface = (1L << 8)
40158 };
40159 extern QDErr
40160 NewGWorldFromPtr(
40161   GWorldPtr * offscreenGWorld,
40162   unsigned long PixelFormat,
40163   const Rect * boundsRect,
40164   CTabHandle cTable,
40165   GDHandle aGDevice,
40166   GWorldFlags flags,
40167   Ptr newBuffer,
40168   long rowBytes) ;
40169 extern Boolean
40170 LockPixels(PixMapHandle pm) ;
40171 extern void
40172 UnlockPixels(PixMapHandle pm) ;
40173 extern GWorldFlags
40174 UpdateGWorld(
40175   GWorldPtr * offscreenGWorld,
40176   short pixelDepth,
40177   const Rect * boundsRect,
40178   CTabHandle cTable,
40179   GDHandle aGDevice,
40180   GWorldFlags flags) ;
40181 extern void
40182 DisposeGWorld(GWorldPtr offscreenGWorld) ;
40183 extern void
40184 GetGWorld(
40185   CGrafPtr * port,
40186   GDHandle * gdh) ;
40187 extern void
40188 SetGWorld(
40189   CGrafPtr port,
40190   GDHandle gdh) ;
40191 extern void
40192 CTabChanged(CTabHandle ctab) ;
40193 extern void
40194 PixPatChanged(PixPatHandle ppat) ;
40195 extern void
40196 PortChanged(GrafPtr port) ;
40197 extern void
40198 GDeviceChanged(GDHandle gdh) ;
40199 extern void
40200 AllowPurgePixels(PixMapHandle pm) ;
40201 extern void
40202 NoPurgePixels(PixMapHandle pm) ;
40203 extern GWorldFlags
40204 GetPixelsState(PixMapHandle pm) ;
40205 extern void
40206 SetPixelsState(
40207   PixMapHandle pm,
40208   GWorldFlags state) ;
40209 extern Ptr
40210 GetPixBaseAddr(PixMapHandle pm) ;
40211 extern long
40212 GetPixRowBytes(PixMapHandle pm) ;
40213 extern QDErr
40214 NewScreenBuffer(
40215   const Rect * globalRect,
40216   Boolean purgeable,
40217   GDHandle * gdh,
40218   PixMapHandle * offscreenPixMap) ;
40219 extern void
40220 DisposeScreenBuffer(PixMapHandle offscreenPixMap) ;
40221 extern GDHandle
40222 GetGWorldDevice(GWorldPtr offscreenGWorld) ;
40223 extern Boolean
40224 QDDone(GrafPtr port) ;
40225 extern long
40226 OffscreenVersion(void) ;
40227 extern QDErr
40228 NewTempScreenBuffer(
40229   const Rect * globalRect,
40230   Boolean purgeable,
40231   GDHandle * gdh,
40232   PixMapHandle * offscreenPixMap) ;
40233 extern Boolean
40234 PixMap32Bit(PixMapHandle pmHandle) ;
40235 extern PixMapHandle
40236 GetGWorldPixMap(GWorldPtr offscreenGWorld) ;
40237
40238
40239
40240
40241 }
40242
40243
40244
40245 extern "C" {
40246
40247
40248 typedef struct QDPict* QDPictRef;
40249 extern QDPictRef
40250 QDPictCreateWithProvider(CGDataProviderRef provider) ;
40251 extern QDPictRef
40252 QDPictCreateWithURL(CFURLRef url) ;
40253 extern QDPictRef
40254 QDPictRetain(QDPictRef pictRef) ;
40255 extern void
40256 QDPictRelease(QDPictRef pictRef) ;
40257 extern CGRect
40258 QDPictGetBounds(QDPictRef pictRef) ;
40259 extern void
40260 QDPictGetResolution(
40261   QDPictRef pictRef,
40262   float * xRes,
40263   float * yRes) ;
40264 extern OSStatus
40265 QDPictDrawToCGContext(
40266   CGContextRef ctx,
40267   CGRect rect,
40268   QDPictRef pictRef) ;
40269
40270
40271
40272
40273 }
40274
40275
40276
40277
40278
40279
40280
40281 extern "C" {
40282
40283
40284
40285 enum {
40286   systemFont = 0,
40287   applFont = 1
40288 };
40289
40290 enum {
40291   kFMDefaultOptions = kNilOptions
40292 };
40293
40294
40295 enum {
40296   kFMDefaultActivationContext = kFMDefaultOptions,
40297   kFMGlobalActivationContext = 0x00000001,
40298   kFMLocalActivationContext = kFMDefaultActivationContext
40299 };
40300
40301
40302 enum {
40303   kFMDefaultIterationScope = kFMDefaultOptions,
40304   kFMGlobalIterationScope = 0x00000001,
40305   kFMLocalIterationScope = kFMDefaultIterationScope
40306 };
40307
40308
40309
40310 enum {
40311   kPlatformDefaultGuiFontID = applFont
40312 };
40313
40314 enum {
40315   commandMark = 17,
40316   checkMark = 18,
40317   diamondMark = 19,
40318   appleMark = 20
40319 };
40320
40321 enum {
40322   propFont = 36864L,
40323   prpFntH = 36865L,
40324   prpFntW = 36866L,
40325   prpFntHW = 36867L,
40326   fixedFont = 45056L,
40327   fxdFntH = 45057L,
40328   fxdFntW = 45058L,
40329   fxdFntHW = 45059L,
40330   fontWid = 44208L
40331 };
40332
40333 struct FMInput {
40334   short family;
40335   short size;
40336   Style face;
40337   Boolean needBits;
40338   short device;
40339   Point numer;
40340   Point denom;
40341 };
40342 typedef struct FMInput FMInput;
40343 struct FMOutput {
40344   short errNum;
40345   Handle fontHandle;
40346   UInt8 boldPixels;
40347   UInt8 italicPixels;
40348   UInt8 ulOffset;
40349   UInt8 ulShadow;
40350   UInt8 ulThick;
40351   UInt8 shadowPixels;
40352   SInt8 extra;
40353   UInt8 ascent;
40354   UInt8 descent;
40355   UInt8 widMax;
40356   SInt8 leading;
40357   SInt8 curStyle;
40358   Point numer;
40359   Point denom;
40360 };
40361 typedef struct FMOutput FMOutput;
40362 typedef FMOutput * FMOutputPtr;
40363 typedef FMOutputPtr FMOutPtr;
40364 struct FMetricRec {
40365   Fixed ascent;
40366   Fixed descent;
40367   Fixed leading;
40368   Fixed widMax;
40369   Handle wTabHandle;
40370 };
40371 typedef struct FMetricRec FMetricRec;
40372 typedef FMetricRec * FMetricRecPtr;
40373 typedef FMetricRecPtr * FMetricRecHandle;
40374 extern void
40375 GetFontName(
40376   short familyID,
40377   Str255 name) ;
40378 extern void
40379 GetFNum(
40380   ConstStr255Param name,
40381   short * familyID) ;
40382 extern Boolean
40383 RealFont(
40384   short fontNum,
40385   short size) ;
40386 extern FMOutPtr
40387 FMSwapFont(const FMInput * inRec) ;
40388 extern void
40389 SetFScaleDisable(Boolean fscaleDisable) ;
40390 extern void
40391 FontMetrics(FMetricRecPtr theMetrics) ;
40392 extern void
40393 SetFractEnable(Boolean fractEnable) ;
40394 extern short
40395 GetDefFontSize(void) ;
40396 extern Boolean
40397 IsOutline(
40398   Point numer,
40399   Point denom) ;
40400 extern void
40401 SetOutlinePreferred(Boolean outlinePreferred) ;
40402 extern Boolean
40403 GetOutlinePreferred(void) ;
40404 extern OSErr
40405 OutlineMetrics(
40406   short byteCount,
40407   const void * textPtr,
40408   Point numer,
40409   Point denom,
40410   short * yMax,
40411   short * yMin,
40412   FixedPtr awArray,
40413   FixedPtr lsbArray,
40414   RectPtr boundsArray) ;
40415 extern void
40416 SetPreserveGlyph(Boolean preserveGlyph) ;
40417 extern Boolean
40418 GetPreserveGlyph(void) ;
40419 extern short
40420 GetSysFont(void) ;
40421 extern short
40422 GetAppFont(void) ;
40423 extern OSStatus
40424 SetAntiAliasedTextEnabled(
40425   Boolean iEnable,
40426   SInt16 iMinFontSize) ;
40427 extern Boolean
40428 IsAntiAliasedTextEnabled(SInt16 * oMinFontSize) ;
40429 extern void
40430 QDTextBounds(
40431   short byteCount,
40432   const void * textAddr,
40433   Rect * bounds) ;
40434 extern OSErr
40435 FetchFontInfo(
40436   SInt16 fontID,
40437   SInt16 fontSize,
40438   SInt16 fontStyle,
40439   FontInfo * info) ;
40440 extern OSStatus
40441 FMCreateFontFamilyIterator(
40442   const FMFilter * iFilter,
40443   void * iRefCon,
40444   OptionBits iOptions,
40445   FMFontFamilyIterator * ioIterator) ;
40446 extern OSStatus
40447 FMDisposeFontFamilyIterator(FMFontFamilyIterator * ioIterator) ;
40448 extern OSStatus
40449 FMResetFontFamilyIterator(
40450   const FMFilter * iFilter,
40451   void * iRefCon,
40452   OptionBits iOptions,
40453   FMFontFamilyIterator * ioIterator) ;
40454 extern OSStatus
40455 FMGetNextFontFamily(
40456   FMFontFamilyIterator * ioIterator,
40457   FMFontFamily * oFontFamily) ;
40458 extern OSStatus
40459 FMCreateFontIterator(
40460   const FMFilter * iFilter,
40461   void * iRefCon,
40462   OptionBits iOptions,
40463   FMFontIterator * ioIterator) ;
40464 extern OSStatus
40465 FMDisposeFontIterator(FMFontIterator * ioIterator) ;
40466 extern OSStatus
40467 FMResetFontIterator(
40468   const FMFilter * iFilter,
40469   void * iRefCon,
40470   OptionBits iOptions,
40471   FMFontIterator * ioIterator) ;
40472 extern OSStatus
40473 FMGetNextFont(
40474   FMFontIterator * ioIterator,
40475   FMFont * oFont) ;
40476 extern OSStatus
40477 FMCreateFontFamilyInstanceIterator(
40478   FMFontFamily iFontFamily,
40479   FMFontFamilyInstanceIterator * ioIterator) ;
40480 extern OSStatus
40481 FMDisposeFontFamilyInstanceIterator(FMFontFamilyInstanceIterator * ioIterator) ;
40482 extern OSStatus
40483 FMResetFontFamilyInstanceIterator(
40484   FMFontFamily iFontFamily,
40485   FMFontFamilyInstanceIterator * ioIterator) ;
40486 extern OSStatus
40487 FMGetNextFontFamilyInstance(
40488   FMFontFamilyInstanceIterator * ioIterator,
40489   FMFont * oFont,
40490   FMFontStyle * oStyle,
40491   FMFontSize * oSize) ;
40492 extern FMFontFamily
40493 FMGetFontFamilyFromName(ConstStr255Param iName) ;
40494 extern OSStatus
40495 FMGetFontFamilyName(
40496   FMFontFamily iFontFamily,
40497   Str255 oName) ;
40498 extern OSStatus
40499 FMGetFontFamilyTextEncoding(
40500   FMFontFamily iFontFamily,
40501   TextEncoding * oTextEncoding) ;
40502 extern OSStatus
40503 FMGetFontFamilyGeneration(
40504   FMFontFamily iFontFamily,
40505   FMGeneration * oGeneration) ;
40506 extern OSStatus
40507 FMGetFontFormat(
40508   FMFont iFont,
40509   FourCharCode * oFormat) ;
40510 extern OSStatus
40511 FMGetFontTableDirectory(
40512   FMFont iFont,
40513   ByteCount iLength,
40514   void * iBuffer,
40515   ByteCount * oActualLength) ;
40516 extern OSStatus
40517 FMGetFontTable(
40518   FMFont iFont,
40519   FourCharCode iTag,
40520   ByteOffset iOffset,
40521   ByteCount iLength,
40522   void * iBuffer,
40523   ByteCount * oActualLength) ;
40524 extern OSStatus
40525 FMGetFontGeneration(
40526   FMFont iFont,
40527   FMGeneration * oGeneration) ;
40528 extern OSStatus
40529 FMGetFontContainer(
40530   FMFont iFont,
40531   FSSpec * oFontContainer) ;
40532 extern OSStatus
40533 FMGetFontFromFontFamilyInstance(
40534   FMFontFamily iFontFamily,
40535   FMFontStyle iStyle,
40536   FMFont * oFont,
40537   FMFontStyle * oIntrinsicStyle) ;
40538 extern OSStatus
40539 FMGetFontFamilyInstanceFromFont(
40540   FMFont iFont,
40541   FMFontFamily * oFontFamily,
40542   FMFontStyle * oStyle) ;
40543 extern ATSFontRef
40544 FMGetATSFontRefFromFont(FMFont iFont) ;
40545 extern ATSFontFamilyRef
40546 FMGetATSFontFamilyRefFromFontFamily(FMFontFamily iFamily) ;
40547 extern FMFont
40548 FMGetFontFromATSFontRef(ATSFontRef iFont) ;
40549 extern FMFontFamily
40550 FMGetFontFamilyFromATSFontFamilyRef(ATSFontFamilyRef iFamily) ;
40551 extern OSStatus
40552 FMActivateFonts(
40553   const FSSpec * iFontContainer,
40554   const FMFilter * iFilter,
40555   void * iRefCon,
40556   OptionBits iOptions) ;
40557 extern OSStatus
40558 FMDeactivateFonts(
40559   const FSSpec * iFontContainer,
40560   const FMFilter * iFilter,
40561   void * iRefCon,
40562   OptionBits iOptions) ;
40563 extern FMGeneration
40564 FMGetGeneration(void) ;
40565 extern OSStatus
40566 FMGetFontContainerFromFontFamilyInstance(
40567   FMFontFamily iFontFamily,
40568   FMFontStyle iStyle,
40569   FMFontSize iFontSize,
40570   FSSpec * oFontContainer) ;
40571 extern OSStatus
40572 FMGetFontFamilyResource(
40573   FMFontFamily iFontFamily,
40574   FMFontStyle iFontStyle,
40575   FMFontSize iFontSize,
40576   ByteCount iBufferSize,
40577   void * ioBuffer,
40578   ByteCount * oSize) ;
40579
40580
40581
40582 typedef FMFontFamily FontFamilyID;
40583 typedef FMFontSize FontPointSize;
40584
40585
40586
40587
40588
40589
40590 enum {
40591   kFMUseGlobalScopeOption = 0x00000001
40592 };
40593
40594 enum {
40595   kFontIDNewYork = 2,
40596   kFontIDGeneva = 3,
40597   kFontIDMonaco = 4,
40598   kFontIDVenice = 5,
40599   kFontIDLondon = 6,
40600   kFontIDAthens = 7,
40601   kFontIDSanFrancisco = 8,
40602   kFontIDToronto = 9,
40603   kFontIDCairo = 11,
40604   kFontIDLosAngeles = 12,
40605   kFontIDTimes = 20,
40606   kFontIDHelvetica = 21,
40607   kFontIDCourier = 22,
40608   kFontIDSymbol = 23,
40609   kFontIDMobile = 24
40610 };
40611 struct WidEntry {
40612   short widStyle;
40613 };
40614 typedef struct WidEntry WidEntry;
40615 struct WidTable {
40616   short numWidths;
40617 };
40618 typedef struct WidTable WidTable;
40619 struct AsscEntry {
40620   short fontSize;
40621   short fontStyle;
40622   short fontID;
40623 };
40624 typedef struct AsscEntry AsscEntry;
40625 struct FontAssoc {
40626   short numAssoc;
40627 };
40628 typedef struct FontAssoc FontAssoc;
40629 struct StyleTable {
40630   short fontClass;
40631   long offset;
40632   long reserved;
40633   char indexes[48];
40634 };
40635 typedef struct StyleTable StyleTable;
40636 struct NameTable {
40637   short stringCount;
40638   Str255 baseFontName;
40639 };
40640 typedef struct NameTable NameTable;
40641 struct KernPair {
40642   char kernFirst;
40643   char kernSecond;
40644   short kernWidth;
40645 };
40646 typedef struct KernPair KernPair;
40647 struct KernEntry {
40648   short kernStyle;
40649   short kernLength;
40650 };
40651 typedef struct KernEntry KernEntry;
40652 struct KernTable {
40653   short numKerns;
40654 };
40655 typedef struct KernTable KernTable;
40656 struct WidthTable {
40657   Fixed tabData[256];
40658   Handle tabFont;
40659   long sExtra;
40660   long style;
40661   short fID;
40662   short fSize;
40663   short face;
40664   short device;
40665   Point inNumer;
40666   Point inDenom;
40667   short aFID;
40668   Handle fHand;
40669   Boolean usedFam;
40670   UInt8 aFace;
40671   short vOutput;
40672   short hOutput;
40673   short vFactor;
40674   short hFactor;
40675   short aSize;
40676   short tabSize;
40677 };
40678 typedef struct WidthTable WidthTable;
40679 typedef WidthTable * WidthTablePtr;
40680 typedef WidthTablePtr * WidthTableHdl;
40681 struct FamRec {
40682   short ffFlags;
40683   short ffFamID;
40684   short ffFirstChar;
40685   short ffLastChar;
40686   short ffAscent;
40687   short ffDescent;
40688   short ffLeading;
40689   short ffWidMax;
40690   long ffWTabOff;
40691   long ffKernOff;
40692   long ffStylOff;
40693   short ffProperty[9];
40694   short ffIntl[2];
40695   short ffVersion;
40696 };
40697 typedef struct FamRec FamRec;
40698 struct FontRec {
40699   short fontType;
40700   short firstChar;
40701   short lastChar;
40702   short widMax;
40703   short kernMax;
40704   short nDescent;
40705   short fRectWidth;
40706   short fRectHeight;
40707   unsigned short owTLoc;
40708   short ascent;
40709   short descent;
40710   short leading;
40711   short rowWords;
40712 };
40713 typedef struct FontRec FontRec;
40714 typedef FontRec * FontRecPtr;
40715 typedef FontRecPtr * FontRecHdl;
40716
40717
40718 }
40719
40720
40721
40722 extern "C" {
40723
40724
40725
40726 enum {
40727   pmCourteous = 0,
40728   pmDithered = 0x0001,
40729   pmTolerant = 0x0002,
40730   pmAnimated = 0x0004,
40731   pmExplicit = 0x0008,
40732   pmWhite = 0x0010,
40733   pmBlack = 0x0020,
40734   pmInhibitG2 = 0x0100,
40735   pmInhibitC2 = 0x0200,
40736   pmInhibitG4 = 0x0400,
40737   pmInhibitC4 = 0x0800,
40738   pmInhibitG8 = 0x1000,
40739   pmInhibitC8 = 0x2000,
40740   pmNoUpdates = 0x8000,
40741   pmBkUpdates = 0xA000,
40742   pmFgUpdates = 0xC000,
40743   pmAllUpdates = 0xE000
40744 };
40745
40746 struct ColorInfo {
40747   RGBColor ciRGB;
40748   short ciUsage;
40749   short ciTolerance;
40750   short ciDataFields[3];
40751 };
40752 typedef struct ColorInfo ColorInfo;
40753 typedef ColorInfo * ColorInfoPtr;
40754 typedef ColorInfoPtr * ColorInfoHandle;
40755 struct Palette {
40756   short pmEntries;
40757   short pmDataFields[7];
40758   ColorInfo pmInfo[1];
40759 };
40760 typedef struct Palette Palette;
40761 typedef Palette * PalettePtr;
40762 typedef PalettePtr * PaletteHandle;
40763 extern void
40764 InitPalettes(void) ;
40765 extern PaletteHandle
40766 NewPalette(
40767   short entries,
40768   CTabHandle srcColors,
40769   short srcUsage,
40770   short srcTolerance) ;
40771 extern PaletteHandle
40772 GetNewPalette(short PaletteID) ;
40773 extern void
40774 DisposePalette(PaletteHandle srcPalette) ;
40775 extern void
40776 ActivatePalette(WindowRef srcWindow) ;
40777 extern void
40778 SetPalette(
40779   WindowRef dstWindow,
40780   PaletteHandle srcPalette,
40781   Boolean cUpdates) ;
40782 extern void
40783 NSetPalette(
40784   WindowRef dstWindow,
40785   PaletteHandle srcPalette,
40786   short nCUpdates) ;
40787 extern PaletteHandle
40788 GetPalette(WindowRef srcWindow) ;
40789 extern void
40790 CopyPalette(
40791   PaletteHandle srcPalette,
40792   PaletteHandle dstPalette,
40793   short srcEntry,
40794   short dstEntry,
40795   short dstLength) ;
40796 extern void
40797 PmForeColor(short dstEntry) ;
40798 extern void
40799 PmBackColor(short dstEntry) ;
40800 extern void
40801 AnimateEntry(
40802   WindowRef dstWindow,
40803   short dstEntry,
40804   const RGBColor * srcRGB) ;
40805 extern void
40806 AnimatePalette(
40807   WindowRef dstWindow,
40808   CTabHandle srcCTab,
40809   short srcIndex,
40810   short dstEntry,
40811   short dstLength) ;
40812 extern void
40813 GetEntryColor(
40814   PaletteHandle srcPalette,
40815   short srcEntry,
40816   RGBColor * dstRGB) ;
40817 extern void
40818 SetEntryColor(
40819   PaletteHandle dstPalette,
40820   short dstEntry,
40821   const RGBColor * srcRGB) ;
40822 extern void
40823 GetEntryUsage(
40824   PaletteHandle srcPalette,
40825   short srcEntry,
40826   short * dstUsage,
40827   short * dstTolerance) ;
40828 extern void
40829 SetEntryUsage(
40830   PaletteHandle dstPalette,
40831   short dstEntry,
40832   short srcUsage,
40833   short srcTolerance) ;
40834 extern void
40835 CTab2Palette(
40836   CTabHandle srcCTab,
40837   PaletteHandle dstPalette,
40838   short srcUsage,
40839   short srcTolerance) ;
40840 extern void
40841 Palette2CTab(
40842   PaletteHandle srcPalette,
40843   CTabHandle dstCTab) ;
40844 extern long
40845 Entry2Index(short entry) ;
40846 extern void
40847 RestoreDeviceClut(GDHandle gd) ;
40848 extern void
40849 ResizePalette(
40850   PaletteHandle p,
40851   short size) ;
40852 extern void
40853 SaveFore(ColorSpec * c) ;
40854 extern void
40855 SaveBack(ColorSpec * c) ;
40856 extern void
40857 RestoreFore(const ColorSpec * c) ;
40858 extern void
40859 RestoreBack(const ColorSpec * c) ;
40860 extern OSErr
40861 SetDepth(
40862   GDHandle gd,
40863   short depth,
40864   short whichFlags,
40865   short flags) ;
40866 extern short
40867 HasDepth(
40868   GDHandle gd,
40869   short depth,
40870   short whichFlags,
40871   short flags) ;
40872 extern short
40873 PMgrVersion(void) ;
40874 extern void
40875 SetPaletteUpdates(
40876   PaletteHandle p,
40877   short updates) ;
40878 extern short
40879 GetPaletteUpdates(PaletteHandle p) ;
40880 extern Boolean
40881 GetGray(
40882   GDHandle device,
40883   const RGBColor * backGround,
40884   RGBColor * foreGround) ;
40885
40886
40887
40888
40889
40890
40891
40892 }
40893
40894
40895
40896 extern "C" {
40897
40898
40899
40900
40901 enum {
40902   returnColorTable = 0x0001,
40903   returnPalette = 0x0002,
40904   recordComments = 0x0004,
40905   recordFontInfo = 0x0008,
40906   suppressBlackAndWhite = 0x0010
40907 };
40908
40909 enum {
40910
40911   systemMethod = 0,
40912   popularMethod = 1,
40913   medianMethod = 2
40914 };
40915
40916 enum {
40917
40918   ColorBankIsCustom = -1,
40919   ColorBankIsExactAnd555 = 0,
40920   ColorBankIs555 = 1
40921 };
40922
40923 typedef long PictInfoID;
40924 struct CommentSpec {
40925   short count;
40926   short ID;
40927 };
40928 typedef struct CommentSpec CommentSpec;
40929 typedef CommentSpec * CommentSpecPtr;
40930 typedef CommentSpecPtr * CommentSpecHandle;
40931 struct FontSpec {
40932   short pictFontID;
40933   short sysFontID;
40934   long size[4];
40935   short style;
40936   long nameOffset;
40937 };
40938 typedef struct FontSpec FontSpec;
40939 typedef FontSpec * FontSpecPtr;
40940 typedef FontSpecPtr * FontSpecHandle;
40941 struct PictInfo {
40942   short version;
40943   long uniqueColors;
40944   PaletteHandle thePalette;
40945   CTabHandle theColorTable;
40946   Fixed hRes;
40947   Fixed vRes;
40948   short depth;
40949   Rect sourceRect;
40950   long textCount;
40951   long lineCount;
40952   long rectCount;
40953   long rRectCount;
40954   long ovalCount;
40955   long arcCount;
40956   long polyCount;
40957   long regionCount;
40958   long bitMapCount;
40959   long pixMapCount;
40960   long commentCount;
40961   long uniqueComments;
40962   CommentSpecHandle commentHandle;
40963   long uniqueFonts;
40964   FontSpecHandle fontHandle;
40965   Handle fontNamesHandle;
40966   long reserved1;
40967   long reserved2;
40968 };
40969 typedef struct PictInfo PictInfo;
40970 typedef PictInfo * PictInfoPtr;
40971 typedef PictInfoPtr * PictInfoHandle;
40972 typedef OSErr ( * InitPickMethodProcPtr)(SInt16 colorsRequested, UInt32 *dataRef, SInt16 *colorBankType);
40973 typedef OSErr ( * RecordColorsProcPtr)(UInt32 dataRef, RGBColor *colorsArray, SInt32 colorCount, SInt32 *uniqueColors);
40974 typedef OSErr ( * CalcColorTableProcPtr)(UInt32 dataRef, SInt16 colorsRequested, void *colorBankPtr, CSpecArray resultPtr);
40975 typedef OSErr ( * DisposeColorPickMethodProcPtr)(UInt32 dataRef);
40976 typedef InitPickMethodProcPtr InitPickMethodUPP;
40977 typedef RecordColorsProcPtr RecordColorsUPP;
40978 typedef CalcColorTableProcPtr CalcColorTableUPP;
40979 typedef DisposeColorPickMethodProcPtr DisposeColorPickMethodUPP;
40980 extern InitPickMethodUPP
40981 NewInitPickMethodUPP(InitPickMethodProcPtr userRoutine) ;
40982 extern RecordColorsUPP
40983 NewRecordColorsUPP(RecordColorsProcPtr userRoutine) ;
40984 extern CalcColorTableUPP
40985 NewCalcColorTableUPP(CalcColorTableProcPtr userRoutine) ;
40986 extern DisposeColorPickMethodUPP
40987 NewDisposeColorPickMethodUPP(DisposeColorPickMethodProcPtr userRoutine) ;
40988 extern void
40989 DisposeInitPickMethodUPP(InitPickMethodUPP userUPP) ;
40990 extern void
40991 DisposeRecordColorsUPP(RecordColorsUPP userUPP) ;
40992 extern void
40993 DisposeCalcColorTableUPP(CalcColorTableUPP userUPP) ;
40994 extern void
40995 DisposeDisposeColorPickMethodUPP(DisposeColorPickMethodUPP userUPP) ;
40996 extern OSErr
40997 InvokeInitPickMethodUPP(
40998   SInt16 colorsRequested,
40999   UInt32 * dataRef,
41000   SInt16 * colorBankType,
41001   InitPickMethodUPP userUPP) ;
41002 extern OSErr
41003 InvokeRecordColorsUPP(
41004   UInt32 dataRef,
41005   RGBColor * colorsArray,
41006   SInt32 colorCount,
41007   SInt32 * uniqueColors,
41008   RecordColorsUPP userUPP) ;
41009 extern OSErr
41010 InvokeCalcColorTableUPP(
41011   UInt32 dataRef,
41012   SInt16 colorsRequested,
41013   void * colorBankPtr,
41014   CSpecArray resultPtr,
41015   CalcColorTableUPP userUPP) ;
41016 extern OSErr
41017 InvokeDisposeColorPickMethodUPP(
41018   UInt32 dataRef,
41019   DisposeColorPickMethodUPP userUPP) ;
41020 extern OSErr
41021 GetPictInfo(
41022   PicHandle thePictHandle,
41023   PictInfo * thePictInfo,
41024   short verb,
41025   short colorsRequested,
41026   short colorPickMethod,
41027   short version) ;
41028 extern OSErr
41029 GetPixMapInfo(
41030   PixMapHandle thePixMapHandle,
41031   PictInfo * thePictInfo,
41032   short verb,
41033   short colorsRequested,
41034   short colorPickMethod,
41035   short version) ;
41036 extern OSErr
41037 NewPictInfo(
41038   PictInfoID * thePictInfoID,
41039   short verb,
41040   short colorsRequested,
41041   short colorPickMethod,
41042   short version) ;
41043 extern OSErr
41044 RecordPictInfo(
41045   PictInfoID thePictInfoID,
41046   PicHandle thePictHandle) ;
41047 extern OSErr
41048 RecordPixMapInfo(
41049   PictInfoID thePictInfoID,
41050   PixMapHandle thePixMapHandle) ;
41051 extern OSErr
41052 RetrievePictInfo(
41053   PictInfoID thePictInfoID,
41054   PictInfo * thePictInfo,
41055   short colorsRequested) ;
41056 extern OSErr
41057 DisposePictInfo(PictInfoID thePictInfoID) ;
41058
41059
41060 }
41061
41062
41063
41064 extern "C" {
41065
41066
41067 typedef Fixed ATSUTextMeasurement;
41068
41069
41070
41071
41072
41073
41074
41075 typedef FMFont ATSUFontID;
41076
41077
41078
41079
41080 typedef UInt16 ATSUFontFeatureType;
41081 typedef UInt16 ATSUFontFeatureSelector;
41082
41083
41084
41085
41086 typedef FourCharCode ATSUFontVariationAxis;
41087 typedef Fixed ATSUFontVariationValue;
41088
41089
41090
41091
41092
41093 typedef struct OpaqueATSUTextLayout* ATSUTextLayout;
41094
41095
41096
41097
41098
41099 typedef struct OpaqueATSUStyle* ATSUStyle;
41100
41101
41102
41103
41104
41105 typedef struct OpaqueATSUFontFallbacks* ATSUFontFallbacks;
41106 typedef UInt32 ATSUAttributeTag;
41107 enum {
41108
41109   kATSULineWidthTag = 1L,
41110
41111   kATSULineRotationTag = 2L,
41112
41113   kATSULineDirectionTag = 3L,
41114
41115   kATSULineJustificationFactorTag = 4L,
41116
41117   kATSULineFlushFactorTag = 5L,
41118
41119   kATSULineBaselineValuesTag = 6L,
41120
41121   kATSULineLayoutOptionsTag = 7L,
41122
41123   kATSULineAscentTag = 8L,
41124
41125   kATSULineDescentTag = 9L,
41126
41127   kATSULineLangRegionTag = 10L,
41128
41129   kATSULineTextLocatorTag = 11L,
41130
41131   kATSULineTruncationTag = 12L,
41132
41133   kATSULineFontFallbacksTag = 13L,
41134
41135   kATSULayoutOperationOverrideTag = 15L,
41136
41137   kATSUMaxLineTag = 16L,
41138
41139   kATSULineLanguageTag = 10L,
41140
41141   kATSUCGContextTag = 32767L,
41142
41143
41144
41145   kATSUQDBoldfaceTag = 256L,
41146
41147   kATSUQDItalicTag = 257L,
41148
41149   kATSUQDUnderlineTag = 258L,
41150
41151   kATSUQDCondensedTag = 259L,
41152
41153   kATSUQDExtendedTag = 260L,
41154
41155
41156   kATSUFontTag = 261L,
41157
41158   kATSUSizeTag = 262L,
41159
41160   kATSUColorTag = 263L,
41161
41162
41163   kATSULangRegionTag = 264L,
41164
41165   kATSUVerticalCharacterTag = 265L,
41166
41167   kATSUImposeWidthTag = 266L,
41168
41169   kATSUBeforeWithStreamShiftTag = 267L,
41170
41171   kATSUAfterWithStreamShiftTag = 268L,
41172
41173   kATSUCrossStreamShiftTag = 269L,
41174
41175   kATSUTrackingTag = 270L,
41176
41177   kATSUHangingInhibitFactorTag = 271L,
41178
41179   kATSUKerningInhibitFactorTag = 272L,
41180
41181   kATSUDecompositionFactorTag = 273L,
41182
41183   kATSUBaselineClassTag = 274L,
41184
41185   kATSUPriorityJustOverrideTag = 275L,
41186
41187   kATSUNoLigatureSplitTag = 276L,
41188
41189   kATSUNoCaretAngleTag = 277L,
41190
41191   kATSUSuppressCrossKerningTag = 278L,
41192
41193   kATSUNoOpticalAlignmentTag = 279L,
41194
41195   kATSUForceHangingTag = 280L,
41196
41197   kATSUNoSpecialJustificationTag = 281L,
41198
41199   kATSUStyleTextLocatorTag = 282L,
41200
41201   kATSUStyleRenderingOptionsTag = 283L,
41202
41203   kATSUAscentTag = 284L,
41204
41205   kATSUDescentTag = 285L,
41206
41207   kATSULeadingTag = 286L,
41208
41209   kATSUGlyphSelectorTag = 287L,
41210
41211   kATSURGBAlphaColorTag = 288L,
41212
41213   kATSUFontMatrixTag = 289L,
41214
41215   kATSUMaxStyleTag = 290L,
41216
41217   kATSULanguageTag = 264L,
41218
41219   kATSUMaxATSUITagValue = 65535L
41220 };
41221
41222
41223
41224
41225
41226
41227 typedef void * ATSUAttributeValuePtr;
41228 typedef const void * ConstATSUAttributeValuePtr;
41229 struct ATSUAttributeInfo {
41230   ATSUAttributeTag fTag;
41231   ByteCount fValueSize;
41232 };
41233 typedef struct ATSUAttributeInfo ATSUAttributeInfo;
41234 struct ATSUCaret {
41235   Fixed fX;
41236   Fixed fY;
41237   Fixed fDeltaX;
41238   Fixed fDeltaY;
41239 };
41240 typedef struct ATSUCaret ATSUCaret;
41241
41242
41243
41244
41245
41246
41247 typedef UInt16 ATSUCursorMovementType;
41248 enum {
41249   kATSUByCharacter = 0,
41250   kATSUByTypographicCluster = 1,
41251   kATSUByWord = 2,
41252   kATSUByCharacterCluster = 3,
41253   kATSUByCluster = 1
41254 };
41255
41256
41257
41258
41259
41260 typedef UInt32 ATSULineTruncation;
41261 enum {
41262   kATSUTruncateNone = 0,
41263   kATSUTruncateStart = 1,
41264   kATSUTruncateEnd = 2,
41265   kATSUTruncateMiddle = 3,
41266   kATSUTruncateSpecificationMask = 0x00000007,
41267
41268   kATSUTruncFeatNoSquishing = 0x00000008
41269 };
41270
41271
41272
41273
41274
41275
41276 typedef UInt16 ATSUVerticalCharacterType;
41277 enum {
41278   kATSUStronglyHorizontal = 0,
41279   kATSUStronglyVertical = 1
41280 };
41281
41282
41283
41284
41285
41286
41287
41288 typedef UInt16 ATSUStyleComparison;
41289 enum {
41290   kATSUStyleUnequal = 0,
41291   kATSUStyleContains = 1,
41292   kATSUStyleEquals = 2,
41293   kATSUStyleContainedBy = 3
41294 };
41295 typedef UInt16 ATSUFontFallbackMethod;
41296 enum {
41297   kATSUDefaultFontFallbacks = 0,
41298   kATSULastResortOnlyFallback = 1,
41299   kATSUSequentialFallbacksPreferred = 2,
41300   kATSUSequentialFallbacksExclusive = 3
41301 };
41302 typedef UInt16 ATSUTabType;
41303 enum {
41304   kATSULeftTab = 0,
41305   kATSUCenterTab = 1,
41306   kATSURightTab = 2,
41307   kATSUNumberTabTypes = 3
41308 };
41309
41310
41311
41312
41313
41314
41315 struct ATSUTab {
41316   ATSUTextMeasurement tabPosition;
41317   ATSUTabType tabType;
41318 };
41319 typedef struct ATSUTab ATSUTab;
41320
41321
41322
41323
41324
41325
41326 typedef UInt16 GlyphCollection;
41327 enum {
41328   kGlyphCollectionGID = 0,
41329   kGlyphCollectionAdobeCNS1 = 1,
41330   kGlyphCollectionAdobeGB1 = 2,
41331   kGlyphCollectionAdobeJapan1 = 3,
41332   kGlyphCollectionAdobeJapan2 = 4,
41333   kGlyphCollectionAdobeKorea1 = 5,
41334   kGlyphCollectionUnspecified = 0xFF
41335 };
41336
41337
41338
41339
41340
41341
41342 struct ATSUGlyphSelector {
41343   GlyphCollection collection;
41344   GlyphID glyphID;
41345 };
41346 typedef struct ATSUGlyphSelector ATSUGlyphSelector;
41347 struct ATSUGlyphInfo {
41348   GlyphID glyphID;
41349   UInt16 reserved;
41350   UInt32 layoutFlags;
41351   UniCharArrayOffset charIndex;
41352   ATSUStyle style;
41353   Float32 deltaY;
41354   Float32 idealX;
41355   SInt16 screenX;
41356   SInt16 caretX;
41357 };
41358 typedef struct ATSUGlyphInfo ATSUGlyphInfo;
41359 struct ATSUGlyphInfoArray {
41360   ATSUTextLayout layout;
41361   ItemCount numGlyphs;
41362   ATSUGlyphInfo glyphs[1];
41363 };
41364 typedef struct ATSUGlyphInfoArray ATSUGlyphInfoArray;
41365
41366
41367
41368 typedef UInt32 ATSUHighlightMethod;
41369 enum {
41370   kInvertHighlighting = 0,
41371   kRedrawHighlighting = 1
41372 };
41373
41374 typedef UInt32 ATSUBackgroundDataType;
41375 enum {
41376   kATSUBackgroundColor = 0,
41377   kATSUBackgroundCallback = 1
41378 };
41379
41380 struct ATSURGBAlphaColor {
41381   float red;
41382   float green;
41383   float blue;
41384   float alpha;
41385 };
41386 typedef struct ATSURGBAlphaColor ATSURGBAlphaColor;
41387 typedef ATSURGBAlphaColor ATSUBackgroundColor;
41388 typedef Boolean ( * RedrawBackgroundProcPtr)(ATSUTextLayout iLayout, UniCharArrayOffset iTextOffset, UniCharCount iTextLength, ATSTrapezoid iUnhighlightArea[], ItemCount iTrapezoidCount);
41389 typedef RedrawBackgroundProcPtr RedrawBackgroundUPP;
41390 extern RedrawBackgroundUPP
41391 NewRedrawBackgroundUPP(RedrawBackgroundProcPtr userRoutine) ;
41392 extern void
41393 DisposeRedrawBackgroundUPP(RedrawBackgroundUPP userUPP) ;
41394 extern Boolean
41395 InvokeRedrawBackgroundUPP(
41396   ATSUTextLayout iLayout,
41397   UniCharArrayOffset iTextOffset,
41398   UniCharCount iTextLength,
41399   ATSTrapezoid iUnhighlightArea[],
41400   ItemCount iTrapezoidCount,
41401   RedrawBackgroundUPP userUPP) ;
41402
41403 union ATSUBackgroundData {
41404   ATSUBackgroundColor backgroundColor;
41405   RedrawBackgroundUPP backgroundUPP;
41406 };
41407 typedef union ATSUBackgroundData ATSUBackgroundData;
41408 struct ATSUUnhighlightData {
41409   ATSUBackgroundDataType dataType;
41410   ATSUBackgroundData unhighlightData;
41411 };
41412 typedef struct ATSUUnhighlightData ATSUUnhighlightData;
41413
41414
41415
41416
41417 enum {
41418   kATSULeftToRightBaseDirection = 0,
41419   kATSURightToLeftBaseDirection = 1
41420 };
41421 enum {
41422   kATSUInvalidFontID = 0
41423 };
41424
41425
41426 enum {
41427   kATSUUseLineControlWidth = 0x7FFFFFFF
41428 };
41429
41430
41431 enum {
41432   kATSUNoSelector = 0x0000FFFF
41433 };
41434
41435
41436 enum {
41437   kATSUUseGrafPortPenLoc = (unsigned long)0xFFFFFFFF,
41438   kATSUClearAll = (unsigned long)0xFFFFFFFF
41439 };
41440
41441
41442 enum {
41443   kATSUFromTextBeginning = (unsigned long)0xFFFFFFFF,
41444   kATSUToTextEnd = (unsigned long)0xFFFFFFFF
41445 };
41446 extern OSStatus
41447 ATSUCopyToHandle(
41448   ATSUStyle iStyle,
41449   Handle oStyleHandle) ;
41450 extern OSStatus
41451 ATSUPasteFromHandle(
41452   ATSUStyle iStyle,
41453   Handle iStyleHandle) ;
41454 extern OSStatus
41455 ATSUCreateFontFallbacks(ATSUFontFallbacks * oFontFallback) ;
41456 extern OSStatus
41457 ATSUDisposeFontFallbacks(ATSUFontFallbacks iFontFallbacks) ;
41458 extern OSStatus
41459 ATSUSetObjFontFallbacks(
41460   ATSUFontFallbacks iFontFallbacks,
41461   ItemCount iFontFallbacksCount,
41462   const ATSUFontID iFonts[],
41463   ATSUFontFallbackMethod iFontFallbackMethod) ;
41464 extern OSStatus
41465 ATSUGetObjFontFallbacks(
41466   ATSUFontFallbacks iFontFallbacks,
41467   ItemCount iMaxFontFallbacksCount,
41468   ATSUFontID oFonts[],
41469   ATSUFontFallbackMethod * oFontFallbackMethod,
41470   ItemCount * oActualFallbacksCount) ;
41471 extern OSStatus
41472 ATSUCreateStyle(ATSUStyle * oStyle) ;
41473 extern OSStatus
41474 ATSUCreateAndCopyStyle(
41475   ATSUStyle iStyle,
41476   ATSUStyle * oStyle) ;
41477 extern OSStatus
41478 ATSUDisposeStyle(ATSUStyle iStyle) ;
41479 extern OSStatus
41480 ATSUSetStyleRefCon(
41481   ATSUStyle iStyle,
41482   UInt32 iRefCon) ;
41483 extern OSStatus
41484 ATSUGetStyleRefCon(
41485   ATSUStyle iStyle,
41486   UInt32 * oRefCon) ;
41487 extern OSStatus
41488 ATSUCompareStyles(
41489   ATSUStyle iFirstStyle,
41490   ATSUStyle iSecondStyle,
41491   ATSUStyleComparison * oComparison) ;
41492 extern OSStatus
41493 ATSUCopyAttributes(
41494   ATSUStyle iSourceStyle,
41495   ATSUStyle iDestinationStyle) ;
41496 extern OSStatus
41497 ATSUOverwriteAttributes(
41498   ATSUStyle iSourceStyle,
41499   ATSUStyle iDestinationStyle) ;
41500 extern OSStatus
41501 ATSUUnderwriteAttributes(
41502   ATSUStyle iSourceStyle,
41503   ATSUStyle iDestinationStyle) ;
41504 extern OSStatus
41505 ATSUClearStyle(ATSUStyle iStyle) ;
41506 extern OSStatus
41507 ATSUStyleIsEmpty(
41508   ATSUStyle iStyle,
41509   Boolean * oIsClear) ;
41510 extern OSStatus
41511 ATSUCalculateBaselineDeltas(
41512   ATSUStyle iStyle,
41513   BslnBaselineClass iBaselineClass,
41514   BslnBaselineRecord oBaselineDeltas) ;
41515 extern OSStatus
41516 ATSUSetAttributes(
41517   ATSUStyle iStyle,
41518   ItemCount iAttributeCount,
41519   const ATSUAttributeTag iTag[],
41520   const ByteCount iValueSize[],
41521   const ATSUAttributeValuePtr iValue[]) ;
41522 extern OSStatus
41523 ATSUGetAttribute(
41524   ATSUStyle iStyle,
41525   ATSUAttributeTag iTag,
41526   ByteCount iExpectedValueSize,
41527   ATSUAttributeValuePtr oValue,
41528   ByteCount * oActualValueSize) ;
41529 extern OSStatus
41530 ATSUGetAllAttributes(
41531   ATSUStyle iStyle,
41532   ATSUAttributeInfo oAttributeInfoArray[],
41533   ItemCount iTagValuePairArraySize,
41534   ItemCount * oTagValuePairCount) ;
41535 extern OSStatus
41536 ATSUClearAttributes(
41537   ATSUStyle iStyle,
41538   ItemCount iTagCount,
41539   const ATSUAttributeTag iTag[]) ;
41540 extern OSStatus
41541 ATSUSetFontFeatures(
41542   ATSUStyle iStyle,
41543   ItemCount iFeatureCount,
41544   const ATSUFontFeatureType iType[],
41545   const ATSUFontFeatureSelector iSelector[]) ;
41546 extern OSStatus
41547 ATSUGetFontFeature(
41548   ATSUStyle iStyle,
41549   ItemCount iFeatureIndex,
41550   ATSUFontFeatureType * oFeatureType,
41551   ATSUFontFeatureSelector * oFeatureSelector) ;
41552 extern OSStatus
41553 ATSUGetAllFontFeatures(
41554   ATSUStyle iStyle,
41555   ItemCount iMaximumFeatureCount,
41556   ATSUFontFeatureType oFeatureType[],
41557   ATSUFontFeatureSelector oFeatureSelector[],
41558   ItemCount * oActualFeatureCount) ;
41559 extern OSStatus
41560 ATSUClearFontFeatures(
41561   ATSUStyle iStyle,
41562   ItemCount iFeatureCount,
41563   const ATSUFontFeatureType iType[],
41564   const ATSUFontFeatureSelector iSelector[]) ;
41565 extern OSStatus
41566 ATSUSetVariations(
41567   ATSUStyle iStyle,
41568   ItemCount iVariationCount,
41569   const ATSUFontVariationAxis iAxes[],
41570   const ATSUFontVariationValue iValue[]) ;
41571 extern OSStatus
41572 ATSUGetFontVariationValue(
41573   ATSUStyle iStyle,
41574   ATSUFontVariationAxis iFontVariationAxis,
41575   ATSUFontVariationValue * oFontVariationValue) ;
41576 extern OSStatus
41577 ATSUGetAllFontVariations(
41578   ATSUStyle iStyle,
41579   ItemCount iVariationCount,
41580   ATSUFontVariationAxis oVariationAxes[],
41581   ATSUFontVariationValue oFontVariationValues[],
41582   ItemCount * oActualVariationCount) ;
41583 extern OSStatus
41584 ATSUClearFontVariations(
41585   ATSUStyle iStyle,
41586   ItemCount iAxisCount,
41587   const ATSUFontVariationAxis iAxis[]) ;
41588 extern OSStatus
41589 ATSUCreateTextLayout(ATSUTextLayout * oTextLayout) ;
41590 extern OSStatus
41591 ATSUCreateAndCopyTextLayout(
41592   ATSUTextLayout iTextLayout,
41593   ATSUTextLayout * oTextLayout) ;
41594 extern OSStatus
41595 ATSUCreateTextLayoutWithTextPtr(
41596   ConstUniCharArrayPtr iText,
41597   UniCharArrayOffset iTextOffset,
41598   UniCharCount iTextLength,
41599   UniCharCount iTextTotalLength,
41600   ItemCount iNumberOfRuns,
41601   const UniCharCount iRunLengths[],
41602   ATSUStyle iStyles[],
41603   ATSUTextLayout * oTextLayout) ;
41604 extern OSStatus
41605 ATSUCreateTextLayoutWithTextHandle(
41606   UniCharArrayHandle iText,
41607   UniCharArrayOffset iTextOffset,
41608   UniCharCount iTextLength,
41609   UniCharCount iTextTotalLength,
41610   ItemCount iNumberOfRuns,
41611   const UniCharCount iRunLengths[],
41612   ATSUStyle iStyles[],
41613   ATSUTextLayout * oTextLayout) ;
41614 extern OSStatus
41615 ATSUClearLayoutCache(
41616   ATSUTextLayout iTextLayout,
41617   UniCharArrayOffset iLineStart) ;
41618 extern OSStatus
41619 ATSUDisposeTextLayout(ATSUTextLayout iTextLayout) ;
41620 extern OSStatus
41621 ATSUSetTextLayoutRefCon(
41622   ATSUTextLayout iTextLayout,
41623   UInt32 iRefCon) ;
41624 extern OSStatus
41625 ATSUGetTextLayoutRefCon(
41626   ATSUTextLayout iTextLayout,
41627   UInt32 * oRefCon) ;
41628 extern OSStatus
41629 ATSUGetGlyphBounds(
41630   ATSUTextLayout iTextLayout,
41631   ATSUTextMeasurement iTextBasePointX,
41632   ATSUTextMeasurement iTextBasePointY,
41633   UniCharArrayOffset iBoundsCharStart,
41634   UniCharCount iBoundsCharLength,
41635   UInt16 iTypeOfBounds,
41636   ItemCount iMaxNumberOfBounds,
41637   ATSTrapezoid oGlyphBounds[],
41638   ItemCount * oActualNumberOfBounds) ;
41639 extern OSStatus
41640 ATSUIdle(ATSUTextLayout iTextLayout) ;
41641 extern OSStatus
41642 ATSUSetTextPointerLocation(
41643   ATSUTextLayout iTextLayout,
41644   ConstUniCharArrayPtr iText,
41645   UniCharArrayOffset iTextOffset,
41646   UniCharCount iTextLength,
41647   UniCharCount iTextTotalLength) ;
41648 extern OSStatus
41649 ATSUSetTextHandleLocation(
41650   ATSUTextLayout iTextLayout,
41651   UniCharArrayHandle iText,
41652   UniCharArrayOffset iTextOffset,
41653   UniCharCount iTextLength,
41654   UniCharCount iTextTotalLength) ;
41655 extern OSStatus
41656 ATSUGetTextLocation(
41657   ATSUTextLayout iTextLayout,
41658   void ** oText,
41659   Boolean * oTextIsStoredInHandle,
41660   UniCharArrayOffset * oOffset,
41661   UniCharCount * oTextLength,
41662   UniCharCount * oTextTotalLength) ;
41663 extern OSStatus
41664 ATSUTextDeleted(
41665   ATSUTextLayout iTextLayout,
41666   UniCharArrayOffset iDeletedRangeStart,
41667   UniCharCount iDeletedRangeLength) ;
41668 extern OSStatus
41669 ATSUTextInserted(
41670   ATSUTextLayout iTextLayout,
41671   UniCharArrayOffset iInsertionLocation,
41672   UniCharCount iInsertionLength) ;
41673 extern OSStatus
41674 ATSUTextMoved(
41675   ATSUTextLayout iTextLayout,
41676   ConstUniCharArrayPtr iNewLocation) ;
41677 extern OSStatus
41678 ATSUCopyLayoutControls(
41679   ATSUTextLayout iSourceTextLayout,
41680   ATSUTextLayout iDestTextLayout) ;
41681 extern OSStatus
41682 ATSUSetLayoutControls(
41683   ATSUTextLayout iTextLayout,
41684   ItemCount iAttributeCount,
41685   const ATSUAttributeTag iTag[],
41686   const ByteCount iValueSize[],
41687   const ATSUAttributeValuePtr iValue[]) ;
41688 extern OSStatus
41689 ATSUGetLayoutControl(
41690   ATSUTextLayout iTextLayout,
41691   ATSUAttributeTag iTag,
41692   ByteCount iExpectedValueSize,
41693   ATSUAttributeValuePtr oValue,
41694   ByteCount * oActualValueSize) ;
41695 extern OSStatus
41696 ATSUGetAllLayoutControls(
41697   ATSUTextLayout iTextLayout,
41698   ATSUAttributeInfo oAttributeInfoArray[],
41699   ItemCount iTagValuePairArraySize,
41700   ItemCount * oTagValuePairCount) ;
41701 extern OSStatus
41702 ATSUClearLayoutControls(
41703   ATSUTextLayout iTextLayout,
41704   ItemCount iTagCount,
41705   const ATSUAttributeTag iTag[]) ;
41706 extern OSStatus
41707 ATSUCopyLineControls(
41708   ATSUTextLayout iSourceTextLayout,
41709   UniCharArrayOffset iSourceLineStart,
41710   ATSUTextLayout iDestTextLayout,
41711   UniCharArrayOffset iDestLineStart) ;
41712 extern OSStatus
41713 ATSUSetLineControls(
41714   ATSUTextLayout iTextLayout,
41715   UniCharArrayOffset iLineStart,
41716   ItemCount iAttributeCount,
41717   const ATSUAttributeTag iTag[],
41718   const ByteCount iValueSize[],
41719   const ATSUAttributeValuePtr iValue[]) ;
41720 extern OSStatus
41721 ATSUGetLineControl(
41722   ATSUTextLayout iTextLayout,
41723   UniCharArrayOffset iLineStart,
41724   ATSUAttributeTag iTag,
41725   ByteCount iExpectedValueSize,
41726   ATSUAttributeValuePtr oValue,
41727   ByteCount * oActualValueSize) ;
41728 extern OSStatus
41729 ATSUGetAllLineControls(
41730   ATSUTextLayout iTextLayout,
41731   UniCharArrayOffset iLineStart,
41732   ATSUAttributeInfo oAttributeInfoArray[],
41733   ItemCount iTagValuePairArraySize,
41734   ItemCount * oTagValuePairCount) ;
41735 extern OSStatus
41736 ATSUClearLineControls(
41737   ATSUTextLayout iTextLayout,
41738   UniCharArrayOffset iLineStart,
41739   ItemCount iTagCount,
41740   const ATSUAttributeTag iTag[]) ;
41741 extern OSStatus
41742 ATSUSetRunStyle(
41743   ATSUTextLayout iTextLayout,
41744   ATSUStyle iStyle,
41745   UniCharArrayOffset iRunStart,
41746   UniCharCount iRunLength) ;
41747 extern OSStatus
41748 ATSUGetRunStyle(
41749   ATSUTextLayout iTextLayout,
41750   UniCharArrayOffset iOffset,
41751   ATSUStyle * oStyle,
41752   UniCharArrayOffset * oRunStart,
41753   UniCharCount * oRunLength) ;
41754 extern OSStatus
41755 ATSUGetContinuousAttributes(
41756   ATSUTextLayout iTextLayout,
41757   UniCharArrayOffset iOffset,
41758   UniCharCount iLength,
41759   ATSUStyle oStyle) ;
41760 extern OSStatus
41761 ATSUDrawText(
41762   ATSUTextLayout iTextLayout,
41763   UniCharArrayOffset iLineOffset,
41764   UniCharCount iLineLength,
41765   ATSUTextMeasurement iLocationX,
41766   ATSUTextMeasurement iLocationY) ;
41767 extern OSStatus
41768 ATSUMeasureText(
41769   ATSUTextLayout iTextLayout,
41770   UniCharArrayOffset iLineStart,
41771   UniCharCount iLineLength,
41772   ATSUTextMeasurement * oTextBefore,
41773   ATSUTextMeasurement * oTextAfter,
41774   ATSUTextMeasurement * oAscent,
41775   ATSUTextMeasurement * oDescent) ;
41776 extern OSStatus
41777 ATSUGetUnjustifiedBounds(
41778   ATSUTextLayout iTextLayout,
41779   UniCharArrayOffset iLineStart,
41780   UniCharCount iLineLength,
41781   ATSUTextMeasurement * oTextBefore,
41782   ATSUTextMeasurement * oTextAfter,
41783   ATSUTextMeasurement * oAscent,
41784   ATSUTextMeasurement * oDescent) ;
41785 extern OSStatus
41786 ATSUMeasureTextImage(
41787   ATSUTextLayout iTextLayout,
41788   UniCharArrayOffset iLineOffset,
41789   UniCharCount iLineLength,
41790   ATSUTextMeasurement iLocationX,
41791   ATSUTextMeasurement iLocationY,
41792   Rect * oTextImageRect) ;
41793 extern OSStatus
41794 ATSUHighlightText(
41795   ATSUTextLayout iTextLayout,
41796   ATSUTextMeasurement iTextBasePointX,
41797   ATSUTextMeasurement iTextBasePointY,
41798   UniCharArrayOffset iHighlightStart,
41799   UniCharCount iHighlightLength) ;
41800 extern OSStatus
41801 ATSUUnhighlightText(
41802   ATSUTextLayout iTextLayout,
41803   ATSUTextMeasurement iTextBasePointX,
41804   ATSUTextMeasurement iTextBasePointY,
41805   UniCharArrayOffset iHighlightStart,
41806   UniCharCount iHighlightLength) ;
41807 extern OSStatus
41808 ATSUGetTextHighlight(
41809   ATSUTextLayout iTextLayout,
41810   ATSUTextMeasurement iTextBasePointX,
41811   ATSUTextMeasurement iTextBasePointY,
41812   UniCharArrayOffset iHighlightStart,
41813   UniCharCount iHighlightLength,
41814   RgnHandle oHighlightRegion) ;
41815 extern OSStatus
41816 ATSUHighlightInactiveText(
41817   ATSUTextLayout iTextLayout,
41818   ATSUTextMeasurement iTextBasePointX,
41819   ATSUTextMeasurement iTextBasePointY,
41820   UniCharArrayOffset iHighlightStart,
41821   UniCharCount iHighlightLength) ;
41822 extern OSStatus
41823 ATSUPositionToOffset(
41824   ATSUTextLayout iTextLayout,
41825   ATSUTextMeasurement iLocationX,
41826   ATSUTextMeasurement iLocationY,
41827   UniCharArrayOffset * ioPrimaryOffset,
41828   Boolean * oIsLeading,
41829   UniCharArrayOffset * oSecondaryOffset) ;
41830 extern OSStatus
41831 ATSUOffsetToPosition(
41832   ATSUTextLayout iTextLayout,
41833   UniCharArrayOffset iOffset,
41834   Boolean iIsLeading,
41835   ATSUCaret * oMainCaret,
41836   ATSUCaret * oSecondCaret,
41837   Boolean * oCaretIsSplit) ;
41838 extern OSStatus
41839 ATSUPositionToCursorOffset(
41840   ATSUTextLayout iTextLayout,
41841   ATSUTextMeasurement iLocationX,
41842   ATSUTextMeasurement iLocationY,
41843   ATSUCursorMovementType iMovementType,
41844   UniCharArrayOffset * ioPrimaryOffset,
41845   Boolean * oIsLeading,
41846   UniCharArrayOffset * oSecondaryOffset) ;
41847 extern OSStatus
41848 ATSUOffsetToCursorPosition(
41849   ATSUTextLayout iTextLayout,
41850   UniCharArrayOffset iOffset,
41851   Boolean iIsLeading,
41852   ATSUCursorMovementType iMovementType,
41853   ATSUCaret * oMainCaret,
41854   ATSUCaret * oSecondCaret,
41855   Boolean * oCaretIsSplit) ;
41856 extern OSStatus
41857 ATSUNextCursorPosition(
41858   ATSUTextLayout iTextLayout,
41859   UniCharArrayOffset iOldOffset,
41860   ATSUCursorMovementType iMovementType,
41861   UniCharArrayOffset * oNewOffset) ;
41862 extern OSStatus
41863 ATSUPreviousCursorPosition(
41864   ATSUTextLayout iTextLayout,
41865   UniCharArrayOffset iOldOffset,
41866   ATSUCursorMovementType iMovementType,
41867   UniCharArrayOffset * oNewOffset) ;
41868 extern OSStatus
41869 ATSURightwardCursorPosition(
41870   ATSUTextLayout iTextLayout,
41871   UniCharArrayOffset iOldOffset,
41872   ATSUCursorMovementType iMovementType,
41873   UniCharArrayOffset * oNewOffset) ;
41874 extern OSStatus
41875 ATSULeftwardCursorPosition(
41876   ATSUTextLayout iTextLayout,
41877   UniCharArrayOffset iOldOffset,
41878   ATSUCursorMovementType iMovementType,
41879   UniCharArrayOffset * oNewOffset) ;
41880 extern OSStatus
41881 ATSUBatchBreakLines(
41882   ATSUTextLayout iTextLayout,
41883   UniCharArrayOffset iRangeStart,
41884   UniCharCount iRangeLength,
41885   ATSUTextMeasurement iLineWidth,
41886   ItemCount * oBreakCount) ;
41887 extern OSStatus
41888 ATSUBreakLine(
41889   ATSUTextLayout iTextLayout,
41890   UniCharArrayOffset iLineStart,
41891   ATSUTextMeasurement iLineWidth,
41892   Boolean iUseAsSoftLineBreak,
41893   UniCharArrayOffset * oLineBreak) ;
41894 extern OSStatus
41895 ATSUSetSoftLineBreak(
41896   ATSUTextLayout iTextLayout,
41897   UniCharArrayOffset iLineBreak) ;
41898 extern OSStatus
41899 ATSUGetSoftLineBreaks(
41900   ATSUTextLayout iTextLayout,
41901   UniCharArrayOffset iRangeStart,
41902   UniCharCount iRangeLength,
41903   ItemCount iMaximumBreaks,
41904   UniCharArrayOffset oBreaks[],
41905   ItemCount * oBreakCount) ;
41906 extern OSStatus
41907 ATSUClearSoftLineBreaks(
41908   ATSUTextLayout iTextLayout,
41909   UniCharArrayOffset iRangeStart,
41910   UniCharCount iRangeLength) ;
41911 extern OSStatus
41912 ATSUSetTabArray(
41913   ATSUTextLayout iTextLayout,
41914   const ATSUTab iTabs[],
41915   ItemCount iTabCount) ;
41916 extern OSStatus
41917 ATSUGetTabArray(
41918   ATSUTextLayout iTextLayout,
41919   ItemCount iMaxTabCount,
41920   ATSUTab oTabs[],
41921   ItemCount * oTabCount) ;
41922 extern OSStatus
41923 ATSUSetFontFallbacks(
41924   ItemCount iFontFallbacksCount,
41925   const ATSUFontID iFontIDs[],
41926   ATSUFontFallbackMethod iFontFallbackMethod) ;
41927 extern OSStatus
41928 ATSUGetFontFallbacks(
41929   ItemCount iMaxFontFallbacksCount,
41930   ATSUFontID oFontIDs[],
41931   ATSUFontFallbackMethod * oFontFallbackMethod,
41932   ItemCount * oActualFallbacksCount) ;
41933 extern OSStatus
41934 ATSUMatchFontsToText(
41935   ATSUTextLayout iTextLayout,
41936   UniCharArrayOffset iTextStart,
41937   UniCharCount iTextLength,
41938   ATSUFontID * oFontID,
41939   UniCharArrayOffset * oChangedOffset,
41940   UniCharCount * oChangedLength) ;
41941 extern OSStatus
41942 ATSUSetTransientFontMatching(
41943   ATSUTextLayout iTextLayout,
41944   Boolean iTransientFontMatching) ;
41945 extern OSStatus
41946 ATSUGetTransientFontMatching(
41947   ATSUTextLayout iTextLayout,
41948   Boolean * oTransientFontMatching) ;
41949 extern OSStatus
41950 ATSUFontCount(ItemCount * oFontCount) ;
41951 extern OSStatus
41952 ATSUGetFontIDs(
41953   ATSUFontID oFontIDs[],
41954   ItemCount iArraySize,
41955   ItemCount * oFontCount) ;
41956 extern OSStatus
41957 ATSUFONDtoFontID(
41958   short iFONDNumber,
41959   Style iFONDStyle,
41960   ATSUFontID * oFontID) ;
41961 extern OSStatus
41962 ATSUFontIDtoFOND(
41963   ATSUFontID iFontID,
41964   short * oFONDNumber,
41965   Style * oFONDStyle) ;
41966 extern OSStatus
41967 ATSUCountFontNames(
41968   ATSUFontID iFontID,
41969   ItemCount * oFontNameCount) ;
41970 extern OSStatus
41971 ATSUGetIndFontName(
41972   ATSUFontID iFontID,
41973   ItemCount iFontNameIndex,
41974   ByteCount iMaximumNameLength,
41975   Ptr oName,
41976   ByteCount * oActualNameLength,
41977   FontNameCode * oFontNameCode,
41978   FontPlatformCode * oFontNamePlatform,
41979   FontScriptCode * oFontNameScript,
41980   FontLanguageCode * oFontNameLanguage) ;
41981 extern OSStatus
41982 ATSUFindFontName(
41983   ATSUFontID iFontID,
41984   FontNameCode iFontNameCode,
41985   FontPlatformCode iFontNamePlatform,
41986   FontScriptCode iFontNameScript,
41987   FontLanguageCode iFontNameLanguage,
41988   ByteCount iMaximumNameLength,
41989   Ptr oName,
41990   ByteCount * oActualNameLength,
41991   ItemCount * oFontNameIndex) ;
41992 extern OSStatus
41993 ATSUFindFontFromName(
41994   Ptr iName,
41995   ByteCount iNameLength,
41996   FontNameCode iFontNameCode,
41997   FontPlatformCode iFontNamePlatform,
41998   FontScriptCode iFontNameScript,
41999   FontLanguageCode iFontNameLanguage,
42000   ATSUFontID * oFontID) ;
42001 extern OSStatus
42002 ATSUCountFontFeatureTypes(
42003   ATSUFontID iFontID,
42004   ItemCount * oTypeCount) ;
42005 extern OSStatus
42006 ATSUCountFontFeatureSelectors(
42007   ATSUFontID iFontID,
42008   ATSUFontFeatureType iType,
42009   ItemCount * oSelectorCount) ;
42010 extern OSStatus
42011 ATSUGetFontFeatureTypes(
42012   ATSUFontID iFontID,
42013   ItemCount iMaximumTypes,
42014   ATSUFontFeatureType oTypes[],
42015   ItemCount * oActualTypeCount) ;
42016 extern OSStatus
42017 ATSUGetFontFeatureSelectors(
42018   ATSUFontID iFontID,
42019   ATSUFontFeatureType iType,
42020   ItemCount iMaximumSelectors,
42021   ATSUFontFeatureSelector oSelectors[],
42022   Boolean oSelectorIsOnByDefault[],
42023   ItemCount * oActualSelectorCount,
42024   Boolean * oIsMutuallyExclusive) ;
42025 extern OSStatus
42026 ATSUGetFontFeatureNameCode(
42027   ATSUFontID iFontID,
42028   ATSUFontFeatureType iType,
42029   ATSUFontFeatureSelector iSelector,
42030   FontNameCode * oNameCode) ;
42031 extern OSStatus
42032 ATSUCountFontTracking(
42033   ATSUFontID iFontID,
42034   ATSUVerticalCharacterType iCharacterOrientation,
42035   ItemCount * oTrackingCount) ;
42036 extern OSStatus
42037 ATSUGetIndFontTracking(
42038   ATSUFontID iFontID,
42039   ATSUVerticalCharacterType iCharacterOrientation,
42040   ItemCount iTrackIndex,
42041   Fixed * oFontTrackingValue,
42042   FontNameCode * oNameCode) ;
42043 extern OSStatus
42044 ATSUCountFontVariations(
42045   ATSUFontID iFontID,
42046   ItemCount * oVariationCount) ;
42047 extern OSStatus
42048 ATSUGetIndFontVariation(
42049   ATSUFontID iFontID,
42050   ItemCount iVariationIndex,
42051   ATSUFontVariationAxis * oATSUFontVariationAxis,
42052   ATSUFontVariationValue * oMinimumValue,
42053   ATSUFontVariationValue * oMaximumValue,
42054   ATSUFontVariationValue * oDefaultValue) ;
42055 extern OSStatus
42056 ATSUGetFontVariationNameCode(
42057   ATSUFontID iFontID,
42058   ATSUFontVariationAxis iAxis,
42059   FontNameCode * oNameCode) ;
42060 extern OSStatus
42061 ATSUCountFontInstances(
42062   ATSUFontID iFontID,
42063   ItemCount * oInstances) ;
42064 extern OSStatus
42065 ATSUGetFontInstance(
42066   ATSUFontID iFontID,
42067   ItemCount iFontInstanceIndex,
42068   ItemCount iMaximumVariations,
42069   ATSUFontVariationAxis oAxes[],
42070   ATSUFontVariationValue oValues[],
42071   ItemCount * oActualVariationCount) ;
42072 extern OSStatus
42073 ATSUGetFontInstanceNameCode(
42074   ATSUFontID iFontID,
42075   ItemCount iInstanceIndex,
42076   FontNameCode * oNameCode) ;
42077 extern OSStatus
42078 ATSUGetGlyphInfo(
42079   ATSUTextLayout iTextLayout,
42080   UniCharArrayOffset iLineStart,
42081   UniCharCount iLineLength,
42082   ByteCount * ioBufferSize,
42083   ATSUGlyphInfoArray * oGlyphInfoPtr) ;
42084 extern OSStatus
42085 ATSUDrawGlyphInfo(
42086   ATSUGlyphInfoArray * iGlyphInfoArray,
42087   Float32Point iLocation) ;
42088 extern OSStatus
42089 ATSUGlyphGetIdealMetrics(
42090   ATSUStyle iATSUStyle,
42091   ItemCount iNumOfGlyphs,
42092   GlyphID iGlyphIDs[],
42093   ByteOffset iInputOffset,
42094   ATSGlyphIdealMetrics oIdealMetrics[]) ;
42095 extern OSStatus
42096 ATSUGetNativeCurveType(
42097   ATSUStyle iATSUStyle,
42098   ATSCurveType * oCurveType) ;
42099 extern OSStatus
42100 ATSUGlyphGetScreenMetrics(
42101   ATSUStyle iATSUStyle,
42102   ItemCount iNumOfGlyphs,
42103   GlyphID iGlyphIDs[],
42104   ByteOffset iInputOffset,
42105   Boolean iForcingAntiAlias,
42106   Boolean iAntiAliasSwitch,
42107   ATSGlyphScreenMetrics oScreenMetrics[]) ;
42108
42109
42110
42111
42112
42113 typedef OSStatus ( * ATSQuadraticLineProcPtr)(const Float32Point *pt1, const Float32Point *pt2, void *callBackDataPtr);
42114 typedef OSStatus ( * ATSQuadraticCurveProcPtr)(const Float32Point *pt1, const Float32Point *controlPt, const Float32Point *pt2, void *callBackDataPtr);
42115 typedef OSStatus ( * ATSQuadraticNewPathProcPtr)(void * callBackDataPtr);
42116 typedef OSStatus ( * ATSQuadraticClosePathProcPtr)(void * callBackDataPtr);
42117 typedef ATSQuadraticLineProcPtr ATSQuadraticLineUPP;
42118 typedef ATSQuadraticCurveProcPtr ATSQuadraticCurveUPP;
42119 typedef ATSQuadraticNewPathProcPtr ATSQuadraticNewPathUPP;
42120 typedef ATSQuadraticClosePathProcPtr ATSQuadraticClosePathUPP;
42121 extern ATSQuadraticLineUPP
42122 NewATSQuadraticLineUPP(ATSQuadraticLineProcPtr userRoutine) ;
42123 extern ATSQuadraticCurveUPP
42124 NewATSQuadraticCurveUPP(ATSQuadraticCurveProcPtr userRoutine) ;
42125 extern ATSQuadraticNewPathUPP
42126 NewATSQuadraticNewPathUPP(ATSQuadraticNewPathProcPtr userRoutine) ;
42127 extern ATSQuadraticClosePathUPP
42128 NewATSQuadraticClosePathUPP(ATSQuadraticClosePathProcPtr userRoutine) ;
42129 extern void
42130 DisposeATSQuadraticLineUPP(ATSQuadraticLineUPP userUPP) ;
42131 extern void
42132 DisposeATSQuadraticCurveUPP(ATSQuadraticCurveUPP userUPP) ;
42133 extern void
42134 DisposeATSQuadraticNewPathUPP(ATSQuadraticNewPathUPP userUPP) ;
42135 extern void
42136 DisposeATSQuadraticClosePathUPP(ATSQuadraticClosePathUPP userUPP) ;
42137 extern OSStatus
42138 InvokeATSQuadraticLineUPP(
42139   const Float32Point * pt1,
42140   const Float32Point * pt2,
42141   void * callBackDataPtr,
42142   ATSQuadraticLineUPP userUPP) ;
42143 extern OSStatus
42144 InvokeATSQuadraticCurveUPP(
42145   const Float32Point * pt1,
42146   const Float32Point * controlPt,
42147   const Float32Point * pt2,
42148   void * callBackDataPtr,
42149   ATSQuadraticCurveUPP userUPP) ;
42150 extern OSStatus
42151 InvokeATSQuadraticNewPathUPP(
42152   void * callBackDataPtr,
42153   ATSQuadraticNewPathUPP userUPP) ;
42154 extern OSStatus
42155 InvokeATSQuadraticClosePathUPP(
42156   void * callBackDataPtr,
42157   ATSQuadraticClosePathUPP userUPP) ;
42158 extern OSStatus
42159 ATSUGlyphGetQuadraticPaths(
42160   ATSUStyle iATSUStyle,
42161   GlyphID iGlyphID,
42162   ATSQuadraticNewPathUPP iNewPathProc,
42163   ATSQuadraticLineUPP iLineProc,
42164   ATSQuadraticCurveUPP iCurveProc,
42165   ATSQuadraticClosePathUPP iClosePathProc,
42166   void * iCallbackDataPtr,
42167   OSStatus * oCallbackResult) ;
42168
42169
42170
42171 typedef OSStatus ( * ATSCubicMoveToProcPtr)(const Float32Point *pt, void *callBackDataPtr);
42172 typedef OSStatus ( * ATSCubicLineToProcPtr)(const Float32Point *pt, void *callBackDataPtr);
42173 typedef OSStatus ( * ATSCubicCurveToProcPtr)(const Float32Point *pt1, const Float32Point *pt2, const Float32Point *pt3, void *callBackDataPtr);
42174 typedef OSStatus ( * ATSCubicClosePathProcPtr)(void * callBackDataPtr);
42175 typedef ATSCubicMoveToProcPtr ATSCubicMoveToUPP;
42176 typedef ATSCubicLineToProcPtr ATSCubicLineToUPP;
42177 typedef ATSCubicCurveToProcPtr ATSCubicCurveToUPP;
42178 typedef ATSCubicClosePathProcPtr ATSCubicClosePathUPP;
42179 extern ATSCubicMoveToUPP
42180 NewATSCubicMoveToUPP(ATSCubicMoveToProcPtr userRoutine) ;
42181 extern ATSCubicLineToUPP
42182 NewATSCubicLineToUPP(ATSCubicLineToProcPtr userRoutine) ;
42183 extern ATSCubicCurveToUPP
42184 NewATSCubicCurveToUPP(ATSCubicCurveToProcPtr userRoutine) ;
42185 extern ATSCubicClosePathUPP
42186 NewATSCubicClosePathUPP(ATSCubicClosePathProcPtr userRoutine) ;
42187 extern void
42188 DisposeATSCubicMoveToUPP(ATSCubicMoveToUPP userUPP) ;
42189 extern void
42190 DisposeATSCubicLineToUPP(ATSCubicLineToUPP userUPP) ;
42191 extern void
42192 DisposeATSCubicCurveToUPP(ATSCubicCurveToUPP userUPP) ;
42193 extern void
42194 DisposeATSCubicClosePathUPP(ATSCubicClosePathUPP userUPP) ;
42195 extern OSStatus
42196 InvokeATSCubicMoveToUPP(
42197   const Float32Point * pt,
42198   void * callBackDataPtr,
42199   ATSCubicMoveToUPP userUPP) ;
42200 extern OSStatus
42201 InvokeATSCubicLineToUPP(
42202   const Float32Point * pt,
42203   void * callBackDataPtr,
42204   ATSCubicLineToUPP userUPP) ;
42205 extern OSStatus
42206 InvokeATSCubicCurveToUPP(
42207   const Float32Point * pt1,
42208   const Float32Point * pt2,
42209   const Float32Point * pt3,
42210   void * callBackDataPtr,
42211   ATSCubicCurveToUPP userUPP) ;
42212 extern OSStatus
42213 InvokeATSCubicClosePathUPP(
42214   void * callBackDataPtr,
42215   ATSCubicClosePathUPP userUPP) ;
42216 extern OSStatus
42217 ATSUGlyphGetCubicPaths(
42218   ATSUStyle iATSUStyle,
42219   GlyphID iGlyphID,
42220   ATSCubicMoveToUPP iMoveToProc,
42221   ATSCubicLineToUPP iLineToProc,
42222   ATSCubicCurveToUPP iCurveToProc,
42223   ATSCubicClosePathUPP iClosePathProc,
42224   void * iCallbackDataPtr,
42225   OSStatus * oCallbackResult) ;
42226 extern OSStatus
42227 ATSUGlyphGetCurvePaths(
42228   ATSUStyle iATSUStyle,
42229   GlyphID iGlyphID,
42230   ByteCount * ioBufferSize,
42231   ATSUCurvePaths * oPaths) ;
42232 extern OSStatus
42233 ATSUSetHighlightingMethod(
42234   ATSUTextLayout iTextLayout,
42235   ATSUHighlightMethod iMethod,
42236   const ATSUUnhighlightData * iUnhighlightData) ;
42237
42238
42239
42240
42241
42242
42243 }
42244
42245
42246
42247
42248 enum {
42249   mBaseOffset = 1,
42250   mRowBytes = 2,
42251   mBounds = 3,
42252   mVersion = 4,
42253   mHRes = 5,
42254   mVRes = 6,
42255   mPixelType = 7,
42256   mPixelSize = 8,
42257   mCmpCount = 9,
42258   mCmpSize = 10,
42259   mPlaneBytes = 11,
42260   mVertRefRate = 14,
42261   mVidParams = 1,
42262   mTable = 2,
42263   mPageCnt = 3,
42264   mDevType = 4,
42265   oneBitMode = 128,
42266   twoBitMode = 129,
42267   fourBitMode = 130,
42268   eightBitMode = 131
42269 };
42270
42271 enum {
42272   sixteenBitMode = 132,
42273   thirtyTwoBitMode = 133,
42274   firstVidMode = 128,
42275   secondVidMode = 129,
42276   thirdVidMode = 130,
42277   fourthVidMode = 131,
42278   fifthVidMode = 132,
42279   sixthVidMode = 133,
42280   spGammaDir = 64,
42281   spVidNamesDir = 65
42282 };
42283
42284
42285
42286
42287 enum {
42288   kDeclROMtables = 'decl',
42289   kDetailedTimingFormat = 'arba'
42290 };
42291
42292
42293 enum {
42294   kDDCBlockSize = 128
42295 };
42296
42297
42298 enum {
42299   kDDCBlockTypeEDID = 0
42300 };
42301
42302
42303 enum {
42304   kDDCForceReadBit = 0,
42305   kDDCForceReadMask = (1 << kDDCForceReadBit)
42306 };
42307 enum {
42308   timingInvalid = 0,
42309   timingInvalid_SM_T24 = 8,
42310   timingApple_FixedRateLCD = 42,
42311   timingApple_512x384_60hz = 130,
42312   timingApple_560x384_60hz = 135,
42313   timingApple_640x480_67hz = 140,
42314   timingApple_640x400_67hz = 145,
42315   timingVESA_640x480_60hz = 150,
42316   timingVESA_640x480_72hz = 152,
42317   timingVESA_640x480_75hz = 154,
42318   timingVESA_640x480_85hz = 158,
42319   timingGTF_640x480_120hz = 159,
42320   timingApple_640x870_75hz = 160,
42321   timingApple_640x818_75hz = 165,
42322   timingApple_832x624_75hz = 170,
42323   timingVESA_800x600_56hz = 180,
42324   timingVESA_800x600_60hz = 182,
42325   timingVESA_800x600_72hz = 184,
42326   timingVESA_800x600_75hz = 186,
42327   timingVESA_800x600_85hz = 188,
42328   timingVESA_1024x768_60hz = 190,
42329   timingVESA_1024x768_70hz = 200,
42330   timingVESA_1024x768_75hz = 204,
42331   timingVESA_1024x768_85hz = 208,
42332   timingApple_1024x768_75hz = 210,
42333   timingApple_1152x870_75hz = 220,
42334   timingAppleNTSC_ST = 230,
42335   timingAppleNTSC_FF = 232,
42336   timingAppleNTSC_STconv = 234,
42337   timingAppleNTSC_FFconv = 236,
42338   timingApplePAL_ST = 238,
42339   timingApplePAL_FF = 240,
42340   timingApplePAL_STconv = 242,
42341   timingApplePAL_FFconv = 244,
42342   timingVESA_1280x960_75hz = 250,
42343   timingVESA_1280x960_60hz = 252,
42344   timingVESA_1280x960_85hz = 254,
42345   timingVESA_1280x1024_60hz = 260,
42346   timingVESA_1280x1024_75hz = 262,
42347   timingVESA_1280x1024_85hz = 268,
42348   timingVESA_1600x1200_60hz = 280,
42349   timingVESA_1600x1200_65hz = 282,
42350   timingVESA_1600x1200_70hz = 284,
42351   timingVESA_1600x1200_75hz = 286,
42352   timingVESA_1600x1200_80hz = 288,
42353   timingVESA_1600x1200_85hz = 289,
42354   timingVESA_1792x1344_60hz = 296,
42355   timingVESA_1792x1344_75hz = 298,
42356   timingVESA_1856x1392_60hz = 300,
42357   timingVESA_1856x1392_75hz = 302,
42358   timingVESA_1920x1440_60hz = 304,
42359   timingVESA_1920x1440_75hz = 306,
42360   timingSMPTE240M_60hz = 400,
42361   timingFilmRate_48hz = 410,
42362   timingSony_1600x1024_76hz = 500,
42363   timingSony_1920x1080_60hz = 510,
42364   timingSony_1920x1080_72hz = 520,
42365   timingSony_1920x1200_76hz = 540,
42366   timingApple_0x0_0hz_Offline = 550
42367 };
42368
42369
42370
42371 enum {
42372   timingApple12 = timingApple_512x384_60hz,
42373   timingApple12x = timingApple_560x384_60hz,
42374   timingApple13 = timingApple_640x480_67hz,
42375   timingApple13x = timingApple_640x400_67hz,
42376   timingAppleVGA = timingVESA_640x480_60hz,
42377   timingApple15 = timingApple_640x870_75hz,
42378   timingApple15x = timingApple_640x818_75hz,
42379   timingApple16 = timingApple_832x624_75hz,
42380   timingAppleSVGA = timingVESA_800x600_56hz,
42381   timingApple1Ka = timingVESA_1024x768_60hz,
42382   timingApple1Kb = timingVESA_1024x768_70hz,
42383   timingApple19 = timingApple_1024x768_75hz,
42384   timingApple21 = timingApple_1152x870_75hz,
42385   timingSony_1900x1200_74hz = 530,
42386   timingSony_1900x1200_76hz = timingSony_1920x1200_76hz
42387 };
42388
42389
42390 enum {
42391   kAllModesValid = 0,
42392   kAllModesSafe = 1,
42393   kReportsTagging = 2,
42394   kHasDirectConnection = 3,
42395   kIsMonoDev = 4,
42396   kUncertainConnection = 5,
42397   kTaggingInfoNonStandard = 6,
42398   kReportsDDCConnection = 7,
42399   kHasDDCConnection = 8,
42400   kConnectionInactive = 9,
42401   kDependentConnection = 10,
42402   kBuiltInConnection = 11,
42403   kOverrideConnection = 12,
42404   kFastCheckForDDC = 13,
42405   kReportsHotPlugging = 14
42406 };
42407
42408
42409
42410 enum {
42411   kUnknownConnect = 1,
42412   kPanelConnect = 2,
42413   kPanelTFTConnect = 2,
42414   kFixedModeCRTConnect = 3,
42415   kMultiModeCRT1Connect = 4,
42416   kMultiModeCRT2Connect = 5,
42417   kMultiModeCRT3Connect = 6,
42418   kMultiModeCRT4Connect = 7,
42419   kModelessConnect = 8,
42420   kFullPageConnect = 9,
42421   kVGAConnect = 10,
42422   kNTSCConnect = 11,
42423   kPALConnect = 12,
42424   kHRConnect = 13,
42425   kPanelFSTNConnect = 14,
42426   kMonoTwoPageConnect = 15,
42427   kColorTwoPageConnect = 16,
42428   kColor16Connect = 17,
42429   kColor19Connect = 18,
42430   kGenericCRT = 19,
42431   kGenericLCD = 20,
42432   kDDCConnect = 21,
42433   kNoConnect = 22
42434 };
42435
42436
42437 enum {
42438   kModeValid = 0,
42439   kModeSafe = 1,
42440   kModeDefault = 2,
42441   kModeShowNow = 3,
42442   kModeNotResize = 4,
42443   kModeRequiresPan = 5,
42444   kModeInterlaced = 6,
42445   kModeShowNever = 7,
42446   kModeSimulscan = 8,
42447   kModeNotPreset = 9,
42448   kModeBuiltIn = 10,
42449   kModeStretched = 11
42450 };
42451
42452
42453 enum {
42454   kDepthDependent = 0
42455 };
42456
42457
42458 enum {
42459   kResolutionHasMultipleDepthSizes = 0
42460 };
42461
42462
42463 enum {
42464
42465   kAVPowerOff = 0,
42466   kAVPowerStandby = 1,
42467   kAVPowerSuspend = 2,
42468   kAVPowerOn = 3,
42469   kHardwareSleep = 128,
42470   kHardwareWake = 129,
42471   kHardwareWakeFromSuspend = 130,
42472   kHardwareWakeToDoze = 131,
42473   kHardwareWakeToDozeFromSuspend = 132
42474 };
42475
42476 enum {
42477
42478   kPowerStateNeedsRefresh = 0,
42479   kPowerStateSleepAwareBit = 1,
42480   kPowerStateSleepForbiddenBit = 2,
42481   kPowerStateSleepCanPowerOffBit = 3,
42482   kPowerStateSleepNoDPMSBit = 4,
42483   kPowerStateSleepWaketoDozeBit = 5,
42484   kPowerStateNeedsRefreshMask = (1L << kPowerStateNeedsRefresh),
42485   kPowerStateSleepAwareMask = (1L << kPowerStateSleepAwareBit),
42486   kPowerStateSleepForbiddenMask = (1L << kPowerStateSleepForbiddenBit),
42487   kPowerStateSleepCanPowerOffMask = (1L << kPowerStateSleepCanPowerOffBit),
42488   kPowerStateSleepNoDPMSMask = (1L << kPowerStateSleepNoDPMSBit),
42489   kPowerStateSleepWaketoDozeMask = (1L << kPowerStateSleepWaketoDozeBit)
42490 };
42491
42492
42493 enum {
42494
42495   cscReset = 0,
42496   cscKillIO = 1,
42497   cscSetMode = 2,
42498   cscSetEntries = 3,
42499   cscSetGamma = 4,
42500   cscGrayPage = 5,
42501   cscGrayScreen = 5,
42502   cscSetGray = 6,
42503   cscSetInterrupt = 7,
42504   cscDirectSetEntries = 8,
42505   cscSetDefaultMode = 9,
42506   cscSwitchMode = 10,
42507   cscSetSync = 11,
42508   cscSavePreferredConfiguration = 16,
42509   cscSetHardwareCursor = 22,
42510   cscDrawHardwareCursor = 23,
42511   cscSetConvolution = 24,
42512   cscSetPowerState = 25,
42513   cscPrivateControlCall = 26,
42514   cscSetMultiConnect = 28,
42515   cscSetClutBehavior = 29,
42516   cscSetDetailedTiming = 31,
42517   cscDoCommunication = 33,
42518   cscProbeConnection = 34,
42519   cscUnusedCall = 127
42520 };
42521
42522 enum {
42523
42524   cscGetMode = 2,
42525   cscGetEntries = 3,
42526   cscGetPageCnt = 4,
42527   cscGetPages = 4,
42528   cscGetPageBase = 5,
42529   cscGetBaseAddr = 5,
42530   cscGetGray = 6,
42531   cscGetInterrupt = 7,
42532   cscGetGamma = 8,
42533   cscGetDefaultMode = 9,
42534   cscGetCurMode = 10,
42535   cscGetSync = 11,
42536   cscGetConnection = 12,
42537   cscGetModeTiming = 13,
42538   cscGetModeBaseAddress = 14,
42539   cscGetScanProc = 15,
42540   cscGetPreferredConfiguration = 16,
42541   cscGetNextResolution = 17,
42542   cscGetVideoParameters = 18,
42543   cscGetGammaInfoList = 20,
42544   cscRetrieveGammaTable = 21,
42545   cscSupportsHardwareCursor = 22,
42546   cscGetHardwareCursorDrawState = 23,
42547   cscGetConvolution = 24,
42548   cscGetPowerState = 25,
42549   cscPrivateStatusCall = 26,
42550   cscGetDDCBlock = 27,
42551   cscGetMultiConnect = 28,
42552   cscGetClutBehavior = 29,
42553   cscGetTimingRanges = 30,
42554   cscGetDetailedTiming = 31,
42555   cscGetCommunicationInfo = 32
42556 };
42557
42558
42559 enum {
42560   kDisableHorizontalSyncBit = 0,
42561   kDisableVerticalSyncBit = 1,
42562   kDisableCompositeSyncBit = 2,
42563   kEnableSyncOnBlue = 3,
42564   kEnableSyncOnGreen = 4,
42565   kEnableSyncOnRed = 5,
42566   kNoSeparateSyncControlBit = 6,
42567   kTriStateSyncBit = 7,
42568   kHorizontalSyncMask = 0x01,
42569   kVerticalSyncMask = 0x02,
42570   kCompositeSyncMask = 0x04,
42571   kDPMSSyncMask = 0x07,
42572   kTriStateSyncMask = 0x80,
42573   kSyncOnBlueMask = 0x08,
42574   kSyncOnGreenMask = 0x10,
42575   kSyncOnRedMask = 0x20,
42576   kSyncOnMask = 0x38
42577 };
42578
42579 enum {
42580
42581   kDPMSSyncOn = 0,
42582   kDPMSSyncStandby = 1,
42583   kDPMSSyncSuspend = 2,
42584   kDPMSSyncOff = 7
42585 };
42586
42587
42588 enum {
42589   kConvolved = 0,
42590   kLiveVideoPassThru = 1,
42591   kConvolvedMask = 0x01,
42592   kLiveVideoPassThruMask = 0x02
42593 };
42594
42595
42596 struct VPBlock {
42597   long vpBaseOffset;
42598   short vpRowBytes;
42599   Rect vpBounds;
42600   short vpVersion;
42601   short vpPackType;
42602   long vpPackSize;
42603   long vpHRes;
42604   long vpVRes;
42605   short vpPixelType;
42606   short vpPixelSize;
42607   short vpCmpCount;
42608   short vpCmpSize;
42609   long vpPlaneBytes;
42610 };
42611 typedef struct VPBlock VPBlock;
42612 typedef VPBlock * VPBlockPtr;
42613 struct VDEntryRecord {
42614   Ptr csTable;
42615 };
42616 typedef struct VDEntryRecord VDEntryRecord;
42617 typedef VDEntryRecord * VDEntRecPtr;
42618
42619 struct VDGrayRecord {
42620   Boolean csMode;
42621   SInt8 filler;
42622 };
42623 typedef struct VDGrayRecord VDGrayRecord;
42624 typedef VDGrayRecord * VDGrayPtr;
42625
42626 struct VDFlagRecord {
42627   SInt8 csMode;
42628   SInt8 filler;
42629 };
42630 typedef struct VDFlagRecord VDFlagRecord;
42631 typedef VDFlagRecord * VDFlagRecPtr;
42632
42633 struct VDSetEntryRecord {
42634   ColorSpec * csTable;
42635   short csStart;
42636   short csCount;
42637 };
42638 typedef struct VDSetEntryRecord VDSetEntryRecord;
42639 typedef VDSetEntryRecord * VDSetEntryPtr;
42640
42641 struct VDGammaRecord {
42642   Ptr csGTable;
42643 };
42644 typedef struct VDGammaRecord VDGammaRecord;
42645 typedef VDGammaRecord * VDGamRecPtr;
42646 struct VDBaseAddressInfoRec {
42647   long csDevData;
42648   long csDevBase;
42649   short csModeReserved;
42650   long csModeBase;
42651 };
42652 typedef struct VDBaseAddressInfoRec VDBaseAddressInfoRec;
42653 typedef VDBaseAddressInfoRec * VDBaseAddressInfoPtr;
42654 struct VDSwitchInfoRec {
42655   unsigned short csMode;
42656   unsigned long csData;
42657   unsigned short csPage;
42658   Ptr csBaseAddr;
42659   unsigned long csReserved;
42660 };
42661 typedef struct VDSwitchInfoRec VDSwitchInfoRec;
42662 typedef VDSwitchInfoRec * VDSwitchInfoPtr;
42663 struct VDTimingInfoRec {
42664   unsigned long csTimingMode;
42665   unsigned long csTimingReserved;
42666   unsigned long csTimingFormat;
42667   unsigned long csTimingData;
42668   unsigned long csTimingFlags;
42669 };
42670 typedef struct VDTimingInfoRec VDTimingInfoRec;
42671 typedef VDTimingInfoRec * VDTimingInfoPtr;
42672 struct VDDisplayConnectInfoRec {
42673   unsigned short csDisplayType;
42674   unsigned char csConnectTaggedType;
42675   unsigned char csConnectTaggedData;
42676   unsigned long csConnectFlags;
42677   unsigned long csDisplayComponent;
42678   unsigned long csConnectReserved;
42679 };
42680 typedef struct VDDisplayConnectInfoRec VDDisplayConnectInfoRec;
42681 typedef VDDisplayConnectInfoRec * VDDisplayConnectInfoPtr;
42682 struct VDMultiConnectInfoRec {
42683   unsigned long csDisplayCountOrNumber;
42684   VDDisplayConnectInfoRec csConnectInfo;
42685 };
42686 typedef struct VDMultiConnectInfoRec VDMultiConnectInfoRec;
42687 typedef VDMultiConnectInfoRec * VDMultiConnectInfoPtr;
42688 typedef unsigned char RawSenseCode;
42689 enum {
42690   kRSCZero = 0,
42691   kRSCOne = 1,
42692   kRSCTwo = 2,
42693   kRSCThree = 3,
42694   kRSCFour = 4,
42695   kRSCFive = 5,
42696   kRSCSix = 6,
42697   kRSCSeven = 7
42698 };
42699 typedef unsigned char ExtendedSenseCode;
42700 enum {
42701   kESCZero21Inch = 0x00,
42702   kESCOnePortraitMono = 0x14,
42703   kESCTwo12Inch = 0x21,
42704   kESCThree21InchRadius = 0x31,
42705   kESCThree21InchMonoRadius = 0x34,
42706   kESCThree21InchMono = 0x35,
42707   kESCFourNTSC = 0x0A,
42708   kESCFivePortrait = 0x1E,
42709   kESCSixMSB1 = 0x03,
42710   kESCSixMSB2 = 0x0B,
42711   kESCSixMSB3 = 0x23,
42712   kESCSixStandard = 0x2B,
42713   kESCSevenPAL = 0x00,
42714   kESCSevenNTSC = 0x14,
42715   kESCSevenVGA = 0x17,
42716   kESCSeven16Inch = 0x2D,
42717   kESCSevenPALAlternate = 0x30,
42718   kESCSeven19Inch = 0x3A,
42719   kESCSevenDDC = 0x3E,
42720   kESCSevenNoDisplay = 0x3F
42721 };
42722 typedef unsigned short DepthMode;
42723 enum {
42724   kDepthMode1 = 128,
42725   kDepthMode2 = 129,
42726   kDepthMode3 = 130,
42727   kDepthMode4 = 131,
42728   kDepthMode5 = 132,
42729   kDepthMode6 = 133
42730 };
42731
42732 enum {
42733   kFirstDepthMode = 128,
42734   kSecondDepthMode = 129,
42735   kThirdDepthMode = 130,
42736   kFourthDepthMode = 131,
42737   kFifthDepthMode = 132,
42738   kSixthDepthMode = 133
42739 };
42740
42741
42742 struct VDPageInfo {
42743   short csMode;
42744   long csData;
42745   short csPage;
42746   Ptr csBaseAddr;
42747 };
42748 typedef struct VDPageInfo VDPageInfo;
42749 typedef VDPageInfo * VDPgInfoPtr;
42750 struct VDSizeInfo {
42751   short csHSize;
42752   short csHPos;
42753   short csVSize;
42754   short csVPos;
42755 };
42756 typedef struct VDSizeInfo VDSizeInfo;
42757 typedef VDSizeInfo * VDSzInfoPtr;
42758 struct VDSettings {
42759   short csParamCnt;
42760   short csBrightMax;
42761   short csBrightDef;
42762   short csBrightVal;
42763   short csCntrstMax;
42764   short csCntrstDef;
42765   short csCntrstVal;
42766   short csTintMax;
42767   short csTintDef;
42768   short csTintVal;
42769   short csHueMax;
42770   short csHueDef;
42771   short csHueVal;
42772   short csHorizDef;
42773   short csHorizVal;
42774   short csHorizMax;
42775   short csVertDef;
42776   short csVertVal;
42777   short csVertMax;
42778 };
42779 typedef struct VDSettings VDSettings;
42780 typedef VDSettings * VDSettingsPtr;
42781 struct VDDefMode {
42782   UInt8 csID;
42783   SInt8 filler;
42784 };
42785 typedef struct VDDefMode VDDefMode;
42786 typedef VDDefMode * VDDefModePtr;
42787 struct VDSyncInfoRec {
42788   UInt8 csMode;
42789   UInt8 csFlags;
42790 };
42791 typedef struct VDSyncInfoRec VDSyncInfoRec;
42792 typedef VDSyncInfoRec * VDSyncInfoPtr;
42793 typedef UInt32 AVIDType;
42794 typedef AVIDType DisplayIDType;
42795 typedef UInt32 DisplayModeID;
42796 typedef UInt32 VideoDeviceType;
42797 typedef UInt32 GammaTableID;
42798
42799
42800
42801
42802
42803 enum {
42804   kDisplayModeIDCurrent = 0x00,
42805   kDisplayModeIDInvalid = (long)0xFFFFFFFF,
42806   kDisplayModeIDFindFirstResolution = (long)0xFFFFFFFE,
42807   kDisplayModeIDNoMoreResolutions = (long)0xFFFFFFFD,
42808   kDisplayModeIDFindFirstProgrammable = (long)0xFFFFFFFC,
42809   kDisplayModeIDBootProgrammable = (long)0xFFFFFFFB,
42810   kDisplayModeIDReservedBase = (long)0x80000000
42811 };
42812
42813
42814 enum {
42815   kGammaTableIDFindFirst = (long)0xFFFFFFFE,
42816   kGammaTableIDNoMoreTables = (long)0xFFFFFFFD,
42817   kGammaTableIDSpecific = 0x00
42818 };
42819
42820
42821 enum {
42822   kGetConnectionCount = (long)0xFFFFFFFF,
42823   kActivateConnection = (0 << kConnectionInactive),
42824   kDeactivateConnection = (1 << kConnectionInactive)
42825 };
42826
42827
42828 enum {
42829   kVideoDefaultBus = 0
42830 };
42831
42832
42833
42834 enum {
42835   kVideoBusTypeInvalid = 0,
42836   kVideoBusTypeI2C = 1
42837 };
42838
42839
42840
42841 enum {
42842   kVideoNoTransactionType = 0,
42843   kVideoSimpleI2CType = 1,
42844   kVideoDDCciReplyType = 2
42845 };
42846
42847
42848 enum {
42849   kVideoReplyMicroSecDelayMask = (1 << 0)
42850 };
42851
42852
42853
42854 struct VDResolutionInfoRec {
42855   DisplayModeID csPreviousDisplayModeID;
42856   DisplayModeID csDisplayModeID;
42857   unsigned long csHorizontalPixels;
42858   unsigned long csVerticalLines;
42859   Fixed csRefreshRate;
42860   DepthMode csMaxDepthMode;
42861   unsigned long csResolutionFlags;
42862   unsigned long csReserved;
42863 };
42864 typedef struct VDResolutionInfoRec VDResolutionInfoRec;
42865 typedef VDResolutionInfoRec * VDResolutionInfoPtr;
42866 struct VDVideoParametersInfoRec {
42867   DisplayModeID csDisplayModeID;
42868   DepthMode csDepthMode;
42869   VPBlockPtr csVPBlockPtr;
42870   unsigned long csPageCount;
42871   VideoDeviceType csDeviceType;
42872   UInt32 csDepthFlags;
42873 };
42874 typedef struct VDVideoParametersInfoRec VDVideoParametersInfoRec;
42875 typedef VDVideoParametersInfoRec * VDVideoParametersInfoPtr;
42876 struct VDGammaInfoRec {
42877   GammaTableID csLastGammaID;
42878   GammaTableID csNextGammaID;
42879   Ptr csGammaPtr;
42880   unsigned long csReserved;
42881 };
42882 typedef struct VDGammaInfoRec VDGammaInfoRec;
42883 typedef VDGammaInfoRec * VDGammaInfoPtr;
42884 struct VDGetGammaListRec {
42885   GammaTableID csPreviousGammaTableID;
42886   GammaTableID csGammaTableID;
42887   unsigned long csGammaTableSize;
42888   char * csGammaTableName;
42889 };
42890 typedef struct VDGetGammaListRec VDGetGammaListRec;
42891 typedef VDGetGammaListRec * VDGetGammaListPtr;
42892 struct VDRetrieveGammaRec {
42893   GammaTableID csGammaTableID;
42894   GammaTbl * csGammaTablePtr;
42895 };
42896 typedef struct VDRetrieveGammaRec VDRetrieveGammaRec;
42897 typedef VDRetrieveGammaRec * VDRetrieveGammaPtr;
42898 struct VDSetHardwareCursorRec {
42899   void * csCursorRef;
42900   UInt32 csReserved1;
42901   UInt32 csReserved2;
42902 };
42903 typedef struct VDSetHardwareCursorRec VDSetHardwareCursorRec;
42904 typedef VDSetHardwareCursorRec * VDSetHardwareCursorPtr;
42905 struct VDDrawHardwareCursorRec {
42906   SInt32 csCursorX;
42907   SInt32 csCursorY;
42908   UInt32 csCursorVisible;
42909   UInt32 csReserved1;
42910   UInt32 csReserved2;
42911 };
42912 typedef struct VDDrawHardwareCursorRec VDDrawHardwareCursorRec;
42913 typedef VDDrawHardwareCursorRec * VDDrawHardwareCursorPtr;
42914 struct VDSupportsHardwareCursorRec {
42915   UInt32 csSupportsHardwareCursor;
42916
42917   UInt32 csReserved1;
42918   UInt32 csReserved2;
42919 };
42920 typedef struct VDSupportsHardwareCursorRec VDSupportsHardwareCursorRec;
42921 typedef VDSupportsHardwareCursorRec * VDSupportsHardwareCursorPtr;
42922 struct VDHardwareCursorDrawStateRec {
42923   SInt32 csCursorX;
42924   SInt32 csCursorY;
42925   UInt32 csCursorVisible;
42926   UInt32 csCursorSet;
42927   UInt32 csReserved1;
42928   UInt32 csReserved2;
42929 };
42930 typedef struct VDHardwareCursorDrawStateRec VDHardwareCursorDrawStateRec;
42931 typedef VDHardwareCursorDrawStateRec * VDHardwareCursorDrawStatePtr;
42932 struct VDConvolutionInfoRec {
42933   DisplayModeID csDisplayModeID;
42934   DepthMode csDepthMode;
42935   unsigned long csPage;
42936   UInt32 csFlags;
42937   UInt32 csReserved;
42938 };
42939 typedef struct VDConvolutionInfoRec VDConvolutionInfoRec;
42940 typedef VDConvolutionInfoRec * VDConvolutionInfoPtr;
42941 struct VDPowerStateRec {
42942   unsigned long powerState;
42943   unsigned long powerFlags;
42944
42945   unsigned long powerReserved1;
42946   unsigned long powerReserved2;
42947 };
42948 typedef struct VDPowerStateRec VDPowerStateRec;
42949 typedef VDPowerStateRec * VDPowerStatePtr;
42950 struct VDPrivateSelectorDataRec {
42951   LogicalAddress privateParameters;
42952   ByteCount privateParametersSize;
42953   LogicalAddress privateResults;
42954   ByteCount privateResultsSize;
42955 };
42956 typedef struct VDPrivateSelectorDataRec VDPrivateSelectorDataRec;
42957
42958 struct VDPrivateSelectorRec {
42959   UInt32 reserved;
42960   VDPrivateSelectorDataRec data[1];
42961 };
42962 typedef struct VDPrivateSelectorRec VDPrivateSelectorRec;
42963 struct VDDDCBlockRec {
42964   UInt32 ddcBlockNumber;
42965   ResType ddcBlockType;
42966   UInt32 ddcFlags;
42967   UInt32 ddcReserved;
42968   Byte ddcBlockData[128];
42969 };
42970 typedef struct VDDDCBlockRec VDDDCBlockRec;
42971 typedef VDDDCBlockRec * VDDDCBlockPtr;
42972
42973 enum {
42974
42975   kSyncInterlaceMask = (1 << 7),
42976   kSyncAnalogCompositeMask = 0,
42977   kSyncAnalogCompositeSerrateMask = (1 << 2),
42978   kSyncAnalogCompositeRGBSyncMask = (1 << 1),
42979   kSyncAnalogBipolarMask = (1 << 3),
42980   kSyncAnalogBipolarSerrateMask = (1 << 2),
42981   kSyncAnalogBipolarSRGBSyncMask = (1 << 1),
42982   kSyncDigitalCompositeMask = (1 << 4),
42983   kSyncDigitalCompositeSerrateMask = (1 << 2),
42984   kSyncDigitalCompositeMatchHSyncMask = (1 << 2),
42985   kSyncDigitalSeperateMask = (1 << 4) + (1 << 3),
42986   kSyncDigitalVSyncPositiveMask = (1 << 2),
42987   kSyncDigitalHSyncPositiveMask = (1 << 1)
42988 };
42989
42990
42991
42992 struct VDDisplayTimingRangeRec {
42993   UInt32 csRangeSize;
42994   UInt32 csRangeType;
42995   UInt32 csRangeVersion;
42996   UInt32 csRangeReserved;
42997
42998   UInt32 csRangeBlockIndex;
42999   UInt32 csRangeGroup;
43000   UInt32 csRangeBlockCount;
43001   UInt32 csRangeFlags;
43002
43003   UInt64 csMinPixelClock;
43004   UInt64 csMaxPixelClock;
43005
43006   UInt32 csMaxPixelError;
43007   UInt32 csTimingRangeSyncFlags;
43008   UInt32 csTimingRangeSignalLevels;
43009   UInt32 csReserved0;
43010
43011   UInt32 csMinFrameRate;
43012   UInt32 csMaxFrameRate;
43013   UInt32 csMinLineRate;
43014   UInt32 csMaxLineRate;
43015
43016
43017   UInt32 csMaxHorizontalTotal;
43018   UInt32 csMaxVerticalTotal;
43019   UInt32 csMaxTotalReserved1;
43020   UInt32 csMaxTotalReserved2;
43021   UInt8 csCharSizeHorizontalActive;
43022   UInt8 csCharSizeHorizontalBlanking;
43023   UInt8 csCharSizeHorizontalSyncOffset;
43024   UInt8 csCharSizeHorizontalSyncPulse;
43025
43026   UInt8 csCharSizeVerticalActive;
43027   UInt8 csCharSizeVerticalBlanking;
43028   UInt8 csCharSizeVerticalSyncOffset;
43029   UInt8 csCharSizeVerticalSyncPulse;
43030
43031   UInt8 csCharSizeHorizontalBorderLeft;
43032   UInt8 csCharSizeHorizontalBorderRight;
43033   UInt8 csCharSizeVerticalBorderTop;
43034   UInt8 csCharSizeVerticalBorderBottom;
43035
43036   UInt8 csCharSizeHorizontalTotal;
43037   UInt8 csCharSizeVerticalTotal;
43038   UInt16 csCharSizeReserved1;
43039
43040
43041   UInt32 csMinHorizontalActiveClocks;
43042   UInt32 csMaxHorizontalActiveClocks;
43043   UInt32 csMinHorizontalBlankingClocks;
43044   UInt32 csMaxHorizontalBlankingClocks;
43045
43046   UInt32 csMinHorizontalSyncOffsetClocks;
43047   UInt32 csMaxHorizontalSyncOffsetClocks;
43048   UInt32 csMinHorizontalPulseWidthClocks;
43049   UInt32 csMaxHorizontalPulseWidthClocks;
43050
43051   UInt32 csMinVerticalActiveClocks;
43052   UInt32 csMaxVerticalActiveClocks;
43053   UInt32 csMinVerticalBlankingClocks;
43054   UInt32 csMaxVerticalBlankingClocks;
43055
43056   UInt32 csMinVerticalSyncOffsetClocks;
43057   UInt32 csMaxVerticalSyncOffsetClocks;
43058   UInt32 csMinVerticalPulseWidthClocks;
43059   UInt32 csMaxVerticalPulseWidthClocks;
43060
43061
43062   UInt32 csMinHorizontalBorderLeft;
43063   UInt32 csMaxHorizontalBorderLeft;
43064   UInt32 csMinHorizontalBorderRight;
43065   UInt32 csMaxHorizontalBorderRight;
43066
43067   UInt32 csMinVerticalBorderTop;
43068   UInt32 csMaxVerticalBorderTop;
43069   UInt32 csMinVerticalBorderBottom;
43070   UInt32 csMaxVerticalBorderBottom;
43071
43072   UInt32 csReserved1;
43073   UInt32 csReserved2;
43074   UInt32 csReserved3;
43075   UInt32 csReserved4;
43076
43077   UInt32 csReserved5;
43078   UInt32 csReserved6;
43079   UInt32 csReserved7;
43080   UInt32 csReserved8;
43081 };
43082 typedef struct VDDisplayTimingRangeRec VDDisplayTimingRangeRec;
43083 typedef VDDisplayTimingRangeRec * VDDisplayTimingRangePtr;
43084
43085 enum {
43086
43087   kDMSModeReady = 0,
43088   kDMSModeNotReady = 1,
43089   kDMSModeFree = 2
43090 };
43091
43092
43093
43094 enum {
43095   kTimingChangeRestrictedErr = -10930,
43096   kVideoI2CReplyPendingErr = -10931,
43097   kVideoI2CTransactionErr = -10932,
43098   kVideoI2CBusyErr = -10933,
43099   kVideoI2CTransactionTypeErr = -10934,
43100   kVideoBufferSizeErr = -10935
43101 };
43102
43103
43104 enum {
43105
43106   kRangeSupportsSignal_0700_0300_Bit = 0,
43107   kRangeSupportsSignal_0714_0286_Bit = 1,
43108   kRangeSupportsSignal_1000_0400_Bit = 2,
43109   kRangeSupportsSignal_0700_0000_Bit = 3,
43110   kRangeSupportsSignal_0700_0300_Mask = (1 << kRangeSupportsSignal_0700_0300_Bit),
43111   kRangeSupportsSignal_0714_0286_Mask = (1 << kRangeSupportsSignal_0714_0286_Bit),
43112   kRangeSupportsSignal_1000_0400_Mask = (1 << kRangeSupportsSignal_1000_0400_Bit),
43113   kRangeSupportsSignal_0700_0000_Mask = (1 << kRangeSupportsSignal_0700_0000_Bit)
43114 };
43115
43116
43117 enum {
43118
43119   kDigitalSignalBit = 0,
43120   kAnalogSetupExpectedBit = 1,
43121   kDigitalSignalMask = (1 << kDigitalSignalBit),
43122   kAnalogSetupExpectedMask = (1 << kAnalogSetupExpectedBit)
43123 };
43124
43125
43126 enum {
43127
43128   kAnalogSignalLevel_0700_0300 = 0,
43129   kAnalogSignalLevel_0714_0286 = 1,
43130   kAnalogSignalLevel_1000_0400 = 2,
43131   kAnalogSignalLevel_0700_0000 = 3
43132 };
43133
43134
43135 enum {
43136
43137   kRangeSupportsSeperateSyncsBit = 0,
43138   kRangeSupportsSyncOnGreenBit = 1,
43139   kRangeSupportsCompositeSyncBit = 2,
43140   kRangeSupportsVSyncSerrationBit = 3,
43141   kRangeSupportsSeperateSyncsMask = (1 << kRangeSupportsSeperateSyncsBit),
43142   kRangeSupportsSyncOnGreenMask = (1 << kRangeSupportsSyncOnGreenBit),
43143   kRangeSupportsCompositeSyncMask = (1 << kRangeSupportsCompositeSyncBit),
43144   kRangeSupportsVSyncSerrationMask = (1 << kRangeSupportsVSyncSerrationBit)
43145 };
43146
43147
43148
43149 enum {
43150
43151   kSyncPositivePolarityBit = 0,
43152   kSyncPositivePolarityMask = (1 << kSyncPositivePolarityBit)
43153 };
43154
43155
43156
43157
43158
43159 struct VDDetailedTimingRec {
43160   UInt32 csTimingSize;
43161   UInt32 csTimingType;
43162   UInt32 csTimingVersion;
43163   UInt32 csTimingReserved;
43164
43165   DisplayModeID csDisplayModeID;
43166   UInt32 csDisplayModeSeed;
43167   UInt32 csDisplayModeState;
43168   UInt32 csDisplayModeAlias;
43169
43170   UInt32 csSignalConfig;
43171   UInt32 csSignalLevels;
43172
43173   UInt64 csPixelClock;
43174
43175   UInt64 csMinPixelClock;
43176   UInt64 csMaxPixelClock;
43177
43178
43179   UInt32 csHorizontalActive;
43180   UInt32 csHorizontalBlanking;
43181   UInt32 csHorizontalSyncOffset;
43182   UInt32 csHorizontalSyncPulseWidth;
43183
43184   UInt32 csVerticalActive;
43185   UInt32 csVerticalBlanking;
43186   UInt32 csVerticalSyncOffset;
43187   UInt32 csVerticalSyncPulseWidth;
43188
43189   UInt32 csHorizontalBorderLeft;
43190   UInt32 csHorizontalBorderRight;
43191   UInt32 csVerticalBorderTop;
43192   UInt32 csVerticalBorderBottom;
43193
43194   UInt32 csHorizontalSyncConfig;
43195   UInt32 csHorizontalSyncLevel;
43196   UInt32 csVerticalSyncConfig;
43197   UInt32 csVerticalSyncLevel;
43198
43199   UInt32 csReserved1;
43200   UInt32 csReserved2;
43201   UInt32 csReserved3;
43202   UInt32 csReserved4;
43203
43204   UInt32 csReserved5;
43205   UInt32 csReserved6;
43206   UInt32 csReserved7;
43207   UInt32 csReserved8;
43208 };
43209 typedef struct VDDetailedTimingRec VDDetailedTimingRec;
43210 typedef VDDetailedTimingRec * VDDetailedTimingPtr;
43211 typedef UInt32 VDClutBehavior;
43212 typedef VDClutBehavior * VDClutBehaviorPtr;
43213 enum {
43214   kSetClutAtSetEntries = 0,
43215   kSetClutAtVBL = 1
43216 };
43217
43218
43219 struct VDCommunicationRec {
43220   SInt32 csBusID;
43221   UInt32 csCommFlags;
43222   UInt32 csMinReplyDelay;
43223   UInt32 csReserved2;
43224
43225   UInt32 csSendAddress;
43226   UInt32 csSendType;
43227   LogicalAddress csSendBuffer;
43228   ByteCount csSendSize;
43229
43230   UInt32 csReplyAddress;
43231   UInt32 csReplyType;
43232   LogicalAddress csReplyBuffer;
43233   ByteCount csReplySize;
43234
43235   UInt32 csReserved3;
43236   UInt32 csReserved4;
43237   UInt32 csReserved5;
43238   UInt32 csReserved6;
43239 };
43240 typedef struct VDCommunicationRec VDCommunicationRec;
43241 typedef VDCommunicationRec * VDCommunicationPtr;
43242 struct VDCommunicationInfoRec {
43243   SInt32 csBusID;
43244   UInt32 csBusType;
43245   SInt32 csMinBus;
43246   SInt32 csMaxBus;
43247
43248   UInt32 csSupportedTypes;
43249   UInt32 csSupportedCommFlags;
43250   UInt32 csReserved2;
43251   UInt32 csReserved3;
43252
43253   UInt32 csReserved4;
43254   UInt32 csReserved5;
43255   UInt32 csReserved6;
43256   UInt32 csReserved7;
43257 };
43258 typedef struct VDCommunicationInfoRec VDCommunicationInfoRec;
43259 typedef VDCommunicationInfoRec * VDCommunicationInfoPtr;
43260
43261
43262
43263
43264 extern "C" {
43265
43266
43267
43268 typedef void * DMProcessInfoPtr;
43269 typedef void * DMModalFilterUPP;
43270 enum {
43271
43272   kAESystemConfigNotice = 'cnfg',
43273   kAEDisplayNotice = 'dspl',
43274   kAEDisplaySummary = 'dsum',
43275   keyDMConfigVersion = 'dmcv',
43276   keyDMConfigFlags = 'dmcf',
43277   keyDMConfigReserved = 'dmcr',
43278   keyDisplayID = 'dmid',
43279   keyDisplayComponent = 'dmdc',
43280   keyDisplayDevice = 'dmdd',
43281   keyDisplayFlags = 'dmdf',
43282   keyDisplayMode = 'dmdm',
43283   keyDisplayModeReserved = 'dmmr',
43284   keyDisplayReserved = 'dmdr',
43285   keyDisplayMirroredId = 'dmmi',
43286   keyDeviceFlags = 'dddf',
43287   keyDeviceDepthMode = 'dddm',
43288   keyDeviceRect = 'dddr',
43289   keyPixMapRect = 'dpdr',
43290   keyPixMapHResolution = 'dphr',
43291   keyPixMapVResolution = 'dpvr',
43292   keyPixMapPixelType = 'dppt',
43293   keyPixMapPixelSize = 'dpps',
43294   keyPixMapCmpCount = 'dpcc',
43295   keyPixMapCmpSize = 'dpcs',
43296   keyPixMapAlignment = 'dppa',
43297   keyPixMapResReserved = 'dprr',
43298   keyPixMapReserved = 'dppr',
43299   keyPixMapColorTableSeed = 'dpct',
43300   keySummaryMenubar = 'dsmb',
43301   keySummaryChanges = 'dsch',
43302   keyDisplayOldConfig = 'dold',
43303   keyDisplayNewConfig = 'dnew'
43304 };
43305
43306 enum {
43307   dmOnlyActiveDisplays = true,
43308   dmAllDisplays = false
43309 };
43310
43311
43312 enum {
43313
43314   kDependentNotifyClassShowCursor = 'shcr',
43315   kDependentNotifyClassDriverOverride = 'ndrv',
43316   kDependentNotifyClassDisplayMgrOverride = 'dmgr',
43317   kDependentNotifyClassProfileChanged = 'prof'
43318 };
43319
43320
43321 enum {
43322
43323   kNoSwitchConfirmBit = 0,
43324   kDepthNotAvailableBit = 1,
43325   kShowModeBit = 3,
43326   kModeNotResizeBit = 4,
43327   kNeverShowModeBit = 5
43328 };
43329
43330
43331
43332
43333 enum {
43334   kBeginEndConfigureBit = 0,
43335   kMovedDisplayBit = 1,
43336   kSetMainDisplayBit = 2,
43337   kSetDisplayModeBit = 3,
43338   kAddDisplayBit = 4,
43339   kRemoveDisplayBit = 5,
43340   kNewDisplayBit = 6,
43341   kDisposeDisplayBit = 7,
43342   kEnabledDisplayBit = 8,
43343   kDisabledDisplayBit = 9,
43344   kMirrorDisplayBit = 10,
43345   kUnMirrorDisplayBit = 11
43346 };
43347
43348
43349 enum {
43350
43351   kDMNotifyRequestConnectionProbe = 0,
43352   kDMNotifyInstalled = 1,
43353   kDMNotifyEvent = 2,
43354   kDMNotifyRemoved = 3,
43355   kDMNotifyPrep = 4,
43356   kDMNotifyExtendEvent = 5,
43357   kDMNotifyDependents = 6,
43358   kDMNotifySuspendConfigure = 7,
43359   kDMNotifyResumeConfigure = 8,
43360   kDMNotifyRequestDisplayProbe = 9,
43361   kDMNotifyDisplayWillSleep = 10,
43362   kDMNotifyDisplayDidWake = 11,
43363
43364   kExtendedNotificationProc = (1L << 16)
43365 };
43366
43367
43368
43369 enum {
43370   kFullNotify = 0,
43371   kFullDependencyNotify = 1
43372 };
43373
43374
43375 enum {
43376   kDummyDeviceID = 0x00FF,
43377   kInvalidDisplayID = 0x0000,
43378   kFirstDisplayID = 0x0100
43379 };
43380
43381 enum {
43382
43383   kAllowDuplicatesBit = 0
43384 };
43385
43386 enum {
43387
43388   kSuppressNumberBit = 0,
43389   kSuppressNumberMask = 1,
43390   kForceNumberBit = 1,
43391   kForceNumberMask = 2,
43392   kSuppressNameBit = 2,
43393   kSuppressNameMask = 4
43394 };
43395
43396
43397 enum {
43398   kDMSupressNumbersMask = (1 << 0),
43399   kDMForceNumbersMask = (1 << 1),
43400   kDMSupressNameMask = (1 << 2)
43401 };
43402
43403
43404
43405
43406 enum {
43407   kNoFidelity = 0,
43408   kMinimumFidelity = 1,
43409   kDefaultFidelity = 500,
43410   kDefaultManufacturerFidelity = 1000
43411 };
43412
43413 enum {
43414   kAnyPanelType = 0,
43415   kAnyEngineType = 0,
43416   kAnyDeviceType = 0,
43417   kAnyPortType = 0
43418 };
43419
43420
43421 enum {
43422
43423   kPLIncludeOfflineDevicesBit = 0
43424 };
43425
43426
43427
43428 enum {
43429   kForceConfirmBit = 0,
43430   kForceConfirmMask = (1 << kForceConfirmBit)
43431 };
43432
43433
43434
43435 enum {
43436   kDisplayModeListNotPreferredBit = 0,
43437   kDisplayModeListNotPreferredMask = (1 << kDisplayModeListNotPreferredBit)
43438 };
43439
43440
43441
43442 enum {
43443   kComponentListNotPreferredBit = 0,
43444   kComponentListNotPreferredMask = (1 << kComponentListNotPreferredBit)
43445 };
43446
43447 enum {
43448   kDisplayTimingInfoVersionZero = 1,
43449   kDisplayTimingInfoReservedCountVersionZero = 16,
43450   kDisplayModeEntryVersionZero = 0,
43451   kDisplayModeEntryVersionOne = 1
43452 };
43453
43454
43455 enum {
43456   kMakeAndModelReservedCount = 4
43457 };
43458
43459
43460
43461 enum {
43462   kDisplayGestaltDisplayCommunicationAttr = 'comm',
43463   kDisplayGestaltForbidI2CMask = (1 << 0),
43464   kDisplayGestaltUseI2CPowerMask = (1 << 1),
43465   kDisplayGestaltCalibratorAttr = 'cali',
43466   kDisplayGestaltBrightnessAffectsGammaMask = (1 << 0),
43467   kDisplayGestaltViewAngleAffectsGammaMask = (1 << 1)
43468 };
43469
43470
43471 typedef UInt32 DMFidelityType;
43472
43473
43474
43475
43476
43477
43478 typedef void * DMListType;
43479 typedef unsigned long DMListIndexType;
43480 typedef VDPowerStateRec AVPowerStateRec;
43481 typedef VDPowerStateRec * AVPowerStatePtr;
43482 struct DMDisplayTimingInfoRec {
43483   UInt32 timingInfoVersion;
43484   UInt32 timingInfoAttributes;
43485   SInt32 timingInfoRelativeQuality;
43486   SInt32 timingInfoRelativeDefault;
43487
43488   UInt32 timingInfoReserved[16];
43489 };
43490 typedef struct DMDisplayTimingInfoRec DMDisplayTimingInfoRec;
43491 typedef DMDisplayTimingInfoRec * DMDisplayTimingInfoPtr;
43492
43493 struct DMComponentListEntryRec {
43494   DisplayIDType itemID;
43495   Component itemComponent;
43496   ComponentDescription itemDescription;
43497
43498   ResType itemClass;
43499   DMFidelityType itemFidelity;
43500   ResType itemSubClass;
43501   Point itemSort;
43502
43503   unsigned long itemFlags;
43504   ResType itemReserved;
43505   unsigned long itemFuture1;
43506   unsigned long itemFuture2;
43507   unsigned long itemFuture3;
43508   unsigned long itemFuture4;
43509 };
43510 typedef struct DMComponentListEntryRec DMComponentListEntryRec;
43511 typedef DMComponentListEntryRec * DMComponentListEntryPtr;
43512
43513 struct AVLocationRec {
43514   unsigned long locationConstant;
43515 };
43516 typedef struct AVLocationRec AVLocationRec;
43517 typedef AVLocationRec * AVLocationPtr;
43518 struct DMDepthInfoRec {
43519   VDSwitchInfoPtr depthSwitchInfo;
43520   VPBlockPtr depthVPBlock;
43521   UInt32 depthFlags;
43522   UInt32 depthReserved1;
43523   UInt32 depthReserved2;
43524 };
43525 typedef struct DMDepthInfoRec DMDepthInfoRec;
43526 typedef DMDepthInfoRec * DMDepthInfoPtr;
43527 struct DMDepthInfoBlockRec {
43528   unsigned long depthBlockCount;
43529   DMDepthInfoPtr depthVPBlock;
43530   unsigned long depthBlockFlags;
43531   unsigned long depthBlockReserved1;
43532   unsigned long depthBlockReserved2;
43533 };
43534 typedef struct DMDepthInfoBlockRec DMDepthInfoBlockRec;
43535 typedef DMDepthInfoBlockRec * DMDepthInfoBlockPtr;
43536 struct DMDisplayModeListEntryRec {
43537   UInt32 displayModeFlags;
43538   VDSwitchInfoPtr displayModeSwitchInfo;
43539   VDResolutionInfoPtr displayModeResolutionInfo;
43540   VDTimingInfoPtr displayModeTimingInfo;
43541   DMDepthInfoBlockPtr displayModeDepthBlockInfo;
43542   UInt32 displayModeVersion;
43543   StringPtr displayModeName;
43544   DMDisplayTimingInfoPtr displayModeDisplayInfo;
43545 };
43546 typedef struct DMDisplayModeListEntryRec DMDisplayModeListEntryRec;
43547 typedef DMDisplayModeListEntryRec * DMDisplayModeListEntryPtr;
43548
43549 struct DependentNotifyRec {
43550   ResType notifyType;
43551   ResType notifyClass;
43552   DisplayIDType notifyPortID;
43553   ComponentInstance notifyComponent;
43554
43555   unsigned long notifyVersion;
43556   unsigned long notifyFlags;
43557   unsigned long notifyReserved;
43558   unsigned long notifyFuture;
43559 };
43560 typedef struct DependentNotifyRec DependentNotifyRec;
43561 typedef DependentNotifyRec * DependentNotifyPtr;
43562
43563 struct DMMakeAndModelRec {
43564   ResType manufacturer;
43565   UInt32 model;
43566   UInt32 serialNumber;
43567   UInt32 manufactureDate;
43568
43569   UInt32 makeReserved[4];
43570 };
43571 typedef struct DMMakeAndModelRec DMMakeAndModelRec;
43572 typedef DMMakeAndModelRec * DMMakeAndModelPtr;
43573
43574 enum {
43575   kIncludeOnlineActiveDisplaysMask = (1 << 0),
43576   kIncludeOnlineDisabledDisplaysMask = (1 << 1),
43577   kIncludeOfflineDisplaysMask = (1 << 2),
43578   kIncludeOfflineDummyDisplaysMask = (1 << 3),
43579   kIncludeHardwareMirroredDisplaysMask = (1 << 4)
43580 };
43581
43582
43583 enum {
43584
43585   kDMModeListIncludeAllModesMask = (1 << 0),
43586   kDMModeListIncludeOfflineModesMask = (1 << 1),
43587   kDMModeListExcludeDriverModesMask = (1 << 2),
43588   kDMModeListExcludeDisplayModesMask = (1 << 3),
43589   kDMModeListExcludeCustomModesMask = (1 << 4),
43590   kDMModeListPreferStretchedModesMask = (1 << 5),
43591   kDMModeListPreferSafeModesMask = (1 << 6)
43592 };
43593
43594
43595
43596 struct DisplayListEntryRec {
43597   GDHandle displayListEntryGDevice;
43598   DisplayIDType displayListEntryDisplayID;
43599   UInt32 displayListEntryIncludeFlags;
43600   UInt32 displayListEntryReserved1;
43601
43602   UInt32 displayListEntryReserved2;
43603   UInt32 displayListEntryReserved3;
43604   UInt32 displayListEntryReserved4;
43605   UInt32 displayListEntryReserved5;
43606 };
43607 typedef struct DisplayListEntryRec DisplayListEntryRec;
43608 typedef DisplayListEntryRec * DisplayListEntryPtr;
43609 struct DMProfileListEntryRec {
43610   CMProfileRef profileRef;
43611   Ptr profileReserved1;
43612   Ptr profileReserved2;
43613   Ptr profileReserved3;
43614 };
43615 typedef struct DMProfileListEntryRec DMProfileListEntryRec;
43616 typedef DMProfileListEntryRec * DMProfileListEntryPtr;
43617 typedef void ( * DMNotificationProcPtr)(AppleEvent * theEvent);
43618 typedef void ( * DMExtendedNotificationProcPtr)(void *userData, short theMessage, void *notifyData);
43619 typedef void ( * DMComponentListIteratorProcPtr)(void *userData, DMListIndexType itemIndex, DMComponentListEntryPtr componentInfo);
43620 typedef void ( * DMDisplayModeListIteratorProcPtr)(void *userData, DMListIndexType itemIndex, DMDisplayModeListEntryPtr displaymodeInfo);
43621 typedef void ( * DMProfileListIteratorProcPtr)(void *userData, DMListIndexType itemIndex, DMProfileListEntryPtr profileInfo);
43622 typedef void ( * DMDisplayListIteratorProcPtr)(void *userData, DMListIndexType itemIndex, DisplayListEntryPtr displaymodeInfo);
43623 typedef DMNotificationProcPtr DMNotificationUPP;
43624 typedef DMExtendedNotificationProcPtr DMExtendedNotificationUPP;
43625 typedef DMComponentListIteratorProcPtr DMComponentListIteratorUPP;
43626 typedef DMDisplayModeListIteratorProcPtr DMDisplayModeListIteratorUPP;
43627 typedef DMProfileListIteratorProcPtr DMProfileListIteratorUPP;
43628 typedef DMDisplayListIteratorProcPtr DMDisplayListIteratorUPP;
43629 extern DMNotificationUPP
43630 NewDMNotificationUPP(DMNotificationProcPtr userRoutine) ;
43631 extern DMExtendedNotificationUPP
43632 NewDMExtendedNotificationUPP(DMExtendedNotificationProcPtr userRoutine) ;
43633 extern DMComponentListIteratorUPP
43634 NewDMComponentListIteratorUPP(DMComponentListIteratorProcPtr userRoutine) ;
43635 extern DMDisplayModeListIteratorUPP
43636 NewDMDisplayModeListIteratorUPP(DMDisplayModeListIteratorProcPtr userRoutine) ;
43637 extern DMProfileListIteratorUPP
43638 NewDMProfileListIteratorUPP(DMProfileListIteratorProcPtr userRoutine) ;
43639 extern DMDisplayListIteratorUPP
43640 NewDMDisplayListIteratorUPP(DMDisplayListIteratorProcPtr userRoutine) ;
43641 extern void
43642 DisposeDMNotificationUPP(DMNotificationUPP userUPP) ;
43643 extern void
43644 DisposeDMExtendedNotificationUPP(DMExtendedNotificationUPP userUPP) ;
43645 extern void
43646 DisposeDMComponentListIteratorUPP(DMComponentListIteratorUPP userUPP) ;
43647 extern void
43648 DisposeDMDisplayModeListIteratorUPP(DMDisplayModeListIteratorUPP userUPP) ;
43649 extern void
43650 DisposeDMProfileListIteratorUPP(DMProfileListIteratorUPP userUPP) ;
43651 extern void
43652 DisposeDMDisplayListIteratorUPP(DMDisplayListIteratorUPP userUPP) ;
43653 extern void
43654 InvokeDMNotificationUPP(
43655   AppleEvent * theEvent,
43656   DMNotificationUPP userUPP) ;
43657 extern void
43658 InvokeDMExtendedNotificationUPP(
43659   void * userData,
43660   short theMessage,
43661   void * notifyData,
43662   DMExtendedNotificationUPP userUPP) ;
43663 extern void
43664 InvokeDMComponentListIteratorUPP(
43665   void * userData,
43666   DMListIndexType itemIndex,
43667   DMComponentListEntryPtr componentInfo,
43668   DMComponentListIteratorUPP userUPP) ;
43669 extern void
43670 InvokeDMDisplayModeListIteratorUPP(
43671   void * userData,
43672   DMListIndexType itemIndex,
43673   DMDisplayModeListEntryPtr displaymodeInfo,
43674   DMDisplayModeListIteratorUPP userUPP) ;
43675 extern void
43676 InvokeDMProfileListIteratorUPP(
43677   void * userData,
43678   DMListIndexType itemIndex,
43679   DMProfileListEntryPtr profileInfo,
43680   DMProfileListIteratorUPP userUPP) ;
43681 extern void
43682 InvokeDMDisplayListIteratorUPP(
43683   void * userData,
43684   DMListIndexType itemIndex,
43685   DisplayListEntryPtr displaymodeInfo,
43686   DMDisplayListIteratorUPP userUPP) ;
43687 extern GDHandle
43688 DMGetFirstScreenDevice(Boolean activeOnly) ;
43689 extern GDHandle
43690 DMGetNextScreenDevice(
43691   GDHandle theDevice,
43692   Boolean activeOnly) ;
43693 extern void
43694 DMDrawDesktopRect(Rect * globalRect) ;
43695 extern void
43696 DMDrawDesktopRegion(RgnHandle globalRgn) ;
43697 extern OSErr
43698 DMBeginConfigureDisplays(Handle * displayState) ;
43699 extern OSErr
43700 DMEndConfigureDisplays(Handle displayState) ;
43701 extern OSErr
43702 DMAddDisplay(
43703   GDHandle newDevice,
43704   short driver,
43705   unsigned long mode,
43706   unsigned long reserved,
43707   unsigned long displayID,
43708   Component displayComponent,
43709   Handle displayState) ;
43710 extern OSErr
43711 DMMoveDisplay(
43712   GDHandle moveDevice,
43713   short x,
43714   short y,
43715   Handle displayState) ;
43716 extern OSErr
43717 DMDisableDisplay(
43718   GDHandle disableDevice,
43719   Handle displayState) ;
43720 extern OSErr
43721 DMEnableDisplay(
43722   GDHandle enableDevice,
43723   Handle displayState) ;
43724 extern OSErr
43725 DMRemoveDisplay(
43726   GDHandle removeDevice,
43727   Handle displayState) ;
43728 extern OSErr
43729 DMSetMainDisplay(
43730   GDHandle newMainDevice,
43731   Handle displayState) ;
43732 extern OSErr
43733 DMSetDisplayMode(
43734   GDHandle theDevice,
43735   unsigned long mode,
43736   unsigned long * depthMode,
43737   unsigned long reserved,
43738   Handle displayState) ;
43739 extern OSErr
43740 DMCheckDisplayMode(
43741   GDHandle theDevice,
43742   unsigned long mode,
43743   unsigned long depthMode,
43744   unsigned long * switchFlags,
43745   unsigned long reserved,
43746   Boolean * modeOk) ;
43747 extern OSErr
43748 DMGetDeskRegion(RgnHandle * desktopRegion) ;
43749 extern OSErr
43750 DMRegisterNotifyProc(
43751   DMNotificationUPP notificationProc,
43752   DMProcessInfoPtr whichPSN) ;
43753 extern OSErr
43754 DMRemoveNotifyProc(
43755   DMNotificationUPP notificationProc,
43756   DMProcessInfoPtr whichPSN) ;
43757 extern OSErr
43758 DMQDIsMirroringCapable(Boolean * qdIsMirroringCapable) ;
43759 extern OSErr
43760 DMCanMirrorNow(Boolean * canMirrorNow) ;
43761 extern OSErr
43762 DMIsMirroringOn(Boolean * isMirroringOn) ;
43763 extern OSErr
43764 DMMirrorDevices(
43765   GDHandle gD1,
43766   GDHandle gD2,
43767   Handle displayState) ;
43768 extern OSErr
43769 DMUnmirrorDevice(
43770   GDHandle gDevice,
43771   Handle displayState) ;
43772 extern OSErr
43773 DMGetNextMirroredDevice(
43774   GDHandle gDevice,
43775   GDHandle * mirroredDevice) ;
43776 extern OSErr
43777 DMBlockMirroring(void) ;
43778 extern OSErr
43779 DMUnblockMirroring(void) ;
43780 extern OSErr
43781 DMGetDisplayIDByGDevice(
43782   GDHandle displayDevice,
43783   DisplayIDType * displayID,
43784   Boolean failToMain) ;
43785 extern OSErr
43786 DMGetGDeviceByDisplayID(
43787   DisplayIDType displayID,
43788   GDHandle * displayDevice,
43789   Boolean failToMain) ;
43790 extern OSErr
43791 DMSetDisplayComponent(
43792   GDHandle theDevice,
43793   Component displayComponent) ;
43794 extern OSErr
43795 DMGetDisplayComponent(
43796   GDHandle theDevice,
43797   Component * displayComponent) ;
43798 extern OSErr
43799 DMNewDisplay(
43800   GDHandle * newDevice,
43801   short driverRefNum,
43802   unsigned long mode,
43803   unsigned long reserved,
43804   DisplayIDType displayID,
43805   Component displayComponent,
43806   Handle displayState) ;
43807 extern OSErr
43808 DMDisposeDisplay(
43809   GDHandle disposeDevice,
43810   Handle displayState) ;
43811 extern OSErr
43812 DMResolveDisplayComponents(void) ;
43813 extern OSErr
43814 DMRegisterExtendedNotifyProc(
43815   DMExtendedNotificationUPP notifyProc,
43816   void * notifyUserData,
43817   unsigned short nofifyOnFlags,
43818   DMProcessInfoPtr whichPSN) ;
43819 extern OSErr
43820 DMRemoveExtendedNotifyProc(
43821   DMExtendedNotificationUPP notifyProc,
43822   void * notifyUserData,
43823   DMProcessInfoPtr whichPSN,
43824   unsigned short removeFlags) ;
43825 extern OSErr
43826 DMNewAVPanelList(
43827   DisplayIDType displayID,
43828   ResType panelType,
43829   DMFidelityType minimumFidelity,
43830   unsigned long panelListFlags,
43831   unsigned long reserved,
43832   DMListIndexType * thePanelCount,
43833   DMListType * thePanelList) ;
43834 extern OSErr
43835 DMNewAVEngineList(
43836   DisplayIDType displayID,
43837   ResType engineType,
43838   DMFidelityType minimumFidelity,
43839   unsigned long engineListFlags,
43840   unsigned long reserved,
43841   DMListIndexType * engineCount,
43842   DMListType * engineList) ;
43843 extern OSErr
43844 DMNewAVDeviceList(
43845   ResType deviceType,
43846   unsigned long deviceListFlags,
43847   unsigned long reserved,
43848   DMListIndexType * deviceCount,
43849   DMListType * deviceList) ;
43850 extern OSErr
43851 DMNewAVPortListByPortType(
43852   ResType subType,
43853   unsigned long portListFlags,
43854   unsigned long reserved,
43855   DMListIndexType * devicePortCount,
43856   DMListType * theDevicePortList) ;
43857 extern OSErr
43858 DMGetIndexedComponentFromList(
43859   DMListType panelList,
43860   DMListIndexType itemIndex,
43861   unsigned long reserved,
43862   DMComponentListIteratorUPP listIterator,
43863   void * userData) ;
43864 extern OSErr
43865 DMDisposeList(DMListType panelList) ;
43866 extern OSErr
43867 DMGetNameByAVID(
43868   AVIDType theID,
43869   unsigned long nameFlags,
43870   Str255 name) ;
43871 extern OSErr
43872 DMNewAVIDByPortComponent(
43873   Component thePortComponent,
43874   ResType portKind,
43875   unsigned long reserved,
43876   AVIDType * newID) ;
43877 extern OSErr
43878 DMGetPortComponentByAVID(
43879   DisplayIDType thePortID,
43880   Component * thePortComponent,
43881   ComponentDescription * theDesciption,
43882   ResType * thePortKind) ;
43883 extern OSErr
43884 DMSendDependentNotification(
43885   ResType notifyType,
43886   ResType notifyClass,
43887   AVIDType displayID,
43888   ComponentInstance notifyComponent) ;
43889 extern OSErr
43890 DMDisposeAVComponent(Component theAVComponent) ;
43891 extern OSErr
43892 DMSaveScreenPrefs(
43893   unsigned long reserved1,
43894   unsigned long saveFlags,
43895   unsigned long reserved2) ;
43896 extern OSErr
43897 DMNewAVIDByDeviceComponent(
43898   Component theDeviceComponent,
43899   ResType portKind,
43900   unsigned long reserved,
43901   DisplayIDType * newID) ;
43902 extern OSErr
43903 DMNewAVPortListByDeviceAVID(
43904   AVIDType theID,
43905   DMFidelityType minimumFidelity,
43906   unsigned long portListFlags,
43907   unsigned long reserved,
43908   DMListIndexType * devicePortCount,
43909   DMListType * theDevicePortList) ;
43910 extern OSErr
43911 DMGetDeviceComponentByAVID(
43912   AVIDType theDeviceID,
43913   Component * theDeviceComponent,
43914   ComponentDescription * theDesciption,
43915   ResType * theDeviceKind) ;
43916 extern OSErr
43917 DMNewDisplayModeList(
43918   DisplayIDType displayID,
43919   unsigned long modeListFlags,
43920   unsigned long reserved,
43921   DMListIndexType * thePanelCount,
43922   DMListType * thePanelList) ;
43923 extern OSErr
43924 DMGetIndexedDisplayModeFromList(
43925   DMListType panelList,
43926   DMListIndexType itemIndex,
43927   unsigned long reserved,
43928   DMDisplayModeListIteratorUPP listIterator,
43929   void * userData) ;
43930 extern OSErr
43931 DMGetGraphicInfoByAVID(
43932   AVIDType theID,
43933   PicHandle * theAVPcit,
43934   Handle * theAVIconSuite,
43935   AVLocationRec * theAVLocation) ;
43936 extern OSErr
43937 DMGetAVPowerState(
43938   AVIDType theID,
43939   AVPowerStatePtr getPowerState,
43940   unsigned long reserved1) ;
43941 extern OSErr
43942 DMSetAVPowerState(
43943   AVIDType theID,
43944   AVPowerStatePtr setPowerState,
43945   unsigned long powerFlags,
43946   Handle displayState) ;
43947 extern OSErr
43948 DMGetDeviceAVIDByPortAVID(
43949   AVIDType portAVID,
43950   AVIDType * deviceAVID) ;
43951 extern OSErr
43952 DMGetEnableByAVID(
43953   AVIDType theAVID,
43954   Boolean * isAVIDEnabledNow,
43955   Boolean * canChangeEnableNow) ;
43956 extern OSErr
43957 DMSetEnableByAVID(
43958   AVIDType theAVID,
43959   Boolean doEnable,
43960   Handle displayState) ;
43961 extern OSErr
43962 DMGetDisplayMode(
43963   GDHandle theDevice,
43964   VDSwitchInfoPtr switchInfo) ;
43965 extern OSErr
43966 DMConfirmConfiguration(
43967   DMModalFilterUPP filterProc,
43968   UInt32 confirmFlags,
43969   UInt32 reserved,
43970   Handle displayState) ;
43971
43972
43973
43974
43975
43976 }
43977
43978
43979
43980 extern "C" {
43981
43982
43983
43984
43985
43986 typedef UInt32 FNSMatchOptions;
43987 enum {
43988   kFNSMatchNames = 0x00000001,
43989   kFNSMatchTechnology = 0x00000002,
43990   kFNSMatchGlyphs = 0x00000004,
43991   kFNSMatchEncodings = 0x00000008,
43992   kFNSMatchQDMetrics = 0x00000010,
43993   kFNSMatchATSUMetrics = 0x00000020,
43994   kFNSMatchKerning = 0x00000040,
43995   kFNSMatchWSLayout = 0x00000080,
43996   kFNSMatchAATLayout = 0x00000100,
43997   kFNSMatchPrintEncoding = 0x00000200,
43998   kFNSMissingDataNoMatch = (unsigned long)0x80000000,
43999   kFNSMatchAll = (unsigned long)0xFFFFFFFF,
44000   kFNSMatchDefaults = 0
44001 };
44002 extern FNSMatchOptions
44003 FNSMatchDefaultsGet(void) ;
44004
44005
44006
44007
44008 typedef UInt32 FNSObjectVersion;
44009 enum {
44010   kFNSVersionDontCare = 0,
44011   kFNSCurSysInfoVersion = 1
44012 };
44013
44014
44015 typedef UInt32 FNSFeatureFlags;
44016
44017
44018
44019
44020 struct FNSSysInfo {
44021   FNSObjectVersion iSysInfoVersion;
44022   FNSFeatureFlags oFeatures;
44023   FNSObjectVersion oCurRefVersion;
44024   FNSObjectVersion oMinRefVersion;
44025   FNSObjectVersion oCurProfileVersion;
44026   FNSObjectVersion oMinProfileVersion;
44027   UInt16 oFontSyncVersion;
44028 };
44029 typedef struct FNSSysInfo FNSSysInfo;
44030 extern void
44031 FNSSysInfoGet(FNSSysInfo * ioInfo) ;
44032
44033
44034
44035
44036 typedef struct OpaqueFNSFontReference* FNSFontReference;
44037 extern OSStatus
44038 FNSReferenceGetVersion(
44039   FNSFontReference iReference,
44040   FNSObjectVersion * oVersion) ;
44041 extern OSStatus
44042 FNSReferenceDispose(FNSFontReference iReference) ;
44043 extern OSStatus
44044 FNSReferenceMatch(
44045   FNSFontReference iReference1,
44046   FNSFontReference iReference2,
44047   FNSMatchOptions iOptions,
44048   FNSMatchOptions * oFailedMatchOptions) ;
44049 extern OSStatus
44050 FNSReferenceFlattenedSize(
44051   FNSFontReference iReference,
44052   ByteCount * oFlattenedSize) ;
44053 extern OSStatus
44054 FNSReferenceFlatten(
44055   FNSFontReference iReference,
44056   void * oFlatReference,
44057   ByteCount * oFlattenedSize) ;
44058 extern OSStatus
44059 FNSReferenceUnflatten(
44060   const void * iFlatReference,
44061   ByteCount iFlattenedSize,
44062   FNSFontReference * oReference) ;
44063
44064
44065
44066
44067 enum {
44068   kFNSCreatorDefault = 0,
44069   kFNSProfileFileType = 'fnsp'
44070 };
44071
44072 typedef struct OpaqueFNSFontProfile* FNSFontProfile;
44073 extern OSStatus
44074 FNSProfileCreate(
44075   const FSSpec * iFile,
44076   FourCharCode iCreator,
44077   ItemCount iEstNumRefs,
44078   FNSObjectVersion iDesiredVersion,
44079   FNSFontProfile * oProfile) ;
44080 extern OSStatus
44081 FNSProfileOpen(
44082   const FSSpec * iFile,
44083   Boolean iOpenForWrite,
44084   FNSFontProfile * oProfile) ;
44085 extern OSStatus
44086 FNSProfileCreateWithFSRef(
44087   const FSRef * iParentDirectory,
44088   UniCharCount iNameLength,
44089   const UniChar * iName,
44090   FourCharCode iCreator,
44091   ItemCount iEstNumRefs,
44092   FNSObjectVersion iDesiredVersion,
44093   FNSFontProfile * oProfile) ;
44094 extern OSStatus
44095 FNSProfileOpenWithFSRef(
44096   const FSRef * iFile,
44097   Boolean iOpenForWrite,
44098   FNSFontProfile * oProfile) ;
44099 extern OSStatus
44100 FNSProfileGetVersion(
44101   FNSFontProfile iProfile,
44102   FNSObjectVersion * oVersion) ;
44103 extern OSStatus
44104 FNSProfileCompact(FNSFontProfile iProfile) ;
44105 extern OSStatus
44106 FNSProfileClose(FNSFontProfile iProfile) ;
44107 extern OSStatus
44108 FNSProfileAddReference(
44109   FNSFontProfile iProfile,
44110   FNSFontReference iReference) ;
44111 extern OSStatus
44112 FNSProfileRemoveReference(
44113   FNSFontProfile iProfile,
44114   FNSFontReference iReference) ;
44115 extern OSStatus
44116 FNSProfileRemoveIndReference(
44117   FNSFontProfile iProfile,
44118   UInt32 iIndex) ;
44119 extern OSStatus
44120 FNSProfileClear(FNSFontProfile iProfile) ;
44121 extern OSStatus
44122 FNSProfileCountReferences(
44123   FNSFontProfile iProfile,
44124   ItemCount * oCount) ;
44125 extern OSStatus
44126 FNSProfileGetIndReference(
44127   FNSFontProfile iProfile,
44128   UInt32 iWhichReference,
44129   FNSFontReference * oReference) ;
44130 extern OSStatus
44131 FNSProfileMatchReference(
44132   FNSFontProfile iProfile,
44133   FNSFontReference iReference,
44134   FNSMatchOptions iMatchOptions,
44135   ItemCount iOutputSize,
44136   UInt32 oIndices[],
44137   ItemCount * oNumMatches) ;
44138 extern OSStatus
44139 FNSReferenceCreate(
44140   FMFont iFont,
44141   FNSObjectVersion iDesiredVersion,
44142   FNSFontReference * oReference) ;
44143 extern OSStatus
44144 FNSReferenceMatchFonts(
44145   FNSFontReference iReference,
44146   FNSMatchOptions iMatchOptions,
44147   ItemCount iOutputSize,
44148   FMFont oFonts[],
44149   ItemCount * oNumMatches) ;
44150 extern OSStatus
44151 FNSReferenceCreateFromFamily(
44152   FMFontFamily iFamily,
44153   FMFontStyle iStyle,
44154   FNSObjectVersion iDesiredVersion,
44155   FNSFontReference * oReference,
44156   FMFontStyle * oActualStyle) ;
44157 extern OSStatus
44158 FNSReferenceMatchFamilies(
44159   FNSFontReference iReference,
44160   FNSMatchOptions iMatchOptions,
44161   ItemCount iOutputSize,
44162   FMFontFamilyInstance oFonts[],
44163   ItemCount * oNumMatches) ;
44164 extern OSStatus
44165 FNSReferenceGetFamilyInfo(
44166   FNSFontReference iReference,
44167   Str255 oFamilyName,
44168   ScriptCode * oFamilyNameScript,
44169   FMFontStyle * oActualStyle) ;
44170 extern OSStatus
44171 FNSReferenceCountNames(
44172   FNSFontReference iReference,
44173   ItemCount * oNameCount) ;
44174 extern OSStatus
44175 FNSReferenceGetIndName(
44176   FNSFontReference iReference,
44177   ItemCount iFontNameIndex,
44178   ByteCount iMaximumNameLength,
44179   Ptr oName,
44180   ByteCount * oActualNameLength,
44181   FontNameCode * oFontNameCode,
44182   FontPlatformCode * oFontNamePlatform,
44183   FontScriptCode * oFontNameScript,
44184   FontLanguageCode * oFontNameLanguage) ;
44185 extern OSStatus
44186 FNSReferenceFindName(
44187   FNSFontReference iReference,
44188   FontNameCode iFontNameCode,
44189   FontPlatformCode iFontNamePlatform,
44190   FontScriptCode iFontNameScript,
44191   FontLanguageCode iFontNameLanguage,
44192   ByteCount iMaximumNameLength,
44193   Ptr oName,
44194   ByteCount * oActualNameLength,
44195   ItemCount * oFontNameIndex) ;
44196 extern Boolean
44197 FNSEnabled(void) ;
44198
44199
44200
44201
44202
44203 }
44204
44205
44206
44207 extern "C" {
44208
44209
44210 typedef UInt32 ATSUFlattenedDataStreamFormat;
44211 enum {
44212   kATSUDataStreamUnicodeStyledText = 'ustl'
44213 };
44214
44215
44216
44217
44218
44219
44220
44221 typedef UInt32 ATSUFlattenStyleRunOptions;
44222 enum {
44223   kATSUFlattenOptionNoOptionsMask = 0x00000000
44224 };
44225
44226
44227
44228
44229
44230
44231 typedef UInt32 ATSUUnFlattenStyleRunOptions;
44232 enum {
44233   kATSUUnFlattenOptionNoOptionsMask = 0x00000000
44234 };
44235 struct ATSUStyleRunInfo {
44236   UniCharCount runLength;
44237   ItemCount styleObjectIndex;
44238 };
44239 typedef struct ATSUStyleRunInfo ATSUStyleRunInfo;
44240 enum {
44241   kATSFlatDataUstlVersion0 = 0,
44242   kATSFlatDataUstlVersion1 = 1,
44243   kATSFlatDataUstlVersion2 = 2,
44244   kATSFlatDataUstlCurrentVersion = kATSFlatDataUstlVersion2
44245 };
44246 struct ATSFlatDataMainHeaderBlock {
44247
44248
44249
44250
44251   UInt32 version;
44252
44253
44254
44255   ByteCount sizeOfDataBlock;
44256
44257
44258
44259   ByteCount offsetToTextLayouts;
44260
44261
44262
44263   ByteCount offsetToStyleRuns;
44264
44265
44266
44267   ByteCount offsetToStyleList;
44268 };
44269 typedef struct ATSFlatDataMainHeaderBlock ATSFlatDataMainHeaderBlock;
44270 struct ATSFlatDataTextLayoutDataHeader {
44271
44272
44273
44274   ByteCount sizeOfLayoutData;
44275
44276
44277   ByteCount textLayoutLength;
44278
44279
44280
44281
44282   ByteCount offsetToLayoutControls;
44283
44284
44285
44286
44287   ByteCount offsetToLineInfo;
44288
44289
44290
44291
44292
44293
44294
44295 };
44296 typedef struct ATSFlatDataTextLayoutDataHeader ATSFlatDataTextLayoutDataHeader;
44297
44298
44299
44300
44301
44302 struct ATSFlatDataLayoutControlsDataHeader {
44303
44304
44305
44306   ItemCount numberOfLayoutControls;
44307   ATSUAttributeInfo controlArray[1];
44308 };
44309 typedef struct ATSFlatDataLayoutControlsDataHeader ATSFlatDataLayoutControlsDataHeader;
44310 struct ATSFlatDataLineInfoData {
44311
44312
44313   UniCharCount lineLength;
44314
44315
44316
44317   ItemCount numberOfLineControls;
44318
44319
44320
44321
44322 };
44323 typedef struct ATSFlatDataLineInfoData ATSFlatDataLineInfoData;
44324
44325
44326
44327
44328
44329 struct ATSFlatDataLineInfoHeader {
44330
44331
44332
44333
44334
44335   ItemCount numberOfLines;
44336
44337
44338
44339
44340   ATSFlatDataLineInfoData lineInfoArray[1];
44341 };
44342 typedef struct ATSFlatDataLineInfoHeader ATSFlatDataLineInfoHeader;
44343 struct ATSFlatDataStyleRunDataHeader {
44344
44345
44346   ItemCount numberOfStyleRuns;
44347
44348
44349
44350
44351   ATSUStyleRunInfo styleRunArray[1];
44352 };
44353 typedef struct ATSFlatDataStyleRunDataHeader ATSFlatDataStyleRunDataHeader;
44354 struct ATSFlatDataStyleListStyleDataHeader {
44355
44356
44357
44358
44359   ByteCount sizeOfStyleInfo;
44360
44361
44362
44363
44364   ItemCount numberOfSetAttributes;
44365
44366
44367
44368   ItemCount numberOfSetFeatures;
44369
44370
44371
44372   ItemCount numberOfSetVariations;
44373 };
44374 typedef struct ATSFlatDataStyleListStyleDataHeader ATSFlatDataStyleListStyleDataHeader;
44375
44376
44377
44378
44379
44380 struct ATSFlatDataStyleListHeader {
44381
44382
44383   ItemCount numberOfStyles;
44384
44385
44386
44387
44388
44389
44390   ATSFlatDataStyleListStyleDataHeader styleDataArray[1];
44391
44392 };
44393 typedef struct ATSFlatDataStyleListHeader ATSFlatDataStyleListHeader;
44394
44395
44396
44397
44398
44399 struct ATSFlatDataStyleListFeatureData {
44400
44401
44402   ATSUFontFeatureType theFeatureType;
44403
44404
44405   ATSUFontFeatureSelector theFeatureSelector;
44406 };
44407 typedef struct ATSFlatDataStyleListFeatureData ATSFlatDataStyleListFeatureData;
44408
44409
44410
44411
44412
44413
44414 struct ATSFlatDataStyleListVariationData {
44415
44416
44417   ATSUFontVariationAxis theVariationAxis;
44418
44419
44420   ATSUFontVariationValue theVariationValue;
44421 };
44422 typedef struct ATSFlatDataStyleListVariationData ATSFlatDataStyleListVariationData;
44423 typedef UInt32 ATSFlatDataFontSpeciferType;
44424 enum {
44425
44426
44427   kATSFlattenedFontSpecifierRawNameData = 'namd'
44428 };
44429
44430
44431
44432
44433
44434
44435 struct ATSFlatDataFontNameDataHeader {
44436
44437
44438   ATSFlatDataFontSpeciferType nameSpecifierType;
44439
44440
44441
44442
44443
44444   ByteCount nameSpecifierSize;
44445
44446
44447
44448
44449
44450
44451
44452 };
44453 typedef struct ATSFlatDataFontNameDataHeader ATSFlatDataFontNameDataHeader;
44454
44455
44456
44457
44458
44459
44460
44461 struct ATSFlatDataFontSpecRawNameData {
44462
44463
44464   FontNameCode fontNameType;
44465
44466
44467
44468
44469
44470   FontPlatformCode fontNamePlatform;
44471
44472
44473
44474
44475
44476   FontScriptCode fontNameScript;
44477
44478
44479
44480
44481   FontLanguageCode fontNameLanguage;
44482
44483
44484
44485   ByteCount fontNameLength;
44486
44487
44488
44489
44490 };
44491 typedef struct ATSFlatDataFontSpecRawNameData ATSFlatDataFontSpecRawNameData;
44492 struct ATSFlatDataFontSpecRawNameDataHeader {
44493
44494
44495
44496   ItemCount numberOfFlattenedNames;
44497
44498
44499
44500
44501
44502   ATSFlatDataFontSpecRawNameData nameDataArray[1];
44503
44504 };
44505 typedef struct ATSFlatDataFontSpecRawNameDataHeader ATSFlatDataFontSpecRawNameDataHeader;
44506 extern OSStatus
44507 ATSUFlattenStyleRunsToStream(
44508   ATSUFlattenedDataStreamFormat iStreamFormat,
44509   ATSUFlattenStyleRunOptions iFlattenOptions,
44510   ItemCount iNumberOfRunInfo,
44511   const ATSUStyleRunInfo iRunInfoArray[],
44512   ItemCount iNumberOfStyleObjects,
44513   const ATSUStyle iStyleArray[],
44514   ByteCount iStreamBufferSize,
44515   void * oStreamBuffer,
44516   ByteCount * oActualStreamBufferSize) ;
44517 extern OSStatus
44518 ATSUUnflattenStyleRunsFromStream(
44519   ATSUFlattenedDataStreamFormat iStreamFormat,
44520   ATSUUnFlattenStyleRunOptions iUnflattenOptions,
44521   ByteCount iStreamBufferSize,
44522   const void * iStreamBuffer,
44523   ItemCount iNumberOfRunInfo,
44524   ItemCount iNumberOfStyleObjects,
44525   ATSUStyleRunInfo oRunInfoArray[],
44526   ATSUStyle oStyleArray[],
44527   ItemCount * oActualNumberOfRunInfo,
44528   ItemCount * oActualNumberOfStyleObjects) ;
44529
44530
44531
44532
44533
44534 }
44535
44536
44537
44538 extern "C" {
44539 typedef UInt32 ATSUDirectDataSelector;
44540 enum {
44541   kATSUDirectDataAdvanceDeltaFixedArray = 0L,
44542   kATSUDirectDataBaselineDeltaFixedArray = 1L,
44543   kATSUDirectDataDeviceDeltaSInt16Array = 2L,
44544   kATSUDirectDataStyleIndexUInt16Array = 3L,
44545   kATSUDirectDataStyleSettingATSUStyleSettingRefArray = 4L,
44546   kATSUDirectDataLayoutRecordATSLayoutRecordVersion1 = 100L,
44547   kATSUDirectDataLayoutRecordATSLayoutRecordCurrent = kATSUDirectDataLayoutRecordATSLayoutRecordVersion1
44548 };
44549 typedef struct ATSStyleSetting* ATSUStyleSettingRef;
44550 extern OSStatus
44551 ATSUDirectGetLayoutDataArrayPtrFromLineRef(
44552   ATSULineRef iLineRef,
44553   ATSUDirectDataSelector iDataSelector,
44554   Boolean iCreate,
44555   void * oLayoutDataArrayPtr[],
44556   ItemCount * oLayoutDataCount) ;
44557 extern OSStatus
44558 ATSUDirectGetLayoutDataArrayPtrFromTextLayout(
44559   ATSUTextLayout iTextLayout,
44560   UniCharArrayOffset iLineOffset,
44561   ATSUDirectDataSelector iDataSelector,
44562   void * oLayoutDataArrayPtr[],
44563   ItemCount * oLayoutDataCount) ;
44564 extern OSStatus
44565 ATSUDirectReleaseLayoutDataArrayPtr(
44566   ATSULineRef iLineRef,
44567   ATSUDirectDataSelector iDataSelector,
44568   void * iLayoutDataArrayPtr[]) ;
44569 extern OSStatus
44570 ATSUDirectAddStyleSettingRef(
44571   ATSULineRef iLineRef,
44572   ATSUStyleSettingRef iStyleSettingRef,
44573   UInt16 * oStyleIndex) ;
44574
44575
44576
44577
44578
44579 }
44580
44581
44582
44583
44584
44585
44586
44587 extern "C" {
44588
44589
44590
44591
44592
44593 enum {
44594   kGenericDocumentIconResource = -4000,
44595   kGenericStationeryIconResource = -3985,
44596   kGenericEditionFileIconResource = -3989,
44597   kGenericApplicationIconResource = -3996,
44598   kGenericDeskAccessoryIconResource = -3991,
44599   kGenericFolderIconResource = -3999,
44600   kPrivateFolderIconResource = -3994,
44601   kFloppyIconResource = -3998,
44602   kTrashIconResource = -3993,
44603   kGenericRAMDiskIconResource = -3988,
44604   kGenericCDROMIconResource = -3987
44605 };
44606
44607
44608
44609 enum {
44610   kDesktopIconResource = -3992,
44611   kOpenFolderIconResource = -3997,
44612   kGenericHardDiskIconResource = -3995,
44613   kGenericFileServerIconResource = -3972,
44614   kGenericSuitcaseIconResource = -3970,
44615   kGenericMoverObjectIconResource = -3969
44616 };
44617
44618
44619
44620 enum {
44621   kGenericPreferencesIconResource = -3971,
44622   kGenericQueryDocumentIconResource = -16506,
44623   kGenericExtensionIconResource = -16415,
44624   kSystemFolderIconResource = -3983,
44625   kHelpIconResource = -20271,
44626   kAppleMenuFolderIconResource = -3982
44627 };
44628
44629
44630 enum {
44631   genericDocumentIconResource = kGenericDocumentIconResource,
44632   genericStationeryIconResource = kGenericStationeryIconResource,
44633   genericEditionFileIconResource = kGenericEditionFileIconResource,
44634   genericApplicationIconResource = kGenericApplicationIconResource,
44635   genericDeskAccessoryIconResource = kGenericDeskAccessoryIconResource,
44636   genericFolderIconResource = kGenericFolderIconResource,
44637   privateFolderIconResource = kPrivateFolderIconResource,
44638   floppyIconResource = kFloppyIconResource,
44639   trashIconResource = kTrashIconResource,
44640   genericRAMDiskIconResource = kGenericRAMDiskIconResource,
44641   genericCDROMIconResource = kGenericCDROMIconResource,
44642   desktopIconResource = kDesktopIconResource,
44643   openFolderIconResource = kOpenFolderIconResource,
44644   genericHardDiskIconResource = kGenericHardDiskIconResource,
44645   genericFileServerIconResource = kGenericFileServerIconResource,
44646   genericSuitcaseIconResource = kGenericSuitcaseIconResource,
44647   genericMoverObjectIconResource = kGenericMoverObjectIconResource,
44648   genericPreferencesIconResource = kGenericPreferencesIconResource,
44649   genericQueryDocumentIconResource = kGenericQueryDocumentIconResource,
44650   genericExtensionIconResource = kGenericExtensionIconResource,
44651   systemFolderIconResource = kSystemFolderIconResource,
44652   appleMenuFolderIconResource = kAppleMenuFolderIconResource
44653 };
44654
44655
44656 enum {
44657   kStartupFolderIconResource = -3981,
44658   kOwnedFolderIconResource = -3980,
44659   kDropFolderIconResource = -3979,
44660   kSharedFolderIconResource = -3978,
44661   kMountedFolderIconResource = -3977,
44662   kControlPanelFolderIconResource = -3976,
44663   kPrintMonitorFolderIconResource = -3975,
44664   kPreferencesFolderIconResource = -3974,
44665   kExtensionsFolderIconResource = -3973,
44666   kFontsFolderIconResource = -3968,
44667   kFullTrashIconResource = -3984
44668 };
44669
44670
44671 enum {
44672   startupFolderIconResource = kStartupFolderIconResource,
44673   ownedFolderIconResource = kOwnedFolderIconResource,
44674   dropFolderIconResource = kDropFolderIconResource,
44675   sharedFolderIconResource = kSharedFolderIconResource,
44676   mountedFolderIconResource = kMountedFolderIconResource,
44677   controlPanelFolderIconResource = kControlPanelFolderIconResource,
44678   printMonitorFolderIconResource = kPrintMonitorFolderIconResource,
44679   preferencesFolderIconResource = kPreferencesFolderIconResource,
44680   extensionsFolderIconResource = kExtensionsFolderIconResource,
44681   fontsFolderIconResource = kFontsFolderIconResource,
44682   fullTrashIconResource = kFullTrashIconResource
44683 };
44684
44685
44686 enum {
44687   kAlignNone = 0x00,
44688   kAlignVerticalCenter = 0x01,
44689   kAlignTop = 0x02,
44690   kAlignBottom = 0x03,
44691   kAlignHorizontalCenter = 0x04,
44692   kAlignAbsoluteCenter = kAlignVerticalCenter | kAlignHorizontalCenter,
44693   kAlignCenterTop = kAlignTop | kAlignHorizontalCenter,
44694   kAlignCenterBottom = kAlignBottom | kAlignHorizontalCenter,
44695   kAlignLeft = 0x08,
44696   kAlignCenterLeft = kAlignVerticalCenter | kAlignLeft,
44697   kAlignTopLeft = kAlignTop | kAlignLeft,
44698   kAlignBottomLeft = kAlignBottom | kAlignLeft,
44699   kAlignRight = 0x0C,
44700   kAlignCenterRight = kAlignVerticalCenter | kAlignRight,
44701   kAlignTopRight = kAlignTop | kAlignRight,
44702   kAlignBottomRight = kAlignBottom | kAlignRight
44703 };
44704
44705
44706 enum {
44707   atNone = kAlignNone,
44708   atVerticalCenter = kAlignVerticalCenter,
44709   atTop = kAlignTop,
44710   atBottom = kAlignBottom,
44711   atHorizontalCenter = kAlignHorizontalCenter,
44712   atAbsoluteCenter = kAlignAbsoluteCenter,
44713   atCenterTop = kAlignCenterTop,
44714   atCenterBottom = kAlignCenterBottom,
44715   atLeft = kAlignLeft,
44716   atCenterLeft = kAlignCenterLeft,
44717   atTopLeft = kAlignTopLeft,
44718   atBottomLeft = kAlignBottomLeft,
44719   atRight = kAlignRight,
44720   atCenterRight = kAlignCenterRight,
44721   atTopRight = kAlignTopRight,
44722   atBottomRight = kAlignBottomRight
44723 };
44724
44725 typedef SInt16 IconAlignmentType;
44726
44727 enum {
44728   kTransformNone = 0x00,
44729   kTransformDisabled = 0x01,
44730   kTransformOffline = 0x02,
44731   kTransformOpen = 0x03,
44732   kTransformLabel1 = 0x0100,
44733   kTransformLabel2 = 0x0200,
44734   kTransformLabel3 = 0x0300,
44735   kTransformLabel4 = 0x0400,
44736   kTransformLabel5 = 0x0500,
44737   kTransformLabel6 = 0x0600,
44738   kTransformLabel7 = 0x0700,
44739   kTransformSelected = 0x4000,
44740   kTransformSelectedDisabled = kTransformSelected | kTransformDisabled,
44741   kTransformSelectedOffline = kTransformSelected | kTransformOffline,
44742   kTransformSelectedOpen = kTransformSelected | kTransformOpen
44743 };
44744
44745
44746 enum {
44747   ttNone = kTransformNone,
44748   ttDisabled = kTransformDisabled,
44749   ttOffline = kTransformOffline,
44750   ttOpen = kTransformOpen,
44751   ttLabel1 = kTransformLabel1,
44752   ttLabel2 = kTransformLabel2,
44753   ttLabel3 = kTransformLabel3,
44754   ttLabel4 = kTransformLabel4,
44755   ttLabel5 = kTransformLabel5,
44756   ttLabel6 = kTransformLabel6,
44757   ttLabel7 = kTransformLabel7,
44758   ttSelected = kTransformSelected,
44759   ttSelectedDisabled = kTransformSelectedDisabled,
44760   ttSelectedOffline = kTransformSelectedOffline,
44761   ttSelectedOpen = kTransformSelectedOpen
44762 };
44763
44764 typedef SInt16 IconTransformType;
44765
44766 enum {
44767   kSelectorLarge1Bit = 0x00000001,
44768   kSelectorLarge4Bit = 0x00000002,
44769   kSelectorLarge8Bit = 0x00000004,
44770   kSelectorLarge32Bit = 0x00000008,
44771   kSelectorLarge8BitMask = 0x00000010,
44772   kSelectorSmall1Bit = 0x00000100,
44773   kSelectorSmall4Bit = 0x00000200,
44774   kSelectorSmall8Bit = 0x00000400,
44775   kSelectorSmall32Bit = 0x00000800,
44776   kSelectorSmall8BitMask = 0x00001000,
44777   kSelectorMini1Bit = 0x00010000,
44778   kSelectorMini4Bit = 0x00020000,
44779   kSelectorMini8Bit = 0x00040000,
44780   kSelectorHuge1Bit = 0x01000000,
44781   kSelectorHuge4Bit = 0x02000000,
44782   kSelectorHuge8Bit = 0x04000000,
44783   kSelectorHuge32Bit = 0x08000000,
44784   kSelectorHuge8BitMask = 0x10000000,
44785   kSelectorAllLargeData = 0x000000FF,
44786   kSelectorAllSmallData = 0x0000FF00,
44787   kSelectorAllMiniData = 0x00FF0000,
44788   kSelectorAllHugeData = (long)0xFF000000,
44789   kSelectorAll1BitData = kSelectorLarge1Bit | kSelectorSmall1Bit | kSelectorMini1Bit | kSelectorHuge1Bit,
44790   kSelectorAll4BitData = kSelectorLarge4Bit | kSelectorSmall4Bit | kSelectorMini4Bit | kSelectorHuge4Bit,
44791   kSelectorAll8BitData = kSelectorLarge8Bit | kSelectorSmall8Bit | kSelectorMini8Bit | kSelectorHuge8Bit,
44792   kSelectorAll32BitData = kSelectorLarge32Bit | kSelectorSmall32Bit | kSelectorHuge32Bit,
44793   kSelectorAllAvailableData = (long)0xFFFFFFFF
44794 };
44795
44796
44797
44798 enum {
44799   svLarge1Bit = kSelectorLarge1Bit,
44800   svLarge4Bit = kSelectorLarge4Bit,
44801   svLarge8Bit = kSelectorLarge8Bit,
44802   svSmall1Bit = kSelectorSmall1Bit,
44803   svSmall4Bit = kSelectorSmall4Bit,
44804   svSmall8Bit = kSelectorSmall8Bit,
44805   svMini1Bit = kSelectorMini1Bit,
44806   svMini4Bit = kSelectorMini4Bit,
44807   svMini8Bit = kSelectorMini8Bit,
44808   svAllLargeData = kSelectorAllLargeData,
44809   svAllSmallData = kSelectorAllSmallData,
44810   svAllMiniData = kSelectorAllMiniData,
44811   svAll1BitData = kSelectorAll1BitData,
44812   svAll4BitData = kSelectorAll4BitData,
44813   svAll8BitData = kSelectorAll8BitData,
44814   svAllAvailableData = kSelectorAllAvailableData
44815 };
44816
44817 typedef UInt32 IconSelectorValue;
44818 typedef OSErr ( * IconActionProcPtr)(ResType theType, Handle *theIcon, void *yourDataPtr);
44819 typedef Handle ( * IconGetterProcPtr)(ResType theType, void *yourDataPtr);
44820 typedef IconActionProcPtr IconActionUPP;
44821 typedef IconGetterProcPtr IconGetterUPP;
44822 extern IconActionUPP
44823 NewIconActionUPP(IconActionProcPtr userRoutine) ;
44824 extern IconGetterUPP
44825 NewIconGetterUPP(IconGetterProcPtr userRoutine) ;
44826 extern void
44827 DisposeIconActionUPP(IconActionUPP userUPP) ;
44828 extern void
44829 DisposeIconGetterUPP(IconGetterUPP userUPP) ;
44830 extern OSErr
44831 InvokeIconActionUPP(
44832   ResType theType,
44833   Handle * theIcon,
44834   void * yourDataPtr,
44835   IconActionUPP userUPP) ;
44836 extern Handle
44837 InvokeIconGetterUPP(
44838   ResType theType,
44839   void * yourDataPtr,
44840   IconGetterUPP userUPP) ;
44841
44842 typedef IconGetterProcPtr IconGetter;
44843 typedef IconActionProcPtr IconAction;
44844
44845 struct CIcon {
44846   PixMap iconPMap;
44847   BitMap iconMask;
44848   BitMap iconBMap;
44849   Handle iconData;
44850   SInt16 iconMaskData[1];
44851 };
44852 typedef struct CIcon CIcon;
44853 typedef CIcon * CIconPtr;
44854 typedef CIconPtr * CIconHandle;
44855 extern CIconHandle
44856 GetCIcon(SInt16 iconID) ;
44857 extern void
44858 PlotCIcon(
44859   const Rect * theRect,
44860   CIconHandle theIcon) ;
44861 extern void
44862 DisposeCIcon(CIconHandle theIcon) ;
44863 extern Handle
44864 GetIcon(SInt16 iconID) ;
44865 extern void
44866 PlotIcon(
44867   const Rect * theRect,
44868   Handle theIcon) ;
44869 typedef Handle IconSuiteRef;
44870 typedef Handle IconCacheRef;
44871
44872 typedef struct OpaqueIconRef* IconRef;
44873 extern OSErr
44874 PlotIconID(
44875   const Rect * theRect,
44876   IconAlignmentType align,
44877   IconTransformType transform,
44878   SInt16 theResID) ;
44879 extern OSErr
44880 NewIconSuite(IconSuiteRef * theIconSuite) ;
44881 extern OSErr
44882 AddIconToSuite(
44883   Handle theIconData,
44884   IconSuiteRef theSuite,
44885   ResType theType) ;
44886 extern OSErr
44887 GetIconFromSuite(
44888   Handle * theIconData,
44889   IconSuiteRef theSuite,
44890   ResType theType) ;
44891 extern OSErr
44892 ForEachIconDo(
44893   IconSuiteRef theSuite,
44894   IconSelectorValue selector,
44895   IconActionUPP action,
44896   void * yourDataPtr) ;
44897 extern OSErr
44898 GetIconSuite(
44899   IconSuiteRef * theIconSuite,
44900   SInt16 theResID,
44901   IconSelectorValue selector) ;
44902 extern OSErr
44903 DisposeIconSuite(
44904   IconSuiteRef theIconSuite,
44905   Boolean disposeData) ;
44906 extern OSErr
44907 PlotIconSuite(
44908   const Rect * theRect,
44909   IconAlignmentType align,
44910   IconTransformType transform,
44911   IconSuiteRef theIconSuite) ;
44912 extern OSErr
44913 MakeIconCache(
44914   IconCacheRef * theCache,
44915   IconGetterUPP makeIcon,
44916   void * yourDataPtr) ;
44917 extern OSErr
44918 LoadIconCache(
44919   const Rect * theRect,
44920   IconAlignmentType align,
44921   IconTransformType transform,
44922   IconCacheRef theIconCache) ;
44923 extern OSErr
44924 PlotIconMethod(
44925   const Rect * theRect,
44926   IconAlignmentType align,
44927   IconTransformType transform,
44928   IconGetterUPP theMethod,
44929   void * yourDataPtr) ;
44930 extern OSErr
44931 GetLabel(
44932   SInt16 labelNumber,
44933   RGBColor * labelColor,
44934   Str255 labelString) ;
44935 extern Boolean
44936 PtInIconID(
44937   Point testPt,
44938   const Rect * iconRect,
44939   IconAlignmentType align,
44940   SInt16 iconID) ;
44941 extern Boolean
44942 PtInIconSuite(
44943   Point testPt,
44944   const Rect * iconRect,
44945   IconAlignmentType align,
44946   IconSuiteRef theIconSuite) ;
44947 extern Boolean
44948 PtInIconMethod(
44949   Point testPt,
44950   const Rect * iconRect,
44951   IconAlignmentType align,
44952   IconGetterUPP theMethod,
44953   void * yourDataPtr) ;
44954 extern Boolean
44955 RectInIconID(
44956   const Rect * testRect,
44957   const Rect * iconRect,
44958   IconAlignmentType align,
44959   SInt16 iconID) ;
44960 extern Boolean
44961 RectInIconSuite(
44962   const Rect * testRect,
44963   const Rect * iconRect,
44964   IconAlignmentType align,
44965   IconSuiteRef theIconSuite) ;
44966 extern Boolean
44967 RectInIconMethod(
44968   const Rect * testRect,
44969   const Rect * iconRect,
44970   IconAlignmentType align,
44971   IconGetterUPP theMethod,
44972   void * yourDataPtr) ;
44973 extern OSErr
44974 IconIDToRgn(
44975   RgnHandle theRgn,
44976   const Rect * iconRect,
44977   IconAlignmentType align,
44978   SInt16 iconID) ;
44979 extern OSErr
44980 IconSuiteToRgn(
44981   RgnHandle theRgn,
44982   const Rect * iconRect,
44983   IconAlignmentType align,
44984   IconSuiteRef theIconSuite) ;
44985 extern OSErr
44986 IconMethodToRgn(
44987   RgnHandle theRgn,
44988   const Rect * iconRect,
44989   IconAlignmentType align,
44990   IconGetterUPP theMethod,
44991   void * yourDataPtr) ;
44992 extern OSErr
44993 SetSuiteLabel(
44994   IconSuiteRef theSuite,
44995   SInt16 theLabel) ;
44996 extern SInt16
44997 GetSuiteLabel(IconSuiteRef theSuite) ;
44998 extern OSErr
44999 GetIconCacheData(
45000   IconCacheRef theCache,
45001   void ** theData) ;
45002 extern OSErr
45003 SetIconCacheData(
45004   IconCacheRef theCache,
45005   void * theData) ;
45006 extern OSErr
45007 GetIconCacheProc(
45008   IconCacheRef theCache,
45009   IconGetterUPP * theProc) ;
45010 extern OSErr
45011 SetIconCacheProc(
45012   IconCacheRef theCache,
45013   IconGetterUPP theProc) ;
45014 extern OSErr
45015 PlotIconHandle(
45016   const Rect * theRect,
45017   IconAlignmentType align,
45018   IconTransformType transform,
45019   Handle theIcon) ;
45020 extern OSErr
45021 PlotSICNHandle(
45022   const Rect * theRect,
45023   IconAlignmentType align,
45024   IconTransformType transform,
45025   Handle theSICN) ;
45026 extern OSErr
45027 PlotCIconHandle(
45028   const Rect * theRect,
45029   IconAlignmentType align,
45030   IconTransformType transform,
45031   CIconHandle theCIcon) ;
45032 enum {
45033   kSystemIconsCreator = 'macs'
45034 };
45035 enum {
45036   kClipboardIcon = 'CLIP',
45037   kClippingUnknownTypeIcon = 'clpu',
45038   kClippingPictureTypeIcon = 'clpp',
45039   kClippingTextTypeIcon = 'clpt',
45040   kClippingSoundTypeIcon = 'clps',
45041   kDesktopIcon = 'desk',
45042   kFinderIcon = 'FNDR',
45043   kFontSuitcaseIcon = 'FFIL',
45044   kFullTrashIcon = 'ftrh',
45045   kGenericApplicationIcon = 'APPL',
45046   kGenericCDROMIcon = 'cddr',
45047   kGenericControlPanelIcon = 'APPC',
45048   kGenericControlStripModuleIcon = 'sdev',
45049   kGenericComponentIcon = 'thng',
45050   kGenericDeskAccessoryIcon = 'APPD',
45051   kGenericDocumentIcon = 'docu',
45052   kGenericEditionFileIcon = 'edtf',
45053   kGenericExtensionIcon = 'INIT',
45054   kGenericFileServerIcon = 'srvr',
45055   kGenericFontIcon = 'ffil',
45056   kGenericFontScalerIcon = 'sclr',
45057   kGenericFloppyIcon = 'flpy',
45058   kGenericHardDiskIcon = 'hdsk',
45059   kGenericIDiskIcon = 'idsk',
45060   kGenericRemovableMediaIcon = 'rmov',
45061   kGenericMoverObjectIcon = 'movr',
45062   kGenericPCCardIcon = 'pcmc',
45063   kGenericPreferencesIcon = 'pref',
45064   kGenericQueryDocumentIcon = 'qery',
45065   kGenericRAMDiskIcon = 'ramd',
45066   kGenericSharedLibaryIcon = 'shlb',
45067   kGenericStationeryIcon = 'sdoc',
45068   kGenericSuitcaseIcon = 'suit',
45069   kGenericURLIcon = 'gurl',
45070   kGenericWORMIcon = 'worm',
45071   kInternationalResourcesIcon = 'ifil',
45072   kKeyboardLayoutIcon = 'kfil',
45073   kSoundFileIcon = 'sfil',
45074   kSystemSuitcaseIcon = 'zsys',
45075   kTrashIcon = 'trsh',
45076   kTrueTypeFontIcon = 'tfil',
45077   kTrueTypeFlatFontIcon = 'sfnt',
45078   kTrueTypeMultiFlatFontIcon = 'ttcf',
45079   kUserIDiskIcon = 'udsk',
45080   kUnknownFSObjectIcon = 'unfs',
45081   kInternationResourcesIcon = kInternationalResourcesIcon
45082 };
45083
45084
45085 enum {
45086   kInternetLocationHTTPIcon = 'ilht',
45087   kInternetLocationFTPIcon = 'ilft',
45088   kInternetLocationAppleShareIcon = 'ilaf',
45089   kInternetLocationAppleTalkZoneIcon = 'ilat',
45090   kInternetLocationFileIcon = 'ilfi',
45091   kInternetLocationMailIcon = 'ilma',
45092   kInternetLocationNewsIcon = 'ilnw',
45093   kInternetLocationNSLNeighborhoodIcon = 'ilns',
45094   kInternetLocationGenericIcon = 'ilge'
45095 };
45096
45097
45098 enum {
45099   kGenericFolderIcon = 'fldr',
45100   kDropFolderIcon = 'dbox',
45101   kMountedFolderIcon = 'mntd',
45102   kOpenFolderIcon = 'ofld',
45103   kOwnedFolderIcon = 'ownd',
45104   kPrivateFolderIcon = 'prvf',
45105   kSharedFolderIcon = 'shfl'
45106 };
45107
45108
45109 enum {
45110   kSharingPrivsNotApplicableIcon = 'shna',
45111   kSharingPrivsReadOnlyIcon = 'shro',
45112   kSharingPrivsReadWriteIcon = 'shrw',
45113   kSharingPrivsUnknownIcon = 'shuk',
45114   kSharingPrivsWritableIcon = 'writ'
45115 };
45116
45117
45118
45119 enum {
45120   kUserFolderIcon = 'ufld',
45121   kWorkgroupFolderIcon = 'wfld',
45122   kGuestUserIcon = 'gusr',
45123   kUserIcon = 'user',
45124   kOwnerIcon = 'susr',
45125   kGroupIcon = 'grup'
45126 };
45127
45128
45129 enum {
45130   kAppearanceFolderIcon = 'appr',
45131   kAppleExtrasFolderIcon = 'aexÄ',
45132   kAppleMenuFolderIcon = 'amnu',
45133   kApplicationsFolderIcon = 'apps',
45134   kApplicationSupportFolderIcon = 'asup',
45135   kAssistantsFolderIcon = 'astÄ',
45136   kColorSyncFolderIcon = 'prof',
45137   kContextualMenuItemsFolderIcon = 'cmnu',
45138   kControlPanelDisabledFolderIcon = 'ctrD',
45139   kControlPanelFolderIcon = 'ctrl',
45140   kControlStripModulesFolderIcon = 'sdvÄ',
45141   kDocumentsFolderIcon = 'docs',
45142   kExtensionsDisabledFolderIcon = 'extD',
45143   kExtensionsFolderIcon = 'extn',
45144   kFavoritesFolderIcon = 'favs',
45145   kFontsFolderIcon = 'font',
45146   kHelpFolderIcon = 'Ählp',
45147   kInternetFolderIcon = 'intÄ',
45148   kInternetPlugInFolderIcon = 'Änet',
45149   kInternetSearchSitesFolderIcon = 'issf',
45150   kLocalesFolderIcon = 'Äloc',
45151   kMacOSReadMeFolderIcon = 'morÄ',
45152   kPublicFolderIcon = 'pubf',
45153   kPreferencesFolderIcon = 'prfÄ',
45154   kPrinterDescriptionFolderIcon = 'ppdf',
45155   kPrinterDriverFolderIcon = 'Äprd',
45156   kPrintMonitorFolderIcon = 'prnt',
45157   kRecentApplicationsFolderIcon = 'rapp',
45158   kRecentDocumentsFolderIcon = 'rdoc',
45159   kRecentServersFolderIcon = 'rsrv',
45160   kScriptingAdditionsFolderIcon = 'Äscr',
45161   kSharedLibrariesFolderIcon = 'Älib',
45162   kScriptsFolderIcon = 'scrÄ',
45163   kShutdownItemsDisabledFolderIcon = 'shdD',
45164   kShutdownItemsFolderIcon = 'shdf',
45165   kSpeakableItemsFolder = 'spki',
45166   kStartupItemsDisabledFolderIcon = 'strD',
45167   kStartupItemsFolderIcon = 'strt',
45168   kSystemExtensionDisabledFolderIcon = 'macD',
45169   kSystemFolderIcon = 'macs',
45170   kTextEncodingsFolderIcon = 'Ätex',
45171   kUsersFolderIcon = 'usrÄ',
45172   kUtilitiesFolderIcon = 'utiÄ',
45173   kVoicesFolderIcon = 'fvoc'
45174 };
45175
45176
45177 enum {
45178   kAppleScriptBadgeIcon = 'scrp',
45179   kLockedBadgeIcon = 'lbdg',
45180   kMountedBadgeIcon = 'mbdg',
45181   kSharedBadgeIcon = 'sbdg',
45182   kAliasBadgeIcon = 'abdg',
45183   kAlertCautionBadgeIcon = 'cbdg'
45184 };
45185
45186
45187 enum {
45188   kAlertNoteIcon = 'note',
45189   kAlertCautionIcon = 'caut',
45190   kAlertStopIcon = 'stop'
45191 };
45192
45193
45194 enum {
45195   kAppleTalkIcon = 'atlk',
45196   kAppleTalkZoneIcon = 'atzn',
45197   kAFPServerIcon = 'afps',
45198   kFTPServerIcon = 'ftps',
45199   kHTTPServerIcon = 'htps',
45200   kGenericNetworkIcon = 'gnet',
45201   kIPFileServerIcon = 'isrv'
45202 };
45203
45204
45205 enum {
45206   kToolbarCustomizeIcon = 'tcus',
45207   kToolbarDeleteIcon = 'tdel',
45208   kToolbarFavoritesIcon = 'tfav',
45209   kToolbarHomeIcon = 'thom'
45210 };
45211
45212
45213 enum {
45214   kAppleLogoIcon = 'capl',
45215   kAppleMenuIcon = 'sapl',
45216   kBackwardArrowIcon = 'baro',
45217   kFavoriteItemsIcon = 'favr',
45218   kForwardArrowIcon = 'faro',
45219   kGridIcon = 'grid',
45220   kHelpIcon = 'help',
45221   kKeepArrangedIcon = 'arng',
45222   kLockedIcon = 'lock',
45223   kNoFilesIcon = 'nfil',
45224   kNoFolderIcon = 'nfld',
45225   kNoWriteIcon = 'nwrt',
45226   kProtectedApplicationFolderIcon = 'papp',
45227   kProtectedSystemFolderIcon = 'psys',
45228   kRecentItemsIcon = 'rcnt',
45229   kShortcutIcon = 'shrt',
45230   kSortAscendingIcon = 'asnd',
45231   kSortDescendingIcon = 'dsnd',
45232   kUnlockedIcon = 'ulck',
45233   kConnectToIcon = 'cnct',
45234   kGenericWindowIcon = 'gwin',
45235   kQuestionMarkIcon = 'ques',
45236   kDeleteAliasIcon = 'dali',
45237   kEjectMediaIcon = 'ejec',
45238   kBurningIcon = 'burn',
45239   kRightContainerArrowIcon = 'rcar'
45240 };
45241
45242
45243
45244
45245 typedef UInt32 IconServicesUsageFlags;
45246 enum {
45247   kIconServicesNormalUsageFlag = 0
45248 };
45249
45250
45251
45252
45253
45254
45255
45256 enum {
45257   kIconServicesCatalogInfoMask = (kFSCatInfoNodeID | kFSCatInfoParentDirID | kFSCatInfoVolume | kFSCatInfoNodeFlags | kFSCatInfoFinderInfo | kFSCatInfoFinderXInfo | kFSCatInfoUserAccess)
45258 };
45259 typedef UInt32 PlotIconRefFlags;
45260 enum {
45261
45262
45263
45264
45265   kPlotIconRefNormalFlags = 0L,
45266
45267
45268
45269
45270   kPlotIconRefNoImage = (1 << 1),
45271
45272
45273
45274
45275   kPlotIconRefNoMask = (1 << 2)
45276 };
45277 extern OSErr
45278 IconRefToIconFamily(
45279   IconRef theIconRef,
45280   IconSelectorValue whichIcons,
45281   IconFamilyHandle * iconFamily) ;
45282 extern OSErr
45283 IconFamilyToIconSuite(
45284   IconFamilyHandle iconFamily,
45285   IconSelectorValue whichIcons,
45286   IconSuiteRef * iconSuite) ;
45287 extern OSErr
45288 IconSuiteToIconFamily(
45289   IconSuiteRef iconSuite,
45290   IconSelectorValue whichIcons,
45291   IconFamilyHandle * iconFamily) ;
45292 extern OSErr
45293 SetIconFamilyData(
45294   IconFamilyHandle iconFamily,
45295   OSType iconType,
45296   Handle h) ;
45297 extern OSErr
45298 GetIconFamilyData(
45299   IconFamilyHandle iconFamily,
45300   OSType iconType,
45301   Handle h) ;
45302 extern OSErr
45303 GetIconRefOwners(
45304   IconRef theIconRef,
45305   UInt16 * owners) ;
45306 extern OSErr
45307 AcquireIconRef(IconRef theIconRef) ;
45308 extern OSErr
45309 ReleaseIconRef(IconRef theIconRef) ;
45310 extern OSErr
45311 GetIconRefFromFile(
45312   const FSSpec * theFile,
45313   IconRef * theIconRef,
45314   SInt16 * theLabel) ;
45315 extern OSErr
45316 GetIconRef(
45317   SInt16 vRefNum,
45318   OSType creator,
45319   OSType iconType,
45320   IconRef * theIconRef) ;
45321 extern OSErr
45322 GetIconRefFromFolder(
45323   SInt16 vRefNum,
45324   SInt32 parentFolderID,
45325   SInt32 folderID,
45326   SInt8 attributes,
45327   SInt8 accessPrivileges,
45328   IconRef * theIconRef) ;
45329 extern OSStatus
45330 GetIconRefFromFileInfo(
45331   const FSRef * inRef,
45332   UniCharCount inFileNameLength,
45333   const UniChar * inFileName,
45334   FSCatalogInfoBitmap inWhichInfo,
45335   const FSCatalogInfo * inCatalogInfo,
45336   IconServicesUsageFlags inUsageFlags,
45337   IconRef * outIconRef,
45338   SInt16 * outLabel) ;
45339 extern OSErr
45340 RegisterIconRefFromIconFamily(
45341   OSType creator,
45342   OSType iconType,
45343   IconFamilyHandle iconFamily,
45344   IconRef * theIconRef) ;
45345 extern OSErr
45346 RegisterIconRefFromResource(
45347   OSType creator,
45348   OSType iconType,
45349   const FSSpec * resourceFile,
45350   SInt16 resourceID,
45351   IconRef * theIconRef) ;
45352 extern OSStatus
45353 RegisterIconRefFromFSRef(
45354   OSType creator,
45355   OSType iconType,
45356   const FSRef * iconFile,
45357   IconRef * theIconRef) ;
45358 extern OSErr
45359 UnregisterIconRef(
45360   OSType creator,
45361   OSType iconType) ;
45362 extern OSErr
45363 UpdateIconRef(IconRef theIconRef) ;
45364 extern OSErr
45365 OverrideIconRefFromResource(
45366   IconRef theIconRef,
45367   const FSSpec * resourceFile,
45368   SInt16 resourceID) ;
45369 extern OSErr
45370 OverrideIconRef(
45371   IconRef oldIconRef,
45372   IconRef newIconRef) ;
45373 extern OSErr
45374 RemoveIconRefOverride(IconRef theIconRef) ;
45375 extern OSErr
45376 CompositeIconRef(
45377   IconRef backgroundIconRef,
45378   IconRef foregroundIconRef,
45379   IconRef * compositeIconRef) ;
45380 extern OSErr
45381 IsIconRefComposite(
45382   IconRef compositeIconRef,
45383   IconRef * backgroundIconRef,
45384   IconRef * foregroundIconRef) ;
45385 extern Boolean
45386 IsValidIconRef(IconRef theIconRef) ;
45387 extern OSErr
45388 PlotIconRef(
45389   const Rect * theRect,
45390   IconAlignmentType align,
45391   IconTransformType transform,
45392   IconServicesUsageFlags theIconServicesUsageFlags,
45393   IconRef theIconRef) ;
45394 extern OSStatus
45395 PlotIconRefInContext(
45396   CGContextRef inContext,
45397   const CGRect * inRect,
45398   IconAlignmentType inAlign,
45399   IconTransformType inTransform,
45400   const RGBColor * inLabelColor,
45401   PlotIconRefFlags inFlags,
45402   IconRef inIconRef) ;
45403 extern Boolean
45404 PtInIconRef(
45405   const Point * testPt,
45406   const Rect * iconRect,
45407   IconAlignmentType align,
45408   IconServicesUsageFlags theIconServicesUsageFlags,
45409   IconRef theIconRef) ;
45410 extern Boolean
45411 RectInIconRef(
45412   const Rect * testRect,
45413   const Rect * iconRect,
45414   IconAlignmentType align,
45415   IconServicesUsageFlags iconServicesUsageFlags,
45416   IconRef theIconRef) ;
45417 extern OSErr
45418 IconRefToRgn(
45419   RgnHandle theRgn,
45420   const Rect * iconRect,
45421   IconAlignmentType align,
45422   IconServicesUsageFlags iconServicesUsageFlags,
45423   IconRef theIconRef) ;
45424 extern OSErr
45425 GetIconSizesFromIconRef(
45426   IconSelectorValue iconSelectorInput,
45427   IconSelectorValue * iconSelectorOutputPtr,
45428   IconServicesUsageFlags iconServicesUsageFlags,
45429   IconRef theIconRef) ;
45430 extern OSErr
45431 FlushIconRefs(
45432   OSType creator,
45433   OSType iconType) ;
45434 extern OSErr
45435 FlushIconRefsByVolume(SInt16 vRefNum) ;
45436 extern OSErr
45437 SetCustomIconsEnabled(
45438   SInt16 vRefNum,
45439   Boolean enableCustomIcons) ;
45440 extern OSErr
45441 GetCustomIconsEnabled(
45442   SInt16 vRefNum,
45443   Boolean * customIconsEnabled) ;
45444 extern Boolean
45445 IsIconRefMaskEmpty(IconRef iconRef) ;
45446 extern IconRef
45447 GetIconRefVariant(
45448   IconRef inIconRef,
45449   OSType inVariant,
45450   IconTransformType * outTransform) ;
45451 extern OSErr
45452 RegisterIconRefFromIconFile(
45453   OSType creator,
45454   OSType iconType,
45455   const FSSpec * iconFile,
45456   IconRef * theIconRef) ;
45457 extern OSErr
45458 ReadIconFile(
45459   const FSSpec * iconFile,
45460   IconFamilyHandle * iconFamily) ;
45461 extern OSStatus
45462 ReadIconFromFSRef(
45463   const FSRef * ref,
45464   IconFamilyHandle * iconFamily) ;
45465 extern OSErr
45466 WriteIconFile(
45467   IconFamilyHandle iconFamily,
45468   const FSSpec * iconFile) ;
45469
45470
45471
45472
45473
45474
45475 }
45476
45477
45478
45479 extern "C" {
45480
45481
45482
45483
45484
45485
45486
45487 enum {
45488   icPrefNotFoundErr = -666,
45489   icPermErr = -667,
45490   icPrefDataErr = -668,
45491   icInternalErr = -669,
45492   icTruncatedErr = -670,
45493   icNoMoreWritersErr = -671,
45494   icNothingToOverrideErr = -672,
45495   icNoURLErr = -673,
45496   icConfigNotFoundErr = -674,
45497   icConfigInappropriateErr = -675,
45498   icProfileNotFoundErr = -676,
45499   icTooManyProfilesErr = -677
45500 };
45501
45502
45503
45504
45505
45506 enum {
45507   kICComponentInterfaceVersion0 = 0x00000000,
45508   kICComponentInterfaceVersion1 = 0x00010000,
45509   kICComponentInterfaceVersion2 = 0x00020000,
45510   kICComponentInterfaceVersion3 = 0x00030000,
45511   kICComponentInterfaceVersion4 = 0x00040000,
45512   kICComponentInterfaceVersion = kICComponentInterfaceVersion4
45513 };
45514
45515
45516
45517
45518
45519 typedef struct OpaqueICInstance* ICInstance;
45520
45521
45522
45523
45524 struct ICDirSpec {
45525   short vRefNum;
45526   long dirID;
45527 };
45528 typedef struct ICDirSpec ICDirSpec;
45529 typedef ICDirSpec ICDirSpecArray[4];
45530 typedef ICDirSpecArray * ICDirSpecArrayPtr;
45531
45532
45533
45534
45535 typedef UInt32 ICAttr;
45536
45537 enum {
45538   kICAttrLockedBit = 0,
45539   kICAttrVolatileBit = 1
45540 };
45541
45542 enum {
45543   kICAttrNoChange = (unsigned long)0xFFFFFFFF,
45544   kICAttrLockedMask = 0x00000001,
45545   kICAttrVolatileMask = 0x00000002
45546 };
45547
45548
45549
45550
45551
45552 typedef UInt8 ICPerm;
45553
45554 enum {
45555   icNoPerm = 0,
45556   icReadOnlyPerm = 1,
45557   icReadWritePerm = 2
45558 };
45559 typedef long ICProfileID;
45560 typedef ICProfileID * ICProfileIDPtr;
45561
45562 enum {
45563   kICNilProfileID = 0
45564 };
45565
45566
45567
45568
45569
45570 enum {
45571   kICNoUserInteractionBit = 0
45572 };
45573
45574 enum {
45575   kICNoUserInteractionMask = 0x00000001
45576 };
45577
45578 enum {
45579   kICFileType = 'ICAp',
45580   kICCreator = 'ICAp'
45581 };
45582
45583
45584
45585
45586
45587 enum {
45588   kInternetEventClass = 'GURL',
45589   kAEGetURL = 'GURL',
45590   kAEFetchURL = 'FURL',
45591   keyAEAttaching = 'Atch'
45592 };
45593
45594
45595
45596 enum {
45597   kICEditPreferenceEventClass = 'ICAp',
45598   kICEditPreferenceEvent = 'ICAp',
45599   keyICEditPreferenceDestination = 'dest'
45600 };
45601
45602
45603
45604
45605
45606 enum {
45607   kICComponentVersion = 0,
45608   kICNumVersion = 1
45609 };
45610
45611
45612
45613
45614 struct ICFontRecord {
45615   short size;
45616   Style face;
45617   char pad;
45618   Str255 font;
45619 };
45620 typedef struct ICFontRecord ICFontRecord;
45621 typedef ICFontRecord * ICFontRecordPtr;
45622 typedef ICFontRecordPtr * ICFontRecordHandle;
45623
45624
45625
45626
45627 struct ICCharTable {
45628   unsigned char netToMac[256];
45629   unsigned char macToNet[256];
45630 };
45631 typedef struct ICCharTable ICCharTable;
45632 typedef ICCharTable * ICCharTablePtr;
45633 typedef ICCharTablePtr * ICCharTableHandle;
45634
45635
45636
45637
45638 struct ICAppSpec {
45639   OSType fCreator;
45640   Str63 name;
45641 };
45642 typedef struct ICAppSpec ICAppSpec;
45643 typedef ICAppSpec * ICAppSpecPtr;
45644 typedef ICAppSpecPtr * ICAppSpecHandle;
45645 struct ICAppSpecList {
45646   short numberOfItems;
45647   ICAppSpec appSpecs[1];
45648 };
45649 typedef struct ICAppSpecList ICAppSpecList;
45650 typedef ICAppSpecList * ICAppSpecListPtr;
45651 typedef ICAppSpecListPtr * ICAppSpecListHandle;
45652
45653
45654
45655
45656
45657
45658 struct ICFileSpec {
45659   Str31 volName;
45660   long volCreationDate;
45661   FSSpec fss;
45662   AliasRecord alias;
45663
45664
45665 };
45666 typedef struct ICFileSpec ICFileSpec;
45667 typedef ICFileSpec * ICFileSpecPtr;
45668 typedef ICFileSpecPtr * ICFileSpecHandle;
45669 enum {
45670   kICFileSpecHeaderSize = sizeof(ICFileSpec) - sizeof(AliasRecord)
45671 };
45672
45673
45674
45675
45676 typedef long ICMapEntryFlags;
45677 typedef short ICFixedLength;
45678
45679
45680 struct ICMapEntry {
45681   short totalLength;
45682   ICFixedLength fixedLength;
45683   short version;
45684   OSType fileType;
45685   OSType fileCreator;
45686   OSType postCreator;
45687   ICMapEntryFlags flags;
45688
45689   Str255 extension;
45690   Str255 creatorAppName;
45691   Str255 postAppName;
45692   Str255 MIMEType;
45693   Str255 entryName;
45694 };
45695 typedef struct ICMapEntry ICMapEntry;
45696 typedef ICMapEntry * ICMapEntryPtr;
45697 typedef ICMapEntryPtr * ICMapEntryHandle;
45698 enum {
45699   kICMapFixedLength = 22
45700 };
45701
45702 enum {
45703   kICMapBinaryBit = 0,
45704   kICMapResourceForkBit = 1,
45705   kICMapDataForkBit = 2,
45706   kICMapPostBit = 3,
45707   kICMapNotIncomingBit = 4,
45708   kICMapNotOutgoingBit = 5
45709 };
45710
45711 enum {
45712   kICMapBinaryMask = 0x00000001,
45713   kICMapResourceForkMask = 0x00000002,
45714   kICMapDataForkMask = 0x00000004,
45715   kICMapPostMask = 0x00000008,
45716   kICMapNotIncomingMask = 0x00000010,
45717   kICMapNotOutgoingMask = 0x00000020
45718 };
45719
45720
45721
45722
45723 typedef short ICServiceEntryFlags;
45724 struct ICServiceEntry {
45725   Str255 name;
45726   short port;
45727   ICServiceEntryFlags flags;
45728 };
45729 typedef struct ICServiceEntry ICServiceEntry;
45730 typedef ICServiceEntry * ICServiceEntryPtr;
45731 typedef ICServiceEntryPtr * ICServiceEntryHandle;
45732
45733 enum {
45734   kICServicesTCPBit = 0,
45735   kICServicesUDPBit = 1
45736 };
45737
45738 enum {
45739   kICServicesTCPMask = 0x00000001,
45740   kICServicesUDPMask = 0x00000002
45741 };
45742
45743 struct ICServices {
45744   short count;
45745   ICServiceEntry services[1];
45746 };
45747 typedef struct ICServices ICServices;
45748 typedef ICServices * ICServicesPtr;
45749 typedef ICServicesPtr * ICServicesHandle;
45750 extern OSStatus
45751 ICStart(
45752   ICInstance * inst,
45753   OSType signature) ;
45754 extern OSStatus
45755 ICStop(ICInstance inst) ;
45756 extern OSStatus
45757 ICGetVersion(
45758   ICInstance inst,
45759   long whichVersion,
45760   UInt32 * version) ;
45761 extern OSStatus
45762 ICGetConfigName(
45763   ICInstance inst,
45764   Boolean longname,
45765   Str255 name) ;
45766 extern OSStatus
45767 ICGetSeed(
45768   ICInstance inst,
45769   long * seed) ;
45770 extern OSStatus
45771 ICGetPerm(
45772   ICInstance inst,
45773   ICPerm * perm) ;
45774 extern OSStatus
45775 ICBegin(
45776   ICInstance inst,
45777   ICPerm perm) ;
45778 extern OSStatus
45779 ICGetPref(
45780   ICInstance inst,
45781   ConstStr255Param key,
45782   ICAttr * attr,
45783   void * buf,
45784   long * size) ;
45785 extern OSStatus
45786 ICSetPref(
45787   ICInstance inst,
45788   ConstStr255Param key,
45789   ICAttr attr,
45790   const void * buf,
45791   long size) ;
45792 extern OSStatus
45793 ICFindPrefHandle(
45794   ICInstance inst,
45795   ConstStr255Param key,
45796   ICAttr * attr,
45797   Handle prefh) ;
45798 extern OSStatus
45799 ICGetPrefHandle(
45800   ICInstance inst,
45801   ConstStr255Param key,
45802   ICAttr * attr,
45803   Handle * prefh) ;
45804 extern OSStatus
45805 ICSetPrefHandle(
45806   ICInstance inst,
45807   ConstStr255Param key,
45808   ICAttr attr,
45809   Handle prefh) ;
45810 extern OSStatus
45811 ICCountPref(
45812   ICInstance inst,
45813   long * count) ;
45814 extern OSStatus
45815 ICGetIndPref(
45816   ICInstance inst,
45817   long index,
45818   Str255 key) ;
45819 extern OSStatus
45820 ICDeletePref(
45821   ICInstance inst,
45822   ConstStr255Param key) ;
45823 extern OSStatus
45824 ICEnd(ICInstance inst) ;
45825 extern OSStatus
45826 ICGetDefaultPref(
45827   ICInstance inst,
45828   ConstStr255Param key,
45829   Handle prefH) ;
45830 extern OSStatus
45831 ICEditPreferences(
45832   ICInstance inst,
45833   ConstStr255Param key) ;
45834 extern OSStatus
45835 ICLaunchURL(
45836   ICInstance inst,
45837   ConstStr255Param hint,
45838   const void * data,
45839   long len,
45840   long * selStart,
45841   long * selEnd) ;
45842 extern OSStatus
45843 ICParseURL(
45844   ICInstance inst,
45845   ConstStr255Param hint,
45846   const void * data,
45847   long len,
45848   long * selStart,
45849   long * selEnd,
45850   Handle url) ;
45851 extern OSStatus
45852 ICCreateGURLEvent(
45853   ICInstance inst,
45854   OSType helperCreator,
45855   Handle urlH,
45856   AppleEvent * theEvent) ;
45857 extern OSStatus
45858 ICSendGURLEvent(
45859   ICInstance inst,
45860   AppleEvent * theEvent) ;
45861 extern OSStatus
45862 ICMapFilename(
45863   ICInstance inst,
45864   ConstStr255Param filename,
45865   ICMapEntry * entry) ;
45866 extern OSStatus
45867 ICMapTypeCreator(
45868   ICInstance inst,
45869   OSType fType,
45870   OSType fCreator,
45871   ConstStr255Param filename,
45872   ICMapEntry * entry) ;
45873 extern OSStatus
45874 ICMapEntriesFilename(
45875   ICInstance inst,
45876   Handle entries,
45877   ConstStr255Param filename,
45878   ICMapEntry * entry) ;
45879 extern OSStatus
45880 ICMapEntriesTypeCreator(
45881   ICInstance inst,
45882   Handle entries,
45883   OSType fType,
45884   OSType fCreator,
45885   ConstStr255Param filename,
45886   ICMapEntry * entry) ;
45887 extern OSStatus
45888 ICCountMapEntries(
45889   ICInstance inst,
45890   Handle entries,
45891   long * count) ;
45892 extern OSStatus
45893 ICGetIndMapEntry(
45894   ICInstance inst,
45895   Handle entries,
45896   long index,
45897   long * pos,
45898   ICMapEntry * entry) ;
45899 extern OSStatus
45900 ICGetMapEntry(
45901   ICInstance inst,
45902   Handle entries,
45903   long pos,
45904   ICMapEntry * entry) ;
45905 extern OSStatus
45906 ICSetMapEntry(
45907   ICInstance inst,
45908   Handle entries,
45909   long pos,
45910   const ICMapEntry * entry) ;
45911 extern OSStatus
45912 ICDeleteMapEntry(
45913   ICInstance inst,
45914   Handle entries,
45915   long pos) ;
45916 extern OSStatus
45917 ICAddMapEntry(
45918   ICInstance inst,
45919   Handle entries,
45920   const ICMapEntry * entry) ;
45921 extern OSStatus
45922 ICGetCurrentProfile(
45923   ICInstance inst,
45924   ICProfileID * currentID) ;
45925 extern OSStatus
45926 ICSetCurrentProfile(
45927   ICInstance inst,
45928   ICProfileID newID) ;
45929 extern OSStatus
45930 ICCountProfiles(
45931   ICInstance inst,
45932   long * count) ;
45933 extern OSStatus
45934 ICGetIndProfile(
45935   ICInstance inst,
45936   long index,
45937   ICProfileID * thisID) ;
45938 extern OSStatus
45939 ICGetProfileName(
45940   ICInstance inst,
45941   ICProfileID thisID,
45942   Str255 name) ;
45943 extern OSStatus
45944 ICSetProfileName(
45945   ICInstance inst,
45946   ICProfileID thisID,
45947   ConstStr255Param name) ;
45948 extern OSStatus
45949 ICAddProfile(
45950   ICInstance inst,
45951   ICProfileID prototypeID,
45952   ICProfileID * newID) ;
45953 extern OSStatus
45954 ICDeleteProfile(
45955   ICInstance inst,
45956   ICProfileID thisID) ;
45957
45958
45959 }
45960
45961
45962
45963 extern "C" {
45964
45965
45966
45967
45968 struct ProcessSerialNumber {
45969   unsigned long highLongOfPSN;
45970   unsigned long lowLongOfPSN;
45971 };
45972 typedef struct ProcessSerialNumber ProcessSerialNumber;
45973 typedef ProcessSerialNumber * ProcessSerialNumberPtr;
45974 enum {
45975
45976   kNoProcess = 0,
45977   kSystemProcess = 1,
45978   kCurrentProcess = 2
45979 };
45980
45981
45982
45983 typedef unsigned short LaunchFlags;
45984 enum {
45985   launchContinue = 0x4000,
45986   launchNoFileFlags = 0x0800,
45987   launchUseMinimum = 0x0400,
45988   launchDontSwitch = 0x0200,
45989   launchAllow24Bit = 0x0100,
45990   launchInhibitDaemon = 0x0080
45991 };
45992
45993
45994
45995 struct AppParameters {
45996   struct {
45997     UInt16 what;
45998     UInt32 message;
45999     UInt32 when;
46000     Point where;
46001     UInt16 modifiers;
46002   } theMsgEvent;
46003   unsigned long eventRefCon;
46004   unsigned long messageLength;
46005 };
46006 typedef struct AppParameters AppParameters;
46007 typedef AppParameters * AppParametersPtr;
46008
46009 struct LaunchParamBlockRec {
46010   unsigned long reserved1;
46011   unsigned short reserved2;
46012   unsigned short launchBlockID;
46013   unsigned long launchEPBLength;
46014   unsigned short launchFileFlags;
46015   LaunchFlags launchControlFlags;
46016   FSSpecPtr launchAppSpec;
46017   ProcessSerialNumber launchProcessSN;
46018   unsigned long launchPreferredSize;
46019   unsigned long launchMinimumSize;
46020   unsigned long launchAvailableSize;
46021   AppParametersPtr launchAppParameters;
46022 };
46023 typedef struct LaunchParamBlockRec LaunchParamBlockRec;
46024 typedef LaunchParamBlockRec * LaunchPBPtr;
46025
46026
46027 enum {
46028   extendedBlock = 0x4C43,
46029   extendedBlockLen = sizeof(LaunchParamBlockRec) - 12
46030 };
46031
46032 enum {
46033
46034   modeReserved = 0x01000000,
46035   modeControlPanel = 0x00080000,
46036   modeLaunchDontSwitch = 0x00040000,
46037   modeDeskAccessory = 0x00020000,
46038   modeMultiLaunch = 0x00010000,
46039   modeNeedSuspendResume = 0x00004000,
46040   modeCanBackground = 0x00001000,
46041   modeDoesActivateOnFGSwitch = 0x00000800,
46042   modeOnlyBackground = 0x00000400,
46043   modeGetFrontClicks = 0x00000200,
46044   modeGetAppDiedMsg = 0x00000100,
46045   mode32BitCompatible = 0x00000080,
46046   modeHighLevelEventAware = 0x00000040,
46047   modeLocalAndRemoteHLEvents = 0x00000020,
46048   modeStationeryAware = 0x00000010,
46049   modeUseTextEditServices = 0x00000008,
46050   modeDisplayManagerAware = 0x00000004
46051 };
46052 struct ProcessInfoRec {
46053   unsigned long processInfoLength;
46054   StringPtr processName;
46055   ProcessSerialNumber processNumber;
46056   unsigned long processType;
46057   OSType processSignature;
46058   unsigned long processMode;
46059   Ptr processLocation;
46060   unsigned long processSize;
46061   unsigned long processFreeMem;
46062   ProcessSerialNumber processLauncher;
46063   unsigned long processLaunchDate;
46064   unsigned long processActiveTime;
46065   FSSpecPtr processAppSpec;
46066 };
46067 typedef struct ProcessInfoRec ProcessInfoRec;
46068 typedef ProcessInfoRec * ProcessInfoRecPtr;
46069 struct ProcessInfoExtendedRec {
46070   unsigned long processInfoLength;
46071   StringPtr processName;
46072   ProcessSerialNumber processNumber;
46073   unsigned long processType;
46074   OSType processSignature;
46075   unsigned long processMode;
46076   Ptr processLocation;
46077   unsigned long processSize;
46078   unsigned long processFreeMem;
46079   ProcessSerialNumber processLauncher;
46080   unsigned long processLaunchDate;
46081   unsigned long processActiveTime;
46082   FSSpecPtr processAppSpec;
46083   unsigned long processTempMemTotal;
46084   unsigned long processPurgeableTempMemTotal;
46085 };
46086 typedef struct ProcessInfoExtendedRec ProcessInfoExtendedRec;
46087 typedef ProcessInfoExtendedRec * ProcessInfoExtendedRecPtr;
46088
46089 struct SizeResourceRec {
46090   unsigned short flags;
46091   unsigned long preferredHeapSize;
46092   unsigned long minimumHeapSize;
46093 };
46094 typedef struct SizeResourceRec SizeResourceRec;
46095 typedef SizeResourceRec * SizeResourceRecPtr;
46096 typedef SizeResourceRecPtr * SizeResourceRecHandle;
46097
46098
46099
46100
46101
46102 enum {
46103
46104
46105
46106
46107
46108   kProcessDictionaryIncludeAllInformationMask = (long)0xFFFFFFFF
46109 };
46110 enum {
46111   kQuitBeforeNormalTimeMask = 1,
46112   kQuitAtNormalTimeMask = 2,
46113   kQuitBeforeFBAsQuitMask = 4,
46114   kQuitBeforeShellQuitsMask = 8,
46115   kQuitBeforeTerminatorAppQuitsMask = 16,
46116   kQuitNeverMask = 32,
46117   kQuitOptionsMask = 0x7F,
46118   kQuitNotQuitDuringInstallMask = 0x0100,
46119   kQuitNotQuitDuringLogoutMask = 0x0200
46120 };
46121 extern OSErr
46122 LaunchApplication(LaunchPBPtr LaunchParams) ;
46123 extern OSErr
46124 GetCurrentProcess(ProcessSerialNumber * PSN) ;
46125 extern OSErr
46126 GetFrontProcess(ProcessSerialNumber * PSN) ;
46127 extern OSErr
46128 GetNextProcess(ProcessSerialNumber * PSN) ;
46129 extern OSErr
46130 GetProcessInformation(
46131   const ProcessSerialNumber * PSN,
46132   ProcessInfoRec * info) ;
46133 extern CFDictionaryRef
46134 ProcessInformationCopyDictionary(
46135   const ProcessSerialNumber * PSN,
46136   UInt32 infoToReturn) ;
46137 extern OSErr
46138 SetFrontProcess(const ProcessSerialNumber * PSN) ;
46139
46140
46141
46142
46143
46144
46145
46146 enum {
46147
46148
46149
46150
46151
46152
46153   kSetFrontProcessFrontWindowOnly = (1 << 0)
46154 };
46155 extern OSStatus
46156 SetFrontProcessWithOptions(
46157   const ProcessSerialNumber * inProcess,
46158   OptionBits inOptions) ;
46159 extern OSErr
46160 WakeUpProcess(const ProcessSerialNumber * PSN) ;
46161 extern OSErr
46162 SameProcess(
46163   const ProcessSerialNumber * PSN1,
46164   const ProcessSerialNumber * PSN2,
46165   Boolean * result) ;
46166 extern void
46167 ExitToShell(void) ;
46168 extern OSStatus
46169 GetProcessBundleLocation(
46170   const ProcessSerialNumber * psn,
46171   FSRef * location) ;
46172 extern OSStatus
46173 CopyProcessName(
46174   const ProcessSerialNumber * psn,
46175   CFStringRef * name) ;
46176 extern OSStatus
46177 GetProcessPID(
46178   const ProcessSerialNumber * psn,
46179   pid_t * pid) ;
46180 extern OSStatus
46181 GetProcessForPID(
46182   pid_t pid,
46183   ProcessSerialNumber * psn) ;
46184 extern Boolean
46185 IsProcessVisible(const ProcessSerialNumber * psn) ;
46186 extern OSErr
46187 ShowHideProcess(
46188   const ProcessSerialNumber * psn,
46189   Boolean visible) ;
46190
46191
46192
46193
46194 enum {
46195   initDev = 0,
46196   hitDev = 1,
46197   closeDev = 2,
46198   nulDev = 3,
46199   updateDev = 4,
46200   activDev = 5,
46201   deactivDev = 6,
46202   keyEvtDev = 7,
46203   macDev = 8,
46204   undoDev = 9,
46205   cutDev = 10,
46206   copyDev = 11,
46207   pasteDev = 12,
46208   clearDev = 13,
46209   cursorDev = 14
46210 };
46211
46212
46213 enum {
46214   cdevGenErr = -1,
46215   cdevMemErr = 0,
46216   cdevResErr = 1,
46217   cdevUnset = 3
46218 };
46219
46220
46221
46222
46223
46224
46225
46226 }
46227
46228
46229
46230 extern "C" {
46231
46232
46233
46234
46235 extern double acos (double);
46236 extern double asin (double);
46237 extern double atan (double);
46238 extern double atan2 (double, double);
46239 extern double ceil (double);
46240 extern double cos (double);
46241 extern double cosh (double);
46242 extern double exp (double);
46243 extern double fabs (double);
46244 extern double floor (double);
46245 extern double fmod (double, double);
46246 extern double frexp (double, int *);
46247 extern double ldexp (double, int);
46248 extern double log10 (double);
46249 extern double log (double);
46250 extern double modf (double, double *);
46251 extern double pow (double, double);
46252 extern double sin (double);
46253 extern double sinh (double);
46254 extern double sqrt (double);
46255 extern double tan (double);
46256 extern double tanh (double);
46257
46258
46259
46260 enum {
46261     kAXErrorSuccess = 0,
46262     kAXErrorFailure = -25200,
46263     kAXErrorIllegalArgument = -25201,
46264     kAXErrorInvalidUIElement = -25202,
46265     kAXErrorInvalidUIElementObserver = -25203,
46266     kAXErrorCannotComplete = -25204,
46267     kAXErrorAttributeUnsupported = -25205,
46268     kAXErrorActionUnsupported = -25206,
46269     kAXErrorNotificationUnsupported = -25207,
46270     kAXErrorNotImplemented = -25208,
46271     kAXErrorNotificationAlreadyRegistered = -25209,
46272     kAXErrorNotificationNotRegistered = -25210,
46273     kAXErrorAPIDisabled = -25211,
46274     kAXErrorNoValue = -25212
46275 };
46276 typedef SInt32 AXError;
46277
46278
46279
46280 }
46281
46282
46283 extern double acos (double);
46284 extern double asin (double);
46285 extern double atan (double);
46286 extern double atan2 (double, double);
46287 extern double ceil (double);
46288 extern double cos (double);
46289 extern double cosh (double);
46290 extern double exp (double);
46291 extern double fabs (double);
46292 extern double floor (double);
46293 extern double fmod (double, double);
46294 extern double frexp (double, int *);
46295 extern double ldexp (double, int);
46296 extern double log10 (double);
46297 extern double log (double);
46298 extern double modf (double, double *);
46299 extern double pow (double, double);
46300 extern double sin (double);
46301 extern double sinh (double);
46302 extern double sqrt (double);
46303 extern double tan (double);
46304 extern double tanh (double);
46305
46306
46307 extern "C" {
46308
46309
46310
46311
46312 extern double acos (double);
46313 extern double asin (double);
46314 extern double atan (double);
46315 extern double atan2 (double, double);
46316 extern double ceil (double);
46317 extern double cos (double);
46318 extern double cosh (double);
46319 extern double exp (double);
46320 extern double fabs (double);
46321 extern double floor (double);
46322 extern double fmod (double, double);
46323 extern double frexp (double, int *);
46324 extern double ldexp (double, int);
46325 extern double log10 (double);
46326 extern double log (double);
46327 extern double modf (double, double *);
46328 extern double pow (double, double);
46329 extern double sin (double);
46330 extern double sinh (double);
46331 extern double sqrt (double);
46332 extern double tan (double);
46333 extern double tanh (double);
46334
46335
46336
46337 extern Boolean AXAPIEnabled ();
46338
46339 typedef struct __AXUIElement *AXUIElementRef;
46340
46341 extern CFTypeID AXUIElementGetTypeID (void);
46342
46343 extern AXError AXUIElementCopyAttributeNames (AXUIElementRef element, CFArrayRef *names);
46344 extern AXError AXUIElementCopyAttributeValue (AXUIElementRef element, CFStringRef attribute, CFTypeRef *value);
46345 extern AXError AXUIElementGetAttributeValueCount (AXUIElementRef element, CFStringRef attribute, CFIndex *count);
46346 extern AXError AXUIElementCopyAttributeValues (AXUIElementRef element, CFStringRef attribute, CFIndex index, CFIndex maxValues, CFArrayRef *values);
46347 extern AXError AXUIElementIsAttributeSettable (AXUIElementRef element, CFStringRef attribute, Boolean *settable);
46348 extern AXError AXUIElementSetAttributeValue (AXUIElementRef element, CFStringRef attribute, CFTypeRef value);
46349
46350 extern AXError AXUIElementCopyActionNames (AXUIElementRef element, CFArrayRef *names);
46351 extern AXError AXUIElementCopyActionDescription (AXUIElementRef element, CFStringRef action, CFStringRef *description);
46352 extern AXError AXUIElementPerformAction (AXUIElementRef element, CFStringRef action);
46353
46354 extern AXError AXUIElementCopyElementAtPosition (AXUIElementRef application, float x,float y, AXUIElementRef *element);
46355
46356 extern AXUIElementRef AXUIElementCreateApplication (pid_t pid);
46357 extern AXUIElementRef AXUIElementCreateSystemWide (void);
46358
46359 extern AXError AXUIElementGetPid (AXUIElementRef element, pid_t *pid);
46360
46361
46362
46363 extern AXError AXUIElementPostKeyboardEvent (AXUIElementRef application, CGCharCode keyChar, CGKeyCode virtualKey, Boolean keyDown);
46364
46365
46366
46367 typedef struct __AXObserver *AXObserverRef;
46368
46369 typedef void (*AXObserverCallback)(AXObserverRef observer, AXUIElementRef element, CFStringRef notification, void *refcon);
46370
46371 CFTypeID AXObserverGetTypeID (void);
46372
46373 extern AXError AXObserverCreate (pid_t application, AXObserverCallback callback, AXObserverRef *outObserver);
46374
46375 extern AXError AXObserverAddNotification (AXObserverRef observer, AXUIElementRef element, CFStringRef notification, void *refcon);
46376 extern AXError AXObserverRemoveNotification (AXObserverRef observer, AXUIElementRef element, CFStringRef notification);
46377
46378 extern CFRunLoopSourceRef AXObserverGetRunLoopSource (AXObserverRef observer);
46379
46380
46381 }
46382 extern "C" {
46383
46384
46385
46386
46387 extern double acos (double);
46388 extern double asin (double);
46389 extern double atan (double);
46390 extern double atan2 (double, double);
46391 extern double ceil (double);
46392 extern double cos (double);
46393 extern double cosh (double);
46394 extern double exp (double);
46395 extern double fabs (double);
46396 extern double floor (double);
46397 extern double fmod (double, double);
46398 extern double frexp (double, int *);
46399 extern double ldexp (double, int);
46400 extern double log10 (double);
46401 extern double log (double);
46402 extern double modf (double, double *);
46403 extern double pow (double, double);
46404 extern double sin (double);
46405 extern double sinh (double);
46406 extern double sqrt (double);
46407 extern double tan (double);
46408 extern double tanh (double);
46409
46410
46411
46412 typedef enum {
46413
46414     kAXValueCGPointType = 1,
46415     kAXValueCGSizeType = 2,
46416     kAXValueCGRectType = 3,
46417
46418
46419     kAXValueCFRangeType = 4,
46420
46421
46422     kAXValueIllegalType = 0
46423
46424 } AXValueType;
46425
46426
46427 extern CFTypeRef AXValueCreate (AXValueType theType, const void *valuePtr);
46428 extern AXValueType AXValueGetType(CFTypeRef value);
46429
46430 extern Boolean AXValueGetValue(CFTypeRef value, AXValueType theType, void *valuePtr);
46431
46432
46433
46434 }
46435 extern "C" {
46436
46437
46438 enum {
46439
46440   kFBCenglishHighWord = (long)0x80000000,
46441   kFBCdutchHighWord = 0x40000000,
46442   kFBCgermanHighWord = 0x20000000,
46443   kFBCswedishHighWord = 0x10000000,
46444   kFBCdanishHighWord = 0x08000000,
46445   kFBCspanishHighWord = 0x04000000,
46446   kFBCportugueseHighWord = 0x02000000,
46447   kFBCitalianHighWord = 0x01000000,
46448   kFBCfrenchHighWord = 0x00800000,
46449   kFBCromanHighWord = 0x00400000,
46450
46451   kFBCicelandicHighWord = 0x00200000,
46452   kFBChebrewHighWord = 0x00100000,
46453   kFBCarabicHighWord = 0x00080000,
46454   kFBCcenteuroHighWord = 0x00040000,
46455   kFBCcroatianHighWord = 0x00020000,
46456   kFBCturkishHighWord = 0x00010000,
46457   kFBCromanianHighWord = 0x00008000,
46458   kFBCgreekHighWord = 0x00004000,
46459   kFBCcyrillicHighWord = 0x00002000,
46460   kFBCdevanagariHighWord = 0x00001000,
46461   kFBCgujuratiHighWord = 0x00000800,
46462   kFBCgurmukhiHighWord = 0x00000400,
46463   kFBCjapaneseHighWord = 0x00000200,
46464   kFBCkoreanHighWord = 0x00000100,
46465   kFBCdefaultLanguagesHighWord = (long)0xFF800000
46466 };
46467
46468
46469 enum {
46470   kFBCnotAllFoldersSearchable = -30533
46471 };
46472 enum {
46473
46474   kFBCphIndexing = 0,
46475   kFBCphFlushing = 1,
46476   kFBCphMerging = 2,
46477   kFBCphMakingIndexAccessor = 3,
46478   kFBCphCompacting = 4,
46479   kFBCphIndexWaiting = 5,
46480   kFBCphSearching = 6,
46481   kFBCphMakingAccessAccessor = 7,
46482   kFBCphAccessWaiting = 8,
46483   kFBCphSummarizing = 9,
46484   kFBCphIdle = 10,
46485   kFBCphCanceling = 11
46486 };
46487
46488 enum {
46489   kFBCsummarizationFailed = -30533
46490 };
46491 typedef struct OpaqueFBCSearchSession* FBCSearchSession;
46492
46493 typedef struct OpaqueFBCSummaryRef* FBCSummaryRef;
46494
46495 typedef char * FBCWordItem;
46496
46497 typedef FBCWordItem * FBCWordList;
46498 typedef Boolean ( * FBCCallbackProcPtr)(UInt16 phase, float percentDone, void *data);
46499 typedef FBCCallbackProcPtr FBCCallbackUPP;
46500 extern FBCCallbackUPP
46501 NewFBCCallbackUPP(FBCCallbackProcPtr userRoutine) ;
46502 extern void
46503 DisposeFBCCallbackUPP(FBCCallbackUPP userUPP) ;
46504 extern Boolean
46505 InvokeFBCCallbackUPP(
46506   UInt16 phase,
46507   float percentDone,
46508   void * data,
46509   FBCCallbackUPP userUPP) ;
46510 extern void
46511 FBCSetSessionCallback(
46512   FBCSearchSession searchSession,
46513   FBCCallbackUPP fn,
46514   void * data) ;
46515 extern void
46516 FBCSetCallback(
46517   FBCCallbackUPP fn,
46518   void * data) ;
46519 typedef Boolean ( * FBCHitTestProcPtr)(const FSRef *theFile, void *data);
46520 typedef FBCHitTestProcPtr FBCHitTestUPP;
46521 extern FBCHitTestUPP
46522 NewFBCHitTestUPP(FBCHitTestProcPtr userRoutine) ;
46523 extern void
46524 DisposeFBCHitTestUPP(FBCHitTestUPP userUPP) ;
46525 extern Boolean
46526 InvokeFBCHitTestUPP(
46527   const FSRef * theFile,
46528   void * data,
46529   FBCHitTestUPP userUPP) ;
46530 extern void
46531 FBCSetSessionHitTest(
46532   FBCSearchSession theSession,
46533   FBCHitTestUPP fn,
46534   void * data) ;
46535 extern void
46536 FBCSetHeapReservation(UInt32 bytes) ;
46537 extern Boolean
46538 FBCVolumeIsIndexed(SInt16 theVRefNum) ;
46539 extern Boolean
46540 FBCVolumeIsRemote(SInt16 theVRefNum) ;
46541 extern OSErr
46542 FBCVolumeIndexTimeStamp(
46543   SInt16 theVRefNum,
46544   UInt32 * timeStamp) ;
46545 extern OSErr
46546 FBCVolumeIndexPhysicalSize(
46547   SInt16 theVRefNum,
46548   UInt32 * size) ;
46549 extern OSErr
46550 FBCCreateSearchSession(FBCSearchSession * searchSession) ;
46551 extern OSErr
46552 FBCCloneSearchSession(
46553   FBCSearchSession original,
46554   FBCSearchSession * clone) ;
46555 extern OSErr
46556 FBCAddAllVolumesToSession(
46557   FBCSearchSession theSession,
46558   Boolean includeRemote) ;
46559 extern OSErr
46560 FBCSetSessionVolumes(
46561   FBCSearchSession theSession,
46562   const SInt16 vRefNums[],
46563   UInt16 numVolumes) ;
46564 extern OSErr
46565 FBCAddVolumeToSession(
46566   FBCSearchSession theSession,
46567   SInt16 vRefNum) ;
46568 extern OSErr
46569 FBCRemoveVolumeFromSession(
46570   FBCSearchSession theSession,
46571   SInt16 vRefNum) ;
46572 extern OSErr
46573 FBCGetSessionVolumeCount(
46574   FBCSearchSession theSession,
46575   UInt16 * count) ;
46576 extern OSErr
46577 FBCGetSessionVolumes(
46578   FBCSearchSession theSession,
46579   SInt16 vRefNums[],
46580   UInt16 * numVolumes) ;
46581 extern OSErr
46582 FBCDoQuerySearch(
46583   FBCSearchSession theSession,
46584   char * queryText,
46585   const FSSpec targetDirs[],
46586   UInt32 numTargets,
46587   UInt32 maxHits,
46588   UInt32 maxHitWords) ;
46589 extern OSErr
46590 FBCDoCFStringSearch(
46591   FBCSearchSession theSession,
46592   CFStringRef queryString,
46593   const FSSpec targetDirs[],
46594   UInt32 numTargets,
46595   UInt32 maxHits,
46596   UInt32 maxHitWords) ;
46597 extern OSErr
46598 FBCDoExampleSearch(
46599   FBCSearchSession theSession,
46600   const UInt32 * exampleHitNums,
46601   UInt32 numExamples,
46602   const FSSpec targetDirs[],
46603   UInt32 numTargets,
46604   UInt32 maxHits,
46605   UInt32 maxHitWords) ;
46606 extern OSErr
46607 FBCBlindExampleSearch(
46608   const FSSpec examples[],
46609   UInt32 numExamples,
46610   const FSSpec targetDirs[],
46611   UInt32 numTargets,
46612   UInt32 maxHits,
46613   UInt32 maxHitWords,
46614   Boolean allIndexes,
46615   Boolean includeRemote,
46616   FBCSearchSession * theSession) ;
46617 extern OSErr
46618 FBCBlindExampleSearchWithCallback(
46619   const FSSpec examples[],
46620   UInt32 numExamples,
46621   const FSSpec targetDirs[],
46622   UInt32 numTargets,
46623   UInt32 maxHits,
46624   UInt32 maxHitWords,
46625   Boolean allIndexes,
46626   Boolean includeRemote,
46627   FBCSearchSession * theSession,
46628   FBCCallbackUPP callback,
46629   void * callbackData,
46630   FBCHitTestUPP userHitTest,
46631   void * userHitTestData) ;
46632 extern OSErr
46633 FBCGetHitCount(
46634   FBCSearchSession theSession,
46635   UInt32 * count) ;
46636 extern OSErr
46637 FBCGetHitDocument(
46638   FBCSearchSession theSession,
46639   UInt32 hitNumber,
46640   FSSpec * theDocument) ;
46641 extern OSErr
46642 FBCGetHitDocumentRef(
46643   FBCSearchSession theSession,
46644   UInt32 hitNumber,
46645   FSRef * theDocument) ;
46646 extern OSErr
46647 FBCGetHitScore(
46648   FBCSearchSession theSession,
46649   UInt32 hitNumber,
46650   float * score) ;
46651 extern OSErr
46652 FBCSummarize(
46653   const void * inBuf,
46654   UInt32 inLength,
46655   void * outBuf,
46656   UInt32 * outLength,
46657   UInt32 * numSentences) ;
46658 extern OSStatus
46659 FBCSummarizeCFString(
46660   CFStringRef inString,
46661   CFStringRef * outString,
46662   UInt32 * numSentences) ;
46663 extern OSStatus
46664 FBCGetSummaryOfCFString(
46665   CFStringRef inString,
46666   FBCSummaryRef * summary) ;
46667 extern OSStatus
46668 FBCGetSummarySentenceCount(
46669   FBCSummaryRef summary,
46670   UInt32 * numSentences) ;
46671 extern OSStatus
46672 FBCGetSummarySentences(
46673   FBCSummaryRef summary,
46674   CFStringRef * outString,
46675   UInt32 * numSentences,
46676   Boolean paragraphs) ;
46677 extern OSStatus
46678 FBCDisposeSummary(FBCSummaryRef summary) ;
46679 extern OSErr
46680 FBCReleaseSessionHits(FBCSearchSession theSession) ;
46681 extern OSErr
46682 FBCDestroySearchSession(FBCSearchSession theSession) ;
46683 extern OSErr
46684 FBCIndexItems(
46685   FSSpecArrayPtr theItems,
46686   UInt32 itemCount) ;
46687 extern OSErr
46688 FBCIndexItemsInLanguages(
46689   FSSpecArrayPtr theItems,
46690   UInt32 itemCount,
46691   UInt32 languageHighBits,
46692   UInt32 languageLowBits) ;
46693 extern OSErr
46694 FBCFindIndexFileFolderForFolder(
46695   const FSRef * inFolder,
46696   FSRef * outFolder) ;
46697 extern OSErr
46698 FBCDeleteIndexFileForFolder(const FSRef * folder) ;
46699 extern OSErr
46700 FBCGetMatchedWords(
46701   FBCSearchSession theSession,
46702   UInt32 hitNumber,
46703   UInt32 * wordCount,
46704   FBCWordList * list) ;
46705 extern OSErr
46706 FBCGetTopicWords(
46707   FBCSearchSession theSession,
46708   UInt32 hitNumber,
46709   UInt32 * wordCount,
46710   FBCWordList * list) ;
46711 extern OSErr
46712 FBCDestroyWordList(
46713   FBCWordList theList,
46714   UInt32 wordCount) ;
46715
46716
46717
46718 enum {
46719
46720   englishHighWord = kFBCenglishHighWord,
46721   dutchHighWord = kFBCdutchHighWord,
46722   germanHighWord = kFBCgermanHighWord,
46723   swedishHighWord = kFBCswedishHighWord,
46724   danishHighWord = kFBCdanishHighWord,
46725   spanishHighWord = kFBCspanishHighWord,
46726   portugueseHighWord = kFBCportugueseHighWord,
46727   italianHighWord = kFBCitalianHighWord,
46728   frenchHighWord = kFBCfrenchHighWord,
46729   romanHighWord = kFBCromanHighWord,
46730
46731   icelandicHighWord = kFBCicelandicHighWord,
46732   hebrewHighWord = kFBChebrewHighWord,
46733   arabicHighWord = kFBCarabicHighWord,
46734   centeuroHighWord = kFBCcenteuroHighWord,
46735   croatianHighWord = kFBCcroatianHighWord,
46736   turkishHighWord = kFBCturkishHighWord,
46737   romanianHighWord = kFBCromanianHighWord,
46738   greekHighWord = kFBCgreekHighWord,
46739   cyrillicHighWord = kFBCcyrillicHighWord,
46740   devanagariHighWord = kFBCdevanagariHighWord,
46741   gujuratiHighWord = kFBCgujuratiHighWord,
46742   gurmukhiHighWord = kFBCgurmukhiHighWord,
46743   japaneseHighWord = kFBCjapaneseHighWord,
46744   koreanHighWord = kFBCkoreanHighWord,
46745   kDefaultLanguagesHighWord = kFBCdefaultLanguagesHighWord
46746 };
46747
46748
46749
46750
46751 }
46752
46753
46754
46755
46756
46757 typedef const void * PMObject;
46758 typedef struct OpaquePMDialog* PMDialog;
46759 typedef struct OpaquePMPrintSettings* PMPrintSettings;
46760 typedef struct OpaquePMPageFormat* PMPageFormat;
46761 typedef struct OpaquePMPrintContext* PMPrintContext;
46762 typedef struct OpaquePMPrintSession* PMPrintSession;
46763 typedef struct OpaquePMPrinter* PMPrinter;
46764 typedef struct OpaquePMServer* PMServer;
46765 enum {
46766   kPMCancel = 0x0080
46767 };
46768 typedef UInt16 PMDestinationType;
46769 enum {
46770   kPMDestinationInvalid = 0,
46771   kPMDestinationPrinter = 1,
46772   kPMDestinationFile = 2,
46773   kPMDestinationFax = 3,
46774   kPMDestinationPreview = 4
46775 };
46776
46777
46778 typedef UInt32 PMTag;
46779 enum {
46780
46781   kPMCurrentValue = 'curr',
46782   kPMDefaultValue = 'dflt',
46783   kPMMinimumValue = 'minv',
46784   kPMMaximumValue = 'maxv',
46785
46786   kPMSourceProfile = 'srcp',
46787
46788   kPMMinRange = 'mnrg',
46789   kPMMaxRange = 'mxrg',
46790   kPMMinSquareResolution = 'mins',
46791   kPMMaxSquareResolution = 'maxs',
46792   kPMDefaultResolution = 'dftr'
46793 };
46794
46795
46796 typedef UInt16 PMOrientation;
46797 enum {
46798   kPMPortrait = 1,
46799   kPMLandscape = 2,
46800   kPMReversePortrait = 3,
46801   kPMReverseLandscape = 4
46802 };
46803
46804
46805 typedef UInt16 PMPrinterState;
46806 enum {
46807   kPMPrinterIdle = 3,
46808   kPMPrinterProcessing = 4,
46809   kPMPrinterStopped = 5
46810 };
46811
46812 enum {
46813   kSizeOfTPrint = 120
46814 };
46815
46816 typedef UInt16 PMColorMode;
46817 enum {
46818   kPMBlackAndWhite = 1,
46819   kPMGray = 2,
46820   kPMColor = 3,
46821   kPMColorModeDuotone = 4,
46822   kPMColorModeSpecialColor = 5
46823 };
46824
46825
46826
46827 typedef UInt32 PMColorSyncIntent;
46828 enum {
46829   kPMColorIntentUndefined = 0x0000,
46830   kPMColorIntentAutomatic = 0x0001,
46831   kPMColorIntentPhoto = 0x0002,
46832   kPMColorIntentBusiness = 0x0004,
46833   kPMColorIntentRelColor = 0x0008,
46834   kPMColorIntentAbsColor = 0x0010,
46835   kPMColorIntentUnused = 0xFFE0
46836 };
46837
46838
46839 typedef UInt32 PMQualityMode;
46840 enum {
46841   kPMQualityLowest = 0x0000,
46842   kPMQualityInkSaver = 0x0001,
46843   kPMQualityDraft = 0x0004,
46844   kPMQualityNormal = 0x0008,
46845   kPMQualityPhoto = 0x000B,
46846   kPMQualityBest = 0x000D,
46847   kPMQualityHighest = 0x000F
46848 };
46849
46850
46851
46852 typedef UInt32 PMPaperType;
46853 enum {
46854   kPMPaperTypeUnknown = 0x0000,
46855   kPMPaperTypePlain = 0x0001,
46856   kPMPaperTypeCoated = 0x0002,
46857   kPMPaperTypePremium = 0x0003,
46858   kPMPaperTypeGlossy = 0x0004,
46859   kPMPaperTypeTransparency = 0x0005,
46860   kPMPaperTypeTShirt = 0x0006
46861 };
46862
46863
46864 typedef UInt16 PMScalingAlignment;
46865 enum {
46866   kPMScalingPinTopLeft = 1,
46867   kPMScalingPinTopRight = 2,
46868   kPMScalingPinBottomLeft = 3,
46869   kPMScalingPinBottomRight = 4,
46870   kPMScalingCenterOnPaper = 5,
46871   kPMScalingCenterOnImgArea = 6
46872 };
46873
46874
46875 typedef UInt16 PMDuplexBinding;
46876 enum {
46877   kPMDuplexBindingLeftRight = 1,
46878   kPMDuplexBindingTopDown = 2
46879 };
46880
46881
46882 typedef UInt16 PMLayoutDirection;
46883 enum {
46884
46885   kPMLayoutLeftRightTopBottom = 1,
46886   kPMLayoutLeftRightBottomTop = 2,
46887   kPMLayoutRightLeftTopBottom = 3,
46888   kPMLayoutRightLeftBottomTop = 4,
46889   kPMLayoutTopBottomLeftRight = 5,
46890   kPMLayoutTopBottomRightLeft = 6,
46891   kPMLayoutBottomTopLeftRight = 7,
46892   kPMLayoutBottomTopRightLeft = 8
46893 };
46894
46895
46896 typedef UInt16 PMBorderType;
46897 enum {
46898   kPMBorderSingleHairline = 1,
46899   kPMBorderDoubleHairline = 2,
46900   kPMBorderSingleThickline = 3,
46901   kPMBorderDoubleThickline = 4
46902 };
46903
46904
46905 enum {
46906   kPSPageInjectAllPages = -1,
46907   kPSInjectionMaxDictSize = 5
46908 };
46909
46910
46911 typedef UInt16 PSInjectionPlacement;
46912 enum {
46913   kPSInjectionBeforeSubsection = 1,
46914   kPSInjectionAfterSubsection = 2,
46915   kPSInjectionReplaceSubsection = 3
46916 };
46917
46918
46919 typedef SInt32 PSInjectionSection;
46920 enum {
46921
46922   kInjectionSectJob = 1,
46923   kInjectionSectCoverPage = 2
46924 };
46925
46926
46927 typedef SInt32 PSInjectionSubsection;
46928 enum {
46929   kInjectionSubPSAdobe = 1,
46930   kInjectionSubPSAdobeEPS = 2,
46931   kInjectionSubBoundingBox = 3,
46932   kInjectionSubEndComments = 4,
46933   kInjectionSubOrientation = 5,
46934   kInjectionSubPages = 6,
46935   kInjectionSubPageOrder = 7,
46936   kInjectionSubBeginProlog = 8,
46937   kInjectionSubEndProlog = 9,
46938   kInjectionSubBeginSetup = 10,
46939   kInjectionSubEndSetup = 11,
46940   kInjectionSubBeginDefaults = 12,
46941   kInjectionSubEndDefaults = 13,
46942   kInjectionSubDocFonts = 14,
46943   kInjectionSubDocNeededFonts = 15,
46944   kInjectionSubDocSuppliedFonts = 16,
46945   kInjectionSubDocNeededRes = 17,
46946   kInjectionSubDocSuppliedRes = 18,
46947   kInjectionSubDocCustomColors = 19,
46948   kInjectionSubDocProcessColors = 20,
46949   kInjectionSubPlateColor = 21,
46950   kInjectionSubPageTrailer = 22,
46951   kInjectionSubTrailer = 23,
46952   kInjectionSubEOF = 24,
46953   kInjectionSubBeginFont = 25,
46954   kInjectionSubEndFont = 26,
46955   kInjectionSubBeginResource = 27,
46956   kInjectionSubEndResource = 28,
46957   kInjectionSubPage = 29,
46958   kInjectionSubBeginPageSetup = 30,
46959   kInjectionSubEndPageSetup = 31
46960 };
46961 enum {
46962   kPMNoError = noErr,
46963   kPMGeneralError = -30870,
46964   kPMOutOfScope = -30871,
46965   kPMInvalidParameter = paramErr,
46966   kPMNoDefaultPrinter = -30872,
46967   kPMNotImplemented = -30873,
46968   kPMNoSuchEntry = -30874,
46969   kPMInvalidPrintSettings = -30875,
46970   kPMInvalidPageFormat = -30876,
46971   kPMValueOutOfRange = -30877,
46972   kPMLockIgnored = -30878
46973 };
46974
46975 enum {
46976   kPMInvalidPrintSession = -30879,
46977   kPMInvalidPrinter = -30880,
46978   kPMObjectInUse = -30881
46979 };
46980
46981
46982 enum {
46983   kPMPrintAllPages = -1
46984 };
46985
46986 enum {
46987   kPMUnlocked = false,
46988   kPMLocked = true
46989 };
46990
46991 struct PMRect {
46992   double top;
46993   double left;
46994   double bottom;
46995   double right;
46996 };
46997 typedef struct PMRect PMRect;
46998 struct PMResolution {
46999   double hRes;
47000   double vRes;
47001 };
47002 typedef struct PMResolution PMResolution;
47003 struct PMLanguageInfo {
47004   Str32 level;
47005   Str32 version;
47006   Str32 release;
47007 };
47008 typedef struct PMLanguageInfo PMLanguageInfo;
47009
47010 extern "C" {
47011
47012
47013
47014
47015
47016
47017
47018 typedef void ( * PMIdleProcPtr)(void);
47019 typedef PMIdleProcPtr PMIdleUPP;
47020 extern PMIdleUPP
47021 NewPMIdleUPP(PMIdleProcPtr userRoutine) ;
47022 extern void
47023 DisposePMIdleUPP(PMIdleUPP userUPP) ;
47024 extern void
47025 InvokePMIdleUPP(PMIdleUPP userUPP) ;
47026 extern OSStatus
47027 PMRetain(PMObject object) ;
47028 extern OSStatus
47029 PMRelease(PMObject object) ;
47030 extern OSStatus
47031 PMCreateSession(PMPrintSession * printSession) ;
47032 extern OSStatus
47033 PMCreatePageFormat(PMPageFormat * pageFormat) ;
47034 extern OSStatus
47035 PMSessionDefaultPageFormat(
47036   PMPrintSession printSession,
47037   PMPageFormat pageFormat) ;
47038 extern OSStatus
47039 PMSessionValidatePageFormat(
47040   PMPrintSession printSession,
47041   PMPageFormat pageFormat,
47042   Boolean * result) ;
47043 extern OSStatus
47044 PMCreatePrintSettings(PMPrintSettings * printSettings) ;
47045 extern OSStatus
47046 PMSessionDefaultPrintSettings(
47047   PMPrintSession printSession,
47048   PMPrintSettings printSettings) ;
47049 extern OSStatus
47050 PMSessionValidatePrintSettings(
47051   PMPrintSession printSession,
47052   PMPrintSettings printSettings,
47053   Boolean * result) ;
47054 extern OSStatus
47055 PMSessionGeneral(
47056   PMPrintSession printSession,
47057   Ptr pData) ;
47058 extern OSStatus
47059 PMSessionConvertOldPrintRecord(
47060   PMPrintSession printSession,
47061   Handle printRecordHandle,
47062   PMPrintSettings * printSettings,
47063   PMPageFormat * pageFormat) ;
47064 extern OSStatus
47065 PMSessionMakeOldPrintRecord(
47066   PMPrintSession printSession,
47067   PMPrintSettings printSettings,
47068   PMPageFormat pageFormat,
47069   Handle * printRecordHandle) ;
47070 extern OSStatus
47071 PMPrinterGetDescriptionURL(
47072   PMPrinter printer,
47073   CFStringRef descriptionType,
47074   CFURLRef * fileURL) ;
47075 extern OSStatus
47076 PMSessionGetCurrentPrinter(
47077   PMPrintSession printSession,
47078   PMPrinter * currentPrinter) ;
47079 extern OSStatus
47080 PMPrinterGetLanguageInfo(
47081   PMPrinter printer,
47082   PMLanguageInfo * info) ;
47083 extern OSStatus
47084 PMPrinterGetDriverCreator(
47085   PMPrinter printer,
47086   OSType * creator) ;
47087 extern OSStatus
47088 PMPrinterGetDriverReleaseInfo(
47089   PMPrinter printer,
47090   VersRec * release) ;
47091 extern OSStatus
47092 PMPrinterGetPrinterResolutionCount(
47093   PMPrinter printer,
47094   UInt32 * count) ;
47095 extern OSStatus
47096 PMPrinterGetPrinterResolution(
47097   PMPrinter printer,
47098   PMTag tag,
47099   PMResolution * res) ;
47100 extern OSStatus
47101 PMPrinterGetIndexedPrinterResolution(
47102   PMPrinter printer,
47103   UInt32 index,
47104   PMResolution * res) ;
47105 extern Boolean
47106 PMPrinterIsPostScriptCapable(PMPrinter printer) ;
47107 extern OSStatus
47108 PMPrinterGetMakeAndModelName(
47109   PMPrinter printer,
47110   CFStringRef * makeAndModel) ;
47111 extern OSStatus
47112 PMSessionEnableColorSync(PMPrintSession printSession) ;
47113 extern OSStatus
47114 PMSessionDisableColorSync(PMPrintSession printSession) ;
47115 extern OSStatus
47116 PMSessionPostScriptBegin(PMPrintSession printSession) ;
47117 extern OSStatus
47118 PMSessionPostScriptEnd(PMPrintSession printSession) ;
47119 extern OSStatus
47120 PMSessionPostScriptHandle(
47121   PMPrintSession printSession,
47122   Handle psHandle) ;
47123 extern OSStatus
47124 PMSessionPostScriptData(
47125   PMPrintSession printSession,
47126   Ptr psPtr,
47127   Size len) ;
47128 extern OSStatus
47129 PMSessionPostScriptFile(
47130   PMPrintSession printSession,
47131   FSSpec * psFile) ;
47132 extern OSStatus
47133 PMSessionSetPSInjectionData(
47134   PMPrintSession printSession,
47135   PMPrintSettings printSettings,
47136   CFArrayRef injectionDictArray) ;
47137 extern OSStatus
47138 PMSessionError(PMPrintSession printSession) ;
47139 extern OSStatus
47140 PMSessionSetError(
47141   PMPrintSession printSession,
47142   OSStatus printError) ;
47143 extern OSStatus
47144 PMSessionGetDocumentFormatGeneration(
47145   PMPrintSession printSession,
47146   CFArrayRef * docFormats) ;
47147 extern OSStatus
47148 PMSessionSetDocumentFormatGeneration(
47149   PMPrintSession printSession,
47150   CFStringRef docFormat,
47151   CFArrayRef graphicsContextTypes,
47152   CFTypeRef options) ;
47153 extern OSStatus
47154 PMSessionGetDocumentFormatSupported(
47155   PMPrintSession printSession,
47156   CFArrayRef * docFormats,
47157   UInt32 limit) ;
47158 extern OSStatus
47159 PMSessionIsDocumentFormatSupported(
47160   PMPrintSession printSession,
47161   CFStringRef docFormat,
47162   Boolean * supported) ;
47163 extern OSStatus
47164 PMSessionGetGraphicsContext(
47165   PMPrintSession printSession,
47166   CFStringRef graphicsContextType,
47167   void ** graphicsContext) ;
47168 extern OSStatus
47169 PMSessionSetIdleProc(
47170   PMPrintSession printSession,
47171   PMIdleUPP idleProc) ;
47172 extern OSStatus
47173 PMSessionSetDataInSession(
47174   PMPrintSession printSession,
47175   CFStringRef key,
47176   CFTypeRef data) ;
47177 extern OSStatus
47178 PMSessionGetDataFromSession(
47179   PMPrintSession printSession,
47180   CFStringRef key,
47181   CFTypeRef * data) ;
47182 extern OSStatus
47183 PMSessionCreatePrinterList(
47184   PMPrintSession printSession,
47185   CFArrayRef * printerList,
47186   CFIndex * currentIndex,
47187   PMPrinter * currentPrinter) ;
47188 extern OSStatus
47189 PMSessionSetCurrentPrinter(
47190   PMPrintSession session,
47191   CFStringRef printerName) ;
47192 extern OSStatus
47193 PMSessionSetDestination(
47194   PMPrintSession printSession,
47195   PMPrintSettings printSettings,
47196   PMDestinationType destType,
47197   CFStringRef destFormat,
47198   CFURLRef destLocation) ;
47199 extern OSStatus
47200 PMSessionGetDestinationType(
47201   PMPrintSession printSession,
47202   PMPrintSettings printSettings,
47203   PMDestinationType * destTypeP) ;
47204 extern OSStatus
47205 PMSessionCopyDestinationFormat(
47206   PMPrintSession printSession,
47207   PMPrintSettings printSettings,
47208   CFStringRef * destFormatP) ;
47209 extern OSStatus
47210 PMSessionCopyDestinationLocation(
47211   PMPrintSession printSession,
47212   PMPrintSettings printSettings,
47213   CFURLRef * destLocationP) ;
47214 extern OSStatus
47215 PMSessionCopyOutputFormatList(
47216   PMPrintSession printSession,
47217   PMDestinationType destType,
47218   CFArrayRef * documentFormatP) ;
47219 extern OSStatus
47220 PMSessionCreatePageFormatList(
47221   PMPrintSession printSession,
47222   PMPrinter printer,
47223   CFArrayRef * pageFormatList) ;
47224 extern OSStatus
47225 PMSessionBeginDocumentNoDialog(
47226   PMPrintSession printSession,
47227   PMPrintSettings printSettings,
47228   PMPageFormat pageFormat) ;
47229 extern OSStatus
47230 PMSessionEndDocumentNoDialog(PMPrintSession printSession) ;
47231 extern OSStatus
47232 PMSessionBeginPageNoDialog(
47233   PMPrintSession printSession,
47234   PMPageFormat pageFormat,
47235   const PMRect * pageFrame) ;
47236 extern OSStatus
47237 PMSessionEndPageNoDialog(PMPrintSession printSession) ;
47238 extern OSStatus
47239 PMCopyPageFormat(
47240   PMPageFormat formatSrc,
47241   PMPageFormat formatDest) ;
47242 extern OSStatus
47243 PMFlattenPageFormat(
47244   PMPageFormat pageFormat,
47245   Handle * flatFormat) ;
47246 extern OSStatus
47247 PMUnflattenPageFormat(
47248   Handle flatFormat,
47249   PMPageFormat * pageFormat) ;
47250 extern OSStatus
47251 PMGetPageFormatExtendedData(
47252   PMPageFormat pageFormat,
47253   OSType dataID,
47254   UInt32 * size,
47255   void * extendedData) ;
47256 extern OSStatus
47257 PMSetPageFormatExtendedData(
47258   PMPageFormat pageFormat,
47259   OSType dataID,
47260   UInt32 size,
47261   void * extendedData) ;
47262 extern OSStatus
47263 PMGetScale(
47264   PMPageFormat pageFormat,
47265   double * scale) ;
47266 extern OSStatus
47267 PMSetScale(
47268   PMPageFormat pageFormat,
47269   double scale) ;
47270 extern OSStatus
47271 PMGetResolution(
47272   PMPageFormat pageFormat,
47273   PMResolution * res) ;
47274 extern OSStatus
47275 PMSetResolution(
47276   PMPageFormat pageFormat,
47277   const PMResolution * res) ;
47278 extern OSStatus
47279 PMGetPhysicalPaperSize(
47280   PMPageFormat pageFormat,
47281   PMRect * paperSize) ;
47282 extern OSStatus
47283 PMSetPhysicalPaperSize(
47284   PMPageFormat pageFormat,
47285   const PMRect * paperSize) ;
47286 extern OSStatus
47287 PMGetPhysicalPageSize(
47288   PMPageFormat pageFormat,
47289   PMRect * pageSize) ;
47290 extern OSStatus
47291 PMGetAdjustedPaperRect(
47292   PMPageFormat pageFormat,
47293   PMRect * paperRect) ;
47294 extern OSStatus
47295 PMGetAdjustedPageRect(
47296   PMPageFormat pageFormat,
47297   PMRect * pageRect) ;
47298 extern OSStatus
47299 PMGetUnadjustedPaperRect(
47300   PMPageFormat pageFormat,
47301   PMRect * paperRect) ;
47302 extern OSStatus
47303 PMSetUnadjustedPaperRect(
47304   PMPageFormat pageFormat,
47305   const PMRect * paperRect) ;
47306 extern OSStatus
47307 PMGetUnadjustedPageRect(
47308   PMPageFormat pageFormat,
47309   PMRect * pageRect) ;
47310 extern OSStatus
47311 PMSetAdjustedPageRect(
47312   PMPageFormat pageFormat,
47313   const PMRect * pageRect) ;
47314 extern OSStatus
47315 PMGetOrientation(
47316   PMPageFormat pageFormat,
47317   PMOrientation * orientation) ;
47318 extern OSStatus
47319 PMSetOrientation(
47320   PMPageFormat pageFormat,
47321   PMOrientation orientation,
47322   Boolean lock) ;
47323 extern OSStatus
47324 PMCopyPrintSettings(
47325   PMPrintSettings settingSrc,
47326   PMPrintSettings settingDest) ;
47327 extern OSStatus
47328 PMFlattenPrintSettings(
47329   PMPrintSettings printSettings,
47330   Handle * flatSettings) ;
47331 extern OSStatus
47332 PMUnflattenPrintSettings(
47333   Handle flatSettings,
47334   PMPrintSettings * printSettings) ;
47335 extern OSStatus
47336 PMGetPrintSettingsExtendedData(
47337   PMPrintSettings printSettings,
47338   OSType dataID,
47339   UInt32 * size,
47340   void * extendedData) ;
47341 extern OSStatus
47342 PMSetPrintSettingsExtendedData(
47343   PMPrintSettings printSettings,
47344   OSType dataID,
47345   UInt32 size,
47346   void * extendedData) ;
47347 extern OSStatus
47348 PMGetDestination(
47349   PMPrintSettings printSettings,
47350   PMDestinationType * destType,
47351   CFURLRef * fileURL) ;
47352 extern OSStatus
47353 PMGetJobName(
47354   PMPrintSettings printSettings,
47355   StringPtr name) ;
47356 extern OSStatus
47357 PMSetJobName(
47358   PMPrintSettings printSettings,
47359   StringPtr name) ;
47360 extern OSStatus
47361 PMGetCopies(
47362   PMPrintSettings printSettings,
47363   UInt32 * copies) ;
47364 extern OSStatus
47365 PMSetCopies(
47366   PMPrintSettings printSettings,
47367   UInt32 copies,
47368   Boolean lock) ;
47369 extern OSStatus
47370 PMGetFirstPage(
47371   PMPrintSettings printSettings,
47372   UInt32 * first) ;
47373 extern OSStatus
47374 PMSetFirstPage(
47375   PMPrintSettings printSettings,
47376   UInt32 first,
47377   Boolean lock) ;
47378 extern OSStatus
47379 PMGetLastPage(
47380   PMPrintSettings printSettings,
47381   UInt32 * last) ;
47382 extern OSStatus
47383 PMSetLastPage(
47384   PMPrintSettings printSettings,
47385   UInt32 last,
47386   Boolean lock) ;
47387 extern OSStatus
47388 PMGetPageRange(
47389   PMPrintSettings printSettings,
47390   UInt32 * minPage,
47391   UInt32 * maxPage) ;
47392 extern OSStatus
47393 PMSetPageRange(
47394   PMPrintSettings printSettings,
47395   UInt32 minPage,
47396   UInt32 maxPage) ;
47397 extern OSStatus
47398 PMSetProfile(
47399   PMPrintSettings printSettings,
47400   PMTag tag,
47401   const CMProfileLocation * profile) ;
47402 extern OSStatus
47403 PMGetColorMode(
47404   PMPrintSettings printSettings,
47405   PMColorMode * colorMode) ;
47406 extern OSStatus
47407 PMSetColorMode(
47408   PMPrintSettings printSettings,
47409   PMColorMode colorMode) ;
47410 extern OSStatus
47411 PMGetJobNameCFString(
47412   PMPrintSettings printSettings,
47413   CFStringRef * name) ;
47414 extern OSStatus
47415 PMSetJobNameCFString(
47416   PMPrintSettings printSettings,
47417   CFStringRef name) ;
47418 extern OSStatus
47419 PMSetCollate(
47420   PMPrintSettings printSettings,
47421   Boolean collate) ;
47422 extern OSStatus
47423 PMGetCollate(
47424   PMPrintSettings printSettings,
47425   Boolean * collate) ;
47426 extern OSStatus
47427 PMServerCreatePrinterList(
47428   PMServer server,
47429   CFArrayRef * printerList) ;
47430 extern CFStringRef
47431 PMPrinterGetName(PMPrinter printer) ;
47432 extern CFStringRef
47433 PMPrinterGetID(PMPrinter printer) ;
47434 extern Boolean
47435 PMPrinterIsDefault(PMPrinter printer) ;
47436 extern CFStringRef
47437 PMPrinterGetLocation(PMPrinter printer) ;
47438 extern OSStatus
47439 PMPrinterGetState(
47440   PMPrinter printer,
47441   PMPrinterState * state) ;
47442 extern OSStatus
47443 PMPrinterGetDeviceURI(
47444   PMPrinter printer,
47445   CFURLRef * deviceURI) ;
47446 extern Boolean
47447 PMPrinterIsFavorite(PMPrinter printer) ;
47448 extern CGImageRef
47449 PMCGImageCreateWithEPSDataProvider(
47450   CGDataProviderRef epsDataProvider,
47451   CGImageRef epsPreview) ;
47452
47453
47454
47455
47456 }
47457
47458
47459
47460 extern "C" {
47461
47462
47463 enum {
47464   kDictionaryFileType = 'dict',
47465   kDCMDictionaryHeaderSignature = 'dict',
47466   kDCMDictionaryHeaderVersion = 2
47467 };
47468
47469 enum {
47470   kDCMAnyFieldTag = typeWildCard,
47471   kDCMAnyFieldType = typeWildCard
47472 };
47473
47474
47475
47476
47477 enum {
47478   keyDCMFieldTag = 'ftag',
47479   keyDCMFieldType = 'ftyp',
47480   keyDCMMaxRecordSize = 'mrsz',
47481   keyDCMFieldAttributes = 'fatr',
47482   keyDCMFieldDefaultData = 'fdef',
47483   keyDCMFieldName = 'fnam',
47484   keyDCMFieldFindMethods = 'ffnd'
47485 };
47486
47487
47488
47489
47490 enum {
47491   typeDCMFieldAttributes = 'fatr',
47492   typeDCMFindMethod = 'fmth'
47493 };
47494
47495
47496
47497
47498
47499 enum {
47500   kDCMIndexedFieldMask = 0x00000001,
47501   kDCMRequiredFieldMask = 0x00000002,
47502   kDCMIdentifyFieldMask = 0x00000004,
47503   kDCMFixedSizeFieldMask = 0x00000008,
47504   kDCMHiddenFieldMask = (long)0x80000000
47505 };
47506
47507 typedef OptionBits DCMFieldAttributes;
47508
47509
47510
47511 enum {
47512   pDCMAccessMethod = 'amtd',
47513   pDCMPermission = 'perm',
47514   pDCMListing = 'list',
47515   pDCMMaintenance = 'mtnc',
47516   pDCMLocale = 'locl',
47517   pDCMClass = pClass,
47518   pDCMCopyright = 'info'
47519 };
47520
47521
47522
47523
47524 enum {
47525   kDCMReadOnlyDictionary = 0,
47526   kDCMReadWriteDictionary = 1
47527 };
47528
47529
47530
47531
47532 enum {
47533   kDCMAllowListing = 0,
47534   kDCMProhibitListing = 1
47535 };
47536
47537
47538
47539
47540 enum {
47541   kDCMUserDictionaryClass = 0,
47542   kDCMSpecificDictionaryClass = 1,
47543   kDCMBasicDictionaryClass = 2
47544 };
47545
47546
47547
47548
47549 enum {
47550   kDCMFindMethodExactMatch = kAEEquals,
47551   kDCMFindMethodBeginningMatch = kAEBeginsWith,
47552   kDCMFindMethodContainsMatch = kAEContains,
47553   kDCMFindMethodEndingMatch = kAEEndsWith,
47554   kDCMFindMethodForwardTrie = 'ftri',
47555   kDCMFindMethodBackwardTrie = 'btri'
47556 };
47557
47558 typedef OSType DCMFindMethod;
47559
47560
47561
47562 enum {
47563   kDCMCanUseFileDictionaryMask = 0x00000001,
47564   kDCMCanUseMemoryDictionaryMask = 0x00000002,
47565   kDCMCanStreamDictionaryMask = 0x00000004,
47566   kDCMCanHaveMultipleIndexMask = 0x00000008,
47567   kDCMCanModifyDictionaryMask = 0x00000010,
47568   kDCMCanCreateDictionaryMask = 0x00000020,
47569   kDCMCanAddDictionaryFieldMask = 0x00000040,
47570   kDCMCanUseTransactionMask = 0x00000080
47571 };
47572
47573 typedef OptionBits DCMAccessMethodFeature;
47574 typedef UInt32 DCMUniqueID;
47575 typedef struct OpaqueDCMObjectID* DCMObjectID;
47576 typedef DCMObjectID DCMAccessMethodID;
47577 typedef DCMObjectID DCMDictionaryID;
47578
47579 typedef struct OpaqueDCMObjectRef* DCMObjectRef;
47580 typedef DCMObjectRef DCMDictionaryRef;
47581 typedef DCMObjectRef DCMDictionaryStreamRef;
47582
47583 typedef struct OpaqueDCMObjectIterator* DCMObjectIterator;
47584 typedef DCMObjectIterator DCMAccessMethodIterator;
47585 typedef DCMObjectIterator DCMDictionaryIterator;
47586 typedef struct OpaqueDCMFoundRecordIterator* DCMFoundRecordIterator;
47587
47588
47589
47590 typedef DescType DCMFieldTag;
47591 typedef DescType DCMFieldType;
47592
47593
47594
47595 struct DCMDictionaryHeader {
47596   FourCharCode headerSignature;
47597   UInt32 headerVersion;
47598   ByteCount headerSize;
47599   Str63 accessMethod;
47600 };
47601 typedef struct DCMDictionaryHeader DCMDictionaryHeader;
47602
47603
47604
47605 typedef Boolean ( * DCMProgressFilterProcPtr)(Boolean determinateProcess, UInt16 percentageComplete, UInt32 callbackUD);
47606 typedef DCMProgressFilterProcPtr DCMProgressFilterUPP;
47607 extern UInt32
47608 DCMLibraryVersion(void) ;
47609 extern OSStatus
47610 DCMNewDictionary(
47611   DCMAccessMethodID accessMethodID,
47612   const FSSpec * newDictionaryFile,
47613   ScriptCode scriptTag,
47614   const AEDesc * listOfFieldInfoRecords,
47615   Boolean invisible,
47616   ItemCount recordCapacity,
47617   DCMDictionaryID * newDictionary) ;
47618 extern OSStatus
47619 DCMDeriveNewDictionary(
47620   DCMDictionaryID srcDictionary,
47621   const FSSpec * newDictionaryFile,
47622   ScriptCode scriptTag,
47623   Boolean invisible,
47624   ItemCount recordCapacity,
47625   DCMDictionaryID * newDictionary) ;
47626 extern OSStatus
47627 DCMDeleteDictionary(DCMDictionaryID dictionaryID) ;
47628 extern OSStatus
47629 DCMRegisterDictionaryFile(
47630   const FSSpec * dictionaryFile,
47631   DCMDictionaryID * dictionaryID) ;
47632 extern OSStatus
47633 DCMUnregisterDictionary(DCMDictionaryID dictionaryID) ;
47634 extern OSStatus
47635 DCMOpenDictionary(
47636   DCMDictionaryID dictionaryID,
47637   ByteCount protectKeySize,
47638   ConstLogicalAddress protectKey,
47639   DCMDictionaryRef * dictionaryRef) ;
47640 extern OSStatus
47641 DCMCloseDictionary(DCMDictionaryRef dictionaryRef) ;
47642 extern OSStatus
47643 DCMGetDictionaryWriteAccess(
47644   DCMDictionaryRef dictionaryRef,
47645   Duration timeOutDuration) ;
47646 extern OSStatus
47647 DCMReleaseDictionaryWriteAccess(
47648   DCMDictionaryRef dictionaryRef,
47649   Boolean commitTransaction) ;
47650 extern OSStatus
47651 DCMFindRecords(
47652   DCMDictionaryRef dictionaryRef,
47653   DCMFieldTag keyFieldTag,
47654   ByteCount keySize,
47655   ConstLogicalAddress keyData,
47656   DCMFindMethod findMethod,
47657   ItemCount preFetchedDataNum,
47658   DCMFieldTag preFetchedData[],
47659   ItemCount skipCount,
47660   ItemCount maxRecordCount,
47661   DCMFoundRecordIterator * recordIterator) ;
47662 extern ItemCount
47663 DCMCountRecordIterator(DCMFoundRecordIterator recordIterator) ;
47664 extern OSStatus
47665 DCMIterateFoundRecord(
47666   DCMFoundRecordIterator recordIterator,
47667   ByteCount maxKeySize,
47668   ByteCount * actualKeySize,
47669   LogicalAddress keyData,
47670   DCMUniqueID * uniqueID,
47671   AEDesc * dataList) ;
47672 extern OSStatus
47673 DCMDisposeRecordIterator(DCMFoundRecordIterator recordIterator) ;
47674 extern OSStatus
47675 DCMCountRecord(
47676   DCMDictionaryID dictionaryID,
47677   ItemCount * count) ;
47678 extern OSStatus
47679 DCMGetRecordSequenceNumber(
47680   DCMDictionaryRef dictionaryRef,
47681   DCMFieldTag keyFieldTag,
47682   ByteCount keySize,
47683   ConstLogicalAddress keyData,
47684   DCMUniqueID uniqueID,
47685   ItemCount * sequenceNum) ;
47686 extern OSStatus
47687 DCMGetNthRecord(
47688   DCMDictionaryRef dictionaryRef,
47689   DCMFieldTag keyFieldTag,
47690   ItemCount serialNum,
47691   ByteCount maxKeySize,
47692   ByteCount * keySize,
47693   LogicalAddress keyData,
47694   DCMUniqueID * uniqueID) ;
47695 extern OSStatus
47696 DCMGetNextRecord(
47697   DCMDictionaryRef dictionaryRef,
47698   DCMFieldTag keyFieldTag,
47699   ByteCount keySize,
47700   ConstLogicalAddress keyData,
47701   DCMUniqueID uniqueID,
47702   ByteCount maxKeySize,
47703   ByteCount * nextKeySize,
47704   LogicalAddress nextKeyData,
47705   DCMUniqueID * nextUniqueID) ;
47706 extern OSStatus
47707 DCMGetPrevRecord(
47708   DCMDictionaryRef dictionaryRef,
47709   DCMFieldTag keyFieldTag,
47710   ByteCount keySize,
47711   ConstLogicalAddress keyData,
47712   DCMUniqueID uniqueID,
47713   ByteCount maxKeySize,
47714   ByteCount * prevKeySize,
47715   LogicalAddress prevKeyData,
47716   DCMUniqueID * prevUniqueID) ;
47717 extern OSStatus
47718 DCMGetFieldData(
47719   DCMDictionaryRef dictionaryRef,
47720   DCMFieldTag keyFieldTag,
47721   ByteCount keySize,
47722   ConstLogicalAddress keyData,
47723   DCMUniqueID uniqueID,
47724   ItemCount numOfData,
47725   const DCMFieldTag dataTag[],
47726   AEDesc * dataList) ;
47727 extern OSStatus
47728 DCMSetFieldData(
47729   DCMDictionaryRef dictionaryRef,
47730   DCMFieldTag keyFieldTag,
47731   ByteCount keySize,
47732   ConstLogicalAddress keyData,
47733   DCMUniqueID uniqueID,
47734   const AEDesc * dataList) ;
47735 extern OSStatus
47736 DCMAddRecord(
47737   DCMDictionaryRef dictionaryRef,
47738   DCMFieldTag keyFieldTag,
47739   ByteCount keySize,
47740   ConstLogicalAddress keyData,
47741   Boolean checkOnly,
47742   const AEDesc * dataList,
47743   DCMUniqueID * newUniqueID) ;
47744 extern OSStatus
47745 DCMDeleteRecord(
47746   DCMDictionaryRef dictionaryRef,
47747   DCMFieldTag keyFieldTag,
47748   ByteCount keySize,
47749   ConstLogicalAddress keyData,
47750   DCMUniqueID uniqueID) ;
47751 extern OSStatus
47752 DCMReorganizeDictionary(
47753   DCMDictionaryID dictionaryID,
47754   ItemCount extraCapacity,
47755   DCMProgressFilterUPP progressProc,
47756   UInt32 userData) ;
47757 extern OSStatus
47758 DCMCompactDictionary(
47759   DCMDictionaryID dictionaryID,
47760   DCMProgressFilterUPP progressProc,
47761   UInt32 userData) ;
47762 extern OSStatus
47763 DCMGetFileFromDictionaryID(
47764   DCMDictionaryID dictionaryID,
47765   FSSpec * fileRef) ;
47766 extern OSStatus
47767 DCMGetDictionaryIDFromFile(
47768   const FSSpec * fileRef,
47769   DCMDictionaryID * dictionaryID) ;
47770 extern DCMDictionaryID
47771 DCMGetDictionaryIDFromRef(DCMDictionaryRef dictionaryRef) ;
47772 extern OSStatus
47773 DCMGetDictionaryFieldInfo(
47774   DCMDictionaryID dictionaryID,
47775   DCMFieldTag fieldTag,
47776   AEDesc * fieldInfoRecord) ;
47777 extern OSStatus
47778 DCMGetDictionaryProperty(
47779   DCMDictionaryID dictionaryID,
47780   DCMFieldTag propertyTag,
47781   ByteCount maxPropertySize,
47782   ByteCount * actualSize,
47783   LogicalAddress propertyValue) ;
47784 extern OSStatus
47785 DCMSetDictionaryProperty(
47786   DCMDictionaryID dictionaryID,
47787   DCMFieldTag propertyTag,
47788   ByteCount propertySize,
47789   ConstLogicalAddress propertyValue) ;
47790 extern OSStatus
47791 DCMGetDictionaryPropertyList(
47792   DCMDictionaryID dictionaryID,
47793   ItemCount maxPropertyNum,
47794   ItemCount * numProperties,
47795   DCMFieldTag propertyTag[]) ;
47796 extern OSStatus
47797 DCMCreateDictionaryIterator(DCMDictionaryIterator * dictionaryIterator) ;
47798 extern OSStatus
47799 DCMCreateAccessMethodIterator(DCMAccessMethodIterator * accessMethodIterator) ;
47800 extern ItemCount
47801 DCMCountObjectIterator(DCMObjectIterator iterator) ;
47802 extern OSStatus
47803 DCMIterateObject(
47804   DCMObjectIterator iterator,
47805   DCMObjectID * objectID) ;
47806 extern OSStatus
47807 DCMResetObjectIterator(DCMObjectIterator iterator) ;
47808 extern OSStatus
47809 DCMDisposeObjectIterator(DCMObjectIterator iterator) ;
47810 extern OSStatus
47811 DCMGetAccessMethodIDFromName(
47812   ConstStr63Param accessMethodName,
47813   DCMAccessMethodID * accessMethodID) ;
47814 extern OSStatus
47815 DCMCreateFieldInfoRecord(
47816   DescType fieldTag,
47817   DescType fieldType,
47818   ByteCount maxRecordSize,
47819   DCMFieldAttributes fieldAttributes,
47820   AEDesc * fieldDefaultData,
47821   ItemCount numberOfFindMethods,
47822   DCMFindMethod findMethods[],
47823   AEDesc * fieldInfoRecord) ;
47824 extern OSStatus
47825 DCMGetFieldTagAndType(
47826   const AEDesc * fieldInfoRecord,
47827   DCMFieldTag * fieldTag,
47828   DCMFieldType * fieldType) ;
47829 extern OSStatus
47830 DCMGetFieldMaxRecordSize(
47831   const AEDesc * fieldInfoRecord,
47832   ByteCount * maxRecordSize) ;
47833 extern OSStatus
47834 DCMGetFieldAttributes(
47835   const AEDesc * fieldInfoRecord,
47836   DCMFieldAttributes * attributes) ;
47837 extern OSStatus
47838 DCMGetFieldDefaultData(
47839   const AEDesc * fieldInfoRecord,
47840   DescType desiredType,
47841   AEDesc * fieldDefaultData) ;
47842 extern OSStatus
47843 DCMGetFieldFindMethods(
47844   const AEDesc * fieldInfoRecord,
47845   ItemCount findMethodsArrayMaxSize,
47846   DCMFindMethod findMethods[],
47847   ItemCount * actualNumberOfFindMethods) ;
47848     inline Boolean DCMDictionaryManagerAvailable() { return true; }
47849 enum {
47850   kMaxYomiLengthInAppleJapaneseDictionary = 40,
47851   kMaxKanjiLengthInAppleJapaneseDictionary = 64
47852 };
47853
47854
47855
47856
47857 enum {
47858   kDCMJapaneseYomiTag = 'yomi',
47859   kDCMJapaneseHyokiTag = 'hyok',
47860   kDCMJapaneseHinshiTag = 'hins',
47861   kDCMJapaneseWeightTag = 'hind',
47862   kDCMJapanesePhoneticTag = 'hton',
47863   kDCMJapaneseAccentTag = 'acnt',
47864   kDCMJapaneseOnKunReadingTag = 'OnKn',
47865   kDCMJapaneseFukugouInfoTag = 'fuku'
47866 };
47867
47868 enum {
47869   kDCMJapaneseYomiType = typeUnicodeText,
47870   kDCMJapaneseHyokiType = typeUnicodeText,
47871   kDCMJapaneseHinshiType = 'hins',
47872   kDCMJapaneseWeightType = typeShortInteger,
47873   kDCMJapanesePhoneticType = typeUnicodeText,
47874   kDCMJapaneseAccentType = 'byte',
47875   kDCMJapaneseOnKunReadingType = typeUnicodeText,
47876   kDCMJapaneseFukugouInfoType = 'fuku'
47877 };
47878
47879 enum {
47880
47881   kInsert = 0,
47882   kReplace = 1,
47883   kInsertOrReplace = 2
47884 };
47885
47886
47887
47888 typedef short DictionaryDataInsertMode;
47889 enum {
47890
47891   kIsCaseSensitive = 0x10,
47892   kIsNotDiacriticalSensitive = 0x20
47893 };
47894
47895 enum {
47896
47897   kNoun = -1,
47898   kVerb = -2,
47899   kAdjective = -3,
47900   kAdverb = -4
47901 };
47902
47903
47904 typedef SInt8 DictionaryEntryAttribute;
47905
47906 struct DictionaryInformation {
47907   FSSpec dictionaryFSSpec;
47908   SInt32 numberOfRecords;
47909   SInt32 currentGarbageSize;
47910   ScriptCode script;
47911   SInt16 maximumKeyLength;
47912   SInt8 keyAttributes;
47913 };
47914 typedef struct DictionaryInformation DictionaryInformation;
47915 struct DictionaryAttributeTable {
47916   UInt8 datSize;
47917   DictionaryEntryAttribute datTable[1];
47918 };
47919 typedef struct DictionaryAttributeTable DictionaryAttributeTable;
47920 typedef DictionaryAttributeTable * DictionaryAttributeTablePtr;
47921
47922
47923 }
47924 extern "C" {
47925
47926
47927
47928 typedef struct OpaqueLAEnvironmentRef* LAEnvironmentRef;
47929 typedef struct OpaqueLAContextRef* LAContextRef;
47930 typedef AEKeyword LAPropertyKey;
47931 typedef DescType LAPropertyType;
47932
47933
47934
47935 struct LAMorphemeRec {
47936   ByteCount sourceTextLength;
47937   LogicalAddress sourceTextPtr;
47938   ByteCount morphemeTextLength;
47939   LogicalAddress morphemeTextPtr;
47940   UInt32 partOfSpeech;
47941 };
47942 typedef struct LAMorphemeRec LAMorphemeRec;
47943 struct LAMorphemesArray {
47944   ItemCount morphemesCount;
47945   ByteCount processedTextLength;
47946   ByteCount morphemesTextLength;
47947   LAMorphemeRec morphemes[1];
47948 };
47949 typedef struct LAMorphemesArray LAMorphemesArray;
47950 typedef LAMorphemesArray * LAMorphemesArrayPtr;
47951 enum {
47952   kLAMorphemesArrayVersion = 0
47953 };
47954
47955
47956
47957
47958 typedef AERecord LAMorphemeBundle;
47959 typedef AERecord LAMorphemePath;
47960 typedef AERecord LAMorpheme;
47961 typedef AERecord LAHomograph;
47962 enum {
47963   keyAELAMorphemeBundle = 'lmfb',
47964   keyAELAMorphemePath = 'lmfp',
47965   keyAELAMorpheme = 'lmfn',
47966   keyAELAHomograph = 'lmfh'
47967 };
47968
47969 enum {
47970   typeLAMorphemeBundle = typeAERecord,
47971   typeLAMorphemePath = typeAERecord,
47972   typeLAMorpheme = typeAEList,
47973   typeLAHomograph = typeAEList
47974 };
47975
47976
47977
47978
47979 enum {
47980   keyAEMorphemePartOfSpeechCode = 'lamc',
47981   keyAEMorphemeTextRange = 'lamt'
47982 };
47983
47984 enum {
47985   typeAEMorphemePartOfSpeechCode = 'lamc',
47986   typeAEMorphemeTextRange = 'lamt'
47987 };
47988
47989 typedef UInt32 MorphemePartOfSpeech;
47990 struct MorphemeTextRange {
47991   UInt32 sourceOffset;
47992   UInt32 length;
47993 };
47994 typedef struct MorphemeTextRange MorphemeTextRange;
47995
47996
47997
47998 enum {
47999   kLAEndOfSourceTextMask = 0x00000001
48000 };
48001
48002
48003
48004
48005 enum {
48006   kLADefaultEdge = 0,
48007   kLAFreeEdge = 1,
48008   kLAIncompleteEdge = 2
48009 };
48010
48011
48012
48013
48014 enum {
48015   kLAAllMorphemes = 0
48016 };
48017 extern UInt32
48018 LALibraryVersion(void) ;
48019 extern OSStatus
48020 LATextToMorphemes(
48021   LAContextRef context,
48022   TextEncoding preferedEncoding,
48023   ByteCount textLength,
48024   ConstLogicalAddress sourceText,
48025   ByteCount bufferSize,
48026   OptionBits convertFlags,
48027   UInt32 structureVersion,
48028   ByteCount * acceptedLength,
48029   LAMorphemesArrayPtr resultBuffer) ;
48030 extern OSStatus
48031 LAOpenAnalysisContext(
48032   LAEnvironmentRef environ,
48033   LAContextRef * context) ;
48034 extern OSStatus
48035 LACloseAnalysisContext(LAContextRef context) ;
48036 extern OSStatus
48037 LAGetEnvironmentList(
48038   UInt32 maxCount,
48039   UInt32 * actualCount,
48040   LAEnvironmentRef environmentList[]) ;
48041 extern OSStatus
48042 LAGetEnvironmentName(
48043   LAEnvironmentRef environment,
48044   Str63 environmentName) ;
48045 extern OSStatus
48046 LAGetEnvironmentRef(
48047   ConstStr63Param targetEnvironmentName,
48048   LAEnvironmentRef * environment) ;
48049 extern OSStatus
48050 LACreateCustomEnvironment(
48051   LAEnvironmentRef baseEnvironment,
48052   ConstStr63Param newEnvironmentName,
48053   Boolean persistent,
48054   LAEnvironmentRef * newEnvironment) ;
48055 extern OSStatus
48056 LADeleteCustomEnvironment(LAEnvironmentRef environment) ;
48057 extern OSStatus
48058 LAOpenDictionary(
48059   LAEnvironmentRef environ,
48060   const FSSpec * dictionary) ;
48061 extern OSStatus
48062 LACloseDictionary(
48063   LAEnvironmentRef environ,
48064   const FSSpec * dictionary) ;
48065 extern OSStatus
48066 LAListAvailableDictionaries(
48067   LAEnvironmentRef environ,
48068   ItemCount maxCount,
48069   ItemCount * actualCount,
48070   FSSpec dictionaryList[],
48071   Boolean opened[]) ;
48072 extern OSStatus
48073 LAAddNewWord(
48074   LAEnvironmentRef environ,
48075   const FSSpec * dictionary,
48076   const AEDesc * dataList) ;
48077 extern OSStatus
48078 LAMorphemeAnalysis(
48079   LAContextRef context,
48080   ConstUniCharArrayPtr text,
48081   UniCharCount textLength,
48082   LAMorphemePath * leadingPath,
48083   LAMorphemePath * trailingPath,
48084   ItemCount pathCount,
48085   LAMorphemeBundle * result) ;
48086 extern OSStatus
48087 LAContinuousMorphemeAnalysis(
48088   LAContextRef context,
48089   ConstUniCharArrayPtr text,
48090   UniCharCount textLength,
48091   Boolean incrementalText,
48092   LAMorphemePath * leadingPath,
48093   LAMorphemePath * trailingPath,
48094   Boolean * modified) ;
48095 extern OSStatus
48096 LAGetMorphemes(
48097   LAContextRef context,
48098   LAMorphemePath * result) ;
48099 extern OSStatus
48100 LAShiftMorphemes(
48101   LAContextRef context,
48102   ItemCount morphemeCount,
48103   LAMorphemePath * path,
48104   UniCharCount * shiftedLength) ;
48105 extern OSStatus
48106 LAResetAnalysis(LAContextRef context) ;
48107     inline Boolean LALanguageAnalysisAvailable() { return true; }
48108 enum {
48109   kAppleJapaneseDictionarySignature = 'jlan'
48110 };
48111
48112
48113
48114
48115 enum {
48116   kMaxInputLengthOfAppleJapaneseEngine = 200
48117 };
48118
48119
48120
48121
48122
48123 typedef MorphemePartOfSpeech JapanesePartOfSpeech;
48124 typedef UInt16 HomographWeight;
48125 typedef UInt8 HomographAccent;
48126
48127
48128
48129 enum {
48130   keyAEHomographDicInfo = 'lahd',
48131   keyAEHomographWeight = 'lahw',
48132   keyAEHomographAccent = 'laha'
48133 };
48134
48135 enum {
48136   typeAEHomographDicInfo = 'lahd',
48137   typeAEHomographWeight = typeShortInteger,
48138   typeAEHomographAccent = 'laha'
48139 };
48140
48141
48142
48143
48144 struct HomographDicInfoRec {
48145   DCMDictionaryID dictionaryID;
48146   DCMUniqueID uniqueID;
48147 };
48148 typedef struct HomographDicInfoRec HomographDicInfoRec;
48149 enum {
48150   kLASpeechRoughClassMask = 0x0000F000,
48151   kLASpeechMediumClassMask = 0x0000FF00,
48152   kLASpeechStrictClassMask = 0x0000FFF0,
48153   kLASpeechKatsuyouMask = 0x0000000F
48154 };
48155
48156
48157
48158
48159
48160 enum {
48161   kLASpeechMeishi = 0x00000000,
48162   kLASpeechFutsuuMeishi = 0x00000000,
48163   kLASpeechJinmei = 0x00000100,
48164   kLASpeechJinmeiSei = 0x00000110,
48165   kLASpeechJinmeiMei = 0x00000120,
48166   kLASpeechChimei = 0x00000200,
48167   kLASpeechSetsubiChimei = 0x00000210,
48168   kLASpeechSoshikimei = 0x00000300,
48169   kLASpeechKoyuuMeishi = 0x00000400,
48170   kLASpeechSahenMeishi = 0x00000500,
48171   kLASpeechKeidouMeishi = 0x00000600,
48172   kLASpeechRentaishi = 0x00001000,
48173   kLASpeechFukushi = 0x00002000,
48174   kLASpeechSetsuzokushi = 0x00003000,
48175   kLASpeechKandoushi = 0x00004000,
48176   kLASpeechDoushi = 0x00005000,
48177   kLASpeechGodanDoushi = 0x00005000,
48178   kLASpeechKagyouGodan = 0x00005000,
48179   kLASpeechSagyouGodan = 0x00005010,
48180   kLASpeechTagyouGodan = 0x00005020,
48181   kLASpeechNagyouGodan = 0x00005030,
48182   kLASpeechMagyouGodan = 0x00005040,
48183   kLASpeechRagyouGodan = 0x00005050,
48184   kLASpeechWagyouGodan = 0x00005060,
48185   kLASpeechGagyouGodan = 0x00005070,
48186   kLASpeechBagyouGodan = 0x00005080,
48187   kLASpeechIchidanDoushi = 0x00005100,
48188   kLASpeechKahenDoushi = 0x00005200,
48189   kLASpeechSahenDoushi = 0x00005300,
48190   kLASpeechZahenDoushi = 0x00005400,
48191   kLASpeechKeiyoushi = 0x00006000,
48192   kLASpeechKeiyoudoushi = 0x00007000,
48193   kLASpeechSettougo = 0x00008000,
48194   kLASpeechSuujiSettougo = 0x00008100,
48195   kLASpeechSetsubigo = 0x00009000,
48196   kLASpeechJinmeiSetsubigo = 0x00009100,
48197   kLASpeechChimeiSetsubigo = 0x00009200,
48198   kLASpeechSoshikimeiSetsubigo = 0x00009300,
48199   kLASpeechSuujiSetsubigo = 0x00009400,
48200   kLASpeechMuhinshi = 0x0000A000,
48201   kLASpeechTankanji = 0x0000A000,
48202   kLASpeechKigou = 0x0000A100,
48203   kLASpeechKuten = 0x0000A110,
48204   kLASpeechTouten = 0x0000A120,
48205   kLASpeechSuushi = 0x0000A200,
48206   kLASpeechDokuritsugo = 0x0000A300,
48207   kLASpeechSeiku = 0x0000A400,
48208   kLASpeechJodoushi = 0x0000B000,
48209   kLASpeechJoshi = 0x0000C000
48210 };
48211
48212
48213
48214
48215
48216 enum {
48217   kLASpeechKatsuyouGokan = 0x00000001,
48218   kLASpeechKatsuyouMizen = 0x00000002,
48219   kLASpeechKatsuyouRenyou = 0x00000003,
48220   kLASpeechKatsuyouSyuushi = 0x00000004,
48221   kLASpeechKatsuyouRentai = 0x00000005,
48222   kLASpeechKatsuyouKatei = 0x00000006,
48223   kLASpeechKatsuyouMeirei = 0x00000007
48224 };
48225
48226
48227
48228
48229
48230 }
48231
48232
48233
48234 extern "C" {
48235
48236
48237
48238 enum {
48239   kTextToSpeechSynthType = 'ttsc',
48240   kTextToSpeechVoiceType = 'ttvd',
48241   kTextToSpeechVoiceFileType = 'ttvf',
48242   kTextToSpeechVoiceBundleType = 'ttvb'
48243 };
48244
48245 enum {
48246   kNoEndingProsody = 1,
48247   kNoSpeechInterrupt = 2,
48248   kPreflightThenPause = 4
48249 };
48250
48251 enum {
48252   kImmediate = 0,
48253   kEndOfWord = 1,
48254   kEndOfSentence = 2
48255 };
48256
48257
48258
48259
48260
48261 enum {
48262   soStatus = 'stat',
48263   soErrors = 'erro',
48264   soInputMode = 'inpt',
48265   soCharacterMode = 'char',
48266   soNumberMode = 'nmbr',
48267   soRate = 'rate',
48268   soPitchBase = 'pbas',
48269   soPitchMod = 'pmod',
48270   soVolume = 'volm',
48271   soSynthType = 'vers',
48272   soRecentSync = 'sync',
48273   soPhonemeSymbols = 'phsy',
48274   soCurrentVoice = 'cvox',
48275   soCommandDelimiter = 'dlim',
48276   soReset = 'rset',
48277   soCurrentA5 = 'myA5',
48278   soRefCon = 'refc',
48279   soTextDoneCallBack = 'tdcb',
48280   soSpeechDoneCallBack = 'sdcb',
48281   soSyncCallBack = 'sycb',
48282   soErrorCallBack = 'ercb',
48283   soPhonemeCallBack = 'phcb',
48284   soWordCallBack = 'wdcb',
48285   soSynthExtension = 'xtnd',
48286   soSoundOutput = 'sndo'
48287 };
48288
48289
48290
48291
48292
48293 enum {
48294   modeText = 'TEXT',
48295   modePhonemes = 'PHON',
48296   modeNormal = 'NORM',
48297   modeLiteral = 'LTRL'
48298 };
48299
48300
48301 enum {
48302   soVoiceDescription = 'info',
48303   soVoiceFile = 'fref'
48304 };
48305
48306
48307
48308
48309
48310
48311 struct SpeechChannelRecord {
48312   long data[1];
48313 };
48314 typedef struct SpeechChannelRecord SpeechChannelRecord;
48315 typedef SpeechChannelRecord * SpeechChannel;
48316
48317 struct VoiceSpec {
48318   OSType creator;
48319   OSType id;
48320 };
48321 typedef struct VoiceSpec VoiceSpec;
48322 typedef VoiceSpec * VoiceSpecPtr;
48323
48324 enum {
48325   kNeuter = 0,
48326   kMale = 1,
48327   kFemale = 2
48328 };
48329
48330
48331
48332
48333 struct VoiceDescription {
48334   long length;
48335   VoiceSpec voice;
48336   long version;
48337   Str63 name;
48338   Str255 comment;
48339   short gender;
48340   short age;
48341   short script;
48342   short language;
48343   short region;
48344   long reserved[4];
48345 };
48346 typedef struct VoiceDescription VoiceDescription;
48347
48348
48349 struct VoiceFileInfo {
48350   FSSpec fileSpec;
48351   short resID;
48352 };
48353 typedef struct VoiceFileInfo VoiceFileInfo;
48354 struct SpeechStatusInfo {
48355   Boolean outputBusy;
48356   Boolean outputPaused;
48357   long inputBytesLeft;
48358   short phonemeCode;
48359 };
48360 typedef struct SpeechStatusInfo SpeechStatusInfo;
48361
48362
48363 struct SpeechErrorInfo {
48364   short count;
48365   OSErr oldest;
48366   long oldPos;
48367   OSErr newest;
48368   long newPos;
48369 };
48370 typedef struct SpeechErrorInfo SpeechErrorInfo;
48371
48372
48373 struct SpeechVersionInfo {
48374   OSType synthType;
48375   OSType synthSubType;
48376   OSType synthManufacturer;
48377   long synthFlags;
48378   NumVersion synthVersion;
48379 };
48380 typedef struct SpeechVersionInfo SpeechVersionInfo;
48381
48382
48383 struct PhonemeInfo {
48384   short opcode;
48385   Str15 phStr;
48386   Str31 exampleStr;
48387   short hiliteStart;
48388   short hiliteEnd;
48389 };
48390 typedef struct PhonemeInfo PhonemeInfo;
48391
48392 struct PhonemeDescriptor {
48393   short phonemeCount;
48394   PhonemeInfo thePhonemes[1];
48395 };
48396 typedef struct PhonemeDescriptor PhonemeDescriptor;
48397 struct SpeechXtndData {
48398   OSType synthCreator;
48399   Byte synthData[2];
48400 };
48401 typedef struct SpeechXtndData SpeechXtndData;
48402
48403 struct DelimiterInfo {
48404   Byte startDelimiter[2];
48405   Byte endDelimiter[2];
48406 };
48407 typedef struct DelimiterInfo DelimiterInfo;
48408
48409 typedef void ( * SpeechTextDoneProcPtr)(SpeechChannel chan, long refCon, const void **nextBuf, unsigned long *byteLen, long *controlFlags);
48410 typedef void ( * SpeechDoneProcPtr)(SpeechChannel chan, long refCon);
48411 typedef void ( * SpeechSyncProcPtr)(SpeechChannel chan, long refCon, OSType syncMessage);
48412 typedef void ( * SpeechErrorProcPtr)(SpeechChannel chan, long refCon, OSErr theError, long bytePos);
48413 typedef void ( * SpeechPhonemeProcPtr)(SpeechChannel chan, long refCon, short phonemeOpcode);
48414 typedef void ( * SpeechWordProcPtr)(SpeechChannel chan, long refCon, unsigned long wordPos, unsigned short wordLen);
48415 typedef SpeechTextDoneProcPtr SpeechTextDoneUPP;
48416 typedef SpeechDoneProcPtr SpeechDoneUPP;
48417 typedef SpeechSyncProcPtr SpeechSyncUPP;
48418 typedef SpeechErrorProcPtr SpeechErrorUPP;
48419 typedef SpeechPhonemeProcPtr SpeechPhonemeUPP;
48420 typedef SpeechWordProcPtr SpeechWordUPP;
48421 extern SpeechTextDoneUPP
48422 NewSpeechTextDoneUPP(SpeechTextDoneProcPtr userRoutine) ;
48423 extern SpeechDoneUPP
48424 NewSpeechDoneUPP(SpeechDoneProcPtr userRoutine) ;
48425 extern SpeechSyncUPP
48426 NewSpeechSyncUPP(SpeechSyncProcPtr userRoutine) ;
48427 extern SpeechErrorUPP
48428 NewSpeechErrorUPP(SpeechErrorProcPtr userRoutine) ;
48429 extern SpeechPhonemeUPP
48430 NewSpeechPhonemeUPP(SpeechPhonemeProcPtr userRoutine) ;
48431 extern SpeechWordUPP
48432 NewSpeechWordUPP(SpeechWordProcPtr userRoutine) ;
48433 extern void
48434 DisposeSpeechTextDoneUPP(SpeechTextDoneUPP userUPP) ;
48435 extern void
48436 DisposeSpeechDoneUPP(SpeechDoneUPP userUPP) ;
48437 extern void
48438 DisposeSpeechSyncUPP(SpeechSyncUPP userUPP) ;
48439 extern void
48440 DisposeSpeechErrorUPP(SpeechErrorUPP userUPP) ;
48441 extern void
48442 DisposeSpeechPhonemeUPP(SpeechPhonemeUPP userUPP) ;
48443 extern void
48444 DisposeSpeechWordUPP(SpeechWordUPP userUPP) ;
48445 extern void
48446 InvokeSpeechTextDoneUPP(
48447   SpeechChannel chan,
48448   long refCon,
48449   const void ** nextBuf,
48450   unsigned long * byteLen,
48451   long * controlFlags,
48452   SpeechTextDoneUPP userUPP) ;
48453 extern void
48454 InvokeSpeechDoneUPP(
48455   SpeechChannel chan,
48456   long refCon,
48457   SpeechDoneUPP userUPP) ;
48458 extern void
48459 InvokeSpeechSyncUPP(
48460   SpeechChannel chan,
48461   long refCon,
48462   OSType syncMessage,
48463   SpeechSyncUPP userUPP) ;
48464 extern void
48465 InvokeSpeechErrorUPP(
48466   SpeechChannel chan,
48467   long refCon,
48468   OSErr theError,
48469   long bytePos,
48470   SpeechErrorUPP userUPP) ;
48471 extern void
48472 InvokeSpeechPhonemeUPP(
48473   SpeechChannel chan,
48474   long refCon,
48475   short phonemeOpcode,
48476   SpeechPhonemeUPP userUPP) ;
48477 extern void
48478 InvokeSpeechWordUPP(
48479   SpeechChannel chan,
48480   long refCon,
48481   unsigned long wordPos,
48482   unsigned short wordLen,
48483   SpeechWordUPP userUPP) ;
48484 extern NumVersion
48485 SpeechManagerVersion(void) ;
48486 extern OSErr
48487 MakeVoiceSpec(
48488   OSType creator,
48489   OSType id,
48490   VoiceSpec * voice) ;
48491 extern OSErr
48492 CountVoices(short * numVoices) ;
48493 extern OSErr
48494 GetIndVoice(
48495   short index,
48496   VoiceSpec * voice) ;
48497 extern OSErr
48498 GetVoiceDescription(
48499   const VoiceSpec * voice,
48500   VoiceDescription * info,
48501   long infoLength) ;
48502 extern OSErr
48503 GetVoiceInfo(
48504   const VoiceSpec * voice,
48505   OSType selector,
48506   void * voiceInfo) ;
48507 extern OSErr
48508 NewSpeechChannel(
48509   VoiceSpec * voice,
48510   SpeechChannel * chan) ;
48511 extern OSErr
48512 DisposeSpeechChannel(SpeechChannel chan) ;
48513 extern OSErr
48514 SpeakString(ConstStr255Param textToBeSpoken) ;
48515 extern OSErr
48516 SpeakText(
48517   SpeechChannel chan,
48518   const void * textBuf,
48519   unsigned long textBytes) ;
48520 extern OSErr
48521 SpeakBuffer(
48522   SpeechChannel chan,
48523   const void * textBuf,
48524   unsigned long textBytes,
48525   long controlFlags) ;
48526 extern OSErr
48527 StopSpeech(SpeechChannel chan) ;
48528 extern OSErr
48529 StopSpeechAt(
48530   SpeechChannel chan,
48531   long whereToStop) ;
48532 extern OSErr
48533 PauseSpeechAt(
48534   SpeechChannel chan,
48535   long whereToPause) ;
48536 extern OSErr
48537 ContinueSpeech(SpeechChannel chan) ;
48538 extern short
48539 SpeechBusy(void) ;
48540 extern short
48541 SpeechBusySystemWide(void) ;
48542 extern OSErr
48543 SetSpeechRate(
48544   SpeechChannel chan,
48545   Fixed rate) ;
48546 extern OSErr
48547 GetSpeechRate(
48548   SpeechChannel chan,
48549   Fixed * rate) ;
48550 extern OSErr
48551 SetSpeechPitch(
48552   SpeechChannel chan,
48553   Fixed pitch) ;
48554 extern OSErr
48555 GetSpeechPitch(
48556   SpeechChannel chan,
48557   Fixed * pitch) ;
48558 extern OSErr
48559 SetSpeechInfo(
48560   SpeechChannel chan,
48561   OSType selector,
48562   const void * speechInfo) ;
48563 extern OSErr
48564 GetSpeechInfo(
48565   SpeechChannel chan,
48566   OSType selector,
48567   void * speechInfo) ;
48568 extern OSErr
48569 TextToPhonemes(
48570   SpeechChannel chan,
48571   const void * textBuf,
48572   unsigned long textBytes,
48573   Handle phonemeBuf,
48574   long * phonemeBytes) ;
48575 extern OSErr
48576 UseDictionary(
48577   SpeechChannel chan,
48578   Handle dictionary) ;
48579
48580
48581
48582
48583
48584
48585
48586 }
48587
48588
48589
48590 extern "C" {
48591
48592
48593
48594
48595
48596
48597
48598
48599
48600 enum {
48601   kLSUnknownErr = -10810,
48602   kLSNotAnApplicationErr = -10811,
48603   kLSNotInitializedErr = -10812,
48604   kLSDataUnavailableErr = -10813,
48605   kLSApplicationNotFoundErr = -10814,
48606   kLSUnknownTypeErr = -10815,
48607   kLSDataTooOldErr = -10816,
48608   kLSDataErr = -10817,
48609   kLSLaunchInProgressErr = -10818,
48610   kLSNotRegisteredErr = -10819,
48611   kLSAppDoesNotClaimTypeErr = -10820,
48612   kLSAppDoesNotSupportSchemeWarning = -10821,
48613   kLSServerCommunicationErr = -10822,
48614   kLSCannotSetInfoErr = -10823
48615 };
48616
48617 typedef OptionBits LSInitializeFlags;
48618 enum {
48619   kLSInitializeDefaults = 0x00000001
48620 };
48621
48622 enum {
48623   kLSMinCatInfoBitmap = (kFSCatInfoNodeFlags | kFSCatInfoParentDirID | kFSCatInfoFinderInfo | kFSCatInfoFinderXInfo)
48624 };
48625
48626 enum {
48627   kLSInvalidExtensionIndex = (unsigned long)0xFFFFFFFF
48628 };
48629
48630 typedef OptionBits LSRequestedInfo;
48631 enum {
48632   kLSRequestExtension = 0x00000001,
48633   kLSRequestTypeCreator = 0x00000002,
48634   kLSRequestBasicFlagsOnly = 0x00000004,
48635   kLSRequestAppTypeFlags = 0x00000008,
48636   kLSRequestAllFlags = 0x00000010,
48637   kLSRequestIconAndKind = 0x00000020,
48638   kLSRequestExtensionFlagsOnly = 0x00000040,
48639   kLSRequestAllInfo = (unsigned long)0xFFFFFFFF
48640 };
48641
48642 typedef OptionBits LSItemInfoFlags;
48643 enum {
48644   kLSItemInfoIsPlainFile = 0x00000001,
48645   kLSItemInfoIsPackage = 0x00000002,
48646   kLSItemInfoIsApplication = 0x00000004,
48647   kLSItemInfoIsContainer = 0x00000008,
48648   kLSItemInfoIsAliasFile = 0x00000010,
48649   kLSItemInfoIsSymlink = 0x00000020,
48650   kLSItemInfoIsInvisible = 0x00000040,
48651   kLSItemInfoIsNativeApp = 0x00000080,
48652   kLSItemInfoIsClassicApp = 0x00000100,
48653   kLSItemInfoAppPrefersNative = 0x00000200,
48654   kLSItemInfoAppPrefersClassic = 0x00000400,
48655   kLSItemInfoAppIsScriptable = 0x00000800,
48656   kLSItemInfoIsVolume = 0x00001000,
48657   kLSItemInfoExtensionIsHidden = 0x00100000
48658 };
48659
48660 typedef OptionBits LSRolesMask;
48661 enum {
48662   kLSRolesNone = 0x00000001,
48663   kLSRolesViewer = 0x00000002,
48664   kLSRolesEditor = 0x00000004,
48665   kLSRolesAll = (unsigned long)0xFFFFFFFF
48666 };
48667
48668 typedef UInt32 LSKindID;
48669 enum {
48670   kLSUnknownKindID = 0
48671 };
48672
48673 enum {
48674   kLSUnknownType = 0,
48675   kLSUnknownCreator = 0
48676 };
48677
48678 struct LSItemInfoRecord {
48679   LSItemInfoFlags flags;
48680   OSType filetype;
48681   OSType creator;
48682   CFStringRef extension;
48683   CFStringRef iconFileName;
48684   LSKindID kindID;
48685 };
48686 typedef struct LSItemInfoRecord LSItemInfoRecord;
48687
48688 typedef OptionBits LSAcceptanceFlags;
48689 enum {
48690   kLSAcceptDefault = 0x00000001,
48691   kLSAcceptAllowLoginUI = 0x00000002
48692 };
48693
48694 typedef OptionBits LSLaunchFlags;
48695 enum {
48696   kLSLaunchDefaults = 0x00000001,
48697   kLSLaunchAndPrint = 0x00000002,
48698   kLSLaunchReserved2 = 0x00000004,
48699   kLSLaunchReserved3 = 0x00000008,
48700   kLSLaunchReserved4 = 0x00000010,
48701   kLSLaunchReserved5 = 0x00000020,
48702   kLSLaunchReserved6 = 0x00000040,
48703   kLSLaunchInhibitBGOnly = 0x00000080,
48704   kLSLaunchDontAddToRecents = 0x00000100,
48705   kLSLaunchDontSwitch = 0x00000200,
48706   kLSLaunchNoParams = 0x00000800,
48707   kLSLaunchAsync = 0x00010000,
48708   kLSLaunchStartClassic = 0x00020000,
48709   kLSLaunchInClassic = 0x00040000,
48710   kLSLaunchNewInstance = 0x00080000,
48711   kLSLaunchAndHide = 0x00100000,
48712   kLSLaunchAndHideOthers = 0x00200000
48713 };
48714
48715 struct LSLaunchFSRefSpec {
48716   const FSRef * appRef;
48717   UInt32 numDocs;
48718   const FSRef * itemRefs;
48719   const AEDesc * passThruParams;
48720   LSLaunchFlags launchFlags;
48721   void * asyncRefCon;
48722 };
48723 typedef struct LSLaunchFSRefSpec LSLaunchFSRefSpec;
48724 struct LSLaunchURLSpec {
48725   CFURLRef appURL;
48726   CFArrayRef itemURLs;
48727   const AEDesc * passThruParams;
48728   LSLaunchFlags launchFlags;
48729   void * asyncRefCon;
48730 };
48731 typedef struct LSLaunchURLSpec LSLaunchURLSpec;
48732 extern OSStatus
48733 LSInit(LSInitializeFlags inFlags) ;
48734 extern OSStatus
48735 LSTerm(void) ;
48736 extern OSStatus
48737 LSCopyItemInfoForRef(
48738   const FSRef * inItemRef,
48739   LSRequestedInfo inWhichInfo,
48740   LSItemInfoRecord * outItemInfo) ;
48741 extern OSStatus
48742 LSCopyItemInfoForURL(
48743   CFURLRef inURL,
48744   LSRequestedInfo inWhichInfo,
48745   LSItemInfoRecord * outItemInfo) ;
48746 extern OSStatus
48747 LSGetExtensionInfo(
48748   UniCharCount inNameLen,
48749   const UniChar inNameBuffer[],
48750   UniCharCount * outExtStartIndex) ;
48751 extern OSStatus
48752 LSCopyDisplayNameForRef(
48753   const FSRef * inRef,
48754   CFStringRef * outDisplayName) ;
48755 extern OSStatus
48756 LSCopyDisplayNameForURL(
48757   CFURLRef inURL,
48758   CFStringRef * outDisplayName) ;
48759 extern OSStatus
48760 LSSetExtensionHiddenForRef(
48761   const FSRef * inRef,
48762   Boolean inHide) ;
48763 extern OSStatus
48764 LSSetExtensionHiddenForURL(
48765   CFURLRef inURL,
48766   Boolean inHide) ;
48767 extern OSStatus
48768 LSCopyKindStringForRef(
48769   const FSRef * inFSRef,
48770   CFStringRef * outKindString) ;
48771 extern OSStatus
48772 LSCopyKindStringForURL(
48773   CFURLRef inURL,
48774   CFStringRef * outKindString) ;
48775 extern OSStatus
48776 LSCopyKindStringForTypeInfo(
48777   OSType inType,
48778   OSType inCreator,
48779   CFStringRef inExtension,
48780   CFStringRef * outKindString) ;
48781 extern OSStatus
48782 LSCopyKindStringForMIMEType(
48783   CFStringRef inMIMEType,
48784   CFStringRef * outKindString) ;
48785 extern OSStatus
48786 LSGetApplicationForItem(
48787   const FSRef * inItemRef,
48788   LSRolesMask inRoleMask,
48789   FSRef * outAppRef,
48790   CFURLRef * outAppURL) ;
48791 extern OSStatus
48792 LSGetApplicationForInfo(
48793   OSType inType,
48794   OSType inCreator,
48795   CFStringRef inExtension,
48796   LSRolesMask inRoleMask,
48797   FSRef * outAppRef,
48798   CFURLRef * outAppURL) ;
48799 extern OSStatus
48800 LSCopyApplicationForMIMEType(
48801   CFStringRef inMIMEType,
48802   LSRolesMask inRoleMask,
48803   CFURLRef * outAppURL) ;
48804 extern OSStatus
48805 LSGetApplicationForURL(
48806   CFURLRef inURL,
48807   LSRolesMask inRoleMask,
48808   FSRef * outAppRef,
48809   CFURLRef * outAppURL) ;
48810 extern OSStatus
48811 LSFindApplicationForInfo(
48812   OSType inCreator,
48813   CFStringRef inBundleID,
48814   CFStringRef inName,
48815   FSRef * outAppRef,
48816   CFURLRef * outAppURL) ;
48817 extern OSStatus
48818 LSCanRefAcceptItem(
48819   const FSRef * inItemFSRef,
48820   const FSRef * inTargetRef,
48821   LSRolesMask inRoleMask,
48822   LSAcceptanceFlags inFlags,
48823   Boolean * outAcceptsItem) ;
48824 extern OSStatus
48825 LSCanURLAcceptURL(
48826   CFURLRef inItemURL,
48827   CFURLRef inTargetURL,
48828   LSRolesMask inRoleMask,
48829   LSAcceptanceFlags inFlags,
48830   Boolean * outAcceptsItem) ;
48831 extern OSStatus
48832 LSOpenFSRef(
48833   const FSRef * inRef,
48834   FSRef * outLaunchedRef) ;
48835 extern OSStatus
48836 LSOpenCFURLRef(
48837   CFURLRef inURL,
48838   CFURLRef * outLaunchedURL) ;
48839 extern OSStatus
48840 LSOpenFromRefSpec(
48841   const LSLaunchFSRefSpec * inLaunchSpec,
48842   FSRef * outLaunchedRef) ;
48843 extern OSStatus
48844 LSOpenFromURLSpec(
48845   const LSLaunchURLSpec * inLaunchSpec,
48846   CFURLRef * outLaunchedURL) ;
48847
48848
48849
48850
48851
48852
48853 }
48854
48855
48856
48857
48858
48859
48860 extern double acos (double);
48861 extern double asin (double);
48862 extern double atan (double);
48863 extern double atan2 (double, double);
48864 extern double ceil (double);
48865 extern double cos (double);
48866 extern double cosh (double);
48867 extern double exp (double);
48868 extern double fabs (double);
48869 extern double floor (double);
48870 extern double fmod (double, double);
48871 extern double frexp (double, int *);
48872 extern double ldexp (double, int);
48873 extern double log10 (double);
48874 extern double log (double);
48875 extern double modf (double, double *);
48876 extern double pow (double, double);
48877 extern double sin (double);
48878 extern double sinh (double);
48879 extern double sqrt (double);
48880 extern double tan (double);
48881 extern double tanh (double);
48882
48883
48884
48885
48886
48887 extern "C" {
48888
48889
48890
48891
48892
48893
48894 typedef struct OpaqueEventRef* EventRef;
48895 enum {
48896
48897
48898
48899
48900
48901   eventAlreadyPostedErr = -9860,
48902
48903
48904
48905
48906
48907   eventTargetBusyErr = -9861,
48908
48909
48910
48911
48912   eventClassInvalidErr = -9862,
48913
48914
48915
48916
48917   eventClassIncorrectErr = -9864,
48918
48919
48920
48921
48922
48923
48924   eventHandlerAlreadyInstalledErr = -9866,
48925
48926
48927
48928
48929   eventInternalErr = -9868,
48930
48931
48932
48933
48934   eventKindIncorrectErr = -9869,
48935
48936
48937
48938
48939   eventParameterNotFoundErr = -9870,
48940   eventNotHandledErr = -9874,
48941
48942
48943
48944
48945
48946   eventLoopTimedOutErr = -9875,
48947
48948
48949
48950
48951
48952   eventLoopQuitErr = -9876,
48953
48954
48955
48956
48957
48958   eventNotInQueueErr = -9877,
48959   eventHotKeyExistsErr = -9878,
48960   eventHotKeyInvalidErr = -9879
48961 };
48962 typedef SInt16 EventPriority;
48963 enum {
48964
48965
48966
48967
48968
48969   kEventPriorityLow = 0,
48970
48971
48972
48973
48974   kEventPriorityStandard = 1,
48975
48976
48977
48978
48979   kEventPriorityHigh = 2
48980 };
48981
48982 enum {
48983   kEventLeaveInQueue = false,
48984   kEventRemoveFromQueue = true
48985 };
48986
48987
48988
48989
48990
48991
48992 typedef double EventTime;
48993 typedef EventTime EventTimeout;
48994 typedef EventTime EventTimerInterval;
48995     inline EventTime TicksToEventTime( UInt32 t ) { return ( (t) / 60.0 ); }
48996     inline UInt32 EventTimeToTicks( EventTime t ) { return (UInt32)( ((t) * 60) + 0.5 ); }
48997 struct EventTypeSpec {
48998   UInt32 eventClass;
48999   UInt32 eventKind;
49000 };
49001 typedef struct EventTypeSpec EventTypeSpec;
49002
49003
49004
49005 typedef OSType EventParamName;
49006 typedef OSType EventParamType;
49007 typedef struct OpaqueEventLoopRef* EventLoopRef;
49008 extern EventLoopRef
49009 GetCurrentEventLoop(void) ;
49010 extern EventLoopRef
49011 GetMainEventLoop(void) ;
49012 extern OSStatus
49013 RunCurrentEventLoop(EventTimeout inTimeout) ;
49014 extern OSStatus
49015 QuitEventLoop(EventLoopRef inEventLoop) ;
49016 extern CFTypeRef
49017 GetCFRunLoopFromEventLoop(EventLoopRef inEventLoop) ;
49018 extern OSStatus
49019 ReceiveNextEvent(
49020   UInt32 inNumTypes,
49021   const EventTypeSpec * inList,
49022   EventTimeout inTimeout,
49023   Boolean inPullEvent,
49024   EventRef * outEvent) ;
49025
49026
49027
49028
49029
49030 typedef UInt32 EventAttributes;
49031 enum {
49032   kEventAttributeNone = 0,
49033   kEventAttributeUserEvent = (1 << 0)
49034 };
49035 extern OSStatus
49036 CreateEvent(
49037   CFAllocatorRef inAllocator,
49038   UInt32 inClassID,
49039   UInt32 kind,
49040   EventTime when,
49041   EventAttributes flags,
49042   EventRef * outEvent) ;
49043 extern EventRef
49044 CopyEvent(EventRef inOther) ;
49045 extern EventRef
49046 RetainEvent(EventRef inEvent) ;
49047 extern UInt32
49048 GetEventRetainCount(EventRef inEvent) ;
49049 extern void
49050 ReleaseEvent(EventRef inEvent) ;
49051 extern OSStatus
49052 SetEventParameter(
49053   EventRef inEvent,
49054   EventParamName inName,
49055   EventParamType inType,
49056   UInt32 inSize,
49057   const void * inDataPtr) ;
49058 extern OSStatus
49059 GetEventParameter(
49060   EventRef inEvent,
49061   EventParamName inName,
49062   EventParamType inDesiredType,
49063   EventParamType * outActualType,
49064   UInt32 inBufferSize,
49065   UInt32 * outActualSize,
49066   void * outData) ;
49067 extern UInt32
49068 GetEventClass(EventRef inEvent) ;
49069 extern UInt32
49070 GetEventKind(EventRef inEvent) ;
49071 extern EventTime
49072 GetEventTime(EventRef inEvent) ;
49073 extern OSStatus
49074 SetEventTime(
49075   EventRef inEvent,
49076   EventTime inTime) ;
49077
49078
49079
49080
49081
49082
49083 typedef struct OpaqueEventQueueRef* EventQueueRef;
49084 extern EventQueueRef
49085 GetCurrentEventQueue(void) ;
49086 extern EventQueueRef
49087 GetMainEventQueue(void) ;
49088 typedef Boolean ( * EventComparatorProcPtr)(EventRef inEvent, void *inCompareData);
49089 typedef EventComparatorProcPtr EventComparatorUPP;
49090 extern EventComparatorUPP
49091 NewEventComparatorUPP(EventComparatorProcPtr userRoutine) ;
49092 extern void
49093 DisposeEventComparatorUPP(EventComparatorUPP userUPP) ;
49094 extern Boolean
49095 InvokeEventComparatorUPP(
49096   EventRef inEvent,
49097   void * inCompareData,
49098   EventComparatorUPP userUPP) ;
49099 extern OSStatus
49100 PostEventToQueue(
49101   EventQueueRef inQueue,
49102   EventRef inEvent,
49103   EventPriority inPriority) ;
49104 extern OSStatus
49105 FlushEventsMatchingListFromQueue(
49106   EventQueueRef inQueue,
49107   UInt32 inNumTypes,
49108   const EventTypeSpec * inList) ;
49109 extern OSStatus
49110 FlushSpecificEventsFromQueue(
49111   EventQueueRef inQueue,
49112   EventComparatorUPP inComparator,
49113   void * inCompareData) ;
49114 extern OSStatus
49115 FlushEventQueue(EventQueueRef inQueue) ;
49116 extern EventRef
49117 FindSpecificEventInQueue(
49118   EventQueueRef inQueue,
49119   EventComparatorUPP inComparator,
49120   void * inCompareData) ;
49121 extern UInt32
49122 GetNumEventsInQueue(EventQueueRef inQueue) ;
49123 extern OSStatus
49124 RemoveEventFromQueue(
49125   EventQueueRef inQueue,
49126   EventRef inEvent) ;
49127 extern Boolean
49128 IsEventInQueue(
49129   EventQueueRef inQueue,
49130   EventRef inEvent) ;
49131 extern EventRef
49132 GetCurrentEvent(void) ;
49133 extern UInt32
49134 GetCurrentEventButtonState(void) ;
49135 extern UInt32
49136 GetCurrentEventKeyModifiers(void) ;
49137 extern UInt32
49138 GetCurrentButtonState(void) ;
49139 extern EventTime
49140 GetCurrentEventTime(void) ;
49141 typedef struct __EventLoopTimer* EventLoopTimerRef;
49142 typedef void ( * EventLoopTimerProcPtr)(EventLoopTimerRef inTimer, void *inUserData);
49143
49144
49145
49146
49147
49148 enum {
49149
49150
49151
49152
49153
49154
49155   kEventLoopIdleTimerStarted = 1,
49156
49157
49158
49159
49160
49161
49162
49163   kEventLoopIdleTimerIdling = 2,
49164
49165
49166
49167
49168
49169   kEventLoopIdleTimerStopped = 3
49170 };
49171
49172 typedef UInt16 EventLoopIdleTimerMessage;
49173 typedef void ( * EventLoopIdleTimerProcPtr)(EventLoopTimerRef inTimer, EventLoopIdleTimerMessage inState, void *inUserData);
49174 typedef EventLoopTimerProcPtr EventLoopTimerUPP;
49175 typedef EventLoopIdleTimerProcPtr EventLoopIdleTimerUPP;
49176 extern EventLoopTimerUPP
49177 NewEventLoopTimerUPP(EventLoopTimerProcPtr userRoutine) ;
49178 extern EventLoopIdleTimerUPP
49179 NewEventLoopIdleTimerUPP(EventLoopIdleTimerProcPtr userRoutine) ;
49180 extern void
49181 DisposeEventLoopTimerUPP(EventLoopTimerUPP userUPP) ;
49182 extern void
49183 DisposeEventLoopIdleTimerUPP(EventLoopIdleTimerUPP userUPP) ;
49184 extern void
49185 InvokeEventLoopTimerUPP(
49186   EventLoopTimerRef inTimer,
49187   void * inUserData,
49188   EventLoopTimerUPP userUPP) ;
49189 extern void
49190 InvokeEventLoopIdleTimerUPP(
49191   EventLoopTimerRef inTimer,
49192   EventLoopIdleTimerMessage inState,
49193   void * inUserData,
49194   EventLoopIdleTimerUPP userUPP) ;
49195 extern OSStatus
49196 InstallEventLoopTimer(
49197   EventLoopRef inEventLoop,
49198   EventTimerInterval inFireDelay,
49199   EventTimerInterval inInterval,
49200   EventLoopTimerUPP inTimerProc,
49201   void * inTimerData,
49202   EventLoopTimerRef * outTimer) ;
49203 extern OSStatus
49204 InstallEventLoopIdleTimer(
49205   EventLoopRef inEventLoop,
49206   EventTimerInterval inDelay,
49207   EventTimerInterval inInterval,
49208   EventLoopIdleTimerUPP inTimerProc,
49209   void * inTimerData,
49210   EventLoopTimerRef * outTimer) ;
49211 extern OSStatus
49212 InstallIdleTimer(
49213   EventLoopRef inEventLoop,
49214   EventTimerInterval inDelay,
49215   EventTimerInterval inInterval,
49216   EventLoopTimerUPP inTimerProc,
49217   void * inTimerData,
49218   EventLoopTimerRef * outTimer) ;
49219 extern OSStatus
49220 RemoveEventLoopTimer(EventLoopTimerRef inTimer) ;
49221 extern OSStatus
49222 SetEventLoopTimerNextFireTime(
49223   EventLoopTimerRef inTimer,
49224   EventTimerInterval inNextFire) ;
49225 typedef struct OpaqueEventHandlerRef* EventHandlerRef;
49226 typedef struct OpaqueEventHandlerCallRef* EventHandlerCallRef;
49227 typedef OSStatus ( * EventHandlerProcPtr)(EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData);
49228 typedef EventHandlerProcPtr EventHandlerUPP;
49229 extern EventHandlerUPP
49230 NewEventHandlerUPP(EventHandlerProcPtr userRoutine) ;
49231 extern void
49232 DisposeEventHandlerUPP(EventHandlerUPP userUPP) ;
49233 extern OSStatus
49234 InvokeEventHandlerUPP(
49235   EventHandlerCallRef inHandlerCallRef,
49236   EventRef inEvent,
49237   void * inUserData,
49238   EventHandlerUPP userUPP) ;
49239
49240 typedef struct OpaqueEventTargetRef* EventTargetRef;
49241 extern OSStatus
49242 InstallEventHandler(
49243   EventTargetRef inTarget,
49244   EventHandlerUPP inHandler,
49245   UInt32 inNumTypes,
49246   const EventTypeSpec * inList,
49247   void * inUserData,
49248   EventHandlerRef * outRef) ;
49249 extern OSStatus
49250 InstallStandardEventHandler(EventTargetRef inTarget) ;
49251 extern OSStatus
49252 RemoveEventHandler(EventHandlerRef inHandlerRef) ;
49253 extern OSStatus
49254 AddEventTypesToHandler(
49255   EventHandlerRef inHandlerRef,
49256   UInt32 inNumTypes,
49257   const EventTypeSpec * inList) ;
49258 extern OSStatus
49259 RemoveEventTypesFromHandler(
49260   EventHandlerRef inHandlerRef,
49261   UInt32 inNumTypes,
49262   const EventTypeSpec * inList) ;
49263 extern OSStatus
49264 CallNextEventHandler(
49265   EventHandlerCallRef inCallRef,
49266   EventRef inEvent) ;
49267 enum {
49268
49269
49270
49271
49272
49273
49274
49275   kEventTargetDontPropagate = (1 << 0),
49276   kEventTargetSendToAllHandlers = (1 << 1)
49277 };
49278 extern OSStatus
49279 SendEventToEventTarget(
49280   EventRef inEvent,
49281   EventTargetRef inTarget) ;
49282 extern OSStatus
49283 SendEventToEventTargetWithOptions(
49284   EventRef inEvent,
49285   EventTargetRef inTarget,
49286   OptionBits inOptions) ;
49287
49288
49289
49290
49291
49292
49293 }
49294 extern "C" {
49295 typedef struct OpaqueHIObjectClassRef* HIObjectClassRef;
49296 typedef struct OpaqueHIObjectRef* HIObjectRef;
49297
49298
49299
49300
49301
49302 enum {
49303
49304
49305
49306
49307   hiObjectClassExistsErr = -22080,
49308
49309
49310
49311
49312
49313   hiObjectClassHasInstancesErr = -22081,
49314   hiObjectClassHasSubclassesErr = -22082,
49315
49316
49317
49318
49319
49320
49321   hiObjectClassIsAbstractErr = -22083
49322 };
49323 enum {
49324
49325
49326
49327
49328   kEventClassHIObject = 'hiob',
49329   kEventHIObjectConstruct = 1,
49330   kEventHIObjectInitialize = 2,
49331
49332
49333
49334
49335
49336
49337
49338   kEventHIObjectDestruct = 3,
49339
49340
49341
49342
49343
49344
49345   kEventHIObjectIsEqual = 4,
49346
49347
49348
49349
49350
49351
49352   kEventHIObjectPrintDebugInfo = 5
49353 };
49354
49355 enum {
49356   kEventParamHIObjectInstance = 'hioi',
49357   typeHIObjectRef = 'hiob'
49358 };
49359 extern OSStatus
49360 HIObjectRegisterSubclass(
49361   CFStringRef inClassID,
49362   CFStringRef inBaseClassID,
49363   OptionBits inOptions,
49364   EventHandlerUPP inConstructProc,
49365   UInt32 inNumEvents,
49366   const EventTypeSpec * inEventList,
49367   void * inConstructData,
49368   HIObjectClassRef * outClassRef) ;
49369 extern OSStatus
49370 HIObjectUnregisterClass(HIObjectClassRef inClassRef) ;
49371 extern OSStatus
49372 HIObjectCreate(
49373   CFStringRef inClassID,
49374   EventRef inConstructData,
49375   HIObjectRef * outObject) ;
49376 extern EventTargetRef
49377 HIObjectGetEventTarget(HIObjectRef inObject) ;
49378 extern void
49379 HIObjectPrintDebugInfo(HIObjectRef inObject) ;
49380 extern CFStringRef
49381 HIObjectCopyClassID(HIObjectRef inObject) ;
49382 extern Boolean
49383 HIObjectIsOfClass(
49384   HIObjectRef inObject,
49385   CFStringRef inObjectClassID) ;
49386 extern void *
49387 HIObjectDynamicCast(
49388   HIObjectRef inObject,
49389   CFStringRef inClassID) ;
49390 extern OSStatus
49391 HIObjectCreateFromBundle(
49392   CFBundleRef inBundle,
49393   HIObjectRef * outObject) ;
49394 extern Boolean
49395 HIObjectIsAccessibilityIgnored(HIObjectRef inObject) ;
49396 extern OSStatus
49397 HIObjectSetAccessibilityIgnored(
49398   HIObjectRef inObject,
49399   Boolean inIgnored) ;
49400 extern HIObjectRef
49401 _HIObjectRetain(HIObjectRef inObject) ;
49402 extern void
49403 _HIObjectRelease(HIObjectRef inObject) ;
49404 extern UInt32
49405 _HIObjectGetRetainCount(HIObjectRef inObject) ;
49406 extern Boolean
49407 _HIObjectIsEqual(
49408   HIObjectRef inObject,
49409   HIObjectRef inOtherObject) ;
49410 extern const CFArrayCallBacks kHIObjectCFArrayCallbacks;
49411 extern const CFDictionaryKeyCallBacks kHIObjectCFDictKeyCallbacks;
49412 extern const CFDictionaryValueCallBacks kHIObjectCFDictValueCallbacks;
49413
49414
49415
49416
49417 }
49418
49419
49420
49421 extern "C" {
49422
49423
49424
49425 typedef UInt16 EventKind;
49426 typedef UInt16 EventMask;
49427 enum {
49428   nullEvent = 0,
49429   mouseDown = 1,
49430   mouseUp = 2,
49431   keyDown = 3,
49432   keyUp = 4,
49433   autoKey = 5,
49434   updateEvt = 6,
49435   diskEvt = 7,
49436   activateEvt = 8,
49437   osEvt = 15,
49438   kHighLevelEvent = 23
49439 };
49440
49441 enum {
49442   mDownMask = 1 << mouseDown,
49443   mUpMask = 1 << mouseUp,
49444   keyDownMask = 1 << keyDown,
49445   keyUpMask = 1 << keyUp,
49446   autoKeyMask = 1 << autoKey,
49447   updateMask = 1 << updateEvt,
49448   diskMask = 1 << diskEvt,
49449   activMask = 1 << activateEvt,
49450   highLevelEventMask = 0x0400,
49451   osMask = 1 << osEvt,
49452   everyEvent = 0xFFFF
49453 };
49454
49455 enum {
49456   charCodeMask = 0x000000FF,
49457   keyCodeMask = 0x0000FF00,
49458   adbAddrMask = 0x00FF0000,
49459   osEvtMessageMask = (unsigned long)0xFF000000
49460 };
49461
49462 enum {
49463
49464   mouseMovedMessage = 0x00FA,
49465   suspendResumeMessage = 0x0001
49466 };
49467
49468 enum {
49469   resumeFlag = 1
49470 };
49471 typedef UInt16 EventModifiers;
49472 enum {
49473
49474   activeFlagBit = 0,
49475   btnStateBit = 7,
49476   cmdKeyBit = 8,
49477   shiftKeyBit = 9,
49478   alphaLockBit = 10,
49479   optionKeyBit = 11,
49480   controlKeyBit = 12,
49481   rightShiftKeyBit = 13,
49482   rightOptionKeyBit = 14,
49483   rightControlKeyBit = 15
49484 };
49485
49486 enum {
49487   activeFlag = 1 << activeFlagBit,
49488   btnState = 1 << btnStateBit,
49489   cmdKey = 1 << cmdKeyBit,
49490   shiftKey = 1 << shiftKeyBit,
49491   alphaLock = 1 << alphaLockBit,
49492   optionKey = 1 << optionKeyBit,
49493   controlKey = 1 << controlKeyBit,
49494   rightShiftKey = 1 << rightShiftKeyBit,
49495   rightOptionKey = 1 << rightOptionKeyBit,
49496   rightControlKey = 1 << rightControlKeyBit
49497 };
49498
49499
49500 enum {
49501   kNullCharCode = 0,
49502   kHomeCharCode = 1,
49503   kEnterCharCode = 3,
49504   kEndCharCode = 4,
49505   kHelpCharCode = 5,
49506   kBellCharCode = 7,
49507   kBackspaceCharCode = 8,
49508   kTabCharCode = 9,
49509   kLineFeedCharCode = 10,
49510   kVerticalTabCharCode = 11,
49511   kPageUpCharCode = 11,
49512   kFormFeedCharCode = 12,
49513   kPageDownCharCode = 12,
49514   kReturnCharCode = 13,
49515   kFunctionKeyCharCode = 16,
49516   kCommandCharCode = 17,
49517   kCheckCharCode = 18,
49518   kDiamondCharCode = 19,
49519   kAppleLogoCharCode = 20,
49520   kEscapeCharCode = 27,
49521   kClearCharCode = 27,
49522   kLeftArrowCharCode = 28,
49523   kRightArrowCharCode = 29,
49524   kUpArrowCharCode = 30,
49525   kDownArrowCharCode = 31,
49526   kSpaceCharCode = 32,
49527   kDeleteCharCode = 127,
49528   kBulletCharCode = 165,
49529   kNonBreakingSpaceCharCode = 202
49530 };
49531
49532
49533 enum {
49534   kShiftUnicode = 0x21E7,
49535   kControlUnicode = 0x2303,
49536   kOptionUnicode = 0x2325,
49537   kCommandUnicode = 0x2318,
49538   kPencilUnicode = 0x270E,
49539   kCheckUnicode = 0x2713,
49540   kDiamondUnicode = 0x25C6,
49541   kBulletUnicode = 0x2022,
49542   kAppleLogoUnicode = 0xF8FF
49543 };
49544
49545 struct EventRecord {
49546   EventKind what;
49547   UInt32 message;
49548   UInt32 when;
49549   Point where;
49550   EventModifiers modifiers;
49551 };
49552 typedef struct EventRecord EventRecord;
49553 typedef void ( * FKEYProcPtr)(void);
49554 typedef FKEYProcPtr FKEYUPP;
49555 extern void
49556 GetMouse(Point * mouseLoc) ;
49557 extern Boolean
49558 Button(void) ;
49559 extern Boolean
49560 StillDown(void) ;
49561 extern Boolean
49562 WaitMouseUp(void) ;
49563 extern UInt32
49564 KeyTranslate(
49565   const void * transData,
49566   UInt16 keycode,
49567   UInt32 * state) ;
49568 extern UInt32
49569 GetCaretTime(void) ;
49570 typedef BigEndianLong KeyMap[4];
49571
49572
49573 typedef UInt8 KeyMapByteArray[16];
49574 extern void
49575 GetKeys(KeyMap theKeys) ;
49576
49577
49578
49579 enum {
49580   networkEvt = 10,
49581   driverEvt = 11,
49582   app1Evt = 12,
49583   app2Evt = 13,
49584   app3Evt = 14,
49585   app4Evt = 15,
49586   networkMask = 0x0400,
49587   driverMask = 0x0800,
49588   app1Mask = 0x1000,
49589   app2Mask = 0x2000,
49590   app3Mask = 0x4000,
49591   app4Mask = 0x8000
49592 };
49593
49594 struct EvQEl {
49595   QElemPtr qLink;
49596   SInt16 qType;
49597   EventKind evtQWhat;
49598   UInt32 evtQMessage;
49599   UInt32 evtQWhen;
49600   Point evtQWhere;
49601   EventModifiers evtQModifiers;
49602 };
49603 typedef struct EvQEl EvQEl;
49604 typedef EvQEl * EvQElPtr;
49605 typedef void ( * GetNextEventFilterProcPtr)(EventRecord *theEvent, Boolean *result);
49606 typedef GetNextEventFilterProcPtr GetNextEventFilterUPP;
49607 typedef GetNextEventFilterUPP GNEFilterUPP;
49608 extern UInt32
49609 GetDblTime(void) ;
49610 extern void
49611 SetEventMask(EventMask value) ;
49612 extern Boolean
49613 GetNextEvent(
49614   EventMask eventMask,
49615   EventRecord * theEvent) ;
49616 extern Boolean
49617 WaitNextEvent(
49618   EventMask eventMask,
49619   EventRecord * theEvent,
49620   UInt32 sleep,
49621   RgnHandle mouseRgn) ;
49622 extern Boolean
49623 EventAvail(
49624   EventMask eventMask,
49625   EventRecord * theEvent) ;
49626 extern OSErr
49627 PostEvent(
49628   EventKind eventNum,
49629   UInt32 eventMsg) ;
49630 extern void
49631 FlushEvents(
49632   EventMask whichMask,
49633   EventMask stopMask) ;
49634 extern void
49635 GetGlobalMouse(Point * globalMouse) ;
49636 extern UInt32
49637 GetCurrentKeyModifiers(void) ;
49638 extern Boolean
49639 CheckEventQueueForUserCancel(void) ;
49640 extern void
49641 KeyScript(short code) ;
49642 extern Boolean
49643 IsCmdChar(
49644   const EventRecord * event,
49645   short test) ;
49646 extern SInt16
49647 LMGetKeyThresh(void) ;
49648 extern void
49649 LMSetKeyThresh(SInt16 value) ;
49650 extern SInt16
49651 LMGetKeyRepThresh(void) ;
49652 extern void
49653 LMSetKeyRepThresh(SInt16 value) ;
49654 extern UInt8
49655 LMGetKbdLast(void) ;
49656 extern void
49657 LMSetKbdLast(UInt8 value) ;
49658 extern UInt8
49659 LMGetKbdType(void) ;
49660 extern void
49661 LMSetKbdType(UInt8 value) ;
49662
49663
49664
49665
49666
49667 }
49668 extern "C" {
49669
49670
49671 enum {
49672   noMark = 0
49673 };
49674 enum {
49675
49676   kMenuDrawMsg = 0,
49677   kMenuSizeMsg = 2,
49678   kMenuPopUpMsg = 3,
49679   kMenuCalcItemMsg = 5,
49680   kMenuThemeSavvyMsg = 7,
49681   mDrawMsg = 0,
49682   mSizeMsg = 2,
49683   mPopUpMsg = 3,
49684   mCalcItemMsg = 5
49685 };
49686 enum {
49687   kThemeSavvyMenuResponse = 0x7473
49688 };
49689
49690
49691 enum {
49692   kMenuInitMsg = 8,
49693   kMenuDisposeMsg = 9,
49694   kMenuFindItemMsg = 10,
49695   kMenuHiliteItemMsg = 11,
49696   kMenuDrawItemsMsg = 12
49697 };
49698
49699 enum {
49700   textMenuProc = 0,
49701   hMenuCmd = 27,
49702   hierMenu = -1,
49703   kInsertHierarchicalMenu = -1,
49704   mctAllItems = -98,
49705   mctLastIDIndic = -99
49706 };
49707
49708
49709 enum {
49710   kMenuStdMenuProc = 63,
49711   kMenuStdMenuBarProc = 63
49712 };
49713
49714
49715 enum {
49716   kMenuNoModifiers = 0,
49717   kMenuShiftModifier = (1 << 0),
49718   kMenuOptionModifier = (1 << 1),
49719   kMenuControlModifier = (1 << 2),
49720   kMenuNoCommandModifier = (1 << 3)
49721 };
49722
49723
49724 enum {
49725   kMenuNoIcon = 0,
49726   kMenuIconType = 1,
49727   kMenuShrinkIconType = 2,
49728   kMenuSmallIconType = 3,
49729   kMenuColorIconType = 4,
49730   kMenuIconSuiteType = 5,
49731   kMenuIconRefType = 6,
49732   kMenuCGImageRefType = 7,
49733   kMenuSystemIconSelectorType = 8,
49734   kMenuIconResourceType = 9
49735 };
49736
49737
49738 enum {
49739   kMenuNullGlyph = 0x00,
49740   kMenuTabRightGlyph = 0x02,
49741   kMenuTabLeftGlyph = 0x03,
49742   kMenuEnterGlyph = 0x04,
49743   kMenuShiftGlyph = 0x05,
49744   kMenuControlGlyph = 0x06,
49745   kMenuOptionGlyph = 0x07,
49746   kMenuSpaceGlyph = 0x09,
49747   kMenuDeleteRightGlyph = 0x0A,
49748   kMenuReturnGlyph = 0x0B,
49749   kMenuReturnR2LGlyph = 0x0C,
49750   kMenuNonmarkingReturnGlyph = 0x0D,
49751   kMenuPencilGlyph = 0x0F,
49752   kMenuDownwardArrowDashedGlyph = 0x10,
49753   kMenuCommandGlyph = 0x11,
49754   kMenuCheckmarkGlyph = 0x12,
49755   kMenuDiamondGlyph = 0x13,
49756   kMenuAppleLogoFilledGlyph = 0x14,
49757   kMenuParagraphKoreanGlyph = 0x15,
49758   kMenuDeleteLeftGlyph = 0x17,
49759   kMenuLeftArrowDashedGlyph = 0x18,
49760   kMenuUpArrowDashedGlyph = 0x19,
49761   kMenuRightArrowDashedGlyph = 0x1A,
49762   kMenuEscapeGlyph = 0x1B,
49763   kMenuClearGlyph = 0x1C,
49764   kMenuLeftDoubleQuotesJapaneseGlyph = 0x1D,
49765   kMenuRightDoubleQuotesJapaneseGlyph = 0x1E,
49766   kMenuTrademarkJapaneseGlyph = 0x1F,
49767   kMenuBlankGlyph = 0x61,
49768   kMenuPageUpGlyph = 0x62,
49769   kMenuCapsLockGlyph = 0x63,
49770   kMenuLeftArrowGlyph = 0x64,
49771   kMenuRightArrowGlyph = 0x65,
49772   kMenuNorthwestArrowGlyph = 0x66,
49773   kMenuHelpGlyph = 0x67,
49774   kMenuUpArrowGlyph = 0x68,
49775   kMenuSoutheastArrowGlyph = 0x69,
49776   kMenuDownArrowGlyph = 0x6A,
49777   kMenuPageDownGlyph = 0x6B,
49778   kMenuAppleLogoOutlineGlyph = 0x6C,
49779   kMenuContextualMenuGlyph = 0x6D,
49780   kMenuPowerGlyph = 0x6E,
49781   kMenuF1Glyph = 0x6F,
49782   kMenuF2Glyph = 0x70,
49783   kMenuF3Glyph = 0x71,
49784   kMenuF4Glyph = 0x72,
49785   kMenuF5Glyph = 0x73,
49786   kMenuF6Glyph = 0x74,
49787   kMenuF7Glyph = 0x75,
49788   kMenuF8Glyph = 0x76,
49789   kMenuF9Glyph = 0x77,
49790   kMenuF10Glyph = 0x78,
49791   kMenuF11Glyph = 0x79,
49792   kMenuF12Glyph = 0x7A,
49793   kMenuF13Glyph = 0x87,
49794   kMenuF14Glyph = 0x88,
49795   kMenuF15Glyph = 0x89,
49796   kMenuControlISOGlyph = 0x8A,
49797   kMenuEjectGlyph = 0x8C
49798 };
49799 typedef UInt32 MenuAttributes;
49800 enum {
49801
49802
49803
49804
49805
49806   kMenuAttrExcludesMarkColumn = (1 << 0),
49807
49808
49809
49810
49811
49812   kMenuAttrAutoDisable = (1 << 2),
49813
49814
49815
49816
49817
49818
49819
49820   kMenuAttrUsePencilGlyph = (1 << 3),
49821   kMenuAttrHidden = (1 << 4)
49822 };
49823 typedef UInt32 MenuItemAttributes;
49824 enum {
49825
49826
49827
49828
49829   kMenuItemAttrDisabled = (1 << 0),
49830
49831
49832
49833
49834   kMenuItemAttrIconDisabled = (1 << 1),
49835
49836
49837
49838
49839   kMenuItemAttrSubmenuParentChoosable = (1 << 2),
49840
49841
49842
49843
49844   kMenuItemAttrDynamic = (1 << 3),
49845
49846
49847
49848
49849
49850   kMenuItemAttrNotPreviousAlternate = (1 << 4),
49851
49852
49853
49854
49855
49856
49857   kMenuItemAttrHidden = (1 << 5),
49858
49859
49860
49861
49862   kMenuItemAttrSeparator = (1 << 6),
49863
49864
49865
49866
49867
49868   kMenuItemAttrSectionHeader = (1 << 7),
49869
49870
49871
49872
49873
49874   kMenuItemAttrIgnoreMeta = (1 << 8),
49875
49876
49877
49878
49879
49880   kMenuItemAttrAutoRepeat = (1 << 9),
49881
49882
49883
49884
49885
49886
49887   kMenuItemAttrUseVirtualKey = (1 << 10),
49888
49889
49890
49891
49892
49893
49894
49895   kMenuItemAttrCustomDraw = (1 << 11),
49896   kMenuItemAttrIncludeInCmdKeyMatching = (1 << 12)
49897 };
49898 typedef UInt32 MenuTrackingMode;
49899 enum {
49900
49901
49902
49903
49904   kMenuTrackingModeMouse = 1,
49905
49906
49907
49908
49909   kMenuTrackingModeKeyboard = 2
49910 };
49911 typedef UInt32 MenuEventOptions;
49912 enum {
49913
49914
49915
49916
49917   kMenuEventIncludeDisabledItems = 0x0001,
49918
49919
49920
49921
49922   kMenuEventQueryOnly = 0x0002,
49923
49924
49925
49926
49927   kMenuEventDontCheckSubmenus = 0x0004
49928 };
49929
49930
49931
49932
49933 typedef SInt16 MenuID;
49934 typedef UInt16 MenuItemIndex;
49935 typedef UInt32 MenuCommand;
49936 typedef struct OpaqueMenuRef* MenuRef;
49937
49938 typedef MenuRef MenuHandle;
49939 typedef Handle MenuBarHandle;
49940 struct MenuBarHeader {
49941
49942
49943
49944
49945
49946   UInt16 lastMenu;
49947
49948
49949
49950
49951
49952   SInt16 lastRight;
49953
49954
49955
49956
49957
49958   SInt16 mbResID;
49959 };
49960 typedef struct MenuBarHeader MenuBarHeader;
49961 struct HMenuBarHeader {
49962
49963
49964
49965
49966
49967   UInt16 lastHMenu;
49968
49969
49970
49971
49972
49973   PixMapHandle menuTitleBits;
49974 };
49975 typedef struct HMenuBarHeader HMenuBarHeader;
49976 struct MenuBarMenu {
49977
49978
49979
49980
49981   MenuRef menu;
49982
49983
49984
49985
49986
49987   SInt16 menuLeft;
49988 };
49989 typedef struct MenuBarMenu MenuBarMenu;
49990 struct HMenuBarMenu {
49991
49992
49993
49994
49995   MenuRef menu;
49996
49997
49998
49999
50000   SInt16 reserved;
50001 };
50002 typedef struct HMenuBarMenu HMenuBarMenu;
50003 struct MCEntry {
50004   MenuID mctID;
50005   short mctItem;
50006   RGBColor mctRGB1;
50007   RGBColor mctRGB2;
50008   RGBColor mctRGB3;
50009   RGBColor mctRGB4;
50010   short mctReserved;
50011 };
50012 typedef struct MCEntry MCEntry;
50013 typedef MCEntry * MCEntryPtr;
50014 typedef MCEntry MCTable[1];
50015 typedef MCEntry * MCTablePtr;
50016 typedef MCTablePtr * MCTableHandle;
50017 struct MenuCRsrc {
50018   short numEntries;
50019   MCTable mcEntryRecs;
50020 };
50021 typedef struct MenuCRsrc MenuCRsrc;
50022 typedef MenuCRsrc * MenuCRsrcPtr;
50023 typedef MenuCRsrcPtr * MenuCRsrcHandle;
50024 struct MenuTrackingData {
50025   MenuRef menu;
50026   MenuItemIndex itemSelected;
50027   MenuItemIndex itemUnderMouse;
50028   Rect itemRect;
50029   SInt32 virtualMenuTop;
50030   SInt32 virtualMenuBottom;
50031 };
50032 typedef struct MenuTrackingData MenuTrackingData;
50033 typedef MenuTrackingData * MenuTrackingDataPtr;
50034 struct MDEFHiliteItemData {
50035
50036
50037
50038
50039
50040   MenuItemIndex previousItem;
50041
50042
50043
50044
50045
50046   MenuItemIndex newItem;
50047
50048
50049
50050
50051
50052   void * context;
50053 };
50054 typedef struct MDEFHiliteItemData MDEFHiliteItemData;
50055 typedef MDEFHiliteItemData * MDEFHiliteItemDataPtr;
50056 typedef MDEFHiliteItemData HiliteMenuItemData;
50057 typedef MDEFHiliteItemDataPtr HiliteMenuItemDataPtr;
50058 struct MDEFDrawData {
50059
50060
50061
50062
50063
50064
50065   MenuTrackingData trackingData;
50066
50067
50068
50069
50070
50071   void * context;
50072 };
50073 typedef struct MDEFDrawData MDEFDrawData;
50074 typedef MDEFDrawData * MDEFDrawDataPtr;
50075 struct MDEFFindItemData {
50076
50077
50078
50079
50080
50081
50082   MenuTrackingData trackingData;
50083
50084
50085
50086
50087
50088
50089   void * context;
50090 };
50091 typedef struct MDEFFindItemData MDEFFindItemData;
50092 typedef MDEFFindItemData * MDEFFindItemDataPtr;
50093 struct MDEFDrawItemsData {
50094
50095
50096
50097
50098   MenuItemIndex firstItem;
50099
50100
50101
50102
50103   MenuItemIndex lastItem;
50104
50105
50106
50107
50108
50109
50110   MenuTrackingData * trackingData;
50111
50112
50113
50114
50115
50116   void * context;
50117 };
50118 typedef struct MDEFDrawItemsData MDEFDrawItemsData;
50119 typedef MDEFDrawItemsData * MDEFDrawItemsDataPtr;
50120 enum {
50121   kMenuItemDataText = (1 << 0),
50122
50123
50124
50125
50126
50127   kMenuItemDataMark = (1 << 1),
50128
50129
50130
50131
50132
50133   kMenuItemDataCmdKey = (1 << 2),
50134
50135
50136
50137
50138
50139   kMenuItemDataCmdKeyGlyph = (1 << 3),
50140
50141
50142
50143
50144
50145   kMenuItemDataCmdKeyModifiers = (1 << 4),
50146
50147
50148
50149
50150
50151   kMenuItemDataStyle = (1 << 5),
50152
50153
50154
50155
50156
50157
50158   kMenuItemDataEnabled = (1 << 6),
50159
50160
50161
50162
50163
50164   kMenuItemDataIconEnabled = (1 << 7),
50165
50166
50167
50168
50169
50170   kMenuItemDataIconID = (1 << 8),
50171   kMenuItemDataIconHandle = (1 << 9),
50172
50173
50174
50175
50176
50177   kMenuItemDataCommandID = (1 << 10),
50178
50179
50180
50181
50182
50183   kMenuItemDataTextEncoding = (1 << 11),
50184   kMenuItemDataSubmenuID = (1 << 12),
50185   kMenuItemDataSubmenuHandle = (1 << 13),
50186   kMenuItemDataFontID = (1 << 14),
50187   kMenuItemDataRefcon = (1 << 15),
50188   kMenuItemDataAttributes = (1 << 16),
50189   kMenuItemDataCFString = (1 << 17),
50190   kMenuItemDataProperties = (1 << 18),
50191
50192
50193
50194
50195
50196   kMenuItemDataIndent = (1 << 19),
50197
50198
50199
50200
50201
50202
50203
50204   kMenuItemDataCmdVirtualKey = (1 << 20),
50205   kMenuItemDataAllDataVersionOne = 0x000FFFFF,
50206   kMenuItemDataAllDataVersionTwo = kMenuItemDataAllDataVersionOne | kMenuItemDataCmdVirtualKey
50207 };
50208
50209 enum {
50210   kMenuItemDataAllData = kMenuItemDataAllDataVersionTwo
50211 };
50212
50213 typedef UInt64 MenuItemDataFlags;
50214 struct MenuItemDataRec {
50215   MenuItemDataFlags whichData;
50216   StringPtr text;
50217   UniChar mark;
50218   UniChar cmdKey;
50219   UInt32 cmdKeyGlyph;
50220   UInt32 cmdKeyModifiers;
50221   Style style;
50222   Boolean enabled;
50223   Boolean iconEnabled;
50224   UInt8 filler1;
50225   SInt32 iconID;
50226   UInt32 iconType;
50227   Handle iconHandle;
50228   MenuCommand cmdID;
50229   TextEncoding encoding;
50230   MenuID submenuID;
50231   MenuRef submenuHandle;
50232   SInt32 fontID;
50233   UInt32 refcon;
50234   OptionBits attr;
50235   CFStringRef cfText;
50236   Collection properties;
50237   UInt32 indent;
50238   UInt16 cmdVirtualKey;
50239 };
50240 typedef struct MenuItemDataRec MenuItemDataRec;
50241 typedef MenuItemDataRec * MenuItemDataPtr;
50242 typedef UInt32 MenuItemID;
50243
50244
50245
50246
50247
50248
50249 typedef void ( * MenuDefProcPtr)(short message, MenuRef theMenu, Rect *menuRect, Point hitPt, short *whichItem);
50250 typedef MenuDefProcPtr MenuDefUPP;
50251 extern MenuDefUPP
50252 NewMenuDefUPP(MenuDefProcPtr userRoutine) ;
50253 extern void
50254 DisposeMenuDefUPP(MenuDefUPP userUPP) ;
50255 extern void
50256 InvokeMenuDefUPP(
50257   short message,
50258   MenuRef theMenu,
50259   Rect * menuRect,
50260   Point hitPt,
50261   short * whichItem,
50262   MenuDefUPP userUPP) ;
50263
50264 typedef long ( * MenuBarDefProcPtr)(short selector, short message, short parameter1, long parameter2);
50265 typedef void ( * MenuHookProcPtr)(void);
50266 typedef short ( * MBarHookProcPtr)(Rect * menuRect);
50267 typedef MenuBarDefProcPtr MenuBarDefUPP;
50268 typedef MenuHookProcPtr MenuHookUPP;
50269 typedef MBarHookProcPtr MBarHookUPP;
50270 enum {
50271   kMenuDefProcPtr = 0
50272 };
50273
50274 typedef UInt32 MenuDefType;
50275 enum {
50276   kMenuDefObjectClass = 1
50277 };
50278
50279 typedef struct OpaqueMenuLayoutRef* MenuLayoutRef;
50280 struct MenuDefSpec {
50281   MenuDefType defType;
50282   union {
50283     MenuDefUPP defProc;
50284   } u;
50285 };
50286 typedef struct MenuDefSpec MenuDefSpec;
50287 typedef MenuDefSpec * MenuDefSpecPtr;
50288 extern MenuRef
50289 NewMenu(
50290   MenuID menuID,
50291   ConstStr255Param menuTitle) ;
50292 extern MenuRef
50293 GetMenu(short resourceID) ;
50294 extern void
50295 DisposeMenu(MenuRef theMenu) ;
50296 extern void
50297 CalcMenuSize(MenuRef theMenu) ;
50298 extern UInt16
50299 CountMenuItems(MenuRef theMenu) ;
50300 extern OSStatus
50301 GetMenuFont(
50302   MenuRef menu,
50303   SInt16 * outFontID,
50304   UInt16 * outFontSize) ;
50305 extern OSStatus
50306 SetMenuFont(
50307   MenuRef menu,
50308   SInt16 inFontID,
50309   UInt16 inFontSize) ;
50310 extern Boolean
50311 GetMenuExcludesMarkColumn(MenuRef menu) ;
50312 extern OSStatus
50313 SetMenuExcludesMarkColumn(
50314   MenuRef menu,
50315   Boolean excludesMark) ;
50316 extern OSStatus
50317 RegisterMenuDefinition(
50318   SInt16 inResID,
50319   MenuDefSpecPtr inDefSpec) ;
50320 extern OSStatus
50321 CreateNewMenu(
50322   MenuID inMenuID,
50323   MenuAttributes inMenuAttributes,
50324   MenuRef * outMenuRef) ;
50325 extern OSStatus
50326 CreateCustomMenu(
50327   const MenuDefSpec * inDefSpec,
50328   MenuID inMenuID,
50329   MenuAttributes inMenuAttributes,
50330   MenuRef * outMenuRef) ;
50331 extern Boolean
50332 IsValidMenu(MenuRef inMenu) ;
50333 extern ItemCount
50334 GetMenuRetainCount(MenuRef inMenu) ;
50335 extern OSStatus
50336 RetainMenu(MenuRef inMenu) ;
50337 extern OSStatus
50338 ReleaseMenu(MenuRef inMenu) ;
50339 extern OSStatus
50340 DuplicateMenu(
50341   MenuRef inSourceMenu,
50342   MenuRef * outMenu) ;
50343 extern OSStatus
50344 CopyMenuTitleAsCFString(
50345   MenuRef inMenu,
50346   CFStringRef * outString) ;
50347 extern OSStatus
50348 SetMenuTitleWithCFString(
50349   MenuRef inMenu,
50350   CFStringRef inString) ;
50351 extern OSStatus
50352 SetMenuTitleIcon(
50353   MenuRef inMenu,
50354   UInt32 inType,
50355   void * inIcon) ;
50356 extern OSStatus
50357 GetMenuTitleIcon(
50358   MenuRef inMenu,
50359   UInt32 * outType,
50360   void ** outIcon) ;
50361 extern OSStatus
50362 InvalidateMenuSize(MenuRef inMenu) ;
50363 extern Boolean
50364 IsMenuSizeInvalid(MenuRef inMenu) ;
50365 extern OSStatus
50366 EraseMenuBackground(
50367   MenuRef inMenu,
50368   const Rect * inEraseRect,
50369   CGContextRef inContext) ;
50370 extern OSStatus
50371 ScrollMenuImage(
50372   MenuRef inMenu,
50373   const Rect * inScrollRect,
50374   int inHScroll,
50375   int inVScroll,
50376   CGContextRef inContext) ;
50377 extern void
50378 AppendMenu(
50379   MenuRef menu,
50380   ConstStr255Param data) ;
50381 extern void
50382 InsertResMenu(
50383   MenuRef theMenu,
50384   ResType theType,
50385   short afterItem) ;
50386 extern void
50387 AppendResMenu(
50388   MenuRef theMenu,
50389   ResType theType) ;
50390 extern void
50391 InsertMenuItem(
50392   MenuRef theMenu,
50393   ConstStr255Param itemString,
50394   short afterItem) ;
50395 extern void
50396 DeleteMenuItem(
50397   MenuRef theMenu,
50398   short item) ;
50399 extern void
50400 InsertFontResMenu(
50401   MenuRef theMenu,
50402   short afterItem,
50403   short scriptFilter) ;
50404 extern void
50405 InsertIntlResMenu(
50406   MenuRef theMenu,
50407   ResType theType,
50408   short afterItem,
50409   short scriptFilter) ;
50410 extern OSStatus
50411 AppendMenuItemText(
50412   MenuRef menu,
50413   ConstStr255Param inString) ;
50414 extern OSStatus
50415 InsertMenuItemText(
50416   MenuRef menu,
50417   ConstStr255Param inString,
50418   MenuItemIndex afterItem) ;
50419 extern OSStatus
50420 CopyMenuItems(
50421   MenuRef inSourceMenu,
50422   MenuItemIndex inFirstItem,
50423   ItemCount inNumItems,
50424   MenuRef inDestMenu,
50425   MenuItemIndex inInsertAfter) ;
50426 extern OSStatus
50427 DeleteMenuItems(
50428   MenuRef inMenu,
50429   MenuItemIndex inFirstItem,
50430   ItemCount inNumItems) ;
50431 extern OSStatus
50432 AppendMenuItemTextWithCFString(
50433   MenuRef inMenu,
50434   CFStringRef inString,
50435   MenuItemAttributes inAttributes,
50436   MenuCommand inCommandID,
50437   MenuItemIndex * outNewItem) ;
50438 extern OSStatus
50439 InsertMenuItemTextWithCFString(
50440   MenuRef inMenu,
50441   CFStringRef inString,
50442   MenuItemIndex inAfterItem,
50443   MenuItemAttributes inAttributes,
50444   MenuCommand inCommandID) ;
50445 extern long
50446 MenuKey(CharParameter ch) ;
50447 extern long
50448 MenuSelect(Point startPt) ;
50449 extern long
50450 PopUpMenuSelect(
50451   MenuRef menu,
50452   short top,
50453   short left,
50454   short popUpItem) ;
50455 extern long
50456 MenuChoice(void) ;
50457 extern UInt32
50458 MenuEvent(const EventRecord * inEvent) ;
50459 extern Boolean
50460 IsMenuKeyEvent(
50461   MenuRef inStartMenu,
50462   EventRef inEvent,
50463   MenuEventOptions inOptions,
50464   MenuRef * outMenu,
50465   MenuItemIndex * outMenuItem) ;
50466 extern OSStatus
50467 InvalidateMenuEnabling(MenuRef inMenu) ;
50468 extern short
50469 GetMBarHeight(void) ;
50470 extern void
50471 DrawMenuBar(void) ;
50472 extern void
50473 InvalMenuBar(void) ;
50474 extern Boolean
50475 IsMenuBarInvalid(MenuRef rootMenu) ;
50476 extern void
50477 HiliteMenu(MenuID menuID) ;
50478 extern MenuBarHandle
50479 GetNewMBar(short menuBarID) ;
50480 extern MenuBarHandle
50481 GetMenuBar(void) ;
50482 extern void
50483 SetMenuBar(MenuBarHandle mbar) ;
50484 extern OSStatus
50485 DuplicateMenuBar(
50486   MenuBarHandle inMbar,
50487   MenuBarHandle * outMbar) ;
50488 extern OSStatus
50489 DisposeMenuBar(MenuBarHandle inMbar) ;
50490 extern MenuRef
50491 GetMenuHandle(MenuID menuID) ;
50492 extern void
50493 InsertMenu(
50494   MenuRef theMenu,
50495   MenuID beforeID) ;
50496 extern void
50497 DeleteMenu(MenuID menuID) ;
50498 extern void
50499 ClearMenuBar(void) ;
50500 extern void
50501 SetMenuFlashCount(short count) ;
50502 extern void
50503 FlashMenuBar(MenuID menuID) ;
50504 extern Boolean
50505 IsMenuBarVisible(void) ;
50506 extern void
50507 ShowMenuBar(void) ;
50508 extern void
50509 HideMenuBar(void) ;
50510 extern MenuRef
50511 AcquireRootMenu(void) ;
50512 extern OSStatus
50513 SetRootMenu(MenuRef inMenu) ;
50514 extern void
50515 CheckMenuItem(
50516   MenuRef theMenu,
50517   short item,
50518   Boolean checked) ;
50519 extern void
50520 SetMenuItemText(
50521   MenuRef theMenu,
50522   short item,
50523   ConstStr255Param itemString) ;
50524 extern void
50525 GetMenuItemText(
50526   MenuRef theMenu,
50527   short item,
50528   Str255 itemString) ;
50529 extern void
50530 SetItemMark(
50531   MenuRef theMenu,
50532   short item,
50533   CharParameter markChar) ;
50534 extern void
50535 GetItemMark(
50536   MenuRef theMenu,
50537   short item,
50538   CharParameter * markChar) ;
50539 extern void
50540 SetItemCmd(
50541   MenuRef theMenu,
50542   short item,
50543   CharParameter cmdChar) ;
50544 extern void
50545 GetItemCmd(
50546   MenuRef theMenu,
50547   short item,
50548   CharParameter * cmdChar) ;
50549 extern void
50550 SetItemIcon(
50551   MenuRef theMenu,
50552   short item,
50553   short iconIndex) ;
50554 extern void
50555 GetItemIcon(
50556   MenuRef theMenu,
50557   short item,
50558   short * iconIndex) ;
50559 extern void
50560 SetItemStyle(
50561   MenuRef theMenu,
50562   short item,
50563   StyleParameter chStyle) ;
50564 extern void
50565 GetItemStyle(
50566   MenuRef theMenu,
50567   short item,
50568   Style * chStyle) ;
50569 extern OSErr
50570 SetMenuItemCommandID(
50571   MenuRef inMenu,
50572   SInt16 inItem,
50573   MenuCommand inCommandID) ;
50574 extern OSErr
50575 GetMenuItemCommandID(
50576   MenuRef inMenu,
50577   SInt16 inItem,
50578   MenuCommand * outCommandID) ;
50579 extern OSErr
50580 SetMenuItemModifiers(
50581   MenuRef inMenu,
50582   SInt16 inItem,
50583   UInt8 inModifiers) ;
50584 extern OSErr
50585 GetMenuItemModifiers(
50586   MenuRef inMenu,
50587   SInt16 inItem,
50588   UInt8 * outModifiers) ;
50589 extern OSErr
50590 SetMenuItemIconHandle(
50591   MenuRef inMenu,
50592   SInt16 inItem,
50593   UInt8 inIconType,
50594   Handle inIconHandle) ;
50595 extern OSErr
50596 GetMenuItemIconHandle(
50597   MenuRef inMenu,
50598   SInt16 inItem,
50599   UInt8 * outIconType,
50600   Handle * outIconHandle) ;
50601 extern OSErr
50602 SetMenuItemTextEncoding(
50603   MenuRef inMenu,
50604   SInt16 inItem,
50605   TextEncoding inScriptID) ;
50606 extern OSErr
50607 GetMenuItemTextEncoding(
50608   MenuRef inMenu,
50609   SInt16 inItem,
50610   TextEncoding * outScriptID) ;
50611 extern OSErr
50612 SetMenuItemHierarchicalID(
50613   MenuRef inMenu,
50614   SInt16 inItem,
50615   MenuID inHierID) ;
50616 extern OSErr
50617 GetMenuItemHierarchicalID(
50618   MenuRef inMenu,
50619   SInt16 inItem,
50620   MenuID * outHierID) ;
50621 extern OSErr
50622 SetMenuItemFontID(
50623   MenuRef inMenu,
50624   SInt16 inItem,
50625   SInt16 inFontID) ;
50626 extern OSErr
50627 GetMenuItemFontID(
50628   MenuRef inMenu,
50629   SInt16 inItem,
50630   SInt16 * outFontID) ;
50631 extern OSErr
50632 SetMenuItemRefCon(
50633   MenuRef inMenu,
50634   SInt16 inItem,
50635   UInt32 inRefCon) ;
50636 extern OSErr
50637 GetMenuItemRefCon(
50638   MenuRef inMenu,
50639   SInt16 inItem,
50640   UInt32 * outRefCon) ;
50641 extern OSErr
50642 SetMenuItemKeyGlyph(
50643   MenuRef inMenu,
50644   SInt16 inItem,
50645   SInt16 inGlyph) ;
50646 extern OSErr
50647 GetMenuItemKeyGlyph(
50648   MenuRef inMenu,
50649   SInt16 inItem,
50650   SInt16 * outGlyph) ;
50651 extern void
50652 EnableMenuItem(
50653   MenuRef theMenu,
50654   MenuItemIndex item) ;
50655 extern void
50656 DisableMenuItem(
50657   MenuRef theMenu,
50658   MenuItemIndex item) ;
50659 extern Boolean
50660 IsMenuItemEnabled(
50661   MenuRef menu,
50662   MenuItemIndex item) ;
50663 extern void
50664 EnableMenuItemIcon(
50665   MenuRef theMenu,
50666   MenuItemIndex item) ;
50667 extern void
50668 DisableMenuItemIcon(
50669   MenuRef theMenu,
50670   MenuItemIndex item) ;
50671 extern Boolean
50672 IsMenuItemIconEnabled(
50673   MenuRef menu,
50674   MenuItemIndex item) ;
50675 extern OSStatus
50676 SetMenuItemHierarchicalMenu(
50677   MenuRef inMenu,
50678   MenuItemIndex inItem,
50679   MenuRef inHierMenu) ;
50680 extern OSStatus
50681 GetMenuItemHierarchicalMenu(
50682   MenuRef inMenu,
50683   MenuItemIndex inItem,
50684   MenuRef * outHierMenu) ;
50685 extern OSStatus
50686 CopyMenuItemTextAsCFString(
50687   MenuRef inMenu,
50688   MenuItemIndex inItem,
50689   CFStringRef * outString) ;
50690 extern OSStatus
50691 SetMenuItemTextWithCFString(
50692   MenuRef inMenu,
50693   MenuItemIndex inItem,
50694   CFStringRef inString) ;
50695 extern OSStatus
50696 GetMenuItemIndent(
50697   MenuRef inMenu,
50698   MenuItemIndex inItem,
50699   UInt32 * outIndent) ;
50700 extern OSStatus
50701 SetMenuItemIndent(
50702   MenuRef inMenu,
50703   MenuItemIndex inItem,
50704   UInt32 inIndent) ;
50705 extern OSStatus
50706 GetMenuItemCommandKey(
50707   MenuRef inMenu,
50708   MenuItemIndex inItem,
50709   Boolean inGetVirtualKey,
50710   UInt16 * outKey) ;
50711 extern OSStatus
50712 SetMenuItemCommandKey(
50713   MenuRef inMenu,
50714   MenuItemIndex inItem,
50715   Boolean inSetVirtualKey,
50716   UInt16 inKey) ;
50717 extern void
50718 DeleteMCEntries(
50719   MenuID menuID,
50720   short menuItem) ;
50721 extern MCTableHandle
50722 GetMCInfo(void) ;
50723 extern void
50724 SetMCInfo(MCTableHandle menuCTbl) ;
50725 extern void
50726 DisposeMCInfo(MCTableHandle menuCTbl) ;
50727 extern MCEntryPtr
50728 GetMCEntry(
50729   MenuID menuID,
50730   short menuItem) ;
50731 extern void
50732 SetMCEntries(
50733   short numEntries,
50734   MCTablePtr menuCEntries) ;
50735 enum {
50736   kMenuPropertyPersistent = 0x00000001
50737 };
50738 extern OSStatus
50739 GetMenuItemProperty(
50740   MenuRef menu,
50741   MenuItemIndex item,
50742   OSType propertyCreator,
50743   OSType propertyTag,
50744   UInt32 bufferSize,
50745   UInt32 * actualSize,
50746   void * propertyBuffer) ;
50747 extern OSStatus
50748 GetMenuItemPropertySize(
50749   MenuRef menu,
50750   MenuItemIndex item,
50751   OSType propertyCreator,
50752   OSType propertyTag,
50753   UInt32 * size) ;
50754 extern OSStatus
50755 SetMenuItemProperty(
50756   MenuRef menu,
50757   MenuItemIndex item,
50758   OSType propertyCreator,
50759   OSType propertyTag,
50760   UInt32 propertySize,
50761   const void * propertyData) ;
50762 extern OSStatus
50763 RemoveMenuItemProperty(
50764   MenuRef menu,
50765   MenuItemIndex item,
50766   OSType propertyCreator,
50767   OSType propertyTag) ;
50768 extern OSStatus
50769 GetMenuItemPropertyAttributes(
50770   MenuRef menu,
50771   MenuItemIndex item,
50772   OSType propertyCreator,
50773   OSType propertyTag,
50774   UInt32 * attributes) ;
50775 extern OSStatus
50776 ChangeMenuItemPropertyAttributes(
50777   MenuRef menu,
50778   MenuItemIndex item,
50779   OSType propertyCreator,
50780   OSType propertyTag,
50781   UInt32 attributesToSet,
50782   UInt32 attributesToClear) ;
50783 extern OSStatus
50784 GetMenuAttributes(
50785   MenuRef menu,
50786   MenuAttributes * outAttributes) ;
50787 extern OSStatus
50788 ChangeMenuAttributes(
50789   MenuRef menu,
50790   MenuAttributes setTheseAttributes,
50791   MenuAttributes clearTheseAttributes) ;
50792 extern OSStatus
50793 GetMenuItemAttributes(
50794   MenuRef menu,
50795   MenuItemIndex item,
50796   MenuItemAttributes * outAttributes) ;
50797 extern OSStatus
50798 ChangeMenuItemAttributes(
50799   MenuRef menu,
50800   MenuItemIndex item,
50801   MenuItemAttributes setTheseAttributes,
50802   MenuItemAttributes clearTheseAttributes) ;
50803 extern void
50804 DisableAllMenuItems(MenuRef theMenu) ;
50805 extern void
50806 EnableAllMenuItems(MenuRef theMenu) ;
50807 extern Boolean
50808 MenuHasEnabledItems(MenuRef theMenu) ;
50809 extern OSStatus
50810 GetMenuTrackingData(
50811   MenuRef theMenu,
50812   MenuTrackingData * outData) ;
50813 extern OSStatus
50814 GetMenuType(
50815   MenuRef theMenu,
50816   UInt16 * outType) ;
50817 extern ItemCount
50818 CountMenuItemsWithCommandID(
50819   MenuRef inMenu,
50820   MenuCommand inCommandID) ;
50821 extern OSStatus
50822 GetIndMenuItemWithCommandID(
50823   MenuRef inMenu,
50824   MenuCommand inCommandID,
50825   UInt32 inItemIndex,
50826   MenuRef * outMenu,
50827   MenuItemIndex * outIndex) ;
50828 extern void
50829 EnableMenuCommand(
50830   MenuRef inMenu,
50831   MenuCommand inCommandID) ;
50832 extern void
50833 DisableMenuCommand(
50834   MenuRef inMenu,
50835   MenuCommand inCommandID) ;
50836 extern Boolean
50837 IsMenuCommandEnabled(
50838   MenuRef inMenu,
50839   MenuCommand inCommandID) ;
50840 extern OSStatus
50841 SetMenuCommandMark(
50842   MenuRef inMenu,
50843   MenuCommand inCommandID,
50844   UniChar inMark) ;
50845 extern OSStatus
50846 GetMenuCommandMark(
50847   MenuRef inMenu,
50848   MenuCommand inCommandID,
50849   UniChar * outMark) ;
50850 extern OSStatus
50851 GetMenuCommandProperty(
50852   MenuRef inMenu,
50853   MenuCommand inCommandID,
50854   OSType inPropertyCreator,
50855   OSType inPropertyTag,
50856   ByteCount inBufferSize,
50857   ByteCount * outActualSize,
50858   void * inPropertyBuffer) ;
50859 extern OSStatus
50860 GetMenuCommandPropertySize(
50861   MenuRef inMenu,
50862   MenuCommand inCommandID,
50863   OSType inPropertyCreator,
50864   OSType inPropertyTag,
50865   ByteCount * outSize) ;
50866 extern OSStatus
50867 SetMenuCommandProperty(
50868   MenuRef inMenu,
50869   MenuCommand inCommandID,
50870   OSType inPropertyCreator,
50871   OSType inPropertyTag,
50872   ByteCount inPropertySize,
50873   const void * inPropertyData) ;
50874 extern OSStatus
50875 RemoveMenuCommandProperty(
50876   MenuRef inMenu,
50877   MenuCommand inCommandID,
50878   OSType inPropertyCreator,
50879   OSType inPropertyTag) ;
50880 extern OSStatus
50881 CopyMenuItemData(
50882   MenuRef inMenu,
50883   MenuItemID inItem,
50884   Boolean inIsCommandID,
50885   MenuItemDataPtr ioData) ;
50886 extern OSStatus
50887 SetMenuItemData(
50888   MenuRef inMenu,
50889   MenuItemID inItem,
50890   Boolean inIsCommandID,
50891   const MenuItemDataRec * inData) ;
50892 extern Boolean
50893 IsMenuItemInvalid(
50894   MenuRef inMenu,
50895   MenuItemIndex inItem) ;
50896 extern OSStatus
50897 InvalidateMenuItems(
50898   MenuRef inMenu,
50899   MenuItemIndex inFirstItem,
50900   ItemCount inNumItems) ;
50901 extern OSStatus
50902 UpdateInvalidMenuItems(MenuRef inMenu) ;
50903 enum {
50904   kHierarchicalFontMenuOption = 0x00000001
50905 };
50906 extern OSStatus
50907 CreateStandardFontMenu(
50908   MenuRef menu,
50909   MenuItemIndex afterItem,
50910   MenuID firstHierMenuID,
50911   OptionBits options,
50912   ItemCount * outHierMenuCount) ;
50913 extern OSStatus
50914 UpdateStandardFontMenu(
50915   MenuRef menu,
50916   ItemCount * outHierMenuCount) ;
50917 extern OSStatus
50918 GetFontFamilyFromMenuSelection(
50919   MenuRef menu,
50920   MenuItemIndex item,
50921   FMFontFamily * outFontFamily,
50922   FMFontStyle * outStyle) ;
50923 enum {
50924   gestaltContextualMenuAttr = 'cmnu',
50925   gestaltContextualMenuUnusedBit = 0,
50926   gestaltContextualMenuTrapAvailable = 1,
50927   gestaltContextualMenuHasAttributeAndModifierKeys = 2,
50928   gestaltContextualMenuHasUnicodeSupport = 3
50929 };
50930
50931
50932
50933
50934
50935
50936 enum {
50937
50938
50939
50940
50941
50942
50943   kCMHelpItemNoHelp = 0,
50944
50945
50946
50947
50948
50949
50950   kCMHelpItemAppleGuide = 1,
50951   kCMHelpItemOtherHelp = 2,
50952   kCMHelpItemRemoveHelp = 3
50953 };
50954
50955
50956
50957
50958
50959
50960 enum {
50961
50962
50963
50964
50965
50966   kCMNothingSelected = 0,
50967
50968
50969
50970
50971
50972
50973
50974   kCMMenuItemSelected = 1,
50975
50976
50977
50978
50979
50980
50981
50982   kCMShowHelpSelected = 3
50983 };
50984 enum {
50985   keyContextualMenuName = 'pnam',
50986
50987
50988
50989
50990
50991   keyContextualMenuCommandID = 'cmcd',
50992
50993
50994
50995
50996
50997
50998   keyContextualMenuSubmenu = 'cmsb',
50999
51000
51001
51002
51003
51004
51005   keyContextualMenuAttributes = 'cmat',
51006   keyContextualMenuModifiers = 'cmmd'
51007 };
51008 extern OSStatus
51009 InitContextualMenus(void) ;
51010 extern Boolean
51011 IsShowContextualMenuClick(const EventRecord * inEvent) ;
51012 extern Boolean
51013 IsShowContextualMenuEvent(EventRef inEvent) ;
51014 extern OSStatus
51015 ContextualMenuSelect(
51016   MenuRef inMenu,
51017   Point inGlobalLocation,
51018   Boolean inReserved,
51019   UInt32 inHelpType,
51020   ConstStr255Param inHelpItemString,
51021   const AEDesc * inSelection,
51022   UInt32 * outUserSelectionType,
51023   SInt16 * outMenuID,
51024   MenuItemIndex * outMenuItem) ;
51025 extern Boolean
51026 ProcessIsContextualMenuClient(ProcessSerialNumber * inPSN) ;
51027 struct ContextualMenuInterfaceStruct
51028 {
51029     void *_reserved; SInt32 (*QueryInterface)(void *thisPointer, CFUUIDBytes iid, void ** ppv); UInt32 (*AddRef)(void *thisPointer); UInt32 (*Release)(void *thisPointer);
51030     OSStatus ( *ExamineContext )(
51031           void* thisInstance,
51032           const AEDesc* inContext,
51033          AEDescList* outCommandPairs );
51034  OSStatus ( *HandleSelection )(
51035          void* thisInstance,
51036           AEDesc* inContext,
51037          SInt32 inCommandID );
51038  void ( *PostMenuCleanup )(
51039          void* thisInstance );
51040 };
51041 typedef struct ContextualMenuInterfaceStruct ContextualMenuInterfaceStruct;
51042
51043
51044
51045
51046
51047
51048
51049 extern OSStatus
51050 CMPluginExamineContext(
51051   void * thisInstance,
51052   const AEDesc * inContext,
51053   AEDescList * outCommandPairs);
51054 extern OSStatus
51055 CMPluginHandleSelection(
51056   void * thisInstance,
51057   AEDesc * inContext,
51058   SInt32 inCommandID);
51059 extern void
51060 CMPluginPostMenuCleanup(void * thisInstance);
51061 extern SInt16
51062 LMGetTheMenu(void) ;
51063 extern MenuID
51064 GetMenuID(MenuRef menu) ;
51065 extern SInt16
51066 GetMenuWidth(MenuRef menu) ;
51067 extern SInt16
51068 GetMenuHeight(MenuRef menu) ;
51069 extern StringPtr
51070 GetMenuTitle(
51071   MenuRef menu,
51072   Str255 title) ;
51073 extern OSStatus
51074 GetMenuDefinition(
51075   MenuRef menu,
51076   MenuDefSpecPtr outDefSpec) ;
51077 extern void
51078 SetMenuID(
51079   MenuRef menu,
51080   MenuID menuID) ;
51081 extern void
51082 SetMenuWidth(
51083   MenuRef menu,
51084   SInt16 width) ;
51085 extern void
51086 SetMenuHeight(
51087   MenuRef menu,
51088   SInt16 height) ;
51089 extern OSStatus
51090 SetMenuTitle(
51091   MenuRef menu,
51092   ConstStr255Param title) ;
51093 extern OSStatus
51094 SetMenuDefinition(
51095   MenuRef menu,
51096   const MenuDefSpec * defSpec) ;
51097
51098
51099 }
51100 extern "C" {
51101
51102
51103 typedef HIObjectRef HIToolbarRef;
51104 typedef HIObjectRef HIToolbarItemRef;
51105 enum {
51106
51107
51108
51109
51110
51111
51112   kHIToolbarDisplayModeDefault = 0,
51113
51114
51115
51116
51117
51118   kHIToolbarDisplayModeIconAndLabel = 1,
51119
51120
51121
51122
51123   kHIToolbarDisplayModeIconOnly = 2,
51124
51125
51126
51127
51128   kHIToolbarDisplayModeLabelOnly = 3
51129 };
51130
51131 typedef UInt32 HIToolbarDisplayMode;
51132
51133
51134
51135
51136
51137 enum {
51138
51139
51140
51141
51142
51143   kHIToolbarDisplaySizeDefault = 0,
51144
51145
51146
51147
51148   kHIToolbarDisplaySizeNormal = 1,
51149
51150
51151
51152
51153   kHIToolbarDisplaySizeSmall = 2
51154 };
51155
51156 typedef UInt32 HIToolbarDisplaySize;
51157
51158
51159
51160
51161
51162 enum {
51163
51164
51165
51166
51167   kHIToolbarNoAttributes = 0,
51168   kHIToolbarAutoSavesConfig = (1 << 0),
51169
51170
51171
51172
51173
51174
51175   kHIToolbarIsConfigurable = (1 << 1),
51176   kHIToolbarValidAttrs = kHIToolbarAutoSavesConfig | kHIToolbarIsConfigurable
51177 };
51178
51179
51180
51181
51182
51183
51184
51185 enum {
51186
51187
51188
51189
51190
51191
51192
51193   kHICommandCustomizeToolbar = 'tcfg',
51194
51195
51196
51197
51198
51199
51200   kHICommandShowToolbar = 'tbsh',
51201
51202
51203
51204
51205
51206
51207   kHICommandHideToolbar = 'tbhd'
51208 };
51209 enum {
51210
51211
51212
51213
51214
51215
51216   kEventToolbarGetDefaultIdentifiers = 1,
51217
51218
51219
51220
51221
51222
51223
51224   kEventToolbarGetAllowedIdentifiers = 2,
51225
51226
51227
51228
51229
51230   kEventToolbarCreateItemWithIdentifier = 3,
51231
51232
51233
51234
51235
51236
51237
51238   kEventToolbarCreateItemFromDrag = 4
51239 };
51240
51241
51242
51243
51244
51245
51246 enum {
51247
51248
51249
51250
51251
51252
51253   kEventToolbarItemImageChanged = 1,
51254
51255
51256
51257
51258
51259
51260   kEventToolbarItemLabelChanged = 2,
51261
51262
51263
51264
51265
51266
51267   kEventToolbarItemHelpTextChanged = 3,
51268
51269
51270
51271
51272
51273
51274   kEventToolbarItemCommandIDChanged = 4,
51275   kEventToolbarItemGetPersistentData = 5,
51276
51277
51278
51279
51280
51281
51282
51283   kEventToolbarItemCreateCustomView = 6,
51284
51285
51286
51287
51288
51289
51290   kEventToolbarItemEnabledStateChanged = 7,
51291
51292
51293
51294
51295
51296
51297
51298   kEventToolbarItemPerformAction = 8
51299 };
51300
51301
51302
51303
51304
51305
51306 enum {
51307   kHIToolbarItemNoAttributes = 0,
51308   kHIToolbarItemAllowDuplicates = (1 << 0),
51309   kHIToolbarItemCantBeRemoved = (1 << 1),
51310   kHIToolbarItemAnchoredLeft = (1 << 2),
51311   kHIToolbarItemIsSeparator = (1 << 3),
51312
51313
51314
51315
51316
51317
51318   kHIToolbarItemSendCmdToUserFocus = (1 << 4),
51319   kHIToolbarItemValidAttrs = kHIToolbarItemAllowDuplicates | kHIToolbarItemIsSeparator | kHIToolbarItemCantBeRemoved | kHIToolbarItemAnchoredLeft | kHIToolbarItemSendCmdToUserFocus,
51320   kHIToolbarItemMutableAttrs = kHIToolbarItemCantBeRemoved | kHIToolbarItemAnchoredLeft
51321 };
51322 extern OSStatus
51323 HIToolbarCreate(
51324   CFStringRef inIdentifier,
51325   OptionBits inAttributes,
51326   HIToolbarRef * outToolbar) ;
51327 extern OSStatus
51328 HIToolbarGetAttributes(
51329   HIToolbarRef inToolbar,
51330   OptionBits * outAttributes) ;
51331 extern OSStatus
51332 HIToolbarChangeAttributes(
51333   HIToolbarRef inToolbar,
51334   OptionBits inAttrsToSet,
51335   OptionBits inAttrsToClear) ;
51336 extern OSStatus
51337 HIToolbarGetDisplayMode(
51338   HIToolbarRef inToolbar,
51339   HIToolbarDisplayMode * outDisplayMode) ;
51340 extern OSStatus
51341 HIToolbarSetDisplayMode(
51342   HIToolbarRef inToolbar,
51343   HIToolbarDisplayMode inDisplayMode) ;
51344 extern OSStatus
51345 HIToolbarGetDisplaySize(
51346   HIToolbarRef inToolbar,
51347   HIToolbarDisplaySize * outSize) ;
51348 extern OSStatus
51349 HIToolbarSetDisplaySize(
51350   HIToolbarRef inToolbar,
51351   HIToolbarDisplaySize inSize) ;
51352 extern OSStatus
51353 HIToolbarCopyIdentifier(
51354   HIToolbarRef inToolbar,
51355   CFStringRef * outIdentifier) ;
51356 extern OSStatus
51357 HIToolbarCopyItems(
51358   HIToolbarRef inToolbar,
51359   CFArrayRef * outItems) ;
51360 extern OSStatus
51361 HIToolbarCreateItemWithIdentifier(
51362   HIToolbarRef inToolbar,
51363   CFStringRef inIdentifier,
51364   CFTypeRef inConfigData,
51365   HIToolbarItemRef * outItem) ;
51366 extern OSStatus
51367 HIToolbarInsertItemAtIndex(
51368   HIToolbarRef inToolbar,
51369   HIToolbarItemRef inItem,
51370   CFIndex inIndex) ;
51371 extern OSStatus
51372 HIToolbarAppendItem(
51373   HIToolbarRef inToolbar,
51374   HIToolbarItemRef inItem) ;
51375 extern OSStatus
51376 HIToolbarRemoveItemAtIndex(
51377   HIToolbarRef inToolbar,
51378   CFIndex inIndex) ;
51379 extern OSStatus
51380 HIToolbarSetDelegate(
51381   HIToolbarRef inToolbar,
51382   HIObjectRef inDelegate) ;
51383 extern HIObjectRef
51384 HIToolbarGetDelegate(HIToolbarRef inToolbar) ;
51385 extern OSStatus
51386 HIToolbarItemCreate(
51387   CFStringRef inIdentifier,
51388   OptionBits inOptions,
51389   HIToolbarItemRef * outItem) ;
51390 extern OSStatus
51391 HIToolbarItemCopyIdentifier(
51392   HIToolbarItemRef inItem,
51393   CFStringRef * outIdentifier) ;
51394 extern OSStatus
51395 HIToolbarItemGetAttributes(
51396   HIToolbarItemRef inItem,
51397   OptionBits * outAttributes) ;
51398 extern OSStatus
51399 HIToolbarItemChangeAttributes(
51400   HIToolbarItemRef inItem,
51401   OptionBits inAttrsToSet,
51402   OptionBits inAttrsToClear) ;
51403 extern OSStatus
51404 HIToolbarItemSetLabel(
51405   HIToolbarItemRef inItem,
51406   CFStringRef inLabel) ;
51407 extern OSStatus
51408 HIToolbarItemCopyLabel(
51409   HIToolbarItemRef inItem,
51410   CFStringRef * outLabel) ;
51411 extern OSStatus
51412 HIToolbarItemSetHelpText(
51413   HIToolbarItemRef inItem,
51414   CFStringRef inShortText,
51415   CFStringRef inLongText) ;
51416 extern OSStatus
51417 HIToolbarItemCopyHelpText(
51418   HIToolbarItemRef inItem,
51419   CFStringRef * outShortText,
51420   CFStringRef * outLongText) ;
51421 extern OSStatus
51422 HIToolbarItemSetCommandID(
51423   HIToolbarItemRef inItem,
51424   MenuCommand inCommandID) ;
51425 extern OSStatus
51426 HIToolbarItemGetCommandID(
51427   HIToolbarItemRef inItem,
51428   MenuCommand * outCommandID) ;
51429 extern OSStatus
51430 HIToolbarItemSetIconRef(
51431   HIToolbarItemRef inItem,
51432   IconRef inIcon) ;
51433 extern OSStatus
51434 HIToolbarItemSetImage(
51435   HIToolbarItemRef inItem,
51436   CGImageRef inImage) ;
51437 extern OSStatus
51438 HIToolbarItemCopyImage(
51439   HIToolbarItemRef inItem,
51440   CGImageRef * outImage) ;
51441 extern OSStatus
51442 HIToolbarItemSetMenu(
51443   HIToolbarItemRef inItem,
51444   MenuRef inMenu) ;
51445 extern OSStatus
51446 HIToolbarItemCopyMenu(
51447   HIToolbarItemRef inItem,
51448   MenuRef * outMenu) ;
51449 extern HIToolbarRef
51450 HIToolbarItemGetToolbar(HIToolbarItemRef inItem) ;
51451 extern Boolean
51452 HIToolbarItemIsEnabled(HIToolbarItemRef inItem) ;
51453 extern OSStatus
51454 HIToolbarItemSetEnabled(
51455   HIToolbarItemRef inItem,
51456   Boolean inEnabled) ;
51457
51458
51459
51460
51461 }
51462
51463
51464
51465 extern "C" {
51466
51467
51468
51469 typedef struct TERec TERec;
51470 typedef TERec * TEPtr;
51471 typedef TEPtr * TEHandle;
51472 typedef void ( * HighHookProcPtr)(const Rect *r, TEPtr pTE);
51473 typedef Boolean ( * EOLHookProcPtr)(char theChar, TEPtr pTE, TEHandle hTE);
51474 typedef void ( * CaretHookProcPtr)(const Rect *r, TEPtr pTE);
51475 typedef unsigned short ( * WidthHookProcPtr)(unsigned short textLen, unsigned short textOffset, void *textBufferPtr, TEPtr pTE, TEHandle hTE);
51476 typedef unsigned short ( * TextWidthHookProcPtr)(unsigned short textLen, unsigned short textOffset, void *textBufferPtr, TEPtr pTE, TEHandle hTE);
51477 typedef unsigned short ( * NWidthHookProcPtr)(unsigned short styleRunLen, unsigned short styleRunOffset, short slop, short direction, void *textBufferPtr, short *lineStart, TEPtr pTE, TEHandle hTE);
51478 typedef void ( * DrawHookProcPtr)(unsigned short textOffset, unsigned short drawLen, void *textBufferPtr, TEPtr pTE, TEHandle hTE);
51479 typedef Boolean ( * HitTestHookProcPtr)(unsigned short styleRunLen, unsigned short styleRunOffset, unsigned short slop, void *textBufferPtr, TEPtr pTE, TEHandle hTE, unsigned short *pixelWidth, unsigned short *charOffset, Boolean *pixelInChar);
51480 typedef void ( * TEFindWordProcPtr)(unsigned short currentPos, short caller, TEPtr pTE, TEHandle hTE, unsigned short *wordStart, unsigned short *wordEnd);
51481 typedef void ( * TERecalcProcPtr)(TEPtr pTE, unsigned short changeLength, unsigned short *lineStart, unsigned short *firstChar, unsigned short *lastChar);
51482 typedef void ( * TEDoTextProcPtr)(TEPtr pTE, unsigned short firstChar, unsigned short lastChar, short selector, GrafPtr *currentGrafPort, short *charPosition);
51483 typedef Boolean ( * TEClickLoopProcPtr)(TEPtr pTE);
51484 typedef Boolean ( * WordBreakProcPtr)(Ptr text, short charPos);
51485 typedef HighHookProcPtr HighHookUPP;
51486 typedef EOLHookProcPtr EOLHookUPP;
51487 typedef CaretHookProcPtr CaretHookUPP;
51488 typedef WidthHookProcPtr WidthHookUPP;
51489 typedef TextWidthHookProcPtr TextWidthHookUPP;
51490 typedef NWidthHookProcPtr NWidthHookUPP;
51491 typedef DrawHookProcPtr DrawHookUPP;
51492 typedef HitTestHookProcPtr HitTestHookUPP;
51493 typedef TEFindWordProcPtr TEFindWordUPP;
51494 typedef TERecalcProcPtr TERecalcUPP;
51495 typedef TEDoTextProcPtr TEDoTextUPP;
51496 typedef TEClickLoopProcPtr TEClickLoopUPP;
51497 typedef WordBreakProcPtr WordBreakUPP;
51498 struct TERec {
51499   Rect destRect;
51500   Rect viewRect;
51501   Rect selRect;
51502   short lineHeight;
51503   short fontAscent;
51504   Point selPoint;
51505   short selStart;
51506   short selEnd;
51507   short active;
51508   WordBreakUPP wordBreak;
51509   TEClickLoopUPP clickLoop;
51510   long clickTime;
51511   short clickLoc;
51512   long caretTime;
51513   short caretState;
51514   short just;
51515   short teLength;
51516   Handle hText;
51517   long hDispatchRec;
51518   short clikStuff;
51519   short crOnly;
51520   short txFont;
51521   StyleField txFace;
51522   short txMode;
51523   short txSize;
51524   GrafPtr inPort;
51525   HighHookUPP highHook;
51526   CaretHookUPP caretHook;
51527   short nLines;
51528   short lineStarts[16001];
51529 };
51530
51531 enum {
51532
51533   teJustLeft = 0,
51534   teJustCenter = 1,
51535   teJustRight = -1,
51536   teForceLeft = -2,
51537   teFlushDefault = 0,
51538   teCenter = 1,
51539   teFlushRight = -1,
51540   teFlushLeft = -2
51541 };
51542
51543 enum {
51544
51545   fontBit = 0,
51546   faceBit = 1,
51547   sizeBit = 2,
51548   clrBit = 3,
51549   addSizeBit = 4,
51550   toggleBit = 5
51551 };
51552
51553 enum {
51554
51555   doFont = 1,
51556   doFace = 2,
51557   doSize = 4,
51558   doColor = 8,
51559   doAll = 15,
51560   addSize = 16,
51561   doToggle = 32
51562 };
51563
51564 enum {
51565
51566   EOLHook = 0,
51567   DRAWHook = 4,
51568   WIDTHHook = 8,
51569   HITTESTHook = 12,
51570   nWIDTHHook = 24,
51571   TextWidthHook = 28
51572 };
51573
51574 enum {
51575
51576   intEOLHook = 0,
51577   intDrawHook = 1,
51578   intWidthHook = 2,
51579   intHitTestHook = 3,
51580   intNWidthHook = 6,
51581   intTextWidthHook = 7,
51582   intInlineInputTSMTEPreUpdateHook = 8,
51583   intInlineInputTSMTEPostUpdateHook = 9
51584 };
51585
51586 enum {
51587
51588   teFAutoScroll = 0,
51589   teFTextBuffering = 1,
51590   teFOutlineHilite = 2,
51591   teFInlineInput = 3,
51592   teFUseWhiteBackground = 4,
51593   teFUseInlineInput = 5,
51594   teFInlineInputAutoScroll = 6
51595 };
51596
51597 enum {
51598
51599
51600
51601
51602
51603
51604   teFIdleWithEventLoopTimer = 7
51605 };
51606
51607 enum {
51608
51609   teBitClear = 0,
51610   teBitSet = 1,
51611   teBitTest = -1
51612 };
51613
51614 enum {
51615
51616   teWordSelect = 4,
51617   teWordDrag = 8,
51618   teFromFind = 12,
51619   teFromRecal = 16
51620 };
51621
51622 enum {
51623
51624   teFind = 0,
51625   teHighlight = 1,
51626   teDraw = -1,
51627   teCaret = -2
51628 };
51629
51630
51631 typedef char Chars[32001];
51632 typedef char * CharsPtr;
51633 typedef CharsPtr * CharsHandle;
51634 struct StyleRun {
51635   short startChar;
51636   short styleIndex;
51637 };
51638 typedef struct StyleRun StyleRun;
51639 struct STElement {
51640   short stCount;
51641   short stHeight;
51642   short stAscent;
51643   short stFont;
51644   StyleField stFace;
51645   short stSize;
51646   RGBColor stColor;
51647 };
51648 typedef struct STElement STElement;
51649 typedef STElement TEStyleTable[1777];
51650 typedef STElement * STPtr;
51651 typedef STPtr * STHandle;
51652 struct LHElement {
51653   short lhHeight;
51654   short lhAscent;
51655 };
51656 typedef struct LHElement LHElement;
51657 typedef LHElement LHTable[8001];
51658 typedef LHElement * LHPtr;
51659 typedef LHPtr * LHHandle;
51660 struct ScrpSTElement {
51661   long scrpStartChar;
51662   short scrpHeight;
51663   short scrpAscent;
51664   short scrpFont;
51665   StyleField scrpFace;
51666   short scrpSize;
51667   RGBColor scrpColor;
51668 };
51669 typedef struct ScrpSTElement ScrpSTElement;
51670
51671 typedef ScrpSTElement ScrpSTTable[1601];
51672 struct StScrpRec {
51673   short scrpNStyles;
51674   ScrpSTTable scrpStyleTab;
51675 };
51676 typedef struct StScrpRec StScrpRec;
51677 typedef StScrpRec * StScrpPtr;
51678 typedef StScrpPtr * StScrpHandle;
51679 struct NullStRec {
51680   long teReserved;
51681   StScrpHandle nullScrap;
51682 };
51683 typedef struct NullStRec NullStRec;
51684 typedef NullStRec * NullStPtr;
51685 typedef NullStPtr * NullStHandle;
51686 struct TEStyleRec {
51687   short nRuns;
51688   short nStyles;
51689   STHandle styleTab;
51690   LHHandle lhTab;
51691   long teRefCon;
51692   NullStHandle nullStyle;
51693   StyleRun runs[8001];
51694 };
51695 typedef struct TEStyleRec TEStyleRec;
51696 typedef TEStyleRec * TEStylePtr;
51697 typedef TEStylePtr * TEStyleHandle;
51698 struct TextStyle {
51699   short tsFont;
51700   StyleField tsFace;
51701   short tsSize;
51702   RGBColor tsColor;
51703 };
51704 typedef struct TextStyle TextStyle;
51705 typedef TextStyle * TextStylePtr;
51706 typedef TextStylePtr * TextStyleHandle;
51707 typedef short TEIntHook;
51708 extern HighHookUPP
51709 NewHighHookUPP(HighHookProcPtr userRoutine) ;
51710 extern EOLHookUPP
51711 NewEOLHookUPP(EOLHookProcPtr userRoutine) ;
51712 extern CaretHookUPP
51713 NewCaretHookUPP(CaretHookProcPtr userRoutine) ;
51714 extern WidthHookUPP
51715 NewWidthHookUPP(WidthHookProcPtr userRoutine) ;
51716 extern TextWidthHookUPP
51717 NewTextWidthHookUPP(TextWidthHookProcPtr userRoutine) ;
51718 extern NWidthHookUPP
51719 NewNWidthHookUPP(NWidthHookProcPtr userRoutine) ;
51720 extern DrawHookUPP
51721 NewDrawHookUPP(DrawHookProcPtr userRoutine) ;
51722 extern HitTestHookUPP
51723 NewHitTestHookUPP(HitTestHookProcPtr userRoutine) ;
51724 extern TEFindWordUPP
51725 NewTEFindWordUPP(TEFindWordProcPtr userRoutine) ;
51726 extern TERecalcUPP
51727 NewTERecalcUPP(TERecalcProcPtr userRoutine) ;
51728 extern TEDoTextUPP
51729 NewTEDoTextUPP(TEDoTextProcPtr userRoutine) ;
51730 extern TEClickLoopUPP
51731 NewTEClickLoopUPP(TEClickLoopProcPtr userRoutine) ;
51732 extern void
51733 DisposeHighHookUPP(HighHookUPP userUPP) ;
51734 extern void
51735 DisposeEOLHookUPP(EOLHookUPP userUPP) ;
51736 extern void
51737 DisposeCaretHookUPP(CaretHookUPP userUPP) ;
51738 extern void
51739 DisposeWidthHookUPP(WidthHookUPP userUPP) ;
51740 extern void
51741 DisposeTextWidthHookUPP(TextWidthHookUPP userUPP) ;
51742 extern void
51743 DisposeNWidthHookUPP(NWidthHookUPP userUPP) ;
51744 extern void
51745 DisposeDrawHookUPP(DrawHookUPP userUPP) ;
51746 extern void
51747 DisposeHitTestHookUPP(HitTestHookUPP userUPP) ;
51748 extern void
51749 DisposeTEFindWordUPP(TEFindWordUPP userUPP) ;
51750 extern void
51751 DisposeTERecalcUPP(TERecalcUPP userUPP) ;
51752 extern void
51753 DisposeTEDoTextUPP(TEDoTextUPP userUPP) ;
51754 extern void
51755 DisposeTEClickLoopUPP(TEClickLoopUPP userUPP) ;
51756 extern void
51757 InvokeHighHookUPP(
51758   const Rect * r,
51759   TEPtr pTE,
51760   HighHookUPP userUPP) ;
51761 extern Boolean
51762 InvokeEOLHookUPP(
51763   char theChar,
51764   TEPtr pTE,
51765   TEHandle hTE,
51766   EOLHookUPP userUPP) ;
51767 extern void
51768 InvokeCaretHookUPP(
51769   const Rect * r,
51770   TEPtr pTE,
51771   CaretHookUPP userUPP) ;
51772 extern unsigned short
51773 InvokeWidthHookUPP(
51774   unsigned short textLen,
51775   unsigned short textOffset,
51776   void * textBufferPtr,
51777   TEPtr pTE,
51778   TEHandle hTE,
51779   WidthHookUPP userUPP) ;
51780 extern unsigned short
51781 InvokeTextWidthHookUPP(
51782   unsigned short textLen,
51783   unsigned short textOffset,
51784   void * textBufferPtr,
51785   TEPtr pTE,
51786   TEHandle hTE,
51787   TextWidthHookUPP userUPP) ;
51788 extern unsigned short
51789 InvokeNWidthHookUPP(
51790   unsigned short styleRunLen,
51791   unsigned short styleRunOffset,
51792   short slop,
51793   short direction,
51794   void * textBufferPtr,
51795   short * lineStart,
51796   TEPtr pTE,
51797   TEHandle hTE,
51798   NWidthHookUPP userUPP) ;
51799 extern void
51800 InvokeDrawHookUPP(
51801   unsigned short textOffset,
51802   unsigned short drawLen,
51803   void * textBufferPtr,
51804   TEPtr pTE,
51805   TEHandle hTE,
51806   DrawHookUPP userUPP) ;
51807 extern Boolean
51808 InvokeHitTestHookUPP(
51809   unsigned short styleRunLen,
51810   unsigned short styleRunOffset,
51811   unsigned short slop,
51812   void * textBufferPtr,
51813   TEPtr pTE,
51814   TEHandle hTE,
51815   unsigned short * pixelWidth,
51816   unsigned short * charOffset,
51817   Boolean * pixelInChar,
51818   HitTestHookUPP userUPP) ;
51819 extern void
51820 InvokeTEFindWordUPP(
51821   unsigned short currentPos,
51822   short caller,
51823   TEPtr pTE,
51824   TEHandle hTE,
51825   unsigned short * wordStart,
51826   unsigned short * wordEnd,
51827   TEFindWordUPP userUPP) ;
51828 extern void
51829 InvokeTERecalcUPP(
51830   TEPtr pTE,
51831   unsigned short changeLength,
51832   unsigned short * lineStart,
51833   unsigned short * firstChar,
51834   unsigned short * lastChar,
51835   TERecalcUPP userUPP) ;
51836 extern void
51837 InvokeTEDoTextUPP(
51838   TEPtr pTE,
51839   unsigned short firstChar,
51840   unsigned short lastChar,
51841   short selector,
51842   GrafPtr * currentGrafPort,
51843   short * charPosition,
51844   TEDoTextUPP userUPP) ;
51845 extern Boolean
51846 InvokeTEClickLoopUPP(
51847   TEPtr pTE,
51848   TEClickLoopUPP userUPP) ;
51849 enum {
51850
51851   teFUseTextServices = 4
51852 };
51853 extern Handle
51854 TEScrapHandle(void) ;
51855 extern long
51856 TEGetScrapLength(void) ;
51857 extern TEHandle
51858 TENew(
51859   const Rect * destRect,
51860   const Rect * viewRect) ;
51861 extern void
51862 TEDispose(TEHandle hTE) ;
51863 extern void
51864 TESetText(
51865   const void * text,
51866   long length,
51867   TEHandle hTE) ;
51868 extern CharsHandle
51869 TEGetText(TEHandle hTE) ;
51870 extern void
51871 TEIdle(TEHandle hTE) ;
51872 extern void
51873 TESetSelect(
51874   long selStart,
51875   long selEnd,
51876   TEHandle hTE) ;
51877 extern void
51878 TEActivate(TEHandle hTE) ;
51879 extern void
51880 TEDeactivate(TEHandle hTE) ;
51881 extern void
51882 TEKey(
51883   CharParameter key,
51884   TEHandle hTE) ;
51885 extern void
51886 TECut(TEHandle hTE) ;
51887 extern void
51888 TECopy(TEHandle hTE) ;
51889 extern void
51890 TEPaste(TEHandle hTE) ;
51891 extern void
51892 TEDelete(TEHandle hTE) ;
51893 extern void
51894 TEInsert(
51895   const void * text,
51896   long length,
51897   TEHandle hTE) ;
51898 extern void
51899 TESetAlignment(
51900   short just,
51901   TEHandle hTE) ;
51902 extern void
51903 TEUpdate(
51904   const Rect * rUpdate,
51905   TEHandle hTE) ;
51906 extern void
51907 TETextBox(
51908   const void * text,
51909   long length,
51910   const Rect * box,
51911   short just) ;
51912 extern void
51913 TEScroll(
51914   short dh,
51915   short dv,
51916   TEHandle hTE) ;
51917 extern void
51918 TESelView(TEHandle hTE) ;
51919 extern void
51920 TEPinScroll(
51921   short dh,
51922   short dv,
51923   TEHandle hTE) ;
51924 extern void
51925 TEAutoView(
51926   Boolean fAuto,
51927   TEHandle hTE) ;
51928 extern void
51929 TECalText(TEHandle hTE) ;
51930 extern short
51931 TEGetOffset(
51932   Point pt,
51933   TEHandle hTE) ;
51934 extern Point
51935 TEGetPoint(
51936   short offset,
51937   TEHandle hTE) ;
51938 extern void
51939 TEClick(
51940   Point pt,
51941   Boolean fExtend,
51942   TEHandle h) ;
51943 extern TEHandle
51944 TEStyleNew(
51945   const Rect * destRect,
51946   const Rect * viewRect) ;
51947 extern void
51948 TESetStyleHandle(
51949   TEStyleHandle theHandle,
51950   TEHandle hTE) ;
51951 extern TEStyleHandle
51952 TEGetStyleHandle(TEHandle hTE) ;
51953 extern void
51954 TEGetStyle(
51955   short offset,
51956   TextStyle * theStyle,
51957   short * lineHeight,
51958   short * fontAscent,
51959   TEHandle hTE) ;
51960 extern void
51961 TEStylePaste(TEHandle hTE) ;
51962 extern void
51963 TESetStyle(
51964   short mode,
51965   const TextStyle * newStyle,
51966   Boolean fRedraw,
51967   TEHandle hTE) ;
51968 extern void
51969 TEReplaceStyle(
51970   short mode,
51971   const TextStyle * oldStyle,
51972   const TextStyle * newStyle,
51973   Boolean fRedraw,
51974   TEHandle hTE) ;
51975 extern StScrpHandle
51976 TEGetStyleScrapHandle(TEHandle hTE) ;
51977 extern void
51978 TEStyleInsert(
51979   const void * text,
51980   long length,
51981   StScrpHandle hST,
51982   TEHandle hTE) ;
51983 extern long
51984 TEGetHeight(
51985   long endLine,
51986   long startLine,
51987   TEHandle hTE) ;
51988 extern Boolean
51989 TEContinuousStyle(
51990   short * mode,
51991   TextStyle * aStyle,
51992   TEHandle hTE) ;
51993 extern void
51994 TEUseStyleScrap(
51995   long rangeStart,
51996   long rangeEnd,
51997   StScrpHandle newStyles,
51998   Boolean fRedraw,
51999   TEHandle hTE) ;
52000 extern void
52001 TECustomHook(
52002   TEIntHook which,
52003   UniversalProcPtr * addr,
52004   TEHandle hTE) ;
52005 extern long
52006 TENumStyles(
52007   long rangeStart,
52008   long rangeEnd,
52009   TEHandle hTE) ;
52010 extern short
52011 TEFeatureFlag(
52012   short feature,
52013   short action,
52014   TEHandle hTE) ;
52015 extern OSErr
52016 TEGetHiliteRgn(
52017   RgnHandle region,
52018   TEHandle hTE) ;
52019 extern void
52020 TESetScrapLength(long length) ;
52021 extern OSErr
52022 TEFromScrap(void) ;
52023 extern OSErr
52024 TEToScrap(void) ;
52025 extern void
52026 TESetClickLoop(
52027   TEClickLoopUPP clikProc,
52028   TEHandle hTE) ;
52029 extern TEDoTextUPP
52030 TEGetDoTextHook(void) ;
52031 extern void
52032 TESetDoTextHook(TEDoTextUPP value) ;
52033 extern TERecalcUPP
52034 TEGetRecalcHook(void) ;
52035 extern void
52036 TESetRecalcHook(TERecalcUPP value) ;
52037 extern TEFindWordUPP
52038 TEGetFindWordHook(void) ;
52039 extern void
52040 TESetFindWordHook(TEFindWordUPP value) ;
52041 extern Handle
52042 TEGetScrapHandle(void) ;
52043 extern void
52044 TESetScrapHandle(Handle value) ;
52045 extern UInt8
52046 LMGetWordRedraw(void) ;
52047 extern void
52048 LMSetWordRedraw(UInt8 value) ;
52049
52050
52051 }
52052
52053
52054
52055 extern "C" {
52056
52057
52058 typedef CGPoint HIPoint;
52059 typedef CGSize HISize;
52060 typedef CGRect HIRect;
52061
52062
52063
52064
52065
52066
52067 typedef struct OpaqueDragRef* DragRef;
52068 typedef UInt32 DragItemRef;
52069 typedef OSType FlavorType;
52070
52071
52072
52073
52074
52075
52076 typedef UInt32 DragAttributes;
52077 enum {
52078   kDragHasLeftSenderWindow = (1L << 0),
52079   kDragInsideSenderApplication = (1L << 1),
52080   kDragInsideSenderWindow = (1L << 2)
52081 };
52082
52083
52084
52085
52086
52087
52088
52089 typedef UInt32 DragBehaviors;
52090 enum {
52091   kDragBehaviorNone = 0,
52092   kDragBehaviorZoomBackAnimation = (1L << 0)
52093 };
52094
52095
52096
52097
52098
52099
52100
52101 typedef UInt32 DragImageFlags;
52102 enum {
52103   kDragRegionAndImage = (1L << 4)
52104 };
52105 enum {
52106   kDragStandardTranslucency = 0L,
52107   kDragDarkTranslucency = 1L,
52108   kDragDarkerTranslucency = 2L,
52109   kDragOpaqueTranslucency = 3L
52110 };
52111 typedef SInt16 DragRegionMessage;
52112 enum {
52113   kDragRegionBegin = 1,
52114   kDragRegionDraw = 2,
52115   kDragRegionHide = 3,
52116   kDragRegionIdle = 4,
52117   kDragRegionEnd = 5
52118 };
52119 typedef SInt16 ZoomAcceleration;
52120 enum {
52121   kZoomNoAcceleration = 0,
52122   kZoomAccelerate = 1,
52123   kZoomDecelerate = 2
52124 };
52125 typedef UInt32 FlavorFlags;
52126 enum {
52127   flavorSenderOnly = (1 << 0),
52128   flavorSenderTranslated = (1 << 1),
52129   flavorNotSaved = (1 << 2),
52130   flavorSystemTranslated = (1 << 8),
52131   flavorDataPromised = (1 << 9)
52132 };
52133 enum {
52134   kDragFlavorTypeHFS = 'hfs ',
52135   kDragFlavorTypePromiseHFS = 'phfs',
52136   flavorTypeHFS = kDragFlavorTypeHFS,
52137   flavorTypePromiseHFS = kDragFlavorTypePromiseHFS
52138 };
52139
52140 enum {
52141   kDragPromisedFlavorFindFile = 'rWm1',
52142   kDragPromisedFlavor = 'fssP'
52143 };
52144
52145 enum {
52146   kDragPseudoCreatorVolumeOrDirectory = 'MACS',
52147   kDragPseudoFileTypeVolume = 'disk',
52148   kDragPseudoFileTypeDirectory = 'fold'
52149 };
52150 enum {
52151   flavorTypeDirectory = 'diry'
52152 };
52153 enum {
52154   kFlavorTypeClippingName = 'clnm',
52155   kFlavorTypeClippingFilename = 'clfn',
52156   kFlavorTypeUnicodeClippingName = 'ucln',
52157   kFlavorTypeUnicodeClippingFilename = 'uclf',
52158   kFlavorTypeDragToTrashOnly = 'fdtt',
52159   kFlavorTypeFinderNoTrackingBehavior = 'fntb'
52160 };
52161 typedef SInt16 DragTrackingMessage;
52162 enum {
52163   kDragTrackingEnterHandler = 1,
52164   kDragTrackingEnterWindow = 2,
52165   kDragTrackingInWindow = 3,
52166   kDragTrackingLeaveWindow = 4,
52167   kDragTrackingLeaveHandler = 5
52168 };
52169 enum {
52170
52171
52172
52173
52174
52175
52176
52177   kDragStandardDropLocationTrash = 'trsh',
52178
52179
52180
52181
52182   kDragStandardDropLocationUnknown = 'unkn'
52183 };
52184
52185 typedef OSType StandardDropLocation;
52186 enum {
52187
52188
52189
52190
52191
52192
52193   kDragActionNothing = 0L,
52194
52195
52196
52197
52198   kDragActionCopy = 1L,
52199
52200
52201
52202
52203   kDragActionAlias = (1L << 1),
52204
52205
52206
52207
52208
52209   kDragActionGeneric = (1L << 2),
52210
52211
52212
52213
52214
52215   kDragActionPrivate = (1L << 3),
52216
52217
52218
52219
52220   kDragActionMove = (1L << 4),
52221
52222
52223
52224
52225   kDragActionDelete = (1L << 5),
52226
52227
52228
52229
52230   kDragActionAll = (long)0xFFFFFFFF
52231 };
52232
52233 typedef UInt32 DragActions;
52234
52235
52236
52237
52238
52239
52240 struct HFSFlavor {
52241   OSType fileType;
52242   OSType fileCreator;
52243   UInt16 fdFlags;
52244   FSSpec fileSpec;
52245 };
52246 typedef struct HFSFlavor HFSFlavor;
52247 struct PromiseHFSFlavor {
52248   OSType fileType;
52249   OSType fileCreator;
52250   UInt16 fdFlags;
52251   FlavorType promisedFlavor;
52252 };
52253 typedef struct PromiseHFSFlavor PromiseHFSFlavor;
52254
52255
52256
52257
52258
52259
52260 typedef OSErr ( * DragTrackingHandlerProcPtr)(DragTrackingMessage message, WindowRef theWindow, void *handlerRefCon, DragRef theDrag);
52261 typedef OSErr ( * DragReceiveHandlerProcPtr)(WindowRef theWindow, void *handlerRefCon, DragRef theDrag);
52262 typedef DragTrackingHandlerProcPtr DragTrackingHandlerUPP;
52263 typedef DragReceiveHandlerProcPtr DragReceiveHandlerUPP;
52264 extern DragTrackingHandlerUPP
52265 NewDragTrackingHandlerUPP(DragTrackingHandlerProcPtr userRoutine) ;
52266 extern DragReceiveHandlerUPP
52267 NewDragReceiveHandlerUPP(DragReceiveHandlerProcPtr userRoutine) ;
52268 extern void
52269 DisposeDragTrackingHandlerUPP(DragTrackingHandlerUPP userUPP) ;
52270 extern void
52271 DisposeDragReceiveHandlerUPP(DragReceiveHandlerUPP userUPP) ;
52272 extern OSErr
52273 InvokeDragTrackingHandlerUPP(
52274   DragTrackingMessage message,
52275   WindowRef theWindow,
52276   void * handlerRefCon,
52277   DragRef theDrag,
52278   DragTrackingHandlerUPP userUPP) ;
52279 extern OSErr
52280 InvokeDragReceiveHandlerUPP(
52281   WindowRef theWindow,
52282   void * handlerRefCon,
52283   DragRef theDrag,
52284   DragReceiveHandlerUPP userUPP) ;
52285
52286
52287
52288
52289
52290
52291
52292 typedef OSErr ( * DragSendDataProcPtr)(FlavorType theType, void *dragSendRefCon, DragItemRef theItemRef, DragRef theDrag);
52293 typedef OSErr ( * DragInputProcPtr)(Point *mouse, SInt16 *modifiers, void *dragInputRefCon, DragRef theDrag);
52294 typedef OSErr ( * DragDrawingProcPtr)(DragRegionMessage message, RgnHandle showRegion, Point showOrigin, RgnHandle hideRegion, Point hideOrigin, void *dragDrawingRefCon, DragRef theDrag);
52295 typedef DragSendDataProcPtr DragSendDataUPP;
52296 typedef DragInputProcPtr DragInputUPP;
52297 typedef DragDrawingProcPtr DragDrawingUPP;
52298 extern DragSendDataUPP
52299 NewDragSendDataUPP(DragSendDataProcPtr userRoutine) ;
52300 extern DragInputUPP
52301 NewDragInputUPP(DragInputProcPtr userRoutine) ;
52302 extern DragDrawingUPP
52303 NewDragDrawingUPP(DragDrawingProcPtr userRoutine) ;
52304 extern void
52305 DisposeDragSendDataUPP(DragSendDataUPP userUPP) ;
52306 extern void
52307 DisposeDragInputUPP(DragInputUPP userUPP) ;
52308 extern void
52309 DisposeDragDrawingUPP(DragDrawingUPP userUPP) ;
52310 extern OSErr
52311 InvokeDragSendDataUPP(
52312   FlavorType theType,
52313   void * dragSendRefCon,
52314   DragItemRef theItemRef,
52315   DragRef theDrag,
52316   DragSendDataUPP userUPP) ;
52317 extern OSErr
52318 InvokeDragInputUPP(
52319   Point * mouse,
52320   SInt16 * modifiers,
52321   void * dragInputRefCon,
52322   DragRef theDrag,
52323   DragInputUPP userUPP) ;
52324 extern OSErr
52325 InvokeDragDrawingUPP(
52326   DragRegionMessage message,
52327   RgnHandle showRegion,
52328   Point showOrigin,
52329   RgnHandle hideRegion,
52330   Point hideOrigin,
52331   void * dragDrawingRefCon,
52332   DragRef theDrag,
52333   DragDrawingUPP userUPP) ;
52334 extern OSErr
52335 InstallTrackingHandler(
52336   DragTrackingHandlerUPP trackingHandler,
52337   WindowRef theWindow,
52338   void * handlerRefCon) ;
52339 extern OSErr
52340 InstallReceiveHandler(
52341   DragReceiveHandlerUPP receiveHandler,
52342   WindowRef theWindow,
52343   void * handlerRefCon) ;
52344 extern OSErr
52345 RemoveTrackingHandler(
52346   DragTrackingHandlerUPP trackingHandler,
52347   WindowRef theWindow) ;
52348 extern OSErr
52349 RemoveReceiveHandler(
52350   DragReceiveHandlerUPP receiveHandler,
52351   WindowRef theWindow) ;
52352 extern OSErr
52353 NewDrag(DragRef * theDrag) ;
52354 extern OSErr
52355 DisposeDrag(DragRef theDrag) ;
52356 extern OSErr
52357 AddDragItemFlavor(
52358   DragRef theDrag,
52359   DragItemRef theItemRef,
52360   FlavorType theType,
52361   const void * dataPtr,
52362   Size dataSize,
52363   FlavorFlags theFlags) ;
52364 extern OSErr
52365 SetDragItemFlavorData(
52366   DragRef theDrag,
52367   DragItemRef theItemRef,
52368   FlavorType theType,
52369   const void * dataPtr,
52370   Size dataSize,
52371   UInt32 dataOffset) ;
52372 extern OSErr
52373 SetDragSendProc(
52374   DragRef theDrag,
52375   DragSendDataUPP sendProc,
52376   void * dragSendRefCon) ;
52377 extern OSErr
52378 SetDragInputProc(
52379   DragRef theDrag,
52380   DragInputUPP inputProc,
52381   void * dragInputRefCon) ;
52382 extern OSErr
52383 SetDragDrawingProc(
52384   DragRef theDrag,
52385   DragDrawingUPP drawingProc,
52386   void * dragDrawingRefCon) ;
52387 extern OSErr
52388 SetDragImage(
52389   DragRef theDrag,
52390   PixMapHandle imagePixMap,
52391   RgnHandle imageRgn,
52392   Point imageOffsetPt,
52393   DragImageFlags theImageFlags) ;
52394 extern OSStatus
52395 SetDragImageWithCGImage(
52396   DragRef inDrag,
52397   CGImageRef inCGImage,
52398   const HIPoint * inImageOffsetPt,
52399   DragImageFlags inImageFlags) ;
52400 extern OSErr
52401 ChangeDragBehaviors(
52402   DragRef theDrag,
52403   DragBehaviors inBehaviorsToSet,
52404   DragBehaviors inBehaviorsToClear) ;
52405 extern OSErr
52406 TrackDrag(
52407   DragRef theDrag,
52408   const EventRecord * theEvent,
52409   RgnHandle theRegion) ;
52410 extern OSErr
52411 CountDragItems(
52412   DragRef theDrag,
52413   UInt16 * numItems) ;
52414 extern OSErr
52415 GetDragItemReferenceNumber(
52416   DragRef theDrag,
52417   UInt16 index,
52418   DragItemRef * theItemRef) ;
52419 extern OSErr
52420 CountDragItemFlavors(
52421   DragRef theDrag,
52422   DragItemRef theItemRef,
52423   UInt16 * numFlavors) ;
52424 extern OSErr
52425 GetFlavorType(
52426   DragRef theDrag,
52427   DragItemRef theItemRef,
52428   UInt16 index,
52429   FlavorType * theType) ;
52430 extern OSErr
52431 GetFlavorFlags(
52432   DragRef theDrag,
52433   DragItemRef theItemRef,
52434   FlavorType theType,
52435   FlavorFlags * theFlags) ;
52436 extern OSErr
52437 GetFlavorDataSize(
52438   DragRef theDrag,
52439   DragItemRef theItemRef,
52440   FlavorType theType,
52441   Size * dataSize) ;
52442 extern OSErr
52443 GetFlavorData(
52444   DragRef theDrag,
52445   DragItemRef theItemRef,
52446   FlavorType theType,
52447   void * dataPtr,
52448   Size * dataSize,
52449   UInt32 dataOffset) ;
52450 extern OSErr
52451 GetDragItemBounds(
52452   DragRef theDrag,
52453   DragItemRef theItemRef,
52454   Rect * itemBounds) ;
52455 extern OSErr
52456 SetDragItemBounds(
52457   DragRef theDrag,
52458   DragItemRef theItemRef,
52459   const Rect * itemBounds) ;
52460 extern OSErr
52461 GetDropLocation(
52462   DragRef theDrag,
52463   AEDesc * dropLocation) ;
52464 extern OSErr
52465 SetDropLocation(
52466   DragRef theDrag,
52467   const AEDesc * dropLocation) ;
52468 extern OSStatus
52469 GetStandardDropLocation(
52470   DragRef theDrag,
52471   StandardDropLocation * outDropLocation) ;
52472 extern OSStatus
52473 SetStandardDropLocation(
52474   DragRef theDrag,
52475   StandardDropLocation dropLocation) ;
52476 extern OSErr
52477 GetDragAttributes(
52478   DragRef theDrag,
52479   DragAttributes * flags) ;
52480 extern OSErr
52481 GetDragMouse(
52482   DragRef theDrag,
52483   Point * mouse,
52484   Point * globalPinnedMouse) ;
52485 extern OSErr
52486 SetDragMouse(
52487   DragRef theDrag,
52488   Point globalPinnedMouse) ;
52489 extern OSErr
52490 GetDragOrigin(
52491   DragRef theDrag,
52492   Point * globalInitialMouse) ;
52493 extern OSErr
52494 GetDragModifiers(
52495   DragRef theDrag,
52496   SInt16 * modifiers,
52497   SInt16 * mouseDownModifiers,
52498   SInt16 * mouseUpModifiers) ;
52499 extern OSStatus
52500 GetDragAllowableActions(
52501   DragRef theDrag,
52502   DragActions * outActions) ;
52503 extern OSStatus
52504 SetDragAllowableActions(
52505   DragRef theDrag,
52506   DragActions inActions,
52507   Boolean isLocal) ;
52508 extern OSStatus
52509 GetDragDropAction(
52510   DragRef theDrag,
52511   DragActions * outAction) ;
52512 extern OSStatus
52513 SetDragDropAction(
52514   DragRef theDrag,
52515   DragActions inAction) ;
52516 extern OSErr
52517 ShowDragHilite(
52518   DragRef theDrag,
52519   RgnHandle hiliteFrame,
52520   Boolean inside) ;
52521 extern OSErr
52522 HideDragHilite(DragRef theDrag) ;
52523 extern OSErr
52524 DragPreScroll(
52525   DragRef theDrag,
52526   SInt16 dH,
52527   SInt16 dV) ;
52528 extern OSErr
52529 DragPostScroll(DragRef theDrag) ;
52530 extern OSErr
52531 UpdateDragHilite(
52532   DragRef theDrag,
52533   RgnHandle updateRgn) ;
52534 extern OSErr
52535 GetDragHiliteColor(
52536   WindowRef window,
52537   RGBColor * color) ;
52538 extern Boolean
52539 WaitMouseMoved(Point initialGlobalMouse) ;
52540 extern OSErr
52541 ZoomRects(
52542   const Rect * fromRect,
52543   const Rect * toRect,
52544   SInt16 zoomSteps,
52545   ZoomAcceleration acceleration) ;
52546 extern OSErr
52547 ZoomRegion(
52548   RgnHandle region,
52549   Point zoomDistance,
52550   SInt16 zoomSteps,
52551   ZoomAcceleration acceleration) ;
52552 typedef DragRef DragReference;
52553 typedef DragItemRef ItemReference;
52554
52555
52556 }
52557 extern "C" {
52558
52559
52560
52561
52562
52563
52564 enum {
52565   kControlDefProcType = 'CDEF',
52566   kControlTemplateResourceType = 'CNTL',
52567   kControlColorTableResourceType = 'cctb',
52568   kControlDefProcResourceType = 'CDEF'
52569 };
52570
52571
52572
52573
52574 struct ControlTemplate {
52575   Rect controlRect;
52576   SInt16 controlValue;
52577   Boolean controlVisible;
52578   UInt8 fill;
52579   SInt16 controlMaximum;
52580   SInt16 controlMinimum;
52581   SInt16 controlDefProcID;
52582   SInt32 controlReference;
52583   Str255 controlTitle;
52584 };
52585 typedef struct ControlTemplate ControlTemplate;
52586 typedef ControlTemplate * ControlTemplatePtr;
52587 typedef ControlTemplatePtr * ControlTemplateHandle;
52588 typedef struct OpaqueControlRef* ControlRef;
52589
52590
52591
52592 typedef ControlRef ControlHandle;
52593 typedef SInt16 ControlPartCode;
52594
52595
52596
52597 typedef void ( * ControlActionProcPtr)(ControlRef theControl, ControlPartCode partCode);
52598 typedef ControlActionProcPtr ControlActionUPP;
52599 extern ControlActionUPP
52600 NewControlActionUPP(ControlActionProcPtr userRoutine) ;
52601 extern void
52602 DisposeControlActionUPP(ControlActionUPP userUPP) ;
52603 extern void
52604 InvokeControlActionUPP(
52605   ControlRef theControl,
52606   ControlPartCode partCode,
52607   ControlActionUPP userUPP) ;
52608
52609
52610
52611
52612 enum {
52613   cFrameColor = 0,
52614   cBodyColor = 1,
52615   cTextColor = 2,
52616   cThumbColor = 3,
52617   kNumberCtlCTabEntries = 4
52618 };
52619
52620 struct CtlCTab {
52621   SInt32 ccSeed;
52622   SInt16 ccRider;
52623   SInt16 ctSize;
52624   ColorSpec ctTable[4];
52625 };
52626 typedef struct CtlCTab CtlCTab;
52627 typedef CtlCTab * CCTabPtr;
52628 typedef CCTabPtr * CCTabHandle;
52629 typedef SInt16 ControlVariant;
52630 enum {
52631   kControlNoVariant = 0,
52632   kControlUsesOwningWindowsFontVariant = 1 << 3
52633 };
52634
52635
52636
52637
52638
52639
52640 enum {
52641   kControlNoPart = 0,
52642   kControlIndicatorPart = 129,
52643   kControlDisabledPart = 254,
52644   kControlInactivePart = 255
52645 };
52646
52647
52648
52649
52650 enum {
52651   kControlEntireControl = 0
52652 };
52653 enum {
52654   kControlStructureMetaPart = -1,
52655   kControlContentMetaPart = -2
52656 };
52657
52658
52659 enum {
52660   kControlFocusNoPart = 0,
52661   kControlFocusNextPart = -1,
52662   kControlFocusPrevPart = -2
52663 };
52664
52665 typedef SInt16 ControlFocusPart;
52666 enum {
52667   kControlCollectionTagBounds = 'boun',
52668   kControlCollectionTagValue = 'valu',
52669   kControlCollectionTagMinimum = 'min ',
52670   kControlCollectionTagMaximum = 'max ',
52671   kControlCollectionTagViewSize = 'view',
52672   kControlCollectionTagVisibility = 'visi',
52673   kControlCollectionTagRefCon = 'refc',
52674   kControlCollectionTagTitle = 'titl',
52675   kControlCollectionTagUnicodeTitle = 'uttl',
52676   kControlCollectionTagIDSignature = 'idsi',
52677   kControlCollectionTagIDID = 'idid',
52678   kControlCollectionTagCommand = 'cmd ',
52679   kControlCollectionTagVarCode = 'varc'
52680 };
52681
52682
52683 enum {
52684   kControlCollectionTagSubControls = 'subc'
52685 };
52686
52687
52688
52689
52690 enum {
52691   kControlContentTextOnly = 0,
52692   kControlNoContent = 0,
52693   kControlContentIconSuiteRes = 1,
52694   kControlContentCIconRes = 2,
52695   kControlContentPictRes = 3,
52696   kControlContentICONRes = 4,
52697   kControlContentIconSuiteHandle = 129,
52698   kControlContentCIconHandle = 130,
52699   kControlContentPictHandle = 131,
52700   kControlContentIconRef = 132,
52701   kControlContentICON = 133
52702 };
52703
52704 typedef SInt16 ControlContentType;
52705 struct ControlButtonContentInfo {
52706   ControlContentType contentType;
52707   union {
52708     SInt16 resID;
52709     CIconHandle cIconHandle;
52710     Handle iconSuite;
52711     IconRef iconRef;
52712     PicHandle picture;
52713     Handle ICONHandle;
52714   } u;
52715 };
52716 typedef struct ControlButtonContentInfo ControlButtonContentInfo;
52717 typedef ControlButtonContentInfo * ControlButtonContentInfoPtr;
52718 typedef ControlButtonContentInfo ControlImageContentInfo;
52719 typedef ControlButtonContentInfo * ControlImageContentInfoPtr;
52720
52721
52722
52723 enum {
52724   kControlKeyScriptBehaviorAllowAnyScript = 'any ',
52725   kControlKeyScriptBehaviorPrefersRoman = 'prmn',
52726   kControlKeyScriptBehaviorRequiresRoman = 'rrmn'
52727 };
52728
52729 typedef UInt32 ControlKeyScriptBehavior;
52730 enum {
52731   kControlFontBigSystemFont = -1,
52732   kControlFontSmallSystemFont = -2,
52733   kControlFontSmallBoldSystemFont = -3,
52734   kControlFontViewSystemFont = -4
52735 };
52736
52737
52738
52739
52740 enum {
52741   kControlUseFontMask = 0x0001,
52742   kControlUseFaceMask = 0x0002,
52743   kControlUseSizeMask = 0x0004,
52744   kControlUseForeColorMask = 0x0008,
52745   kControlUseBackColorMask = 0x0010,
52746   kControlUseModeMask = 0x0020,
52747   kControlUseJustMask = 0x0040,
52748   kControlUseAllMask = 0x00FF,
52749   kControlAddFontSizeMask = 0x0100
52750 };
52751
52752
52753
52754
52755 enum {
52756   kControlAddToMetaFontMask = 0x0200
52757 };
52758
52759
52760
52761
52762
52763 enum {
52764   kControlUseThemeFontIDMask = 0x0080
52765 };
52766
52767 struct ControlFontStyleRec {
52768   SInt16 flags;
52769   SInt16 font;
52770   SInt16 size;
52771   SInt16 style;
52772   SInt16 mode;
52773   SInt16 just;
52774   RGBColor foreColor;
52775   RGBColor backColor;
52776 };
52777 typedef struct ControlFontStyleRec ControlFontStyleRec;
52778 typedef ControlFontStyleRec * ControlFontStylePtr;
52779 enum {
52780   kDoNotActivateAndIgnoreClick = 0,
52781   kDoNotActivateAndHandleClick = 1,
52782   kActivateAndIgnoreClick = 2,
52783   kActivateAndHandleClick = 3
52784 };
52785
52786 typedef UInt32 ClickActivationResult;
52787 enum {
52788   kControlFontStyleTag = 'font',
52789   kControlKeyFilterTag = 'fltr',
52790
52791
52792
52793
52794
52795   kControlKindTag = 'kind',
52796
52797
52798
52799
52800
52801
52802
52803   kControlSizeTag = 'size'
52804 };
52805
52806
52807
52808
52809 enum {
52810
52811   kControlSupportsGhosting = 1 << 0,
52812   kControlSupportsEmbedding = 1 << 1,
52813   kControlSupportsFocus = 1 << 2,
52814   kControlWantsIdle = 1 << 3,
52815   kControlWantsActivate = 1 << 4,
52816   kControlHandlesTracking = 1 << 5,
52817   kControlSupportsDataAccess = 1 << 6,
52818   kControlHasSpecialBackground = 1 << 7,
52819   kControlGetsFocusOnClick = 1 << 8,
52820   kControlSupportsCalcBestRect = 1 << 9,
52821   kControlSupportsLiveFeedback = 1 << 10,
52822   kControlHasRadioBehavior = 1 << 11,
52823   kControlSupportsDragAndDrop = 1 << 12,
52824   kControlAutoToggles = 1 << 14,
52825   kControlSupportsGetRegion = 1 << 17,
52826   kControlSupportsFlattening = 1 << 19,
52827   kControlSupportsSetCursor = 1 << 20,
52828   kControlSupportsContextualMenus = 1 << 21,
52829   kControlSupportsClickActivation = 1 << 22,
52830   kControlIdlesWithTimer = 1 << 23
52831 };
52832
52833
52834
52835
52836 enum {
52837   drawCntl = 0,
52838   testCntl = 1,
52839   calcCRgns = 2,
52840   initCntl = 3,
52841   dispCntl = 4,
52842   posCntl = 5,
52843   thumbCntl = 6,
52844   dragCntl = 7,
52845   autoTrack = 8,
52846   calcCntlRgn = 10,
52847   calcThumbRgn = 11,
52848   drawThumbOutline = 12,
52849   kControlMsgDrawGhost = 13,
52850   kControlMsgCalcBestRect = 14,
52851   kControlMsgHandleTracking = 15,
52852   kControlMsgFocus = 16,
52853   kControlMsgKeyDown = 17,
52854   kControlMsgIdle = 18,
52855   kControlMsgGetFeatures = 19,
52856   kControlMsgSetData = 20,
52857   kControlMsgGetData = 21,
52858   kControlMsgActivate = 22,
52859   kControlMsgSetUpBackground = 23,
52860   kControlMsgCalcValueFromPos = 26,
52861   kControlMsgTestNewMsgSupport = 27,
52862   kControlMsgSubValueChanged = 25,
52863   kControlMsgSubControlAdded = 28,
52864   kControlMsgSubControlRemoved = 29,
52865   kControlMsgApplyTextColor = 30,
52866   kControlMsgGetRegion = 31,
52867   kControlMsgFlatten = 32,
52868   kControlMsgSetCursor = 33,
52869   kControlMsgDragEnter = 38,
52870   kControlMsgDragLeave = 39,
52871   kControlMsgDragWithin = 40,
52872   kControlMsgDragReceive = 41,
52873   kControlMsgDisplayDebugInfo = 46,
52874   kControlMsgContextualMenuClick = 47,
52875   kControlMsgGetClickActivation = 48
52876 };
52877
52878 typedef SInt16 ControlDefProcMessage;
52879 enum {
52880
52881
52882
52883
52884
52885   kControlSizeNormal = 0,
52886
52887
52888
52889
52890
52891
52892   kControlSizeSmall = 1,
52893
52894
52895
52896
52897
52898
52899   kControlSizeLarge = 2,
52900
52901
52902
52903
52904
52905
52906   kControlSizeAuto = 0xFFFF
52907 };
52908
52909 typedef UInt16 ControlSize;
52910
52911
52912
52913 enum {
52914   kDrawControlEntireControl = 0,
52915   kDrawControlIndicatorOnly = 129
52916 };
52917
52918
52919
52920
52921 enum {
52922   kDragControlEntireControl = 0,
52923   kDragControlIndicator = 1
52924 };
52925
52926
52927
52928
52929 struct IndicatorDragConstraint {
52930   Rect limitRect;
52931   Rect slopRect;
52932   DragConstraint axis;
52933 };
52934 typedef struct IndicatorDragConstraint IndicatorDragConstraint;
52935 typedef IndicatorDragConstraint * IndicatorDragConstraintPtr;
52936
52937
52938
52939 enum {
52940   kControlSupportsNewMessages = ' ok '
52941 };
52942
52943
52944
52945
52946
52947 struct ControlTrackingRec {
52948   Point startPt;
52949   EventModifiers modifiers;
52950   ControlActionUPP action;
52951 };
52952 typedef struct ControlTrackingRec ControlTrackingRec;
52953 typedef ControlTrackingRec * ControlTrackingPtr;
52954
52955
52956
52957 struct ControlKeyDownRec {
52958   EventModifiers modifiers;
52959   SInt16 keyCode;
52960   SInt16 charCode;
52961 };
52962 typedef struct ControlKeyDownRec ControlKeyDownRec;
52963 typedef ControlKeyDownRec * ControlKeyDownPtr;
52964
52965
52966
52967
52968 struct ControlDataAccessRec {
52969   ResType tag;
52970   ResType part;
52971   Size size;
52972   Ptr dataPtr;
52973 };
52974 typedef struct ControlDataAccessRec ControlDataAccessRec;
52975 typedef ControlDataAccessRec * ControlDataAccessPtr;
52976
52977
52978
52979 struct ControlCalcSizeRec {
52980   SInt16 height;
52981   SInt16 width;
52982   SInt16 baseLine;
52983 };
52984 typedef struct ControlCalcSizeRec ControlCalcSizeRec;
52985 typedef ControlCalcSizeRec * ControlCalcSizePtr;
52986
52987
52988
52989
52990 struct ControlBackgroundRec {
52991   SInt16 depth;
52992   Boolean colorDevice;
52993 };
52994 typedef struct ControlBackgroundRec ControlBackgroundRec;
52995 typedef ControlBackgroundRec * ControlBackgroundPtr;
52996
52997
52998
52999
53000 struct ControlApplyTextColorRec {
53001   SInt16 depth;
53002   Boolean colorDevice;
53003   Boolean active;
53004 };
53005 typedef struct ControlApplyTextColorRec ControlApplyTextColorRec;
53006 typedef ControlApplyTextColorRec * ControlApplyTextColorPtr;
53007
53008
53009
53010
53011 struct ControlGetRegionRec {
53012   RgnHandle region;
53013   ControlPartCode part;
53014 };
53015 typedef struct ControlGetRegionRec ControlGetRegionRec;
53016 typedef ControlGetRegionRec * ControlGetRegionPtr;
53017
53018
53019
53020
53021 struct ControlSetCursorRec {
53022   Point localPoint;
53023   EventModifiers modifiers;
53024   Boolean cursorWasSet;
53025 };
53026 typedef struct ControlSetCursorRec ControlSetCursorRec;
53027 typedef ControlSetCursorRec * ControlSetCursorPtr;
53028
53029
53030
53031
53032
53033 struct ControlContextualMenuClickRec {
53034   Point localPoint;
53035   Boolean menuDisplayed;
53036 };
53037 typedef struct ControlContextualMenuClickRec ControlContextualMenuClickRec;
53038 typedef ControlContextualMenuClickRec * ControlContextualMenuClickPtr;
53039
53040
53041
53042
53043
53044 struct ControlClickActivationRec {
53045   Point localPoint;
53046   EventModifiers modifiers;
53047   ClickActivationResult result;
53048 };
53049 typedef struct ControlClickActivationRec ControlClickActivationRec;
53050 typedef ControlClickActivationRec * ControlClickActivationPtr;
53051
53052
53053
53054 typedef SInt32 ( * ControlDefProcPtr)(SInt16 varCode, ControlRef theControl, ControlDefProcMessage message, SInt32 param);
53055 typedef ControlDefProcPtr ControlDefUPP;
53056 extern ControlDefUPP
53057 NewControlDefUPP(ControlDefProcPtr userRoutine) ;
53058 extern void
53059 DisposeControlDefUPP(ControlDefUPP userUPP) ;
53060 extern SInt32
53061 InvokeControlDefUPP(
53062   SInt16 varCode,
53063   ControlRef theControl,
53064   ControlDefProcMessage message,
53065   SInt32 param,
53066   ControlDefUPP userUPP) ;
53067 enum {
53068   kControlKeyFilterBlockKey = 0,
53069   kControlKeyFilterPassKey = 1
53070 };
53071
53072 typedef SInt16 ControlKeyFilterResult;
53073 typedef ControlKeyFilterResult ( * ControlKeyFilterProcPtr)(ControlRef theControl, SInt16 *keyCode, SInt16 *charCode, EventModifiers *modifiers);
53074 typedef ControlKeyFilterProcPtr ControlKeyFilterUPP;
53075 extern ControlKeyFilterUPP
53076 NewControlKeyFilterUPP(ControlKeyFilterProcPtr userRoutine) ;
53077 extern void
53078 DisposeControlKeyFilterUPP(ControlKeyFilterUPP userUPP) ;
53079 extern ControlKeyFilterResult
53080 InvokeControlKeyFilterUPP(
53081   ControlRef theControl,
53082   SInt16 * keyCode,
53083   SInt16 * charCode,
53084   EventModifiers * modifiers,
53085   ControlKeyFilterUPP userUPP) ;
53086
53087
53088
53089
53090
53091
53092
53093 enum {
53094   noConstraint = kNoConstraint,
53095   hAxisOnly = 1,
53096   vAxisOnly = 2
53097 };
53098
53099
53100
53101
53102
53103 enum {
53104   kControlDefProcPtr = 0,
53105   kControlDefObjectClass = 1
53106 };
53107
53108 typedef UInt32 ControlDefType;
53109 struct ControlDefSpec {
53110   ControlDefType defType;
53111   union {
53112     ControlDefUPP defProc;
53113     void * classRef;
53114   } u;
53115 };
53116 typedef struct ControlDefSpec ControlDefSpec;
53117 extern OSStatus
53118 CreateCustomControl(
53119   WindowRef owningWindow,
53120   const Rect * contBounds,
53121   const ControlDefSpec * def,
53122   Collection initData,
53123   ControlRef * outControl) ;
53124 extern ControlRef
53125 NewControl(
53126   WindowRef owningWindow,
53127   const Rect * boundsRect,
53128   ConstStr255Param controlTitle,
53129   Boolean initiallyVisible,
53130   SInt16 initialValue,
53131   SInt16 minimumValue,
53132   SInt16 maximumValue,
53133   SInt16 procID,
53134   SInt32 controlReference) ;
53135 extern ControlRef
53136 GetNewControl(
53137   SInt16 resourceID,
53138   WindowRef owningWindow) ;
53139 extern void
53140 DisposeControl(ControlRef theControl) ;
53141 extern void
53142 KillControls(WindowRef theWindow) ;
53143 typedef OSStatus ( * ControlCNTLToCollectionProcPtr)(const Rect *bounds, SInt16 value, Boolean visible, SInt16 max, SInt16 min, SInt16 procID, SInt32 refCon, ConstStr255Param title, Collection collection);
53144 typedef ControlCNTLToCollectionProcPtr ControlCNTLToCollectionUPP;
53145 extern ControlCNTLToCollectionUPP
53146 NewControlCNTLToCollectionUPP(ControlCNTLToCollectionProcPtr userRoutine) ;
53147 extern void
53148 DisposeControlCNTLToCollectionUPP(ControlCNTLToCollectionUPP userUPP) ;
53149 extern OSStatus
53150 InvokeControlCNTLToCollectionUPP(
53151   const Rect * bounds,
53152   SInt16 value,
53153   Boolean visible,
53154   SInt16 max,
53155   SInt16 min,
53156   SInt16 procID,
53157   SInt32 refCon,
53158   ConstStr255Param title,
53159   Collection collection,
53160   ControlCNTLToCollectionUPP userUPP) ;
53161 extern OSStatus
53162 RegisterControlDefinition(
53163   SInt16 inCDEFResID,
53164   const ControlDefSpec * inControlDef,
53165   ControlCNTLToCollectionUPP inConversionProc) ;
53166 extern void
53167 HiliteControl(
53168   ControlRef theControl,
53169   ControlPartCode hiliteState) ;
53170 extern void
53171 ShowControl(ControlRef theControl) ;
53172 extern void
53173 HideControl(ControlRef theControl) ;
53174 extern Boolean
53175 IsControlActive(ControlRef inControl) ;
53176 extern Boolean
53177 IsControlVisible(ControlRef inControl) ;
53178 extern OSErr
53179 ActivateControl(ControlRef inControl) ;
53180 extern OSErr
53181 DeactivateControl(ControlRef inControl) ;
53182 extern OSErr
53183 SetControlVisibility(
53184   ControlRef inControl,
53185   Boolean inIsVisible,
53186   Boolean inDoDraw) ;
53187 extern Boolean
53188 IsControlEnabled(ControlRef inControl) ;
53189 extern OSStatus
53190 EnableControl(ControlRef inControl) ;
53191 extern OSStatus
53192 DisableControl(ControlRef inControl) ;
53193 extern void
53194 DrawControls(WindowRef theWindow) ;
53195 extern void
53196 Draw1Control(ControlRef theControl) ;
53197 extern void
53198 UpdateControls(
53199   WindowRef inWindow,
53200   RgnHandle inUpdateRegion) ;
53201 extern OSErr
53202 GetBestControlRect(
53203   ControlRef inControl,
53204   Rect * outRect,
53205   SInt16 * outBaseLineOffset) ;
53206 extern OSErr
53207 SetControlFontStyle(
53208   ControlRef inControl,
53209   const ControlFontStyleRec * inStyle) ;
53210 extern void
53211 DrawControlInCurrentPort(ControlRef inControl) ;
53212 extern OSErr
53213 SetUpControlBackground(
53214   ControlRef inControl,
53215   SInt16 inDepth,
53216   Boolean inIsColorDevice) ;
53217 extern OSErr
53218 SetUpControlTextColor(
53219   ControlRef inControl,
53220   SInt16 inDepth,
53221   Boolean inIsColorDevice) ;
53222 typedef OSStatus ( * ControlColorProcPtr)(ControlRef inControl, SInt16 inMessage, SInt16 inDrawDepth, Boolean inDrawInColor);
53223 typedef ControlColorProcPtr ControlColorUPP;
53224 extern ControlColorUPP
53225 NewControlColorUPP(ControlColorProcPtr userRoutine) ;
53226 extern void
53227 DisposeControlColorUPP(ControlColorUPP userUPP) ;
53228 extern OSStatus
53229 InvokeControlColorUPP(
53230   ControlRef inControl,
53231   SInt16 inMessage,
53232   SInt16 inDrawDepth,
53233   Boolean inDrawInColor,
53234   ControlColorUPP userUPP) ;
53235 extern OSStatus
53236 SetControlColorProc(
53237   ControlRef inControl,
53238   ControlColorUPP inProc) ;
53239 extern ControlPartCode
53240 TrackControl(
53241   ControlRef theControl,
53242   Point startPoint,
53243   ControlActionUPP actionProc) ;
53244 extern void
53245 DragControl(
53246   ControlRef theControl,
53247   Point startPoint,
53248   const Rect * limitRect,
53249   const Rect * slopRect,
53250   DragConstraint axis) ;
53251 extern ControlPartCode
53252 TestControl(
53253   ControlRef theControl,
53254   Point testPoint) ;
53255 extern ControlPartCode
53256 FindControl(
53257   Point testPoint,
53258   WindowRef theWindow,
53259   ControlRef * theControl) ;
53260 extern ControlRef
53261 FindControlUnderMouse(
53262   Point inWhere,
53263   WindowRef inWindow,
53264   ControlPartCode * outPart) ;
53265 extern ControlPartCode
53266 HandleControlClick(
53267   ControlRef inControl,
53268   Point inWhere,
53269   EventModifiers inModifiers,
53270   ControlActionUPP inAction) ;
53271 extern OSStatus
53272 HandleControlContextualMenuClick(
53273   ControlRef inControl,
53274   Point inWhere,
53275   Boolean * menuDisplayed) ;
53276 extern OSStatus
53277 GetControlClickActivation(
53278   ControlRef inControl,
53279   Point inWhere,
53280   EventModifiers inModifiers,
53281   ClickActivationResult * outResult) ;
53282 extern ControlPartCode
53283 HandleControlKey(
53284   ControlRef inControl,
53285   SInt16 inKeyCode,
53286   SInt16 inCharCode,
53287   EventModifiers inModifiers) ;
53288 extern void
53289 IdleControls(WindowRef inWindow) ;
53290 extern OSStatus
53291 HandleControlSetCursor(
53292   ControlRef control,
53293   Point localPoint,
53294   EventModifiers modifiers,
53295   Boolean * cursorWasSet) ;
53296 extern void
53297 MoveControl(
53298   ControlRef theControl,
53299   SInt16 h,
53300   SInt16 v) ;
53301 extern void
53302 SizeControl(
53303   ControlRef theControl,
53304   SInt16 w,
53305   SInt16 h) ;
53306 extern void
53307 SetControlTitle(
53308   ControlRef theControl,
53309   ConstStr255Param title) ;
53310 extern void
53311 GetControlTitle(
53312   ControlRef theControl,
53313   Str255 title) ;
53314 extern OSStatus
53315 SetControlTitleWithCFString(
53316   ControlRef inControl,
53317   CFStringRef inString) ;
53318 extern OSStatus
53319 CopyControlTitleAsCFString(
53320   ControlRef inControl,
53321   CFStringRef * outString) ;
53322 extern SInt16
53323 GetControlValue(ControlRef theControl) ;
53324 extern void
53325 SetControlValue(
53326   ControlRef theControl,
53327   SInt16 newValue) ;
53328 extern SInt16
53329 GetControlMinimum(ControlRef theControl) ;
53330 extern void
53331 SetControlMinimum(
53332   ControlRef theControl,
53333   SInt16 newMinimum) ;
53334 extern SInt16
53335 GetControlMaximum(ControlRef theControl) ;
53336 extern void
53337 SetControlMaximum(
53338   ControlRef theControl,
53339   SInt16 newMaximum) ;
53340 extern SInt32
53341 GetControlViewSize(ControlRef theControl) ;
53342 extern void
53343 SetControlViewSize(
53344   ControlRef theControl,
53345   SInt32 newViewSize) ;
53346 extern SInt32
53347 GetControl32BitValue(ControlRef theControl) ;
53348 extern void
53349 SetControl32BitValue(
53350   ControlRef theControl,
53351   SInt32 newValue) ;
53352 extern SInt32
53353 GetControl32BitMaximum(ControlRef theControl) ;
53354 extern void
53355 SetControl32BitMaximum(
53356   ControlRef theControl,
53357   SInt32 newMaximum) ;
53358 extern SInt32
53359 GetControl32BitMinimum(ControlRef theControl) ;
53360 extern void
53361 SetControl32BitMinimum(
53362   ControlRef theControl,
53363   SInt32 newMinimum) ;
53364 extern Boolean
53365 IsValidControlHandle(ControlRef theControl) ;
53366
53367
53368
53369
53370
53371
53372 struct ControlID {
53373   OSType signature;
53374   SInt32 id;
53375 };
53376 typedef struct ControlID ControlID;
53377 extern OSStatus
53378 SetControlID(
53379   ControlRef inControl,
53380   const ControlID * inID) ;
53381 extern OSStatus
53382 GetControlID(
53383   ControlRef inControl,
53384   ControlID * outID) ;
53385 extern OSStatus
53386 GetControlByID(
53387   WindowRef inWindow,
53388   const ControlID * inID,
53389   ControlRef * outControl) ;
53390 extern OSStatus
53391 SetControlCommandID(
53392   ControlRef inControl,
53393   UInt32 inCommandID) ;
53394 extern OSStatus
53395 GetControlCommandID(
53396   ControlRef inControl,
53397   UInt32 * outCommandID) ;
53398
53399
53400
53401
53402
53403
53404 struct ControlKind {
53405   OSType signature;
53406   OSType kind;
53407 };
53408 typedef struct ControlKind ControlKind;
53409
53410
53411
53412
53413
53414 enum {
53415
53416
53417
53418
53419   kControlKindSignatureApple = 'appl'
53420 };
53421 extern OSStatus
53422 GetControlKind(
53423   ControlRef inControl,
53424   ControlKind * outControlKind) ;
53425
53426
53427
53428
53429
53430 enum {
53431   kControlPropertyPersistent = 0x00000001
53432 };
53433 extern OSStatus
53434 GetControlProperty(
53435   ControlRef control,
53436   OSType propertyCreator,
53437   OSType propertyTag,
53438   UInt32 bufferSize,
53439   UInt32 * actualSize,
53440   void * propertyBuffer) ;
53441 extern OSStatus
53442 GetControlPropertySize(
53443   ControlRef control,
53444   OSType propertyCreator,
53445   OSType propertyTag,
53446   UInt32 * size) ;
53447 extern OSStatus
53448 SetControlProperty(
53449   ControlRef control,
53450   OSType propertyCreator,
53451   OSType propertyTag,
53452   UInt32 propertySize,
53453   const void * propertyData) ;
53454 extern OSStatus
53455 RemoveControlProperty(
53456   ControlRef control,
53457   OSType propertyCreator,
53458   OSType propertyTag) ;
53459 extern OSStatus
53460 GetControlPropertyAttributes(
53461   ControlRef control,
53462   OSType propertyCreator,
53463   OSType propertyTag,
53464   UInt32 * attributes) ;
53465 extern OSStatus
53466 ChangeControlPropertyAttributes(
53467   ControlRef control,
53468   OSType propertyCreator,
53469   OSType propertyTag,
53470   UInt32 attributesToSet,
53471   UInt32 attributesToClear) ;
53472 extern OSStatus
53473 GetControlRegion(
53474   ControlRef inControl,
53475   ControlPartCode inPart,
53476   RgnHandle outRegion) ;
53477 extern ControlVariant
53478 GetControlVariant(ControlRef theControl) ;
53479 extern void
53480 SetControlAction(
53481   ControlRef theControl,
53482   ControlActionUPP actionProc) ;
53483 extern ControlActionUPP
53484 GetControlAction(ControlRef theControl) ;
53485 extern void
53486 SetControlReference(
53487   ControlRef theControl,
53488   SInt32 data) ;
53489 extern SInt32
53490 GetControlReference(ControlRef theControl) ;
53491 extern SInt32
53492 SendControlMessage(
53493   ControlRef inControl,
53494   SInt16 inMessage,
53495   void * inParam) ;
53496 extern OSErr
53497 DumpControlHierarchy(
53498   WindowRef inWindow,
53499   const FSSpec * inDumpFile) ;
53500 extern OSErr
53501 CreateRootControl(
53502   WindowRef inWindow,
53503   ControlRef * outControl) ;
53504 extern OSErr
53505 GetRootControl(
53506   WindowRef inWindow,
53507   ControlRef * outControl) ;
53508 extern OSErr
53509 EmbedControl(
53510   ControlRef inControl,
53511   ControlRef inContainer) ;
53512 extern OSErr
53513 AutoEmbedControl(
53514   ControlRef inControl,
53515   WindowRef inWindow) ;
53516 extern OSErr
53517 GetSuperControl(
53518   ControlRef inControl,
53519   ControlRef * outParent) ;
53520 extern OSErr
53521 CountSubControls(
53522   ControlRef inControl,
53523   UInt16 * outNumChildren) ;
53524 extern OSErr
53525 GetIndexedSubControl(
53526   ControlRef inControl,
53527   UInt16 inIndex,
53528   ControlRef * outSubControl) ;
53529 extern OSErr
53530 SetControlSupervisor(
53531   ControlRef inControl,
53532   ControlRef inBoss) ;
53533 extern OSErr
53534 GetKeyboardFocus(
53535   WindowRef inWindow,
53536   ControlRef * outControl) ;
53537 extern OSErr
53538 SetKeyboardFocus(
53539   WindowRef inWindow,
53540   ControlRef inControl,
53541   ControlFocusPart inPart) ;
53542 extern OSErr
53543 AdvanceKeyboardFocus(WindowRef inWindow) ;
53544 extern OSErr
53545 ReverseKeyboardFocus(WindowRef inWindow) ;
53546 extern OSErr
53547 ClearKeyboardFocus(WindowRef inWindow) ;
53548 extern OSErr
53549 GetControlFeatures(
53550   ControlRef inControl,
53551   UInt32 * outFeatures) ;
53552 extern OSErr
53553 SetControlData(
53554   ControlRef inControl,
53555   ControlPartCode inPart,
53556   ResType inTagName,
53557   Size inSize,
53558   const void * inData) ;
53559 extern OSErr
53560 GetControlData(
53561   ControlRef inControl,
53562   ControlPartCode inPart,
53563   ResType inTagName,
53564   Size inBufferSize,
53565   void * inBuffer,
53566   Size * outActualSize) ;
53567 extern OSErr
53568 GetControlDataSize(
53569   ControlRef inControl,
53570   ControlPartCode inPart,
53571   ResType inTagName,
53572   Size * outMaxSize) ;
53573 enum {
53574
53575
53576
53577
53578
53579   kDragTrackingEnterControl = 2,
53580
53581
53582
53583
53584
53585   kDragTrackingInControl = 3,
53586
53587
53588
53589
53590
53591   kDragTrackingLeaveControl = 4
53592 };
53593 extern OSStatus
53594 HandleControlDragTracking(
53595   ControlRef inControl,
53596   DragTrackingMessage inMessage,
53597   DragReference inDrag,
53598   Boolean * outLikesDrag) ;
53599 extern OSStatus
53600 HandleControlDragReceive(
53601   ControlRef inControl,
53602   DragReference inDrag) ;
53603 extern OSStatus
53604 SetControlDragTrackingEnabled(
53605   ControlRef inControl,
53606   Boolean inTracks) ;
53607 extern OSStatus
53608 IsControlDragTrackingEnabled(
53609   ControlRef inControl,
53610   Boolean * outTracks) ;
53611 extern OSStatus
53612 SetAutomaticControlDragTrackingEnabledForWindow(
53613   WindowRef inWindow,
53614   Boolean inTracks) ;
53615 extern OSStatus
53616 IsAutomaticControlDragTrackingEnabledForWindow(
53617   WindowRef inWindow,
53618   Boolean * outTracks) ;
53619 extern Rect *
53620 GetControlBounds(
53621   ControlRef control,
53622   Rect * bounds) ;
53623 extern Boolean
53624 IsControlHilited(ControlRef control) ;
53625 extern UInt16
53626 GetControlHilite(ControlRef control) ;
53627 extern WindowRef
53628 GetControlOwner(ControlRef control) ;
53629 extern Handle
53630 GetControlDataHandle(ControlRef control) ;
53631 extern MenuRef
53632 GetControlPopupMenuHandle(ControlRef control) ;
53633 extern short
53634 GetControlPopupMenuID(ControlRef control) ;
53635 extern void
53636 SetControlDataHandle(
53637   ControlRef control,
53638   Handle dataHandle) ;
53639 extern void
53640 SetControlBounds(
53641   ControlRef control,
53642   const Rect * bounds) ;
53643 extern void
53644 SetControlPopupMenuHandle(
53645   ControlRef control,
53646   MenuRef popupMenu) ;
53647 extern void
53648 SetControlPopupMenuID(
53649   ControlRef control,
53650   short menuID) ;
53651
53652
53653
53654
53655
53656
53657 }
53658
53659
53660
53661 extern "C" {
53662
53663
53664 typedef OSType PropertyCreator;
53665 typedef OSType PropertyTag;
53666 typedef UInt32 WindowClass;
53667 enum {
53668   kAlertWindowClass = 1,
53669   kMovableAlertWindowClass = 2,
53670   kModalWindowClass = 3,
53671   kMovableModalWindowClass = 4,
53672   kFloatingWindowClass = 5,
53673   kDocumentWindowClass = 6,
53674   kUtilityWindowClass = 8,
53675   kHelpWindowClass = 10,
53676   kSheetWindowClass = 11,
53677   kToolbarWindowClass = 12,
53678   kPlainWindowClass = 13,
53679   kOverlayWindowClass = 14,
53680   kSheetAlertWindowClass = 15,
53681   kAltPlainWindowClass = 16,
53682   kDrawerWindowClass = 20,
53683   kAllWindowClasses = (unsigned long)0xFFFFFFFF
53684 };
53685
53686
53687
53688
53689
53690
53691 typedef UInt32 WindowAttributes;
53692
53693
53694
53695
53696
53697 enum {
53698
53699
53700
53701
53702   kWindowNoAttributes = 0L,
53703
53704
53705
53706
53707
53708
53709   kWindowCloseBoxAttribute = (1L << 0),
53710
53711
53712
53713
53714
53715
53716   kWindowHorizontalZoomAttribute = (1L << 1),
53717
53718
53719
53720
53721
53722
53723   kWindowVerticalZoomAttribute = (1L << 2),
53724
53725
53726
53727
53728
53729
53730   kWindowFullZoomAttribute = (kWindowVerticalZoomAttribute | kWindowHorizontalZoomAttribute),
53731
53732
53733
53734
53735
53736
53737
53738   kWindowCollapseBoxAttribute = (1L << 3),
53739
53740
53741
53742
53743
53744
53745   kWindowResizableAttribute = (1L << 4),
53746
53747
53748
53749
53750
53751
53752   kWindowSideTitlebarAttribute = (1L << 5),
53753
53754
53755
53756
53757
53758   kWindowToolbarButtonAttribute = (1L << 6),
53759   kWindowMetalAttribute = (1L << 8),
53760
53761
53762
53763
53764   kWindowNoUpdatesAttribute = (1L << 16),
53765
53766
53767
53768
53769   kWindowNoActivatesAttribute = (1L << 17),
53770
53771
53772
53773
53774
53775
53776
53777   kWindowOpaqueForEventsAttribute = (1L << 18),
53778   kWindowCompositingAttribute = (1L << 19),
53779
53780
53781
53782
53783
53784
53785   kWindowNoShadowAttribute = (1L << 21),
53786
53787
53788
53789
53790
53791
53792
53793   kWindowHideOnSuspendAttribute = (1L << 24),
53794
53795
53796
53797
53798
53799   kWindowStandardHandlerAttribute = (1L << 25),
53800
53801
53802
53803
53804
53805
53806
53807   kWindowHideOnFullScreenAttribute = (1L << 26),
53808
53809
53810
53811
53812
53813
53814   kWindowInWindowMenuAttribute = (1L << 27),
53815
53816
53817
53818
53819
53820   kWindowLiveResizeAttribute = (1L << 28),
53821
53822
53823
53824
53825
53826
53827
53828   kWindowIgnoreClicksAttribute = (1L << 29),
53829
53830
53831
53832
53833
53834
53835
53836   kWindowNoConstrainAttribute = (unsigned long)((1L << 31)),
53837
53838
53839
53840
53841
53842   kWindowStandardDocumentAttributes = (kWindowCloseBoxAttribute | kWindowFullZoomAttribute | kWindowCollapseBoxAttribute | kWindowResizableAttribute),
53843
53844
53845
53846
53847
53848   kWindowStandardFloatingAttributes = (kWindowCloseBoxAttribute | kWindowCollapseBoxAttribute)
53849 };
53850
53851
53852
53853
53854
53855 enum {
53856   kWindowDefProcType = 'WDEF'
53857 };
53858
53859
53860
53861
53862 enum {
53863   kStandardWindowDefinition = 0,
53864   kRoundWindowDefinition = 1,
53865   kFloatingWindowDefinition = 124
53866 };
53867
53868
53869
53870
53871 enum {
53872
53873   kDocumentWindowVariantCode = 0,
53874   kModalDialogVariantCode = 1,
53875   kPlainDialogVariantCode = 2,
53876   kShadowDialogVariantCode = 3,
53877   kMovableModalDialogVariantCode = 5,
53878   kAlertVariantCode = 7,
53879   kMovableAlertVariantCode = 9,
53880   kSideFloaterVariantCode = 8
53881 };
53882
53883
53884
53885
53886
53887 enum {
53888
53889   documentProc = 0,
53890   dBoxProc = 1,
53891   plainDBox = 2,
53892   altDBoxProc = 3,
53893   noGrowDocProc = 4,
53894   movableDBoxProc = 5,
53895   zoomDocProc = 8,
53896   zoomNoGrow = 12,
53897   floatProc = 1985,
53898   floatGrowProc = 1987,
53899   floatZoomProc = 1989,
53900   floatZoomGrowProc = 1991,
53901   floatSideProc = 1993,
53902   floatSideGrowProc = 1995,
53903   floatSideZoomProc = 1997,
53904   floatSideZoomGrowProc = 1999
53905 };
53906 enum {
53907
53908   kWindowDocumentDefProcResID = 64,
53909   kWindowDialogDefProcResID = 65,
53910   kWindowUtilityDefProcResID = 66,
53911   kWindowUtilitySideTitleDefProcResID = 67,
53912   kWindowSheetDefProcResID = 68,
53913   kWindowSimpleDefProcResID = 69,
53914   kWindowSheetAlertDefProcResID = 70
53915 };
53916
53917 enum {
53918
53919   kWindowDocumentProc = 1024,
53920   kWindowGrowDocumentProc = 1025,
53921   kWindowVertZoomDocumentProc = 1026,
53922   kWindowVertZoomGrowDocumentProc = 1027,
53923   kWindowHorizZoomDocumentProc = 1028,
53924   kWindowHorizZoomGrowDocumentProc = 1029,
53925   kWindowFullZoomDocumentProc = 1030,
53926   kWindowFullZoomGrowDocumentProc = 1031
53927 };
53928
53929
53930 enum {
53931
53932   kWindowPlainDialogProc = 1040,
53933   kWindowShadowDialogProc = 1041,
53934   kWindowModalDialogProc = 1042,
53935   kWindowMovableModalDialogProc = 1043,
53936   kWindowAlertProc = 1044,
53937   kWindowMovableAlertProc = 1045
53938 };
53939
53940
53941 enum {
53942
53943   kWindowMovableModalGrowProc = 1046
53944 };
53945
53946
53947 enum {
53948
53949   kWindowFloatProc = 1057,
53950   kWindowFloatGrowProc = 1059,
53951   kWindowFloatVertZoomProc = 1061,
53952   kWindowFloatVertZoomGrowProc = 1063,
53953   kWindowFloatHorizZoomProc = 1065,
53954   kWindowFloatHorizZoomGrowProc = 1067,
53955   kWindowFloatFullZoomProc = 1069,
53956   kWindowFloatFullZoomGrowProc = 1071
53957 };
53958
53959
53960 enum {
53961
53962   kWindowFloatSideProc = 1073,
53963   kWindowFloatSideGrowProc = 1075,
53964   kWindowFloatSideVertZoomProc = 1077,
53965   kWindowFloatSideVertZoomGrowProc = 1079,
53966   kWindowFloatSideHorizZoomProc = 1081,
53967   kWindowFloatSideHorizZoomGrowProc = 1083,
53968   kWindowFloatSideFullZoomProc = 1085,
53969   kWindowFloatSideFullZoomGrowProc = 1087
53970 };
53971
53972
53973 enum {
53974
53975   kWindowSheetProc = 1088,
53976   kWindowSheetAlertProc = 1120
53977 };
53978
53979
53980
53981
53982
53983
53984
53985 enum {
53986
53987
53988
53989
53990
53991
53992   kWindowSimpleProc = 1104,
53993
53994
53995
53996
53997   kWindowSimpleFrameProc = 1105
53998 };
53999 enum {
54000   kWindowNoPosition = 0x0000,
54001   kWindowDefaultPosition = 0x0000,
54002   kWindowCenterMainScreen = 0x280A,
54003   kWindowAlertPositionMainScreen = 0x300A,
54004   kWindowStaggerMainScreen = 0x380A,
54005   kWindowCenterParentWindow = 0xA80A,
54006   kWindowAlertPositionParentWindow = 0xB00A,
54007   kWindowStaggerParentWindow = 0xB80A,
54008   kWindowCenterParentWindowScreen = 0x680A,
54009   kWindowAlertPositionParentWindowScreen = 0x700A,
54010   kWindowStaggerParentWindowScreen = 0x780A
54011 };
54012 typedef UInt32 WindowPositionMethod;
54013 enum {
54014
54015
54016
54017
54018   kWindowCenterOnMainScreen = 1,
54019
54020
54021
54022
54023   kWindowCenterOnParentWindow = 2,
54024
54025
54026
54027
54028
54029   kWindowCenterOnParentWindowScreen = 3,
54030
54031
54032
54033
54034   kWindowCascadeOnMainScreen = 4,
54035
54036
54037
54038
54039   kWindowCascadeOnParentWindow = 5,
54040
54041
54042
54043
54044
54045   kWindowCascadeOnParentWindowScreen = 6,
54046
54047
54048
54049
54050
54051
54052
54053   kWindowCascadeStartAtParentWindowScreen = 10,
54054
54055
54056
54057
54058   kWindowAlertPositionOnMainScreen = 7,
54059
54060
54061
54062
54063   kWindowAlertPositionOnParentWindow = 8,
54064
54065
54066
54067
54068
54069   kWindowAlertPositionOnParentWindowScreen = 9
54070 };
54071
54072
54073
54074
54075
54076 typedef UInt16 WindowRegionCode;
54077 enum {
54078
54079   kWindowTitleBarRgn = 0,
54080   kWindowTitleTextRgn = 1,
54081   kWindowCloseBoxRgn = 2,
54082   kWindowZoomBoxRgn = 3,
54083   kWindowDragRgn = 5,
54084   kWindowGrowRgn = 6,
54085   kWindowCollapseBoxRgn = 7,
54086   kWindowTitleProxyIconRgn = 8,
54087   kWindowStructureRgn = 32,
54088   kWindowContentRgn = 33,
54089   kWindowUpdateRgn = 34,
54090   kWindowOpaqueRgn = 35,
54091   kWindowGlobalPortRgn = 40
54092 };
54093
54094
54095 struct GetWindowRegionRec {
54096   RgnHandle winRgn;
54097   WindowRegionCode regionCode;
54098 };
54099 typedef struct GetWindowRegionRec GetWindowRegionRec;
54100 typedef GetWindowRegionRec * GetWindowRegionPtr;
54101 typedef GetWindowRegionRec * GetWindowRegionRecPtr;
54102 struct SetupWindowProxyDragImageRec {
54103   GWorldPtr imageGWorld;
54104   RgnHandle imageRgn;
54105   RgnHandle outlineRgn;
54106 };
54107 typedef struct SetupWindowProxyDragImageRec SetupWindowProxyDragImageRec;
54108
54109 struct MeasureWindowTitleRec {
54110
54111   SInt16 fullTitleWidth;
54112   SInt16 titleTextWidth;
54113
54114
54115   Boolean isUnicodeTitle;
54116   Boolean unused;
54117 };
54118 typedef struct MeasureWindowTitleRec MeasureWindowTitleRec;
54119 typedef MeasureWindowTitleRec * MeasureWindowTitleRecPtr;
54120
54121
54122
54123
54124
54125
54126
54127 struct GetGrowImageRegionRec {
54128   Rect growRect;
54129   RgnHandle growImageRegion;
54130 };
54131 typedef struct GetGrowImageRegionRec GetGrowImageRegionRec;
54132
54133
54134
54135 enum {
54136   dialogKind = 2,
54137   userKind = 8,
54138   kDialogWindowKind = 2,
54139   kApplicationWindowKind = 8
54140 };
54141
54142
54143
54144
54145
54146 typedef SInt16 WindowPartCode;
54147 enum {
54148   inDesk = 0,
54149   inNoWindow = 0,
54150   inMenuBar = 1,
54151   inSysWindow = 2,
54152   inContent = 3,
54153   inDrag = 4,
54154   inGrow = 5,
54155   inGoAway = 6,
54156   inZoomIn = 7,
54157   inZoomOut = 8,
54158   inCollapseBox = 11,
54159   inProxyIcon = 12,
54160   inToolbarButton = 13,
54161   inStructure = 15
54162 };
54163
54164
54165
54166
54167 typedef SInt16 WindowDefPartCode;
54168 enum {
54169   wNoHit = 0,
54170   wInContent = 1,
54171   wInDrag = 2,
54172   wInGrow = 3,
54173   wInGoAway = 4,
54174   wInZoomIn = 5,
54175   wInZoomOut = 6,
54176   wInCollapseBox = 9,
54177   wInProxyIcon = 10,
54178   wInToolbarButton = 11,
54179   wInStructure = 13
54180 };
54181
54182
54183
54184
54185
54186 enum {
54187   kWindowMsgDraw = 0,
54188   kWindowMsgHitTest = 1,
54189   kWindowMsgCalculateShape = 2,
54190   kWindowMsgInitialize = 3,
54191   kWindowMsgCleanUp = 4,
54192   kWindowMsgDrawGrowOutline = 5,
54193   kWindowMsgDrawGrowBox = 6
54194 };
54195
54196
54197 enum {
54198   kWindowMsgGetFeatures = 7,
54199   kWindowMsgGetRegion = 8
54200 };
54201
54202
54203 enum {
54204   kWindowMsgDragHilite = 9,
54205   kWindowMsgModified = 10,
54206   kWindowMsgDrawInCurrentPort = 11,
54207   kWindowMsgSetupProxyDragImage = 12,
54208   kWindowMsgStateChanged = 13,
54209   kWindowMsgMeasureTitle = 14
54210 };
54211
54212
54213 enum {
54214   kWindowMsgGetGrowImageRegion = 19
54215 };
54216
54217
54218 enum {
54219   wDraw = 0,
54220   wHit = 1,
54221   wCalcRgns = 2,
54222   wNew = 3,
54223   wDispose = 4,
54224   wGrow = 5,
54225   wDrawGIcon = 6
54226 };
54227
54228
54229
54230
54231 enum {
54232   kWindowStateTitleChanged = (1 << 0)
54233 };
54234
54235
54236
54237
54238
54239 enum {
54240   kWindowCanGrow = (1 << 0),
54241   kWindowCanZoom = (1 << 1),
54242   kWindowCanCollapse = (1 << 2),
54243   kWindowIsModal = (1 << 3),
54244   kWindowCanGetWindowRegion = (1 << 4),
54245   kWindowIsAlert = (1 << 5),
54246   kWindowHasTitleBar = (1 << 6)
54247 };
54248
54249
54250 enum {
54251   kWindowSupportsDragHilite = (1 << 7),
54252   kWindowSupportsModifiedBit = (1 << 8),
54253   kWindowCanDrawInCurrentPort = (1 << 9),
54254   kWindowCanSetupProxyDragImage = (1 << 10),
54255   kWindowCanMeasureTitle = (1 << 11),
54256   kWindowWantsDisposeAtProcessDeath = (1 << 12),
54257   kWindowSupportsGetGrowImageRegion = (1 << 13),
54258   kWindowDefSupportsColorGrafPort = 0x40000002
54259 };
54260
54261
54262 enum {
54263   kWindowIsOpaque = (1 << 14)
54264 };
54265
54266
54267
54268
54269
54270 enum {
54271   kWindowSupportsSetGrowImageRegion = (1 << 13)
54272 };
54273
54274
54275
54276
54277 enum {
54278   deskPatID = 16
54279 };
54280
54281
54282
54283
54284
54285
54286 enum {
54287   wContentColor = 0,
54288   wFrameColor = 1,
54289   wTextColor = 2,
54290   wHiliteColor = 3,
54291   wTitleBarColor = 4
54292 };
54293
54294
54295
54296
54297
54298
54299 enum {
54300   kMouseUpOutOfSlop = (long)0x80008000
54301 };
54302
54303
54304
54305
54306
54307 struct WinCTab {
54308   long wCSeed;
54309   short wCReserved;
54310   short ctSize;
54311   ColorSpec ctTable[5];
54312 };
54313 typedef struct WinCTab WinCTab;
54314 typedef WinCTab * WCTabPtr;
54315 typedef WCTabPtr * WCTabHandle;
54316 enum {
54317   kWindowDefinitionVersionOne = 1,
54318   kWindowDefinitionVersionTwo = 2
54319 };
54320
54321
54322 enum {
54323   kWindowIsCollapsedState = (1 << 0L)
54324 };
54325
54326 struct BasicWindowDescription {
54327   UInt32 descriptionSize;
54328
54329   Rect windowContentRect;
54330   Rect windowZoomRect;
54331   UInt32 windowRefCon;
54332   UInt32 windowStateFlags;
54333   WindowPositionMethod windowPositionMethod;
54334
54335   UInt32 windowDefinitionVersion;
54336   union {
54337     struct {
54338       SInt16 windowDefProc;
54339       Boolean windowHasCloseBox;
54340     } versionOne;
54341
54342     struct {
54343       WindowClass windowClass;
54344       WindowAttributes windowAttributes;
54345     } versionTwo;
54346
54347   } windowDefinition;
54348 };
54349 typedef struct BasicWindowDescription BasicWindowDescription;
54350
54351 enum {
54352   kStoredWindowSystemTag = 'appl',
54353   kStoredBasicWindowDescriptionID = 'sbas',
54354   kStoredWindowPascalTitleID = 's255'
54355 };
54356
54357 enum {
54358   kStoredWindowUnicodeTitleID = 'ustr',
54359   kStoredWindowTitleCFStringID = 'cfst'
54360 };
54361 struct WStateData {
54362   Rect userState;
54363   Rect stdState;
54364 };
54365 typedef struct WStateData WStateData;
54366 typedef WStateData * WStateDataPtr;
54367 typedef WStateDataPtr * WStateDataHandle;
54368
54369
54370
54371 typedef long ( * WindowDefProcPtr)(short varCode, WindowRef window, short message, long param);
54372 typedef void ( * DeskHookProcPtr)(Boolean mouseClick, EventRecord *theEvent);
54373 typedef OSStatus ( * WindowPaintProcPtr)(GDHandle device, GrafPtr qdContext, WindowRef window, RgnHandle inClientPaintRgn, RgnHandle outSystemPaintRgn, void *refCon);
54374 typedef WindowDefProcPtr WindowDefUPP;
54375 typedef DeskHookProcPtr DeskHookUPP;
54376 typedef WindowPaintProcPtr WindowPaintUPP;
54377 extern WindowDefUPP
54378 NewWindowDefUPP(WindowDefProcPtr userRoutine) ;
54379 extern WindowPaintUPP
54380 NewWindowPaintUPP(WindowPaintProcPtr userRoutine) ;
54381 extern void
54382 DisposeWindowDefUPP(WindowDefUPP userUPP) ;
54383 extern void
54384 DisposeWindowPaintUPP(WindowPaintUPP userUPP) ;
54385 extern long
54386 InvokeWindowDefUPP(
54387   short varCode,
54388   WindowRef window,
54389   short message,
54390   long param,
54391   WindowDefUPP userUPP) ;
54392 extern OSStatus
54393 InvokeWindowPaintUPP(
54394   GDHandle device,
54395   GrafPtr qdContext,
54396   WindowRef window,
54397   RgnHandle inClientPaintRgn,
54398   RgnHandle outSystemPaintRgn,
54399   void * refCon,
54400   WindowPaintUPP userUPP) ;
54401
54402
54403
54404
54405 enum {
54406   kWindowDefProcPtr = 0,
54407   kWindowDefObjectClass = 1,
54408   kWindowDefProcID = 2,
54409   kWindowDefHIView = 3
54410 };
54411
54412 typedef UInt32 WindowDefType;
54413 struct WindowDefSpec {
54414   WindowDefType defType;
54415   union {
54416     WindowDefUPP defProc;
54417     void * classRef;
54418     short procID;
54419     void * rootView;
54420   } u;
54421 };
54422 typedef struct WindowDefSpec WindowDefSpec;
54423 typedef WindowDefSpec * WindowDefSpecPtr;
54424 extern WindowRef
54425 GetNewCWindow(
54426   short windowID,
54427   void * wStorage,
54428   WindowRef behind) ;
54429 extern WindowRef
54430 NewWindow(
54431   void * wStorage,
54432   const Rect * boundsRect,
54433   ConstStr255Param title,
54434   Boolean visible,
54435   short theProc,
54436   WindowRef behind,
54437   Boolean goAwayFlag,
54438   long refCon) ;
54439 extern WindowRef
54440 GetNewWindow(
54441   short windowID,
54442   void * wStorage,
54443   WindowRef behind) ;
54444 extern WindowRef
54445 NewCWindow(
54446   void * wStorage,
54447   const Rect * boundsRect,
54448   ConstStr255Param title,
54449   Boolean visible,
54450   short procID,
54451   WindowRef behind,
54452   Boolean goAwayFlag,
54453   long refCon) ;
54454 extern void
54455 DisposeWindow(WindowRef window) ;
54456 extern OSStatus
54457 CreateNewWindow(
54458   WindowClass windowClass,
54459   WindowAttributes attributes,
54460   const Rect * contentBounds,
54461   WindowRef * outWindow) ;
54462 extern OSStatus
54463 CreateWindowFromResource(
54464   SInt16 resID,
54465   WindowRef * outWindow) ;
54466 extern OSStatus
54467 StoreWindowIntoCollection(
54468   WindowRef window,
54469   Collection collection) ;
54470 extern OSStatus
54471 CreateWindowFromCollection(
54472   Collection collection,
54473   WindowRef * outWindow) ;
54474 extern OSStatus
54475 GetWindowOwnerCount(
54476   WindowRef window,
54477   UInt32 * outCount) ;
54478 extern OSStatus
54479 CloneWindow(WindowRef window) ;
54480 extern ItemCount
54481 GetWindowRetainCount(WindowRef inWindow) ;
54482 extern OSStatus
54483 RetainWindow(WindowRef inWindow) ;
54484 extern OSStatus
54485 ReleaseWindow(WindowRef inWindow) ;
54486 extern OSStatus
54487 CreateCustomWindow(
54488   const WindowDefSpec * def,
54489   WindowClass windowClass,
54490   WindowAttributes attributes,
54491   const Rect * contentBounds,
54492   WindowRef * outWindow) ;
54493 extern OSStatus
54494 ReshapeCustomWindow(WindowRef window) ;
54495 extern OSStatus
54496 RegisterWindowDefinition(
54497   SInt16 inResID,
54498   const WindowDefSpec * inDefSpec) ;
54499 extern OSStatus
54500 GetWindowWidgetHilite(
54501   WindowRef inWindow,
54502   WindowDefPartCode * outHilite) ;
54503 extern Boolean
54504 IsValidWindowClass(WindowClass inClass) ;
54505 extern WindowAttributes
54506 GetAvailableWindowAttributes(WindowClass inClass) ;
54507 extern OSStatus
54508 GetWindowClass(
54509   WindowRef window,
54510   WindowClass * outClass) ;
54511 extern OSStatus
54512 GetWindowAttributes(
54513   WindowRef window,
54514   WindowAttributes * outAttributes) ;
54515 extern OSStatus
54516 ChangeWindowAttributes(
54517   WindowRef window,
54518   WindowAttributes setTheseAttributes,
54519   WindowAttributes clearTheseAttributes) ;
54520 extern OSStatus
54521 SetWindowClass(
54522   WindowRef inWindow,
54523   WindowClass inWindowClass) ;
54524 typedef UInt32 WindowModality;
54525 enum {
54526
54527
54528
54529
54530
54531   kWindowModalityNone = 0,
54532
54533
54534
54535
54536
54537
54538   kWindowModalitySystemModal = 1,
54539
54540
54541
54542
54543
54544   kWindowModalityAppModal = 2,
54545
54546
54547
54548
54549   kWindowModalityWindowModal = 3
54550 };
54551 extern OSStatus
54552 SetWindowModality(
54553   WindowRef inWindow,
54554   WindowModality inModalKind,
54555   WindowRef inUnavailableWindow) ;
54556 extern OSStatus
54557 GetWindowModality(
54558   WindowRef inWindow,
54559   WindowModality * outModalKind,
54560   WindowRef * outUnavailableWindow) ;
54561 extern OSStatus
54562 ShowFloatingWindows(void) ;
54563 extern OSStatus
54564 HideFloatingWindows(void) ;
54565 extern Boolean
54566 AreFloatingWindowsVisible(void) ;
54567 typedef struct OpaqueWindowGroupRef* WindowGroupRef;
54568 typedef UInt32 WindowGroupAttributes;
54569 enum {
54570
54571
54572
54573
54574
54575
54576
54577   kWindowGroupAttrSelectAsLayer = 1 << 0,
54578
54579
54580
54581
54582
54583
54584   kWindowGroupAttrMoveTogether = 1 << 1,
54585   kWindowGroupAttrLayerTogether = 1 << 2,
54586
54587
54588
54589
54590
54591
54592
54593   kWindowGroupAttrSharedActivation = 1 << 3,
54594   kWindowGroupAttrHideOnCollapse = 1 << 4
54595 };
54596 typedef UInt32 WindowActivationScope;
54597 enum {
54598   kWindowActivationScopeNone = 0,
54599
54600
54601
54602
54603
54604
54605
54606   kWindowActivationScopeIndependent = 1,
54607
54608
54609
54610
54611
54612
54613
54614   kWindowActivationScopeAll = 2
54615 };
54616
54617
54618
54619
54620
54621
54622
54623 enum {
54624
54625
54626
54627
54628
54629   kNextWindowGroup = true,
54630
54631
54632
54633
54634
54635   kPreviousWindowGroup = false
54636 };
54637 typedef UInt32 WindowGroupContentOptions;
54638 enum {
54639
54640
54641
54642
54643
54644
54645   kWindowGroupContentsReturnWindows = 1 << 0,
54646
54647
54648
54649
54650
54651
54652
54653   kWindowGroupContentsRecurse = 1 << 1,
54654
54655
54656
54657
54658
54659
54660   kWindowGroupContentsVisible = 1 << 2
54661 };
54662 extern OSStatus
54663 CreateWindowGroup(
54664   WindowGroupAttributes inAttributes,
54665   WindowGroupRef * outGroup) ;
54666 extern OSStatus
54667 RetainWindowGroup(WindowGroupRef inGroup) ;
54668 extern OSStatus
54669 ReleaseWindowGroup(WindowGroupRef inGroup) ;
54670 extern ItemCount
54671 GetWindowGroupRetainCount(WindowGroupRef inGroup) ;
54672 extern WindowGroupRef
54673 GetWindowGroupOfClass(WindowClass windowClass) ;
54674 extern OSStatus
54675 SetWindowGroupName(
54676   WindowGroupRef inGroup,
54677   CFStringRef inName) ;
54678 extern OSStatus
54679 CopyWindowGroupName(
54680   WindowGroupRef inGroup,
54681   CFStringRef * outName) ;
54682 extern OSStatus
54683 GetWindowGroupAttributes(
54684   WindowGroupRef inGroup,
54685   WindowGroupAttributes * outAttributes) ;
54686 extern OSStatus
54687 ChangeWindowGroupAttributes(
54688   WindowGroupRef inGroup,
54689   WindowGroupAttributes setTheseAttributes,
54690   WindowGroupAttributes clearTheseAttributes) ;
54691 extern OSStatus
54692 SetWindowGroupLevel(
54693   WindowGroupRef inGroup,
54694   SInt32 inLevel) ;
54695 extern OSStatus
54696 GetWindowGroupLevel(
54697   WindowGroupRef inGroup,
54698   SInt32 * outLevel) ;
54699 extern OSStatus
54700 SendWindowGroupBehind(
54701   WindowGroupRef inGroup,
54702   WindowGroupRef behindGroup) ;
54703 extern WindowGroupRef
54704 GetWindowGroup(WindowRef inWindow) ;
54705 extern OSStatus
54706 SetWindowGroup(
54707   WindowRef inWindow,
54708   WindowGroupRef inNewGroup) ;
54709 extern Boolean
54710 IsWindowContainedInGroup(
54711   WindowRef inWindow,
54712   WindowGroupRef inGroup) ;
54713 extern WindowGroupRef
54714 GetWindowGroupParent(WindowGroupRef inGroup) ;
54715 extern OSStatus
54716 SetWindowGroupParent(
54717   WindowGroupRef inGroup,
54718   WindowGroupRef inNewGroup) ;
54719 extern WindowGroupRef
54720 GetWindowGroupSibling(
54721   WindowGroupRef inGroup,
54722   Boolean inNextGroup) ;
54723 extern WindowRef
54724 GetWindowGroupOwner(WindowGroupRef inGroup) ;
54725 extern OSStatus
54726 SetWindowGroupOwner(
54727   WindowGroupRef inGroup,
54728   WindowRef inWindow) ;
54729 extern ItemCount
54730 CountWindowGroupContents(
54731   WindowGroupRef inGroup,
54732   WindowGroupContentOptions inOptions) ;
54733 extern OSStatus
54734 GetWindowGroupContents(
54735   WindowGroupRef inGroup,
54736   WindowGroupContentOptions inOptions,
54737   ItemCount inAllowedItems,
54738   ItemCount * outNumItems,
54739   void ** outItems) ;
54740 extern OSStatus
54741 GetIndexedWindow(
54742   WindowGroupRef inGroup,
54743   UInt32 inIndex,
54744   WindowGroupContentOptions inOptions,
54745   WindowRef * outWindow) ;
54746 extern OSStatus
54747 GetWindowIndex(
54748   WindowRef inWindow,
54749   WindowGroupRef inStartGroup,
54750   WindowGroupContentOptions inOptions,
54751   UInt32 * outIndex) ;
54752 extern WindowRef
54753 ActiveNonFloatingWindow(void) ;
54754 extern Boolean
54755 IsWindowActive(WindowRef inWindow) ;
54756 extern OSStatus
54757 ActivateWindow(
54758   WindowRef inWindow,
54759   Boolean inActivate) ;
54760 extern OSStatus
54761 GetWindowActivationScope(
54762   WindowRef inWindow,
54763   WindowActivationScope * outScope) ;
54764 extern OSStatus
54765 SetWindowActivationScope(
54766   WindowRef inWindow,
54767   WindowActivationScope inScope) ;
54768 extern void
54769 DebugPrintWindowGroup(WindowGroupRef inGroup) ;
54770 extern void
54771 DebugPrintAllWindowGroups(void) ;
54772 extern OSStatus
54773 SetWindowContentColor(
54774   WindowRef window,
54775   const RGBColor * color) ;
54776 extern OSStatus
54777 GetWindowContentColor(
54778   WindowRef window,
54779   RGBColor * color) ;
54780 extern OSStatus
54781 GetWindowContentPattern(
54782   WindowRef window,
54783   PixPatHandle outPixPat) ;
54784 extern OSStatus
54785 SetWindowContentPattern(
54786   WindowRef window,
54787   PixPatHandle pixPat) ;
54788
54789
54790
54791 typedef OptionBits WindowPaintProcOptions;
54792 enum {
54793   kWindowPaintProcOptionsNone = 0
54794 };
54795 extern OSStatus
54796 InstallWindowContentPaintProc(
54797   WindowRef window,
54798   WindowPaintUPP paintProc,
54799   WindowPaintProcOptions options,
54800   void * refCon) ;
54801
54802
54803
54804
54805
54806 typedef UInt32 ScrollWindowOptions;
54807 enum {
54808   kScrollWindowNoOptions = 0,
54809   kScrollWindowInvalidate = (1L << 0),
54810   kScrollWindowEraseToPortBackground = (1L << 1)
54811 };
54812 extern OSStatus
54813 ScrollWindowRect(
54814   WindowRef inWindow,
54815   const Rect * inScrollRect,
54816   SInt16 inHPixels,
54817   SInt16 inVPixels,
54818   ScrollWindowOptions inOptions,
54819   RgnHandle outExposedRgn) ;
54820 extern OSStatus
54821 ScrollWindowRegion(
54822   WindowRef inWindow,
54823   RgnHandle inScrollRgn,
54824   SInt16 inHPixels,
54825   SInt16 inVPixels,
54826   ScrollWindowOptions inOptions,
54827   RgnHandle outExposedRgn) ;
54828 extern void
54829 ClipAbove(WindowRef window) ;
54830 extern void
54831 PaintOne(
54832   WindowRef window,
54833   RgnHandle clobberedRgn) ;
54834 extern void
54835 PaintBehind(
54836   WindowRef startWindow,
54837   RgnHandle clobberedRgn) ;
54838 extern void
54839 CalcVis(WindowRef window) ;
54840 extern void
54841 CalcVisBehind(
54842   WindowRef startWindow,
54843   RgnHandle clobberedRgn) ;
54844 extern Boolean
54845 CheckUpdate(EventRecord * theEvent) ;
54846 extern WindowPartCode
54847 FindWindow(
54848   Point thePoint,
54849   WindowRef * window) ;
54850 extern WindowRef
54851 FrontWindow(void) ;
54852 extern void
54853 BringToFront(WindowRef window) ;
54854 extern void
54855 SendBehind(
54856   WindowRef window,
54857   WindowRef behindWindow) ;
54858 extern void
54859 SelectWindow(WindowRef window) ;
54860 extern WindowRef
54861 FrontNonFloatingWindow(void) ;
54862 extern WindowRef
54863 GetNextWindowOfClass(
54864   WindowRef inWindow,
54865   WindowClass inWindowClass,
54866   Boolean mustBeVisible) ;
54867 extern WindowRef
54868 GetFrontWindowOfClass(
54869   WindowClass inWindowClass,
54870   Boolean mustBeVisible) ;
54871 extern OSStatus
54872 FindWindowOfClass(
54873   const Point * where,
54874   WindowClass inWindowClass,
54875   WindowRef * outWindow,
54876   WindowPartCode * outWindowPart) ;
54877
54878
54879
54880
54881
54882
54883
54884 enum {
54885
54886
54887
54888
54889
54890   kWindowMenuIncludeRotate = 1 << 0
54891 };
54892 extern OSStatus
54893 CreateStandardWindowMenu(
54894   OptionBits inOptions,
54895   MenuRef * outMenu) ;
54896 extern OSStatus
54897 SetWindowAlternateTitle(
54898   WindowRef inWindow,
54899   CFStringRef inTitle) ;
54900 extern OSStatus
54901 CopyWindowAlternateTitle(
54902   WindowRef inWindow,
54903   CFStringRef * outTitle) ;
54904 extern Boolean
54905 IsValidWindowPtr(WindowRef possibleWindow) ;
54906 extern void
54907 HiliteWindow(
54908   WindowRef window,
54909   Boolean fHilite) ;
54910 extern void
54911 SetWRefCon(
54912   WindowRef window,
54913   long data) ;
54914 extern long
54915 GetWRefCon(WindowRef window) ;
54916 extern void
54917 SetWindowPic(
54918   WindowRef window,
54919   PicHandle pic) ;
54920 extern PicHandle
54921 GetWindowPic(WindowRef window) ;
54922 extern short
54923 GetWVariant(WindowRef window) ;
54924 extern OSStatus
54925 GetWindowFeatures(
54926   WindowRef window,
54927   UInt32 * outFeatures) ;
54928 extern OSStatus
54929 GetWindowRegion(
54930   WindowRef window,
54931   WindowRegionCode inRegionCode,
54932   RgnHandle ioWinRgn) ;
54933 extern OSStatus
54934 GetWindowStructureWidths(
54935   WindowRef inWindow,
54936   Rect * outRect) ;
54937 extern void
54938 BeginUpdate(WindowRef window) ;
54939 extern void
54940 EndUpdate(WindowRef window) ;
54941 extern OSStatus
54942 InvalWindowRgn(
54943   WindowRef window,
54944   RgnHandle region) ;
54945 extern OSStatus
54946 InvalWindowRect(
54947   WindowRef window,
54948   const Rect * bounds) ;
54949 extern OSStatus
54950 ValidWindowRgn(
54951   WindowRef window,
54952   RgnHandle region) ;
54953 extern OSStatus
54954 ValidWindowRect(
54955   WindowRef window,
54956   const Rect * bounds) ;
54957 extern void
54958 DrawGrowIcon(WindowRef window) ;
54959 extern void
54960 SetWTitle(
54961   WindowRef window,
54962   ConstStr255Param title) ;
54963 extern void
54964 GetWTitle(
54965   WindowRef window,
54966   Str255 title) ;
54967 extern OSStatus
54968 SetWindowTitleWithCFString(
54969   WindowRef inWindow,
54970   CFStringRef inString) ;
54971 extern OSStatus
54972 CopyWindowTitleAsCFString(
54973   WindowRef inWindow,
54974   CFStringRef * outString) ;
54975 extern OSStatus
54976 SetWindowProxyFSSpec(
54977   WindowRef window,
54978   const FSSpec * inFile) ;
54979 extern OSStatus
54980 GetWindowProxyFSSpec(
54981   WindowRef window,
54982   FSSpec * outFile) ;
54983 extern OSStatus
54984 SetWindowProxyAlias(
54985   WindowRef inWindow,
54986   AliasHandle inAlias) ;
54987 extern OSStatus
54988 GetWindowProxyAlias(
54989   WindowRef window,
54990   AliasHandle * alias) ;
54991 extern OSStatus
54992 SetWindowProxyCreatorAndType(
54993   WindowRef window,
54994   OSType fileCreator,
54995   OSType fileType,
54996   SInt16 vRefNum) ;
54997 extern OSStatus
54998 GetWindowProxyIcon(
54999   WindowRef window,
55000   IconRef * outIcon) ;
55001 extern OSStatus
55002 SetWindowProxyIcon(
55003   WindowRef window,
55004   IconRef icon) ;
55005 extern OSStatus
55006 RemoveWindowProxy(WindowRef window) ;
55007 extern OSStatus
55008 BeginWindowProxyDrag(
55009   WindowRef window,
55010   DragReference * outNewDrag,
55011   RgnHandle outDragOutlineRgn) ;
55012 extern OSStatus
55013 EndWindowProxyDrag(
55014   WindowRef window,
55015   DragReference theDrag) ;
55016 extern OSStatus
55017 TrackWindowProxyFromExistingDrag(
55018   WindowRef window,
55019   Point startPt,
55020   DragReference drag,
55021   RgnHandle inDragOutlineRgn) ;
55022 extern OSStatus
55023 TrackWindowProxyDrag(
55024   WindowRef window,
55025   Point startPt) ;
55026 extern Boolean
55027 IsWindowModified(WindowRef window) ;
55028 extern OSStatus
55029 SetWindowModified(
55030   WindowRef window,
55031   Boolean modified) ;
55032 extern Boolean
55033 IsWindowPathSelectClick(
55034   WindowRef window,
55035   const EventRecord * event) ;
55036 extern OSStatus
55037 WindowPathSelect(
55038   WindowRef window,
55039   MenuRef menu,
55040   SInt32 * outMenuResult) ;
55041 extern Boolean
55042 IsWindowPathSelectEvent(
55043   WindowRef window,
55044   EventRef inEvent) ;
55045 extern OSStatus
55046 HiliteWindowFrameForDrag(
55047   WindowRef window,
55048   Boolean hilited) ;
55049 typedef UInt32 WindowTransitionEffect;
55050 enum {
55051
55052
55053
55054
55055
55056   kWindowZoomTransitionEffect = 1,
55057
55058
55059
55060
55061
55062
55063   kWindowSheetTransitionEffect = 2,
55064
55065
55066
55067
55068
55069
55070   kWindowSlideTransitionEffect = 3
55071 };
55072 typedef UInt32 WindowTransitionAction;
55073 enum {
55074
55075
55076
55077
55078
55079
55080
55081   kWindowShowTransitionAction = 1,
55082
55083
55084
55085
55086
55087
55088
55089   kWindowHideTransitionAction = 2,
55090
55091
55092
55093
55094
55095
55096
55097   kWindowMoveTransitionAction = 3,
55098
55099
55100
55101
55102
55103
55104
55105   kWindowResizeTransitionAction = 4
55106 };
55107 extern OSStatus
55108 TransitionWindow(
55109   WindowRef inWindow,
55110   WindowTransitionEffect inEffect,
55111   WindowTransitionAction inAction,
55112   const Rect * inRect) ;
55113 extern OSStatus
55114 TransitionWindowAndParent(
55115   WindowRef inWindow,
55116   WindowRef inParentWindow,
55117   WindowTransitionEffect inEffect,
55118   WindowTransitionAction inAction,
55119   const Rect * inRect) ;
55120 extern void
55121 MoveWindow(
55122   WindowRef window,
55123   short hGlobal,
55124   short vGlobal,
55125   Boolean front) ;
55126 extern void
55127 SizeWindow(
55128   WindowRef window,
55129   short w,
55130   short h,
55131   Boolean fUpdate) ;
55132 extern long
55133 GrowWindow(
55134   WindowRef window,
55135   Point startPt,
55136   const Rect * bBox) ;
55137 extern void
55138 DragWindow(
55139   WindowRef window,
55140   Point startPt,
55141   const Rect * boundsRect) ;
55142 extern void
55143 ZoomWindow(
55144   WindowRef window,
55145   WindowPartCode partCode,
55146   Boolean front) ;
55147 extern Boolean
55148 IsWindowCollapsable(WindowRef window) ;
55149 extern Boolean
55150 IsWindowCollapsed(WindowRef window) ;
55151 extern OSStatus
55152 CollapseWindow(
55153   WindowRef window,
55154   Boolean collapse) ;
55155 extern OSStatus
55156 CollapseAllWindows(Boolean collapse) ;
55157 extern OSStatus
55158 CreateQDContextForCollapsedWindowDockTile(
55159   WindowRef inWindow,
55160   CGrafPtr * outContext) ;
55161 extern OSStatus
55162 ReleaseQDContextForCollapsedWindowDockTile(
55163   WindowRef inWindow,
55164   CGrafPtr inContext) ;
55165 extern OSStatus
55166 UpdateCollapsedWindowDockTile(WindowRef inWindow) ;
55167 extern OSStatus
55168 SetWindowDockTileMenu(
55169   WindowRef inWindow,
55170   MenuRef inMenu) ;
55171 extern MenuRef
55172 GetWindowDockTileMenu(WindowRef inWindow) ;
55173 extern OSStatus
55174 GetWindowBounds(
55175   WindowRef window,
55176   WindowRegionCode regionCode,
55177   Rect * globalBounds) ;
55178 extern OSStatus
55179 SetWindowResizeLimits(
55180   WindowRef inWindow,
55181   const HISize * inMinLimits,
55182   const HISize * inMaxLimits) ;
55183 extern OSStatus
55184 GetWindowResizeLimits(
55185   WindowRef inWindow,
55186   HISize * outMinLimits,
55187   HISize * outMaxLimits) ;
55188 extern Boolean
55189 ResizeWindow(
55190   WindowRef inWindow,
55191   Point inStartPoint,
55192   const Rect * inSizeConstraints,
55193   Rect * outNewContentRect) ;
55194 extern OSStatus
55195 SetWindowBounds(
55196   WindowRef window,
55197   WindowRegionCode regionCode,
55198   const Rect * globalBounds) ;
55199 extern OSStatus
55200 RepositionWindow(
55201   WindowRef window,
55202   WindowRef parentWindow,
55203   WindowPositionMethod method) ;
55204 extern OSStatus
55205 MoveWindowStructure(
55206   WindowRef window,
55207   short hGlobal,
55208   short vGlobal) ;
55209 extern Boolean
55210 IsWindowInStandardState(
55211   WindowRef inWindow,
55212   const Point * inIdealSize,
55213   Rect * outIdealStandardState) ;
55214 extern OSStatus
55215 ZoomWindowIdeal(
55216   WindowRef inWindow,
55217   WindowPartCode inPartCode,
55218   Point * ioIdealSize) ;
55219 extern OSStatus
55220 GetWindowIdealUserState(
55221   WindowRef inWindow,
55222   Rect * outUserState) ;
55223 extern OSStatus
55224 SetWindowIdealUserState(
55225   WindowRef inWindow,
55226   const Rect * inUserState) ;
55227 extern OSStatus
55228 GetWindowGreatestAreaDevice(
55229   WindowRef inWindow,
55230   WindowRegionCode inRegion,
55231   GDHandle * outGreatestDevice,
55232   Rect * outGreatestDeviceRect) ;
55233
55234
55235
55236
55237
55238
55239
55240 typedef UInt32 WindowConstrainOptions;
55241 enum {
55242
55243
55244
55245
55246   kWindowConstrainMayResize = (1L << 0),
55247
55248
55249
55250
55251   kWindowConstrainMoveRegardlessOfFit = (1L << 1),
55252
55253
55254
55255
55256
55257   kWindowConstrainAllowPartial = (1L << 2),
55258
55259
55260
55261
55262
55263   kWindowConstrainCalcOnly = (1L << 3),
55264
55265
55266
55267
55268
55269   kWindowConstrainUseTransitionWindow = (1L << 4),
55270
55271
55272
55273
55274
55275
55276
55277   kWindowConstrainStandardOptions = kWindowConstrainMoveRegardlessOfFit
55278 };
55279 extern OSStatus
55280 ConstrainWindowToScreen(
55281   WindowRef inWindowRef,
55282   WindowRegionCode inRegionCode,
55283   WindowConstrainOptions inOptions,
55284   const Rect * inScreenRect,
55285   Rect * outStructure) ;
55286 extern OSStatus
55287 GetAvailableWindowPositioningBounds(
55288   GDHandle inDevice,
55289   Rect * outAvailableRect) ;
55290 extern OSStatus
55291 GetAvailableWindowPositioningRegion(
55292   GDHandle inDevice,
55293   RgnHandle ioRgn) ;
55294 extern void
55295 HideWindow(WindowRef window) ;
55296 extern void
55297 ShowWindow(WindowRef window) ;
55298 extern void
55299 ShowHide(
55300   WindowRef window,
55301   Boolean showFlag) ;
55302 extern Boolean
55303 IsWindowVisible(WindowRef window) ;
55304 typedef UInt32 WindowLatentVisibility;
55305 enum {
55306
55307
55308
55309
55310   kWindowLatentVisibleFloater = 1 << 0,
55311
55312
55313
55314
55315   kWindowLatentVisibleSuspend = 1 << 1,
55316
55317
55318
55319
55320   kWindowLatentVisibleFullScreen = 1 << 2,
55321
55322
55323
55324
55325   kWindowLatentVisibleAppHidden = 1 << 3,
55326
55327
55328
55329
55330   kWindowLatentVisibleCollapsedOwner = 1 << 4,
55331
55332
55333
55334
55335
55336   kWindowLatentVisibleCollapsedGroup = 1 << 5
55337 };
55338 extern Boolean
55339 IsWindowLatentVisible(
55340   WindowRef inWindow,
55341   WindowLatentVisibility * outLatentVisible) ;
55342 extern OSStatus
55343 ShowSheetWindow(
55344   WindowRef inSheet,
55345   WindowRef inParentWindow) ;
55346 extern OSStatus
55347 HideSheetWindow(WindowRef inSheet) ;
55348 extern OSStatus
55349 GetSheetWindowParent(
55350   WindowRef inSheet,
55351   WindowRef * outParentWindow) ;
55352 enum {
55353
55354
55355
55356
55357
55358
55359
55360   kWindowEdgeDefault = 0,
55361
55362
55363
55364
55365   kWindowEdgeTop = 1 << 0,
55366
55367
55368
55369
55370   kWindowEdgeLeft = 1 << 1,
55371
55372
55373
55374
55375   kWindowEdgeBottom = 1 << 2,
55376
55377
55378
55379
55380   kWindowEdgeRight = 1 << 3
55381 };
55382
55383
55384
55385
55386
55387
55388 enum {
55389
55390
55391
55392
55393   kWindowDrawerOpening = 1,
55394
55395
55396
55397
55398   kWindowDrawerOpen = 2,
55399
55400
55401
55402
55403   kWindowDrawerClosing = 3,
55404
55405
55406
55407
55408   kWindowDrawerClosed = 4
55409 };
55410
55411 typedef UInt32 WindowDrawerState;
55412 extern OptionBits
55413 GetDrawerPreferredEdge(WindowRef inDrawerWindow) ;
55414 extern OSStatus
55415 SetDrawerPreferredEdge(
55416   WindowRef inDrawerWindow,
55417   OptionBits inEdge) ;
55418 extern OptionBits
55419 GetDrawerCurrentEdge(WindowRef inDrawerWindow) ;
55420 extern WindowDrawerState
55421 GetDrawerState(WindowRef inDrawerWindow) ;
55422 extern WindowRef
55423 GetDrawerParent(WindowRef inDrawerWindow) ;
55424 extern OSStatus
55425 SetDrawerParent(
55426   WindowRef inDrawerWindow,
55427   WindowRef inParent) ;
55428 extern OSStatus
55429 SetDrawerOffsets(
55430   WindowRef inDrawerWindow,
55431   float inLeadingOffset,
55432   float inTrailingOffset) ;
55433 extern OSStatus
55434 GetDrawerOffsets(
55435   WindowRef inDrawerWindow,
55436   float * outLeadingOffset,
55437   float * outTrailingOffset) ;
55438 extern OSStatus
55439 ToggleDrawer(WindowRef inDrawerWindow) ;
55440 extern OSStatus
55441 OpenDrawer(
55442   WindowRef inDrawerWindow,
55443   OptionBits inEdge,
55444   Boolean inAsync) ;
55445 extern OSStatus
55446 CloseDrawer(
55447   WindowRef inDrawerWindow,
55448   Boolean inAsync) ;
55449 extern OSStatus
55450 DisableScreenUpdates(void) ;
55451 extern OSStatus
55452 EnableScreenUpdates(void) ;
55453 extern OSStatus
55454 SetWindowToolbar(
55455   WindowRef inWindow,
55456   HIToolbarRef inToolbar) ;
55457 extern OSStatus
55458 GetWindowToolbar(
55459   WindowRef inWindow,
55460   HIToolbarRef * outToolbar) ;
55461 extern OSStatus
55462 ShowHideWindowToolbar(
55463   WindowRef inWindow,
55464   Boolean inShow,
55465   Boolean inAnimate) ;
55466 extern Boolean
55467 IsWindowToolbarVisible(WindowRef inWindow) ;
55468 extern OSStatus
55469 SetWindowAlpha(
55470   WindowRef inWindow,
55471   float inAlpha) ;
55472 extern OSStatus
55473 GetWindowAlpha(
55474   WindowRef inWindow,
55475   float * outAlpha) ;
55476 extern OSStatus
55477 GetWindowProperty(
55478   WindowRef window,
55479   PropertyCreator propertyCreator,
55480   PropertyTag propertyTag,
55481   UInt32 bufferSize,
55482   UInt32 * actualSize,
55483   void * propertyBuffer) ;
55484 extern OSStatus
55485 GetWindowPropertySize(
55486   WindowRef window,
55487   PropertyCreator creator,
55488   PropertyTag tag,
55489   UInt32 * size) ;
55490 extern OSStatus
55491 SetWindowProperty(
55492   WindowRef window,
55493   PropertyCreator propertyCreator,
55494   PropertyTag propertyTag,
55495   UInt32 propertySize,
55496   const void * propertyBuffer) ;
55497 extern OSStatus
55498 RemoveWindowProperty(
55499   WindowRef window,
55500   PropertyCreator propertyCreator,
55501   PropertyTag propertyTag) ;
55502
55503
55504
55505
55506
55507 enum {
55508   kWindowPropertyPersistent = 0x00000001
55509 };
55510 extern OSStatus
55511 GetWindowPropertyAttributes(
55512   WindowRef window,
55513   OSType propertyCreator,
55514   OSType propertyTag,
55515   UInt32 * attributes) ;
55516 extern OSStatus
55517 ChangeWindowPropertyAttributes(
55518   WindowRef window,
55519   OSType propertyCreator,
55520   OSType propertyTag,
55521   UInt32 attributesToSet,
55522   UInt32 attributesToClear) ;
55523 extern long
55524 PinRect(
55525   const Rect * theRect,
55526   Point thePt) ;
55527 extern RgnHandle
55528 GetGrayRgn(void) ;
55529 extern Boolean
55530 TrackBox(
55531   WindowRef window,
55532   Point thePt,
55533   WindowPartCode partCode) ;
55534 extern Boolean
55535 TrackGoAway(
55536   WindowRef window,
55537   Point thePt) ;
55538 extern long
55539 DragGrayRgn(
55540   RgnHandle theRgn,
55541   Point startPt,
55542   const Rect * limitRect,
55543   const Rect * slopRect,
55544   short axis,
55545   DragGrayRgnUPP actionProc) ;
55546 extern long
55547 DragTheRgn(
55548   RgnHandle theRgn,
55549   Point startPt,
55550   const Rect * limitRect,
55551   const Rect * slopRect,
55552   short axis,
55553   DragGrayRgnUPP actionProc) ;
55554 extern WindowRef
55555 GetWindowList(void) ;
55556 extern CGrafPtr
55557 GetWindowPort(WindowRef window) ;
55558 extern CGrafPtr
55559 GetWindowStructurePort(WindowRef inWindow) ;
55560 extern short
55561 GetWindowKind(WindowRef window) ;
55562 extern Boolean
55563 IsWindowHilited(WindowRef window) ;
55564 extern Boolean
55565 IsWindowUpdatePending(WindowRef window) ;
55566 extern WindowRef
55567 GetNextWindow(WindowRef window) ;
55568 extern WindowRef
55569 GetPreviousWindow(WindowRef inWindow) ;
55570 extern Rect *
55571 GetWindowStandardState(
55572   WindowRef window,
55573   Rect * rect) ;
55574 extern Rect *
55575 GetWindowUserState(
55576   WindowRef window,
55577   Rect * rect) ;
55578 extern void
55579 SetWindowKind(
55580   WindowRef window,
55581   short kind) ;
55582 extern void
55583 SetWindowStandardState(
55584   WindowRef window,
55585   const Rect * rect) ;
55586 extern void
55587 SetWindowUserState(
55588   WindowRef window,
55589   const Rect * rect) ;
55590 extern void
55591 SetPortWindowPort(WindowRef window) ;
55592 extern Rect *
55593 GetWindowPortBounds(
55594   WindowRef window,
55595   Rect * bounds) ;
55596 extern WindowRef
55597 GetWindowFromPort(CGrafPtr port) ;
55598 enum {
55599   kWindowGroupAttrSelectable = kWindowGroupAttrSelectAsLayer,
55600   kWindowGroupAttrPositionFixed = kWindowGroupAttrMoveTogether,
55601   kWindowGroupAttrZOrderFixed = kWindowGroupAttrLayerTogether
55602 };
55603
55604
55605 }
55606 extern "C" {
55607
55608
55609 enum {
55610   kTrackMouseLocationOptionDontConsumeMouseUp = (1 << 0)
55611 };
55612
55613 typedef UInt16 MouseTrackingResult;
55614 enum {
55615   kMouseTrackingMouseDown = 1,
55616   kMouseTrackingMouseUp = 2,
55617   kMouseTrackingMouseExited = 3,
55618   kMouseTrackingMouseEntered = 4,
55619   kMouseTrackingMouseDragged = 5,
55620   kMouseTrackingKeyModifiersChanged = 6,
55621   kMouseTrackingUserCancelled = 7,
55622   kMouseTrackingTimedOut = 8,
55623   kMouseTrackingMouseMoved = 9
55624 };
55625 extern Boolean
55626 IsUserCancelEventRef(EventRef event) ;
55627 extern OSStatus
55628 TrackMouseLocation(
55629   GrafPtr inPort,
55630   Point * outPt,
55631   MouseTrackingResult * outResult) ;
55632 extern OSStatus
55633 TrackMouseLocationWithOptions(
55634   GrafPtr inPort,
55635   OptionBits inOptions,
55636   EventTimeout inTimeout,
55637   Point * outPt,
55638   UInt32 * outModifiers,
55639   MouseTrackingResult * outResult) ;
55640 extern OSStatus
55641 TrackMouseRegion(
55642   GrafPtr inPort,
55643   RgnHandle inRegion,
55644   Boolean * ioWasInRgn,
55645   MouseTrackingResult * outResult) ;
55646 extern Boolean
55647 ConvertEventRefToEventRecord(
55648   EventRef inEvent,
55649   EventRecord * outEvent) ;
55650 extern Boolean
55651 IsEventInMask(
55652   EventRef inEvent,
55653   EventMask inMask) ;
55654 extern EventTime
55655 GetLastUserEventTime(void) ;
55656 extern Boolean
55657 IsMouseCoalescingEnabled(void) ;
55658 extern OSStatus
55659 SetMouseCoalescingEnabled(
55660   Boolean inNewState,
55661   Boolean * outOldState) ;
55662 enum {
55663
55664
55665
55666
55667   kEventClassMouse = 'mous',
55668
55669
55670
55671
55672   kEventClassKeyboard = 'keyb',
55673
55674
55675
55676
55677   kEventClassTextInput = 'text',
55678
55679
55680
55681
55682   kEventClassApplication = 'appl',
55683
55684
55685
55686
55687   kEventClassAppleEvent = 'eppc',
55688
55689
55690
55691
55692   kEventClassMenu = 'menu',
55693
55694
55695
55696
55697   kEventClassWindow = 'wind',
55698
55699
55700
55701
55702   kEventClassControl = 'cntl',
55703
55704
55705
55706
55707   kEventClassCommand = 'cmds',
55708
55709
55710
55711
55712   kEventClassTablet = 'tblt',
55713
55714
55715
55716
55717   kEventClassVolume = 'vol ',
55718
55719
55720
55721
55722   kEventClassAppearance = 'appm',
55723
55724
55725
55726
55727   kEventClassService = 'serv',
55728
55729
55730
55731
55732   kEventClassToolbar = 'tbar',
55733
55734
55735
55736
55737   kEventClassToolbarItem = 'tbit',
55738
55739
55740
55741
55742   kEventClassAccessibility = 'acce'
55743 };
55744 enum {
55745
55746
55747
55748
55749   kEventMouseDown = 1,
55750
55751
55752
55753
55754   kEventMouseUp = 2,
55755
55756
55757
55758
55759   kEventMouseMoved = 5,
55760
55761
55762
55763
55764   kEventMouseDragged = 6,
55765
55766
55767
55768
55769   kEventMouseEntered = 8,
55770
55771
55772
55773
55774   kEventMouseExited = 9,
55775
55776
55777
55778
55779   kEventMouseWheelMoved = 10
55780 };
55781 typedef UInt16 EventMouseButton;
55782 enum {
55783
55784
55785
55786
55787
55788   kEventMouseButtonPrimary = 1,
55789
55790
55791
55792
55793   kEventMouseButtonSecondary = 2,
55794
55795
55796
55797
55798   kEventMouseButtonTertiary = 3
55799 };
55800
55801
55802
55803
55804
55805
55806
55807 typedef UInt16 EventMouseWheelAxis;
55808 enum {
55809
55810
55811
55812
55813   kEventMouseWheelAxisX = 0,
55814
55815
55816
55817
55818   kEventMouseWheelAxisY = 1
55819 };
55820 enum {
55821
55822
55823
55824
55825
55826   kEventTextInputUpdateActiveInputArea = 1,
55827   kEventTextInputUnicodeForKeyEvent = 2,
55828
55829
55830
55831
55832
55833
55834
55835   kEventTextInputOffsetToPos = 3,
55836   kEventTextInputPosToOffset = 4,
55837
55838
55839
55840
55841
55842
55843   kEventTextInputShowHideBottomWindow = 5,
55844
55845
55846
55847
55848
55849   kEventTextInputGetSelectedText = 6,
55850   kEventTextInputUnicodeText = 7
55851 };
55852 enum {
55853
55854
55855
55856
55857   kEventRawKeyDown = 1,
55858
55859
55860
55861
55862   kEventRawKeyRepeat = 2,
55863
55864
55865
55866
55867   kEventRawKeyUp = 3,
55868
55869
55870
55871
55872   kEventRawKeyModifiersChanged = 4,
55873
55874
55875
55876
55877   kEventHotKeyPressed = 5,
55878
55879
55880
55881
55882   kEventHotKeyReleased = 6
55883 };
55884 enum {
55885
55886
55887
55888
55889   kEventKeyModifierNumLockBit = 16,
55890
55891
55892
55893
55894   kEventKeyModifierFnBit = 17
55895 };
55896
55897 enum {
55898   kEventKeyModifierNumLockMask = 1L << kEventKeyModifierNumLockBit,
55899   kEventKeyModifierFnMask = 1L << kEventKeyModifierFnBit
55900 };
55901 enum {
55902
55903
55904
55905
55906
55907
55908   kEventAppActivated = 1,
55909
55910
55911
55912
55913   kEventAppDeactivated = 2,
55914   kEventAppQuit = 3,
55915
55916
55917
55918
55919
55920
55921   kEventAppLaunchNotification = 4,
55922
55923
55924
55925
55926
55927   kEventAppLaunched = 5,
55928
55929
55930
55931
55932
55933   kEventAppTerminated = 6,
55934
55935
55936
55937
55938
55939   kEventAppFrontSwitched = 7,
55940
55941
55942
55943
55944
55945
55946
55947   kEventAppFocusMenuBar = 8,
55948   kEventAppFocusNextDocumentWindow = 9,
55949   kEventAppFocusNextFloatingWindow = 10,
55950   kEventAppFocusToolbar = 11,
55951   kEventAppGetDockTileMenu = 20,
55952
55953
55954
55955
55956   kEventAppHidden = 107,
55957
55958
55959
55960
55961
55962   kEventAppShown = 108,
55963
55964
55965
55966
55967
55968   kEventAppSystemUIModeChanged = 109
55969 };
55970 enum {
55971
55972
55973
55974
55975
55976   kEventAppleEvent = 1
55977 };
55978 enum {
55979
55980
55981
55982
55983
55984
55985
55986   kEventWindowUpdate = 1,
55987
55988
55989
55990
55991
55992
55993   kEventWindowDrawContent = 2
55994 };
55995 enum {
55996
55997
55998
55999
56000
56001
56002   kEventWindowActivated = 5,
56003
56004
56005
56006
56007
56008
56009   kEventWindowDeactivated = 6,
56010   kEventWindowGetClickActivation = 7
56011 };
56012 enum {
56013
56014
56015
56016
56017   kEventWindowShowing = 22,
56018
56019
56020
56021
56022   kEventWindowHiding = 23,
56023
56024
56025
56026
56027   kEventWindowShown = 24,
56028
56029
56030
56031
56032   kEventWindowHidden = 25,
56033
56034
56035
56036
56037
56038   kEventWindowCollapsing = 86,
56039
56040
56041
56042
56043   kEventWindowCollapsed = 67,
56044
56045
56046
56047
56048
56049   kEventWindowExpanding = 87,
56050
56051
56052
56053
56054   kEventWindowExpanded = 70,
56055   kEventWindowZoomed = 76,
56056   kEventWindowBoundsChanging = 26,
56057
56058
56059
56060
56061
56062
56063
56064
56065   kEventWindowBoundsChanged = 27,
56066
56067
56068
56069
56070   kEventWindowResizeStarted = 28,
56071
56072
56073
56074
56075   kEventWindowResizeCompleted = 29,
56076
56077
56078
56079
56080   kEventWindowDragStarted = 30,
56081
56082
56083
56084
56085   kEventWindowDragCompleted = 31,
56086
56087
56088
56089
56090   kEventWindowClosed = 73
56091 };
56092 enum {
56093
56094
56095
56096
56097
56098   kWindowBoundsChangeUserDrag = (1 << 0),
56099
56100
56101
56102
56103   kWindowBoundsChangeUserResize = (1 << 1),
56104
56105
56106
56107
56108   kWindowBoundsChangeSizeChanged = (1 << 2),
56109
56110
56111
56112
56113   kWindowBoundsChangeOriginChanged = (1 << 3),
56114   kWindowBoundsChangeZoom = (1 << 4)
56115 };
56116 enum {
56117
56118
56119
56120
56121
56122   kEventWindowClickDragRgn = 32,
56123
56124
56125
56126
56127
56128   kEventWindowClickResizeRgn = 33,
56129
56130
56131
56132
56133
56134
56135
56136   kEventWindowClickCollapseRgn = 34,
56137
56138
56139
56140
56141
56142   kEventWindowClickCloseRgn = 35,
56143
56144
56145
56146
56147
56148   kEventWindowClickZoomRgn = 36,
56149
56150
56151
56152
56153
56154
56155
56156   kEventWindowClickContentRgn = 37,
56157
56158
56159
56160
56161
56162
56163   kEventWindowClickProxyIconRgn = 38,
56164
56165
56166
56167
56168
56169
56170   kEventWindowClickToolbarButtonRgn = 41,
56171
56172
56173
56174
56175
56176   kEventWindowClickStructureRgn = 42
56177 };
56178 enum {
56179   kEventWindowCursorChange = 40
56180 };
56181 enum {
56182   kEventWindowCollapse = 66,
56183   kEventWindowCollapseAll = 68,
56184   kEventWindowExpand = 69,
56185   kEventWindowExpandAll = 71,
56186
56187
56188
56189
56190
56191
56192
56193   kEventWindowClose = 72,
56194   kEventWindowCloseAll = 74,
56195   kEventWindowZoom = 75,
56196   kEventWindowZoomAll = 77,
56197
56198
56199
56200
56201
56202
56203   kEventWindowContextualMenuSelect = 78,
56204
56205
56206
56207
56208
56209
56210   kEventWindowPathSelect = 79,
56211
56212
56213
56214
56215
56216   kEventWindowGetIdealSize = 80,
56217   kEventWindowGetMinimumSize = 81,
56218   kEventWindowGetMaximumSize = 82,
56219   kEventWindowConstrain = 83,
56220
56221
56222
56223
56224
56225
56226
56227   kEventWindowHandleContentClick = 85,
56228   kEventWindowGetDockTileMenu = 90,
56229
56230
56231
56232
56233
56234   kEventWindowProxyBeginDrag = 128,
56235
56236
56237
56238
56239
56240   kEventWindowProxyEndDrag = 129,
56241   kEventWindowToolbarSwitchMode = 150
56242 };
56243 enum {
56244
56245
56246
56247
56248
56249
56250
56251   kEventWindowFocusAcquired = 200,
56252
56253
56254
56255
56256
56257
56258   kEventWindowFocusRelinquish = 201,
56259
56260
56261
56262
56263
56264
56265
56266   kEventWindowFocusContent = 202,
56267
56268
56269
56270
56271
56272
56273
56274   kEventWindowFocusToolbar = 203
56275 };
56276 enum {
56277
56278
56279
56280
56281
56282
56283   kEventWindowDrawerOpening = 220,
56284
56285
56286
56287
56288
56289   kEventWindowDrawerOpened = 221,
56290
56291
56292
56293
56294
56295
56296   kEventWindowDrawerClosing = 222,
56297
56298
56299
56300
56301
56302   kEventWindowDrawerClosed = 223
56303 };
56304 enum {
56305
56306
56307
56308
56309
56310
56311
56312   kEventWindowDrawFrame = 1000,
56313
56314
56315
56316
56317
56318
56319   kEventWindowDrawPart = 1001,
56320
56321
56322
56323
56324
56325
56326
56327   kEventWindowGetRegion = 1002,
56328
56329
56330
56331
56332
56333
56334
56335   kEventWindowHitTest = 1003,
56336   kEventWindowInit = 1004,
56337   kEventWindowDispose = 1005,
56338
56339
56340
56341
56342
56343
56344   kEventWindowDragHilite = 1006,
56345
56346
56347
56348
56349
56350
56351   kEventWindowModified = 1007,
56352
56353
56354
56355
56356
56357
56358   kEventWindowSetupProxyDragImage = 1008,
56359
56360
56361
56362
56363
56364   kEventWindowStateChanged = 1009,
56365
56366
56367
56368
56369
56370   kEventWindowMeasureTitle = 1010,
56371   kEventWindowDrawGrowBox = 1011,
56372   kEventWindowGetGrowImageRegion = 1012,
56373   kEventWindowPaint = 1013
56374 };
56375 enum {
56376   kEventMenuBeginTracking = 1,
56377
56378
56379
56380
56381   kEventMenuEndTracking = 2,
56382
56383
56384
56385
56386
56387
56388
56389   kEventMenuChangeTrackingMode = 3,
56390   kEventMenuOpening = 4,
56391
56392
56393
56394
56395   kEventMenuClosed = 5,
56396
56397
56398
56399
56400
56401   kEventMenuTargetItem = 6,
56402   kEventMenuMatchKey = 7,
56403   kEventMenuEnableItems = 8,
56404   kEventMenuPopulate = 9,
56405   kEventMenuMeasureItemWidth = 100,
56406   kEventMenuMeasureItemHeight = 101,
56407   kEventMenuDrawItem = 102,
56408   kEventMenuDrawItemContent = 103,
56409
56410
56411
56412
56413   kEventMenuDispose = 1001
56414 };
56415
56416
56417
56418
56419
56420
56421
56422 enum {
56423
56424
56425
56426
56427
56428
56429
56430   kMenuContextMenuBar = 1 << 0,
56431
56432
56433
56434
56435
56436   kMenuContextPullDown = 1 << 8,
56437
56438
56439
56440
56441
56442   kMenuContextPopUp = 1 << 9,
56443
56444
56445
56446
56447
56448   kMenuContextSubmenu = 1 << 10,
56449
56450
56451
56452
56453
56454   kMenuContextMenuBarTracking = 1 << 16,
56455
56456
56457
56458
56459
56460   kMenuContextPopUpTracking = 1 << 17,
56461
56462
56463
56464
56465
56466   kMenuContextKeyMatching = 1 << 18,
56467   kMenuContextMenuEnabling = 1 << 19,
56468
56469
56470
56471
56472
56473
56474
56475   kMenuContextCommandIDSearch = 1 << 20
56476 };
56477 enum {
56478   kEventProcessCommand = 1,
56479   kEventCommandProcess = 1,
56480   kEventCommandUpdateStatus = 2
56481 };
56482 enum {
56483
56484
56485
56486
56487   kHICommandOK = 'ok  ',
56488
56489
56490
56491
56492   kHICommandCancel = 'not!',
56493
56494
56495
56496
56497   kHICommandQuit = 'quit',
56498
56499
56500
56501
56502   kHICommandUndo = 'undo',
56503
56504
56505
56506
56507   kHICommandRedo = 'redo',
56508
56509
56510
56511
56512   kHICommandCut = 'cut ',
56513
56514
56515
56516
56517   kHICommandCopy = 'copy',
56518
56519
56520
56521
56522   kHICommandPaste = 'past',
56523
56524
56525
56526
56527   kHICommandClear = 'clea',
56528
56529
56530
56531
56532   kHICommandSelectAll = 'sall',
56533
56534
56535
56536
56537
56538
56539   kHICommandHide = 'hide',
56540
56541
56542
56543
56544
56545
56546   kHICommandHideOthers = 'hido',
56547
56548
56549
56550
56551
56552
56553   kHICommandShowAll = 'shal',
56554
56555
56556
56557
56558   kHICommandPreferences = 'pref',
56559   kHICommandZoomWindow = 'zoom',
56560
56561
56562
56563
56564
56565
56566   kHICommandMinimizeWindow = 'mini',
56567
56568
56569
56570
56571
56572
56573
56574   kHICommandMinimizeAll = 'mina',
56575
56576
56577
56578
56579
56580
56581   kHICommandMaximizeWindow = 'maxi',
56582
56583
56584
56585
56586
56587
56588
56589   kHICommandMaximizeAll = 'maxa',
56590
56591
56592
56593
56594
56595
56596   kHICommandArrangeInFront = 'frnt',
56597
56598
56599
56600
56601
56602
56603
56604   kHICommandBringAllToFront = 'bfrt',
56605   kHICommandWindowListSeparator = 'wldv',
56606   kHICommandWindowListTerminator = 'wlst',
56607
56608
56609
56610
56611
56612
56613   kHICommandSelectWindow = 'swin',
56614   kHICommandRotateWindowsForward = 'rotw',
56615   kHICommandRotateWindowsBackward = 'rotb',
56616   kHICommandRotateFloatingWindowsForward = 'rtfw',
56617   kHICommandRotateFloatingWindowsBackward = 'rtfb',
56618
56619
56620
56621
56622   kHICommandAbout = 'abou',
56623
56624
56625
56626
56627   kHICommandNew = 'new ',
56628
56629
56630
56631
56632   kHICommandOpen = 'open',
56633
56634
56635
56636
56637   kHICommandClose = 'clos',
56638
56639
56640
56641
56642   kHICommandSave = 'save',
56643
56644
56645
56646
56647   kHICommandSaveAs = 'svas',
56648
56649
56650
56651
56652
56653   kHICommandRevert = 'rvrt',
56654
56655
56656
56657
56658   kHICommandPrint = 'prnt',
56659
56660
56661
56662
56663
56664   kHICommandPageSetup = 'page',
56665
56666
56667
56668
56669
56670
56671
56672   kHICommandAppHelp = 'ahlp'
56673 };
56674 enum {
56675
56676
56677
56678
56679
56680   kHICommandFromMenu = (1L << 0),
56681
56682
56683
56684
56685
56686   kHICommandFromControl = (1L << 1),
56687
56688
56689
56690
56691
56692   kHICommandFromWindow = (1L << 2)
56693 };
56694
56695 struct HICommand {
56696   UInt32 attributes;
56697   UInt32 commandID;
56698   struct {
56699     MenuRef menuRef;
56700     MenuItemIndex menuItemIndex;
56701   } menu;
56702 };
56703 typedef struct HICommand HICommand;
56704 struct HICommandExtended {
56705   UInt32 attributes;
56706   UInt32 commandID;
56707   union {
56708     ControlRef control;
56709     WindowRef window;
56710     struct {
56711       MenuRef menuRef;
56712       MenuItemIndex menuItemIndex;
56713     } menu;
56714   } source;
56715 };
56716 typedef struct HICommandExtended HICommandExtended;
56717 enum {
56718
56719
56720
56721
56722   kEventControlInitialize = 1000,
56723
56724
56725
56726
56727   kEventControlDispose = 1001,
56728   kEventControlGetOptimalBounds = 1003,
56729   kEventControlDefInitialize = kEventControlInitialize,
56730   kEventControlDefDispose = kEventControlDispose,
56731
56732
56733
56734
56735
56736   kEventControlHit = 1,
56737   kEventControlSimulateHit = 2,
56738
56739
56740
56741
56742
56743
56744
56745   kEventControlHitTest = 3,
56746
56747
56748
56749
56750
56751
56752   kEventControlDraw = 4,
56753
56754
56755
56756
56757
56758
56759
56760   kEventControlApplyBackground = 5,
56761   kEventControlApplyTextColor = 6,
56762   kEventControlSetFocusPart = 7,
56763
56764
56765
56766
56767
56768
56769   kEventControlGetFocusPart = 8,
56770
56771
56772
56773
56774
56775   kEventControlActivate = 9,
56776
56777
56778
56779
56780
56781   kEventControlDeactivate = 10,
56782
56783
56784
56785
56786
56787   kEventControlSetCursor = 11,
56788
56789
56790
56791
56792
56793
56794   kEventControlContextualMenuClick = 12,
56795
56796
56797
56798
56799
56800
56801
56802   kEventControlClick = 13,
56803   kEventControlGetNextFocusCandidate = 14,
56804
56805
56806
56807
56808
56809
56810   kEventControlGetAutoToggleValue = 15,
56811   kEventControlInterceptSubviewClick = 16,
56812   kEventControlGetClickActivation = 17,
56813   kEventControlDragEnter = 18,
56814
56815
56816
56817
56818
56819
56820
56821   kEventControlDragWithin = 19,
56822
56823
56824
56825
56826
56827   kEventControlDragLeave = 20,
56828
56829
56830
56831
56832   kEventControlDragReceive = 21,
56833
56834
56835
56836
56837
56838
56839
56840   kEventControlTrack = 51,
56841   kEventControlGetScrollToHereStartPoint = 52,
56842
56843
56844
56845
56846
56847
56848   kEventControlGetIndicatorDragConstraint = 53,
56849
56850
56851
56852
56853
56854
56855
56856   kEventControlIndicatorMoved = 54,
56857
56858
56859
56860
56861
56862   kEventControlGhostingFinished = 55,
56863
56864
56865
56866
56867
56868
56869
56870   kEventControlGetActionProcPart = 56,
56871
56872
56873
56874
56875
56876
56877
56878   kEventControlGetPartRegion = 101,
56879
56880
56881
56882
56883
56884
56885
56886   kEventControlGetPartBounds = 102,
56887
56888
56889
56890
56891
56892   kEventControlSetData = 103,
56893
56894
56895
56896
56897
56898   kEventControlGetData = 104,
56899   kEventControlGetSizeConstraints = 105,
56900
56901
56902
56903
56904
56905
56906   kEventControlValueFieldChanged = 151,
56907
56908
56909
56910
56911
56912   kEventControlAddedSubControl = 152,
56913
56914
56915
56916
56917
56918   kEventControlRemovingSubControl = 153,
56919
56920
56921
56922
56923
56924   kEventControlBoundsChanged = 154,
56925
56926
56927
56928
56929
56930   kEventControlTitleChanged = 158,
56931
56932
56933
56934
56935
56936
56937   kEventControlOwningWindowChanged = 159,
56938
56939
56940
56941
56942
56943
56944
56945   kEventControlHiliteChanged = 160,
56946
56947
56948
56949
56950
56951
56952
56953   kEventControlEnabledStateChanged = 161,
56954
56955
56956
56957
56958
56959   kEventControlArbitraryMessage = 201
56960 };
56961 enum {
56962
56963
56964
56965
56966   kControlBoundsChangeSizeChanged = (1 << 2),
56967
56968
56969
56970
56971   kControlBoundsChangePositionChanged = (1 << 3)
56972 };
56973 enum {
56974
56975
56976
56977
56978
56979   kEventTabletPoint = 1,
56980
56981
56982
56983
56984
56985   kEventTabletProximity = 2,
56986   kEventTabletPointer = 1
56987 };
56988
56989 struct TabletPointRec {
56990   SInt32 absX;
56991   SInt32 absY;
56992   SInt32 absZ;
56993   UInt16 buttons;
56994   UInt16 pressure;
56995   SInt16 tiltX;
56996   SInt16 tiltY;
56997   UInt16 rotation;
56998   SInt16 tangentialPressure;
56999   UInt16 deviceID;
57000   SInt16 vendor1;
57001   SInt16 vendor2;
57002   SInt16 vendor3;
57003 };
57004 typedef struct TabletPointRec TabletPointRec;
57005 typedef TabletPointRec TabletPointerRec;
57006 struct TabletProximityRec {
57007   UInt16 vendorID;
57008   UInt16 tabletID;
57009   UInt16 pointerID;
57010   UInt16 deviceID;
57011   UInt16 systemTabletID;
57012   UInt16 vendorPointerType;
57013   UInt32 pointerSerialNumber;
57014   UInt64 uniqueID;
57015   UInt32 capabilityMask;
57016   UInt8 pointerType;
57017   UInt8 enterProximity;
57018 };
57019 typedef struct TabletProximityRec TabletProximityRec;
57020 enum {
57021
57022
57023
57024
57025
57026   kEventVolumeMounted = 1,
57027
57028
57029
57030
57031
57032   kEventVolumeUnmounted = 2
57033 };
57034 enum {
57035   typeFSVolumeRefNum = 'voln'
57036 };
57037 enum {
57038
57039
57040
57041
57042
57043   kEventAppearanceScrollBarVariantChanged = 1
57044 };
57045 enum {
57046
57047
57048
57049
57050
57051
57052   kEventServiceCopy = 1,
57053
57054
57055
57056
57057
57058
57059   kEventServicePaste = 2,
57060   kEventServiceGetTypes = 3,
57061   kEventServicePerform = 4
57062 };
57063 extern CFStringRef
57064 CreateTypeStringWithOSType(OSType inType) ;
57065 enum {
57066   kEventAccessibleGetChildAtPoint = 1,
57067   kEventAccessibleGetFocusedChild = 2,
57068
57069
57070
57071
57072
57073
57074   kEventAccessibleGetAllAttributeNames = 21,
57075
57076
57077
57078
57079
57080
57081
57082   kEventAccessibleGetNamedAttribute = 22,
57083   kEventAccessibleSetNamedAttribute = 23,
57084   kEventAccessibleIsNamedAttributeSettable = 24,
57085
57086
57087
57088
57089
57090
57091   kEventAccessibleGetAllActionNames = 41,
57092
57093
57094
57095
57096
57097
57098   kEventAccessiblePerformNamedAction = 42,
57099   kEventAccessibleGetNamedActionDescription = 44
57100 };
57101 extern AXUIElementRef
57102 AXUIElementCreateWithHIObjectAndIdentifier(
57103   HIObjectRef inHIObject,
57104   UInt64 inIdentifier) ;
57105 extern HIObjectRef
57106 AXUIElementGetHIObject(AXUIElementRef inUIElement) ;
57107 extern void
57108 AXUIElementGetIdentifier(
57109   AXUIElementRef inUIElement,
57110   UInt64 * outIdentifier) ;
57111 extern void
57112 AXNotificationHIObjectNotify(
57113   CFStringRef inNotification,
57114   HIObjectRef inHIObject,
57115   UInt64 inIdentifier) ;
57116
57117
57118
57119
57120
57121 enum {
57122   kEventParamDirectObject = '----'
57123 };
57124
57125
57126
57127
57128 enum {
57129   kEventParamPostTarget = 'ptrg',
57130
57131
57132
57133
57134   typeEventTargetRef = 'etrg'
57135 };
57136
57137
57138
57139 enum {
57140   kEventParamWindowRef = 'wind',
57141   kEventParamGrafPort = 'graf',
57142   kEventParamDragRef = 'drag',
57143   kEventParamMenuRef = 'menu',
57144   kEventParamEventRef = 'evnt',
57145   kEventParamControlRef = 'ctrl',
57146   kEventParamRgnHandle = 'rgnh',
57147   kEventParamEnabled = 'enab',
57148   kEventParamDimensions = 'dims',
57149   kEventParamAvailableBounds = 'avlb',
57150   kEventParamAEEventID = keyAEEventID,
57151   kEventParamAEEventClass = keyAEEventClass,
57152   kEventParamCGContextRef = 'cntx',
57153   kEventParamDeviceDepth = 'devd',
57154   kEventParamDeviceColor = 'devc',
57155   kEventParamMutableArray = 'marr',
57156   kEventParamResult = 'ansr',
57157   kEventParamMinimumSize = 'mnsz',
57158   kEventParamMaximumSize = 'mxsz',
57159   typeWindowRef = 'wind',
57160   typeGrafPtr = 'graf',
57161   typeGWorldPtr = 'gwld',
57162   typeDragRef = 'drag',
57163   typeMenuRef = 'menu',
57164   typeControlRef = 'ctrl',
57165   typeCollection = 'cltn',
57166   typeQDRgnHandle = 'rgnh',
57167   typeOSStatus = 'osst',
57168   typeCFStringRef = 'cfst',
57169   typeCFMutableStringRef = 'cfms',
57170   typeCFIndex = 'cfix',
57171   typeCFTypeRef = 'cfty',
57172   typeCGContextRef = 'cntx',
57173   typeHIPoint = 'hipt',
57174   typeHISize = 'hisz',
57175   typeHIRect = 'hirc',
57176   typeVoidPtr = 'void'
57177 };
57178
57179
57180
57181 enum {
57182   kEventParamMouseLocation = 'mloc',
57183   kEventParamWindowMouseLocation = 'wmou',
57184   kEventParamMouseButton = 'mbtn',
57185   kEventParamClickCount = 'ccnt',
57186   kEventParamMouseWheelAxis = 'mwax',
57187   kEventParamMouseWheelDelta = 'mwdl',
57188   kEventParamMouseDelta = 'mdta',
57189   kEventParamMouseChord = 'chor',
57190   kEventParamTabletEventType = 'tblt',
57191   kEventParamMouseTrackingRef = 'mtrf',
57192   typeMouseButton = 'mbtn',
57193   typeMouseWheelAxis = 'mwax',
57194   typeMouseTrackingRef = 'mtrf'
57195 };
57196
57197
57198
57199 enum {
57200   kEventParamKeyCode = 'kcod',
57201   kEventParamKeyMacCharCodes = 'kchr',
57202   kEventParamKeyModifiers = 'kmod',
57203   kEventParamKeyUnicodes = 'kuni',
57204   kEventParamKeyboardType = 'kbdt',
57205   typeEventHotKeyID = 'hkid'
57206 };
57207
57208
57209
57210 enum {
57211   kEventParamTextInputSendRefCon = 'tsrc',
57212   kEventParamTextInputSendComponentInstance = 'tsci',
57213   kEventParamTextInputSendSLRec = 'tssl',
57214   kEventParamTextInputReplySLRec = 'trsl',
57215   kEventParamTextInputSendText = 'tstx',
57216   kEventParamTextInputReplyText = 'trtx',
57217   kEventParamTextInputSendUpdateRng = 'tsup',
57218   kEventParamTextInputSendHiliteRng = 'tshi',
57219   kEventParamTextInputSendClauseRng = 'tscl',
57220   kEventParamTextInputSendPinRng = 'tspn',
57221   kEventParamTextInputSendFixLen = 'tsfx',
57222   kEventParamTextInputSendLeadingEdge = 'tsle',
57223   kEventParamTextInputReplyLeadingEdge = 'trle',
57224   kEventParamTextInputSendTextOffset = 'tsto',
57225   kEventParamTextInputReplyTextOffset = 'trto',
57226   kEventParamTextInputReplyRegionClass = 'trrg',
57227   kEventParamTextInputSendCurrentPoint = 'tscp',
57228   kEventParamTextInputSendDraggingMode = 'tsdm',
57229   kEventParamTextInputReplyPoint = 'trpt',
57230   kEventParamTextInputReplyFont = 'trft',
57231   kEventParamTextInputReplyFMFont = 'trfm',
57232   kEventParamTextInputReplyPointSize = 'trpz',
57233   kEventParamTextInputReplyLineHeight = 'trlh',
57234   kEventParamTextInputReplyLineAscent = 'trla',
57235   kEventParamTextInputReplyTextAngle = 'trta',
57236   kEventParamTextInputSendShowHide = 'tssh',
57237   kEventParamTextInputReplyShowHide = 'trsh',
57238   kEventParamTextInputSendKeyboardEvent = 'tske',
57239   kEventParamTextInputSendTextServiceEncoding = 'tsse',
57240   kEventParamTextInputSendTextServiceMacEncoding = 'tssm',
57241   kEventParamTextInputGlyphInfoArray = 'glph'
57242 };
57243
57244
57245
57246 enum {
57247   kEventParamHICommand = 'hcmd',
57248   typeHICommand = 'hcmd'
57249 };
57250
57251
57252
57253 enum {
57254   kEventParamWindowFeatures = 'wftr',
57255   kEventParamWindowDefPart = 'wdpc',
57256   kEventParamCurrentBounds = 'crct',
57257   kEventParamOriginalBounds = 'orct',
57258   kEventParamPreviousBounds = 'prct',
57259   kEventParamClickActivation = 'clac',
57260   kEventParamWindowRegionCode = 'wshp',
57261   kEventParamWindowDragHiliteFlag = 'wdhf',
57262   kEventParamWindowModifiedFlag = 'wmff',
57263   kEventParamWindowProxyGWorldPtr = 'wpgw',
57264   kEventParamWindowProxyImageRgn = 'wpir',
57265   kEventParamWindowProxyOutlineRgn = 'wpor',
57266   kEventParamWindowStateChangedFlags = 'wscf',
57267   kEventParamWindowTitleFullWidth = 'wtfw',
57268   kEventParamWindowTitleTextWidth = 'wttw',
57269   kEventParamWindowGrowRect = 'grct',
57270   kEventParamAttributes = 'attr',
57271   kEventParamPreviousDockRect = 'pdrc',
57272   kEventParamCurrentDockRect = 'cdrc',
57273   typeWindowRegionCode = 'wshp',
57274   typeWindowDefPartCode = 'wdpt',
57275   typeClickActivationResult = 'clac'
57276 };
57277
57278
57279
57280 enum {
57281   kEventParamControlPart = 'cprt',
57282   kEventParamInitCollection = 'icol',
57283   kEventParamControlMessage = 'cmsg',
57284   kEventParamControlParam = 'cprm',
57285   kEventParamControlResult = 'crsl',
57286   kEventParamControlRegion = 'crgn',
57287   kEventParamControlAction = 'caup',
57288   kEventParamControlIndicatorDragConstraint = 'cidc',
57289   kEventParamControlIndicatorRegion = 'cirn',
57290   kEventParamControlIsGhosting = 'cgst',
57291   kEventParamControlIndicatorOffset = 'ciof',
57292   kEventParamControlClickActivationResult = 'ccar',
57293   kEventParamControlSubControl = 'csub',
57294   kEventParamControlOptimalBounds = 'cobn',
57295   kEventParamControlOptimalBaselineOffset = 'cobo',
57296   kEventParamControlDataTag = 'cdtg',
57297   kEventParamControlDataBuffer = 'cdbf',
57298   kEventParamControlDataBufferSize = 'cdbs',
57299   kEventParamControlDrawDepth = 'cddp',
57300   kEventParamControlDrawInColor = 'cdic',
57301   kEventParamControlFeatures = 'cftr',
57302   kEventParamControlPartBounds = 'cpbd',
57303   kEventParamControlOriginalOwningWindow = 'coow',
57304   kEventParamControlCurrentOwningWindow = 'ccow',
57305   kEventParamControlFocusEverything = 'cfev',
57306   kEventParamNextControl = 'cnxc',
57307   kEventParamStartControl = 'cstc',
57308   kEventParamControlSubview = 'csvw',
57309   kEventParamControlPreviousPart = 'copc',
57310   kEventParamControlCurrentPart = 'cnpc',
57311   kEventParamControlInvalRgn = 'civr',
57312   kEventParamControlValue = 'cval',
57313   typeControlActionUPP = 'caup',
57314   typeIndicatorDragConstraint = 'cidc',
57315   typeControlPartCode = 'cprt'
57316 };
57317
57318
57319
57320 enum {
57321   kEventParamCurrentMenuTrackingMode = 'cmtm',
57322   kEventParamNewMenuTrackingMode = 'nmtm',
57323   kEventParamMenuFirstOpen = '1sto',
57324   kEventParamMenuItemIndex = 'item',
57325   kEventParamMenuCommand = 'mcmd',
57326   kEventParamEnableMenuForKeyEvent = 'fork',
57327   kEventParamMenuEventOptions = 'meop',
57328   kEventParamMenuContext = 'mctx',
57329   kEventParamMenuItemBounds = 'mitb',
57330   kEventParamMenuMarkBounds = 'mmkb',
57331   kEventParamMenuIconBounds = 'micb',
57332   kEventParamMenuTextBounds = 'mtxb',
57333   kEventParamMenuTextBaseline = 'mtbl',
57334   kEventParamMenuCommandKeyBounds = 'mcmb',
57335   kEventParamMenuVirtualTop = 'mvrt',
57336   kEventParamMenuVirtualBottom = 'mvrb',
57337   kEventParamMenuDrawState = 'mdrs',
57338   kEventParamMenuItemType = 'mitp',
57339   kEventParamMenuItemWidth = 'mitw',
57340   kEventParamMenuItemHeight = 'mith',
57341   typeMenuItemIndex = 'midx',
57342   typeMenuCommand = 'mcmd',
57343   typeMenuTrackingMode = 'mtmd',
57344   typeMenuEventOptions = 'meop',
57345   typeThemeMenuState = 'tmns',
57346   typeThemeMenuItemType = 'tmit'
57347 };
57348
57349
57350
57351 enum {
57352   kEventParamProcessID = 'psn ',
57353   kEventParamLaunchRefCon = 'lref',
57354   kEventParamLaunchErr = 'err ',
57355   kEventParamSystemUIMode = 'uimd'
57356 };
57357
57358
57359
57360 enum {
57361   kEventParamTabletPointRec = 'tbrc',
57362   kEventParamTabletProximityRec = 'tbpx',
57363   typeTabletPointRec = 'tbrc',
57364   typeTabletProximityRec = 'tbpx',
57365   kEventParamTabletPointerRec = 'tbrc',
57366   typeTabletPointerRec = 'tbrc'
57367 };
57368
57369
57370
57371 enum {
57372   kEventParamNewScrollBarVariant = 'nsbv'
57373 };
57374
57375
57376
57377 enum {
57378   kEventParamScrapRef = 'scrp',
57379   kEventParamServiceCopyTypes = 'svsd',
57380   kEventParamServicePasteTypes = 'svpt',
57381   kEventParamServiceMessageName = 'svmg',
57382   kEventParamServiceUserData = 'svud',
57383   typeScrapRef = 'scrp',
57384   typeCFMutableArrayRef = 'cfma'
57385 };
57386
57387
57388
57389 enum {
57390   kEventParamToolbar = 'tbar',
57391   kEventParamToolbarItem = 'tbit',
57392   kEventParamToolbarItemIdentifier = 'tbii',
57393   kEventParamToolbarItemConfigData = 'tbid',
57394   typeHIToolbarRef = 'tbar',
57395   typeHIToolbarItemRef = 'tbit'
57396 };
57397
57398
57399
57400 enum {
57401   kEventParamAccessibleObject = 'aobj',
57402   kEventParamAccessibleChild = 'achl',
57403   kEventParamAccessibleAttributeName = 'atnm',
57404   kEventParamAccessibleAttributeNames = 'atns',
57405   kEventParamAccessibleAttributeValue = 'atvl',
57406   kEventParamAccessibleAttributeSettable = 'atst',
57407   kEventParamAccessibleActionName = 'acnm',
57408   kEventParamAccessibleActionNames = 'acns',
57409   kEventParamAccessibleActionDescription = 'acds'
57410 };
57411 extern EventTargetRef
57412 GetWindowEventTarget(WindowRef inWindow) ;
57413 extern EventTargetRef
57414 GetControlEventTarget(ControlRef inControl) ;
57415 extern EventTargetRef
57416 GetMenuEventTarget(MenuRef inMenu) ;
57417 extern EventTargetRef
57418 GetApplicationEventTarget(void) ;
57419 extern EventTargetRef
57420 GetUserFocusEventTarget(void) ;
57421 extern EventTargetRef
57422 GetEventDispatcherTarget(void) ;
57423 typedef struct OpaqueToolboxObjectClassRef* ToolboxObjectClassRef;
57424 extern OSStatus
57425 RegisterToolboxObjectClass(
57426   CFStringRef inClassID,
57427   ToolboxObjectClassRef inBaseClass,
57428   UInt32 inNumEvents,
57429   const EventTypeSpec * inEventList,
57430   EventHandlerUPP inEventHandler,
57431   void * inEventHandlerData,
57432   ToolboxObjectClassRef * outClassRef) ;
57433 extern OSStatus
57434 UnregisterToolboxObjectClass(ToolboxObjectClassRef inClassRef) ;
57435 extern OSStatus
57436 ProcessHICommand(const HICommand * inCommand) ;
57437 extern void
57438 RunApplicationEventLoop(void) ;
57439 extern void
57440 QuitApplicationEventLoop(void) ;
57441 extern OSStatus
57442 RunAppModalLoopForWindow(WindowRef inWindow) ;
57443 extern OSStatus
57444 QuitAppModalLoopForWindow(WindowRef inWindow) ;
57445 extern OSStatus
57446 BeginAppModalStateForWindow(WindowRef inWindow) ;
57447 extern OSStatus
57448 EndAppModalStateForWindow(WindowRef inWindow) ;
57449 extern OSStatus
57450 SetUserFocusWindow(WindowRef inWindow) ;
57451 extern WindowRef
57452 GetUserFocusWindow(void) ;
57453 extern OSStatus
57454 SetWindowDefaultButton(
57455   WindowRef inWindow,
57456   ControlRef inControl) ;
57457 extern OSStatus
57458 SetWindowCancelButton(
57459   WindowRef inWindow,
57460   ControlRef inControl) ;
57461 extern OSStatus
57462 GetWindowDefaultButton(
57463   WindowRef inWindow,
57464   ControlRef * outControl) ;
57465 extern OSStatus
57466 GetWindowCancelButton(
57467   WindowRef inWindow,
57468   ControlRef * outControl) ;
57469
57470
57471
57472
57473
57474
57475 struct EventHotKeyID {
57476   OSType signature;
57477   UInt32 id;
57478 };
57479 typedef struct EventHotKeyID EventHotKeyID;
57480 typedef struct OpaqueEventHotKeyRef* EventHotKeyRef;
57481 extern OSStatus
57482 RegisterEventHotKey(
57483   UInt32 inHotKeyCode,
57484   UInt32 inHotKeyModifiers,
57485   EventHotKeyID inHotKeyID,
57486   EventTargetRef inTarget,
57487   OptionBits inOptions,
57488   EventHotKeyRef * outRef) ;
57489 extern OSStatus
57490 UnregisterEventHotKey(EventHotKeyRef inHotKey) ;
57491 typedef struct OpaqueMouseTrackingRef* MouseTrackingRef;
57492 typedef UInt32 MouseTrackingOptions;
57493 enum {
57494
57495
57496
57497
57498
57499   kMouseTrackingOptionsLocalClip = 0,
57500
57501
57502
57503
57504
57505   kMouseTrackingOptionsGlobalClip = 1,
57506
57507
57508
57509
57510
57511   kMouseTrackingOptionsStandard = kMouseTrackingOptionsLocalClip
57512 };
57513
57514 struct MouseTrackingRegionID {
57515   OSType signature;
57516   SInt32 id;
57517 };
57518 typedef struct MouseTrackingRegionID MouseTrackingRegionID;
57519 extern OSStatus
57520 CreateMouseTrackingRegion(
57521   WindowRef inWindow,
57522   RgnHandle inRegion,
57523   RgnHandle inClip,
57524   MouseTrackingOptions inOptions,
57525   MouseTrackingRegionID inID,
57526   void * inRefCon,
57527   EventTargetRef inTargetToNotify,
57528   MouseTrackingRef * outTrackingRef) ;
57529 extern OSStatus
57530 RetainMouseTrackingRegion(MouseTrackingRef inMouseRef) ;
57531 extern OSStatus
57532 ReleaseMouseTrackingRegion(MouseTrackingRef inMouseRef) ;
57533 extern OSStatus
57534 ChangeMouseTrackingRegion(
57535   MouseTrackingRef inMouseRef,
57536   RgnHandle inRegion,
57537   RgnHandle inClip) ;
57538 extern OSStatus
57539 ClipMouseTrackingRegion(
57540   MouseTrackingRef inMouseRef,
57541   RgnHandle inRegion) ;
57542 extern OSStatus
57543 GetMouseTrackingRegionID(
57544   MouseTrackingRef inMouseRef,
57545   MouseTrackingRegionID * outID) ;
57546 extern OSStatus
57547 GetMouseTrackingRegionRefCon(
57548   MouseTrackingRef inMouseRef,
57549   void ** outRefCon) ;
57550 extern OSStatus
57551 MoveMouseTrackingRegion(
57552   MouseTrackingRef inMouseRef,
57553   SInt16 deltaH,
57554   SInt16 deltaV,
57555   RgnHandle inClip) ;
57556 extern OSStatus
57557 SetMouseTrackingRegionEnabled(
57558   MouseTrackingRef inMouseRef,
57559   Boolean inEnabled) ;
57560 extern OSStatus
57561 ClipWindowMouseTrackingRegions(
57562   WindowRef inWindow,
57563   OSType inSignature,
57564   RgnHandle inClip) ;
57565 extern OSStatus
57566 MoveWindowMouseTrackingRegions(
57567   WindowRef inWindow,
57568   OSType inSignature,
57569   SInt16 deltaH,
57570   SInt16 deltaV,
57571   RgnHandle inClip) ;
57572 extern OSStatus
57573 SetWindowMouseTrackingRegionsEnabled(
57574   WindowRef inWindow,
57575   OSType inSignature,
57576   Boolean inEnabled) ;
57577 extern OSStatus
57578 ReleaseWindowMouseTrackingRegions(
57579   WindowRef inWindow,
57580   OSType inSignature) ;
57581
57582
57583
57584
57585
57586
57587 enum {
57588   kEventWindowDefDrawFrame = kEventWindowDrawFrame,
57589   kEventWindowDefDrawPart = kEventWindowDrawPart,
57590   kEventWindowDefGetRegion = kEventWindowGetRegion,
57591   kEventWindowDefHitTest = kEventWindowHitTest,
57592   kEventWindowDefInit = kEventWindowInit,
57593   kEventWindowDefDispose = kEventWindowDispose,
57594   kEventWindowDefDragHilite = kEventWindowDragHilite,
57595   kEventWindowDefModified = kEventWindowModified,
57596   kEventWindowDefSetupProxyDragImage = kEventWindowSetupProxyDragImage,
57597   kEventWindowDefStateChanged = kEventWindowStateChanged,
57598   kEventWindowDefMeasureTitle = kEventWindowMeasureTitle,
57599   kEventWindowDefDrawGrowBox = kEventWindowDrawGrowBox,
57600   kEventWindowDefGetGrowImageRegion = kEventWindowGetGrowImageRegion
57601 };
57602
57603
57604 enum {
57605   kEventClassEPPC = kEventClassAppleEvent,
57606   kEventHighLevelEvent = kEventAppleEvent
57607 };
57608
57609 enum {
57610   kEventUpdateActiveInputArea = kEventTextInputUpdateActiveInputArea,
57611   kEventUnicodeForKeyEvent = kEventTextInputUnicodeForKeyEvent,
57612   kEventOffsetToPos = kEventTextInputOffsetToPos,
57613   kEventPosToOffset = kEventTextInputPosToOffset,
57614   kEventShowHideBottomWindow = kEventTextInputShowHideBottomWindow,
57615   kEventGetSelectedText = kEventTextInputGetSelectedText
57616 };
57617
57618
57619
57620
57621
57622 typedef UInt32 EventClassID;
57623 typedef UInt32 EventClass;
57624 typedef UInt32 EventType;
57625
57626
57627
57628 enum {
57629   kMouseTrackingMousePressed = kMouseTrackingMouseDown,
57630   kMouseTrackingMouseReleased = kMouseTrackingMouseUp
57631 };
57632
57633 enum {
57634   kEventControlGetSubviewForMouseEvent = kEventControlInterceptSubviewClick
57635 };
57636
57637
57638
57639
57640 }
57641 extern "C" {
57642
57643
57644
57645 typedef ControlRef HIViewRef;
57646 typedef ControlID HIViewID;
57647 typedef ControlPartCode HIViewPartCode;
57648 extern const HIViewID kHIViewWindowContentID;
57649 extern const HIViewID kHIViewWindowGrowBoxID;
57650
57651
57652
57653
57654
57655
57656 enum {
57657
57658
57659
57660
57661   kHIViewZOrderAbove = 1,
57662
57663
57664
57665
57666   kHIViewZOrderBelow = 2
57667 };
57668
57669 typedef UInt32 HIViewZOrderOp;
57670 enum {
57671
57672
57673
57674
57675
57676
57677
57678   kHIViewSendCommandToUserFocus = (1 << 0)
57679 };
57680 extern HIViewRef
57681 HIViewGetRoot(WindowRef inWindow) ;
57682 extern OSStatus
57683 HIViewAddSubview(
57684   HIViewRef inParent,
57685   HIViewRef inNewChild) ;
57686 extern OSStatus
57687 HIViewRemoveFromSuperview(HIViewRef inView) ;
57688 extern HIViewRef
57689 HIViewGetSuperview(HIViewRef inView) ;
57690 extern HIViewRef
57691 HIViewGetFirstSubview(HIViewRef inView) ;
57692 extern HIViewRef
57693 HIViewGetLastSubview(HIViewRef inView) ;
57694 extern HIViewRef
57695 HIViewGetNextView(HIViewRef inView) ;
57696 extern HIViewRef
57697 HIViewGetPreviousView(HIViewRef inView) ;
57698 extern OSStatus
57699 HIViewSetZOrder(
57700   HIViewRef inView,
57701   HIViewZOrderOp inOp,
57702   HIViewRef inOther) ;
57703 extern OSStatus
57704 HIViewSetVisible(
57705   HIViewRef inView,
57706   Boolean inVisible) ;
57707 extern Boolean
57708 HIViewIsVisible(HIViewRef inView) ;
57709 extern OSStatus
57710 HIViewGetBounds(
57711   HIViewRef inView,
57712   HIRect * outRect) ;
57713 extern OSStatus
57714 HIViewGetFrame(
57715   HIViewRef inView,
57716   HIRect * outRect) ;
57717 extern OSStatus
57718 HIViewSetFrame(
57719   HIViewRef inView,
57720   const HIRect * inRect) ;
57721 extern OSStatus
57722 HIViewMoveBy(
57723   HIViewRef inView,
57724   float inDX,
57725   float inDY) ;
57726 extern OSStatus
57727 HIViewPlaceInSuperviewAt(
57728   HIViewRef inView,
57729   float inX,
57730   float inY) ;
57731 extern OSStatus
57732 HIViewReshapeStructure(HIViewRef inView) ;
57733 extern OSStatus
57734 HIViewGetViewForMouseEvent(
57735   HIViewRef inView,
57736   EventRef inEvent,
57737   HIViewRef * outView) ;
57738 extern OSStatus
57739 HIViewClick(
57740   HIViewRef inView,
57741   EventRef inEvent) ;
57742 extern OSStatus
57743 HIViewSimulateClick(
57744   HIViewRef inView,
57745   HIViewPartCode inPartToClick,
57746   UInt32 inModifiers,
57747   ControlPartCode * outPartClicked) ;
57748 extern OSStatus
57749 HIViewGetPartHit(
57750   HIViewRef inView,
57751   const HIPoint * inPoint,
57752   HIViewPartCode * outPart) ;
57753 extern OSStatus
57754 HIViewGetSubviewHit(
57755   HIViewRef inView,
57756   const HIPoint * inPoint,
57757   Boolean inDeep,
57758   HIViewRef * outView) ;
57759 extern Boolean
57760 HIViewGetNeedsDisplay(HIViewRef inView) ;
57761 extern OSStatus
57762 HIViewSetNeedsDisplay(
57763   HIViewRef inView,
57764   Boolean inNeedsDisplay) ;
57765 extern OSStatus
57766 HIViewSetNeedsDisplayInRegion(
57767   HIViewRef inView,
57768   RgnHandle inRgn,
57769   Boolean inNeedsDisplay) ;
57770 extern OSStatus
57771 HIViewFlashDirtyArea(WindowRef inWindow) ;
57772 extern OSStatus
57773 HIViewGetSizeConstraints(
57774   HIViewRef inView,
57775   HISize * outMinSize,
57776   HISize * outMaxSize) ;
57777 extern OSStatus
57778 HIViewConvertPoint(
57779   HIPoint * ioPoint,
57780   HIViewRef inSourceView,
57781   HIViewRef inDestView) ;
57782 extern OSStatus
57783 HIViewConvertRect(
57784   HIRect * ioRect,
57785   HIViewRef inSourceView,
57786   HIViewRef inDestView) ;
57787 extern OSStatus
57788 HIViewConvertRegion(
57789   RgnHandle ioRgn,
57790   HIViewRef inSourceView,
57791   HIViewRef inDestView) ;
57792 extern OSStatus
57793 HIViewSetDrawingEnabled(
57794   HIViewRef inView,
57795   Boolean inEnabled) ;
57796 extern Boolean
57797 HIViewIsDrawingEnabled(HIViewRef inView) ;
57798 extern OSStatus
57799 HIViewScrollRect(
57800   HIViewRef inView,
57801   const HIRect * inRect,
57802   float inDX,
57803   float inDY) ;
57804 extern OSStatus
57805 HIViewSetBoundsOrigin(
57806   HIViewRef inView,
57807   float inX,
57808   float inY) ;
57809 extern OSStatus
57810 HIViewAdvanceFocus(
57811   HIViewRef inRootForFocus,
57812   EventModifiers inModifiers) ;
57813 extern OSStatus
57814 HIViewGetFocusPart(
57815   HIViewRef inView,
57816   HIViewPartCode * outFocusPart) ;
57817 extern Boolean
57818 HIViewSubtreeContainsFocus(HIViewRef inSubtreeStart) ;
57819 extern OSStatus
57820 HIViewSetNextFocus(
57821   HIViewRef inView,
57822   HIViewRef inNextFocus) ;
57823 extern OSStatus
57824 HIViewSetFirstSubViewFocus(
57825   HIViewRef inParent,
57826   HIViewRef inSubView) ;
57827 extern OSStatus
57828 HIViewFindByID(
57829   HIViewRef inStartView,
57830   HIViewID inID,
57831   HIViewRef * outControl) ;
57832 extern OSStatus
57833 HIViewGetAttributes(
57834   HIViewRef inView,
57835   OptionBits * outAttrs) ;
57836 extern OSStatus
57837 HIViewChangeAttributes(
57838   HIViewRef inView,
57839   OptionBits inAttrsToSet,
57840   OptionBits inAttrsToClear) ;
57841 extern OSStatus
57842 HIViewCreateOffscreenImage(
57843   HIViewRef inView,
57844   OptionBits inOptions,
57845   HIRect * outFrame,
57846   CGImageRef * outImage) ;
57847 extern OSStatus
57848 HIViewDrawCGImage(
57849   CGContextRef inContext,
57850   const HIRect * inBounds,
57851   CGImageRef inImage) ;
57852 extern OSStatus
57853 HIGrowBoxViewSetTransparent(
57854   HIViewRef inGrowBoxView,
57855   Boolean inTransparent) ;
57856 extern Boolean
57857 HIGrowBoxViewIsTransparent(HIViewRef inGrowBoxView) ;
57858
57859
57860
57861
57862
57863
57864 enum {
57865   kEventClassScrollable = 'scrl'
57866 };
57867
57868 enum {
57869   kEventScrollableGetInfo = 1,
57870   kEventScrollableInfoChanged = 2,
57871   kEventScrollableScrollTo = 10
57872 };
57873
57874 enum {
57875   kEventParamImageSize = 'imsz',
57876   kEventParamViewSize = 'vwsz',
57877   kEventParamLineSize = 'lnsz',
57878   kEventParamOrigin = 'orgn'
57879 };
57880
57881
57882
57883
57884
57885
57886 enum {
57887
57888
57889
57890
57891   kHIScrollViewOptionsVertScroll = (1 << 0),
57892
57893
57894
57895
57896   kHIScrollViewOptionsHorizScroll = (1 << 1),
57897
57898
57899
57900
57901
57902
57903   kHIScrollViewOptionsAllowGrow = (1 << 2),
57904   kHIScrollViewValidOptions = (kHIScrollViewOptionsVertScroll | kHIScrollViewOptionsHorizScroll | kHIScrollViewOptionsAllowGrow)
57905 };
57906 extern OSStatus
57907 HIScrollViewCreate(
57908   OptionBits inOptions,
57909   HIViewRef * outView) ;
57910 extern OSStatus
57911 HIScrollViewSetScrollBarAutoHide(
57912   HIViewRef inView,
57913   Boolean inAutoHide) ;
57914 extern Boolean
57915 HIScrollViewGetScrollBarAutoHide(HIViewRef inView) ;
57916 extern OSStatus
57917 HIImageViewCreate(
57918   CGImageRef inImage,
57919   ControlRef * outControl) ;
57920
57921
57922 enum {
57923   kHIImageViewImageTag = 'imag'
57924 };
57925 extern OSStatus
57926 HIImageViewSetOpaque(
57927   HIViewRef inView,
57928   Boolean inOpaque) ;
57929 extern Boolean
57930 HIImageViewIsOpaque(HIViewRef inView) ;
57931 extern OSStatus
57932 HIImageViewSetAlpha(
57933   HIViewRef inView,
57934   float inAlpha) ;
57935 extern float
57936 HIImageViewGetAlpha(HIViewRef inView) ;
57937 extern OSStatus
57938 HIImageViewSetScaleToFit(
57939   HIViewRef inView,
57940   Boolean inScaleToFit) ;
57941 extern Boolean
57942 HIImageViewGetScaleToFit(HIViewRef inView) ;
57943 extern OSStatus
57944 HIImageViewSetImage(
57945   HIViewRef inView,
57946   CGImageRef inImage) ;
57947 extern CGImageRef
57948 HIImageViewCopyImage(HIViewRef inView) ;
57949 enum {
57950
57951
57952
57953
57954   kHIComboBoxNoAttributes = 0L,
57955
57956
57957
57958
57959
57960
57961   kHIComboBoxAutoCompletionAttribute = (1L << 0),
57962
57963
57964
57965
57966
57967   kHIComboBoxAutoDisclosureAttribute = (1L << 1),
57968
57969
57970
57971
57972
57973   kHIComboBoxAutoSortAttribute = (1L << 2),
57974
57975
57976
57977
57978
57979   kHIComboBoxAutoSizeListAttribute = (1L << 3),
57980
57981
57982
57983
57984   kHIComboBoxStandardAttributes = (kHIComboBoxAutoCompletionAttribute | kHIComboBoxAutoDisclosureAttribute | kHIComboBoxAutoSizeListAttribute)
57985 };
57986
57987
57988 enum {
57989   kControlKindHIComboBox = 'cbbx'
57990 };
57991
57992
57993 enum {
57994   kHIComboBoxEditTextPart = 5,
57995   kHIComboBoxDisclosurePart = 28
57996 };
57997
57998
57999
58000
58001
58002
58003 enum {
58004
58005
58006
58007
58008
58009
58010
58011   kHIComboBoxListTag = 'cbls',
58012
58013
58014
58015
58016
58017   kHIComboBoxListPixelWidthTag = 'cblw',
58018
58019
58020
58021
58022
58023   kHIComboBoxListPixelHeightTag = 'cblh',
58024
58025
58026
58027
58028
58029   kHIComboBoxNumVisibleItemsTag = 'cbni'
58030 };
58031 extern OSStatus
58032 HIComboBoxCreate(
58033   const HIRect * boundsRect,
58034   CFStringRef text,
58035   const ControlFontStyleRec * style,
58036   CFArrayRef list,
58037   OptionBits inAttributes,
58038   HIViewRef * outComboBox) ;
58039 extern ItemCount
58040 HIComboBoxGetItemCount(HIViewRef inComboBox) ;
58041 extern OSStatus
58042 HIComboBoxInsertTextItemAtIndex(
58043   HIViewRef inComboBox,
58044   CFIndex inIndex,
58045   CFStringRef inText) ;
58046 extern OSStatus
58047 HIComboBoxAppendTextItem(
58048   HIViewRef inComboBox,
58049   CFStringRef inText,
58050   CFIndex * outIndex) ;
58051 extern OSStatus
58052 HIComboBoxCopyTextItemAtIndex(
58053   HIViewRef inComboBox,
58054   CFIndex inIndex,
58055   CFStringRef * outString) ;
58056 extern OSStatus
58057 HIComboBoxRemoveItemAtIndex(
58058   HIViewRef inComboBox,
58059   CFIndex inIndex) ;
58060 extern OSStatus
58061 HIComboBoxChangeAttributes(
58062   HIViewRef inComboBox,
58063   OptionBits inAttributesToSet,
58064   OptionBits inAttributesToClear) ;
58065 extern OSStatus
58066 HIComboBoxGetAttributes(
58067   HIViewRef inComboBox,
58068   OptionBits * outAttributes) ;
58069
58070
58071
58072
58073
58074 }
58075
58076
58077
58078 extern "C" {
58079 extern OSStatus
58080 GetTextAndEncodingFromCFString(
58081   CFStringRef inString,
58082   BytePtr outText,
58083   ByteCount inTextMaxLength,
58084   ByteCount * outTextLength,
58085   TextEncoding * outEncoding) ;
58086
58087
58088
58089
58090 }
58091
58092
58093
58094 extern "C" {
58095 typedef const struct __HIShape* HIShapeRef;
58096 typedef struct __HIShape* HIMutableShapeRef;
58097 extern CFTypeID
58098 HIShapeGetTypeID(void) ;
58099 extern HIShapeRef
58100 HIShapeCreateWithQDRgn(RgnHandle inRgn) ;
58101 extern HIShapeRef
58102 HIShapeCreateWithRect(const HIRect * inRect) ;
58103 extern HIShapeRef
58104 HIShapeCreateCopy(HIShapeRef inShape) ;
58105 extern HIShapeRef
58106 HIShapeCreateIntersection(
58107   HIShapeRef inShape1,
58108   HIShapeRef inShape2) ;
58109 extern HIShapeRef
58110 HIShapeCreateDifference(
58111   HIShapeRef inShape1,
58112   HIShapeRef inShape2) ;
58113 extern HIShapeRef
58114 HIShapeCreateUnion(
58115   HIShapeRef inShape1,
58116   HIShapeRef inShape2) ;
58117 extern Boolean
58118 HIShapeIsEmpty(HIShapeRef inShape) ;
58119 extern Boolean
58120 HIShapeIsRectangular(HIShapeRef inShape) ;
58121 extern Boolean
58122 HIShapeContainsPoint(
58123   HIShapeRef inShape,
58124   const HIPoint * inPoint) ;
58125 extern HIRect *
58126 HIShapeGetBounds(
58127   HIShapeRef inShape,
58128   HIRect * outRect) ;
58129 extern OSStatus
58130 HIShapeGetAsQDRgn(
58131   HIShapeRef inShape,
58132   RgnHandle outRgn) ;
58133 extern OSStatus
58134 HIShapeReplacePathInCGContext(
58135   HIShapeRef inShape,
58136   CGContextRef inContext) ;
58137 extern OSStatus
58138 HIShapeSetQDClip(
58139   HIShapeRef inShape,
58140   CGrafPtr inPort) ;
58141 extern HIMutableShapeRef
58142 HIShapeCreateMutable(void) ;
58143 extern HIMutableShapeRef
58144 HIShapeCreateMutableCopy(HIShapeRef inOrig) ;
58145 extern OSStatus
58146 HIShapeSetEmpty(HIMutableShapeRef inShape) ;
58147 extern OSStatus
58148 HIShapeIntersect(
58149   HIShapeRef inShape1,
58150   HIShapeRef inShape2,
58151   HIMutableShapeRef outResult) ;
58152 extern OSStatus
58153 HIShapeDifference(
58154   HIShapeRef inShape1,
58155   HIShapeRef inShape2,
58156   HIMutableShapeRef outResult) ;
58157 extern OSStatus
58158 HIShapeUnion(
58159   HIShapeRef inShape1,
58160   HIShapeRef inShape2,
58161   HIMutableShapeRef outResult) ;
58162 extern OSStatus
58163 HIShapeOffset(
58164   HIMutableShapeRef inShape,
58165   float inDX,
58166   float inDY) ;
58167
58168
58169
58170
58171
58172 }
58173
58174
58175
58176 extern "C" {
58177
58178
58179
58180
58181
58182
58183
58184
58185
58186 typedef SInt16 BalloonVariant;
58187 enum {
58188   kTopLeftTipPointsLeftVariant = 0,
58189   kTopLeftTipPointsUpVariant = 1,
58190   kTopRightTipPointsUpVariant = 2,
58191   kTopRightTipPointsRightVariant = 3,
58192   kBottomRightTipPointsRightVariant = 4,
58193   kBottomRightTipPointsDownVariant = 5,
58194   kBottomLeftTipPointsDownVariant = 6,
58195   kBottomLeftTipPointsLeftVariant = 7,
58196   kBalloonVariantCount = 8
58197 };
58198
58199
58200 enum {
58201   hmBalloonHelpVersion = 0x0002
58202 };
58203
58204 enum {
58205   kHMHelpMenuID = -16490,
58206   kHMAboutHelpItem = 1,
58207   kHMShowBalloonsItem = 3
58208 };
58209
58210 enum {
58211   kHMHelpID = -5696,
58212   kBalloonWDEFID = 126
58213 };
58214
58215 enum {
58216
58217   helpItem = 1
58218 };
58219
58220 enum {
58221
58222   hmDefaultOptions = 0,
58223   hmUseSubIDBit = 0,
58224   hmAbsoluteCoordsBit = 1,
58225   hmSaveBitsNoWindowBit = 2,
58226   hmSaveBitsWindowBit = 3,
58227   hmMatchInTitleBit = 4,
58228   hmUseSubIDMask = (1 << hmUseSubIDBit),
58229   hmAbsoluteCoordsMask = (1 << hmAbsoluteCoordsBit),
58230   hmSaveBitsNoWindowMask = (1 << hmSaveBitsNoWindowBit),
58231   hmSaveBitsWindowMask = (1 << hmSaveBitsWindowBit),
58232   hmMatchInTitleMask = (1 << hmMatchInTitleBit)
58233 };
58234 enum {
58235
58236   kHMStringItem = 1,
58237   kHMPictItem = 2,
58238   kHMStringResItem = 3,
58239   kHMTEResItem = 6,
58240   kHMSTRResItem = 7,
58241   kHMSkipItem = 256,
58242   kHMCompareItem = 512,
58243   kHMNamedResourceItem = 1024,
58244   kHMTrackCntlItem = 2048
58245 };
58246
58247 enum {
58248
58249   khmmString = 1,
58250   khmmPict = 2,
58251   khmmStringRes = 3,
58252   khmmTEHandle = 4,
58253   khmmPictHandle = 5,
58254   khmmTERes = 6,
58255   khmmSTRRes = 7,
58256   kHMEnabledItem = 0
58257 };
58258
58259 enum {
58260
58261   kHMTETextResType = 'TEXT',
58262   kHMTEStyleResType = 'styl'
58263 };
58264
58265 enum {
58266   kHMDisabledItem = 1,
58267   kHMCheckedItem = 2,
58268   kHMOtherItem = 3,
58269
58270   kHMRegularWindow = 0,
58271   kHMSaveBitsNoWindow = 1,
58272   kHMSaveBitsWindow = 2
58273 };
58274
58275 enum {
58276
58277   kHMMenuResType = 'hmnu',
58278   kHMDialogResType = 'hdlg',
58279   kHMWindListResType = 'hwin',
58280   kHMRectListResType = 'hrct',
58281   kHMOverrideResType = 'hovr',
58282   kHMFinderApplResType = 'hfdr'
58283 };
58284
58285 struct HMStringResType {
58286   short hmmResID;
58287   short hmmIndex;
58288 };
58289 typedef struct HMStringResType HMStringResType;
58290 struct HMMessageRecord {
58291   SInt16 hmmHelpType;
58292   union {
58293     Str255 hmmString;
58294     SInt16 hmmPict;
58295     TEHandle hmmTEHandle;
58296     HMStringResType hmmStringRes;
58297     SInt16 hmmPictRes;
58298     PicHandle hmmPictHandle;
58299     SInt16 hmmTERes;
58300     SInt16 hmmSTRRes;
58301   } u;
58302 };
58303 typedef struct HMMessageRecord HMMessageRecord;
58304 typedef HMMessageRecord * HMMessageRecPtr;
58305 typedef OSErr ( * TipFunctionProcPtr)(Point tip, RgnHandle structure, Rect *r, BalloonVariant *balloonVariant);
58306 typedef TipFunctionProcPtr TipFunctionUPP;
58307
58308
58309 }
58310
58311
58312
58313
58314
58315
58316
58317 extern "C" {
58318
58319
58320
58321 typedef struct NMRec NMRec;
58322 typedef NMRec * NMRecPtr;
58323 typedef void ( * NMProcPtr)(NMRecPtr nmReqPtr);
58324 typedef NMProcPtr NMUPP;
58325 struct NMRec {
58326   QElemPtr qLink;
58327   short qType;
58328   short nmFlags;
58329   long nmPrivate;
58330   short nmReserved;
58331   short nmMark;
58332   Handle nmIcon;
58333   Handle nmSound;
58334   StringPtr nmStr;
58335   NMUPP nmResp;
58336   long nmRefCon;
58337 };
58338 extern NMUPP
58339 NewNMUPP(NMProcPtr userRoutine) ;
58340 extern void
58341 DisposeNMUPP(NMUPP userUPP) ;
58342 extern void
58343 InvokeNMUPP(
58344   NMRecPtr nmReqPtr,
58345   NMUPP userUPP) ;
58346 extern OSErr
58347 NMInstall(NMRecPtr nmReqPtr) ;
58348 extern OSErr
58349 NMRemove(NMRecPtr nmReqPtr) ;
58350
58351
58352
58353
58354
58355
58356 }
58357 extern "C" {
58358
58359
58360
58361 enum {
58362   kAppearanceEventClass = 'appr',
58363   kAEAppearanceChanged = 'thme',
58364   kAESystemFontChanged = 'sysf',
58365   kAESmallSystemFontChanged = 'ssfn',
58366   kAEViewsFontChanged = 'vfnt'
58367 };
58368
58369
58370
58371
58372 enum {
58373   kThemeDataFileType = 'thme',
58374   kThemePlatinumFileType = 'pltn',
58375   kThemeCustomThemesFileType = 'scen',
58376   kThemeSoundTrackFileType = 'tsnd'
58377 };
58378 enum {
58379   kThemeBrushDialogBackgroundActive = 1,
58380   kThemeBrushDialogBackgroundInactive = 2,
58381   kThemeBrushAlertBackgroundActive = 3,
58382   kThemeBrushAlertBackgroundInactive = 4,
58383   kThemeBrushModelessDialogBackgroundActive = 5,
58384   kThemeBrushModelessDialogBackgroundInactive = 6,
58385   kThemeBrushUtilityWindowBackgroundActive = 7,
58386   kThemeBrushUtilityWindowBackgroundInactive = 8,
58387   kThemeBrushListViewSortColumnBackground = 9,
58388   kThemeBrushListViewBackground = 10,
58389   kThemeBrushIconLabelBackground = 11,
58390   kThemeBrushListViewSeparator = 12,
58391   kThemeBrushChasingArrows = 13,
58392   kThemeBrushDragHilite = 14,
58393   kThemeBrushDocumentWindowBackground = 15,
58394   kThemeBrushFinderWindowBackground = 16
58395 };
58396
58397
58398 enum {
58399   kThemeBrushScrollBarDelimiterActive = 17,
58400   kThemeBrushScrollBarDelimiterInactive = 18,
58401   kThemeBrushFocusHighlight = 19,
58402   kThemeBrushPopupArrowActive = 20,
58403   kThemeBrushPopupArrowPressed = 21,
58404   kThemeBrushPopupArrowInactive = 22,
58405   kThemeBrushAppleGuideCoachmark = 23,
58406   kThemeBrushIconLabelBackgroundSelected = 24,
58407   kThemeBrushStaticAreaFill = 25,
58408   kThemeBrushActiveAreaFill = 26,
58409   kThemeBrushButtonFrameActive = 27,
58410   kThemeBrushButtonFrameInactive = 28,
58411   kThemeBrushButtonFaceActive = 29,
58412   kThemeBrushButtonFaceInactive = 30,
58413   kThemeBrushButtonFacePressed = 31,
58414   kThemeBrushButtonActiveDarkShadow = 32,
58415   kThemeBrushButtonActiveDarkHighlight = 33,
58416   kThemeBrushButtonActiveLightShadow = 34,
58417   kThemeBrushButtonActiveLightHighlight = 35,
58418   kThemeBrushButtonInactiveDarkShadow = 36,
58419   kThemeBrushButtonInactiveDarkHighlight = 37,
58420   kThemeBrushButtonInactiveLightShadow = 38,
58421   kThemeBrushButtonInactiveLightHighlight = 39,
58422   kThemeBrushButtonPressedDarkShadow = 40,
58423   kThemeBrushButtonPressedDarkHighlight = 41,
58424   kThemeBrushButtonPressedLightShadow = 42,
58425   kThemeBrushButtonPressedLightHighlight = 43,
58426   kThemeBrushBevelActiveLight = 44,
58427   kThemeBrushBevelActiveDark = 45,
58428   kThemeBrushBevelInactiveLight = 46,
58429   kThemeBrushBevelInactiveDark = 47
58430 };
58431
58432
58433 enum {
58434   kThemeBrushNotificationWindowBackground = 48
58435 };
58436
58437
58438 enum {
58439   kThemeBrushMovableModalBackground = 49,
58440   kThemeBrushSheetBackgroundOpaque = 50,
58441   kThemeBrushDrawerBackground = 51,
58442   kThemeBrushToolbarBackground = 52,
58443   kThemeBrushSheetBackgroundTransparent = 53,
58444   kThemeBrushMenuBackground = 54,
58445   kThemeBrushMenuBackgroundSelected = 55
58446 };
58447
58448
58449 enum {
58450   kThemeBrushSheetBackground = kThemeBrushSheetBackgroundOpaque
58451 };
58452
58453
58454
58455
58456 enum {
58457   kThemeBrushBlack = -1,
58458   kThemeBrushWhite = -2,
58459   kThemeBrushPrimaryHighlightColor = -3,
58460   kThemeBrushSecondaryHighlightColor = -4
58461 };
58462
58463 typedef SInt16 ThemeBrush;
58464 enum {
58465   kThemeTextColorDialogActive = 1,
58466   kThemeTextColorDialogInactive = 2,
58467   kThemeTextColorAlertActive = 3,
58468   kThemeTextColorAlertInactive = 4,
58469   kThemeTextColorModelessDialogActive = 5,
58470   kThemeTextColorModelessDialogInactive = 6,
58471   kThemeTextColorWindowHeaderActive = 7,
58472   kThemeTextColorWindowHeaderInactive = 8,
58473   kThemeTextColorPlacardActive = 9,
58474   kThemeTextColorPlacardInactive = 10,
58475   kThemeTextColorPlacardPressed = 11,
58476   kThemeTextColorPushButtonActive = 12,
58477   kThemeTextColorPushButtonInactive = 13,
58478   kThemeTextColorPushButtonPressed = 14,
58479   kThemeTextColorBevelButtonActive = 15,
58480   kThemeTextColorBevelButtonInactive = 16,
58481   kThemeTextColorBevelButtonPressed = 17,
58482   kThemeTextColorPopupButtonActive = 18,
58483   kThemeTextColorPopupButtonInactive = 19,
58484   kThemeTextColorPopupButtonPressed = 20,
58485   kThemeTextColorIconLabel = 21,
58486   kThemeTextColorListView = 22
58487 };
58488
58489
58490 enum {
58491   kThemeTextColorDocumentWindowTitleActive = 23,
58492   kThemeTextColorDocumentWindowTitleInactive = 24,
58493   kThemeTextColorMovableModalWindowTitleActive = 25,
58494   kThemeTextColorMovableModalWindowTitleInactive = 26,
58495   kThemeTextColorUtilityWindowTitleActive = 27,
58496   kThemeTextColorUtilityWindowTitleInactive = 28,
58497   kThemeTextColorPopupWindowTitleActive = 29,
58498   kThemeTextColorPopupWindowTitleInactive = 30,
58499   kThemeTextColorRootMenuActive = 31,
58500   kThemeTextColorRootMenuSelected = 32,
58501   kThemeTextColorRootMenuDisabled = 33,
58502   kThemeTextColorMenuItemActive = 34,
58503   kThemeTextColorMenuItemSelected = 35,
58504   kThemeTextColorMenuItemDisabled = 36,
58505   kThemeTextColorPopupLabelActive = 37,
58506   kThemeTextColorPopupLabelInactive = 38
58507 };
58508
58509
58510
58511 enum {
58512   kThemeTextColorTabFrontActive = 39,
58513   kThemeTextColorTabNonFrontActive = 40,
58514   kThemeTextColorTabNonFrontPressed = 41,
58515   kThemeTextColorTabFrontInactive = 42,
58516   kThemeTextColorTabNonFrontInactive = 43,
58517   kThemeTextColorIconLabelSelected = 44,
58518   kThemeTextColorBevelButtonStickyActive = 45,
58519   kThemeTextColorBevelButtonStickyInactive = 46
58520 };
58521
58522
58523 enum {
58524   kThemeTextColorNotification = 47
58525 };
58526
58527
58528
58529 enum {
58530   kThemeTextColorSystemDetail = 48
58531 };
58532
58533
58534
58535 enum {
58536   kThemeTextColorBlack = -1,
58537   kThemeTextColorWhite = -2
58538 };
58539
58540 typedef SInt16 ThemeTextColor;
58541
58542 enum {
58543   kThemeStateInactive = 0,
58544   kThemeStateActive = 1,
58545   kThemeStatePressed = 2,
58546   kThemeStateRollover = 6,
58547   kThemeStateUnavailable = 7,
58548   kThemeStateUnavailableInactive = 8
58549 };
58550
58551
58552 enum {
58553   kThemeStateDisabled = 0
58554 };
58555
58556 enum {
58557   kThemeStatePressedUp = 2,
58558   kThemeStatePressedDown = 3
58559 };
58560
58561 typedef UInt32 ThemeDrawState;
58562
58563
58564
58565 enum {
58566   kThemeArrowCursor = 0,
58567   kThemeCopyArrowCursor = 1,
58568   kThemeAliasArrowCursor = 2,
58569   kThemeContextualMenuArrowCursor = 3,
58570   kThemeIBeamCursor = 4,
58571   kThemeCrossCursor = 5,
58572   kThemePlusCursor = 6,
58573   kThemeWatchCursor = 7,
58574   kThemeClosedHandCursor = 8,
58575   kThemeOpenHandCursor = 9,
58576   kThemePointingHandCursor = 10,
58577   kThemeCountingUpHandCursor = 11,
58578   kThemeCountingDownHandCursor = 12,
58579   kThemeCountingUpAndDownHandCursor = 13,
58580   kThemeSpinningCursor = 14,
58581   kThemeResizeLeftCursor = 15,
58582   kThemeResizeRightCursor = 16,
58583   kThemeResizeLeftRightCursor = 17,
58584   kThemeNotAllowedCursor = 18
58585 };
58586
58587 typedef UInt32 ThemeCursor;
58588
58589
58590
58591 enum {
58592   kThemeMenuBarNormal = 0,
58593   kThemeMenuBarSelected = 1
58594 };
58595
58596 typedef UInt16 ThemeMenuBarState;
58597
58598 enum {
58599   kThemeMenuSquareMenuBar = (1 << 0)
58600 };
58601
58602
58603
58604
58605 enum {
58606   kThemeMenuActive = 0,
58607   kThemeMenuSelected = 1,
58608   kThemeMenuDisabled = 3
58609 };
58610
58611 typedef UInt16 ThemeMenuState;
58612
58613
58614
58615
58616 enum {
58617   kThemeMenuTypePullDown = 0,
58618   kThemeMenuTypePopUp = 1,
58619   kThemeMenuTypeHierarchical = 2,
58620   kThemeMenuTypeInactive = 0x0100
58621 };
58622
58623 typedef UInt16 ThemeMenuType;
58624 enum {
58625   kThemeMenuItemPlain = 0,
58626   kThemeMenuItemHierarchical = 1,
58627   kThemeMenuItemScrollUpArrow = 2,
58628   kThemeMenuItemScrollDownArrow = 3,
58629   kThemeMenuItemAtTop = 0x0100,
58630   kThemeMenuItemAtBottom = 0x0200,
58631   kThemeMenuItemHierBackground = 0x0400,
58632   kThemeMenuItemPopUpBackground = 0x0800,
58633   kThemeMenuItemHasIcon = 0x8000,
58634   kThemeMenuItemNoBackground = 0x4000
58635 };
58636
58637 typedef UInt16 ThemeMenuItemType;
58638
58639
58640
58641 enum {
58642   kThemeBackgroundTabPane = 1,
58643   kThemeBackgroundPlacard = 2,
58644   kThemeBackgroundWindowHeader = 3,
58645   kThemeBackgroundListViewWindowHeader = 4,
58646   kThemeBackgroundSecondaryGroupBox = 5
58647 };
58648
58649 typedef UInt32 ThemeBackgroundKind;
58650 enum {
58651   kThemeNameTag = 'name',
58652   kThemeVariantNameTag = 'varn',
58653   kThemeVariantBaseTintTag = 'tint',
58654   kThemeHighlightColorTag = 'hcol',
58655   kThemeScrollBarArrowStyleTag = 'sbar',
58656   kThemeScrollBarThumbStyleTag = 'sbth',
58657   kThemeSoundsEnabledTag = 'snds',
58658   kThemeDblClickCollapseTag = 'coll'
58659 };
58660
58661 enum {
58662   kThemeAppearanceFileNameTag = 'thme',
58663   kThemeSystemFontTag = 'lgsf',
58664   kThemeSmallSystemFontTag = 'smsf',
58665   kThemeViewsFontTag = 'vfnt',
58666   kThemeViewsFontSizeTag = 'vfsz',
58667   kThemeDesktopPatternNameTag = 'patn',
58668   kThemeDesktopPatternTag = 'patt',
58669   kThemeDesktopPictureNameTag = 'dpnm',
58670   kThemeDesktopPictureAliasTag = 'dpal',
58671   kThemeDesktopPictureAlignmentTag = 'dpan',
58672   kThemeHighlightColorNameTag = 'hcnm',
58673   kThemeExamplePictureIDTag = 'epic',
58674   kThemeSoundTrackNameTag = 'sndt',
58675   kThemeSoundMaskTag = 'smsk',
58676   kThemeUserDefinedTag = 'user',
58677   kThemeSmoothFontEnabledTag = 'smoo',
58678   kThemeSmoothFontMinSizeTag = 'smos'
58679 };
58680
58681
58682 enum {
58683   kTiledOnScreen = 1,
58684   kCenterOnScreen = 2,
58685   kFitToScreen = 3,
58686   kFillScreen = 4,
58687   kUseBestGuess = 5
58688 };
58689
58690
58691
58692
58693 enum {
58694   kThemeCheckBoxClassicX = 0,
58695   kThemeCheckBoxCheckMark = 1
58696 };
58697
58698 typedef UInt16 ThemeCheckBoxStyle;
58699 enum {
58700   kThemeScrollBarArrowsSingle = 0,
58701   kThemeScrollBarArrowsLowerRight = 1
58702 };
58703
58704 typedef UInt16 ThemeScrollBarArrowStyle;
58705 enum {
58706   kThemeScrollBarThumbNormal = 0,
58707   kThemeScrollBarThumbProportional = 1
58708 };
58709
58710 typedef UInt16 ThemeScrollBarThumbStyle;
58711 enum {
58712   kThemeSystemFont = 0,
58713
58714
58715
58716
58717
58718
58719   kThemeSmallSystemFont = 1,
58720
58721
58722
58723
58724
58725
58726   kThemeSmallEmphasizedSystemFont = 2,
58727
58728
58729
58730
58731
58732   kThemeViewsFont = 3,
58733
58734
58735
58736
58737
58738
58739
58740   kThemeEmphasizedSystemFont = 4,
58741
58742
58743
58744
58745
58746
58747
58748   kThemeApplicationFont = 5,
58749
58750
58751
58752
58753
58754
58755
58756   kThemeLabelFont = 6,
58757
58758
58759
58760
58761
58762   kThemeMenuTitleFont = 100,
58763
58764
58765
58766
58767
58768   kThemeMenuItemFont = 101,
58769
58770
58771
58772
58773
58774   kThemeMenuItemMarkFont = 102,
58775
58776
58777
58778
58779
58780   kThemeMenuItemCmdKeyFont = 103,
58781
58782
58783
58784
58785
58786   kThemeWindowTitleFont = 104,
58787
58788
58789
58790
58791
58792   kThemePushButtonFont = 105,
58793
58794
58795
58796
58797
58798   kThemeUtilityWindowTitleFont = 106,
58799
58800
58801
58802
58803
58804   kThemeAlertHeaderFont = 107,
58805   kThemeSystemFontDetail = 7,
58806   kThemeSystemFontDetailEmphasized = 8,
58807   kThemeCurrentPortFont = 200,
58808
58809
58810
58811
58812
58813   kThemeToolbarFont = 108
58814 };
58815
58816
58817 enum {
58818   kPublicThemeFontCount = 17
58819 };
58820
58821 typedef UInt16 ThemeFontID;
58822
58823
58824
58825 enum {
58826   kThemeTabNonFront = 0,
58827   kThemeTabNonFrontPressed = 1,
58828   kThemeTabNonFrontInactive = 2,
58829   kThemeTabFront = 3,
58830   kThemeTabFrontInactive = 4,
58831   kThemeTabNonFrontUnavailable = 5,
58832   kThemeTabFrontUnavailable = 6
58833 };
58834
58835 typedef UInt16 ThemeTabStyle;
58836 enum {
58837   kThemeTabNorth = 0,
58838   kThemeTabSouth = 1,
58839   kThemeTabEast = 2,
58840   kThemeTabWest = 3
58841 };
58842
58843 typedef UInt16 ThemeTabDirection;
58844
58845
58846
58847
58848
58849
58850 enum {
58851   kThemeSmallTabHeight = 16,
58852   kThemeLargeTabHeight = 21,
58853   kThemeTabPaneOverlap = 3,
58854   kThemeSmallTabHeightMax = 19,
58855   kThemeLargeTabHeightMax = 24
58856 };
58857
58858
58859
58860
58861 enum {
58862   kThemeMediumScrollBar = 0,
58863   kThemeSmallScrollBar = 1,
58864   kThemeMediumSlider = 2,
58865   kThemeMediumProgressBar = 3,
58866   kThemeMediumIndeterminateBar = 4,
58867   kThemeRelevanceBar = 5,
58868   kThemeSmallSlider = 6,
58869   kThemeLargeProgressBar = 7,
58870   kThemeLargeIndeterminateBar = 8
58871 };
58872
58873 typedef UInt16 ThemeTrackKind;
58874
58875
58876
58877 enum {
58878
58879   kThemeTrackActive = 0,
58880   kThemeTrackDisabled = 1,
58881   kThemeTrackNothingToScroll = 2,
58882   kThemeTrackInactive = 3
58883 };
58884
58885 typedef UInt8 ThemeTrackEnableState;
58886
58887
58888
58889 enum {
58890
58891   kThemeLeftOutsideArrowPressed = 0x01,
58892   kThemeLeftInsideArrowPressed = 0x02,
58893   kThemeLeftTrackPressed = 0x04,
58894   kThemeThumbPressed = 0x08,
58895   kThemeRightTrackPressed = 0x10,
58896   kThemeRightInsideArrowPressed = 0x20,
58897   kThemeRightOutsideArrowPressed = 0x40,
58898   kThemeTopOutsideArrowPressed = kThemeLeftOutsideArrowPressed,
58899   kThemeTopInsideArrowPressed = kThemeLeftInsideArrowPressed,
58900   kThemeTopTrackPressed = kThemeLeftTrackPressed,
58901   kThemeBottomTrackPressed = kThemeRightTrackPressed,
58902   kThemeBottomInsideArrowPressed = kThemeRightInsideArrowPressed,
58903   kThemeBottomOutsideArrowPressed = kThemeRightOutsideArrowPressed
58904 };
58905
58906 typedef UInt8 ThemeTrackPressState;
58907
58908
58909
58910 enum {
58911
58912   kThemeThumbPlain = 0,
58913   kThemeThumbUpward = 1,
58914   kThemeThumbDownward = 2
58915 };
58916
58917 typedef UInt8 ThemeThumbDirection;
58918 enum {
58919
58920
58921
58922
58923   kThemeTrackHorizontal = (1 << 0),
58924
58925
58926
58927
58928   kThemeTrackRightToLeft = (1 << 1),
58929
58930
58931
58932
58933   kThemeTrackShowThumb = (1 << 2),
58934
58935
58936
58937
58938   kThemeTrackThumbRgnIsNotGhost = (1 << 3),
58939
58940
58941
58942
58943
58944   kThemeTrackNoScrollBarArrows = (1 << 4),
58945
58946
58947
58948
58949
58950   kThemeTrackHasFocus = (1 << 5)
58951 };
58952
58953 typedef UInt16 ThemeTrackAttributes;
58954
58955
58956
58957 struct ScrollBarTrackInfo {
58958   SInt32 viewsize;
58959   ThemeTrackPressState pressState;
58960 };
58961 typedef struct ScrollBarTrackInfo ScrollBarTrackInfo;
58962 struct SliderTrackInfo {
58963   ThemeThumbDirection thumbDir;
58964   ThemeTrackPressState pressState;
58965 };
58966 typedef struct SliderTrackInfo SliderTrackInfo;
58967 struct ProgressTrackInfo {
58968   UInt8 phase;
58969 };
58970 typedef struct ProgressTrackInfo ProgressTrackInfo;
58971 struct ThemeTrackDrawInfo {
58972   ThemeTrackKind kind;
58973   Rect bounds;
58974   SInt32 min;
58975   SInt32 max;
58976   SInt32 value;
58977   UInt32 reserved;
58978
58979   ThemeTrackAttributes attributes;
58980   ThemeTrackEnableState enableState;
58981   UInt8 filler1;
58982
58983   union {
58984     ScrollBarTrackInfo scrollbar;
58985     SliderTrackInfo slider;
58986     ProgressTrackInfo progress;
58987   } trackInfo;
58988 };
58989 typedef struct ThemeTrackDrawInfo ThemeTrackDrawInfo;
58990
58991
58992
58993 enum {
58994   kThemeWindowHasGrow = (1 << 0),
58995   kThemeWindowHasHorizontalZoom = (1 << 3),
58996   kThemeWindowHasVerticalZoom = (1 << 4),
58997   kThemeWindowHasFullZoom = kThemeWindowHasHorizontalZoom + kThemeWindowHasVerticalZoom,
58998   kThemeWindowHasCloseBox = (1 << 5),
58999   kThemeWindowHasCollapseBox = (1 << 6),
59000   kThemeWindowHasTitleText = (1 << 7),
59001   kThemeWindowIsCollapsed = (1 << 8),
59002   kThemeWindowHasDirty = (1 << 9)
59003 };
59004
59005
59006 typedef UInt32 ThemeWindowAttributes;
59007
59008
59009
59010 enum {
59011   kThemeDocumentWindow = 0,
59012   kThemeDialogWindow = 1,
59013   kThemeMovableDialogWindow = 2,
59014   kThemeAlertWindow = 3,
59015   kThemeMovableAlertWindow = 4,
59016   kThemePlainDialogWindow = 5,
59017   kThemeShadowDialogWindow = 6,
59018   kThemePopupWindow = 7,
59019   kThemeUtilityWindow = 8,
59020   kThemeUtilitySideWindow = 9,
59021   kThemeSheetWindow = 10,
59022   kThemeDrawerWindow = 11
59023 };
59024
59025 typedef UInt16 ThemeWindowType;
59026
59027
59028
59029 enum {
59030   kThemeWidgetCloseBox = 0,
59031   kThemeWidgetZoomBox = 1,
59032   kThemeWidgetCollapseBox = 2,
59033   kThemeWidgetDirtyCloseBox = 6
59034 };
59035
59036 enum {
59037
59038   kThemeWidgetABox = 3,
59039   kThemeWidgetBBox = 4,
59040   kThemeWidgetBOffBox = 5
59041 };
59042
59043 typedef UInt16 ThemeTitleBarWidget;
59044
59045
59046
59047 enum {
59048   kThemeArrowLeft = 0,
59049   kThemeArrowDown = 1,
59050   kThemeArrowRight = 2,
59051   kThemeArrowUp = 3
59052 };
59053
59054 typedef UInt16 ThemeArrowOrientation;
59055
59056
59057
59058 enum {
59059   kThemeArrow3pt = 0,
59060   kThemeArrow5pt = 1,
59061   kThemeArrow7pt = 2,
59062   kThemeArrow9pt = 3
59063 };
59064
59065 typedef UInt16 ThemePopupArrowSize;
59066
59067
59068
59069 enum {
59070   kThemeGrowLeft = (1 << 0),
59071   kThemeGrowRight = (1 << 1),
59072   kThemeGrowUp = (1 << 2),
59073   kThemeGrowDown = (1 << 3)
59074 };
59075
59076 typedef UInt16 ThemeGrowDirection;
59077
59078
59079
59080 enum {
59081   kThemePushButton = 0,
59082   kThemeCheckBox = 1,
59083   kThemeRadioButton = 2,
59084   kThemeBevelButton = 3,
59085   kThemeArrowButton = 4,
59086   kThemePopupButton = 5,
59087   kThemeDisclosureButton = 6,
59088   kThemeIncDecButton = 7,
59089   kThemeSmallBevelButton = 8,
59090   kThemeMediumBevelButton = 3,
59091   kThemeLargeBevelButton = 9,
59092   kThemeListHeaderButton = 10,
59093   kThemeRoundButton = 11,
59094   kThemeLargeRoundButton = 12,
59095   kThemeSmallCheckBox = 13,
59096   kThemeSmallRadioButton = 14,
59097   kThemeRoundedBevelButton = 15,
59098   kThemeNormalCheckBox = kThemeCheckBox,
59099   kThemeNormalRadioButton = kThemeRadioButton
59100 };
59101
59102 typedef UInt16 ThemeButtonKind;
59103
59104
59105
59106 enum {
59107   kThemeButtonOff = 0,
59108   kThemeButtonOn = 1,
59109   kThemeButtonMixed = 2,
59110   kThemeDisclosureRight = 0,
59111   kThemeDisclosureDown = 1,
59112   kThemeDisclosureLeft = 2
59113 };
59114
59115 typedef UInt16 ThemeButtonValue;
59116
59117
59118
59119 enum {
59120   kThemeAdornmentNone = 0,
59121   kThemeAdornmentDefault = (1 << 0),
59122   kThemeAdornmentFocus = (1 << 2),
59123   kThemeAdornmentRightToLeft = (1 << 4),
59124   kThemeAdornmentDrawIndicatorOnly = (1 << 5),
59125   kThemeAdornmentHeaderButtonLeftNeighborSelected = (1 << 6),
59126   kThemeAdornmentHeaderButtonRightNeighborSelected = (1 << 7),
59127   kThemeAdornmentHeaderButtonSortUp = (1 << 8),
59128   kThemeAdornmentHeaderMenuButton = (1 << 9),
59129   kThemeAdornmentHeaderButtonNoShadow = (1 << 10),
59130   kThemeAdornmentHeaderButtonShadowOnly = (1 << 11),
59131   kThemeAdornmentNoShadow = kThemeAdornmentHeaderButtonNoShadow,
59132   kThemeAdornmentShadowOnly = kThemeAdornmentHeaderButtonShadowOnly,
59133   kThemeAdornmentArrowLeftArrow = (1 << 6),
59134   kThemeAdornmentArrowDownArrow = (1 << 7),
59135   kThemeAdornmentArrowDoubleArrow = (1 << 8),
59136   kThemeAdornmentArrowUpArrow = (1 << 9)
59137 };
59138
59139 typedef UInt16 ThemeButtonAdornment;
59140
59141
59142
59143 struct ThemeButtonDrawInfo {
59144   ThemeDrawState state;
59145   ThemeButtonValue value;
59146   ThemeButtonAdornment adornment;
59147 };
59148 typedef struct ThemeButtonDrawInfo ThemeButtonDrawInfo;
59149 typedef ThemeButtonDrawInfo * ThemeButtonDrawInfoPtr;
59150 enum {
59151   kThemeNoSounds = 0,
59152   kThemeWindowSoundsMask = (1 << 0),
59153   kThemeMenuSoundsMask = (1 << 1),
59154   kThemeControlSoundsMask = (1 << 2),
59155   kThemeFinderSoundsMask = (1 << 3)
59156 };
59157 enum {
59158   kThemeDragSoundNone = 0,
59159   kThemeDragSoundMoveWindow = 'wmov',
59160   kThemeDragSoundGrowWindow = 'wgro',
59161   kThemeDragSoundMoveUtilWindow = 'umov',
59162   kThemeDragSoundGrowUtilWindow = 'ugro',
59163   kThemeDragSoundMoveDialog = 'dmov',
59164   kThemeDragSoundMoveAlert = 'amov',
59165   kThemeDragSoundMoveIcon = 'imov',
59166   kThemeDragSoundSliderThumb = 'slth',
59167   kThemeDragSoundSliderGhost = 'slgh',
59168   kThemeDragSoundScrollBarThumb = 'sbth',
59169   kThemeDragSoundScrollBarGhost = 'sbgh',
59170   kThemeDragSoundScrollBarArrowDecreasing = 'sbad',
59171   kThemeDragSoundScrollBarArrowIncreasing = 'sbai',
59172   kThemeDragSoundDragging = 'drag'
59173 };
59174
59175 typedef OSType ThemeDragSoundKind;
59176 enum {
59177   kThemeSoundNone = 0,
59178   kThemeSoundMenuOpen = 'mnuo',
59179   kThemeSoundMenuClose = 'mnuc',
59180   kThemeSoundMenuItemHilite = 'mnui',
59181   kThemeSoundMenuItemRelease = 'mnus',
59182   kThemeSoundWindowClosePress = 'wclp',
59183   kThemeSoundWindowCloseEnter = 'wcle',
59184   kThemeSoundWindowCloseExit = 'wclx',
59185   kThemeSoundWindowCloseRelease = 'wclr',
59186   kThemeSoundWindowZoomPress = 'wzmp',
59187   kThemeSoundWindowZoomEnter = 'wzme',
59188   kThemeSoundWindowZoomExit = 'wzmx',
59189   kThemeSoundWindowZoomRelease = 'wzmr',
59190   kThemeSoundWindowCollapsePress = 'wcop',
59191   kThemeSoundWindowCollapseEnter = 'wcoe',
59192   kThemeSoundWindowCollapseExit = 'wcox',
59193   kThemeSoundWindowCollapseRelease = 'wcor',
59194   kThemeSoundWindowDragBoundary = 'wdbd',
59195   kThemeSoundUtilWinClosePress = 'uclp',
59196   kThemeSoundUtilWinCloseEnter = 'ucle',
59197   kThemeSoundUtilWinCloseExit = 'uclx',
59198   kThemeSoundUtilWinCloseRelease = 'uclr',
59199   kThemeSoundUtilWinZoomPress = 'uzmp',
59200   kThemeSoundUtilWinZoomEnter = 'uzme',
59201   kThemeSoundUtilWinZoomExit = 'uzmx',
59202   kThemeSoundUtilWinZoomRelease = 'uzmr',
59203   kThemeSoundUtilWinCollapsePress = 'ucop',
59204   kThemeSoundUtilWinCollapseEnter = 'ucoe',
59205   kThemeSoundUtilWinCollapseExit = 'ucox',
59206   kThemeSoundUtilWinCollapseRelease = 'ucor',
59207   kThemeSoundUtilWinDragBoundary = 'udbd',
59208   kThemeSoundWindowOpen = 'wopn',
59209   kThemeSoundWindowClose = 'wcls',
59210   kThemeSoundWindowZoomIn = 'wzmi',
59211   kThemeSoundWindowZoomOut = 'wzmo',
59212   kThemeSoundWindowCollapseUp = 'wcol',
59213   kThemeSoundWindowCollapseDown = 'wexp',
59214   kThemeSoundWindowActivate = 'wact',
59215   kThemeSoundUtilWindowOpen = 'uopn',
59216   kThemeSoundUtilWindowClose = 'ucls',
59217   kThemeSoundUtilWindowZoomIn = 'uzmi',
59218   kThemeSoundUtilWindowZoomOut = 'uzmo',
59219   kThemeSoundUtilWindowCollapseUp = 'ucol',
59220   kThemeSoundUtilWindowCollapseDown = 'uexp',
59221   kThemeSoundUtilWindowActivate = 'uact',
59222   kThemeSoundDialogOpen = 'dopn',
59223   kThemeSoundDialogClose = 'dlgc',
59224   kThemeSoundAlertOpen = 'aopn',
59225   kThemeSoundAlertClose = 'altc',
59226   kThemeSoundPopupWindowOpen = 'pwop',
59227   kThemeSoundPopupWindowClose = 'pwcl',
59228   kThemeSoundButtonPress = 'btnp',
59229   kThemeSoundButtonEnter = 'btne',
59230   kThemeSoundButtonExit = 'btnx',
59231   kThemeSoundButtonRelease = 'btnr',
59232   kThemeSoundDefaultButtonPress = 'dbtp',
59233   kThemeSoundDefaultButtonEnter = 'dbte',
59234   kThemeSoundDefaultButtonExit = 'dbtx',
59235   kThemeSoundDefaultButtonRelease = 'dbtr',
59236   kThemeSoundCancelButtonPress = 'cbtp',
59237   kThemeSoundCancelButtonEnter = 'cbte',
59238   kThemeSoundCancelButtonExit = 'cbtx',
59239   kThemeSoundCancelButtonRelease = 'cbtr',
59240   kThemeSoundCheckboxPress = 'chkp',
59241   kThemeSoundCheckboxEnter = 'chke',
59242   kThemeSoundCheckboxExit = 'chkx',
59243   kThemeSoundCheckboxRelease = 'chkr',
59244   kThemeSoundRadioPress = 'radp',
59245   kThemeSoundRadioEnter = 'rade',
59246   kThemeSoundRadioExit = 'radx',
59247   kThemeSoundRadioRelease = 'radr',
59248   kThemeSoundScrollArrowPress = 'sbap',
59249   kThemeSoundScrollArrowEnter = 'sbae',
59250   kThemeSoundScrollArrowExit = 'sbax',
59251   kThemeSoundScrollArrowRelease = 'sbar',
59252   kThemeSoundScrollEndOfTrack = 'sbte',
59253   kThemeSoundScrollTrackPress = 'sbtp',
59254   kThemeSoundSliderEndOfTrack = 'slte',
59255   kThemeSoundSliderTrackPress = 'sltp',
59256   kThemeSoundBalloonOpen = 'blno',
59257   kThemeSoundBalloonClose = 'blnc',
59258   kThemeSoundBevelPress = 'bevp',
59259   kThemeSoundBevelEnter = 'beve',
59260   kThemeSoundBevelExit = 'bevx',
59261   kThemeSoundBevelRelease = 'bevr',
59262   kThemeSoundLittleArrowUpPress = 'laup',
59263   kThemeSoundLittleArrowDnPress = 'ladp',
59264   kThemeSoundLittleArrowEnter = 'lare',
59265   kThemeSoundLittleArrowExit = 'larx',
59266   kThemeSoundLittleArrowUpRelease = 'laur',
59267   kThemeSoundLittleArrowDnRelease = 'ladr',
59268   kThemeSoundPopupPress = 'popp',
59269   kThemeSoundPopupEnter = 'pope',
59270   kThemeSoundPopupExit = 'popx',
59271   kThemeSoundPopupRelease = 'popr',
59272   kThemeSoundDisclosurePress = 'dscp',
59273   kThemeSoundDisclosureEnter = 'dsce',
59274   kThemeSoundDisclosureExit = 'dscx',
59275   kThemeSoundDisclosureRelease = 'dscr',
59276   kThemeSoundTabPressed = 'tabp',
59277   kThemeSoundTabEnter = 'tabe',
59278   kThemeSoundTabExit = 'tabx',
59279   kThemeSoundTabRelease = 'tabr',
59280   kThemeSoundDragTargetHilite = 'dthi',
59281   kThemeSoundDragTargetUnhilite = 'dtuh',
59282   kThemeSoundDragTargetDrop = 'dtdr',
59283   kThemeSoundEmptyTrash = 'ftrs',
59284   kThemeSoundSelectItem = 'fsel',
59285   kThemeSoundNewItem = 'fnew',
59286   kThemeSoundReceiveDrop = 'fdrp',
59287   kThemeSoundCopyDone = 'fcpd',
59288   kThemeSoundResolveAlias = 'fral',
59289   kThemeSoundLaunchApp = 'flap',
59290   kThemeSoundDiskInsert = 'dski',
59291   kThemeSoundDiskEject = 'dske',
59292   kThemeSoundFinderDragOnIcon = 'fdon',
59293   kThemeSoundFinderDragOffIcon = 'fdof'
59294 };
59295
59296 typedef OSType ThemeSoundKind;
59297 enum {
59298   kThemePopupTabNormalPosition = 0,
59299   kThemePopupTabCenterOnWindow = 1,
59300   kThemePopupTabCenterOnOffset = 2
59301 };
59302
59303 struct ThemeWindowMetrics {
59304   UInt16 metricSize;
59305   SInt16 titleHeight;
59306   SInt16 titleWidth;
59307   SInt16 popupTabOffset;
59308   SInt16 popupTabWidth;
59309   UInt16 popupTabPosition;
59310 };
59311 typedef struct ThemeWindowMetrics ThemeWindowMetrics;
59312 typedef ThemeWindowMetrics * ThemeWindowMetricsPtr;
59313 enum {
59314
59315
59316
59317
59318   kThemeMetricScrollBarWidth = 0,
59319
59320
59321
59322
59323   kThemeMetricSmallScrollBarWidth = 1,
59324
59325
59326
59327
59328   kThemeMetricCheckBoxHeight = 2,
59329
59330
59331
59332
59333   kThemeMetricRadioButtonHeight = 3,
59334   kThemeMetricEditTextWhitespace = 4,
59335
59336
59337
59338
59339
59340
59341
59342   kThemeMetricEditTextFrameOutset = 5,
59343
59344
59345
59346
59347
59348   kThemeMetricListBoxFrameOutset = 6,
59349
59350
59351
59352
59353
59354
59355   kThemeMetricFocusRectOutset = 7,
59356
59357
59358
59359
59360   kThemeMetricImageWellThickness = 8,
59361
59362
59363
59364
59365
59366
59367
59368   kThemeMetricScrollBarOverlap = 9,
59369
59370
59371
59372
59373   kThemeMetricLargeTabHeight = 10,
59374
59375
59376
59377
59378
59379   kThemeMetricLargeTabCapsWidth = 11,
59380
59381
59382
59383
59384
59385
59386
59387   kThemeMetricTabFrameOverlap = 12,
59388   kThemeMetricTabIndentOrStyle = 13,
59389
59390
59391
59392
59393
59394   kThemeMetricTabOverlap = 14,
59395
59396
59397
59398
59399
59400   kThemeMetricSmallTabHeight = 15,
59401
59402
59403
59404
59405
59406   kThemeMetricSmallTabCapsWidth = 16,
59407
59408
59409
59410
59411   kThemeMetricPushButtonHeight = 19,
59412
59413
59414
59415
59416   kThemeMetricListHeaderHeight = 20,
59417
59418
59419
59420
59421
59422   kThemeMetricDisclosureTriangleHeight = 25,
59423
59424
59425
59426
59427   kThemeMetricDisclosureTriangleWidth = 26,
59428
59429
59430
59431
59432   kThemeMetricLittleArrowsHeight = 27,
59433
59434
59435
59436
59437   kThemeMetricLittleArrowsWidth = 28,
59438
59439
59440
59441
59442   kThemeMetricPopupButtonHeight = 30,
59443
59444
59445
59446
59447   kThemeMetricSmallPopupButtonHeight = 31,
59448
59449
59450
59451
59452   kThemeMetricLargeProgressBarThickness = 32,
59453
59454
59455
59456
59457   kThemeMetricPullDownHeight = 33,
59458
59459
59460
59461
59462   kThemeMetricSmallPullDownHeight = 34,
59463
59464
59465
59466
59467   kThemeMetricResizeControlHeight = 38,
59468
59469
59470
59471
59472   kThemeMetricSmallResizeControlHeight = 39,
59473
59474
59475
59476
59477   kThemeMetricHSliderHeight = 41,
59478
59479
59480
59481
59482   kThemeMetricHSliderTickHeight = 42,
59483
59484
59485
59486
59487   kThemeMetricVSliderWidth = 45,
59488
59489
59490
59491
59492   kThemeMetricVSliderTickWidth = 46,
59493
59494
59495
59496
59497
59498   kThemeMetricTitleBarControlsHeight = 49,
59499
59500
59501
59502
59503   kThemeMetricCheckBoxWidth = 50,
59504
59505
59506
59507
59508   kThemeMetricRadioButtonWidth = 52,
59509
59510
59511
59512
59513   kThemeMetricNormalProgressBarThickness = 58,
59514
59515
59516
59517
59518   kThemeMetricProgressBarShadowOutset = 59,
59519
59520
59521
59522
59523
59524   kThemeMetricSmallProgressBarShadowOutset = 60,
59525
59526
59527
59528
59529
59530   kThemeMetricPrimaryGroupBoxContentInset = 61,
59531
59532
59533
59534
59535
59536   kThemeMetricSecondaryGroupBoxContentInset = 62,
59537
59538
59539
59540
59541   kThemeMetricMenuMarkColumnWidth = 63,
59542
59543
59544
59545
59546
59547   kThemeMetricMenuExcludedMarkColumnWidth = 64,
59548
59549
59550
59551
59552
59553   kThemeMetricMenuMarkIndent = 65,
59554
59555
59556
59557
59558   kThemeMetricMenuTextLeadingEdgeMargin = 66,
59559
59560
59561
59562
59563   kThemeMetricMenuTextTrailingEdgeMargin = 67,
59564
59565
59566
59567
59568   kThemeMetricMenuIndentWidth = 68,
59569
59570
59571
59572
59573
59574   kThemeMetricMenuIconTrailingEdgeMargin = 69
59575 };
59576
59577
59578
59579
59580
59581
59582 enum {
59583
59584
59585
59586
59587   kThemeMetricDisclosureButtonHeight = 17,
59588
59589
59590
59591
59592   kThemeMetricRoundButtonSize = 18,
59593
59594
59595
59596
59597   kThemeMetricSmallCheckBoxHeight = 21,
59598
59599
59600
59601
59602   kThemeMetricDisclosureButtonWidth = 22,
59603
59604
59605
59606
59607   kThemeMetricSmallDisclosureButtonHeight = 23,
59608
59609
59610
59611
59612   kThemeMetricSmallDisclosureButtonWidth = 24,
59613
59614
59615
59616
59617   kThemeMetricPaneSplitterHeight = 29,
59618
59619
59620
59621
59622   kThemeMetricSmallPushButtonHeight = 35,
59623
59624
59625
59626
59627   kThemeMetricSmallRadioButtonHeight = 36,
59628
59629
59630
59631
59632   kThemeMetricRelevanceIndicatorHeight = 37,
59633
59634
59635
59636
59637   kThemeMetricLargeRoundButtonSize = 40,
59638
59639
59640
59641
59642   kThemeMetricSmallHSliderHeight = 43,
59643
59644
59645
59646
59647
59648   kThemeMetricSmallHSliderTickHeight = 44,
59649
59650
59651
59652
59653   kThemeMetricSmallVSliderWidth = 47,
59654
59655
59656
59657
59658   kThemeMetricSmallVSliderTickWidth = 48,
59659
59660
59661
59662
59663   kThemeMetricSmallCheckBoxWidth = 51,
59664
59665
59666
59667
59668   kThemeMetricSmallRadioButtonWidth = 53,
59669
59670
59671
59672
59673
59674   kThemeMetricSmallHSliderMinThumbWidth = 54,
59675
59676
59677
59678
59679   kThemeMetricSmallVSliderMinThumbHeight = 55,
59680
59681
59682
59683
59684
59685   kThemeMetricSmallHSliderTickOffset = 56,
59686
59687
59688
59689
59690
59691   kThemeMetricSmallVSliderTickOffset = 57
59692 };
59693
59694 typedef UInt32 ThemeMetric;
59695
59696
59697
59698 typedef struct OpaqueThemeDrawingState* ThemeDrawingState;
59699
59700
59701
59702 typedef void ( * ThemeTabTitleDrawProcPtr)(const Rect *bounds, ThemeTabStyle style, ThemeTabDirection direction, SInt16 depth, Boolean isColorDev, UInt32 userData);
59703 typedef void ( * ThemeEraseProcPtr)(const Rect *bounds, UInt32 eraseData, SInt16 depth, Boolean isColorDev);
59704 typedef void ( * ThemeButtonDrawProcPtr)(const Rect *bounds, ThemeButtonKind kind, const ThemeButtonDrawInfo *info, UInt32 userData, SInt16 depth, Boolean isColorDev);
59705 typedef void ( * WindowTitleDrawingProcPtr)(const Rect *bounds, SInt16 depth, Boolean colorDevice, UInt32 userData);
59706 typedef Boolean ( * ThemeIteratorProcPtr)(ConstStr255Param inFileName, SInt16 resID, Collection inThemeSettings, void *inUserData);
59707 typedef ThemeTabTitleDrawProcPtr ThemeTabTitleDrawUPP;
59708 typedef ThemeEraseProcPtr ThemeEraseUPP;
59709 typedef ThemeButtonDrawProcPtr ThemeButtonDrawUPP;
59710 typedef WindowTitleDrawingProcPtr WindowTitleDrawingUPP;
59711 typedef ThemeIteratorProcPtr ThemeIteratorUPP;
59712 extern ThemeTabTitleDrawUPP
59713 NewThemeTabTitleDrawUPP(ThemeTabTitleDrawProcPtr userRoutine) ;
59714 extern ThemeEraseUPP
59715 NewThemeEraseUPP(ThemeEraseProcPtr userRoutine) ;
59716 extern ThemeButtonDrawUPP
59717 NewThemeButtonDrawUPP(ThemeButtonDrawProcPtr userRoutine) ;
59718 extern WindowTitleDrawingUPP
59719 NewWindowTitleDrawingUPP(WindowTitleDrawingProcPtr userRoutine) ;
59720 extern ThemeIteratorUPP
59721 NewThemeIteratorUPP(ThemeIteratorProcPtr userRoutine) ;
59722 extern void
59723 DisposeThemeTabTitleDrawUPP(ThemeTabTitleDrawUPP userUPP) ;
59724 extern void
59725 DisposeThemeEraseUPP(ThemeEraseUPP userUPP) ;
59726 extern void
59727 DisposeThemeButtonDrawUPP(ThemeButtonDrawUPP userUPP) ;
59728 extern void
59729 DisposeWindowTitleDrawingUPP(WindowTitleDrawingUPP userUPP) ;
59730 extern void
59731 DisposeThemeIteratorUPP(ThemeIteratorUPP userUPP) ;
59732 extern void
59733 InvokeThemeTabTitleDrawUPP(
59734   const Rect * bounds,
59735   ThemeTabStyle style,
59736   ThemeTabDirection direction,
59737   SInt16 depth,
59738   Boolean isColorDev,
59739   UInt32 userData,
59740   ThemeTabTitleDrawUPP userUPP) ;
59741 extern void
59742 InvokeThemeEraseUPP(
59743   const Rect * bounds,
59744   UInt32 eraseData,
59745   SInt16 depth,
59746   Boolean isColorDev,
59747   ThemeEraseUPP userUPP) ;
59748 extern void
59749 InvokeThemeButtonDrawUPP(
59750   const Rect * bounds,
59751   ThemeButtonKind kind,
59752   const ThemeButtonDrawInfo * info,
59753   UInt32 userData,
59754   SInt16 depth,
59755   Boolean isColorDev,
59756   ThemeButtonDrawUPP userUPP) ;
59757 extern void
59758 InvokeWindowTitleDrawingUPP(
59759   const Rect * bounds,
59760   SInt16 depth,
59761   Boolean colorDevice,
59762   UInt32 userData,
59763   WindowTitleDrawingUPP userUPP) ;
59764 extern Boolean
59765 InvokeThemeIteratorUPP(
59766   ConstStr255Param inFileName,
59767   SInt16 resID,
59768   Collection inThemeSettings,
59769   void * inUserData,
59770   ThemeIteratorUPP userUPP) ;
59771
59772
59773
59774
59775 typedef void ( * MenuTitleDrawingProcPtr)(const Rect *inBounds, SInt16 inDepth, Boolean inIsColorDevice, SInt32 inUserData);
59776 typedef void ( * MenuItemDrawingProcPtr)(const Rect *inBounds, SInt16 inDepth, Boolean inIsColorDevice, SInt32 inUserData);
59777 typedef MenuTitleDrawingProcPtr MenuTitleDrawingUPP;
59778 typedef MenuItemDrawingProcPtr MenuItemDrawingUPP;
59779 extern MenuTitleDrawingUPP
59780 NewMenuTitleDrawingUPP(MenuTitleDrawingProcPtr userRoutine) ;
59781 extern MenuItemDrawingUPP
59782 NewMenuItemDrawingUPP(MenuItemDrawingProcPtr userRoutine) ;
59783 extern void
59784 DisposeMenuTitleDrawingUPP(MenuTitleDrawingUPP userUPP) ;
59785 extern void
59786 DisposeMenuItemDrawingUPP(MenuItemDrawingUPP userUPP) ;
59787 extern void
59788 InvokeMenuTitleDrawingUPP(
59789   const Rect * inBounds,
59790   SInt16 inDepth,
59791   Boolean inIsColorDevice,
59792   SInt32 inUserData,
59793   MenuTitleDrawingUPP userUPP) ;
59794 extern void
59795 InvokeMenuItemDrawingUPP(
59796   const Rect * inBounds,
59797   SInt16 inDepth,
59798   Boolean inIsColorDevice,
59799   SInt32 inUserData,
59800   MenuItemDrawingUPP userUPP) ;
59801 extern OSStatus
59802 RegisterAppearanceClient(void) ;
59803 extern OSStatus
59804 UnregisterAppearanceClient(void) ;
59805 extern Boolean
59806 IsAppearanceClient(const ProcessSerialNumber * process) ;
59807 extern OSStatus
59808 SetThemePen(
59809   ThemeBrush inBrush,
59810   SInt16 inDepth,
59811   Boolean inIsColorDevice) ;
59812 extern OSStatus
59813 SetThemeBackground(
59814   ThemeBrush inBrush,
59815   SInt16 inDepth,
59816   Boolean inIsColorDevice) ;
59817 extern OSStatus
59818 SetThemeTextColor(
59819   ThemeTextColor inColor,
59820   SInt16 inDepth,
59821   Boolean inIsColorDevice) ;
59822 extern OSStatus
59823 SetThemeWindowBackground(
59824   WindowRef inWindow,
59825   ThemeBrush inBrush,
59826   Boolean inUpdate) ;
59827 extern OSStatus
59828 DrawThemeWindowHeader(
59829   const Rect * inRect,
59830   ThemeDrawState inState) ;
59831 extern OSStatus
59832 DrawThemeWindowListViewHeader(
59833   const Rect * inRect,
59834   ThemeDrawState inState) ;
59835 extern OSStatus
59836 DrawThemePlacard(
59837   const Rect * inRect,
59838   ThemeDrawState inState) ;
59839 extern OSStatus
59840 DrawThemeEditTextFrame(
59841   const Rect * inRect,
59842   ThemeDrawState inState) ;
59843 extern OSStatus
59844 DrawThemeListBoxFrame(
59845   const Rect * inRect,
59846   ThemeDrawState inState) ;
59847 extern OSStatus
59848 DrawThemeFocusRect(
59849   const Rect * inRect,
59850   Boolean inHasFocus) ;
59851 extern OSStatus
59852 DrawThemePrimaryGroup(
59853   const Rect * inRect,
59854   ThemeDrawState inState) ;
59855 extern OSStatus
59856 DrawThemeSecondaryGroup(
59857   const Rect * inRect,
59858   ThemeDrawState inState) ;
59859 extern OSStatus
59860 DrawThemeSeparator(
59861   const Rect * inRect,
59862   ThemeDrawState inState) ;
59863 extern OSStatus
59864 DrawThemeModelessDialogFrame(
59865   const Rect * inRect,
59866   ThemeDrawState inState) ;
59867 extern OSStatus
59868 DrawThemeGenericWell(
59869   const Rect * inRect,
59870   ThemeDrawState inState,
59871   Boolean inFillCenter) ;
59872 extern OSStatus
59873 DrawThemeFocusRegion(
59874   RgnHandle inRegion,
59875   Boolean inHasFocus) ;
59876 extern Boolean
59877 IsThemeInColor(
59878   SInt16 inDepth,
59879   Boolean inIsColorDevice) ;
59880 extern OSStatus
59881 GetThemeAccentColors(CTabHandle * outColors) ;
59882 extern OSStatus
59883 DrawThemeMenuBarBackground(
59884   const Rect * inBounds,
59885   ThemeMenuBarState inState,
59886   UInt32 inAttributes) ;
59887 extern OSStatus
59888 DrawThemeMenuTitle(
59889   const Rect * inMenuBarRect,
59890   const Rect * inTitleRect,
59891   ThemeMenuState inState,
59892   UInt32 inAttributes,
59893   MenuTitleDrawingUPP inTitleProc,
59894   UInt32 inTitleData) ;
59895 extern OSStatus
59896 GetThemeMenuBarHeight(SInt16 * outHeight) ;
59897 extern OSStatus
59898 DrawThemeMenuBackground(
59899   const Rect * inMenuRect,
59900   ThemeMenuType inMenuType) ;
59901 extern OSStatus
59902 GetThemeMenuBackgroundRegion(
59903   const Rect * inMenuRect,
59904   ThemeMenuType menuType,
59905   RgnHandle region) ;
59906 extern OSStatus
59907 DrawThemeMenuItem(
59908   const Rect * inMenuRect,
59909   const Rect * inItemRect,
59910   SInt16 inVirtualMenuTop,
59911   SInt16 inVirtualMenuBottom,
59912   ThemeMenuState inState,
59913   ThemeMenuItemType inItemType,
59914   MenuItemDrawingUPP inDrawProc,
59915   UInt32 inUserData) ;
59916 extern OSStatus
59917 DrawThemeMenuSeparator(const Rect * inItemRect) ;
59918 extern OSStatus
59919 GetThemeMenuSeparatorHeight(SInt16 * outHeight) ;
59920 extern OSStatus
59921 GetThemeMenuItemExtra(
59922   ThemeMenuItemType inItemType,
59923   SInt16 * outHeight,
59924   SInt16 * outWidth) ;
59925 extern OSStatus
59926 GetThemeMenuTitleExtra(
59927   SInt16 * outWidth,
59928   Boolean inIsSquished) ;
59929 extern OSStatus
59930 GetTheme(Collection ioCollection) ;
59931 extern OSStatus
59932 SetTheme(Collection ioCollection) ;
59933 extern OSStatus
59934 IterateThemes(
59935   ThemeIteratorUPP inProc,
59936   void * inUserData) ;
59937 extern OSStatus
59938 DrawThemeTabPane(
59939   const Rect * inRect,
59940   ThemeDrawState inState) ;
59941 extern OSStatus
59942 DrawThemeTab(
59943   const Rect * inRect,
59944   ThemeTabStyle inStyle,
59945   ThemeTabDirection inDirection,
59946   ThemeTabTitleDrawUPP labelProc,
59947   UInt32 userData) ;
59948 extern OSStatus
59949 GetThemeTabRegion(
59950   const Rect * inRect,
59951   ThemeTabStyle inStyle,
59952   ThemeTabDirection inDirection,
59953   RgnHandle ioRgn) ;
59954 extern OSStatus
59955 SetThemeCursor(ThemeCursor inCursor) ;
59956 extern OSStatus
59957 SetAnimatedThemeCursor(
59958   ThemeCursor inCursor,
59959   UInt32 inAnimationStep) ;
59960 extern OSStatus
59961 GetThemeScrollBarThumbStyle(ThemeScrollBarThumbStyle * outStyle) ;
59962 extern OSStatus
59963 GetThemeScrollBarArrowStyle(ThemeScrollBarArrowStyle * outStyle) ;
59964 extern OSStatus
59965 GetThemeCheckBoxStyle(ThemeCheckBoxStyle * outStyle) ;
59966 extern OSStatus
59967 UseThemeFont(
59968   ThemeFontID inFontID,
59969   ScriptCode inScript) ;
59970 extern OSStatus
59971 GetThemeFont(
59972   ThemeFontID inFontID,
59973   ScriptCode inScript,
59974   Str255 outFontName,
59975   SInt16 * outFontSize,
59976   Style * outStyle) ;
59977 extern OSStatus
59978 DrawThemeTextBox(
59979   CFStringRef inString,
59980   ThemeFontID inFontID,
59981   ThemeDrawState inState,
59982   Boolean inWrapToWidth,
59983   const Rect * inBoundingBox,
59984   SInt16 inJust,
59985   void * inContext) ;
59986 extern OSStatus
59987 TruncateThemeText(
59988   CFMutableStringRef inString,
59989   ThemeFontID inFontID,
59990   ThemeDrawState inState,
59991   SInt16 inPixelWidthLimit,
59992   TruncCode inTruncWhere,
59993   Boolean * outTruncated) ;
59994 extern OSStatus
59995 GetThemeTextDimensions(
59996   CFStringRef inString,
59997   ThemeFontID inFontID,
59998   ThemeDrawState inState,
59999   Boolean inWrapToWidth,
60000   Point * ioBounds,
60001   SInt16 * outBaseline) ;
60002 extern OSStatus
60003 GetThemeTextShadowOutset(
60004   ThemeFontID inFontID,
60005   ThemeDrawState inState,
60006   Rect * outOutset) ;
60007 extern OSStatus
60008 DrawThemeTrack(
60009   const ThemeTrackDrawInfo * drawInfo,
60010   RgnHandle rgnGhost,
60011   ThemeEraseUPP eraseProc,
60012   UInt32 eraseData) ;
60013 extern Boolean
60014 HitTestThemeTrack(
60015   const ThemeTrackDrawInfo * drawInfo,
60016   Point mousePoint,
60017   ControlPartCode * partHit) ;
60018 extern OSStatus
60019 GetThemeTrackBounds(
60020   const ThemeTrackDrawInfo * drawInfo,
60021   Rect * bounds) ;
60022 extern OSStatus
60023 GetThemeTrackThumbRgn(
60024   const ThemeTrackDrawInfo * drawInfo,
60025   RgnHandle thumbRgn) ;
60026 extern OSStatus
60027 GetThemeTrackDragRect(
60028   const ThemeTrackDrawInfo * drawInfo,
60029   Rect * dragRect) ;
60030 extern OSStatus
60031 DrawThemeTrackTickMarks(
60032   const ThemeTrackDrawInfo * drawInfo,
60033   ItemCount numTicks,
60034   ThemeEraseUPP eraseProc,
60035   UInt32 eraseData) ;
60036 extern OSStatus
60037 GetThemeTrackThumbPositionFromOffset(
60038   const ThemeTrackDrawInfo * drawInfo,
60039   Point thumbOffset,
60040   SInt32 * relativePosition) ;
60041 extern OSStatus
60042 GetThemeTrackThumbPositionFromRegion(
60043   const ThemeTrackDrawInfo * drawInfo,
60044   RgnHandle thumbRgn,
60045   SInt32 * relativePosition) ;
60046 extern OSStatus
60047 GetThemeTrackLiveValue(
60048   const ThemeTrackDrawInfo * drawInfo,
60049   SInt32 relativePosition,
60050   SInt32 * value) ;
60051 extern OSStatus
60052 DrawThemeScrollBarArrows(
60053   const Rect * bounds,
60054   ThemeTrackEnableState enableState,
60055   ThemeTrackPressState pressState,
60056   Boolean isHoriz,
60057   Rect * trackBounds) ;
60058 extern OSStatus
60059 GetThemeScrollBarTrackRect(
60060   const Rect * bounds,
60061   ThemeTrackEnableState enableState,
60062   ThemeTrackPressState pressState,
60063   Boolean isHoriz,
60064   Rect * trackBounds) ;
60065 extern Boolean
60066 HitTestThemeScrollBarArrows(
60067   const Rect * scrollBarBounds,
60068   ThemeTrackEnableState enableState,
60069   ThemeTrackPressState pressState,
60070   Boolean isHoriz,
60071   Point ptHit,
60072   Rect * trackBounds,
60073   ControlPartCode * partcode) ;
60074 extern OSStatus
60075 GetThemeWindowRegion(
60076   ThemeWindowType flavor,
60077   const Rect * contRect,
60078   ThemeDrawState state,
60079   const ThemeWindowMetrics * metrics,
60080   ThemeWindowAttributes attributes,
60081   WindowRegionCode winRegion,
60082   RgnHandle rgn) ;
60083 extern OSStatus
60084 DrawThemeWindowFrame(
60085   ThemeWindowType flavor,
60086   const Rect * contRect,
60087   ThemeDrawState state,
60088   const ThemeWindowMetrics * metrics,
60089   ThemeWindowAttributes attributes,
60090   WindowTitleDrawingUPP titleProc,
60091   UInt32 titleData) ;
60092 extern OSStatus
60093 DrawThemeTitleBarWidget(
60094   ThemeWindowType flavor,
60095   const Rect * contRect,
60096   ThemeDrawState state,
60097   const ThemeWindowMetrics * metrics,
60098   ThemeWindowAttributes attributes,
60099   ThemeTitleBarWidget widget) ;
60100 extern Boolean
60101 GetThemeWindowRegionHit(
60102   ThemeWindowType flavor,
60103   const Rect * inContRect,
60104   ThemeDrawState state,
60105   const ThemeWindowMetrics * metrics,
60106   ThemeWindowAttributes inAttributes,
60107   Point inPoint,
60108   WindowRegionCode * outRegionHit) ;
60109 extern OSStatus
60110 DrawThemeScrollBarDelimiters(
60111   ThemeWindowType flavor,
60112   const Rect * inContRect,
60113   ThemeDrawState state,
60114   ThemeWindowAttributes attributes) ;
60115 extern OSStatus
60116 DrawThemeButton(
60117   const Rect * inBounds,
60118   ThemeButtonKind inKind,
60119   const ThemeButtonDrawInfo * inNewInfo,
60120   const ThemeButtonDrawInfo * inPrevInfo,
60121   ThemeEraseUPP inEraseProc,
60122   ThemeButtonDrawUPP inLabelProc,
60123   UInt32 inUserData) ;
60124 extern OSStatus
60125 GetThemeButtonRegion(
60126   const Rect * inBounds,
60127   ThemeButtonKind inKind,
60128   const ThemeButtonDrawInfo * inNewInfo,
60129   RgnHandle outRegion) ;
60130 extern OSStatus
60131 GetThemeButtonContentBounds(
60132   const Rect * inBounds,
60133   ThemeButtonKind inKind,
60134   const ThemeButtonDrawInfo * inDrawInfo,
60135   Rect * outBounds) ;
60136 extern OSStatus
60137 GetThemeButtonBackgroundBounds(
60138   const Rect * inBounds,
60139   ThemeButtonKind inKind,
60140   const ThemeButtonDrawInfo * inDrawInfo,
60141   Rect * outBounds) ;
60142 extern OSStatus
60143 PlayThemeSound(ThemeSoundKind kind) ;
60144 extern OSStatus
60145 BeginThemeDragSound(ThemeDragSoundKind kind) ;
60146 extern OSStatus
60147 EndThemeDragSound(void) ;
60148 extern OSStatus
60149 DrawThemeTickMark(
60150   const Rect * bounds,
60151   ThemeDrawState state) ;
60152 extern OSStatus
60153 DrawThemeChasingArrows(
60154   const Rect * bounds,
60155   UInt32 index,
60156   ThemeDrawState state,
60157   ThemeEraseUPP eraseProc,
60158   UInt32 eraseData) ;
60159 extern OSStatus
60160 DrawThemePopupArrow(
60161   const Rect * bounds,
60162   ThemeArrowOrientation orientation,
60163   ThemePopupArrowSize size,
60164   ThemeDrawState state,
60165   ThemeEraseUPP eraseProc,
60166   UInt32 eraseData) ;
60167 extern OSStatus
60168 DrawThemeStandaloneGrowBox(
60169   Point origin,
60170   ThemeGrowDirection growDirection,
60171   Boolean isSmall,
60172   ThemeDrawState state) ;
60173 extern OSStatus
60174 DrawThemeStandaloneNoGrowBox(
60175   Point origin,
60176   ThemeGrowDirection growDirection,
60177   Boolean isSmall,
60178   ThemeDrawState state) ;
60179 extern OSStatus
60180 GetThemeStandaloneGrowBoxBounds(
60181   Point origin,
60182   ThemeGrowDirection growDirection,
60183   Boolean isSmall,
60184   Rect * bounds) ;
60185 extern OSStatus
60186 NormalizeThemeDrawingState(void) ;
60187 extern OSStatus
60188 GetThemeDrawingState(ThemeDrawingState * outState) ;
60189 extern OSStatus
60190 SetThemeDrawingState(
60191   ThemeDrawingState inState,
60192   Boolean inDisposeNow) ;
60193 extern OSStatus
60194 DisposeThemeDrawingState(ThemeDrawingState inState) ;
60195 extern OSStatus
60196 ApplyThemeBackground(
60197   ThemeBackgroundKind inKind,
60198   const Rect * bounds,
60199   ThemeDrawState inState,
60200   SInt16 inDepth,
60201   Boolean inColorDev) ;
60202 extern OSStatus
60203 SetThemeTextColorForWindow(
60204   WindowRef inWindow,
60205   Boolean inActive,
60206   SInt16 inDepth,
60207   Boolean inColorDev) ;
60208 extern Boolean
60209 IsValidAppearanceFileType(OSType fileType) ;
60210 extern OSStatus
60211 GetThemeBrushAsColor(
60212   ThemeBrush inBrush,
60213   SInt16 inDepth,
60214   Boolean inColorDev,
60215   RGBColor * outColor) ;
60216 extern OSStatus
60217 GetThemeTextColor(
60218   ThemeTextColor inColor,
60219   SInt16 inDepth,
60220   Boolean inColorDev,
60221   RGBColor * outColor) ;
60222 extern OSStatus
60223 GetThemeMetric(
60224   ThemeMetric inMetric,
60225   SInt32 * outMetric) ;
60226 extern OSStatus
60227 CopyThemeIdentifier(CFStringRef * outIdentifier) ;
60228
60229
60230
60231
60232
60233
60234 enum {
60235   appearanceBadBrushIndexErr = themeInvalidBrushErr,
60236   appearanceProcessRegisteredErr = themeProcessRegisteredErr,
60237   appearanceProcessNotRegisteredErr = themeProcessNotRegisteredErr,
60238   appearanceBadTextColorIndexErr = themeBadTextColorErr,
60239   appearanceThemeHasNoAccents = themeHasNoAccentsErr,
60240   appearanceBadCursorIndexErr = themeBadCursorIndexErr
60241 };
60242
60243 enum {
60244   kThemeActiveDialogBackgroundBrush = kThemeBrushDialogBackgroundActive,
60245   kThemeInactiveDialogBackgroundBrush = kThemeBrushDialogBackgroundInactive,
60246   kThemeActiveAlertBackgroundBrush = kThemeBrushAlertBackgroundActive,
60247   kThemeInactiveAlertBackgroundBrush = kThemeBrushAlertBackgroundInactive,
60248   kThemeActiveModelessDialogBackgroundBrush = kThemeBrushModelessDialogBackgroundActive,
60249   kThemeInactiveModelessDialogBackgroundBrush = kThemeBrushModelessDialogBackgroundInactive,
60250   kThemeActiveUtilityWindowBackgroundBrush = kThemeBrushUtilityWindowBackgroundActive,
60251   kThemeInactiveUtilityWindowBackgroundBrush = kThemeBrushUtilityWindowBackgroundInactive,
60252   kThemeListViewSortColumnBackgroundBrush = kThemeBrushListViewSortColumnBackground,
60253   kThemeListViewBackgroundBrush = kThemeBrushListViewBackground,
60254   kThemeIconLabelBackgroundBrush = kThemeBrushIconLabelBackground,
60255   kThemeListViewSeparatorBrush = kThemeBrushListViewSeparator,
60256   kThemeChasingArrowsBrush = kThemeBrushChasingArrows,
60257   kThemeDragHiliteBrush = kThemeBrushDragHilite,
60258   kThemeDocumentWindowBackgroundBrush = kThemeBrushDocumentWindowBackground,
60259   kThemeFinderWindowBackgroundBrush = kThemeBrushFinderWindowBackground
60260 };
60261
60262 enum {
60263   kThemeActiveScrollBarDelimiterBrush = kThemeBrushScrollBarDelimiterActive,
60264   kThemeInactiveScrollBarDelimiterBrush = kThemeBrushScrollBarDelimiterInactive,
60265   kThemeFocusHighlightBrush = kThemeBrushFocusHighlight,
60266   kThemeActivePopupArrowBrush = kThemeBrushPopupArrowActive,
60267   kThemePressedPopupArrowBrush = kThemeBrushPopupArrowPressed,
60268   kThemeInactivePopupArrowBrush = kThemeBrushPopupArrowInactive,
60269   kThemeAppleGuideCoachmarkBrush = kThemeBrushAppleGuideCoachmark
60270 };
60271
60272 enum {
60273   kThemeActiveDialogTextColor = kThemeTextColorDialogActive,
60274   kThemeInactiveDialogTextColor = kThemeTextColorDialogInactive,
60275   kThemeActiveAlertTextColor = kThemeTextColorAlertActive,
60276   kThemeInactiveAlertTextColor = kThemeTextColorAlertInactive,
60277   kThemeActiveModelessDialogTextColor = kThemeTextColorModelessDialogActive,
60278   kThemeInactiveModelessDialogTextColor = kThemeTextColorModelessDialogInactive,
60279   kThemeActiveWindowHeaderTextColor = kThemeTextColorWindowHeaderActive,
60280   kThemeInactiveWindowHeaderTextColor = kThemeTextColorWindowHeaderInactive,
60281   kThemeActivePlacardTextColor = kThemeTextColorPlacardActive,
60282   kThemeInactivePlacardTextColor = kThemeTextColorPlacardInactive,
60283   kThemePressedPlacardTextColor = kThemeTextColorPlacardPressed,
60284   kThemeActivePushButtonTextColor = kThemeTextColorPushButtonActive,
60285   kThemeInactivePushButtonTextColor = kThemeTextColorPushButtonInactive,
60286   kThemePressedPushButtonTextColor = kThemeTextColorPushButtonPressed,
60287   kThemeActiveBevelButtonTextColor = kThemeTextColorBevelButtonActive,
60288   kThemeInactiveBevelButtonTextColor = kThemeTextColorBevelButtonInactive,
60289   kThemePressedBevelButtonTextColor = kThemeTextColorBevelButtonPressed,
60290   kThemeActivePopupButtonTextColor = kThemeTextColorPopupButtonActive,
60291   kThemeInactivePopupButtonTextColor = kThemeTextColorPopupButtonInactive,
60292   kThemePressedPopupButtonTextColor = kThemeTextColorPopupButtonPressed,
60293   kThemeIconLabelTextColor = kThemeTextColorIconLabel,
60294   kThemeListViewTextColor = kThemeTextColorListView
60295 };
60296
60297 enum {
60298   kThemeActiveDocumentWindowTitleTextColor = kThemeTextColorDocumentWindowTitleActive,
60299   kThemeInactiveDocumentWindowTitleTextColor = kThemeTextColorDocumentWindowTitleInactive,
60300   kThemeActiveMovableModalWindowTitleTextColor = kThemeTextColorMovableModalWindowTitleActive,
60301   kThemeInactiveMovableModalWindowTitleTextColor = kThemeTextColorMovableModalWindowTitleInactive,
60302   kThemeActiveUtilityWindowTitleTextColor = kThemeTextColorUtilityWindowTitleActive,
60303   kThemeInactiveUtilityWindowTitleTextColor = kThemeTextColorUtilityWindowTitleInactive,
60304   kThemeActivePopupWindowTitleColor = kThemeTextColorPopupWindowTitleActive,
60305   kThemeInactivePopupWindowTitleColor = kThemeTextColorPopupWindowTitleInactive,
60306   kThemeActiveRootMenuTextColor = kThemeTextColorRootMenuActive,
60307   kThemeSelectedRootMenuTextColor = kThemeTextColorRootMenuSelected,
60308   kThemeDisabledRootMenuTextColor = kThemeTextColorRootMenuDisabled,
60309   kThemeActiveMenuItemTextColor = kThemeTextColorMenuItemActive,
60310   kThemeSelectedMenuItemTextColor = kThemeTextColorMenuItemSelected,
60311   kThemeDisabledMenuItemTextColor = kThemeTextColorMenuItemDisabled,
60312   kThemeActivePopupLabelTextColor = kThemeTextColorPopupLabelActive,
60313   kThemeInactivePopupLabelTextColor = kThemeTextColorPopupLabelInactive
60314 };
60315
60316 enum {
60317   kAEThemeSwitch = kAEAppearanceChanged
60318 };
60319
60320 enum {
60321   kThemeNoAdornment = kThemeAdornmentNone,
60322   kThemeDefaultAdornment = kThemeAdornmentDefault,
60323   kThemeFocusAdornment = kThemeAdornmentFocus,
60324   kThemeRightToLeftAdornment = kThemeAdornmentRightToLeft,
60325   kThemeDrawIndicatorOnly = kThemeAdornmentDrawIndicatorOnly
60326 };
60327
60328 enum {
60329   kThemeBrushPassiveAreaFill = kThemeBrushStaticAreaFill
60330 };
60331
60332 enum {
60333   kThemeMetricCheckBoxGlyphHeight = kThemeMetricCheckBoxHeight,
60334   kThemeMetricRadioButtonGlyphHeight = kThemeMetricRadioButtonHeight,
60335   kThemeMetricDisclosureButtonSize = kThemeMetricDisclosureButtonHeight,
60336   kThemeMetricBestListHeaderHeight = kThemeMetricListHeaderHeight,
60337   kThemeMetricSmallProgressBarThickness = kThemeMetricNormalProgressBarThickness,
60338   kThemeMetricProgressBarThickness = kThemeMetricLargeProgressBarThickness
60339 };
60340
60341 enum {
60342   kThemeScrollBar = kThemeMediumScrollBar,
60343   kThemeSlider = kThemeMediumSlider,
60344   kThemeProgressBar = kThemeMediumProgressBar,
60345   kThemeIndeterminateBar = kThemeMediumIndeterminateBar
60346 };
60347
60348
60349
60350
60351 }
60352 extern "C" {
60353
60354
60355
60356 enum {
60357
60358   kControlDialogItem = 4,
60359   kButtonDialogItem = kControlDialogItem | 0,
60360   kCheckBoxDialogItem = kControlDialogItem | 1,
60361   kRadioButtonDialogItem = kControlDialogItem | 2,
60362   kResourceControlDialogItem = kControlDialogItem | 3,
60363   kStaticTextDialogItem = 8,
60364   kEditTextDialogItem = 16,
60365   kIconDialogItem = 32,
60366   kPictureDialogItem = 64,
60367   kUserDialogItem = 0,
60368   kHelpDialogItem = 1,
60369   kItemDisableBit = 128
60370 };
60371
60372 enum {
60373
60374   ctrlItem = 4,
60375   btnCtrl = 0,
60376   chkCtrl = 1,
60377   radCtrl = 2,
60378   resCtrl = 3,
60379   statText = 8,
60380   editText = 16,
60381   iconItem = 32,
60382   picItem = 64,
60383   userItem = 0,
60384   itemDisable = 128
60385 };
60386
60387 enum {
60388
60389   kStdOkItemIndex = 1,
60390   kStdCancelItemIndex = 2,
60391   ok = kStdOkItemIndex,
60392   cancel = kStdCancelItemIndex
60393 };
60394
60395 enum {
60396
60397   kStopIcon = 0,
60398   kNoteIcon = 1,
60399   kCautionIcon = 2,
60400   stopIcon = kStopIcon,
60401   noteIcon = kNoteIcon,
60402   cautionIcon = kCautionIcon
60403 };
60404 typedef SInt16 DITLMethod;
60405 enum {
60406   overlayDITL = 0,
60407   appendDITLRight = 1,
60408   appendDITLBottom = 2
60409 };
60410
60411 typedef SInt16 StageList;
60412
60413 typedef DialogPtr DialogRef;
60414 struct DialogTemplate {
60415   Rect boundsRect;
60416   SInt16 procID;
60417   Boolean visible;
60418   Boolean filler1;
60419   Boolean goAwayFlag;
60420   Boolean filler2;
60421   SInt32 refCon;
60422   SInt16 itemsID;
60423   Str255 title;
60424 };
60425 typedef struct DialogTemplate DialogTemplate;
60426 typedef DialogTemplate * DialogTPtr;
60427 typedef DialogTPtr * DialogTHndl;
60428 struct AlertTemplate {
60429   Rect boundsRect;
60430   SInt16 itemsID;
60431   StageList stages;
60432 };
60433 typedef struct AlertTemplate AlertTemplate;
60434 typedef AlertTemplate * AlertTPtr;
60435 typedef AlertTPtr * AlertTHndl;
60436
60437 typedef SInt16 DialogItemIndexZeroBased;
60438 typedef SInt16 DialogItemIndex;
60439 typedef SInt16 DialogItemType;
60440
60441 typedef void ( * SoundProcPtr)(SInt16 soundNumber);
60442 typedef Boolean ( * ModalFilterProcPtr)(DialogRef theDialog, EventRecord *theEvent, DialogItemIndex *itemHit);
60443
60444 typedef Boolean ( * ModalFilterYDProcPtr)(DialogRef theDialog, EventRecord *theEvent, short *itemHit, void *yourDataPtr);
60445 typedef void ( * UserItemProcPtr)(DialogRef theDialog, DialogItemIndex itemNo);
60446 typedef SoundProcPtr SoundUPP;
60447 typedef ModalFilterProcPtr ModalFilterUPP;
60448 typedef ModalFilterYDProcPtr ModalFilterYDUPP;
60449 typedef UserItemProcPtr UserItemUPP;
60450 extern ModalFilterUPP
60451 NewModalFilterUPP(ModalFilterProcPtr userRoutine) ;
60452 extern ModalFilterYDUPP
60453 NewModalFilterYDUPP(ModalFilterYDProcPtr userRoutine) ;
60454 extern UserItemUPP
60455 NewUserItemUPP(UserItemProcPtr userRoutine) ;
60456 extern void
60457 DisposeModalFilterUPP(ModalFilterUPP userUPP) ;
60458 extern void
60459 DisposeModalFilterYDUPP(ModalFilterYDUPP userUPP) ;
60460 extern void
60461 DisposeUserItemUPP(UserItemUPP userUPP) ;
60462 extern Boolean
60463 InvokeModalFilterUPP(
60464   DialogRef theDialog,
60465   EventRecord * theEvent,
60466   DialogItemIndex * itemHit,
60467   ModalFilterUPP userUPP) ;
60468 extern Boolean
60469 InvokeModalFilterYDUPP(
60470   DialogRef theDialog,
60471   EventRecord * theEvent,
60472   short * itemHit,
60473   void * yourDataPtr,
60474   ModalFilterYDUPP userUPP) ;
60475 extern void
60476 InvokeUserItemUPP(
60477   DialogRef theDialog,
60478   DialogItemIndex itemNo,
60479   UserItemUPP userUPP) ;
60480
60481
60482
60483
60484
60485
60486
60487 enum {
60488
60489   kAlertStopAlert = 0,
60490   kAlertNoteAlert = 1,
60491   kAlertCautionAlert = 2,
60492   kAlertPlainAlert = 3
60493 };
60494
60495 typedef SInt16 AlertType;
60496 enum {
60497   kAlertDefaultOKText = -1,
60498   kAlertDefaultCancelText = -1,
60499   kAlertDefaultOtherText = -1
60500 };
60501
60502
60503 enum {
60504   kAlertStdAlertOKButton = 1,
60505   kAlertStdAlertCancelButton = 2,
60506   kAlertStdAlertOtherButton = 3,
60507   kAlertStdAlertHelpButton = 4
60508 };
60509
60510 enum {
60511
60512   kDialogFlagsUseThemeBackground = (1 << 0),
60513   kDialogFlagsUseControlHierarchy = (1 << 1),
60514   kDialogFlagsHandleMovableModal = (1 << 2),
60515   kDialogFlagsUseThemeControls = (1 << 3)
60516 };
60517
60518 enum {
60519
60520   kAlertFlagsUseThemeBackground = (1 << 0),
60521   kAlertFlagsUseControlHierarchy = (1 << 1),
60522   kAlertFlagsAlertIsMovable = (1 << 2),
60523   kAlertFlagsUseThemeControls = (1 << 3)
60524 };
60525
60526
60527 enum {
60528   kDialogFontNoFontStyle = 0,
60529   kDialogFontUseFontMask = 0x0001,
60530   kDialogFontUseFaceMask = 0x0002,
60531   kDialogFontUseSizeMask = 0x0004,
60532   kDialogFontUseForeColorMask = 0x0008,
60533   kDialogFontUseBackColorMask = 0x0010,
60534   kDialogFontUseModeMask = 0x0020,
60535   kDialogFontUseJustMask = 0x0040,
60536   kDialogFontUseAllMask = 0x00FF,
60537   kDialogFontAddFontSizeMask = 0x0100,
60538   kDialogFontUseFontNameMask = 0x0200,
60539   kDialogFontAddToMetaFontMask = 0x0400
60540 };
60541
60542
60543
60544 enum {
60545   kDialogFontUseThemeFontIDMask = 0x0080
60546 };
60547
60548 struct AlertStdAlertParamRec {
60549   Boolean movable;
60550   Boolean helpButton;
60551   ModalFilterUPP filterProc;
60552   ConstStringPtr defaultText;
60553   ConstStringPtr cancelText;
60554   ConstStringPtr otherText;
60555   SInt16 defaultButton;
60556   SInt16 cancelButton;
60557   UInt16 position;
60558
60559 };
60560 typedef struct AlertStdAlertParamRec AlertStdAlertParamRec;
60561 typedef AlertStdAlertParamRec * AlertStdAlertParamPtr;
60562 enum {
60563   kHICommandOther = 'othr'
60564 };
60565
60566 enum {
60567   kStdCFStringAlertVersionOne = 1
60568 };
60569
60570
60571
60572
60573
60574
60575
60576 enum {
60577
60578
60579
60580
60581
60582
60583   kStdAlertDoNotDisposeSheet = 1 << 0,
60584
60585
60586
60587
60588
60589
60590   kStdAlertDoNotAnimateOnDefault = 1 << 1,
60591
60592
60593
60594
60595
60596
60597   kStdAlertDoNotAnimateOnCancel = 1 << 2,
60598
60599
60600
60601
60602
60603
60604   kStdAlertDoNotAnimateOnOther = 1 << 3
60605 };
60606
60607 struct AlertStdCFStringAlertParamRec {
60608   UInt32 version;
60609   Boolean movable;
60610   Boolean helpButton;
60611   CFStringRef defaultText;
60612   CFStringRef cancelText;
60613   CFStringRef otherText;
60614   SInt16 defaultButton;
60615   SInt16 cancelButton;
60616   UInt16 position;
60617
60618   OptionBits flags;
60619 };
60620 typedef struct AlertStdCFStringAlertParamRec AlertStdCFStringAlertParamRec;
60621 typedef AlertStdCFStringAlertParamRec * AlertStdCFStringAlertParamPtr;
60622 extern DialogRef
60623 NewDialog(
60624   void * dStorage,
60625   const Rect * boundsRect,
60626   ConstStr255Param title,
60627   Boolean visible,
60628   SInt16 procID,
60629   WindowRef behind,
60630   Boolean goAwayFlag,
60631   SInt32 refCon,
60632   Handle items) ;
60633 extern DialogRef
60634 GetNewDialog(
60635   SInt16 dialogID,
60636   void * dStorage,
60637   WindowRef behind) ;
60638 extern DialogRef
60639 NewColorDialog(
60640   void * dStorage,
60641   const Rect * boundsRect,
60642   ConstStr255Param title,
60643   Boolean visible,
60644   SInt16 procID,
60645   WindowRef behind,
60646   Boolean goAwayFlag,
60647   SInt32 refCon,
60648   Handle items) ;
60649 extern void
60650 DisposeDialog(DialogRef theDialog) ;
60651 extern void
60652 ModalDialog(
60653   ModalFilterUPP modalFilter,
60654   DialogItemIndex * itemHit) ;
60655 extern Boolean
60656 IsDialogEvent(const EventRecord * theEvent) ;
60657 extern Boolean
60658 DialogSelect(
60659   const EventRecord * theEvent,
60660   DialogRef * theDialog,
60661   DialogItemIndex * itemHit) ;
60662 extern void
60663 DrawDialog(DialogRef theDialog) ;
60664 extern void
60665 UpdateDialog(
60666   DialogRef theDialog,
60667   RgnHandle updateRgn) ;
60668 extern void
60669 HideDialogItem(
60670   DialogRef theDialog,
60671   DialogItemIndex itemNo) ;
60672 extern void
60673 ShowDialogItem(
60674   DialogRef theDialog,
60675   DialogItemIndex itemNo) ;
60676 extern DialogItemIndexZeroBased
60677 FindDialogItem(
60678   DialogRef theDialog,
60679   Point thePt) ;
60680 extern void
60681 DialogCut(DialogRef theDialog) ;
60682 extern void
60683 DialogPaste(DialogRef theDialog) ;
60684 extern void
60685 DialogCopy(DialogRef theDialog) ;
60686 extern void
60687 DialogDelete(DialogRef theDialog) ;
60688 extern DialogItemIndex
60689 Alert(
60690   SInt16 alertID,
60691   ModalFilterUPP modalFilter) ;
60692 extern DialogItemIndex
60693 StopAlert(
60694   SInt16 alertID,
60695   ModalFilterUPP modalFilter) ;
60696 extern DialogItemIndex
60697 NoteAlert(
60698   SInt16 alertID,
60699   ModalFilterUPP modalFilter) ;
60700 extern DialogItemIndex
60701 CautionAlert(
60702   SInt16 alertID,
60703   ModalFilterUPP modalFilter) ;
60704 extern void
60705 GetDialogItem(
60706   DialogRef theDialog,
60707   DialogItemIndex itemNo,
60708   DialogItemType * itemType,
60709   Handle * item,
60710   Rect * box) ;
60711 extern void
60712 SetDialogItem(
60713   DialogRef theDialog,
60714   DialogItemIndex itemNo,
60715   DialogItemType itemType,
60716   Handle item,
60717   const Rect * box) ;
60718 extern void
60719 ParamText(
60720   ConstStr255Param param0,
60721   ConstStr255Param param1,
60722   ConstStr255Param param2,
60723   ConstStr255Param param3) ;
60724 extern void
60725 SelectDialogItemText(
60726   DialogRef theDialog,
60727   DialogItemIndex itemNo,
60728   SInt16 strtSel,
60729   SInt16 endSel) ;
60730 extern void
60731 GetDialogItemText(
60732   Handle item,
60733   Str255 text) ;
60734 extern void
60735 SetDialogItemText(
60736   Handle item,
60737   ConstStr255Param text) ;
60738 extern SInt16
60739 GetAlertStage(void) ;
60740 extern void
60741 SetDialogFont(SInt16 fontNum) ;
60742 extern void
60743 ResetAlertStage(void) ;
60744 extern void
60745 GetParamText(
60746   StringPtr param0,
60747   StringPtr param1,
60748   StringPtr param2,
60749   StringPtr param3) ;
60750 extern void
60751 AppendDITL(
60752   DialogRef theDialog,
60753   Handle theHandle,
60754   DITLMethod method) ;
60755 extern DialogItemIndex
60756 CountDITL(DialogRef theDialog) ;
60757 extern void
60758 ShortenDITL(
60759   DialogRef theDialog,
60760   DialogItemIndex numberItems) ;
60761 extern OSStatus
60762 InsertDialogItem(
60763   DialogRef theDialog,
60764   DialogItemIndex afterItem,
60765   DialogItemType itemType,
60766   Handle itemHandle,
60767   const Rect * box) ;
60768 extern OSStatus
60769 RemoveDialogItems(
60770   DialogRef theDialog,
60771   DialogItemIndex itemNo,
60772   DialogItemIndex amountToRemove,
60773   Boolean disposeItemData) ;
60774 extern Boolean
60775 StdFilterProc(
60776   DialogRef theDialog,
60777   EventRecord * event,
60778   DialogItemIndex * itemHit) ;
60779 extern OSErr
60780 GetStdFilterProc(ModalFilterUPP * theProc) ;
60781 extern OSErr
60782 SetDialogDefaultItem(
60783   DialogRef theDialog,
60784   DialogItemIndex newItem) ;
60785 extern OSErr
60786 SetDialogCancelItem(
60787   DialogRef theDialog,
60788   DialogItemIndex newItem) ;
60789 extern OSErr
60790 SetDialogTracksCursor(
60791   DialogRef theDialog,
60792   Boolean tracks) ;
60793 extern DialogRef
60794 NewFeaturesDialog(
60795   void * inStorage,
60796   const Rect * inBoundsRect,
60797   ConstStr255Param inTitle,
60798   Boolean inIsVisible,
60799   SInt16 inProcID,
60800   WindowRef inBehind,
60801   Boolean inGoAwayFlag,
60802   SInt32 inRefCon,
60803   Handle inItemListHandle,
60804   UInt32 inFlags) ;
60805 extern OSErr
60806 AutoSizeDialog(DialogRef inDialog) ;
60807 extern OSErr
60808 StandardAlert(
60809   AlertType inAlertType,
60810   ConstStr255Param inError,
60811   ConstStr255Param inExplanation,
60812   const AlertStdAlertParamRec * inAlertParam,
60813   SInt16 * outItemHit) ;
60814 extern OSStatus
60815 GetStandardAlertDefaultParams(
60816   AlertStdCFStringAlertParamPtr param,
60817   UInt32 version) ;
60818 extern OSStatus
60819 CreateStandardAlert(
60820   AlertType alertType,
60821   CFStringRef error,
60822   CFStringRef explanation,
60823   const AlertStdCFStringAlertParamRec * param,
60824   DialogRef * outAlert) ;
60825 extern OSStatus
60826 RunStandardAlert(
60827   DialogRef inAlert,
60828   ModalFilterUPP filterProc,
60829   DialogItemIndex * outItemHit) ;
60830 extern OSStatus
60831 CreateStandardSheet(
60832   AlertType alertType,
60833   CFStringRef error,
60834   CFStringRef explanation,
60835   const AlertStdCFStringAlertParamRec * param,
60836   EventTargetRef notifyTarget,
60837   DialogRef * outSheet) ;
60838 extern OSStatus
60839 CloseStandardSheet(
60840   DialogRef inSheet,
60841   UInt32 inResultCommand) ;
60842 extern OSErr
60843 GetDialogItemAsControl(
60844   DialogRef inDialog,
60845   SInt16 inItemNo,
60846   ControlRef * outControl) ;
60847 extern OSErr
60848 MoveDialogItem(
60849   DialogRef inDialog,
60850   SInt16 inItemNo,
60851   SInt16 inHoriz,
60852   SInt16 inVert) ;
60853 extern OSErr
60854 SizeDialogItem(
60855   DialogRef inDialog,
60856   SInt16 inItemNo,
60857   SInt16 inWidth,
60858   SInt16 inHeight) ;
60859 extern OSErr
60860 AppendDialogItemList(
60861   DialogRef dialog,
60862   SInt16 ditlID,
60863   DITLMethod method) ;
60864 extern OSStatus
60865 SetDialogTimeout(
60866   DialogRef inDialog,
60867   SInt16 inButtonToPress,
60868   UInt32 inSecondsToWait) ;
60869 extern OSStatus
60870 GetDialogTimeout(
60871   DialogRef inDialog,
60872   SInt16 * outButtonToPress,
60873   UInt32 * outSecondsToWait,
60874   UInt32 * outSecondsRemaining) ;
60875 extern OSStatus
60876 SetModalDialogEventMask(
60877   DialogRef inDialog,
60878   EventMask inMask) ;
60879 extern OSStatus
60880 GetModalDialogEventMask(
60881   DialogRef inDialog,
60882   EventMask * outMask) ;
60883 extern WindowRef
60884 GetDialogWindow(DialogRef dialog) ;
60885 extern TEHandle
60886 GetDialogTextEditHandle(DialogRef dialog) ;
60887 extern SInt16
60888 GetDialogDefaultItem(DialogRef dialog) ;
60889 extern SInt16
60890 GetDialogCancelItem(DialogRef dialog) ;
60891 extern SInt16
60892 GetDialogKeyboardFocusItem(DialogRef dialog) ;
60893 extern void
60894 SetPortDialogPort(DialogRef dialog) ;
60895 extern CGrafPtr
60896 GetDialogPort(DialogRef dialog) ;
60897 extern DialogRef
60898 GetDialogFromWindow(WindowRef window) ;
60899
60900
60901 }
60902
60903
60904
60905 extern "C" {
60906
60907
60908
60909 typedef Point Cell;
60910 typedef Rect ListBounds;
60911 typedef char DataArray[32001];
60912 typedef char * DataPtr;
60913 typedef DataPtr * DataHandle;
60914 typedef short ( * ListSearchProcPtr)(Ptr aPtr, Ptr bPtr, short aLen, short bLen);
60915 typedef Boolean ( * ListClickLoopProcPtr)(void);
60916 typedef ListSearchProcPtr ListSearchUPP;
60917 typedef ListClickLoopProcPtr ListClickLoopUPP;
60918 struct ListRec {
60919   Rect rView;
60920   GrafPtr port;
60921   Point indent;
60922   Point cellSize;
60923   ListBounds visible;
60924   ControlRef vScroll;
60925   ControlRef hScroll;
60926   SInt8 selFlags;
60927   Boolean lActive;
60928   SInt8 lReserved;
60929   SInt8 listFlags;
60930   long clikTime;
60931   Point clikLoc;
60932   Point mouseLoc;
60933   ListClickLoopUPP lClickLoop;
60934   Cell lastClick;
60935   long refCon;
60936   Handle listDefProc;
60937   Handle userHandle;
60938   ListBounds dataBounds;
60939   DataHandle cells;
60940   short maxIndex;
60941   short cellArray[1];
60942 };
60943 typedef struct ListRec ListRec;
60944 typedef ListRec * ListPtr;
60945 typedef ListPtr * ListHandle;
60946
60947 typedef ListHandle ListRef;
60948
60949
60950 enum {
60951
60952   lDrawingModeOffBit = 3,
60953   lDoVAutoscrollBit = 1,
60954   lDoHAutoscrollBit = 0
60955 };
60956
60957 enum {
60958
60959   lDrawingModeOff = 8,
60960   lDoVAutoscroll = 2,
60961   lDoHAutoscroll = 1
60962 };
60963
60964
60965 enum {
60966
60967   lOnlyOneBit = 7,
60968   lExtendDragBit = 6,
60969   lNoDisjointBit = 5,
60970   lNoExtendBit = 4,
60971   lNoRectBit = 3,
60972   lUseSenseBit = 2,
60973   lNoNilHiliteBit = 1
60974 };
60975
60976
60977 enum {
60978
60979   lOnlyOne = -128,
60980   lExtendDrag = 64,
60981   lNoDisjoint = 32,
60982   lNoExtend = 16,
60983   lNoRect = 8,
60984   lUseSense = 4,
60985   lNoNilHilite = 2
60986 };
60987
60988
60989 enum {
60990
60991   lInitMsg = 0,
60992   lDrawMsg = 1,
60993   lHiliteMsg = 2,
60994   lCloseMsg = 3
60995 };
60996
60997
60998
60999
61000
61001 struct StandardIconListCellDataRec {
61002   Handle iconHandle;
61003   short font;
61004   short face;
61005   short size;
61006   Str255 name;
61007 };
61008 typedef struct StandardIconListCellDataRec StandardIconListCellDataRec;
61009 typedef StandardIconListCellDataRec * StandardIconListCellDataPtr;
61010
61011
61012 typedef void ( * ListDefProcPtr)(short lMessage, Boolean lSelect, Rect *lRect, Cell lCell, short lDataOffset, short lDataLen, ListHandle lHandle);
61013 typedef ListDefProcPtr ListDefUPP;
61014 extern ListSearchUPP
61015 NewListSearchUPP(ListSearchProcPtr userRoutine) ;
61016 extern ListClickLoopUPP
61017 NewListClickLoopUPP(ListClickLoopProcPtr userRoutine) ;
61018 extern ListDefUPP
61019 NewListDefUPP(ListDefProcPtr userRoutine) ;
61020 extern void
61021 DisposeListSearchUPP(ListSearchUPP userUPP) ;
61022 extern void
61023 DisposeListClickLoopUPP(ListClickLoopUPP userUPP) ;
61024 extern void
61025 DisposeListDefUPP(ListDefUPP userUPP) ;
61026 extern short
61027 InvokeListSearchUPP(
61028   Ptr aPtr,
61029   Ptr bPtr,
61030   short aLen,
61031   short bLen,
61032   ListSearchUPP userUPP) ;
61033 extern Boolean
61034 InvokeListClickLoopUPP(ListClickLoopUPP userUPP) ;
61035 extern void
61036 InvokeListDefUPP(
61037   short lMessage,
61038   Boolean lSelect,
61039   Rect * lRect,
61040   Cell lCell,
61041   short lDataOffset,
61042   short lDataLen,
61043   ListHandle lHandle,
61044   ListDefUPP userUPP) ;
61045
61046 enum {
61047   kListDefProcPtr = 0,
61048   kListDefUserProcType = kListDefProcPtr,
61049   kListDefStandardTextType = 1,
61050   kListDefStandardIconType = 2
61051 };
61052
61053 typedef UInt32 ListDefType;
61054 struct ListDefSpec {
61055   ListDefType defType;
61056   union {
61057     ListDefUPP userProc;
61058   } u;
61059 };
61060 typedef struct ListDefSpec ListDefSpec;
61061 typedef ListDefSpec * ListDefSpecPtr;
61062 extern OSStatus
61063 CreateCustomList(
61064   const Rect * rView,
61065   const ListBounds * dataBounds,
61066   Point cellSize,
61067   const ListDefSpec * theSpec,
61068   WindowRef theWindow,
61069   Boolean drawIt,
61070   Boolean hasGrow,
61071   Boolean scrollHoriz,
61072   Boolean scrollVert,
61073   ListHandle * outList) ;
61074 extern ListHandle
61075 LNew(
61076   const Rect * rView,
61077   const ListBounds * dataBounds,
61078   Point cSize,
61079   short theProc,
61080   WindowRef theWindow,
61081   Boolean drawIt,
61082   Boolean hasGrow,
61083   Boolean scrollHoriz,
61084   Boolean scrollVert) ;
61085 extern void
61086 LDispose(ListHandle lHandle) ;
61087 extern short
61088 LAddColumn(
61089   short count,
61090   short colNum,
61091   ListHandle lHandle) ;
61092 extern short
61093 LAddRow(
61094   short count,
61095   short rowNum,
61096   ListHandle lHandle) ;
61097 extern void
61098 LDelColumn(
61099   short count,
61100   short colNum,
61101   ListHandle lHandle) ;
61102 extern void
61103 LDelRow(
61104   short count,
61105   short rowNum,
61106   ListHandle lHandle) ;
61107 extern Boolean
61108 LGetSelect(
61109   Boolean next,
61110   Cell * theCell,
61111   ListHandle lHandle) ;
61112 extern Cell
61113 LLastClick(ListHandle lHandle) ;
61114 extern Boolean
61115 LNextCell(
61116   Boolean hNext,
61117   Boolean vNext,
61118   Cell * theCell,
61119   ListHandle lHandle) ;
61120 extern Boolean
61121 LSearch(
61122   const void * dataPtr,
61123   short dataLen,
61124   ListSearchUPP searchProc,
61125   Cell * theCell,
61126   ListHandle lHandle) ;
61127 extern void
61128 LSize(
61129   short listWidth,
61130   short listHeight,
61131   ListHandle lHandle) ;
61132 extern void
61133 LSetDrawingMode(
61134   Boolean drawIt,
61135   ListHandle lHandle) ;
61136 extern void
61137 LScroll(
61138   short dCols,
61139   short dRows,
61140   ListHandle lHandle) ;
61141 extern void
61142 LAutoScroll(ListHandle lHandle) ;
61143 extern void
61144 LUpdate(
61145   RgnHandle theRgn,
61146   ListHandle lHandle) ;
61147 extern void
61148 LActivate(
61149   Boolean act,
61150   ListHandle lHandle) ;
61151 extern void
61152 LCellSize(
61153   Point cSize,
61154   ListHandle lHandle) ;
61155 extern Boolean
61156 LClick(
61157   Point pt,
61158   EventModifiers modifiers,
61159   ListHandle lHandle) ;
61160 extern void
61161 LAddToCell(
61162   const void * dataPtr,
61163   short dataLen,
61164   Cell theCell,
61165   ListHandle lHandle) ;
61166 extern void
61167 LClrCell(
61168   Cell theCell,
61169   ListHandle lHandle) ;
61170 extern void
61171 LGetCell(
61172   void * dataPtr,
61173   short * dataLen,
61174   Cell theCell,
61175   ListHandle lHandle) ;
61176 extern void
61177 LRect(
61178   Rect * cellRect,
61179   Cell theCell,
61180   ListHandle lHandle) ;
61181 extern void
61182 LSetCell(
61183   const void * dataPtr,
61184   short dataLen,
61185   Cell theCell,
61186   ListHandle lHandle) ;
61187 extern void
61188 LSetSelect(
61189   Boolean setIt,
61190   Cell theCell,
61191   ListHandle lHandle) ;
61192 extern void
61193 LDraw(
61194   Cell theCell,
61195   ListHandle lHandle) ;
61196 extern void
61197 LGetCellDataLocation(
61198   short * offset,
61199   short * len,
61200   Cell theCell,
61201   ListHandle lHandle) ;
61202 extern OSStatus
61203 RegisterListDefinition(
61204   SInt16 inResID,
61205   ListDefSpecPtr inDefSpec) ;
61206 extern Rect *
61207 GetListViewBounds(
61208   ListHandle list,
61209   Rect * view) ;
61210 extern CGrafPtr
61211 GetListPort(ListHandle list) ;
61212 extern Point *
61213 GetListCellIndent(
61214   ListHandle list,
61215   Point * indent) ;
61216 extern Point *
61217 GetListCellSize(
61218   ListHandle list,
61219   Point * size) ;
61220 extern ListBounds *
61221 GetListVisibleCells(
61222   ListHandle list,
61223   ListBounds * visible) ;
61224 extern ControlRef
61225 GetListVerticalScrollBar(ListHandle list) ;
61226 extern ControlRef
61227 GetListHorizontalScrollBar(ListHandle list) ;
61228 extern Boolean
61229 GetListActive(ListHandle list) ;
61230 extern SInt32
61231 GetListClickTime(ListHandle list) ;
61232 extern Point *
61233 GetListClickLocation(
61234   ListHandle list,
61235   Point * click) ;
61236 extern Point *
61237 GetListMouseLocation(
61238   ListHandle list,
61239   Point * mouse) ;
61240 extern ListClickLoopUPP
61241 GetListClickLoop(ListHandle list) ;
61242 extern SInt32
61243 GetListRefCon(ListHandle list) ;
61244 extern Handle
61245 GetListDefinition(ListHandle list) ;
61246 extern Handle
61247 GetListUserHandle(ListHandle list) ;
61248 extern ListBounds *
61249 GetListDataBounds(
61250   ListHandle list,
61251   ListBounds * bounds) ;
61252 extern DataHandle
61253 GetListDataHandle(ListHandle list) ;
61254 extern OptionBits
61255 GetListFlags(ListHandle list) ;
61256 extern OptionBits
61257 GetListSelectionFlags(ListHandle list) ;
61258 extern void
61259 SetListViewBounds(
61260   ListHandle list,
61261   const Rect * view) ;
61262 extern void
61263 SetListPort(
61264   ListHandle list,
61265   CGrafPtr port) ;
61266 extern void
61267 SetListCellIndent(
61268   ListHandle list,
61269   Point * indent) ;
61270 extern void
61271 SetListClickTime(
61272   ListHandle list,
61273   SInt32 time) ;
61274 extern void
61275 SetListClickLoop(
61276   ListHandle list,
61277   ListClickLoopUPP clickLoop) ;
61278 extern void
61279 SetListLastClick(
61280   ListHandle list,
61281   Cell * lastClick) ;
61282 extern void
61283 SetListRefCon(
61284   ListHandle list,
61285   SInt32 refCon) ;
61286 extern void
61287 SetListUserHandle(
61288   ListHandle list,
61289   Handle userHandle) ;
61290 extern void
61291 SetListFlags(
61292   ListHandle list,
61293   OptionBits listFlags) ;
61294 extern void
61295 SetListSelectionFlags(
61296   ListHandle list,
61297   OptionBits selectionFlags) ;
61298
61299
61300 }
61301 extern "C" {
61302
61303
61304
61305
61306
61307 typedef Boolean ( * AEIdleProcPtr)(EventRecord *theEvent, long *sleepTime, RgnHandle *mouseRgn);
61308 typedef Boolean ( * AEFilterProcPtr)(EventRecord *theEvent, long returnID, long transactionID, const AEAddressDesc *sender);
61309 typedef AEIdleProcPtr AEIdleUPP;
61310 typedef AEFilterProcPtr AEFilterUPP;
61311 extern OSErr
61312 AESend(
61313   const AppleEvent * theAppleEvent,
61314   AppleEvent * reply,
61315   AESendMode sendMode,
61316   AESendPriority sendPriority,
61317   long timeOutInTicks,
61318   AEIdleUPP idleProc,
61319   AEFilterUPP filterProc) ;
61320 extern OSErr
61321 AEProcessAppleEvent(const EventRecord * theEventRecord) ;
61322 extern OSErr
61323 AEResetTimer(const AppleEvent * reply) ;
61324 typedef SInt8 AEInteractAllowed;
61325 enum {
61326   kAEInteractWithSelf = 0,
61327   kAEInteractWithLocal = 1,
61328   kAEInteractWithAll = 2
61329 };
61330 extern OSErr
61331 AEGetInteractionAllowed(AEInteractAllowed * level) ;
61332 extern OSErr
61333 AESetInteractionAllowed(AEInteractAllowed level) ;
61334 extern OSErr
61335 AEInteractWithUser(
61336   long timeOutInTicks,
61337   NMRecPtr nmReqPtr,
61338   AEIdleUPP idleProc) ;
61339 extern OSErr
61340 AESuspendTheCurrentEvent(const AppleEvent * theAppleEvent) ;
61341 enum {
61342   kAEDoNotIgnoreHandler = 0x00000000,
61343   kAEIgnoreAppPhacHandler = 0x00000001,
61344   kAEIgnoreAppEventHandler = 0x00000002,
61345   kAEIgnoreSysPhacHandler = 0x00000004,
61346   kAEIgnoreSysEventHandler = 0x00000008,
61347   kAEIngoreBuiltInEventHandler = 0x00000010,
61348   kAEDontDisposeOnResume = (long)0x80000000
61349 };
61350
61351
61352 enum {
61353   kAENoDispatch = 0,
61354   kAEUseStandardDispatch = (long)0xFFFFFFFF
61355 };
61356 extern OSErr
61357 AEResumeTheCurrentEvent(
61358   const AppleEvent * theAppleEvent,
61359   const AppleEvent * reply,
61360   AEEventHandlerUPP dispatcher,
61361   long handlerRefcon) ;
61362 extern OSErr
61363 AEGetTheCurrentEvent(AppleEvent * theAppleEvent) ;
61364 extern OSErr
61365 AESetTheCurrentEvent(const AppleEvent * theAppleEvent) ;
61366 extern AEIdleUPP
61367 NewAEIdleUPP(AEIdleProcPtr userRoutine) ;
61368 extern AEFilterUPP
61369 NewAEFilterUPP(AEFilterProcPtr userRoutine) ;
61370 extern void
61371 DisposeAEIdleUPP(AEIdleUPP userUPP) ;
61372 extern void
61373 DisposeAEFilterUPP(AEFilterUPP userUPP) ;
61374 extern Boolean
61375 InvokeAEIdleUPP(
61376   EventRecord * theEvent,
61377   long * sleepTime,
61378   RgnHandle * mouseRgn,
61379   AEIdleUPP userUPP) ;
61380 extern Boolean
61381 InvokeAEFilterUPP(
61382   EventRecord * theEvent,
61383   long returnID,
61384   long transactionID,
61385   const AEAddressDesc * sender,
61386   AEFilterUPP userUPP) ;
61387
61388
61389
61390
61391
61392
61393 }
61394 extern "C" {
61395
61396
61397
61398 enum {
61399   kTextService = 'tsvc',
61400   kTSMVersion = 0x0150
61401 };
61402
61403
61404
61405
61406
61407
61408 enum {
61409   kKeyboardInputMethodClass = 'inpm',
61410   kInkInputMethodClass = 'ink ',
61411   kCharacterPaletteInputMethodClass = 'cplt'
61412 };
61413
61414 typedef OSType TextServiceClass;
61415 enum {
61416   kTSClassHonorUserSetting = 1,
61417   kTSClassForceSetting = 2,
61418   kTSClassForceToHonorUserSetting = 3
61419 };
61420
61421 typedef UInt32 TSClassEnablingForceLevel;
61422 enum {
61423   kUnicodeDocument = 'udoc',
61424   kUnicodeTextService = 'utsv'
61425 };
61426
61427
61428 enum {
61429   kTSMDocumentPropertySupportGlyphInfo = 'dpgi'
61430 };
61431
61432
61433
61434 enum {
61435   kUnknownLanguage = 0xFFFF,
61436   kUnknownScript = 0xFFFF,
61437   kNeutralScript = 0xFFFF
61438 };
61439
61440
61441 enum {
61442   kTextServiceVersion2 = 'tsv2'
61443 };
61444
61445
61446
61447 enum {
61448   kInteractiveServicesTag = 'tmin',
61449   kLocaleIDTag = 'loce',
61450   kTextInputObjectTag = 'tiot',
61451   kLocaleObjectRefTag = 'lobj',
61452   kLocaleRefTag = 'lref',
61453   kKeyboardInputMethodContextTag = 'kinp',
61454   kKeyboardLocaleObjectRefTag = 'kilo',
61455   kHandwritingInputMethodContextTag = 'hinp',
61456   kHandwritingLocaleObjectRefTag = 'hilo',
61457   kSpeechInputMethodContextTag = 'sinp',
61458   kSpeechLocaleObjectRefTag = 'silo',
61459   kPasswordModeTag = 'pwdm',
61460   kRefconTag = 'refc',
61461   kUseFloatingWindowTag = 'uswm',
61462   kReadOnlyDocumentTag = 'isro',
61463   kSupportsMultiInlineHolesTag = 'minl',
61464   kProtocolVersionTag = 'nprt',
61465   kTSMContextCollectionTag = 'tsmx'
61466 };
61467
61468
61469
61470 enum {
61471   kIMRomanInputMode = 'romn',
61472   kIMPasswordInputMode = 'pasw',
61473   kIMXingInputMode = 'xing',
61474   kIMHuaInputMode = 'huam',
61475   kIMPinyinInputMode = 'piny',
61476   kIMQuweiInputMode = 'quwe',
61477   kIMCangjieInputMode = 'cgji',
61478   kIMJianyiInputMode = 'jnyi',
61479   kIMZhuyinInputMode = 'zhuy',
61480   kIMB5CodeInputMode = 'b5cd',
61481   kIMKatakanaInputMode = 'kata',
61482   kIMHiraganaInputMode = 'hira'
61483 };
61484
61485
61486
61487 enum {
61488   kIM2ByteInputMode = '2byt',
61489   kIM1ByteInputMode = '1byt',
61490   kIMDirectInputMode = 'dinp'
61491 };
61492 enum {
61493   kNeedsInputWindow = 1,
61494   kHandlesUpdateRegion = 2,
61495   kHandlesGetRegion = 3,
61496   kHandlesPos2Offset = 4,
61497   kHandlesOffset2Pos = 5,
61498   kInPasswordMode = 6,
61499   kHandleMultipleHoles = 7,
61500   kDocumentIsReadOnly = 8
61501 };
61502
61503 enum {
61504
61505   bTakeActiveEvent = 15,
61506   bHandleAERecording = 16,
61507   bScriptMask = 0x00007F00,
61508   bLanguageMask = 0x000000FF,
61509   bScriptLanguageMask = bScriptMask + bLanguageMask
61510 };
61511
61512 enum {
61513
61514   kIMJaTypingMethodProperty = 'jtyp',
61515   kIMJaTypingMethodRoman = 'roma',
61516   kIMJaTypingMethodKana = 'kana'
61517 };
61518
61519 enum {
61520
61521   kCMGetScriptLangSupport = 0x0001,
61522   kCMInitiateTextService = 0x0002,
61523   kCMTerminateTextService = 0x0003,
61524   kCMActivateTextService = 0x0004,
61525   kCMDeactivateTextService = 0x0005,
61526   kCMTextServiceEvent = 0x0006,
61527   kCMGetTextServiceMenu = 0x0007,
61528   kCMTextServiceMenuSelect = 0x0008,
61529   kCMFixTextService = 0x0009,
61530   kCMSetTextServiceCursor = 0x000A,
61531   kCMHidePaletteWindows = 0x000B,
61532   kCMGetTextServiceProperty = 0x000C,
61533   kCMSetTextServiceProperty = 0x000D
61534 };
61535
61536 enum {
61537
61538   kCMUCTextServiceEvent = 0x000E
61539 };
61540
61541
61542
61543
61544
61545
61546
61547 typedef struct OpaqueTSMContext* TSMContext;
61548 typedef struct OpaqueTSMDocumentID* TSMDocumentID;
61549 typedef OSType InterfaceTypeList[1];
61550
61551
61552 struct TextServiceInfo {
61553   Component fComponent;
61554   Str255 fItemName;
61555 };
61556 typedef struct TextServiceInfo TextServiceInfo;
61557 typedef TextServiceInfo * TextServiceInfoPtr;
61558 struct TextServiceList {
61559   short fTextServiceCount;
61560   TextServiceInfo fServices[1];
61561 };
61562 typedef struct TextServiceList TextServiceList;
61563 typedef TextServiceList * TextServiceListPtr;
61564 typedef TextServiceListPtr * TextServiceListHandle;
61565 struct ScriptLanguageRecord {
61566   ScriptCode fScript;
61567   LangCode fLanguage;
61568 };
61569 typedef struct ScriptLanguageRecord ScriptLanguageRecord;
61570 struct ScriptLanguageSupport {
61571   short fScriptLanguageCount;
61572   ScriptLanguageRecord fScriptLanguageArray[1];
61573 };
61574 typedef struct ScriptLanguageSupport ScriptLanguageSupport;
61575 typedef ScriptLanguageSupport * ScriptLanguageSupportPtr;
61576 typedef ScriptLanguageSupportPtr * ScriptLanguageSupportHandle;
61577 struct TSMGlyphInfo {
61578   CFRange range;
61579   ATSFontRef fontRef;
61580   UInt16 collection;
61581   UInt16 glyphID;
61582 };
61583 typedef struct TSMGlyphInfo TSMGlyphInfo;
61584 struct TSMGlyphInfoArray {
61585   ItemCount numGlyphInfo;
61586   TSMGlyphInfo glyphInfo[1];
61587 };
61588 typedef struct TSMGlyphInfoArray TSMGlyphInfoArray;
61589 extern OSErr
61590 NewTSMDocument(
61591   short numOfInterface,
61592   InterfaceTypeList supportedInterfaceTypes,
61593   TSMDocumentID * idocID,
61594   long refcon) ;
61595 extern OSErr
61596 DeleteTSMDocument(TSMDocumentID idocID) ;
61597 extern OSErr
61598 ActivateTSMDocument(TSMDocumentID idocID) ;
61599 extern OSErr
61600 DeactivateTSMDocument(TSMDocumentID idocID) ;
61601 extern OSErr
61602 FixTSMDocument(TSMDocumentID idocID) ;
61603 extern OSErr
61604 GetServiceList(
61605   short numOfInterface,
61606   OSType * supportedInterfaceTypes,
61607   TextServiceListHandle * serviceInfo,
61608   long * seedValue) ;
61609 extern OSErr
61610 OpenTextService(
61611   TSMDocumentID idocID,
61612   Component aComponent,
61613   ComponentInstance * aComponentInstance) ;
61614 extern OSErr
61615 CloseTextService(
61616   TSMDocumentID idocID,
61617   ComponentInstance aComponentInstance) ;
61618 extern OSErr
61619 SendAEFromTSMComponent(
61620   const AppleEvent * theAppleEvent,
61621   AppleEvent * reply,
61622   AESendMode sendMode,
61623   AESendPriority sendPriority,
61624   long timeOutInTicks,
61625   AEIdleUPP idleProc,
61626   AEFilterUPP filterProc) ;
61627 extern OSStatus
61628 SendTextInputEvent(EventRef inEvent) ;
61629 extern OSErr
61630 SetDefaultInputMethod(
61631   Component ts,
61632   ScriptLanguageRecord * slRecordPtr) ;
61633 extern OSErr
61634 GetDefaultInputMethod(
61635   Component * ts,
61636   ScriptLanguageRecord * slRecordPtr) ;
61637 extern OSErr
61638 SetTextServiceLanguage(ScriptLanguageRecord * slRecordPtr) ;
61639 extern OSErr
61640 GetTextServiceLanguage(ScriptLanguageRecord * slRecordPtr) ;
61641 extern OSErr
61642 UseInputWindow(
61643   TSMDocumentID idocID,
61644   Boolean useWindow) ;
61645 extern OSStatus
61646 TSMSetInlineInputRegion(
61647   TSMDocumentID inTSMDocument,
61648   WindowRef inWindow,
61649   RgnHandle inRegion) ;
61650 extern ComponentResult
61651 GetScriptLanguageSupport(
61652   ComponentInstance ts,
61653   ScriptLanguageSupportHandle * scriptHdl) ;
61654 extern ComponentResult
61655 InitiateTextService(ComponentInstance ts) ;
61656 extern ComponentResult
61657 TerminateTextService(ComponentInstance ts) ;
61658 extern ComponentResult
61659 ActivateTextService(ComponentInstance ts) ;
61660 extern ComponentResult
61661 DeactivateTextService(ComponentInstance ts) ;
61662 extern ComponentResult
61663 GetTextServiceMenu(
61664   ComponentInstance ts,
61665   MenuRef * serviceMenu) ;
61666 extern ComponentResult
61667 TextServiceEventRef(
61668   ComponentInstance ts,
61669   EventRef event) ;
61670 extern ComponentResult
61671 FixTextService(ComponentInstance ts) ;
61672 extern ComponentResult
61673 HidePaletteWindows(ComponentInstance ts) ;
61674 extern ComponentResult
61675 GetTextServiceProperty(
61676   ComponentInstance ts,
61677   OSType propertySelector,
61678   SInt32 * result) ;
61679 extern ComponentResult
61680 SetTextServiceProperty(
61681   ComponentInstance ts,
61682   OSType propertySelector,
61683   SInt32 value) ;
61684 extern TSMDocumentID
61685 TSMGetActiveDocument(void) ;
61686 extern OSStatus
61687 GetDefaultInputMethodOfClass(
61688   Component * aComp,
61689   ScriptLanguageRecord * slRecPtr,
61690   TextServiceClass tsClass) ;
61691 extern OSStatus
61692 SetDefaultInputMethodOfClass(
61693   Component aComp,
61694   ScriptLanguageRecord * slRecPtr,
61695   TextServiceClass tsClass) ;
61696 extern OSStatus
61697 DeselectTextService(Component aComp) ;
61698 extern OSStatus
61699 SelectTextService(Component aComp) ;
61700 extern OSStatus
61701 TSMSetDocumentProperty(
61702   TSMDocumentID docID,
61703   OSType propertyTag,
61704   UInt32 propertySize,
61705   void * propertyData) ;
61706 extern OSStatus
61707 TSMGetDocumentProperty(
61708   TSMDocumentID docID,
61709   OSType propertyTag,
61710   UInt32 bufferSize,
61711   UInt32 * actualSize,
61712   void * propertyBuffer) ;
61713 extern OSStatus
61714 TSMRemoveDocumentProperty(
61715   TSMDocumentID docID,
61716   OSType propertyTag) ;
61717
61718
61719 }
61720
61721
61722
61723 extern "C" {
61724
61725
61726 typedef FourCharCode ScrapFlavorType;
61727
61728
61729
61730
61731
61732
61733 enum {
61734   kScrapFlavorTypePicture = 'PICT',
61735   kScrapFlavorTypeText = 'TEXT',
61736   kScrapFlavorTypeTextStyle = 'styl',
61737   kScrapFlavorTypeMovie = 'moov',
61738   kScrapFlavorTypeSound = 'snd ',
61739   kScrapFlavorTypeUnicode = 'utxt',
61740   kScrapFlavorTypeUnicodeStyle = 'ustl'
61741 };
61742 extern OSStatus
61743 LoadScrap(void) ;
61744 extern OSStatus
61745 UnloadScrap(void) ;
61746 enum {
61747   kScrapFlavorSizeUnknown = -1
61748 };
61749
61750
61751
61752
61753
61754
61755
61756 enum {
61757   kScrapReservedFlavorType = 'srft'
61758 };
61759 enum {
61760   kScrapFlavorMaskNone = 0x00000000,
61761   kScrapFlavorMaskSenderOnly = 0x00000001,
61762   kScrapFlavorMaskTranslated = 0x00000002
61763 };
61764
61765 typedef UInt32 ScrapFlavorFlags;
61766
61767
61768
61769
61770 struct ScrapFlavorInfo {
61771   ScrapFlavorType flavorType;
61772   ScrapFlavorFlags flavorFlags;
61773 };
61774 typedef struct ScrapFlavorInfo ScrapFlavorInfo;
61775 typedef struct OpaqueScrapRef* ScrapRef;
61776 enum {
61777   kScrapGetNamedScrap = 0,
61778   kScrapClearNamedScrap = (1L << 0)
61779 };
61780 extern OSStatus
61781 GetScrapByName(
61782   CFStringRef name,
61783   OptionBits options,
61784   ScrapRef * scrap) ;
61785 extern OSStatus
61786 GetCurrentScrap(ScrapRef * scrap) ;
61787 extern OSStatus
61788 GetScrapFlavorFlags(
61789   ScrapRef scrap,
61790   ScrapFlavorType flavorType,
61791   ScrapFlavorFlags * flavorFlags) ;
61792 extern OSStatus
61793 GetScrapFlavorSize(
61794   ScrapRef scrap,
61795   ScrapFlavorType flavorType,
61796   Size * byteCount) ;
61797 extern OSStatus
61798 GetScrapFlavorData(
61799   ScrapRef scrap,
61800   ScrapFlavorType flavorType,
61801   Size * byteCount,
61802   void * destination) ;
61803 extern OSStatus
61804 ClearCurrentScrap(void) ;
61805 extern OSStatus
61806 ClearScrap(ScrapRef * inOutScrap) ;
61807 extern OSStatus
61808 PutScrapFlavor(
61809   ScrapRef scrap,
61810   ScrapFlavorType flavorType,
61811   ScrapFlavorFlags flavorFlags,
61812   Size flavorSize,
61813   const void * flavorData) ;
61814 typedef OSStatus ( * ScrapPromiseKeeperProcPtr)(ScrapRef scrap, ScrapFlavorType flavorType, void *userData);
61815 typedef ScrapPromiseKeeperProcPtr ScrapPromiseKeeperUPP;
61816 extern ScrapPromiseKeeperUPP
61817 NewScrapPromiseKeeperUPP(ScrapPromiseKeeperProcPtr userRoutine) ;
61818 extern void
61819 DisposeScrapPromiseKeeperUPP(ScrapPromiseKeeperUPP userUPP) ;
61820 extern OSStatus
61821 InvokeScrapPromiseKeeperUPP(
61822   ScrapRef scrap,
61823   ScrapFlavorType flavorType,
61824   void * userData,
61825   ScrapPromiseKeeperUPP userUPP) ;
61826 extern OSStatus
61827 SetScrapPromiseKeeper(
61828   ScrapRef scrap,
61829   ScrapPromiseKeeperUPP upp,
61830   const void * userData) ;
61831 extern OSStatus
61832 GetScrapFlavorCount(
61833   ScrapRef scrap,
61834   UInt32 * infoCount) ;
61835 extern OSStatus
61836 GetScrapFlavorInfoList(
61837   ScrapRef scrap,
61838   UInt32 * infoCount,
61839   ScrapFlavorInfo info[]) ;
61840 extern OSStatus
61841 CallInScrapPromises(void) ;
61842
61843
61844
61845
61846
61847 }
61848
61849
61850
61851 extern "C" {
61852
61853
61854
61855
61856
61857 typedef struct OpaqueTXNObject* TXNObject;
61858 typedef struct OpaqueTXNFontMenuObject* TXNFontMenuObject;
61859 typedef UInt32 TXNFrameID;
61860 typedef UInt32 TXNVersionValue;
61861 enum {
61862   kTXNWillDefaultToATSUIBit = 0,
61863   kTXNWillDefaultToCarbonEventBit = 1
61864 };
61865
61866
61867 typedef OptionBits TXNFeatureBits;
61868 enum {
61869   kTXNWillDefaultToATSUIMask = 1L << kTXNWillDefaultToATSUIBit,
61870   kTXNWillDefaultToCarbonEventMask = 1L << kTXNWillDefaultToCarbonEventBit
61871 };
61872
61873 enum {
61874   kTXNWantMoviesBit = 0,
61875   kTXNWantSoundBit = 1,
61876   kTXNWantGraphicsBit = 2,
61877   kTXNAlwaysUseQuickDrawTextBit = 3,
61878   kTXNUseTemporaryMemoryBit = 4
61879 };
61880
61881
61882 typedef OptionBits TXNInitOptions;
61883 enum {
61884   kTXNWantMoviesMask = 1L << kTXNWantMoviesBit,
61885   kTXNWantSoundMask = 1L << kTXNWantSoundBit,
61886   kTXNWantGraphicsMask = 1L << kTXNWantGraphicsBit,
61887   kTXNAlwaysUseQuickDrawTextMask = 1L << kTXNAlwaysUseQuickDrawTextBit,
61888   kTXNUseTemporaryMemoryMask = 1L << kTXNUseTemporaryMemoryBit
61889 };
61890
61891 enum {
61892   kTXNDrawGrowIconBit = 0,
61893   kTXNShowWindowBit = 1,
61894   kTXNWantHScrollBarBit = 2,
61895   kTXNWantVScrollBarBit = 3,
61896   kTXNNoTSMEverBit = 4,
61897   kTXNReadOnlyBit = 5,
61898   kTXNNoKeyboardSyncBit = 6,
61899   kTXNNoSelectionBit = 7,
61900   kTXNSaveStylesAsSTYLResourceBit = 8,
61901   kOutputTextInUnicodeEncodingBit = 9,
61902   kTXNDoNotInstallDragProcsBit = 10,
61903   kTXNAlwaysWrapAtViewEdgeBit = 11,
61904   kTXNDontDrawCaretWhenInactiveBit = 12,
61905   kTXNDontDrawSelectionWhenInactiveBit = 13,
61906   kTXNSingleLineOnlyBit = 14,
61907   kTXNDisableDragAndDropBit = 15,
61908   kTXNUseQDforImagingBit = 16,
61909   kTXNMonostyledTextBit = 17
61910 };
61911 typedef OptionBits TXNFrameOptions;
61912 enum {
61913
61914
61915
61916
61917   kTXNDrawGrowIconMask = 1L << kTXNDrawGrowIconBit,
61918
61919
61920
61921
61922
61923
61924
61925   kTXNShowWindowMask = 1L << kTXNShowWindowBit,
61926
61927
61928
61929
61930   kTXNWantHScrollBarMask = 1L << kTXNWantHScrollBarBit,
61931
61932
61933
61934
61935   kTXNWantVScrollBarMask = 1L << kTXNWantVScrollBarBit,
61936
61937
61938
61939
61940
61941   kTXNNoTSMEverMask = 1L << kTXNNoTSMEverBit,
61942
61943
61944
61945
61946   kTXNReadOnlyMask = 1L << kTXNReadOnlyBit,
61947
61948
61949
61950
61951   kTXNNoKeyboardSyncMask = 1L << kTXNNoKeyboardSyncBit,
61952
61953
61954
61955
61956
61957   kTXNNoSelectionMask = 1L << kTXNNoSelectionBit,
61958   kTXNSaveStylesAsSTYLResourceMask = 1L << kTXNSaveStylesAsSTYLResourceBit,
61959
61960
61961
61962
61963   kOutputTextInUnicodeEncodingMask = 1L << kOutputTextInUnicodeEncodingBit,
61964
61965
61966
61967
61968
61969
61970   kTXNDoNotInstallDragProcsMask = 1L << kTXNDoNotInstallDragProcsBit,
61971
61972
61973
61974
61975   kTXNAlwaysWrapAtViewEdgeMask = 1L << kTXNAlwaysWrapAtViewEdgeBit,
61976
61977
61978
61979
61980
61981   kTXNDontDrawCaretWhenInactiveMask = 1L << kTXNDontDrawCaretWhenInactiveBit,
61982
61983
61984
61985
61986
61987   kTXNDontDrawSelectionWhenInactiveMask = 1L << kTXNDontDrawSelectionWhenInactiveBit,
61988
61989
61990
61991
61992
61993
61994
61995   kTXNSingleLineOnlyMask = 1L << kTXNSingleLineOnlyBit,
61996
61997
61998
61999
62000
62001   kTXNDisableDragAndDropMask = 1L << kTXNDisableDragAndDropBit,
62002
62003
62004
62005
62006
62007   kTXNUseQDforImagingMask = 1L << kTXNUseQDforImagingBit,
62008
62009
62010
62011
62012
62013   kTXNMonostyledTextMask = 1L << kTXNMonostyledTextBit
62014 };
62015
62016 enum {
62017   kTXNSetFlushnessBit = 0,
62018   kTXNSetJustificationBit = 1,
62019   kTXNUseFontFallBackBit = 2,
62020   kTXNRotateTextBit = 3,
62021   kTXNUseVerticalTextBit = 4,
62022   kTXNDontUpdateBoxRectBit = 5,
62023   kTXNDontDrawTextBit = 6,
62024   kTXNUseCGContextRefBit = 7,
62025   kTXNImageWithQDBit = 8,
62026   kTXNDontWrapTextBit = 9
62027 };
62028 typedef OptionBits TXNTextBoxOptions;
62029 enum {
62030
62031
62032
62033
62034
62035   kTXNSetFlushnessMask = 1L << kTXNSetFlushnessBit,
62036
62037
62038
62039
62040
62041
62042
62043   kTXNSetJustificationMask = 1L << kTXNSetJustificationBit,
62044
62045
62046
62047
62048
62049   kTXNUseFontFallBackMask = 1L << kTXNUseFontFallBackBit,
62050
62051
62052
62053
62054
62055
62056
62057   kTXNRotateTextMask = 1L << kTXNRotateTextBit,
62058
62059
62060
62061
62062
62063   kTXNUseVerticalTextMask = 1L << kTXNUseVerticalTextBit,
62064   kTXNDontUpdateBoxRectMask = 1L << kTXNDontUpdateBoxRectBit,
62065
62066
62067
62068
62069
62070   kTXNDontDrawTextMask = 1L << kTXNDontDrawTextBit,
62071
62072
62073
62074
62075
62076   kTXNUseCGContextRefMask = 1L << kTXNUseCGContextRefBit,
62077
62078
62079
62080
62081
62082   kTXNImageWithQDMask = 1L << kTXNImageWithQDBit,
62083
62084
62085
62086
62087   kTXNDontWrapTextMask = 1L << kTXNDontWrapTextBit
62088 };
62089
62090 struct TXNTextBoxOptionsData {
62091   TXNTextBoxOptions optionTags;
62092   Fract flushness;
62093   Fract justification;
62094   Fixed rotation;
62095   void * options;
62096 };
62097 typedef struct TXNTextBoxOptionsData TXNTextBoxOptionsData;
62098 enum {
62099   kTXNFontContinuousBit = 0,
62100   kTXNSizeContinuousBit = 1,
62101   kTXNStyleContinuousBit = 2,
62102   kTXNColorContinuousBit = 3
62103 };
62104
62105 typedef OptionBits TXNContinuousFlags;
62106 enum {
62107   kTXNFontContinuousMask = 1L << kTXNFontContinuousBit,
62108   kTXNSizeContinuousMask = 1L << kTXNSizeContinuousBit,
62109   kTXNStyleContinuousMask = 1L << kTXNStyleContinuousBit,
62110   kTXNColorContinuousMask = 1L << kTXNColorContinuousBit
62111 };
62112
62113 enum {
62114   kTXNIgnoreCaseBit = 0,
62115   kTXNEntireWordBit = 1,
62116   kTXNUseEncodingWordRulesBit = 31
62117 };
62118
62119 typedef OptionBits TXNMatchOptions;
62120 enum {
62121   kTXNIgnoreCaseMask = 1L << kTXNIgnoreCaseBit,
62122   kTXNEntireWordMask = 1L << kTXNEntireWordBit,
62123   kTXNUseEncodingWordRulesMask = (unsigned long)(1L << kTXNUseEncodingWordRulesBit)
62124 };
62125
62126
62127 typedef OSType TXNFileType;
62128 enum {
62129   kTXNTextensionFile = 'txtn',
62130   kTXNTextFile = 'TEXT',
62131   kTXNPictureFile = 'PICT',
62132   kTXNMovieFile = 'MooV',
62133   kTXNSoundFile = 'sfil',
62134   kTXNAIFFFile = 'AIFF',
62135   kTXNUnicodeTextFile = 'utxt'
62136 };
62137
62138
62139 typedef UInt32 TXNFrameType;
62140 enum {
62141   kTXNTextEditStyleFrameType = 1,
62142   kTXNPageFrameType = 2,
62143   kTXNMultipleFrameType = 3
62144 };
62145
62146
62147 typedef OSType TXNDataType;
62148 enum {
62149   kTXNTextData = 'TEXT',
62150   kTXNPictureData = 'PICT',
62151   kTXNMovieData = 'moov',
62152   kTXNSoundData = 'snd ',
62153   kTXNUnicodeTextData = 'utxt'
62154 };
62155
62156
62157 typedef FourCharCode TXNControlTag;
62158 enum {
62159   kTXNLineDirectionTag = 'lndr',
62160   kTXNJustificationTag = 'just',
62161   kTXNIOPrivilegesTag = 'iopv',
62162   kTXNSelectionStateTag = 'slst',
62163   kTXNInlineStateTag = 'inst',
62164   kTXNWordWrapStateTag = 'wwrs',
62165   kTXNKeyboardSyncStateTag = 'kbsy',
62166   kTXNAutoIndentStateTag = 'auin',
62167   kTXNTabSettingsTag = 'tabs',
62168   kTXNRefConTag = 'rfcn',
62169   kTXNMarginsTag = 'marg',
62170   kTXNFlattenMoviesTag = 'flat',
62171   kTXNDoFontSubstitution = 'fSub',
62172   kTXNNoUserIOTag = 'nuio',
62173   kTXNUseCarbonEvents = 'cbcb',
62174   kTXNDrawCaretWhenInactiveTag = 'dcrt',
62175   kTXNDrawSelectionWhenInactiveTag = 'dsln',
62176   kTXNDisableDragAndDropTag = 'drag',
62177   kTXNSingleLevelUndoTag = 'undo',
62178   kTXNVisibilityTag = 'visb'
62179 };
62180
62181 typedef UInt32 TXNActionKey;
62182 enum {
62183   kTXNTypingAction = 0,
62184   kTXNCutAction = 1,
62185   kTXNPasteAction = 2,
62186   kTXNClearAction = 3,
62187   kTXNChangeFontAction = 4,
62188   kTXNChangeFontColorAction = 5,
62189   kTXNChangeFontSizeAction = 6,
62190   kTXNChangeStyleAction = 7,
62191   kTXNAlignLeftAction = 8,
62192   kTXNAlignCenterAction = 9,
62193   kTXNAlignRightAction = 10,
62194   kTXNDropAction = 11,
62195   kTXNMoveAction = 12,
62196   kTXNFontFeatureAction = 13,
62197   kTXNFontVariationAction = 14,
62198   kTXNUndoLastAction = 1024
62199 };
62200
62201 enum {
62202   kTXNClearThisControl = (long)0xFFFFFFFF,
62203   kTXNClearTheseFontFeatures = (long)0x80000000
62204 };
62205
62206
62207
62208
62209
62210 enum {
62211   kTXNReadWrite = false,
62212   kTXNReadOnly = true
62213 };
62214
62215
62216 enum {
62217   kTXNSelectionOn = true,
62218   kTXNSelectionOff = false
62219 };
62220
62221
62222 enum {
62223   kTXNUseInline = false,
62224   kTXNUseBottomline = true
62225 };
62226
62227
62228
62229 enum {
62230   kTXNAutoWrap = false,
62231   kTXNNoAutoWrap = true
62232 };
62233
62234
62235 enum {
62236   kTXNSyncKeyboard = false,
62237   kTXNNoSyncKeyboard = true
62238 };
62239
62240
62241 enum {
62242   kTXNAutoIndentOff = false,
62243   kTXNAutoIndentOn = true
62244 };
62245
62246
62247 enum {
62248   kTXNDontDrawCaretWhenInactive = false,
62249   kTXNDrawCaretWhenInactive = true
62250 };
62251
62252
62253 enum {
62254   kTXNDontDrawSelectionWhenInactive = false,
62255   kTXNDrawSelectionWhenInactive = true
62256 };
62257
62258
62259 enum {
62260   kTXNEnableDragAndDrop = false,
62261   kTXNDisableDragAndDrop = true
62262 };
62263
62264 typedef SInt8 TXNTabType;
62265 enum {
62266   kTXNRightTab = -1,
62267   kTXNLeftTab = 0,
62268   kTXNCenterTab = 1
62269 };
62270
62271 struct TXNTab {
62272   SInt16 value;
62273   TXNTabType tabType;
62274   UInt8 filler;
62275 };
62276 typedef struct TXNTab TXNTab;
62277 enum {
62278   kTXNLeftToRight = 0,
62279   kTXNRightToLeft = 1
62280 };
62281
62282 enum {
62283   kTXNFlushDefault = 0,
62284   kTXNFlushLeft = 1,
62285   kTXNFlushRight = 2,
62286   kTXNCenter = 4,
62287   kTXNFullJust = 8,
62288   kTXNForceFullJust = 16
62289 };
62290
62291
62292
62293
62294
62295 struct TXNMargins {
62296   SInt16 topMargin;
62297   SInt16 leftMargin;
62298   SInt16 bottomMargin;
62299   SInt16 rightMargin;
62300 };
62301 typedef struct TXNMargins TXNMargins;
62302 union TXNControlData {
62303   UInt32 uValue;
62304   SInt32 sValue;
62305   TXNTab tabValue;
62306   TXNMargins * marginsPtr;
62307 };
62308 typedef union TXNControlData TXNControlData;
62309 typedef Boolean TXNScrollBarState;
62310 enum {
62311   kScrollBarsAlwaysActive = true,
62312   kScrollBarsSyncWithFocus = false
62313 };
62314
62315
62316
62317
62318
62319 enum {
62320   kTXNDontCareTypeSize = (long)0xFFFFFFFF,
62321   kTXNDontCareTypeStyle = 0xFF,
62322   kTXNIncrementTypeSize = 0x00000001,
62323   kTXNDecrementTypeSize = (long)0x80000000,
62324   kTXNUseScriptDefaultValue = -1,
62325   kTXNNoFontVariations = 0x7FFF
62326 };
62327
62328 typedef UInt32 TXNOffset;
62329 enum {
62330   kTXNUseCurrentSelection = (unsigned long)0xFFFFFFFF,
62331   kTXNStartOffset = 0,
62332   kTXNEndOffset = 0x7FFFFFFF
62333 };
62334
62335
62336 enum {
62337   kTXNSingleStylePerTextDocumentResType = 'MPSR',
62338   kTXNMultipleStylesPerTextDocumentResType = 'styl'
62339 };
62340
62341
62342 typedef void * TXNObjectRefcon;
62343
62344 enum {
62345   kTXNShowStart = false,
62346   kTXNShowEnd = true
62347 };
62348
62349 typedef OSStatus TXNErrors;
62350
62351
62352 enum {
62353   kTXNDefaultFontSize = 0x000C0000
62354 };
62355
62356 enum {
62357   kTXNDefaultFontStyle = normal
62358 };
62359
62360
62361 typedef UInt32 TXNHyperLinkState;
62362 enum {
62363   kTXNLinkNotPressed = 0,
62364   kTXNLinkWasPressed = 1,
62365   kTXNLinkTracking = 3
62366 };
62367
62368 typedef FourCharCode TXNTypeRunAttributes;
62369 enum {
62370   kTXNQDFontNameAttribute = 'fntn',
62371   kTXNQDFontFamilyIDAttribute = 'font',
62372   kTXNQDFontSizeAttribute = 'size',
62373   kTXNQDFontStyleAttribute = 'face',
62374   kTXNQDFontColorAttribute = 'klor',
62375   kTXNTextEncodingAttribute = 'encd',
62376   kTXNATSUIFontFeaturesAttribute = 'atfe',
62377   kTXNATSUIFontVariationsAttribute = 'atva',
62378   kTXNURLAttribute = 'urla'
62379 };
62380
62381
62382
62383
62384
62385
62386 typedef ByteCount TXNTypeRunAttributeSizes;
62387 enum {
62388   kTXNQDFontNameAttributeSize = sizeof(Str255),
62389   kTXNQDFontFamilyIDAttributeSize = sizeof(SInt16),
62390   kTXNQDFontSizeAttributeSize = sizeof(SInt16),
62391   kTXNQDFontStyleAttributeSize = sizeof(Style),
62392   kTXNQDFontColorAttributeSize = sizeof(RGBColor),
62393   kTXNTextEncodingAttributeSize = sizeof(TextEncoding),
62394   kTXNFontSizeAttributeSize = sizeof(Fixed)
62395 };
62396
62397 typedef UInt32 TXNPermanentTextEncodingType;
62398 enum {
62399   kTXNSystemDefaultEncoding = 0,
62400   kTXNMacOSEncoding = 1,
62401   kTXNUnicodeEncoding = 2
62402 };
62403
62404
62405
62406 typedef FourCharCode TXTNTag;
62407 struct TXNATSUIFeatures {
62408   ItemCount featureCount;
62409   ATSUFontFeatureType * featureTypes;
62410   ATSUFontFeatureSelector * featureSelectors;
62411 };
62412 typedef struct TXNATSUIFeatures TXNATSUIFeatures;
62413 struct TXNATSUIVariations {
62414   ItemCount variationCount;
62415   ATSUFontVariationAxis * variationAxis;
62416   ATSUFontVariationValue * variationValues;
62417 };
62418 typedef struct TXNATSUIVariations TXNATSUIVariations;
62419 union TXNAttributeData {
62420   void * dataPtr;
62421   UInt32 dataValue;
62422   TXNATSUIFeatures * atsuFeatures;
62423   TXNATSUIVariations * atsuVariations;
62424   CFURLRef urlReference;
62425 };
62426 typedef union TXNAttributeData TXNAttributeData;
62427 struct TXNTypeAttributes {
62428   TXTNTag tag;
62429   ByteCount size;
62430   TXNAttributeData data;
62431 };
62432 typedef struct TXNTypeAttributes TXNTypeAttributes;
62433 struct TXNMacOSPreferredFontDescription {
62434   UInt32 fontID;
62435   Fixed pointSize;
62436   TextEncoding encoding;
62437   Style fontStyle;
62438 };
62439 typedef struct TXNMacOSPreferredFontDescription TXNMacOSPreferredFontDescription;
62440 struct TXNMatchTextRecord {
62441   const void * iTextPtr;
62442   SInt32 iTextToMatchLength;
62443   TextEncoding iTextEncoding;
62444 };
62445 typedef struct TXNMatchTextRecord TXNMatchTextRecord;
62446
62447 typedef UInt32 TXNBackgroundType;
62448 enum {
62449   kTXNBackgroundTypeRGB = 1
62450 };
62451
62452
62453
62454
62455
62456 union TXNBackgroundData {
62457   RGBColor color;
62458 };
62459 typedef union TXNBackgroundData TXNBackgroundData;
62460 struct TXNBackground {
62461   TXNBackgroundType bgType;
62462   TXNBackgroundData bg;
62463 };
62464 typedef struct TXNBackground TXNBackground;
62465 struct TXNLongRect {
62466   SInt32 top;
62467   SInt32 left;
62468   SInt32 bottom;
62469   SInt32 right;
62470 };
62471 typedef struct TXNLongRect TXNLongRect;
62472
62473
62474
62475
62476 enum {
62477   kTXNTextInputCountBit = 0,
62478   kTXNRunCountBit = 1
62479 };
62480
62481 typedef OptionBits TXNCountOptions;
62482 enum {
62483   kTXNTextInputCountMask = 1L << kTXNTextInputCountBit,
62484   kTXNRunCountMask = 1L << kTXNRunCountBit,
62485   kTXNAllCountMask = kTXNTextInputCountMask | kTXNRunCountMask
62486 };
62487
62488
62489 typedef UInt32 TXNScrollUnit;
62490 enum {
62491   kTXNScrollUnitsInPixels = 0,
62492   kTXNScrollUnitsInLines = 1,
62493   kTXNScrollUnitsInViewRects = 2
62494 };
62495
62496 typedef UInt32 TXNScrollBarOrientation;
62497 enum {
62498   kTXNHorizontal = 0,
62499   kTXNVertical = 1
62500 };
62501
62502 typedef OSStatus ( * TXNFindProcPtr)(const TXNMatchTextRecord *matchData, TXNDataType iDataType, TXNMatchOptions iMatchOptions, const void *iSearchTextPtr, TextEncoding encoding, TXNOffset absStartOffset, ByteCount searchTextLength, TXNOffset *oStartMatch, TXNOffset *oEndMatch, Boolean *ofound, UInt32 refCon);
62503 typedef CFStringRef ( * TXNActionKeyMapperProcPtr)(TXNActionKey actionKey, UInt32 commandID);
62504
62505 typedef void ( * TXNScrollInfoProcPtr)(SInt32 iValue, SInt32 iMaximumValue, TXNScrollBarOrientation iScrollBarOrientation, SInt32 iRefCon);
62506 typedef TXNFindProcPtr TXNFindUPP;
62507 typedef TXNActionKeyMapperProcPtr TXNActionKeyMapperUPP;
62508 typedef TXNScrollInfoProcPtr TXNScrollInfoUPP;
62509 extern TXNFindUPP
62510 NewTXNFindUPP(TXNFindProcPtr userRoutine) ;
62511 extern TXNActionKeyMapperUPP
62512 NewTXNActionKeyMapperUPP(TXNActionKeyMapperProcPtr userRoutine) ;
62513 extern TXNScrollInfoUPP
62514 NewTXNScrollInfoUPP(TXNScrollInfoProcPtr userRoutine) ;
62515 extern void
62516 DisposeTXNFindUPP(TXNFindUPP userUPP) ;
62517 extern void
62518 DisposeTXNActionKeyMapperUPP(TXNActionKeyMapperUPP userUPP) ;
62519 extern void
62520 DisposeTXNScrollInfoUPP(TXNScrollInfoUPP userUPP) ;
62521 extern OSStatus
62522 InvokeTXNFindUPP(
62523   const TXNMatchTextRecord * matchData,
62524   TXNDataType iDataType,
62525   TXNMatchOptions iMatchOptions,
62526   const void * iSearchTextPtr,
62527   TextEncoding encoding,
62528   TXNOffset absStartOffset,
62529   ByteCount searchTextLength,
62530   TXNOffset * oStartMatch,
62531   TXNOffset * oEndMatch,
62532   Boolean * ofound,
62533   UInt32 refCon,
62534   TXNFindUPP userUPP) ;
62535 extern CFStringRef
62536 InvokeTXNActionKeyMapperUPP(
62537   TXNActionKey actionKey,
62538   UInt32 commandID,
62539   TXNActionKeyMapperUPP userUPP) ;
62540 extern void
62541 InvokeTXNScrollInfoUPP(
62542   SInt32 iValue,
62543   SInt32 iMaximumValue,
62544   TXNScrollBarOrientation iScrollBarOrientation,
62545   SInt32 iRefCon,
62546   TXNScrollInfoUPP userUPP) ;
62547 enum {
62548   kTXNNoAppleEventHandlersBit = 0,
62549   kTXNRestartAppleEventHandlersBit = 1
62550 };
62551
62552 enum {
62553   kTXNNoAppleEventHandlersMask = 1 << kTXNNoAppleEventHandlersBit,
62554   kTXNRestartAppleEventHandlersMask = 1 << kTXNRestartAppleEventHandlersBit
62555 };
62556 struct TXNCarbonEventInfo {
62557   Boolean useCarbonEvents;
62558   UInt8 filler;
62559   UInt16 flags;
62560   CFDictionaryRef fDictionary;
62561 };
62562 typedef struct TXNCarbonEventInfo TXNCarbonEventInfo;
62563 extern OSStatus
62564 TXNNewObject(
62565   const FSSpec * iFileSpec,
62566   WindowRef iWindow,
62567   const Rect * iFrame,
62568   TXNFrameOptions iFrameOptions,
62569   TXNFrameType iFrameType,
62570   TXNFileType iFileType,
62571   TXNPermanentTextEncodingType iPermanentEncoding,
62572   TXNObject * oTXNObject,
62573   TXNFrameID * oTXNFrameID,
62574   TXNObjectRefcon iRefCon) ;
62575 extern void
62576 TXNDeleteObject(TXNObject iTXNObject) ;
62577 extern void
62578 TXNResizeFrame(
62579   TXNObject iTXNObject,
62580   UInt32 iWidth,
62581   UInt32 iHeight,
62582   TXNFrameID iTXNFrameID) ;
62583 extern void
62584 TXNSetFrameBounds(
62585   TXNObject iTXNObject,
62586   SInt32 iTop,
62587   SInt32 iLeft,
62588   SInt32 iBottom,
62589   SInt32 iRight,
62590   TXNFrameID iTXNFrameID) ;
62591 extern OSStatus
62592 TXNInitTextension(
62593   const TXNMacOSPreferredFontDescription iDefaultFonts[],
62594   ItemCount iCountDefaultFonts,
62595   TXNInitOptions iUsageFlags) ;
62596 extern void
62597 TXNTerminateTextension(void) ;
62598 extern void
62599 TXNKeyDown(
62600   TXNObject iTXNObject,
62601   const EventRecord * iEvent) ;
62602 extern void
62603 TXNAdjustCursor(
62604   TXNObject iTXNObject,
62605   RgnHandle ioCursorRgn) ;
62606 extern void
62607 TXNClick(
62608   TXNObject iTXNObject,
62609   const EventRecord * iEvent) ;
62610 extern void
62611 TXNSelectAll(TXNObject iTXNObject) ;
62612 extern void
62613 TXNFocus(
62614   TXNObject iTXNObject,
62615   Boolean iBecomingFocused) ;
62616 extern void
62617 TXNUpdate(TXNObject iTXNObject) ;
62618 extern void
62619 TXNDraw(
62620   TXNObject iTXNObject,
62621   GWorldPtr iDrawPort) ;
62622 extern void
62623 TXNForceUpdate(TXNObject iTXNObject) ;
62624 extern UInt32
62625 TXNGetSleepTicks(TXNObject iTXNObject) ;
62626 extern void
62627 TXNIdle(TXNObject iTXNObject) ;
62628 extern void
62629 TXNGrowWindow(
62630   TXNObject iTXNObject,
62631   const EventRecord * iEvent) ;
62632 extern void
62633 TXNZoomWindow(
62634   TXNObject iTXNObject,
62635   SInt16 iPart) ;
62636 extern Boolean
62637 TXNCanUndo(
62638   TXNObject iTXNObject,
62639   TXNActionKey * oTXNActionKey) ;
62640 extern void
62641 TXNUndo(TXNObject iTXNObject) ;
62642 extern Boolean
62643 TXNCanRedo(
62644   TXNObject iTXNObject,
62645   TXNActionKey * oTXNActionKey) ;
62646 extern void
62647 TXNRedo(TXNObject iTXNObject) ;
62648 extern OSStatus
62649 TXNCut(TXNObject iTXNObject) ;
62650 extern OSStatus
62651 TXNCopy(TXNObject iTXNObject) ;
62652 extern OSStatus
62653 TXNPaste(TXNObject iTXNObject) ;
62654 extern OSStatus
62655 TXNClear(TXNObject iTXNObject) ;
62656 extern void
62657 TXNGetSelection(
62658   TXNObject iTXNObject,
62659   TXNOffset * oStartOffset,
62660   TXNOffset * oEndOffset) ;
62661 extern void
62662 TXNShowSelection(
62663   TXNObject iTXNObject,
62664   Boolean iShowEnd) ;
62665 extern Boolean
62666 TXNIsSelectionEmpty(TXNObject iTXNObject) ;
62667 extern OSStatus
62668 TXNSetSelection(
62669   TXNObject iTXNObject,
62670   TXNOffset iStartOffset,
62671   TXNOffset iEndOffset) ;
62672 extern OSStatus
62673 TXNGetContinuousTypeAttributes(
62674   TXNObject iTxnObject,
62675   TXNContinuousFlags * oContinuousFlags,
62676   ItemCount iCount,
62677   TXNTypeAttributes ioTypeAttributes[]) ;
62678 extern OSStatus
62679 TXNSetTypeAttributes(
62680   TXNObject iTXNObject,
62681   ItemCount iAttrCount,
62682   const TXNTypeAttributes iAttributes[],
62683   TXNOffset iStartOffset,
62684   TXNOffset iEndOffset) ;
62685 extern OSStatus
62686 TXNSetTXNObjectControls(
62687   TXNObject iTXNObject,
62688   Boolean iClearAll,
62689   ItemCount iControlCount,
62690   const TXNControlTag iControlTags[],
62691   const TXNControlData iControlData[]) ;
62692 extern OSStatus
62693 TXNGetTXNObjectControls(
62694   TXNObject iTXNObject,
62695   ItemCount iControlCount,
62696   const TXNControlTag iControlTags[],
62697   TXNControlData oControlData[]) ;
62698 extern OSStatus
62699 TXNCountRunsInRange(
62700   TXNObject iTXNObject,
62701   TXNOffset iStartOffset,
62702   TXNOffset iEndOffset,
62703   ItemCount * oRunCount) ;
62704 extern OSStatus
62705 TXNGetIndexedRunInfoFromRange(
62706   TXNObject iTXNObject,
62707   ItemCount iIndex,
62708   TXNOffset iStartOffset,
62709   TXNOffset iEndOffset,
62710   TXNOffset * oRunStartOffset,
62711   TXNOffset * oRunEndOffset,
62712   TXNDataType * oRunDataType,
62713   ItemCount iTypeAttributeCount,
62714   TXNTypeAttributes * ioTypeAttributes) ;
62715 extern ByteCount
62716 TXNDataSize(TXNObject iTXNObject) ;
62717 extern OSStatus
62718 TXNGetData(
62719   TXNObject iTXNObject,
62720   TXNOffset iStartOffset,
62721   TXNOffset iEndOffset,
62722   Handle * oDataHandle) ;
62723 extern OSStatus
62724 TXNGetDataEncoded(
62725   TXNObject iTXNObject,
62726   TXNOffset iStartOffset,
62727   TXNOffset iEndOffset,
62728   Handle * oDataHandle,
62729   TXNDataType iEncoding) ;
62730 extern OSStatus
62731 TXNSetDataFromFile(
62732   TXNObject iTXNObject,
62733   SInt16 iFileRefNum,
62734   OSType iFileType,
62735   ByteCount iFileLength,
62736   TXNOffset iStartOffset,
62737   TXNOffset iEndOffset) ;
62738 extern OSStatus
62739 TXNSetData(
62740   TXNObject iTXNObject,
62741   TXNDataType iDataType,
62742   const void * iDataPtr,
62743   ByteCount iDataSize,
62744   TXNOffset iStartOffset,
62745   TXNOffset iEndOffset) ;
62746 extern ItemCount
62747 TXNGetChangeCount(TXNObject iTXNObject) ;
62748 extern OSStatus
62749 TXNSave(
62750   TXNObject iTXNObject,
62751   TXNFileType iType,
62752   OSType iResType,
62753   TXNPermanentTextEncodingType iPermanentEncoding,
62754   const FSSpec * iFileSpecification,
62755   SInt16 iDataReference,
62756   SInt16 iResourceReference) ;
62757 extern OSStatus
62758 TXNRevert(TXNObject iTXNObject) ;
62759 extern OSStatus
62760 TXNPageSetup(TXNObject iTXNObject) ;
62761 extern OSStatus
62762 TXNPrint(TXNObject iTXNObject) ;
62763 extern Boolean
62764 TXNIsScrapPastable(void) ;
62765 extern OSStatus
62766 TXNConvertToPublicScrap(void) ;
62767 extern OSStatus
62768 TXNConvertFromPublicScrap(void) ;
62769 extern void
62770 TXNGetViewRect(
62771   TXNObject iTXNObject,
62772   Rect * oViewRect) ;
62773 extern void
62774 TXNSetViewRect(
62775   TXNObject iTXNObject,
62776   const Rect * iViewRect) ;
62777 extern OSStatus
62778 TXNFind(
62779   TXNObject iTXNObject,
62780   const TXNMatchTextRecord * iMatchTextDataPtr,
62781   TXNDataType iDataType,
62782   TXNMatchOptions iMatchOptions,
62783   TXNOffset iStartSearchOffset,
62784   TXNOffset iEndSearchOffset,
62785   TXNFindUPP iFindProc,
62786   SInt32 iRefCon,
62787   TXNOffset * oStartMatchOffset,
62788   TXNOffset * oEndMatchOffset) ;
62789 extern OSStatus
62790 TXNSetFontDefaults(
62791   TXNObject iTXNObject,
62792   ItemCount iCount,
62793   const TXNMacOSPreferredFontDescription iFontDefaults[]) ;
62794 extern OSStatus
62795 TXNGetFontDefaults(
62796   TXNObject iTXNObject,
62797   ItemCount * ioCount,
62798   TXNMacOSPreferredFontDescription ioFontDefaults[]) ;
62799 extern OSStatus
62800 TXNAttachObjectToWindow(
62801   TXNObject iTXNObject,
62802   GWorldPtr iWindow,
62803   Boolean iIsActualWindow) ;
62804 extern Boolean
62805 TXNIsObjectAttachedToWindow(TXNObject iTXNObject) ;
62806 extern OSErr
62807 TXNDragTracker(
62808   TXNObject iTXNObject,
62809   TXNFrameID iTXNFrameID,
62810   DragTrackingMessage iMessage,
62811   WindowRef iWindow,
62812   DragReference iDragReference,
62813   Boolean iDifferentObjectSameWindow) ;
62814 extern OSErr
62815 TXNDragReceiver(
62816   TXNObject iTXNObject,
62817   TXNFrameID iTXNFrameID,
62818   WindowRef iWindow,
62819   DragReference iDragReference,
62820   Boolean iDifferentObjectSameWindow) ;
62821 extern OSStatus
62822 TXNActivate(
62823   TXNObject iTXNObject,
62824   TXNFrameID iTXNFrameID,
62825   TXNScrollBarState iActiveState) ;
62826 extern OSStatus
62827 TXNSetBackground(
62828   TXNObject iTXNObject,
62829   const TXNBackground * iBackgroundInfo) ;
62830 extern OSStatus
62831 TXNEchoMode(
62832   TXNObject iTXNObject,
62833   UniChar iEchoCharacter,
62834   TextEncoding iEncoding,
62835   Boolean iOn) ;
62836 extern OSStatus
62837 TXNNewFontMenuObject(
62838   MenuRef iFontMenuHandle,
62839   SInt16 iMenuID,
62840   SInt16 iStartHierMenuID,
62841   TXNFontMenuObject * oTXNFontMenuObject) ;
62842 extern OSStatus
62843 TXNGetFontMenuHandle(
62844   TXNFontMenuObject iTXNFontMenuObject,
62845   MenuRef * oFontMenuHandle) ;
62846 extern OSStatus
62847 TXNDisposeFontMenuObject(TXNFontMenuObject iTXNFontMenuObject) ;
62848 extern OSStatus
62849 TXNDoFontMenuSelection(
62850   TXNObject iTXNObject,
62851   TXNFontMenuObject iTXNFontMenuObject,
62852   SInt16 iMenuID,
62853   SInt16 iMenuItem) ;
62854 extern OSStatus
62855 TXNPrepareFontMenu(
62856   TXNObject iTXNObject,
62857   TXNFontMenuObject iTXNFontMenuObject) ;
62858 extern TXNVersionValue
62859 TXNVersionInformation(TXNFeatureBits * oFeatureFlags) ;
62860 extern OSStatus
62861 TXNPointToOffset(
62862   TXNObject iTXNObject,
62863   Point iPoint,
62864   TXNOffset * oOffset) ;
62865 extern OSStatus
62866 TXNOffsetToPoint(
62867   TXNObject iTXNObject,
62868   TXNOffset iOffset,
62869   Point * oPoint) ;
62870 extern OSStatus
62871 TXNDrawUnicodeTextBox(
62872   const UniChar iText[],
62873   UniCharCount iLen,
62874   Rect * ioBox,
62875   ATSUStyle iStyle,
62876   const TXNTextBoxOptionsData * iOptions) ;
62877 extern OSStatus
62878 TXNDrawCFStringTextBox(
62879   CFStringRef iText,
62880   Rect * ioBox,
62881   ATSUStyle iStyle,
62882   const TXNTextBoxOptionsData * iOptions) ;
62883 extern OSStatus
62884 TXNGetLineCount(
62885   TXNObject iTXNObject,
62886   ItemCount * oLineTotal) ;
62887 extern OSStatus
62888 TXNGetLineMetrics(
62889   TXNObject iTXNObject,
62890   UInt32 iLineNumber,
62891   Fixed * oLineWidth,
62892   Fixed * oLineHeight) ;
62893 extern OSStatus
62894 TXNGetActionChangeCount(
62895   TXNObject iTXNObject,
62896   TXNCountOptions iOptions,
62897   ItemCount * oCount) ;
62898 extern OSStatus
62899 TXNClearActionChangeCount(
62900   TXNObject iTXNObject,
62901   TXNCountOptions iOptions) ;
62902 extern OSStatus
62903 TXNIsObjectAttachedToSpecificWindow(
62904   TXNObject iTXNObject,
62905   WindowRef iWindow,
62906   Boolean * oAttached) ;
62907 extern void
62908 TXNSetRectBounds(
62909   TXNObject iTXNObject,
62910   const Rect * iViewRect,
62911   const TXNLongRect * iDestinationRect,
62912   Boolean iUpdate) ;
62913 extern OSStatus
62914 TXNGetRectBounds(
62915   TXNObject iTXNObject,
62916   Rect * oViewRect,
62917   TXNLongRect * oDestinationRect,
62918   TXNLongRect * oTextRect) ;
62919 extern void
62920 TXNRecalcTextLayout(TXNObject iTXNObject) ;
62921 extern OSStatus
62922 TXNScroll(
62923   TXNObject iTXNObject,
62924   TXNScrollUnit iVerticalScrollUnit,
62925   TXNScrollUnit iHorizontalScrollUnit,
62926   SInt32 * ioVerticalDelta,
62927   SInt32 * ioHorizontalDelta) ;
62928 extern void
62929 TXNRegisterScrollInfoProc(
62930   TXNObject iTXNObject,
62931   TXNScrollInfoUPP iTXNScrollInfoUPP,
62932   SInt32 iRefCon) ;
62933 extern OSStatus
62934 TXNClearUndo(TXNObject iTXNObject) ;
62935
62936
62937
62938
62939
62940 }
62941
62942
62943
62944 extern "C" {
62945
62946
62947
62948
62949
62950
62951 enum {
62952   kMacHelpVersion = 0x0003
62953 };
62954
62955 typedef SInt16 HMContentRequest;
62956 enum {
62957   kHMSupplyContent = 0,
62958   kHMDisposeContent = 1
62959 };
62960
62961 typedef UInt32 HMContentType;
62962 enum {
62963   kHMNoContent = 'none',
62964   kHMCFStringContent = 'cfst',
62965   kHMCFStringLocalizedContent = 'cfsl',
62966   kHMPascalStrContent = 'pstr',
62967   kHMStringResContent = 'str#',
62968   kHMTEHandleContent = 'txth',
62969   kHMTextResContent = 'text',
62970   kHMStrResContent = 'str '
62971 };
62972 typedef SInt16 HMTagDisplaySide;
62973 enum {
62974
62975
62976
62977
62978   kHMDefaultSide = 0,
62979
62980
62981
62982
62983   kHMOutsideTopScriptAligned = 1,
62984
62985
62986
62987
62988   kHMOutsideLeftCenterAligned = 2,
62989   kHMOutsideBottomScriptAligned = 3,
62990
62991
62992
62993
62994   kHMOutsideRightCenterAligned = 4,
62995
62996
62997
62998
62999   kHMOutsideTopLeftAligned = 5,
63000
63001
63002
63003
63004   kHMOutsideTopRightAligned = 6,
63005
63006
63007
63008
63009   kHMOutsideLeftTopAligned = 7,
63010
63011
63012
63013
63014   kHMOutsideLeftBottomAligned = 8,
63015
63016
63017
63018
63019   kHMOutsideBottomLeftAligned = 9,
63020
63021
63022
63023
63024   kHMOutsideBottomRightAligned = 10,
63025   kHMOutsideRightTopAligned = 11,
63026   kHMOutsideRightBottomAligned = 12,
63027
63028
63029
63030
63031   kHMOutsideTopCenterAligned = 13,
63032
63033
63034
63035
63036   kHMOutsideBottomCenterAligned = 14,
63037
63038
63039
63040
63041   kHMInsideRightCenterAligned = 15,
63042
63043
63044
63045
63046   kHMInsideLeftCenterAligned = 16,
63047
63048
63049
63050
63051   kHMInsideBottomCenterAligned = 17,
63052
63053
63054
63055
63056   kHMInsideTopCenterAligned = 18,
63057
63058
63059
63060
63061   kHMInsideTopLeftCorner = 19,
63062
63063
63064
63065
63066   kHMInsideTopRightCorner = 20,
63067
63068
63069
63070
63071   kHMInsideBottomLeftCorner = 21,
63072
63073
63074
63075
63076   kHMInsideBottomRightCorner = 22,
63077
63078
63079
63080
63081   kHMAbsoluteCenterAligned = 23
63082 };
63083
63084
63085 enum {
63086   kHMTopSide = kHMOutsideTopScriptAligned,
63087   kHMLeftSide = kHMOutsideLeftCenterAligned,
63088   kHMBottomSide = kHMOutsideBottomScriptAligned,
63089   kHMRightSide = kHMOutsideRightCenterAligned,
63090   kHMTopLeftCorner = kHMOutsideTopLeftAligned,
63091   kHMTopRightCorner = kHMOutsideTopRightAligned,
63092   kHMLeftTopCorner = kHMOutsideLeftTopAligned,
63093   kHMLeftBottomCorner = kHMOutsideLeftBottomAligned,
63094   kHMBottomLeftCorner = kHMOutsideBottomLeftAligned,
63095   kHMBottomRightCorner = kHMOutsideBottomRightAligned,
63096   kHMRightTopCorner = kHMOutsideRightTopAligned,
63097   kHMRightBottomCorner = kHMOutsideRightBottomAligned
63098 };
63099
63100 typedef SInt16 HMContentProvidedType;
63101 enum {
63102   kHMContentProvided = 0,
63103   kHMContentNotProvided = 1,
63104   kHMContentNotProvidedDontPropagate = 2
63105 };
63106
63107 enum {
63108   kHMMinimumContentIndex = 0,
63109   kHMMaximumContentIndex = 1
63110 };
63111
63112 enum {
63113   errHMIllegalContentForMinimumState = -10980,
63114   errHMIllegalContentForMaximumState = -10981
63115 };
63116
63117
63118 enum {
63119   kHMIllegalContentForMinimumState = errHMIllegalContentForMinimumState
63120 };
63121
63122 enum {
63123   kHelpTagEventHandlerTag = 'hevt'
63124 };
63125
63126 struct HMHelpContent {
63127   HMContentType contentType;
63128   union {
63129     CFStringRef tagCFString;
63130     Str255 tagString;
63131     HMStringResType tagStringRes;
63132     TEHandle tagTEHandle;
63133     SInt16 tagTextRes;
63134     SInt16 tagStrRes;
63135   } u;
63136 };
63137 typedef struct HMHelpContent HMHelpContent;
63138 struct HMHelpContentRec {
63139   SInt32 version;
63140   Rect absHotRect;
63141   HMTagDisplaySide tagSide;
63142   HMHelpContent content[2];
63143 };
63144 typedef struct HMHelpContentRec HMHelpContentRec;
63145 typedef HMHelpContentRec * HMHelpContentPtr;
63146
63147
63148
63149 typedef OSStatus ( * HMControlContentProcPtr)(ControlRef inControl, Point inGlobalMouse, HMContentRequest inRequest, HMContentProvidedType *outContentProvided, HMHelpContentPtr ioHelpContent);
63150 typedef OSStatus ( * HMWindowContentProcPtr)(WindowRef inWindow, Point inGlobalMouse, HMContentRequest inRequest, HMContentProvidedType *outContentProvided, HMHelpContentPtr ioHelpContent);
63151 typedef OSStatus ( * HMMenuTitleContentProcPtr)(MenuRef inMenu, HMContentRequest inRequest, HMContentProvidedType *outContentProvided, HMHelpContentPtr ioHelpContent);
63152 typedef OSStatus ( * HMMenuItemContentProcPtr)(const MenuTrackingData *inTrackingData, HMContentRequest inRequest, HMContentProvidedType *outContentProvided, HMHelpContentPtr ioHelpContent);
63153 typedef HMControlContentProcPtr HMControlContentUPP;
63154 typedef HMWindowContentProcPtr HMWindowContentUPP;
63155 typedef HMMenuTitleContentProcPtr HMMenuTitleContentUPP;
63156 typedef HMMenuItemContentProcPtr HMMenuItemContentUPP;
63157 extern HMControlContentUPP
63158 NewHMControlContentUPP(HMControlContentProcPtr userRoutine) ;
63159 extern HMWindowContentUPP
63160 NewHMWindowContentUPP(HMWindowContentProcPtr userRoutine) ;
63161 extern HMMenuTitleContentUPP
63162 NewHMMenuTitleContentUPP(HMMenuTitleContentProcPtr userRoutine) ;
63163 extern HMMenuItemContentUPP
63164 NewHMMenuItemContentUPP(HMMenuItemContentProcPtr userRoutine) ;
63165 extern void
63166 DisposeHMControlContentUPP(HMControlContentUPP userUPP) ;
63167 extern void
63168 DisposeHMWindowContentUPP(HMWindowContentUPP userUPP) ;
63169 extern void
63170 DisposeHMMenuTitleContentUPP(HMMenuTitleContentUPP userUPP) ;
63171 extern void
63172 DisposeHMMenuItemContentUPP(HMMenuItemContentUPP userUPP) ;
63173 extern OSStatus
63174 InvokeHMControlContentUPP(
63175   ControlRef inControl,
63176   Point inGlobalMouse,
63177   HMContentRequest inRequest,
63178   HMContentProvidedType * outContentProvided,
63179   HMHelpContentPtr ioHelpContent,
63180   HMControlContentUPP userUPP) ;
63181 extern OSStatus
63182 InvokeHMWindowContentUPP(
63183   WindowRef inWindow,
63184   Point inGlobalMouse,
63185   HMContentRequest inRequest,
63186   HMContentProvidedType * outContentProvided,
63187   HMHelpContentPtr ioHelpContent,
63188   HMWindowContentUPP userUPP) ;
63189 extern OSStatus
63190 InvokeHMMenuTitleContentUPP(
63191   MenuRef inMenu,
63192   HMContentRequest inRequest,
63193   HMContentProvidedType * outContentProvided,
63194   HMHelpContentPtr ioHelpContent,
63195   HMMenuTitleContentUPP userUPP) ;
63196 extern OSStatus
63197 InvokeHMMenuItemContentUPP(
63198   const MenuTrackingData * inTrackingData,
63199   HMContentRequest inRequest,
63200   HMContentProvidedType * outContentProvided,
63201   HMHelpContentPtr ioHelpContent,
63202   HMMenuItemContentUPP userUPP) ;
63203 extern OSStatus
63204 HMGetHelpMenu(
63205   MenuRef * outHelpMenu,
63206   MenuItemIndex * outFirstCustomItemIndex) ;
63207 extern OSStatus
63208 HMSetControlHelpContent(
63209   ControlRef inControl,
63210   const HMHelpContentRec * inContent) ;
63211 extern OSStatus
63212 HMGetControlHelpContent(
63213   ControlRef inControl,
63214   HMHelpContentRec * outContent) ;
63215 extern OSStatus
63216 HMSetWindowHelpContent(
63217   WindowRef inWindow,
63218   const HMHelpContentRec * inContent) ;
63219 extern OSStatus
63220 HMGetWindowHelpContent(
63221   WindowRef inWindow,
63222   HMHelpContentRec * outContent) ;
63223 extern OSStatus
63224 HMSetMenuItemHelpContent(
63225   MenuRef inMenu,
63226   MenuItemIndex inItem,
63227   const HMHelpContentRec * inContent) ;
63228 extern OSStatus
63229 HMGetMenuItemHelpContent(
63230   MenuRef inMenu,
63231   MenuItemIndex inItem,
63232   HMHelpContentRec * outContent) ;
63233 extern OSStatus
63234 HMInstallControlContentCallback(
63235   ControlRef inControl,
63236   HMControlContentUPP inContentUPP) ;
63237 extern OSStatus
63238 HMInstallWindowContentCallback(
63239   WindowRef inWindow,
63240   HMWindowContentUPP inContentUPP) ;
63241 extern OSStatus
63242 HMInstallMenuTitleContentCallback(
63243   MenuRef inMenu,
63244   HMMenuTitleContentUPP inContentUPP) ;
63245 extern OSStatus
63246 HMInstallMenuItemContentCallback(
63247   MenuRef inMenu,
63248   HMMenuItemContentUPP inContentUPP) ;
63249 extern OSStatus
63250 HMGetControlContentCallback(
63251   ControlRef inControl,
63252   HMControlContentUPP * outContentUPP) ;
63253 extern OSStatus
63254 HMGetWindowContentCallback(
63255   WindowRef inWindow,
63256   HMWindowContentUPP * outContentUPP) ;
63257 extern OSStatus
63258 HMGetMenuTitleContentCallback(
63259   MenuRef inMenu,
63260   HMMenuTitleContentUPP * outContentUPP) ;
63261 extern OSStatus
63262 HMGetMenuItemContentCallback(
63263   MenuRef inMenu,
63264   HMMenuItemContentUPP * outContentUPP) ;
63265 extern Boolean
63266 HMAreHelpTagsDisplayed(void) ;
63267 extern OSStatus
63268 HMSetHelpTagsDisplayed(Boolean inDisplayTags) ;
63269 extern OSStatus
63270 HMSetTagDelay(Duration inDelay) ;
63271 extern OSStatus
63272 HMGetTagDelay(Duration * outDelay) ;
63273 extern OSStatus
63274 HMSetMenuHelpFromBalloonRsrc(
63275   MenuRef inMenu,
63276   SInt16 inHmnuRsrcID) ;
63277 extern OSStatus
63278 HMSetDialogHelpFromBalloonRsrc(
63279   DialogRef inDialog,
63280   SInt16 inHdlgRsrcID,
63281   SInt16 inItemStart) ;
63282 extern OSStatus
63283 HMDisplayTag(const HMHelpContentRec * inContent) ;
63284 extern OSStatus
63285 HMHideTag(void) ;
63286
63287
63288
63289
63290
63291 }
63292
63293
63294
63295 extern "C" {
63296
63297
63298 enum {
63299   kControlTabListResType = 'tab#',
63300   kControlListDescResType = 'ldes'
63301 };
63302
63303
63304
63305
63306 enum {
63307   kControlCheckBoxUncheckedValue = 0,
63308   kControlCheckBoxCheckedValue = 1,
63309   kControlCheckBoxMixedValue = 2
63310 };
63311
63312
63313
63314
63315 enum {
63316   kControlRadioButtonUncheckedValue = 0,
63317   kControlRadioButtonCheckedValue = 1,
63318   kControlRadioButtonMixedValue = 2
63319 };
63320
63321
63322
63323
63324
63325 enum {
63326   popupFixedWidth = 1 << 0,
63327   popupVariableWidth = 1 << 1,
63328   popupUseAddResMenu = 1 << 2,
63329   popupUseWFont = 1 << 3
63330 };
63331
63332
63333 enum {
63334   popupTitleBold = 1 << 8,
63335   popupTitleItalic = 1 << 9,
63336   popupTitleUnderline = 1 << 10,
63337   popupTitleOutline = 1 << 11,
63338   popupTitleShadow = 1 << 12,
63339   popupTitleCondense = 1 << 13,
63340   popupTitleExtend = 1 << 14,
63341   popupTitleNoStyle = 1 << 15
63342 };
63343
63344
63345 enum {
63346   popupTitleLeftJust = 0x00000000,
63347   popupTitleCenterJust = 0x00000001,
63348   popupTitleRightJust = 0x000000FF
63349 };
63350 enum {
63351   pushButProc = 0,
63352   checkBoxProc = 1,
63353   radioButProc = 2,
63354   scrollBarProc = 16,
63355   popupMenuProc = 1008
63356 };
63357
63358
63359
63360
63361 enum {
63362   kControlLabelPart = 1,
63363   kControlMenuPart = 2,
63364   kControlTrianglePart = 4,
63365   kControlEditTextPart = 5,
63366   kControlPicturePart = 6,
63367   kControlIconPart = 7,
63368   kControlClockPart = 8,
63369   kControlListBoxPart = 24,
63370   kControlListBoxDoubleClickPart = 25,
63371   kControlImageWellPart = 26,
63372   kControlRadioGroupPart = 27,
63373   kControlButtonPart = 10,
63374   kControlCheckBoxPart = 11,
63375   kControlRadioButtonPart = 11,
63376   kControlUpButtonPart = 20,
63377   kControlDownButtonPart = 21,
63378   kControlPageUpPart = 22,
63379   kControlPageDownPart = 23,
63380   kControlClockHourDayPart = 9,
63381   kControlClockMinuteMonthPart = 10,
63382   kControlClockSecondYearPart = 11,
63383   kControlClockAMPMPart = 12,
63384   kControlDataBrowserPart = 24,
63385   kControlDataBrowserDraggedPart = 25
63386 };
63387 enum {
63388   kControlBevelButtonSmallBevelProc = 32,
63389   kControlBevelButtonNormalBevelProc = 33,
63390   kControlBevelButtonLargeBevelProc = 34
63391 };
63392
63393
63394 enum {
63395   kControlBevelButtonSmallBevelVariant = 0,
63396   kControlBevelButtonNormalBevelVariant = (1 << 0),
63397   kControlBevelButtonLargeBevelVariant = (1 << 1),
63398   kControlBevelButtonMenuOnRightVariant = (1 << 2)
63399 };
63400
63401
63402 typedef UInt16 ControlBevelThickness;
63403 enum {
63404   kControlBevelButtonSmallBevel = 0,
63405   kControlBevelButtonNormalBevel = 1,
63406   kControlBevelButtonLargeBevel = 2
63407 };
63408
63409
63410
63411 enum {
63412   kControlBehaviorPushbutton = 0,
63413   kControlBehaviorToggles = 0x0100,
63414   kControlBehaviorSticky = 0x0200,
63415   kControlBehaviorSingleValueMenu = 0,
63416   kControlBehaviorMultiValueMenu = 0x4000,
63417   kControlBehaviorOffsetContents = 0x8000
63418 };
63419
63420
63421 enum {
63422   kControlBehaviorCommandMenu = 0x2000
63423 };
63424
63425 typedef UInt16 ControlBevelButtonBehavior;
63426 typedef UInt16 ControlBevelButtonMenuBehavior;
63427
63428 typedef UInt16 ControlBevelButtonMenuPlacement;
63429 enum {
63430   kControlBevelButtonMenuOnBottom = 0,
63431   kControlBevelButtonMenuOnRight = (1 << 2)
63432 };
63433
63434
63435 enum {
63436   kControlKindBevelButton = 'bevl'
63437 };
63438 extern OSStatus
63439 CreateBevelButtonControl(
63440   WindowRef window,
63441   const Rect * boundsRect,
63442   CFStringRef title,
63443   ControlBevelThickness thickness,
63444   ControlBevelButtonBehavior behavior,
63445   ControlButtonContentInfoPtr info,
63446   SInt16 menuID,
63447   ControlBevelButtonMenuBehavior menuBehavior,
63448   ControlBevelButtonMenuPlacement menuPlacement,
63449   ControlRef * outControl) ;
63450
63451
63452
63453
63454
63455 typedef SInt16 ControlButtonGraphicAlignment;
63456 enum {
63457   kControlBevelButtonAlignSysDirection = -1,
63458   kControlBevelButtonAlignCenter = 0,
63459   kControlBevelButtonAlignLeft = 1,
63460   kControlBevelButtonAlignRight = 2,
63461   kControlBevelButtonAlignTop = 3,
63462   kControlBevelButtonAlignBottom = 4,
63463   kControlBevelButtonAlignTopLeft = 5,
63464   kControlBevelButtonAlignBottomLeft = 6,
63465   kControlBevelButtonAlignTopRight = 7,
63466   kControlBevelButtonAlignBottomRight = 8
63467 };
63468
63469
63470 typedef SInt16 ControlButtonTextAlignment;
63471 enum {
63472   kControlBevelButtonAlignTextSysDirection = teFlushDefault,
63473   kControlBevelButtonAlignTextCenter = teCenter,
63474   kControlBevelButtonAlignTextFlushRight = teFlushRight,
63475   kControlBevelButtonAlignTextFlushLeft = teFlushLeft
63476 };
63477
63478
63479 typedef SInt16 ControlButtonTextPlacement;
63480 enum {
63481   kControlBevelButtonPlaceSysDirection = -1,
63482   kControlBevelButtonPlaceNormally = 0,
63483   kControlBevelButtonPlaceToRightOfGraphic = 1,
63484   kControlBevelButtonPlaceToLeftOfGraphic = 2,
63485   kControlBevelButtonPlaceBelowGraphic = 3,
63486   kControlBevelButtonPlaceAboveGraphic = 4
63487 };
63488
63489
63490
63491 enum {
63492   kControlBevelButtonContentTag = 'cont',
63493   kControlBevelButtonTransformTag = 'tran',
63494   kControlBevelButtonTextAlignTag = 'tali',
63495   kControlBevelButtonTextOffsetTag = 'toff',
63496   kControlBevelButtonGraphicAlignTag = 'gali',
63497   kControlBevelButtonGraphicOffsetTag = 'goff',
63498   kControlBevelButtonTextPlaceTag = 'tplc',
63499   kControlBevelButtonMenuValueTag = 'mval',
63500   kControlBevelButtonMenuHandleTag = 'mhnd',
63501   kControlBevelButtonMenuRefTag = 'mhnd',
63502   kControlBevelButtonCenterPopupGlyphTag = 'pglc'
63503 };
63504
63505
63506 enum {
63507   kControlBevelButtonLastMenuTag = 'lmnu',
63508   kControlBevelButtonMenuDelayTag = 'mdly'
63509 };
63510
63511
63512 enum {
63513
63514
63515
63516
63517
63518   kControlBevelButtonScaleIconTag = 'scal'
63519 };
63520
63521
63522 enum {
63523   kControlBevelButtonOwnedMenuRefTag = 'omrf',
63524   kControlBevelButtonKindTag = 'bebk'
63525 };
63526 extern OSErr
63527 GetBevelButtonMenuValue(
63528   ControlRef inButton,
63529   SInt16 * outValue) ;
63530 extern OSErr
63531 SetBevelButtonMenuValue(
63532   ControlRef inButton,
63533   SInt16 inValue) ;
63534 extern OSErr
63535 GetBevelButtonMenuHandle(
63536   ControlRef inButton,
63537   MenuHandle * outHandle) ;
63538 extern OSErr
63539 GetBevelButtonContentInfo(
63540   ControlRef inButton,
63541   ControlButtonContentInfoPtr outContent) ;
63542 extern OSErr
63543 SetBevelButtonContentInfo(
63544   ControlRef inButton,
63545   ControlButtonContentInfoPtr inContent) ;
63546 extern OSErr
63547 SetBevelButtonTransform(
63548   ControlRef inButton,
63549   IconTransformType transform) ;
63550 extern OSErr
63551 SetBevelButtonGraphicAlignment(
63552   ControlRef inButton,
63553   ControlButtonGraphicAlignment inAlign,
63554   SInt16 inHOffset,
63555   SInt16 inVOffset) ;
63556 extern OSErr
63557 SetBevelButtonTextAlignment(
63558   ControlRef inButton,
63559   ControlButtonTextAlignment inAlign,
63560   SInt16 inHOffset) ;
63561 extern OSErr
63562 SetBevelButtonTextPlacement(
63563   ControlRef inButton,
63564   ControlButtonTextPlacement inWhere) ;
63565 enum {
63566   kControlSliderProc = 48,
63567   kControlSliderLiveFeedback = (1 << 0),
63568   kControlSliderHasTickMarks = (1 << 1),
63569   kControlSliderReverseDirection = (1 << 2),
63570   kControlSliderNonDirectional = (1 << 3)
63571 };
63572
63573
63574 typedef UInt16 ControlSliderOrientation;
63575 enum {
63576   kControlSliderPointsDownOrRight = 0,
63577   kControlSliderPointsUpOrLeft = 1,
63578   kControlSliderDoesNotPoint = 2
63579 };
63580
63581
63582 enum {
63583   kControlKindSlider = 'sldr'
63584 };
63585 extern OSStatus
63586 CreateSliderControl(
63587   WindowRef window,
63588   const Rect * boundsRect,
63589   SInt32 value,
63590   SInt32 minimum,
63591   SInt32 maximum,
63592   ControlSliderOrientation orientation,
63593   UInt16 numTickMarks,
63594   Boolean liveTracking,
63595   ControlActionUPP liveTrackingProc,
63596   ControlRef * outControl) ;
63597 enum {
63598   kControlTriangleProc = 64,
63599   kControlTriangleLeftFacingProc = 65,
63600   kControlTriangleAutoToggleProc = 66,
63601   kControlTriangleLeftFacingAutoToggleProc = 67
63602 };
63603
63604 typedef UInt16 ControlDisclosureTriangleOrientation;
63605 enum {
63606   kControlDisclosureTrianglePointDefault = 0,
63607   kControlDisclosureTrianglePointRight = 1,
63608   kControlDisclosureTrianglePointLeft = 2
63609 };
63610
63611
63612 enum {
63613   kControlKindDisclosureTriangle = 'dist'
63614 };
63615 extern OSStatus
63616 CreateDisclosureTriangleControl(
63617   WindowRef inWindow,
63618   const Rect * inBoundsRect,
63619   ControlDisclosureTriangleOrientation inOrientation,
63620   CFStringRef inTitle,
63621   SInt32 inInitialValue,
63622   Boolean inDrawTitle,
63623   Boolean inAutoToggles,
63624   ControlRef * outControl) ;
63625
63626
63627
63628
63629 enum {
63630   kControlTriangleLastValueTag = 'last'
63631 };
63632 extern OSErr
63633 SetDisclosureTriangleLastValue(
63634   ControlRef inTabControl,
63635   SInt16 inValue) ;
63636 enum {
63637   kControlProgressBarProc = 80,
63638   kControlRelevanceBarProc = 81
63639 };
63640
63641
63642 enum {
63643   kControlKindProgressBar = 'prgb',
63644   kControlKindRelevanceBar = 'relb'
63645 };
63646 extern OSStatus
63647 CreateProgressBarControl(
63648   WindowRef window,
63649   const Rect * boundsRect,
63650   SInt32 value,
63651   SInt32 minimum,
63652   SInt32 maximum,
63653   Boolean indeterminate,
63654   ControlRef * outControl) ;
63655 extern OSStatus
63656 CreateRelevanceBarControl(
63657   WindowRef window,
63658   const Rect * boundsRect,
63659   SInt32 value,
63660   SInt32 minimum,
63661   SInt32 maximum,
63662   ControlRef * outControl) ;
63663
63664
63665
63666 enum {
63667   kControlProgressBarIndeterminateTag = 'inde',
63668   kControlProgressBarAnimatingTag = 'anim'
63669 };
63670
63671
63672
63673
63674
63675
63676
63677 enum {
63678   kControlLittleArrowsProc = 96
63679 };
63680
63681
63682 enum {
63683   kControlKindLittleArrows = 'larr'
63684 };
63685 extern OSStatus
63686 CreateLittleArrowsControl(
63687   WindowRef window,
63688   const Rect * boundsRect,
63689   SInt32 value,
63690   SInt32 minimum,
63691   SInt32 maximum,
63692   SInt32 increment,
63693   ControlRef * outControl) ;
63694 enum {
63695   kControlChasingArrowsProc = 112
63696 };
63697
63698
63699 enum {
63700   kControlKindChasingArrows = 'carr'
63701 };
63702 extern OSStatus
63703 CreateChasingArrowsControl(
63704   WindowRef window,
63705   const Rect * boundsRect,
63706   ControlRef * outControl) ;
63707
63708
63709
63710 enum {
63711   kControlChasingArrowsAnimatingTag = 'anim'
63712 };
63713 enum {
63714   kControlTabLargeProc = 128,
63715   kControlTabSmallProc = 129,
63716   kControlTabLargeNorthProc = 128,
63717   kControlTabSmallNorthProc = 129,
63718   kControlTabLargeSouthProc = 130,
63719   kControlTabSmallSouthProc = 131,
63720   kControlTabLargeEastProc = 132,
63721   kControlTabSmallEastProc = 133,
63722   kControlTabLargeWestProc = 134,
63723   kControlTabSmallWestProc = 135
63724 };
63725
63726
63727 typedef UInt16 ControlTabDirection;
63728 enum {
63729   kControlTabDirectionNorth = 0,
63730   kControlTabDirectionSouth = 1,
63731   kControlTabDirectionEast = 2,
63732   kControlTabDirectionWest = 3
63733 };
63734
63735
63736 typedef UInt16 ControlTabSize;
63737 enum {
63738   kControlTabSizeLarge = kControlSizeNormal,
63739   kControlTabSizeSmall = kControlSizeSmall
63740 };
63741
63742
63743
63744
63745
63746 struct ControlTabEntry {
63747   ControlButtonContentInfo * icon;
63748   CFStringRef name;
63749   Boolean enabled;
63750 };
63751 typedef struct ControlTabEntry ControlTabEntry;
63752
63753 enum {
63754   kControlKindTabs = 'tabs'
63755 };
63756 extern OSStatus
63757 CreateTabsControl(
63758   WindowRef window,
63759   const Rect * boundsRect,
63760   ControlTabSize size,
63761   ControlTabDirection direction,
63762   UInt16 numTabs,
63763   const ControlTabEntry * tabArray,
63764   ControlRef * outControl) ;
63765
63766
63767
63768
63769 enum {
63770   kControlTabContentRectTag = 'rect',
63771   kControlTabEnabledFlagTag = 'enab',
63772   kControlTabFontStyleTag = kControlFontStyleTag
63773 };
63774
63775
63776 enum {
63777   kControlTabInfoTag = 'tabi'
63778 };
63779
63780
63781 enum {
63782   kControlTabImageContentTag = 'cont'
63783 };
63784
63785 enum {
63786   kControlTabInfoVersionZero = 0,
63787   kControlTabInfoVersionOne = 1
63788 };
63789
63790 struct ControlTabInfoRec {
63791   SInt16 version;
63792   SInt16 iconSuiteID;
63793   Str255 name;
63794 };
63795 typedef struct ControlTabInfoRec ControlTabInfoRec;
63796 struct ControlTabInfoRecV1 {
63797   SInt16 version;
63798   SInt16 iconSuiteID;
63799   CFStringRef name;
63800
63801 };
63802 typedef struct ControlTabInfoRecV1 ControlTabInfoRecV1;
63803 extern OSErr
63804 GetTabContentRect(
63805   ControlRef inTabControl,
63806   Rect * outContentRect) ;
63807 extern OSErr
63808 SetTabEnabled(
63809   ControlRef inTabControl,
63810   SInt16 inTabToHilite,
63811   Boolean inEnabled) ;
63812 enum {
63813   kControlSeparatorLineProc = 144
63814 };
63815
63816
63817 enum {
63818   kControlKindSeparator = 'sepa'
63819 };
63820 extern OSStatus
63821 CreateSeparatorControl(
63822   WindowRef window,
63823   const Rect * boundsRect,
63824   ControlRef * outControl) ;
63825 enum {
63826   kControlGroupBoxTextTitleProc = 160,
63827   kControlGroupBoxCheckBoxProc = 161,
63828   kControlGroupBoxPopupButtonProc = 162,
63829   kControlGroupBoxSecondaryTextTitleProc = 164,
63830   kControlGroupBoxSecondaryCheckBoxProc = 165,
63831   kControlGroupBoxSecondaryPopupButtonProc = 166
63832 };
63833
63834
63835 enum {
63836   kControlKindGroupBox = 'grpb',
63837   kControlKindCheckGroupBox = 'cgrp',
63838   kControlKindPopupGroupBox = 'pgrp'
63839 };
63840 extern OSStatus
63841 CreateGroupBoxControl(
63842   WindowRef window,
63843   const Rect * boundsRect,
63844   CFStringRef title,
63845   Boolean primary,
63846   ControlRef * outControl) ;
63847 extern OSStatus
63848 CreateCheckGroupBoxControl(
63849   WindowRef window,
63850   const Rect * boundsRect,
63851   CFStringRef title,
63852   SInt32 initialValue,
63853   Boolean primary,
63854   Boolean autoToggle,
63855   ControlRef * outControl) ;
63856 extern OSStatus
63857 CreatePopupGroupBoxControl(
63858   WindowRef window,
63859   const Rect * boundsRect,
63860   CFStringRef title,
63861   Boolean primary,
63862   SInt16 menuID,
63863   Boolean variableWidth,
63864   SInt16 titleWidth,
63865   SInt16 titleJustification,
63866   Style titleStyle,
63867   ControlRef * outControl) ;
63868
63869
63870
63871
63872 enum {
63873   kControlGroupBoxMenuHandleTag = 'mhan',
63874   kControlGroupBoxMenuRefTag = 'mhan',
63875   kControlGroupBoxFontStyleTag = kControlFontStyleTag
63876 };
63877
63878
63879 enum {
63880   kControlGroupBoxTitleRectTag = 'trec'
63881 };
63882 enum {
63883   kControlImageWellProc = 176
63884 };
63885
63886
63887 enum {
63888   kControlKindImageWell = 'well'
63889 };
63890 extern OSStatus
63891 CreateImageWellControl(
63892   WindowRef window,
63893   const Rect * boundsRect,
63894   const ControlButtonContentInfo * info,
63895   ControlRef * outControl) ;
63896
63897
63898
63899 enum {
63900   kControlImageWellContentTag = 'cont',
63901   kControlImageWellTransformTag = 'tran',
63902   kControlImageWellIsDragDestinationTag = 'drag'
63903 };
63904 extern OSErr
63905 GetImageWellContentInfo(
63906   ControlRef inButton,
63907   ControlButtonContentInfoPtr outContent) ;
63908 extern OSErr
63909 SetImageWellContentInfo(
63910   ControlRef inButton,
63911   ControlButtonContentInfoPtr inContent) ;
63912 extern OSErr
63913 SetImageWellTransform(
63914   ControlRef inButton,
63915   IconTransformType inTransform) ;
63916 enum {
63917   kControlPopupArrowEastProc = 192,
63918   kControlPopupArrowWestProc = 193,
63919   kControlPopupArrowNorthProc = 194,
63920   kControlPopupArrowSouthProc = 195,
63921   kControlPopupArrowSmallEastProc = 196,
63922   kControlPopupArrowSmallWestProc = 197,
63923   kControlPopupArrowSmallNorthProc = 198,
63924   kControlPopupArrowSmallSouthProc = 199
63925 };
63926
63927
63928 enum {
63929   kControlPopupArrowOrientationEast = 0,
63930   kControlPopupArrowOrientationWest = 1,
63931   kControlPopupArrowOrientationNorth = 2,
63932   kControlPopupArrowOrientationSouth = 3
63933 };
63934
63935
63936 typedef UInt16 ControlPopupArrowOrientation;
63937
63938 enum {
63939   kControlPopupArrowSizeNormal = 0,
63940   kControlPopupArrowSizeSmall = 1
63941 };
63942
63943 typedef UInt16 ControlPopupArrowSize;
63944
63945 enum {
63946   kControlKindPopupArrow = 'parr'
63947 };
63948 extern OSStatus
63949 CreatePopupArrowControl(
63950   WindowRef window,
63951   const Rect * boundsRect,
63952   ControlPopupArrowOrientation orientation,
63953   ControlPopupArrowSize size,
63954   ControlRef * outControl) ;
63955
63956
63957
63958
63959
63960
63961 enum {
63962   kControlPlacardProc = 224
63963 };
63964
63965
63966 enum {
63967   kControlKindPlacard = 'plac'
63968 };
63969 extern OSStatus
63970 CreatePlacardControl(
63971   WindowRef window,
63972   const Rect * boundsRect,
63973   ControlRef * outControl) ;
63974 enum {
63975   kControlClockTimeProc = 240,
63976   kControlClockTimeSecondsProc = 241,
63977   kControlClockDateProc = 242,
63978   kControlClockMonthYearProc = 243
63979 };
63980
63981
63982 typedef UInt16 ControlClockType;
63983 enum {
63984   kControlClockTypeHourMinute = 0,
63985   kControlClockTypeHourMinuteSecond = 1,
63986   kControlClockTypeMonthDayYear = 2,
63987   kControlClockTypeMonthYear = 3
63988 };
63989
63990
63991
63992
63993 typedef UInt32 ControlClockFlags;
63994 enum {
63995   kControlClockFlagStandard = 0,
63996   kControlClockNoFlags = 0,
63997   kControlClockFlagDisplayOnly = 1,
63998   kControlClockIsDisplayOnly = 1,
63999   kControlClockFlagLive = 2,
64000   kControlClockIsLive = 2
64001 };
64002
64003
64004 enum {
64005   kControlKindClock = 'clck'
64006 };
64007 extern OSStatus
64008 CreateClockControl(
64009   WindowRef window,
64010   const Rect * boundsRect,
64011   ControlClockType clockType,
64012   ControlClockFlags clockFlags,
64013   ControlRef * outControl) ;
64014
64015
64016
64017 enum {
64018   kControlClockLongDateTag = 'date',
64019   kControlClockFontStyleTag = kControlFontStyleTag,
64020   kControlClockAnimatingTag = 'anim'
64021 };
64022 enum {
64023   kControlUserPaneProc = 256
64024 };
64025
64026
64027 enum {
64028   kControlKindUserPane = 'upan'
64029 };
64030 extern OSStatus
64031 CreateUserPaneControl(
64032   WindowRef window,
64033   const Rect * boundsRect,
64034   UInt32 features,
64035   ControlRef * outControl) ;
64036
64037
64038
64039
64040 enum {
64041   kControlUserItemDrawProcTag = 'uidp',
64042   kControlUserPaneDrawProcTag = 'draw',
64043   kControlUserPaneHitTestProcTag = 'hitt',
64044   kControlUserPaneTrackingProcTag = 'trak',
64045   kControlUserPaneIdleProcTag = 'idle',
64046   kControlUserPaneKeyDownProcTag = 'keyd',
64047   kControlUserPaneActivateProcTag = 'acti',
64048   kControlUserPaneFocusProcTag = 'foci',
64049   kControlUserPaneBackgroundProcTag = 'back'
64050 };
64051
64052 typedef void ( * ControlUserPaneDrawProcPtr)(ControlRef control, SInt16 part);
64053 typedef ControlPartCode ( * ControlUserPaneHitTestProcPtr)(ControlRef control, Point where);
64054 typedef ControlPartCode ( * ControlUserPaneTrackingProcPtr)(ControlRef control, Point startPt, ControlActionUPP actionProc);
64055 typedef void ( * ControlUserPaneIdleProcPtr)(ControlRef control);
64056 typedef ControlPartCode ( * ControlUserPaneKeyDownProcPtr)(ControlRef control, SInt16 keyCode, SInt16 charCode, SInt16 modifiers);
64057 typedef void ( * ControlUserPaneActivateProcPtr)(ControlRef control, Boolean activating);
64058 typedef ControlPartCode ( * ControlUserPaneFocusProcPtr)(ControlRef control, ControlFocusPart action);
64059 typedef void ( * ControlUserPaneBackgroundProcPtr)(ControlRef control, ControlBackgroundPtr info);
64060 typedef ControlUserPaneDrawProcPtr ControlUserPaneDrawUPP;
64061 typedef ControlUserPaneHitTestProcPtr ControlUserPaneHitTestUPP;
64062 typedef ControlUserPaneTrackingProcPtr ControlUserPaneTrackingUPP;
64063 typedef ControlUserPaneIdleProcPtr ControlUserPaneIdleUPP;
64064 typedef ControlUserPaneKeyDownProcPtr ControlUserPaneKeyDownUPP;
64065 typedef ControlUserPaneActivateProcPtr ControlUserPaneActivateUPP;
64066 typedef ControlUserPaneFocusProcPtr ControlUserPaneFocusUPP;
64067 typedef ControlUserPaneBackgroundProcPtr ControlUserPaneBackgroundUPP;
64068 extern ControlUserPaneDrawUPP
64069 NewControlUserPaneDrawUPP(ControlUserPaneDrawProcPtr userRoutine) ;
64070 extern ControlUserPaneHitTestUPP
64071 NewControlUserPaneHitTestUPP(ControlUserPaneHitTestProcPtr userRoutine) ;
64072 extern ControlUserPaneTrackingUPP
64073 NewControlUserPaneTrackingUPP(ControlUserPaneTrackingProcPtr userRoutine) ;
64074 extern ControlUserPaneIdleUPP
64075 NewControlUserPaneIdleUPP(ControlUserPaneIdleProcPtr userRoutine) ;
64076 extern ControlUserPaneKeyDownUPP
64077 NewControlUserPaneKeyDownUPP(ControlUserPaneKeyDownProcPtr userRoutine) ;
64078 extern ControlUserPaneActivateUPP
64079 NewControlUserPaneActivateUPP(ControlUserPaneActivateProcPtr userRoutine) ;
64080 extern ControlUserPaneFocusUPP
64081 NewControlUserPaneFocusUPP(ControlUserPaneFocusProcPtr userRoutine) ;
64082 extern ControlUserPaneBackgroundUPP
64083 NewControlUserPaneBackgroundUPP(ControlUserPaneBackgroundProcPtr userRoutine) ;
64084 extern void
64085 DisposeControlUserPaneDrawUPP(ControlUserPaneDrawUPP userUPP) ;
64086 extern void
64087 DisposeControlUserPaneHitTestUPP(ControlUserPaneHitTestUPP userUPP) ;
64088 extern void
64089 DisposeControlUserPaneTrackingUPP(ControlUserPaneTrackingUPP userUPP) ;
64090 extern void
64091 DisposeControlUserPaneIdleUPP(ControlUserPaneIdleUPP userUPP) ;
64092 extern void
64093 DisposeControlUserPaneKeyDownUPP(ControlUserPaneKeyDownUPP userUPP) ;
64094 extern void
64095 DisposeControlUserPaneActivateUPP(ControlUserPaneActivateUPP userUPP) ;
64096 extern void
64097 DisposeControlUserPaneFocusUPP(ControlUserPaneFocusUPP userUPP) ;
64098 extern void
64099 DisposeControlUserPaneBackgroundUPP(ControlUserPaneBackgroundUPP userUPP) ;
64100 extern void
64101 InvokeControlUserPaneDrawUPP(
64102   ControlRef control,
64103   SInt16 part,
64104   ControlUserPaneDrawUPP userUPP) ;
64105 extern ControlPartCode
64106 InvokeControlUserPaneHitTestUPP(
64107   ControlRef control,
64108   Point where,
64109   ControlUserPaneHitTestUPP userUPP) ;
64110 extern ControlPartCode
64111 InvokeControlUserPaneTrackingUPP(
64112   ControlRef control,
64113   Point startPt,
64114   ControlActionUPP actionProc,
64115   ControlUserPaneTrackingUPP userUPP) ;
64116 extern void
64117 InvokeControlUserPaneIdleUPP(
64118   ControlRef control,
64119   ControlUserPaneIdleUPP userUPP) ;
64120 extern ControlPartCode
64121 InvokeControlUserPaneKeyDownUPP(
64122   ControlRef control,
64123   SInt16 keyCode,
64124   SInt16 charCode,
64125   SInt16 modifiers,
64126   ControlUserPaneKeyDownUPP userUPP) ;
64127 extern void
64128 InvokeControlUserPaneActivateUPP(
64129   ControlRef control,
64130   Boolean activating,
64131   ControlUserPaneActivateUPP userUPP) ;
64132 extern ControlPartCode
64133 InvokeControlUserPaneFocusUPP(
64134   ControlRef control,
64135   ControlFocusPart action,
64136   ControlUserPaneFocusUPP userUPP) ;
64137 extern void
64138 InvokeControlUserPaneBackgroundUPP(
64139   ControlRef control,
64140   ControlBackgroundPtr info,
64141   ControlUserPaneBackgroundUPP userUPP) ;
64142
64143
64144
64145
64146
64147
64148
64149 enum {
64150   kControlEditTextProc = 272,
64151   kControlEditTextPasswordProc = 274
64152 };
64153
64154
64155 enum {
64156   kControlEditTextInlineInputProc = 276
64157 };
64158
64159
64160 enum {
64161   kControlKindEditText = 'etxt'
64162 };
64163 extern OSStatus
64164 CreateEditTextControl(
64165   WindowRef window,
64166   const Rect * boundsRect,
64167   CFStringRef text,
64168   Boolean isPassword,
64169   Boolean useInlineInput,
64170   const ControlFontStyleRec * style,
64171   ControlRef * outControl) ;
64172
64173
64174
64175
64176 enum {
64177   kControlEditTextStyleTag = kControlFontStyleTag,
64178   kControlEditTextTextTag = 'text',
64179   kControlEditTextTEHandleTag = 'than',
64180   kControlEditTextKeyFilterTag = kControlKeyFilterTag,
64181   kControlEditTextSelectionTag = 'sele',
64182   kControlEditTextPasswordTag = 'pass'
64183 };
64184
64185
64186 enum {
64187   kControlEditTextKeyScriptBehaviorTag = 'kscr',
64188
64189   kControlEditTextLockedTag = 'lock',
64190   kControlEditTextFixedTextTag = 'ftxt',
64191   kControlEditTextValidationProcTag = 'vali',
64192   kControlEditTextInlinePreUpdateProcTag = 'prup',
64193   kControlEditTextInlinePostUpdateProcTag = 'poup'
64194 };
64195
64196
64197
64198
64199
64200
64201 enum {
64202
64203
64204
64205
64206
64207
64208   kControlEditTextCFStringTag = 'cfst',
64209
64210
64211
64212
64213
64214
64215   kControlEditTextPasswordCFStringTag = 'pwcf'
64216 };
64217
64218
64219
64220
64221
64222 struct ControlEditTextSelectionRec {
64223   SInt16 selStart;
64224   SInt16 selEnd;
64225 };
64226 typedef struct ControlEditTextSelectionRec ControlEditTextSelectionRec;
64227 typedef ControlEditTextSelectionRec * ControlEditTextSelectionPtr;
64228 typedef void ( * ControlEditTextValidationProcPtr)(ControlRef control);
64229 typedef ControlEditTextValidationProcPtr ControlEditTextValidationUPP;
64230 extern ControlEditTextValidationUPP
64231 NewControlEditTextValidationUPP(ControlEditTextValidationProcPtr userRoutine) ;
64232 extern void
64233 DisposeControlEditTextValidationUPP(ControlEditTextValidationUPP userUPP) ;
64234 extern void
64235 InvokeControlEditTextValidationUPP(
64236   ControlRef control,
64237   ControlEditTextValidationUPP userUPP) ;
64238
64239
64240
64241
64242
64243 enum {
64244   kControlStaticTextProc = 288
64245 };
64246
64247
64248 enum {
64249   kControlKindStaticText = 'stxt'
64250 };
64251 extern OSStatus
64252 CreateStaticTextControl(
64253   WindowRef window,
64254   const Rect * boundsRect,
64255   CFStringRef text,
64256   const ControlFontStyleRec * style,
64257   ControlRef * outControl) ;
64258
64259
64260
64261
64262 enum {
64263   kControlStaticTextStyleTag = kControlFontStyleTag,
64264   kControlStaticTextTextTag = 'text',
64265   kControlStaticTextTextHeightTag = 'thei'
64266 };
64267
64268
64269 enum {
64270   kControlStaticTextTruncTag = 'trun'
64271 };
64272
64273
64274 enum {
64275   kControlStaticTextCFStringTag = 'cfst'
64276 };
64277 enum {
64278   kControlPictureProc = 304,
64279   kControlPictureNoTrackProc = 305
64280 };
64281
64282
64283 enum {
64284   kControlKindPicture = 'pict'
64285 };
64286 extern OSStatus
64287 CreatePictureControl(
64288   WindowRef window,
64289   const Rect * boundsRect,
64290   const ControlButtonContentInfo * content,
64291   Boolean dontTrack,
64292   ControlRef * outControl) ;
64293
64294
64295
64296 enum {
64297   kControlPictureHandleTag = 'pich'
64298 };
64299 enum {
64300   kControlIconProc = 320,
64301   kControlIconNoTrackProc = 321,
64302   kControlIconSuiteProc = 322,
64303   kControlIconSuiteNoTrackProc = 323
64304 };
64305
64306 enum {
64307
64308
64309
64310   kControlIconRefProc = 324,
64311   kControlIconRefNoTrackProc = 325
64312 };
64313
64314
64315 enum {
64316   kControlKindIcon = 'icon'
64317 };
64318 extern OSStatus
64319 CreateIconControl(
64320   WindowRef inWindow,
64321   const Rect * inBoundsRect,
64322   const ControlButtonContentInfo * inIconContent,
64323   Boolean inDontTrack,
64324   ControlRef * outControl) ;
64325
64326
64327
64328 enum {
64329   kControlIconTransformTag = 'trfm',
64330   kControlIconAlignmentTag = 'algn'
64331 };
64332
64333
64334 enum {
64335   kControlIconResourceIDTag = 'ires',
64336   kControlIconContentTag = 'cont'
64337 };
64338
64339
64340
64341
64342
64343 enum {
64344   kControlWindowHeaderProc = 336,
64345   kControlWindowListViewHeaderProc = 337
64346 };
64347
64348
64349 enum {
64350   kControlKindWindowHeader = 'whed'
64351 };
64352 extern OSStatus
64353 CreateWindowHeaderControl(
64354   WindowRef window,
64355   const Rect * boundsRect,
64356   Boolean isListHeader,
64357   ControlRef * outControl) ;
64358 enum {
64359   kControlListBoxProc = 352,
64360   kControlListBoxAutoSizeProc = 353
64361 };
64362
64363
64364 enum {
64365   kControlKindListBox = 'lbox'
64366 };
64367 extern OSStatus
64368 CreateListBoxControl(
64369   WindowRef window,
64370   const Rect * boundsRect,
64371   Boolean autoSize,
64372   SInt16 numRows,
64373   SInt16 numColumns,
64374   Boolean horizScroll,
64375   Boolean vertScroll,
64376   SInt16 cellHeight,
64377   SInt16 cellWidth,
64378   Boolean hasGrowSpace,
64379   const ListDefSpec * listDef,
64380   ControlRef * outControl) ;
64381
64382
64383
64384 enum {
64385   kControlListBoxListHandleTag = 'lhan',
64386   kControlListBoxKeyFilterTag = kControlKeyFilterTag,
64387   kControlListBoxFontStyleTag = kControlFontStyleTag
64388 };
64389
64390
64391 enum {
64392   kControlListBoxDoubleClickTag = 'dblc',
64393   kControlListBoxLDEFTag = 'ldef'
64394 };
64395 enum {
64396   kControlPushButtonProc = 368,
64397   kControlCheckBoxProc = 369,
64398   kControlRadioButtonProc = 370,
64399   kControlPushButLeftIconProc = 374,
64400   kControlPushButRightIconProc = 375
64401 };
64402
64403
64404 enum {
64405   kControlCheckBoxAutoToggleProc = 371,
64406   kControlRadioButtonAutoToggleProc = 372
64407 };
64408
64409
64410 typedef UInt16 ControlPushButtonIconAlignment;
64411 enum {
64412   kControlPushButtonIconOnLeft = 6,
64413   kControlPushButtonIconOnRight = 7
64414 };
64415
64416
64417 enum {
64418   kControlKindPushButton = 'push',
64419   kControlKindPushIconButton = 'picn',
64420   kControlKindRadioButton = 'rdio',
64421   kControlKindCheckBox = 'cbox'
64422 };
64423 extern OSStatus
64424 CreatePushButtonControl(
64425   WindowRef window,
64426   const Rect * boundsRect,
64427   CFStringRef title,
64428   ControlRef * outControl) ;
64429 extern OSStatus
64430 CreatePushButtonWithIconControl(
64431   WindowRef window,
64432   const Rect * boundsRect,
64433   CFStringRef title,
64434   ControlButtonContentInfo * icon,
64435   ControlPushButtonIconAlignment iconAlignment,
64436   ControlRef * outControl) ;
64437 extern OSStatus
64438 CreateRadioButtonControl(
64439   WindowRef window,
64440   const Rect * boundsRect,
64441   CFStringRef title,
64442   SInt32 initialValue,
64443   Boolean autoToggle,
64444   ControlRef * outControl) ;
64445 extern OSStatus
64446 CreateCheckBoxControl(
64447   WindowRef window,
64448   const Rect * boundsRect,
64449   CFStringRef title,
64450   SInt32 initialValue,
64451   Boolean autoToggle,
64452   ControlRef * outControl) ;
64453
64454
64455
64456
64457
64458 enum {
64459   kControlPushButtonDefaultTag = 'dflt',
64460   kControlPushButtonCancelTag = 'cncl'
64461 };
64462
64463
64464
64465
64466
64467
64468
64469 enum {
64470   kControlScrollBarProc = 384,
64471   kControlScrollBarLiveProc = 386
64472 };
64473
64474
64475 enum {
64476   kControlKindScrollBar = 'sbar'
64477 };
64478 extern OSStatus
64479 CreateScrollBarControl(
64480   WindowRef window,
64481   const Rect * boundsRect,
64482   SInt32 value,
64483   SInt32 minimum,
64484   SInt32 maximum,
64485   SInt32 viewSize,
64486   Boolean liveTracking,
64487   ControlActionUPP liveTrackingProc,
64488   ControlRef * outControl) ;
64489
64490
64491
64492 enum {
64493   kControlScrollBarShowsArrowsTag = 'arro'
64494 };
64495 enum {
64496   kControlPopupButtonProc = 400,
64497   kControlPopupFixedWidthVariant = 1 << 0,
64498   kControlPopupVariableWidthVariant = 1 << 1,
64499   kControlPopupUseAddResMenuVariant = 1 << 2,
64500   kControlPopupUseWFontVariant = kControlUsesOwningWindowsFontVariant
64501 };
64502
64503
64504 enum {
64505   kControlKindPopupButton = 'popb'
64506 };
64507 extern OSStatus
64508 CreatePopupButtonControl(
64509   WindowRef window,
64510   const Rect * boundsRect,
64511   CFStringRef title,
64512   SInt16 menuID,
64513   Boolean variableWidth,
64514   SInt16 titleWidth,
64515   SInt16 titleJustification,
64516   Style titleStyle,
64517   ControlRef * outControl) ;
64518
64519
64520
64521
64522
64523 enum {
64524   kControlPopupButtonMenuHandleTag = 'mhan',
64525   kControlPopupButtonMenuRefTag = 'mhan',
64526   kControlPopupButtonMenuIDTag = 'mnid'
64527 };
64528
64529
64530 enum {
64531   kControlPopupButtonExtraHeightTag = 'exht',
64532   kControlPopupButtonOwnedMenuRefTag = 'omrf'
64533 };
64534
64535
64536 enum {
64537   kControlPopupButtonCheckCurrentTag = 'chck'
64538 };
64539 enum {
64540   kControlRadioGroupProc = 416
64541 };
64542
64543
64544 enum {
64545   kControlKindRadioGroup = 'rgrp'
64546 };
64547 extern OSStatus
64548 CreateRadioGroupControl(
64549   WindowRef window,
64550   const Rect * boundsRect,
64551   ControlRef * outControl) ;
64552 enum {
64553   kControlScrollTextBoxProc = 432,
64554   kControlScrollTextBoxAutoScrollProc = 433
64555 };
64556
64557
64558 enum {
64559   kControlKindScrollingTextBox = 'stbx'
64560 };
64561 extern OSStatus
64562 CreateScrollingTextBoxControl(
64563   WindowRef window,
64564   const Rect * boundsRect,
64565   SInt16 contentResID,
64566   Boolean autoScroll,
64567   UInt32 delayBeforeAutoScroll,
64568   UInt32 delayBetweenAutoScroll,
64569   UInt16 autoScrollAmount,
64570   ControlRef * outControl) ;
64571
64572
64573
64574 enum {
64575   kControlScrollTextBoxDelayBeforeAutoScrollTag = 'stdl',
64576   kControlScrollTextBoxDelayBetweenAutoScrollTag = 'scdl',
64577   kControlScrollTextBoxAutoScrollAmountTag = 'samt',
64578   kControlScrollTextBoxContentsTag = 'tres',
64579   kControlScrollTextBoxAnimatingTag = 'anim'
64580 };
64581 extern OSStatus
64582 CreateDisclosureButtonControl(
64583   WindowRef inWindow,
64584   const Rect * inBoundsRect,
64585   SInt32 inValue,
64586   Boolean inAutoToggles,
64587   ControlRef * outControl) ;
64588
64589
64590
64591
64592 enum {
64593   kControlKindDisclosureButton = 'disb'
64594 };
64595
64596
64597
64598
64599
64600
64601 enum {
64602
64603
64604
64605
64606   kControlDisclosureButtonClosed = 0,
64607
64608
64609
64610
64611   kControlDisclosureButtonDisclosed = 1
64612 };
64613 typedef SInt16 ControlRoundButtonSize;
64614 enum {
64615
64616
64617
64618
64619   kControlRoundButtonNormalSize = kControlSizeNormal,
64620
64621
64622
64623
64624   kControlRoundButtonLargeSize = kControlSizeLarge
64625 };
64626
64627
64628 enum {
64629   kControlRoundButtonContentTag = 'cont',
64630   kControlRoundButtonSizeTag = kControlSizeTag
64631 };
64632
64633
64634 enum {
64635   kControlKindRoundButton = 'rndb'
64636 };
64637 extern OSStatus
64638 CreateRoundButtonControl(
64639   WindowRef inWindow,
64640   const Rect * inBoundsRect,
64641   ControlRoundButtonSize inSize,
64642   ControlButtonContentInfo * inContent,
64643   ControlRef * outControl) ;
64644 enum {
64645   kControlKindDataBrowser = 'datb'
64646 };
64647
64648
64649 enum {
64650   errDataBrowserNotConfigured = -4970,
64651   errDataBrowserItemNotFound = -4971,
64652   errDataBrowserItemNotAdded = -4975,
64653   errDataBrowserPropertyNotFound = -4972,
64654   errDataBrowserInvalidPropertyPart = -4973,
64655   errDataBrowserInvalidPropertyData = -4974,
64656   errDataBrowserPropertyNotSupported = -4979
64657 };
64658
64659 enum {
64660
64661   kControlDataBrowserIncludesFrameAndFocusTag = 'brdr',
64662   kControlDataBrowserKeyFilterTag = kControlEditTextKeyFilterTag,
64663   kControlDataBrowserEditTextKeyFilterTag = kControlDataBrowserKeyFilterTag,
64664   kControlDataBrowserEditTextValidationProcTag = kControlEditTextValidationProcTag
64665 };
64666
64667
64668 typedef OSType DataBrowserViewStyle;
64669 enum {
64670   kDataBrowserNoView = 0x3F3F3F3F,
64671   kDataBrowserListView = 'lstv',
64672   kDataBrowserColumnView = 'clmv'
64673 };
64674
64675
64676 typedef UInt32 DataBrowserSelectionFlags;
64677 enum {
64678   kDataBrowserDragSelect = 1 << 0,
64679   kDataBrowserSelectOnlyOne = 1 << 1,
64680   kDataBrowserResetSelection = 1 << 2,
64681   kDataBrowserCmdTogglesSelection = 1 << 3,
64682   kDataBrowserNoDisjointSelection = 1 << 4,
64683   kDataBrowserAlwaysExtendSelection = 1 << 5,
64684   kDataBrowserNeverEmptySelectionSet = 1 << 6
64685 };
64686
64687
64688 typedef UInt16 DataBrowserSortOrder;
64689 enum {
64690   kDataBrowserOrderUndefined = 0,
64691   kDataBrowserOrderIncreasing = 1,
64692   kDataBrowserOrderDecreasing = 2
64693 };
64694
64695
64696 typedef UInt32 DataBrowserItemID;
64697 enum {
64698   kDataBrowserNoItem = 0L
64699 };
64700
64701 typedef UInt32 DataBrowserItemState;
64702 enum {
64703   kDataBrowserItemNoState = 0,
64704   kDataBrowserItemAnyState = (unsigned long)(-1),
64705   kDataBrowserItemIsSelected = 1 << 0,
64706   kDataBrowserContainerIsOpen = 1 << 1,
64707   kDataBrowserItemIsDragTarget = 1 << 2
64708 };
64709
64710
64711 typedef UInt8 DataBrowserRevealOptions;
64712 enum {
64713   kDataBrowserRevealOnly = 0,
64714   kDataBrowserRevealAndCenterInView = 1 << 0,
64715   kDataBrowserRevealWithoutSelecting = 1 << 1
64716 };
64717
64718
64719 typedef UInt32 DataBrowserSetOption;
64720 enum {
64721   kDataBrowserItemsAdd = 0,
64722   kDataBrowserItemsAssign = 1,
64723   kDataBrowserItemsToggle = 2,
64724   kDataBrowserItemsRemove = 3
64725 };
64726
64727
64728 typedef UInt32 DataBrowserSelectionAnchorDirection;
64729 enum {
64730   kDataBrowserSelectionAnchorUp = 0,
64731   kDataBrowserSelectionAnchorDown = 1,
64732   kDataBrowserSelectionAnchorLeft = 2,
64733   kDataBrowserSelectionAnchorRight = 3
64734 };
64735
64736
64737 typedef UInt32 DataBrowserEditCommand;
64738 enum {
64739   kDataBrowserEditMsgUndo = kHICommandUndo,
64740   kDataBrowserEditMsgRedo = kHICommandRedo,
64741   kDataBrowserEditMsgCut = kHICommandCut,
64742   kDataBrowserEditMsgCopy = kHICommandCopy,
64743   kDataBrowserEditMsgPaste = kHICommandPaste,
64744   kDataBrowserEditMsgClear = kHICommandClear,
64745   kDataBrowserEditMsgSelectAll = kHICommandSelectAll
64746 };
64747
64748
64749 typedef UInt32 DataBrowserItemNotification;
64750 enum {
64751   kDataBrowserItemAdded = 1,
64752   kDataBrowserItemRemoved = 2,
64753   kDataBrowserEditStarted = 3,
64754   kDataBrowserEditStopped = 4,
64755   kDataBrowserItemSelected = 5,
64756   kDataBrowserItemDeselected = 6,
64757   kDataBrowserItemDoubleClicked = 7,
64758   kDataBrowserContainerOpened = 8,
64759   kDataBrowserContainerClosing = 9,
64760   kDataBrowserContainerClosed = 10,
64761   kDataBrowserContainerSorting = 11,
64762   kDataBrowserContainerSorted = 12,
64763   kDataBrowserUserToggledContainer = 16,
64764   kDataBrowserTargetChanged = 15,
64765   kDataBrowserUserStateChanged = 13,
64766   kDataBrowserSelectionSetChanged = 14
64767 };
64768
64769
64770
64771 typedef UInt32 DataBrowserPropertyID;
64772 enum {
64773
64774   kDataBrowserItemNoProperty = 0L,
64775   kDataBrowserItemIsActiveProperty = 1L,
64776   kDataBrowserItemIsSelectableProperty = 2L,
64777   kDataBrowserItemIsEditableProperty = 3L,
64778   kDataBrowserItemIsContainerProperty = 4L,
64779   kDataBrowserContainerIsOpenableProperty = 5L,
64780   kDataBrowserContainerIsClosableProperty = 6L,
64781   kDataBrowserContainerIsSortableProperty = 7L,
64782   kDataBrowserItemSelfIdentityProperty = 8L,
64783   kDataBrowserContainerAliasIDProperty = 9L,
64784   kDataBrowserColumnViewPreviewProperty = 10L,
64785   kDataBrowserItemParentContainerProperty = 11L
64786 };
64787
64788
64789
64790
64791 typedef OSType DataBrowserPropertyType;
64792 enum {
64793
64794   kDataBrowserCustomType = 0x3F3F3F3F,
64795   kDataBrowserIconType = 'icnr',
64796   kDataBrowserTextType = 'text',
64797   kDataBrowserDateTimeType = 'date',
64798   kDataBrowserSliderType = 'sldr',
64799   kDataBrowserCheckboxType = 'chbx',
64800   kDataBrowserProgressBarType = 'prog',
64801   kDataBrowserRelevanceRankType = 'rank',
64802   kDataBrowserPopupMenuType = 'menu',
64803   kDataBrowserIconAndTextType = 'ticn'
64804 };
64805
64806
64807
64808
64809 typedef OSType DataBrowserPropertyPart;
64810 enum {
64811   kDataBrowserPropertyEnclosingPart = 0L,
64812   kDataBrowserPropertyContentPart = '----',
64813   kDataBrowserPropertyDisclosurePart = 'disc',
64814   kDataBrowserPropertyTextPart = kDataBrowserTextType,
64815   kDataBrowserPropertyIconPart = kDataBrowserIconType,
64816   kDataBrowserPropertySliderPart = kDataBrowserSliderType,
64817   kDataBrowserPropertyCheckboxPart = kDataBrowserCheckboxType,
64818   kDataBrowserPropertyProgressBarPart = kDataBrowserProgressBarType,
64819   kDataBrowserPropertyRelevanceRankPart = kDataBrowserRelevanceRankType
64820 };
64821
64822
64823 typedef unsigned long DataBrowserPropertyFlags;
64824
64825 enum {
64826   kDataBrowserUniversalPropertyFlagsMask = 0xFF,
64827   kDataBrowserPropertyIsMutable = 1 << 0,
64828   kDataBrowserDefaultPropertyFlags = 0 << 0,
64829   kDataBrowserUniversalPropertyFlags = kDataBrowserUniversalPropertyFlagsMask,
64830   kDataBrowserPropertyIsEditable = kDataBrowserPropertyIsMutable
64831 };
64832
64833
64834 enum {
64835   kDataBrowserPropertyFlagsOffset = 8,
64836   kDataBrowserPropertyFlagsMask = 0xFF << kDataBrowserPropertyFlagsOffset,
64837   kDataBrowserCheckboxTriState = 1 << kDataBrowserPropertyFlagsOffset,
64838   kDataBrowserDateTimeRelative = 1 << (kDataBrowserPropertyFlagsOffset),
64839   kDataBrowserDateTimeDateOnly = 1 << (kDataBrowserPropertyFlagsOffset + 1),
64840   kDataBrowserDateTimeTimeOnly = 1 << (kDataBrowserPropertyFlagsOffset + 2),
64841   kDataBrowserDateTimeSecondsToo = 1 << (kDataBrowserPropertyFlagsOffset + 3),
64842   kDataBrowserSliderPlainThumb = kThemeThumbPlain << kDataBrowserPropertyFlagsOffset,
64843   kDataBrowserSliderUpwardThumb = kThemeThumbUpward << kDataBrowserPropertyFlagsOffset,
64844   kDataBrowserSliderDownwardThumb = kThemeThumbDownward << kDataBrowserPropertyFlagsOffset,
64845   kDataBrowserDoNotTruncateText = 3 << kDataBrowserPropertyFlagsOffset,
64846   kDataBrowserTruncateTextAtEnd = 2 << kDataBrowserPropertyFlagsOffset,
64847   kDataBrowserTruncateTextMiddle = 0 << kDataBrowserPropertyFlagsOffset,
64848   kDataBrowserTruncateTextAtStart = 1 << kDataBrowserPropertyFlagsOffset,
64849   kDataBrowserPropertyModificationFlags = kDataBrowserPropertyFlagsMask,
64850   kDataBrowserRelativeDateTime = kDataBrowserDateTimeRelative
64851 };
64852
64853
64854
64855
64856
64857 enum {
64858   kDataBrowserViewSpecificFlagsOffset = 16,
64859   kDataBrowserViewSpecificFlagsMask = 0xFF << kDataBrowserViewSpecificFlagsOffset,
64860   kDataBrowserViewSpecificPropertyFlags = kDataBrowserViewSpecificFlagsMask
64861 };
64862
64863
64864 enum {
64865   kDataBrowserClientPropertyFlagsOffset = 24,
64866   kDataBrowserClientPropertyFlagsMask = (unsigned long)(0xFF << kDataBrowserClientPropertyFlagsOffset)
64867 };
64868
64869
64870 struct DataBrowserPropertyDesc {
64871   DataBrowserPropertyID propertyID;
64872   DataBrowserPropertyType propertyType;
64873   DataBrowserPropertyFlags propertyFlags;
64874 };
64875 typedef struct DataBrowserPropertyDesc DataBrowserPropertyDesc;
64876
64877 typedef void ( * DataBrowserItemProcPtr)(DataBrowserItemID item, DataBrowserItemState state, void *clientData);
64878 typedef DataBrowserItemProcPtr DataBrowserItemUPP;
64879 extern DataBrowserItemUPP
64880 NewDataBrowserItemUPP(DataBrowserItemProcPtr userRoutine) ;
64881 extern void
64882 DisposeDataBrowserItemUPP(DataBrowserItemUPP userUPP) ;
64883 extern void
64884 InvokeDataBrowserItemUPP(
64885   DataBrowserItemID item,
64886   DataBrowserItemState state,
64887   void * clientData,
64888   DataBrowserItemUPP userUPP) ;
64889 extern OSStatus
64890 CreateDataBrowserControl(
64891   WindowRef window,
64892   const Rect * boundsRect,
64893   DataBrowserViewStyle style,
64894   ControlRef * outControl) ;
64895 extern OSStatus
64896 GetDataBrowserViewStyle(
64897   ControlRef browser,
64898   DataBrowserViewStyle * style) ;
64899 extern OSStatus
64900 SetDataBrowserViewStyle(
64901   ControlRef browser,
64902   DataBrowserViewStyle style) ;
64903 extern OSStatus
64904 AddDataBrowserItems(
64905   ControlRef browser,
64906   DataBrowserItemID container,
64907   UInt32 numItems,
64908   const DataBrowserItemID * items,
64909   DataBrowserPropertyID preSortProperty) ;
64910 extern OSStatus
64911 RemoveDataBrowserItems(
64912   ControlRef browser,
64913   DataBrowserItemID container,
64914   UInt32 numItems,
64915   const DataBrowserItemID * items,
64916   DataBrowserPropertyID preSortProperty) ;
64917 extern OSStatus
64918 UpdateDataBrowserItems(
64919   ControlRef browser,
64920   DataBrowserItemID container,
64921   UInt32 numItems,
64922   const DataBrowserItemID * items,
64923   DataBrowserPropertyID preSortProperty,
64924   DataBrowserPropertyID propertyID) ;
64925 extern Boolean
64926 EnableDataBrowserEditCommand(
64927   ControlRef browser,
64928   DataBrowserEditCommand command) ;
64929 extern OSStatus
64930 ExecuteDataBrowserEditCommand(
64931   ControlRef browser,
64932   DataBrowserEditCommand command) ;
64933 extern OSStatus
64934 GetDataBrowserSelectionAnchor(
64935   ControlRef browser,
64936   DataBrowserItemID * first,
64937   DataBrowserItemID * last) ;
64938 extern OSStatus
64939 MoveDataBrowserSelectionAnchor(
64940   ControlRef browser,
64941   DataBrowserSelectionAnchorDirection direction,
64942   Boolean extendSelection) ;
64943 extern OSStatus
64944 OpenDataBrowserContainer(
64945   ControlRef browser,
64946   DataBrowserItemID container) ;
64947 extern OSStatus
64948 CloseDataBrowserContainer(
64949   ControlRef browser,
64950   DataBrowserItemID container) ;
64951 extern OSStatus
64952 SortDataBrowserContainer(
64953   ControlRef browser,
64954   DataBrowserItemID container,
64955   Boolean sortChildren) ;
64956 extern OSStatus
64957 GetDataBrowserItems(
64958   ControlRef browser,
64959   DataBrowserItemID container,
64960   Boolean recurse,
64961   DataBrowserItemState state,
64962   Handle items) ;
64963 extern OSStatus
64964 GetDataBrowserItemCount(
64965   ControlRef browser,
64966   DataBrowserItemID container,
64967   Boolean recurse,
64968   DataBrowserItemState state,
64969   UInt32 * numItems) ;
64970 extern OSStatus
64971 ForEachDataBrowserItem(
64972   ControlRef browser,
64973   DataBrowserItemID container,
64974   Boolean recurse,
64975   DataBrowserItemState state,
64976   DataBrowserItemUPP callback,
64977   void * clientData) ;
64978 extern Boolean
64979 IsDataBrowserItemSelected(
64980   ControlRef browser,
64981   DataBrowserItemID item) ;
64982 extern OSStatus
64983 GetDataBrowserItemState(
64984   ControlRef browser,
64985   DataBrowserItemID item,
64986   DataBrowserItemState * state) ;
64987 extern OSStatus
64988 RevealDataBrowserItem(
64989   ControlRef browser,
64990   DataBrowserItemID item,
64991   DataBrowserPropertyID propertyID,
64992   DataBrowserRevealOptions options) ;
64993 extern OSStatus
64994 SetDataBrowserSelectedItems(
64995   ControlRef browser,
64996   UInt32 numItems,
64997   const DataBrowserItemID * items,
64998   DataBrowserSetOption operation) ;
64999 extern OSStatus
65000 SetDataBrowserUserState(
65001   ControlRef browser,
65002   CFDataRef stateInfo) ;
65003 extern OSStatus
65004 GetDataBrowserUserState(
65005   ControlRef browser,
65006   CFDataRef * stateInfo) ;
65007 extern OSStatus
65008 SetDataBrowserActiveItems(
65009   ControlRef browser,
65010   Boolean active) ;
65011 extern OSStatus
65012 GetDataBrowserActiveItems(
65013   ControlRef browser,
65014   Boolean * active) ;
65015 extern OSStatus
65016 SetDataBrowserScrollBarInset(
65017   ControlRef browser,
65018   Rect * insetRect) ;
65019 extern OSStatus
65020 GetDataBrowserScrollBarInset(
65021   ControlRef browser,
65022   Rect * insetRect) ;
65023 extern OSStatus
65024 SetDataBrowserTarget(
65025   ControlRef browser,
65026   DataBrowserItemID target) ;
65027 extern OSStatus
65028 GetDataBrowserTarget(
65029   ControlRef browser,
65030   DataBrowserItemID * target) ;
65031 extern OSStatus
65032 SetDataBrowserSortOrder(
65033   ControlRef browser,
65034   DataBrowserSortOrder order) ;
65035 extern OSStatus
65036 GetDataBrowserSortOrder(
65037   ControlRef browser,
65038   DataBrowserSortOrder * order) ;
65039 extern OSStatus
65040 SetDataBrowserScrollPosition(
65041   ControlRef browser,
65042   UInt32 top,
65043   UInt32 left) ;
65044 extern OSStatus
65045 GetDataBrowserScrollPosition(
65046   ControlRef browser,
65047   UInt32 * top,
65048   UInt32 * left) ;
65049 extern OSStatus
65050 SetDataBrowserHasScrollBars(
65051   ControlRef browser,
65052   Boolean horiz,
65053   Boolean vert) ;
65054 extern OSStatus
65055 GetDataBrowserHasScrollBars(
65056   ControlRef browser,
65057   Boolean * horiz,
65058   Boolean * vert) ;
65059 extern OSStatus
65060 SetDataBrowserSortProperty(
65061   ControlRef browser,
65062   DataBrowserPropertyID property) ;
65063 extern OSStatus
65064 GetDataBrowserSortProperty(
65065   ControlRef browser,
65066   DataBrowserPropertyID * property) ;
65067 extern OSStatus
65068 SetDataBrowserSelectionFlags(
65069   ControlRef browser,
65070   DataBrowserSelectionFlags selectionFlags) ;
65071 extern OSStatus
65072 GetDataBrowserSelectionFlags(
65073   ControlRef browser,
65074   DataBrowserSelectionFlags * selectionFlags) ;
65075 extern OSStatus
65076 SetDataBrowserPropertyFlags(
65077   ControlRef browser,
65078   DataBrowserPropertyID property,
65079   DataBrowserPropertyFlags flags) ;
65080 extern OSStatus
65081 GetDataBrowserPropertyFlags(
65082   ControlRef browser,
65083   DataBrowserPropertyID property,
65084   DataBrowserPropertyFlags * flags) ;
65085 extern OSStatus
65086 SetDataBrowserEditText(
65087   ControlRef browser,
65088   CFStringRef text) ;
65089 extern OSStatus
65090 CopyDataBrowserEditText(
65091   ControlRef browser,
65092   CFStringRef * text) ;
65093 extern OSStatus
65094 GetDataBrowserEditText(
65095   ControlRef browser,
65096   CFMutableStringRef text) ;
65097 extern OSStatus
65098 SetDataBrowserEditItem(
65099   ControlRef browser,
65100   DataBrowserItemID item,
65101   DataBrowserPropertyID property) ;
65102 extern OSStatus
65103 GetDataBrowserEditItem(
65104   ControlRef browser,
65105   DataBrowserItemID * item,
65106   DataBrowserPropertyID * property) ;
65107 extern OSStatus
65108 GetDataBrowserItemPartBounds(
65109   ControlRef browser,
65110   DataBrowserItemID item,
65111   DataBrowserPropertyID property,
65112   DataBrowserPropertyPart part,
65113   Rect * bounds) ;
65114
65115
65116
65117
65118
65119 typedef void * DataBrowserItemDataRef;
65120 extern OSStatus
65121 SetDataBrowserItemDataIcon(
65122   DataBrowserItemDataRef itemData,
65123   IconRef theData) ;
65124 extern OSStatus
65125 GetDataBrowserItemDataIcon(
65126   DataBrowserItemDataRef itemData,
65127   IconRef * theData) ;
65128 extern OSStatus
65129 SetDataBrowserItemDataText(
65130   DataBrowserItemDataRef itemData,
65131   CFStringRef theData) ;
65132 extern OSStatus
65133 GetDataBrowserItemDataText(
65134   DataBrowserItemDataRef itemData,
65135   CFStringRef * theData) ;
65136 extern OSStatus
65137 SetDataBrowserItemDataValue(
65138   DataBrowserItemDataRef itemData,
65139   SInt32 theData) ;
65140 extern OSStatus
65141 GetDataBrowserItemDataValue(
65142   DataBrowserItemDataRef itemData,
65143   SInt32 * theData) ;
65144 extern OSStatus
65145 SetDataBrowserItemDataMinimum(
65146   DataBrowserItemDataRef itemData,
65147   SInt32 theData) ;
65148 extern OSStatus
65149 GetDataBrowserItemDataMinimum(
65150   DataBrowserItemDataRef itemData,
65151   SInt32 * theData) ;
65152 extern OSStatus
65153 SetDataBrowserItemDataMaximum(
65154   DataBrowserItemDataRef itemData,
65155   SInt32 theData) ;
65156 extern OSStatus
65157 GetDataBrowserItemDataMaximum(
65158   DataBrowserItemDataRef itemData,
65159   SInt32 * theData) ;
65160 extern OSStatus
65161 SetDataBrowserItemDataBooleanValue(
65162   DataBrowserItemDataRef itemData,
65163   Boolean theData) ;
65164 extern OSStatus
65165 GetDataBrowserItemDataBooleanValue(
65166   DataBrowserItemDataRef itemData,
65167   Boolean * theData) ;
65168 extern OSStatus
65169 SetDataBrowserItemDataMenuRef(
65170   DataBrowserItemDataRef itemData,
65171   MenuRef theData) ;
65172 extern OSStatus
65173 GetDataBrowserItemDataMenuRef(
65174   DataBrowserItemDataRef itemData,
65175   MenuRef * theData) ;
65176 extern OSStatus
65177 SetDataBrowserItemDataRGBColor(
65178   DataBrowserItemDataRef itemData,
65179   const RGBColor * theData) ;
65180 extern OSStatus
65181 GetDataBrowserItemDataRGBColor(
65182   DataBrowserItemDataRef itemData,
65183   RGBColor * theData) ;
65184 extern OSStatus
65185 SetDataBrowserItemDataDrawState(
65186   DataBrowserItemDataRef itemData,
65187   ThemeDrawState theData) ;
65188 extern OSStatus
65189 GetDataBrowserItemDataDrawState(
65190   DataBrowserItemDataRef itemData,
65191   ThemeDrawState * theData) ;
65192 extern OSStatus
65193 SetDataBrowserItemDataButtonValue(
65194   DataBrowserItemDataRef itemData,
65195   ThemeButtonValue theData) ;
65196 extern OSStatus
65197 GetDataBrowserItemDataButtonValue(
65198   DataBrowserItemDataRef itemData,
65199   ThemeButtonValue * theData) ;
65200 extern OSStatus
65201 SetDataBrowserItemDataIconTransform(
65202   DataBrowserItemDataRef itemData,
65203   IconTransformType theData) ;
65204 extern OSStatus
65205 GetDataBrowserItemDataIconTransform(
65206   DataBrowserItemDataRef itemData,
65207   IconTransformType * theData) ;
65208 extern OSStatus
65209 SetDataBrowserItemDataDateTime(
65210   DataBrowserItemDataRef itemData,
65211   long theData) ;
65212 extern OSStatus
65213 GetDataBrowserItemDataDateTime(
65214   DataBrowserItemDataRef itemData,
65215   long * theData) ;
65216 extern OSStatus
65217 SetDataBrowserItemDataLongDateTime(
65218   DataBrowserItemDataRef itemData,
65219   const LongDateTime * theData) ;
65220 extern OSStatus
65221 GetDataBrowserItemDataLongDateTime(
65222   DataBrowserItemDataRef itemData,
65223   LongDateTime * theData) ;
65224 extern OSStatus
65225 SetDataBrowserItemDataItemID(
65226   DataBrowserItemDataRef itemData,
65227   DataBrowserItemID theData) ;
65228 extern OSStatus
65229 GetDataBrowserItemDataItemID(
65230   DataBrowserItemDataRef itemData,
65231   DataBrowserItemID * theData) ;
65232 extern OSStatus
65233 GetDataBrowserItemDataProperty(
65234   DataBrowserItemDataRef itemData,
65235   DataBrowserPropertyID * theData) ;
65236
65237
65238
65239
65240
65241
65242 typedef OSStatus ( * DataBrowserItemDataProcPtr)(ControlRef browser, DataBrowserItemID item, DataBrowserPropertyID property, DataBrowserItemDataRef itemData, Boolean setValue);
65243 typedef DataBrowserItemDataProcPtr DataBrowserItemDataUPP;
65244
65245
65246 typedef Boolean ( * DataBrowserItemCompareProcPtr)(ControlRef browser, DataBrowserItemID itemOne, DataBrowserItemID itemTwo, DataBrowserPropertyID sortProperty);
65247 typedef DataBrowserItemCompareProcPtr DataBrowserItemCompareUPP;
65248 typedef void ( * DataBrowserItemNotificationWithItemProcPtr)(ControlRef browser, DataBrowserItemID item, DataBrowserItemNotification message, DataBrowserItemDataRef itemData);
65249 typedef void ( * DataBrowserItemNotificationProcPtr)(ControlRef browser, DataBrowserItemID item, DataBrowserItemNotification message);
65250 typedef DataBrowserItemNotificationWithItemProcPtr DataBrowserItemNotificationWithItemUPP;
65251 typedef DataBrowserItemNotificationProcPtr DataBrowserItemNotificationUPP;
65252
65253
65254
65255 typedef Boolean ( * DataBrowserAddDragItemProcPtr)(ControlRef browser, DragReference theDrag, DataBrowserItemID item, ItemReference *itemRef);
65256 typedef Boolean ( * DataBrowserAcceptDragProcPtr)(ControlRef browser, DragReference theDrag, DataBrowserItemID item);
65257 typedef Boolean ( * DataBrowserReceiveDragProcPtr)(ControlRef browser, DragReference theDrag, DataBrowserItemID item);
65258 typedef void ( * DataBrowserPostProcessDragProcPtr)(ControlRef browser, DragReference theDrag, OSStatus trackDragResult);
65259 typedef DataBrowserAddDragItemProcPtr DataBrowserAddDragItemUPP;
65260 typedef DataBrowserAcceptDragProcPtr DataBrowserAcceptDragUPP;
65261 typedef DataBrowserReceiveDragProcPtr DataBrowserReceiveDragUPP;
65262 typedef DataBrowserPostProcessDragProcPtr DataBrowserPostProcessDragUPP;
65263
65264
65265 typedef void ( * DataBrowserGetContextualMenuProcPtr)(ControlRef browser, MenuRef *menu, UInt32 *helpType, CFStringRef *helpItemString, AEDesc *selection);
65266 typedef void ( * DataBrowserSelectContextualMenuProcPtr)(ControlRef browser, MenuRef menu, UInt32 selectionType, SInt16 menuID, MenuItemIndex menuItem);
65267 typedef DataBrowserGetContextualMenuProcPtr DataBrowserGetContextualMenuUPP;
65268 typedef DataBrowserSelectContextualMenuProcPtr DataBrowserSelectContextualMenuUPP;
65269
65270
65271 typedef void ( * DataBrowserItemHelpContentProcPtr)(ControlRef browser, DataBrowserItemID item, DataBrowserPropertyID property, HMContentRequest inRequest, HMContentProvidedType *outContentProvided, HMHelpContentPtr ioHelpContent);
65272 typedef DataBrowserItemHelpContentProcPtr DataBrowserItemHelpContentUPP;
65273 extern DataBrowserItemDataUPP
65274 NewDataBrowserItemDataUPP(DataBrowserItemDataProcPtr userRoutine) ;
65275 extern DataBrowserItemCompareUPP
65276 NewDataBrowserItemCompareUPP(DataBrowserItemCompareProcPtr userRoutine) ;
65277 extern DataBrowserItemNotificationWithItemUPP
65278 NewDataBrowserItemNotificationWithItemUPP(DataBrowserItemNotificationWithItemProcPtr userRoutine) ;
65279 extern DataBrowserItemNotificationUPP
65280 NewDataBrowserItemNotificationUPP(DataBrowserItemNotificationProcPtr userRoutine) ;
65281 extern DataBrowserAddDragItemUPP
65282 NewDataBrowserAddDragItemUPP(DataBrowserAddDragItemProcPtr userRoutine) ;
65283 extern DataBrowserAcceptDragUPP
65284 NewDataBrowserAcceptDragUPP(DataBrowserAcceptDragProcPtr userRoutine) ;
65285 extern DataBrowserReceiveDragUPP
65286 NewDataBrowserReceiveDragUPP(DataBrowserReceiveDragProcPtr userRoutine) ;
65287 extern DataBrowserPostProcessDragUPP
65288 NewDataBrowserPostProcessDragUPP(DataBrowserPostProcessDragProcPtr userRoutine) ;
65289 extern DataBrowserGetContextualMenuUPP
65290 NewDataBrowserGetContextualMenuUPP(DataBrowserGetContextualMenuProcPtr userRoutine) ;
65291 extern DataBrowserSelectContextualMenuUPP
65292 NewDataBrowserSelectContextualMenuUPP(DataBrowserSelectContextualMenuProcPtr userRoutine) ;
65293 extern DataBrowserItemHelpContentUPP
65294 NewDataBrowserItemHelpContentUPP(DataBrowserItemHelpContentProcPtr userRoutine) ;
65295 extern void
65296 DisposeDataBrowserItemDataUPP(DataBrowserItemDataUPP userUPP) ;
65297 extern void
65298 DisposeDataBrowserItemCompareUPP(DataBrowserItemCompareUPP userUPP) ;
65299 extern void
65300 DisposeDataBrowserItemNotificationWithItemUPP(DataBrowserItemNotificationWithItemUPP userUPP) ;
65301 extern void
65302 DisposeDataBrowserItemNotificationUPP(DataBrowserItemNotificationUPP userUPP) ;
65303 extern void
65304 DisposeDataBrowserAddDragItemUPP(DataBrowserAddDragItemUPP userUPP) ;
65305 extern void
65306 DisposeDataBrowserAcceptDragUPP(DataBrowserAcceptDragUPP userUPP) ;
65307 extern void
65308 DisposeDataBrowserReceiveDragUPP(DataBrowserReceiveDragUPP userUPP) ;
65309 extern void
65310 DisposeDataBrowserPostProcessDragUPP(DataBrowserPostProcessDragUPP userUPP) ;
65311 extern void
65312 DisposeDataBrowserGetContextualMenuUPP(DataBrowserGetContextualMenuUPP userUPP) ;
65313 extern void
65314 DisposeDataBrowserSelectContextualMenuUPP(DataBrowserSelectContextualMenuUPP userUPP) ;
65315 extern void
65316 DisposeDataBrowserItemHelpContentUPP(DataBrowserItemHelpContentUPP userUPP) ;
65317 extern OSStatus
65318 InvokeDataBrowserItemDataUPP(
65319   ControlRef browser,
65320   DataBrowserItemID item,
65321   DataBrowserPropertyID property,
65322   DataBrowserItemDataRef itemData,
65323   Boolean setValue,
65324   DataBrowserItemDataUPP userUPP) ;
65325 extern Boolean
65326 InvokeDataBrowserItemCompareUPP(
65327   ControlRef browser,
65328   DataBrowserItemID itemOne,
65329   DataBrowserItemID itemTwo,
65330   DataBrowserPropertyID sortProperty,
65331   DataBrowserItemCompareUPP userUPP) ;
65332 extern void
65333 InvokeDataBrowserItemNotificationWithItemUPP(
65334   ControlRef browser,
65335   DataBrowserItemID item,
65336   DataBrowserItemNotification message,
65337   DataBrowserItemDataRef itemData,
65338   DataBrowserItemNotificationWithItemUPP userUPP) ;
65339 extern void
65340 InvokeDataBrowserItemNotificationUPP(
65341   ControlRef browser,
65342   DataBrowserItemID item,
65343   DataBrowserItemNotification message,
65344   DataBrowserItemNotificationUPP userUPP) ;
65345 extern Boolean
65346 InvokeDataBrowserAddDragItemUPP(
65347   ControlRef browser,
65348   DragReference theDrag,
65349   DataBrowserItemID item,
65350   ItemReference * itemRef,
65351   DataBrowserAddDragItemUPP userUPP) ;
65352 extern Boolean
65353 InvokeDataBrowserAcceptDragUPP(
65354   ControlRef browser,
65355   DragReference theDrag,
65356   DataBrowserItemID item,
65357   DataBrowserAcceptDragUPP userUPP) ;
65358 extern Boolean
65359 InvokeDataBrowserReceiveDragUPP(
65360   ControlRef browser,
65361   DragReference theDrag,
65362   DataBrowserItemID item,
65363   DataBrowserReceiveDragUPP userUPP) ;
65364 extern void
65365 InvokeDataBrowserPostProcessDragUPP(
65366   ControlRef browser,
65367   DragReference theDrag,
65368   OSStatus trackDragResult,
65369   DataBrowserPostProcessDragUPP userUPP) ;
65370 extern void
65371 InvokeDataBrowserGetContextualMenuUPP(
65372   ControlRef browser,
65373   MenuRef * menu,
65374   UInt32 * helpType,
65375   CFStringRef * helpItemString,
65376   AEDesc * selection,
65377   DataBrowserGetContextualMenuUPP userUPP) ;
65378 extern void
65379 InvokeDataBrowserSelectContextualMenuUPP(
65380   ControlRef browser,
65381   MenuRef menu,
65382   UInt32 selectionType,
65383   SInt16 menuID,
65384   MenuItemIndex menuItem,
65385   DataBrowserSelectContextualMenuUPP userUPP) ;
65386 extern void
65387 InvokeDataBrowserItemHelpContentUPP(
65388   ControlRef browser,
65389   DataBrowserItemID item,
65390   DataBrowserPropertyID property,
65391   HMContentRequest inRequest,
65392   HMContentProvidedType * outContentProvided,
65393   HMHelpContentPtr ioHelpContent,
65394   DataBrowserItemHelpContentUPP userUPP) ;
65395
65396
65397 enum {
65398   kDataBrowserLatestCallbacks = 0
65399 };
65400
65401 struct DataBrowserCallbacks {
65402   UInt32 version;
65403
65404   union {
65405     struct {
65406       DataBrowserItemDataUPP itemDataCallback;
65407       DataBrowserItemCompareUPP itemCompareCallback;
65408       DataBrowserItemNotificationUPP itemNotificationCallback;
65409
65410       DataBrowserAddDragItemUPP addDragItemCallback;
65411       DataBrowserAcceptDragUPP acceptDragCallback;
65412       DataBrowserReceiveDragUPP receiveDragCallback;
65413       DataBrowserPostProcessDragUPP postProcessDragCallback;
65414
65415       DataBrowserItemHelpContentUPP itemHelpContentCallback;
65416       DataBrowserGetContextualMenuUPP getContextualMenuCallback;
65417       DataBrowserSelectContextualMenuUPP selectContextualMenuCallback;
65418     } v1;
65419   } u;
65420 };
65421 typedef struct DataBrowserCallbacks DataBrowserCallbacks;
65422 extern OSStatus
65423 InitDataBrowserCallbacks(DataBrowserCallbacks * callbacks) ;
65424 extern OSStatus
65425 GetDataBrowserCallbacks(
65426   ControlRef browser,
65427   DataBrowserCallbacks * callbacks) ;
65428 extern OSStatus
65429 SetDataBrowserCallbacks(
65430   ControlRef browser,
65431   const DataBrowserCallbacks * callbacks) ;
65432
65433
65434
65435
65436
65437 typedef unsigned long DataBrowserDragFlags;
65438 typedef SInt16 DataBrowserTrackingResult;
65439 enum {
65440   kDataBrowserContentHit = 1,
65441   kDataBrowserNothingHit = 0,
65442   kDataBrowserStopTracking = -1
65443 };
65444
65445 typedef void ( * DataBrowserDrawItemProcPtr)(ControlRef browser, DataBrowserItemID item, DataBrowserPropertyID property, DataBrowserItemState itemState, const Rect *theRect, SInt16 gdDepth, Boolean colorDevice);
65446 typedef Boolean ( * DataBrowserEditItemProcPtr)(ControlRef browser, DataBrowserItemID item, DataBrowserPropertyID property, CFStringRef theString, Rect *maxEditTextRect, Boolean *shrinkToFit);
65447 typedef Boolean ( * DataBrowserHitTestProcPtr)(ControlRef browser, DataBrowserItemID itemID, DataBrowserPropertyID property, const Rect *theRect, const Rect *mouseRect);
65448 typedef DataBrowserTrackingResult ( * DataBrowserTrackingProcPtr)(ControlRef browser, DataBrowserItemID itemID, DataBrowserPropertyID property, const Rect *theRect, Point startPt, EventModifiers modifiers);
65449 typedef void ( * DataBrowserItemDragRgnProcPtr)(ControlRef browser, DataBrowserItemID itemID, DataBrowserPropertyID property, const Rect *theRect, RgnHandle dragRgn);
65450 typedef DataBrowserDragFlags ( * DataBrowserItemAcceptDragProcPtr)(ControlRef browser, DataBrowserItemID itemID, DataBrowserPropertyID property, const Rect *theRect, DragReference theDrag);
65451 typedef Boolean ( * DataBrowserItemReceiveDragProcPtr)(ControlRef browser, DataBrowserItemID itemID, DataBrowserPropertyID property, DataBrowserDragFlags dragFlags, DragReference theDrag);
65452 typedef DataBrowserDrawItemProcPtr DataBrowserDrawItemUPP;
65453 typedef DataBrowserEditItemProcPtr DataBrowserEditItemUPP;
65454 typedef DataBrowserHitTestProcPtr DataBrowserHitTestUPP;
65455 typedef DataBrowserTrackingProcPtr DataBrowserTrackingUPP;
65456 typedef DataBrowserItemDragRgnProcPtr DataBrowserItemDragRgnUPP;
65457 typedef DataBrowserItemAcceptDragProcPtr DataBrowserItemAcceptDragUPP;
65458 typedef DataBrowserItemReceiveDragProcPtr DataBrowserItemReceiveDragUPP;
65459 extern DataBrowserDrawItemUPP
65460 NewDataBrowserDrawItemUPP(DataBrowserDrawItemProcPtr userRoutine) ;
65461 extern DataBrowserEditItemUPP
65462 NewDataBrowserEditItemUPP(DataBrowserEditItemProcPtr userRoutine) ;
65463 extern DataBrowserHitTestUPP
65464 NewDataBrowserHitTestUPP(DataBrowserHitTestProcPtr userRoutine) ;
65465 extern DataBrowserTrackingUPP
65466 NewDataBrowserTrackingUPP(DataBrowserTrackingProcPtr userRoutine) ;
65467 extern DataBrowserItemDragRgnUPP
65468 NewDataBrowserItemDragRgnUPP(DataBrowserItemDragRgnProcPtr userRoutine) ;
65469 extern DataBrowserItemAcceptDragUPP
65470 NewDataBrowserItemAcceptDragUPP(DataBrowserItemAcceptDragProcPtr userRoutine) ;
65471 extern DataBrowserItemReceiveDragUPP
65472 NewDataBrowserItemReceiveDragUPP(DataBrowserItemReceiveDragProcPtr userRoutine) ;
65473 extern void
65474 DisposeDataBrowserDrawItemUPP(DataBrowserDrawItemUPP userUPP) ;
65475 extern void
65476 DisposeDataBrowserEditItemUPP(DataBrowserEditItemUPP userUPP) ;
65477 extern void
65478 DisposeDataBrowserHitTestUPP(DataBrowserHitTestUPP userUPP) ;
65479 extern void
65480 DisposeDataBrowserTrackingUPP(DataBrowserTrackingUPP userUPP) ;
65481 extern void
65482 DisposeDataBrowserItemDragRgnUPP(DataBrowserItemDragRgnUPP userUPP) ;
65483 extern void
65484 DisposeDataBrowserItemAcceptDragUPP(DataBrowserItemAcceptDragUPP userUPP) ;
65485 extern void
65486 DisposeDataBrowserItemReceiveDragUPP(DataBrowserItemReceiveDragUPP userUPP) ;
65487 extern void
65488 InvokeDataBrowserDrawItemUPP(
65489   ControlRef browser,
65490   DataBrowserItemID item,
65491   DataBrowserPropertyID property,
65492   DataBrowserItemState itemState,
65493   const Rect * theRect,
65494   SInt16 gdDepth,
65495   Boolean colorDevice,
65496   DataBrowserDrawItemUPP userUPP) ;
65497 extern Boolean
65498 InvokeDataBrowserEditItemUPP(
65499   ControlRef browser,
65500   DataBrowserItemID item,
65501   DataBrowserPropertyID property,
65502   CFStringRef theString,
65503   Rect * maxEditTextRect,
65504   Boolean * shrinkToFit,
65505   DataBrowserEditItemUPP userUPP) ;
65506 extern Boolean
65507 InvokeDataBrowserHitTestUPP(
65508   ControlRef browser,
65509   DataBrowserItemID itemID,
65510   DataBrowserPropertyID property,
65511   const Rect * theRect,
65512   const Rect * mouseRect,
65513   DataBrowserHitTestUPP userUPP) ;
65514 extern DataBrowserTrackingResult
65515 InvokeDataBrowserTrackingUPP(
65516   ControlRef browser,
65517   DataBrowserItemID itemID,
65518   DataBrowserPropertyID property,
65519   const Rect * theRect,
65520   Point startPt,
65521   EventModifiers modifiers,
65522   DataBrowserTrackingUPP userUPP) ;
65523 extern void
65524 InvokeDataBrowserItemDragRgnUPP(
65525   ControlRef browser,
65526   DataBrowserItemID itemID,
65527   DataBrowserPropertyID property,
65528   const Rect * theRect,
65529   RgnHandle dragRgn,
65530   DataBrowserItemDragRgnUPP userUPP) ;
65531 extern DataBrowserDragFlags
65532 InvokeDataBrowserItemAcceptDragUPP(
65533   ControlRef browser,
65534   DataBrowserItemID itemID,
65535   DataBrowserPropertyID property,
65536   const Rect * theRect,
65537   DragReference theDrag,
65538   DataBrowserItemAcceptDragUPP userUPP) ;
65539 extern Boolean
65540 InvokeDataBrowserItemReceiveDragUPP(
65541   ControlRef browser,
65542   DataBrowserItemID itemID,
65543   DataBrowserPropertyID property,
65544   DataBrowserDragFlags dragFlags,
65545   DragReference theDrag,
65546   DataBrowserItemReceiveDragUPP userUPP) ;
65547
65548
65549 enum {
65550   kDataBrowserLatestCustomCallbacks = 0
65551 };
65552
65553 struct DataBrowserCustomCallbacks {
65554
65555   UInt32 version;
65556
65557   union {
65558     struct {
65559       DataBrowserDrawItemUPP drawItemCallback;
65560       DataBrowserEditItemUPP editTextCallback;
65561       DataBrowserHitTestUPP hitTestCallback;
65562       DataBrowserTrackingUPP trackingCallback;
65563
65564       DataBrowserItemDragRgnUPP dragRegionCallback;
65565       DataBrowserItemAcceptDragUPP acceptDragCallback;
65566       DataBrowserItemReceiveDragUPP receiveDragCallback;
65567     } v1;
65568   } u;
65569 };
65570 typedef struct DataBrowserCustomCallbacks DataBrowserCustomCallbacks;
65571 extern OSStatus
65572 InitDataBrowserCustomCallbacks(DataBrowserCustomCallbacks * callbacks) ;
65573 extern OSStatus
65574 GetDataBrowserCustomCallbacks(
65575   ControlRef browser,
65576   DataBrowserCustomCallbacks * callbacks) ;
65577 extern OSStatus
65578 SetDataBrowserCustomCallbacks(
65579   ControlRef browser,
65580   const DataBrowserCustomCallbacks * callbacks) ;
65581
65582
65583
65584
65585
65586
65587 typedef UInt32 DataBrowserTableViewHiliteStyle;
65588 enum {
65589   kDataBrowserTableViewMinimalHilite = 0,
65590   kDataBrowserTableViewFillHilite = 1
65591 };
65592
65593 typedef UInt32 DataBrowserTableViewPropertyFlags;
65594 enum {
65595
65596   kDataBrowserTableViewSelectionColumn = 1 << kDataBrowserViewSpecificFlagsOffset
65597 };
65598
65599
65600
65601 typedef UInt32 DataBrowserTableViewRowIndex;
65602 typedef UInt32 DataBrowserTableViewColumnIndex;
65603 typedef DataBrowserPropertyID DataBrowserTableViewColumnID;
65604 typedef DataBrowserPropertyDesc DataBrowserTableViewColumnDesc;
65605
65606
65607
65608 enum {
65609   kDataBrowserTableViewLastColumn = -1
65610 };
65611 extern OSStatus
65612 RemoveDataBrowserTableViewColumn(
65613   ControlRef browser,
65614   DataBrowserTableViewColumnID column) ;
65615 extern OSStatus
65616 GetDataBrowserTableViewColumnCount(
65617   ControlRef browser,
65618   UInt32 * numColumns) ;
65619 extern OSStatus
65620 SetDataBrowserTableViewHiliteStyle(
65621   ControlRef browser,
65622   DataBrowserTableViewHiliteStyle hiliteStyle) ;
65623 extern OSStatus
65624 GetDataBrowserTableViewHiliteStyle(
65625   ControlRef browser,
65626   DataBrowserTableViewHiliteStyle * hiliteStyle) ;
65627 extern OSStatus
65628 SetDataBrowserTableViewRowHeight(
65629   ControlRef browser,
65630   UInt16 height) ;
65631 extern OSStatus
65632 GetDataBrowserTableViewRowHeight(
65633   ControlRef browser,
65634   UInt16 * height) ;
65635 extern OSStatus
65636 SetDataBrowserTableViewColumnWidth(
65637   ControlRef browser,
65638   UInt16 width) ;
65639 extern OSStatus
65640 GetDataBrowserTableViewColumnWidth(
65641   ControlRef browser,
65642   UInt16 * width) ;
65643 extern OSStatus
65644 SetDataBrowserTableViewItemRowHeight(
65645   ControlRef browser,
65646   DataBrowserItemID item,
65647   UInt16 height) ;
65648 extern OSStatus
65649 GetDataBrowserTableViewItemRowHeight(
65650   ControlRef browser,
65651   DataBrowserItemID item,
65652   UInt16 * height) ;
65653 extern OSStatus
65654 SetDataBrowserTableViewNamedColumnWidth(
65655   ControlRef browser,
65656   DataBrowserTableViewColumnID column,
65657   UInt16 width) ;
65658 extern OSStatus
65659 GetDataBrowserTableViewNamedColumnWidth(
65660   ControlRef browser,
65661   DataBrowserTableViewColumnID column,
65662   UInt16 * width) ;
65663 extern OSStatus
65664 SetDataBrowserTableViewGeometry(
65665   ControlRef browser,
65666   Boolean variableWidthColumns,
65667   Boolean variableHeightRows) ;
65668 extern OSStatus
65669 GetDataBrowserTableViewGeometry(
65670   ControlRef browser,
65671   Boolean * variableWidthColumns,
65672   Boolean * variableHeightRows) ;
65673 extern OSStatus
65674 GetDataBrowserTableViewItemID(
65675   ControlRef browser,
65676   DataBrowserTableViewRowIndex row,
65677   DataBrowserItemID * item) ;
65678 extern OSStatus
65679 SetDataBrowserTableViewItemRow(
65680   ControlRef browser,
65681   DataBrowserItemID item,
65682   DataBrowserTableViewRowIndex row) ;
65683 extern OSStatus
65684 GetDataBrowserTableViewItemRow(
65685   ControlRef browser,
65686   DataBrowserItemID item,
65687   DataBrowserTableViewRowIndex * row) ;
65688 extern OSStatus
65689 SetDataBrowserTableViewColumnPosition(
65690   ControlRef browser,
65691   DataBrowserTableViewColumnID column,
65692   DataBrowserTableViewColumnIndex position) ;
65693 extern OSStatus
65694 GetDataBrowserTableViewColumnPosition(
65695   ControlRef browser,
65696   DataBrowserTableViewColumnID column,
65697   DataBrowserTableViewColumnIndex * position) ;
65698 extern OSStatus
65699 GetDataBrowserTableViewColumnProperty(
65700   ControlRef browser,
65701   DataBrowserTableViewColumnIndex column,
65702   DataBrowserTableViewColumnID * property) ;
65703
65704
65705
65706
65707
65708
65709 typedef UInt32 DataBrowserListViewPropertyFlags;
65710 enum {
65711
65712   kDataBrowserListViewMovableColumn = 1 << (kDataBrowserViewSpecificFlagsOffset + 1),
65713   kDataBrowserListViewSortableColumn = 1 << (kDataBrowserViewSpecificFlagsOffset + 2),
65714   kDataBrowserListViewSelectionColumn = kDataBrowserTableViewSelectionColumn,
65715   kDataBrowserListViewDefaultColumnFlags = kDataBrowserListViewMovableColumn + kDataBrowserListViewSortableColumn
65716 };
65717
65718
65719 enum {
65720   kDataBrowserListViewLatestHeaderDesc = 0
65721 };
65722
65723 struct DataBrowserListViewHeaderDesc {
65724   UInt32 version;
65725
65726   UInt16 minimumWidth;
65727   UInt16 maximumWidth;
65728
65729   SInt16 titleOffset;
65730   CFStringRef titleString;
65731   DataBrowserSortOrder initialOrder;
65732   ControlFontStyleRec btnFontStyle;
65733   ControlButtonContentInfo btnContentInfo;
65734 };
65735 typedef struct DataBrowserListViewHeaderDesc DataBrowserListViewHeaderDesc;
65736 struct DataBrowserListViewColumnDesc {
65737   DataBrowserTableViewColumnDesc propertyDesc;
65738   DataBrowserListViewHeaderDesc headerBtnDesc;
65739 };
65740 typedef struct DataBrowserListViewColumnDesc DataBrowserListViewColumnDesc;
65741
65742 enum {
65743   kDataBrowserListViewAppendColumn = kDataBrowserTableViewLastColumn
65744 };
65745 extern OSStatus
65746 AutoSizeDataBrowserListViewColumns(ControlRef browser) ;
65747 extern OSStatus
65748 AddDataBrowserListViewColumn(
65749   ControlRef browser,
65750   DataBrowserListViewColumnDesc * columnDesc,
65751   DataBrowserTableViewColumnIndex position) ;
65752 extern OSStatus
65753 GetDataBrowserListViewHeaderDesc(
65754   ControlRef browser,
65755   DataBrowserTableViewColumnID column,
65756   DataBrowserListViewHeaderDesc * desc) ;
65757 extern OSStatus
65758 SetDataBrowserListViewHeaderDesc(
65759   ControlRef browser,
65760   DataBrowserTableViewColumnID column,
65761   DataBrowserListViewHeaderDesc * desc) ;
65762 extern OSStatus
65763 SetDataBrowserListViewHeaderBtnHeight(
65764   ControlRef browser,
65765   UInt16 height) ;
65766 extern OSStatus
65767 GetDataBrowserListViewHeaderBtnHeight(
65768   ControlRef browser,
65769   UInt16 * height) ;
65770 extern OSStatus
65771 SetDataBrowserListViewUsePlainBackground(
65772   ControlRef browser,
65773   Boolean usePlainBackground) ;
65774 extern OSStatus
65775 GetDataBrowserListViewUsePlainBackground(
65776   ControlRef browser,
65777   Boolean * usePlainBackground) ;
65778 extern OSStatus
65779 SetDataBrowserListViewDisclosureColumn(
65780   ControlRef browser,
65781   DataBrowserTableViewColumnID column,
65782   Boolean expandableRows) ;
65783 extern OSStatus
65784 GetDataBrowserListViewDisclosureColumn(
65785   ControlRef browser,
65786   DataBrowserTableViewColumnID * column,
65787   Boolean * expandableRows) ;
65788 extern OSStatus
65789 GetDataBrowserColumnViewPath(
65790   ControlRef browser,
65791   Handle path) ;
65792 extern OSStatus
65793 GetDataBrowserColumnViewPathLength(
65794   ControlRef browser,
65795   UInt32 * pathLength) ;
65796 extern OSStatus
65797 SetDataBrowserColumnViewPath(
65798   ControlRef browser,
65799   UInt32 length,
65800   const DataBrowserItemID * path) ;
65801 extern OSStatus
65802 SetDataBrowserColumnViewDisplayType(
65803   ControlRef browser,
65804   DataBrowserPropertyType propertyType) ;
65805 extern OSStatus
65806 GetDataBrowserColumnViewDisplayType(
65807   ControlRef browser,
65808   DataBrowserPropertyType * propertyType) ;
65809 typedef Boolean ( * EditUnicodePostUpdateProcPtr)(UniCharArrayHandle uniText, UniCharCount uniTextLength, UniCharArrayOffset iStartOffset, UniCharArrayOffset iEndOffset, void *refcon);
65810 typedef EditUnicodePostUpdateProcPtr EditUnicodePostUpdateUPP;
65811 extern EditUnicodePostUpdateUPP
65812 NewEditUnicodePostUpdateUPP(EditUnicodePostUpdateProcPtr userRoutine) ;
65813 extern void
65814 DisposeEditUnicodePostUpdateUPP(EditUnicodePostUpdateUPP userUPP) ;
65815 extern Boolean
65816 InvokeEditUnicodePostUpdateUPP(
65817   UniCharArrayHandle uniText,
65818   UniCharCount uniTextLength,
65819   UniCharArrayOffset iStartOffset,
65820   UniCharArrayOffset iEndOffset,
65821   void * refcon,
65822   EditUnicodePostUpdateUPP userUPP) ;
65823
65824
65825
65826 enum {
65827   kControlEditUnicodeTextPostUpdateProcTag = 'upup'
65828 };
65829
65830
65831 enum {
65832   kControlEditUnicodeTextProc = 912,
65833   kControlEditUnicodeTextPasswordProc = 914
65834 };
65835
65836
65837 enum {
65838   kControlKindEditUnicodeText = 'eutx'
65839 };
65840 extern OSStatus
65841 CreateEditUnicodeTextControl(
65842   WindowRef window,
65843   const Rect * boundsRect,
65844   CFStringRef text,
65845   Boolean isPassword,
65846   const ControlFontStyleRec * style,
65847   ControlRef * outControl) ;
65848
65849
65850
65851 enum {
65852   kControlEditTextSingleLineTag = 'sglc'
65853 };
65854
65855
65856 }
65857
65858
65859
65860 extern "C" {
65861
65862
65863
65864
65865 enum {
65866   kTSMTESignature = 'tmTE',
65867   kTSMTEInterfaceType = 'tmTE'
65868 };
65869 enum {
65870   kTSMTEAutoScroll = 1
65871 };
65872
65873
65874
65875
65876 typedef void ( * TSMTEPreUpdateProcPtr)(TEHandle textH, long refCon);
65877 typedef void ( * TSMTEPostUpdateProcPtr)(TEHandle textH, long fixLen, long inputAreaStart, long inputAreaEnd, long pinStart, long pinEnd, long refCon);
65878 typedef TSMTEPreUpdateProcPtr TSMTEPreUpdateUPP;
65879 typedef TSMTEPostUpdateProcPtr TSMTEPostUpdateUPP;
65880
65881
65882
65883 struct TSMTERec {
65884   TEHandle textH;
65885   TSMTEPreUpdateUPP preUpdateProc;
65886   TSMTEPostUpdateUPP postUpdateProc;
65887   long updateFlag;
65888   long refCon;
65889 };
65890 typedef struct TSMTERec TSMTERec;
65891 typedef TSMTERec * TSMTERecPtr;
65892 typedef TSMTERecPtr * TSMTERecHandle;
65893 extern TSMTEPreUpdateUPP
65894 NewTSMTEPreUpdateUPP(TSMTEPreUpdateProcPtr userRoutine) ;
65895 extern TSMTEPostUpdateUPP
65896 NewTSMTEPostUpdateUPP(TSMTEPostUpdateProcPtr userRoutine) ;
65897 extern void
65898 DisposeTSMTEPreUpdateUPP(TSMTEPreUpdateUPP userUPP) ;
65899 extern void
65900 DisposeTSMTEPostUpdateUPP(TSMTEPostUpdateUPP userUPP) ;
65901 extern void
65902 InvokeTSMTEPreUpdateUPP(
65903   TEHandle textH,
65904   long refCon,
65905   TSMTEPreUpdateUPP userUPP) ;
65906 extern void
65907 InvokeTSMTEPostUpdateUPP(
65908   TEHandle textH,
65909   long fixLen,
65910   long inputAreaStart,
65911   long inputAreaEnd,
65912   long pinStart,
65913   long pinEnd,
65914   long refCon,
65915   TSMTEPostUpdateUPP userUPP) ;
65916 extern Boolean
65917 IsTSMTEDialog(DialogRef dialog) ;
65918 extern TSMDocumentID
65919 GetTSMTEDialogDocumentID(DialogRef dialog) ;
65920 extern TSMTERecHandle
65921 GetTSMTEDialogTSMTERecHandle(DialogRef dialog) ;
65922 extern void
65923 SetTSMTEDialogDocumentID(
65924   DialogRef dialog,
65925   TSMDocumentID documentID) ;
65926 extern void
65927 SetTSMTEDialogTSMTERecHandle(
65928   DialogRef dialog,
65929   TSMTERecHandle tsmteRecHandle) ;
65930
65931
65932
65933
65934
65935 }
65936
65937
65938
65939 extern "C" {
65940
65941
65942
65943 enum {
65944   kSupportsFileTranslation = 1,
65945   kSupportsScrapTranslation = 2,
65946   kTranslatorCanGenerateFilename = 4
65947 };
65948
65949
65950
65951 typedef OSType FileType;
65952 typedef ResType ScrapType;
65953
65954 typedef UInt32 TranslationAttributes;
65955 enum {
65956   taDstDocNeedsResourceFork = 1,
65957   taDstIsAppTranslation = 2
65958 };
65959
65960
65961 struct FileTypeSpec {
65962   FileType format;
65963   long hint;
65964   TranslationAttributes flags;
65965   OSType catInfoType;
65966   OSType catInfoCreator;
65967 };
65968 typedef struct FileTypeSpec FileTypeSpec;
65969 struct FileTranslationList {
65970   unsigned long modDate;
65971   unsigned long groupCount;
65972 };
65973 typedef struct FileTranslationList FileTranslationList;
65974 typedef FileTranslationList * FileTranslationListPtr;
65975 typedef FileTranslationListPtr * FileTranslationListHandle;
65976
65977 struct ScrapTypeSpec {
65978   ScrapType format;
65979   long hint;
65980 };
65981 typedef struct ScrapTypeSpec ScrapTypeSpec;
65982 struct ScrapTranslationList {
65983   unsigned long modDate;
65984   unsigned long groupCount;
65985 };
65986 typedef struct ScrapTranslationList ScrapTranslationList;
65987 typedef ScrapTranslationList * ScrapTranslationListPtr;
65988 typedef ScrapTranslationListPtr * ScrapTranslationListHandle;
65989
65990
65991
65992
65993
65994 typedef long TranslationRefNum;
65995 extern OSErr
65996 SetTranslationAdvertisement(
65997   TranslationRefNum refNum,
65998   PicHandle advertisement) ;
65999 extern OSErr
66000 UpdateTranslationProgress(
66001   TranslationRefNum refNum,
66002   short percentDone,
66003   Boolean * canceled) ;
66004
66005
66006
66007
66008
66009
66010
66011 enum {
66012   kTranslateGetFileTranslationList = 0,
66013   kTranslateIdentifyFile = 1,
66014   kTranslateTranslateFile = 2,
66015   kTranslateGetTranslatedFilename = 3,
66016   kTranslateGetScrapTranslationList = 10,
66017   kTranslateIdentifyScrap = 11,
66018   kTranslateTranslateScrap = 12,
66019   kTranslateGetScrapTranslationListConsideringData = 13
66020 };
66021
66022
66023
66024
66025
66026
66027
66028 typedef ComponentResult ( * DoGetFileTranslationListProcPtr)(ComponentInstance self, FileTranslationListHandle translationList);
66029 typedef ComponentResult ( * DoIdentifyFileProcPtr)(ComponentInstance self, const FSSpec *theDocument, FileType *docType);
66030 typedef ComponentResult ( * DoTranslateFileProcPtr)(ComponentInstance self, TranslationRefNum refNum, const FSSpec *sourceDocument, FileType srcType, long srcTypeHint, const FSSpec *dstDoc, FileType dstType, long dstTypeHint);
66031 typedef ComponentResult ( * DoGetTranslatedFilenameProcPtr)(ComponentInstance self, FileType dstType, long dstTypeHint, FSSpec *theDocument);
66032 typedef ComponentResult ( * DoGetScrapTranslationListProcPtr)(ComponentInstance self, ScrapTranslationListHandle list);
66033 typedef ComponentResult ( * DoIdentifyScrapProcPtr)(ComponentInstance self, const void *dataPtr, Size dataLength, ScrapType *dataFormat);
66034 typedef ComponentResult ( * DoTranslateScrapProcPtr)(ComponentInstance self, TranslationRefNum refNum, const void *srcDataPtr, Size srcDataLength, ScrapType srcType, long srcTypeHint, Handle dstData, ScrapType dstType, long dstTypeHint);
66035
66036
66037
66038 }
66039
66040
66041
66042 extern "C" {
66043
66044
66045
66046
66047 typedef short DocOpenMethod;
66048 enum {
66049   domCannot = 0,
66050   domNative = 1,
66051   domTranslateFirst = 2,
66052   domWildcard = 3
66053 };
66054
66055
66056 typedef OSType TypesBlock[64];
66057 typedef OSType * TypesBlockPtr;
66058
66059 enum {
66060   kTranslationScrapProgressDialogID = -16555
66061 };
66062
66063
66064 struct FileTranslationSpec {
66065   OSType componentSignature;
66066   const void * translationSystemInfo;
66067   FileTypeSpec src;
66068   FileTypeSpec dst;
66069 };
66070 typedef struct FileTranslationSpec FileTranslationSpec;
66071 typedef FileTranslationSpec * FileTranslationSpecArrayPtr;
66072 typedef FileTranslationSpecArrayPtr * FileTranslationSpecArrayHandle;
66073 extern OSErr
66074 GetFileTypesThatAppCanNativelyOpen(
66075   short appVRefNumHint,
66076   OSType appSignature,
66077   FileType * nativeTypes) ;
66078 extern OSErr
66079 ExtendFileTypeList(
66080   const FileType * originalTypeList,
66081   short numberOriginalTypes,
66082   FileType * extendedTypeList,
66083   short * numberExtendedTypes) ;
66084 extern OSErr
66085 CanDocBeOpened(
66086   const FSSpec * targetDocument,
66087   short appVRefNumHint,
66088   OSType appSignature,
66089   const FileType * nativeTypes,
66090   Boolean onlyNative,
66091   DocOpenMethod * howToOpen,
66092   FileTranslationSpec * howToTranslate) ;
66093 extern short
66094 GetFileTranslationPaths(
66095   const FSSpec * srcDocument,
66096   FileType dstDocType,
66097   unsigned short maxResultCount,
66098   FileTranslationSpecArrayPtr resultBuffer) ;
66099 extern OSErr
66100 GetPathFromTranslationDialog(
66101   const FSSpec * theDocument,
66102   const FSSpec * theApplication,
66103   TypesBlockPtr typeList,
66104   DocOpenMethod * howToOpen,
66105   FileTranslationSpec * howToTranslate) ;
66106 extern OSErr
66107 TranslateFile(
66108   const FSSpec * sourceDocument,
66109   const FSSpec * destinationDocument,
66110   const FileTranslationSpec * howToTranslate) ;
66111 extern OSErr
66112 GetDocumentKindString(
66113   short docVRefNum,
66114   OSType docType,
66115   OSType docCreator,
66116   Str63 kindString) ;
66117 extern OSErr
66118 GetTranslationExtensionName(
66119   const FileTranslationSpec * translationMethod,
66120   Str31 extensionName) ;
66121 typedef OSErr ( * GetScrapDataProcPtr)(ScrapType requestedFormat, Handle dataH, void *srcDataGetterRefCon);
66122 typedef GetScrapDataProcPtr GetScrapDataUPP;
66123 extern GetScrapDataUPP
66124 NewGetScrapDataUPP(GetScrapDataProcPtr userRoutine) ;
66125 extern void
66126 DisposeGetScrapDataUPP(GetScrapDataUPP userUPP) ;
66127 extern OSErr
66128 InvokeGetScrapDataUPP(
66129   ScrapType requestedFormat,
66130   Handle dataH,
66131   void * srcDataGetterRefCon,
66132   GetScrapDataUPP userUPP) ;
66133
66134 typedef GetScrapDataUPP GetScrapData;
66135 extern OSErr
66136 TranslateScrap(
66137   GetScrapDataUPP sourceDataGetter,
66138   void * sourceDataGetterRefCon,
66139   ScrapType destinationFormat,
66140   Handle destinationData,
66141   short progressDialogID) ;
66142
66143
66144
66145
66146
66147
66148
66149 }
66150
66151
66152
66153
66154
66155
66156
66157 extern "C" {
66158
66159
66160
66161 typedef SInt16 TSCode;
66162 enum {
66163   tsPreviousSelectMode = -1,
66164   tsNormalSelectMode = 0,
66165   tsNextSelectMode = 1
66166 };
66167
66168 struct TypeSelectRecord {
66169   unsigned long tsrLastKeyTime;
66170   ScriptCode tsrScript;
66171   Str63 tsrKeyStrokes;
66172 };
66173 typedef struct TypeSelectRecord TypeSelectRecord;
66174 typedef Boolean ( * IndexToStringProcPtr)(short item, ScriptCode *itemsScript, StringPtr *itemsStringPtr, void *yourDataPtr);
66175 typedef IndexToStringProcPtr IndexToStringUPP;
66176 extern void
66177 TypeSelectClear(TypeSelectRecord * tsr) ;
66178 extern Boolean
66179 TypeSelectNewKey(
66180   const EventRecord * theEvent,
66181   TypeSelectRecord * tsr) ;
66182 extern short
66183 TypeSelectFindItem(
66184   const TypeSelectRecord * tsr,
66185   short listSize,
66186   TSCode selectMode,
66187   IndexToStringUPP getStringProc,
66188   void * yourDataPtr) ;
66189 extern short
66190 TypeSelectCompare(
66191   const TypeSelectRecord * tsr,
66192   ScriptCode testStringScript,
66193   StringPtr testStringPtr) ;
66194 extern IndexToStringUPP
66195 NewIndexToStringUPP(IndexToStringProcPtr userRoutine) ;
66196 extern void
66197 DisposeIndexToStringUPP(IndexToStringUPP userUPP) ;
66198 extern Boolean
66199 InvokeIndexToStringUPP(
66200   short item,
66201   ScriptCode * itemsScript,
66202   StringPtr * itemsStringPtr,
66203   void * yourDataPtr,
66204   IndexToStringUPP userUPP) ;
66205
66206
66207
66208
66209
66210
66211
66212 }
66213
66214
66215
66216 extern "C" {
66217 enum {
66218
66219
66220
66221
66222   kUIModeNormal = 0,
66223   kUIModeContentSuppressed = 1,
66224
66225
66226
66227
66228
66229
66230
66231   kUIModeContentHidden = 2,
66232   kUIModeAllHidden = 3
66233 };
66234
66235 typedef UInt32 SystemUIMode;
66236
66237
66238
66239
66240
66241
66242 enum {
66243
66244
66245
66246
66247
66248
66249   kUIOptionAutoShowMenuBar = 1 << 0,
66250
66251
66252
66253
66254   kUIOptionDisableAppleMenu = 1 << 2,
66255   kUIOptionDisableProcessSwitch = 1 << 3,
66256
66257
66258
66259
66260
66261
66262
66263   kUIOptionDisableForceQuit = 1 << 4,
66264
66265
66266
66267
66268
66269
66270
66271   kUIOptionDisableSessionTerminate = 1 << 5
66272 };
66273
66274 typedef OptionBits SystemUIOptions;
66275 extern OSStatus
66276 SetSystemUIMode(
66277   SystemUIMode inMode,
66278   SystemUIOptions inOptions) ;
66279 extern void
66280 GetSystemUIMode(
66281   SystemUIMode * outMode,
66282   SystemUIOptions * outOptions) ;
66283 extern HIObjectRef
66284 HIApplicationGetCurrent(void) ;
66285 extern OSStatus
66286 SetApplicationDockTileImage(CGImageRef inImage) ;
66287 extern OSStatus
66288 OverlayApplicationDockTileImage(CGImageRef inImage) ;
66289 extern OSStatus
66290 RestoreApplicationDockTileImage(void) ;
66291 extern CGContextRef
66292 BeginCGContextForApplicationDockTile(void) ;
66293 extern void
66294 EndCGContextForApplicationDockTile(CGContextRef inContext) ;
66295 extern CGrafPtr
66296 BeginQDContextForApplicationDockTile(void) ;
66297 extern void
66298 EndQDContextForApplicationDockTile(CGrafPtr inContext) ;
66299 extern OSStatus
66300 SetApplicationDockTileMenu(MenuRef inMenu) ;
66301 extern MenuRef
66302 GetApplicationDockTileMenu(void) ;
66303 extern OSStatus
66304 CreateCGImageFromPixMaps(
66305   PixMapHandle inImage,
66306   PixMapHandle inMask,
66307   CGImageRef * outImage) ;
66308 extern TextEncoding
66309 GetApplicationTextEncoding(void) ;
66310 extern ScriptCode
66311 GetApplicationScript(void) ;
66312
66313
66314
66315
66316
66317 }
66318
66319
66320
66321 extern "C" {
66322
66323
66324
66325
66326
66327
66328 enum {
66329   _KeyboardDispatch = 0xAA7A
66330 };
66331
66332
66333 enum {
66334   gestaltKeyboardsAttr = 'kbds',
66335   gestaltKBPS2Keyboards = 1,
66336   gestaltKBPS2SetIDToAny = 2,
66337   gestaltKBPS2SetTranslationTable = 4
66338 };
66339
66340
66341
66342
66343
66344
66345 enum {
66346   errKBPS2KeyboardNotAvailable = -30850,
66347   errKBIlligalParameters = -30851,
66348   errKBFailSettingID = -30852,
66349   errKBFailSettingTranslationTable = -30853,
66350   errKBFailWritePreference = -30854
66351 };
66352 typedef UInt32 PhysicalKeyboardLayoutType;
66353 enum {
66354
66355
66356
66357
66358   kKeyboardJIS = 'JIS ',
66359
66360
66361
66362
66363   kKeyboardANSI = 'ANSI',
66364
66365
66366
66367
66368   kKeyboardISO = 'ISO ',
66369
66370
66371
66372
66373   kKeyboardUnknown = kUnknownType
66374 };
66375 extern OSType
66376 KBGetLayoutType(SInt16 iKeyboardType) ;
66377 typedef struct OpaqueKeyboardLayoutRef* KeyboardLayoutRef;
66378 typedef UInt32 KeyboardLayoutPropertyTag;
66379 enum {
66380
66381
66382
66383
66384
66385   kKLKCHRData = 0,
66386
66387
66388
66389
66390
66391   kKLuchrData = 1,
66392
66393
66394
66395
66396   kKLIdentifier = 2,
66397
66398
66399
66400
66401   kKLIcon = 3,
66402
66403
66404
66405
66406   kKLLocalizedName = 4,
66407
66408
66409
66410
66411   kKLName = 5,
66412
66413
66414
66415
66416   kKLGroupIdentifier = 6,
66417
66418
66419
66420
66421   kKLKind = 7
66422 };
66423 typedef SInt32 KeyboardLayoutKind;
66424 enum {
66425
66426
66427
66428
66429   kKLKCHRuchrKind = 0,
66430
66431
66432
66433
66434   kKLKCHRKind = 1,
66435
66436
66437
66438
66439   kKLuchrKind = 2
66440 };
66441 typedef SInt32 KeyboardLayoutIdentifier;
66442 enum {
66443   kKLUSKeyboard = 0
66444 };
66445 extern OSStatus
66446 KLGetKeyboardLayoutCount(CFIndex * oCount) ;
66447 extern OSStatus
66448 KLGetKeyboardLayoutAtIndex(
66449   CFIndex iIndex,
66450   KeyboardLayoutRef * oKeyboardLayout) ;
66451 extern OSStatus
66452 KLGetIndexedKeyboardLayout(
66453   CFIndex iIndex,
66454   KeyboardLayoutRef * oKeyboardLayout) ;
66455 extern OSStatus
66456 KLGetKeyboardLayoutProperty(
66457   KeyboardLayoutRef iKeyboardLayout,
66458   KeyboardLayoutPropertyTag iPropertyTag,
66459   const void ** oValue) ;
66460 extern OSStatus
66461 KLGetKeyboardLayoutWithIdentifier(
66462   SInt32 iIdentifier,
66463   KeyboardLayoutRef * oKeyboardLayout) ;
66464 extern OSStatus
66465 KLGetKeyboardLayoutWithName(
66466   CFStringRef iName,
66467   KeyboardLayoutRef * oKeyboardLayout) ;
66468 extern OSStatus
66469 KLGetCurrentKeyboardLayout(KeyboardLayoutRef * oKeyboardLayout) ;
66470 extern OSStatus
66471 KLSetCurrentKeyboardLayout(KeyboardLayoutRef iKeyboardLayout) ;
66472
66473
66474
66475
66476 }
66477
66478
66479
66480 extern "C" {
66481
66482
66483 enum {
66484   kIBCarbonRuntimeCantFindNibFile = -10960,
66485   kIBCarbonRuntimeObjectNotOfRequestedType = -10961,
66486   kIBCarbonRuntimeCantFindObject = -10962
66487 };
66488
66489
66490 typedef struct OpaqueIBNibRef* IBNibRef;
66491 extern OSStatus
66492 CreateNibReference(
66493   CFStringRef inNibName,
66494   IBNibRef * outNibRef) ;
66495 extern OSStatus
66496 CreateNibReferenceWithCFBundle(
66497   CFBundleRef inBundle,
66498   CFStringRef inNibName,
66499   IBNibRef * outNibRef) ;
66500 extern void
66501 DisposeNibReference(IBNibRef inNibRef) ;
66502 extern OSStatus
66503 CreateWindowFromNib(
66504   IBNibRef inNibRef,
66505   CFStringRef inName,
66506   WindowRef * outWindow) ;
66507 extern OSStatus
66508 CreateMenuFromNib(
66509   IBNibRef inNibRef,
66510   CFStringRef inName,
66511   MenuRef * outMenuRef) ;
66512 extern OSStatus
66513 CreateMenuBarFromNib(
66514   IBNibRef inNibRef,
66515   CFStringRef inName,
66516   Handle * outMenuBar) ;
66517 extern OSStatus
66518 SetMenuBarFromNib(
66519   IBNibRef inNibRef,
66520   CFStringRef inName) ;
66521
66522
66523
66524
66525 }
66526
66527
66528
66529 extern "C" {
66530
66531
66532 enum {
66533   soundListRsrc = 'snd ',
66534   kSoundCodecInfoResourceType = 'snfo'
66535 };
66536
66537 enum {
66538   kSimpleBeepID = 1
66539 };
66540
66541 enum {
66542   rate48khz = (long)0xBB800000,
66543   rate44khz = (long)0xAC440000,
66544   rate32khz = 0x7D000000,
66545   rate22050hz = 0x56220000,
66546   rate22khz = 0x56EE8BA3,
66547   rate16khz = 0x3E800000,
66548   rate11khz = 0x2B7745D1,
66549   rate11025hz = 0x2B110000,
66550   rate8khz = 0x1F400000
66551 };
66552
66553
66554 enum {
66555   sampledSynth = 5
66556 };
66557 enum {
66558   kMiddleC = 60
66559 };
66560
66561 enum {
66562   kNoVolume = 0,
66563   kFullVolume = 0x0100
66564 };
66565
66566 enum {
66567   stdQLength = 128
66568 };
66569
66570 enum {
66571   dataOffsetFlag = 0x8000
66572 };
66573
66574 enum {
66575   kUseOptionalOutputDevice = -1
66576 };
66577
66578 enum {
66579   notCompressed = 0,
66580   fixedCompression = -1,
66581   variableCompression = -2
66582 };
66583
66584 enum {
66585   twoToOne = 1,
66586   eightToThree = 2,
66587   threeToOne = 3,
66588   sixToOne = 4,
66589   sixToOnePacketSize = 8,
66590   threeToOnePacketSize = 16
66591 };
66592
66593 enum {
66594   stateBlockSize = 64,
66595   leftOverBlockSize = 32
66596 };
66597
66598 enum {
66599   firstSoundFormat = 0x0001,
66600   secondSoundFormat = 0x0002
66601 };
66602 enum {
66603   sysBeepDisable = 0x0000,
66604   sysBeepEnable = (1 << 0),
66605   sysBeepSynchronous = (1 << 1)
66606 };
66607
66608 enum {
66609   unitTypeNoSelection = 0xFFFF,
66610   unitTypeSeconds = 0x0000
66611 };
66612
66613 enum {
66614   stdSH = 0x00,
66615   extSH = 0xFF,
66616   cmpSH = 0xFE
66617 };
66618
66619
66620 enum {
66621   nullCmd = 0,
66622   quietCmd = 3,
66623   flushCmd = 4,
66624   reInitCmd = 5,
66625   waitCmd = 10,
66626   pauseCmd = 11,
66627   resumeCmd = 12,
66628   callBackCmd = 13,
66629   syncCmd = 14,
66630   availableCmd = 24,
66631   versionCmd = 25,
66632   volumeCmd = 46,
66633   getVolumeCmd = 47,
66634   clockComponentCmd = 50,
66635   getClockComponentCmd = 51,
66636   scheduledSoundCmd = 52,
66637   linkSoundComponentsCmd = 53,
66638   soundCmd = 80,
66639   bufferCmd = 81,
66640   rateMultiplierCmd = 86,
66641   getRateMultiplierCmd = 87
66642 };
66643 enum {
66644   initChanLeft = 0x0002,
66645   initChanRight = 0x0003,
66646   initNoInterp = 0x0004,
66647   initNoDrop = 0x0008,
66648   initMono = 0x0080,
66649   initStereo = 0x00C0,
66650   initMACE3 = 0x0300,
66651   initMACE6 = 0x0400,
66652   initPanMask = 0x0003,
66653   initSRateMask = 0x0030,
66654   initStereoMask = 0x00C0,
66655   initCompMask = 0xFF00
66656 };
66657
66658
66659 enum {
66660   siActiveChannels = 'chac',
66661   siActiveLevels = 'lmac',
66662   siAGCOnOff = 'agc ',
66663   siAsync = 'asyn',
66664   siAVDisplayBehavior = 'avdb',
66665   siChannelAvailable = 'chav',
66666   siCompressionAvailable = 'cmav',
66667   siCompressionFactor = 'cmfa',
66668   siCompressionHeader = 'cmhd',
66669   siCompressionNames = 'cnam',
66670   siCompressionParams = 'evaw',
66671   siCompressionSampleRate = 'cprt',
66672   siCompressionChannels = 'cpct',
66673   siCompressionOutputSampleRate = 'cort',
66674   siCompressionInputRateList = 'crtl',
66675   siCompressionType = 'comp',
66676   siCompressionConfiguration = 'ccfg',
66677   siContinuous = 'cont',
66678   siDecompressionParams = 'wave',
66679   siDecompressionConfiguration = 'dcfg',
66680   siDeviceBufferInfo = 'dbin',
66681   siDeviceConnected = 'dcon',
66682   siDeviceIcon = 'icon',
66683   siDeviceName = 'name',
66684   siEQSpectrumBands = 'eqsb',
66685   siEQSpectrumLevels = 'eqlv',
66686   siEQSpectrumOnOff = 'eqlo',
66687   siEQSpectrumResolution = 'eqrs',
66688   siEQToneControlGain = 'eqtg',
66689   siEQToneControlOnOff = 'eqtc',
66690   siHardwareBalance = 'hbal',
66691   siHardwareBalanceSteps = 'hbls',
66692   siHardwareBass = 'hbas',
66693   siHardwareBassSteps = 'hbst',
66694   siHardwareBusy = 'hwbs',
66695   siHardwareFormat = 'hwfm',
66696   siHardwareMute = 'hmut',
66697   siHardwareMuteNoPrefs = 'hmnp',
66698   siHardwareTreble = 'htrb',
66699   siHardwareTrebleSteps = 'hwts',
66700   siHardwareVolume = 'hvol',
66701   siHardwareVolumeSteps = 'hstp',
66702   siHeadphoneMute = 'pmut',
66703   siHeadphoneVolume = 'pvol',
66704   siHeadphoneVolumeSteps = 'hdst',
66705   siInputAvailable = 'inav',
66706   siInputGain = 'gain',
66707   siInputSource = 'sour',
66708   siInputSourceNames = 'snam',
66709   siLevelMeterOnOff = 'lmet',
66710   siModemGain = 'mgai',
66711   siMonitorAvailable = 'mnav',
66712   siMonitorSource = 'mons',
66713   siNumberChannels = 'chan',
66714   siOptionsDialog = 'optd',
66715   siOSTypeInputSource = 'inpt',
66716   siOSTypeInputAvailable = 'inav',
66717   siOutputDeviceName = 'onam',
66718   siPlayThruOnOff = 'plth',
66719   siPostMixerSoundComponent = 'psmx',
66720   siPreMixerSoundComponent = 'prmx',
66721   siQuality = 'qual',
66722   siRateMultiplier = 'rmul',
66723   siRecordingQuality = 'qual',
66724   siSampleRate = 'srat',
66725   siSampleRateAvailable = 'srav',
66726   siSampleSize = 'ssiz',
66727   siSampleSizeAvailable = 'ssav',
66728   siSetupCDAudio = 'sucd',
66729   siSetupModemAudio = 'sumd',
66730   siSlopeAndIntercept = 'flap',
66731   siSoundClock = 'sclk',
66732   siUseThisSoundClock = 'sclc',
66733   siSpeakerMute = 'smut',
66734   siSpeakerVolume = 'svol',
66735   siSSpCPULoadLimit = '3dll',
66736   siSSpLocalization = '3dif',
66737   siSSpSpeakerSetup = '3dst',
66738   siStereoInputGain = 'sgai',
66739   siSubwooferMute = 'bmut',
66740   siTerminalType = 'ttyp',
66741   siTwosComplementOnOff = 'twos',
66742   siVendorProduct = 'vpro',
66743   siVolume = 'volu',
66744   siVoxRecordInfo = 'voxr',
66745   siVoxStopInfo = 'voxs',
66746   siWideStereo = 'wide',
66747   siSupportedExtendedFlags = 'exfl',
66748   siRateConverterRollOffSlope = 'rcdb',
66749   siOutputLatency = 'olte',
66750   siHALAudioDeviceID = 'hlid',
66751   siHALAudioDeviceUniqueID = 'huid',
66752   siClientAcceptsVBR = 'cvbr',
66753   siSourceIsExhausted = 'srcx',
66754   siMediaContextID = 'uuid',
66755   siCompressionMaxPacketSize = 'cmxp'
66756 };
66757
66758 enum {
66759   siCloseDriver = 'clos',
66760   siInitializeDriver = 'init',
66761   siPauseRecording = 'paus',
66762   siUserInterruptProc = 'user'
66763 };
66764
66765
66766 enum {
66767   kInvalidSource = (long)0xFFFFFFFF,
66768   kNoSource = 'none',
66769   kCDSource = 'cd  ',
66770   kExtMicSource = 'emic',
66771   kSoundInSource = 'sinj',
66772   kRCAInSource = 'irca',
66773   kTVFMTunerSource = 'tvfm',
66774   kDAVInSource = 'idav',
66775   kIntMicSource = 'imic',
66776   kMediaBaySource = 'mbay',
66777   kModemSource = 'modm',
66778   kPCCardSource = 'pcm ',
66779   kZoomVideoSource = 'zvpc',
66780   kDVDSource = 'dvda',
66781   kMicrophoneArray = 'mica'
66782 };
66783
66784
66785 enum {
66786   kNoSoundComponentType = '****',
66787   kSoundComponentType = 'sift',
66788   kSoundComponentPPCType = 'nift',
66789   kRate8SubType = 'ratb',
66790   kRate16SubType = 'ratw',
66791   kConverterSubType = 'conv',
66792   kSndSourceSubType = 'sour',
66793   kMixerType = 'mixr',
66794   kMixer8SubType = 'mixb',
66795   kMixer16SubType = 'mixw',
66796   kSoundInputDeviceType = 'sinp',
66797   kWaveInSubType = 'wavi',
66798   kWaveInSnifferSubType = 'wisn',
66799   kSoundOutputDeviceType = 'sdev',
66800   kClassicSubType = 'clas',
66801   kASCSubType = 'asc ',
66802   kDSPSubType = 'dsp ',
66803   kAwacsSubType = 'awac',
66804   kGCAwacsSubType = 'awgc',
66805   kSingerSubType = 'sing',
66806   kSinger2SubType = 'sng2',
66807   kWhitSubType = 'whit',
66808   kSoundBlasterSubType = 'sbls',
66809   kWaveOutSubType = 'wavo',
66810   kWaveOutSnifferSubType = 'wosn',
66811   kDirectSoundSubType = 'dsnd',
66812   kDirectSoundSnifferSubType = 'dssn',
66813   kUNIXsdevSubType = 'un1x',
66814   kUSBSubType = 'usb ',
66815   kBlueBoxSubType = 'bsnd',
66816   kHALCustomComponentSubType = 'halx',
66817   kSoundCompressor = 'scom',
66818   kSoundDecompressor = 'sdec',
66819   kAudioComponentType = 'adio',
66820   kAwacsPhoneSubType = 'hphn',
66821   kAudioVisionSpeakerSubType = 'telc',
66822   kAudioVisionHeadphoneSubType = 'telh',
66823   kPhilipsFaderSubType = 'tvav',
66824   kSGSToneSubType = 'sgs0',
66825   kSoundEffectsType = 'snfx',
66826   kEqualizerSubType = 'eqal',
66827   kSSpLocalizationSubType = 'snd3'
66828 };
66829
66830
66831 enum {
66832   kSoundNotCompressed = 'NONE',
66833   k8BitOffsetBinaryFormat = 'raw ',
66834   k16BitBigEndianFormat = 'twos',
66835   k16BitLittleEndianFormat = 'sowt',
66836   kFloat32Format = 'fl32',
66837   kFloat64Format = 'fl64',
66838   k24BitFormat = 'in24',
66839   k32BitFormat = 'in32',
66840   k32BitLittleEndianFormat = '23ni',
66841   kMACE3Compression = 'MAC3',
66842   kMACE6Compression = 'MAC6',
66843   kCDXA4Compression = 'cdx4',
66844   kCDXA2Compression = 'cdx2',
66845   kIMACompression = 'ima4',
66846   kULawCompression = 'ulaw',
66847   kALawCompression = 'alaw',
66848   kMicrosoftADPCMFormat = 0x6D730002,
66849   kDVIIntelIMAFormat = 0x6D730011,
66850   kDVAudioFormat = 'dvca',
66851   kQDesignCompression = 'QDMC',
66852   kQDesign2Compression = 'QDM2',
66853   kQUALCOMMCompression = 'Qclp',
66854   kOffsetBinary = k8BitOffsetBinaryFormat,
66855   kTwosComplement = k16BitBigEndianFormat,
66856   kLittleEndianFormat = k16BitLittleEndianFormat,
66857   kMPEGLayer3Format = 0x6D730055,
66858   kFullMPEGLay3Format = '.mp3'
66859 };
66860 enum {
66861   k16BitNativeEndianFormat = k16BitBigEndianFormat,
66862   k16BitNonNativeEndianFormat = k16BitLittleEndianFormat
66863 };
66864
66865
66866
66867
66868 enum {
66869   k8BitRawIn = (1 << 0),
66870   k8BitTwosIn = (1 << 1),
66871   k16BitIn = (1 << 2),
66872   kStereoIn = (1 << 3),
66873   k8BitRawOut = (1 << 8),
66874   k8BitTwosOut = (1 << 9),
66875   k16BitOut = (1 << 10),
66876   kStereoOut = (1 << 11),
66877   kReverse = (1L << 16),
66878   kRateConvert = (1L << 17),
66879   kCreateSoundSource = (1L << 18),
66880   kVMAwareness = (1L << 21),
66881   kHighQuality = (1L << 22),
66882   kNonRealTime = (1L << 23)
66883 };
66884
66885
66886 enum {
66887   kSoundCodecInfoFixedCompression = (1L << 0),
66888   kSoundCodecInfoVariableCompression = (1L << 1),
66889   kSoundCodecInfoHasRestrictedInputRates = (1L << 2),
66890   kSoundCodecInfoCanChangeOutputRate = (1L << 3),
66891   kSoundCodecInfoRequiresExternalFraming = (1L << 4)
66892 };
66893
66894
66895 enum {
66896   kSourcePaused = (1 << 0),
66897   kPassThrough = (1L << 16),
66898   kNoSoundComponentChain = (1L << 17)
66899 };
66900
66901
66902 enum {
66903   kNoMixing = (1 << 0),
66904   kNoSampleRateConversion = (1 << 1),
66905   kNoSampleSizeConversion = (1 << 2),
66906   kNoSampleFormatConversion = (1 << 3),
66907   kNoChannelConversion = (1 << 4),
66908   kNoDecompression = (1 << 5),
66909   kNoVolumeConversion = (1 << 6),
66910   kNoRealtimeProcessing = (1 << 7),
66911   kScheduledSource = (1 << 8),
66912   kNonInterleavedBuffer = (1 << 9),
66913   kNonPagingMixer = (1 << 10),
66914   kSoundConverterMixer = (1 << 11),
66915   kPagingMixer = (1 << 12),
66916   kVMAwareMixer = (1 << 13),
66917   kExtendedSoundData = (1 << 14)
66918 };
66919
66920
66921 enum {
66922   kBestQuality = (1 << 0)
66923 };
66924
66925
66926 enum {
66927   kInputMask = 0x000000FF,
66928   kOutputMask = 0x0000FF00,
66929   kOutputShift = 8,
66930   kActionMask = 0x00FF0000,
66931   kSoundComponentBits = 0x00FFFFFF
66932 };
66933
66934
66935 enum {
66936   kAudioFormatAtomType = 'frma',
66937   kAudioEndianAtomType = 'enda',
66938   kAudioVBRAtomType = 'vbra',
66939   kAudioTerminatorAtomType = 0
66940 };
66941
66942
66943 enum {
66944   kAVDisplayHeadphoneRemove = 0,
66945   kAVDisplayHeadphoneInsert = 1,
66946   kAVDisplayPlainTalkRemove = 2,
66947   kAVDisplayPlainTalkInsert = 3
66948 };
66949
66950
66951 enum {
66952
66953   audioAllChannels = 0,
66954   audioLeftChannel = 1,
66955   audioRightChannel = 2,
66956
66957   audioUnmuted = 0,
66958   audioMuted = 1,
66959
66960   audioDoesMono = (1L << 0),
66961   audioDoesStereo = (1L << 1),
66962   audioDoesIndependentChannels = (1L << 2)
66963 };
66964
66965
66966 enum {
66967   siCDQuality = 'cd  ',
66968   siBestQuality = 'best',
66969   siBetterQuality = 'betr',
66970   siGoodQuality = 'good',
66971   siNoneQuality = 'none'
66972 };
66973
66974 enum {
66975   siDeviceIsConnected = 1,
66976   siDeviceNotConnected = 0,
66977   siDontKnowIfConnected = -1,
66978   siReadPermission = 0,
66979   siWritePermission = 1
66980 };
66981
66982
66983 enum {
66984   kSoundConverterDidntFillBuffer = (1 << 0),
66985   kSoundConverterHasLeftOverData = (1 << 1)
66986 };
66987
66988
66989 enum {
66990   kExtendedSoundSampleCountNotValid = 1L << 0,
66991   kExtendedSoundBufferSizeValid = 1L << 1,
66992   kExtendedSoundFrameSizesValid = 1L << 2,
66993   kExtendedSoundCommonFrameSizeValid = 1L << 3,
66994   kExtendedSoundExtensionsValid = 1L << 4,
66995   kExtendedSoundBufferFlagsValid = 1L << 5
66996 };
66997
66998
66999 enum {
67000   kExtendedSoundBufferIsDiscontinuous = 1L << 0,
67001   kExtendedSoundBufferIsFirstBuffer = 1L << 1
67002 };
67003
67004
67005
67006
67007
67008
67009
67010 struct SndCommand {
67011   unsigned short cmd;
67012   short param1;
67013   long param2;
67014 };
67015 typedef struct SndCommand SndCommand;
67016 typedef struct SndChannel SndChannel;
67017
67018 typedef SndChannel * SndChannelPtr;
67019 typedef void ( * SndCallBackProcPtr)(SndChannelPtr chan, SndCommand *cmd);
67020 typedef SndCallBackProcPtr SndCallBackUPP;
67021 struct SndChannel {
67022   SndChannelPtr nextChan;
67023   Ptr firstMod;
67024   SndCallBackUPP callBack;
67025   long userInfo;
67026   long wait;
67027   SndCommand cmdInProgress;
67028   short flags;
67029   short qLength;
67030   short qHead;
67031   short qTail;
67032   SndCommand queue[128];
67033 };
67034 extern SndCallBackUPP
67035 NewSndCallBackUPP(SndCallBackProcPtr userRoutine) ;
67036 extern void
67037 DisposeSndCallBackUPP(SndCallBackUPP userUPP) ;
67038 extern void
67039 InvokeSndCallBackUPP(
67040   SndChannelPtr chan,
67041   SndCommand * cmd,
67042   SndCallBackUPP userUPP) ;
67043
67044
67045 struct StateBlock {
67046   short stateVar[64];
67047 };
67048 typedef struct StateBlock StateBlock;
67049 typedef StateBlock * StateBlockPtr;
67050 struct LeftOverBlock {
67051   unsigned long count;
67052   SInt8 sampleArea[32];
67053 };
67054 typedef struct LeftOverBlock LeftOverBlock;
67055 typedef LeftOverBlock * LeftOverBlockPtr;
67056 struct ModRef {
67057   unsigned short modNumber;
67058   long modInit;
67059 };
67060 typedef struct ModRef ModRef;
67061 struct SndListResource {
67062   short format;
67063   short numModifiers;
67064   ModRef modifierPart[1];
67065   short numCommands;
67066   SndCommand commandPart[1];
67067   UInt8 dataPart[1];
67068 };
67069 typedef struct SndListResource SndListResource;
67070 typedef SndListResource * SndListPtr;
67071 typedef SndListPtr * SndListHandle;
67072 typedef SndListHandle SndListHndl;
67073
67074 struct Snd2ListResource {
67075   short format;
67076   short refCount;
67077   short numCommands;
67078   SndCommand commandPart[1];
67079   UInt8 dataPart[1];
67080 };
67081 typedef struct Snd2ListResource Snd2ListResource;
67082 typedef Snd2ListResource * Snd2ListPtr;
67083 typedef Snd2ListPtr * Snd2ListHandle;
67084 typedef Snd2ListHandle Snd2ListHndl;
67085 struct SoundHeader {
67086   Ptr samplePtr;
67087   unsigned long length;
67088   UnsignedFixed sampleRate;
67089   unsigned long loopStart;
67090   unsigned long loopEnd;
67091   UInt8 encode;
67092   UInt8 baseFrequency;
67093   UInt8 sampleArea[1];
67094 };
67095 typedef struct SoundHeader SoundHeader;
67096 typedef SoundHeader * SoundHeaderPtr;
67097 struct CmpSoundHeader {
67098   Ptr samplePtr;
67099   unsigned long numChannels;
67100   UnsignedFixed sampleRate;
67101   unsigned long loopStart;
67102   unsigned long loopEnd;
67103   UInt8 encode;
67104   UInt8 baseFrequency;
67105   unsigned long numFrames;
67106   extended80 AIFFSampleRate;
67107   Ptr markerChunk;
67108   OSType format;
67109   unsigned long futureUse2;
67110   StateBlockPtr stateVars;
67111   LeftOverBlockPtr leftOverSamples;
67112   short compressionID;
67113   unsigned short packetSize;
67114   unsigned short snthID;
67115   unsigned short sampleSize;
67116   UInt8 sampleArea[1];
67117 };
67118 typedef struct CmpSoundHeader CmpSoundHeader;
67119 typedef CmpSoundHeader * CmpSoundHeaderPtr;
67120 struct ExtSoundHeader {
67121   Ptr samplePtr;
67122   unsigned long numChannels;
67123   UnsignedFixed sampleRate;
67124   unsigned long loopStart;
67125   unsigned long loopEnd;
67126   UInt8 encode;
67127   UInt8 baseFrequency;
67128   unsigned long numFrames;
67129   extended80 AIFFSampleRate;
67130   Ptr markerChunk;
67131   Ptr instrumentChunks;
67132   Ptr AESRecording;
67133   unsigned short sampleSize;
67134   unsigned short futureUse1;
67135   unsigned long futureUse2;
67136   unsigned long futureUse3;
67137   unsigned long futureUse4;
67138   UInt8 sampleArea[1];
67139 };
67140 typedef struct ExtSoundHeader ExtSoundHeader;
67141 typedef ExtSoundHeader * ExtSoundHeaderPtr;
67142 union SoundHeaderUnion {
67143   SoundHeader stdHeader;
67144   CmpSoundHeader cmpHeader;
67145   ExtSoundHeader extHeader;
67146 };
67147 typedef union SoundHeaderUnion SoundHeaderUnion;
67148 struct ConversionBlock {
67149   short destination;
67150   short unused;
67151   CmpSoundHeaderPtr inputPtr;
67152   CmpSoundHeaderPtr outputPtr;
67153 };
67154 typedef struct ConversionBlock ConversionBlock;
67155 typedef ConversionBlock * ConversionBlockPtr;
67156
67157 enum {
67158   kScheduledSoundDoScheduled = 1 << 0,
67159   kScheduledSoundDoCallBack = 1 << 1,
67160   kScheduledSoundExtendedHdr = 1 << 2
67161 };
67162
67163 struct ScheduledSoundHeader {
67164   SoundHeaderUnion u;
67165   long flags;
67166   short reserved;
67167   short callBackParam1;
67168   long callBackParam2;
67169   TimeRecord startTime;
67170 };
67171 typedef struct ScheduledSoundHeader ScheduledSoundHeader;
67172 typedef ScheduledSoundHeader * ScheduledSoundHeaderPtr;
67173 struct ExtendedScheduledSoundHeader {
67174   SoundHeaderUnion u;
67175   long flags;
67176   short reserved;
67177   short callBackParam1;
67178   long callBackParam2;
67179   TimeRecord startTime;
67180   long recordSize;
67181   long extendedFlags;
67182   long bufferSize;
67183   long frameCount;
67184   long * frameSizesArray;
67185   long commonFrameSize;
67186   void * extensionsPtr;
67187   long extensionsSize;
67188   unsigned long bufferFlags;
67189   unsigned long bufferFlagsMask;
67190 };
67191 typedef struct ExtendedScheduledSoundHeader ExtendedScheduledSoundHeader;
67192 typedef ExtendedScheduledSoundHeader * ExtendedScheduledSoundHeaderPtr;
67193 struct SMStatus {
67194   short smMaxCPULoad;
67195   short smNumChannels;
67196   short smCurCPULoad;
67197 };
67198 typedef struct SMStatus SMStatus;
67199 typedef SMStatus * SMStatusPtr;
67200 struct SCStatus {
67201   UnsignedFixed scStartTime;
67202   UnsignedFixed scEndTime;
67203   UnsignedFixed scCurrentTime;
67204   Boolean scChannelBusy;
67205   Boolean scChannelDisposed;
67206   Boolean scChannelPaused;
67207   Boolean scUnused;
67208   unsigned long scChannelAttributes;
67209   long scCPULoad;
67210 };
67211 typedef struct SCStatus SCStatus;
67212 typedef SCStatus * SCStatusPtr;
67213 struct AudioSelection {
67214   long unitType;
67215   UnsignedFixed selStart;
67216   UnsignedFixed selEnd;
67217 };
67218 typedef struct AudioSelection AudioSelection;
67219 typedef AudioSelection * AudioSelectionPtr;
67220 struct SoundInfoList {
67221   short count;
67222   Handle infoHandle;
67223 };
67224 typedef struct SoundInfoList SoundInfoList;
67225 typedef SoundInfoList * SoundInfoListPtr;
67226 struct SoundComponentData {
67227   long flags;
67228   OSType format;
67229   short numChannels;
67230   short sampleSize;
67231   UnsignedFixed sampleRate;
67232   long sampleCount;
67233   Byte * buffer;
67234   long reserved;
67235 };
67236 typedef struct SoundComponentData SoundComponentData;
67237 typedef SoundComponentData * SoundComponentDataPtr;
67238 struct ExtendedSoundComponentData {
67239   SoundComponentData desc;
67240   long recordSize;
67241   long extendedFlags;
67242   long bufferSize;
67243   long frameCount;
67244   long * frameSizesArray;
67245   long commonFrameSize;
67246   void * extensionsPtr;
67247   long extensionsSize;
67248   unsigned long bufferFlags;
67249   unsigned long bufferFlagsMask;
67250 };
67251 typedef struct ExtendedSoundComponentData ExtendedSoundComponentData;
67252 typedef ExtendedSoundComponentData * ExtendedSoundComponentDataPtr;
67253 typedef struct SoundParamBlock SoundParamBlock;
67254 typedef SoundParamBlock * SoundParamBlockPtr;
67255 typedef Boolean ( * SoundParamProcPtr)(SoundParamBlockPtr * pb);
67256 typedef SoundParamProcPtr SoundParamUPP;
67257 struct SoundParamBlock {
67258   long recordSize;
67259   SoundComponentData desc;
67260   UnsignedFixed rateMultiplier;
67261   short leftVolume;
67262   short rightVolume;
67263   long quality;
67264   ComponentInstance filter;
67265   SoundParamUPP moreRtn;
67266   SoundParamUPP completionRtn;
67267   long refCon;
67268   short result;
67269 };
67270
67271 struct ExtendedSoundParamBlock {
67272   SoundParamBlock pb;
67273   short reserved;
67274   long extendedFlags;
67275   long bufferSize;
67276   long frameCount;
67277   long * frameSizesArray;
67278   long commonFrameSize;
67279   void * extensionsPtr;
67280   long extensionsSize;
67281   unsigned long bufferFlags;
67282   unsigned long bufferFlagsMask;
67283 };
67284 typedef struct ExtendedSoundParamBlock ExtendedSoundParamBlock;
67285 typedef ExtendedSoundParamBlock * ExtendedSoundParamBlockPtr;
67286 struct CompressionInfo {
67287   long recordSize;
67288   OSType format;
67289   short compressionID;
67290   unsigned short samplesPerPacket;
67291   unsigned short bytesPerPacket;
67292   unsigned short bytesPerFrame;
67293   unsigned short bytesPerSample;
67294   unsigned short futureUse1;
67295 };
67296 typedef struct CompressionInfo CompressionInfo;
67297 typedef CompressionInfo * CompressionInfoPtr;
67298 typedef CompressionInfoPtr * CompressionInfoHandle;
67299
67300 struct SoundSlopeAndInterceptRecord {
67301   Float64 slope;
67302   Float64 intercept;
67303   Float64 minClip;
67304   Float64 maxClip;
67305 };
67306 typedef struct SoundSlopeAndInterceptRecord SoundSlopeAndInterceptRecord;
67307 typedef SoundSlopeAndInterceptRecord * SoundSlopeAndInterceptPtr;
67308
67309 typedef struct OpaqueSoundConverter* SoundConverter;
67310
67311 typedef Boolean ( * SoundConverterFillBufferDataProcPtr)(SoundComponentDataPtr *data, void *refCon);
67312 typedef SoundConverterFillBufferDataProcPtr SoundConverterFillBufferDataUPP;
67313
67314 typedef struct OpaqueSoundSource* SoundSource;
67315 typedef SoundSource * SoundSourcePtr;
67316
67317
67318 struct SoundComponentLink {
67319   ComponentDescription description;
67320   SoundSource mixerID;
67321   SoundSource * linkID;
67322 };
67323 typedef struct SoundComponentLink SoundComponentLink;
67324 typedef SoundComponentLink * SoundComponentLinkPtr;
67325 struct AudioInfo {
67326   long capabilitiesFlags;
67327   long reserved;
67328   unsigned short numVolumeSteps;
67329 };
67330 typedef struct AudioInfo AudioInfo;
67331 typedef AudioInfo * AudioInfoPtr;
67332 struct AudioFormatAtom {
67333   long size;
67334   OSType atomType;
67335   OSType format;
67336 };
67337 typedef struct AudioFormatAtom AudioFormatAtom;
67338 typedef AudioFormatAtom * AudioFormatAtomPtr;
67339 struct AudioEndianAtom {
67340   long size;
67341   OSType atomType;
67342   short littleEndian;
67343 };
67344 typedef struct AudioEndianAtom AudioEndianAtom;
67345 typedef AudioEndianAtom * AudioEndianAtomPtr;
67346 struct AudioTerminatorAtom {
67347   long size;
67348   OSType atomType;
67349 };
67350 typedef struct AudioTerminatorAtom AudioTerminatorAtom;
67351 typedef AudioTerminatorAtom * AudioTerminatorAtomPtr;
67352 struct LevelMeterInfo {
67353   short numChannels;
67354   UInt8 leftMeter;
67355   UInt8 rightMeter;
67356 };
67357 typedef struct LevelMeterInfo LevelMeterInfo;
67358 typedef LevelMeterInfo * LevelMeterInfoPtr;
67359 struct EQSpectrumBandsRecord {
67360   short count;
67361   UnsignedFixedPtr frequency;
67362 };
67363 typedef struct EQSpectrumBandsRecord EQSpectrumBandsRecord;
67364 typedef EQSpectrumBandsRecord * EQSpectrumBandsRecordPtr;
67365
67366
67367
67368 typedef struct SPB SPB;
67369 typedef SPB * SPBPtr;
67370
67371
67372
67373 typedef void ( * SIInterruptProcPtr)(SPBPtr inParamPtr, Ptr dataBuffer, short peakAmplitude, long sampleSize);
67374 typedef void ( * SICompletionProcPtr)(SPBPtr inParamPtr);
67375 typedef SIInterruptProcPtr SIInterruptUPP;
67376 typedef SICompletionProcPtr SICompletionUPP;
67377
67378
67379
67380 struct SPB {
67381   long inRefNum;
67382   unsigned long count;
67383   unsigned long milliseconds;
67384   unsigned long bufferLength;
67385   Ptr bufferPtr;
67386   SICompletionUPP completionRoutine;
67387   SIInterruptUPP interruptRoutine;
67388   long userLong;
67389   OSErr error;
67390   long unused1;
67391 };
67392 extern SoundParamUPP
67393 NewSoundParamUPP(SoundParamProcPtr userRoutine) ;
67394 extern SoundConverterFillBufferDataUPP
67395 NewSoundConverterFillBufferDataUPP(SoundConverterFillBufferDataProcPtr userRoutine) ;
67396 extern SIInterruptUPP
67397 NewSIInterruptUPP(SIInterruptProcPtr userRoutine) ;
67398 extern SICompletionUPP
67399 NewSICompletionUPP(SICompletionProcPtr userRoutine) ;
67400 extern void
67401 DisposeSoundParamUPP(SoundParamUPP userUPP) ;
67402 extern void
67403 DisposeSoundConverterFillBufferDataUPP(SoundConverterFillBufferDataUPP userUPP) ;
67404 extern void
67405 DisposeSIInterruptUPP(SIInterruptUPP userUPP) ;
67406 extern void
67407 DisposeSICompletionUPP(SICompletionUPP userUPP) ;
67408 extern Boolean
67409 InvokeSoundParamUPP(
67410   SoundParamBlockPtr * pb,
67411   SoundParamUPP userUPP) ;
67412 extern Boolean
67413 InvokeSoundConverterFillBufferDataUPP(
67414   SoundComponentDataPtr * data,
67415   void * refCon,
67416   SoundConverterFillBufferDataUPP userUPP) ;
67417 extern void
67418 InvokeSIInterruptUPP(
67419   SPBPtr inParamPtr,
67420   Ptr dataBuffer,
67421   short peakAmplitude,
67422   long sampleSize,
67423   SIInterruptUPP userUPP) ;
67424 extern void
67425 InvokeSICompletionUPP(
67426   SPBPtr inParamPtr,
67427   SICompletionUPP userUPP) ;
67428
67429 typedef void ( * FilePlayCompletionProcPtr)(SndChannelPtr chan);
67430 typedef FilePlayCompletionProcPtr FilePlayCompletionUPP;
67431 extern void
67432 SysBeep(short duration) ;
67433 extern OSErr
67434 SndDoCommand(
67435   SndChannelPtr chan,
67436   const SndCommand * cmd,
67437   Boolean noWait) ;
67438 extern OSErr
67439 SndDoImmediate(
67440   SndChannelPtr chan,
67441   const SndCommand * cmd) ;
67442 extern OSErr
67443 SndNewChannel(
67444   SndChannelPtr * chan,
67445   short synth,
67446   long init,
67447   SndCallBackUPP userRoutine) ;
67448 extern OSErr
67449 SndDisposeChannel(
67450   SndChannelPtr chan,
67451   Boolean quietNow) ;
67452 extern OSErr
67453 SndPlay(
67454   SndChannelPtr chan,
67455   SndListHandle sndHandle,
67456   Boolean async) ;
67457 extern NumVersion
67458 SndSoundManagerVersion(void) ;
67459 extern OSErr
67460 SndChannelStatus(
67461   SndChannelPtr chan,
67462   short theLength,
67463   SCStatusPtr theStatus) ;
67464 extern OSErr
67465 SndManagerStatus(
67466   short theLength,
67467   SMStatusPtr theStatus) ;
67468 extern void
67469 SndGetSysBeepState(short * sysBeepState) ;
67470 extern OSErr
67471 SndSetSysBeepState(short sysBeepState) ;
67472 extern OSErr
67473 GetSysBeepVolume(long * level) ;
67474 extern OSErr
67475 SetSysBeepVolume(long level) ;
67476 extern OSErr
67477 GetDefaultOutputVolume(long * level) ;
67478 extern OSErr
67479 SetDefaultOutputVolume(long level) ;
67480 extern OSErr
67481 GetSoundHeaderOffset(
67482   SndListHandle sndHandle,
67483   long * offset) ;
67484 extern UnsignedFixed
67485 UnsignedFixedMulDiv(
67486   UnsignedFixed value,
67487   UnsignedFixed multiplier,
67488   UnsignedFixed divisor);
67489 extern OSErr
67490 GetCompressionInfo(
67491   short compressionID,
67492   OSType format,
67493   short numChannels,
67494   short sampleSize,
67495   CompressionInfoPtr cp) ;
67496 extern OSErr
67497 SetSoundPreference(
67498   OSType theType,
67499   Str255 name,
67500   Handle settings) ;
67501 extern OSErr
67502 GetSoundPreference(
67503   OSType theType,
67504   Str255 name,
67505   Handle settings) ;
67506 extern OSErr
67507 OpenMixerSoundComponent(
67508   SoundComponentDataPtr outputDescription,
67509   long outputFlags,
67510   ComponentInstance * mixerComponent) ;
67511 extern OSErr
67512 CloseMixerSoundComponent(ComponentInstance ci) ;
67513 extern OSErr
67514 SndGetInfo(
67515   SndChannelPtr chan,
67516   OSType selector,
67517   void * infoPtr) ;
67518 extern OSErr
67519 SndSetInfo(
67520   SndChannelPtr chan,
67521   OSType selector,
67522   const void * infoPtr) ;
67523 extern OSErr
67524 GetSoundOutputInfo(
67525   Component outputDevice,
67526   OSType selector,
67527   void * infoPtr) ;
67528 extern OSErr
67529 SetSoundOutputInfo(
67530   Component outputDevice,
67531   OSType selector,
67532   const void * infoPtr) ;
67533 extern OSErr
67534 GetCompressionName(
67535   OSType compressionType,
67536   Str255 compressionName) ;
67537 extern OSErr
67538 SoundConverterOpen(
67539   const SoundComponentData * inputFormat,
67540   const SoundComponentData * outputFormat,
67541   SoundConverter * sc) ;
67542 extern OSErr
67543 SoundConverterClose(SoundConverter sc) ;
67544 extern OSErr
67545 SoundConverterGetBufferSizes(
67546   SoundConverter sc,
67547   unsigned long inputBytesTarget,
67548   unsigned long * inputFrames,
67549   unsigned long * inputBytes,
67550   unsigned long * outputBytes) ;
67551 extern OSErr
67552 SoundConverterBeginConversion(SoundConverter sc) ;
67553 extern OSErr
67554 SoundConverterConvertBuffer(
67555   SoundConverter sc,
67556   const void * inputPtr,
67557   unsigned long inputFrames,
67558   void * outputPtr,
67559   unsigned long * outputFrames,
67560   unsigned long * outputBytes) ;
67561 extern OSErr
67562 SoundConverterEndConversion(
67563   SoundConverter sc,
67564   void * outputPtr,
67565   unsigned long * outputFrames,
67566   unsigned long * outputBytes) ;
67567 extern OSErr
67568 SoundConverterGetInfo(
67569   SoundConverter sc,
67570   OSType selector,
67571   void * infoPtr) ;
67572 extern OSErr
67573 SoundConverterSetInfo(
67574   SoundConverter sc,
67575   OSType selector,
67576   void * infoPtr) ;
67577 extern OSErr
67578 SoundConverterFillBuffer(
67579   SoundConverter sc,
67580   SoundConverterFillBufferDataUPP fillBufferDataUPP,
67581   void * fillBufferDataRefCon,
67582   void * outputBuffer,
67583   unsigned long outputBufferByteSize,
67584   unsigned long * bytesWritten,
67585   unsigned long * framesWritten,
67586   unsigned long * outputFlags) ;
67587 extern OSErr
67588 SoundManagerGetInfo(
67589   OSType selector,
67590   void * infoPtr) ;
67591 extern OSErr
67592 SoundManagerSetInfo(
67593   OSType selector,
67594   const void * infoPtr) ;
67595 extern ComponentResult
67596 SoundComponentInitOutputDevice(
67597   ComponentInstance ti,
67598   long actions) ;
67599 extern ComponentResult
67600 SoundComponentSetSource(
67601   ComponentInstance ti,
67602   SoundSource sourceID,
67603   ComponentInstance source) ;
67604 extern ComponentResult
67605 SoundComponentGetSource(
67606   ComponentInstance ti,
67607   SoundSource sourceID,
67608   ComponentInstance * source) ;
67609 extern ComponentResult
67610 SoundComponentGetSourceData(
67611   ComponentInstance ti,
67612   SoundComponentDataPtr * sourceData) ;
67613 extern ComponentResult
67614 SoundComponentSetOutput(
67615   ComponentInstance ti,
67616   SoundComponentDataPtr requested,
67617   SoundComponentDataPtr * actual) ;
67618 extern ComponentResult
67619 SoundComponentAddSource(
67620   ComponentInstance ti,
67621   SoundSource * sourceID) ;
67622 extern ComponentResult
67623 SoundComponentRemoveSource(
67624   ComponentInstance ti,
67625   SoundSource sourceID) ;
67626 extern ComponentResult
67627 SoundComponentGetInfo(
67628   ComponentInstance ti,
67629   SoundSource sourceID,
67630   OSType selector,
67631   void * infoPtr) ;
67632 extern ComponentResult
67633 SoundComponentSetInfo(
67634   ComponentInstance ti,
67635   SoundSource sourceID,
67636   OSType selector,
67637   void * infoPtr) ;
67638 extern ComponentResult
67639 SoundComponentStartSource(
67640   ComponentInstance ti,
67641   short count,
67642   SoundSource * sources) ;
67643 extern ComponentResult
67644 SoundComponentStopSource(
67645   ComponentInstance ti,
67646   short count,
67647   SoundSource * sources) ;
67648 extern ComponentResult
67649 SoundComponentPauseSource(
67650   ComponentInstance ti,
67651   short count,
67652   SoundSource * sources) ;
67653 extern ComponentResult
67654 SoundComponentPlaySourceBuffer(
67655   ComponentInstance ti,
67656   SoundSource sourceID,
67657   SoundParamBlockPtr pb,
67658   long actions) ;
67659
67660
67661
67662
67663 enum {
67664     kSoundComponentInitOutputDeviceSelect = 0x0001,
67665     kSoundComponentSetSourceSelect = 0x0002,
67666     kSoundComponentGetSourceSelect = 0x0003,
67667     kSoundComponentGetSourceDataSelect = 0x0004,
67668     kSoundComponentSetOutputSelect = 0x0005,
67669     kSoundComponentAddSourceSelect = 0x0101,
67670     kSoundComponentRemoveSourceSelect = 0x0102,
67671     kSoundComponentGetInfoSelect = 0x0103,
67672     kSoundComponentSetInfoSelect = 0x0104,
67673     kSoundComponentStartSourceSelect = 0x0105,
67674     kSoundComponentStopSourceSelect = 0x0106,
67675     kSoundComponentPauseSourceSelect = 0x0107,
67676     kSoundComponentPlaySourceBufferSelect = 0x0108
67677 };
67678 enum {
67679   kDelegatedSoundComponentSelectors = 0x0100
67680 };
67681 extern NumVersion
67682 SPBVersion(void) ;
67683 extern OSErr
67684 SndRecord(
67685   ModalFilterUPP filterProc,
67686   Point corner,
67687   OSType quality,
67688   SndListHandle * sndHandle) ;
67689 extern OSErr
67690 SPBSignInDevice(
67691   short deviceRefNum,
67692   ConstStr255Param deviceName) ;
67693 extern OSErr
67694 SPBSignOutDevice(short deviceRefNum) ;
67695 extern OSErr
67696 SPBGetIndexedDevice(
67697   short count,
67698   Str255 deviceName,
67699   Handle * deviceIconHandle) ;
67700 extern OSErr
67701 SPBOpenDevice(
67702   ConstStr255Param deviceName,
67703   short permission,
67704   long * inRefNum) ;
67705 extern OSErr
67706 SPBCloseDevice(long inRefNum) ;
67707 extern OSErr
67708 SPBRecord(
67709   SPBPtr inParamPtr,
67710   Boolean asynchFlag) ;
67711 extern OSErr
67712 SPBPauseRecording(long inRefNum) ;
67713 extern OSErr
67714 SPBResumeRecording(long inRefNum) ;
67715 extern OSErr
67716 SPBStopRecording(long inRefNum) ;
67717 extern OSErr
67718 SPBGetRecordingStatus(
67719   long inRefNum,
67720   short * recordingStatus,
67721   short * meterLevel,
67722   unsigned long * totalSamplesToRecord,
67723   unsigned long * numberOfSamplesRecorded,
67724   unsigned long * totalMsecsToRecord,
67725   unsigned long * numberOfMsecsRecorded) ;
67726 extern OSErr
67727 SPBGetDeviceInfo(
67728   long inRefNum,
67729   OSType infoType,
67730   void * infoData) ;
67731 extern OSErr
67732 SPBSetDeviceInfo(
67733   long inRefNum,
67734   OSType infoType,
67735   void * infoData) ;
67736 extern OSErr
67737 SPBMillisecondsToBytes(
67738   long inRefNum,
67739   long * milliseconds) ;
67740 extern OSErr
67741 SPBBytesToMilliseconds(
67742   long inRefNum,
67743   long * byteCount) ;
67744 extern OSErr
67745 SetupSndHeader(
67746   SndListHandle sndHandle,
67747   short numChannels,
67748   UnsignedFixed sampleRate,
67749   short sampleSize,
67750   OSType compressionType,
67751   short baseNote,
67752   unsigned long numBytes,
67753   short * headerLen) ;
67754 extern OSErr
67755 SetupAIFFHeader(
67756   short fRefNum,
67757   short numChannels,
67758   UnsignedFixed sampleRate,
67759   short sampleSize,
67760   OSType compressionType,
67761   unsigned long numBytes,
67762   unsigned long numFrames) ;
67763 extern OSErr
67764 ParseAIFFHeader(
67765   short fRefNum,
67766   SoundComponentData * sndInfo,
67767   unsigned long * numFrames,
67768   unsigned long * dataOffset) ;
67769 extern OSErr
67770 ParseSndHeader(
67771   SndListHandle sndHandle,
67772   SoundComponentData * sndInfo,
67773   unsigned long * numFrames,
67774   unsigned long * dataOffset) ;
67775 typedef struct SndInputCmpParam SndInputCmpParam;
67776 typedef SndInputCmpParam * SndInputCmpParamPtr;
67777 typedef void ( * SICCompletionProcPtr)(SndInputCmpParamPtr SICParmPtr);
67778 struct SndInputCmpParam {
67779   SICCompletionProcPtr ioCompletion;
67780   SIInterruptProcPtr ioInterrupt;
67781   OSErr ioResult;
67782   short pad;
67783   unsigned long ioReqCount;
67784   unsigned long ioActCount;
67785   Ptr ioBuffer;
67786   Ptr ioMisc;
67787 };
67788 extern ComponentResult
67789 SndInputReadAsync(
67790   ComponentInstance self,
67791   SndInputCmpParamPtr SICParmPtr) ;
67792 extern ComponentResult
67793 SndInputReadSync(
67794   ComponentInstance self,
67795   SndInputCmpParamPtr SICParmPtr) ;
67796 extern ComponentResult
67797 SndInputPauseRecording(ComponentInstance self) ;
67798 extern ComponentResult
67799 SndInputResumeRecording(ComponentInstance self) ;
67800 extern ComponentResult
67801 SndInputStopRecording(ComponentInstance self) ;
67802 extern ComponentResult
67803 SndInputGetStatus(
67804   ComponentInstance self,
67805   short * recordingStatus,
67806   unsigned long * totalSamplesToRecord,
67807   unsigned long * numberOfSamplesRecorded) ;
67808 extern ComponentResult
67809 SndInputGetDeviceInfo(
67810   ComponentInstance self,
67811   OSType infoType,
67812   void * infoData) ;
67813 extern ComponentResult
67814 SndInputSetDeviceInfo(
67815   ComponentInstance self,
67816   OSType infoType,
67817   void * infoData) ;
67818 extern ComponentResult
67819 SndInputInitHardware(ComponentInstance self) ;
67820
67821
67822
67823
67824 enum {
67825     kSndInputReadAsyncSelect = 0x0001,
67826     kSndInputReadSyncSelect = 0x0002,
67827     kSndInputPauseRecordingSelect = 0x0003,
67828     kSndInputResumeRecordingSelect = 0x0004,
67829     kSndInputStopRecordingSelect = 0x0005,
67830     kSndInputGetStatusSelect = 0x0006,
67831     kSndInputGetDeviceInfoSelect = 0x0007,
67832     kSndInputSetDeviceInfoSelect = 0x0008,
67833     kSndInputInitHardwareSelect = 0x0009
67834 };
67835
67836
67837
67838
67839
67840
67841 }
67842
67843
67844
67845 extern "C" {
67846
67847
67848 enum {
67849   kOSAComponentType = 'osa '
67850 };
67851
67852
67853 enum {
67854   kOSAGenericScriptingComponentSubtype = 'scpt'
67855 };
67856
67857
67858
67859 enum {
67860   kOSAFileType = 'osas'
67861 };
67862
67863
67864
67865
67866
67867
67868 enum {
67869   kOSASuite = 'ascr'
67870 };
67871
67872
67873 enum {
67874   kOSARecordedText = 'recd'
67875 };
67876
67877
67878
67879 enum {
67880   kOSAScriptIsModified = 'modi'
67881 };
67882
67883
67884
67885 enum {
67886   kOSAScriptIsTypeCompiledScript = 'cscr'
67887 };
67888
67889
67890
67891 enum {
67892   kOSAScriptIsTypeScriptValue = 'valu'
67893 };
67894
67895
67896
67897 enum {
67898   kOSAScriptIsTypeScriptContext = 'cntx'
67899 };
67900
67901
67902
67903 enum {
67904   kOSAScriptBestType = 'best'
67905 };
67906
67907
67908
67909
67910
67911
67912
67913 enum {
67914   kOSACanGetSource = 'gsrc'
67915 };
67916
67917
67918 enum {
67919   typeOSADialectInfo = 'difo',
67920   keyOSADialectName = 'dnam',
67921   keyOSADialectCode = 'dcod',
67922   keyOSADialectLangCode = 'dlcd',
67923   keyOSADialectScriptCode = 'dscd'
67924 };
67925
67926 typedef ComponentResult OSAError;
67927
67928 typedef unsigned long OSAID;
67929
67930
67931
67932
67933 enum {
67934   kOSANullScript = 0L
67935 };
67936
67937
67938 enum {
67939   kOSANullMode = 0,
67940   kOSAModeNull = 0
67941 };
67942
67943
67944
67945
67946
67947 typedef OSErr ( * OSACreateAppleEventProcPtr)(AEEventClass theAEEventClass, AEEventID theAEEventID, const AEAddressDesc *target, short returnID, long transactionID, AppleEvent *result, long refCon);
67948 typedef OSErr ( * OSASendProcPtr)(const AppleEvent *theAppleEvent, AppleEvent *reply, AESendMode sendMode, AESendPriority sendPriority, long timeOutInTicks, AEIdleUPP idleProc, AEFilterUPP filterProc, long refCon);
67949 typedef OSACreateAppleEventProcPtr OSACreateAppleEventUPP;
67950 typedef OSASendProcPtr OSASendUPP;
67951 extern OSACreateAppleEventUPP
67952 NewOSACreateAppleEventUPP(OSACreateAppleEventProcPtr userRoutine) ;
67953 extern OSASendUPP
67954 NewOSASendUPP(OSASendProcPtr userRoutine) ;
67955 extern void
67956 DisposeOSACreateAppleEventUPP(OSACreateAppleEventUPP userUPP) ;
67957 extern void
67958 DisposeOSASendUPP(OSASendUPP userUPP) ;
67959 extern OSErr
67960 InvokeOSACreateAppleEventUPP(
67961   AEEventClass theAEEventClass,
67962   AEEventID theAEEventID,
67963   const AEAddressDesc * target,
67964   short returnID,
67965   long transactionID,
67966   AppleEvent * result,
67967   long refCon,
67968   OSACreateAppleEventUPP userUPP) ;
67969 extern OSErr
67970 InvokeOSASendUPP(
67971   const AppleEvent * theAppleEvent,
67972   AppleEvent * reply,
67973   AESendMode sendMode,
67974   AESendPriority sendPriority,
67975   long timeOutInTicks,
67976   AEIdleUPP idleProc,
67977   AEFilterUPP filterProc,
67978   long refCon,
67979   OSASendUPP userUPP) ;
67980 enum {
67981   kOSASupportsCompiling = 0x0002,
67982   kOSASupportsGetSource = 0x0004,
67983   kOSASupportsAECoercion = 0x0008,
67984   kOSASupportsAESending = 0x0010,
67985   kOSASupportsRecording = 0x0020,
67986   kOSASupportsConvenience = 0x0040,
67987   kOSASupportsDialects = 0x0080,
67988   kOSASupportsEventHandling = 0x0100
67989 };
67990
67991
67992 enum {
67993   kOSASelectLoad = 0x0001,
67994   kOSASelectStore = 0x0002,
67995   kOSASelectExecute = 0x0003,
67996   kOSASelectDisplay = 0x0004,
67997   kOSASelectScriptError = 0x0005,
67998   kOSASelectDispose = 0x0006,
67999   kOSASelectSetScriptInfo = 0x0007,
68000   kOSASelectGetScriptInfo = 0x0008,
68001   kOSASelectSetActiveProc = 0x0009,
68002   kOSASelectGetActiveProc = 0x000A
68003 };
68004
68005
68006 enum {
68007   kOSASelectScriptingComponentName = 0x0102,
68008   kOSASelectCompile = 0x0103,
68009   kOSASelectCopyID = 0x0104
68010 };
68011
68012 enum {
68013   kOSASelectCopyScript = 0x0105
68014 };
68015
68016
68017 enum {
68018   kOSASelectGetSource = 0x0201
68019 };
68020
68021
68022 enum {
68023   kOSASelectCoerceFromDesc = 0x0301,
68024   kOSASelectCoerceToDesc = 0x0302
68025 };
68026
68027
68028 enum {
68029   kOSASelectSetSendProc = 0x0401,
68030   kOSASelectGetSendProc = 0x0402,
68031   kOSASelectSetCreateProc = 0x0403,
68032   kOSASelectGetCreateProc = 0x0404,
68033   kOSASelectSetDefaultTarget = 0x0405
68034 };
68035
68036
68037 enum {
68038   kOSASelectStartRecording = 0x0501,
68039   kOSASelectStopRecording = 0x0502
68040 };
68041
68042
68043 enum {
68044   kOSASelectLoadExecute = 0x0601,
68045   kOSASelectCompileExecute = 0x0602,
68046   kOSASelectDoScript = 0x0603
68047 };
68048
68049
68050 enum {
68051   kOSASelectSetCurrentDialect = 0x0701,
68052   kOSASelectGetCurrentDialect = 0x0702,
68053   kOSASelectAvailableDialects = 0x0703,
68054   kOSASelectGetDialectInfo = 0x0704,
68055   kOSASelectAvailableDialectCodeList = 0x0705
68056 };
68057
68058
68059 enum {
68060   kOSASelectSetResumeDispatchProc = 0x0801,
68061   kOSASelectGetResumeDispatchProc = 0x0802,
68062   kOSASelectExecuteEvent = 0x0803,
68063   kOSASelectDoEvent = 0x0804,
68064   kOSASelectMakeContext = 0x0805
68065 };
68066
68067
68068 enum {
68069   kOSADebuggerCreateSession = 0x0901,
68070   kOSADebuggerGetSessionState = 0x0902,
68071   kOSADebuggerSessionStep = 0x0903,
68072   kOSADebuggerDisposeSession = 0x0904,
68073   kOSADebuggerGetStatementRanges = 0x0905,
68074   kOSADebuggerGetBreakpoint = 0x0910,
68075   kOSADebuggerSetBreakpoint = 0x0911,
68076   kOSADebuggerGetDefaultBreakpoint = 0x0912,
68077   kOSADebuggerGetCurrentCallFrame = 0x0906,
68078   kOSADebuggerGetCallFrameState = 0x0907,
68079   kOSADebuggerGetVariable = 0x0908,
68080   kOSADebuggerSetVariable = 0x0909,
68081   kOSADebuggerGetPreviousCallFrame = 0x090A,
68082   kOSADebuggerDisposeCallFrame = 0x090B
68083 };
68084
68085
68086 enum {
68087   kOSASelectComponentSpecificStart = 0x1001
68088 };
68089 enum {
68090   kOSAModePreventGetSource = 0x00000001
68091 };
68092 enum {
68093   kOSAModeNeverInteract = kAENeverInteract,
68094   kOSAModeCanInteract = kAECanInteract,
68095   kOSAModeAlwaysInteract = kAEAlwaysInteract,
68096   kOSAModeDontReconnect = kAEDontReconnect
68097 };
68098 enum {
68099   kOSAModeCantSwitchLayer = 0x00000040
68100 };
68101 enum {
68102   kOSAModeDoRecord = 0x00001000
68103 };
68104 enum {
68105   kOSAModeCompileIntoContext = 0x00000002
68106 };
68107 enum {
68108   kOSAModeAugmentContext = 0x00000004
68109 };
68110
68111
68112
68113
68114
68115
68116
68117 enum {
68118   kOSAModeDisplayForHumans = 0x00000008
68119 };
68120
68121
68122
68123
68124
68125
68126
68127 enum {
68128   kOSAModeDontStoreParent = 0x00010000
68129 };
68130 enum {
68131   kOSAModeDispatchToDirectObject = 0x00020000
68132 };
68133
68134
68135
68136
68137
68138 enum {
68139   kOSAModeDontGetDataForArguments = 0x00040000
68140 };
68141
68142
68143
68144
68145
68146
68147 enum {
68148   kOSAModeFullyQualifyDescriptors = 0x00080000
68149 };
68150 enum {
68151   kOSAScriptResourceType = kOSAGenericScriptingComponentSubtype
68152 };
68153
68154
68155
68156
68157
68158 enum {
68159   typeOSAGenericStorage = kOSAScriptResourceType
68160 };
68161 extern OSAError
68162 OSALoad(
68163   ComponentInstance scriptingComponent,
68164   const AEDesc * scriptData,
68165   long modeFlags,
68166   OSAID * resultingScriptID) ;
68167 extern OSAError
68168 OSAStore(
68169   ComponentInstance scriptingComponent,
68170   OSAID scriptID,
68171   DescType desiredType,
68172   long modeFlags,
68173   AEDesc * resultingScriptData) ;
68174 extern OSAError
68175 OSAExecute(
68176   ComponentInstance scriptingComponent,
68177   OSAID compiledScriptID,
68178   OSAID contextID,
68179   long modeFlags,
68180   OSAID * resultingScriptValueID) ;
68181 extern OSAError
68182 OSADisplay(
68183   ComponentInstance scriptingComponent,
68184   OSAID scriptValueID,
68185   DescType desiredType,
68186   long modeFlags,
68187   AEDesc * resultingText) ;
68188 extern OSAError
68189 OSAScriptError(
68190   ComponentInstance scriptingComponent,
68191   OSType selector,
68192   DescType desiredType,
68193   AEDesc * resultingErrorDescription) ;
68194 enum {
68195   kOSAErrorNumber = keyErrorNumber
68196 };
68197 enum {
68198   kOSAErrorMessage = keyErrorString
68199 };
68200 enum {
68201   kOSAErrorBriefMessage = 'errb'
68202 };
68203 enum {
68204   kOSAErrorApp = 'erap'
68205 };
68206 enum {
68207   kOSAErrorPartialResult = 'ptlr'
68208 };
68209 enum {
68210   kOSAErrorOffendingObject = 'erob'
68211 };
68212
68213
68214
68215
68216
68217
68218 enum {
68219   kOSAErrorExpectedType = 'errt'
68220 };
68221 enum {
68222   kOSAErrorRange = 'erng'
68223 };
68224
68225
68226
68227
68228
68229
68230 enum {
68231   typeOSAErrorRange = 'erng'
68232 };
68233
68234
68235
68236 enum {
68237   keyOSASourceStart = 'srcs'
68238 };
68239
68240
68241
68242 enum {
68243   keyOSASourceEnd = 'srce'
68244 };
68245 extern OSAError
68246 OSADispose(
68247   ComponentInstance scriptingComponent,
68248   OSAID scriptID) ;
68249 extern OSAError
68250 OSASetScriptInfo(
68251   ComponentInstance scriptingComponent,
68252   OSAID scriptID,
68253   OSType selector,
68254   long value) ;
68255 extern OSAError
68256 OSAGetScriptInfo(
68257   ComponentInstance scriptingComponent,
68258   OSAID scriptID,
68259   OSType selector,
68260   long * result) ;
68261 typedef OSErr ( * OSAActiveProcPtr)(long refCon);
68262 typedef OSAActiveProcPtr OSAActiveUPP;
68263 extern OSAActiveUPP
68264 NewOSAActiveUPP(OSAActiveProcPtr userRoutine) ;
68265 extern void
68266 DisposeOSAActiveUPP(OSAActiveUPP userUPP) ;
68267 extern OSErr
68268 InvokeOSAActiveUPP(
68269   long refCon,
68270   OSAActiveUPP userUPP) ;
68271 extern OSAError
68272 OSASetActiveProc(
68273   ComponentInstance scriptingComponent,
68274   OSAActiveUPP activeProc,
68275   long refCon) ;
68276 extern OSAError
68277 OSAGetActiveProc(
68278   ComponentInstance scriptingComponent,
68279   OSAActiveUPP * activeProc,
68280   long * refCon) ;
68281 extern OSAError
68282 OSAScriptingComponentName(
68283   ComponentInstance scriptingComponent,
68284   AEDesc * resultingScriptingComponentName) ;
68285 extern OSAError
68286 OSACompile(
68287   ComponentInstance scriptingComponent,
68288   const AEDesc * sourceData,
68289   long modeFlags,
68290   OSAID * previousAndResultingScriptID) ;
68291 extern OSAError
68292 OSACopyID(
68293   ComponentInstance scriptingComponent,
68294   OSAID fromID,
68295   OSAID * toID) ;
68296 extern OSAError
68297 OSAGetSource(
68298   ComponentInstance scriptingComponent,
68299   OSAID scriptID,
68300   DescType desiredType,
68301   AEDesc * resultingSourceData) ;
68302 extern OSAError
68303 OSACoerceFromDesc(
68304   ComponentInstance scriptingComponent,
68305   const AEDesc * scriptData,
68306   long modeFlags,
68307   OSAID * resultingScriptID) ;
68308 extern OSAError
68309 OSACoerceToDesc(
68310   ComponentInstance scriptingComponent,
68311   OSAID scriptID,
68312   DescType desiredType,
68313   long modeFlags,
68314   AEDesc * result) ;
68315 extern OSAError
68316 OSASetSendProc(
68317   ComponentInstance scriptingComponent,
68318   OSASendUPP sendProc,
68319   long refCon) ;
68320 extern OSAError
68321 OSAGetSendProc(
68322   ComponentInstance scriptingComponent,
68323   OSASendUPP * sendProc,
68324   long * refCon) ;
68325 extern OSAError
68326 OSASetCreateProc(
68327   ComponentInstance scriptingComponent,
68328   OSACreateAppleEventUPP createProc,
68329   long refCon) ;
68330 extern OSAError
68331 OSAGetCreateProc(
68332   ComponentInstance scriptingComponent,
68333   OSACreateAppleEventUPP * createProc,
68334   long * refCon) ;
68335 extern OSAError
68336 OSASetDefaultTarget(
68337   ComponentInstance scriptingComponent,
68338   const AEAddressDesc * target) ;
68339 extern OSAError
68340 OSAStartRecording(
68341   ComponentInstance scriptingComponent,
68342   OSAID * compiledScriptToModifyID) ;
68343 extern OSAError
68344 OSAStopRecording(
68345   ComponentInstance scriptingComponent,
68346   OSAID compiledScriptID) ;
68347 extern OSAError
68348 OSALoadExecute(
68349   ComponentInstance scriptingComponent,
68350   const AEDesc * scriptData,
68351   OSAID contextID,
68352   long modeFlags,
68353   OSAID * resultingScriptValueID) ;
68354 extern OSAError
68355 OSACompileExecute(
68356   ComponentInstance scriptingComponent,
68357   const AEDesc * sourceData,
68358   OSAID contextID,
68359   long modeFlags,
68360   OSAID * resultingScriptValueID) ;
68361 extern OSAError
68362 OSADoScript(
68363   ComponentInstance scriptingComponent,
68364   const AEDesc * sourceData,
68365   OSAID contextID,
68366   DescType desiredType,
68367   long modeFlags,
68368   AEDesc * resultingText) ;
68369 extern OSAError
68370 OSASetCurrentDialect(
68371   ComponentInstance scriptingComponent,
68372   short dialectCode) ;
68373 extern OSAError
68374 OSAGetCurrentDialect(
68375   ComponentInstance scriptingComponent,
68376   short * resultingDialectCode) ;
68377 extern OSAError
68378 OSAAvailableDialects(
68379   ComponentInstance scriptingComponent,
68380   AEDesc * resultingDialectInfoList) ;
68381 extern OSAError
68382 OSAGetDialectInfo(
68383   ComponentInstance scriptingComponent,
68384   short dialectCode,
68385   OSType selector,
68386   AEDesc * resultingDialectInfo) ;
68387 extern OSAError
68388 OSAAvailableDialectCodeList(
68389   ComponentInstance scriptingComponent,
68390   AEDesc * resultingDialectCodeList) ;
68391 extern OSAError
68392 OSASetResumeDispatchProc(
68393   ComponentInstance scriptingComponent,
68394   AEEventHandlerUPP resumeDispatchProc,
68395   long refCon) ;
68396 enum {
68397   kOSAUseStandardDispatch = kAEUseStandardDispatch
68398 };
68399 enum {
68400   kOSANoDispatch = kAENoDispatch
68401 };
68402 enum {
68403   kOSADontUsePhac = 0x0001
68404 };
68405 extern OSAError
68406 OSAGetResumeDispatchProc(
68407   ComponentInstance scriptingComponent,
68408   AEEventHandlerUPP * resumeDispatchProc,
68409   long * refCon) ;
68410 extern OSAError
68411 OSAExecuteEvent(
68412   ComponentInstance scriptingComponent,
68413   const AppleEvent * theAppleEvent,
68414   OSAID contextID,
68415   long modeFlags,
68416   OSAID * resultingScriptValueID) ;
68417 extern OSAError
68418 OSADoEvent(
68419   ComponentInstance scriptingComponent,
68420   const AppleEvent * theAppleEvent,
68421   OSAID contextID,
68422   long modeFlags,
68423   AppleEvent * reply) ;
68424 extern OSAError
68425 OSAMakeContext(
68426   ComponentInstance scriptingComponent,
68427   const AEDesc * contextName,
68428   OSAID parentContext,
68429   OSAID * resultingContextID) ;
68430 typedef OSAID OSADebugSessionRef;
68431 typedef OSAID OSADebugCallFrameRef;
68432
68433
68434
68435 typedef UInt32 OSAProgramState;
68436 enum {
68437   eNotStarted = 0,
68438   eRunnable = 1,
68439   eRunning = 2,
68440   eStopped = 3,
68441   eTerminated = 4
68442 };
68443
68444 typedef UInt32 OSADebugStepKind;
68445 enum {
68446   eStepOver = 0,
68447   eStepIn = 1,
68448   eStepOut = 2,
68449   eRun = 3
68450 };
68451
68452
68453
68454
68455 enum {
68456   keyProgramState = 'dsps'
68457 };
68458
68459
68460
68461
68462 struct StatementRange {
68463   unsigned long startPos;
68464   unsigned long endPos;
68465 };
68466 typedef struct StatementRange StatementRange;
68467 enum {
68468   typeStatementRange = 'srng'
68469 };
68470
68471 enum {
68472   keyProcedureName = 'dfnm',
68473   keyStatementRange = 'dfsr',
68474   keyLocalsNames = 'dfln',
68475   keyGlobalsNames = 'dfgn',
68476   keyParamsNames = 'dfpn'
68477 };
68478 extern OSAError
68479 OSADebuggerCreateSession(
68480   ComponentInstance scriptingComponent,
68481   OSAID inScript,
68482   OSAID inContext,
68483   OSADebugSessionRef * outSession) ;
68484 extern OSAError
68485 OSADebuggerGetSessionState(
68486   ComponentInstance scriptingComponent,
68487   OSADebugSessionRef inSession,
68488   AERecord * outState) ;
68489 extern OSAError
68490 OSADebuggerSessionStep(
68491   ComponentInstance scriptingComponent,
68492   OSADebugSessionRef inSession,
68493   OSADebugStepKind inKind) ;
68494 extern OSAError
68495 OSADebuggerDisposeSession(
68496   ComponentInstance scriptingComponent,
68497   OSADebugSessionRef inSession) ;
68498 extern OSAError
68499 OSADebuggerGetStatementRanges(
68500   ComponentInstance scriptingComponent,
68501   OSADebugSessionRef inSession,
68502   AEDescList * outStatementRangeArray) ;
68503 extern OSAError
68504 OSADebuggerGetBreakpoint(
68505   ComponentInstance scriptingComponent,
68506   OSADebugSessionRef inSession,
68507   UInt32 inSrcOffset,
68508   OSAID * outBreakpoint) ;
68509 extern OSAError
68510 OSADebuggerSetBreakpoint(
68511   ComponentInstance scriptingComponent,
68512   OSADebugSessionRef inSession,
68513   UInt32 inSrcOffset,
68514   OSAID inBreakpoint) ;
68515 extern OSAError
68516 OSADebuggerGetDefaultBreakpoint(
68517   ComponentInstance scriptingComponent,
68518   OSADebugSessionRef inSession,
68519   OSAID * outBreakpoint) ;
68520 extern OSAError
68521 OSADebuggerGetCurrentCallFrame(
68522   ComponentInstance scriptingComponent,
68523   OSADebugSessionRef inSession,
68524   OSADebugCallFrameRef * outCallFrame) ;
68525 extern OSAError
68526 OSADebuggerGetCallFrameState(
68527   ComponentInstance scriptingComponent,
68528   OSADebugCallFrameRef inCallFrame,
68529   AERecord * outState) ;
68530 extern OSAError
68531 OSADebuggerGetVariable(
68532   ComponentInstance scriptingComponent,
68533   OSADebugCallFrameRef inCallFrame,
68534   const AEDesc * inVariableName,
68535   OSAID * outVariable) ;
68536 extern OSAError
68537 OSADebuggerSetVariable(
68538   ComponentInstance scriptingComponent,
68539   OSADebugCallFrameRef inCallFrame,
68540   const AEDesc * inVariableName,
68541   OSAID inVariable) ;
68542 extern OSAError
68543 OSADebuggerGetPreviousCallFrame(
68544   ComponentInstance scriptingComponent,
68545   OSADebugCallFrameRef inCurrentFrame,
68546   OSADebugCallFrameRef * outPrevFrame) ;
68547 extern OSAError
68548 OSADebuggerDisposeCallFrame(
68549   ComponentInstance scriptingComponent,
68550   OSADebugCallFrameRef inCallFrame) ;
68551
68552
68553
68554
68555
68556 }
68557
68558
68559
68560 extern "C" {
68561 extern OSErr
68562 OSAGetStorageType(
68563   AEDataStorage scriptData,
68564   DescType * dscType) ;
68565 extern OSErr
68566 OSAAddStorageType(
68567   AEDataStorage scriptData,
68568   DescType dscType) ;
68569 extern OSErr
68570 OSARemoveStorageType(AEDataStorage scriptData) ;
68571
68572
68573
68574
68575 }
68576
68577
68578
68579 extern "C" {
68580 enum {
68581
68582   kGenericComponentVersion = 0x0100
68583 };
68584
68585 enum {
68586   kGSSSelectGetDefaultScriptingComponent = 0x1001,
68587   kGSSSelectSetDefaultScriptingComponent = 0x1002,
68588   kGSSSelectGetScriptingComponent = 0x1003,
68589   kGSSSelectGetScriptingComponentFromStored = 0x1004,
68590   kGSSSelectGenericToRealID = 0x1005,
68591   kGSSSelectRealToGenericID = 0x1006,
68592   kGSSSelectOutOfRange = 0x1007
68593 };
68594
68595 typedef OSType ScriptingComponentSelector;
68596 typedef OSAID GenericID;
68597 extern OSAError
68598 OSAGetDefaultScriptingComponent(
68599   ComponentInstance genericScriptingComponent,
68600   ScriptingComponentSelector * scriptingSubType) ;
68601 extern OSAError
68602 OSASetDefaultScriptingComponent(
68603   ComponentInstance genericScriptingComponent,
68604   ScriptingComponentSelector scriptingSubType) ;
68605 extern OSAError
68606 OSAGetScriptingComponent(
68607   ComponentInstance genericScriptingComponent,
68608   ScriptingComponentSelector scriptingSubType,
68609   ComponentInstance * scriptingInstance) ;
68610 extern OSAError
68611 OSAGetScriptingComponentFromStored(
68612   ComponentInstance genericScriptingComponent,
68613   const AEDesc * scriptData,
68614   ScriptingComponentSelector * scriptingSubType) ;
68615 extern OSAError
68616 OSAGenericToRealID(
68617   ComponentInstance genericScriptingComponent,
68618   OSAID * theScriptID,
68619   ComponentInstance * theExactComponent) ;
68620 extern OSAError
68621 OSARealToGenericID(
68622   ComponentInstance genericScriptingComponent,
68623   OSAID * theScriptID,
68624   ComponentInstance theExactComponent) ;
68625
68626
68627
68628
68629
68630
68631 }
68632
68633
68634
68635 extern "C" {
68636 enum {
68637   typeAppleScript = 'ascr',
68638   kAppleScriptSubtype = typeAppleScript,
68639   typeASStorage = typeAppleScript
68640 };
68641
68642
68643
68644
68645
68646 enum {
68647   kASSelectInit = 0x1001,
68648   kASSelectSetSourceStyles = 0x1002,
68649   kASSelectGetSourceStyles = 0x1003,
68650   kASSelectGetSourceStyleNames = 0x1004
68651 };
68652
68653
68654
68655
68656
68657 enum {
68658   kASHasOpenHandler = 'hsod'
68659 };
68660 extern OSAError
68661 ASInit(
68662   ComponentInstance scriptingComponent,
68663   long modeFlags,
68664   long minStackSize,
68665   long preferredStackSize,
68666   long maxStackSize,
68667   long minHeapSize,
68668   long preferredHeapSize,
68669   long maxHeapSize) ;
68670 enum {
68671   kASDefaultMinStackSize = 4 * 1024,
68672   kASDefaultPreferredStackSize = 16 * 1024,
68673   kASDefaultMaxStackSize = 16 * 1024,
68674   kASDefaultMinHeapSize = 4 * 1024,
68675   kASDefaultPreferredHeapSize = 16 * 1024,
68676   kASDefaultMaxHeapSize = 32L * 1024 * 1024
68677 };
68678 extern OSAError
68679 ASSetSourceStyles(
68680   ComponentInstance scriptingComponent,
68681   STHandle sourceStyles) ;
68682 extern OSAError
68683 ASGetSourceStyles(
68684   ComponentInstance scriptingComponent,
68685   STHandle * resultingSourceStyles) ;
68686 extern OSAError
68687 ASGetSourceStyleNames(
68688   ComponentInstance scriptingComponent,
68689   long modeFlags,
68690   AEDescList * resultingSourceStyleNamesList) ;
68691 enum {
68692   kASSourceStyleUncompiledText = 0,
68693   kASSourceStyleNormalText = 1,
68694   kASSourceStyleLanguageKeyword = 2,
68695   kASSourceStyleApplicationKeyword = 3,
68696   kASSourceStyleComment = 4,
68697   kASSourceStyleLiteral = 5,
68698   kASSourceStyleUserSymbol = 6,
68699   kASSourceStyleObjectSpecifier = 7,
68700   kASNumberOfSourceStyles = 8
68701 };
68702
68703
68704
68705
68706 }
68707
68708
68709
68710 extern "C" {
68711 enum {
68712   kOSAModeDontDefine = 0x0001
68713 };
68714
68715
68716
68717
68718 enum {
68719   kASSelectSetPropertyObsolete = 0x1101,
68720   kASSelectGetPropertyObsolete = 0x1102,
68721   kASSelectSetHandlerObsolete = 0x1103,
68722   kASSelectGetHandlerObsolete = 0x1104,
68723   kASSelectGetAppTerminologyObsolete = 0x1105,
68724   kASSelectSetProperty = 0x1106,
68725   kASSelectGetProperty = 0x1107,
68726   kASSelectSetHandler = 0x1108,
68727   kASSelectGetHandler = 0x1109,
68728   kASSelectGetAppTerminology = 0x110A,
68729   kASSelectGetSysTerminology = 0x110B,
68730   kASSelectGetPropertyNames = 0x110C,
68731   kASSelectGetHandlerNames = 0x110D
68732 };
68733 extern OSAError
68734 OSASetProperty(
68735   ComponentInstance scriptingComponent,
68736   long modeFlags,
68737   OSAID contextID,
68738   const AEDesc * variableName,
68739   OSAID scriptValueID) ;
68740 extern OSAError
68741 OSAGetProperty(
68742   ComponentInstance scriptingComponent,
68743   long modeFlags,
68744   OSAID contextID,
68745   const AEDesc * variableName,
68746   OSAID * resultingScriptValueID) ;
68747 extern OSAError
68748 OSAGetPropertyNames(
68749   ComponentInstance scriptingComponent,
68750   long modeFlags,
68751   OSAID contextID,
68752   AEDescList * resultingPropertyNames) ;
68753 extern OSAError
68754 OSASetHandler(
68755   ComponentInstance scriptingComponent,
68756   long modeFlags,
68757   OSAID contextID,
68758   const AEDesc * handlerName,
68759   OSAID compiledScriptID) ;
68760 extern OSAError
68761 OSAGetHandler(
68762   ComponentInstance scriptingComponent,
68763   long modeFlags,
68764   OSAID contextID,
68765   const AEDesc * handlerName,
68766   OSAID * resultingCompiledScriptID) ;
68767 extern OSAError
68768 OSAGetHandlerNames(
68769   ComponentInstance scriptingComponent,
68770   long modeFlags,
68771   OSAID contextID,
68772   AEDescList * resultingHandlerNames) ;
68773 extern OSAError
68774 OSAGetAppTerminology(
68775   ComponentInstance scriptingComponent,
68776   long modeFlags,
68777   FSSpec * fileSpec,
68778   short terminologyID,
68779   Boolean * didLaunch,
68780   AEDesc * terminologyList) ;
68781 extern OSAError
68782 OSAGetSysTerminology(
68783   ComponentInstance scriptingComponent,
68784   long modeFlags,
68785   short terminologyID,
68786   AEDesc * terminologyList) ;
68787 extern OSAError
68788 ASSetProperty(
68789   ComponentInstance scriptingComponent,
68790   OSAID contextID,
68791   const AEDesc * variableName,
68792   OSAID scriptValueID) ;
68793 extern OSAError
68794 ASGetProperty(
68795   ComponentInstance scriptingComponent,
68796   OSAID contextID,
68797   const AEDesc * variableName,
68798   OSAID * resultingScriptValueID) ;
68799 extern OSAError
68800 ASSetHandler(
68801   ComponentInstance scriptingComponent,
68802   OSAID contextID,
68803   const AEDesc * handlerName,
68804   OSAID compiledScriptID) ;
68805 extern OSAError
68806 ASGetHandler(
68807   ComponentInstance scriptingComponent,
68808   OSAID contextID,
68809   const AEDesc * handlerName,
68810   OSAID * resultingCompiledScriptID) ;
68811 extern OSAError
68812 ASGetAppTerminology(
68813   ComponentInstance scriptingComponent,
68814   FSSpec * fileSpec,
68815   short terminologID,
68816   Boolean * didLaunch,
68817   AEDesc * terminologyList) ;
68818 }
68819
68820
68821
68822 enum {
68823   keyAETarget = 'targ',
68824   keySubjectAttr = 'subj',
68825   keyASReturning = 'Krtn',
68826   kASAppleScriptSuite = 'ascr',
68827   kASScriptEditorSuite = 'ToyS',
68828   kASTypeNamesSuite = 'tpnm',
68829   typeAETE = 'aete',
68830   typeAEUT = 'aeut',
68831   kGetAETE = 'gdte',
68832   kGetAEUT = 'gdut',
68833   kUpdateAEUT = 'udut',
68834   kUpdateAETE = 'udte',
68835   kCleanUpAEUT = 'cdut',
68836   kASComment = 'cmnt',
68837   kASLaunchEvent = 'noop',
68838   keyScszResource = 'scsz',
68839   typeScszResource = 'scsz',
68840   kASSubroutineEvent = 'psbr',
68841   keyASSubroutineName = 'snam',
68842   kASPrepositionalSubroutine = 'psbr',
68843   keyASPositionalArgs = 'parg'
68844 };
68845
68846 enum {
68847
68848   keyAppHandledCoercion = 'idas'
68849 };
68850
68851 enum {
68852
68853   kASStartLogEvent = 'log1',
68854   kASStopLogEvent = 'log0',
68855   kASCommentEvent = 'cmnt'
68856 };
68857
68858
68859
68860 enum {
68861
68862   kASAdd = '+   ',
68863   kASSubtract = '-   ',
68864   kASMultiply = '*   ',
68865   kASDivide = '/   ',
68866   kASQuotient = 'div ',
68867   kASRemainder = 'mod ',
68868   kASPower = '^   ',
68869   kASEqual = kAEEquals,
68870   kASNotEqual = '­   ',
68871   kASGreaterThan = kAEGreaterThan,
68872   kASGreaterThanOrEqual = kAEGreaterThanEquals,
68873   kASLessThan = kAELessThan,
68874   kASLessThanOrEqual = kAELessThanEquals,
68875   kASComesBefore = 'cbfr',
68876   kASComesAfter = 'cafr',
68877   kASConcatenate = 'ccat',
68878   kASStartsWith = kAEBeginsWith,
68879   kASEndsWith = kAEEndsWith,
68880   kASContains = kAEContains
68881 };
68882
68883 enum {
68884   kASAnd = kAEAND,
68885   kASOr = kAEOR,
68886   kASNot = kAENOT,
68887   kASNegate = 'neg ',
68888   keyASArg = 'arg '
68889 };
68890
68891 enum {
68892
68893   kASErrorEventCode = 'err ',
68894   kOSAErrorArgs = 'erra',
68895   keyAEErrorObject = 'erob',
68896   pLength = 'leng',
68897   pReverse = 'rvse',
68898   pRest = 'rest',
68899   pInherits = 'c@#^',
68900   pProperties = 'pALL',
68901   keyASUserRecordFields = 'usrf',
68902   typeUserRecordFields = typeAEList
68903 };
68904
68905
68906 enum {
68907   keyASPrepositionAt = 'at  ',
68908   keyASPrepositionIn = 'in  ',
68909   keyASPrepositionFrom = 'from',
68910   keyASPrepositionFor = 'for ',
68911   keyASPrepositionTo = 'to  ',
68912   keyASPrepositionThru = 'thru',
68913   keyASPrepositionThrough = 'thgh',
68914   keyASPrepositionBy = 'by  ',
68915   keyASPrepositionOn = 'on  ',
68916   keyASPrepositionInto = 'into',
68917   keyASPrepositionOnto = 'onto',
68918   keyASPrepositionBetween = 'btwn',
68919   keyASPrepositionAgainst = 'agst',
68920   keyASPrepositionOutOf = 'outo',
68921   keyASPrepositionInsteadOf = 'isto',
68922   keyASPrepositionAsideFrom = 'asdf',
68923   keyASPrepositionAround = 'arnd',
68924   keyASPrepositionBeside = 'bsid',
68925   keyASPrepositionBeneath = 'bnth',
68926   keyASPrepositionUnder = 'undr'
68927 };
68928
68929 enum {
68930   keyASPrepositionOver = 'over',
68931   keyASPrepositionAbove = 'abve',
68932   keyASPrepositionBelow = 'belw',
68933   keyASPrepositionApartFrom = 'aprt',
68934   keyASPrepositionGiven = 'givn',
68935   keyASPrepositionWith = 'with',
68936   keyASPrepositionWithout = 'wout',
68937   keyASPrepositionAbout = 'abou',
68938   keyASPrepositionSince = 'snce',
68939   keyASPrepositionUntil = 'till'
68940 };
68941
68942 enum {
68943
68944   kDialectBundleResType = 'Dbdl',
68945   cConstant = typeEnumerated,
68946   cClassIdentifier = pClass,
68947   cObjectBeingExamined = typeObjectBeingExamined,
68948   cList = typeAEList,
68949   cSmallReal = typeSMFloat,
68950   cReal = typeFloat,
68951   cRecord = typeAERecord,
68952   cReference = cObjectSpecifier,
68953   cUndefined = 'undf',
68954   cMissingValue = 'msng',
68955   cSymbol = 'symb',
68956   cLinkedList = 'llst',
68957   cVector = 'vect',
68958   cEventIdentifier = 'evnt',
68959   cKeyIdentifier = 'kyid',
68960   cUserIdentifier = 'uid ',
68961   cPreposition = 'prep',
68962   cKeyForm = enumKeyForm,
68963   cScript = 'scpt',
68964   cHandler = 'hand',
68965   cProcedure = 'proc'
68966 };
68967
68968 enum {
68969   cHandleBreakpoint = 'brak'
68970 };
68971
68972 enum {
68973   cClosure = 'clsr',
68974   cRawData = 'rdat',
68975   cStringClass = typeChar,
68976   cNumber = 'nmbr',
68977   cListElement = 'celm',
68978   cListOrRecord = 'lr  ',
68979   cListOrString = 'ls  ',
68980   cListRecordOrString = 'lrs ',
68981   cNumberOrString = 'ns  ',
68982   cNumberOrDateTime = 'nd  ',
68983   cNumberDateTimeOrString = 'nds ',
68984   cAliasOrString = 'sf  ',
68985   cSeconds = 'scnd',
68986   typeSound = 'snd ',
68987   enumBooleanValues = 'boov',
68988   kAETrue = typeTrue,
68989   kAEFalse = typeFalse,
68990   enumMiscValues = 'misc',
68991   kASCurrentApplication = 'cura',
68992   formUserPropertyID = 'usrp'
68993 };
68994
68995 enum {
68996   cString = cStringClass
68997 };
68998
68999 enum {
69000
69001   pASIt = 'it  ',
69002   pASMe = 'me  ',
69003   pASResult = 'rslt',
69004   pASSpace = 'spac',
69005   pASReturn = 'ret ',
69006   pASTab = 'tab ',
69007   pASPi = 'pi  ',
69008   pASParent = 'pare',
69009   kASInitializeEventCode = 'init',
69010   pASPrintLength = 'prln',
69011   pASPrintDepth = 'prdp',
69012   pASTopLevelScript = 'ascr'
69013 };
69014
69015 enum {
69016
69017   kAECase = 'case',
69018   kAEDiacritic = 'diac',
69019   kAEWhiteSpace = 'whit',
69020   kAEHyphens = 'hyph',
69021   kAEExpansion = 'expa',
69022   kAEPunctuation = 'punc',
69023   kAEZenkakuHankaku = 'zkhk',
69024   kAESmallKana = 'skna',
69025   kAEKataHiragana = 'hika',
69026   kASConsiderReplies = 'rmte',
69027   enumConsiderations = 'cons'
69028 };
69029
69030
69031 enum {
69032   kAECaseConsiderMask = 0x00000001,
69033   kAEDiacriticConsiderMask = 0x00000002,
69034   kAEWhiteSpaceConsiderMask = 0x00000004,
69035   kAEHyphensConsiderMask = 0x00000008,
69036   kAEExpansionConsiderMask = 0x00000010,
69037   kAEPunctuationConsiderMask = 0x00000020,
69038   kASConsiderRepliesConsiderMask = 0x00000040,
69039   kAECaseIgnoreMask = 0x00010000,
69040   kAEDiacriticIgnoreMask = 0x00020000,
69041   kAEWhiteSpaceIgnoreMask = 0x00040000,
69042   kAEHyphensIgnoreMask = 0x00080000,
69043   kAEExpansionIgnoreMask = 0x00100000,
69044   kAEPunctuationIgnoreMask = 0x00200000,
69045   kASConsiderRepliesIgnoreMask = 0x00400000,
69046   enumConsidsAndIgnores = 'csig'
69047 };
69048
69049 enum {
69050   cCoercion = 'coec',
69051   cCoerceUpperCase = 'txup',
69052   cCoerceLowerCase = 'txlo',
69053   cCoerceRemoveDiacriticals = 'txdc',
69054   cCoerceRemovePunctuation = 'txpc',
69055   cCoerceRemoveHyphens = 'txhy',
69056   cCoerceOneByteToTwoByte = 'txex',
69057   cCoerceRemoveWhiteSpace = 'txws',
69058   cCoerceSmallKana = 'txsk',
69059   cCoerceZenkakuhankaku = 'txze',
69060   cCoerceKataHiragana = 'txkh',
69061   cZone = 'zone',
69062   cMachine = 'mach',
69063   cAddress = 'addr',
69064   cRunningAddress = 'radd',
69065   cStorage = 'stor'
69066 };
69067
69068 enum {
69069
69070   pASWeekday = 'wkdy',
69071   pASMonth = 'mnth',
69072   pASDay = 'day ',
69073   pASYear = 'year',
69074   pASTime = 'time',
69075   pASDateString = 'dstr',
69076   pASTimeString = 'tstr',
69077   cMonth = pASMonth,
69078   cJanuary = 'jan ',
69079   cFebruary = 'feb ',
69080   cMarch = 'mar ',
69081   cApril = 'apr ',
69082   cMay = 'may ',
69083   cJune = 'jun ',
69084   cJuly = 'jul ',
69085   cAugust = 'aug ',
69086   cSeptember = 'sep ',
69087   cOctober = 'oct ',
69088   cNovember = 'nov ',
69089   cDecember = 'dec '
69090 };
69091
69092 enum {
69093
69094   cWeekday = pASWeekday,
69095   cSunday = 'sun ',
69096   cMonday = 'mon ',
69097   cTuesday = 'tue ',
69098   cWednesday = 'wed ',
69099   cThursday = 'thu ',
69100   cFriday = 'fri ',
69101   cSaturday = 'sat ',
69102   pASQuote = 'quot',
69103   pASSeconds = 'secs',
69104   pASMinutes = 'min ',
69105   pASHours = 'hour',
69106   pASDays = 'days',
69107   pASWeeks = 'week',
69108   cWritingCodeInfo = 'citl',
69109   pScriptCode = 'pscd',
69110   pLangCode = 'plcd',
69111   kASMagicTellEvent = 'tell',
69112   kASMagicEndTellEvent = 'tend'
69113 };
69114
69115
69116
69117 enum {
69118   kAEFinderSuite = 'fndr'
69119 };
69120
69121
69122
69123
69124
69125
69126 enum {
69127   kAECleanUp = 'fclu',
69128   kAEEject = 'ejct',
69129   kAEEmpty = 'empt',
69130   kAEErase = 'fera',
69131   kAEGestalt = 'gstl',
69132   kAEPutAway = 'ptwy',
69133   kAERebuildDesktopDB = 'rddb',
69134   kAESync = 'fupd',
69135   kAEInterceptOpen = 'fopn'
69136 };
69137
69138
69139 enum {
69140   kAEDatabaseSuite = 'DATA',
69141   kAESort = 'SORT'
69142 };
69143 enum {
69144   cInternalFinderObject = 'obj '
69145 };
69146
69147
69148
69149
69150
69151 enum {
69152
69153
69154
69155   cAliasFile = 'alia',
69156   cApplicationFile = 'appf',
69157   cControlPanelFile = 'ccdv',
69158   cDeskAccessoryFile = 'dafi',
69159   cDocumentFile = 'docf',
69160   cFontFile = 'fntf',
69161   cSoundFile = 'sndf',
69162   cClippingFile = 'clpf',
69163   cContainer = 'ctnr',
69164   cDesktop = 'cdsk',
69165   cSharableContainer = 'sctr',
69166   cDisk = 'cdis',
69167   cFolder = 'cfol',
69168   cSuitcase = 'stcs',
69169   cAccessorySuitcase = 'dsut',
69170   cFontSuitcase = 'fsut',
69171   cTrash = 'ctrs',
69172   cDesktopPrinter = 'dskp',
69173   cPackage = 'pack',
69174   cContentSpace = 'dwnd',
69175   cContainerWindow = 'cwnd',
69176   cInfoWindow = 'iwnd',
69177   cSharingWindow = 'swnd',
69178   cStatusWindow = 'qwnd',
69179   cClippingWindow = 'lwnd',
69180   cPreferencesWindow = 'pwnd',
69181   cDTPWindow = 'dtpw',
69182   cProcess = 'prcs',
69183   cAccessoryProcess = 'pcda',
69184   cApplicationProcess = 'pcap',
69185   cGroup = 'sgrp',
69186   cUser = 'cuse',
69187   cSharingPrivileges = 'priv',
69188   cPreferences = 'cprf',
69189   cLabel = 'clbl',
69190   cSound = 'snd ',
69191   cAliasList = 'alst',
69192   cSpecialFolders = 'spfl',
69193   cOnlineDisk = 'cods',
69194   cOnlineLocalDisk = 'clds',
69195   cOnlineRemoteDisk = 'crds',
69196   cEntireContents = 'ects',
69197   cIconFamily = 'ifam'
69198 };
69199 enum {
69200
69201   pComment = 'comt',
69202   pContainer = cContainer,
69203   pContentSpace = cContentSpace,
69204   pCreationDateOld = 'crtd',
69205   pCreationDate = 'ascd',
69206   pDescription = 'dscr',
69207   pDisk = cDisk,
69208   pFolderOld = cFolder,
69209   pFolder = 'asdr',
69210   pIconBitmap = 'iimg',
69211   pInfoWindow = cInfoWindow,
69212   pKind = 'kind',
69213   pLabelIndex = 'labi',
69214   pModificationDateOld = 'modd',
69215   pModificationDate = 'asmo',
69216
69217   pPhysicalSize = 'phys',
69218   pPosition = 'posn',
69219   pIsSelected = 'issl',
69220   pSize = pPointSize,
69221   pWindow = cWindow,
69222   pPreferencesWindow = cPreferencesWindow
69223 };
69224
69225
69226
69227 enum {
69228   pFileCreator = 'fcrt',
69229   pFileType = 'asty',
69230   pFileTypeOld = 'fitp',
69231   pIsLocked = 'aslk',
69232   pIsLockedOld = 'islk',
69233
69234
69235   pProductVersion = 'ver2'
69236 };
69237
69238
69239
69240 enum {
69241   pOriginalItem = 'orig'
69242 };
69243
69244
69245 enum {
69246   pMinAppPartition = 'mprt',
69247   pAppPartition = 'appt',
69248   pSuggestedAppPartition = 'sprt',
69249   pIsScriptable = 'isab'
69250 };
69251
69252
69253 enum {
69254   pInternetLocation = 'iloc'
69255 };
69256
69257
69258 enum {
69259   pSound = 'snd '
69260 };
69261 enum {
69262   pShowFolderSize = 'sfsz',
69263   pShowComment = 'scom',
69264   pShowDate = 'sdat',
69265   pShowCreationDate = 'scda',
69266   pShowKind = 'sknd',
69267   pShowLabel = 'slbl',
69268   pShowSize = 'ssiz',
69269   pShowVersion = 'svrs',
69270   pSortDirection = 'sord',
69271   pShowDiskInfo = 'sdin',
69272   pListViewIconSize = 'lvis',
69273   pGridIcons = 'fgrd',
69274   pStaggerIcons = 'fstg',
69275   pViewFont = 'vfnt',
69276   pViewFontSize = 'vfsz'
69277 };
69278
69279
69280 enum {
69281   pCompletelyExpanded = 'pexc',
69282   pContainerWindow = cContainerWindow,
69283   pEntireContents = cEntireContents,
69284   pExpandable = 'pexa',
69285   pExpanded = 'pexp',
69286   pPreviousView = 'svew',
69287   pView = 'pvew',
69288   pIconSize = pListViewIconSize,
69289   pKeepArranged = 'arrg',
69290   pKeepArrangedBy = 'arby'
69291 };
69292
69293
69294 enum {
69295   pStartupDisk = 'sdsk',
69296   pTrash = 'trsh'
69297 };
69298
69299
69300 enum {
69301   pOwner = 'sown',
69302   pOwnerPrivileges = 'ownr',
69303   pGroup = cGroup,
69304   pGroupPrivileges = 'gppr',
69305   pGuestPrivileges = 'gstp',
69306   pArePrivilegesInherited = 'iprv',
69307   pExported = 'sexp',
69308   pMounted = 'smou',
69309   pSharingProtection = 'spro',
69310   pSharing = 'shar',
69311   pSharingWindow = cSharingWindow
69312 };
69313
69314
69315 enum {
69316   pCapacity = 'capa',
69317   pEjectable = 'isej',
69318   pFreeSpace = 'frsp',
69319   pLocal = 'isrv',
69320   pIsStartup = 'istd'
69321 };
69322
69323
69324 enum {
69325   pWarnOnEmpty = 'warn'
69326 };
69327
69328
69329 enum {
69330   pIsZoomedFull = 'zumf',
69331   pIsPopup = 'drwr',
69332   pIsPulledOpen = 'pull',
69333   pIsCollapsed = 'wshd'
69334 };
69335
69336
69337 enum {
69338   pObject = cObject
69339 };
69340
69341
69342 enum {
69343   pSharableContainer = cSharableContainer
69344 };
69345
69346
69347 enum {
69348   pInfoPanel = 'panl'
69349 };
69350
69351
69352
69353 enum {
69354   pFileShareOn = 'fshr',
69355   pFileShareStartingUp = 'fsup',
69356   pProgramLinkingOn = 'iac '
69357 };
69358
69359
69360 enum {
69361
69362
69363   pShowModificationDate = pShowDate,
69364   pUseRelativeDate = 'urdt',
69365   pDelayBeforeSpringing = 'dela',
69366   pSpringOpenFolders = 'sprg',
69367   pUseShortMenus = 'usme',
69368   pUseWideGrid = 'uswg',
69369   pLabel1 = 'lbl1',
69370   pLabel2 = 'lbl2',
69371   pLabel3 = 'lbl3',
69372   pLabel4 = 'lbl4',
69373   pLabel5 = 'lbl5',
69374   pLabel6 = 'lbl6',
69375   pLabel7 = 'lbl7',
69376   pDefaultIconViewIconSize = 'iisz',
69377   pDefaultButtonViewIconSize = 'bisz',
69378   pDefaultListViewIconSize = 'lisz',
69379   pIconViewArrangement = 'iarr',
69380   pButtonViewArrangement = 'barr'
69381 };
69382
69383
69384
69385
69386
69387 enum {
69388   pNoArrangement = 'narr',
69389   pSnapToGridArrangement = 'grda',
69390   pByNameArrangement = 'nama',
69391   pByModificationDateArrangement = 'mdta',
69392   pByCreationDateArrangement = 'cdta',
69393   pBySizeArrangement = 'siza',
69394   pByKindArrangement = 'kina',
69395   pByLabelArrangement = 'laba'
69396 };
69397
69398
69399
69400
69401 enum {
69402
69403   pFile = cFile,
69404
69405
69406
69407   pPartitionSpaceUsed = 'pusd',
69408
69409   pLocalAndRemoteEvents = 'revt',
69410   pHasScriptingTerminology = 'hscr'
69411 };
69412
69413
69414 enum {
69415   pDeskAccessoryFile = cDeskAccessoryFile
69416 };
69417
69418
69419 enum {
69420   pApplicationFile = cApplicationFile
69421 };
69422 enum {
69423
69424
69425
69426
69427
69428
69429   pCanConnect = 'ccon',
69430   pCanChangePassword = 'ccpw',
69431   pCanDoProgramLinking = 'ciac',
69432   pIsOwner = 'isow',
69433   pARADialIn = 'arad',
69434   pShouldCallBack = 'calb',
69435   pCallBackNumber = 'cbnm'
69436 };
69437
69438
69439
69440
69441
69442 enum {
69443   pAboutMacintosh = 'abbx',
69444   pAppleMenuItemsFolder = 'amnu',
69445
69446   pControlPanelsFolder = 'ctrl',
69447   pDesktop = 'desk',
69448   pExtensionsFolder = 'extn',
69449
69450   pFinderPreferences = 'pfrp',
69451   pFontsFolder = 'font',
69452   pFontsFolderPreAllegro = 'ffnt',
69453
69454
69455   pLargestFreeBlock = 'mfre',
69456   pPreferencesFolder = 'pref',
69457
69458
69459
69460   pShortCuts = 'scut',
69461   pShutdownFolder = 'shdf',
69462   pStartupItemsFolder = 'strt',
69463   pSystemFolder = 'macs',
69464   pTemporaryFolder = 'temp',
69465
69466   pViewPreferences = 'pvwp',
69467   pStartingUp = 'awak'
69468 };
69469
69470
69471 enum {
69472   pSeeFiles = 'prvr',
69473   pSeeFolders = 'prvs',
69474   pMakeChanges = 'prvw'
69475 };
69476 enum {
69477   pSmallIcon = 'smic',
69478   pSmallButton = 'smbu',
69479   pLargeButton = 'lgbu',
69480   pGrid = 'grid'
69481 };
69482
69483
69484
69485
69486
69487
69488
69489 enum {
69490   enumViewBy = 'vwby',
69491   enumGestalt = 'gsen',
69492   enumConflicts = 'cflc',
69493   enumExistingItems = 'exsi',
69494   enumOlderItems = 'oldr'
69495 };
69496
69497 enum {
69498   enumDate = 'enda',
69499   enumAnyDate = 'anyd',
69500   enumToday = 'tday',
69501   enumYesterday = 'yday',
69502   enumThisWeek = 'twek',
69503   enumLastWeek = 'lwek',
69504   enumThisMonth = 'tmon',
69505   enumLastMonth = 'lmon',
69506   enumThisYear = 'tyer',
69507   enumLastYear = 'lyer',
69508   enumBeforeDate = 'bfdt',
69509   enumAfterDate = 'afdt',
69510   enumBetweenDate = 'btdt',
69511   enumOnDate = 'ondt'
69512 };
69513
69514 enum {
69515   enumAllDocuments = 'alld',
69516   enumFolders = 'fold',
69517   enumAliases = 'alia',
69518   enumStationery = 'stat'
69519 };
69520
69521 enum {
69522   enumWhere = 'wher',
69523   enumAllLocalDisks = 'aldk',
69524   enumAllRemoteDisks = 'ardk',
69525   enumAllDisks = 'alld',
69526   enumAllOpenFolders = 'aofo'
69527 };
69528
69529
69530 enum {
69531   enumIconSize = 'isiz',
69532   enumSmallIconSize = pSmallIcon,
69533   enumMiniIconSize = 'miic',
69534   enumLargeIconSize = 'lgic'
69535 };
69536
69537 enum {
69538   enumSortDirection = 'sodr',
69539   enumSortDirectionNormal = 'snrm',
69540   enumSortDirectionReverse = 'srvs'
69541 };
69542
69543 enum {
69544   enumArrangement = 'earr'
69545 };
69546
69547
69548 enum {
69549   enumInfoWindowPanel = 'ipnl',
69550   enumGeneralPanel = 'gpnl',
69551   enumSharingPanel = 'spnl',
69552   enumStatusNConfigPanel = 'scnl',
69553   enumFontsPanel = 'fpnl',
69554   enumMemoryPanel = 'mpnl'
69555 };
69556
69557
69558
69559 enum {
69560   enumPrefsWindowPanel = 'pple',
69561   enumPrefsGeneralPanel = 'pgnp',
69562   enumPrefsLabelPanel = 'plbp',
69563   enumPrefsIconViewPanel = 'pivp',
69564   enumPrefsButtonViewPanel = 'pbvp',
69565   enumPrefsListViewPanel = 'plvp'
69566 };
69567
69568
69569
69570
69571
69572
69573
69574 enum {
69575   typeIconFamily = cIconFamily,
69576   typeIconAndMask = 'ICN#',
69577   type8BitMask = 'l8mk',
69578   type32BitIcon = 'il32',
69579   type8BitIcon = 'icl8',
69580   type4BitIcon = 'icl4',
69581   typeSmallIconAndMask = 'ics#',
69582   typeSmall8BitMask = 's8mk',
69583   typeSmall32BitIcon = 'is32',
69584   typeSmall8BitIcon = 'ics8',
69585   typeSmall4BitIcon = 'ics4',
69586   typeRelativeTime = 'rtim',
69587   typeConceptualTime = 'timc'
69588 };
69589
69590
69591
69592
69593
69594
69595
69596 enum {
69597   keyIconAndMask = 'ICN#',
69598   key32BitIcon = 'il32',
69599   key8BitIcon = 'icl8',
69600   key4BitIcon = 'icl4',
69601   key8BitMask = 'l8mk',
69602   keySmallIconAndMask = 'ics#',
69603   keySmall8BitIcon = 'ics8',
69604   keySmall4BitIcon = 'ics4',
69605   keySmall32BitIcon = 'is32',
69606   keySmall8BitMask = 's8mk',
69607   keyMini1BitMask = 'icm#',
69608   keyMini4BitIcon = 'icm4',
69609   keyMini8BitIcon = 'icm8',
69610   keyAEUsing = 'usin',
69611   keyAEReplacing = 'alrp',
69612   keyAENoAutoRouting = 'rout',
69613   keyLocalPositionList = 'mvpl',
69614   keyGlobalPositionList = 'mvpg',
69615   keyRedirectedDocumentList = 'fpdl'
69616 };
69617
69618
69619
69620
69621
69622
69623
69624 enum {
69625   keyASPrepositionHas = 'has ',
69626   keyAll = 'kyal',
69627   keyOldFinderItems = 'fsel'
69628 };
69629
69630
69631
69632
69633
69634
69635
69636 enum {
69637   formAlias = typeAlias,
69638   formCreator = pFileCreator
69639 };
69640 enum {
69641   errFinderIsBusy = -15260,
69642   errFinderWindowNotOpen = -15261,
69643   errFinderCannotPutAway = -15262,
69644   errFinderWindowMustBeIconView = -15263,
69645   errFinderWindowMustBeListView = -15264,
69646   errFinderCantMoveToDestination = -15265,
69647   errFinderCantMoveSource = -15266,
69648   errFinderCantOverwrite = -15267,
69649   errFinderIncestuousMove = -15268,
69650   errFinderCantMoveToAncestor = -15269,
69651   errFinderCantUseTrashedItems = -15270,
69652   errFinderItemAlreadyInDest = -15271,
69653   errFinderUnknownUser = -15272,
69654   errFinderSharePointsCantInherit = -15273,
69655   errFinderWindowWrongType = -15274,
69656   errFinderPropertyNowWindowBased = -15275,
69657   errFinderAppFolderProtected = -15276,
69658   errFinderSysFolderProtected = -15277,
69659   errFinderBoundsWrong = -15278,
69660   errAEValueOutOfRange = -15279,
69661   errFinderPropertyDoesNotApply = -15280,
69662   errFinderFileSharingMustBeOn = -15281,
69663   errFinderMustBeActive = -15282,
69664   errFinderVolumeNotFound = -15283,
69665   errFinderLockedItemsInTrash = -15284,
69666   errFinderOnlyLockedItemsInTrash = -15285,
69667   errFinderProgramLinkingMustBeOn = -15286,
69668   errFinderWindowMustBeButtonView = -15287,
69669   errFinderBadPackageContents = -15288,
69670   errFinderUnsupportedInsidePackages = -15289,
69671   errFinderCorruptOpenFolderList = -15290,
69672   errFinderNoInvisibleFiles = -15291,
69673   errFinderCantDeleteImmediately = -15292,
69674   errFinderLastReserved = -15379
69675 };
69676
69677
69678
69679 enum {
69680   kDigiHubEventClass = 'dhub'
69681 };
69682
69683
69684
69685 enum {
69686   kDigiHubMusicCD = 'aucd',
69687   kDigiHubPictureCD = 'picd',
69688   kDigiHubVideoDVD = 'vdvd',
69689   kDigiHubBlankCD = 'bcd ',
69690   kDigiHubBlankDVD = 'bdvd'
69691 };
69692
69693
69694
69695 extern "C" {
69696
69697
69698
69699 typedef void ( * PMItemProcPtr)(DialogRef theDialog, short item);
69700 typedef void ( * PMPrintDialogInitProcPtr)(PMPrintSettings printSettings, PMDialog *theDialog);
69701 typedef void ( * PMPageSetupDialogInitProcPtr)(PMPageFormat pageFormat, PMDialog *theDialog);
69702 typedef void ( * PMSheetDoneProcPtr)(PMPrintSession printSession, WindowRef documentWindow, Boolean accepted);
69703 typedef PMItemProcPtr PMItemUPP;
69704 typedef PMPrintDialogInitProcPtr PMPrintDialogInitUPP;
69705 typedef PMPageSetupDialogInitProcPtr PMPageSetupDialogInitUPP;
69706 typedef PMSheetDoneProcPtr PMSheetDoneUPP;
69707 extern PMItemUPP
69708 NewPMItemUPP(PMItemProcPtr userRoutine) ;
69709 extern PMPrintDialogInitUPP
69710 NewPMPrintDialogInitUPP(PMPrintDialogInitProcPtr userRoutine) ;
69711 extern PMPageSetupDialogInitUPP
69712 NewPMPageSetupDialogInitUPP(PMPageSetupDialogInitProcPtr userRoutine) ;
69713 extern PMSheetDoneUPP
69714 NewPMSheetDoneUPP(PMSheetDoneProcPtr userRoutine) ;
69715 extern void
69716 DisposePMItemUPP(PMItemUPP userUPP) ;
69717 extern void
69718 DisposePMPrintDialogInitUPP(PMPrintDialogInitUPP userUPP) ;
69719 extern void
69720 DisposePMPageSetupDialogInitUPP(PMPageSetupDialogInitUPP userUPP) ;
69721 extern void
69722 DisposePMSheetDoneUPP(PMSheetDoneUPP userUPP) ;
69723 extern void
69724 InvokePMItemUPP(
69725   DialogRef theDialog,
69726   short item,
69727   PMItemUPP userUPP) ;
69728 extern void
69729 InvokePMPrintDialogInitUPP(
69730   PMPrintSettings printSettings,
69731   PMDialog * theDialog,
69732   PMPrintDialogInitUPP userUPP) ;
69733 extern void
69734 InvokePMPageSetupDialogInitUPP(
69735   PMPageFormat pageFormat,
69736   PMDialog * theDialog,
69737   PMPageSetupDialogInitUPP userUPP) ;
69738 extern void
69739 InvokePMSheetDoneUPP(
69740   PMPrintSession printSession,
69741   WindowRef documentWindow,
69742   Boolean accepted,
69743   PMSheetDoneUPP userUPP) ;
69744 extern OSStatus
69745 PMSessionBeginDocument(
69746   PMPrintSession printSession,
69747   PMPrintSettings printSettings,
69748   PMPageFormat pageFormat) ;
69749 extern OSStatus
69750 PMSessionEndDocument(PMPrintSession printSession) ;
69751 extern OSStatus
69752 PMSessionBeginPage(
69753   PMPrintSession printSession,
69754   PMPageFormat pageFormat,
69755   const PMRect * pageFrame) ;
69756 extern OSStatus
69757 PMSessionEndPage(PMPrintSession printSession) ;
69758 extern OSStatus
69759 PMSessionPageSetupDialog(
69760   PMPrintSession printSession,
69761   PMPageFormat pageFormat,
69762   Boolean * accepted) ;
69763 extern OSStatus
69764 PMSessionPrintDialog(
69765   PMPrintSession printSession,
69766   PMPrintSettings printSettings,
69767   PMPageFormat constPageFormat,
69768   Boolean * accepted) ;
69769 extern OSStatus
69770 PMSessionPageSetupDialogInit(
69771   PMPrintSession printSession,
69772   PMPageFormat pageFormat,
69773   PMDialog * newDialog) ;
69774 extern OSStatus
69775 PMSessionPrintDialogInit(
69776   PMPrintSession printSession,
69777   PMPrintSettings printSettings,
69778   PMPageFormat constPageFormat,
69779   PMDialog * newDialog) ;
69780 extern OSStatus
69781 PMSessionPrintDialogMain(
69782   PMPrintSession printSession,
69783   PMPrintSettings printSettings,
69784   PMPageFormat constPageFormat,
69785   Boolean * accepted,
69786   PMPrintDialogInitUPP myInitProc) ;
69787 extern OSStatus
69788 PMSessionPageSetupDialogMain(
69789   PMPrintSession printSession,
69790   PMPageFormat pageFormat,
69791   Boolean * accepted,
69792   PMPageSetupDialogInitUPP myInitProc) ;
69793 extern OSStatus
69794 PMSessionUseSheets(
69795   PMPrintSession printSession,
69796   WindowRef documentWindow,
69797   PMSheetDoneUPP sheetDoneProc) ;
69798 extern OSStatus
69799 PMGetDialogPtr(
69800   PMDialog pmDialog,
69801   DialogRef * theDialog) ;
69802 extern OSStatus
69803 PMGetModalFilterProc(
69804   PMDialog pmDialog,
69805   ModalFilterUPP * filterProc) ;
69806 extern OSStatus
69807 PMSetModalFilterProc(
69808   PMDialog pmDialog,
69809   ModalFilterUPP filterProc) ;
69810 extern OSStatus
69811 PMGetItemProc(
69812   PMDialog pmDialog,
69813   PMItemUPP * itemProc) ;
69814 extern OSStatus
69815 PMSetItemProc(
69816   PMDialog pmDialog,
69817   PMItemUPP itemProc) ;
69818 extern OSStatus
69819 PMGetDialogAccepted(
69820   PMDialog pmDialog,
69821   Boolean * process) ;
69822 extern OSStatus
69823 PMSetDialogAccepted(
69824   PMDialog pmDialog,
69825   Boolean process) ;
69826 extern OSStatus
69827 PMGetDialogDone(
69828   PMDialog pmDialog,
69829   Boolean * done) ;
69830 extern OSStatus
69831 PMSetDialogDone(
69832   PMDialog pmDialog,
69833   Boolean done) ;
69834 extern OSStatus
69835 PMSessionEnablePrinterPresets(
69836   PMPrintSession session,
69837   CFStringRef graphicsType) ;
69838 extern OSStatus
69839 PMSessionDisablePrinterPresets(PMPrintSession session) ;
69840
69841
69842
69843
69844 }
69845
69846
69847
69848 extern "C" {
69849
69850
69851
69852 typedef UInt32 NavAskSaveChangesAction;
69853 enum {
69854
69855   kNavSaveChangesClosingDocument = 1,
69856   kNavSaveChangesQuittingApplication = 2,
69857   kNavSaveChangesOther = 0
69858 };
69859
69860
69861 typedef UInt32 NavAskSaveChangesResult;
69862 enum {
69863
69864   kNavAskSaveChangesSave = 1,
69865   kNavAskSaveChangesCancel = 2,
69866   kNavAskSaveChangesDontSave = 3
69867 };
69868
69869
69870 typedef UInt32 NavAskDiscardChangesResult;
69871 enum {
69872
69873   kNavAskDiscardChanges = 1,
69874   kNavAskDiscardChangesCancel = 2
69875 };
69876
69877
69878 typedef SInt16 NavFilterModes;
69879 enum {
69880
69881   kNavFilteringBrowserList = 0,
69882   kNavFilteringFavorites = 1,
69883   kNavFilteringRecents = 2,
69884   kNavFilteringShortCutVolumes = 3,
69885   kNavFilteringLocationPopup = 4
69886 };
69887
69888
69889 enum {
69890   kNavFileOrFolderVersion = 1
69891 };
69892
69893 struct NavFileOrFolderInfo {
69894   UInt16 version;
69895   Boolean isFolder;
69896   Boolean visible;
69897   UInt32 creationDate;
69898   UInt32 modificationDate;
69899   union {
69900     struct {
69901       Boolean locked;
69902       Boolean resourceOpen;
69903       Boolean dataOpen;
69904       Boolean reserved1;
69905       UInt32 dataSize;
69906       UInt32 resourceSize;
69907       FInfo finderInfo;
69908       FXInfo finderXInfo;
69909     } fileInfo;
69910     struct {
69911       Boolean shareable;
69912       Boolean sharePoint;
69913       Boolean mounted;
69914       Boolean readable;
69915       Boolean writeable;
69916       Boolean reserved2;
69917       UInt32 numberOfFiles;
69918       DInfo finderDInfo;
69919       DXInfo finderDXInfo;
69920       OSType folderType;
69921       OSType folderCreator;
69922       char reserved3[206];
69923     } folderInfo;
69924
69925   } fileAndFolder;
69926 };
69927 typedef struct NavFileOrFolderInfo NavFileOrFolderInfo;
69928 union NavEventDataInfo {
69929   EventRecord * event;
69930   void * param;
69931 };
69932 typedef union NavEventDataInfo NavEventDataInfo;
69933 struct NavEventData {
69934   NavEventDataInfo eventDataParms;
69935   SInt16 itemHit;
69936 };
69937 typedef struct NavEventData NavEventData;
69938 typedef struct __NavDialog* NavDialogRef;
69939 typedef UInt32 NavUserAction;
69940 enum {
69941
69942
69943
69944
69945
69946   kNavUserActionNone = 0,
69947
69948
69949
69950
69951   kNavUserActionCancel = 1,
69952
69953
69954
69955
69956   kNavUserActionOpen = 2,
69957
69958
69959
69960
69961   kNavUserActionSaveAs = 3,
69962
69963
69964
69965
69966
69967   kNavUserActionChoose = 4,
69968
69969
69970
69971
69972   kNavUserActionNewFolder = 5,
69973
69974
69975
69976
69977   kNavUserActionSaveChanges = 6,
69978
69979
69980
69981
69982   kNavUserActionDontSaveChanges = 7,
69983
69984
69985
69986
69987
69988   kNavUserActionDiscardChanges = 8,
69989
69990
69991
69992
69993
69994   kNavUserActionReviewDocuments = 9,
69995
69996
69997
69998
69999
70000   kNavUserActionDiscardDocuments = 10
70001 };
70002
70003
70004
70005 enum {
70006   kNavCBRecVersion = 1
70007 };
70008 struct NavCBRec {
70009
70010
70011
70012
70013   UInt16 version;
70014
70015
70016
70017
70018   NavDialogRef context;
70019
70020
70021
70022
70023   WindowRef window;
70024
70025
70026
70027
70028   Rect customRect;
70029
70030
70031
70032
70033   Rect previewRect;
70034
70035
70036
70037
70038   NavEventData eventData;
70039
70040
70041
70042
70043
70044   NavUserAction userAction;
70045
70046
70047
70048
70049   char reserved[218];
70050 };
70051 typedef struct NavCBRec NavCBRec;
70052 typedef NavCBRec * NavCBRecPtr;
70053
70054
70055
70056
70057
70058
70059
70060 typedef SInt32 NavEventCallbackMessage;
70061 enum {
70062
70063
70064
70065
70066
70067   kNavCBEvent = 0,
70068
70069
70070
70071
70072
70073
70074
70075   kNavCBCustomize = 1,
70076
70077
70078
70079
70080
70081
70082   kNavCBStart = 2,
70083
70084
70085
70086
70087   kNavCBTerminate = 3,
70088
70089
70090
70091
70092
70093
70094   kNavCBAdjustRect = 4,
70095
70096
70097
70098
70099
70100
70101
70102   kNavCBNewLocation = 5,
70103
70104
70105
70106
70107   kNavCBShowDesktop = 6,
70108
70109
70110
70111
70112
70113
70114   kNavCBSelectEntry = 7,
70115   kNavCBPopupMenuSelect = 8,
70116
70117
70118
70119
70120   kNavCBAccept = 9,
70121
70122
70123
70124
70125   kNavCBCancel = 10,
70126
70127
70128
70129
70130
70131
70132   kNavCBAdjustPreview = 11,
70133
70134
70135
70136
70137
70138
70139
70140   kNavCBUserAction = 12,
70141
70142
70143
70144
70145
70146
70147   kNavCBOpenSelection = (long)0x80000000
70148 };
70149
70150
70151 typedef void * NavCallBackUserData;
70152
70153 typedef void ( * NavEventProcPtr)(NavEventCallbackMessage callBackSelector, NavCBRecPtr callBackParms, void *callBackUD);
70154
70155 typedef Boolean ( * NavPreviewProcPtr)(NavCBRecPtr callBackParms, void *callBackUD);
70156
70157 typedef Boolean ( * NavObjectFilterProcPtr)(AEDesc *theItem, void *info, void *callBackUD, NavFilterModes filterMode);
70158 typedef NavEventProcPtr NavEventUPP;
70159 typedef NavPreviewProcPtr NavPreviewUPP;
70160 typedef NavObjectFilterProcPtr NavObjectFilterUPP;
70161 extern NavEventUPP
70162 NewNavEventUPP(NavEventProcPtr userRoutine) ;
70163 extern NavPreviewUPP
70164 NewNavPreviewUPP(NavPreviewProcPtr userRoutine) ;
70165 extern NavObjectFilterUPP
70166 NewNavObjectFilterUPP(NavObjectFilterProcPtr userRoutine) ;
70167 extern void
70168 DisposeNavEventUPP(NavEventUPP userUPP) ;
70169 extern void
70170 DisposeNavPreviewUPP(NavPreviewUPP userUPP) ;
70171 extern void
70172 DisposeNavObjectFilterUPP(NavObjectFilterUPP userUPP) ;
70173 extern void
70174 InvokeNavEventUPP(
70175   NavEventCallbackMessage callBackSelector,
70176   NavCBRecPtr callBackParms,
70177   void * callBackUD,
70178   NavEventUPP userUPP) ;
70179 extern Boolean
70180 InvokeNavPreviewUPP(
70181   NavCBRecPtr callBackParms,
70182   void * callBackUD,
70183   NavPreviewUPP userUPP) ;
70184 extern Boolean
70185 InvokeNavObjectFilterUPP(
70186   AEDesc * theItem,
70187   void * info,
70188   void * callBackUD,
70189   NavFilterModes filterMode,
70190   NavObjectFilterUPP userUPP) ;
70191
70192 typedef SInt32 NavCustomControlMessage;
70193 enum {
70194   kNavCtlShowDesktop = 0,
70195   kNavCtlSortBy = 1,
70196   kNavCtlSortOrder = 2,
70197   kNavCtlScrollHome = 3,
70198   kNavCtlScrollEnd = 4,
70199   kNavCtlPageUp = 5,
70200   kNavCtlPageDown = 6,
70201   kNavCtlGetLocation = 7,
70202   kNavCtlSetLocation = 8,
70203   kNavCtlGetSelection = 9,
70204   kNavCtlSetSelection = 10,
70205   kNavCtlShowSelection = 11,
70206   kNavCtlOpenSelection = 12,
70207   kNavCtlEjectVolume = 13,
70208   kNavCtlNewFolder = 14,
70209   kNavCtlCancel = 15,
70210   kNavCtlAccept = 16,
70211   kNavCtlIsPreviewShowing = 17,
70212   kNavCtlAddControl = 18,
70213   kNavCtlAddControlList = 19,
70214   kNavCtlGetFirstControlID = 20,
70215   kNavCtlSelectCustomType = 21,
70216   kNavCtlSelectAllType = 22,
70217   kNavCtlGetEditFileName = 23,
70218   kNavCtlSetEditFileName = 24,
70219   kNavCtlSelectEditFileName = 25,
70220   kNavCtlBrowserSelectAll = 26,
70221   kNavCtlGotoParent = 27,
70222   kNavCtlSetActionState = 28,
70223   kNavCtlBrowserRedraw = 29,
70224   kNavCtlTerminate = 30
70225 };
70226
70227 typedef UInt32 NavActionState;
70228 enum {
70229   kNavNormalState = 0x00000000,
70230   kNavDontOpenState = 0x00000001,
70231   kNavDontSaveState = 0x00000002,
70232   kNavDontChooseState = 0x00000004,
70233   kNavDontNewFolderState = 0x00000010
70234 };
70235
70236 typedef UInt16 NavPopupMenuItem;
70237 enum {
70238   kNavAllKnownFiles = 0,
70239   kNavAllReadableFiles = 1,
70240   kNavAllFiles = 2
70241 };
70242
70243 typedef UInt16 NavSortKeyField;
70244 enum {
70245   kNavSortNameField = 0,
70246   kNavSortDateField = 1
70247 };
70248
70249
70250 typedef UInt16 NavSortOrder;
70251 enum {
70252   kNavSortAscending = 0,
70253   kNavSortDescending = 1
70254 };
70255
70256
70257 typedef UInt32 NavDialogOptionFlags;
70258 enum {
70259   kNavDefaultNavDlogOptions = 0x000000E4,
70260   kNavNoTypePopup = 0x00000001,
70261   kNavDontAutoTranslate = 0x00000002,
70262   kNavDontAddTranslateItems = 0x00000004,
70263   kNavAllFilesInPopup = 0x00000010,
70264   kNavAllowStationery = 0x00000020,
70265   kNavAllowPreviews = 0x00000040,
70266   kNavAllowMultipleFiles = 0x00000080,
70267   kNavAllowInvisibleFiles = 0x00000100,
70268   kNavDontResolveAliases = 0x00000200,
70269   kNavSelectDefaultLocation = 0x00000400,
70270   kNavSelectAllReadableItem = 0x00000800,
70271   kNavSupportPackages = 0x00001000,
70272   kNavAllowOpenPackages = 0x00002000,
70273   kNavDontAddRecents = 0x00004000,
70274   kNavDontUseCustomFrame = 0x00008000,
70275   kNavDontConfirmReplacement = 0x00010000,
70276   kNavPreserveSaveFileExtension = 0x00020000
70277 };
70278
70279
70280 typedef UInt32 NavTranslationOptions;
70281 enum {
70282   kNavTranslateInPlace = 0,
70283   kNavTranslateCopy = 1
70284 };
70285
70286
70287 enum {
70288   kNavMenuItemSpecVersion = 0
70289 };
70290
70291 struct NavMenuItemSpec {
70292   UInt16 version;
70293   OSType menuCreator;
70294   OSType menuType;
70295   Str255 menuItemName;
70296   char reserved[245];
70297 };
70298 typedef struct NavMenuItemSpec NavMenuItemSpec;
70299 typedef NavMenuItemSpec * NavMenuItemSpecArrayPtr;
70300 typedef NavMenuItemSpecArrayPtr * NavMenuItemSpecArrayHandle;
70301 typedef NavMenuItemSpecArrayPtr NavMenuItemSpecPtr;
70302 typedef NavMenuItemSpecArrayHandle NavMenuItemSpecHandle;
70303 enum {
70304   kNavGenericSignature = '****'
70305 };
70306
70307 struct NavTypeList {
70308   OSType componentSignature;
70309   short reserved;
70310   short osTypeCount;
70311   OSType osType[1];
70312 };
70313 typedef struct NavTypeList NavTypeList;
70314 typedef NavTypeList * NavTypeListPtr;
70315 typedef NavTypeListPtr * NavTypeListHandle;
70316 enum {
70317   kNavDialogOptionsVersion = 0
70318 };
70319
70320 struct NavDialogOptions {
70321   UInt16 version;
70322   NavDialogOptionFlags dialogOptionFlags;
70323   Point location;
70324   Str255 clientName;
70325   Str255 windowTitle;
70326   Str255 actionButtonLabel;
70327   Str255 cancelButtonLabel;
70328   Str255 savedFileName;
70329   Str255 message;
70330   UInt32 preferenceKey;
70331   NavMenuItemSpecArrayHandle popupExtension;
70332   char reserved[494];
70333 };
70334 typedef struct NavDialogOptions NavDialogOptions;
70335 enum {
70336   kNavReplyRecordVersion = 2
70337 };
70338 struct NavReplyRecord {
70339
70340
70341
70342
70343
70344
70345   UInt16 version;
70346
70347
70348
70349
70350   Boolean validRecord;
70351
70352
70353
70354
70355
70356
70357
70358   Boolean replacing;
70359
70360
70361
70362
70363
70364   Boolean isStationery;
70365
70366
70367
70368
70369
70370   Boolean translationNeeded;
70371   AEDescList selection;
70372
70373
70374
70375
70376
70377   ScriptCode keyScript;
70378
70379
70380
70381
70382
70383
70384
70385   FileTranslationSpecArrayHandle fileTranslation;
70386
70387
70388
70389
70390   UInt32 reserved1;
70391
70392
70393
70394
70395
70396
70397
70398   CFStringRef saveFileName;
70399   Boolean saveFileExtensionHidden;
70400
70401
70402
70403
70404   UInt8 reserved2;
70405
70406
70407
70408
70409   char reserved[225];
70410 };
70411 typedef struct NavReplyRecord NavReplyRecord;
70412 extern OSErr
70413 NavLoad(void);
70414 extern OSErr
70415 NavUnload(void);
70416 extern UInt32
70417 NavLibraryVersion(void) ;
70418 extern OSErr
70419 NavGetDefaultDialogOptions(NavDialogOptions * dialogOptions) ;
70420 extern OSErr
70421 NavGetFile(
70422   AEDesc * defaultLocation,
70423   NavReplyRecord * reply,
70424   NavDialogOptions * dialogOptions,
70425   NavEventUPP eventProc,
70426   NavPreviewUPP previewProc,
70427   NavObjectFilterUPP filterProc,
70428   NavTypeListHandle typeList,
70429   void * callBackUD) ;
70430 extern OSErr
70431 NavPutFile(
70432   AEDesc * defaultLocation,
70433   NavReplyRecord * reply,
70434   NavDialogOptions * dialogOptions,
70435   NavEventUPP eventProc,
70436   OSType fileType,
70437   OSType fileCreator,
70438   void * callBackUD) ;
70439 extern OSErr
70440 NavAskSaveChanges(
70441   NavDialogOptions * dialogOptions,
70442   NavAskSaveChangesAction action,
70443   NavAskSaveChangesResult * reply,
70444   NavEventUPP eventProc,
70445   void * callBackUD) ;
70446 extern OSErr
70447 NavCustomAskSaveChanges(
70448   NavDialogOptions * dialogOptions,
70449   NavAskSaveChangesResult * reply,
70450   NavEventUPP eventProc,
70451   void * callBackUD) ;
70452 extern OSErr
70453 NavAskDiscardChanges(
70454   NavDialogOptions * dialogOptions,
70455   NavAskDiscardChangesResult * reply,
70456   NavEventUPP eventProc,
70457   void * callBackUD) ;
70458 extern OSErr
70459 NavChooseFile(
70460   AEDesc * defaultLocation,
70461   NavReplyRecord * reply,
70462   NavDialogOptions * dialogOptions,
70463   NavEventUPP eventProc,
70464   NavPreviewUPP previewProc,
70465   NavObjectFilterUPP filterProc,
70466   NavTypeListHandle typeList,
70467   void * callBackUD) ;
70468 extern OSErr
70469 NavChooseFolder(
70470   AEDesc * defaultLocation,
70471   NavReplyRecord * reply,
70472   NavDialogOptions * dialogOptions,
70473   NavEventUPP eventProc,
70474   NavObjectFilterUPP filterProc,
70475   void * callBackUD) ;
70476 extern OSErr
70477 NavChooseVolume(
70478   AEDesc * defaultSelection,
70479   NavReplyRecord * reply,
70480   NavDialogOptions * dialogOptions,
70481   NavEventUPP eventProc,
70482   NavObjectFilterUPP filterProc,
70483   void * callBackUD) ;
70484 extern OSErr
70485 NavChooseObject(
70486   AEDesc * defaultLocation,
70487   NavReplyRecord * reply,
70488   NavDialogOptions * dialogOptions,
70489   NavEventUPP eventProc,
70490   NavObjectFilterUPP filterProc,
70491   void * callBackUD) ;
70492 extern OSErr
70493 NavNewFolder(
70494   AEDesc * defaultLocation,
70495   NavReplyRecord * reply,
70496   NavDialogOptions * dialogOptions,
70497   NavEventUPP eventProc,
70498   void * callBackUD) ;
70499 extern OSErr
70500 NavTranslateFile(
70501   NavReplyRecord * reply,
70502   NavTranslationOptions howToTranslate) ;
70503 extern OSErr
70504 NavCompleteSave(
70505   NavReplyRecord * reply,
70506   NavTranslationOptions howToTranslate) ;
70507 extern OSErr
70508 NavCustomControl(
70509   NavDialogRef dialog,
70510   NavCustomControlMessage selector,
70511   void * parms) ;
70512 extern OSErr
70513 NavCreatePreview(
70514   AEDesc * theObject,
70515   OSType previewDataType,
70516   const void * previewData,
70517   Size previewDataSize) ;
70518 extern OSErr
70519 NavDisposeReply(NavReplyRecord * reply) ;
70520 extern Boolean
70521 NavServicesCanRun(void);
70522     inline Boolean NavServicesAvailable() { return true; }
70523 enum {
70524   kNavDialogCreationOptionsVersion = 0
70525 };
70526 struct NavDialogCreationOptions {
70527
70528
70529
70530
70531
70532   UInt16 version;
70533
70534
70535
70536
70537
70538   NavDialogOptionFlags optionFlags;
70539
70540
70541
70542
70543
70544
70545   Point location;
70546   CFStringRef clientName;
70547
70548
70549
70550
70551
70552   CFStringRef windowTitle;
70553
70554
70555
70556
70557
70558   CFStringRef actionButtonLabel;
70559
70560
70561
70562
70563
70564   CFStringRef cancelButtonLabel;
70565
70566
70567
70568
70569
70570   CFStringRef saveFileName;
70571
70572
70573
70574
70575
70576
70577   CFStringRef message;
70578   UInt32 preferenceKey;
70579
70580
70581
70582
70583
70584
70585   CFArrayRef popupExtension;
70586
70587
70588
70589
70590
70591
70592
70593   WindowModality modality;
70594
70595
70596
70597
70598
70599   WindowRef parentWindow;
70600
70601
70602
70603
70604   char reserved[16];
70605 };
70606 typedef struct NavDialogCreationOptions NavDialogCreationOptions;
70607 extern OSStatus
70608 NavGetDefaultDialogCreationOptions(NavDialogCreationOptions * outOptions) ;
70609 extern OSStatus
70610 NavCreateGetFileDialog(
70611   const NavDialogCreationOptions * inOptions,
70612   NavTypeListHandle inTypeList,
70613   NavEventUPP inEventProc,
70614   NavPreviewUPP inPreviewProc,
70615   NavObjectFilterUPP inFilterProc,
70616   void * inClientData,
70617   NavDialogRef * outDialog) ;
70618 extern OSStatus
70619 NavCreatePutFileDialog(
70620   const NavDialogCreationOptions * inOptions,
70621   OSType inFileType,
70622   OSType inFileCreator,
70623   NavEventUPP inEventProc,
70624   void * inClientData,
70625   NavDialogRef * outDialog) ;
70626 extern OSStatus
70627 NavCreateAskReviewDocumentsDialog(
70628   const NavDialogCreationOptions * inOptions,
70629   UInt32 inDocumentCount,
70630   NavEventUPP inEventProc,
70631   void * inClientData,
70632   NavDialogRef * outDialog) ;
70633 extern OSStatus
70634 NavCreateAskSaveChangesDialog(
70635   const NavDialogCreationOptions * inOptions,
70636   NavAskSaveChangesAction inAction,
70637   NavEventUPP inEventProc,
70638   void * inClientData,
70639   NavDialogRef * outDialog) ;
70640 extern OSStatus
70641 NavCreateAskDiscardChangesDialog(
70642   const NavDialogCreationOptions * inOptions,
70643   NavEventUPP inEventProc,
70644   void * inClientData,
70645   NavDialogRef * outDialog) ;
70646 extern OSStatus
70647 NavCreateChooseFileDialog(
70648   const NavDialogCreationOptions * inOptions,
70649   NavTypeListHandle inTypeList,
70650   NavEventUPP inEventProc,
70651   NavPreviewUPP inPreviewProc,
70652   NavObjectFilterUPP inFilterProc,
70653   void * inClientData,
70654   NavDialogRef * outDialog) ;
70655 extern OSStatus
70656 NavCreateChooseFolderDialog(
70657   const NavDialogCreationOptions * inOptions,
70658   NavEventUPP inEventProc,
70659   NavObjectFilterUPP inFilterProc,
70660   void * inClientData,
70661   NavDialogRef * outDialog) ;
70662 extern OSStatus
70663 NavCreateChooseVolumeDialog(
70664   const NavDialogCreationOptions * inOptions,
70665   NavEventUPP inEventProc,
70666   NavObjectFilterUPP inFilterProc,
70667   void * inClientData,
70668   NavDialogRef * outDialog) ;
70669 extern OSStatus
70670 NavCreateChooseObjectDialog(
70671   const NavDialogCreationOptions * inOptions,
70672   NavEventUPP inEventProc,
70673   NavPreviewUPP inPreviewProc,
70674   NavObjectFilterUPP inFilterProc,
70675   void * inClientData,
70676   NavDialogRef * outDialog) ;
70677 extern OSStatus
70678 NavCreateNewFolderDialog(
70679   const NavDialogCreationOptions * inOptions,
70680   NavEventUPP inEventProc,
70681   void * inClientData,
70682   NavDialogRef * outDialog) ;
70683 extern OSStatus
70684 NavDialogRun(NavDialogRef inDialog) ;
70685 extern void
70686 NavDialogDispose(NavDialogRef inDialog) ;
70687 extern WindowRef
70688 NavDialogGetWindow(NavDialogRef inDialog) ;
70689 extern NavUserAction
70690 NavDialogGetUserAction(NavDialogRef inDialog) ;
70691 extern OSStatus
70692 NavDialogGetReply(
70693   NavDialogRef inDialog,
70694   NavReplyRecord * outReply) ;
70695 extern CFStringRef
70696 NavDialogGetSaveFileName(NavDialogRef inPutFileDialog) ;
70697 extern OSStatus
70698 NavDialogSetSaveFileName(
70699   NavDialogRef inPutFileDialog,
70700   CFStringRef inFileName) ;
70701 extern Boolean
70702 NavDialogGetSaveFileExtensionHidden(NavDialogRef inPutFileDialog) ;
70703 extern OSStatus
70704 NavDialogSetSaveFileExtensionHidden(
70705   NavDialogRef inPutFileDialog,
70706   Boolean inHidden) ;
70707
70708
70709
70710
70711
70712
70713 }
70714
70715
70716
70717 extern "C" {
70718
70719
70720
70721 enum {
70722
70723   kMaximumSmallFract = 0x0000FFFF
70724 };
70725
70726 enum {
70727   kDefaultColorPickerWidth = 383,
70728   kDefaultColorPickerHeight = 238
70729 };
70730
70731 typedef SInt16 DialogPlacementSpec;
70732 enum {
70733   kAtSpecifiedOrigin = 0,
70734   kDeepestColorScreen = 1,
70735   kCenterOnMainScreen = 2
70736 };
70737
70738
70739
70740 enum {
70741   kColorPickerDialogIsMoveable = 1,
70742   kColorPickerDialogIsModal = 2,
70743   kColorPickerCanModifyPalette = 4,
70744   kColorPickerCanAnimatePalette = 8,
70745   kColorPickerAppIsColorSyncAware = 16,
70746   kColorPickerInSystemDialog = 32,
70747   kColorPickerInApplicationDialog = 64,
70748   kColorPickerInPickerDialog = 128,
70749   kColorPickerDetachedFromChoices = 256,
70750   kColorPickerCallColorProcLive = 512
70751 };
70752 typedef unsigned short SmallFract;
70753
70754
70755
70756
70757 struct HSVColor {
70758   SmallFract hue;
70759   SmallFract saturation;
70760   SmallFract value;
70761 };
70762 typedef struct HSVColor HSVColor;
70763 struct HSLColor {
70764   SmallFract hue;
70765   SmallFract saturation;
70766   SmallFract lightness;
70767 };
70768 typedef struct HSLColor HSLColor;
70769 struct CMYColor {
70770   SmallFract cyan;
70771   SmallFract magenta;
70772   SmallFract yellow;
70773 };
70774 typedef struct CMYColor CMYColor;
70775 struct PMColor {
70776   CMProfileHandle profile;
70777   CMColor color;
70778 };
70779 typedef struct PMColor PMColor;
70780 typedef PMColor * PMColorPtr;
70781 struct NPMColor {
70782   CMProfileRef profile;
70783   CMColor color;
70784 };
70785 typedef struct NPMColor NPMColor;
70786 typedef NPMColor * NPMColorPtr;
70787 typedef struct OpaquePicker* Picker;
70788 typedef Picker picker;
70789 struct PickerMenuItemInfo {
70790   short editMenuID;
70791   short cutItem;
70792   short copyItem;
70793   short pasteItem;
70794   short clearItem;
70795   short undoItem;
70796 };
70797 typedef struct PickerMenuItemInfo PickerMenuItemInfo;
70798
70799
70800
70801
70802 typedef void ( * ColorChangedProcPtr)(long userData, PMColor *newColor);
70803 typedef void ( * NColorChangedProcPtr)(long userData, NPMColor *newColor);
70804 typedef Boolean ( * UserEventProcPtr)(EventRecord * event);
70805 typedef ColorChangedProcPtr ColorChangedUPP;
70806 typedef NColorChangedProcPtr NColorChangedUPP;
70807 typedef UserEventProcPtr UserEventUPP;
70808 struct ColorPickerInfo {
70809   PMColor theColor;
70810   CMProfileHandle dstProfile;
70811   UInt32 flags;
70812   DialogPlacementSpec placeWhere;
70813   Point dialogOrigin;
70814   OSType pickerType;
70815   UserEventUPP eventProc;
70816   ColorChangedUPP colorProc;
70817   UInt32 colorProcData;
70818   Str255 prompt;
70819   PickerMenuItemInfo mInfo;
70820   Boolean newColorChosen;
70821   SInt8 filler;
70822 };
70823 typedef struct ColorPickerInfo ColorPickerInfo;
70824 struct NColorPickerInfo {
70825   NPMColor theColor;
70826   CMProfileRef dstProfile;
70827   UInt32 flags;
70828   DialogPlacementSpec placeWhere;
70829   Point dialogOrigin;
70830   OSType pickerType;
70831   UserEventUPP eventProc;
70832   NColorChangedUPP colorProc;
70833   UInt32 colorProcData;
70834   Str255 prompt;
70835   PickerMenuItemInfo mInfo;
70836   Boolean newColorChosen;
70837   UInt8 reserved;
70838 };
70839 typedef struct NColorPickerInfo NColorPickerInfo;
70840 extern SmallFract
70841 Fix2SmallFract(Fixed f);
70842 extern Fixed
70843 SmallFract2Fix(SmallFract s);
70844 extern void
70845 CMY2RGB(
70846   const CMYColor * cColor,
70847   RGBColor * rColor);
70848 extern void
70849 RGB2CMY(
70850   const RGBColor * rColor,
70851   CMYColor * cColor);
70852 extern void
70853 HSL2RGB(
70854   const HSLColor * hColor,
70855   RGBColor * rColor);
70856 extern void
70857 RGB2HSL(
70858   const RGBColor * rColor,
70859   HSLColor * hColor);
70860 extern void
70861 HSV2RGB(
70862   const HSVColor * hColor,
70863   RGBColor * rColor);
70864 extern void
70865 RGB2HSV(
70866   const RGBColor * rColor,
70867   HSVColor * hColor);
70868 extern Boolean
70869 GetColor(
70870   Point where,
70871   ConstStr255Param prompt,
70872   const RGBColor * inColor,
70873   RGBColor * outColor);
70874 extern OSErr
70875 PickColor(ColorPickerInfo * theColorInfo);
70876 extern OSErr
70877 NPickColor(NColorPickerInfo * theColorInfo);
70878 extern ColorChangedUPP
70879 NewColorChangedUPP(ColorChangedProcPtr userRoutine);
70880 extern NColorChangedUPP
70881 NewNColorChangedUPP(NColorChangedProcPtr userRoutine);
70882 extern UserEventUPP
70883 NewUserEventUPP(UserEventProcPtr userRoutine);
70884 extern void
70885 DisposeColorChangedUPP(ColorChangedUPP userUPP);
70886 extern void
70887 DisposeNColorChangedUPP(NColorChangedUPP userUPP);
70888 extern void
70889 DisposeUserEventUPP(UserEventUPP userUPP);
70890 extern void
70891 InvokeColorChangedUPP(
70892   long userData,
70893   PMColor * newColor,
70894   ColorChangedUPP userUPP);
70895 extern void
70896 InvokeNColorChangedUPP(
70897   long userData,
70898   NPMColor * newColor,
70899   NColorChangedUPP userUPP);
70900 extern Boolean
70901 InvokeUserEventUPP(
70902   EventRecord * event,
70903   UserEventUPP userUPP);
70904
70905
70906
70907
70908
70909 }
70910
70911
70912
70913 extern "C" {
70914
70915
70916
70917 typedef void ( * CalibrateEventProcPtr)(EventRecord * event);
70918 typedef CalibrateEventProcPtr CalibrateEventUPP;
70919
70920
70921
70922 enum {
70923   kCalibratorNamePrefix = 'cali'
70924 };
70925
70926 struct CalibratorInfo {
70927   UInt32 dataSize;
70928   CMDisplayIDType displayID;
70929   UInt32 profileLocationSize;
70930   CMProfileLocation * profileLocationPtr;
70931   CalibrateEventUPP eventProc;
70932   Boolean isGood;
70933 };
70934 typedef struct CalibratorInfo CalibratorInfo;
70935 typedef Boolean ( * CanCalibrateProcPtr)(CMDisplayIDType displayID, Str255 errMessage);
70936 typedef OSErr ( * CalibrateProcPtr)(CalibratorInfo * theInfo);
70937 typedef CanCalibrateProcPtr CanCalibrateUPP;
70938 typedef CalibrateProcPtr CalibrateUPP;
70939 extern CalibrateEventUPP
70940 NewCalibrateEventUPP(CalibrateEventProcPtr userRoutine) ;
70941 extern CanCalibrateUPP
70942 NewCanCalibrateUPP(CanCalibrateProcPtr userRoutine);
70943 extern CalibrateUPP
70944 NewCalibrateUPP(CalibrateProcPtr userRoutine);
70945 extern void
70946 DisposeCalibrateEventUPP(CalibrateEventUPP userUPP) ;
70947 extern void
70948 DisposeCanCalibrateUPP(CanCalibrateUPP userUPP);
70949 extern void
70950 DisposeCalibrateUPP(CalibrateUPP userUPP);
70951 extern void
70952 InvokeCalibrateEventUPP(
70953   EventRecord * event,
70954   CalibrateEventUPP userUPP) ;
70955 extern Boolean
70956 InvokeCanCalibrateUPP(
70957   CMDisplayIDType displayID,
70958   Str255 errMessage,
70959   CanCalibrateUPP userUPP);
70960 extern OSErr
70961 InvokeCalibrateUPP(
70962   CalibratorInfo * theInfo,
70963   CalibrateUPP userUPP);
70964 extern OSErr
70965 CMCalibrateDisplay(CalibratorInfo * theInfo) ;
70966
70967
70968
70969
70970
70971
70972 }
70973
70974
70975
70976 extern "C" {
70977
70978
70979
70980 typedef UInt32 NSLDialogOptionFlags;
70981 enum {
70982   kNSLDefaultNSLDlogOptions = 0x00000000,
70983   kNSLNoURLTEField = 0x00000001,
70984   kNSLAddServiceTypes = 0x00000002,
70985   kNSLClientHandlesRecents = 0x00000004
70986 };
70987
70988
70989 struct NSLDialogOptions {
70990   UInt16 version;
70991   NSLDialogOptionFlags dialogOptionFlags;
70992   Str255 windowTitle;
70993   Str255 actionButtonLabel;
70994   Str255 cancelButtonLabel;
70995   Str255 message;
70996 };
70997 typedef struct NSLDialogOptions NSLDialogOptions;
70998 typedef Boolean ( * NSLURLFilterProcPtr)(char *url, Str255 displayString);
70999
71000 typedef void ( * NSLEventProcPtr)(EventRecord *newEvent, void *userContext);
71001 typedef NSLURLFilterProcPtr NSLURLFilterUPP;
71002 typedef NSLEventProcPtr NSLEventUPP;
71003 extern NSLURLFilterUPP
71004 NewNSLURLFilterUPP(NSLURLFilterProcPtr userRoutine);
71005 extern NSLEventUPP
71006 NewNSLEventUPP(NSLEventProcPtr userRoutine);
71007 extern void
71008 DisposeNSLURLFilterUPP(NSLURLFilterUPP userUPP);
71009 extern void
71010 DisposeNSLEventUPP(NSLEventUPP userUPP);
71011 extern Boolean
71012 InvokeNSLURLFilterUPP(
71013   char * url,
71014   Str255 displayString,
71015   NSLURLFilterUPP userUPP);
71016 extern void
71017 InvokeNSLEventUPP(
71018   EventRecord * newEvent,
71019   void * userContext,
71020   NSLEventUPP userUPP);
71021 extern OSStatus
71022 NSLStandardGetURL(
71023   NSLDialogOptions * dialogOptions,
71024   NSLEventUPP eventProc,
71025   void * eventProcContextPtr,
71026   NSLURLFilterUPP filterProc,
71027   char * serviceTypeList,
71028   char ** userSelectedURL);
71029 extern OSStatus
71030 NSLGetDefaultDialogOptions(NSLDialogOptions * dialogOptions);
71031 extern char *
71032 NSLFreeURL(char * url);
71033 extern OSErr
71034 NSLSaveURLAliasToFolder(
71035   OSType folderSelectorType,
71036   const char * url,
71037   const char * userFriendlyName);
71038
71039
71040
71041
71042
71043
71044
71045 }
71046
71047
71048
71049
71050
71051
71052
71053 extern "C" {
71054
71055
71056 enum {
71057
71058
71059
71060
71061   kEventClassFont = 'font'
71062 };
71063
71064
71065
71066
71067
71068
71069 enum {
71070
71071
71072
71073
71074
71075
71076
71077   kHICommandShowHideFontPanel = 'shfp'
71078 };
71079 enum {
71080
71081
71082
71083
71084
71085   kEventFontPanelClosed = 1,
71086   kEventFontSelection = 2
71087 };
71088 enum {
71089   typeATSUFontID = typeUInt32,
71090   typeATSUSize = typeFixed,
71091   typeFMFontFamily = typeSInt16,
71092   typeFMFontStyle = typeSInt16,
71093   typeFMFontSize = typeSInt16,
71094   typeFontColor = typeRGBColor,
71095   kEventParamATSUFontID = 'auid',
71096   kEventParamATSUFontSize = 'ausz',
71097   kEventParamFMFontFamily = 'fmfm',
71098   kEventParamFMFontStyle = 'fmst',
71099   kEventParamFMFontSize = 'fmsz',
71100   kEventParamFontColor = 'fclr'
71101 };
71102 enum {
71103   fontPanelShowErr = -8880,
71104   fontPanelSelectionStyleErr = -8881,
71105   fontPanelFontSelectionQDStyleVersionErr = -8882
71106 };
71107
71108
71109
71110
71111
71112
71113 enum {
71114   kFontSelectionATSUIType = 'astl',
71115   kFontSelectionQDType = 'qstl'
71116 };
71117
71118
71119
71120
71121
71122 enum {
71123   kFontSelectionQDStyleVersionZero = 0
71124 };
71125 struct FontSelectionQDStyle {
71126   UInt32 version;
71127   FMFontFamilyInstance instance;
71128   FMFontSize size;
71129   Boolean hasColor;
71130   UInt8 reserved;
71131   RGBColor color;
71132 };
71133 typedef struct FontSelectionQDStyle FontSelectionQDStyle;
71134 typedef FontSelectionQDStyle * FontSelectionQDStylePtr;
71135 extern Boolean
71136 FPIsFontPanelVisible(void) ;
71137 extern OSStatus
71138 FPShowHideFontPanel(void) ;
71139 extern OSStatus
71140 SetFontInfoForSelection(
71141   OSType iStyleType,
71142   UInt32 iNumStyles,
71143   void * iStyles,
71144   HIObjectRef iFPEventTarget) ;
71145
71146
71147
71148
71149
71150 }
71151
71152
71153
71154 extern "C" {
71155
71156
71157 typedef struct OpaqueHRReference* HRReference;
71158 extern OSStatus
71159 HRGetHTMLRenderingLibVersion(NumVersion * returnVers) ;
71160     inline Boolean HRHTMLRenderingLibAvailable() { return true; }
71161
71162
71163
71164
71165
71166 enum {
71167   kHRRendererHTML32Type = 'ht32'
71168 };
71169 extern OSStatus
71170 HRNewReference(
71171   HRReference * hrRef,
71172   OSType rendererType,
71173   GrafPtr grafPtr) ;
71174 extern OSStatus
71175 HRNewReferenceInWindow(
71176   HRReference * hrRef,
71177   OSType rendererType,
71178   WindowRef inWindowRef) ;
71179 extern OSStatus
71180 HRDisposeReference(HRReference hrRef) ;
71181 extern SInt32
71182 HRFreeMemory(Size inBytesNeeded) ;
71183 extern void
71184 HRScreenConfigurationChanged(void) ;
71185 extern Boolean
71186 HRIsHREvent(const EventRecord * eventRecord) ;
71187 extern OSStatus
71188 HRSetGrafPtr(
71189   HRReference hrRef,
71190   GrafPtr grafPtr) ;
71191 extern OSStatus
71192 HRSetWindowRef(
71193   HRReference hrRef,
71194   WindowRef windowRef) ;
71195 extern OSStatus
71196 HRSetEmbeddingControl(
71197   HRReference hrRef,
71198   ControlRef controlRef) ;
71199 extern OSStatus
71200 HRActivate(HRReference hrRef) ;
71201 extern OSStatus
71202 HRDeactivate(HRReference hrRef) ;
71203 extern OSStatus
71204 HRDraw(
71205   HRReference hrRef,
71206   RgnHandle updateRgnH) ;
71207 extern OSStatus
71208 HRDrawInPort(
71209   HRReference hrRef,
71210   RgnHandle updateRgnH,
71211   CGrafPtr grafPtr) ;
71212 extern OSStatus
71213 HRSetRenderingRect(
71214   HRReference hrRef,
71215   const Rect * renderingRect) ;
71216 extern OSStatus
71217 HRGetRenderedImageSize(
71218   HRReference hrRef,
71219   Point * renderingSize) ;
71220 extern OSStatus
71221 HRGetRenderedImageSize32(
71222   HRReference hrRef,
71223   UInt32 * height,
71224   UInt32 * width) ;
71225 extern OSStatus
71226 HRScrollToLocation(
71227   HRReference hrRef,
71228   Point * location) ;
71229 extern OSStatus
71230 HRScrollToImageLocation32(
71231   HRReference hrRef,
71232   SInt32 h,
71233   SInt32 v) ;
71234 extern OSStatus
71235 HRForceQuickdraw(
71236   HRReference hrRef,
71237   Boolean forceQuickdraw) ;
71238
71239
71240 typedef SInt16 HRScrollbarState;
71241 enum {
71242   eHRScrollbarOn = 0,
71243   eHRScrollbarOff = 1,
71244   eHRScrollbarAuto = 2
71245 };
71246 extern OSStatus
71247 HRSetScrollbarState(
71248   HRReference hrRef,
71249   HRScrollbarState hScrollbarState,
71250   HRScrollbarState vScrollbarState) ;
71251 extern OSStatus
71252 HRSetDrawBorder(
71253   HRReference hrRef,
71254   Boolean drawBorder) ;
71255 extern OSStatus
71256 HRSetGrowboxCutout(
71257   HRReference hrRef,
71258   Boolean allowCutout) ;
71259 extern OSStatus
71260 HRGoToFile(
71261   HRReference hrRef,
71262   const FSSpec * fsspec,
71263   Boolean addToHistory,
71264   Boolean forceRefresh) ;
71265 extern OSStatus
71266 HRGoToURL(
71267   HRReference hrRef,
71268   const char * url,
71269   Boolean addToHistory,
71270   Boolean forceRefresh) ;
71271 extern OSStatus
71272 HRGoToAnchor(
71273   HRReference hrRef,
71274   const char * anchorName) ;
71275 extern OSStatus
71276 HRGoToPtr(
71277   HRReference hrRef,
71278   char * buffer,
71279   UInt32 bufferSize,
71280   Boolean addToHistory,
71281   Boolean forceRefresh) ;
71282 extern OSStatus
71283 HRGoToFSRef(
71284   HRReference hrRef,
71285   const FSRef * fref,
71286   Boolean addToHistory,
71287   Boolean forceRefresh) ;
71288 extern OSStatus
71289 HRGoToCFURL(
71290   HRReference hrRef,
71291   CFURLRef url,
71292   Boolean addToHistory,
71293   Boolean forceRefresh) ;
71294 extern OSStatus
71295 HRGoToAnchorCFString(
71296   HRReference hrRef,
71297   CFStringRef anchorName) ;
71298 extern OSStatus
71299 HRGoToData(
71300   HRReference hrRef,
71301   CFDataRef data,
71302   Boolean addToHistory,
71303   Boolean forceRefresh) ;
71304 extern OSStatus
71305 HRGetRootURL(
71306   HRReference hrRef,
71307   Handle rootURLH) ;
71308 extern OSStatus
71309 HRGetBaseURL(
71310   HRReference hrRef,
71311   Handle baseURLH) ;
71312 extern OSStatus
71313 HRGetHTMLURL(
71314   HRReference hrRef,
71315   Handle HTMLURLH) ;
71316 extern OSStatus
71317 HRGetTitle(
71318   HRReference hrRef,
71319   StringPtr title) ;
71320 extern OSStatus
71321 HRGetHTMLFile(
71322   HRReference hrRef,
71323   FSSpec * fsspec) ;
71324 extern OSStatus
71325 HRGetRootURLAsCFString(
71326   HRReference hrRef,
71327   CFStringRef * rootString) ;
71328 extern OSStatus
71329 HRGetBaseURLAsCFString(
71330   HRReference hrRef,
71331   CFStringRef * baseString) ;
71332 extern OSStatus
71333 HRGetHTMLURLAsCFURL(
71334   HRReference hrRef,
71335   CFURLRef * theURL) ;
71336 extern OSStatus
71337 HRGetTitleAsCFString(
71338   HRReference hrRef,
71339   CFStringRef * title) ;
71340 extern OSStatus
71341 HRGetHTMLFileAsFSRef(
71342   HRReference hrRef,
71343   FSRef * fref) ;
71344 extern OSStatus
71345 HRUtilCreateFullURL(
71346   const char * rootURL,
71347   const char * linkURL,
71348   Handle fullURLH) ;
71349 extern OSStatus
71350 HRUtilGetFSSpecFromURL(
71351   const char * rootURL,
71352   const char * linkURL,
71353   FSSpec * destSpec) ;
71354 extern OSStatus
71355 HRUtilGetURLFromFSSpec(
71356   const FSSpec * fsspec,
71357   Handle urlHandle) ;
71358 extern OSStatus
71359 HRUtilCreateFullCFURL(
71360   CFStringRef rootString,
71361   CFStringRef linkString,
71362   CFURLRef * url) ;
71363 extern OSStatus
71364 HRUtilGetFSRefFromURL(
71365   CFStringRef rootString,
71366   CFStringRef linkString,
71367   FSRef * destRef) ;
71368 extern OSStatus
71369 HRUtilGetURLFromFSRef(
71370   const FSRef * fileRef,
71371   CFURLRef * url) ;
71372 typedef Boolean ( * HRWasURLVisitedProcPtr)(const char *url, void *refCon);
71373 typedef HRWasURLVisitedProcPtr HRWasURLVisitedUPP;
71374 extern void
71375 HRRegisterWasURLVisitedUPP(
71376   HRWasURLVisitedUPP inWasURLVisitedUPP,
71377   HRReference hrRef,
71378   void * inRefCon) ;
71379 extern void
71380 HRUnregisterWasURLVisitedUPP(HRReference hrRef) ;
71381 typedef Boolean ( * HRWasCFURLVisitedProcPtr)(CFURLRef url, void *refCon);
71382 typedef HRWasCFURLVisitedProcPtr HRWasCFURLVisitedUPP;
71383 extern void
71384 HRRegisterWasCFURLVisitedUPP(
71385   HRWasCFURLVisitedUPP inWasCFURLVisitedUPP,
71386   HRReference hrRef,
71387   void * inRefCon) ;
71388 extern void
71389 HRUnregisterWasCFURLVisitedUPP(HRReference hrRef) ;
71390 typedef OSStatus ( * HRNewURLProcPtr)(const char *url, const char *targetFrame, Boolean addToHistory, void *refCon);
71391 typedef HRNewURLProcPtr HRNewURLUPP;
71392 extern void
71393 HRRegisterNewURLUPP(
71394   HRNewURLUPP inNewURLUPP,
71395   HRReference hrRef,
71396   void * inRefCon) ;
71397 extern void
71398 HRUnregisterNewURLUPP(HRReference hrRef) ;
71399 typedef OSStatus ( * HRNewCFURLProcPtr)(CFURLRef url, CFStringRef targetString, Boolean addToHistory, void *refCon);
71400 typedef HRNewCFURLProcPtr HRNewCFURLUPP;
71401 extern void
71402 HRRegisterNewCFURLUPP(
71403   HRNewCFURLUPP inURLUPP,
71404   HRReference hrRef,
71405   void * inRefCon) ;
71406 extern void
71407 HRUnregisterNewCFURLUPP(HRReference hrRef) ;
71408 typedef UInt16 URLSourceType;
71409 enum {
71410   kHRLookingForHTMLSource = 1,
71411   kHRLookingForImage = 2,
71412   kHRLookingForEmbedded = 3,
71413   kHRLookingForImageMap = 4,
71414   kHRLookingForFrame = 5
71415 };
71416
71417 typedef OSStatus ( * HRURLToFSSpecProcPtr)(const char *rootURL, const char *linkURL, FSSpec *fsspec, URLSourceType urlSourceType, void *refCon);
71418 typedef HRURLToFSSpecProcPtr HRURLToFSSpecUPP;
71419 extern void
71420 HRRegisterURLToFSSpecUPP(
71421   HRURLToFSSpecUPP inURLToFSSpecUPP,
71422   HRReference hrRef,
71423   void * inRefCon) ;
71424 extern void
71425 HRUnregisterURLToFSSpecUPP(HRReference hrRef) ;
71426 typedef OSStatus ( * HRURLToFSRefProcPtr)(CFStringRef rootString, CFStringRef linkString, FSRef *fref, URLSourceType urlSourceType, void *refCon);
71427 typedef HRURLToFSRefProcPtr HRURLToFSRefUPP;
71428 extern void
71429 HRRegisterURLToFSRefUPP(
71430   HRURLToFSRefUPP inURLToFSRefUPP,
71431   HRReference hrRef,
71432   void * inRefCon) ;
71433 extern void
71434 HRUnregisterURLToFSRefUPP(HRReference hrRef) ;
71435 extern HRWasURLVisitedUPP
71436 NewHRWasURLVisitedUPP(HRWasURLVisitedProcPtr userRoutine) ;
71437 extern HRWasCFURLVisitedUPP
71438 NewHRWasCFURLVisitedUPP(HRWasCFURLVisitedProcPtr userRoutine) ;
71439 extern HRNewURLUPP
71440 NewHRNewURLUPP(HRNewURLProcPtr userRoutine) ;
71441 extern HRNewCFURLUPP
71442 NewHRNewCFURLUPP(HRNewCFURLProcPtr userRoutine) ;
71443 extern HRURLToFSSpecUPP
71444 NewHRURLToFSSpecUPP(HRURLToFSSpecProcPtr userRoutine) ;
71445 extern HRURLToFSRefUPP
71446 NewHRURLToFSRefUPP(HRURLToFSRefProcPtr userRoutine) ;
71447 extern void
71448 DisposeHRWasURLVisitedUPP(HRWasURLVisitedUPP userUPP) ;
71449 extern void
71450 DisposeHRWasCFURLVisitedUPP(HRWasCFURLVisitedUPP userUPP) ;
71451 extern void
71452 DisposeHRNewURLUPP(HRNewURLUPP userUPP) ;
71453 extern void
71454 DisposeHRNewCFURLUPP(HRNewCFURLUPP userUPP) ;
71455 extern void
71456 DisposeHRURLToFSSpecUPP(HRURLToFSSpecUPP userUPP) ;
71457 extern void
71458 DisposeHRURLToFSRefUPP(HRURLToFSRefUPP userUPP) ;
71459 extern Boolean
71460 InvokeHRWasURLVisitedUPP(
71461   const char * url,
71462   void * refCon,
71463   HRWasURLVisitedUPP userUPP) ;
71464 extern Boolean
71465 InvokeHRWasCFURLVisitedUPP(
71466   CFURLRef url,
71467   void * refCon,
71468   HRWasCFURLVisitedUPP userUPP) ;
71469 extern OSStatus
71470 InvokeHRNewURLUPP(
71471   const char * url,
71472   const char * targetFrame,
71473   Boolean addToHistory,
71474   void * refCon,
71475   HRNewURLUPP userUPP) ;
71476 extern OSStatus
71477 InvokeHRNewCFURLUPP(
71478   CFURLRef url,
71479   CFStringRef targetString,
71480   Boolean addToHistory,
71481   void * refCon,
71482   HRNewCFURLUPP userUPP) ;
71483 extern OSStatus
71484 InvokeHRURLToFSSpecUPP(
71485   const char * rootURL,
71486   const char * linkURL,
71487   FSSpec * fsspec,
71488   URLSourceType urlSourceType,
71489   void * refCon,
71490   HRURLToFSSpecUPP userUPP) ;
71491 extern OSStatus
71492 InvokeHRURLToFSRefUPP(
71493   CFStringRef rootString,
71494   CFStringRef linkString,
71495   FSRef * fref,
71496   URLSourceType urlSourceType,
71497   void * refCon,
71498   HRURLToFSRefUPP userUPP) ;
71499
71500
71501
71502 }
71503
71504
71505
71506 extern "C" {
71507
71508
71509
71510
71511 enum {
71512   kSRNotAvailable = -5100,
71513   kSRInternalError = -5101,
71514   kSRComponentNotFound = -5102,
71515   kSROutOfMemory = -5103,
71516   kSRNotASpeechObject = -5104,
71517   kSRBadParameter = -5105,
71518   kSRParamOutOfRange = -5106,
71519   kSRBadSelector = -5107,
71520   kSRBufferTooSmall = -5108,
71521   kSRNotARecSystem = -5109,
71522   kSRFeedbackNotAvail = -5110,
71523   kSRCantSetProperty = -5111,
71524   kSRCantGetProperty = -5112,
71525   kSRCantSetDuringRecognition = -5113,
71526   kSRAlreadyListening = -5114,
71527   kSRNotListeningState = -5115,
71528   kSRModelMismatch = -5116,
71529   kSRNoClientLanguageModel = -5117,
71530   kSRNoPendingUtterances = -5118,
71531   kSRRecognitionCanceled = -5119,
71532   kSRRecognitionDone = -5120,
71533   kSROtherRecAlreadyModal = -5121,
71534   kSRHasNoSubItems = -5122,
71535   kSRSubItemNotFound = -5123,
71536   kSRLanguageModelTooBig = -5124,
71537   kSRAlreadyReleased = -5125,
71538   kSRAlreadyFinished = -5126,
71539   kSRWordNotFound = -5127,
71540   kSRNotFinishedWithRejection = -5128,
71541   kSRExpansionTooDeep = -5129,
71542   kSRTooManyElements = -5130,
71543   kSRCantAdd = -5131,
71544   kSRSndInSourceDisconnected = -5132,
71545   kSRCantReadLanguageObject = -5133,
71546
71547   kSRNotImplementedYet = -5199
71548 };
71549
71550
71551
71552 typedef struct OpaqueSRSpeechObject* SRSpeechObject;
71553 typedef SRSpeechObject SRRecognitionSystem;
71554 typedef SRSpeechObject SRRecognizer;
71555 typedef SRSpeechObject SRSpeechSource;
71556 typedef SRSpeechSource SRRecognitionResult;
71557 typedef SRSpeechObject SRLanguageObject;
71558 typedef SRLanguageObject SRLanguageModel;
71559 typedef SRLanguageObject SRPath;
71560 typedef SRLanguageObject SRPhrase;
71561 typedef SRLanguageObject SRWord;
71562
71563 typedef unsigned short SRSpeedSetting;
71564
71565 typedef unsigned short SRRejectionLevel;
71566
71567
71568
71569 struct SRCallBackStruct {
71570   long what;
71571   long message;
71572   SRRecognizer instance;
71573   OSErr status;
71574   short flags;
71575   long refCon;
71576 };
71577 typedef struct SRCallBackStruct SRCallBackStruct;
71578
71579 typedef void ( * SRCallBackProcPtr)(SRCallBackStruct * param);
71580 typedef SRCallBackProcPtr SRCallBackUPP;
71581 extern SRCallBackUPP
71582 NewSRCallBackUPP(SRCallBackProcPtr userRoutine) ;
71583 extern void
71584 DisposeSRCallBackUPP(SRCallBackUPP userUPP) ;
71585 extern void
71586 InvokeSRCallBackUPP(
71587   SRCallBackStruct * param,
71588   SRCallBackUPP userUPP) ;
71589
71590 struct SRCallBackParam {
71591   SRCallBackUPP callBack;
71592   long refCon;
71593 };
71594 typedef struct SRCallBackParam SRCallBackParam;
71595
71596 enum {
71597   kSRDefaultRecognitionSystemID = 0
71598 };
71599
71600
71601 enum {
71602   kSRFeedbackAndListeningModes = 'fbwn',
71603   kSRRejectedWord = 'rejq',
71604   kSRCleanupOnClientExit = 'clup'
71605 };
71606
71607 enum {
71608   kSRNoFeedbackNoListenModes = 0,
71609   kSRHasFeedbackHasListenModes = 1,
71610   kSRNoFeedbackHasListenModes = 2
71611 };
71612
71613
71614 enum {
71615   kSRDefaultSpeechSource = 0,
71616   kSRLiveDesktopSpeechSource = 'dklv',
71617   kSRCanned22kHzSpeechSource = 'ca22'
71618 };
71619
71620
71621
71622 enum {
71623   kSRNotifyRecognitionBeginning = 1L << 0,
71624   kSRNotifyRecognitionDone = 1L << 1
71625 };
71626
71627
71628
71629 enum {
71630   kAESpeechSuite = 'sprc'
71631 };
71632
71633
71634 enum {
71635   kAESpeechDone = 'srsd',
71636   kAESpeechDetected = 'srbd'
71637 };
71638
71639
71640 enum {
71641   keySRRecognizer = 'krec',
71642   keySRSpeechResult = 'kspr',
71643   keySRSpeechStatus = 'ksst'
71644 };
71645
71646
71647 enum {
71648   typeSRRecognizer = 'trec',
71649   typeSRSpeechResult = 'tspr'
71650 };
71651
71652
71653
71654 enum {
71655   kSRNotificationParam = 'noti',
71656   kSRCallBackParam = 'call',
71657   kSRSearchStatusParam = 'stat',
71658   kSRAutoFinishingParam = 'afin',
71659   kSRForegroundOnly = 'fgon',
71660   kSRBlockBackground = 'blbg',
71661   kSRBlockModally = 'blmd',
71662   kSRWantsResultTextDrawn = 'txfb',
71663   kSRWantsAutoFBGestures = 'dfbr',
71664   kSRSoundInVolume = 'volu',
71665   kSRReadAudioFSSpec = 'aurd',
71666   kSRCancelOnSoundOut = 'caso',
71667   kSRSpeedVsAccuracyParam = 'sped'
71668 };
71669
71670
71671
71672 enum {
71673   kSRUseToggleListen = 0,
71674   kSRUsePushToTalk = 1
71675 };
71676
71677 enum {
71678   kSRListenKeyMode = 'lkmd',
71679   kSRListenKeyCombo = 'lkey',
71680   kSRListenKeyName = 'lnam',
71681   kSRKeyWord = 'kwrd',
71682   kSRKeyExpected = 'kexp'
71683 };
71684
71685
71686 enum {
71687   kSRIdleRecognizer = 1L << 0,
71688   kSRSearchInProgress = 1L << 1,
71689   kSRSearchWaitForAllClients = 1L << 2,
71690   kSRMustCancelSearch = 1L << 3,
71691   kSRPendingSearch = 1L << 4
71692 };
71693
71694
71695 enum {
71696   kSRTEXTFormat = 'TEXT',
71697   kSRPhraseFormat = 'lmph',
71698   kSRPathFormat = 'lmpt',
71699   kSRLanguageModelFormat = 'lmfm'
71700 };
71701
71702
71703 enum {
71704   kSRSpelling = 'spel',
71705   kSRLMObjType = 'lmtp',
71706   kSRRefCon = 'refc',
71707   kSROptional = 'optl',
71708   kSREnabled = 'enbl',
71709   kSRRepeatable = 'rptb',
71710   kSRRejectable = 'rjbl',
71711
71712   kSRRejectionLevel = 'rjct'
71713 };
71714
71715
71716 enum {
71717   kSRLanguageModelType = 'lmob',
71718   kSRPathType = 'path',
71719   kSRPhraseType = 'phra',
71720   kSRWordType = 'word'
71721 };
71722
71723
71724 enum {
71725   kSRDefaultRejectionLevel = 50
71726 };
71727 extern OSErr
71728 SROpenRecognitionSystem(
71729   SRRecognitionSystem * system,
71730   OSType systemID) ;
71731 extern OSErr
71732 SRCloseRecognitionSystem(SRRecognitionSystem system) ;
71733 extern OSErr
71734 SRSetProperty(
71735   SRSpeechObject srObject,
71736   OSType selector,
71737   const void * property,
71738   Size propertyLen) ;
71739 extern OSErr
71740 SRGetProperty(
71741   SRSpeechObject srObject,
71742   OSType selector,
71743   void * property,
71744   Size * propertyLen) ;
71745 extern OSErr
71746 SRReleaseObject(SRSpeechObject srObject) ;
71747 extern OSErr
71748 SRGetReference(
71749   SRSpeechObject srObject,
71750   SRSpeechObject * newObjectRef) ;
71751 extern OSErr
71752 SRNewRecognizer(
71753   SRRecognitionSystem system,
71754   SRRecognizer * recognizer,
71755   OSType sourceID) ;
71756 extern OSErr
71757 SRStartListening(SRRecognizer recognizer) ;
71758 extern OSErr
71759 SRStopListening(SRRecognizer recognizer) ;
71760 extern OSErr
71761 SRSetLanguageModel(
71762   SRRecognizer recognizer,
71763   SRLanguageModel languageModel) ;
71764 extern OSErr
71765 SRGetLanguageModel(
71766   SRRecognizer recognizer,
71767   SRLanguageModel * languageModel) ;
71768 extern OSErr
71769 SRContinueRecognition(SRRecognizer recognizer) ;
71770 extern OSErr
71771 SRCancelRecognition(SRRecognizer recognizer) ;
71772 extern OSErr
71773 SRIdle(void) ;
71774 extern OSErr
71775 SRNewLanguageModel(
71776   SRRecognitionSystem system,
71777   SRLanguageModel * model,
71778   const void * name,
71779   Size nameLength) ;
71780 extern OSErr
71781 SRNewPath(
71782   SRRecognitionSystem system,
71783   SRPath * path) ;
71784 extern OSErr
71785 SRNewPhrase(
71786   SRRecognitionSystem system,
71787   SRPhrase * phrase,
71788   const void * text,
71789   Size textLength) ;
71790 extern OSErr
71791 SRNewWord(
71792   SRRecognitionSystem system,
71793   SRWord * word,
71794   const void * text,
71795   Size textLength) ;
71796 extern OSErr
71797 SRPutLanguageObjectIntoHandle(
71798   SRLanguageObject languageObject,
71799   Handle lobjHandle) ;
71800 extern OSErr
71801 SRPutLanguageObjectIntoDataFile(
71802   SRLanguageObject languageObject,
71803   short fRefNum) ;
71804 extern OSErr
71805 SRNewLanguageObjectFromHandle(
71806   SRRecognitionSystem system,
71807   SRLanguageObject * languageObject,
71808   Handle lObjHandle) ;
71809 extern OSErr
71810 SRNewLanguageObjectFromDataFile(
71811   SRRecognitionSystem system,
71812   SRLanguageObject * languageObject,
71813   short fRefNum) ;
71814 extern OSErr
71815 SREmptyLanguageObject(SRLanguageObject languageObject) ;
71816 extern OSErr
71817 SRChangeLanguageObject(
71818   SRLanguageObject languageObject,
71819   const void * text,
71820   Size textLength) ;
71821 extern OSErr
71822 SRAddLanguageObject(
71823   SRLanguageObject base,
71824   SRLanguageObject addon) ;
71825 extern OSErr
71826 SRAddText(
71827   SRLanguageObject base,
71828   const void * text,
71829   Size textLength,
71830   long refCon) ;
71831 extern OSErr
71832 SRRemoveLanguageObject(
71833   SRLanguageObject base,
71834   SRLanguageObject toRemove) ;
71835 extern OSErr
71836 SRCountItems(
71837   SRSpeechObject container,
71838   long * count) ;
71839 extern OSErr
71840 SRGetIndexedItem(
71841   SRSpeechObject container,
71842   SRSpeechObject * item,
71843   long index) ;
71844 extern OSErr
71845 SRSetIndexedItem(
71846   SRSpeechObject container,
71847   SRSpeechObject item,
71848   long index) ;
71849 extern OSErr
71850 SRRemoveIndexedItem(
71851   SRSpeechObject container,
71852   long index) ;
71853 extern OSErr
71854 SRDrawText(
71855   SRRecognizer recognizer,
71856   const void * dispText,
71857   Size dispLength) ;
71858 extern OSErr
71859 SRDrawRecognizedText(
71860   SRRecognizer recognizer,
71861   const void * dispText,
71862   Size dispLength) ;
71863 extern OSErr
71864 SRSpeakText(
71865   SRRecognizer recognizer,
71866   const void * speakText,
71867   Size speakLength) ;
71868 extern OSErr
71869 SRSpeakAndDrawText(
71870   SRRecognizer recognizer,
71871   const void * text,
71872   Size textLength) ;
71873 extern OSErr
71874 SRStopSpeech(SRRecognizer recognizer) ;
71875 extern Boolean
71876 SRSpeechBusy(SRRecognizer recognizer) ;
71877 extern OSErr
71878 SRProcessBegin(
71879   SRRecognizer recognizer,
71880   Boolean failed) ;
71881 extern OSErr
71882 SRProcessEnd(
71883   SRRecognizer recognizer,
71884   Boolean failed) ;
71885
71886
71887
71888
71889
71890
71891
71892 }
71893
71894
71895
71896 extern "C" {
71897 extern OSStatus
71898 KCAddAppleSharePassword(
71899   AFPServerSignature * serverSignature,
71900   StringPtr serverAddress,
71901   StringPtr serverName,
71902   StringPtr volumeName,
71903   StringPtr accountName,
71904   UInt32 passwordLength,
71905   const void * passwordData,
71906   KCItemRef * item) ;
71907 extern OSStatus
71908 KCAddInternetPassword(
71909   StringPtr serverName,
71910   StringPtr securityDomain,
71911   StringPtr accountName,
71912   UInt16 port,
71913   OSType protocol,
71914   OSType authType,
71915   UInt32 passwordLength,
71916   const void * passwordData,
71917   KCItemRef * item) ;
71918 extern OSStatus
71919 KCAddInternetPasswordWithPath(
71920   StringPtr serverName,
71921   StringPtr securityDomain,
71922   StringPtr accountName,
71923   StringPtr path,
71924   UInt16 port,
71925   OSType protocol,
71926   OSType authType,
71927   UInt32 passwordLength,
71928   const void * passwordData,
71929   KCItemRef * item) ;
71930 extern OSStatus
71931 KCAddGenericPassword(
71932   StringPtr serviceName,
71933   StringPtr accountName,
71934   UInt32 passwordLength,
71935   const void * passwordData,
71936   KCItemRef * item) ;
71937 extern OSStatus
71938 KCAddItem(KCItemRef item) ;
71939 extern OSStatus
71940 KCUnlock(
71941   KCRef keychain,
71942   StringPtr password) ;
71943 extern OSStatus
71944 KCCreateKeychain(
71945   StringPtr password,
71946   KCRef * keychain) ;
71947 extern OSStatus
71948 KCChangeSettings(KCRef keychain) ;
71949 extern OSStatus
71950 kcunlock(
71951   KCRef keychain,
71952   const char * password) ;
71953 extern OSStatus
71954 kccreatekeychain(
71955   const char * password,
71956   KCRef * keychain) ;
71957 extern OSStatus
71958 kcaddapplesharepassword(
71959   AFPServerSignature * serverSignature,
71960   const char * serverAddress,
71961   const char * serverName,
71962   const char * volumeName,
71963   const char * accountName,
71964   UInt32 passwordLength,
71965   const void * passwordData,
71966   KCItemRef * item) ;
71967 extern OSStatus
71968 kcaddinternetpassword(
71969   const char * serverName,
71970   const char * securityDomain,
71971   const char * accountName,
71972   UInt16 port,
71973   OSType protocol,
71974   OSType authType,
71975   UInt32 passwordLength,
71976   const void * passwordData,
71977   KCItemRef * item) ;
71978 extern OSStatus
71979 kcaddinternetpasswordwithpath(
71980   const char * serverName,
71981   const char * securityDomain,
71982   const char * accountName,
71983   const char * path,
71984   UInt16 port,
71985   OSType protocol,
71986   OSType authType,
71987   UInt32 passwordLength,
71988   const void * passwordData,
71989   KCItemRef * item) ;
71990 extern OSStatus
71991 kcaddgenericpassword(
71992   const char * serviceName,
71993   const char * accountName,
71994   UInt32 passwordLength,
71995   const void * passwordData,
71996   KCItemRef * item) ;
71997 }
71998
71999
72000
72001 extern "C" {
72002
72003
72004
72005
72006 typedef struct OpaqueURLReference* URLReference;
72007 typedef UInt32 URLOpenFlags;
72008 enum {
72009   kURLReplaceExistingFlag = 1 << 0,
72010   kURLBinHexFileFlag = 1 << 1,
72011   kURLExpandFileFlag = 1 << 2,
72012   kURLDisplayProgressFlag = 1 << 3,
72013   kURLDisplayAuthFlag = 1 << 4,
72014   kURLUploadFlag = 1 << 5,
72015   kURLIsDirectoryHintFlag = 1 << 6,
72016   kURLDoNotTryAnonymousFlag = 1 << 7,
72017   kURLDirectoryListingFlag = 1 << 8,
72018   kURLExpandAndVerifyFlag = 1 << 9,
72019   kURLNoAutoRedirectFlag = 1 << 10,
72020   kURLDebinhexOnlyFlag = 1 << 11,
72021   kURLDoNotDeleteOnErrorFlag = 1 << 12,
72022
72023
72024   kURLResumeDownloadFlag = 1 << 13,
72025
72026
72027   kURLReservedFlag = (unsigned long)(1 << 31)
72028 };
72029
72030 typedef UInt32 URLState;
72031 enum {
72032   kURLNullState = 0,
72033   kURLInitiatingState = 1,
72034   kURLLookingUpHostState = 2,
72035   kURLConnectingState = 3,
72036   kURLResourceFoundState = 4,
72037   kURLDownloadingState = 5,
72038   kURLDataAvailableState = 0x10 + kURLDownloadingState,
72039   kURLTransactionCompleteState = 6,
72040   kURLErrorOccurredState = 7,
72041   kURLAbortingState = 8,
72042   kURLCompletedState = 9,
72043   kURLUploadingState = 10
72044 };
72045
72046 typedef UInt32 URLEvent;
72047 enum {
72048   kURLInitiatedEvent = kURLInitiatingState,
72049   kURLResourceFoundEvent = kURLResourceFoundState,
72050   kURLDownloadingEvent = kURLDownloadingState,
72051   kURLAbortInitiatedEvent = kURLAbortingState,
72052   kURLCompletedEvent = kURLCompletedState,
72053   kURLErrorOccurredEvent = kURLErrorOccurredState,
72054   kURLDataAvailableEvent = kURLDataAvailableState,
72055   kURLTransactionCompleteEvent = kURLTransactionCompleteState,
72056   kURLUploadingEvent = kURLUploadingState,
72057   kURLSystemEvent = 29,
72058   kURLPercentEvent = 30,
72059   kURLPeriodicEvent = 31,
72060   kURLPropertyChangedEvent = 32
72061 };
72062
72063 typedef unsigned long URLEventMask;
72064 enum {
72065   kURLInitiatedEventMask = 1 << (kURLInitiatedEvent - 1),
72066   kURLResourceFoundEventMask = 1 << (kURLResourceFoundEvent - 1),
72067   kURLDownloadingMask = 1 << (kURLDownloadingEvent - 1),
72068   kURLUploadingMask = 1 << (kURLUploadingEvent - 1),
72069   kURLAbortInitiatedMask = 1 << (kURLAbortInitiatedEvent - 1),
72070   kURLCompletedEventMask = 1 << (kURLCompletedEvent - 1),
72071   kURLErrorOccurredEventMask = 1 << (kURLErrorOccurredEvent - 1),
72072   kURLDataAvailableEventMask = 1 << (kURLDataAvailableEvent - 1),
72073   kURLTransactionCompleteEventMask = 1 << (kURLTransactionCompleteEvent - 1),
72074   kURLSystemEventMask = 1 << (kURLSystemEvent - 1),
72075   kURLPercentEventMask = 1 << (kURLPercentEvent - 1),
72076   kURLPeriodicEventMask = 1 << (kURLPeriodicEvent - 1),
72077   kURLPropertyChangedEventMask = 1 << (kURLPropertyChangedEvent - 1),
72078   kURLAllBufferEventsMask = kURLDataAvailableEventMask + kURLTransactionCompleteEventMask,
72079   kURLAllNonBufferEventsMask = kURLInitiatedEventMask + kURLDownloadingMask + kURLUploadingMask + kURLAbortInitiatedMask + kURLCompletedEventMask + kURLErrorOccurredEventMask + kURLPercentEventMask + kURLPeriodicEventMask + kURLPropertyChangedEventMask,
72080   kURLAllEventsMask = (long)0xFFFFFFFF
72081 };
72082
72083
72084 struct URLCallbackInfo {
72085   UInt32 version;
72086   URLReference urlRef;
72087   const char * property;
72088   UInt32 currentSize;
72089   EventRecord * systemEvent;
72090 };
72091 typedef struct URLCallbackInfo URLCallbackInfo;
72092
72093
72094 enum {
72095   kUserNameAndPasswordFlag = 0x00000001
72096 };
72097 extern OSStatus
72098 URLGetURLAccessVersion(UInt32 * returnVers) ;
72099     inline Boolean URLAccessAvailable() { return true; }
72100
72101
72102
72103
72104
72105 typedef OSStatus ( * URLNotifyProcPtr)(void *userContext, URLEvent event, URLCallbackInfo *callbackInfo);
72106 typedef OSStatus ( * URLSystemEventProcPtr)(void *userContext, EventRecord *event);
72107 typedef URLNotifyProcPtr URLNotifyUPP;
72108 typedef URLSystemEventProcPtr URLSystemEventUPP;
72109 extern URLNotifyUPP
72110 NewURLNotifyUPP(URLNotifyProcPtr userRoutine) ;
72111 extern URLSystemEventUPP
72112 NewURLSystemEventUPP(URLSystemEventProcPtr userRoutine) ;
72113 extern void
72114 DisposeURLNotifyUPP(URLNotifyUPP userUPP) ;
72115 extern void
72116 DisposeURLSystemEventUPP(URLSystemEventUPP userUPP) ;
72117 extern OSStatus
72118 InvokeURLNotifyUPP(
72119   void * userContext,
72120   URLEvent event,
72121   URLCallbackInfo * callbackInfo,
72122   URLNotifyUPP userUPP) ;
72123 extern OSStatus
72124 InvokeURLSystemEventUPP(
72125   void * userContext,
72126   EventRecord * event,
72127   URLSystemEventUPP userUPP) ;
72128 extern OSStatus
72129 URLSimpleDownload(
72130   const char * url,
72131   FSSpec * destination,
72132   Handle destinationHandle,
72133   URLOpenFlags openFlags,
72134   URLSystemEventUPP eventProc,
72135   void * userContext) ;
72136 extern OSStatus
72137 URLDownload(
72138   URLReference urlRef,
72139   FSSpec * destination,
72140   Handle destinationHandle,
72141   URLOpenFlags openFlags,
72142   URLSystemEventUPP eventProc,
72143   void * userContext) ;
72144 extern OSStatus
72145 URLSimpleUpload(
72146   const char * url,
72147   const FSSpec * source,
72148   URLOpenFlags openFlags,
72149   URLSystemEventUPP eventProc,
72150   void * userContext) ;
72151 extern OSStatus
72152 URLUpload(
72153   URLReference urlRef,
72154   const FSSpec * source,
72155   URLOpenFlags openFlags,
72156   URLSystemEventUPP eventProc,
72157   void * userContext) ;
72158 extern OSStatus
72159 URLNewReference(
72160   const char * url,
72161   URLReference * urlRef) ;
72162 extern OSStatus
72163 URLDisposeReference(URLReference urlRef) ;
72164 extern OSStatus
72165 URLOpen(
72166   URLReference urlRef,
72167   FSSpec * fileSpec,
72168   URLOpenFlags openFlags,
72169   URLNotifyUPP notifyProc,
72170   URLEventMask eventRegister,
72171   void * userContext) ;
72172 extern OSStatus
72173 URLAbort(URLReference urlRef) ;
72174 extern OSStatus
72175 URLGetDataAvailable(
72176   URLReference urlRef,
72177   Size * dataSize) ;
72178 extern OSStatus
72179 URLGetBuffer(
72180   URLReference urlRef,
72181   void ** buffer,
72182   Size * bufferSize) ;
72183 extern OSStatus
72184 URLReleaseBuffer(
72185   URLReference urlRef,
72186   void * buffer) ;
72187 extern OSStatus
72188 URLGetProperty(
72189   URLReference urlRef,
72190   const char * property,
72191   void * propertyBuffer,
72192   Size bufferSize) ;
72193 extern OSStatus
72194 URLGetPropertySize(
72195   URLReference urlRef,
72196   const char * property,
72197   Size * propertySize) ;
72198 extern OSStatus
72199 URLSetProperty(
72200   URLReference urlRef,
72201   const char * property,
72202   void * propertyBuffer,
72203   Size bufferSize) ;
72204 extern OSStatus
72205 URLGetCurrentState(
72206   URLReference urlRef,
72207   URLState * state) ;
72208 extern OSStatus
72209 URLGetError(
72210   URLReference urlRef,
72211   OSStatus * urlError) ;
72212 extern OSStatus
72213 URLIdle(void) ;
72214 extern OSStatus
72215 URLGetFileInfo(
72216   StringPtr fName,
72217   OSType * fType,
72218   OSType * fCreator) ;
72219
72220
72221
72222
72223
72224 }
72225
72226
72227
72228 extern "C" {
72229
72230
72231
72232 enum {
72233   kAHInternalErr = -10790,
72234   kAHInternetConfigPrefErr = -10791
72235 };
72236
72237
72238 typedef SInt16 AHTOCType;
72239 enum {
72240   kAHTOCTypeUser = 0,
72241   kAHTOCTypeDeveloper = 1
72242 };
72243 extern OSStatus
72244 AHSearch(
72245   CFStringRef bookname,
72246   CFStringRef query) ;
72247 extern OSStatus
72248 AHGotoMainTOC(AHTOCType toctype) ;
72249 extern OSStatus
72250 AHGotoPage(
72251   CFStringRef bookname,
72252   CFStringRef path,
72253   CFStringRef anchor) ;
72254 extern OSStatus
72255 AHLookupAnchor(
72256   CFStringRef bookname,
72257   CFStringRef anchor) ;
72258 extern OSStatus
72259 AHRegisterHelpBook(const FSRef * appBundleRef) ;
72260
72261
72262
72263
72264 }
72265
72266
72267
72268 extern "C" {
72269
72270
72271
72272 typedef struct OpaqueICAObject* ICAObject;
72273 typedef struct OpaqueICAProperty* ICAProperty;
72274 typedef struct OpaqueICAConnectionID* ICAConnectionID;
72275 typedef struct OpaqueICAEventDataCookie* ICAEventDataCookie;
72276 typedef struct OpaqueICAScannerSessionID* ICAScannerSessionID;
72277
72278
72279
72280
72281 enum {
72282   kICACommunicationErr = -9900,
72283   kICADeviceNotFoundErr = -9901,
72284   kICADeviceNotOpenErr = -9902,
72285   kICAFileCorruptedErr = -9903,
72286   kICAIOPendingErr = -9904,
72287   kICAInvalidObjectErr = -9905,
72288   kICAInvalidPropertyErr = -9906,
72289   kICAIndexOutOfRangeErr = -9907,
72290   kICAPropertyTypeNotFoundErr = -9908
72291 };
72292
72293
72294 enum {
72295   kICADevice = 'icdv',
72296   kICADeviceCamera = 'cmra',
72297   kICADeviceScanner = 'scan',
72298   kICADeviceMFP = 'mfp ',
72299   kICAList = 'objl',
72300   kICADirectory = 'dire',
72301   kICAFile = 'file',
72302   kICAFileImage = 'imag',
72303   kICAFileMovie = 'moov',
72304   kICAFileAudio = 'audo',
72305   kICAFileFirmware = 'firm',
72306   kICAFileOther = 'othe'
72307 };
72308
72309
72310 enum {
72311   kICAProperty = 'prop',
72312
72313
72314
72315   kICAPropertyImageWidth = '0100',
72316   kICAPropertyImageHeight = '0101',
72317   kICAPropertyImageBitDepth = '0102',
72318   kICAPropertyImageDPI = '011A',
72319   kICAPropertyImageExposureTime = '829A',
72320   kICAPropertyImageFNumber = '829D',
72321   kICAPropertyImageDateOriginal = '9003',
72322   kICAPropertyImageDateDigitized = '9004',
72323   kICAPropertyImageShutterSpeed = '9201',
72324   kICAPropertyImageAperture = '9202',
72325   kICAPropertyImageFlash = '9209',
72326   kICAPropertyColorSpace = 'A001',
72327   kICAPropertyImageFilename = 'ifil',
72328   kICAPropertyImageSize = 'isiz',
72329   kICAPropertyImageData = 'idat',
72330   kICAPropertyImageThumbnail = 'thum',
72331   kICAPropertyColorSyncProfile = 'prof'
72332 };
72333
72334
72335 enum {
72336   kICAMessageConnect = 'open',
72337   kICAMessageDisconnect = 'clos',
72338   kICAMessageReset = 'rese',
72339   kICAMessageCheckDevice = 'chkd'
72340 };
72341
72342
72343
72344 enum {
72345   kICATypeUInt16 = 'ui16',
72346   kICATypeUInt32 = 'ui32',
72347   kICATypeUInt64 = 'ui64',
72348   kICATypeSInt16 = 'si16',
72349   kICATypeSInt32 = 'si32',
72350   kICATypeSInt64 = 'si64',
72351   kICATypeFixed = 'sing',
72352   kICATypeBoolean = 'bool',
72353   kICATypeString = 'TEXT',
72354   kICATypeData = 'data',
72355   kICATypeThumbnail = 'thum'
72356 };
72357
72358
72359
72360 enum {
72361   kICAFlagReadWriteAccess = 1L << 0,
72362   kICAFlagReadAccess = 1L << 1
72363 };
72364
72365
72366
72367
72368 enum {
72369   kICAEventCancelTransaction = 'ecnt',
72370   kICAEventObjectAdded = 'eoba',
72371   kICAEventObjectRemoved = 'eobr',
72372   kICAEventStoreAdded = 'esta',
72373   kICAEventStoreRemoved = 'estr',
72374   kICAEventDeviceAdded = 'edea',
72375   kICAEventDeviceRemoved = 'eder',
72376   kICAEventDevicePropChanged = 'edpc',
72377   kICAEventObjectInfoChanged = 'eoic',
72378   kICAEventDeviceInfoChanged = 'edic',
72379   kICAEventRequestObjectTransfer = 'erot',
72380   kICAEventStoreFull = 'estf',
72381   kICAEventDeviceReset = 'edvr',
72382   kICAEventStorageInfoChanged = 'esic',
72383   kICAEventCaptureComplete = 'ecpc',
72384   kICAEventUnreportedStatus = 'eurs'
72385 };
72386
72387
72388
72389 enum {
72390   kICAStartAtBeginning = 0,
72391   kICAEntireLength = -1
72392 };
72393
72394
72395 enum {
72396   kDeleteAfterDownload = 0x00000001,
72397   kCreateCustomIcon = 0x00000002,
72398   kAddMetaDataToFinderComment = 0x00000004,
72399   kAdjustCreationDate = 0x00000008,
72400   kSetFileTypeAndCreator = 0x00000010,
72401   kEmbedColorSyncProfile = 0x00000020,
72402   kRotateImage = 0x00000040
72403 };
72404
72405
72406 enum {
72407   kExtendedNotificationPB = 'extd',
72408   kMessageGetEventData = 'mged',
72409   kEventClassPTPStandard = 'PTPs',
72410   kEventClassPTPVendor = 'PTPv'
72411 };
72412
72413
72414
72415
72416 struct ICAObjectInfo {
72417   OSType objectType;
72418   OSType objectSubtype;
72419 };
72420 typedef struct ICAObjectInfo ICAObjectInfo;
72421
72422
72423 struct ICAPropertyInfo {
72424   OSType propertyType;
72425   OSType dataType;
72426   UInt32 dataSize;
72427   UInt32 dataFlags;
72428 };
72429 typedef struct ICAPropertyInfo ICAPropertyInfo;
72430
72431
72432 struct ICAMessage {
72433   OSType messageType;
72434   UInt32 startByte;
72435   void * dataPtr;
72436   UInt32 dataSize;
72437   OSType dataType;
72438 };
72439 typedef struct ICAMessage ICAMessage;
72440
72441
72442 struct ICAThumbnail {
72443   UInt32 width;
72444   UInt32 height;
72445   UInt32 dataSize;
72446   UInt8 data[1];
72447 };
72448 typedef struct ICAThumbnail ICAThumbnail;
72449 enum {
72450   kICAPBVersion = 0x00010000
72451 };
72452 typedef struct ICAHeader ICAHeader;
72453 typedef void ( * ICACompletion)(ICAHeader * pb);
72454
72455
72456
72457
72458
72459 struct ICAHeader {
72460   OSErr err;
72461   UInt32 refcon;
72462 };
72463
72464
72465
72466
72467
72468
72469 struct ICAGetChildCountPB {
72470   ICAHeader header;
72471   ICAObject object;
72472   UInt32 count;
72473 };
72474 typedef struct ICAGetChildCountPB ICAGetChildCountPB;
72475
72476
72477 struct ICAGetNthChildPB {
72478   ICAHeader header;
72479   ICAObject parentObject;
72480   UInt32 index;
72481   ICAObject childObject;
72482   ICAObjectInfo childInfo;
72483 };
72484 typedef struct ICAGetNthChildPB ICAGetNthChildPB;
72485
72486
72487 struct ICAGetObjectInfoPB {
72488   ICAHeader header;
72489   ICAObject object;
72490   ICAObjectInfo objectInfo;
72491 };
72492 typedef struct ICAGetObjectInfoPB ICAGetObjectInfoPB;
72493
72494
72495 struct ICAGetParentOfObjectPB {
72496   ICAHeader header;
72497   ICAObject object;
72498   ICAObject parentObject;
72499   ICAObjectInfo parentInfo;
72500 };
72501 typedef struct ICAGetParentOfObjectPB ICAGetParentOfObjectPB;
72502
72503
72504 struct ICAGetRootOfObjectPB {
72505   ICAHeader header;
72506   ICAObject object;
72507   ICAObject rootObject;
72508   ICAObjectInfo rootInfo;
72509 };
72510 typedef struct ICAGetRootOfObjectPB ICAGetRootOfObjectPB;
72511
72512
72513 struct ICAGetObjectRefConPB {
72514   ICAHeader header;
72515   ICAObject object;
72516   UInt32 objectRefCon;
72517 };
72518 typedef struct ICAGetObjectRefConPB ICAGetObjectRefConPB;
72519
72520
72521 struct ICASetObjectRefConPB {
72522   ICAHeader header;
72523   ICAObject object;
72524   UInt32 objectRefCon;
72525 };
72526 typedef struct ICASetObjectRefConPB ICASetObjectRefConPB;
72527
72528
72529
72530
72531
72532 struct ICAGetPropertyCountPB {
72533   ICAHeader header;
72534   ICAObject object;
72535   UInt32 count;
72536 };
72537 typedef struct ICAGetPropertyCountPB ICAGetPropertyCountPB;
72538
72539
72540 struct ICAGetNthPropertyPB {
72541   ICAHeader header;
72542   ICAObject object;
72543   UInt32 index;
72544   ICAProperty property;
72545   ICAPropertyInfo propertyInfo;
72546 };
72547 typedef struct ICAGetNthPropertyPB ICAGetNthPropertyPB;
72548
72549
72550 struct ICAGetPropertyByTypePB {
72551   ICAHeader header;
72552   ICAObject object;
72553   OSType propertyType;
72554   ICAProperty property;
72555   ICAPropertyInfo propertyInfo;
72556 };
72557 typedef struct ICAGetPropertyByTypePB ICAGetPropertyByTypePB;
72558
72559
72560 struct ICAGetPropertyInfoPB {
72561   ICAHeader header;
72562   ICAProperty property;
72563   ICAPropertyInfo propertyInfo;
72564 };
72565 typedef struct ICAGetPropertyInfoPB ICAGetPropertyInfoPB;
72566
72567
72568 struct ICAGetPropertyDataPB {
72569   ICAHeader header;
72570   ICAProperty property;
72571   UInt32 startByte;
72572   UInt32 requestedSize;
72573   void * dataPtr;
72574   UInt32 actualSize;
72575   OSType dataType;
72576 };
72577 typedef struct ICAGetPropertyDataPB ICAGetPropertyDataPB;
72578
72579
72580 struct ICASetPropertyDataPB {
72581   ICAHeader header;
72582   ICAProperty property;
72583   UInt32 startByte;
72584   void * dataPtr;
72585   UInt32 dataSize;
72586   OSType dataType;
72587 };
72588 typedef struct ICASetPropertyDataPB ICASetPropertyDataPB;
72589
72590
72591 struct ICAGetParentOfPropertyPB {
72592   ICAHeader header;
72593   ICAProperty property;
72594   ICAObject parentObject;
72595   ICAObjectInfo parentInfo;
72596 };
72597 typedef struct ICAGetParentOfPropertyPB ICAGetParentOfPropertyPB;
72598
72599
72600 struct ICAGetRootOfPropertyPB {
72601   ICAHeader header;
72602   ICAProperty property;
72603   ICAObject rootObject;
72604   ICAObjectInfo rootInfo;
72605 };
72606 typedef struct ICAGetRootOfPropertyPB ICAGetRootOfPropertyPB;
72607
72608
72609 struct ICAGetPropertyRefConPB {
72610   ICAHeader header;
72611   ICAProperty property;
72612   UInt32 propertyRefCon;
72613 };
72614 typedef struct ICAGetPropertyRefConPB ICAGetPropertyRefConPB;
72615
72616
72617 struct ICASetPropertyRefConPB {
72618   ICAHeader header;
72619   ICAProperty property;
72620   UInt32 propertyRefCon;
72621 };
72622 typedef struct ICASetPropertyRefConPB ICASetPropertyRefConPB;
72623
72624
72625
72626
72627
72628 struct ICAGetDeviceListPB {
72629   ICAHeader header;
72630   ICAObject object;
72631 };
72632 typedef struct ICAGetDeviceListPB ICAGetDeviceListPB;
72633
72634
72635 struct ICAObjectSendMessagePB {
72636   ICAHeader header;
72637   ICAObject object;
72638   ICAMessage message;
72639   UInt32 result;
72640 };
72641 typedef struct ICAObjectSendMessagePB ICAObjectSendMessagePB;
72642
72643
72644 struct ICARegisterEventNotificationPB {
72645   ICAHeader header;
72646   ICAObject object;
72647   OSType notifyType;
72648   ICACompletion notifyProc;
72649 };
72650 typedef struct ICARegisterEventNotificationPB ICARegisterEventNotificationPB;
72651
72652
72653 struct ICAExtendedRegisterEventNotificationPB {
72654   ICAHeader header;
72655   ICAObject object;
72656   OSType extd;
72657   ICACompletion notifyProc;
72658
72659   UInt32 rawEventType;
72660   OSType eventType;
72661   OSType eventClass;
72662   UInt32 eventDataSize;
72663   ICAEventDataCookie eventDataCookie;
72664   ICAObject deviceObject;
72665 };
72666 typedef struct ICAExtendedRegisterEventNotificationPB ICAExtendedRegisterEventNotificationPB;
72667
72668
72669 struct ICADownloadFilePB {
72670   ICAHeader header;
72671   ICAObject object;
72672   FSRef * dirFSRef;
72673   UInt32 flags;
72674   OSType fileType;
72675   OSType fileCreator;
72676   Fixed rotationAngle;
72677   FSRef * fileFSRef;
72678 };
72679 typedef struct ICADownloadFilePB ICADownloadFilePB;
72680
72681
72682 struct ICACopyObjectPropertyDictionaryPB {
72683   ICAHeader header;
72684   ICAObject object;
72685   CFDictionaryRef * theDict;
72686 };
72687 typedef struct ICACopyObjectPropertyDictionaryPB ICACopyObjectPropertyDictionaryPB;
72688 extern OSErr
72689 ICAGetChildCount(
72690   ICAGetChildCountPB * pb,
72691   ICACompletion completion) ;
72692 extern OSErr
72693 ICAGetNthChild(
72694   ICAGetNthChildPB * pb,
72695   ICACompletion completion) ;
72696 extern OSErr
72697 ICAGetObjectInfo(
72698   ICAGetObjectInfoPB * pb,
72699   ICACompletion completion) ;
72700 extern OSErr
72701 ICAGetParentOfObject(
72702   ICAGetParentOfObjectPB * pb,
72703   ICACompletion completion) ;
72704 extern OSErr
72705 ICAGetRootOfObject(
72706   ICAGetRootOfObjectPB * pb,
72707   ICACompletion completion) ;
72708 extern OSErr
72709 ICAGetObjectRefCon(
72710   ICAGetObjectRefConPB * pb,
72711   ICACompletion completion) ;
72712 extern OSErr
72713 ICASetObjectRefCon(
72714   ICASetObjectRefConPB * pb,
72715   ICACompletion completion) ;
72716 extern OSErr
72717 ICAGetPropertyCount(
72718   ICAGetPropertyCountPB * pb,
72719   ICACompletion completion) ;
72720 extern OSErr
72721 ICAGetNthProperty(
72722   ICAGetNthPropertyPB * pb,
72723   ICACompletion completion) ;
72724 extern OSErr
72725 ICAGetPropertyByType(
72726   ICAGetPropertyByTypePB * pb,
72727   ICACompletion completion) ;
72728 extern OSErr
72729 ICAGetPropertyInfo(
72730   ICAGetPropertyInfoPB * pb,
72731   ICACompletion completion) ;
72732 extern OSErr
72733 ICAGetPropertyData(
72734   ICAGetPropertyDataPB * pb,
72735   ICACompletion completion) ;
72736 extern OSErr
72737 ICASetPropertyData(
72738   ICASetPropertyDataPB * pb,
72739   ICACompletion completion) ;
72740 extern OSErr
72741 ICAGetParentOfProperty(
72742   ICAGetParentOfPropertyPB * pb,
72743   ICACompletion completion) ;
72744 extern OSErr
72745 ICAGetRootOfProperty(
72746   ICAGetRootOfPropertyPB * pb,
72747   ICACompletion completion) ;
72748 extern OSErr
72749 ICAGetPropertyRefCon(
72750   ICAGetPropertyRefConPB * pb,
72751   ICACompletion completion) ;
72752 extern OSErr
72753 ICASetPropertyRefCon(
72754   ICASetPropertyRefConPB * pb,
72755   ICACompletion completion) ;
72756 extern OSErr
72757 ICAGetDeviceList(
72758   ICAGetDeviceListPB * pb,
72759   ICACompletion completion) ;
72760 extern OSErr
72761 ICAObjectSendMessage(
72762   ICAObjectSendMessagePB * pb,
72763   ICACompletion completion) ;
72764 extern OSErr
72765 ICARegisterEventNotification(
72766   ICARegisterEventNotificationPB * pb,
72767   ICACompletion completion) ;
72768 extern OSErr
72769 ICADownloadFile(
72770   ICADownloadFilePB * pb,
72771   ICACompletion completion) ;
72772 extern OSErr
72773 ICACopyObjectPropertyDictionary(
72774   ICACopyObjectPropertyDictionaryPB * pb,
72775   ICACompletion completion) ;
72776
72777
72778
72779
72780
72781
72782 struct ICAScannerOpenSessionPB {
72783   ICAHeader header;
72784   ICAObject object;
72785   ICAScannerSessionID sessionID;
72786 };
72787 typedef struct ICAScannerOpenSessionPB ICAScannerOpenSessionPB;
72788
72789
72790 struct ICAScannerCloseSessionPB {
72791   ICAHeader header;
72792   ICAScannerSessionID sessionID;
72793 };
72794 typedef struct ICAScannerCloseSessionPB ICAScannerCloseSessionPB;
72795
72796
72797 struct ICAScannerInitializePB {
72798   ICAHeader header;
72799   ICAScannerSessionID sessionID;
72800 };
72801 typedef struct ICAScannerInitializePB ICAScannerInitializePB;
72802
72803
72804 struct ICAScannerGetParametersPB {
72805   ICAHeader header;
72806   ICAScannerSessionID sessionID;
72807   CFMutableDictionaryRef theDict;
72808 };
72809 typedef struct ICAScannerGetParametersPB ICAScannerGetParametersPB;
72810
72811
72812 struct ICAScannerSetParametersPB {
72813   ICAHeader header;
72814   ICAScannerSessionID sessionID;
72815   CFMutableDictionaryRef theDict;
72816 };
72817 typedef struct ICAScannerSetParametersPB ICAScannerSetParametersPB;
72818
72819
72820 struct ICAScannerStatusPB {
72821   ICAHeader header;
72822   ICAScannerSessionID sessionID;
72823   UInt32 status;
72824 };
72825 typedef struct ICAScannerStatusPB ICAScannerStatusPB;
72826
72827
72828 struct ICAScannerStartPB {
72829   ICAHeader header;
72830   ICAScannerSessionID sessionID;
72831 };
72832 typedef struct ICAScannerStartPB ICAScannerStartPB;
72833 extern OSErr
72834 ICAScannerOpenSession(
72835   ICAScannerOpenSessionPB * pb,
72836   ICACompletion completion) ;
72837 extern OSErr
72838 ICAScannerCloseSession(
72839   ICAScannerCloseSessionPB * pb,
72840   ICACompletion completion) ;
72841 extern OSErr
72842 ICAScannerInitialize(
72843   ICAScannerInitializePB * pb,
72844   ICACompletion completion) ;
72845 extern OSErr
72846 ICAScannerGetParameters(
72847   ICAScannerGetParametersPB * pb,
72848   ICACompletion completion) ;
72849 extern OSErr
72850 ICAScannerSetParameters(
72851   ICAScannerSetParametersPB * pb,
72852   ICACompletion completion) ;
72853 extern OSErr
72854 ICAScannerStatus(
72855   ICAScannerStatusPB * pb,
72856   ICACompletion completion) ;
72857 extern OSErr
72858 ICAScannerStart(
72859   ICAScannerStartPB * pb,
72860   ICACompletion completion) ;
72861
72862
72863
72864
72865
72866 }
72867
72868
72869
72870 extern "C" {
72871
72872
72873 typedef struct ICDHeader ICDHeader;
72874 typedef void ( * ICDCompletion)(ICDHeader * pb);
72875
72876
72877
72878 struct ICDHeader {
72879   OSErr err;
72880   UInt32 refcon;
72881 };
72882
72883
72884
72885
72886 struct ICD_NewObjectPB {
72887   ICDHeader header;
72888
72889   ICAObject parentObject;
72890   ICAObjectInfo objectInfo;
72891
72892   ICAObject object;
72893 };
72894 typedef struct ICD_NewObjectPB ICD_NewObjectPB;
72895 struct ICD_DisposeObjectPB {
72896   ICDHeader header;
72897
72898   ICAObject object;
72899 };
72900 typedef struct ICD_DisposeObjectPB ICD_DisposeObjectPB;
72901
72902
72903
72904 struct ICD_NewPropertyPB {
72905   ICDHeader header;
72906
72907   ICAObject object;
72908   ICAPropertyInfo propertyInfo;
72909
72910   ICAProperty property;
72911 };
72912 typedef struct ICD_NewPropertyPB ICD_NewPropertyPB;
72913 struct ICD_DisposePropertyPB {
72914   ICDHeader header;
72915
72916   ICAProperty property;
72917 };
72918 typedef struct ICD_DisposePropertyPB ICD_DisposePropertyPB;
72919 extern OSErr
72920 ICDNewObject(
72921   ICD_NewObjectPB * pb,
72922   ICDCompletion completion) ;
72923 extern OSErr
72924 ICDDisposeObject(
72925   ICD_DisposeObjectPB * pb,
72926   ICDCompletion completion) ;
72927 extern OSErr
72928 ICDNewProperty(
72929   ICD_NewPropertyPB * pb,
72930   ICDCompletion completion) ;
72931 extern OSErr
72932 ICDDisposeProperty(
72933   ICD_DisposePropertyPB * pb,
72934   ICDCompletion completion) ;
72935
72936
72937
72938
72939
72940
72941
72942
72943
72944 }
72945
72946
72947
72948 enum {
72949
72950
72951
72952   kICAPropertyCameraBatteryLevel = '5001',
72953   kICAPropertyCameraFunctionalMode = '5002',
72954   kICAPropertyCameraImageSize = '5003',
72955   kICAPropertyCameraCompressionSetting = '5004',
72956   kICAPropertyCameraWhiteBalance = '5005',
72957   kICAPropertyCameraRGBGain = '5006',
72958   kICAPropertyCameraFNumber = '5007',
72959   kICAPropertyCameraFocalLength = '5008',
72960   kICAPropertyCameraFocusDistance = '5009',
72961   kICAPropertyCameraFocusMode = '500A',
72962   kICAPropertyCameraExposureMeteringMode = '500B',
72963   kICAPropertyCameraFlashMode = '500C',
72964   kICAPropertyCameraExposureTime = '500D',
72965   kICAPropertyCameraExposureProgramMode = '500E',
72966   kICAPropertyCameraExposureIndex = '500F',
72967   kICAPropertyCameraExposureBiasCompensation = '5010',
72968   kICAPropertyCameraDateTime = '5011',
72969   kICAPropertyCameraCaptureDelay = '5012',
72970   kICAPropertyCameraStillCaptureMode = '5013',
72971   kICAPropertyCameraContrast = '5014',
72972   kICAPropertyCameraSharpness = '5015',
72973   kICAPropertyCameraDigitalZoom = '5016',
72974   kICAPropertyCameraEffectMode = '5017',
72975   kICAPropertyCameraBurstNumber = '5018',
72976   kICAPropertyCameraBurstInterval = '5019',
72977   kICAPropertyCameraTimelapseNumber = '501A',
72978   kICAPropertyCameraTimelapseInterval = '501B',
72979   kICAPropertyCameraFocusMeteringMode = '501C'
72980 };
72981
72982 enum {
72983
72984   kICAPropertyCameraStorageType = 'stor',
72985   kICAPropertyCameraFilesystemType = 'fsys',
72986   kICAPropertyCameraAccessCapability = 'acap',
72987   kICAPropertyCameraMaxCapacity = 'maxc',
72988   kICAPropertyCameraFreeSpaceInBytes = 'fres',
72989   kICAPropertyCameraFreeSpaceInImages = 'frei',
72990   kICAPropertyCameraStorageDescription = 'stod',
72991   kICAPropertyCameraVolumeLabel = 'voll'
72992 };
72993
72994 enum {
72995
72996   kICAPropertyCameraIcon = 'icon',
72997   kICAPropertyCameraSupportedMessages = 'msgs'
72998 };
72999
73000 enum {
73001
73002   kICAStorageFixedROM = 0x0001,
73003   kICAStorageRemovableROM = 0x0002,
73004   kICAStorageFixedRAM = 0x0003,
73005   kICAStorageRemovableRAM = 0x0004
73006 };
73007
73008 enum {
73009
73010   kICAFileystemGenericFlat = 0x0001,
73011   kICAFileystemGenericHierarchical = 0x0002,
73012   kICAFileystemDCF = 0x0003
73013 };
73014
73015 enum {
73016
73017   kICAAccessReadWrite = 0x0000,
73018   kICAAccessReadOnly = 0x0001,
73019   kICAAccessReadOnlyWithObjectDeletion = 0x0002
73020 };
73021
73022 enum {
73023
73024   kICAMessageCameraCaptureNewImage = 'ccni',
73025   kICAMessageCameraDeleteOne = 'del1',
73026   kICAMessageCameraDeleteAll = 'dela',
73027   kICAMessageCameraSyncClock = 'sclk',
73028   kICAMessageCameraUploadData = 'load'
73029 };
73030
73031
73032 extern double acos (double);
73033 extern double asin (double);
73034 extern double atan (double);
73035 extern double atan2 (double, double);
73036 extern double ceil (double);
73037 extern double cos (double);
73038 extern double cosh (double);
73039 extern double exp (double);
73040 extern double fabs (double);
73041 extern double floor (double);
73042 extern double fmod (double, double);
73043 extern double frexp (double, int *);
73044 extern double ldexp (double, int);
73045 extern double log10 (double);
73046 extern double log (double);
73047 extern double modf (double, double *);
73048 extern double pow (double, double);
73049 extern double sin (double);
73050 extern double sinh (double);
73051 extern double sqrt (double);
73052 extern double tan (double);
73053 extern double tanh (double);
73054
73055
73056
73057
73058
73059 extern double acos (double);
73060 extern double asin (double);
73061 extern double atan (double);
73062 extern double atan2 (double, double);
73063 extern double ceil (double);
73064 extern double cos (double);
73065 extern double cosh (double);
73066 extern double exp (double);
73067 extern double fabs (double);
73068 extern double floor (double);
73069 extern double fmod (double, double);
73070 extern double frexp (double, int *);
73071 extern double ldexp (double, int);
73072 extern double log10 (double);
73073 extern double log (double);
73074 extern double modf (double, double *);
73075 extern double pow (double, double);
73076 extern double sin (double);
73077 extern double sinh (double);
73078 extern double sqrt (double);
73079 extern double tan (double);
73080 extern double tanh (double);
73081
73082
73083 enum {
73084
73085
73086
73087         kSCStatusOK = 0,
73088         kSCStatusFailed = 1001,
73089         kSCStatusInvalidArgument = 1002,
73090         kSCStatusAccessError = 1003,
73091
73092
73093
73094         kSCStatusNoKey = 1004,
73095         kSCStatusKeyExists = 1005,
73096         kSCStatusLocked = 1006,
73097         kSCStatusNeedLock = 1007,
73098
73099
73100
73101         kSCStatusNoStoreSession = 2001,
73102         kSCStatusNoStoreServer = 2002,
73103         kSCStatusNotifierActive = 2003,
73104
73105
73106
73107         kSCStatusNoPrefsSession = 3001,
73108         kSCStatusPrefsBusy = 3002,
73109         kSCStatusNoConfigFile = 3003,
73110         kSCStatusNoLink = 3004,
73111         kSCStatusStale = 3005,
73112         kSCStatusMaxLink = 3006,
73113
73114
73115
73116         kSCStatusReachabilityUnknown = 4001,
73117 };
73118
73119
73120
73121 extern "C" {
73122 void closelog (void);
73123 void openlog (const char *, int, int);
73124 int setlogmask (int);
73125 void syslog (int, const char *, ...);
73126 void vsyslog (int, const char *, __builtin_va_list);
73127 }
73128
73129
73130
73131 extern double acos (double);
73132 extern double asin (double);
73133 extern double atan (double);
73134 extern double atan2 (double, double);
73135 extern double ceil (double);
73136 extern double cos (double);
73137 extern double cosh (double);
73138 extern double exp (double);
73139 extern double fabs (double);
73140 extern double floor (double);
73141 extern double fmod (double, double);
73142 extern double frexp (double, int *);
73143 extern double ldexp (double, int);
73144 extern double log10 (double);
73145 extern double log (double);
73146 extern double modf (double, double *);
73147 extern double pow (double, double);
73148 extern double sin (double);
73149 extern double sinh (double);
73150 extern double sqrt (double);
73151 extern double tan (double);
73152 extern double tanh (double);
73153
73154
73155 typedef const struct __SCDynamicStore * SCDynamicStoreRef;
73156
73157
73158
73159
73160 typedef struct {
73161         CFIndex version;
73162         void * info;
73163         const void *(*retain)(const void *info);
73164         void (*release)(const void *info);
73165         CFStringRef (*copyDescription)(const void *info);
73166 } SCDynamicStoreContext;
73167 typedef void (*SCDynamicStoreCallBack) (
73168                                         SCDynamicStoreRef store,
73169                                         CFArrayRef changedKeys,
73170                                         void *info
73171                                         );
73172
73173
73174 extern "C" {
73175
73176
73177
73178
73179
73180 CFTypeID
73181 SCDynamicStoreGetTypeID (void);
73182 SCDynamicStoreRef
73183 SCDynamicStoreCreate (
73184                                         CFAllocatorRef allocator,
73185                                         CFStringRef name,
73186                                         SCDynamicStoreCallBack callout,
73187                                         SCDynamicStoreContext *context
73188                                         );
73189 CFRunLoopSourceRef
73190 SCDynamicStoreCreateRunLoopSource (
73191                                         CFAllocatorRef allocator,
73192                                         SCDynamicStoreRef store,
73193                                         CFIndex order
73194                                         );
73195 CFArrayRef
73196 SCDynamicStoreCopyKeyList (
73197                                         SCDynamicStoreRef store,
73198                                         CFStringRef pattern
73199                                         );
73200 Boolean
73201 SCDynamicStoreAddValue (
73202                                         SCDynamicStoreRef store,
73203                                         CFStringRef key,
73204                                         CFPropertyListRef value
73205                                         );
73206 Boolean
73207 SCDynamicStoreAddTemporaryValue (
73208                                         SCDynamicStoreRef store,
73209                                         CFStringRef key,
73210                                         CFPropertyListRef value
73211                                         );
73212 CFPropertyListRef
73213 SCDynamicStoreCopyValue (
73214                                         SCDynamicStoreRef store,
73215                                         CFStringRef key
73216                                         );
73217 CFDictionaryRef
73218 SCDynamicStoreCopyMultiple (
73219                                         SCDynamicStoreRef store,
73220                                         CFArrayRef keys,
73221                                         CFArrayRef patterns
73222                                         );
73223 Boolean
73224 SCDynamicStoreSetValue (
73225                                         SCDynamicStoreRef store,
73226                                         CFStringRef key,
73227                                         CFPropertyListRef value
73228                                         );
73229 Boolean
73230 SCDynamicStoreSetMultiple (
73231                                         SCDynamicStoreRef store,
73232                                         CFDictionaryRef keysToSet,
73233                                         CFArrayRef keysToRemove,
73234                                         CFArrayRef keysToNotify
73235                                         );
73236 Boolean
73237 SCDynamicStoreRemoveValue (
73238                                         SCDynamicStoreRef store,
73239                                         CFStringRef key
73240                                         );
73241 Boolean
73242 SCDynamicStoreNotifyValue (
73243                                         SCDynamicStoreRef store,
73244                                         CFStringRef key
73245                                         );
73246 Boolean
73247 SCDynamicStoreSetNotificationKeys (
73248                                         SCDynamicStoreRef store,
73249                                         CFArrayRef keys,
73250                                         CFArrayRef patterns
73251                                         );
73252 CFArrayRef
73253 SCDynamicStoreCopyNotifiedKeys (
73254                                         SCDynamicStoreRef store
73255                                         );
73256
73257 }
73258
73259
73260 extern double acos (double);
73261 extern double asin (double);
73262 extern double atan (double);
73263 extern double atan2 (double, double);
73264 extern double ceil (double);
73265 extern double cos (double);
73266 extern double cosh (double);
73267 extern double exp (double);
73268 extern double fabs (double);
73269 extern double floor (double);
73270 extern double fmod (double, double);
73271 extern double frexp (double, int *);
73272 extern double ldexp (double, int);
73273 extern double log10 (double);
73274 extern double log (double);
73275 extern double modf (double, double *);
73276 extern double pow (double, double);
73277 extern double sin (double);
73278 extern double sinh (double);
73279 extern double sqrt (double);
73280 extern double tan (double);
73281 extern double tanh (double);
73282
73283
73284
73285
73286
73287
73288
73289
73290
73291 extern "C" {
73292 CFStringRef
73293 SCDynamicStoreKeyCreate (
73294                                                 CFAllocatorRef allocator,
73295                                                 CFStringRef fmt,
73296                                                 ...
73297                                                 );
73298
73299
73300
73301
73302 CFStringRef
73303 SCDynamicStoreKeyCreateNetworkGlobalEntity (
73304                                                 CFAllocatorRef allocator,
73305                                                 CFStringRef domain,
73306                                                 CFStringRef entity
73307                                                 );
73308
73309
73310
73311
73312 CFStringRef
73313 SCDynamicStoreKeyCreateNetworkInterface (
73314                                                 CFAllocatorRef allocator,
73315                                                 CFStringRef domain
73316                                                 );
73317
73318
73319
73320
73321 CFStringRef
73322 SCDynamicStoreKeyCreateNetworkInterfaceEntity (
73323                                                 CFAllocatorRef allocator,
73324                                                 CFStringRef domain,
73325                                                 CFStringRef ifname,
73326                                                 CFStringRef entity
73327                                                 );
73328
73329
73330
73331
73332 CFStringRef
73333 SCDynamicStoreKeyCreateNetworkServiceEntity (
73334                                                 CFAllocatorRef allocator,
73335                                                 CFStringRef domain,
73336                                                 CFStringRef serviceID,
73337                                                 CFStringRef entity
73338                                                 );
73339 CFStringRef
73340 SCDynamicStoreKeyCreateComputerName (
73341                                                 CFAllocatorRef allocator
73342                                                 );
73343 CFStringRef
73344 SCDynamicStoreKeyCreateConsoleUser (
73345                                                 CFAllocatorRef allocator
73346                                                 );
73347 CFStringRef
73348 SCDynamicStoreKeyCreateHostNames (
73349                                                 CFAllocatorRef allocator
73350                                                 );
73351 CFStringRef
73352 SCDynamicStoreKeyCreateLocation (
73353                                                 CFAllocatorRef allocator
73354                                                 );
73355 CFStringRef
73356 SCDynamicStoreKeyCreateProxies (
73357                                                 CFAllocatorRef allocator
73358                                                 );
73359
73360 }
73361
73362
73363 extern double acos (double);
73364 extern double asin (double);
73365 extern double atan (double);
73366 extern double atan2 (double, double);
73367 extern double ceil (double);
73368 extern double cos (double);
73369 extern double cosh (double);
73370 extern double exp (double);
73371 extern double fabs (double);
73372 extern double floor (double);
73373 extern double fmod (double, double);
73374 extern double frexp (double, int *);
73375 extern double ldexp (double, int);
73376 extern double log10 (double);
73377 extern double log (double);
73378 extern double modf (double, double *);
73379 extern double pow (double, double);
73380 extern double sin (double);
73381 extern double sinh (double);
73382 extern double sqrt (double);
73383 extern double tan (double);
73384 extern double tanh (double);
73385
73386
73387 extern "C" {
73388 CFStringRef
73389 SCDynamicStoreCopyComputerName (
73390                                         SCDynamicStoreRef store,
73391                                         CFStringEncoding *nameEncoding
73392                                         );
73393 CFStringRef
73394 SCDynamicStoreCopyConsoleUser (
73395                                         SCDynamicStoreRef session,
73396                                         uid_t *uid,
73397                                         gid_t *gid
73398                                         );
73399 CFStringRef
73400 SCDynamicStoreCopyLocalHostName (
73401                                         SCDynamicStoreRef store
73402                                         );
73403 CFStringRef
73404 SCDynamicStoreCopyLocation (
73405                                         SCDynamicStoreRef store
73406                                         );
73407 CFDictionaryRef
73408 SCDynamicStoreCopyProxies (
73409                                         SCDynamicStoreRef store
73410                                         );
73411
73412 }
73413
73414
73415
73416
73417 extern double acos (double);
73418 extern double asin (double);
73419 extern double atan (double);
73420 extern double atan2 (double, double);
73421 extern double ceil (double);
73422 extern double cos (double);
73423 extern double cosh (double);
73424 extern double exp (double);
73425 extern double fabs (double);
73426 extern double floor (double);
73427 extern double fmod (double, double);
73428 extern double frexp (double, int *);
73429 extern double ldexp (double, int);
73430 extern double log10 (double);
73431 extern double log (double);
73432 extern double modf (double, double *);
73433 extern double pow (double, double);
73434 extern double sin (double);
73435 extern double sinh (double);
73436 extern double sqrt (double);
73437 extern double tan (double);
73438 extern double tanh (double);
73439
73440
73441 typedef const struct __SCPreferences * SCPreferencesRef;
73442
73443
73444 extern "C" {
73445
73446
73447
73448
73449
73450 CFTypeID
73451 SCPreferencesGetTypeID (void);
73452 SCPreferencesRef
73453 SCPreferencesCreate (
73454                                 CFAllocatorRef allocator,
73455                                 CFStringRef name,
73456                                 CFStringRef prefsID
73457                                 );
73458 Boolean
73459 SCPreferencesLock (
73460                                 SCPreferencesRef session,
73461                                 Boolean wait
73462                                 );
73463 Boolean
73464 SCPreferencesCommitChanges (
73465                                 SCPreferencesRef session
73466                                 );
73467 Boolean
73468 SCPreferencesApplyChanges (
73469                                 SCPreferencesRef session
73470                                 );
73471 Boolean
73472 SCPreferencesUnlock (
73473                                 SCPreferencesRef session
73474                                 );
73475 CFDataRef
73476 SCPreferencesGetSignature (
73477                                 SCPreferencesRef session
73478                                 );
73479 CFArrayRef
73480 SCPreferencesCopyKeyList (
73481                                 SCPreferencesRef session
73482                                 );
73483 CFPropertyListRef
73484 SCPreferencesGetValue (
73485                                 SCPreferencesRef session,
73486                                 CFStringRef key
73487                                 );
73488 Boolean
73489 SCPreferencesAddValue (
73490                                 SCPreferencesRef session,
73491                                 CFStringRef key,
73492                                 CFPropertyListRef value
73493                                 );
73494 Boolean
73495 SCPreferencesSetValue (
73496                                 SCPreferencesRef session,
73497                                 CFStringRef key,
73498                                 CFPropertyListRef value
73499                                 );
73500 Boolean
73501 SCPreferencesRemoveValue (
73502                                 SCPreferencesRef session,
73503                                 CFStringRef key
73504                                 );
73505
73506 }
73507
73508
73509 extern double acos (double);
73510 extern double asin (double);
73511 extern double atan (double);
73512 extern double atan2 (double, double);
73513 extern double ceil (double);
73514 extern double cos (double);
73515 extern double cosh (double);
73516 extern double exp (double);
73517 extern double fabs (double);
73518 extern double floor (double);
73519 extern double fmod (double, double);
73520 extern double frexp (double, int *);
73521 extern double ldexp (double, int);
73522 extern double log10 (double);
73523 extern double log (double);
73524 extern double modf (double, double *);
73525 extern double pow (double, double);
73526 extern double sin (double);
73527 extern double sinh (double);
73528 extern double sqrt (double);
73529 extern double tan (double);
73530 extern double tanh (double);
73531
73532
73533 extern "C" {
73534 CFStringRef
73535 SCPreferencesPathCreateUniqueChild (
73536                                         SCPreferencesRef session,
73537                                         CFStringRef prefix
73538                                         );
73539 CFDictionaryRef
73540 SCPreferencesPathGetValue (
73541                                         SCPreferencesRef session,
73542                                         CFStringRef path
73543                                         );
73544 CFStringRef
73545 SCPreferencesPathGetLink (
73546                                         SCPreferencesRef session,
73547                                         CFStringRef path
73548                                         );
73549 Boolean
73550 SCPreferencesPathSetValue (
73551                                         SCPreferencesRef session,
73552                                         CFStringRef path,
73553                                         CFDictionaryRef value
73554                                         );
73555 Boolean
73556 SCPreferencesPathSetLink (
73557                                         SCPreferencesRef session,
73558                                         CFStringRef path,
73559                                         CFStringRef link
73560                                         );
73561 Boolean
73562 SCPreferencesPathRemoveValue (
73563                                         SCPreferencesRef session,
73564                                         CFStringRef path
73565                                         );
73566
73567 }
73568
73569
73570
73571
73572 typedef u_char sa_family_t;
73573 struct linger {
73574         int l_onoff;
73575         int l_linger;
73576 };
73577 struct sockaddr {
73578         u_char sa_len;
73579         u_char sa_family;
73580         char sa_data[14];
73581 };
73582
73583
73584
73585
73586
73587
73588 struct sockproto {
73589         u_short sp_family;
73590         u_short sp_protocol;
73591 };
73592 struct sockaddr_storage {
73593         u_char ss_len;
73594         sa_family_t ss_family;
73595         char __ss_pad1[((sizeof(int64_t)) - sizeof(u_char) - sizeof(sa_family_t))];
73596         int64_t __ss_align;
73597         char __ss_pad2[(128 - sizeof(u_char) - sizeof(sa_family_t) - ((sizeof(int64_t)) - sizeof(u_char) - sizeof(sa_family_t)) - (sizeof(int64_t)))];
73598 };
73599 struct msghdr {
73600         caddr_t msg_name;
73601         u_int msg_namelen;
73602         struct iovec *msg_iov;
73603         u_int msg_iovlen;
73604         caddr_t msg_control;
73605         u_int msg_controllen;
73606         int msg_flags;
73607 };
73608 struct cmsghdr {
73609         u_int cmsg_len;
73610         int cmsg_level;
73611         int cmsg_type;
73612
73613 };
73614 struct osockaddr {
73615         u_short sa_family;
73616         char sa_data[14];
73617 };
73618
73619
73620
73621
73622 struct omsghdr {
73623         caddr_t msg_name;
73624         int msg_namelen;
73625         struct iovec *msg_iov;
73626         int msg_iovlen;
73627         caddr_t msg_accrights;
73628         int msg_accrightslen;
73629 };
73630 extern "C" {
73631 int accept (int, struct sockaddr *, int *);
73632 int bind (int, const struct sockaddr *, int);
73633 int connect (int, const struct sockaddr *, int);
73634 int getpeername (int, struct sockaddr *, int *);
73635 int getsockname (int, struct sockaddr *, int *);
73636 int getsockopt (int, int, int, void *, int *);
73637 int listen (int, int);
73638 ssize_t recv (int, void *, size_t, int);
73639 ssize_t recvfrom (int, void *, size_t, int, struct sockaddr *, int *);
73640 ssize_t recvmsg (int, struct msghdr *, int);
73641 ssize_t send (int, const void *, size_t, int);
73642 ssize_t sendto (int, const void *, size_t, int, const struct sockaddr *, int);
73643
73644 ssize_t sendmsg (int, const struct msghdr *, int);
73645
73646
73647
73648 int setsockopt (int, int, int, const void *, int);
73649 int shutdown (int, int);
73650 int socket (int, int, int);
73651 int socketpair (int, int, int, int *);
73652
73653 void pfctlinput (int, struct sockaddr *);
73654 }
73655
73656
73657 extern double acos (double);
73658 extern double asin (double);
73659 extern double atan (double);
73660 extern double atan2 (double, double);
73661 extern double ceil (double);
73662 extern double cos (double);
73663 extern double cosh (double);
73664 extern double exp (double);
73665 extern double fabs (double);
73666 extern double floor (double);
73667 extern double fmod (double, double);
73668 extern double frexp (double, int *);
73669 extern double ldexp (double, int);
73670 extern double log10 (double);
73671 extern double log (double);
73672 extern double modf (double, double *);
73673 extern double pow (double, double);
73674 extern double sin (double);
73675 extern double sinh (double);
73676 extern double sqrt (double);
73677 extern double tan (double);
73678 extern double tanh (double);
73679
73680
73681 typedef enum {
73682         kSCNetworkFlagsTransientConnection = 1<<0,
73683         kSCNetworkFlagsReachable = 1<<1,
73684         kSCNetworkFlagsConnectionRequired = 1<<2,
73685         kSCNetworkFlagsConnectionAutomatic = 1<<3,
73686         kSCNetworkFlagsInterventionRequired = 1<<4,
73687 } SCNetworkConnectionFlags;
73688
73689
73690 extern "C" {
73691 Boolean
73692 SCNetworkCheckReachabilityByAddress (
73693                                         const struct sockaddr *address,
73694                                         const int addrlen,
73695                                         SCNetworkConnectionFlags *flags
73696                                         );
73697 Boolean
73698 SCNetworkCheckReachabilityByName (
73699                                         const char *nodename,
73700                                         SCNetworkConnectionFlags *flags
73701                                         );
73702
73703 }
73704
73705 extern "C" {
73706
73707
73708
73709
73710
73711
73712 int SCError ();
73713 const char * SCErrorString (int status);
73714
73715 }
73716
73717
73718
73719 extern "C" {
73720 typedef GDHandle AGLDevice;
73721
73722
73723
73724
73725 typedef CGrafPtr AGLDrawable;
73726
73727
73728
73729
73730 typedef struct __AGLRendererInfoRec *AGLRendererInfo;
73731 typedef struct __AGLPixelFormatRec *AGLPixelFormat;
73732 typedef struct __AGLContextRec *AGLContext;
73733 extern AGLPixelFormat aglChoosePixelFormat(const AGLDevice *gdevs, GLint ndev, const GLint *attribs);
73734 extern void aglDestroyPixelFormat(AGLPixelFormat pix);
73735 extern AGLPixelFormat aglNextPixelFormat(AGLPixelFormat pix);
73736 extern GLboolean aglDescribePixelFormat(AGLPixelFormat pix, GLint attrib, GLint *value);
73737 extern AGLDevice *aglDevicesOfPixelFormat(AGLPixelFormat pix, GLint *ndevs);
73738
73739
73740
73741
73742 extern AGLRendererInfo aglQueryRendererInfo(const AGLDevice *gdevs, GLint ndev);
73743 extern void aglDestroyRendererInfo(AGLRendererInfo rend);
73744 extern AGLRendererInfo aglNextRendererInfo(AGLRendererInfo rend);
73745 extern GLboolean aglDescribeRenderer(AGLRendererInfo rend, GLint prop, GLint *value);
73746
73747
73748
73749
73750 extern AGLContext aglCreateContext(AGLPixelFormat pix, AGLContext share);
73751 extern GLboolean aglDestroyContext(AGLContext ctx);
73752 extern GLboolean aglCopyContext(AGLContext src, AGLContext dst, GLuint mask);
73753 extern GLboolean aglUpdateContext(AGLContext ctx);
73754
73755
73756
73757
73758 extern GLboolean aglSetCurrentContext(AGLContext ctx);
73759 extern AGLContext aglGetCurrentContext(void);
73760
73761
73762
73763
73764 extern GLboolean aglSetDrawable(AGLContext ctx, AGLDrawable draw);
73765 extern GLboolean aglSetOffScreen(AGLContext ctx, GLsizei width, GLsizei height, GLsizei rowbytes, GLvoid *baseaddr);
73766 extern GLboolean aglSetFullScreen(AGLContext ctx, GLsizei width, GLsizei height, GLsizei freq, GLint device);
73767 extern AGLDrawable aglGetDrawable(AGLContext ctx);
73768
73769
73770
73771
73772 extern GLboolean aglSetVirtualScreen(AGLContext ctx, GLint screen);
73773 extern GLint aglGetVirtualScreen(AGLContext ctx);
73774
73775
73776
73777
73778 extern void aglGetVersion(GLint *major, GLint *minor);
73779
73780
73781
73782
73783 extern GLboolean aglConfigure(GLenum pname, GLuint param);
73784
73785
73786
73787
73788 extern void aglSwapBuffers(AGLContext ctx);
73789
73790
73791
73792
73793 extern GLboolean aglEnable(AGLContext ctx, GLenum pname);
73794 extern GLboolean aglDisable(AGLContext ctx, GLenum pname);
73795 extern GLboolean aglIsEnabled(AGLContext ctx, GLenum pname);
73796 extern GLboolean aglSetInteger(AGLContext ctx, GLenum pname, const GLint *params);
73797 extern GLboolean aglGetInteger(AGLContext ctx, GLenum pname, GLint *params);
73798
73799
73800
73801
73802 extern GLboolean aglUseFont(AGLContext ctx, GLint fontID, Style face, GLint size, GLint first, GLint count, GLint base);
73803
73804
73805
73806
73807 extern GLenum aglGetError(void);
73808 extern const GLubyte *aglErrorString(GLenum code);
73809
73810
73811
73812
73813 extern void aglResetLibrary(void);
73814
73815
73816
73817
73818 extern void aglSurfaceTexture (AGLContext context, GLenum target, GLenum internalformat, AGLContext surfacecontext);
73819
73820
73821 }
73822
73823
73824
73825 // we have to include any #defines from Apple's headers that we need here
73826 #define InstallWindowEventHandler( t, h, n, l, u, r ) \
73827        InstallEventHandler( GetWindowEventTarget( t ), (h), (n), (l), (u), (r) )
73828 #define InstallControlEventHandler( t, h, n, l, u, r ) \
73829         InstallEventHandler( GetControlEventTarget( t ), (h), (n), (l), (u), (r) )
73830 #define InstallMenuEventHandler( t, h, n, l, u, r ) \
73831       InstallEventHandler( GetMenuEventTarget( t ), (h), (n), (l), (u), (r) )
73832
73833 #define AGL_VERSION_2_0  1
73834 #define AGL_NONE                   0
73835 #define AGL_ALL_RENDERERS          1  /* choose from all available renderers          */
73836 #define AGL_BUFFER_SIZE            2  /* depth of the index buffer                    */
73837 #define AGL_LEVEL                  3  /* level in plane stacking                      */
73838 #define AGL_RGBA                   4  /* choose an RGBA format                        */
73839 #define AGL_DOUBLEBUFFER           5  /* double buffering supported                   */
73840 #define AGL_STEREO                 6  /* stereo buffering supported                   */
73841 #define AGL_AUX_BUFFERS            7  /* number of aux buffers                        */
73842 #define AGL_RED_SIZE               8  /* number of red component bits                 */
73843 #define AGL_GREEN_SIZE             9  /* number of green component bits               */
73844 #define AGL_BLUE_SIZE             10  /* number of blue component bits                */
73845 #define AGL_ALPHA_SIZE            11  /* number of alpha component bits               */
73846 #define AGL_DEPTH_SIZE            12  /* number of depth bits                         */
73847 #define AGL_STENCIL_SIZE          13  /* number of stencil bits                       */
73848 #define AGL_ACCUM_RED_SIZE        14  /* number of red accum bits                     */
73849 #define AGL_ACCUM_GREEN_SIZE      15  /* number of green accum bits                   */
73850 #define AGL_ACCUM_BLUE_SIZE       16  /* number of blue accum bits                    */
73851 #define AGL_ACCUM_ALPHA_SIZE      17  /* number of alpha accum bits                   */
73852 #define AGL_PIXEL_SIZE            50  /* frame buffer bits per pixel                  */
73853 #define AGL_MINIMUM_POLICY        51  /* never choose smaller buffers than requested  */
73854 #define AGL_MAXIMUM_POLICY        52  /* choose largest buffers of type requested     */
73855 #define AGL_OFFSCREEN             53  /* choose an off-screen capable renderer        */
73856 #define AGL_FULLSCREEN            54  /* choose a full-screen capable renderer        */
73857 #define AGL_SAMPLE_BUFFERS_ARB    55  /* number of multi sample buffers               */
73858 #define AGL_SAMPLES_ARB           56  /* number of samples per multi sample buffer    */
73859 #define AGL_AUX_DEPTH_STENCIL     57  /* independent depth and/or stencil buffers for the aux buffer */
73860 #define AGL_RENDERER_ID           70  /* request renderer by ID                       */
73861 #define AGL_SINGLE_RENDERER       71  /* choose a single renderer for all screens     */
73862 #define AGL_NO_RECOVERY           72  /* disable all failure recovery systems         */
73863 #define AGL_ACCELERATED           73  /* choose a hardware accelerated renderer       */
73864 #define AGL_CLOSEST_POLICY        74  /* choose the closest color buffer to request   */
73865 #define AGL_ROBUST                75  /* renderer does not need failure recovery      */
73866 #define AGL_BACKING_STORE         76  /* back buffer contents are valid after swap    */
73867 #define AGL_MP_SAFE               78  /* renderer is multi-processor safe             */
73868 #define AGL_WINDOW                80  /* can be used to render to an onscreen window  */
73869 #define AGL_MULTISCREEN           81  /* single window can span multiple screens      */
73870 #define AGL_VIRTUAL_SCREEN        82  /* virtual screen number                        */
73871 #define AGL_COMPLIANT             83  /* renderer is opengl compliant                 */
73872 /* #define AGL_OFFSCREEN          53 */
73873 /* #define AGL_FULLSCREEN         54 */
73874 /* #define AGL_RENDERER_ID        70 */
73875 /* #define AGL_ACCELERATED        73 */
73876 /* #define AGL_ROBUST             75 */
73877 /* #define AGL_BACKING_STORE      76 */
73878 /* #define AGL_MP_SAFE            78 */
73879 /* #define AGL_WINDOW             80 */
73880 /* #define AGL_MULTISCREEN        81 */
73881 /* #define AGL_COMPLIANT          83 */
73882 #define AGL_BUFFER_MODES         100
73883 #define AGL_MIN_LEVEL            101
73884 #define AGL_MAX_LEVEL            102
73885 #define AGL_COLOR_MODES          103
73886 #define AGL_ACCUM_MODES          104
73887 #define AGL_DEPTH_MODES          105
73888 #define AGL_STENCIL_MODES        106
73889 #define AGL_MAX_AUX_BUFFERS      107
73890 #define AGL_VIDEO_MEMORY         120
73891 #define AGL_TEXTURE_MEMORY       121
73892 #define AGL_SWAP_RECT            200  /* Enable or set the swap rectangle              */
73893 #define AGL_BUFFER_RECT          202  /* Enable or set the buffer rectangle            */
73894 #define AGL_SWAP_LIMIT           203  /* Enable or disable the swap async limit        */
73895 #define AGL_COLORMAP_TRACKING    210  /* Enable or disable colormap tracking           */
73896 #define AGL_COLORMAP_ENTRY       212  /* Set a colormap entry to {index, r, g, b}      */
73897 #define AGL_RASTERIZATION        220  /* Enable or disable all rasterization           */
73898 #define AGL_SWAP_INTERVAL        222  /* 0 -> Don't sync, n -> Sync every n retrace    */
73899 #define AGL_STATE_VALIDATION     230  /* Validate state for multi-screen functionality */
73900 #define AGL_BUFFER_NAME          231  /* Set the buffer name. Allows for multi ctx to share a buffer */
73901 #define AGL_ORDER_CONTEXT_TO_FRONT  232  /* Order the current context in front of all the other contexts. */
73902 #define AGL_CONTEXT_SURFACE_ID   233  /* aglGetInteger only - returns the ID of the drawable surface for the context */
73903 #define AGL_CONTEXT_DISPLAY_ID   234  /* aglGetInteger only - returns the display ID(s) of all displays touched by the context, up to a maximum of 32 displays */
73904 #define AGL_SURFACE_ORDER        235  /* Position of OpenGL surface relative to window: 1 -> Above window, -1 -> Below Window */
73905 #define AGL_SURFACE_OPACITY      236  /* Opacity of OpenGL surface: 1 -> Surface is opaque (default), 0 -> non-opaque */
73906 #define AGL_CLIP_REGION          254  /* Enable or set the drawable clipping region */
73907 #define AGL_FS_CAPTURE_SINGLE    255  /* Enable the capture of only a single display for aglFullScreen, normally disabled */
73908 #define AGL_FORMAT_CACHE_SIZE    501  /* Set the size of the pixel format cache        */
73909 #define AGL_CLEAR_FORMAT_CACHE   502  /* Reset the pixel format cache                  */
73910 #define AGL_RETAIN_RENDERERS     503  /* Whether to retain loaded renderers in memory  */
73911 #define AGL_MONOSCOPIC_BIT       0x00000001
73912 #define AGL_STEREOSCOPIC_BIT     0x00000002
73913 #define AGL_SINGLEBUFFER_BIT     0x00000004
73914 #define AGL_DOUBLEBUFFER_BIT     0x00000008
73915 #define AGL_0_BIT                0x00000001
73916 #define AGL_1_BIT                0x00000002
73917 #define AGL_2_BIT                0x00000004
73918 #define AGL_3_BIT                0x00000008
73919 #define AGL_4_BIT                0x00000010
73920 #define AGL_5_BIT                0x00000020
73921 #define AGL_6_BIT                0x00000040
73922 #define AGL_8_BIT                0x00000080
73923 #define AGL_10_BIT               0x00000100
73924 #define AGL_12_BIT               0x00000200
73925 #define AGL_16_BIT               0x00000400
73926 #define AGL_24_BIT               0x00000800
73927 #define AGL_32_BIT               0x00001000
73928 #define AGL_48_BIT               0x00002000
73929 #define AGL_64_BIT               0x00004000
73930 #define AGL_96_BIT               0x00008000
73931 #define AGL_128_BIT              0x00010000
73932 #define AGL_RGB8_BIT             0x00000001  /* 8 rgb bit/pixel,     RGB=7:0, inverse colormap         */
73933 #define AGL_RGB8_A8_BIT          0x00000002  /* 8-8 argb bit/pixel,  A=7:0, RGB=7:0, inverse colormap  */
73934 #define AGL_BGR233_BIT           0x00000004  /* 8 rgb bit/pixel,     B=7:6, G=5:3, R=2:0               */
73935 #define AGL_BGR233_A8_BIT        0x00000008  /* 8-8 argb bit/pixel,  A=7:0, B=7:6, G=5:3, R=2:0        */
73936 #define AGL_RGB332_BIT           0x00000010  /* 8 rgb bit/pixel,     R=7:5, G=4:2, B=1:0               */
73937 #define AGL_RGB332_A8_BIT        0x00000020  /* 8-8 argb bit/pixel,  A=7:0, R=7:5, G=4:2, B=1:0        */
73938 #define AGL_RGB444_BIT           0x00000040  /* 16 rgb bit/pixel,    R=11:8, G=7:4, B=3:0              */
73939 #define AGL_ARGB4444_BIT         0x00000080  /* 16 argb bit/pixel,   A=15:12, R=11:8, G=7:4, B=3:0     */
73940 #define AGL_RGB444_A8_BIT        0x00000100  /* 8-16 argb bit/pixel, A=7:0, R=11:8, G=7:4, B=3:0       */
73941 #define AGL_RGB555_BIT           0x00000200  /* 16 rgb bit/pixel,    R=14:10, G=9:5, B=4:0             */
73942 #define AGL_ARGB1555_BIT         0x00000400  /* 16 argb bit/pixel,   A=15, R=14:10, G=9:5, B=4:0       */
73943 #define AGL_RGB555_A8_BIT        0x00000800  /* 8-16 argb bit/pixel, A=7:0, R=14:10, G=9:5, B=4:0      */
73944 #define AGL_RGB565_BIT           0x00001000  /* 16 rgb bit/pixel,    R=15:11, G=10:5, B=4:0            */
73945 #define AGL_RGB565_A8_BIT        0x00002000  /* 8-16 argb bit/pixel, A=7:0, R=15:11, G=10:5, B=4:0     */
73946 #define AGL_RGB888_BIT           0x00004000  /* 32 rgb bit/pixel,    R=23:16, G=15:8, B=7:0            */
73947 #define AGL_ARGB8888_BIT         0x00008000  /* 32 argb bit/pixel,   A=31:24, R=23:16, G=15:8, B=7:0   */
73948 #define AGL_RGB888_A8_BIT        0x00010000  /* 8-32 argb bit/pixel, A=7:0, R=23:16, G=15:8, B=7:0     */
73949 #define AGL_RGB101010_BIT        0x00020000  /* 32 rgb bit/pixel,    R=29:20, G=19:10, B=9:0           */
73950 #define AGL_ARGB2101010_BIT      0x00040000  /* 32 argb bit/pixel,   A=31:30  R=29:20, G=19:10, B=9:0  */
73951 #define AGL_RGB101010_A8_BIT     0x00080000  /* 8-32 argb bit/pixel, A=7:0  R=29:20, G=19:10, B=9:0    */
73952 #define AGL_RGB121212_BIT        0x00100000  /* 48 rgb bit/pixel,    R=35:24, G=23:12, B=11:0          */
73953 #define AGL_ARGB12121212_BIT     0x00200000  /* 48 argb bit/pixel,   A=47:36, R=35:24, G=23:12, B=11:0 */
73954 #define AGL_RGB161616_BIT        0x00400000  /* 64 rgb bit/pixel,    R=47:32, G=31:16, B=15:0          */
73955 #define AGL_ARGB16161616_BIT     0x00800000  /* 64 argb bit/pixel,   A=63:48, R=47:32, G=31:16, B=15:0 */
73956 #define AGL_INDEX8_BIT           0x20000000  /* 8 bit color look up table                              */
73957 #define AGL_INDEX16_BIT          0x40000000  /* 16 bit color look up table                             */
73958 #define AGL_NO_ERROR                 0 /* no error                        */
73959 #define AGL_BAD_ATTRIBUTE        10000 /* invalid pixel format attribute  */
73960 #define AGL_BAD_PROPERTY         10001 /* invalid renderer property       */
73961 #define AGL_BAD_PIXELFMT         10002 /* invalid pixel format            */
73962 #define AGL_BAD_RENDINFO         10003 /* invalid renderer info           */
73963 #define AGL_BAD_CONTEXT          10004 /* invalid context                 */
73964 #define AGL_BAD_DRAWABLE         10005 /* invalid drawable                */
73965 #define AGL_BAD_GDEV             10006 /* invalid graphics device         */
73966 #define AGL_BAD_STATE            10007 /* invalid context state           */
73967 #define AGL_BAD_VALUE            10008 /* invalid numerical value         */
73968 #define AGL_BAD_MATCH            10009 /* invalid share context           */
73969 #define AGL_BAD_ENUM             10010 /* invalid enumerant               */
73970 #define AGL_BAD_OFFSCREEN        10011 /* invalid offscreen drawable      */
73971 #define AGL_BAD_FULLSCREEN       10012 /* invalid offscreen drawable      */
73972 #define AGL_BAD_WINDOW           10013 /* invalid window                  */
73973 #define AGL_BAD_POINTER          10014 /* invalid pointer                 */
73974 #define AGL_BAD_MODULE           10015 /* invalid code module             */
73975 #define AGL_BAD_ALLOC            10016 /* memory allocation failure       */
73976
73977
73978 #define kSCPropNetOverridePrimary                SCSTR("OverridePrimary")                 /* CFNumber (0 or 1) */
73979 #define kSCPropNetServiceOrder                   SCSTR("ServiceOrder")                    /* CFArray[CFString] */
73980 #define kSCPropNetPPPOverridePrimary             SCSTR("PPPOverridePrimary")              /* CFNumber (0 or 1) */
73981 #define kSCPropNetInterfaces                     SCSTR("Interfaces")                      /* CFArray[CFString] */
73982 #define kSCPropNetLocalHostName                  SCSTR("LocalHostName")                   /* CFString */
73983 #define kSCPropNetAirPortAllowNetCreation        SCSTR("AllowNetCreation")                /* CFNumber (0 or 1) */
73984 #define kSCPropNetAirPortAuthPassword            SCSTR("AuthPassword")                    /* CFData */
73985 #define kSCPropNetAirPortAuthPasswordEncryption  SCSTR("AuthPasswordEncryption")          /* CFString */
73986 #define kSCPropNetAirPortJoinMode                SCSTR("JoinMode")                        /* CFString */
73987 #define kSCPropNetAirPortPowerEnabled            SCSTR("PowerEnabled")                    /* CFNumber (0 or 1) */
73988 #define kSCPropNetAirPortPreferredNetwork        SCSTR("PreferredNetwork")                /* CFString */
73989 #define kSCPropNetAirPortSavePasswords           SCSTR("SavePasswords")                   /* CFNumber (0 or 1) */
73990 /* kSCPropNetAirPortJoinMode values */
73991 #define kSCPropNetAppleTalkComputerName          SCSTR("ComputerName")                    /* CFString */
73992 #define kSCPropNetAppleTalkComputerNameEncoding  SCSTR("ComputerNameEncoding")            /* CFNumber */
73993 #define kSCPropNetAppleTalkConfigMethod          SCSTR("ConfigMethod")                    /* CFString */
73994 #define kSCPropNetAppleTalkDefaultZone           SCSTR("DefaultZone")                     /* CFString */
73995 #define kSCPropNetAppleTalkNetworkID             SCSTR("NetworkID")                       /* CFNumber */
73996 #define kSCPropNetAppleTalkNetworkRange          SCSTR("NetworkRange")                    /* CFArray[CFNumber] */
73997 #define kSCPropNetAppleTalkNodeID                SCSTR("NodeID")                          /* CFNumber */
73998 #define kSCPropNetAppleTalkSeedNetworkRange      SCSTR("SeedNetworkRange")                /* CFArray[CFNumber] */
73999 #define kSCPropNetAppleTalkSeedZones             SCSTR("SeedZones")                       /* CFArray[CFString] */
74000 /* kSCPropNetAppleTalkConfigMethod values */
74001 #define kSCPropNetDNSDomainName                  SCSTR("DomainName")                      /* CFString */
74002 #define kSCPropNetDNSSearchDomains               SCSTR("SearchDomains")                   /* CFArray[CFString] */
74003 #define kSCPropNetDNSServerAddresses             SCSTR("ServerAddresses")                 /* CFArray[CFString] */
74004 #define kSCPropNetDNSSortList                    SCSTR("SortList")                        /* CFArray[CFString] */
74005 #define kSCPropNetInterfaceDeviceName            SCSTR("DeviceName")                      /* CFString */
74006 #define kSCPropNetInterfaceHardware              SCSTR("Hardware")                        /* CFString */
74007 #define kSCPropNetInterfaceType                  SCSTR("Type")                            /* CFString */
74008 #define kSCPropNetInterfaceSubType               SCSTR("SubType")                         /* CFString */
74009 #define kSCPropNetInterfaceSupportsModemOnHold   SCSTR("SupportsModemOnHold")             /* CFNumber (0 or 1) */
74010 /* kSCPropNetInterfaceType values */
74011 /* kSCPropNetServiceSubType values (for PPP) */
74012 #define kSCPropNetIPv4Addresses                  SCSTR("Addresses")                       /* CFArray[CFString] */
74013 #define kSCPropNetIPv4ConfigMethod               SCSTR("ConfigMethod")                    /* CFString */
74014 #define kSCPropNetIPv4DHCPClientID               SCSTR("DHCPClientID")                    /* CFString */
74015 #define kSCPropNetIPv4Router                     SCSTR("Router")                          /* CFString */
74016 #define kSCPropNetIPv4SubnetMasks                SCSTR("SubnetMasks")                     /* CFArray[CFString] */
74017 #define kSCPropNetIPv4DestAddresses              SCSTR("DestAddresses")                   /* CFArray[CFString] */
74018 #define kSCPropNetIPv4BroadcastAddresses         SCSTR("BroadcastAddresses")              /* CFArray[CFString] */
74019 /* kSCPropNetIPv4ConfigMethod values */
74020 #define kSCPropNetIPv6Addresses                  SCSTR("Addresses")                       /* CFArray[CFString] */
74021 #define kSCPropNetIPv6ConfigMethod               SCSTR("ConfigMethod")                    /* CFString */
74022 #define kSCPropNetLinkActive                     SCSTR("Active")                          /* CFBoolean */
74023 #define kSCPropNetLinkDetaching                  SCSTR("Detaching")                       /* CFBoolean */
74024 #define kSCPropNetModemConnectionScript          SCSTR("ConnectionScript")                /* CFString */
74025 #define kSCPropNetModemConnectSpeed              SCSTR("ConnectSpeed")                    /* CFNumber */
74026 #define kSCPropNetModemDataCompression           SCSTR("DataCompression")                 /* CFNumber (0 or 1) */
74027 #define kSCPropNetModemDialMode                  SCSTR("DialMode")                        /* CFString */
74028 #define kSCPropNetModemErrorCorrection           SCSTR("ErrorCorrection")                 /* CFNumber (0 or 1) */
74029 #define kSCPropNetModemHoldCallWaitingAudibleAlert SCSTR("HoldCallWaitingAudibleAlert")     /* CFNumber (0 or 1) */
74030 #define kSCPropNetModemHoldDisconnectOnAnswer    SCSTR("HoldDisconnectOnAnswer")          /* CFNumber (0 or 1) */
74031 #define kSCPropNetModemHoldEnabled               SCSTR("HoldEnabled")                     /* CFNumber (0 or 1) */
74032 #define kSCPropNetModemHoldReminder              SCSTR("HoldReminder")                    /* CFNumber (0 or 1) */
74033 #define kSCPropNetModemHoldReminderTime          SCSTR("HoldReminderTime")                /* CFNumber */
74034 #define kSCPropNetModemNote                      SCSTR("Note")                            /* CFString */
74035 #define kSCPropNetModemPulseDial                 SCSTR("PulseDial")                       /* CFNumber (0 or 1) */
74036 #define kSCPropNetModemSpeaker                   SCSTR("Speaker")                         /* CFNumber (0 or 1) */
74037 #define kSCPropNetModemSpeed                     SCSTR("Speed")                           /* CFNumber */
74038 /* kSCPropNetModemDialMode values */
74039 #define kSCPropNetNetInfoBindingMethods          SCSTR("BindingMethods")                  /* CFString */
74040 #define kSCPropNetNetInfoServerAddresses         SCSTR("ServerAddresses")                 /* CFArray[CFString] */
74041 #define kSCPropNetNetInfoServerTags              SCSTR("ServerTags")                      /* CFArray[CFString] */
74042 #define kSCPropNetNetInfoBroadcastServerTag      SCSTR("BroadcastServerTag")              /* CFString */
74043 /* kSCPropNetNetInfoBindingMethods values */
74044 /* kSCPropNetNetInfoBroadcastServerTag default value */
74045 #define kSCPropNetPPPConnectTime                 SCSTR("ConnectTime")                     /* CFNumber */
74046 #define kSCPropNetPPPDeviceLastCause             SCSTR("DeviceLastCause")                 /* CFNumber */
74047 #define kSCPropNetPPPDialOnDemand                SCSTR("DialOnDemand")                    /* CFNumber (0 or 1) */
74048 #define kSCPropNetPPPDisconnectOnIdle            SCSTR("DisconnectOnIdle")                /* CFNumber (0 or 1) */
74049 #define kSCPropNetPPPDisconnectOnIdleTimer       SCSTR("DisconnectOnIdleTimer")           /* CFNumber */
74050 #define kSCPropNetPPPDisconnectOnLogout          SCSTR("DisconnectOnLogout")              /* CFNumber (0 or 1) */
74051 #define kSCPropNetPPPDisconnectOnSleep           SCSTR("DisconnectOnSleep")               /* CFNumber (0 or 1) */
74052 #define kSCPropNetPPPIdleReminderTimer           SCSTR("IdleReminderTimer")               /* CFNumber */
74053 #define kSCPropNetPPPIdleReminder                SCSTR("IdleReminder")                    /* CFNumber (0 or 1) */
74054 #define kSCPropNetPPPLastCause                   SCSTR("LastCause")                       /* CFNumber */
74055 #define kSCPropNetPPPLogfile                     SCSTR("Logfile")                         /* CFString */
74056 #define kSCPropNetPPPPlugins                     SCSTR("Plugins")                         /* CFArray[CFString] */
74057 #define kSCPropNetPPPSessionTimer                SCSTR("SessionTimer")                    /* CFNumber */
74058 #define kSCPropNetPPPStatus                      SCSTR("Status")                          /* CFString */
74059 #define kSCPropNetPPPUseSessionTimer             SCSTR("UseSessionTimer")                 /* CFNumber (0 or 1) */
74060 #define kSCPropNetPPPVerboseLogging              SCSTR("VerboseLogging")                  /* CFNumber (0 or 1) */
74061 #define kSCPropNetPPPAuthName                    SCSTR("AuthName")                        /* CFString */
74062 #define kSCPropNetPPPAuthPassword                SCSTR("AuthPassword")                    /* CFString */
74063 #define kSCPropNetPPPAuthPasswordEncryption      SCSTR("AuthPasswordEncryption")          /* CFString */
74064 #define kSCPropNetPPPAuthProtocol                SCSTR("AuthProtocol")                    /* CFArray[CFString] */
74065 /* kSCPropNetPPPAuthProtocol values */
74066 #define kSCPropNetPPPCommAlternateRemoteAddress  SCSTR("CommAlternateRemoteAddress")      /* CFString */
74067 #define kSCPropNetPPPCommConnectDelay            SCSTR("CommConnectDelay")                /* CFNumber */
74068 #define kSCPropNetPPPCommDisplayTerminalWindow   SCSTR("CommDisplayTerminalWindow")       /* CFNumber (0 or 1) */
74069 #define kSCPropNetPPPCommRedialCount             SCSTR("CommRedialCount")                 /* CFNumber */
74070 #define kSCPropNetPPPCommRedialEnabled           SCSTR("CommRedialEnabled")               /* CFNumber (0 or 1) */
74071 #define kSCPropNetPPPCommRedialInterval          SCSTR("CommRedialInterval")              /* CFNumber */
74072 #define kSCPropNetPPPCommRemoteAddress           SCSTR("CommRemoteAddress")               /* CFString */
74073 #define kSCPropNetPPPCommTerminalScript          SCSTR("CommTerminalScript")              /* CFString */
74074 #define kSCPropNetPPPCommUseTerminalScript       SCSTR("CommUseTerminalScript")           /* CFNumber (0 or 1) */
74075 #define kSCPropNetPPPCCPEnabled                  SCSTR("CCPEnabled")                      /* CFNumber (0 or 1) */
74076 #define kSCPropNetPPPIPCPCompressionVJ           SCSTR("IPCPCompressionVJ")               /* CFNumber (0 or 1) */
74077 #define kSCPropNetPPPLCPEchoEnabled              SCSTR("LCPEchoEnabled")                  /* CFNumber (0 or 1) */
74078 #define kSCPropNetPPPLCPEchoFailure              SCSTR("LCPEchoFailure")                  /* CFNumber */
74079 #define kSCPropNetPPPLCPEchoInterval             SCSTR("LCPEchoInterval")                 /* CFNumber */
74080 #define kSCPropNetPPPLCPCompressionACField       SCSTR("LCPCompressionACField")           /* CFNumber (0 or 1) */
74081 #define kSCPropNetPPPLCPCompressionPField        SCSTR("LCPCompressionPField")            /* CFNumber (0 or 1) */
74082 #define kSCPropNetPPPLCPMRU                      SCSTR("LCPMRU")                          /* CFNumber */
74083 #define kSCPropNetPPPLCPMTU                      SCSTR("LCPMTU")                          /* CFNumber */
74084 #define kSCPropNetPPPLCPReceiveACCM              SCSTR("LCPReceiveACCM")                  /* CFNumber */
74085 #define kSCPropNetPPPLCPTransmitACCM             SCSTR("LCPTransmitACCM")                 /* CFNumber */
74086 #define kSCPropNetProxiesExceptionsList          SCSTR("ExceptionsList")                  /* CFArray[CFString] */
74087 #define kSCPropNetProxiesFTPEnable               SCSTR("FTPEnable")                       /* CFNumber (0 or 1) */
74088 #define kSCPropNetProxiesFTPPassive              SCSTR("FTPPassive")                      /* CFNumber (0 or 1) */
74089 #define kSCPropNetProxiesFTPPort                 SCSTR("FTPPort")                         /* CFNumber */
74090 #define kSCPropNetProxiesFTPProxy                SCSTR("FTPProxy")                        /* CFString */
74091 #define kSCPropNetProxiesGopherEnable            SCSTR("GopherEnable")                    /* CFNumber (0 or 1) */
74092 #define kSCPropNetProxiesGopherPort              SCSTR("GopherPort")                      /* CFNumber */
74093 #define kSCPropNetProxiesGopherProxy             SCSTR("GopherProxy")                     /* CFString */
74094 #define kSCPropNetProxiesHTTPEnable              SCSTR("HTTPEnable")                      /* CFNumber (0 or 1) */
74095 #define kSCPropNetProxiesHTTPPort                SCSTR("HTTPPort")                        /* CFNumber */
74096 #define kSCPropNetProxiesHTTPProxy               SCSTR("HTTPProxy")                       /* CFString */
74097 #define kSCPropNetProxiesHTTPSEnable             SCSTR("HTTPSEnable")                     /* CFNumber (0 or 1) */
74098 #define kSCPropNetProxiesHTTPSPort               SCSTR("HTTPSPort")                       /* CFNumber */
74099 #define kSCPropNetProxiesHTTPSProxy              SCSTR("HTTPSProxy")                      /* CFString */
74100 #define kSCPropNetProxiesRTSPEnable              SCSTR("RTSPEnable")                      /* CFNumber (0 or 1) */
74101 #define kSCPropNetProxiesRTSPPort                SCSTR("RTSPPort")                        /* CFNumber */
74102 #define kSCPropNetProxiesRTSPProxy               SCSTR("RTSPProxy")                       /* CFString */
74103 #define kSCPropNetProxiesSOCKSEnable             SCSTR("SOCKSEnable")                     /* CFNumber (0 or 1) */
74104 #define kSCPropNetProxiesSOCKSPort               SCSTR("SOCKSPort")                       /* CFNumber */
74105 #define kSCPropNetProxiesSOCKSProxy              SCSTR("SOCKSProxy")                      /* CFString */
74106
74107 #define CFSTR(cStr)  __CFStringMakeConstantString("" cStr "")
74108 #define  SCSTR(s) CFSTR(s)
74109
74110 CFDictionaryRef
74111 SCDynamicStoreCopyProxies               (
74112                                         SCDynamicStoreRef       store
74113                                         );
74114
74115