initial checkin
[org.ibex.nanogoat.git] / src / org / ibex / 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 #include <math.h>
5
6 typedef u_int8_t uint8_t;
7 typedef u_int16_t uint16_t;
8 typedef u_int32_t uint32_t;
9 typedef u_int64_t uint64_t;
10
11
12
13 typedef int8_t int_least8_t;
14 typedef int16_t int_least16_t;
15 typedef int32_t int_least32_t;
16 typedef int64_t int_least64_t;
17 typedef uint8_t uint_least8_t;
18 typedef uint16_t uint_least16_t;
19 typedef uint32_t uint_least32_t;
20 typedef uint64_t uint_least64_t;
21
22
23
24 typedef int8_t int_fast8_t;
25 typedef int16_t int_fast16_t;
26 typedef int32_t int_fast32_t;
27 typedef int64_t int_fast64_t;
28 typedef uint8_t uint_fast8_t;
29 typedef uint16_t uint_fast16_t;
30 typedef uint32_t uint_fast32_t;
31 typedef uint64_t uint_fast64_t;
32 typedef long long intmax_t;
33 typedef unsigned long long uintmax_t;
34
35
36
37 extern "C" {
38
39
40 typedef unsigned char UInt8;
41 typedef signed char SInt8;
42 typedef unsigned short UInt16;
43 typedef signed short SInt16;
44 typedef unsigned long UInt32;
45 typedef signed long SInt32;
46
47 struct wide {
48   SInt32 hi;
49   UInt32 lo;
50 };
51 typedef struct wide wide;
52 struct UnsignedWide {
53   UInt32 hi;
54   UInt32 lo;
55 };
56 typedef struct UnsignedWide UnsignedWide;
57       typedef signed long long SInt64;
58         typedef unsigned long long UInt64;
59 typedef long Fixed;
60 typedef Fixed * FixedPtr;
61 typedef long Fract;
62 typedef Fract * FractPtr;
63 typedef unsigned long UnsignedFixed;
64 typedef UnsignedFixed * UnsignedFixedPtr;
65 typedef short ShortFixed;
66 typedef ShortFixed * ShortFixedPtr;
67 typedef float Float32;
68 typedef double Float64;
69 struct Float80 {
70     SInt16 exp;
71     UInt16 man[4];
72 };
73 typedef struct Float80 Float80;
74
75 struct Float96 {
76     SInt16 exp[2];
77     UInt16 man[4];
78 };
79 typedef struct Float96 Float96;
80 struct Float32Point {
81     Float32 x;
82     Float32 y;
83 };
84 typedef struct Float32Point Float32Point;
85 typedef char * Ptr;
86 typedef Ptr * Handle;
87 typedef long Size;
88 typedef SInt16 OSErr;
89 typedef SInt32 OSStatus;
90 typedef void * LogicalAddress;
91 typedef const void * ConstLogicalAddress;
92 typedef void * PhysicalAddress;
93 typedef UInt8 * BytePtr;
94 typedef UInt32 ByteCount;
95 typedef UInt32 ByteOffset;
96 typedef SInt32 Duration;
97 typedef UnsignedWide AbsoluteTime;
98 typedef UInt32 OptionBits;
99 typedef UInt32 ItemCount;
100 typedef UInt32 PBVersion;
101 typedef SInt16 ScriptCode;
102 typedef SInt16 LangCode;
103 typedef SInt16 RegionCode;
104 typedef unsigned long FourCharCode;
105 typedef FourCharCode OSType;
106 typedef FourCharCode ResType;
107 typedef OSType * OSTypePtr;
108 typedef ResType * ResTypePtr;
109 typedef unsigned char Boolean;
110 typedef long ( * ProcPtr)();
111 typedef void ( * Register68kProcPtr)();
112
113
114
115
116 typedef ProcPtr UniversalProcPtr;
117
118
119 typedef ProcPtr * ProcHandle;
120 typedef UniversalProcPtr * UniversalProcHandle;
121 enum {
122   noErr = 0
123 };
124
125 enum {
126   kNilOptions = 0
127 };
128
129
130 enum {
131   kVariableLengthArray = 1
132 };
133
134 enum {
135   kUnknownType = 0x3F3F3F3F
136 };
137 typedef UInt32 UnicodeScalarValue;
138 typedef UInt32 UTF32Char;
139 typedef UInt16 UniChar;
140 typedef UInt16 UTF16Char;
141 typedef UInt8 UTF8Char;
142 typedef UniChar * UniCharPtr;
143 typedef UInt32 UniCharCount;
144 typedef UniCharCount * UniCharCountPtr;
145 typedef unsigned char Str255[256];
146 typedef unsigned char Str63[64];
147 typedef unsigned char Str32[33];
148 typedef unsigned char Str31[32];
149 typedef unsigned char Str27[28];
150 typedef unsigned char Str15[16];
151 typedef unsigned char Str32Field[34];
152 typedef Str63 StrFileName;
153 typedef unsigned char * StringPtr;
154 typedef StringPtr * StringHandle;
155 typedef const unsigned char * ConstStringPtr;
156 typedef const unsigned char * ConstStr255Param;
157 typedef const unsigned char * ConstStr63Param;
158 typedef const unsigned char * ConstStr32Param;
159 typedef const unsigned char * ConstStr31Param;
160 typedef const unsigned char * ConstStr27Param;
161 typedef const unsigned char * ConstStr15Param;
162 typedef ConstStr63Param ConstStrFileNameParam;
163
164 inline unsigned char StrLength(ConstStr255Param string) { return (*string); }
165 struct Point {
166   short v;
167   short h;
168 };
169 typedef struct Point Point;
170 typedef Point * PointPtr;
171 struct Rect {
172   short top;
173   short left;
174   short bottom;
175   short right;
176 };
177 typedef struct Rect Rect;
178 typedef Rect * RectPtr;
179 struct FixedPoint {
180   Fixed x;
181   Fixed y;
182 };
183 typedef struct FixedPoint FixedPoint;
184 struct FixedRect {
185   Fixed left;
186   Fixed top;
187   Fixed right;
188   Fixed bottom;
189 };
190 typedef struct FixedRect FixedRect;
191
192 typedef short CharParameter;
193 enum {
194   normal = 0,
195   bold = 1,
196   italic = 2,
197   underline = 4,
198   outline = 8,
199   shadow = 0x10,
200   condense = 0x20,
201   extend = 0x40
202 };
203
204 typedef unsigned char Style;
205 typedef short StyleParameter;
206 typedef Style StyleField;
207 typedef long TimeValue;
208 typedef long TimeScale;
209 typedef wide CompTimeValue;
210 typedef SInt64 TimeValue64;
211 typedef struct TimeBaseRecord* TimeBase;
212 struct TimeRecord {
213   CompTimeValue value;
214   TimeScale scale;
215   TimeBase base;
216 };
217 typedef struct TimeRecord TimeRecord;
218 struct NumVersion {
219
220   UInt8 majorRev;
221   UInt8 minorAndBugRev;
222   UInt8 stage;
223   UInt8 nonRelRev;
224 };
225 typedef struct NumVersion NumVersion;
226 enum {
227
228   developStage = 0x20,
229   alphaStage = 0x40,
230   betaStage = 0x60,
231   finalStage = 0x80
232 };
233
234 union NumVersionVariant {
235
236   NumVersion parts;
237   unsigned long whole;
238 };
239 typedef union NumVersionVariant NumVersionVariant;
240 typedef NumVersionVariant * NumVersionVariantPtr;
241 typedef NumVersionVariantPtr * NumVersionVariantHandle;
242 struct VersRec {
243
244   NumVersion numericVersion;
245   short countryCode;
246   Str255 shortVersion;
247   Str255 reserved;
248 };
249 typedef struct VersRec VersRec;
250 typedef VersRec * VersRecPtr;
251 typedef VersRecPtr * VersRecHndl;
252
253
254
255
256
257 typedef UInt8 Byte;
258 typedef SInt8 SignedByte;
259 typedef wide * WidePtr;
260 typedef UnsignedWide * UnsignedWidePtr;
261 typedef Float80 extended80;
262 typedef Float96 extended96;
263 typedef SInt8 VHSelect;
264 extern void
265 Debugger(void) ;
266 extern void
267 DebugStr(ConstStr255Param debuggerMsg) ;
268 extern void
269 SysBreak(void) ;
270 extern void
271 SysBreakStr(ConstStr255Param debuggerMsg) ;
272 extern void
273 SysBreakFunc(ConstStr255Param debuggerMsg) ;
274
275
276 }
277 extern "C" {
278 extern double kCFCoreFoundationVersionNumber;
279
280
281
282
283
284
285
286 typedef UInt32 CFTypeID;
287 typedef UInt32 CFOptionFlags;
288 typedef UInt32 CFHashCode;
289 typedef SInt32 CFIndex;
290
291
292 typedef const void * CFTypeRef;
293
294 typedef const struct __CFString * CFStringRef;
295 typedef struct __CFString * CFMutableStringRef;
296
297
298
299
300
301
302 typedef CFTypeRef CFPropertyListRef;
303
304
305 typedef enum {
306     kCFCompareLessThan = -1,
307     kCFCompareEqualTo = 0,
308     kCFCompareGreaterThan = 1
309 } CFComparisonResult;
310
311
312 typedef CFComparisonResult (*CFComparatorFunction)(const void *val1, const void *val2, void *context);
313
314
315
316 enum {
317     kCFNotFound = -1
318 };
319
320
321
322 typedef struct {
323     CFIndex location;
324     CFIndex length;
325 } CFRange;
326
327
328 static __inline__ CFRange CFRangeMake(CFIndex loc, CFIndex len) {
329     CFRange range;
330     range.location = loc;
331     range.length = len;
332     return range;
333 }
334
335
336
337
338
339 extern
340 CFRange __CFRangeMake(CFIndex loc, CFIndex len);
341
342
343
344
345
346 typedef const struct __CFNull * CFNullRef;
347
348 extern
349 CFTypeID CFNullGetTypeID(void);
350
351 extern
352 const CFNullRef kCFNull;
353 typedef const struct __CFAllocator * CFAllocatorRef;
354
355
356 extern
357 const CFAllocatorRef kCFAllocatorDefault;
358
359
360 extern
361 const CFAllocatorRef kCFAllocatorSystemDefault;
362
363
364
365
366
367
368
369 extern
370 const CFAllocatorRef kCFAllocatorMalloc;
371
372
373
374
375
376 extern
377 const CFAllocatorRef kCFAllocatorNull;
378
379
380
381
382
383 extern
384 const CFAllocatorRef kCFAllocatorUseContext;
385
386 typedef const void * (*CFAllocatorRetainCallBack)(const void *info);
387 typedef void (*CFAllocatorReleaseCallBack)(const void *info);
388 typedef CFStringRef (*CFAllocatorCopyDescriptionCallBack)(const void *info);
389 typedef void * (*CFAllocatorAllocateCallBack)(CFIndex allocSize, CFOptionFlags hint, void *info);
390 typedef void * (*CFAllocatorReallocateCallBack)(void *ptr, CFIndex newsize, CFOptionFlags hint, void *info);
391 typedef void (*CFAllocatorDeallocateCallBack)(void *ptr, void *info);
392 typedef CFIndex (*CFAllocatorPreferredSizeCallBack)(CFIndex size, CFOptionFlags hint, void *info);
393 typedef struct {
394     CFIndex version;
395     void * info;
396     CFAllocatorRetainCallBack retain;
397     CFAllocatorReleaseCallBack release;
398     CFAllocatorCopyDescriptionCallBack copyDescription;
399     CFAllocatorAllocateCallBack allocate;
400     CFAllocatorReallocateCallBack reallocate;
401     CFAllocatorDeallocateCallBack deallocate;
402     CFAllocatorPreferredSizeCallBack preferredSize;
403 } CFAllocatorContext;
404
405 extern
406 CFTypeID CFAllocatorGetTypeID(void);
407 extern
408 void CFAllocatorSetDefault(CFAllocatorRef allocator);
409
410 extern
411 CFAllocatorRef CFAllocatorGetDefault(void);
412
413 extern
414 CFAllocatorRef CFAllocatorCreate(CFAllocatorRef allocator, CFAllocatorContext *context);
415
416 extern
417 void *CFAllocatorAllocate(CFAllocatorRef allocator, CFIndex size, CFOptionFlags hint);
418
419 extern
420 void *CFAllocatorReallocate(CFAllocatorRef allocator, void *ptr, CFIndex newsize, CFOptionFlags hint);
421
422 extern
423 void CFAllocatorDeallocate(CFAllocatorRef allocator, void *ptr);
424
425 extern
426 CFIndex CFAllocatorGetPreferredSizeForSize(CFAllocatorRef allocator, CFIndex size, CFOptionFlags hint);
427
428 extern
429 void CFAllocatorGetContext(CFAllocatorRef allocator, CFAllocatorContext *context);
430
431
432
433
434 extern
435 CFTypeID CFGetTypeID(CFTypeRef cf);
436
437 extern
438 CFStringRef CFCopyTypeIDDescription(CFTypeID type_id);
439
440 extern
441 CFTypeRef CFRetain(CFTypeRef cf);
442
443 extern
444 void CFRelease(CFTypeRef cf);
445
446 extern
447 CFIndex CFGetRetainCount(CFTypeRef cf);
448
449 extern
450 Boolean CFEqual(CFTypeRef cf1, CFTypeRef cf2);
451
452 extern
453 CFHashCode CFHash(CFTypeRef cf);
454
455 extern
456 CFStringRef CFCopyDescription(CFTypeRef cf);
457
458 extern
459 CFAllocatorRef CFGetAllocator(CFTypeRef cf);
460
461
462 }
463 extern "C" {
464 typedef const void * (*CFArrayRetainCallBack)(CFAllocatorRef allocator, const void *value);
465 typedef void (*CFArrayReleaseCallBack)(CFAllocatorRef allocator, const void *value);
466 typedef CFStringRef (*CFArrayCopyDescriptionCallBack)(const void *value);
467 typedef Boolean (*CFArrayEqualCallBack)(const void *value1, const void *value2);
468 typedef struct {
469     CFIndex version;
470     CFArrayRetainCallBack retain;
471     CFArrayReleaseCallBack release;
472     CFArrayCopyDescriptionCallBack copyDescription;
473     CFArrayEqualCallBack equal;
474 } CFArrayCallBacks;
475
476
477
478
479
480
481 extern
482 const CFArrayCallBacks kCFTypeArrayCallBacks;
483 typedef void (*CFArrayApplierFunction)(const void *value, void *context);
484
485
486
487
488
489 typedef const struct __CFArray * CFArrayRef;
490
491
492
493
494
495 typedef struct __CFArray * CFMutableArrayRef;
496
497
498
499
500
501 extern
502 CFTypeID CFArrayGetTypeID(void);
503 extern
504 CFArrayRef CFArrayCreate(CFAllocatorRef allocator, const void **values, CFIndex numValues, const CFArrayCallBacks *callBacks);
505 extern
506 CFArrayRef CFArrayCreateCopy(CFAllocatorRef allocator, CFArrayRef theArray);
507 extern
508 CFMutableArrayRef CFArrayCreateMutable(CFAllocatorRef allocator, CFIndex capacity, const CFArrayCallBacks *callBacks);
509 extern
510 CFMutableArrayRef CFArrayCreateMutableCopy(CFAllocatorRef allocator, CFIndex capacity, CFArrayRef theArray);
511 extern
512 CFIndex CFArrayGetCount(CFArrayRef theArray);
513 extern
514 CFIndex CFArrayGetCountOfValue(CFArrayRef theArray, CFRange range, const void *value);
515 extern
516 Boolean CFArrayContainsValue(CFArrayRef theArray, CFRange range, const void *value);
517 extern
518 const void *CFArrayGetValueAtIndex(CFArrayRef theArray, CFIndex idx);
519 extern
520 void CFArrayGetValues(CFArrayRef theArray, CFRange range, const void **values);
521 extern
522 void CFArrayApplyFunction(CFArrayRef theArray, CFRange range, CFArrayApplierFunction applier, void *context);
523 extern
524 CFIndex CFArrayGetFirstIndexOfValue(CFArrayRef theArray, CFRange range, const void *value);
525 extern
526 CFIndex CFArrayGetLastIndexOfValue(CFArrayRef theArray, CFRange range, const void *value);
527 extern
528 CFIndex CFArrayBSearchValues(CFArrayRef theArray, CFRange range, const void *value, CFComparatorFunction comparator, void *context);
529 extern
530 void CFArrayAppendValue(CFMutableArrayRef theArray, const void *value);
531 extern
532 void CFArrayInsertValueAtIndex(CFMutableArrayRef theArray, CFIndex idx, const void *value);
533 extern
534 void CFArraySetValueAtIndex(CFMutableArrayRef theArray, CFIndex idx, const void *value);
535 extern
536 void CFArrayRemoveValueAtIndex(CFMutableArrayRef theArray, CFIndex idx);
537 extern
538 void CFArrayRemoveAllValues(CFMutableArrayRef theArray);
539 extern
540 void CFArrayReplaceValues(CFMutableArrayRef theArray, CFRange range, const void **newValues, CFIndex newCount);
541 extern
542 void CFArrayExchangeValuesAtIndices(CFMutableArrayRef theArray, CFIndex idx1, CFIndex idx2);
543 extern
544 void CFArraySortValues(CFMutableArrayRef theArray, CFRange range, CFComparatorFunction comparator, void *context);
545 extern
546 void CFArrayAppendArray(CFMutableArrayRef theArray, CFArrayRef otherArray, CFRange otherRange);
547
548
549 }
550 extern "C" {
551
552
553 typedef const void * (*CFBagRetainCallBack)(CFAllocatorRef allocator, const void *value);
554 typedef void (*CFBagReleaseCallBack)(CFAllocatorRef allocator, const void *value);
555 typedef CFStringRef (*CFBagCopyDescriptionCallBack)(const void *value);
556 typedef Boolean (*CFBagEqualCallBack)(const void *value1, const void *value2);
557 typedef CFHashCode (*CFBagHashCallBack)(const void *value);
558 typedef struct {
559     CFIndex version;
560     CFBagRetainCallBack retain;
561     CFBagReleaseCallBack release;
562     CFBagCopyDescriptionCallBack copyDescription;
563     CFBagEqualCallBack equal;
564     CFBagHashCallBack hash;
565 } CFBagCallBacks;
566
567 extern
568 const CFBagCallBacks kCFTypeBagCallBacks;
569 extern
570 const CFBagCallBacks kCFCopyStringBagCallBacks;
571
572 typedef void (*CFBagApplierFunction)(const void *value, void *context);
573
574 typedef const struct __CFBag * CFBagRef;
575 typedef struct __CFBag * CFMutableBagRef;
576
577 extern
578 CFTypeID CFBagGetTypeID(void);
579
580 extern
581 CFBagRef CFBagCreate(CFAllocatorRef allocator, const void **values, CFIndex numValues, const CFBagCallBacks *callBacks);
582
583 extern
584 CFBagRef CFBagCreateCopy(CFAllocatorRef allocator, CFBagRef theBag);
585
586 extern
587 CFMutableBagRef CFBagCreateMutable(CFAllocatorRef allocator, CFIndex capacity, const CFBagCallBacks *callBacks);
588
589 extern
590 CFMutableBagRef CFBagCreateMutableCopy(CFAllocatorRef allocator, CFIndex capacity, CFBagRef theBag);
591
592 extern
593 CFIndex CFBagGetCount(CFBagRef theBag);
594
595 extern
596 CFIndex CFBagGetCountOfValue(CFBagRef theBag, const void *value);
597
598 extern
599 Boolean CFBagContainsValue(CFBagRef theBag, const void *value);
600
601 extern
602 const void *CFBagGetValue(CFBagRef theBag, const void *value);
603
604 extern
605 Boolean CFBagGetValueIfPresent(CFBagRef theBag, const void *candidate, const void **value);
606
607 extern
608 void CFBagGetValues(CFBagRef theBag, const void **values);
609
610 extern
611 void CFBagApplyFunction(CFBagRef theBag, CFBagApplierFunction applier, void *context);
612
613 extern
614 void CFBagAddValue(CFMutableBagRef theBag, const void *value);
615
616 extern
617 void CFBagReplaceValue(CFMutableBagRef theBag, const void *value);
618
619 extern
620 void CFBagSetValue(CFMutableBagRef theBag, const void *value);
621
622 extern
623 void CFBagRemoveValue(CFMutableBagRef theBag, const void *value);
624
625 extern
626 void CFBagRemoveAllValues(CFMutableBagRef theBag);
627
628
629 }
630 extern "C" {
631
632
633 typedef const struct __CFData * CFDataRef;
634 typedef struct __CFData * CFMutableDataRef;
635
636 extern
637 CFTypeID CFDataGetTypeID(void);
638
639 extern
640 CFDataRef CFDataCreate(CFAllocatorRef allocator, const UInt8 *bytes, CFIndex length);
641
642 extern
643 CFDataRef CFDataCreateWithBytesNoCopy(CFAllocatorRef allocator, const UInt8 *bytes, CFIndex length, CFAllocatorRef bytesDeallocator);
644
645
646 extern
647 CFDataRef CFDataCreateCopy(CFAllocatorRef allocator, CFDataRef theData);
648
649 extern
650 CFMutableDataRef CFDataCreateMutable(CFAllocatorRef allocator, CFIndex capacity);
651
652 extern
653 CFMutableDataRef CFDataCreateMutableCopy(CFAllocatorRef allocator, CFIndex capacity, CFDataRef theData);
654
655 extern
656 CFIndex CFDataGetLength(CFDataRef theData);
657
658 extern
659 const UInt8 *CFDataGetBytePtr(CFDataRef theData);
660
661 extern
662 UInt8 *CFDataGetMutableBytePtr(CFMutableDataRef theData);
663
664 extern
665 void CFDataGetBytes(CFDataRef theData, CFRange range, UInt8 *buffer);
666
667 extern
668 void CFDataSetLength(CFMutableDataRef theData, CFIndex length);
669
670 extern
671 void CFDataIncreaseLength(CFMutableDataRef theData, CFIndex extraLength);
672
673 extern
674 void CFDataAppendBytes(CFMutableDataRef theData, const UInt8 *bytes, CFIndex length);
675
676 extern
677 void CFDataReplaceBytes(CFMutableDataRef theData, CFRange range, const UInt8 *newBytes, CFIndex newLength);
678
679 extern
680 void CFDataDeleteBytes(CFMutableDataRef theData, CFRange range);
681
682
683 }
684
685
686 extern "C" {
687
688
689
690
691
692
693 typedef const struct __CFCharacterSet * CFCharacterSetRef;
694
695
696
697
698
699 typedef struct __CFCharacterSet * CFMutableCharacterSetRef;
700
701
702
703
704
705 typedef enum {
706     kCFCharacterSetControl = 1,
707     kCFCharacterSetWhitespace,
708     kCFCharacterSetWhitespaceAndNewline,
709     kCFCharacterSetDecimalDigit,
710     kCFCharacterSetLetter,
711     kCFCharacterSetLowercaseLetter,
712     kCFCharacterSetUppercaseLetter,
713     kCFCharacterSetNonBase,
714     kCFCharacterSetDecomposable,
715     kCFCharacterSetAlphaNumeric,
716     kCFCharacterSetPunctuation,
717     kCFCharacterSetIllegal
718
719     ,
720     kCFCharacterSetCapitalizedLetter
721
722 } CFCharacterSetPredefinedSet;
723
724
725
726
727
728 extern
729 CFTypeID CFCharacterSetGetTypeID(void);
730 extern
731 CFCharacterSetRef CFCharacterSetGetPredefined(CFCharacterSetPredefinedSet theSetIdentifier);
732 extern
733 CFCharacterSetRef CFCharacterSetCreateWithCharactersInRange(CFAllocatorRef alloc, CFRange theRange);
734 extern
735 CFCharacterSetRef CFCharacterSetCreateWithCharactersInString(CFAllocatorRef alloc, CFStringRef theString);
736 extern
737 CFCharacterSetRef CFCharacterSetCreateWithBitmapRepresentation(CFAllocatorRef alloc, CFDataRef theData);
738 extern CFCharacterSetRef CFCharacterSetCreateInvertedSet(CFAllocatorRef alloc, CFCharacterSetRef theSet);
739 extern Boolean CFCharacterSetIsSupersetOfSet(CFCharacterSetRef theSet, CFCharacterSetRef theOtherset);
740 extern Boolean CFCharacterSetHasMemberInPlane(CFCharacterSetRef theSet, CFIndex thePlane);
741 extern
742 CFMutableCharacterSetRef CFCharacterSetCreateMutable(CFAllocatorRef alloc);
743 extern
744 CFMutableCharacterSetRef CFCharacterSetCreateMutableCopy(CFAllocatorRef alloc, CFCharacterSetRef theSet);
745 extern
746 Boolean CFCharacterSetIsCharacterMember(CFCharacterSetRef theSet, UniChar theChar);
747 extern Boolean CFCharacterSetIsLongCharacterMember(CFCharacterSetRef theSet, UTF32Char theChar);
748 extern
749 CFDataRef CFCharacterSetCreateBitmapRepresentation(CFAllocatorRef alloc, CFCharacterSetRef theSet);
750 extern
751 void CFCharacterSetAddCharactersInRange(CFMutableCharacterSetRef theSet, CFRange theRange);
752 extern
753 void CFCharacterSetRemoveCharactersInRange(CFMutableCharacterSetRef theSet, CFRange theRange);
754 extern
755 void CFCharacterSetAddCharactersInString(CFMutableCharacterSetRef theSet, CFStringRef theString);
756 extern
757 void CFCharacterSetRemoveCharactersInString(CFMutableCharacterSetRef theSet, CFStringRef theString);
758 extern
759 void CFCharacterSetUnion(CFMutableCharacterSetRef theSet, CFCharacterSetRef theOtherSet);
760 extern
761 void CFCharacterSetIntersect(CFMutableCharacterSetRef theSet, CFCharacterSetRef theOtherSet);
762 extern
763 void CFCharacterSetInvert(CFMutableCharacterSetRef theSet);
764
765
766 }
767
768 extern "C" {
769
770
771 typedef double CFTimeInterval;
772 typedef CFTimeInterval CFAbsoluteTime;
773
774
775
776 extern
777 CFAbsoluteTime CFAbsoluteTimeGetCurrent(void);
778
779 extern
780 const CFTimeInterval kCFAbsoluteTimeIntervalSince1970;
781 extern
782 const CFTimeInterval kCFAbsoluteTimeIntervalSince1904;
783
784 typedef const struct __CFDate * CFDateRef;
785
786 extern
787 CFTypeID CFDateGetTypeID(void);
788
789 extern
790 CFDateRef CFDateCreate(CFAllocatorRef allocator, CFAbsoluteTime at);
791
792 extern
793 CFAbsoluteTime CFDateGetAbsoluteTime(CFDateRef theDate);
794
795 extern
796 CFTimeInterval CFDateGetTimeIntervalSinceDate(CFDateRef theDate, CFDateRef otherDate);
797
798 extern
799 CFComparisonResult CFDateCompare(CFDateRef theDate, CFDateRef otherDate, void *context);
800
801 typedef const struct __CFTimeZone * CFTimeZoneRef;
802
803 typedef struct {
804     SInt32 year;
805     SInt8 month;
806     SInt8 day;
807     SInt8 hour;
808     SInt8 minute;
809     double second;
810 } CFGregorianDate;
811
812 typedef struct {
813     SInt32 years;
814     SInt32 months;
815     SInt32 days;
816     SInt32 hours;
817     SInt32 minutes;
818     double seconds;
819 } CFGregorianUnits;
820
821 typedef enum {
822     kCFGregorianUnitsYears = (1 << 0),
823     kCFGregorianUnitsMonths = (1 << 1),
824     kCFGregorianUnitsDays = (1 << 2),
825     kCFGregorianUnitsHours = (1 << 3),
826     kCFGregorianUnitsMinutes = (1 << 4),
827     kCFGregorianUnitsSeconds = (1 << 5),
828
829
830
831
832     kCFGregorianAllUnits = 0x00FFFFFF
833 } CFGregorianUnitFlags;
834
835 extern
836 Boolean CFGregorianDateIsValid(CFGregorianDate gdate, CFOptionFlags unitFlags);
837
838 extern
839 CFAbsoluteTime CFGregorianDateGetAbsoluteTime(CFGregorianDate gdate, CFTimeZoneRef tz);
840
841 extern
842 CFGregorianDate CFAbsoluteTimeGetGregorianDate(CFAbsoluteTime at, CFTimeZoneRef tz);
843
844 extern
845 CFAbsoluteTime CFAbsoluteTimeAddGregorianUnits(CFAbsoluteTime at, CFTimeZoneRef tz, CFGregorianUnits units);
846
847 extern
848 CFGregorianUnits CFAbsoluteTimeGetDifferenceAsGregorianUnits(CFAbsoluteTime at1, CFAbsoluteTime at2, CFTimeZoneRef tz, CFOptionFlags unitFlags);
849
850 extern
851 SInt32 CFAbsoluteTimeGetDayOfWeek(CFAbsoluteTime at, CFTimeZoneRef tz);
852
853 extern
854 SInt32 CFAbsoluteTimeGetDayOfYear(CFAbsoluteTime at, CFTimeZoneRef tz);
855
856 extern
857 SInt32 CFAbsoluteTimeGetWeekOfYear(CFAbsoluteTime at, CFTimeZoneRef tz);
858
859
860 }
861 extern "C" {
862 typedef const void * (*CFDictionaryRetainCallBack)(CFAllocatorRef allocator, const void *value);
863 typedef void (*CFDictionaryReleaseCallBack)(CFAllocatorRef allocator, const void *value);
864 typedef CFStringRef (*CFDictionaryCopyDescriptionCallBack)(const void *value);
865 typedef Boolean (*CFDictionaryEqualCallBack)(const void *value1, const void *value2);
866 typedef CFHashCode (*CFDictionaryHashCallBack)(const void *value);
867 typedef struct {
868     CFIndex version;
869     CFDictionaryRetainCallBack retain;
870     CFDictionaryReleaseCallBack release;
871     CFDictionaryCopyDescriptionCallBack copyDescription;
872     CFDictionaryEqualCallBack equal;
873     CFDictionaryHashCallBack hash;
874 } CFDictionaryKeyCallBacks;
875
876
877
878
879
880
881
882 extern
883 const CFDictionaryKeyCallBacks kCFTypeDictionaryKeyCallBacks;
884 extern
885 const CFDictionaryKeyCallBacks kCFCopyStringDictionaryKeyCallBacks;
886 typedef struct {
887     CFIndex version;
888     CFDictionaryRetainCallBack retain;
889     CFDictionaryReleaseCallBack release;
890     CFDictionaryCopyDescriptionCallBack copyDescription;
891     CFDictionaryEqualCallBack equal;
892 } CFDictionaryValueCallBacks;
893
894
895
896
897
898
899
900 extern
901 const CFDictionaryValueCallBacks kCFTypeDictionaryValueCallBacks;
902 typedef void (*CFDictionaryApplierFunction)(const void *key, const void *value, void *context);
903
904
905
906
907
908 typedef const struct __CFDictionary * CFDictionaryRef;
909
910
911
912
913
914 typedef struct __CFDictionary * CFMutableDictionaryRef;
915
916
917
918
919
920 extern
921 CFTypeID CFDictionaryGetTypeID(void);
922 extern
923 CFDictionaryRef CFDictionaryCreate(CFAllocatorRef allocator, const void **keys, const void **values, CFIndex numValues, const CFDictionaryKeyCallBacks *keyCallBacks, const CFDictionaryValueCallBacks *valueCallBacks);
924 extern
925 CFDictionaryRef CFDictionaryCreateCopy(CFAllocatorRef allocator, CFDictionaryRef theDict);
926 extern
927 CFMutableDictionaryRef CFDictionaryCreateMutable(CFAllocatorRef allocator, CFIndex capacity, const CFDictionaryKeyCallBacks *keyCallBacks, const CFDictionaryValueCallBacks *valueCallBacks);
928 extern
929 CFMutableDictionaryRef CFDictionaryCreateMutableCopy(CFAllocatorRef allocator, CFIndex capacity, CFDictionaryRef theDict);
930 extern
931 CFIndex CFDictionaryGetCount(CFDictionaryRef theDict);
932 extern
933 CFIndex CFDictionaryGetCountOfKey(CFDictionaryRef theDict, const void *key);
934 extern
935 CFIndex CFDictionaryGetCountOfValue(CFDictionaryRef theDict, const void *value);
936 extern
937 Boolean CFDictionaryContainsKey(CFDictionaryRef theDict, const void *key);
938 extern
939 Boolean CFDictionaryContainsValue(CFDictionaryRef theDict, const void *value);
940 extern
941 const void *CFDictionaryGetValue(CFDictionaryRef theDict, const void *key);
942 extern
943 Boolean CFDictionaryGetValueIfPresent(CFDictionaryRef theDict, const void *key, const void **value);
944 extern
945 void CFDictionaryGetKeysAndValues(CFDictionaryRef theDict, const void **keys, const void **values);
946 extern
947 void CFDictionaryApplyFunction(CFDictionaryRef theDict, CFDictionaryApplierFunction applier, void *context);
948 extern
949 void CFDictionaryAddValue(CFMutableDictionaryRef theDict, const void *key, const void *value);
950 extern
951 void CFDictionarySetValue(CFMutableDictionaryRef theDict, const void *key, const void *value);
952 extern
953 void CFDictionaryReplaceValue(CFMutableDictionaryRef theDict, const void *key, const void *value);
954 extern
955 void CFDictionaryRemoveValue(CFMutableDictionaryRef theDict, const void *key);
956 extern
957 void CFDictionaryRemoveAllValues(CFMutableDictionaryRef theDict);
958
959
960 }
961 extern "C" {
962
963
964 typedef const struct __CFBoolean * CFBooleanRef;
965
966 extern
967 const CFBooleanRef kCFBooleanTrue;
968 extern
969 const CFBooleanRef kCFBooleanFalse;
970
971 extern
972 CFTypeID CFBooleanGetTypeID(void);
973
974 extern
975 Boolean CFBooleanGetValue(CFBooleanRef boolean);
976
977 typedef enum {
978
979     kCFNumberSInt8Type = 1,
980     kCFNumberSInt16Type = 2,
981     kCFNumberSInt32Type = 3,
982     kCFNumberSInt64Type = 4,
983     kCFNumberFloat32Type = 5,
984     kCFNumberFloat64Type = 6,
985
986     kCFNumberCharType = 7,
987     kCFNumberShortType = 8,
988     kCFNumberIntType = 9,
989     kCFNumberLongType = 10,
990     kCFNumberLongLongType = 11,
991     kCFNumberFloatType = 12,
992     kCFNumberDoubleType = 13,
993
994     kCFNumberCFIndexType = 14,
995     kCFNumberMaxType = 14
996 } CFNumberType;
997
998 typedef const struct __CFNumber * CFNumberRef;
999
1000 extern
1001 const CFNumberRef kCFNumberPositiveInfinity;
1002 extern
1003 const CFNumberRef kCFNumberNegativeInfinity;
1004 extern
1005 const CFNumberRef kCFNumberNaN;
1006
1007 extern
1008 CFTypeID CFNumberGetTypeID(void);
1009 extern
1010 CFNumberRef CFNumberCreate(CFAllocatorRef allocator, CFNumberType theType, const void *valuePtr);
1011
1012
1013
1014
1015
1016 extern
1017 CFNumberType CFNumberGetType(CFNumberRef number);
1018
1019
1020
1021
1022 extern
1023 CFIndex CFNumberGetByteSize(CFNumberRef number);
1024
1025
1026
1027
1028
1029 extern
1030 Boolean CFNumberIsFloatType(CFNumberRef number);
1031 extern
1032 Boolean CFNumberGetValue(CFNumberRef number, CFNumberType theType, void *valuePtr);
1033 extern
1034 CFComparisonResult CFNumberCompare(CFNumberRef number, CFNumberRef otherNumber, void *context);
1035
1036
1037 }
1038 typedef __builtin_va_list __gnuc_va_list;
1039 typedef __gnuc_va_list va_list;
1040
1041
1042 extern "C" {
1043 typedef UInt32 CFStringEncoding;
1044
1045
1046
1047
1048
1049 typedef enum {
1050     kCFStringEncodingMacRoman = 0,
1051     kCFStringEncodingWindowsLatin1 = 0x0500,
1052     kCFStringEncodingISOLatin1 = 0x0201,
1053     kCFStringEncodingNextStepLatin = 0x0B01,
1054     kCFStringEncodingASCII = 0x0600,
1055     kCFStringEncodingUnicode = 0x0100,
1056     kCFStringEncodingUTF8 = 0x08000100,
1057     kCFStringEncodingNonLossyASCII = 0x0BFF
1058 } CFStringBuiltInEncodings;
1059
1060
1061 extern
1062 CFTypeID CFStringGetTypeID(void);
1063 extern
1064 CFStringRef CFStringCreateWithPascalString(CFAllocatorRef alloc, ConstStr255Param pStr, CFStringEncoding encoding);
1065
1066 extern
1067 CFStringRef CFStringCreateWithCString(CFAllocatorRef alloc, const char *cStr, CFStringEncoding encoding);
1068
1069 extern
1070 CFStringRef CFStringCreateWithCharacters(CFAllocatorRef alloc, const UniChar *chars, CFIndex numChars);
1071 extern
1072 CFStringRef CFStringCreateWithPascalStringNoCopy(CFAllocatorRef alloc, ConstStr255Param pStr, CFStringEncoding encoding, CFAllocatorRef contentsDeallocator);
1073
1074 extern
1075 CFStringRef CFStringCreateWithCStringNoCopy(CFAllocatorRef alloc, const char *cStr, CFStringEncoding encoding, CFAllocatorRef contentsDeallocator);
1076
1077 extern
1078 CFStringRef CFStringCreateWithCharactersNoCopy(CFAllocatorRef alloc, const UniChar *chars, CFIndex numChars, CFAllocatorRef contentsDeallocator);
1079
1080
1081
1082 extern
1083 CFStringRef CFStringCreateWithSubstring(CFAllocatorRef alloc, CFStringRef str, CFRange range);
1084
1085 extern
1086 CFStringRef CFStringCreateCopy(CFAllocatorRef alloc, CFStringRef theString);
1087
1088
1089
1090 extern
1091 CFStringRef CFStringCreateWithFormat(CFAllocatorRef alloc, CFDictionaryRef formatOptions, CFStringRef format, ...);
1092
1093 extern
1094 CFStringRef CFStringCreateWithFormatAndArguments(CFAllocatorRef alloc, CFDictionaryRef formatOptions, CFStringRef format, va_list arguments);
1095
1096
1097
1098 extern
1099 CFMutableStringRef CFStringCreateMutable(CFAllocatorRef alloc, CFIndex maxLength);
1100
1101 extern
1102 CFMutableStringRef CFStringCreateMutableCopy(CFAllocatorRef alloc, CFIndex maxLength, CFStringRef theString);
1103
1104
1105
1106
1107
1108
1109
1110 extern
1111 CFMutableStringRef CFStringCreateMutableWithExternalCharactersNoCopy(CFAllocatorRef alloc, UniChar *chars, CFIndex numChars, CFIndex capacity, CFAllocatorRef externalCharactersAllocator);
1112
1113
1114
1115
1116
1117 extern
1118 CFIndex CFStringGetLength(CFStringRef theString);
1119
1120
1121
1122
1123
1124
1125 extern
1126 UniChar CFStringGetCharacterAtIndex(CFStringRef theString, CFIndex idx);
1127
1128 extern
1129 void CFStringGetCharacters(CFStringRef theString, CFRange range, UniChar *buffer);
1130 extern
1131 Boolean CFStringGetPascalString(CFStringRef theString, StringPtr buffer, CFIndex bufferSize, CFStringEncoding encoding);
1132
1133 extern
1134 Boolean CFStringGetCString(CFStringRef theString, char *buffer, CFIndex bufferSize, CFStringEncoding encoding);
1135
1136
1137
1138
1139
1140
1141 extern
1142 ConstStringPtr CFStringGetPascalStringPtr(CFStringRef theString, CFStringEncoding encoding);
1143
1144 extern
1145 const char *CFStringGetCStringPtr(CFStringRef theString, CFStringEncoding encoding);
1146
1147 extern
1148 const UniChar *CFStringGetCharactersPtr(CFStringRef theString);
1149 extern
1150 CFIndex CFStringGetBytes(CFStringRef theString, CFRange range, CFStringEncoding encoding, UInt8 lossByte, Boolean isExternalRepresentation, UInt8 *buffer, CFIndex maxBufLen, CFIndex *usedBufLen);
1151
1152
1153
1154
1155
1156
1157
1158 extern
1159 CFStringRef CFStringCreateWithBytes(CFAllocatorRef alloc, const UInt8 *bytes, CFIndex numBytes, CFStringEncoding encoding, Boolean isExternalRepresentation);
1160
1161
1162
1163
1164
1165
1166
1167 extern
1168 CFStringRef CFStringCreateFromExternalRepresentation(CFAllocatorRef alloc, CFDataRef data, CFStringEncoding encoding);
1169
1170 extern
1171 CFDataRef CFStringCreateExternalRepresentation(CFAllocatorRef alloc, CFStringRef theString, CFStringEncoding encoding, UInt8 lossByte);
1172
1173
1174
1175 extern
1176 CFStringEncoding CFStringGetSmallestEncoding(CFStringRef theString);
1177
1178 extern
1179 CFStringEncoding CFStringGetFastestEncoding(CFStringRef theString);
1180
1181
1182
1183 extern
1184 CFStringEncoding CFStringGetSystemEncoding(void);
1185
1186 extern
1187 CFIndex CFStringGetMaximumSizeForEncoding(CFIndex length, CFStringEncoding encoding);
1188
1189
1190
1191
1192
1193
1194 typedef enum {
1195     kCFCompareCaseInsensitive = 1,
1196     kCFCompareBackwards = 4,
1197     kCFCompareAnchored = 8,
1198     kCFCompareNonliteral = 16,
1199     kCFCompareLocalized = 32,
1200     kCFCompareNumerically = 64
1201 } CFStringCompareFlags;
1202
1203
1204
1205
1206
1207
1208 extern
1209 CFComparisonResult CFStringCompareWithOptions(CFStringRef theString1, CFStringRef theString2, CFRange rangeToCompare, CFOptionFlags compareOptions);
1210
1211
1212
1213
1214
1215 extern
1216 CFComparisonResult CFStringCompare(CFStringRef theString1, CFStringRef theString2, CFOptionFlags compareOptions);
1217
1218
1219
1220
1221
1222 extern
1223 Boolean CFStringFindWithOptions(CFStringRef theString, CFStringRef stringToFind, CFRange rangeToSearch, CFOptionFlags searchOptions, CFRange *result);
1224 extern
1225 CFArrayRef CFStringCreateArrayWithFindResults(CFAllocatorRef alloc, CFStringRef theString, CFStringRef stringToFind, CFRange rangeToSearch, CFOptionFlags compareOptions);
1226
1227
1228
1229 extern
1230 CFRange CFStringFind(CFStringRef theString, CFStringRef stringToFind, CFOptionFlags compareOptions);
1231
1232 extern
1233 Boolean CFStringHasPrefix(CFStringRef theString, CFStringRef prefix);
1234
1235 extern
1236 Boolean CFStringHasSuffix(CFStringRef theString, CFStringRef suffix);
1237 extern CFRange CFStringGetRangeOfComposedCharactersAtIndex(CFStringRef theString, CFIndex theIndex);
1238 extern Boolean CFStringFindCharacterFromSet(CFStringRef theString, CFCharacterSetRef theSet, CFRange rangeToSearch, CFOptionFlags searchOptions, CFRange *result);
1239 extern
1240 void CFStringGetLineBounds(CFStringRef theString, CFRange range, CFIndex *lineBeginIndex, CFIndex *lineEndIndex, CFIndex *contentsEndIndex);
1241
1242
1243
1244 extern
1245 CFStringRef CFStringCreateByCombiningStrings(CFAllocatorRef alloc, CFArrayRef theArray, CFStringRef separatorString);
1246
1247 extern
1248 CFArrayRef CFStringCreateArrayBySeparatingStrings(CFAllocatorRef alloc, CFStringRef theString, CFStringRef separatorString);
1249
1250
1251
1252 extern
1253 SInt32 CFStringGetIntValue(CFStringRef str);
1254
1255 extern
1256 double CFStringGetDoubleValue(CFStringRef str);
1257 extern
1258 void CFStringAppend(CFMutableStringRef theString, CFStringRef appendedString);
1259
1260 extern
1261 void CFStringAppendCharacters(CFMutableStringRef theString, const UniChar *chars, CFIndex numChars);
1262
1263 extern
1264 void CFStringAppendPascalString(CFMutableStringRef theString, ConstStr255Param pStr, CFStringEncoding encoding);
1265
1266 extern
1267 void CFStringAppendCString(CFMutableStringRef theString, const char *cStr, CFStringEncoding encoding);
1268
1269 extern
1270 void CFStringAppendFormat(CFMutableStringRef theString, CFDictionaryRef formatOptions, CFStringRef format, ...);
1271
1272 extern
1273 void CFStringAppendFormatAndArguments(CFMutableStringRef theString, CFDictionaryRef formatOptions, CFStringRef format, va_list arguments);
1274
1275 extern
1276 void CFStringInsert(CFMutableStringRef str, CFIndex idx, CFStringRef insertedStr);
1277
1278 extern
1279 void CFStringDelete(CFMutableStringRef theString, CFRange range);
1280
1281 extern
1282 void CFStringReplace(CFMutableStringRef theString, CFRange range, CFStringRef replacement);
1283
1284 extern
1285 void CFStringReplaceAll(CFMutableStringRef theString, CFStringRef replacement);
1286 extern
1287 CFIndex CFStringFindAndReplace(CFMutableStringRef theString, CFStringRef stringToFind, CFStringRef replacementString, CFRange rangeToSearch, CFOptionFlags compareOptions);
1288 extern
1289 void CFStringSetExternalCharactersNoCopy(CFMutableStringRef theString, UniChar *chars, CFIndex length, CFIndex capacity);
1290 extern
1291 void CFStringPad(CFMutableStringRef theString, CFStringRef padString, CFIndex length, CFIndex indexIntoPad);
1292
1293 extern
1294 void CFStringTrim(CFMutableStringRef theString, CFStringRef trimString);
1295
1296 extern
1297 void CFStringTrimWhitespace(CFMutableStringRef theString);
1298
1299 extern
1300 void CFStringLowercase(CFMutableStringRef theString, const void *localeTBD);
1301
1302 extern
1303 void CFStringUppercase(CFMutableStringRef theString, const void *localeTBD);
1304
1305 extern
1306 void CFStringCapitalize(CFMutableStringRef theString, const void *localeTBD);
1307
1308
1309
1310
1311
1312
1313
1314 typedef enum {
1315         kCFStringNormalizationFormD = 0,
1316         kCFStringNormalizationFormKD,
1317         kCFStringNormalizationFormC,
1318         kCFStringNormalizationFormKC
1319 } CFStringNormalizationForm;
1320 extern void CFStringNormalize(CFMutableStringRef theString, CFStringNormalizationForm theForm);
1321
1322
1323
1324
1325 extern
1326 Boolean CFStringIsEncodingAvailable(CFStringEncoding encoding);
1327
1328
1329
1330 extern
1331 const CFStringEncoding *CFStringGetListOfAvailableEncodings(void);
1332
1333
1334
1335 extern
1336 CFStringRef CFStringGetNameOfEncoding(CFStringEncoding encoding);
1337
1338
1339
1340 extern
1341 UInt32 CFStringConvertEncodingToNSStringEncoding(CFStringEncoding encoding);
1342
1343 extern
1344 CFStringEncoding CFStringConvertNSStringEncodingToEncoding(UInt32 encoding);
1345
1346
1347
1348 extern
1349 UInt32 CFStringConvertEncodingToWindowsCodepage(CFStringEncoding encoding);
1350
1351 extern
1352 CFStringEncoding CFStringConvertWindowsCodepageToEncoding(UInt32 codepage);
1353
1354
1355
1356 extern
1357 CFStringEncoding CFStringConvertIANACharSetNameToEncoding(CFStringRef theString);
1358
1359 extern
1360 CFStringRef CFStringConvertEncodingToIANACharSetName(CFStringEncoding encoding);
1361
1362
1363
1364
1365
1366 extern
1367 CFStringEncoding CFStringGetMostCompatibleMacStringEncoding(CFStringEncoding encoding);
1368 typedef struct {
1369     UniChar buffer[64];
1370     CFStringRef theString;
1371     const UniChar *directBuffer;
1372     CFRange rangeToBuffer;
1373     CFIndex bufferedRangeStart;
1374     CFIndex bufferedRangeEnd;
1375 } CFStringInlineBuffer;
1376
1377
1378 static __inline__ void CFStringInitInlineBuffer(CFStringRef str, CFStringInlineBuffer *buf, CFRange range) {
1379     buf->theString = str;
1380     buf->rangeToBuffer = range;
1381     buf->directBuffer = CFStringGetCharactersPtr(str);
1382     buf->bufferedRangeStart = buf->bufferedRangeEnd = 0;
1383 }
1384
1385 static __inline__ UniChar CFStringGetCharacterFromInlineBuffer(CFStringInlineBuffer *buf, CFIndex idx) {
1386     if (buf->directBuffer) return buf->directBuffer[idx + buf->rangeToBuffer.location];
1387     if (idx >= buf->bufferedRangeEnd || idx < buf->bufferedRangeStart) {
1388         if (idx < 0 || idx > buf->rangeToBuffer.length) return 0;
1389         if ((buf->bufferedRangeStart = idx - 4) < 0) buf->bufferedRangeStart = 0;
1390         buf->bufferedRangeEnd = buf->bufferedRangeStart + 64;
1391         if (buf->bufferedRangeEnd > buf->rangeToBuffer.length) buf->bufferedRangeEnd = buf->rangeToBuffer.length;
1392         CFStringGetCharacters(buf->theString, CFRangeMake(buf->rangeToBuffer.location + buf->bufferedRangeStart, buf->bufferedRangeEnd - buf->bufferedRangeStart), buf->buffer);
1393     }
1394     return buf->buffer[idx - buf->bufferedRangeStart];
1395 }
1396 extern
1397 void CFShow(CFTypeRef obj);
1398
1399 extern
1400 void CFShowStr(CFStringRef str);
1401
1402
1403 extern
1404 CFStringRef __CFStringMakeConstantString(const char *cStr);
1405
1406
1407 }
1408 extern "C" {
1409
1410
1411 typedef enum {
1412     kCFURLPOSIXPathStyle = 0,
1413     kCFURLHFSPathStyle,
1414     kCFURLWindowsPathStyle
1415 } CFURLPathStyle;
1416
1417 typedef const struct __CFURL * CFURLRef;
1418 extern
1419 CFTypeID CFURLGetTypeID(void);
1420
1421
1422
1423 extern
1424 CFURLRef CFURLCreateWithBytes(CFAllocatorRef allocator, const UInt8 *URLBytes, CFIndex length, CFStringEncoding encoding, CFURLRef baseURL);
1425
1426
1427
1428
1429
1430 extern
1431 CFDataRef CFURLCreateData(CFAllocatorRef allocator, CFURLRef url, CFStringEncoding encoding, Boolean escapeWhitespace);
1432
1433
1434 extern
1435 CFURLRef CFURLCreateWithString(CFAllocatorRef allocator, CFStringRef URLString, CFURLRef baseURL);
1436
1437
1438
1439
1440
1441
1442
1443 extern
1444 CFURLRef CFURLCreateWithFileSystemPath(CFAllocatorRef allocator, CFStringRef filePath, CFURLPathStyle pathStyle, Boolean isDirectory);
1445
1446 extern
1447 CFURLRef CFURLCreateFromFileSystemRepresentation(CFAllocatorRef allocator, const UInt8 *buffer, CFIndex bufLen, Boolean isDirectory);
1448
1449 extern
1450 CFURLRef CFURLCreateWithFileSystemPathRelativeToBase(CFAllocatorRef allocator, CFStringRef filePath, CFURLPathStyle pathStyle, Boolean isDirectory, CFURLRef baseURL);
1451
1452 extern
1453 CFURLRef CFURLCreateFromFileSystemRepresentationRelativeToBase(CFAllocatorRef allocator, const UInt8 *buffer, CFIndex bufLen, Boolean isDirectory, CFURLRef baseURL);
1454 extern
1455 Boolean CFURLGetFileSystemRepresentation(CFURLRef url, Boolean resolveAgainstBase, UInt8 *buffer, CFIndex maxBufLen);
1456
1457
1458 extern
1459 CFURLRef CFURLCopyAbsoluteURL(CFURLRef relativeURL);
1460
1461
1462 extern
1463 CFStringRef CFURLGetString(CFURLRef anURL);
1464
1465
1466 extern
1467 CFURLRef CFURLGetBaseURL(CFURLRef anURL);
1468 extern
1469 Boolean CFURLCanBeDecomposed(CFURLRef anURL);
1470
1471
1472
1473 extern
1474 CFStringRef CFURLCopyScheme(CFURLRef anURL);
1475
1476
1477 extern
1478 CFStringRef CFURLCopyNetLocation(CFURLRef anURL);
1479 extern
1480 CFStringRef CFURLCopyPath(CFURLRef anURL);
1481
1482 extern
1483 CFStringRef CFURLCopyStrictPath(CFURLRef anURL, Boolean *isAbsolute);
1484
1485 extern
1486 CFStringRef CFURLCopyFileSystemPath(CFURLRef anURL, CFURLPathStyle pathStyle);
1487
1488
1489
1490 extern
1491 Boolean CFURLHasDirectoryPath(CFURLRef anURL);
1492
1493
1494
1495 extern
1496 CFStringRef CFURLCopyResourceSpecifier(CFURLRef anURL);
1497
1498 extern
1499 CFStringRef CFURLCopyHostName(CFURLRef anURL);
1500
1501 extern
1502 SInt32 CFURLGetPortNumber(CFURLRef anURL);
1503
1504 extern
1505 CFStringRef CFURLCopyUserName(CFURLRef anURL);
1506
1507 extern
1508 CFStringRef CFURLCopyPassword(CFURLRef anURL);
1509
1510
1511
1512
1513
1514
1515 extern
1516 CFStringRef CFURLCopyParameterString(CFURLRef anURL, CFStringRef charactersToLeaveEscaped);
1517
1518 extern
1519 CFStringRef CFURLCopyQueryString(CFURLRef anURL, CFStringRef charactersToLeaveEscaped);
1520
1521 extern
1522 CFStringRef CFURLCopyFragment(CFURLRef anURL, CFStringRef charactersToLeaveEscaped);
1523
1524 extern
1525 CFStringRef CFURLCopyLastPathComponent(CFURLRef url);
1526
1527 extern
1528 CFStringRef CFURLCopyPathExtension(CFURLRef url);
1529
1530
1531
1532
1533
1534 extern
1535 CFURLRef CFURLCreateCopyAppendingPathComponent(CFAllocatorRef allocator, CFURLRef url, CFStringRef pathComponent, Boolean isDirectory);
1536
1537 extern
1538 CFURLRef CFURLCreateCopyDeletingLastPathComponent(CFAllocatorRef allocator, CFURLRef url);
1539
1540 extern
1541 CFURLRef CFURLCreateCopyAppendingPathExtension(CFAllocatorRef allocator, CFURLRef url, CFStringRef extension);
1542
1543 extern
1544 CFURLRef CFURLCreateCopyDeletingPathExtension(CFAllocatorRef allocator, CFURLRef url);
1545 extern
1546 CFStringRef CFURLCreateStringByReplacingPercentEscapes(CFAllocatorRef allocator, CFStringRef originalString, CFStringRef charactersToLeaveEscaped);
1547 extern
1548 CFStringRef CFURLCreateStringByAddingPercentEscapes(CFAllocatorRef allocator, CFStringRef originalString, CFStringRef charactersToLeaveUnescaped, CFStringRef legalURLCharactersToBeEscaped, CFStringEncoding encoding);
1549
1550
1551
1552 struct FSRef;
1553
1554 extern
1555 CFURLRef CFURLCreateFromFSRef(CFAllocatorRef allocator, const struct FSRef *fsRef);
1556
1557 extern
1558 Boolean CFURLGetFSRef(CFURLRef url, struct FSRef *fsRef);
1559
1560
1561
1562 }
1563
1564 extern "C" {
1565
1566
1567
1568
1569
1570
1571 typedef struct __CFRunLoop * CFRunLoopRef;
1572
1573
1574
1575
1576
1577 typedef struct __CFRunLoopSource * CFRunLoopSourceRef;
1578
1579
1580
1581
1582
1583 typedef struct __CFRunLoopObserver * CFRunLoopObserverRef;
1584
1585
1586
1587
1588
1589 typedef struct __CFRunLoopTimer * CFRunLoopTimerRef;
1590
1591
1592 enum {
1593     kCFRunLoopRunFinished = 1,
1594     kCFRunLoopRunStopped = 2,
1595     kCFRunLoopRunTimedOut = 3,
1596     kCFRunLoopRunHandledSource = 4
1597 };
1598
1599
1600 typedef enum {
1601     kCFRunLoopEntry = (1 << 0),
1602     kCFRunLoopBeforeTimers = (1 << 1),
1603     kCFRunLoopBeforeSources = (1 << 2),
1604     kCFRunLoopBeforeWaiting = (1 << 5),
1605     kCFRunLoopAfterWaiting = (1 << 6),
1606     kCFRunLoopExit = (1 << 7),
1607     kCFRunLoopAllActivities = 0x0FFFFFFFU
1608 } CFRunLoopActivity;
1609
1610 extern const CFStringRef kCFRunLoopDefaultMode;
1611 extern const CFStringRef kCFRunLoopCommonModes;
1612
1613
1614
1615
1616
1617 extern CFTypeID CFRunLoopGetTypeID(void);
1618
1619
1620
1621
1622
1623
1624 extern CFRunLoopRef CFRunLoopGetCurrent(void);
1625 extern CFStringRef CFRunLoopCopyCurrentMode(CFRunLoopRef rl);
1626
1627
1628
1629
1630
1631
1632
1633 extern CFArrayRef CFRunLoopCopyAllModes(CFRunLoopRef rl);
1634 extern void CFRunLoopAddCommonMode(CFRunLoopRef rl, CFStringRef mode);
1635 extern CFAbsoluteTime CFRunLoopGetNextTimerFireDate(CFRunLoopRef rl, CFStringRef mode);
1636
1637
1638
1639
1640
1641 extern void CFRunLoopRun(void);
1642 extern SInt32 CFRunLoopRunInMode(CFStringRef mode, CFTimeInterval seconds, Boolean returnAfterSourceHandled);
1643 extern Boolean CFRunLoopIsWaiting(CFRunLoopRef rl);
1644 extern void CFRunLoopWakeUp(CFRunLoopRef rl);
1645 extern void CFRunLoopStop(CFRunLoopRef rl);
1646
1647 extern Boolean CFRunLoopContainsSource(CFRunLoopRef rl, CFRunLoopSourceRef source, CFStringRef mode);
1648 extern void CFRunLoopAddSource(CFRunLoopRef rl, CFRunLoopSourceRef source, CFStringRef mode);
1649 extern void CFRunLoopRemoveSource(CFRunLoopRef rl, CFRunLoopSourceRef source, CFStringRef mode);
1650
1651 extern Boolean CFRunLoopContainsObserver(CFRunLoopRef rl, CFRunLoopObserverRef observer, CFStringRef mode);
1652 extern void CFRunLoopAddObserver(CFRunLoopRef rl, CFRunLoopObserverRef observer, CFStringRef mode);
1653 extern void CFRunLoopRemoveObserver(CFRunLoopRef rl, CFRunLoopObserverRef observer, CFStringRef mode);
1654
1655 extern Boolean CFRunLoopContainsTimer(CFRunLoopRef rl, CFRunLoopTimerRef timer, CFStringRef mode);
1656 extern void CFRunLoopAddTimer(CFRunLoopRef rl, CFRunLoopTimerRef timer, CFStringRef mode);
1657 extern void CFRunLoopRemoveTimer(CFRunLoopRef rl, CFRunLoopTimerRef timer, CFStringRef mode);
1658 typedef struct {
1659     CFIndex version;
1660     void * info;
1661     const void *(*retain)(const void *info);
1662     void (*release)(const void *info);
1663     CFStringRef (*copyDescription)(const void *info);
1664     Boolean (*equal)(const void *info1, const void *info2);
1665     CFHashCode (*hash)(const void *info);
1666     void (*schedule)(void *info, CFRunLoopRef rl, CFStringRef mode);
1667     void (*cancel)(void *info, CFRunLoopRef rl, CFStringRef mode);
1668     void (*perform)(void *info);
1669 } CFRunLoopSourceContext;
1670
1671
1672 typedef struct {
1673     CFIndex version;
1674     void * info;
1675     const void *(*retain)(const void *info);
1676     void (*release)(const void *info);
1677     CFStringRef (*copyDescription)(const void *info);
1678     Boolean (*equal)(const void *info1, const void *info2);
1679     CFHashCode (*hash)(const void *info);
1680     mach_port_t (*getPort)(void *info);
1681     void * (*perform)(void *msg, CFIndex size, CFAllocatorRef allocator, void *info);
1682 } CFRunLoopSourceContext1;
1683
1684
1685
1686
1687
1688
1689 extern CFTypeID CFRunLoopSourceGetTypeID(void);
1690 extern CFRunLoopSourceRef CFRunLoopSourceCreate(CFAllocatorRef allocator, CFIndex order, CFRunLoopSourceContext *context);
1691
1692
1693
1694
1695
1696
1697
1698 extern CFIndex CFRunLoopSourceGetOrder(CFRunLoopSourceRef source);
1699 extern void CFRunLoopSourceInvalidate(CFRunLoopSourceRef source);
1700
1701
1702
1703
1704
1705
1706
1707 extern Boolean CFRunLoopSourceIsValid(CFRunLoopSourceRef source);
1708 extern void CFRunLoopSourceGetContext(CFRunLoopSourceRef source, CFRunLoopSourceContext *context);
1709 extern void CFRunLoopSourceSignal(CFRunLoopSourceRef source);
1710
1711 typedef struct {
1712     CFIndex version;
1713     void * info;
1714     const void *(*retain)(const void *info);
1715     void (*release)(const void *info);
1716     CFStringRef (*copyDescription)(const void *info);
1717 } CFRunLoopObserverContext;
1718
1719 typedef void (*CFRunLoopObserverCallBack)(CFRunLoopObserverRef observer, CFRunLoopActivity activity, void *info);
1720
1721
1722
1723
1724
1725 extern CFTypeID CFRunLoopObserverGetTypeID(void);
1726
1727 extern CFRunLoopObserverRef CFRunLoopObserverCreate(CFAllocatorRef allocator, CFOptionFlags activities, Boolean repeats, CFIndex order, CFRunLoopObserverCallBack callout, CFRunLoopObserverContext *context);
1728
1729 extern CFOptionFlags CFRunLoopObserverGetActivities(CFRunLoopObserverRef observer);
1730 extern Boolean CFRunLoopObserverDoesRepeat(CFRunLoopObserverRef observer);
1731 extern CFIndex CFRunLoopObserverGetOrder(CFRunLoopObserverRef observer);
1732 extern void CFRunLoopObserverInvalidate(CFRunLoopObserverRef observer);
1733 extern Boolean CFRunLoopObserverIsValid(CFRunLoopObserverRef observer);
1734 extern void CFRunLoopObserverGetContext(CFRunLoopObserverRef observer, CFRunLoopObserverContext *context);
1735
1736 typedef struct {
1737     CFIndex version;
1738     void * info;
1739     const void *(*retain)(const void *info);
1740     void (*release)(const void *info);
1741     CFStringRef (*copyDescription)(const void *info);
1742 } CFRunLoopTimerContext;
1743
1744 typedef void (*CFRunLoopTimerCallBack)(CFRunLoopTimerRef timer, void *info);
1745
1746
1747
1748
1749
1750 extern CFTypeID CFRunLoopTimerGetTypeID(void);
1751
1752 extern CFRunLoopTimerRef CFRunLoopTimerCreate(CFAllocatorRef allocator, CFAbsoluteTime fireDate, CFTimeInterval interval, CFOptionFlags flags, CFIndex order, CFRunLoopTimerCallBack callout, CFRunLoopTimerContext *context);
1753 extern CFAbsoluteTime CFRunLoopTimerGetNextFireDate(CFRunLoopTimerRef timer);
1754 extern void CFRunLoopTimerSetNextFireDate(CFRunLoopTimerRef timer, CFAbsoluteTime fireDate);
1755 extern CFTimeInterval CFRunLoopTimerGetInterval(CFRunLoopTimerRef timer);
1756 extern Boolean CFRunLoopTimerDoesRepeat(CFRunLoopTimerRef timer);
1757 extern CFIndex CFRunLoopTimerGetOrder(CFRunLoopTimerRef timer);
1758 extern void CFRunLoopTimerInvalidate(CFRunLoopTimerRef timer);
1759 extern Boolean CFRunLoopTimerIsValid(CFRunLoopTimerRef timer);
1760 extern void CFRunLoopTimerGetContext(CFRunLoopTimerRef timer, CFRunLoopTimerContext *context);
1761
1762
1763 }
1764 extern "C" {
1765
1766
1767
1768
1769
1770
1771 typedef int CFSocketNativeHandle;
1772
1773 typedef struct __CFSocket * CFSocketRef;
1774 typedef enum {
1775     kCFSocketSuccess = 0,
1776     kCFSocketError = -1,
1777     kCFSocketTimeout = -2
1778 } CFSocketError;
1779
1780 typedef struct {
1781     SInt32 protocolFamily;
1782     SInt32 socketType;
1783     SInt32 protocol;
1784     CFDataRef address;
1785 } CFSocketSignature;
1786
1787 typedef enum {
1788     kCFSocketNoCallBack = 0,
1789     kCFSocketReadCallBack = 1,
1790     kCFSocketAcceptCallBack = 2,
1791     kCFSocketDataCallBack = 3,
1792     kCFSocketConnectCallBack = 4
1793
1794     ,
1795     kCFSocketWriteCallBack = 8
1796
1797 } CFSocketCallBackType;
1798
1799
1800
1801 enum {
1802     kCFSocketAutomaticallyReenableReadCallBack = 1,
1803     kCFSocketAutomaticallyReenableAcceptCallBack = 2,
1804     kCFSocketAutomaticallyReenableDataCallBack = 3,
1805     kCFSocketAutomaticallyReenableWriteCallBack = 8,
1806     kCFSocketCloseOnInvalidate = 128
1807 };
1808
1809
1810 typedef void (*CFSocketCallBack)(CFSocketRef s, CFSocketCallBackType type, CFDataRef address, const void *data, void *info);
1811
1812
1813 typedef struct {
1814     CFIndex version;
1815     void * info;
1816     const void *(*retain)(const void *info);
1817     void (*release)(const void *info);
1818     CFStringRef (*copyDescription)(const void *info);
1819 } CFSocketContext;
1820
1821 extern CFTypeID CFSocketGetTypeID(void);
1822
1823 extern CFSocketRef CFSocketCreate(CFAllocatorRef allocator, SInt32 protocolFamily, SInt32 socketType, SInt32 protocol, CFOptionFlags callBackTypes, CFSocketCallBack callout, const CFSocketContext *context);
1824 extern CFSocketRef CFSocketCreateWithNative(CFAllocatorRef allocator, CFSocketNativeHandle sock, CFOptionFlags callBackTypes, CFSocketCallBack callout, const CFSocketContext *context);
1825 extern CFSocketRef CFSocketCreateWithSocketSignature(CFAllocatorRef allocator, const CFSocketSignature *signature, CFOptionFlags callBackTypes, CFSocketCallBack callout, const CFSocketContext *context);
1826 extern CFSocketRef CFSocketCreateConnectedToSocketSignature(CFAllocatorRef allocator, const CFSocketSignature *signature, CFOptionFlags callBackTypes, CFSocketCallBack callout, const CFSocketContext *context, CFTimeInterval timeout);
1827
1828
1829 extern CFSocketError CFSocketSetAddress(CFSocketRef s, CFDataRef address);
1830 extern CFSocketError CFSocketConnectToAddress(CFSocketRef s, CFDataRef address, CFTimeInterval timeout);
1831 extern void CFSocketInvalidate(CFSocketRef s);
1832
1833 extern Boolean CFSocketIsValid(CFSocketRef s);
1834 extern CFDataRef CFSocketCopyAddress(CFSocketRef s);
1835 extern CFDataRef CFSocketCopyPeerAddress(CFSocketRef s);
1836 extern void CFSocketGetContext(CFSocketRef s, CFSocketContext *context);
1837 extern CFSocketNativeHandle CFSocketGetNative(CFSocketRef s);
1838
1839 extern CFRunLoopSourceRef CFSocketCreateRunLoopSource(CFAllocatorRef allocator, CFSocketRef s, CFIndex order);
1840
1841
1842 extern CFOptionFlags CFSocketGetSocketFlags(CFSocketRef s);
1843 extern void CFSocketSetSocketFlags(CFSocketRef s, CFOptionFlags flags);
1844 extern void CFSocketDisableCallBacks(CFSocketRef s, CFOptionFlags callBackTypes);
1845 extern void CFSocketEnableCallBacks(CFSocketRef s, CFOptionFlags callBackTypes);
1846
1847
1848
1849 extern CFSocketError CFSocketSendData(CFSocketRef s, CFDataRef address, CFDataRef data, CFTimeInterval timeout);
1850 extern CFSocketError CFSocketRegisterValue(const CFSocketSignature *nameServerSignature, CFTimeInterval timeout, CFStringRef name, CFPropertyListRef value);
1851 extern CFSocketError CFSocketCopyRegisteredValue(const CFSocketSignature *nameServerSignature, CFTimeInterval timeout, CFStringRef name, CFPropertyListRef *value, CFDataRef *nameServerAddress);
1852
1853 extern CFSocketError CFSocketRegisterSocketSignature(const CFSocketSignature *nameServerSignature, CFTimeInterval timeout, CFStringRef name, const CFSocketSignature *signature);
1854 extern CFSocketError CFSocketCopyRegisteredSocketSignature(const CFSocketSignature *nameServerSignature, CFTimeInterval timeout, CFStringRef name, CFSocketSignature *signature, CFDataRef *nameServerAddress);
1855
1856 extern CFSocketError CFSocketUnregister(const CFSocketSignature *nameServerSignature, CFTimeInterval timeout, CFStringRef name);
1857
1858 extern void CFSocketSetDefaultNameRegistryPortNumber(UInt16 port);
1859 extern UInt16 CFSocketGetDefaultNameRegistryPortNumber(void);
1860
1861
1862 extern const CFStringRef kCFSocketCommandKey;
1863 extern const CFStringRef kCFSocketNameKey;
1864 extern const CFStringRef kCFSocketValueKey;
1865 extern const CFStringRef kCFSocketResultKey;
1866 extern const CFStringRef kCFSocketErrorKey;
1867 extern const CFStringRef kCFSocketRegisterCommand;
1868 extern const CFStringRef kCFSocketRetrieveCommand;
1869
1870
1871 }
1872
1873
1874 extern "C" {
1875
1876
1877 typedef enum {
1878     kCFStreamStatusNotOpen = 0,
1879     kCFStreamStatusOpening,
1880     kCFStreamStatusOpen,
1881     kCFStreamStatusReading,
1882     kCFStreamStatusWriting,
1883     kCFStreamStatusAtEnd,
1884     kCFStreamStatusClosed,
1885     kCFStreamStatusError
1886 } CFStreamStatus;
1887
1888 typedef enum {
1889     kCFStreamErrorDomainCustom = -1,
1890     kCFStreamErrorDomainPOSIX = 1,
1891     kCFStreamErrorDomainMacOSStatus
1892 } CFStreamErrorDomain;
1893
1894 typedef struct {
1895     CFStreamErrorDomain domain;
1896     SInt32 error;
1897 } CFStreamError;
1898
1899 typedef enum {
1900     kCFStreamEventNone = 0,
1901     kCFStreamEventOpenCompleted = 1,
1902     kCFStreamEventHasBytesAvailable = 2,
1903     kCFStreamEventCanAcceptBytes = 4,
1904     kCFStreamEventErrorOccurred = 8,
1905     kCFStreamEventEndEncountered = 16
1906 } CFStreamEventType;
1907
1908 typedef struct {
1909     CFIndex version;
1910     void *info;
1911     void *(*retain)(void *info);
1912     void (*release)(void *info);
1913     CFStringRef (*copyDescription)(void *info);
1914 } CFStreamClientContext;
1915
1916 typedef struct __CFReadStream * CFReadStreamRef;
1917 typedef struct __CFWriteStream * CFWriteStreamRef;
1918
1919 typedef void (*CFReadStreamClientCallBack)(CFReadStreamRef stream, CFStreamEventType type, void *clientCallBackInfo);
1920 typedef void (*CFWriteStreamClientCallBack)(CFWriteStreamRef stream, CFStreamEventType type, void *clientCallBackInfo);
1921
1922 extern
1923 CFTypeID CFReadStreamGetTypeID(void);
1924 extern
1925 CFTypeID CFWriteStreamGetTypeID(void);
1926
1927
1928
1929
1930 extern
1931 const CFStringRef kCFStreamPropertyDataWritten;
1932
1933
1934 extern
1935 CFReadStreamRef CFReadStreamCreateWithBytesNoCopy(CFAllocatorRef alloc, const UInt8 *bytes, CFIndex length, CFAllocatorRef bytesDeallocator);
1936
1937
1938 extern
1939 CFWriteStreamRef CFWriteStreamCreateWithBuffer(CFAllocatorRef alloc, UInt8 *buffer, CFIndex bufferCapacity);
1940
1941
1942 extern
1943 CFWriteStreamRef CFWriteStreamCreateWithAllocatedBuffers(CFAllocatorRef alloc, CFAllocatorRef bufferAllocator);
1944
1945
1946 extern
1947 CFReadStreamRef CFReadStreamCreateWithFile(CFAllocatorRef alloc, CFURLRef fileURL);
1948 extern
1949 CFWriteStreamRef CFWriteStreamCreateWithFile(CFAllocatorRef alloc, CFURLRef fileURL);
1950
1951
1952
1953 extern
1954 const CFStringRef kCFStreamPropertyAppendToFile;
1955
1956
1957
1958
1959
1960 extern
1961 const CFStringRef kCFStreamPropertySocketNativeHandle;
1962
1963
1964 extern
1965 const CFStringRef kCFStreamPropertySocketRemoteHostName;
1966
1967
1968 extern
1969 const CFStringRef kCFStreamPropertySocketRemotePortNumber;
1970
1971
1972 extern
1973 void CFStreamCreatePairWithSocket(CFAllocatorRef alloc, CFSocketNativeHandle sock, CFReadStreamRef *readStream, CFWriteStreamRef *writeStream);
1974 extern
1975 void CFStreamCreatePairWithSocketToHost(CFAllocatorRef alloc, CFStringRef host, UInt32 port, CFReadStreamRef *readStream, CFWriteStreamRef *writeStream);
1976
1977 extern
1978 void CFStreamCreatePairWithPeerSocketSignature(CFAllocatorRef alloc, const CFSocketSignature *signature, CFReadStreamRef *readStream, CFWriteStreamRef *writeStream);
1979
1980
1981
1982
1983 extern
1984 CFStreamStatus CFReadStreamGetStatus(CFReadStreamRef stream);
1985 extern
1986 CFStreamStatus CFWriteStreamGetStatus(CFWriteStreamRef stream);
1987
1988
1989
1990
1991 extern
1992 CFStreamError CFReadStreamGetError(CFReadStreamRef stream);
1993 extern
1994 CFStreamError CFWriteStreamGetError(CFWriteStreamRef stream);
1995
1996
1997
1998
1999
2000
2001 extern
2002 Boolean CFReadStreamOpen(CFReadStreamRef stream);
2003 extern
2004 Boolean CFWriteStreamOpen(CFWriteStreamRef stream);
2005
2006
2007
2008
2009 extern
2010 void CFReadStreamClose(CFReadStreamRef stream);
2011 extern
2012 void CFWriteStreamClose(CFWriteStreamRef stream);
2013
2014
2015
2016 extern
2017 Boolean CFReadStreamHasBytesAvailable(CFReadStreamRef stream);
2018 extern
2019 CFIndex CFReadStreamRead(CFReadStreamRef stream, UInt8 *buffer, CFIndex bufferLength);
2020 extern
2021 const UInt8 *CFReadStreamGetBuffer(CFReadStreamRef stream, CFIndex maxBytesToRead, CFIndex *numBytesRead);
2022
2023
2024
2025 extern
2026 Boolean CFWriteStreamCanAcceptBytes(CFWriteStreamRef stream);
2027
2028
2029
2030
2031
2032
2033 extern
2034 CFIndex CFWriteStreamWrite(CFWriteStreamRef stream, const UInt8 *buffer, CFIndex bufferLength);
2035 extern
2036 CFTypeRef CFReadStreamCopyProperty(CFReadStreamRef stream, CFStringRef propertyName);
2037 extern
2038 CFTypeRef CFWriteStreamCopyProperty(CFWriteStreamRef stream, CFStringRef propertyName);
2039
2040
2041
2042
2043 extern
2044 Boolean CFReadStreamSetProperty(CFReadStreamRef stream, CFStringRef propertyName, CFTypeRef propertyValue);
2045 extern
2046 Boolean CFWriteStreamSetProperty(CFWriteStreamRef stream, CFStringRef propertyName, CFTypeRef propertyValue);
2047 extern
2048 Boolean CFReadStreamSetClient(CFReadStreamRef stream, CFOptionFlags streamEvents, CFReadStreamClientCallBack clientCB, CFStreamClientContext *clientContext);
2049 extern
2050 Boolean CFWriteStreamSetClient(CFWriteStreamRef stream, CFOptionFlags streamEvents, CFWriteStreamClientCallBack clientCB, CFStreamClientContext *clientContext);
2051
2052 extern
2053 void CFReadStreamScheduleWithRunLoop(CFReadStreamRef stream, CFRunLoopRef runLoop, CFStringRef runLoopMode);
2054 extern
2055 void CFWriteStreamScheduleWithRunLoop(CFWriteStreamRef stream, CFRunLoopRef runLoop, CFStringRef runLoopMode);
2056
2057 extern
2058 void CFReadStreamUnscheduleFromRunLoop(CFReadStreamRef stream, CFRunLoopRef runLoop, CFStringRef runLoopMode);
2059 extern
2060 void CFWriteStreamUnscheduleFromRunLoop(CFWriteStreamRef stream, CFRunLoopRef runLoop, CFStringRef runLoopMode);
2061
2062
2063 }
2064
2065
2066 extern "C" {
2067
2068
2069 typedef enum {
2070     kCFPropertyListImmutable = 0,
2071     kCFPropertyListMutableContainers,
2072     kCFPropertyListMutableContainersAndLeaves
2073 } CFPropertyListMutabilityOptions;
2074 extern
2075 CFPropertyListRef CFPropertyListCreateFromXMLData(CFAllocatorRef allocator, CFDataRef xmlData, CFOptionFlags mutabilityOption, CFStringRef *errorString);
2076 extern
2077 CFDataRef CFPropertyListCreateXMLData(CFAllocatorRef allocator, CFPropertyListRef propertyList);
2078
2079
2080
2081
2082
2083
2084
2085 extern
2086 CFPropertyListRef CFPropertyListCreateDeepCopy(CFAllocatorRef allocator, CFPropertyListRef propertyList, CFOptionFlags mutabilityOption);
2087
2088
2089
2090 typedef enum {
2091     kCFPropertyListOpenStepFormat = 1,
2092     kCFPropertyListXMLFormat_v1_0 = 100,
2093     kCFPropertyListBinaryFormat_v1_0 = 200
2094 } CFPropertyListFormat;
2095
2096 extern
2097 Boolean CFPropertyListIsValid(CFPropertyListRef plist, CFPropertyListFormat format);
2098
2099
2100
2101
2102
2103
2104
2105 extern
2106 CFIndex CFPropertyListWriteToStream(CFPropertyListRef propertyList, CFWriteStreamRef stream, CFPropertyListFormat format, CFStringRef *errorString);
2107 extern
2108 CFPropertyListRef CFPropertyListCreateFromStream(CFAllocatorRef allocator, CFReadStreamRef stream, CFIndex streamLength, CFOptionFlags mutabilityOption, CFPropertyListFormat *format, CFStringRef *errorString);
2109 }
2110 extern "C" {
2111 typedef const void * (*CFSetRetainCallBack)(CFAllocatorRef allocator, const void *value);
2112
2113
2114
2115
2116
2117
2118
2119 typedef void (*CFSetReleaseCallBack)(CFAllocatorRef allocator, const void *value);
2120
2121
2122
2123
2124
2125
2126
2127 typedef CFStringRef (*CFSetCopyDescriptionCallBack)(const void *value);
2128 typedef Boolean (*CFSetEqualCallBack)(const void *value1, const void *value2);
2129
2130
2131
2132
2133
2134
2135
2136 typedef CFHashCode (*CFSetHashCallBack)(const void *value);
2137 typedef struct {
2138     CFIndex version;
2139     CFSetRetainCallBack retain;
2140     CFSetReleaseCallBack release;
2141     CFSetCopyDescriptionCallBack copyDescription;
2142     CFSetEqualCallBack equal;
2143     CFSetHashCallBack hash;
2144 } CFSetCallBacks;
2145
2146
2147
2148
2149
2150
2151 extern
2152 const CFSetCallBacks kCFTypeSetCallBacks;
2153
2154
2155
2156
2157
2158
2159
2160 extern
2161 const CFSetCallBacks kCFCopyStringSetCallBacks;
2162 typedef void (*CFSetApplierFunction)(const void *value, void *context);
2163
2164
2165
2166
2167
2168 typedef const struct __CFSet * CFSetRef;
2169
2170
2171
2172
2173
2174 typedef struct __CFSet * CFMutableSetRef;
2175
2176
2177
2178
2179
2180 extern
2181 CFTypeID CFSetGetTypeID(void);
2182 extern
2183 CFSetRef CFSetCreate(CFAllocatorRef allocator, const void **values, CFIndex numValues, const CFSetCallBacks *callBacks);
2184 extern
2185 CFSetRef CFSetCreateCopy(CFAllocatorRef allocator, CFSetRef theSet);
2186 extern
2187 CFMutableSetRef CFSetCreateMutable(CFAllocatorRef allocator, CFIndex capacity, const CFSetCallBacks *callBacks);
2188 extern
2189 CFMutableSetRef CFSetCreateMutableCopy(CFAllocatorRef allocator, CFIndex capacity, CFSetRef theSet);
2190 extern
2191 CFIndex CFSetGetCount(CFSetRef theSet);
2192 extern
2193 CFIndex CFSetGetCountOfValue(CFSetRef theSet, const void *value);
2194 extern
2195 Boolean CFSetContainsValue(CFSetRef theSet, const void *value);
2196 extern
2197 const void *CFSetGetValue(CFSetRef theSet, const void *value);
2198 extern
2199 Boolean CFSetGetValueIfPresent(CFSetRef theSet, const void *candidate, const void **value);
2200 extern
2201 void CFSetGetValues(CFSetRef theSet, const void **values);
2202 extern
2203 void CFSetApplyFunction(CFSetRef theSet, CFSetApplierFunction applier, void *context);
2204 extern
2205 void CFSetAddValue(CFMutableSetRef theSet, const void *value);
2206 extern
2207 void CFSetReplaceValue(CFMutableSetRef theSet, const void *value);
2208 extern
2209 void CFSetSetValue(CFMutableSetRef theSet, const void *value);
2210 extern
2211 void CFSetRemoveValue(CFMutableSetRef theSet, const void *value);
2212 extern
2213 void CFSetRemoveAllValues(CFMutableSetRef theSet);
2214
2215
2216 }
2217
2218 extern "C" {
2219
2220
2221 extern
2222 CFTypeID CFTimeZoneGetTypeID(void);
2223
2224 extern
2225 CFTimeZoneRef CFTimeZoneCopySystem(void);
2226
2227 extern
2228 void CFTimeZoneResetSystem(void);
2229
2230 extern
2231 CFTimeZoneRef CFTimeZoneCopyDefault(void);
2232
2233 extern
2234 void CFTimeZoneSetDefault(CFTimeZoneRef tz);
2235
2236 extern
2237 CFArrayRef CFTimeZoneCopyKnownNames(void);
2238
2239 extern
2240 CFDictionaryRef CFTimeZoneCopyAbbreviationDictionary(void);
2241
2242 extern
2243 void CFTimeZoneSetAbbreviationDictionary(CFDictionaryRef dict);
2244
2245 extern
2246 CFTimeZoneRef CFTimeZoneCreate(CFAllocatorRef allocator, CFStringRef name, CFDataRef data);
2247
2248 extern
2249 CFTimeZoneRef CFTimeZoneCreateWithTimeIntervalFromGMT(CFAllocatorRef allocator, CFTimeInterval ti);
2250
2251 extern
2252 CFTimeZoneRef CFTimeZoneCreateWithName(CFAllocatorRef allocator, CFStringRef name, Boolean tryAbbrev);
2253
2254 extern
2255 CFStringRef CFTimeZoneGetName(CFTimeZoneRef tz);
2256
2257 extern
2258 CFDataRef CFTimeZoneGetData(CFTimeZoneRef tz);
2259
2260 extern
2261 CFTimeInterval CFTimeZoneGetSecondsFromGMT(CFTimeZoneRef tz, CFAbsoluteTime at);
2262
2263 extern
2264 CFStringRef CFTimeZoneCopyAbbreviation(CFTimeZoneRef tz, CFAbsoluteTime at);
2265
2266 extern
2267 Boolean CFTimeZoneIsDaylightSavingTime(CFTimeZoneRef tz, CFAbsoluteTime at);
2268
2269
2270 }
2271 extern "C" {
2272 typedef const void * (*CFTreeRetainCallBack)(const void *info);
2273
2274
2275
2276
2277
2278
2279
2280 typedef void (*CFTreeReleaseCallBack)(const void *info);
2281 typedef CFStringRef (*CFTreeCopyDescriptionCallBack)(const void *info);
2282 typedef struct {
2283     CFIndex version;
2284     void * info;
2285     CFTreeRetainCallBack retain;
2286     CFTreeReleaseCallBack release;
2287     CFTreeCopyDescriptionCallBack copyDescription;
2288 } CFTreeContext;
2289 typedef void (*CFTreeApplierFunction)(const void *value, void *context);
2290
2291
2292
2293
2294
2295 typedef struct __CFTree * CFTreeRef;
2296
2297
2298
2299
2300
2301 extern
2302 CFTypeID CFTreeGetTypeID(void);
2303 extern
2304 CFTreeRef CFTreeCreate(CFAllocatorRef allocator, const CFTreeContext *context);
2305 extern
2306 CFTreeRef CFTreeGetParent(CFTreeRef tree);
2307 extern
2308 CFTreeRef CFTreeGetNextSibling(CFTreeRef tree);
2309 extern
2310 CFTreeRef CFTreeGetFirstChild(CFTreeRef tree);
2311 extern
2312 void CFTreeGetContext(CFTreeRef tree, CFTreeContext *context);
2313 extern
2314 CFIndex CFTreeGetChildCount(CFTreeRef tree);
2315 extern
2316 CFTreeRef CFTreeGetChildAtIndex(CFTreeRef tree, CFIndex idx);
2317 extern
2318 void CFTreeGetChildren(CFTreeRef tree, CFTreeRef *children);
2319 extern
2320 void CFTreeApplyFunctionToChildren(CFTreeRef tree, CFTreeApplierFunction applier, void *context);
2321 extern
2322 CFTreeRef CFTreeFindRoot(CFTreeRef tree);
2323 extern
2324 void CFTreeSetContext(CFTreeRef tree, const CFTreeContext *context);
2325 extern
2326 void CFTreePrependChild(CFTreeRef tree, CFTreeRef newChild);
2327 extern
2328 void CFTreeAppendChild(CFTreeRef tree, CFTreeRef newChild);
2329 extern
2330 void CFTreeInsertSibling(CFTreeRef tree, CFTreeRef newSibling);
2331
2332
2333
2334
2335
2336
2337
2338 extern
2339 void CFTreeRemove(CFTreeRef tree);
2340
2341
2342
2343
2344
2345
2346
2347 extern
2348 void CFTreeRemoveAllChildren(CFTreeRef tree);
2349 extern
2350 void CFTreeSortChildren(CFTreeRef tree, CFComparatorFunction comparator, void *context);
2351
2352
2353 }
2354
2355 extern "C" {
2356
2357
2358 enum {
2359         kCFXMLNodeCurrentVersion = 1
2360 };
2361
2362 typedef const struct __CFXMLNode * CFXMLNodeRef;
2363 typedef CFTreeRef CFXMLTreeRef;
2364 typedef enum {
2365     kCFXMLNodeTypeDocument = 1,
2366     kCFXMLNodeTypeElement = 2,
2367     kCFXMLNodeTypeAttribute = 3,
2368     kCFXMLNodeTypeProcessingInstruction = 4,
2369     kCFXMLNodeTypeComment = 5,
2370     kCFXMLNodeTypeText = 6,
2371     kCFXMLNodeTypeCDATASection = 7,
2372     kCFXMLNodeTypeDocumentFragment = 8,
2373     kCFXMLNodeTypeEntity = 9,
2374     kCFXMLNodeTypeEntityReference = 10,
2375     kCFXMLNodeTypeDocumentType = 11,
2376     kCFXMLNodeTypeWhitespace = 12,
2377     kCFXMLNodeTypeNotation = 13,
2378     kCFXMLNodeTypeElementTypeDeclaration = 14,
2379     kCFXMLNodeTypeAttributeListDeclaration = 15
2380 } CFXMLNodeTypeCode;
2381
2382 typedef struct {
2383     CFDictionaryRef attributes;
2384     CFArrayRef attributeOrder;
2385     Boolean isEmpty;
2386     char _reserved[3];
2387 } CFXMLElementInfo;
2388
2389 typedef struct {
2390     CFStringRef dataString;
2391 } CFXMLProcessingInstructionInfo;
2392
2393 typedef struct {
2394     CFURLRef sourceURL;
2395     CFStringEncoding encoding;
2396 } CFXMLDocumentInfo;
2397
2398 typedef struct {
2399     CFURLRef systemID;
2400     CFStringRef publicID;
2401 } CFXMLExternalID;
2402
2403 typedef struct {
2404     CFXMLExternalID externalID;
2405 } CFXMLDocumentTypeInfo;
2406
2407 typedef struct {
2408     CFXMLExternalID externalID;
2409 } CFXMLNotationInfo;
2410
2411 typedef struct {
2412
2413     CFStringRef contentDescription;
2414 } CFXMLElementTypeDeclarationInfo;
2415
2416 typedef struct {
2417
2418     CFStringRef attributeName;
2419     CFStringRef typeString;
2420     CFStringRef defaultString;
2421 } CFXMLAttributeDeclarationInfo;
2422
2423 typedef struct {
2424     CFIndex numberOfAttributes;
2425     CFXMLAttributeDeclarationInfo *attributes;
2426 } CFXMLAttributeListDeclarationInfo;
2427
2428 typedef enum {
2429     kCFXMLEntityTypeParameter,
2430     kCFXMLEntityTypeParsedInternal,
2431     kCFXMLEntityTypeParsedExternal,
2432     kCFXMLEntityTypeUnparsed,
2433     kCFXMLEntityTypeCharacter
2434 } CFXMLEntityTypeCode;
2435
2436 typedef struct {
2437     CFXMLEntityTypeCode entityType;
2438     CFStringRef replacementText;
2439     CFXMLExternalID entityID;
2440     CFStringRef notationName;
2441 } CFXMLEntityInfo;
2442
2443 typedef struct {
2444     CFXMLEntityTypeCode entityType;
2445 } CFXMLEntityReferenceInfo;
2446 extern
2447 CFTypeID CFXMLNodeGetTypeID(void);
2448
2449
2450 extern
2451 CFXMLNodeRef CFXMLNodeCreate(CFAllocatorRef alloc, CFXMLNodeTypeCode xmlType, CFStringRef dataString, const void *additionalInfoPtr, CFIndex version);
2452
2453
2454 extern
2455 CFXMLNodeRef CFXMLNodeCreateCopy(CFAllocatorRef alloc, CFXMLNodeRef origNode);
2456
2457 extern
2458 CFXMLNodeTypeCode CFXMLNodeGetTypeCode(CFXMLNodeRef node);
2459
2460 extern
2461 CFStringRef CFXMLNodeGetString(CFXMLNodeRef node);
2462
2463 extern
2464 const void *CFXMLNodeGetInfoPtr(CFXMLNodeRef node);
2465
2466 extern
2467 CFIndex CFXMLNodeGetVersion(CFXMLNodeRef node);
2468
2469
2470
2471
2472 extern
2473 CFXMLTreeRef CFXMLTreeCreateWithNode(CFAllocatorRef allocator, CFXMLNodeRef node);
2474
2475
2476 extern
2477 CFXMLNodeRef CFXMLTreeGetNode(CFXMLTreeRef xmlTree);
2478
2479
2480 }
2481 extern "C" {
2482
2483
2484 typedef struct __CFXMLParser * CFXMLParserRef;
2485 typedef enum {
2486     kCFXMLParserValidateDocument = (1 << 0),
2487     kCFXMLParserSkipMetaData = (1 << 1),
2488     kCFXMLParserReplacePhysicalEntities = (1 << 2),
2489     kCFXMLParserSkipWhitespace = (1 << 3),
2490     kCFXMLParserResolveExternalEntities = (1 << 4),
2491     kCFXMLParserAddImpliedAttributes = (1 << 5),
2492     kCFXMLParserAllOptions = 0x00FFFFFF,
2493     kCFXMLParserNoOptions = 0
2494 } CFXMLParserOptions;
2495
2496
2497 typedef enum {
2498     kCFXMLStatusParseNotBegun = -2,
2499     kCFXMLStatusParseInProgress = -1,
2500     kCFXMLStatusParseSuccessful = 0,
2501     kCFXMLErrorUnexpectedEOF = 1,
2502     kCFXMLErrorUnknownEncoding,
2503     kCFXMLErrorEncodingConversionFailure,
2504     kCFXMLErrorMalformedProcessingInstruction,
2505     kCFXMLErrorMalformedDTD,
2506     kCFXMLErrorMalformedName,
2507     kCFXMLErrorMalformedCDSect,
2508     kCFXMLErrorMalformedCloseTag,
2509     kCFXMLErrorMalformedStartTag,
2510     kCFXMLErrorMalformedDocument,
2511     kCFXMLErrorElementlessDocument,
2512     kCFXMLErrorMalformedComment,
2513     kCFXMLErrorMalformedCharacterReference,
2514     kCFXMLErrorMalformedParsedCharacterData,
2515     kCFXMLErrorNoData
2516 } CFXMLParserStatusCode;
2517 typedef void * (*CFXMLParserCreateXMLStructureCallBack)(CFXMLParserRef parser, CFXMLNodeRef nodeDesc, void *info);
2518 typedef void (*CFXMLParserAddChildCallBack)(CFXMLParserRef parser, void *parent, void *child, void *info);
2519 typedef void (*CFXMLParserEndXMLStructureCallBack)(CFXMLParserRef parser, void *xmlType, void *info);
2520 typedef CFDataRef (*CFXMLParserResolveExternalEntityCallBack)(CFXMLParserRef parser, CFXMLExternalID *extID, void *info);
2521 typedef Boolean (*CFXMLParserHandleErrorCallBack)(CFXMLParserRef parser, CFXMLParserStatusCode error, void *info);
2522 typedef struct {
2523     CFIndex version;
2524     CFXMLParserCreateXMLStructureCallBack createXMLStructure;
2525     CFXMLParserAddChildCallBack addChild;
2526     CFXMLParserEndXMLStructureCallBack endXMLStructure;
2527     CFXMLParserResolveExternalEntityCallBack resolveExternalEntity;
2528     CFXMLParserHandleErrorCallBack handleError;
2529 } CFXMLParserCallBacks;
2530
2531 typedef const void * (*CFXMLParserRetainCallBack)(const void *info);
2532 typedef void (*CFXMLParserReleaseCallBack)(const void *info);
2533 typedef CFStringRef (*CFXMLParserCopyDescriptionCallBack)(const void *info);
2534 typedef struct {
2535     CFIndex version;
2536     void * info;
2537     CFXMLParserRetainCallBack retain;
2538     CFXMLParserReleaseCallBack release;
2539     CFXMLParserCopyDescriptionCallBack copyDescription;
2540 } CFXMLParserContext;
2541
2542 extern
2543 CFTypeID CFXMLParserGetTypeID(void);
2544 extern
2545 CFXMLParserRef CFXMLParserCreate(CFAllocatorRef allocator, CFDataRef xmlData, CFURLRef dataSource, CFOptionFlags parseOptions, CFIndex versionOfNodes, CFXMLParserCallBacks *callBacks, CFXMLParserContext *context);
2546
2547
2548
2549
2550 extern
2551 CFXMLParserRef CFXMLParserCreateWithDataFromURL(CFAllocatorRef allocator, CFURLRef dataSource, CFOptionFlags parseOptions, CFIndex versionOfNodes, CFXMLParserCallBacks *callBacks, CFXMLParserContext *context);
2552
2553
2554 extern
2555 void CFXMLParserGetContext(CFXMLParserRef parser, CFXMLParserContext *context);
2556
2557 extern
2558 void CFXMLParserGetCallBacks(CFXMLParserRef parser, CFXMLParserCallBacks *callBacks);
2559
2560 extern
2561 CFURLRef CFXMLParserGetSourceURL(CFXMLParserRef parser);
2562
2563
2564 extern
2565 CFIndex CFXMLParserGetLocation(CFXMLParserRef parser);
2566
2567
2568 extern
2569 CFIndex CFXMLParserGetLineNumber(CFXMLParserRef parser);
2570
2571
2572 extern
2573 void *CFXMLParserGetDocument(CFXMLParserRef parser);
2574
2575
2576
2577
2578 extern
2579 CFXMLParserStatusCode CFXMLParserGetStatusCode(CFXMLParserRef parser);
2580
2581 extern
2582 CFStringRef CFXMLParserCopyErrorDescription(CFXMLParserRef parser);
2583
2584
2585
2586
2587 extern
2588 void CFXMLParserAbort(CFXMLParserRef parser, CFXMLParserStatusCode errorCode, CFStringRef errorDescription);
2589
2590
2591
2592
2593
2594
2595 extern
2596 Boolean CFXMLParserParse(CFXMLParserRef parser);
2597
2598
2599
2600
2601
2602
2603
2604 extern
2605 CFXMLTreeRef CFXMLTreeCreateFromData(CFAllocatorRef allocator, CFDataRef xmlData, CFURLRef dataSource, CFOptionFlags parseOptions, CFIndex versionOfNodes);
2606
2607
2608
2609 extern
2610 CFXMLTreeRef CFXMLTreeCreateWithDataFromURL(CFAllocatorRef allocator, CFURLRef dataSource, CFOptionFlags parseOptions, CFIndex versionOfNodes);
2611
2612
2613
2614
2615
2616
2617
2618 extern
2619 CFDataRef CFXMLTreeCreateXMLData(CFAllocatorRef allocator, CFXMLTreeRef xmlTree);
2620
2621
2622 }
2623
2624 extern "C" {
2625
2626
2627 typedef struct {
2628     CFIndex version;
2629     void * info;
2630     const void *(*retain)(const void *info);
2631     void (*release)(const void *info);
2632     CFStringRef (*copyDescription)(const void *info);
2633 } CFBinaryHeapCompareContext;
2634 typedef struct {
2635     CFIndex version;
2636     const void *(*retain)(CFAllocatorRef allocator, const void *ptr);
2637     void (*release)(CFAllocatorRef allocator, const void *ptr);
2638     CFStringRef (*copyDescription)(const void *ptr);
2639     CFComparisonResult (*compare)(const void *ptr1, const void *ptr2, void *context);
2640 } CFBinaryHeapCallBacks;
2641
2642
2643
2644
2645
2646
2647
2648 extern const CFBinaryHeapCallBacks kCFStringBinaryHeapCallBacks;
2649 typedef void (*CFBinaryHeapApplierFunction)(const void *val, void *context);
2650
2651
2652
2653
2654
2655 typedef struct __CFBinaryHeap * CFBinaryHeapRef;
2656
2657
2658
2659
2660
2661 extern CFTypeID CFBinaryHeapGetTypeID(void);
2662 extern CFBinaryHeapRef CFBinaryHeapCreate(CFAllocatorRef allocator, CFIndex capacity, const CFBinaryHeapCallBacks *callBacks, const CFBinaryHeapCompareContext *compareContext);
2663 extern CFBinaryHeapRef CFBinaryHeapCreateCopy(CFAllocatorRef allocator, CFIndex capacity, CFBinaryHeapRef heap);
2664 extern CFIndex CFBinaryHeapGetCount(CFBinaryHeapRef heap);
2665 extern CFIndex CFBinaryHeapGetCountOfValue(CFBinaryHeapRef heap, const void *value);
2666 extern Boolean CFBinaryHeapContainsValue(CFBinaryHeapRef heap, const void *value);
2667 extern const void * CFBinaryHeapGetMinimum(CFBinaryHeapRef heap);
2668 extern Boolean CFBinaryHeapGetMinimumIfPresent(CFBinaryHeapRef heap, const void **value);
2669 extern void CFBinaryHeapGetValues(CFBinaryHeapRef heap, const void **values);
2670 extern void CFBinaryHeapApplyFunction(CFBinaryHeapRef heap, CFBinaryHeapApplierFunction applier, void *context);
2671 extern void CFBinaryHeapAddValue(CFBinaryHeapRef heap, const void *value);
2672
2673
2674
2675
2676
2677
2678
2679 extern void CFBinaryHeapRemoveMinimumValue(CFBinaryHeapRef heap);
2680 extern void CFBinaryHeapRemoveAllValues(CFBinaryHeapRef heap);
2681
2682
2683 }
2684 extern "C" {
2685
2686
2687 typedef UInt32 CFBit;
2688
2689 typedef const struct __CFBitVector * CFBitVectorRef;
2690 typedef struct __CFBitVector * CFMutableBitVectorRef;
2691
2692 extern CFTypeID CFBitVectorGetTypeID(void);
2693
2694 extern CFBitVectorRef CFBitVectorCreate(CFAllocatorRef allocator, const UInt8 *bytes, CFIndex numBits);
2695 extern CFBitVectorRef CFBitVectorCreateCopy(CFAllocatorRef allocator, CFBitVectorRef bv);
2696 extern CFMutableBitVectorRef CFBitVectorCreateMutable(CFAllocatorRef allocator, CFIndex capacity);
2697 extern CFMutableBitVectorRef CFBitVectorCreateMutableCopy(CFAllocatorRef allocator, CFIndex capacity, CFBitVectorRef bv);
2698
2699 extern CFIndex CFBitVectorGetCount(CFBitVectorRef bv);
2700 extern CFIndex CFBitVectorGetCountOfBit(CFBitVectorRef bv, CFRange range, CFBit value);
2701 extern Boolean CFBitVectorContainsBit(CFBitVectorRef bv, CFRange range, CFBit value);
2702 extern CFBit CFBitVectorGetBitAtIndex(CFBitVectorRef bv, CFIndex idx);
2703 extern void CFBitVectorGetBits(CFBitVectorRef bv, CFRange range, UInt8 *bytes);
2704 extern CFIndex CFBitVectorGetFirstIndexOfBit(CFBitVectorRef bv, CFRange range, CFBit value);
2705 extern CFIndex CFBitVectorGetLastIndexOfBit(CFBitVectorRef bv, CFRange range, CFBit value);
2706
2707 extern void CFBitVectorSetCount(CFMutableBitVectorRef bv, CFIndex count);
2708 extern void CFBitVectorFlipBitAtIndex(CFMutableBitVectorRef bv, CFIndex idx);
2709 extern void CFBitVectorFlipBits(CFMutableBitVectorRef bv, CFRange range);
2710 extern void CFBitVectorSetBitAtIndex(CFMutableBitVectorRef bv, CFIndex idx, CFBit value);
2711 extern void CFBitVectorSetBits(CFMutableBitVectorRef bv, CFRange range, CFBit value);
2712 extern void CFBitVectorSetAllBits(CFMutableBitVectorRef bv, CFBit value);
2713
2714
2715 }
2716 extern "C" {
2717
2718
2719 typedef struct __CFBundle *CFBundleRef;
2720 typedef struct __CFBundle *CFPlugInRef;
2721
2722
2723 extern
2724 const CFStringRef kCFBundleInfoDictionaryVersionKey;
2725
2726 extern
2727 const CFStringRef kCFBundleExecutableKey;
2728
2729 extern
2730 const CFStringRef kCFBundleIdentifierKey;
2731
2732 extern
2733 const CFStringRef kCFBundleVersionKey;
2734
2735
2736 extern
2737 const CFStringRef kCFBundleDevelopmentRegionKey;
2738
2739 extern
2740 const CFStringRef kCFBundleNameKey;
2741
2742
2743 extern
2744 const CFStringRef kCFBundleLocalizationsKey;
2745
2746
2747
2748
2749
2750 extern
2751 CFBundleRef CFBundleGetMainBundle(void);
2752
2753 extern
2754 CFBundleRef CFBundleGetBundleWithIdentifier(CFStringRef bundleID);
2755
2756
2757
2758
2759
2760 extern
2761 CFArrayRef CFBundleGetAllBundles(void);
2762
2763
2764
2765
2766 extern
2767 UInt32 CFBundleGetTypeID(void);
2768
2769 extern
2770 CFBundleRef CFBundleCreate(CFAllocatorRef allocator, CFURLRef bundleURL);
2771
2772
2773 extern
2774 CFArrayRef CFBundleCreateBundlesFromDirectory(CFAllocatorRef allocator, CFURLRef directoryURL, CFStringRef bundleType);
2775
2776
2777
2778
2779
2780 extern
2781 CFURLRef CFBundleCopyBundleURL(CFBundleRef bundle);
2782
2783 extern
2784 CFTypeRef CFBundleGetValueForInfoDictionaryKey(CFBundleRef bundle, CFStringRef key);
2785
2786
2787 extern
2788 CFDictionaryRef CFBundleGetInfoDictionary(CFBundleRef bundle);
2789
2790
2791
2792 extern
2793 CFDictionaryRef CFBundleGetLocalInfoDictionary(CFBundleRef bundle);
2794
2795
2796 extern
2797 void CFBundleGetPackageInfo(CFBundleRef bundle, UInt32 *packageType, UInt32 *packageCreator);
2798
2799 extern
2800 CFStringRef CFBundleGetIdentifier(CFBundleRef bundle);
2801
2802 extern
2803 UInt32 CFBundleGetVersionNumber(CFBundleRef bundle);
2804
2805 extern
2806 CFStringRef CFBundleGetDevelopmentRegion(CFBundleRef bundle);
2807
2808 extern
2809 CFURLRef CFBundleCopySupportFilesDirectoryURL(CFBundleRef bundle);
2810
2811 extern
2812 CFURLRef CFBundleCopyResourcesDirectoryURL(CFBundleRef bundle);
2813
2814 extern
2815 CFURLRef CFBundleCopyPrivateFrameworksURL(CFBundleRef bundle);
2816
2817 extern
2818 CFURLRef CFBundleCopySharedFrameworksURL(CFBundleRef bundle);
2819
2820 extern
2821 CFURLRef CFBundleCopySharedSupportURL(CFBundleRef bundle);
2822
2823 extern
2824 CFURLRef CFBundleCopyBuiltInPlugInsURL(CFBundleRef bundle);
2825
2826
2827
2828
2829 extern
2830 CFDictionaryRef CFBundleCopyInfoDictionaryInDirectory(CFURLRef bundleURL);
2831
2832 extern
2833 Boolean CFBundleGetPackageInfoInDirectory(CFURLRef url, UInt32 *packageType, UInt32 *packageCreator);
2834
2835
2836
2837 extern
2838 CFURLRef CFBundleCopyResourceURL(CFBundleRef bundle, CFStringRef resourceName, CFStringRef resourceType, CFStringRef subDirName);
2839
2840 extern
2841 CFArrayRef CFBundleCopyResourceURLsOfType(CFBundleRef bundle, CFStringRef resourceType, CFStringRef subDirName);
2842
2843 extern
2844 CFStringRef CFBundleCopyLocalizedString(CFBundleRef bundle, CFStringRef key, CFStringRef value, CFStringRef tableName);
2845 extern
2846 CFURLRef CFBundleCopyResourceURLInDirectory(CFURLRef bundleURL, CFStringRef resourceName, CFStringRef resourceType, CFStringRef subDirName);
2847
2848 extern
2849 CFArrayRef CFBundleCopyResourceURLsOfTypeInDirectory(CFURLRef bundleURL, CFStringRef resourceType, CFStringRef subDirName);
2850
2851
2852
2853
2854
2855
2856 extern
2857 CFArrayRef CFBundleCopyBundleLocalizations(CFBundleRef bundle);
2858
2859
2860 extern
2861 CFArrayRef CFBundleCopyPreferredLocalizationsFromArray(CFArrayRef locArray);
2862
2863
2864
2865
2866
2867
2868
2869 extern
2870 CFArrayRef CFBundleCopyLocalizationsForPreferences(CFArrayRef locArray, CFArrayRef prefArray);
2871 extern
2872 CFURLRef CFBundleCopyResourceURLForLocalization(CFBundleRef bundle, CFStringRef resourceName, CFStringRef resourceType, CFStringRef subDirName, CFStringRef localizationName);
2873
2874 extern
2875 CFArrayRef CFBundleCopyResourceURLsOfTypeForLocalization(CFBundleRef bundle, CFStringRef resourceType, CFStringRef subDirName, CFStringRef localizationName);
2876
2877
2878
2879
2880
2881 extern
2882 CFDictionaryRef CFBundleCopyInfoDictionaryForURL(CFURLRef url);
2883
2884
2885
2886
2887
2888 extern
2889 CFArrayRef CFBundleCopyLocalizationsForURL(CFURLRef url);
2890 extern
2891 CFURLRef CFBundleCopyExecutableURL(CFBundleRef bundle);
2892
2893 extern
2894 Boolean CFBundleIsExecutableLoaded(CFBundleRef bundle);
2895
2896 extern
2897 Boolean CFBundleLoadExecutable(CFBundleRef bundle);
2898
2899 extern
2900 void CFBundleUnloadExecutable(CFBundleRef bundle);
2901
2902 extern
2903 void *CFBundleGetFunctionPointerForName(CFBundleRef bundle, CFStringRef functionName);
2904
2905 extern
2906 void CFBundleGetFunctionPointersForNames(CFBundleRef bundle, CFArrayRef functionNames, void *ftbl[]);
2907
2908 extern
2909 void *CFBundleGetDataPointerForName(CFBundleRef bundle, CFStringRef symbolName);
2910
2911 extern
2912 void CFBundleGetDataPointersForNames(CFBundleRef bundle, CFArrayRef symbolNames, void *stbl[]);
2913
2914 extern
2915 CFURLRef CFBundleCopyAuxiliaryExecutableURL(CFBundleRef bundle, CFStringRef executableName);
2916 extern
2917 CFPlugInRef CFBundleGetPlugIn(CFBundleRef bundle);
2918
2919
2920
2921 extern
2922 short CFBundleOpenBundleResourceMap(CFBundleRef bundle);
2923
2924
2925
2926
2927
2928
2929 extern
2930 SInt32 CFBundleOpenBundleResourceFiles(CFBundleRef bundle, short *refNum, short *localizedRefNum);
2931
2932
2933
2934 extern
2935 void CFBundleCloseBundleResourceMap(CFBundleRef bundle, short refNum);
2936
2937
2938 }
2939 extern "C" {
2940
2941
2942 typedef enum __CFByteOrder {
2943     CFByteOrderUnknown,
2944     CFByteOrderLittleEndian,
2945     CFByteOrderBigEndian
2946 } CFByteOrder;
2947
2948 static __inline__ CFByteOrder CFByteOrderGetCurrent(void) {
2949     uint32_t x = (CFByteOrderBigEndian << 24) | CFByteOrderLittleEndian;
2950     return (CFByteOrder)*((UInt8 *)&x);
2951 }
2952
2953 static __inline__ uint16_t CFSwapInt16(uint16_t arg) {
2954
2955
2956
2957
2958
2959     uint16_t result;
2960     __asm__ volatile("lhbrx %0, 0, %1" : "=r" (result) : "r" (&arg) : "r0");
2961     return result;
2962 }
2963
2964 static __inline__ uint32_t CFSwapInt32(uint32_t arg) {
2965
2966
2967
2968
2969
2970     uint32_t result;
2971     __asm__ volatile("lwbrx %0, 0, %1" : "=r" (result) : "r" (&arg) : "r0");
2972     return result;
2973 }
2974
2975 static __inline__ uint64_t CFSwapInt64(uint64_t arg) {
2976     union CFSwap {
2977         uint64_t sv;
2978         UInt8 uc[8];
2979     } result, *argp = (union CFSwap *)&arg;
2980     result.uc[0] = argp->uc[7];
2981     result.uc[1] = argp->uc[6];
2982     result.uc[2] = argp->uc[5];
2983     result.uc[3] = argp->uc[4];
2984     result.uc[4] = argp->uc[3];
2985     result.uc[5] = argp->uc[2];
2986     result.uc[6] = argp->uc[1];
2987     result.uc[7] = argp->uc[0];
2988     return result.sv;
2989
2990 }
2991
2992 static __inline__ uint16_t CFSwapInt16BigToHost(uint16_t arg) {
2993
2994     return arg;
2995
2996
2997
2998 }
2999
3000 static __inline__ uint32_t CFSwapInt32BigToHost(uint32_t arg) {
3001
3002     return arg;
3003
3004
3005
3006 }
3007
3008 static __inline__ uint64_t CFSwapInt64BigToHost(uint64_t arg) {
3009
3010     return arg;
3011
3012
3013
3014 }
3015
3016 static __inline__ uint16_t CFSwapInt16HostToBig(uint16_t arg) {
3017
3018     return arg;
3019
3020
3021
3022 }
3023
3024 static __inline__ uint32_t CFSwapInt32HostToBig(uint32_t arg) {
3025
3026     return arg;
3027
3028
3029
3030 }
3031
3032 static __inline__ uint64_t CFSwapInt64HostToBig(uint64_t arg) {
3033
3034     return arg;
3035
3036
3037
3038 }
3039
3040 static __inline__ uint16_t CFSwapInt16LittleToHost(uint16_t arg) {
3041
3042
3043
3044     return CFSwapInt16(arg);
3045
3046 }
3047
3048 static __inline__ uint32_t CFSwapInt32LittleToHost(uint32_t arg) {
3049
3050
3051
3052     return CFSwapInt32(arg);
3053
3054 }
3055
3056 static __inline__ uint64_t CFSwapInt64LittleToHost(uint64_t arg) {
3057
3058
3059
3060     return CFSwapInt64(arg);
3061
3062 }
3063
3064 static __inline__ uint16_t CFSwapInt16HostToLittle(uint16_t arg) {
3065
3066
3067
3068     return CFSwapInt16(arg);
3069
3070 }
3071
3072 static __inline__ uint32_t CFSwapInt32HostToLittle(uint32_t arg) {
3073
3074
3075
3076     return CFSwapInt32(arg);
3077
3078 }
3079
3080 static __inline__ uint64_t CFSwapInt64HostToLittle(uint64_t arg) {
3081
3082
3083
3084     return CFSwapInt64(arg);
3085
3086 }
3087
3088 typedef struct {uint32_t v;} CFSwappedFloat32;
3089 typedef struct {uint64_t v;} CFSwappedFloat64;
3090
3091 static __inline__ CFSwappedFloat32 CFConvertFloat32HostToSwapped(Float32 arg) {
3092     union CFSwap {
3093         Float32 v;
3094         CFSwappedFloat32 sv;
3095     } result;
3096     result.v = arg;
3097
3098
3099
3100     return result.sv;
3101 }
3102
3103 static __inline__ Float32 CFConvertFloat32SwappedToHost(CFSwappedFloat32 arg) {
3104     union CFSwap {
3105         Float32 v;
3106         CFSwappedFloat32 sv;
3107     } result;
3108     result.sv = arg;
3109
3110
3111
3112     return result.v;
3113 }
3114
3115 static __inline__ CFSwappedFloat64 CFConvertFloat64HostToSwapped(Float64 arg) {
3116     union CFSwap {
3117         Float64 v;
3118         CFSwappedFloat64 sv;
3119     } result;
3120     result.v = arg;
3121
3122
3123
3124     return result.sv;
3125 }
3126
3127 static __inline__ Float64 CFConvertFloat64SwappedToHost(CFSwappedFloat64 arg) {
3128     union CFSwap {
3129         Float64 v;
3130         CFSwappedFloat64 sv;
3131     } result;
3132     result.sv = arg;
3133
3134
3135
3136     return result.v;
3137 }
3138
3139 static __inline__ CFSwappedFloat32 CFConvertFloatHostToSwapped(float arg) {
3140     union CFSwap {
3141         float v;
3142         CFSwappedFloat32 sv;
3143     } result;
3144     result.v = arg;
3145
3146
3147
3148     return result.sv;
3149 }
3150
3151 static __inline__ float CFConvertFloatSwappedToHost(CFSwappedFloat32 arg) {
3152     union CFSwap {
3153         float v;
3154         CFSwappedFloat32 sv;
3155     } result;
3156     result.sv = arg;
3157
3158
3159
3160     return result.v;
3161 }
3162
3163 static __inline__ CFSwappedFloat64 CFConvertDoubleHostToSwapped(double arg) {
3164     union CFSwap {
3165         double v;
3166         CFSwappedFloat64 sv;
3167     } result;
3168     result.v = arg;
3169
3170
3171
3172     return result.sv;
3173 }
3174
3175 static __inline__ double CFConvertDoubleSwappedToHost(CFSwappedFloat64 arg) {
3176     union CFSwap {
3177         double v;
3178         CFSwappedFloat64 sv;
3179     } result;
3180     result.sv = arg;
3181
3182
3183
3184     return result.v;
3185 }
3186
3187
3188 }
3189 extern "C" {
3190
3191
3192 typedef const struct __CFUUID * CFUUIDRef;
3193
3194 typedef struct {
3195     UInt8 byte0;
3196     UInt8 byte1;
3197     UInt8 byte2;
3198     UInt8 byte3;
3199     UInt8 byte4;
3200     UInt8 byte5;
3201     UInt8 byte6;
3202     UInt8 byte7;
3203     UInt8 byte8;
3204     UInt8 byte9;
3205     UInt8 byte10;
3206     UInt8 byte11;
3207     UInt8 byte12;
3208     UInt8 byte13;
3209     UInt8 byte14;
3210     UInt8 byte15;
3211 } CFUUIDBytes;
3212
3213
3214
3215
3216
3217
3218 extern
3219 CFTypeID CFUUIDGetTypeID(void);
3220
3221 extern
3222 CFUUIDRef CFUUIDCreate(CFAllocatorRef alloc);
3223
3224
3225 extern
3226 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);
3227
3228
3229 extern
3230 CFUUIDRef CFUUIDCreateFromString(CFAllocatorRef alloc, CFStringRef uuidStr);
3231
3232
3233 extern
3234 CFStringRef CFUUIDCreateString(CFAllocatorRef alloc, CFUUIDRef uuid);
3235
3236
3237 extern
3238 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);
3239
3240
3241 extern
3242 CFUUIDBytes CFUUIDGetUUIDBytes(CFUUIDRef uuid);
3243
3244 extern
3245 CFUUIDRef CFUUIDCreateFromUUIDBytes(CFAllocatorRef alloc, CFUUIDBytes bytes);
3246
3247
3248 }
3249
3250
3251 extern "C" {
3252
3253
3254
3255
3256 extern
3257 const CFStringRef kCFPlugInDynamicRegistrationKey;
3258 extern
3259 const CFStringRef kCFPlugInDynamicRegisterFunctionKey;
3260 extern
3261 const CFStringRef kCFPlugInUnloadFunctionKey;
3262 extern
3263 const CFStringRef kCFPlugInFactoriesKey;
3264 extern
3265 const CFStringRef kCFPlugInTypesKey;
3266
3267
3268
3269
3270 typedef void (*CFPlugInDynamicRegisterFunction)(CFPlugInRef plugIn);
3271 typedef void (*CFPlugInUnloadFunction)(CFPlugInRef plugIn);
3272 typedef void *(*CFPlugInFactoryFunction)(CFAllocatorRef allocator, CFUUIDRef typeUUID);
3273
3274
3275
3276 extern
3277 UInt32 CFPlugInGetTypeID(void);
3278
3279 extern
3280 CFPlugInRef CFPlugInCreate(CFAllocatorRef allocator, CFURLRef plugInURL);
3281
3282
3283 extern
3284 CFBundleRef CFPlugInGetBundle(CFPlugInRef plugIn);
3285
3286
3287
3288
3289
3290
3291
3292 extern
3293 void CFPlugInSetLoadOnDemand(CFPlugInRef plugIn, Boolean flag);
3294
3295 extern
3296 Boolean CFPlugInIsLoadOnDemand(CFPlugInRef plugIn);
3297
3298
3299
3300
3301
3302 extern
3303 CFArrayRef CFPlugInFindFactoriesForPlugInType(CFUUIDRef typeUUID);
3304
3305
3306 extern
3307 CFArrayRef CFPlugInFindFactoriesForPlugInTypeInPlugIn(CFUUIDRef typeUUID, CFPlugInRef plugIn);
3308
3309
3310 extern
3311 void *CFPlugInInstanceCreate(CFAllocatorRef allocator, CFUUIDRef factoryUUID, CFUUIDRef typeUUID);
3312
3313
3314
3315
3316
3317
3318 extern
3319 Boolean CFPlugInRegisterFactoryFunction(CFUUIDRef factoryUUID, CFPlugInFactoryFunction func);
3320
3321 extern
3322 Boolean CFPlugInRegisterFactoryFunctionByName(CFUUIDRef factoryUUID, CFPlugInRef plugIn, CFStringRef functionName);
3323
3324 extern
3325 Boolean CFPlugInUnregisterFactory(CFUUIDRef factoryUUID);
3326
3327 extern
3328 Boolean CFPlugInRegisterPlugInType(CFUUIDRef factoryUUID, CFUUIDRef typeUUID);
3329
3330 extern
3331 Boolean CFPlugInUnregisterPlugInType(CFUUIDRef factoryUUID, CFUUIDRef typeUUID);
3332
3333
3334
3335
3336
3337 extern
3338 void CFPlugInAddInstanceForFactory(CFUUIDRef factoryID);
3339
3340 extern
3341 void CFPlugInRemoveInstanceForFactory(CFUUIDRef factoryID);
3342
3343
3344
3345
3346 typedef struct __CFPlugInInstance *CFPlugInInstanceRef;
3347
3348 typedef Boolean (*CFPlugInInstanceGetInterfaceFunction)(CFPlugInInstanceRef instance, CFStringRef interfaceName, void **ftbl);
3349 typedef void (*CFPlugInInstanceDeallocateInstanceDataFunction)(void *instanceData);
3350
3351 extern
3352 Boolean CFPlugInInstanceGetInterfaceFunctionTable(CFPlugInInstanceRef instance, CFStringRef interfaceName, void **ftbl);
3353 extern
3354 CFStringRef CFPlugInInstanceGetFactoryName(CFPlugInInstanceRef instance);
3355 extern
3356 void *CFPlugInInstanceGetInstanceData(CFPlugInInstanceRef instance);
3357 extern
3358 UInt32 CFPlugInInstanceGetTypeID(void);
3359 extern
3360 CFPlugInInstanceRef CFPlugInInstanceCreateWithInstanceDataSize(CFAllocatorRef allocator, CFIndex instanceDataSize, CFPlugInInstanceDeallocateInstanceDataFunction deallocateInstanceFunction, CFStringRef factoryName, CFPlugInInstanceGetInterfaceFunction getInterfaceFunction);
3361
3362
3363 }
3364 extern "C" {
3365 extern
3366 Boolean CFURLCreateDataAndPropertiesFromResource(CFAllocatorRef alloc, CFURLRef url, CFDataRef *resourceData, CFDictionaryRef *properties, CFArrayRef desiredProperties, SInt32 *errorCode);
3367 extern
3368 Boolean CFURLWriteDataAndPropertiesToResource(CFURLRef url, CFDataRef dataToWrite, CFDictionaryRef propertiesToWrite, SInt32 *errorCode);
3369
3370
3371
3372 extern
3373 Boolean CFURLDestroyResource(CFURLRef url, SInt32 *errorCode);
3374
3375
3376
3377 extern
3378 CFTypeRef CFURLCreatePropertyFromResource(CFAllocatorRef alloc, CFURLRef url, CFStringRef property, SInt32 *errorCode);
3379
3380
3381 typedef enum {
3382     kCFURLUnknownError = -10,
3383     kCFURLUnknownSchemeError = -11,
3384     kCFURLResourceNotFoundError = -12,
3385     kCFURLResourceAccessViolationError = -13,
3386     kCFURLRemoteHostUnavailableError = -14,
3387     kCFURLImproperArgumentsError = -15,
3388     kCFURLUnknownPropertyKeyError = -16,
3389     kCFURLPropertyKeyUnavailableError = -17,
3390     kCFURLTimeoutError = -18
3391 } CFURLError;
3392
3393
3394
3395 extern
3396 const CFStringRef kCFURLFileExists;
3397 extern
3398 const CFStringRef kCFURLFileDirectoryContents;
3399 extern
3400 const CFStringRef kCFURLFileLength;
3401 extern
3402 const CFStringRef kCFURLFileLastModificationTime;
3403 extern
3404 const CFStringRef kCFURLFilePOSIXMode;
3405 extern
3406 const CFStringRef kCFURLFileOwnerID;
3407 extern
3408 const CFStringRef kCFURLHTTPStatusCode;
3409 extern
3410 const CFStringRef kCFURLHTTPStatusLine;
3411 }
3412
3413
3414
3415 extern "C" {
3416
3417
3418 typedef struct __CFMachPort * CFMachPortRef;
3419
3420 typedef struct {
3421     CFIndex version;
3422     void * info;
3423     const void *(*retain)(const void *info);
3424     void (*release)(const void *info);
3425     CFStringRef (*copyDescription)(const void *info);
3426 } CFMachPortContext;
3427
3428 typedef void (*CFMachPortCallBack)(CFMachPortRef port, void *msg, CFIndex size, void *info);
3429 typedef void (*CFMachPortInvalidationCallBack)(CFMachPortRef port, void *info);
3430
3431 extern CFTypeID CFMachPortGetTypeID(void);
3432
3433 extern CFMachPortRef CFMachPortCreate(CFAllocatorRef allocator, CFMachPortCallBack callout, CFMachPortContext *context, Boolean *shouldFreeInfo);
3434 extern CFMachPortRef CFMachPortCreateWithPort(CFAllocatorRef allocator, mach_port_t portNum, CFMachPortCallBack callout, CFMachPortContext *context, Boolean *shouldFreeInfo);
3435
3436 extern mach_port_t CFMachPortGetPort(CFMachPortRef port);
3437 extern void CFMachPortGetContext(CFMachPortRef port, CFMachPortContext *context);
3438 extern void CFMachPortInvalidate(CFMachPortRef port);
3439 extern Boolean CFMachPortIsValid(CFMachPortRef port);
3440 extern CFMachPortInvalidationCallBack CFMachPortGetInvalidationCallBack(CFMachPortRef port);
3441 extern void CFMachPortSetInvalidationCallBack(CFMachPortRef port, CFMachPortInvalidationCallBack callout);
3442
3443 extern CFRunLoopSourceRef CFMachPortCreateRunLoopSource(CFAllocatorRef allocator, CFMachPortRef port, CFIndex order);
3444
3445
3446 }
3447 extern "C" {
3448
3449
3450 typedef struct __CFMessagePort * CFMessagePortRef;
3451
3452 enum {
3453     kCFMessagePortSuccess = 0,
3454     kCFMessagePortSendTimeout = -1,
3455     kCFMessagePortReceiveTimeout = -2,
3456     kCFMessagePortIsInvalid = -3,
3457     kCFMessagePortTransportError = -4
3458 };
3459
3460 typedef struct {
3461     CFIndex version;
3462     void * info;
3463     const void *(*retain)(const void *info);
3464     void (*release)(const void *info);
3465     CFStringRef (*copyDescription)(const void *info);
3466 } CFMessagePortContext;
3467
3468 typedef CFDataRef (*CFMessagePortCallBack)(CFMessagePortRef local, SInt32 msgid, CFDataRef data, void *info);
3469
3470 typedef void (*CFMessagePortInvalidationCallBack)(CFMessagePortRef ms, void *info);
3471
3472 extern CFTypeID CFMessagePortGetTypeID(void);
3473
3474 extern CFMessagePortRef CFMessagePortCreateLocal(CFAllocatorRef allocator, CFStringRef name, CFMessagePortCallBack callout, CFMessagePortContext *context, Boolean *shouldFreeInfo);
3475 extern CFMessagePortRef CFMessagePortCreateRemote(CFAllocatorRef allocator, CFStringRef name);
3476
3477 extern Boolean CFMessagePortIsRemote(CFMessagePortRef ms);
3478 extern CFStringRef CFMessagePortGetName(CFMessagePortRef ms);
3479 extern Boolean CFMessagePortSetName(CFMessagePortRef ms, CFStringRef newName);
3480 extern void CFMessagePortGetContext(CFMessagePortRef ms, CFMessagePortContext *context);
3481 extern void CFMessagePortInvalidate(CFMessagePortRef ms);
3482 extern Boolean CFMessagePortIsValid(CFMessagePortRef ms);
3483 extern CFMessagePortInvalidationCallBack CFMessagePortGetInvalidationCallBack(CFMessagePortRef ms);
3484 extern void CFMessagePortSetInvalidationCallBack(CFMessagePortRef ms, CFMessagePortInvalidationCallBack callout);
3485
3486
3487 extern SInt32 CFMessagePortSendRequest(CFMessagePortRef remote, SInt32 msgid, CFDataRef data, CFTimeInterval sendTimeout, CFTimeInterval rcvTimeout, CFStringRef replyMode, CFDataRef *returnData);
3488
3489 extern CFRunLoopSourceRef CFMessagePortCreateRunLoopSource(CFAllocatorRef allocator, CFMessagePortRef local, CFIndex order);
3490
3491
3492 }
3493
3494
3495
3496
3497
3498
3499 extern "C" {
3500
3501
3502 typedef struct __CFNotificationCenter * CFNotificationCenterRef;
3503
3504 typedef void (*CFNotificationCallback)(CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef userInfo);
3505
3506 typedef enum {
3507     CFNotificationSuspensionBehaviorDrop = 1,
3508
3509     CFNotificationSuspensionBehaviorCoalesce = 2,
3510
3511     CFNotificationSuspensionBehaviorHold = 3,
3512
3513     CFNotificationSuspensionBehaviorDeliverImmediately = 4
3514
3515 } CFNotificationSuspensionBehavior;
3516
3517 extern CFTypeID CFNotificationCenterGetTypeID(void);
3518
3519
3520 extern CFNotificationCenterRef CFNotificationCenterGetDistributedCenter(void);
3521
3522
3523 extern void CFNotificationCenterAddObserver(CFNotificationCenterRef center, const void *observer, CFNotificationCallback callBack, CFStringRef name, const void *object, CFNotificationSuspensionBehavior suspensionBehavior);
3524
3525 extern void CFNotificationCenterRemoveObserver(CFNotificationCenterRef center, const void *observer, CFStringRef name, const void *object);
3526 extern void CFNotificationCenterRemoveEveryObserver(CFNotificationCenterRef center, const void *observer);
3527
3528
3529 extern void CFNotificationCenterPostNotification(CFNotificationCenterRef center, CFStringRef name, const void *object, CFDictionaryRef userInfo, Boolean deliverImmediately);
3530
3531
3532 }
3533 extern "C" {
3534
3535
3536 extern
3537 const CFStringRef kCFPreferencesAnyApplication;
3538 extern
3539 const CFStringRef kCFPreferencesCurrentApplication;
3540 extern
3541 const CFStringRef kCFPreferencesAnyHost;
3542 extern
3543 const CFStringRef kCFPreferencesCurrentHost;
3544 extern
3545 const CFStringRef kCFPreferencesAnyUser;
3546 extern
3547 const CFStringRef kCFPreferencesCurrentUser;
3548 extern
3549 CFPropertyListRef CFPreferencesCopyAppValue(CFStringRef key, CFStringRef applicationID);
3550
3551
3552
3553
3554 extern
3555 Boolean CFPreferencesGetAppBooleanValue(CFStringRef key, CFStringRef applicationID, Boolean *keyExistsAndHasValidFormat);
3556
3557
3558
3559
3560 extern
3561 CFIndex CFPreferencesGetAppIntegerValue(CFStringRef key, CFStringRef applicationID, Boolean *keyExistsAndHasValidFormat);
3562
3563
3564
3565
3566 extern
3567 void CFPreferencesSetAppValue(CFStringRef key, CFPropertyListRef value, CFStringRef applicationID);
3568
3569
3570
3571
3572
3573 extern
3574 void CFPreferencesAddSuitePreferencesToApp(CFStringRef applicationID, CFStringRef suiteID);
3575
3576 extern
3577 void CFPreferencesRemoveSuitePreferencesFromApp(CFStringRef applicationID, CFStringRef suiteID);
3578
3579
3580
3581 extern
3582 Boolean CFPreferencesAppSynchronize(CFStringRef applicationID);
3583
3584
3585
3586
3587
3588 extern
3589 CFPropertyListRef CFPreferencesCopyValue(CFStringRef key, CFStringRef applicationID, CFStringRef userName, CFStringRef hostName);
3590
3591
3592
3593
3594
3595 extern
3596 CFDictionaryRef CFPreferencesCopyMultiple(CFArrayRef keysToFetch, CFStringRef applicationID, CFStringRef userName, CFStringRef hostName);
3597
3598
3599
3600 extern
3601 void CFPreferencesSetValue(CFStringRef key, CFPropertyListRef value, CFStringRef applicationID, CFStringRef userName, CFStringRef hostName);
3602
3603
3604
3605 extern
3606 void CFPreferencesSetMultiple(CFDictionaryRef keysToSet, CFArrayRef keysToRemove, CFStringRef applicationID, CFStringRef userName, CFStringRef hostName);
3607
3608 extern
3609 Boolean CFPreferencesSynchronize(CFStringRef applicationID, CFStringRef userName, CFStringRef hostName);
3610
3611
3612
3613
3614
3615 extern
3616 CFArrayRef CFPreferencesCopyApplicationList(CFStringRef userName, CFStringRef hostName);
3617
3618
3619
3620
3621 extern
3622 CFArrayRef CFPreferencesCopyKeyList(CFStringRef applicationID, CFStringRef userName, CFStringRef hostName);
3623
3624
3625
3626
3627
3628
3629
3630 extern
3631 Boolean CFPreferencesAppValueIsForced(CFStringRef key, CFStringRef applicationID);
3632
3633
3634
3635
3636 }
3637
3638 extern "C" {
3639
3640
3641 typedef enum {
3642
3643     kCFStringEncodingMacJapanese = 1,
3644     kCFStringEncodingMacChineseTrad = 2,
3645     kCFStringEncodingMacKorean = 3,
3646     kCFStringEncodingMacArabic = 4,
3647     kCFStringEncodingMacHebrew = 5,
3648     kCFStringEncodingMacGreek = 6,
3649     kCFStringEncodingMacCyrillic = 7,
3650     kCFStringEncodingMacDevanagari = 9,
3651     kCFStringEncodingMacGurmukhi = 10,
3652     kCFStringEncodingMacGujarati = 11,
3653     kCFStringEncodingMacOriya = 12,
3654     kCFStringEncodingMacBengali = 13,
3655     kCFStringEncodingMacTamil = 14,
3656     kCFStringEncodingMacTelugu = 15,
3657     kCFStringEncodingMacKannada = 16,
3658     kCFStringEncodingMacMalayalam = 17,
3659     kCFStringEncodingMacSinhalese = 18,
3660     kCFStringEncodingMacBurmese = 19,
3661     kCFStringEncodingMacKhmer = 20,
3662     kCFStringEncodingMacThai = 21,
3663     kCFStringEncodingMacLaotian = 22,
3664     kCFStringEncodingMacGeorgian = 23,
3665     kCFStringEncodingMacArmenian = 24,
3666     kCFStringEncodingMacChineseSimp = 25,
3667     kCFStringEncodingMacTibetan = 26,
3668     kCFStringEncodingMacMongolian = 27,
3669     kCFStringEncodingMacEthiopic = 28,
3670     kCFStringEncodingMacCentralEurRoman = 29,
3671     kCFStringEncodingMacVietnamese = 30,
3672     kCFStringEncodingMacExtArabic = 31,
3673
3674     kCFStringEncodingMacSymbol = 33,
3675     kCFStringEncodingMacDingbats = 34,
3676     kCFStringEncodingMacTurkish = 35,
3677     kCFStringEncodingMacCroatian = 36,
3678     kCFStringEncodingMacIcelandic = 37,
3679     kCFStringEncodingMacRomanian = 38,
3680     kCFStringEncodingMacCeltic = 39,
3681     kCFStringEncodingMacGaelic = 40,
3682
3683     kCFStringEncodingMacFarsi = 0x8C,
3684
3685     kCFStringEncodingMacUkrainian = 0x98,
3686
3687     kCFStringEncodingMacInuit = 0xEC,
3688     kCFStringEncodingMacVT100 = 0xFC,
3689
3690     kCFStringEncodingMacHFS = 0xFF,
3691
3692
3693
3694
3695
3696
3697     kCFStringEncodingISOLatin2 = 0x0202,
3698     kCFStringEncodingISOLatin3 = 0x0203,
3699     kCFStringEncodingISOLatin4 = 0x0204,
3700     kCFStringEncodingISOLatinCyrillic = 0x0205,
3701     kCFStringEncodingISOLatinArabic = 0x0206,
3702     kCFStringEncodingISOLatinGreek = 0x0207,
3703     kCFStringEncodingISOLatinHebrew = 0x0208,
3704     kCFStringEncodingISOLatin5 = 0x0209,
3705     kCFStringEncodingISOLatin6 = 0x020A,
3706     kCFStringEncodingISOLatinThai = 0x020B,
3707     kCFStringEncodingISOLatin7 = 0x020D,
3708     kCFStringEncodingISOLatin8 = 0x020E,
3709     kCFStringEncodingISOLatin9 = 0x020F,
3710
3711
3712     kCFStringEncodingDOSLatinUS = 0x0400,
3713     kCFStringEncodingDOSGreek = 0x0405,
3714     kCFStringEncodingDOSBalticRim = 0x0406,
3715     kCFStringEncodingDOSLatin1 = 0x0410,
3716     kCFStringEncodingDOSGreek1 = 0x0411,
3717     kCFStringEncodingDOSLatin2 = 0x0412,
3718     kCFStringEncodingDOSCyrillic = 0x0413,
3719     kCFStringEncodingDOSTurkish = 0x0414,
3720     kCFStringEncodingDOSPortuguese = 0x0415,
3721     kCFStringEncodingDOSIcelandic = 0x0416,
3722     kCFStringEncodingDOSHebrew = 0x0417,
3723     kCFStringEncodingDOSCanadianFrench = 0x0418,
3724     kCFStringEncodingDOSArabic = 0x0419,
3725     kCFStringEncodingDOSNordic = 0x041A,
3726     kCFStringEncodingDOSRussian = 0x041B,
3727     kCFStringEncodingDOSGreek2 = 0x041C,
3728     kCFStringEncodingDOSThai = 0x041D,
3729     kCFStringEncodingDOSJapanese = 0x0420,
3730     kCFStringEncodingDOSChineseSimplif = 0x0421,
3731     kCFStringEncodingDOSKorean = 0x0422,
3732     kCFStringEncodingDOSChineseTrad = 0x0423,
3733
3734     kCFStringEncodingWindowsLatin2 = 0x0501,
3735     kCFStringEncodingWindowsCyrillic = 0x0502,
3736     kCFStringEncodingWindowsGreek = 0x0503,
3737     kCFStringEncodingWindowsLatin5 = 0x0504,
3738     kCFStringEncodingWindowsHebrew = 0x0505,
3739     kCFStringEncodingWindowsArabic = 0x0506,
3740     kCFStringEncodingWindowsBalticRim = 0x0507,
3741     kCFStringEncodingWindowsKoreanJohab = 0x0510,
3742     kCFStringEncodingWindowsVietnamese = 0x0508,
3743
3744
3745
3746     kCFStringEncodingJIS_X0201_76 = 0x0620,
3747     kCFStringEncodingJIS_X0208_83 = 0x0621,
3748     kCFStringEncodingJIS_X0208_90 = 0x0622,
3749     kCFStringEncodingJIS_X0212_90 = 0x0623,
3750     kCFStringEncodingJIS_C6226_78 = 0x0624,
3751     kCFStringEncodingShiftJIS_X0213_00 = 0x0628,
3752     kCFStringEncodingGB_2312_80 = 0x0630,
3753     kCFStringEncodingGBK_95 = 0x0631,
3754     kCFStringEncodingGB_18030_2000 = 0x0632,
3755     kCFStringEncodingKSC_5601_87 = 0x0640,
3756     kCFStringEncodingKSC_5601_92_Johab = 0x0641,
3757     kCFStringEncodingCNS_11643_92_P1 = 0x0651,
3758     kCFStringEncodingCNS_11643_92_P2 = 0x0652,
3759     kCFStringEncodingCNS_11643_92_P3 = 0x0653,
3760
3761
3762     kCFStringEncodingISO_2022_JP = 0x0820,
3763     kCFStringEncodingISO_2022_JP_2 = 0x0821,
3764     kCFStringEncodingISO_2022_JP_1 = 0x0822,
3765     kCFStringEncodingISO_2022_JP_3 = 0x0823,
3766     kCFStringEncodingISO_2022_CN = 0x0830,
3767     kCFStringEncodingISO_2022_CN_EXT = 0x0831,
3768     kCFStringEncodingISO_2022_KR = 0x0840,
3769
3770
3771     kCFStringEncodingEUC_JP = 0x0920,
3772     kCFStringEncodingEUC_CN = 0x0930,
3773     kCFStringEncodingEUC_TW = 0x0931,
3774     kCFStringEncodingEUC_KR = 0x0940,
3775
3776
3777     kCFStringEncodingShiftJIS = 0x0A01,
3778     kCFStringEncodingKOI8_R = 0x0A02,
3779     kCFStringEncodingBig5 = 0x0A03,
3780     kCFStringEncodingMacRomanLatin1 = 0x0A04,
3781     kCFStringEncodingHZ_GB_2312 = 0x0A05,
3782     kCFStringEncodingBig5_HKSCS_1999 = 0x0A06,
3783
3784
3785
3786
3787
3788     kCFStringEncodingEBCDIC_US = 0x0C01,
3789     kCFStringEncodingEBCDIC_CP037 = 0x0C02
3790 } CFStringEncodings;
3791
3792
3793 }
3794 extern "C" {
3795
3796
3797 typedef struct __CFUserNotification * CFUserNotificationRef;
3798 typedef void (*CFUserNotificationCallBack)(CFUserNotificationRef userNotification, CFOptionFlags responseFlags);
3799
3800 extern
3801 CFTypeID CFUserNotificationGetTypeID(void);
3802
3803 extern
3804 CFUserNotificationRef CFUserNotificationCreate(CFAllocatorRef allocator, CFTimeInterval timeout, CFOptionFlags flags, SInt32 *error, CFDictionaryRef dictionary);
3805
3806 extern
3807 SInt32 CFUserNotificationReceiveResponse(CFUserNotificationRef userNotification, CFTimeInterval timeout, CFOptionFlags *responseFlags);
3808
3809 extern
3810 CFStringRef CFUserNotificationGetResponseValue(CFUserNotificationRef userNotification, CFStringRef key, CFIndex idx);
3811
3812 extern
3813 CFDictionaryRef CFUserNotificationGetResponseDictionary(CFUserNotificationRef userNotification);
3814
3815 extern
3816 SInt32 CFUserNotificationUpdate(CFUserNotificationRef userNotification, CFTimeInterval timeout, CFOptionFlags flags, CFDictionaryRef dictionary);
3817
3818 extern
3819 SInt32 CFUserNotificationCancel(CFUserNotificationRef userNotification);
3820
3821 extern
3822 CFRunLoopSourceRef CFUserNotificationCreateRunLoopSource(CFAllocatorRef allocator, CFUserNotificationRef userNotification, CFUserNotificationCallBack callout, CFIndex order);
3823
3824
3825
3826
3827 extern
3828 SInt32 CFUserNotificationDisplayNotice(CFTimeInterval timeout, CFOptionFlags flags, CFURLRef iconURL, CFURLRef soundURL, CFURLRef localizationURL, CFStringRef alertHeader, CFStringRef alertMessage, CFStringRef defaultButtonTitle);
3829
3830 extern
3831 SInt32 CFUserNotificationDisplayAlert(CFTimeInterval timeout, CFOptionFlags flags, CFURLRef iconURL, CFURLRef soundURL, CFURLRef localizationURL, CFStringRef alertHeader, CFStringRef alertMessage, CFStringRef defaultButtonTitle, CFStringRef alternateButtonTitle, CFStringRef otherButtonTitle, CFOptionFlags *responseFlags);
3832
3833
3834
3835
3836 enum {
3837     kCFUserNotificationStopAlertLevel = 0,
3838     kCFUserNotificationNoteAlertLevel = 1,
3839     kCFUserNotificationCautionAlertLevel = 2,
3840     kCFUserNotificationPlainAlertLevel = 3
3841 };
3842
3843 enum {
3844     kCFUserNotificationDefaultResponse = 0,
3845     kCFUserNotificationAlternateResponse = 1,
3846     kCFUserNotificationOtherResponse = 2,
3847     kCFUserNotificationCancelResponse = 3
3848 };
3849
3850 enum {
3851     kCFUserNotificationNoDefaultButtonFlag = (1 << 5),
3852     kCFUserNotificationUseRadioButtonsFlag = (1 << 6)
3853 };
3854
3855 static __inline__ CFOptionFlags CFUserNotificationCheckBoxChecked(CFIndex i) {return (1 << (8 + i));}
3856 static __inline__ CFOptionFlags CFUserNotificationSecureTextField(CFIndex i) {return (1 << (16 + i));}
3857 static __inline__ CFOptionFlags CFUserNotificationPopUpSelection(CFIndex n) {return (n << 24);}
3858
3859
3860
3861
3862 extern
3863 const CFStringRef kCFUserNotificationIconURLKey;
3864
3865 extern
3866 const CFStringRef kCFUserNotificationSoundURLKey;
3867
3868 extern
3869 const CFStringRef kCFUserNotificationLocalizationURLKey;
3870
3871 extern
3872 const CFStringRef kCFUserNotificationAlertHeaderKey;
3873
3874 extern
3875 const CFStringRef kCFUserNotificationAlertMessageKey;
3876
3877 extern
3878 const CFStringRef kCFUserNotificationDefaultButtonTitleKey;
3879
3880 extern
3881 const CFStringRef kCFUserNotificationAlternateButtonTitleKey;
3882
3883 extern
3884 const CFStringRef kCFUserNotificationOtherButtonTitleKey;
3885
3886 extern
3887 const CFStringRef kCFUserNotificationProgressIndicatorValueKey;
3888
3889 extern
3890 const CFStringRef kCFUserNotificationPopUpTitlesKey;
3891
3892 extern
3893 const CFStringRef kCFUserNotificationTextFieldTitlesKey;
3894
3895 extern
3896 const CFStringRef kCFUserNotificationCheckBoxTitlesKey;
3897
3898 extern
3899 const CFStringRef kCFUserNotificationTextFieldValuesKey;
3900
3901
3902 }
3903
3904
3905 enum {
3906   kClippingCreator = 'drag',
3907   kClippingPictureType = 'clpp',
3908   kClippingTextType = 'clpt',
3909   kClippingSoundType = 'clps',
3910   kClippingUnknownType = 'clpu'
3911 };
3912
3913
3914
3915 enum {
3916   kInternetLocationCreator = 'drag',
3917   kInternetLocationHTTP = 'ilht',
3918   kInternetLocationFTP = 'ilft',
3919   kInternetLocationFile = 'ilfi',
3920   kInternetLocationMail = 'ilma',
3921   kInternetLocationNNTP = 'ilnw',
3922   kInternetLocationAFP = 'ilaf',
3923   kInternetLocationAppleTalk = 'ilat',
3924   kInternetLocationNSL = 'ilns',
3925   kInternetLocationGeneric = 'ilge'
3926 };
3927
3928
3929
3930 enum {
3931   kCustomIconResource = -16455
3932 };
3933
3934
3935
3936
3937
3938
3939 enum {
3940   kCustomBadgeResourceType = 'badg',
3941   kCustomBadgeResourceID = kCustomIconResource,
3942   kCustomBadgeResourceVersion = 0
3943 };
3944
3945 struct CustomBadgeResource {
3946   SInt16 version;
3947   SInt16 customBadgeResourceID;
3948
3949   OSType customBadgeType;
3950   OSType customBadgeCreator;
3951   OSType windowBadgeType;
3952   OSType windowBadgeCreator;
3953
3954   OSType overrideType;
3955   OSType overrideCreator;
3956 };
3957 typedef struct CustomBadgeResource CustomBadgeResource;
3958 typedef CustomBadgeResource * CustomBadgeResourcePtr;
3959 typedef CustomBadgeResourcePtr * CustomBadgeResourceHandle;
3960 enum {
3961   kRoutingResourceType = 'rout',
3962   kRoutingResourceID = 0
3963 };
3964
3965 struct RoutingResourceEntry {
3966   OSType creator;
3967   OSType fileType;
3968   OSType targetFolder;
3969   OSType destinationFolder;
3970   OSType reservedField;
3971 };
3972 typedef struct RoutingResourceEntry RoutingResourceEntry;
3973 typedef RoutingResourceEntry * RoutingResourcePtr;
3974 typedef RoutingResourcePtr * RoutingResourceHandle;
3975
3976
3977 enum {
3978   kContainerFolderAliasType = 'fdrp',
3979   kContainerTrashAliasType = 'trsh',
3980   kContainerHardDiskAliasType = 'hdsk',
3981   kContainerFloppyAliasType = 'flpy',
3982   kContainerServerAliasType = 'srvr',
3983   kApplicationAliasType = 'adrp',
3984   kContainerAliasType = 'drop',
3985   kDesktopPrinterAliasType = 'dtpa',
3986   kContainerCDROMAliasType = 'cddr',
3987   kApplicationCPAliasType = 'acdp',
3988   kApplicationDAAliasType = 'addp',
3989   kPackageAliasType = 'fpka',
3990   kAppPackageAliasType = 'fapa'
3991 };
3992
3993
3994 enum {
3995   kSystemFolderAliasType = 'fasy',
3996   kAppleMenuFolderAliasType = 'faam',
3997   kStartupFolderAliasType = 'fast',
3998   kPrintMonitorDocsFolderAliasType = 'fapn',
3999   kPreferencesFolderAliasType = 'fapf',
4000   kControlPanelFolderAliasType = 'fact',
4001   kExtensionFolderAliasType = 'faex'
4002 };
4003
4004
4005 enum {
4006   kExportedFolderAliasType = 'faet',
4007   kDropFolderAliasType = 'fadr',
4008   kSharedFolderAliasType = 'fash',
4009   kMountedFolderAliasType = 'famn'
4010 };
4011
4012
4013
4014
4015
4016 enum {
4017   kIsOnDesk = 0x0001,
4018   kColor = 0x000E,
4019
4020   kIsShared = 0x0040,
4021
4022
4023
4024   kHasNoINITs = 0x0080,
4025
4026   kHasBeenInited = 0x0100,
4027
4028
4029
4030
4031
4032   kHasCustomIcon = 0x0400,
4033   kIsStationery = 0x0800,
4034   kNameLocked = 0x1000,
4035   kHasBundle = 0x2000,
4036   kIsInvisible = 0x4000,
4037   kIsAlias = 0x8000
4038 };
4039
4040
4041 enum {
4042   fOnDesk = kIsOnDesk,
4043   fHasBundle = kHasBundle,
4044   fInvisible = kIsInvisible
4045 };
4046
4047
4048 enum {
4049   fTrash = -3,
4050   fDesktop = -2,
4051   fDisk = 0
4052 };
4053 enum {
4054   kExtendedFlagsAreInvalid = 0x8000,
4055   kExtendedFlagHasCustomBadge = 0x0100,
4056   kExtendedFlagHasRoutingInfo = 0x0004
4057 };
4058 enum {
4059   kFirstMagicBusyFiletype = 'bzy ',
4060   kLastMagicBusyFiletype = 'bzy?'
4061 };
4062
4063
4064
4065
4066
4067
4068 enum {
4069   kMagicBusyCreationDate = 0x4F3AFDB0
4070 };
4071 struct FileInfo {
4072   OSType fileType;
4073   OSType fileCreator;
4074   UInt16 finderFlags;
4075   Point location;
4076
4077   UInt16 reservedField;
4078 };
4079 typedef struct FileInfo FileInfo;
4080 struct FolderInfo {
4081   Rect windowBounds;
4082   UInt16 finderFlags;
4083   Point location;
4084
4085   UInt16 reservedField;
4086 };
4087 typedef struct FolderInfo FolderInfo;
4088 struct ExtendedFileInfo {
4089   SInt16 reserved1[4];
4090   UInt16 extendedFinderFlags;
4091   SInt16 reserved2;
4092   SInt32 putAwayFolderID;
4093 };
4094 typedef struct ExtendedFileInfo ExtendedFileInfo;
4095 struct ExtendedFolderInfo {
4096   Point scrollPosition;
4097   SInt32 reserved1;
4098   UInt16 extendedFinderFlags;
4099   SInt16 reserved2;
4100   SInt32 putAwayFolderID;
4101 };
4102 typedef struct ExtendedFolderInfo ExtendedFolderInfo;
4103 struct FInfo {
4104   OSType fdType;
4105   OSType fdCreator;
4106   UInt16 fdFlags;
4107   Point fdLocation;
4108
4109   SInt16 fdFldr;
4110 };
4111 typedef struct FInfo FInfo;
4112
4113
4114
4115
4116
4117
4118
4119 struct FXInfo {
4120   SInt16 fdIconID;
4121   SInt16 fdReserved[3];
4122   SInt8 fdScript;
4123   SInt8 fdXFlags;
4124   SInt16 fdComment;
4125   SInt32 fdPutAway;
4126 };
4127 typedef struct FXInfo FXInfo;
4128
4129
4130
4131
4132
4133
4134 struct DInfo {
4135   Rect frRect;
4136   UInt16 frFlags;
4137   Point frLocation;
4138
4139   SInt16 frView;
4140 };
4141 typedef struct DInfo DInfo;
4142
4143
4144
4145
4146
4147
4148
4149 struct DXInfo {
4150   Point frScroll;
4151   SInt32 frOpenChain;
4152   SInt8 frScript;
4153   SInt8 frXFlags;
4154   SInt16 frComment;
4155   SInt32 frPutAway;
4156 };
4157 typedef struct DXInfo DXInfo;
4158
4159
4160
4161
4162
4163 extern "C" {
4164 extern Fixed
4165 FixRatio(
4166   short numer,
4167   short denom) ;
4168 extern Fixed
4169 FixMul(
4170   Fixed a,
4171   Fixed b) ;
4172 extern short
4173 FixRound(Fixed x) ;
4174 extern Fract
4175 Fix2Frac(Fixed x) ;
4176 extern long
4177 Fix2Long(Fixed x) ;
4178 extern Fixed
4179 Long2Fix(long x) ;
4180 extern Fixed
4181 Frac2Fix(Fract x) ;
4182 extern Fract
4183 FracMul(
4184   Fract x,
4185   Fract y) ;
4186 extern Fixed
4187 FixDiv(
4188   Fixed x,
4189   Fixed y) ;
4190 extern Fract
4191 FracDiv(
4192   Fract x,
4193   Fract y) ;
4194 extern Fract
4195 FracSqrt(Fract x) ;
4196 extern Fract
4197 FracSin(Fixed x) ;
4198 extern Fract
4199 FracCos(Fixed x) ;
4200 extern Fixed
4201 FixATan2(
4202   long x,
4203   long y) ;
4204 extern double
4205 Frac2X(Fract x) ;
4206 extern double
4207 Fix2X(Fixed x) ;
4208 extern Fixed
4209 X2Fix(double x) ;
4210 extern Fract
4211 X2Frac(double x) ;
4212 extern short
4213 WideCompare(
4214   const wide * target,
4215   const wide * source) ;
4216 extern wide *
4217 WideAdd(
4218   wide * target,
4219   const wide * source) ;
4220 extern wide *
4221 WideSubtract(
4222   wide * target,
4223   const wide * source) ;
4224 extern wide *
4225 WideNegate(wide * target) ;
4226 extern wide *
4227 WideShift(
4228   wide * target,
4229   long shift) ;
4230 extern unsigned long
4231 WideSquareRoot(const wide * source) ;
4232 extern wide *
4233 WideMultiply(
4234   long multiplicand,
4235   long multiplier,
4236   wide * target) ;
4237 extern long
4238 WideDivide(
4239   const wide * dividend,
4240   long divisor,
4241   long * remainder) ;
4242 extern wide *
4243 WideWideDivide(
4244   wide * dividend,
4245   long divisor,
4246   long * remainder) ;
4247 extern wide *
4248 WideBitShift(
4249   wide * src,
4250   long shift) ;
4251
4252
4253
4254
4255
4256
4257
4258 }
4259
4260
4261
4262
4263 enum {
4264
4265   itlcShowIcon = 7,
4266   itlcDualCaret = 6,
4267
4268   itlcSysDirection = 15
4269 };
4270
4271 enum {
4272
4273   itlcDisableKeyScriptSync = 3
4274 };
4275
4276 enum {
4277
4278   itlcDisableKeyScriptSyncMask = 1 << itlcDisableKeyScriptSync
4279 };
4280
4281
4282 enum {
4283   tokLeftQuote = 1,
4284   tokRightQuote = 2,
4285   tokLeadPlacer = 3,
4286   tokLeader = 4,
4287   tokNonLeader = 5,
4288   tokZeroLead = 6,
4289   tokPercent = 7,
4290   tokPlusSign = 8,
4291   tokMinusSign = 9,
4292   tokThousands = 10,
4293   tokReserved = 11,
4294   tokSeparator = 12,
4295   tokEscape = 13,
4296   tokDecPoint = 14,
4297   tokEPlus = 15,
4298   tokEMinus = 16,
4299   tokMaxSymbols = 31,
4300   curNumberPartsVersion = 1
4301 };
4302
4303 enum {
4304   currSymLead = 16,
4305   currNegSym = 32,
4306   currTrailingZ = 64,
4307   currLeadingZ = 128
4308 };
4309
4310 enum {
4311   mdy = 0,
4312   dmy = 1,
4313   ymd = 2,
4314   myd = 3,
4315   dym = 4,
4316   ydm = 5
4317 };
4318
4319 typedef SInt8 DateOrders;
4320 enum {
4321   timeCycle24 = 0,
4322   timeCycleZero = 1,
4323   timeCycle12 = 255,
4324   zeroCycle = 1,
4325   longDay = 0,
4326   longWeek = 1,
4327   longMonth = 2,
4328   longYear = 3,
4329   supDay = 1,
4330   supWeek = 2,
4331   supMonth = 4,
4332   supYear = 8,
4333   dayLdingZ = 32,
4334   mntLdingZ = 64,
4335   century = 128,
4336   secLeadingZ = 32,
4337   minLeadingZ = 64,
4338   hrLeadingZ = 128
4339 };
4340
4341
4342 struct OffPair {
4343   short offFirst;
4344   short offSecond;
4345 };
4346 typedef struct OffPair OffPair;
4347 typedef OffPair OffsetTable[3];
4348 struct Intl0Rec {
4349   char decimalPt;
4350   char thousSep;
4351   char listSep;
4352   char currSym1;
4353   char currSym2;
4354   char currSym3;
4355   UInt8 currFmt;
4356   UInt8 dateOrder;
4357   UInt8 shrtDateFmt;
4358   char dateSep;
4359   UInt8 timeCycle;
4360   UInt8 timeFmt;
4361   char mornStr[4];
4362   char eveStr[4];
4363   char timeSep;
4364   char time1Suff;
4365   char time2Suff;
4366   char time3Suff;
4367   char time4Suff;
4368   char time5Suff;
4369   char time6Suff;
4370   char time7Suff;
4371   char time8Suff;
4372   UInt8 metricSys;
4373   short intl0Vers;
4374 };
4375 typedef struct Intl0Rec Intl0Rec;
4376 typedef Intl0Rec * Intl0Ptr;
4377 typedef Intl0Ptr * Intl0Hndl;
4378 struct Intl1Rec {
4379   Str15 days[7];
4380   Str15 months[12];
4381   UInt8 suppressDay;
4382   UInt8 lngDateFmt;
4383   UInt8 dayLeading0;
4384   UInt8 abbrLen;
4385   char st0[4];
4386   char st1[4];
4387   char st2[4];
4388   char st3[4];
4389   char st4[4];
4390   short intl1Vers;
4391   short localRtn[1];
4392 };
4393 typedef struct Intl1Rec Intl1Rec;
4394 typedef Intl1Rec * Intl1Ptr;
4395 typedef Intl1Ptr * Intl1Hndl;
4396
4397 struct Itl1ExtRec {
4398   Intl1Rec base;
4399   short version;
4400   short format;
4401   short calendarCode;
4402   long extraDaysTableOffset;
4403   long extraDaysTableLength;
4404   long extraMonthsTableOffset;
4405   long extraMonthsTableLength;
4406   long abbrevDaysTableOffset;
4407   long abbrevDaysTableLength;
4408   long abbrevMonthsTableOffset;
4409   long abbrevMonthsTableLength;
4410   long extraSepsTableOffset;
4411   long extraSepsTableLength;
4412   short tables[1];
4413 };
4414 typedef struct Itl1ExtRec Itl1ExtRec;
4415 struct UntokenTable {
4416   short len;
4417   short lastToken;
4418   short index[256];
4419 };
4420 typedef struct UntokenTable UntokenTable;
4421 typedef UntokenTable * UntokenTablePtr;
4422 typedef UntokenTablePtr * UntokenTableHandle;
4423 union WideChar {
4424   char a[2];
4425   short b;
4426 };
4427 typedef union WideChar WideChar;
4428 struct WideCharArr {
4429   short size;
4430   WideChar data[10];
4431 };
4432 typedef struct WideCharArr WideCharArr;
4433 struct NumberParts {
4434   short version;
4435   WideChar data[31];
4436   WideCharArr pePlus;
4437   WideCharArr peMinus;
4438   WideCharArr peMinusPlus;
4439   WideCharArr altNumTable;
4440   char reserved[20];
4441 };
4442 typedef struct NumberParts NumberParts;
4443 typedef NumberParts * NumberPartsPtr;
4444
4445 struct Itl4Rec {
4446   short flags;
4447   long resourceType;
4448   short resourceNum;
4449   short version;
4450   long resHeader1;
4451   long resHeader2;
4452   short numTables;
4453   long mapOffset;
4454   long strOffset;
4455   long fetchOffset;
4456   long unTokenOffset;
4457   long defPartsOffset;
4458   long resOffset6;
4459   long resOffset7;
4460   long resOffset8;
4461 };
4462 typedef struct Itl4Rec Itl4Rec;
4463 typedef Itl4Rec * Itl4Ptr;
4464 typedef Itl4Ptr * Itl4Handle;
4465
4466 struct NItl4Rec {
4467   short flags;
4468   long resourceType;
4469   short resourceNum;
4470   short version;
4471   short format;
4472   short resHeader;
4473   long resHeader2;
4474   short numTables;
4475   long mapOffset;
4476   long strOffset;
4477   long fetchOffset;
4478   long unTokenOffset;
4479   long defPartsOffset;
4480   long whtSpListOffset;
4481   long resOffset7;
4482   long resOffset8;
4483   short resLength1;
4484   short resLength2;
4485   short resLength3;
4486   short unTokenLength;
4487   short defPartsLength;
4488   short whtSpListLength;
4489   short resLength7;
4490   short resLength8;
4491 };
4492 typedef struct NItl4Rec NItl4Rec;
4493 typedef NItl4Rec * NItl4Ptr;
4494 typedef NItl4Ptr * NItl4Handle;
4495
4496 struct TableDirectoryRecord {
4497   OSType tableSignature;
4498   unsigned long reserved;
4499   unsigned long tableStartOffset;
4500   unsigned long tableSize;
4501 };
4502 typedef struct TableDirectoryRecord TableDirectoryRecord;
4503 struct Itl5Record {
4504   Fixed versionNumber;
4505   unsigned short numberOfTables;
4506   unsigned short reserved[3];
4507   TableDirectoryRecord tableDirectory[1];
4508 };
4509 typedef struct Itl5Record Itl5Record;
4510 struct RuleBasedTrslRecord {
4511   short sourceType;
4512   short targetType;
4513   short formatNumber;
4514   short propertyFlag;
4515   short numberOfRules;
4516 };
4517 typedef struct RuleBasedTrslRecord RuleBasedTrslRecord;
4518
4519 struct ItlcRecord {
4520   short itlcSystem;
4521   short itlcReserved;
4522   SInt8 itlcFontForce;
4523   SInt8 itlcIntlForce;
4524   SInt8 itlcOldKybd;
4525   SInt8 itlcFlags;
4526   short itlcIconOffset;
4527   SInt8 itlcIconSide;
4528   SInt8 itlcIconRsvd;
4529   short itlcRegionCode;
4530   short itlcSysFlags;
4531   SInt8 itlcReserved4[32];
4532 };
4533 typedef struct ItlcRecord ItlcRecord;
4534 struct ItlbRecord {
4535   short itlbNumber;
4536   short itlbDate;
4537   short itlbSort;
4538   short itlbFlags;
4539   short itlbToken;
4540   short itlbEncoding;
4541   short itlbLang;
4542   SInt8 itlbNumRep;
4543   SInt8 itlbDateRep;
4544   short itlbKeys;
4545   short itlbIcon;
4546 };
4547 typedef struct ItlbRecord ItlbRecord;
4548
4549 struct ItlbExtRecord {
4550   ItlbRecord base;
4551   long itlbLocalSize;
4552   short itlbMonoFond;
4553   short itlbMonoSize;
4554   short itlbPrefFond;
4555   short itlbPrefSize;
4556   short itlbSmallFond;
4557   short itlbSmallSize;
4558   short itlbSysFond;
4559   short itlbSysSize;
4560   short itlbAppFond;
4561   short itlbAppSize;
4562   short itlbHelpFond;
4563   short itlbHelpSize;
4564   Style itlbValidStyles;
4565   Style itlbAliasStyle;
4566 };
4567 typedef struct ItlbExtRecord ItlbExtRecord;
4568
4569
4570
4571 extern "C" {
4572
4573
4574
4575
4576 enum {
4577   smSystemScript = -1,
4578   smCurrentScript = -2,
4579   smAllScripts = -3
4580 };
4581 enum {
4582   smRoman = 0,
4583   smJapanese = 1,
4584   smTradChinese = 2,
4585   smKorean = 3,
4586   smArabic = 4,
4587   smHebrew = 5,
4588   smGreek = 6,
4589   smCyrillic = 7,
4590   smRSymbol = 8,
4591   smDevanagari = 9,
4592   smGurmukhi = 10,
4593   smGujarati = 11,
4594   smOriya = 12,
4595   smBengali = 13,
4596   smTamil = 14,
4597   smTelugu = 15,
4598   smKannada = 16,
4599   smMalayalam = 17,
4600   smSinhalese = 18,
4601   smBurmese = 19,
4602   smKhmer = 20,
4603   smThai = 21,
4604   smLao = 22,
4605   smGeorgian = 23,
4606   smArmenian = 24,
4607   smSimpChinese = 25,
4608   smTibetan = 26,
4609   smMongolian = 27,
4610   smEthiopic = 28,
4611   smGeez = 28,
4612   smCentralEuroRoman = 29,
4613   smVietnamese = 30,
4614   smExtArabic = 31,
4615   smUninterp = 32
4616 };
4617
4618
4619 enum {
4620   smUnicodeScript = 0x7E
4621 };
4622
4623
4624 enum {
4625   smChinese = 2,
4626   smRussian = 7,
4627
4628   smLaotian = 22,
4629   smAmharic = 28,
4630   smSlavic = 29,
4631   smEastEurRoman = 29,
4632   smSindhi = 31,
4633   smKlingon = 32
4634 };
4635
4636
4637
4638
4639
4640
4641 enum {
4642   langEnglish = 0,
4643   langFrench = 1,
4644   langGerman = 2,
4645   langItalian = 3,
4646   langDutch = 4,
4647   langSwedish = 5,
4648   langSpanish = 6,
4649   langDanish = 7,
4650   langPortuguese = 8,
4651   langNorwegian = 9,
4652   langHebrew = 10,
4653   langJapanese = 11,
4654   langArabic = 12,
4655   langFinnish = 13,
4656   langGreek = 14,
4657   langIcelandic = 15,
4658   langMaltese = 16,
4659   langTurkish = 17,
4660   langCroatian = 18,
4661   langTradChinese = 19,
4662   langUrdu = 20,
4663   langHindi = 21,
4664   langThai = 22,
4665   langKorean = 23
4666 };
4667
4668 enum {
4669   langLithuanian = 24,
4670   langPolish = 25,
4671   langHungarian = 26,
4672   langEstonian = 27,
4673   langLatvian = 28,
4674   langSami = 29,
4675   langFaroese = 30,
4676   langFarsi = 31,
4677   langPersian = 31,
4678   langRussian = 32,
4679   langSimpChinese = 33,
4680   langFlemish = 34,
4681   langIrishGaelic = 35,
4682   langAlbanian = 36,
4683   langRomanian = 37,
4684   langCzech = 38,
4685   langSlovak = 39,
4686   langSlovenian = 40,
4687   langYiddish = 41,
4688   langSerbian = 42,
4689   langMacedonian = 43,
4690   langBulgarian = 44,
4691   langUkrainian = 45,
4692   langByelorussian = 46,
4693   langBelorussian = 46
4694 };
4695
4696 enum {
4697   langUzbek = 47,
4698   langKazakh = 48,
4699   langAzerbaijani = 49,
4700   langAzerbaijanAr = 50,
4701   langArmenian = 51,
4702   langGeorgian = 52,
4703   langMoldavian = 53,
4704   langKirghiz = 54,
4705   langTajiki = 55,
4706   langTurkmen = 56,
4707   langMongolian = 57,
4708   langMongolianCyr = 58,
4709   langPashto = 59,
4710   langKurdish = 60,
4711   langKashmiri = 61,
4712   langSindhi = 62,
4713   langTibetan = 63,
4714   langNepali = 64,
4715   langSanskrit = 65,
4716   langMarathi = 66,
4717   langBengali = 67,
4718   langAssamese = 68,
4719   langGujarati = 69,
4720   langPunjabi = 70
4721 };
4722
4723 enum {
4724   langOriya = 71,
4725   langMalayalam = 72,
4726   langKannada = 73,
4727   langTamil = 74,
4728   langTelugu = 75,
4729   langSinhalese = 76,
4730   langBurmese = 77,
4731   langKhmer = 78,
4732   langLao = 79,
4733   langVietnamese = 80,
4734   langIndonesian = 81,
4735   langTagalog = 82,
4736   langMalayRoman = 83,
4737   langMalayArabic = 84,
4738   langAmharic = 85,
4739   langTigrinya = 86,
4740   langOromo = 87,
4741   langSomali = 88,
4742   langSwahili = 89,
4743   langKinyarwanda = 90,
4744   langRuanda = 90,
4745   langRundi = 91,
4746   langNyanja = 92,
4747   langChewa = 92,
4748   langMalagasy = 93,
4749   langEsperanto = 94
4750 };
4751
4752 enum {
4753   langWelsh = 128,
4754   langBasque = 129,
4755   langCatalan = 130,
4756   langLatin = 131,
4757   langQuechua = 132,
4758   langGuarani = 133,
4759   langAymara = 134,
4760   langTatar = 135,
4761   langUighur = 136,
4762   langDzongkha = 137,
4763   langJavaneseRom = 138,
4764   langSundaneseRom = 139,
4765   langGalician = 140,
4766   langAfrikaans = 141
4767 };
4768
4769 enum {
4770   langBreton = 142,
4771   langInuktitut = 143,
4772   langScottishGaelic = 144,
4773   langManxGaelic = 145,
4774   langIrishGaelicScript = 146,
4775   langTongan = 147,
4776   langGreekPoly = 148,
4777   langGreenlandic = 149,
4778   langAzerbaijanRoman = 150
4779 };
4780
4781 enum {
4782   langUnspecified = 32767
4783 };
4784
4785
4786
4787
4788
4789 enum {
4790   langPortugese = 8,
4791   langMalta = 16,
4792   langYugoslavian = 18,
4793   langChinese = 19,
4794   langLettish = 28,
4795   langLapponian = 29,
4796   langLappish = 29,
4797   langSaamisk = 29,
4798   langFaeroese = 30,
4799   langIrish = 35,
4800   langGalla = 87,
4801   langAfricaans = 141
4802 };
4803 enum {
4804
4805   verUS = 0,
4806   verFrance = 1,
4807   verBritain = 2,
4808   verGermany = 3,
4809   verItaly = 4,
4810   verNetherlands = 5,
4811   verFlemish = 6,
4812   verSweden = 7,
4813   verSpain = 8,
4814   verDenmark = 9,
4815   verPortugal = 10,
4816   verFrCanada = 11,
4817   verNorway = 12,
4818   verIsrael = 13,
4819   verJapan = 14,
4820   verAustralia = 15,
4821   verArabic = 16,
4822   verFinland = 17,
4823   verFrSwiss = 18,
4824   verGrSwiss = 19,
4825   verGreece = 20,
4826   verIceland = 21,
4827   verMalta = 22,
4828   verCyprus = 23,
4829   verTurkey = 24,
4830   verYugoCroatian = 25
4831 };
4832
4833 enum {
4834   verNetherlandsComma = 26,
4835   verBelgiumLuxPoint = 27,
4836   verCanadaComma = 28,
4837   verCanadaPoint = 29,
4838   vervariantPortugal = 30,
4839   vervariantNorway = 31,
4840   vervariantDenmark = 32
4841 };
4842
4843 enum {
4844   verIndiaHindi = 33,
4845   verPakistanUrdu = 34,
4846   verTurkishModified = 35,
4847   verItalianSwiss = 36,
4848   verInternational = 37,
4849
4850   verRomania = 39,
4851   verGreecePoly = 40,
4852   verLithuania = 41,
4853   verPoland = 42,
4854   verHungary = 43,
4855   verEstonia = 44,
4856   verLatvia = 45,
4857   verSami = 46,
4858   verFaroeIsl = 47,
4859   verIran = 48,
4860   verRussia = 49,
4861   verIreland = 50,
4862   verKorea = 51,
4863   verChina = 52,
4864   verTaiwan = 53,
4865   verThailand = 54,
4866   verScriptGeneric = 55,
4867   verCzech = 56,
4868   verSlovak = 57,
4869   verFarEastGeneric = 58,
4870   verMagyar = 59,
4871   verBengali = 60,
4872   verByeloRussian = 61
4873 };
4874
4875 enum {
4876   verUkraine = 62,
4877
4878   verGreeceAlt = 64,
4879   verSerbian = 65,
4880   verSlovenian = 66,
4881   verMacedonian = 67,
4882   verCroatia = 68,
4883
4884   verGermanReformed = 70,
4885   verBrazil = 71,
4886   verBulgaria = 72,
4887   verCatalonia = 73,
4888   verMultilingual = 74,
4889   verScottishGaelic = 75,
4890   verManxGaelic = 76,
4891   verBreton = 77,
4892   verNunavut = 78,
4893   verWelsh = 79,
4894
4895   verIrishGaelicScript = 81,
4896   verEngCanada = 82,
4897   verBhutan = 83,
4898   verArmenian = 84,
4899   verGeorgian = 85,
4900   verSpLatinAmerica = 86,
4901
4902   verTonga = 88,
4903
4904
4905   verFrenchUniversal = 91,
4906   verAustria = 92,
4907
4908   verGujarati = 94,
4909   verPunjabi = 95,
4910   verIndiaUrdu = 96,
4911   verVietnam = 97
4912 };
4913
4914 enum {
4915   verFrBelgium = 98,
4916   verUzbek = 99,
4917   verSingapore = 100,
4918   verNynorsk = 101,
4919   verAfrikaans = 102,
4920   verEsperanto = 103,
4921   verMarathi = 104,
4922   verTibetan = 105,
4923   verNepal = 106,
4924   verGreenland = 107,
4925   verIrelandEnglish = 108
4926 };
4927 enum {
4928   verFrBelgiumLux = 6,
4929   verBelgiumLux = 6,
4930   verArabia = 16,
4931   verYugoslavia = 25,
4932   verIndia = 33,
4933   verPakistan = 34,
4934   verRumania = 39,
4935   verGreekAncient = 40,
4936   verLapland = 46,
4937   verFaeroeIsl = 47,
4938   verGenericFE = 58,
4939   verBelarus = 61,
4940   verUkrania = 62,
4941   verAlternateGr = 64,
4942   verSerbia = 65,
4943   verSlovenia = 66,
4944   verMacedonia = 67,
4945   verBrittany = 77,
4946   verWales = 79,
4947   verArmenia = 84,
4948   verGeorgia = 85,
4949   verAustriaGerman = 92,
4950   verTibet = 105
4951 };
4952
4953 enum {
4954   minCountry = verUS,
4955   maxCountry = verGreenland
4956 };
4957
4958 enum {
4959
4960   calGregorian = 0,
4961   calArabicCivil = 1,
4962   calArabicLunar = 2,
4963   calJapanese = 3,
4964   calJewish = 4,
4965   calCoptic = 5,
4966   calPersian = 6
4967 };
4968
4969 enum {
4970
4971   intWestern = 0,
4972   intArabic = 1,
4973   intRoman = 2,
4974   intJapanese = 3,
4975   intEuropean = 4,
4976   intOutputMask = 0x8000
4977 };
4978
4979 enum {
4980
4981   smSingleByte = 0,
4982   smFirstByte = -1,
4983   smLastByte = 1,
4984   smMiddleByte = 2
4985 };
4986
4987 enum {
4988
4989   smcTypeMask = 0x000F,
4990   smcReserved = 0x00F0,
4991   smcClassMask = 0x0F00,
4992   smcOrientationMask = 0x1000,
4993   smcRightMask = 0x2000,
4994   smcUpperMask = 0x4000,
4995   smcDoubleMask = 0x8000
4996 };
4997
4998 enum {
4999
5000   smCharPunct = 0x0000,
5001   smCharAscii = 0x0001,
5002   smCharEuro = 0x0007,
5003   smCharExtAscii = 0x0007,
5004
5005   smCharKatakana = 0x0002,
5006   smCharHiragana = 0x0003,
5007   smCharIdeographic = 0x0004,
5008   smCharTwoByteGreek = 0x0005,
5009   smCharTwoByteRussian = 0x0006,
5010   smCharBidirect = 0x0008,
5011   smCharContextualLR = 0x0009,
5012   smCharNonContextualLR = 0x000A,
5013   smCharHangul = 0x000C,
5014   smCharJamo = 0x000D,
5015   smCharBopomofo = 0x000E,
5016   smCharGanaKana = 0x000F,
5017
5018   smCharFISKana = 0x0002,
5019   smCharFISGana = 0x0003,
5020   smCharFISIdeo = 0x0004
5021 };
5022
5023 enum {
5024   smCharFISGreek = 0x0005,
5025   smCharFISRussian = 0x0006,
5026
5027   smPunctNormal = 0x0000,
5028   smPunctNumber = 0x0100,
5029   smPunctSymbol = 0x0200,
5030   smPunctBlank = 0x0300,
5031   smPunctRepeat = 0x0400,
5032   smPunctGraphic = 0x0500,
5033
5034   smKanaSmall = 0x0100,
5035   smKanaHardOK = 0x0200,
5036   smKanaSoftOK = 0x0300,
5037
5038   smIdeographicLevel1 = 0x0000,
5039   smIdeographicLevel2 = 0x0100,
5040   smIdeographicUser = 0x0200,
5041
5042   smFISClassLvl1 = 0x0000,
5043   smFISClassLvl2 = 0x0100,
5044   smFISClassUser = 0x0200,
5045
5046   smJamoJaeum = 0x0000,
5047   smJamoBogJaeum = 0x0100,
5048   smJamoMoeum = 0x0200,
5049   smJamoBogMoeum = 0x0300
5050 };
5051
5052 enum {
5053
5054   smCharHorizontal = 0x0000,
5055   smCharVertical = 0x1000,
5056
5057   smCharLeft = 0x0000,
5058   smCharRight = 0x2000,
5059   smCharLower = 0x0000,
5060   smCharUpper = 0x4000,
5061   smChar1byte = 0x0000,
5062   smChar2byte = 0x8000
5063 };
5064
5065 enum {
5066
5067   smTransAscii = 0,
5068   smTransNative = 1,
5069   smTransCase = 0xFE,
5070   smTransSystem = 0xFF,
5071
5072   smTransAscii1 = 2,
5073   smTransAscii2 = 3,
5074   smTransKana1 = 4,
5075   smTransKana2 = 5
5076 };
5077
5078 enum {
5079   smTransGana2 = 7,
5080   smTransHangul2 = 8,
5081   smTransJamo2 = 9,
5082   smTransBopomofo2 = 10,
5083
5084   smTransLower = 0x4000,
5085   smTransUpper = 0x8000,
5086
5087   smTransRuleBaseFormat = 1,
5088   smTransHangulFormat = 2,
5089
5090   smTransPreDoubleByting = 1,
5091   smTransPreLowerCasing = 2
5092 };
5093
5094 enum {
5095
5096   smMaskAll = (long)0xFFFFFFFF,
5097
5098   smMaskAscii = 0x00000001,
5099   smMaskNative = 0x00000002,
5100
5101   smMaskAscii1 = 0x00000004,
5102   smMaskAscii2 = 0x00000008,
5103   smMaskKana1 = 0x00000010,
5104   smMaskKana2 = 0x00000020,
5105   smMaskGana2 = 0x00000080,
5106   smMaskHangul2 = 0x00000100,
5107   smMaskJamo2 = 0x00000200,
5108   smMaskBopomofo2 = 0x00000400
5109 };
5110
5111 enum {
5112
5113   smNotInstalled = 0,
5114   smBadVerb = -1,
5115   smBadScript = -2
5116 };
5117
5118 enum {
5119
5120   smRedrawChar = 0,
5121   smRedrawWord = 1,
5122   smRedrawLine = -1
5123 };
5124
5125 enum {
5126
5127   smVersion = 0,
5128   smMunged = 2,
5129   smEnabled = 4,
5130   smBidirect = 6,
5131   smFontForce = 8,
5132   smIntlForce = 10,
5133   smForced = 12,
5134   smDefault = 14,
5135   smPrint = 16,
5136   smSysScript = 18,
5137   smLastScript = 20,
5138   smKeyScript = 22,
5139   smSysRef = 24,
5140   smKeyCache = 26,
5141   smKeySwap = 28,
5142   smGenFlags = 30,
5143   smOverride = 32,
5144   smCharPortion = 34,
5145
5146   smDoubleByte = 36,
5147   smKCHRCache = 38,
5148   smRegionCode = 40,
5149   smKeyDisableState = 42
5150 };
5151
5152 enum {
5153
5154
5155
5156   smScriptVersion = 0,
5157   smScriptMunged = 2,
5158   smScriptEnabled = 4,
5159   smScriptRight = 6,
5160   smScriptJust = 8,
5161   smScriptRedraw = 10,
5162   smScriptSysFond = 12,
5163   smScriptAppFond = 14,
5164   smScriptBundle = 16,
5165   smScriptNumber = 16,
5166   smScriptDate = 18,
5167   smScriptSort = 20,
5168   smScriptFlags = 22,
5169   smScriptToken = 24,
5170   smScriptEncoding = 26,
5171   smScriptLang = 28
5172 };
5173
5174 enum {
5175   smScriptNumDate = 30,
5176   smScriptKeys = 32,
5177   smScriptIcon = 34,
5178   smScriptPrint = 36,
5179   smScriptTrap = 38,
5180   smScriptCreator = 40,
5181   smScriptFile = 42,
5182   smScriptName = 44,
5183
5184
5185   smScriptMonoFondSize = 78,
5186   smScriptPrefFondSize = 80,
5187   smScriptSmallFondSize = 82,
5188   smScriptSysFondSize = 84,
5189   smScriptAppFondSize = 86,
5190   smScriptHelpFondSize = 88,
5191   smScriptValidStyles = 90,
5192   smScriptAliasStyle = 92
5193 };
5194
5195
5196
5197 enum {
5198
5199   smLayoutCache = -309,
5200   smOldVerbSupport = -311,
5201   smSetKashidas = -291,
5202   smSetKashProp = -287,
5203   smScriptSysBase = -281,
5204   smScriptAppBase = -283,
5205   smScriptFntBase = -285,
5206   smScriptLigatures = -263,
5207   smScriptNumbers = -267
5208 };
5209
5210 enum {
5211
5212   iuSystemScript = -1,
5213   iuCurrentScript = -2
5214 };
5215
5216 enum {
5217
5218   smKeyNextScript = -1,
5219   smKeySysScript = -2,
5220   smKeySwapScript = -3,
5221
5222   smKeyNextKybd = -4,
5223   smKeySwapKybd = -5,
5224   smKeyDisableKybds = -6,
5225   smKeyEnableKybds = -7,
5226   smKeyToggleInline = -8,
5227   smKeyToggleDirection = -9,
5228   smKeyNextInputMethod = -10,
5229   smKeySwapInputMethod = -11,
5230   smKeyDisableKybdSwitch = -12,
5231   smKeySetDirLeftRight = -15,
5232   smKeySetDirRightLeft = -16,
5233   smKeyRoman = -17
5234 };
5235
5236
5237 enum {
5238
5239   smfDisableKeyScriptSync = 27
5240 };
5241
5242 enum {
5243
5244   smfDisableKeyScriptSyncMask = 1L << smfDisableKeyScriptSync
5245 };
5246
5247 enum {
5248
5249   smKeyForceKeyScriptBit = 7,
5250   smKeyForceKeyScriptMask = 1 << smKeyForceKeyScriptBit
5251 };
5252
5253 enum {
5254
5255
5256   smsfIntellCP = 0,
5257   smsfSingByte = 1,
5258   smsfNatCase = 2,
5259   smsfContext = 3,
5260   smsfNoForceFont = 4,
5261   smsfB0Digits = 5,
5262   smsfAutoInit = 6,
5263   smsfUnivExt = 7,
5264   smsfSynchUnstyledTE = 8,
5265   smsfForms = 13,
5266   smsfLigatures = 14,
5267   smsfReverse = 15,
5268
5269
5270   smfShowIcon = 31,
5271   smfDualCaret = 30,
5272   smfNameTagEnab = 29,
5273   smfUseAssocFontInfo = 28
5274 };
5275
5276 enum {
5277
5278
5279
5280   romanSysFond = 0x3FFF,
5281   romanAppFond = 3,
5282   romanFlags = 0x0007,
5283
5284   smFondStart = 0x4000,
5285   smFondEnd = 0xC000,
5286
5287   smUprHalfCharSet = 0x80
5288 };
5289
5290 enum {
5291
5292   diaeresisUprY = 0xD9,
5293   fraction = 0xDA,
5294   intlCurrency = 0xDB,
5295   leftSingGuillemet = 0xDC,
5296   rightSingGuillemet = 0xDD,
5297   fiLigature = 0xDE,
5298   flLigature = 0xDF,
5299   dblDagger = 0xE0,
5300   centeredDot = 0xE1,
5301   baseSingQuote = 0xE2,
5302   baseDblQuote = 0xE3,
5303   perThousand = 0xE4,
5304   circumflexUprA = 0xE5,
5305   circumflexUprE = 0xE6,
5306   acuteUprA = 0xE7,
5307   diaeresisUprE = 0xE8,
5308   graveUprE = 0xE9,
5309   acuteUprI = 0xEA,
5310   circumflexUprI = 0xEB,
5311   diaeresisUprI = 0xEC,
5312   graveUprI = 0xED,
5313   acuteUprO = 0xEE,
5314   circumflexUprO = 0xEF,
5315   appleLogo = 0xF0,
5316   graveUprO = 0xF1,
5317   acuteUprU = 0xF2,
5318   circumflexUprU = 0xF3,
5319   graveUprU = 0xF4,
5320   dotlessLwrI = 0xF5,
5321   circumflex = 0xF6,
5322   tilde = 0xF7,
5323   macron = 0xF8,
5324   breveMark = 0xF9,
5325   overDot = 0xFA,
5326   ringMark = 0xFB,
5327   cedilla = 0xFC,
5328   doubleAcute = 0xFD,
5329   ogonek = 0xFE,
5330   hachek = 0xFF
5331 };
5332
5333 enum {
5334
5335   tokenIntl = 4,
5336   tokenEmpty = -1
5337 };
5338
5339 enum {
5340   tokenUnknown = 0,
5341   tokenWhite = 1,
5342   tokenLeftLit = 2,
5343   tokenRightLit = 3,
5344   tokenAlpha = 4,
5345   tokenNumeric = 5,
5346   tokenNewLine = 6,
5347   tokenLeftComment = 7,
5348   tokenRightComment = 8,
5349   tokenLiteral = 9,
5350   tokenEscape = 10,
5351   tokenAltNum = 11,
5352   tokenRealNum = 12,
5353   tokenAltReal = 13,
5354   tokenReserve1 = 14,
5355   tokenReserve2 = 15,
5356   tokenLeftParen = 16,
5357   tokenRightParen = 17,
5358   tokenLeftBracket = 18,
5359   tokenRightBracket = 19
5360 };
5361
5362 enum {
5363   tokenLeftCurly = 20,
5364   tokenRightCurly = 21,
5365   tokenLeftEnclose = 22,
5366   tokenRightEnclose = 23,
5367   tokenPlus = 24,
5368   tokenMinus = 25,
5369   tokenAsterisk = 26,
5370   tokenDivide = 27,
5371   tokenPlusMinus = 28,
5372   tokenSlash = 29,
5373   tokenBackSlash = 30,
5374   tokenLess = 31,
5375   tokenGreat = 32,
5376   tokenEqual = 33,
5377   tokenLessEqual2 = 34,
5378   tokenLessEqual1 = 35,
5379   tokenGreatEqual2 = 36,
5380   tokenGreatEqual1 = 37,
5381   token2Equal = 38,
5382   tokenColonEqual = 39
5383 };
5384
5385 enum {
5386   tokenNotEqual = 40,
5387   tokenLessGreat = 41,
5388   tokenExclamEqual = 42,
5389   tokenExclam = 43,
5390   tokenTilde = 44,
5391   tokenComma = 45,
5392   tokenPeriod = 46,
5393   tokenLeft2Quote = 47,
5394   tokenRight2Quote = 48,
5395   tokenLeft1Quote = 49,
5396   tokenRight1Quote = 50,
5397   token2Quote = 51,
5398   token1Quote = 52,
5399   tokenSemicolon = 53,
5400   tokenPercent = 54,
5401   tokenCaret = 55,
5402   tokenUnderline = 56,
5403   tokenAmpersand = 57,
5404   tokenAtSign = 58,
5405   tokenBar = 59
5406 };
5407
5408 enum {
5409   tokenQuestion = 60,
5410   tokenPi = 61,
5411   tokenRoot = 62,
5412   tokenSigma = 63,
5413   tokenIntegral = 64,
5414   tokenMicro = 65,
5415   tokenCapPi = 66,
5416   tokenInfinity = 67,
5417   tokenColon = 68,
5418   tokenHash = 69,
5419   tokenDollar = 70,
5420   tokenNoBreakSpace = 71,
5421   tokenFraction = 72,
5422   tokenIntlCurrency = 73,
5423   tokenLeftSingGuillemet = 74,
5424   tokenRightSingGuillemet = 75,
5425   tokenPerThousand = 76,
5426   tokenEllipsis = 77,
5427   tokenCenterDot = 78,
5428   tokenNil = 127
5429 };
5430
5431 enum {
5432   delimPad = -2,
5433   tokenTilda = 44,
5434   tokenCarat = 55
5435 };
5436
5437 enum {
5438
5439   smWordSelectTable = 0,
5440   smWordWrapTable = 1,
5441   smNumberPartsTable = 2,
5442   smUnTokenTable = 3,
5443   smWhiteSpaceList = 4,
5444   iuWordSelectTable = 0,
5445   iuWordWrapTable = 1,
5446   iuNumberPartsTable = 2,
5447   iuUnTokenTable = 3,
5448   iuWhiteSpaceList = 4
5449 };
5450
5451
5452 enum {
5453   tokenOK = 0,
5454   tokenOverflow = 1,
5455   stringOverflow = 2,
5456   badDelim = 3,
5457   badEnding = 4,
5458   crash = 5
5459 };
5460
5461 typedef SInt8 TokenResults;
5462 typedef char CharByteTable[256];
5463
5464 typedef short ScriptTokenType;
5465 typedef ScriptTokenType DelimType[2];
5466 typedef ScriptTokenType CommentType[4];
5467 struct TokenRec {
5468   ScriptTokenType theToken;
5469   Ptr position;
5470   long length;
5471   StringPtr stringPosition;
5472 };
5473 typedef struct TokenRec TokenRec;
5474 typedef TokenRec * TokenRecPtr;
5475 struct TokenBlock {
5476   Ptr source;
5477   long sourceLength;
5478   Ptr tokenList;
5479   long tokenLength;
5480   long tokenCount;
5481   Ptr stringList;
5482   long stringLength;
5483   long stringCount;
5484   Boolean doString;
5485   Boolean doAppend;
5486   Boolean doAlphanumeric;
5487   Boolean doNest;
5488   ScriptTokenType leftDelims[2];
5489   ScriptTokenType rightDelims[2];
5490   ScriptTokenType leftComment[4];
5491   ScriptTokenType rightComment[4];
5492   ScriptTokenType escapeCode;
5493   ScriptTokenType decimalCode;
5494   Handle itlResource;
5495   long reserved[8];
5496 };
5497 typedef struct TokenBlock TokenBlock;
5498 typedef TokenBlock * TokenBlockPtr;
5499 extern short
5500 GetSysDirection(void) ;
5501 extern void
5502 SetSysDirection(short value) ;
5503 extern short
5504 FontScript(void) ;
5505 extern short
5506 IntlScript(void) ;
5507 extern short
5508 FontToScript(short fontNumber) ;
5509 extern long
5510 GetScriptManagerVariable(short selector) ;
5511 extern OSErr
5512 SetScriptManagerVariable(
5513   short selector,
5514   long param) ;
5515 extern long
5516 GetScriptVariable(
5517   short script,
5518   short selector) ;
5519 extern OSErr
5520 SetScriptVariable(
5521   short script,
5522   short selector,
5523   long param) ;
5524 extern short
5525 CharacterByteType(
5526   Ptr textBuf,
5527   short textOffset,
5528   ScriptCode script) ;
5529 extern short
5530 CharacterType(
5531   Ptr textBuf,
5532   short textOffset,
5533   ScriptCode script) ;
5534 extern OSErr
5535 TransliterateText(
5536   Handle srcHandle,
5537   Handle dstHandle,
5538   short target,
5539   long srcMask,
5540   ScriptCode script) ;
5541 extern Boolean
5542 FillParseTable(
5543   CharByteTable table,
5544   ScriptCode script) ;
5545 extern Handle
5546 GetIntlResource(short theID) ;
5547 extern void
5548 ClearIntlResourceCache(void) ;
5549 extern void
5550 GetIntlResourceTable(
5551   ScriptCode script,
5552   short tableCode,
5553   Handle * itlHandle,
5554   long * offset,
5555   long * length) ;
5556 extern TokenResults
5557 IntlTokenize(TokenBlockPtr tokenParam) ;
5558
5559
5560 }
5561
5562
5563
5564 extern "C" {
5565
5566
5567 enum {
5568   paramErr = -50,
5569   noHardwareErr = -200,
5570   notEnoughHardwareErr = -201,
5571   userCanceledErr = -128,
5572   qErr = -1,
5573   vTypErr = -2,
5574   corErr = -3,
5575   unimpErr = -4,
5576   SlpTypeErr = -5,
5577   seNoDB = -8,
5578   controlErr = -17,
5579   statusErr = -18,
5580   readErr = -19,
5581   writErr = -20,
5582   badUnitErr = -21,
5583   unitEmptyErr = -22,
5584   openErr = -23,
5585   closErr = -24,
5586   dRemovErr = -25,
5587   dInstErr = -26
5588 };
5589
5590 enum {
5591   abortErr = -27,
5592   iIOAbortErr = -27,
5593   notOpenErr = -28,
5594   unitTblFullErr = -29,
5595   dceExtErr = -30,
5596   slotNumErr = -360,
5597   gcrOnMFMErr = -400,
5598   dirFulErr = -33,
5599   dskFulErr = -34,
5600   nsvErr = -35,
5601   ioErr = -36,
5602   bdNamErr = -37,
5603   fnOpnErr = -38,
5604   eofErr = -39,
5605   posErr = -40,
5606   mFulErr = -41,
5607   tmfoErr = -42,
5608   fnfErr = -43,
5609   wPrErr = -44,
5610   fLckdErr = -45
5611 };
5612
5613 enum {
5614   vLckdErr = -46,
5615   fBsyErr = -47,
5616   dupFNErr = -48,
5617   opWrErr = -49,
5618   rfNumErr = -51,
5619   gfpErr = -52,
5620   volOffLinErr = -53,
5621   permErr = -54,
5622   volOnLinErr = -55,
5623   nsDrvErr = -56,
5624   noMacDskErr = -57,
5625   extFSErr = -58,
5626   fsRnErr = -59,
5627   badMDBErr = -60,
5628   wrPermErr = -61,
5629   dirNFErr = -120,
5630   tmwdoErr = -121,
5631   badMovErr = -122,
5632   wrgVolTypErr = -123,
5633   volGoneErr = -124
5634 };
5635
5636 enum {
5637   fidNotFound = -1300,
5638   fidExists = -1301,
5639   notAFileErr = -1302,
5640   diffVolErr = -1303,
5641   catChangedErr = -1304,
5642   desktopDamagedErr = -1305,
5643   sameFileErr = -1306,
5644   badFidErr = -1307,
5645   notARemountErr = -1308,
5646   fileBoundsErr = -1309,
5647   fsDataTooBigErr = -1310,
5648   volVMBusyErr = -1311,
5649   badFCBErr = -1327,
5650   errFSUnknownCall = -1400,
5651   errFSBadFSRef = -1401,
5652   errFSBadForkName = -1402,
5653   errFSBadBuffer = -1403,
5654   errFSBadForkRef = -1404,
5655   errFSBadInfoBitmap = -1405,
5656   errFSMissingCatInfo = -1406,
5657   errFSNotAFolder = -1407,
5658   errFSForkNotFound = -1409,
5659   errFSNameTooLong = -1410,
5660   errFSMissingName = -1411,
5661   errFSBadPosMode = -1412,
5662   errFSBadAllocFlags = -1413,
5663   errFSNoMoreItems = -1417,
5664   errFSBadItemCount = -1418,
5665   errFSBadSearchParams = -1419,
5666   errFSRefsDifferent = -1420,
5667   errFSForkExists = -1421,
5668   errFSBadIteratorFlags = -1422,
5669   errFSIteratorNotFound = -1423,
5670   errFSIteratorNotSupported = -1424,
5671   errFSQuotaExceeded = -1425,
5672   envNotPresent = -5500,
5673   envBadVers = -5501,
5674   envVersTooBig = -5502,
5675   fontDecError = -64,
5676   fontNotDeclared = -65,
5677   fontSubErr = -66,
5678   fontNotOutlineErr = -32615,
5679   firstDskErr = -84,
5680   lastDskErr = -64,
5681   noDriveErr = -64,
5682   offLinErr = -65,
5683   noNybErr = -66
5684 };
5685
5686 enum {
5687   noAdrMkErr = -67,
5688   dataVerErr = -68,
5689   badCksmErr = -69,
5690   badBtSlpErr = -70,
5691   noDtaMkErr = -71,
5692   badDCksum = -72,
5693   badDBtSlp = -73,
5694   wrUnderrun = -74,
5695   cantStepErr = -75,
5696   tk0BadErr = -76,
5697   initIWMErr = -77,
5698   twoSideErr = -78,
5699   spdAdjErr = -79,
5700   seekErr = -80,
5701   sectNFErr = -81,
5702   fmt1Err = -82,
5703   fmt2Err = -83,
5704   verErr = -84,
5705   clkRdErr = -85,
5706   clkWrErr = -86,
5707   prWrErr = -87,
5708   prInitErr = -88,
5709   rcvrErr = -89,
5710   breakRecd = -90
5711 };
5712
5713 enum {
5714
5715   noScrapErr = -100,
5716   noTypeErr = -102
5717 };
5718
5719 enum {
5720
5721   eLenErr = -92,
5722   eMultiErr = -91
5723 };
5724
5725 enum {
5726   ddpSktErr = -91,
5727   ddpLenErr = -92,
5728   noBridgeErr = -93,
5729   lapProtErr = -94,
5730   excessCollsns = -95,
5731   portNotPwr = -96,
5732   portInUse = -97,
5733   portNotCf = -98
5734 };
5735
5736 enum {
5737
5738   memROZWarn = -99,
5739   memROZError = -99,
5740   memROZErr = -99,
5741   memFullErr = -108,
5742   nilHandleErr = -109,
5743   memWZErr = -111,
5744   memPurErr = -112,
5745   memAdrErr = -110,
5746   memAZErr = -113,
5747   memPCErr = -114,
5748   memBCErr = -115,
5749   memSCErr = -116,
5750   memLockedErr = -117
5751 };
5752
5753 enum {
5754
5755   iMemFullErr = -108,
5756   iIOAbort = -27
5757 };
5758
5759
5760 enum {
5761   resourceInMemory = -188,
5762   writingPastEnd = -189,
5763   inputOutOfBounds = -190,
5764   resNotFound = -192,
5765   resFNotFound = -193,
5766   addResFailed = -194,
5767   addRefFailed = -195,
5768   rmvResFailed = -196,
5769   rmvRefFailed = -197,
5770   resAttrErr = -198,
5771   mapReadErr = -199,
5772   CantDecompress = -186,
5773   badExtResource = -185,
5774   noMemForPictPlaybackErr = -145,
5775   rgnOverflowErr = -147,
5776   rgnTooBigError = -147,
5777   pixMapTooDeepErr = -148,
5778   insufficientStackErr = -149,
5779   nsStackErr = -149
5780 };
5781
5782 enum {
5783   evtNotEnb = 1
5784 };
5785
5786
5787 enum {
5788   cMatchErr = -150,
5789   cTempMemErr = -151,
5790   cNoMemErr = -152,
5791   cRangeErr = -153,
5792   cProtectErr = -154,
5793   cDevErr = -155,
5794   cResErr = -156,
5795   cDepthErr = -157,
5796   rgnTooBigErr = -500,
5797   updPixMemErr = -125,
5798   pictInfoVersionErr = -11000,
5799   pictInfoIDErr = -11001,
5800   pictInfoVerbErr = -11002,
5801   cantLoadPickMethodErr = -11003,
5802   colorsRequestedErr = -11004,
5803   pictureDataErr = -11005
5804 };
5805
5806
5807 enum {
5808
5809   cmProfileError = -170,
5810   cmMethodError = -171,
5811   cmMethodNotFound = -175,
5812   cmProfileNotFound = -176,
5813   cmProfilesIdentical = -177,
5814   cmCantConcatenateError = -178,
5815   cmCantXYZ = -179,
5816   cmCantDeleteProfile = -180,
5817   cmUnsupportedDataType = -181,
5818   cmNoCurrentProfile = -182
5819 };
5820
5821
5822 enum {
5823
5824   noHardware = noHardwareErr,
5825   notEnoughHardware = notEnoughHardwareErr,
5826   queueFull = -203,
5827   resProblem = -204,
5828   badChannel = -205,
5829   badFormat = -206,
5830   notEnoughBufferSpace = -207,
5831   badFileFormat = -208,
5832   channelBusy = -209,
5833   buffersTooSmall = -210,
5834   channelNotBusy = -211,
5835   noMoreRealTime = -212,
5836   siVBRCompressionNotSupported = -213,
5837   siNoSoundInHardware = -220,
5838   siBadSoundInDevice = -221,
5839   siNoBufferSpecified = -222,
5840   siInvalidCompression = -223,
5841   siHardDriveTooSlow = -224,
5842   siInvalidSampleRate = -225,
5843   siInvalidSampleSize = -226,
5844   siDeviceBusyErr = -227,
5845   siBadDeviceName = -228,
5846   siBadRefNum = -229,
5847   siInputDeviceErr = -230,
5848   siUnknownInfoType = -231,
5849   siUnknownQuality = -232
5850 };
5851
5852
5853 enum {
5854   noSynthFound = -240,
5855   synthOpenFailed = -241,
5856   synthNotReady = -242,
5857   bufTooSmall = -243,
5858   voiceNotFound = -244,
5859   incompatibleVoice = -245,
5860   badDictFormat = -246,
5861   badInputText = -247
5862 };
5863
5864
5865 enum {
5866   midiNoClientErr = -250,
5867   midiNoPortErr = -251,
5868   midiTooManyPortsErr = -252,
5869   midiTooManyConsErr = -253,
5870   midiVConnectErr = -254,
5871   midiVConnectMade = -255,
5872   midiVConnectRmvd = -256,
5873   midiNoConErr = -257,
5874   midiWriteErr = -258,
5875   midiNameLenErr = -259,
5876   midiDupIDErr = -260,
5877   midiInvalidCmdErr = -261
5878 };
5879
5880
5881 enum {
5882   nmTypErr = -299
5883 };
5884
5885
5886 enum {
5887   siInitSDTblErr = 1,
5888   siInitVBLQsErr = 2,
5889   siInitSPTblErr = 3,
5890   sdmJTInitErr = 10,
5891   sdmInitErr = 11,
5892   sdmSRTInitErr = 12,
5893   sdmPRAMInitErr = 13,
5894   sdmPriInitErr = 14
5895 };
5896
5897 enum {
5898   smSDMInitErr = -290,
5899   smSRTInitErr = -291,
5900   smPRAMInitErr = -292,
5901   smPriInitErr = -293,
5902   smEmptySlot = -300,
5903   smCRCFail = -301,
5904   smFormatErr = -302,
5905   smRevisionErr = -303,
5906   smNoDir = -304,
5907   smDisabledSlot = -305,
5908   smNosInfoArray = -306
5909 };
5910
5911
5912 enum {
5913   smResrvErr = -307,
5914   smUnExBusErr = -308,
5915   smBLFieldBad = -309,
5916   smFHBlockRdErr = -310,
5917   smFHBlkDispErr = -311,
5918   smDisposePErr = -312,
5919   smNoBoardSRsrc = -313,
5920   smGetPRErr = -314,
5921   smNoBoardId = -315,
5922   smInitStatVErr = -316,
5923   smInitTblVErr = -317,
5924   smNoJmpTbl = -318,
5925   smReservedSlot = -318,
5926   smBadBoardId = -319,
5927   smBusErrTO = -320,
5928
5929   svTempDisable = -32768L,
5930   svDisabled = -32640,
5931   smBadRefId = -330,
5932   smBadsList = -331,
5933   smReservedErr = -332,
5934   smCodeRevErr = -333
5935 };
5936
5937 enum {
5938   smCPUErr = -334,
5939   smsPointerNil = -335,
5940   smNilsBlockErr = -336,
5941   smSlotOOBErr = -337,
5942   smSelOOBErr = -338,
5943   smNewPErr = -339,
5944   smBlkMoveErr = -340,
5945   smCkStatusErr = -341,
5946   smGetDrvrNamErr = -342,
5947   smDisDrvrNamErr = -343,
5948   smNoMoresRsrcs = -344,
5949   smsGetDrvrErr = -345,
5950   smBadsPtrErr = -346,
5951   smByteLanesErr = -347,
5952   smOffsetErr = -348,
5953   smNoGoodOpens = -349,
5954   smSRTOvrFlErr = -350,
5955   smRecNotFnd = -351
5956 };
5957
5958
5959 enum {
5960
5961   notBTree = -410,
5962   btNoSpace = -413,
5963   btDupRecErr = -414,
5964   btRecNotFnd = -415,
5965   btKeyLenErr = -416,
5966   btKeyAttrErr = -417,
5967   unknownInsertModeErr = -20000,
5968   recordDataTooBigErr = -20001,
5969   invalidIndexErr = -20002
5970 };
5971
5972
5973
5974
5975
5976 enum {
5977   fsmFFSNotFoundErr = -431,
5978   fsmBusyFFSErr = -432,
5979   fsmBadFFSNameErr = -433,
5980   fsmBadFSDLenErr = -434,
5981   fsmDuplicateFSIDErr = -435,
5982   fsmBadFSDVersionErr = -436,
5983   fsmNoAlternateStackErr = -437,
5984   fsmUnknownFSMMessageErr = -438
5985 };
5986
5987
5988 enum {
5989
5990   editionMgrInitErr = -450,
5991   badSectionErr = -451,
5992   notRegisteredSectionErr = -452,
5993   badEditionFileErr = -453,
5994   badSubPartErr = -454,
5995   multiplePublisherWrn = -460,
5996   containerNotFoundWrn = -461,
5997   containerAlreadyOpenWrn = -462,
5998   notThePublisherWrn = -463
5999 };
6000
6001 enum {
6002   teScrapSizeErr = -501,
6003   hwParamErr = -502,
6004   driverHardwareGoneErr = -503
6005 };
6006
6007 enum {
6008
6009   procNotFound = -600,
6010   memFragErr = -601,
6011   appModeErr = -602,
6012   protocolErr = -603,
6013   hardwareConfigErr = -604,
6014   appMemFullErr = -605,
6015   appIsDaemon = -606,
6016   bufferIsSmall = -607,
6017   noOutstandingHLE = -608,
6018   connectionInvalid = -609,
6019   noUserInteractionAllowed = -610
6020 };
6021
6022 enum {
6023
6024   wrongApplicationPlatform = -875,
6025   appVersionTooOld = -876,
6026   notAppropriateForClassic = -877
6027 };
6028
6029
6030 enum {
6031   threadTooManyReqsErr = -617,
6032   threadNotFoundErr = -618,
6033   threadProtocolErr = -619
6034 };
6035
6036 enum {
6037   threadBadAppContextErr = -616
6038 };
6039
6040
6041 enum {
6042   notEnoughMemoryErr = -620,
6043   notHeldErr = -621,
6044   cannotMakeContiguousErr = -622,
6045   notLockedErr = -623,
6046   interruptsMaskedErr = -624,
6047   cannotDeferErr = -625,
6048   noMMUErr = -626
6049 };
6050
6051
6052 enum {
6053   vmMorePhysicalThanVirtualErr = -628,
6054   vmKernelMMUInitErr = -629,
6055   vmOffErr = -630,
6056   vmMemLckdErr = -631,
6057   vmBadDriver = -632,
6058   vmNoVectorErr = -633
6059 };
6060
6061
6062 enum {
6063   vmInvalidBackingFileIDErr = -640,
6064   vmMappingPrivilegesErr = -641,
6065   vmBusyBackingFileErr = -642,
6066   vmNoMoreBackingFilesErr = -643,
6067   vmInvalidFileViewIDErr = -644,
6068   vmFileViewAccessErr = -645,
6069   vmNoMoreFileViewsErr = -646,
6070   vmAddressNotInFileViewErr = -647,
6071   vmInvalidOwningProcessErr = -648
6072 };
6073
6074
6075 enum {
6076   rcDBNull = -800,
6077   rcDBValue = -801,
6078   rcDBError = -802,
6079   rcDBBadType = -803,
6080   rcDBBreak = -804,
6081   rcDBExec = -805,
6082   rcDBBadSessID = -806,
6083   rcDBBadSessNum = -807,
6084   rcDBBadDDEV = -808,
6085   rcDBAsyncNotSupp = -809,
6086   rcDBBadAsyncPB = -810,
6087   rcDBNoHandler = -811,
6088   rcDBWrongVersion = -812,
6089   rcDBPackNotInited = -813
6090 };
6091
6092
6093
6094 enum {
6095   hmHelpDisabled = -850,
6096   hmBalloonAborted = -853,
6097   hmSameAsLastBalloon = -854,
6098   hmHelpManagerNotInited = -855,
6099   hmSkippedBalloon = -857,
6100   hmWrongVersion = -858,
6101   hmUnknownHelpType = -859,
6102   hmOperationUnsupported = -861,
6103   hmNoBalloonUp = -862,
6104   hmCloseViewActive = -863
6105 };
6106
6107
6108
6109 enum {
6110
6111   notInitErr = -900,
6112   nameTypeErr = -902,
6113   noPortErr = -903,
6114
6115
6116   noGlobalsErr = -904,
6117   localOnlyErr = -905,
6118   destPortErr = -906,
6119   sessTableErr = -907,
6120   noSessionErr = -908,
6121   badReqErr = -909,
6122   portNameExistsErr = -910,
6123   noUserNameErr = -911,
6124   userRejectErr = -912,
6125   noMachineNameErr = -913,
6126   noToolboxNameErr = -914,
6127   noResponseErr = -915,
6128   portClosedErr = -916,
6129   sessClosedErr = -917,
6130   badPortNameErr = -919,
6131   noDefaultUserErr = -922,
6132   notLoggedInErr = -923,
6133   noUserRefErr = -924,
6134   networkErr = -925,
6135   noInformErr = -926,
6136   authFailErr = -927,
6137   noUserRecErr = -928,
6138   badServiceMethodErr = -930,
6139   badLocNameErr = -931,
6140   guestNotAllowedErr = -932
6141 };
6142
6143
6144 enum {
6145   kFMIterationCompleted = -980L,
6146   kFMInvalidFontFamilyErr = -981L,
6147   kFMInvalidFontErr = -982L,
6148   kFMIterationScopeModifiedErr = -983L,
6149   kFMFontTableAccessErr = -984L,
6150   kFMFontContainerAccessErr = -985L
6151 };
6152
6153 enum {
6154   noMaskFoundErr = -1000
6155 };
6156
6157 enum {
6158   nbpBuffOvr = -1024,
6159   nbpNoConfirm = -1025,
6160   nbpConfDiff = -1026,
6161   nbpDuplicate = -1027,
6162   nbpNotFound = -1028,
6163   nbpNISErr = -1029
6164 };
6165
6166 enum {
6167   aspBadVersNum = -1066,
6168   aspBufTooSmall = -1067,
6169   aspNoMoreSess = -1068,
6170   aspNoServers = -1069,
6171   aspParamErr = -1070,
6172   aspServerBusy = -1071,
6173   aspSessClosed = -1072,
6174   aspSizeErr = -1073,
6175   aspTooMany = -1074,
6176   aspNoAck = -1075
6177 };
6178
6179 enum {
6180   reqFailed = -1096,
6181   tooManyReqs = -1097,
6182   tooManySkts = -1098,
6183   badATPSkt = -1099,
6184   badBuffNum = -1100,
6185   noRelErr = -1101,
6186   cbNotFound = -1102,
6187   noSendResp = -1103,
6188   noDataArea = -1104,
6189   reqAborted = -1105
6190 };
6191
6192
6193 enum {
6194
6195   errRefNum = -1280,
6196   errAborted = -1279,
6197   errState = -1278,
6198   errOpening = -1277,
6199   errAttention = -1276,
6200   errFwdReset = -1275,
6201   errDSPQueueSize = -1274,
6202   errOpenDenied = -1273
6203 };
6204
6205
6206
6207
6208
6209
6210 enum {
6211   errAECoercionFail = -1700,
6212   errAEDescNotFound = -1701,
6213   errAECorruptData = -1702,
6214   errAEWrongDataType = -1703,
6215   errAENotAEDesc = -1704,
6216   errAEBadListItem = -1705,
6217   errAENewerVersion = -1706,
6218   errAENotAppleEvent = -1707,
6219   errAEEventNotHandled = -1708,
6220   errAEReplyNotValid = -1709,
6221   errAEUnknownSendMode = -1710,
6222   errAEWaitCanceled = -1711,
6223   errAETimeout = -1712,
6224   errAENoUserInteraction = -1713,
6225   errAENotASpecialFunction = -1714,
6226   errAEParamMissed = -1715,
6227   errAEUnknownAddressType = -1716,
6228   errAEHandlerNotFound = -1717,
6229   errAEReplyNotArrived = -1718,
6230   errAEIllegalIndex = -1719,
6231   errAEImpossibleRange = -1720,
6232   errAEWrongNumberArgs = -1721,
6233   errAEAccessorNotFound = -1723,
6234   errAENoSuchLogical = -1725,
6235   errAEBadTestKey = -1726,
6236   errAENotAnObjSpec = -1727,
6237   errAENoSuchObject = -1728,
6238   errAENegativeCount = -1729,
6239   errAEEmptyListContainer = -1730,
6240   errAEUnknownObjectType = -1731,
6241   errAERecordingIsAlreadyOn = -1732,
6242   errAEReceiveTerminate = -1733,
6243   errAEReceiveEscapeCurrent = -1734,
6244   errAEEventFiltered = -1735,
6245   errAEDuplicateHandler = -1736,
6246   errAEStreamBadNesting = -1737,
6247   errAEStreamAlreadyConverted = -1738,
6248   errAEDescIsNull = -1739,
6249   errAEBuildSyntaxError = -1740,
6250   errAEBufferTooSmall = -1741
6251 };
6252
6253 enum {
6254   errOSASystemError = -1750,
6255   errOSAInvalidID = -1751,
6256   errOSABadStorageType = -1752,
6257   errOSAScriptError = -1753,
6258   errOSABadSelector = -1754,
6259   errOSASourceNotAvailable = -1756,
6260   errOSANoSuchDialect = -1757,
6261   errOSADataFormatObsolete = -1758,
6262   errOSADataFormatTooNew = -1759,
6263   errOSACorruptData = errAECorruptData,
6264   errOSARecordingIsAlreadyOn = errAERecordingIsAlreadyOn,
6265   errOSAComponentMismatch = -1761,
6266   errOSACantOpenComponent = -1762
6267 };
6268
6269
6270
6271
6272 enum {
6273   errOffsetInvalid = -1800,
6274   errOffsetIsOutsideOfView = -1801,
6275   errTopOfDocument = -1810,
6276   errTopOfBody = -1811,
6277   errEndOfDocument = -1812,
6278   errEndOfBody = -1813
6279 };
6280
6281
6282 enum {
6283
6284   badDragRefErr = -1850,
6285   badDragItemErr = -1851,
6286   badDragFlavorErr = -1852,
6287   duplicateFlavorErr = -1853,
6288   cantGetFlavorErr = -1854,
6289   duplicateHandlerErr = -1855,
6290   handlerNotFoundErr = -1856,
6291   dragNotAcceptedErr = -1857,
6292   unsupportedForPlatformErr = -1858,
6293   noSuitableDisplaysErr = -1859,
6294   badImageRgnErr = -1860,
6295   badImageErr = -1861,
6296   nonDragOriginatorErr = -1862
6297 };
6298
6299
6300
6301 enum {
6302   couldNotResolveDataRef = -2000,
6303   badImageDescription = -2001,
6304   badPublicMovieAtom = -2002,
6305   cantFindHandler = -2003,
6306   cantOpenHandler = -2004,
6307   badComponentType = -2005,
6308   noMediaHandler = -2006,
6309   noDataHandler = -2007,
6310   invalidMedia = -2008,
6311   invalidTrack = -2009,
6312   invalidMovie = -2010,
6313   invalidSampleTable = -2011,
6314   invalidDataRef = -2012,
6315   invalidHandler = -2013,
6316   invalidDuration = -2014,
6317   invalidTime = -2015,
6318   cantPutPublicMovieAtom = -2016,
6319   badEditList = -2017,
6320   mediaTypesDontMatch = -2018,
6321   progressProcAborted = -2019,
6322   movieToolboxUninitialized = -2020,
6323   noRecordOfApp = movieToolboxUninitialized,
6324   wfFileNotFound = -2021,
6325   cantCreateSingleForkFile = -2022,
6326   invalidEditState = -2023,
6327   nonMatchingEditState = -2024,
6328   staleEditState = -2025,
6329   userDataItemNotFound = -2026,
6330   maxSizeToGrowTooSmall = -2027,
6331   badTrackIndex = -2028,
6332   trackIDNotFound = -2029,
6333   trackNotInMovie = -2030,
6334   timeNotInTrack = -2031,
6335   timeNotInMedia = -2032,
6336   badEditIndex = -2033,
6337   internalQuickTimeError = -2034,
6338   cantEnableTrack = -2035,
6339   invalidRect = -2036,
6340   invalidSampleNum = -2037,
6341   invalidChunkNum = -2038,
6342   invalidSampleDescIndex = -2039,
6343   invalidChunkCache = -2040,
6344   invalidSampleDescription = -2041,
6345   dataNotOpenForRead = -2042,
6346   dataNotOpenForWrite = -2043,
6347   dataAlreadyOpenForWrite = -2044,
6348   dataAlreadyClosed = -2045,
6349   endOfDataReached = -2046,
6350   dataNoDataRef = -2047,
6351   noMovieFound = -2048,
6352   invalidDataRefContainer = -2049,
6353   badDataRefIndex = -2050,
6354   noDefaultDataRef = -2051,
6355   couldNotUseAnExistingSample = -2052,
6356   featureUnsupported = -2053,
6357   noVideoTrackInMovieErr = -2054,
6358   noSoundTrackInMovieErr = -2055,
6359   soundSupportNotAvailableErr = -2056,
6360   unsupportedAuxiliaryImportData = -2057,
6361   auxiliaryExportDataUnavailable = -2058,
6362   samplesAlreadyInMediaErr = -2059,
6363   noSourceTreeFoundErr = -2060,
6364   sourceNotFoundErr = -2061,
6365   movieTextNotFoundErr = -2062,
6366   missingRequiredParameterErr = -2063,
6367   invalidSpriteWorldPropertyErr = -2064,
6368   invalidSpritePropertyErr = -2065,
6369   gWorldsNotSameDepthAndSizeErr = -2066,
6370   invalidSpriteIndexErr = -2067,
6371   invalidImageIndexErr = -2068,
6372   invalidSpriteIDErr = -2069
6373 };
6374
6375 enum {
6376   internalComponentErr = -2070,
6377   notImplementedMusicOSErr = -2071,
6378   cantSendToSynthesizerOSErr = -2072,
6379   cantReceiveFromSynthesizerOSErr = -2073,
6380   illegalVoiceAllocationOSErr = -2074,
6381   illegalPartOSErr = -2075,
6382   illegalChannelOSErr = -2076,
6383   illegalKnobOSErr = -2077,
6384   illegalKnobValueOSErr = -2078,
6385   illegalInstrumentOSErr = -2079,
6386   illegalControllerOSErr = -2080,
6387   midiManagerAbsentOSErr = -2081,
6388   synthesizerNotRespondingOSErr = -2082,
6389   synthesizerOSErr = -2083,
6390   illegalNoteChannelOSErr = -2084,
6391   noteChannelNotAllocatedOSErr = -2085,
6392   tunePlayerFullOSErr = -2086,
6393   tuneParseOSErr = -2087,
6394   noExportProcAvailableErr = -2089,
6395   videoOutputInUseErr = -2090
6396 };
6397
6398 enum {
6399   componentDllLoadErr = -2091,
6400   componentDllEntryNotFoundErr = -2092,
6401   qtmlDllLoadErr = -2093,
6402   qtmlDllEntryNotFoundErr = -2094,
6403   qtmlUninitialized = -2095,
6404   unsupportedOSErr = -2096,
6405   unsupportedProcessorErr = -2097
6406 };
6407
6408 enum {
6409   cannotFindAtomErr = -2101,
6410   notLeafAtomErr = -2102,
6411   atomsNotOfSameTypeErr = -2103,
6412   atomIndexInvalidErr = -2104,
6413   duplicateAtomTypeAndIDErr = -2105,
6414   invalidAtomErr = -2106,
6415   invalidAtomContainerErr = -2107,
6416   invalidAtomTypeErr = -2108,
6417   cannotBeLeafAtomErr = -2109,
6418   pathTooLongErr = -2110,
6419   emptyPathErr = -2111,
6420   noPathMappingErr = -2112,
6421   pathNotVerifiedErr = -2113,
6422   unknownFormatErr = -2114,
6423   wackBadFileErr = -2115,
6424   wackForkNotFoundErr = -2116,
6425   wackBadMetaDataErr = -2117,
6426   qfcbNotFoundErr = -2118,
6427   qfcbNotCreatedErr = -2119,
6428   AAPNotCreatedErr = -2120,
6429   AAPNotFoundErr = -2121,
6430   ASDBadHeaderErr = -2122,
6431   ASDBadForkErr = -2123,
6432   ASDEntryNotFoundErr = -2124,
6433   fileOffsetTooBigErr = -2125,
6434   notAllowedToSaveMovieErr = -2126,
6435   qtNetworkAlreadyAllocatedErr = -2127,
6436   urlDataHHTTPProtocolErr = -2129,
6437   urlDataHHTTPNoNetDriverErr = -2130,
6438   urlDataHHTTPURLErr = -2131,
6439   urlDataHHTTPRedirectErr = -2132,
6440   urlDataHFTPProtocolErr = -2133,
6441   urlDataHFTPShutdownErr = -2134,
6442   urlDataHFTPBadUserErr = -2135,
6443   urlDataHFTPBadPasswordErr = -2136,
6444   urlDataHFTPServerErr = -2137,
6445   urlDataHFTPDataConnectionErr = -2138,
6446   urlDataHFTPNoDirectoryErr = -2139,
6447   urlDataHFTPQuotaErr = -2140,
6448   urlDataHFTPPermissionsErr = -2141,
6449   urlDataHFTPFilenameErr = -2142,
6450   urlDataHFTPNoNetDriverErr = -2143,
6451   urlDataHFTPBadNameListErr = -2144,
6452   urlDataHFTPNeedPasswordErr = -2145,
6453   urlDataHFTPNoPasswordErr = -2146,
6454   urlDataHFTPServerDisconnectedErr = -2147,
6455   urlDataHFTPURLErr = -2148,
6456   notEnoughDataErr = -2149,
6457   qtActionNotHandledErr = -2157,
6458   qtXMLParseErr = -2158,
6459   qtXMLApplicationErr = -2159
6460 };
6461
6462
6463 enum {
6464   digiUnimpErr = -2201,
6465   qtParamErr = -2202,
6466   matrixErr = -2203,
6467   notExactMatrixErr = -2204,
6468   noMoreKeyColorsErr = -2205,
6469   notExactSizeErr = -2206,
6470   badDepthErr = -2207,
6471   noDMAErr = -2208,
6472   badCallOrderErr = -2209
6473 };
6474
6475
6476
6477 enum {
6478   kernelIncompleteErr = -2401,
6479   kernelCanceledErr = -2402,
6480   kernelOptionsErr = -2403,
6481   kernelPrivilegeErr = -2404,
6482   kernelUnsupportedErr = -2405,
6483   kernelObjectExistsErr = -2406,
6484   kernelWritePermissionErr = -2407,
6485   kernelReadPermissionErr = -2408,
6486   kernelExecutePermissionErr = -2409,
6487   kernelDeletePermissionErr = -2410,
6488   kernelExecutionLevelErr = -2411,
6489   kernelAttributeErr = -2412,
6490   kernelAsyncSendLimitErr = -2413,
6491   kernelAsyncReceiveLimitErr = -2414,
6492   kernelTimeoutErr = -2415,
6493   kernelInUseErr = -2416,
6494   kernelTerminatedErr = -2417,
6495   kernelExceptionErr = -2418,
6496   kernelIDErr = -2419,
6497   kernelAlreadyFreeErr = -2421,
6498   kernelReturnValueErr = -2422,
6499   kernelUnrecoverableErr = -2499
6500 };
6501
6502
6503
6504 enum {
6505
6506   tsmComponentNoErr = 0,
6507   tsmUnsupScriptLanguageErr = -2500,
6508   tsmInputMethodNotFoundErr = -2501,
6509   tsmNotAnAppErr = -2502,
6510   tsmAlreadyRegisteredErr = -2503,
6511   tsmNeverRegisteredErr = -2504,
6512   tsmInvalidDocIDErr = -2505,
6513   tsmTSMDocBusyErr = -2506,
6514   tsmDocNotActiveErr = -2507,
6515   tsmNoOpenTSErr = -2508,
6516   tsmCantOpenComponentErr = -2509,
6517   tsmTextServiceNotFoundErr = -2510,
6518   tsmDocumentOpenErr = -2511,
6519   tsmUseInputWindowErr = -2512,
6520   tsmTSHasNoMenuErr = -2513,
6521   tsmTSNotOpenErr = -2514,
6522   tsmComponentAlreadyOpenErr = -2515,
6523   tsmInputMethodIsOldErr = -2516,
6524   tsmScriptHasNoIMErr = -2517,
6525   tsmUnsupportedTypeErr = -2518,
6526   tsmUnknownErr = -2519,
6527   tsmInvalidContext = -2520,
6528   tsmNoHandler = -2521,
6529   tsmNoMoreTokens = -2522,
6530   tsmNoStem = -2523,
6531   tsmDefaultIsNotInputMethodErr = -2524,
6532   tsmDocPropertyNotFoundErr = -2528,
6533   tsmDocPropertyBufferTooSmallErr = -2529,
6534   tsmCantChangeForcedClassStateErr = -2530
6535 };
6536
6537
6538 enum {
6539
6540   mmInternalError = -2526
6541 };
6542
6543
6544 enum {
6545   nrLockedErr = -2536,
6546   nrNotEnoughMemoryErr = -2537,
6547   nrInvalidNodeErr = -2538,
6548   nrNotFoundErr = -2539,
6549   nrNotCreatedErr = -2540,
6550   nrNameErr = -2541,
6551   nrNotSlotDeviceErr = -2542,
6552   nrDataTruncatedErr = -2543,
6553   nrPowerErr = -2544,
6554   nrPowerSwitchAbortErr = -2545,
6555   nrTypeMismatchErr = -2546,
6556   nrNotModifiedErr = -2547,
6557   nrOverrunErr = -2548,
6558   nrResultCodeBase = -2549,
6559   nrPathNotFound = -2550,
6560   nrPathBufferTooSmall = -2551,
6561   nrInvalidEntryIterationOp = -2552,
6562   nrPropertyAlreadyExists = -2553,
6563   nrIterationDone = -2554,
6564   nrExitedIteratorScope = -2555,
6565   nrTransactionAborted = -2556,
6566   nrCallNotSupported = -2557
6567 };
6568
6569
6570 enum {
6571   invalidIconRefErr = -2580,
6572   noSuchIconErr = -2581,
6573   noIconDataAvailableErr = -2582
6574 };
6575 enum {
6576   errOSACantCoerce = errAECoercionFail,
6577   errOSACantAccess = errAENoSuchObject,
6578   errOSACantAssign = -10006,
6579   errOSAGeneralError = -2700,
6580   errOSADivideByZero = -2701,
6581   errOSANumericOverflow = -2702,
6582   errOSACantLaunch = -2703,
6583   errOSAAppNotHighLevelEventAware = -2704,
6584   errOSACorruptTerminology = -2705,
6585   errOSAStackOverflow = -2706,
6586   errOSAInternalTableOverflow = -2707,
6587   errOSADataBlockTooLarge = -2708,
6588   errOSACantGetTerminology = -2709,
6589   errOSACantCreate = -2710
6590 };
6591 enum {
6592   errOSATypeError = errAEWrongDataType,
6593   OSAMessageNotUnderstood = errAEEventNotHandled,
6594   OSAUndefinedHandler = errAEHandlerNotFound,
6595   OSAIllegalAccess = errAEAccessorNotFound,
6596   OSAIllegalIndex = errAEIllegalIndex,
6597   OSAIllegalRange = errAEImpossibleRange,
6598   OSAIllegalAssign = -10003,
6599   OSASyntaxError = -2740,
6600   OSASyntaxTypeError = -2741,
6601   OSATokenTooLong = -2742,
6602   OSAMissingParameter = errAEDescNotFound,
6603   OSAParameterMismatch = errAEWrongNumberArgs,
6604   OSADuplicateParameter = -2750,
6605   OSADuplicateProperty = -2751,
6606   OSADuplicateHandler = -2752,
6607   OSAUndefinedVariable = -2753,
6608   OSAInconsistentDeclarations = -2754,
6609   OSAControlFlowError = -2755
6610 };
6611 enum {
6612   errASCantConsiderAndIgnore = -2720,
6613   errASCantCompareMoreThan32k = -2721,
6614   errASTerminologyNestingTooDeep = -2760,
6615   errASIllegalFormalParameter = -2761,
6616   errASParameterNotForEvent = -2762,
6617   errASNoResultReturned = -2763,
6618   errASInconsistentNames = -2780
6619 };
6620
6621
6622
6623 enum {
6624   cfragFirstErrCode = -2800,
6625   cfragContextIDErr = -2800,
6626   cfragConnectionIDErr = -2801,
6627   cfragNoSymbolErr = -2802,
6628   cfragNoSectionErr = -2803,
6629   cfragNoLibraryErr = -2804,
6630   cfragDupRegistrationErr = -2805,
6631   cfragFragmentFormatErr = -2806,
6632   cfragUnresolvedErr = -2807,
6633   cfragNoPositionErr = -2808,
6634   cfragNoPrivateMemErr = -2809,
6635   cfragNoClientMemErr = -2810,
6636   cfragNoIDsErr = -2811,
6637   cfragInitOrderErr = -2812,
6638   cfragImportTooOldErr = -2813,
6639   cfragImportTooNewErr = -2814,
6640   cfragInitLoopErr = -2815,
6641   cfragInitAtBootErr = -2816,
6642   cfragLibConnErr = -2817,
6643   cfragCFMStartupErr = -2818,
6644   cfragCFMInternalErr = -2819,
6645   cfragFragmentCorruptErr = -2820,
6646   cfragInitFunctionErr = -2821,
6647   cfragNoApplicationErr = -2822,
6648   cfragArchitectureErr = -2823,
6649   cfragFragmentUsageErr = -2824,
6650   cfragFileSizeErr = -2825,
6651   cfragNotClosureErr = -2826,
6652   cfragNoRegistrationErr = -2827,
6653   cfragContainerIDErr = -2828,
6654   cfragClosureIDErr = -2829,
6655   cfragAbortClosureErr = -2830,
6656   cfragOutputLengthErr = -2831,
6657   cfragLastErrCode = -2899
6658 };
6659
6660 enum {
6661
6662   cfragFirstReservedCode = -2897,
6663   cfragReservedCode_3 = -2897,
6664   cfragReservedCode_2 = -2898,
6665   cfragReservedCode_1 = -2899
6666 };
6667 enum {
6668   invalidComponentID = -3000,
6669   validInstancesExist = -3001,
6670   componentNotCaptured = -3002,
6671   componentDontRegister = -3003,
6672   unresolvedComponentDLLErr = -3004,
6673   retryComponentRegistrationErr = -3005
6674 };
6675
6676
6677 enum {
6678   invalidTranslationPathErr = -3025,
6679   couldNotParseSourceFileErr = -3026,
6680   noTranslationPathErr = -3030,
6681   badTranslationSpecErr = -3031,
6682   noPrefAppErr = -3032
6683 };
6684
6685 enum {
6686   buf2SmallErr = -3101,
6687   noMPPErr = -3102,
6688   ckSumErr = -3103,
6689   extractErr = -3104,
6690   readQErr = -3105,
6691   atpLenErr = -3106,
6692   atpBadRsp = -3107,
6693   recNotFnd = -3108,
6694   sktClosedErr = -3109
6695 };
6696
6697
6698
6699 enum {
6700   kOTNoError = 0,
6701   kOTOutOfMemoryErr = -3211,
6702   kOTNotFoundErr = -3201,
6703   kOTDuplicateFoundErr = -3216,
6704   kOTBadAddressErr = -3150,
6705   kOTBadOptionErr = -3151,
6706   kOTAccessErr = -3152,
6707   kOTBadReferenceErr = -3153,
6708   kOTNoAddressErr = -3154,
6709   kOTOutStateErr = -3155,
6710   kOTBadSequenceErr = -3156,
6711   kOTSysErrorErr = -3157,
6712   kOTLookErr = -3158,
6713   kOTBadDataErr = -3159,
6714   kOTBufferOverflowErr = -3160,
6715   kOTFlowErr = -3161,
6716   kOTNoDataErr = -3162,
6717   kOTNoDisconnectErr = -3163,
6718   kOTNoUDErrErr = -3164,
6719   kOTBadFlagErr = -3165,
6720   kOTNoReleaseErr = -3166,
6721   kOTNotSupportedErr = -3167,
6722   kOTStateChangeErr = -3168,
6723   kOTNoStructureTypeErr = -3169,
6724   kOTBadNameErr = -3170,
6725   kOTBadQLenErr = -3171,
6726   kOTAddressBusyErr = -3172,
6727   kOTIndOutErr = -3173,
6728   kOTProviderMismatchErr = -3174,
6729   kOTResQLenErr = -3175,
6730   kOTResAddressErr = -3176,
6731   kOTQFullErr = -3177,
6732   kOTProtocolErr = -3178,
6733   kOTBadSyncErr = -3179,
6734   kOTCanceledErr = -3180,
6735   kEPERMErr = -3200,
6736   kENOENTErr = -3201,
6737   kENORSRCErr = -3202,
6738   kEINTRErr = -3203,
6739   kEIOErr = -3204,
6740   kENXIOErr = -3205,
6741   kEBADFErr = -3208,
6742   kEAGAINErr = -3210,
6743   kENOMEMErr = -3211,
6744   kEACCESErr = -3212,
6745   kEFAULTErr = -3213,
6746   kEBUSYErr = -3215,
6747   kEEXISTErr = -3216,
6748   kENODEVErr = -3218,
6749   kEINVALErr = -3221,
6750   kENOTTYErr = -3224,
6751   kEPIPEErr = -3231,
6752   kERANGEErr = -3233,
6753   kEWOULDBLOCKErr = -3234,
6754   kEDEADLKErr = -3234,
6755   kEALREADYErr = -3236,
6756   kENOTSOCKErr = -3237,
6757   kEDESTADDRREQErr = -3238,
6758   kEMSGSIZEErr = -3239,
6759   kEPROTOTYPEErr = -3240,
6760   kENOPROTOOPTErr = -3241,
6761   kEPROTONOSUPPORTErr = -3242,
6762   kESOCKTNOSUPPORTErr = -3243,
6763   kEOPNOTSUPPErr = -3244,
6764   kEADDRINUSEErr = -3247,
6765   kEADDRNOTAVAILErr = -3248,
6766   kENETDOWNErr = -3249,
6767   kENETUNREACHErr = -3250,
6768   kENETRESETErr = -3251,
6769   kECONNABORTEDErr = -3252,
6770   kECONNRESETErr = -3253,
6771   kENOBUFSErr = -3254,
6772   kEISCONNErr = -3255,
6773   kENOTCONNErr = -3256,
6774   kESHUTDOWNErr = -3257,
6775   kETOOMANYREFSErr = -3258,
6776   kETIMEDOUTErr = -3259,
6777   kECONNREFUSEDErr = -3260,
6778   kEHOSTDOWNErr = -3263,
6779   kEHOSTUNREACHErr = -3264,
6780   kEPROTOErr = -3269,
6781   kETIMEErr = -3270,
6782   kENOSRErr = -3271,
6783   kEBADMSGErr = -3272,
6784   kECANCELErr = -3273,
6785   kENOSTRErr = -3274,
6786   kENODATAErr = -3275,
6787   kEINPROGRESSErr = -3276,
6788   kESRCHErr = -3277,
6789   kENOMSGErr = -3278,
6790   kOTClientNotInittedErr = -3279,
6791   kOTPortHasDiedErr = -3280,
6792   kOTPortWasEjectedErr = -3281,
6793   kOTBadConfigurationErr = -3282,
6794   kOTConfigurationChangedErr = -3283,
6795   kOTUserRequestedErr = -3284,
6796   kOTPortLostConnection = -3285
6797 };
6798
6799
6800
6801 enum {
6802   kQDNoPalette = -3950,
6803   kQDNoColorHWCursorSupport = -3951,
6804   kQDCursorAlreadyRegistered = -3952,
6805   kQDCursorNotRegistered = -3953,
6806   kQDCorruptPICTDataErr = -3954
6807 };
6808
6809
6810
6811
6812 enum {
6813   firstPickerError = -4000,
6814   invalidPickerType = firstPickerError,
6815   requiredFlagsDontMatch = -4001,
6816   pickerResourceError = -4002,
6817   cantLoadPicker = -4003,
6818   cantCreatePickerWindow = -4004,
6819   cantLoadPackage = -4005,
6820   pickerCantLive = -4006,
6821   colorSyncNotInstalled = -4007,
6822   badProfileError = -4008,
6823   noHelpForItem = -4009
6824 };
6825
6826
6827
6828
6829 enum {
6830   kNSL68kContextNotSupported = -4170,
6831   kNSLSchedulerError = -4171,
6832   kNSLBadURLSyntax = -4172,
6833   kNSLNoCarbonLib = -4173,
6834   kNSLUILibraryNotAvailable = -4174,
6835   kNSLNotImplementedYet = -4175,
6836   kNSLErrNullPtrError = -4176,
6837   kNSLSomePluginsFailedToLoad = -4177,
6838   kNSLNullNeighborhoodPtr = -4178,
6839   kNSLNoPluginsForSearch = -4179,
6840   kNSLSearchAlreadyInProgress = -4180,
6841   kNSLNoPluginsFound = -4181,
6842   kNSLPluginLoadFailed = -4182,
6843   kNSLBadProtocolTypeErr = -4183,
6844   kNSLNullListPtr = -4184,
6845   kNSLBadClientInfoPtr = -4185,
6846   kNSLCannotContinueLookup = -4186,
6847   kNSLBufferTooSmallForData = -4187,
6848   kNSLNoContextAvailable = -4188,
6849   kNSLRequestBufferAlreadyInList = -4189,
6850   kNSLInvalidPluginSpec = -4190,
6851   kNSLNoSupportForService = -4191,
6852   kNSLBadNetConnection = -4192,
6853   kNSLBadDataTypeErr = -4193,
6854   kNSLBadServiceTypeErr = -4194,
6855   kNSLBadReferenceErr = -4195,
6856   kNSLNoElementsInList = -4196,
6857   kNSLInsufficientOTVer = -4197,
6858   kNSLInsufficientSysVer = -4198,
6859   kNSLNotInitialized = -4199,
6860   kNSLInitializationFailed = -4200
6861 };
6862
6863
6864
6865
6866 enum {
6867   kDTPHoldJobErr = -4200,
6868   kDTPStopQueueErr = -4201,
6869   kDTPTryAgainErr = -4202,
6870   kDTPAbortJobErr = 128
6871 };
6872
6873
6874
6875 enum {
6876
6877   cmElementTagNotFound = -4200,
6878   cmIndexRangeErr = -4201,
6879   cmCantDeleteElement = -4202,
6880   cmFatalProfileErr = -4203,
6881   cmInvalidProfile = -4204,
6882   cmInvalidProfileLocation = -4205,
6883   cmCantCopyModifiedV1Profile = -4215,
6884
6885   cmInvalidSearch = -4206,
6886   cmSearchError = -4207,
6887   cmErrIncompatibleProfile = -4208,
6888   cmInvalidColorSpace = -4209,
6889   cmInvalidSrcMap = -4210,
6890   cmInvalidDstMap = -4211,
6891   cmNoGDevicesError = -4212,
6892   cmInvalidProfileComment = -4213,
6893   cmRangeOverFlow = -4214,
6894   cmNamedColorNotFound = -4216,
6895   cmCantGamutCheckError = -4217
6896 };
6897
6898
6899 enum {
6900   badFolderDescErr = -4270,
6901   duplicateFolderDescErr = -4271,
6902   noMoreFolderDescErr = -4272,
6903   invalidFolderTypeErr = -4273,
6904   duplicateRoutingErr = -4274,
6905   routingNotFoundErr = -4275,
6906   badRoutingSizeErr = -4276
6907 };
6908
6909
6910
6911 enum {
6912   coreFoundationUnknownErr = -4960
6913 };
6914
6915
6916 enum {
6917   internalScrapErr = -4988,
6918   duplicateScrapFlavorErr = -4989,
6919   badScrapRefErr = -4990,
6920   processStateIncorrectErr = -4991,
6921   scrapPromiseNotKeptErr = -4992,
6922   noScrapPromiseKeeperErr = -4993,
6923   nilScrapFlavorDataErr = -4994,
6924   scrapFlavorFlagsMismatchErr = -4995,
6925   scrapFlavorSizeMismatchErr = -4996,
6926   illegalScrapFlavorFlagsErr = -4997,
6927   illegalScrapFlavorTypeErr = -4998,
6928   illegalScrapFlavorSizeErr = -4999,
6929   scrapFlavorNotFoundErr = -102,
6930   needClearScrapErr = -100
6931 };
6932
6933
6934 enum {
6935
6936   afpAccessDenied = -5000,
6937   afpAuthContinue = -5001,
6938   afpBadUAM = -5002,
6939   afpBadVersNum = -5003,
6940   afpBitmapErr = -5004,
6941   afpCantMove = -5005,
6942   afpDenyConflict = -5006,
6943   afpDirNotEmpty = -5007,
6944   afpDiskFull = -5008,
6945   afpEofError = -5009,
6946   afpFileBusy = -5010,
6947   afpFlatVol = -5011,
6948   afpItemNotFound = -5012,
6949   afpLockErr = -5013,
6950   afpMiscErr = -5014,
6951   afpNoMoreLocks = -5015,
6952   afpNoServer = -5016,
6953   afpObjectExists = -5017,
6954   afpObjectNotFound = -5018,
6955   afpParmErr = -5019,
6956   afpRangeNotLocked = -5020,
6957   afpRangeOverlap = -5021,
6958   afpSessClosed = -5022,
6959   afpUserNotAuth = -5023,
6960   afpCallNotSupported = -5024,
6961   afpObjectTypeErr = -5025,
6962   afpTooManyFilesOpen = -5026,
6963   afpServerGoingDown = -5027,
6964   afpCantRename = -5028,
6965   afpDirNotFound = -5029,
6966   afpIconTypeError = -5030,
6967   afpVolLocked = -5031,
6968   afpObjectLocked = -5032,
6969   afpContainsSharedErr = -5033,
6970   afpIDNotFound = -5034,
6971   afpIDExists = -5035,
6972   afpDiffVolErr = -5036,
6973   afpCatalogChanged = -5037,
6974   afpSameObjectErr = -5038,
6975   afpBadIDErr = -5039,
6976   afpPwdSameErr = -5040,
6977   afpPwdTooShortErr = -5041,
6978   afpPwdExpiredErr = -5042,
6979   afpInsideSharedErr = -5043,
6980
6981   afpInsideTrashErr = -5044,
6982
6983   afpPwdNeedsChangeErr = -5045,
6984   afpPwdPolicyErr = -5046,
6985   afpAlreadyLoggedInErr = -5047,
6986   afpCallNotAllowed = -5048
6987 };
6988
6989 enum {
6990
6991   afpBadDirIDType = -5060,
6992   afpCantMountMoreSrvre = -5061,
6993   afpAlreadyMounted = -5062,
6994   afpSameNodeErr = -5063
6995 };
6996
6997
6998
6999
7000
7001
7002 enum {
7003   numberFormattingNotANumberErr = -5200,
7004   numberFormattingOverflowInDestinationErr = -5201,
7005   numberFormattingBadNumberFormattingObjectErr = -5202,
7006   numberFormattingSpuriousCharErr = -5203,
7007   numberFormattingLiteralMissingErr = -5204,
7008   numberFormattingDelimiterMissingErr = -5205,
7009   numberFormattingEmptyFormatErr = -5206,
7010   numberFormattingBadFormatErr = -5207,
7011   numberFormattingBadOptionsErr = -5208,
7012   numberFormattingBadTokenErr = -5209,
7013   numberFormattingUnOrderedCurrencyRangeErr = -5210,
7014   numberFormattingBadCurrencyPositionErr = -5211,
7015   numberFormattingNotADigitErr = -5212,
7016   numberFormattingUnOrdredCurrencyRangeErr = -5210,
7017   numberFortmattingNotADigitErr = -5212
7018 };
7019
7020
7021 enum {
7022   textParserBadParamErr = -5220,
7023   textParserObjectNotFoundErr = -5221,
7024   textParserBadTokenValueErr = -5222,
7025   textParserBadParserObjectErr = -5223,
7026   textParserParamErr = -5224,
7027   textParserNoMoreTextErr = -5225,
7028   textParserBadTextLanguageErr = -5226,
7029   textParserBadTextEncodingErr = -5227,
7030   textParserNoSuchTokenFoundErr = -5228,
7031   textParserNoMoreTokensErr = -5229
7032 };
7033
7034 enum {
7035   errUnknownAttributeTag = -5240,
7036   errMarginWilllNotFit = -5241,
7037   errNotInImagingMode = -5242,
7038   errAlreadyInImagingMode = -5243,
7039   errEngineNotFound = -5244,
7040   errIteratorReachedEnd = -5245,
7041   errInvalidRange = -5246,
7042   errOffsetNotOnElementBounday = -5247,
7043   errNoHiliteText = -5248,
7044   errEmptyScrap = -5249,
7045   errReadOnlyText = -5250,
7046   errUnknownElement = -5251,
7047   errNonContiuousAttribute = -5252,
7048   errCannotUndo = -5253
7049 };
7050
7051
7052
7053 enum {
7054   hrHTMLRenderingLibNotInstalledErr = -5360,
7055   hrMiscellaneousExceptionErr = -5361,
7056   hrUnableToResizeHandleErr = -5362,
7057   hrURLNotHandledErr = -5363
7058 };
7059
7060
7061
7062 enum {
7063   errIANoErr = 0,
7064   errIAUnknownErr = -5380,
7065   errIAAllocationErr = -5381,
7066   errIAParamErr = -5382,
7067   errIANoMoreItems = -5383,
7068   errIABufferTooSmall = -5384,
7069   errIACanceled = -5385,
7070   errIAInvalidDocument = -5386,
7071   errIATextExtractionErr = -5387,
7072   errIAEndOfTextRun = -5388
7073 };
7074
7075
7076
7077 enum {
7078   qtsBadSelectorErr = -5400,
7079   qtsBadStateErr = -5401,
7080   qtsBadDataErr = -5402,
7081   qtsUnsupportedDataTypeErr = -5403,
7082   qtsUnsupportedRateErr = -5404,
7083   qtsUnsupportedFeatureErr = -5405,
7084   qtsTooMuchDataErr = -5406,
7085   qtsUnknownValueErr = -5407,
7086   qtsTimeoutErr = -5408,
7087   qtsConnectionFailedErr = -5420,
7088   qtsAddressBusyErr = -5421
7089 };
7090
7091
7092 enum {
7093
7094   gestaltUnknownErr = -5550,
7095   gestaltUndefSelectorErr = -5551,
7096   gestaltDupSelectorErr = -5552,
7097   gestaltLocationErr = -5553
7098 };
7099
7100
7101
7102 enum {
7103   menuPropertyInvalidErr = -5603,
7104   menuPropertyInvalid = menuPropertyInvalidErr,
7105   menuPropertyNotFoundErr = -5604,
7106   menuNotFoundErr = -5620,
7107   menuUsesSystemDefErr = -5621,
7108   menuItemNotFoundErr = -5622,
7109   menuInvalidErr = -5623
7110 };
7111
7112
7113
7114 enum {
7115   errInvalidWindowPtr = -5600,
7116   errInvalidWindowRef = -5600,
7117   errUnsupportedWindowAttributesForClass = -5601,
7118   errWindowDoesNotHaveProxy = -5602,
7119   errInvalidWindowProperty = -5603,
7120   errWindowPropertyNotFound = -5604,
7121   errUnrecognizedWindowClass = -5605,
7122   errCorruptWindowDescription = -5606,
7123   errUserWantsToDragWindow = -5607,
7124   errWindowsAlreadyInitialized = -5608,
7125   errFloatingWindowsNotInitialized = -5609,
7126   errWindowNotFound = -5610,
7127   errWindowDoesNotFitOnscreen = -5611,
7128   windowAttributeImmutableErr = -5612,
7129   windowAttributesConflictErr = -5613,
7130   windowManagerInternalErr = -5614,
7131   windowWrongStateErr = -5615,
7132   windowGroupInvalidErr = -5616,
7133   windowAppModalStateAlreadyExistsErr = -5617,
7134   windowNoAppModalStateErr = -5618,
7135   errWindowDoesntSupportFocus = -30583,
7136   errWindowRegionCodeInvalid = -30593
7137 };
7138
7139
7140
7141 enum {
7142   dialogNoTimeoutErr = -5640
7143 };
7144
7145
7146
7147 enum {
7148   kNavWrongDialogStateErr = -5694,
7149   kNavWrongDialogClassErr = -5695,
7150   kNavInvalidSystemConfigErr = -5696,
7151   kNavCustomControlMessageFailedErr = -5697,
7152   kNavInvalidCustomControlMessageErr = -5698,
7153   kNavMissingKindStringErr = -5699
7154 };
7155
7156
7157
7158 enum {
7159   collectionItemLockedErr = -5750,
7160   collectionItemNotFoundErr = -5751,
7161   collectionIndexRangeErr = -5752,
7162   collectionVersionErr = -5753
7163 };
7164
7165
7166
7167 enum {
7168   kQTSSUnknownErr = -6150
7169 };
7170
7171
7172 enum {
7173
7174   kDMGenErr = -6220,
7175
7176   kDMMirroringOnAlready = -6221,
7177   kDMWrongNumberOfDisplays = -6222,
7178   kDMMirroringBlocked = -6223,
7179   kDMCantBlock = -6224,
7180   kDMMirroringNotOn = -6225,
7181
7182   kSysSWTooOld = -6226,
7183   kDMSWNotInitializedErr = -6227,
7184   kDMDriverNotDisplayMgrAwareErr = -6228,
7185   kDMDisplayNotFoundErr = -6229,
7186   kDMNotFoundErr = -6229,
7187   kDMDisplayAlreadyInstalledErr = -6230,
7188   kDMMainDisplayCannotMoveErr = -6231,
7189   kDMNoDeviceTableclothErr = -6231,
7190   kDMFoundErr = -6232
7191 };
7192
7193
7194
7195
7196
7197 enum {
7198   laTooSmallBufferErr = -6984,
7199   laEnvironmentBusyErr = -6985,
7200   laEnvironmentNotFoundErr = -6986,
7201   laEnvironmentExistErr = -6987,
7202   laInvalidPathErr = -6988,
7203   laNoMoreMorphemeErr = -6989,
7204   laFailAnalysisErr = -6990,
7205   laTextOverFlowErr = -6991,
7206   laDictionaryNotOpenedErr = -6992,
7207   laDictionaryUnknownErr = -6993,
7208   laDictionaryTooManyErr = -6994,
7209   laPropertyValueErr = -6995,
7210   laPropertyUnknownErr = -6996,
7211   laPropertyIsReadOnlyErr = -6997,
7212   laPropertyNotFoundErr = -6998,
7213   laPropertyErr = -6999,
7214   laEngineNotFoundErr = -7000
7215 };
7216
7217
7218 enum {
7219   kUSBNoErr = 0,
7220   kUSBNoTran = 0,
7221   kUSBNoDelay = 0,
7222   kUSBPending = 1
7223 };
7224 enum {
7225   kUSBNotSent2Err = -6901,
7226   kUSBNotSent1Err = -6902,
7227   kUSBBufUnderRunErr = -6903,
7228   kUSBBufOvrRunErr = -6904,
7229   kUSBRes2Err = -6905,
7230   kUSBRes1Err = -6906,
7231   kUSBUnderRunErr = -6907,
7232   kUSBOverRunErr = -6908,
7233   kUSBWrongPIDErr = -6909,
7234   kUSBPIDCheckErr = -6910,
7235   kUSBNotRespondingErr = -6911,
7236   kUSBEndpointStallErr = -6912,
7237   kUSBDataToggleErr = -6913,
7238   kUSBBitstufErr = -6914,
7239   kUSBCRCErr = -6915,
7240   kUSBLinkErr = -6916
7241 };
7242
7243
7244
7245
7246
7247
7248 enum {
7249   kUSBQueueFull = -6948,
7250   kUSBNotHandled = -6987,
7251   kUSBUnknownNotification = -6949,
7252   kUSBBadDispatchTable = -6950
7253 };
7254
7255
7256
7257
7258
7259
7260
7261 enum {
7262   kUSBInternalReserved10 = -6951,
7263   kUSBInternalReserved9 = -6952,
7264   kUSBInternalReserved8 = -6953,
7265   kUSBInternalReserved7 = -6954,
7266   kUSBInternalReserved6 = -6955,
7267   kUSBInternalReserved5 = -6956,
7268   kUSBInternalReserved4 = -6957,
7269   kUSBInternalReserved3 = -6958,
7270   kUSBInternalReserved2 = -6959,
7271   kUSBInternalReserved1 = -6960
7272 };
7273
7274
7275 enum {
7276   kUSBPortDisabled = -6969,
7277   kUSBQueueAborted = -6970,
7278   kUSBTimedOut = -6971,
7279   kUSBDeviceDisconnected = -6972,
7280   kUSBDeviceNotSuspended = -6973,
7281   kUSBDeviceSuspended = -6974,
7282   kUSBInvalidBuffer = -6975,
7283   kUSBDevicePowerProblem = -6976,
7284   kUSBDeviceBusy = -6977,
7285   kUSBUnknownInterfaceErr = -6978,
7286   kUSBPipeStalledError = -6979,
7287   kUSBPipeIdleError = -6980,
7288   kUSBNoBandwidthError = -6981,
7289   kUSBAbortedError = -6982,
7290   kUSBFlagsError = -6983,
7291   kUSBCompletionError = -6984,
7292   kUSBPBLengthError = -6985,
7293   kUSBPBVersionError = -6986,
7294   kUSBNotFound = -6987,
7295   kUSBOutOfMemoryErr = -6988,
7296   kUSBDeviceErr = -6989,
7297   kUSBNoDeviceErr = -6990,
7298   kUSBAlreadyOpenErr = -6991,
7299   kUSBTooManyTransactionsErr = -6992,
7300   kUSBUnknownRequestErr = -6993,
7301   kUSBRqErr = -6994,
7302   kUSBIncorrectTypeErr = -6995,
7303   kUSBTooManyPipesErr = -6996,
7304   kUSBUnknownPipeErr = -6997,
7305   kUSBUnknownDeviceErr = -6998,
7306   kUSBInternalErr = -6999
7307 };
7308
7309
7310
7311
7312
7313 enum {
7314   dcmParamErr = -7100,
7315   dcmNotDictionaryErr = -7101,
7316   dcmBadDictionaryErr = -7102,
7317   dcmPermissionErr = -7103,
7318   dcmDictionaryNotOpenErr = -7104,
7319   dcmDictionaryBusyErr = -7105,
7320   dcmBlockFullErr = -7107,
7321   dcmNoRecordErr = -7108,
7322   dcmDupRecordErr = -7109,
7323   dcmNecessaryFieldErr = -7110,
7324   dcmBadFieldInfoErr = -7111,
7325   dcmBadFieldTypeErr = -7112,
7326   dcmNoFieldErr = -7113,
7327   dcmBadKeyErr = -7115,
7328   dcmTooManyKeyErr = -7116,
7329   dcmBadDataSizeErr = -7117,
7330   dcmBadFindMethodErr = -7118,
7331   dcmBadPropertyErr = -7119,
7332   dcmProtectedErr = -7121,
7333   dcmNoAccessMethodErr = -7122,
7334   dcmBadFeatureErr = -7124,
7335   dcmIterationCompleteErr = -7126,
7336   dcmBufferOverflowErr = -7127
7337 };
7338
7339
7340
7341 enum {
7342   kRAInvalidParameter = -7100,
7343   kRAInvalidPort = -7101,
7344   kRAStartupFailed = -7102,
7345   kRAPortSetupFailed = -7103,
7346   kRAOutOfMemory = -7104,
7347   kRANotSupported = -7105,
7348   kRAMissingResources = -7106,
7349   kRAIncompatiblePrefs = -7107,
7350   kRANotConnected = -7108,
7351   kRAConnectionCanceled = -7109,
7352   kRAUnknownUser = -7110,
7353   kRAInvalidPassword = -7111,
7354   kRAInternalError = -7112,
7355   kRAInstallationDamaged = -7113,
7356   kRAPortBusy = -7114,
7357   kRAUnknownPortState = -7115,
7358   kRAInvalidPortState = -7116,
7359   kRAInvalidSerialProtocol = -7117,
7360   kRAUserLoginDisabled = -7118,
7361   kRAUserPwdChangeRequired = -7119,
7362   kRAUserPwdEntryRequired = -7120,
7363   kRAUserInteractionRequired = -7121,
7364   kRAInitOpenTransportFailed = -7122,
7365   kRARemoteAccessNotReady = -7123,
7366   kRATCPIPInactive = -7124,
7367   kRATCPIPNotConfigured = -7125,
7368   kRANotPrimaryInterface = -7126,
7369   kRAConfigurationDBInitErr = -7127,
7370   kRAPPPProtocolRejected = -7128,
7371   kRAPPPAuthenticationFailed = -7129,
7372   kRAPPPNegotiationFailed = -7130,
7373   kRAPPPUserDisconnected = -7131,
7374   kRAPPPPeerDisconnected = -7132,
7375   kRAPeerNotResponding = -7133,
7376   kRAATalkInactive = -7134,
7377   kRAExtAuthenticationFailed = -7135,
7378   kRANCPRejectedbyPeer = -7136,
7379   kRADuplicateIPAddr = -7137,
7380   kRACallBackFailed = -7138,
7381   kRANotEnabled = -7139
7382 };
7383 enum {
7384   kATSUInvalidTextLayoutErr = -8790,
7385
7386
7387   kATSUInvalidStyleErr = -8791,
7388
7389
7390   kATSUInvalidTextRangeErr = -8792,
7391
7392
7393   kATSUFontsMatched = -8793,
7394
7395
7396   kATSUFontsNotMatched = -8794,
7397
7398
7399   kATSUNoCorrespondingFontErr = -8795,
7400
7401
7402
7403
7404
7405
7406   kATSUInvalidFontErr = -8796,
7407   kATSUInvalidAttributeValueErr = -8797,
7408
7409   kATSUInvalidAttributeSizeErr = -8798,
7410
7411   kATSUInvalidAttributeTagErr = -8799,
7412
7413   kATSUInvalidCacheErr = -8800,
7414
7415
7416
7417
7418   kATSUNotSetErr = -8801,
7419
7420
7421
7422   kATSUNoStyleRunsAssignedErr = -8802,
7423
7424   kATSUQuickDrawTextErr = -8803,
7425
7426   kATSULowLevelErr = -8804,
7427
7428   kATSUNoFontCmapAvailableErr = -8805,
7429
7430   kATSUNoFontScalerAvailableErr = -8806,
7431
7432   kATSUCoordinateOverflowErr = -8807,
7433
7434   kATSULineBreakInWord = -8808,
7435
7436
7437   kATSUBusyObjectErr = -8809
7438 };
7439 enum {
7440
7441   kTextUnsupportedEncodingErr = -8738,
7442   kTextMalformedInputErr = -8739,
7443   kTextUndefinedElementErr = -8740,
7444   kTECMissingTableErr = -8745,
7445   kTECTableChecksumErr = -8746,
7446   kTECTableFormatErr = -8747,
7447   kTECCorruptConverterErr = -8748,
7448   kTECNoConversionPathErr = -8749,
7449   kTECBufferBelowMinimumSizeErr = -8750,
7450   kTECArrayFullErr = -8751,
7451   kTECBadTextRunErr = -8752,
7452   kTECPartialCharErr = -8753,
7453   kTECUnmappableElementErr = -8754,
7454   kTECIncompleteElementErr = -8755,
7455   kTECDirectionErr = -8756,
7456   kTECGlobalsUnavailableErr = -8770,
7457   kTECItemUnavailableErr = -8771,
7458
7459   kTECUsedFallbacksStatus = -8783,
7460   kTECNeedFlushStatus = -8784,
7461   kTECOutputBufferFullStatus = -8785,
7462
7463   unicodeChecksumErr = -8769,
7464   unicodeNoTableErr = -8768,
7465   unicodeVariantErr = -8767,
7466   unicodeFallbacksErr = -8766,
7467   unicodePartConvertErr = -8765,
7468   unicodeBufErr = -8764,
7469   unicodeCharErr = -8763,
7470   unicodeElementErr = -8762,
7471   unicodeNotFoundErr = -8761,
7472   unicodeTableFormatErr = -8760,
7473   unicodeDirectionErr = -8759,
7474   unicodeContextualErr = -8758,
7475   unicodeTextEncodingDataErr = -8757
7476 };
7477
7478
7479
7480 enum {
7481   kUTCUnderflowErr = -8850,
7482   kUTCOverflowErr = -8851,
7483   kIllegalClockValueErr = -8852
7484 };
7485
7486
7487
7488
7489
7490 enum {
7491   kATSUInvalidFontFallbacksErr = -8900,
7492
7493   kATSUUnsupportedStreamFormatErr = -8901,
7494
7495   kATSUBadStreamErr = -8902,
7496
7497
7498   kATSUOutputBufferTooSmallErr = -8903,
7499
7500   kATSUInvalidCallInsideCallbackErr = -8904,
7501
7502   kATSULastErr = -8959
7503 };
7504
7505
7506
7507 enum {
7508   codecErr = -8960,
7509   noCodecErr = -8961,
7510   codecUnimpErr = -8962,
7511   codecSizeErr = -8963,
7512   codecScreenBufErr = -8964,
7513   codecImageBufErr = -8965,
7514   codecSpoolErr = -8966,
7515   codecAbortErr = -8967,
7516   codecWouldOffscreenErr = -8968,
7517   codecBadDataErr = -8969,
7518   codecDataVersErr = -8970,
7519   codecExtensionNotFoundErr = -8971,
7520   scTypeNotFoundErr = codecExtensionNotFoundErr,
7521   codecConditionErr = -8972,
7522   codecOpenErr = -8973,
7523   codecCantWhenErr = -8974,
7524   codecCantQueueErr = -8975,
7525   codecNothingToBlitErr = -8976,
7526   codecNoMemoryPleaseWaitErr = -8977,
7527   codecDisabledErr = -8978,
7528   codecNeedToFlushChainErr = -8979,
7529   lockPortBitsBadSurfaceErr = -8980,
7530   lockPortBitsWindowMovedErr = -8981,
7531   lockPortBitsWindowResizedErr = -8982,
7532   lockPortBitsWindowClippedErr = -8983,
7533   lockPortBitsBadPortErr = -8984,
7534   lockPortBitsSurfaceLostErr = -8985,
7535   codecParameterDialogConfirm = -8986,
7536   codecNeedAccessKeyErr = -8987,
7537   codecOffscreenFailedErr = -8988,
7538   codecDroppedFrameErr = -8989,
7539   directXObjectAlreadyExists = -8990,
7540   lockPortBitsWrongGDeviceErr = -8991,
7541   codecOffscreenFailedPleaseRetryErr = -8992,
7542   badCodecCharacterizationErr = -8993,
7543   noThumbnailFoundErr = -8994
7544 };
7545
7546
7547
7548 enum {
7549   kBadAdapterErr = -9050,
7550   kBadAttributeErr = -9051,
7551   kBadBaseErr = -9052,
7552   kBadEDCErr = -9053,
7553   kBadIRQErr = -9054,
7554   kBadOffsetErr = -9055,
7555   kBadPageErr = -9056,
7556   kBadSizeErr = -9057,
7557   kBadSocketErr = -9058,
7558   kBadTypeErr = -9059,
7559   kBadVccErr = -9060,
7560   kBadVppErr = -9061,
7561   kBadWindowErr = -9062,
7562   kBadArgLengthErr = -9063,
7563   kBadArgsErr = -9064,
7564   kBadHandleErr = -9065,
7565   kBadCISErr = -9066,
7566   kBadSpeedErr = -9067,
7567   kReadFailureErr = -9068,
7568   kWriteFailureErr = -9069,
7569   kGeneralFailureErr = -9070,
7570   kNoCardErr = -9071,
7571   kUnsupportedFunctionErr = -9072,
7572   kUnsupportedModeErr = -9073,
7573   kBusyErr = -9074,
7574   kWriteProtectedErr = -9075,
7575   kConfigurationLockedErr = -9076,
7576   kInUseErr = -9077,
7577   kNoMoreItemsErr = -9078,
7578   kOutOfResourceErr = -9079,
7579   kNoCardSevicesSocketsErr = -9080,
7580   kInvalidRegEntryErr = -9081,
7581   kBadLinkErr = -9082,
7582   kBadDeviceErr = -9083,
7583   k16BitCardErr = -9084,
7584   kCardBusCardErr = -9085,
7585   kPassCallToChainErr = -9086,
7586   kCantConfigureCardErr = -9087,
7587   kPostCardEventErr = -9088,
7588   kInvalidDeviceNumber = -9089,
7589   kUnsupportedVsErr = -9090,
7590   kInvalidCSClientErr = -9091,
7591   kBadTupleDataErr = -9092,
7592   kBadCustomIFIDErr = -9093,
7593   kNoIOWindowRequestedErr = -9094,
7594   kNoMoreTimerClientsErr = -9095,
7595   kNoMoreInterruptSlotsErr = -9096,
7596   kNoClientTableErr = -9097,
7597   kUnsupportedCardErr = -9098,
7598   kNoCardEnablersFoundErr = -9099,
7599   kNoEnablerForCardErr = -9100,
7600   kNoCompatibleNameErr = -9101,
7601   kClientRequestDenied = -9102,
7602
7603   kNotReadyErr = -9103,
7604   kTooManyIOWindowsErr = -9104,
7605   kAlreadySavedStateErr = -9105,
7606   kAttemptDupCardEntryErr = -9106,
7607   kCardPowerOffErr = -9107,
7608   kNotZVCapableErr = -9108,
7609   kNoCardBusCISErr = -9109
7610 };
7611
7612
7613 enum {
7614   noDeviceForChannel = -9400,
7615   grabTimeComplete = -9401,
7616   cantDoThatInCurrentMode = -9402,
7617   notEnoughMemoryToGrab = -9403,
7618   notEnoughDiskSpaceToGrab = -9404,
7619   couldntGetRequiredComponent = -9405,
7620   badSGChannel = -9406,
7621   seqGrabInfoNotAvailable = -9407,
7622   deviceCantMeetRequest = -9408,
7623   badControllerHeight = -9994,
7624   editingNotAllowed = -9995,
7625   controllerBoundsNotExact = -9996,
7626   cannotSetWidthOfAttachedController = -9997,
7627   controllerHasFixedHeight = -9998,
7628   cannotMoveAttachedController = -9999
7629 };
7630
7631
7632 enum {
7633   errAEBadKeyForm = -10002,
7634   errAECantHandleClass = -10010,
7635   errAECantSupplyType = -10009,
7636   errAECantUndo = -10015,
7637   errAEEventFailed = -10000,
7638   errAEIndexTooLarge = -10007,
7639   errAEInTransaction = -10011,
7640   errAELocalOnly = -10016,
7641   errAENoSuchTransaction = -10012,
7642   errAENotAnElement = -10008,
7643   errAENotASingleObject = -10014,
7644   errAENotModifiable = -10003,
7645   errAENoUserSelection = -10013,
7646   errAEPrivilegeError = -10004,
7647   errAEReadDenied = -10005,
7648   errAETypeError = -10001,
7649   errAEWriteDenied = -10006,
7650   errAENotAnEnumMember = -10023,
7651   errAECantPutThatThere = -10024,
7652   errAEPropertiesClash = -10025
7653 };
7654
7655
7656 enum {
7657   telGenericError = -1,
7658   telNoErr = 0,
7659   telNoTools = 8,
7660   telBadTermErr = -10001,
7661   telBadDNErr = -10002,
7662   telBadCAErr = -10003,
7663   telBadHandErr = -10004,
7664   telBadProcErr = -10005,
7665   telCAUnavail = -10006,
7666   telNoMemErr = -10007,
7667   telNoOpenErr = -10008,
7668   telBadHTypeErr = -10010,
7669   telHTypeNotSupp = -10011,
7670   telBadLevelErr = -10012,
7671   telBadVTypeErr = -10013,
7672   telVTypeNotSupp = -10014,
7673   telBadAPattErr = -10015,
7674   telAPattNotSupp = -10016,
7675   telBadIndex = -10017,
7676   telIndexNotSupp = -10018,
7677   telBadStateErr = -10019,
7678   telStateNotSupp = -10020,
7679   telBadIntExt = -10021,
7680   telIntExtNotSupp = -10022,
7681   telBadDNDType = -10023,
7682   telDNDTypeNotSupp = -10024,
7683   telFeatNotSub = -10030,
7684   telFeatNotAvail = -10031,
7685   telFeatActive = -10032,
7686   telFeatNotSupp = -10033,
7687   telConfLimitErr = -10040,
7688   telConfNoLimit = -10041,
7689   telConfErr = -10042,
7690   telConfRej = -10043,
7691   telTransferErr = -10044,
7692   telTransferRej = -10045,
7693   telCBErr = -10046,
7694   telConfLimitExceeded = -10047,
7695   telBadDNType = -10050,
7696   telBadPageID = -10051,
7697   telBadIntercomID = -10052,
7698   telBadFeatureID = -10053,
7699   telBadFwdType = -10054,
7700   telBadPickupGroupID = -10055,
7701   telBadParkID = -10056,
7702   telBadSelect = -10057,
7703   telBadBearerType = -10058,
7704   telBadRate = -10059,
7705   telDNTypeNotSupp = -10060,
7706   telFwdTypeNotSupp = -10061,
7707   telBadDisplayMode = -10062,
7708   telDisplayModeNotSupp = -10063,
7709   telNoCallbackRef = -10064,
7710   telAlreadyOpen = -10070,
7711   telStillNeeded = -10071,
7712   telTermNotOpen = -10072,
7713   telCANotAcceptable = -10080,
7714   telCANotRejectable = -10081,
7715   telCANotDeflectable = -10082,
7716   telPBErr = -10090,
7717   telBadFunction = -10091,
7718
7719   telNoSuchTool = -10102,
7720   telUnknownErr = -10103,
7721   telNoCommFolder = -10106,
7722   telInitFailed = -10107,
7723   telBadCodeResource = -10108,
7724   telDeviceNotFound = -10109,
7725   telBadProcID = -10110,
7726   telValidateFailed = -10111,
7727   telAutoAnsNotOn = -10112,
7728   telDetAlreadyOn = -10113,
7729   telBadSWErr = -10114,
7730   telBadSampleRate = -10115,
7731   telNotEnoughdspBW = -10116
7732 };
7733
7734 enum {
7735   errTaskNotFound = -10780
7736 };
7737
7738
7739
7740
7741
7742 enum {
7743
7744   pmBusyErr = -13000,
7745   pmReplyTOErr = -13001,
7746   pmSendStartErr = -13002,
7747   pmSendEndErr = -13003,
7748   pmRecvStartErr = -13004,
7749   pmRecvEndErr = -13005
7750 };
7751
7752
7753 enum {
7754   kPowerHandlerExistsForDeviceErr = -13006,
7755   kPowerHandlerNotFoundForDeviceErr = -13007,
7756   kPowerHandlerNotFoundForProcErr = -13008,
7757   kPowerMgtMessageNotHandled = -13009,
7758   kPowerMgtRequestDenied = -13010,
7759   kCantReportProcessorTemperatureErr = -13013,
7760   kProcessorTempRoutineRequiresMPLib2 = -13014,
7761   kNoSuchPowerSource = -13020,
7762   kBridgeSoftwareRunningCantSleep = -13038
7763 };
7764
7765
7766
7767 enum {
7768   debuggingExecutionContextErr = -13880,
7769   debuggingDuplicateSignatureErr = -13881,
7770   debuggingDuplicateOptionErr = -13882,
7771   debuggingInvalidSignatureErr = -13883,
7772   debuggingInvalidOptionErr = -13884,
7773   debuggingInvalidNameErr = -13885,
7774   debuggingNoCallbackErr = -13886,
7775   debuggingNoMatchErr = -13887
7776 };
7777
7778
7779
7780 enum {
7781   kHIDVersionIncompatibleErr = -13909,
7782   kHIDDeviceNotReady = -13910
7783 };
7784
7785
7786
7787 enum {
7788   kHIDSuccess = 0,
7789   kHIDInvalidRangePageErr = -13923,
7790   kHIDReportIDZeroErr = -13924,
7791   kHIDReportCountZeroErr = -13925,
7792   kHIDReportSizeZeroErr = -13926,
7793   kHIDUnmatchedDesignatorRangeErr = -13927,
7794   kHIDUnmatchedStringRangeErr = -13928,
7795   kHIDInvertedUsageRangeErr = -13929,
7796   kHIDUnmatchedUsageRangeErr = -13930,
7797   kHIDInvertedPhysicalRangeErr = -13931,
7798   kHIDInvertedLogicalRangeErr = -13932,
7799   kHIDBadLogicalMaximumErr = -13933,
7800   kHIDBadLogicalMinimumErr = -13934,
7801   kHIDUsagePageZeroErr = -13935,
7802   kHIDEndOfDescriptorErr = -13936,
7803   kHIDNotEnoughMemoryErr = -13937,
7804   kHIDBadParameterErr = -13938,
7805   kHIDNullPointerErr = -13939,
7806   kHIDInvalidReportLengthErr = -13940,
7807   kHIDInvalidReportTypeErr = -13941,
7808   kHIDBadLogPhysValuesErr = -13942,
7809   kHIDIncompatibleReportErr = -13943,
7810   kHIDInvalidPreparsedDataErr = -13944,
7811   kHIDNotValueArrayErr = -13945,
7812   kHIDUsageNotFoundErr = -13946,
7813   kHIDValueOutOfRangeErr = -13947,
7814   kHIDBufferTooSmallErr = -13948,
7815   kHIDNullStateErr = -13949,
7816   kHIDBaseError = -13950
7817 };
7818
7819
7820
7821 enum {
7822   kModemOutOfMemory = -14000,
7823   kModemPreferencesMissing = -14001,
7824   kModemScriptMissing = -14002
7825 };
7826
7827
7828
7829
7830 enum {
7831   kTXNEndIterationErr = -22000,
7832   kTXNCannotAddFrameErr = -22001,
7833   kTXNInvalidFrameIDErr = -22002,
7834   kTXNIllegalToCrossDataBoundariesErr = -22003,
7835   kTXNUserCanceledOperationErr = -22004,
7836   kTXNBadDefaultFileTypeWarning = -22005,
7837   kTXNCannotSetAutoIndentErr = -22006,
7838   kTXNRunIndexOutofBoundsErr = -22007,
7839   kTXNNoMatchErr = -22008,
7840   kTXNAttributeTagInvalidForRunErr = -22009,
7841   kTXNSomeOrAllTagsInvalidForRunErr = -22010,
7842   kTXNInvalidRunIndex = -22011,
7843   kTXNAlreadyInitializedErr = -22012,
7844   kTXNCannotTurnTSMOffWhenUsingUnicodeErr = -22013,
7845   kTXNCopyNotAllowedInEchoModeErr = -22014,
7846   kTXNDataTypeNotAllowedErr = -22015,
7847   kTXNATSUIIsNotInstalledErr = -22016,
7848   kTXNOutsideOfLineErr = -22017,
7849   kTXNOutsideOfFrameErr = -22018
7850 };
7851
7852
7853
7854
7855
7856 enum {
7857   printerStatusOpCodeNotSupportedErr = -25280
7858 };
7859
7860
7861
7862 enum {
7863   errKCNotAvailable = -25291,
7864   errKCReadOnly = -25292,
7865   errKCAuthFailed = -25293,
7866   errKCNoSuchKeychain = -25294,
7867   errKCInvalidKeychain = -25295,
7868   errKCDuplicateKeychain = -25296,
7869   errKCDuplicateCallback = -25297,
7870   errKCInvalidCallback = -25298,
7871   errKCDuplicateItem = -25299,
7872   errKCItemNotFound = -25300,
7873   errKCBufferTooSmall = -25301,
7874   errKCDataTooLarge = -25302,
7875   errKCNoSuchAttr = -25303,
7876   errKCInvalidItemRef = -25304,
7877   errKCInvalidSearchRef = -25305,
7878   errKCNoSuchClass = -25306,
7879   errKCNoDefaultKeychain = -25307,
7880   errKCInteractionNotAllowed = -25308,
7881   errKCReadOnlyAttr = -25309,
7882   errKCWrongKCVersion = -25310,
7883   errKCKeySizeNotAllowed = -25311,
7884   errKCNoStorageModule = -25312,
7885   errKCNoCertificateModule = -25313,
7886   errKCNoPolicyModule = -25314,
7887   errKCInteractionRequired = -25315,
7888   errKCDataNotAvailable = -25316,
7889   errKCDataNotModifiable = -25317,
7890   errKCCreateChainFailed = -25318
7891 };
7892
7893
7894
7895 enum {
7896   kUCOutputBufferTooSmall = -25340,
7897   kUCTextBreakLocatorMissingType = -25341
7898 };
7899
7900 enum {
7901   kUCTSNoKeysAddedToObjectErr = -25342,
7902   kUCTSSearchListErr = -25343
7903 };
7904
7905
7906 enum {
7907   kMPIterationEndErr = -29275,
7908   kMPPrivilegedErr = -29276,
7909   kMPProcessCreatedErr = -29288,
7910   kMPProcessTerminatedErr = -29289,
7911   kMPTaskCreatedErr = -29290,
7912   kMPTaskBlockedErr = -29291,
7913   kMPTaskStoppedErr = -29292,
7914   kMPBlueBlockingErr = -29293,
7915   kMPDeletedErr = -29295,
7916   kMPTimeoutErr = -29296,
7917   kMPTaskAbortedErr = -29297,
7918   kMPInsufficientResourcesErr = -29298,
7919   kMPInvalidIDErr = -29299
7920 };
7921
7922 enum {
7923   kMPNanokernelNeedsMemoryErr = -29294
7924 };
7925
7926
7927 enum {
7928   kCollateAttributesNotFoundErr = -29500,
7929   kCollateInvalidOptions = -29501,
7930   kCollateMissingUnicodeTableErr = -29502,
7931   kCollateUnicodeConvertFailedErr = -29503,
7932   kCollatePatternNotFoundErr = -29504,
7933   kCollateInvalidChar = -29505,
7934   kCollateBufferTooSmall = -29506,
7935   kCollateInvalidCollationRef = -29507
7936 };
7937
7938
7939
7940 enum {
7941   kFNSInvalidReferenceErr = -29580,
7942   kFNSBadReferenceVersionErr = -29581,
7943   kFNSInvalidProfileErr = -29582,
7944   kFNSBadProfileVersionErr = -29583,
7945   kFNSDuplicateReferenceErr = -29584,
7946   kFNSMismatchErr = -29585,
7947   kFNSInsufficientDataErr = -29586,
7948   kFNSBadFlattenedSizeErr = -29587,
7949   kFNSNameNotFoundErr = -29589
7950 };
7951
7952
7953
7954
7955 enum {
7956   kLocalesBufferTooSmallErr = -30001,
7957   kLocalesTableFormatErr = -30002,
7958   kLocalesDefaultDisplayStatus = -30029
7959 };
7960
7961
7962
7963 enum {
7964   kALMInternalErr = -30049,
7965   kALMGroupNotFoundErr = -30048,
7966   kALMNoSuchModuleErr = -30047,
7967   kALMModuleCommunicationErr = -30046,
7968   kALMDuplicateModuleErr = -30045,
7969   kALMInstallationErr = -30044,
7970   kALMDeferSwitchErr = -30043,
7971   kALMRebootFlagsLevelErr = -30042
7972 };
7973
7974 enum {
7975   kALMLocationNotFoundErr = kALMGroupNotFoundErr
7976 };
7977
7978
7979
7980 enum {
7981   kSSpInternalErr = -30340,
7982   kSSpVersionErr = -30341,
7983   kSSpCantInstallErr = -30342,
7984   kSSpParallelUpVectorErr = -30343,
7985   kSSpScaleToZeroErr = -30344
7986 };
7987
7988
7989
7990 enum {
7991   kNSpInitializationFailedErr = -30360,
7992   kNSpAlreadyInitializedErr = -30361,
7993   kNSpTopologyNotSupportedErr = -30362,
7994   kNSpPipeFullErr = -30364,
7995   kNSpHostFailedErr = -30365,
7996   kNSpProtocolNotAvailableErr = -30366,
7997   kNSpInvalidGameRefErr = -30367,
7998   kNSpInvalidParameterErr = -30369,
7999   kNSpOTNotPresentErr = -30370,
8000   kNSpOTVersionTooOldErr = -30371,
8001   kNSpMemAllocationErr = -30373,
8002   kNSpAlreadyAdvertisingErr = -30374,
8003   kNSpNotAdvertisingErr = -30376,
8004   kNSpInvalidAddressErr = -30377,
8005   kNSpFreeQExhaustedErr = -30378,
8006   kNSpRemovePlayerFailedErr = -30379,
8007   kNSpAddressInUseErr = -30380,
8008   kNSpFeatureNotImplementedErr = -30381,
8009   kNSpNameRequiredErr = -30382,
8010   kNSpInvalidPlayerIDErr = -30383,
8011   kNSpInvalidGroupIDErr = -30384,
8012   kNSpNoPlayersErr = -30385,
8013   kNSpNoGroupsErr = -30386,
8014   kNSpNoHostVolunteersErr = -30387,
8015   kNSpCreateGroupFailedErr = -30388,
8016   kNSpAddPlayerFailedErr = -30389,
8017   kNSpInvalidDefinitionErr = -30390,
8018   kNSpInvalidProtocolRefErr = -30391,
8019   kNSpInvalidProtocolListErr = -30392,
8020   kNSpTimeoutErr = -30393,
8021   kNSpGameTerminatedErr = -30394,
8022   kNSpConnectFailedErr = -30395,
8023   kNSpSendFailedErr = -30396,
8024   kNSpMessageTooBigErr = -30397,
8025   kNSpCantBlockErr = -30398,
8026   kNSpJoinFailedErr = -30399
8027 };
8028
8029
8030
8031 enum {
8032   kISpInternalErr = -30420,
8033   kISpSystemListErr = -30421,
8034   kISpBufferToSmallErr = -30422,
8035   kISpElementInListErr = -30423,
8036   kISpElementNotInListErr = -30424,
8037   kISpSystemInactiveErr = -30425,
8038   kISpDeviceInactiveErr = -30426,
8039   kISpSystemActiveErr = -30427,
8040   kISpDeviceActiveErr = -30428,
8041   kISpListBusyErr = -30429
8042 };
8043
8044
8045 enum {
8046   kDSpNotInitializedErr = -30440L,
8047   kDSpSystemSWTooOldErr = -30441L,
8048   kDSpInvalidContextErr = -30442L,
8049   kDSpInvalidAttributesErr = -30443L,
8050   kDSpContextAlreadyReservedErr = -30444L,
8051   kDSpContextNotReservedErr = -30445L,
8052   kDSpContextNotFoundErr = -30446L,
8053   kDSpFrameRateNotReadyErr = -30447L,
8054   kDSpConfirmSwitchWarning = -30448L,
8055   kDSpInternalErr = -30449L,
8056   kDSpStereoContextErr = -30450L
8057 };
8058
8059
8060
8061
8062
8063
8064
8065 enum {
8066   kFBCvTwinExceptionErr = -30500,
8067   kFBCnoIndexesFound = -30501,
8068   kFBCallocFailed = -30502,
8069   kFBCbadParam = -30503,
8070   kFBCfileNotIndexed = -30504,
8071   kFBCbadIndexFile = -30505,
8072   kFBCcompactionFailed = -30506,
8073   kFBCvalidationFailed = -30507,
8074   kFBCindexingFailed = -30508,
8075   kFBCcommitFailed = -30509,
8076   kFBCdeletionFailed = -30510,
8077   kFBCmoveFailed = -30511,
8078   kFBCtokenizationFailed = -30512,
8079   kFBCmergingFailed = -30513,
8080   kFBCindexCreationFailed = -30514,
8081   kFBCaccessorStoreFailed = -30515,
8082   kFBCaddDocFailed = -30516,
8083   kFBCflushFailed = -30517,
8084   kFBCindexNotFound = -30518,
8085   kFBCnoSearchSession = -30519,
8086   kFBCindexingCanceled = -30520,
8087   kFBCaccessCanceled = -30521,
8088   kFBCindexFileDestroyed = -30522,
8089   kFBCindexNotAvailable = -30523,
8090   kFBCsearchFailed = -30524,
8091   kFBCsomeFilesNotIndexed = -30525,
8092   kFBCillegalSessionChange = -30526,
8093
8094   kFBCanalysisNotAvailable = -30527,
8095   kFBCbadIndexFileVersion = -30528,
8096   kFBCsummarizationCanceled = -30529,
8097   kFBCindexDiskIOFailed = -30530,
8098   kFBCbadSearchSession = -30531,
8099   kFBCnoSuchHit = -30532
8100 };
8101
8102
8103
8104 enum {
8105   notAQTVRMovieErr = -30540,
8106   constraintReachedErr = -30541,
8107   callNotSupportedByNodeErr = -30542,
8108   selectorNotSupportedByNodeErr = -30543,
8109   invalidNodeIDErr = -30544,
8110   invalidViewStateErr = -30545,
8111   timeNotInViewErr = -30546,
8112   propertyNotSupportedByNodeErr = -30547,
8113   settingNotSupportedByNodeErr = -30548,
8114   limitReachedErr = -30549,
8115   invalidNodeFormatErr = -30550,
8116   invalidHotSpotIDErr = -30551,
8117   noMemoryNodeFailedInitialize = -30552,
8118   streamingNodeNotReadyErr = -30553,
8119   qtvrLibraryLoadErr = -30554,
8120   qtvrUninitialized = -30555
8121 };
8122
8123
8124
8125 enum {
8126   themeInvalidBrushErr = -30560,
8127   themeProcessRegisteredErr = -30561,
8128   themeProcessNotRegisteredErr = -30562,
8129   themeBadTextColorErr = -30563,
8130   themeHasNoAccentsErr = -30564,
8131   themeBadCursorIndexErr = -30565,
8132   themeScriptFontNotFoundErr = -30566,
8133   themeMonitorDepthNotSupportedErr = -30567,
8134   themeNoAppropriateBrushErr = -30568
8135 };
8136
8137
8138
8139 enum {
8140   errMessageNotSupported = -30580,
8141   errDataNotSupported = -30581,
8142   errControlDoesntSupportFocus = -30582,
8143   errUnknownControl = -30584,
8144   errCouldntSetFocus = -30585,
8145   errNoRootControl = -30586,
8146   errRootAlreadyExists = -30587,
8147   errInvalidPartCode = -30588,
8148   errControlsAlreadyExist = -30589,
8149   errControlIsNotEmbedder = -30590,
8150   errDataSizeMismatch = -30591,
8151   errControlHiddenOrDisabled = -30592,
8152   errCantEmbedIntoSelf = -30594,
8153   errCantEmbedRoot = -30595,
8154   errItemNotControl = -30596,
8155   controlInvalidDataVersionErr = -30597,
8156   controlPropertyInvalid = -5603,
8157   controlPropertyNotFoundErr = -5604,
8158   controlHandleInvalidErr = -30599
8159 };
8160
8161
8162
8163
8164
8165 enum {
8166   kURLInvalidURLReferenceError = -30770,
8167   kURLProgressAlreadyDisplayedError = -30771,
8168   kURLDestinationExistsError = -30772,
8169   kURLInvalidURLError = -30773,
8170   kURLUnsupportedSchemeError = -30774,
8171   kURLServerBusyError = -30775,
8172   kURLAuthenticationError = -30776,
8173   kURLPropertyNotYetKnownError = -30777,
8174   kURLUnknownPropertyError = -30778,
8175   kURLPropertyBufferTooSmallError = -30779,
8176   kURLUnsettablePropertyError = -30780,
8177   kURLInvalidCallError = -30781,
8178   kURLFileEmptyError = -30783,
8179   kURLExtensionFailureError = -30785,
8180   kURLInvalidConfigurationError = -30786,
8181   kURLAccessNotAvailableError = -30787,
8182   kURL68kNotSupportedError = -30788
8183 };
8184
8185
8186
8187 enum {
8188   badComponentInstance = (long)0x80008001,
8189   badComponentSelector = (long)0x80008002
8190 };
8191
8192
8193
8194 enum {
8195   dsBusError = 1,
8196   dsAddressErr = 2,
8197   dsIllInstErr = 3,
8198   dsZeroDivErr = 4,
8199   dsChkErr = 5,
8200   dsOvflowErr = 6,
8201   dsPrivErr = 7,
8202   dsTraceErr = 8,
8203   dsLineAErr = 9,
8204   dsLineFErr = 10,
8205   dsMiscErr = 11,
8206   dsCoreErr = 12,
8207   dsIrqErr = 13,
8208   dsIOCoreErr = 14,
8209   dsLoadErr = 15,
8210   dsFPErr = 16,
8211   dsNoPackErr = 17,
8212   dsNoPk1 = 18,
8213   dsNoPk2 = 19
8214 };
8215
8216 enum {
8217   dsNoPk3 = 20,
8218   dsNoPk4 = 21,
8219   dsNoPk5 = 22,
8220   dsNoPk6 = 23,
8221   dsNoPk7 = 24,
8222   dsMemFullErr = 25,
8223   dsBadLaunch = 26,
8224   dsFSErr = 27,
8225   dsStknHeap = 28,
8226   negZcbFreeErr = 33,
8227   dsFinderErr = 41,
8228   dsBadSlotInt = 51,
8229   dsBadSANEOpcode = 81,
8230   dsBadPatchHeader = 83,
8231   menuPrgErr = 84,
8232   dsMBarNFnd = 85,
8233   dsHMenuFindErr = 86,
8234   dsWDEFNotFound = 87,
8235   dsCDEFNotFound = 88,
8236   dsMDEFNotFound = 89
8237 };
8238
8239 enum {
8240   dsNoFPU = 90,
8241   dsNoPatch = 98,
8242   dsBadPatch = 99,
8243   dsParityErr = 101,
8244   dsOldSystem = 102,
8245   ds32BitMode = 103,
8246   dsNeedToWriteBootBlocks = 104,
8247   dsNotEnoughRAMToBoot = 105,
8248   dsBufPtrTooLow = 106,
8249   dsVMDeferredFuncTableFull = 112,
8250   dsVMBadBackingStore = 113,
8251   dsCantHoldSystemHeap = 114,
8252   dsSystemRequiresPowerPC = 116,
8253   dsGibblyMovedToDisabledFolder = 117,
8254   dsUnBootableSystem = 118,
8255   dsMustUseFCBAccessors = 119,
8256   dsMacOSROMVersionTooOld = 120,
8257   dsLostConnectionToNetworkDisk = 121,
8258   dsRAMDiskTooBig = 122,
8259   dsWriteToSupervisorStackGuardPage = 128,
8260   dsReinsert = 30,
8261   shutDownAlert = 42,
8262   dsShutDownOrRestart = 20000,
8263   dsSwitchOffOrRestart = 20001,
8264   dsForcedQuit = 20002,
8265   dsRemoveDisk = 20003,
8266   dsDirtyDisk = 20004,
8267   dsShutDownOrResume = 20109,
8268   dsSCSIWarn = 20010,
8269   dsMBSysError = 29200,
8270   dsMBFlpySysError = 29201,
8271   dsMBATASysError = 29202,
8272   dsMBATAPISysError = 29203,
8273   dsMBExternFlpySysError = 29204,
8274   dsPCCardATASysError = 29205
8275 };
8276
8277
8278
8279
8280
8281
8282 enum {
8283   dsNoExtsMacsBug = -1,
8284   dsNoExtsDisassembler = -2,
8285   dsMacsBugInstalled = -10,
8286   dsDisassemblerInstalled = -11,
8287   dsExtensionsDisabled = -13,
8288   dsGreeting = 40,
8289   dsSysErr = 32767,
8290
8291   WDEFNFnd = dsWDEFNotFound
8292 };
8293
8294 enum {
8295   CDEFNFnd = dsCDEFNotFound,
8296   dsNotThe1 = 31,
8297   dsBadStartupDisk = 42,
8298   dsSystemFileErr = 43,
8299   dsHD20Installed = -12,
8300   mBarNFnd = -126,
8301   fsDSIntErr = -127,
8302   hMenuFindErr = -127,
8303   userBreak = -490,
8304   strUserBreak = -491,
8305   exUserBreak = -492
8306 };
8307
8308
8309 enum {
8310
8311   dsBadLibrary = 1010,
8312   dsMixedModeFailure = 1011
8313 };
8314 extern void
8315 SysError(short errorCode) ;
8316
8317
8318
8319
8320
8321
8322 }
8323 extern "C" {
8324
8325
8326
8327
8328 enum {
8329   kUTCDefaultOptions = 0
8330 };
8331
8332
8333 struct UTCDateTime {
8334   UInt16 highSeconds;
8335   UInt32 lowSeconds;
8336   UInt16 fraction;
8337 };
8338 typedef struct UTCDateTime UTCDateTime;
8339 typedef UTCDateTime * UTCDateTimePtr;
8340 typedef UTCDateTimePtr * UTCDateTimeHandle;
8341 struct LocalDateTime {
8342   UInt16 highSeconds;
8343   UInt32 lowSeconds;
8344   UInt16 fraction;
8345 };
8346 typedef struct LocalDateTime LocalDateTime;
8347 typedef LocalDateTime * LocalDateTimePtr;
8348 typedef LocalDateTimePtr * LocalDateTimeHandle;
8349 extern OSStatus
8350 ConvertLocalTimeToUTC(
8351   UInt32 localSeconds,
8352   UInt32 * utcSeconds) ;
8353 extern OSStatus
8354 ConvertUTCToLocalTime(
8355   UInt32 utcSeconds,
8356   UInt32 * localSeconds) ;
8357 extern OSStatus
8358 ConvertUTCToLocalDateTime(
8359   const UTCDateTime * utcDateTime,
8360   LocalDateTime * localDateTime) ;
8361 extern OSStatus
8362 ConvertLocalToUTCDateTime(
8363   const LocalDateTime * localDateTime,
8364   UTCDateTime * utcDateTime) ;
8365 extern OSStatus
8366 GetUTCDateTime(
8367   UTCDateTime * utcDateTime,
8368   OptionBits options) ;
8369 extern OSStatus
8370 SetUTCDateTime(
8371   const UTCDateTime * utcDateTime,
8372   OptionBits options) ;
8373 extern OSStatus
8374 GetLocalDateTime(
8375   LocalDateTime * localDateTime,
8376   OptionBits options) ;
8377 extern OSStatus
8378 SetLocalDateTime(
8379   const LocalDateTime * localDateTime,
8380   OptionBits options) ;
8381
8382
8383
8384
8385
8386 }
8387
8388
8389
8390 extern "C" {
8391
8392
8393
8394
8395
8396 typedef UInt32 TextEncodingBase;
8397 enum {
8398
8399   kTextEncodingMacRoman = 0L,
8400   kTextEncodingMacJapanese = 1,
8401   kTextEncodingMacChineseTrad = 2,
8402   kTextEncodingMacKorean = 3,
8403   kTextEncodingMacArabic = 4,
8404   kTextEncodingMacHebrew = 5,
8405   kTextEncodingMacGreek = 6,
8406   kTextEncodingMacCyrillic = 7,
8407   kTextEncodingMacDevanagari = 9,
8408   kTextEncodingMacGurmukhi = 10,
8409   kTextEncodingMacGujarati = 11,
8410   kTextEncodingMacOriya = 12,
8411   kTextEncodingMacBengali = 13,
8412   kTextEncodingMacTamil = 14,
8413   kTextEncodingMacTelugu = 15,
8414   kTextEncodingMacKannada = 16,
8415   kTextEncodingMacMalayalam = 17,
8416   kTextEncodingMacSinhalese = 18,
8417   kTextEncodingMacBurmese = 19,
8418   kTextEncodingMacKhmer = 20,
8419   kTextEncodingMacThai = 21,
8420   kTextEncodingMacLaotian = 22,
8421   kTextEncodingMacGeorgian = 23,
8422   kTextEncodingMacArmenian = 24,
8423   kTextEncodingMacChineseSimp = 25,
8424   kTextEncodingMacTibetan = 26,
8425   kTextEncodingMacMongolian = 27,
8426   kTextEncodingMacEthiopic = 28,
8427   kTextEncodingMacCentralEurRoman = 29,
8428   kTextEncodingMacVietnamese = 30,
8429   kTextEncodingMacExtArabic = 31,
8430   kTextEncodingMacSymbol = 33,
8431   kTextEncodingMacDingbats = 34,
8432   kTextEncodingMacTurkish = 35,
8433   kTextEncodingMacCroatian = 36,
8434   kTextEncodingMacIcelandic = 37,
8435   kTextEncodingMacRomanian = 38,
8436   kTextEncodingMacCeltic = 39,
8437   kTextEncodingMacGaelic = 40,
8438   kTextEncodingMacKeyboardGlyphs = 41
8439 };
8440
8441
8442 enum {
8443   kTextEncodingMacTradChinese = kTextEncodingMacChineseTrad,
8444   kTextEncodingMacRSymbol = 8,
8445   kTextEncodingMacSimpChinese = kTextEncodingMacChineseSimp,
8446   kTextEncodingMacGeez = kTextEncodingMacEthiopic,
8447   kTextEncodingMacEastEurRoman = kTextEncodingMacCentralEurRoman,
8448   kTextEncodingMacUninterp = 32
8449 };
8450 enum {
8451   kTextEncodingMacUnicode = 0x7E
8452 };
8453
8454
8455 enum {
8456
8457   kTextEncodingMacFarsi = 0x8C,
8458
8459   kTextEncodingMacUkrainian = 0x98,
8460
8461   kTextEncodingMacInuit = 0xEC,
8462   kTextEncodingMacVT100 = 0xFC
8463 };
8464
8465
8466 enum {
8467   kTextEncodingMacHFS = 0xFF
8468 };
8469
8470
8471 enum {
8472   kTextEncodingUnicodeDefault = 0x0100,
8473   kTextEncodingUnicodeV1_1 = 0x0101,
8474   kTextEncodingISO10646_1993 = 0x0101,
8475   kTextEncodingUnicodeV2_0 = 0x0103,
8476   kTextEncodingUnicodeV2_1 = 0x0103,
8477   kTextEncodingUnicodeV3_0 = 0x0104,
8478   kTextEncodingUnicodeV3_1 = 0x0105,
8479   kTextEncodingUnicodeV3_2 = 0x0106
8480 };
8481
8482
8483 enum {
8484   kTextEncodingISOLatin1 = 0x0201,
8485   kTextEncodingISOLatin2 = 0x0202,
8486   kTextEncodingISOLatin3 = 0x0203,
8487   kTextEncodingISOLatin4 = 0x0204,
8488   kTextEncodingISOLatinCyrillic = 0x0205,
8489   kTextEncodingISOLatinArabic = 0x0206,
8490   kTextEncodingISOLatinGreek = 0x0207,
8491   kTextEncodingISOLatinHebrew = 0x0208,
8492   kTextEncodingISOLatin5 = 0x0209,
8493   kTextEncodingISOLatin6 = 0x020A,
8494   kTextEncodingISOLatin7 = 0x020D,
8495   kTextEncodingISOLatin8 = 0x020E,
8496   kTextEncodingISOLatin9 = 0x020F
8497 };
8498
8499
8500 enum {
8501   kTextEncodingDOSLatinUS = 0x0400,
8502   kTextEncodingDOSGreek = 0x0405,
8503   kTextEncodingDOSBalticRim = 0x0406,
8504   kTextEncodingDOSLatin1 = 0x0410,
8505   kTextEncodingDOSGreek1 = 0x0411,
8506   kTextEncodingDOSLatin2 = 0x0412,
8507   kTextEncodingDOSCyrillic = 0x0413,
8508   kTextEncodingDOSTurkish = 0x0414,
8509   kTextEncodingDOSPortuguese = 0x0415,
8510   kTextEncodingDOSIcelandic = 0x0416,
8511   kTextEncodingDOSHebrew = 0x0417,
8512   kTextEncodingDOSCanadianFrench = 0x0418,
8513   kTextEncodingDOSArabic = 0x0419,
8514   kTextEncodingDOSNordic = 0x041A,
8515   kTextEncodingDOSRussian = 0x041B,
8516   kTextEncodingDOSGreek2 = 0x041C,
8517   kTextEncodingDOSThai = 0x041D,
8518   kTextEncodingDOSJapanese = 0x0420,
8519   kTextEncodingDOSChineseSimplif = 0x0421,
8520   kTextEncodingDOSKorean = 0x0422,
8521   kTextEncodingDOSChineseTrad = 0x0423,
8522   kTextEncodingWindowsLatin1 = 0x0500,
8523   kTextEncodingWindowsANSI = 0x0500,
8524   kTextEncodingWindowsLatin2 = 0x0501,
8525   kTextEncodingWindowsCyrillic = 0x0502,
8526   kTextEncodingWindowsGreek = 0x0503,
8527   kTextEncodingWindowsLatin5 = 0x0504,
8528   kTextEncodingWindowsHebrew = 0x0505,
8529   kTextEncodingWindowsArabic = 0x0506,
8530   kTextEncodingWindowsBalticRim = 0x0507,
8531   kTextEncodingWindowsVietnamese = 0x0508,
8532   kTextEncodingWindowsKoreanJohab = 0x0510
8533 };
8534
8535
8536 enum {
8537   kTextEncodingUS_ASCII = 0x0600,
8538   kTextEncodingJIS_X0201_76 = 0x0620,
8539   kTextEncodingJIS_X0208_83 = 0x0621,
8540   kTextEncodingJIS_X0208_90 = 0x0622,
8541   kTextEncodingJIS_X0212_90 = 0x0623,
8542   kTextEncodingJIS_C6226_78 = 0x0624,
8543   kTextEncodingShiftJIS_X0213_00 = 0x0628,
8544   kTextEncodingGB_2312_80 = 0x0630,
8545   kTextEncodingGBK_95 = 0x0631,
8546   kTextEncodingGB_18030_2000 = 0x0632,
8547   kTextEncodingKSC_5601_87 = 0x0640,
8548   kTextEncodingKSC_5601_92_Johab = 0x0641,
8549   kTextEncodingCNS_11643_92_P1 = 0x0651,
8550   kTextEncodingCNS_11643_92_P2 = 0x0652,
8551   kTextEncodingCNS_11643_92_P3 = 0x0653
8552 };
8553
8554
8555 enum {
8556   kTextEncodingISO_2022_JP = 0x0820,
8557   kTextEncodingISO_2022_JP_2 = 0x0821,
8558   kTextEncodingISO_2022_JP_1 = 0x0822,
8559   kTextEncodingISO_2022_JP_3 = 0x0823,
8560   kTextEncodingISO_2022_CN = 0x0830,
8561   kTextEncodingISO_2022_CN_EXT = 0x0831,
8562   kTextEncodingISO_2022_KR = 0x0840
8563 };
8564
8565
8566 enum {
8567   kTextEncodingEUC_JP = 0x0920,
8568   kTextEncodingEUC_CN = 0x0930,
8569   kTextEncodingEUC_TW = 0x0931,
8570   kTextEncodingEUC_KR = 0x0940
8571 };
8572
8573
8574 enum {
8575   kTextEncodingShiftJIS = 0x0A01,
8576   kTextEncodingKOI8_R = 0x0A02,
8577   kTextEncodingBig5 = 0x0A03,
8578   kTextEncodingMacRomanLatin1 = 0x0A04,
8579   kTextEncodingHZ_GB_2312 = 0x0A05,
8580   kTextEncodingBig5_HKSCS_1999 = 0x0A06
8581 };
8582
8583
8584 enum {
8585   kTextEncodingNextStepLatin = 0x0B01,
8586   kTextEncodingNextStepJapanese = 0x0B02
8587 };
8588
8589
8590 enum {
8591   kTextEncodingEBCDIC_US = 0x0C01,
8592   kTextEncodingEBCDIC_CP037 = 0x0C02
8593 };
8594
8595
8596 enum {
8597   kTextEncodingMultiRun = 0x0FFF,
8598   kTextEncodingUnknown = 0xFFFF
8599 };
8600
8601
8602
8603 typedef UInt32 TextEncodingVariant;
8604
8605 enum {
8606   kTextEncodingDefaultVariant = 0
8607 };
8608
8609
8610 enum {
8611   kMacRomanDefaultVariant = 0,
8612   kMacRomanCurrencySignVariant = 1,
8613   kMacRomanEuroSignVariant = 2
8614 };
8615
8616
8617 enum {
8618   kMacCyrillicDefaultVariant = 0,
8619   kMacCyrillicCurrSignStdVariant = 1,
8620   kMacCyrillicCurrSignUkrVariant = 2,
8621   kMacCyrillicEuroSignVariant = 3
8622 };
8623
8624
8625 enum {
8626   kMacIcelandicStdDefaultVariant = 0,
8627   kMacIcelandicTTDefaultVariant = 1,
8628
8629   kMacIcelandicStdCurrSignVariant = 2,
8630   kMacIcelandicTTCurrSignVariant = 3,
8631
8632   kMacIcelandicStdEuroSignVariant = 4,
8633   kMacIcelandicTTEuroSignVariant = 5
8634 };
8635
8636
8637 enum {
8638   kMacCroatianDefaultVariant = 0,
8639   kMacCroatianCurrencySignVariant = 1,
8640   kMacCroatianEuroSignVariant = 2
8641 };
8642
8643
8644
8645 enum {
8646   kMacRomanianDefaultVariant = 0,
8647   kMacRomanianCurrencySignVariant = 1,
8648   kMacRomanianEuroSignVariant = 2
8649 };
8650
8651
8652
8653 enum {
8654   kMacJapaneseStandardVariant = 0,
8655   kMacJapaneseStdNoVerticalsVariant = 1,
8656   kMacJapaneseBasicVariant = 2,
8657   kMacJapanesePostScriptScrnVariant = 3,
8658   kMacJapanesePostScriptPrintVariant = 4,
8659   kMacJapaneseVertAtKuPlusTenVariant = 5
8660 };
8661
8662
8663 enum {
8664   kMacArabicStandardVariant = 0,
8665   kMacArabicTrueTypeVariant = 1,
8666   kMacArabicThuluthVariant = 2,
8667   kMacArabicAlBayanVariant = 3
8668 };
8669
8670
8671 enum {
8672   kMacFarsiStandardVariant = 0,
8673   kMacFarsiTrueTypeVariant = 1
8674 };
8675
8676
8677 enum {
8678   kMacHebrewStandardVariant = 0,
8679   kMacHebrewFigureSpaceVariant = 1
8680 };
8681
8682
8683 enum {
8684   kMacVT100DefaultVariant = 0,
8685   kMacVT100CurrencySignVariant = 1,
8686   kMacVT100EuroSignVariant = 2
8687 };
8688
8689
8690 enum {
8691   kUnicodeNoSubset = 0,
8692   kUnicodeCanonicalDecompVariant = 2,
8693   kUnicodeCanonicalCompVariant = 3,
8694   kUnicodeHFSPlusDecompVariant = 8,
8695   kUnicodeHFSPlusCompVariant = 9
8696 };
8697
8698
8699 enum {
8700   kBig5_BasicVariant = 0,
8701   kBig5_StandardVariant = 1,
8702   kBig5_ETenVariant = 2
8703 };
8704
8705
8706 enum {
8707   kMacRomanLatin1DefaultVariant = 0,
8708   kMacRomanLatin1StandardVariant = 2,
8709   kMacRomanLatin1TurkishVariant = 6,
8710   kMacRomanLatin1CroatianVariant = 8,
8711   kMacRomanLatin1IcelandicVariant = 11,
8712   kMacRomanLatin1RomanianVariant = 14
8713 };
8714
8715
8716 enum {
8717   kUnicodeNoCompatibilityVariant = 1,
8718   kUnicodeNoCorporateVariant = 4
8719 };
8720
8721
8722 enum {
8723   kMacRomanStandardVariant = 0,
8724   kMacIcelandicStandardVariant = 0,
8725   kMacIcelandicTrueTypeVariant = 1,
8726   kJapaneseStandardVariant = 0,
8727   kJapaneseStdNoVerticalsVariant = 1,
8728   kJapaneseBasicVariant = 2,
8729   kJapanesePostScriptScrnVariant = 3,
8730   kJapanesePostScriptPrintVariant = 4,
8731   kJapaneseVertAtKuPlusTenVariant = 5,
8732
8733   kHebrewStandardVariant = 0,
8734   kHebrewFigureSpaceVariant = 1,
8735   kUnicodeMaxDecomposedVariant = 2,
8736   kUnicodeNoComposedVariant = 3,
8737
8738
8739   kJapaneseNoOneByteKanaOption = 0x20,
8740   kJapaneseUseAsciiBackslashOption = 0x40
8741 };
8742
8743
8744 typedef UInt32 TextEncodingFormat;
8745 enum {
8746
8747   kTextEncodingDefaultFormat = 0,
8748   kUnicode16BitFormat = 0,
8749   kUnicodeUTF7Format = 1,
8750   kUnicodeUTF8Format = 2,
8751   kUnicode32BitFormat = 3
8752 };
8753
8754
8755 typedef UInt32 TextEncoding;
8756
8757 typedef UInt32 TextEncodingNameSelector;
8758 enum {
8759   kTextEncodingFullName = 0,
8760   kTextEncodingBaseName = 1,
8761   kTextEncodingVariantName = 2,
8762   kTextEncodingFormatName = 3
8763 };
8764
8765
8766 struct TextEncodingRun {
8767   ByteOffset offset;
8768   TextEncoding textEncoding;
8769 };
8770 typedef struct TextEncodingRun TextEncodingRun;
8771 typedef TextEncodingRun * TextEncodingRunPtr;
8772 typedef const TextEncodingRun * ConstTextEncodingRunPtr;
8773 struct ScriptCodeRun {
8774   ByteOffset offset;
8775   ScriptCode script;
8776 };
8777 typedef struct ScriptCodeRun ScriptCodeRun;
8778 typedef ScriptCodeRun * ScriptCodeRunPtr;
8779 typedef const ScriptCodeRun * ConstScriptCodeRunPtr;
8780 typedef UInt8 * TextPtr;
8781 typedef const UInt8 * ConstTextPtr;
8782
8783 typedef UniChar * UniCharArrayPtr;
8784 typedef const UniChar * ConstUniCharArrayPtr;
8785
8786
8787
8788
8789 typedef UniCharArrayPtr * UniCharArrayHandle;
8790
8791
8792
8793
8794 typedef UInt32 UniCharArrayOffset;
8795
8796 enum {
8797   kTextScriptDontCare = -128,
8798   kTextLanguageDontCare = -128,
8799   kTextRegionDontCare = -128
8800 };
8801
8802
8803
8804 struct TECInfo {
8805   UInt16 format;
8806   UInt16 tecVersion;
8807   UInt32 tecTextConverterFeatures;
8808   UInt32 tecUnicodeConverterFeatures;
8809   UInt32 tecTextCommonFeatures;
8810   Str31 tecTextEncodingsFolderName;
8811   Str31 tecExtensionFileName;
8812   UInt16 tecLowestTEFileVersion;
8813   UInt16 tecHighestTEFileVersion;
8814 };
8815 typedef struct TECInfo TECInfo;
8816 typedef TECInfo * TECInfoPtr;
8817 typedef TECInfoPtr * TECInfoHandle;
8818
8819 enum {
8820   kTECInfoCurrentFormat = 2
8821 };
8822 enum {
8823   kTECKeepInfoFixBit = 0,
8824   kTECFallbackTextLengthFixBit = 1,
8825   kTECTextRunBitClearFixBit = 2,
8826   kTECTextToUnicodeScanFixBit = 3,
8827   kTECAddForceASCIIChangesBit = 4,
8828   kTECPreferredEncodingFixBit = 5,
8829   kTECAddTextRunHeuristicsBit = 6,
8830   kTECAddFallbackInterruptBit = 7
8831 };
8832
8833 enum {
8834   kTECKeepInfoFixMask = 1L << kTECKeepInfoFixBit,
8835   kTECFallbackTextLengthFixMask = 1L << kTECFallbackTextLengthFixBit,
8836   kTECTextRunBitClearFixMask = 1L << kTECTextRunBitClearFixBit,
8837   kTECTextToUnicodeScanFixMask = 1L << kTECTextToUnicodeScanFixBit,
8838   kTECAddForceASCIIChangesMask = 1L << kTECAddForceASCIIChangesBit,
8839   kTECPreferredEncodingFixMask = 1L << kTECPreferredEncodingFixBit,
8840   kTECAddTextRunHeuristicsMask = 1L << kTECAddTextRunHeuristicsBit,
8841   kTECAddFallbackInterruptMask = 1L << kTECAddFallbackInterruptBit
8842 };
8843
8844
8845
8846
8847
8848
8849
8850 enum {
8851   kUnicodeByteOrderMark = 0xFEFF,
8852   kUnicodeObjectReplacement = 0xFFFC,
8853   kUnicodeReplacementChar = 0xFFFD,
8854   kUnicodeSwappedByteOrderMark = 0xFFFE,
8855   kUnicodeNotAChar = 0xFFFF
8856 };
8857
8858
8859
8860
8861
8862
8863 typedef SInt32 UCCharPropertyType;
8864 enum {
8865   kUCCharPropTypeGenlCategory = 1,
8866   kUCCharPropTypeCombiningClass = 2,
8867   kUCCharPropTypeBidiCategory = 3
8868 };
8869
8870 typedef UInt32 UCCharPropertyValue;
8871
8872 enum {
8873
8874   kUCGenlCatOtherNotAssigned = 0,
8875   kUCGenlCatOtherControl = 1,
8876   kUCGenlCatOtherFormat = 2,
8877   kUCGenlCatOtherSurrogate = 3,
8878   kUCGenlCatOtherPrivateUse = 4,
8879   kUCGenlCatMarkNonSpacing = 5,
8880   kUCGenlCatMarkSpacingCombining = 6,
8881   kUCGenlCatMarkEnclosing = 7,
8882   kUCGenlCatNumberDecimalDigit = 8,
8883   kUCGenlCatNumberLetter = 9,
8884   kUCGenlCatNumberOther = 10,
8885   kUCGenlCatSeparatorSpace = 11,
8886   kUCGenlCatSeparatorLine = 12,
8887   kUCGenlCatSeparatorParagraph = 13,
8888   kUCGenlCatLetterUppercase = 14,
8889   kUCGenlCatLetterLowercase = 15,
8890   kUCGenlCatLetterTitlecase = 16,
8891
8892   kUCGenlCatLetterModifier = 17,
8893   kUCGenlCatLetterOther = 18,
8894   kUCGenlCatPunctConnector = 20,
8895   kUCGenlCatPunctDash = 21,
8896   kUCGenlCatPunctOpen = 22,
8897   kUCGenlCatPunctClose = 23,
8898   kUCGenlCatPunctInitialQuote = 24,
8899   kUCGenlCatPunctFinalQuote = 25,
8900   kUCGenlCatPunctOther = 26,
8901   kUCGenlCatSymbolMath = 28,
8902   kUCGenlCatSymbolCurrency = 29,
8903   kUCGenlCatSymbolModifier = 30,
8904   kUCGenlCatSymbolOther = 31
8905 };
8906
8907
8908 enum {
8909   kUCBidiCatNotApplicable = 0,
8910
8911   kUCBidiCatLeftRight = 1,
8912   kUCBidiCatRightLeft = 2,
8913
8914   kUCBidiCatEuroNumber = 3,
8915   kUCBidiCatEuroNumberSeparator = 4,
8916   kUCBidiCatEuroNumberTerminator = 5,
8917   kUCBidiCatArabicNumber = 6,
8918   kUCBidiCatCommonNumberSeparator = 7,
8919
8920   kUCBidiCatBlockSeparator = 8,
8921   kUCBidiCatSegmentSeparator = 9,
8922
8923   kUCBidiCatWhitespace = 10,
8924   kUCBidiCatOtherNeutral = 11,
8925
8926   kUCBidiCatRightLeftArabic = 12,
8927   kUCBidiCatLeftRightEmbedding = 13,
8928   kUCBidiCatRightLeftEmbedding = 14,
8929   kUCBidiCatLeftRightOverride = 15,
8930   kUCBidiCatRightLeftOverride = 16,
8931   kUCBidiCatPopDirectionalFormat = 17,
8932   kUCBidiCatNonSpacingMark = 18,
8933   kUCBidiCatBoundaryNeutral = 19
8934 };
8935 extern TextEncoding
8936 CreateTextEncoding(
8937   TextEncodingBase encodingBase,
8938   TextEncodingVariant encodingVariant,
8939   TextEncodingFormat encodingFormat) ;
8940 extern TextEncodingBase
8941 GetTextEncodingBase(TextEncoding encoding) ;
8942 extern TextEncodingVariant
8943 GetTextEncodingVariant(TextEncoding encoding) ;
8944 extern TextEncodingFormat
8945 GetTextEncodingFormat(TextEncoding encoding) ;
8946 extern TextEncoding
8947 ResolveDefaultTextEncoding(TextEncoding encoding) ;
8948 extern OSStatus
8949 GetTextEncodingName(
8950   TextEncoding iEncoding,
8951   TextEncodingNameSelector iNamePartSelector,
8952   RegionCode iPreferredRegion,
8953   TextEncoding iPreferredEncoding,
8954   ByteCount iOutputBufLen,
8955   ByteCount * oNameLength,
8956   RegionCode * oActualRegion,
8957   TextEncoding * oActualEncoding,
8958   TextPtr oEncodingName) ;
8959 extern OSStatus
8960 TECGetInfo(TECInfoHandle * tecInfo) ;
8961 extern OSStatus
8962 UpgradeScriptInfoToTextEncoding(
8963   ScriptCode iTextScriptID,
8964   LangCode iTextLanguageID,
8965   RegionCode iRegionID,
8966   ConstStr255Param iTextFontname,
8967   TextEncoding * oEncoding) ;
8968 extern OSStatus
8969 RevertTextEncodingToScriptInfo(
8970   TextEncoding iEncoding,
8971   ScriptCode * oTextScriptID,
8972   LangCode * oTextLanguageID,
8973   Str255 oTextFontname) ;
8974 extern OSStatus
8975 GetTextEncodingFromScriptInfo(
8976   ScriptCode iTextScriptID,
8977   LangCode iTextLanguageID,
8978   RegionCode iTextRegionID,
8979   TextEncoding * oEncoding) ;
8980 extern OSStatus
8981 GetScriptInfoFromTextEncoding(
8982   TextEncoding iEncoding,
8983   ScriptCode * oTextScriptID,
8984   LangCode * oTextLanguageID) ;
8985 extern OSStatus
8986 NearestMacTextEncodings(
8987   TextEncoding generalEncoding,
8988   TextEncoding * bestMacEncoding,
8989   TextEncoding * alternateMacEncoding) ;
8990 extern OSStatus
8991 UCGetCharProperty(
8992   const UniChar * charPtr,
8993   UniCharCount textLength,
8994   UCCharPropertyType propType,
8995   UCCharPropertyValue * propValue) ;
8996 enum {
8997   kUCHighSurrogateRangeStart = 0xD800UL,
8998     kUCHighSurrogateRangeEnd = 0xDBFFUL,
8999     kUCLowSurrogateRangeStart = 0xDC00UL,
9000     kUCLowSurrogateRangeEnd = 0xDFFFUL
9001 };
9002 static __inline__ Boolean UCIsSurrogateHighCharacter( UniChar character ) {
9003
9004    return ( ( character & 0xFC00UL ) == kUCHighSurrogateRangeStart );
9005 }
9006
9007
9008
9009
9010
9011
9012
9013 static __inline__ Boolean UCIsSurrogateLowCharacter( UniChar character ) {
9014
9015     return ( ( character & 0xFC00UL ) == kUCLowSurrogateRangeStart );
9016 }
9017 static __inline__ UnicodeScalarValue UCGetUnicodeScalarValueForSurrogatePair( UniChar surrogateHigh, UniChar surrogateLow ) {
9018   return ( ( surrogateHigh - kUCHighSurrogateRangeStart ) << 10 ) + ( surrogateLow - kUCLowSurrogateRangeStart ) + 0x0010000UL;
9019 }
9020
9021
9022
9023
9024
9025 }
9026
9027
9028
9029
9030
9031
9032 enum {
9033   kRoutineDescriptorVersion = 7
9034 };
9035
9036
9037 enum {
9038   _MixedModeMagic = 0xAAFE
9039 };
9040
9041
9042 enum {
9043   kCurrentMixedModeStateRecord = 1
9044 };
9045
9046
9047 typedef unsigned short CallingConventionType;
9048 enum {
9049   kPascalStackBased = 0,
9050   kCStackBased = 1,
9051   kRegisterBased = 2,
9052   kD0DispatchedPascalStackBased = 8,
9053   kD1DispatchedPascalStackBased = 12,
9054   kD0DispatchedCStackBased = 9,
9055   kStackDispatchedPascalStackBased = 14,
9056   kThinkCStackBased = 5
9057 };
9058
9059
9060 typedef SInt8 ISAType;
9061 enum {
9062   kM68kISA = 0,
9063   kPowerPCISA = 1
9064 };
9065
9066 enum {
9067   kX86ISA = 2
9068 };
9069
9070
9071 typedef SInt8 RTAType;
9072 enum {
9073   kOld68kRTA = 0 << 4,
9074   kPowerPCRTA = 0 << 4,
9075   kCFM68kRTA = 1 << 4
9076 };
9077
9078 enum {
9079   kX86RTA = 2 << 4
9080 };
9081 enum {
9082   kRegisterD0 = 0,
9083   kRegisterD1 = 1,
9084   kRegisterD2 = 2,
9085   kRegisterD3 = 3,
9086   kRegisterD4 = 8,
9087   kRegisterD5 = 9,
9088   kRegisterD6 = 10,
9089   kRegisterD7 = 11,
9090   kRegisterA0 = 4,
9091   kRegisterA1 = 5,
9092   kRegisterA2 = 6,
9093   kRegisterA3 = 7,
9094   kRegisterA4 = 12,
9095   kRegisterA5 = 13,
9096   kRegisterA6 = 14,
9097   kCCRegisterCBit = 16,
9098   kCCRegisterVBit = 17,
9099   kCCRegisterZBit = 18,
9100   kCCRegisterNBit = 19,
9101   kCCRegisterXBit = 20
9102 };
9103
9104 typedef unsigned short registerSelectorType;
9105
9106 enum {
9107   kNoByteCode = 0,
9108   kOneByteCode = 1,
9109   kTwoByteCode = 2,
9110   kFourByteCode = 3
9111 };
9112
9113
9114 typedef unsigned long ProcInfoType;
9115
9116 typedef unsigned short RoutineFlagsType;
9117 enum {
9118   kProcDescriptorIsAbsolute = 0x00,
9119   kProcDescriptorIsRelative = 0x01
9120 };
9121
9122 enum {
9123   kFragmentIsPrepared = 0x00,
9124   kFragmentNeedsPreparing = 0x02
9125 };
9126
9127 enum {
9128   kUseCurrentISA = 0x00,
9129   kUseNativeISA = 0x04
9130 };
9131
9132 enum {
9133   kPassSelector = 0x00,
9134   kDontPassSelector = 0x08
9135 };
9136
9137 enum {
9138   kRoutineIsNotDispatchedDefaultRoutine = 0x00,
9139   kRoutineIsDispatchedDefaultRoutine = 0x10
9140 };
9141
9142 enum {
9143   kProcDescriptorIsProcPtr = 0x00,
9144   kProcDescriptorIsIndex = 0x20
9145 };
9146
9147 struct RoutineRecord {
9148   ProcInfoType procInfo;
9149   SInt8 reserved1;
9150   ISAType ISA;
9151   RoutineFlagsType routineFlags;
9152   ProcPtr procDescriptor;
9153   UInt32 reserved2;
9154   UInt32 selector;
9155 };
9156 typedef struct RoutineRecord RoutineRecord;
9157 typedef RoutineRecord * RoutineRecordPtr;
9158 typedef RoutineRecordPtr * RoutineRecordHandle;
9159
9160
9161 typedef UInt8 RDFlagsType;
9162 enum {
9163   kSelectorsAreNotIndexable = 0x00,
9164   kSelectorsAreIndexable = 0x01
9165 };
9166
9167
9168 struct RoutineDescriptor {
9169   UInt16 goMixedModeTrap;
9170   SInt8 version;
9171   RDFlagsType routineDescriptorFlags;
9172   UInt32 reserved1;
9173   UInt8 reserved2;
9174   UInt8 selectorInfo;
9175   UInt16 routineCount;
9176   RoutineRecord routineRecords[1];
9177 };
9178 typedef struct RoutineDescriptor RoutineDescriptor;
9179 typedef RoutineDescriptor * RoutineDescriptorPtr;
9180 typedef RoutineDescriptorPtr * RoutineDescriptorHandle;
9181
9182 struct MixedModeStateRecord {
9183   UInt32 state1;
9184   UInt32 state2;
9185   UInt32 state3;
9186   UInt32 state4;
9187 };
9188 typedef struct MixedModeStateRecord MixedModeStateRecord;
9189 enum {
9190
9191   kCallingConventionWidth = 4,
9192   kCallingConventionPhase = 0,
9193   kCallingConventionMask = 0x0F,
9194   kResultSizeWidth = 2,
9195   kResultSizePhase = kCallingConventionWidth,
9196   kResultSizeMask = 0x30,
9197   kStackParameterWidth = 2,
9198   kStackParameterPhase = (kCallingConventionWidth + kResultSizeWidth),
9199   kStackParameterMask = (long)0xFFFFFFC0,
9200   kRegisterResultLocationWidth = 5,
9201   kRegisterResultLocationPhase = (kCallingConventionWidth + kResultSizeWidth),
9202   kRegisterParameterWidth = 5,
9203   kRegisterParameterPhase = (kCallingConventionWidth + kResultSizeWidth + kRegisterResultLocationWidth),
9204   kRegisterParameterMask = 0x7FFFF800,
9205   kRegisterParameterSizePhase = 0,
9206   kRegisterParameterSizeWidth = 2,
9207   kRegisterParameterWhichPhase = kRegisterParameterSizeWidth,
9208   kRegisterParameterWhichWidth = 3,
9209   kDispatchedSelectorSizeWidth = 2,
9210   kDispatchedSelectorSizePhase = (kCallingConventionWidth + kResultSizeWidth),
9211   kDispatchedParameterPhase = (kCallingConventionWidth + kResultSizeWidth + kDispatchedSelectorSizeWidth),
9212   kSpecialCaseSelectorWidth = 6,
9213   kSpecialCaseSelectorPhase = kCallingConventionWidth,
9214   kSpecialCaseSelectorMask = 0x03F0
9215 };
9216
9217 enum {
9218   kSpecialCase = 0x000F
9219 };
9220
9221 enum {
9222
9223   kSpecialCaseHighHook = 0,
9224   kSpecialCaseCaretHook = 0,
9225   kSpecialCaseEOLHook = 1,
9226   kSpecialCaseWidthHook = 2,
9227   kSpecialCaseTextWidthHook = 2,
9228   kSpecialCaseNWidthHook = 3,
9229   kSpecialCaseDrawHook = 4,
9230   kSpecialCaseHitTestHook = 5,
9231   kSpecialCaseTEFindWord = 6,
9232   kSpecialCaseProtocolHandler = 7,
9233   kSpecialCaseSocketListener = 8,
9234   kSpecialCaseTERecalc = 9,
9235   kSpecialCaseTEDoText = 10,
9236   kSpecialCaseGNEFilterProc = 11,
9237   kSpecialCaseMBarHook = 12
9238 };
9239 extern "C" {
9240
9241
9242
9243
9244
9245
9246 enum {
9247   kCollectionDontWantTag = 0L,
9248   kCollectionDontWantId = 0L,
9249   kCollectionDontWantSize = 0L,
9250   kCollectionDontWantAttributes = 0L,
9251   kCollectionDontWantIndex = 0L,
9252   kCollectionDontWantData = 0L
9253 };
9254
9255
9256
9257 enum {
9258   kCollectionNoAttributes = 0x00000000,
9259   kCollectionAllAttributes = (long)0xFFFFFFFF,
9260   kCollectionUserAttributes = 0x0000FFFF,
9261   kCollectionDefaultAttributes = 0x40000000
9262 };
9263
9264
9265
9266
9267
9268
9269
9270 enum {
9271   kCollectionUser0Bit = 0,
9272   kCollectionUser1Bit = 1,
9273   kCollectionUser2Bit = 2,
9274   kCollectionUser3Bit = 3,
9275   kCollectionUser4Bit = 4,
9276   kCollectionUser5Bit = 5,
9277   kCollectionUser6Bit = 6,
9278   kCollectionUser7Bit = 7,
9279   kCollectionUser8Bit = 8,
9280   kCollectionUser9Bit = 9,
9281   kCollectionUser10Bit = 10,
9282   kCollectionUser11Bit = 11,
9283   kCollectionUser12Bit = 12,
9284   kCollectionUser13Bit = 13,
9285   kCollectionUser14Bit = 14,
9286   kCollectionUser15Bit = 15,
9287   kCollectionReserved0Bit = 16,
9288   kCollectionReserved1Bit = 17,
9289   kCollectionReserved2Bit = 18,
9290   kCollectionReserved3Bit = 19,
9291   kCollectionReserved4Bit = 20,
9292   kCollectionReserved5Bit = 21,
9293   kCollectionReserved6Bit = 22,
9294   kCollectionReserved7Bit = 23,
9295   kCollectionReserved8Bit = 24,
9296   kCollectionReserved9Bit = 25,
9297   kCollectionReserved10Bit = 26,
9298   kCollectionReserved11Bit = 27,
9299   kCollectionReserved12Bit = 28,
9300   kCollectionReserved13Bit = 29,
9301   kCollectionPersistenceBit = 30,
9302   kCollectionLockBit = 31
9303 };
9304
9305
9306
9307 enum {
9308   kCollectionUser0Mask = 1L << kCollectionUser0Bit,
9309   kCollectionUser1Mask = 1L << kCollectionUser1Bit,
9310   kCollectionUser2Mask = 1L << kCollectionUser2Bit,
9311   kCollectionUser3Mask = 1L << kCollectionUser3Bit,
9312   kCollectionUser4Mask = 1L << kCollectionUser4Bit,
9313   kCollectionUser5Mask = 1L << kCollectionUser5Bit,
9314   kCollectionUser6Mask = 1L << kCollectionUser6Bit,
9315   kCollectionUser7Mask = 1L << kCollectionUser7Bit,
9316   kCollectionUser8Mask = 1L << kCollectionUser8Bit,
9317   kCollectionUser9Mask = 1L << kCollectionUser9Bit,
9318   kCollectionUser10Mask = 1L << kCollectionUser10Bit,
9319   kCollectionUser11Mask = 1L << kCollectionUser11Bit,
9320   kCollectionUser12Mask = 1L << kCollectionUser12Bit,
9321   kCollectionUser13Mask = 1L << kCollectionUser13Bit,
9322   kCollectionUser14Mask = 1L << kCollectionUser14Bit,
9323   kCollectionUser15Mask = 1L << kCollectionUser15Bit,
9324   kCollectionReserved0Mask = 1L << kCollectionReserved0Bit,
9325   kCollectionReserved1Mask = 1L << kCollectionReserved1Bit,
9326   kCollectionReserved2Mask = 1L << kCollectionReserved2Bit,
9327   kCollectionReserved3Mask = 1L << kCollectionReserved3Bit,
9328   kCollectionReserved4Mask = 1L << kCollectionReserved4Bit,
9329   kCollectionReserved5Mask = 1L << kCollectionReserved5Bit,
9330   kCollectionReserved6Mask = 1L << kCollectionReserved6Bit,
9331   kCollectionReserved7Mask = 1L << kCollectionReserved7Bit,
9332   kCollectionReserved8Mask = 1L << kCollectionReserved8Bit,
9333   kCollectionReserved9Mask = 1L << kCollectionReserved9Bit,
9334   kCollectionReserved10Mask = 1L << kCollectionReserved10Bit,
9335   kCollectionReserved11Mask = 1L << kCollectionReserved11Bit,
9336   kCollectionReserved12Mask = 1L << kCollectionReserved12Bit,
9337   kCollectionReserved13Mask = 1L << kCollectionReserved13Bit,
9338   kCollectionPersistenceMask = 1L << kCollectionPersistenceBit,
9339   kCollectionLockMask = 1L << kCollectionLockBit
9340 };
9341
9342
9343
9344
9345
9346
9347 typedef struct OpaqueCollection* Collection;
9348
9349 typedef FourCharCode CollectionTag;
9350 typedef OSErr ( * CollectionFlattenProcPtr)(SInt32 size, void *data, void *refCon);
9351 typedef OSErr ( * CollectionExceptionProcPtr)(Collection c, OSErr status);
9352 typedef CollectionFlattenProcPtr CollectionFlattenUPP;
9353 typedef CollectionExceptionProcPtr CollectionExceptionUPP;
9354 extern CollectionFlattenUPP
9355 NewCollectionFlattenUPP(CollectionFlattenProcPtr userRoutine) ;
9356 extern CollectionExceptionUPP
9357 NewCollectionExceptionUPP(CollectionExceptionProcPtr userRoutine) ;
9358 extern void
9359 DisposeCollectionFlattenUPP(CollectionFlattenUPP userUPP) ;
9360 extern void
9361 DisposeCollectionExceptionUPP(CollectionExceptionUPP userUPP) ;
9362 extern OSErr
9363 InvokeCollectionFlattenUPP(
9364   SInt32 size,
9365   void * data,
9366   void * refCon,
9367   CollectionFlattenUPP userUPP) ;
9368 extern OSErr
9369 InvokeCollectionExceptionUPP(
9370   Collection c,
9371   OSErr status,
9372   CollectionExceptionUPP userUPP) ;
9373 extern Collection
9374 NewCollection(void) ;
9375 extern void
9376 DisposeCollection(Collection c) ;
9377 extern Collection
9378 CloneCollection(Collection c) ;
9379 extern SInt32
9380 CountCollectionOwners(Collection c) ;
9381 extern OSStatus
9382 RetainCollection(Collection c) ;
9383 extern OSStatus
9384 ReleaseCollection(Collection c) ;
9385 extern ItemCount
9386 GetCollectionRetainCount(Collection c) ;
9387 extern Collection
9388 CopyCollection(
9389   Collection srcCollection,
9390   Collection dstCollection) ;
9391 extern SInt32
9392 GetCollectionDefaultAttributes(Collection c) ;
9393 extern void
9394 SetCollectionDefaultAttributes(
9395   Collection c,
9396   SInt32 whichAttributes,
9397   SInt32 newAttributes) ;
9398 extern SInt32
9399 CountCollectionItems(Collection c) ;
9400 extern OSErr
9401 AddCollectionItem(
9402   Collection c,
9403   CollectionTag tag,
9404   SInt32 id,
9405   SInt32 itemSize,
9406   const void * itemData) ;
9407 extern OSErr
9408 GetCollectionItem(
9409   Collection c,
9410   CollectionTag tag,
9411   SInt32 id,
9412   SInt32 * itemSize,
9413   void * itemData) ;
9414 extern OSErr
9415 RemoveCollectionItem(
9416   Collection c,
9417   CollectionTag tag,
9418   SInt32 id) ;
9419 extern OSErr
9420 SetCollectionItemInfo(
9421   Collection c,
9422   CollectionTag tag,
9423   SInt32 id,
9424   SInt32 whichAttributes,
9425   SInt32 newAttributes) ;
9426 extern OSErr
9427 GetCollectionItemInfo(
9428   Collection c,
9429   CollectionTag tag,
9430   SInt32 id,
9431   SInt32 * index,
9432   SInt32 * itemSize,
9433   SInt32 * attributes) ;
9434 extern OSErr
9435 ReplaceIndexedCollectionItem(
9436   Collection c,
9437   SInt32 index,
9438   SInt32 itemSize,
9439   const void * itemData) ;
9440 extern OSErr
9441 GetIndexedCollectionItem(
9442   Collection c,
9443   SInt32 index,
9444   SInt32 * itemSize,
9445   void * itemData) ;
9446 extern OSErr
9447 RemoveIndexedCollectionItem(
9448   Collection c,
9449   SInt32 index) ;
9450 extern OSErr
9451 SetIndexedCollectionItemInfo(
9452   Collection c,
9453   SInt32 index,
9454   SInt32 whichAttributes,
9455   SInt32 newAttributes) ;
9456 extern OSErr
9457 GetIndexedCollectionItemInfo(
9458   Collection c,
9459   SInt32 index,
9460   CollectionTag * tag,
9461   SInt32 * id,
9462   SInt32 * itemSize,
9463   SInt32 * attributes) ;
9464 extern Boolean
9465 CollectionTagExists(
9466   Collection c,
9467   CollectionTag tag) ;
9468 extern SInt32
9469 CountCollectionTags(Collection c) ;
9470 extern OSErr
9471 GetIndexedCollectionTag(
9472   Collection c,
9473   SInt32 tagIndex,
9474   CollectionTag * tag) ;
9475 extern SInt32
9476 CountTaggedCollectionItems(
9477   Collection c,
9478   CollectionTag tag) ;
9479 extern OSErr
9480 GetTaggedCollectionItem(
9481   Collection c,
9482   CollectionTag tag,
9483   SInt32 whichItem,
9484   SInt32 * itemSize,
9485   void * itemData) ;
9486 extern OSErr
9487 GetTaggedCollectionItemInfo(
9488   Collection c,
9489   CollectionTag tag,
9490   SInt32 whichItem,
9491   SInt32 * id,
9492   SInt32 * index,
9493   SInt32 * itemSize,
9494   SInt32 * attributes) ;
9495 extern void
9496 PurgeCollection(
9497   Collection c,
9498   SInt32 whichAttributes,
9499   SInt32 matchingAttributes) ;
9500 extern void
9501 PurgeCollectionTag(
9502   Collection c,
9503   CollectionTag tag) ;
9504 extern void
9505 EmptyCollection(Collection c) ;
9506 extern OSErr
9507 FlattenCollection(
9508   Collection c,
9509   CollectionFlattenUPP flattenProc,
9510   void * refCon) ;
9511 extern OSErr
9512 FlattenPartialCollection(
9513   Collection c,
9514   CollectionFlattenUPP flattenProc,
9515   void * refCon,
9516   SInt32 whichAttributes,
9517   SInt32 matchingAttributes) ;
9518 extern OSErr
9519 UnflattenCollection(
9520   Collection c,
9521   CollectionFlattenUPP flattenProc,
9522   void * refCon) ;
9523 extern CollectionExceptionUPP
9524 GetCollectionExceptionProc(Collection c) ;
9525 extern void
9526 SetCollectionExceptionProc(
9527   Collection c,
9528   CollectionExceptionUPP exceptionProc) ;
9529 extern Collection
9530 GetNewCollection(SInt16 collectionID) ;
9531 extern OSErr
9532 AddCollectionItemHdl(
9533   Collection aCollection,
9534   CollectionTag tag,
9535   SInt32 id,
9536   Handle itemData) ;
9537 extern OSErr
9538 GetCollectionItemHdl(
9539   Collection aCollection,
9540   CollectionTag tag,
9541   SInt32 id,
9542   Handle itemData) ;
9543 extern OSErr
9544 ReplaceIndexedCollectionItemHdl(
9545   Collection aCollection,
9546   SInt32 index,
9547   Handle itemData) ;
9548 extern OSErr
9549 GetIndexedCollectionItemHdl(
9550   Collection aCollection,
9551   SInt32 index,
9552   Handle itemData) ;
9553 extern OSErr
9554 FlattenCollectionToHdl(
9555   Collection aCollection,
9556   Handle flattened) ;
9557 extern OSErr
9558 UnflattenCollectionFromHdl(
9559   Collection aCollection,
9560   Handle flattened) ;
9561 }
9562
9563
9564
9565 typedef long BigEndianLong;
9566 typedef unsigned long BigEndianUnsignedLong;
9567 typedef short BigEndianShort;
9568 typedef unsigned short BigEndianUnsignedShort;
9569 typedef Fixed BigEndianFixed;
9570 typedef UnsignedFixed BigEndianUnsignedFixed;
9571 typedef OSType BigEndianOSType;
9572
9573
9574
9575
9576
9577
9578 extern "C" {
9579
9580
9581
9582
9583 typedef OSErr ( * SelectorFunctionProcPtr)(OSType selector, long *response);
9584 typedef SelectorFunctionProcPtr SelectorFunctionUPP;
9585 extern OSErr
9586 Gestalt(
9587   OSType selector,
9588   long * response) ;
9589 extern OSErr
9590 ReplaceGestalt(
9591   OSType selector,
9592   SelectorFunctionUPP gestaltFunction,
9593   SelectorFunctionUPP * oldGestaltFunction) ;
9594 extern OSErr
9595 NewGestalt(
9596   OSType selector,
9597   SelectorFunctionUPP gestaltFunction) ;
9598 extern OSErr
9599 NewGestaltValue(
9600   OSType selector,
9601   long newValue) ;
9602 extern OSErr
9603 ReplaceGestaltValue(
9604   OSType selector,
9605   long replacementValue) ;
9606 extern OSErr
9607 SetGestaltValue(
9608   OSType selector,
9609   long newValue) ;
9610 extern OSErr
9611 DeleteGestaltValue(OSType selector) ;
9612 extern SelectorFunctionUPP
9613 NewSelectorFunctionUPP(SelectorFunctionProcPtr userRoutine) ;
9614 extern void
9615 DisposeSelectorFunctionUPP(SelectorFunctionUPP userUPP) ;
9616 extern OSErr
9617 InvokeSelectorFunctionUPP(
9618   OSType selector,
9619   long * response,
9620   SelectorFunctionUPP userUPP) ;
9621
9622
9623
9624 enum {
9625   gestaltAddressingModeAttr = 'addr',
9626   gestalt32BitAddressing = 0,
9627   gestalt32BitSysZone = 1,
9628   gestalt32BitCapable = 2
9629 };
9630
9631 enum {
9632   gestaltAFPClient = 'afps',
9633   gestaltAFPClientVersionMask = 0x0000FFFF,
9634
9635   gestaltAFPClient3_5 = 0x0001,
9636   gestaltAFPClient3_6 = 0x0002,
9637   gestaltAFPClient3_6_1 = 0x0003,
9638   gestaltAFPClient3_6_2 = 0x0004,
9639   gestaltAFPClient3_6_3 = 0x0005,
9640   gestaltAFPClient3_7 = 0x0006,
9641   gestaltAFPClient3_7_2 = 0x0007,
9642   gestaltAFPClient3_8 = 0x0008,
9643   gestaltAFPClient3_8_1 = 0x0009,
9644   gestaltAFPClient3_8_3 = 0x000A,
9645   gestaltAFPClient3_8_4 = 0x000B,
9646   gestaltAFPClientAttributeMask = (long)0xFFFF0000,
9647
9648   gestaltAFPClientCfgRsrc = 16,
9649   gestaltAFPClientSupportsIP = 29,
9650   gestaltAFPClientVMUI = 30,
9651   gestaltAFPClientMultiReq = 31
9652 };
9653
9654
9655 enum {
9656   gestaltAliasMgrAttr = 'alis',
9657   gestaltAliasMgrPresent = 0,
9658   gestaltAliasMgrSupportsRemoteAppletalk = 1,
9659   gestaltAliasMgrSupportsAOCEKeychain = 2,
9660   gestaltAliasMgrResolveAliasFileWithMountOptions = 3,
9661   gestaltAliasMgrFollowsAliasesWhenResolving = 4,
9662   gestaltAliasMgrSupportsExtendedCalls = 5,
9663   gestaltAliasMgrSupportsFSCalls = 6,
9664   gestaltAliasMgrPrefersPath = 7
9665 };
9666
9667
9668 enum {
9669   gestaltAppearanceAttr = 'appr',
9670   gestaltAppearanceExists = 0,
9671   gestaltAppearanceCompatMode = 1
9672 };
9673
9674
9675
9676
9677
9678
9679
9680 enum {
9681   gestaltAppearanceVersion = 'apvr'
9682 };
9683
9684 enum {
9685   gestaltArbitorAttr = 'arb ',
9686   gestaltSerialArbitrationExists = 0
9687 };
9688
9689 enum {
9690   gestaltAppleScriptVersion = 'ascv'
9691 };
9692
9693 enum {
9694   gestaltAppleScriptAttr = 'ascr',
9695   gestaltAppleScriptPresent = 0,
9696   gestaltAppleScriptPowerPCSupport = 1
9697 };
9698
9699 enum {
9700   gestaltATAAttr = 'ata ',
9701   gestaltATAPresent = 0
9702 };
9703
9704 enum {
9705   gestaltATalkVersion = 'atkv'
9706 };
9707
9708 enum {
9709   gestaltAppleTalkVersion = 'atlk'
9710 };
9711 enum {
9712   gestaltAUXVersion = 'a/ux'
9713 };
9714
9715 enum {
9716   gestaltMacOSCompatibilityBoxAttr = 'bbox',
9717   gestaltMacOSCompatibilityBoxPresent = 0,
9718   gestaltMacOSCompatibilityBoxHasSerial = 1,
9719   gestaltMacOSCompatibilityBoxless = 2
9720 };
9721
9722 enum {
9723   gestaltBusClkSpeed = 'bclk'
9724 };
9725
9726 enum {
9727   gestaltCloseViewAttr = 'BSDa',
9728   gestaltCloseViewEnabled = 0,
9729   gestaltCloseViewDisplayMgrFriendly = 1
9730 };
9731
9732 enum {
9733   gestaltCarbonVersion = 'cbon'
9734 };
9735
9736 enum {
9737   gestaltCFMAttr = 'cfrg',
9738   gestaltCFMPresent = 0,
9739   gestaltCFMPresentMask = 0x0001,
9740   gestaltCFM99Present = 2,
9741   gestaltCFM99PresentMask = 0x0004
9742 };
9743
9744 enum {
9745   gestaltCollectionMgrVersion = 'cltn'
9746 };
9747
9748 enum {
9749   gestaltColorMatchingAttr = 'cmta',
9750   gestaltHighLevelMatching = 0,
9751   gestaltColorMatchingLibLoaded = 1
9752 };
9753
9754 enum {
9755   gestaltColorMatchingVersion = 'cmtc',
9756   gestaltColorSync10 = 0x0100,
9757   gestaltColorSync11 = 0x0110,
9758   gestaltColorSync104 = 0x0104,
9759   gestaltColorSync105 = 0x0105,
9760   gestaltColorSync20 = 0x0200,
9761   gestaltColorSync21 = 0x0210,
9762   gestaltColorSync211 = 0x0211,
9763   gestaltColorSync212 = 0x0212,
9764   gestaltColorSync213 = 0x0213,
9765   gestaltColorSync25 = 0x0250,
9766   gestaltColorSync26 = 0x0260,
9767   gestaltColorSync261 = 0x0261,
9768   gestaltColorSync30 = 0x0300
9769 };
9770
9771 enum {
9772   gestaltControlMgrVersion = 'cmvr'
9773 };
9774
9775 enum {
9776   gestaltControlMgrAttr = 'cntl',
9777   gestaltControlMgrPresent = (1L << 0),
9778
9779
9780   gestaltControlMgrPresentBit = 0,
9781   gestaltControlMsgPresentMask = (1L << gestaltControlMgrPresentBit)
9782 };
9783
9784 enum {
9785   gestaltConnMgrAttr = 'conn',
9786   gestaltConnMgrPresent = 0,
9787   gestaltConnMgrCMSearchFix = 1,
9788   gestaltConnMgrErrorString = 2,
9789   gestaltConnMgrMultiAsyncIO = 3
9790 };
9791
9792 enum {
9793   gestaltColorPickerVersion = 'cpkr',
9794   gestaltColorPicker = 'cpkr'
9795 };
9796
9797 enum {
9798   gestaltComponentMgr = 'cpnt',
9799   gestaltComponentPlatform = 'copl'
9800 };
9801 enum {
9802   gestaltNativeCPUtype = 'cput',
9803   gestaltNativeCPUfamily = 'cpuf',
9804   gestaltCPU68000 = 0,
9805   gestaltCPU68010 = 1,
9806   gestaltCPU68020 = 2,
9807   gestaltCPU68030 = 3,
9808   gestaltCPU68040 = 4,
9809   gestaltCPU601 = 0x0101,
9810   gestaltCPU603 = 0x0103,
9811   gestaltCPU604 = 0x0104,
9812   gestaltCPU603e = 0x0106,
9813   gestaltCPU603ev = 0x0107,
9814   gestaltCPU750 = 0x0108,
9815   gestaltCPU604e = 0x0109,
9816   gestaltCPU604ev = 0x010A,
9817   gestaltCPUG4 = 0x010C,
9818   gestaltCPUG47450 = 0x0110
9819 };
9820
9821 enum {
9822   gestaltCPUApollo = 0x0111,
9823   gestaltCPU750FX = 0x0120
9824 };
9825
9826 enum {
9827
9828   gestaltCPU486 = 'i486',
9829   gestaltCPUPentium = 'i586',
9830   gestaltCPUPentiumPro = 'i5pr',
9831   gestaltCPUPentiumII = 'i5ii',
9832   gestaltCPUX86 = 'ixxx'
9833 };
9834
9835 enum {
9836   gestaltCRMAttr = 'crm ',
9837   gestaltCRMPresent = 0,
9838   gestaltCRMPersistentFix = 1,
9839   gestaltCRMToolRsrcCalls = 2
9840 };
9841
9842 enum {
9843   gestaltControlStripVersion = 'csvr'
9844 };
9845
9846 enum {
9847   gestaltCTBVersion = 'ctbv'
9848 };
9849
9850 enum {
9851   gestaltDBAccessMgrAttr = 'dbac',
9852   gestaltDBAccessMgrPresent = 0
9853 };
9854
9855 enum {
9856   gestaltDiskCacheSize = 'dcsz'
9857 };
9858
9859 enum {
9860   gestaltSDPFindVersion = 'dfnd'
9861 };
9862
9863 enum {
9864   gestaltDictionaryMgrAttr = 'dict',
9865   gestaltDictionaryMgrPresent = 0
9866 };
9867
9868 enum {
9869   gestaltDITLExtAttr = 'ditl',
9870   gestaltDITLExtPresent = 0,
9871   gestaltDITLExtSupportsIctb = 1
9872 };
9873
9874 enum {
9875   gestaltDialogMgrAttr = 'dlog',
9876   gestaltDialogMgrPresent = (1L << 0),
9877
9878
9879   gestaltDialogMgrPresentBit = 0,
9880   gestaltDialogMgrHasAquaAlertBit = 2,
9881   gestaltDialogMgrPresentMask = (1L << gestaltDialogMgrPresentBit),
9882   gestaltDialogMgrHasAquaAlertMask = (1L << gestaltDialogMgrHasAquaAlertBit),
9883   gestaltDialogMsgPresentMask = gestaltDialogMgrPresentMask
9884 };
9885
9886 enum {
9887   gestaltDesktopPicturesAttr = 'dkpx',
9888   gestaltDesktopPicturesInstalled = 0,
9889   gestaltDesktopPicturesDisplayed = 1
9890 };
9891
9892 enum {
9893   gestaltDisplayMgrVers = 'dplv'
9894 };
9895
9896 enum {
9897   gestaltDisplayMgrAttr = 'dply',
9898   gestaltDisplayMgrPresent = 0,
9899   gestaltDisplayMgrCanSwitchMirrored = 2,
9900   gestaltDisplayMgrSetDepthNotifies = 3,
9901   gestaltDisplayMgrCanConfirm = 4,
9902   gestaltDisplayMgrColorSyncAware = 5,
9903   gestaltDisplayMgrGeneratesProfiles = 6,
9904   gestaltDisplayMgrSleepNotifies = 7
9905 };
9906
9907 enum {
9908   gestaltDragMgrAttr = 'drag',
9909   gestaltDragMgrPresent = 0,
9910   gestaltDragMgrFloatingWind = 1,
9911   gestaltPPCDragLibPresent = 2,
9912   gestaltDragMgrHasImageSupport = 3,
9913   gestaltCanStartDragInFloatWindow = 4,
9914   gestaltSetDragImageUpdates = 5
9915 };
9916
9917 enum {
9918   gestaltDrawSprocketVersion = 'dspv'
9919 };
9920
9921 enum {
9922   gestaltDigitalSignatureVersion = 'dsig'
9923 };
9924
9925
9926
9927
9928
9929 enum {
9930   gestaltDTPFeatures = 'dtpf',
9931   kDTPThirdPartySupported = 0x00000004
9932 };
9933
9934
9935
9936
9937
9938
9939 enum {
9940   gestaltDTPInfo = 'dtpx'
9941 };
9942
9943 enum {
9944   gestaltEasyAccessAttr = 'easy',
9945   gestaltEasyAccessOff = 0,
9946   gestaltEasyAccessOn = 1,
9947   gestaltEasyAccessSticky = 2,
9948   gestaltEasyAccessLocked = 3
9949 };
9950
9951 enum {
9952   gestaltEditionMgrAttr = 'edtn',
9953   gestaltEditionMgrPresent = 0,
9954   gestaltEditionMgrTranslationAware = 1
9955 };
9956
9957 enum {
9958   gestaltAppleEventsAttr = 'evnt',
9959   gestaltAppleEventsPresent = 0,
9960   gestaltScriptingSupport = 1,
9961   gestaltOSLInSystem = 2,
9962   gestaltSupportsApplicationURL = 4
9963 };
9964
9965 enum {
9966   gestaltExtensionTableVersion = 'etbl'
9967 };
9968
9969
9970 enum {
9971   gestaltFBCIndexingState = 'fbci',
9972   gestaltFBCindexingSafe = 0,
9973   gestaltFBCindexingCritical = 1
9974 };
9975
9976 enum {
9977   gestaltFBCVersion = 'fbcv',
9978   gestaltFBCCurrentVersion = 0x0011,
9979   gestaltOSXFBCCurrentVersion = 0x0100
9980 };
9981
9982
9983 enum {
9984   gestaltFileMappingAttr = 'flmp',
9985   gestaltFileMappingPresent = 0,
9986   gestaltFileMappingMultipleFilesFix = 1
9987 };
9988
9989 enum {
9990   gestaltFloppyAttr = 'flpy',
9991   gestaltFloppyIsMFMOnly = 0,
9992   gestaltFloppyIsManualEject = 1,
9993   gestaltFloppyUsesDiskInPlace = 2
9994 };
9995
9996 enum {
9997   gestaltFinderAttr = 'fndr',
9998   gestaltFinderDropEvent = 0,
9999   gestaltFinderMagicPlacement = 1,
10000   gestaltFinderCallsAEProcess = 2,
10001   gestaltOSLCompliantFinder = 3,
10002   gestaltFinderSupports4GBVolumes = 4,
10003   gestaltFinderHasClippings = 6,
10004   gestaltFinderFullDragManagerSupport = 7,
10005   gestaltFinderFloppyRootComments = 8,
10006   gestaltFinderLargeAndNotSavedFlavorsOK = 9,
10007   gestaltFinderUsesExtensibleFolderManager = 10,
10008   gestaltFinderUnderstandsRedirectedDesktopFolder = 11
10009 };
10010
10011 enum {
10012   gestaltFindFolderAttr = 'fold',
10013   gestaltFindFolderPresent = 0,
10014   gestaltFolderDescSupport = 1,
10015   gestaltFolderMgrFollowsAliasesWhenResolving = 2,
10016   gestaltFolderMgrSupportsExtendedCalls = 3,
10017   gestaltFolderMgrSupportsDomains = 4,
10018   gestaltFolderMgrSupportsFSCalls = 5
10019 };
10020
10021 enum {
10022   gestaltFindFolderRedirectionAttr = 'fole'
10023 };
10024
10025
10026 enum {
10027   gestaltFontMgrAttr = 'font',
10028   gestaltOutlineFonts = 0
10029 };
10030
10031 enum {
10032   gestaltFPUType = 'fpu ',
10033   gestaltNoFPU = 0,
10034   gestalt68881 = 1,
10035   gestalt68882 = 2,
10036   gestalt68040FPU = 3
10037 };
10038
10039 enum {
10040   gestaltFSAttr = 'fs  ',
10041   gestaltFullExtFSDispatching = 0,
10042   gestaltHasFSSpecCalls = 1,
10043   gestaltHasFileSystemManager = 2,
10044   gestaltFSMDoesDynamicLoad = 3,
10045   gestaltFSSupports4GBVols = 4,
10046   gestaltFSSupports2TBVols = 5,
10047   gestaltHasExtendedDiskInit = 6,
10048   gestaltDTMgrSupportsFSM = 7,
10049   gestaltFSNoMFSVols = 8,
10050   gestaltFSSupportsHFSPlusVols = 9,
10051   gestaltFSIncompatibleDFA82 = 10
10052 };
10053
10054 enum {
10055   gestaltFSSupportsDirectIO = 11
10056 };
10057
10058 enum {
10059   gestaltHasHFSPlusAPIs = 12,
10060   gestaltMustUseFCBAccessors = 13,
10061   gestaltFSUsesPOSIXPathsForConversion = 14,
10062   gestaltFSSupportsExclusiveLocks = 15,
10063   gestaltFSSupportsHardLinkDetection = 16
10064 };
10065
10066 enum {
10067   gestaltAdminFeaturesFlagsAttr = 'fred',
10068   gestaltFinderUsesSpecialOpenFoldersFile = 0
10069 };
10070
10071 enum {
10072   gestaltFSMVersion = 'fsm '
10073 };
10074
10075 enum {
10076   gestaltFXfrMgrAttr = 'fxfr',
10077   gestaltFXfrMgrPresent = 0,
10078   gestaltFXfrMgrMultiFile = 1,
10079   gestaltFXfrMgrErrorString = 2,
10080   gestaltFXfrMgrAsync = 3
10081 };
10082
10083 enum {
10084   gestaltGraphicsAttr = 'gfxa',
10085   gestaltGraphicsIsDebugging = 0x00000001,
10086   gestaltGraphicsIsLoaded = 0x00000002,
10087   gestaltGraphicsIsPowerPC = 0x00000004
10088 };
10089
10090 enum {
10091   gestaltGraphicsVersion = 'grfx',
10092   gestaltCurrentGraphicsVersion = 0x00010200
10093 };
10094
10095 enum {
10096   gestaltHardwareAttr = 'hdwr',
10097   gestaltHasVIA1 = 0,
10098   gestaltHasVIA2 = 1,
10099   gestaltHasASC = 3,
10100   gestaltHasSCC = 4,
10101   gestaltHasSCSI = 7,
10102   gestaltHasSoftPowerOff = 19,
10103   gestaltHasSCSI961 = 21,
10104   gestaltHasSCSI962 = 22,
10105   gestaltHasUniversalROM = 24,
10106   gestaltHasEnhancedLtalk = 30
10107 };
10108
10109 enum {
10110   gestaltHelpMgrAttr = 'help',
10111   gestaltHelpMgrPresent = 0,
10112   gestaltHelpMgrExtensions = 1,
10113   gestaltAppleGuideIsDebug = 30,
10114   gestaltAppleGuidePresent = 31
10115 };
10116
10117 enum {
10118   gestaltHardwareVendorCode = 'hrad',
10119   gestaltHardwareVendorApple = 'Appl'
10120 };
10121
10122 enum {
10123   gestaltCompressionMgr = 'icmp'
10124 };
10125
10126 enum {
10127   gestaltIconUtilitiesAttr = 'icon',
10128   gestaltIconUtilitiesPresent = 0,
10129   gestaltIconUtilitiesHas48PixelIcons = 1,
10130   gestaltIconUtilitiesHas32BitIcons = 2,
10131   gestaltIconUtilitiesHas8BitDeepMasks = 3,
10132   gestaltIconUtilitiesHasIconServices = 4
10133 };
10134
10135 enum {
10136   gestaltInternalDisplay = 'idsp'
10137 };
10138
10139
10140
10141
10142
10143 enum {
10144   gestaltKeyboardType = 'kbd ',
10145   gestaltMacKbd = 1,
10146   gestaltMacAndPad = 2,
10147   gestaltMacPlusKbd = 3,
10148   gestaltExtADBKbd = 4,
10149   gestaltStdADBKbd = 5,
10150   gestaltPrtblADBKbd = 6,
10151   gestaltPrtblISOKbd = 7,
10152   gestaltStdISOADBKbd = 8,
10153   gestaltExtISOADBKbd = 9,
10154   gestaltADBKbdII = 10,
10155   gestaltADBISOKbdII = 11,
10156   gestaltPwrBookADBKbd = 12,
10157   gestaltPwrBookISOADBKbd = 13,
10158   gestaltAppleAdjustKeypad = 14,
10159   gestaltAppleAdjustADBKbd = 15,
10160   gestaltAppleAdjustISOKbd = 16,
10161   gestaltJapanAdjustADBKbd = 17,
10162   gestaltPwrBkExtISOKbd = 20,
10163   gestaltPwrBkExtJISKbd = 21,
10164   gestaltPwrBkExtADBKbd = 24,
10165   gestaltPS2Keyboard = 27,
10166   gestaltPwrBkSubDomKbd = 28,
10167   gestaltPwrBkSubISOKbd = 29,
10168   gestaltPwrBkSubJISKbd = 30,
10169   gestaltPwrBkEKDomKbd = 195,
10170   gestaltPwrBkEKISOKbd = 196,
10171   gestaltPwrBkEKJISKbd = 197,
10172   gestaltUSBCosmoANSIKbd = 198,
10173   gestaltUSBCosmoISOKbd = 199,
10174   gestaltUSBCosmoJISKbd = 200,
10175   gestaltPwrBk99JISKbd = 201,
10176   gestaltUSBAndyANSIKbd = 204,
10177   gestaltUSBAndyISOKbd = 205,
10178   gestaltUSBAndyJISKbd = 206
10179 };
10180
10181
10182 enum {
10183   gestaltPortable2001ANSIKbd = 202,
10184   gestaltPortable2001ISOKbd = 203,
10185   gestaltPortable2001JISKbd = 207
10186 };
10187
10188
10189
10190
10191
10192 enum {
10193   gestaltUDFSupport = 'kudf'
10194 };
10195
10196 enum {
10197   gestaltLowMemorySize = 'lmem'
10198 };
10199
10200 enum {
10201   gestaltLogicalRAMSize = 'lram'
10202 };
10203 enum {
10204   gestaltMachineType = 'mach',
10205   gestaltClassic = 1,
10206   gestaltMacXL = 2,
10207   gestaltMac512KE = 3,
10208   gestaltMacPlus = 4,
10209   gestaltMacSE = 5,
10210   gestaltMacII = 6,
10211   gestaltMacIIx = 7,
10212   gestaltMacIIcx = 8,
10213   gestaltMacSE030 = 9,
10214   gestaltPortable = 10,
10215   gestaltMacIIci = 11,
10216   gestaltPowerMac8100_120 = 12,
10217   gestaltMacIIfx = 13,
10218   gestaltMacClassic = 17,
10219   gestaltMacIIsi = 18,
10220   gestaltMacLC = 19,
10221   gestaltMacQuadra900 = 20,
10222   gestaltPowerBook170 = 21,
10223   gestaltMacQuadra700 = 22,
10224   gestaltClassicII = 23,
10225   gestaltPowerBook100 = 24,
10226   gestaltPowerBook140 = 25,
10227   gestaltMacQuadra950 = 26,
10228   gestaltMacLCIII = 27,
10229   gestaltPerforma450 = gestaltMacLCIII,
10230   gestaltPowerBookDuo210 = 29,
10231   gestaltMacCentris650 = 30,
10232   gestaltPowerBookDuo230 = 32,
10233   gestaltPowerBook180 = 33,
10234   gestaltPowerBook160 = 34,
10235   gestaltMacQuadra800 = 35,
10236   gestaltMacQuadra650 = 36,
10237   gestaltMacLCII = 37,
10238   gestaltPowerBookDuo250 = 38,
10239   gestaltAWS9150_80 = 39,
10240   gestaltPowerMac8100_110 = 40,
10241   gestaltAWS8150_110 = gestaltPowerMac8100_110,
10242   gestaltPowerMac5200 = 41,
10243   gestaltPowerMac5260 = gestaltPowerMac5200,
10244   gestaltPerforma5300 = gestaltPowerMac5200,
10245   gestaltPowerMac6200 = 42,
10246   gestaltPerforma6300 = gestaltPowerMac6200,
10247   gestaltMacIIvi = 44,
10248   gestaltMacIIvm = 45,
10249   gestaltPerforma600 = gestaltMacIIvm,
10250   gestaltPowerMac7100_80 = 47,
10251   gestaltMacIIvx = 48,
10252   gestaltMacColorClassic = 49,
10253   gestaltPerforma250 = gestaltMacColorClassic,
10254   gestaltPowerBook165c = 50,
10255   gestaltMacCentris610 = 52,
10256   gestaltMacQuadra610 = 53,
10257   gestaltPowerBook145 = 54,
10258   gestaltPowerMac8100_100 = 55,
10259   gestaltMacLC520 = 56,
10260   gestaltAWS9150_120 = 57,
10261   gestaltPowerMac6400 = 58,
10262   gestaltPerforma6400 = gestaltPowerMac6400,
10263   gestaltPerforma6360 = gestaltPerforma6400,
10264   gestaltMacCentris660AV = 60,
10265   gestaltMacQuadra660AV = gestaltMacCentris660AV,
10266   gestaltPerforma46x = 62,
10267   gestaltPowerMac8100_80 = 65,
10268   gestaltAWS8150_80 = gestaltPowerMac8100_80,
10269   gestaltPowerMac9500 = 67,
10270   gestaltPowerMac9600 = gestaltPowerMac9500,
10271   gestaltPowerMac7500 = 68,
10272   gestaltPowerMac7600 = gestaltPowerMac7500,
10273   gestaltPowerMac8500 = 69,
10274   gestaltPowerMac8600 = gestaltPowerMac8500,
10275   gestaltAWS8550 = gestaltPowerMac7500,
10276   gestaltPowerBook180c = 71,
10277   gestaltPowerBook520 = 72,
10278   gestaltPowerBook520c = gestaltPowerBook520,
10279   gestaltPowerBook540 = gestaltPowerBook520,
10280   gestaltPowerBook540c = gestaltPowerBook520,
10281   gestaltPowerMac5400 = 74,
10282   gestaltPowerMac6100_60 = 75,
10283   gestaltAWS6150_60 = gestaltPowerMac6100_60,
10284   gestaltPowerBookDuo270c = 77,
10285   gestaltMacQuadra840AV = 78,
10286   gestaltPerforma550 = 80,
10287   gestaltPowerBook165 = 84,
10288   gestaltPowerBook190 = 85,
10289   gestaltMacTV = 88,
10290   gestaltMacLC475 = 89,
10291   gestaltPerforma47x = gestaltMacLC475,
10292   gestaltMacLC575 = 92,
10293   gestaltMacQuadra605 = 94,
10294   gestaltMacQuadra630 = 98,
10295   gestaltMacLC580 = 99,
10296   gestaltPerforma580 = gestaltMacLC580,
10297   gestaltPowerMac6100_66 = 100,
10298   gestaltAWS6150_66 = gestaltPowerMac6100_66,
10299   gestaltPowerBookDuo280 = 102,
10300   gestaltPowerBookDuo280c = 103,
10301   gestaltPowerMacLC475 = 104,
10302   gestaltPowerMacPerforma47x = gestaltPowerMacLC475,
10303   gestaltPowerMacLC575 = 105,
10304   gestaltPowerMacPerforma57x = gestaltPowerMacLC575,
10305   gestaltPowerMacQuadra630 = 106,
10306   gestaltPowerMacLC630 = gestaltPowerMacQuadra630,
10307   gestaltPowerMacPerforma63x = gestaltPowerMacQuadra630,
10308   gestaltPowerMac7200 = 108,
10309   gestaltPowerMac7300 = 109,
10310   gestaltPowerMac7100_66 = 112,
10311   gestaltPowerBook150 = 115,
10312   gestaltPowerMacQuadra700 = 116,
10313   gestaltPowerMacQuadra900 = 117,
10314   gestaltPowerMacQuadra950 = 118,
10315   gestaltPowerMacCentris610 = 119,
10316   gestaltPowerMacCentris650 = 120,
10317   gestaltPowerMacQuadra610 = 121,
10318   gestaltPowerMacQuadra650 = 122,
10319   gestaltPowerMacQuadra800 = 123,
10320   gestaltPowerBookDuo2300 = 124,
10321   gestaltPowerBook500PPCUpgrade = 126,
10322   gestaltPowerBook5300 = 128,
10323   gestaltPowerBook1400 = 310,
10324   gestaltPowerBook3400 = 306,
10325   gestaltPowerBook2400 = 307,
10326   gestaltPowerBookG3Series = 312,
10327   gestaltPowerBookG3 = 313,
10328   gestaltPowerBookG3Series2 = 314,
10329   gestaltPowerMacNewWorld = 406,
10330   gestaltPowerMacG3 = 510,
10331   gestaltPowerMac5500 = 512,
10332   gestalt20thAnniversary = gestaltPowerMac5500,
10333   gestaltPowerMac6500 = 513,
10334   gestaltPowerMac4400_160 = 514,
10335   gestaltPowerMac4400 = 515,
10336   gestaltMacOSCompatibility = 1206
10337 };
10338
10339
10340 enum {
10341   gestaltQuadra605 = gestaltMacQuadra605,
10342   gestaltQuadra610 = gestaltMacQuadra610,
10343   gestaltQuadra630 = gestaltMacQuadra630,
10344   gestaltQuadra650 = gestaltMacQuadra650,
10345   gestaltQuadra660AV = gestaltMacQuadra660AV,
10346   gestaltQuadra700 = gestaltMacQuadra700,
10347   gestaltQuadra800 = gestaltMacQuadra800,
10348   gestaltQuadra840AV = gestaltMacQuadra840AV,
10349   gestaltQuadra900 = gestaltMacQuadra900,
10350   gestaltQuadra950 = gestaltMacQuadra950
10351 };
10352
10353 enum {
10354   kMachineNameStrID = -16395
10355 };
10356
10357 enum {
10358   gestaltSMPMailerVersion = 'malr'
10359 };
10360
10361 enum {
10362   gestaltMediaBay = 'mbeh',
10363   gestaltMBLegacy = 0,
10364   gestaltMBSingleBay = 1,
10365   gestaltMBMultipleBays = 2
10366 };
10367
10368 enum {
10369   gestaltMessageMgrVersion = 'mess'
10370 };
10371
10372
10373
10374 enum {
10375   gestaltMenuMgrAttr = 'menu',
10376   gestaltMenuMgrPresent = (1L << 0),
10377
10378
10379   gestaltMenuMgrPresentBit = 0,
10380   gestaltMenuMgrAquaLayoutBit = 1,
10381   gestaltMenuMgrMultipleItemsWithCommandIDBit = 2,
10382   gestaltMenuMgrRetainsIconRefBit = 3,
10383   gestaltMenuMgrSendsMenuBoundsToDefProcBit = 4,
10384   gestaltMenuMgrMoreThanFiveMenusDeepBit = 5,
10385
10386   gestaltMenuMgrPresentMask = (1L << gestaltMenuMgrPresentBit),
10387   gestaltMenuMgrAquaLayoutMask = (1L << gestaltMenuMgrAquaLayoutBit),
10388   gestaltMenuMgrMultipleItemsWithCommandIDMask = (1L << gestaltMenuMgrMultipleItemsWithCommandIDBit),
10389   gestaltMenuMgrRetainsIconRefMask = (1L << gestaltMenuMgrRetainsIconRefBit),
10390   gestaltMenuMgrSendsMenuBoundsToDefProcMask = (1L << gestaltMenuMgrSendsMenuBoundsToDefProcBit),
10391   gestaltMenuMgrMoreThanFiveMenusDeepMask = (1L << gestaltMenuMgrMoreThanFiveMenusDeepBit)
10392 };
10393
10394
10395 enum {
10396   gestaltMultipleUsersState = 'mfdr'
10397 };
10398
10399
10400 enum {
10401   gestaltMachineIcon = 'micn'
10402 };
10403
10404 enum {
10405   gestaltMiscAttr = 'misc',
10406   gestaltScrollingThrottle = 0,
10407   gestaltSquareMenuBar = 2
10408 };
10409 enum {
10410   gestaltMixedModeVersion = 'mixd'
10411 };
10412
10413 enum {
10414   gestaltMixedModeAttr = 'mixd',
10415   gestaltMixedModePowerPC = 0,
10416   gestaltPowerPCAware = 0,
10417   gestaltMixedModeCFM68K = 1,
10418   gestaltMixedModeCFM68KHasTrap = 2,
10419   gestaltMixedModeCFM68KHasState = 3
10420 };
10421
10422 enum {
10423   gestaltQuickTimeConferencing = 'mtlk'
10424 };
10425
10426 enum {
10427   gestaltMemoryMapAttr = 'mmap',
10428   gestaltMemoryMapSparse = 0
10429 };
10430
10431 enum {
10432   gestaltMMUType = 'mmu ',
10433   gestaltNoMMU = 0,
10434   gestaltAMU = 1,
10435   gestalt68851 = 2,
10436   gestalt68030MMU = 3,
10437   gestalt68040MMU = 4,
10438   gestaltEMMU1 = 5
10439 };
10440
10441 enum {
10442   gestaltUserVisibleMachineName = 'mnam'
10443 };
10444
10445 enum {
10446   gestaltMPCallableAPIsAttr = 'mpsc',
10447   gestaltMPFileManager = 0,
10448   gestaltMPDeviceManager = 1,
10449   gestaltMPTrapCalls = 2
10450 };
10451
10452 enum {
10453   gestaltStdNBPAttr = 'nlup',
10454   gestaltStdNBPPresent = 0,
10455   gestaltStdNBPSupportsAutoPosition = 1
10456 };
10457
10458 enum {
10459   gestaltNotificationMgrAttr = 'nmgr',
10460   gestaltNotificationPresent = 0
10461 };
10462
10463 enum {
10464   gestaltNameRegistryVersion = 'nreg'
10465 };
10466
10467 enum {
10468   gestaltNuBusSlotCount = 'nubs'
10469 };
10470
10471 enum {
10472   gestaltOCEToolboxVersion = 'ocet',
10473   gestaltOCETB = 0x0102,
10474   gestaltSFServer = 0x0100
10475 };
10476
10477 enum {
10478   gestaltOCEToolboxAttr = 'oceu',
10479   gestaltOCETBPresent = 0x01,
10480   gestaltOCETBAvailable = 0x02,
10481   gestaltOCESFServerAvailable = 0x04,
10482   gestaltOCETBNativeGlueAvailable = 0x10
10483 };
10484
10485 enum {
10486   gestaltOpenFirmwareInfo = 'opfw'
10487 };
10488
10489 enum {
10490   gestaltOSAttr = 'os  ',
10491   gestaltSysZoneGrowable = 0,
10492   gestaltLaunchCanReturn = 1,
10493   gestaltLaunchFullFileSpec = 2,
10494   gestaltLaunchControl = 3,
10495   gestaltTempMemSupport = 4,
10496   gestaltRealTempMemory = 5,
10497   gestaltTempMemTracked = 6,
10498   gestaltIPCSupport = 7,
10499   gestaltSysDebuggerSupport = 8,
10500   gestaltNativeProcessMgrBit = 19,
10501   gestaltAltivecRegistersSwappedCorrectlyBit = 20
10502 };
10503
10504 enum {
10505   gestaltOSTable = 'ostt'
10506 };
10507 enum {
10508   gestaltOpenTptNetworkSetup = 'otcf',
10509   gestaltOpenTptNetworkSetupLegacyImport = 0,
10510   gestaltOpenTptNetworkSetupLegacyExport = 1,
10511   gestaltOpenTptNetworkSetupSupportsMultihoming = 2
10512 };
10513
10514 enum {
10515   gestaltOpenTptNetworkSetupVersion = 'otcv'
10516 };
10517
10518
10519
10520
10521
10522
10523
10524 enum {
10525   gestaltOpenTptRemoteAccess = 'otra',
10526   gestaltOpenTptRemoteAccessPresent = 0,
10527   gestaltOpenTptRemoteAccessLoaded = 1,
10528   gestaltOpenTptRemoteAccessClientOnly = 2,
10529   gestaltOpenTptRemoteAccessPServer = 3,
10530   gestaltOpenTptRemoteAccessMPServer = 4,
10531   gestaltOpenTptPPPPresent = 5,
10532   gestaltOpenTptARAPPresent = 6
10533 };
10534
10535 enum {
10536   gestaltOpenTptRemoteAccessVersion = 'otrv'
10537 };
10538
10539
10540
10541
10542
10543 enum {
10544   gestaltOpenTptVersions = 'otvr'
10545 };
10546
10547 enum {
10548   gestaltOpenTpt = 'otan',
10549   gestaltOpenTptPresentMask = 0x00000001,
10550   gestaltOpenTptLoadedMask = 0x00000002,
10551   gestaltOpenTptAppleTalkPresentMask = 0x00000004,
10552   gestaltOpenTptAppleTalkLoadedMask = 0x00000008,
10553   gestaltOpenTptTCPPresentMask = 0x00000010,
10554   gestaltOpenTptTCPLoadedMask = 0x00000020,
10555   gestaltOpenTptIPXSPXPresentMask = 0x00000040,
10556   gestaltOpenTptIPXSPXLoadedMask = 0x00000080,
10557   gestaltOpenTptPresentBit = 0,
10558   gestaltOpenTptLoadedBit = 1,
10559   gestaltOpenTptAppleTalkPresentBit = 2,
10560   gestaltOpenTptAppleTalkLoadedBit = 3,
10561   gestaltOpenTptTCPPresentBit = 4,
10562   gestaltOpenTptTCPLoadedBit = 5,
10563   gestaltOpenTptIPXSPXPresentBit = 6,
10564   gestaltOpenTptIPXSPXLoadedBit = 7
10565 };
10566
10567
10568 enum {
10569   gestaltPCCard = 'pccd',
10570   gestaltCardServicesPresent = 0,
10571   gestaltPCCardFamilyPresent = 1,
10572   gestaltPCCardHasPowerControl = 2,
10573   gestaltPCCardSupportsCardBus = 3
10574 };
10575
10576 enum {
10577   gestaltProcClkSpeed = 'pclk'
10578 };
10579
10580 enum {
10581   gestaltPCXAttr = 'pcxg',
10582   gestaltPCXHas8and16BitFAT = 0,
10583   gestaltPCXHasProDOS = 1,
10584   gestaltPCXNewUI = 2,
10585   gestaltPCXUseICMapping = 3
10586 };
10587
10588 enum {
10589   gestaltLogicalPageSize = 'pgsz'
10590 };
10591 enum {
10592   gestaltScreenCaptureMain = 'pic1',
10593   gestaltScreenCaptureDir = 'pic2'
10594 };
10595
10596 enum {
10597   gestaltGXPrintingMgrVersion = 'pmgr'
10598 };
10599
10600 enum {
10601   gestaltPopupAttr = 'pop!',
10602   gestaltPopupPresent = 0
10603 };
10604
10605 enum {
10606   gestaltPowerMgrAttr = 'powr',
10607   gestaltPMgrExists = 0,
10608   gestaltPMgrCPUIdle = 1,
10609   gestaltPMgrSCC = 2,
10610   gestaltPMgrSound = 3,
10611   gestaltPMgrDispatchExists = 4,
10612   gestaltPMgrSupportsAVPowerStateAtSleepWake = 5
10613 };
10614
10615 enum {
10616   gestaltPowerMgrVers = 'pwrv'
10617 };
10618
10619
10620
10621
10622
10623
10624
10625 enum {
10626   gestaltPPCToolboxAttr = 'ppc ',
10627   gestaltPPCToolboxPresent = 0x0000,
10628   gestaltPPCSupportsRealTime = 0x1000,
10629   gestaltPPCSupportsIncoming = 0x0001,
10630   gestaltPPCSupportsOutGoing = 0x0002,
10631   gestaltPPCSupportsTCP_IP = 0x0004,
10632   gestaltPPCSupportsIncomingAppleTalk = 0x0010,
10633   gestaltPPCSupportsIncomingTCP_IP = 0x0020,
10634   gestaltPPCSupportsOutgoingAppleTalk = 0x0100,
10635   gestaltPPCSupportsOutgoingTCP_IP = 0x0200
10636 };
10637
10638 enum {
10639   gestaltPowerPCProcessorFeatures = 'ppcf',
10640   gestaltPowerPCHasGraphicsInstructions = 0,
10641   gestaltPowerPCHasSTFIWXInstruction = 1,
10642   gestaltPowerPCHasSquareRootInstructions = 2,
10643   gestaltPowerPCHasDCBAInstruction = 3,
10644   gestaltPowerPCHasVectorInstructions = 4,
10645   gestaltPowerPCHasDataStreams = 5
10646 };
10647
10648 enum {
10649   gestaltProcessorType = 'proc',
10650   gestalt68000 = 1,
10651   gestalt68010 = 2,
10652   gestalt68020 = 3,
10653   gestalt68030 = 4,
10654   gestalt68040 = 5
10655 };
10656
10657 enum {
10658   gestaltSDPPromptVersion = 'prpv'
10659 };
10660
10661 enum {
10662   gestaltParityAttr = 'prty',
10663   gestaltHasParityCapability = 0,
10664   gestaltParityEnabled = 1
10665 };
10666
10667 enum {
10668   gestaltQD3DVersion = 'q3v '
10669 };
10670
10671 enum {
10672   gestaltQD3DViewer = 'q3vc',
10673   gestaltQD3DViewerPresent = 0
10674 };
10675 enum {
10676   gestaltQuickdrawVersion = 'qd  ',
10677   gestaltOriginalQD = 0x0000,
10678   gestalt8BitQD = 0x0100,
10679   gestalt32BitQD = 0x0200,
10680   gestalt32BitQD11 = 0x0201,
10681   gestalt32BitQD12 = 0x0220,
10682   gestalt32BitQD13 = 0x0230,
10683   gestaltAllegroQD = 0x0250,
10684   gestaltMacOSXQD = 0x0300
10685 };
10686
10687 enum {
10688   gestaltQD3D = 'qd3d',
10689   gestaltQD3DPresent = 0
10690 };
10691 enum {
10692   gestaltGXVersion = 'qdgx'
10693 };
10694
10695 enum {
10696   gestaltQuickdrawFeatures = 'qdrw',
10697   gestaltHasColor = 0,
10698   gestaltHasDeepGWorlds = 1,
10699   gestaltHasDirectPixMaps = 2,
10700   gestaltHasGrayishTextOr = 3,
10701   gestaltSupportsMirroring = 4,
10702   gestaltQDHasLongRowBytes = 5
10703 };
10704
10705 enum {
10706   gestaltQDTextVersion = 'qdtx',
10707   gestaltOriginalQDText = 0x0000,
10708   gestaltAllegroQDText = 0x0100,
10709   gestaltMacOSXQDText = 0x0200
10710 };
10711
10712 enum {
10713   gestaltQDTextFeatures = 'qdtf',
10714   gestaltWSIISupport = 0,
10715   gestaltSbitFontSupport = 1,
10716   gestaltAntiAliasedTextAvailable = 2,
10717   gestaltOFA2available = 3,
10718   gestaltCreatesAliasFontRsrc = 4,
10719   gestaltNativeType1FontSupport = 5,
10720   gestaltCanUseCGTextRendering = 6
10721 };
10722
10723
10724 enum {
10725   gestaltQuickTimeConferencingInfo = 'qtci'
10726 };
10727
10728 enum {
10729   gestaltQuickTimeVersion = 'qtim',
10730   gestaltQuickTime = 'qtim'
10731 };
10732
10733 enum {
10734   gestaltQuickTimeFeatures = 'qtrs',
10735   gestaltPPCQuickTimeLibPresent = 0
10736 };
10737
10738 enum {
10739   gestaltQuickTimeStreamingFeatures = 'qtsf'
10740 };
10741
10742 enum {
10743   gestaltQuickTimeStreamingVersion = 'qtst'
10744 };
10745
10746 enum {
10747   gestaltQTVRMgrAttr = 'qtvr',
10748   gestaltQTVRMgrPresent = 0,
10749   gestaltQTVRObjMoviesPresent = 1,
10750   gestaltQTVRCylinderPanosPresent = 2,
10751   gestaltQTVRCubicPanosPresent = 3
10752 };
10753
10754 enum {
10755   gestaltQTVRMgrVers = 'qtvv'
10756 };
10757
10758 enum {
10759   gestaltPhysicalRAMSize = 'ram '
10760 };
10761
10762 enum {
10763   gestaltRBVAddr = 'rbv '
10764 };
10765
10766 enum {
10767   gestaltROMSize = 'rom '
10768 };
10769
10770 enum {
10771   gestaltROMVersion = 'romv'
10772 };
10773
10774 enum {
10775   gestaltResourceMgrAttr = 'rsrc',
10776   gestaltPartialRsrcs = 0,
10777   gestaltHasResourceOverrides = 1
10778 };
10779
10780 enum {
10781   gestaltResourceMgrBugFixesAttrs = 'rmbg',
10782   gestaltRMForceSysHeapRolledIn = 0,
10783   gestaltRMFakeAppleMenuItemsRolledIn = 1,
10784   gestaltSanityCheckResourceFiles = 2,
10785   gestaltSupportsFSpResourceFileAlreadyOpenBit = 3,
10786   gestaltRMSupportsFSCalls = 4,
10787   gestaltRMTypeIndexOrderingReverse = 8
10788 };
10789
10790
10791 enum {
10792   gestaltRealtimeMgrAttr = 'rtmr',
10793   gestaltRealtimeMgrPresent = 0
10794 };
10795
10796
10797 enum {
10798   gestaltSafeOFAttr = 'safe',
10799   gestaltVMZerosPagesBit = 0,
10800   gestaltInitHeapZerosOutHeapsBit = 1,
10801   gestaltNewHandleReturnsZeroedMemoryBit = 2,
10802   gestaltNewPtrReturnsZeroedMemoryBit = 3,
10803   gestaltFileAllocationZeroedBlocksBit = 4
10804 };
10805
10806
10807 enum {
10808   gestaltSCCReadAddr = 'sccr'
10809 };
10810
10811 enum {
10812   gestaltSCCWriteAddr = 'sccw'
10813 };
10814
10815 enum {
10816   gestaltScrapMgrAttr = 'scra',
10817   gestaltScrapMgrTranslationAware = 0
10818 };
10819
10820 enum {
10821   gestaltScriptMgrVersion = 'scri'
10822 };
10823
10824 enum {
10825   gestaltScriptCount = 'scr#'
10826 };
10827
10828 enum {
10829   gestaltSCSI = 'scsi',
10830   gestaltAsyncSCSI = 0,
10831   gestaltAsyncSCSIINROM = 1,
10832   gestaltSCSISlotBoot = 2,
10833   gestaltSCSIPollSIH = 3
10834 };
10835
10836 enum {
10837   gestaltControlStripAttr = 'sdev',
10838   gestaltControlStripExists = 0,
10839   gestaltControlStripVersionFixed = 1,
10840   gestaltControlStripUserFont = 2,
10841   gestaltControlStripUserHotKey = 3
10842 };
10843
10844 enum {
10845   gestaltSDPStandardDirectoryVersion = 'sdvr'
10846 };
10847
10848 enum {
10849   gestaltSerialAttr = 'ser ',
10850   gestaltHasGPIaToDCDa = 0,
10851   gestaltHasGPIaToRTxCa = 1,
10852   gestaltHasGPIbToDCDb = 2,
10853   gestaltHidePortA = 3,
10854   gestaltHidePortB = 4,
10855   gestaltPortADisabled = 5,
10856   gestaltPortBDisabled = 6
10857 };
10858
10859 enum {
10860   gestaltShutdownAttributes = 'shut',
10861   gestaltShutdownHassdOnBootVolUnmount = 0
10862 };
10863
10864 enum {
10865   gestaltNuBusConnectors = 'sltc'
10866 };
10867
10868 enum {
10869   gestaltSlotAttr = 'slot',
10870   gestaltSlotMgrExists = 0,
10871   gestaltNuBusPresent = 1,
10872   gestaltSESlotPresent = 2,
10873   gestaltSE30SlotPresent = 3,
10874   gestaltPortableSlotPresent = 4
10875 };
10876
10877 enum {
10878   gestaltFirstSlotNumber = 'slt1'
10879 };
10880
10881 enum {
10882   gestaltSoundAttr = 'snd ',
10883   gestaltStereoCapability = 0,
10884   gestaltStereoMixing = 1,
10885   gestaltSoundIOMgrPresent = 3,
10886   gestaltBuiltInSoundInput = 4,
10887   gestaltHasSoundInputDevice = 5,
10888   gestaltPlayAndRecord = 6,
10889   gestalt16BitSoundIO = 7,
10890   gestaltStereoInput = 8,
10891   gestaltLineLevelInput = 9,
10892
10893   gestaltSndPlayDoubleBuffer = 10,
10894   gestaltMultiChannels = 11,
10895   gestalt16BitAudioSupport = 12
10896 };
10897
10898 enum {
10899   gestaltSplitOSAttr = 'spos',
10900   gestaltSplitOSBootDriveIsNetworkVolume = 0,
10901   gestaltSplitOSAware = 1,
10902   gestaltSplitOSEnablerVolumeIsDifferentFromBootVolume = 2,
10903   gestaltSplitOSMachineNameSetToNetworkNameTemp = 3,
10904   gestaltSplitOSMachineNameStartupDiskIsNonPersistent = 5
10905 };
10906
10907 enum {
10908   gestaltSMPSPSendLetterVersion = 'spsl'
10909 };
10910
10911 enum {
10912   gestaltSpeechRecognitionAttr = 'srta',
10913   gestaltDesktopSpeechRecognition = 1,
10914   gestaltTelephoneSpeechRecognition = 2
10915 };
10916
10917 enum {
10918   gestaltSpeechRecognitionVersion = 'srtb'
10919 };
10920
10921 enum {
10922   gestaltSoftwareVendorCode = 'srad',
10923   gestaltSoftwareVendorApple = 'Appl',
10924   gestaltSoftwareVendorLicensee = 'Lcns'
10925 };
10926
10927 enum {
10928   gestaltStandardFileAttr = 'stdf',
10929   gestaltStandardFile58 = 0,
10930   gestaltStandardFileTranslationAware = 1,
10931   gestaltStandardFileHasColorIcons = 2,
10932   gestaltStandardFileUseGenericIcons = 3,
10933   gestaltStandardFileHasDynamicVolumeAllocation = 4
10934 };
10935
10936 enum {
10937   gestaltSysArchitecture = 'sysa',
10938   gestalt68k = 1,
10939   gestaltPowerPC = 2
10940 };
10941
10942 enum {
10943   gestaltIntel = 10
10944 };
10945
10946 enum {
10947   gestaltSystemUpdateVersion = 'sysu'
10948 };
10949
10950 enum {
10951   gestaltSystemVersion = 'sysv'
10952 };
10953
10954 enum {
10955   gestaltToolboxTable = 'tbtt'
10956 };
10957
10958 enum {
10959   gestaltTextEditVersion = 'te  ',
10960   gestaltTE1 = 1,
10961   gestaltTE2 = 2,
10962   gestaltTE3 = 3,
10963   gestaltTE4 = 4,
10964   gestaltTE5 = 5
10965 };
10966
10967 enum {
10968   gestaltTE6 = 6
10969 };
10970
10971 enum {
10972   gestaltTEAttr = 'teat',
10973   gestaltTEHasGetHiliteRgn = 0,
10974   gestaltTESupportsInlineInput = 1,
10975   gestaltTESupportsTextObjects = 2,
10976   gestaltTEHasWhiteBackground = 3
10977 };
10978
10979 enum {
10980   gestaltTeleMgrAttr = 'tele',
10981   gestaltTeleMgrPresent = 0,
10982   gestaltTeleMgrPowerPCSupport = 1,
10983   gestaltTeleMgrSoundStreams = 2,
10984   gestaltTeleMgrAutoAnswer = 3,
10985   gestaltTeleMgrIndHandset = 4,
10986   gestaltTeleMgrSilenceDetect = 5,
10987   gestaltTeleMgrNewTELNewSupport = 6
10988 };
10989
10990 enum {
10991   gestaltTermMgrAttr = 'term',
10992   gestaltTermMgrPresent = 0,
10993   gestaltTermMgrErrorString = 2
10994 };
10995
10996 enum {
10997   gestaltThreadMgrAttr = 'thds',
10998   gestaltThreadMgrPresent = 0,
10999   gestaltSpecificMatchSupport = 1,
11000   gestaltThreadsLibraryPresent = 2
11001 };
11002
11003 enum {
11004   gestaltTimeMgrVersion = 'tmgr',
11005   gestaltStandardTimeMgr = 1,
11006   gestaltRevisedTimeMgr = 2,
11007   gestaltExtendedTimeMgr = 3,
11008   gestaltNativeTimeMgr = 4
11009 };
11010
11011 enum {
11012   gestaltTSMTEVersion = 'tmTV',
11013   gestaltTSMTE1 = 0x0100,
11014   gestaltTSMTE15 = 0x0150,
11015   gestaltTSMTE152 = 0x0152
11016 };
11017
11018 enum {
11019   gestaltTSMTEAttr = 'tmTE',
11020   gestaltTSMTEPresent = 0,
11021   gestaltTSMTE = 0
11022 };
11023
11024 enum {
11025   gestaltAVLTreeAttr = 'tree',
11026   gestaltAVLTreePresentBit = 0,
11027   gestaltAVLTreeSupportsHandleBasedTreeBit = 1,
11028   gestaltAVLTreeSupportsTreeLockingBit = 2
11029 };
11030
11031 enum {
11032   gestaltALMAttr = 'trip',
11033   gestaltALMPresent = 0,
11034   gestaltALMHasSFGroup = 1,
11035   gestaltALMHasCFMSupport = 2,
11036   gestaltALMHasRescanNotifiers = 3
11037 };
11038
11039 enum {
11040   gestaltALMHasSFLocation = gestaltALMHasSFGroup
11041 };
11042
11043 enum {
11044   gestaltTSMgrVersion = 'tsmv',
11045   gestaltTSMgr15 = 0x0150,
11046   gestaltTSMgr20 = 0x0200
11047 };
11048
11049 enum {
11050   gestaltTSMgrAttr = 'tsma',
11051   gestaltTSMDisplayMgrAwareBit = 0,
11052   gestaltTSMdoesTSMTEBit = 1
11053 };
11054
11055 enum {
11056   gestaltSpeechAttr = 'ttsc',
11057   gestaltSpeechMgrPresent = 0,
11058   gestaltSpeechHasPPCGlue = 1
11059 };
11060
11061 enum {
11062   gestaltTVAttr = 'tv  ',
11063   gestaltHasTVTuner = 0,
11064   gestaltHasSoundFader = 1,
11065   gestaltHasHWClosedCaptioning = 2,
11066   gestaltHasIRRemote = 3,
11067   gestaltHasVidDecoderScaler = 4,
11068   gestaltHasStereoDecoder = 5,
11069   gestaltHasSerialFader = 6,
11070   gestaltHasFMTuner = 7,
11071   gestaltHasSystemIRFunction = 8,
11072   gestaltIRDisabled = 9,
11073   gestaltINeedIRPowerOffConfirm = 10,
11074   gestaltHasZoomedVideo = 11
11075 };
11076
11077
11078 enum {
11079   gestaltATSUVersion = 'uisv',
11080   gestaltOriginalATSUVersion = (1 << 16),
11081   gestaltATSUUpdate1 = (2 << 16),
11082   gestaltATSUUpdate2 = (3 << 16),
11083   gestaltATSUUpdate3 = (4 << 16),
11084   gestaltATSUUpdate4 = (5 << 16),
11085   gestaltATSUUpdate5 = (6 << 16),
11086   gestaltATSUUpdate6 = (7 << 16)
11087 };
11088
11089 enum {
11090   gestaltATSUFeatures = 'uisf',
11091   gestaltATSUTrackingFeature = 0x00000001,
11092   gestaltATSUMemoryFeature = 0x00000001,
11093   gestaltATSUFallbacksFeature = 0x00000001,
11094   gestaltATSUGlyphBoundsFeature = 0x00000001,
11095   gestaltATSULineControlFeature = 0x00000001,
11096   gestaltATSULayoutCreateAndCopyFeature = 0x00000001,
11097   gestaltATSULayoutCacheClearFeature = 0x00000001,
11098   gestaltATSUTextLocatorUsageFeature = 0x00000002,
11099   gestaltATSULowLevelOrigFeatures = 0x00000004,
11100   gestaltATSUFallbacksObjFeatures = 0x00000008,
11101   gestaltATSUIgnoreLeadingFeature = 0x00000008,
11102   gestaltATSUByCharacterClusterFeature = 0x00000010,
11103   gestaltATSUAscentDescentControlsFeature = 0x00000010,
11104   gestaltATSUHighlightInactiveTextFeature = 0x00000010,
11105   gestaltATSUPositionToCursorFeature = 0x00000010,
11106   gestaltATSUBatchBreakLinesFeature = 0x00000010,
11107   gestaltATSUTabSupportFeature = 0x00000010,
11108   gestaltATSUDirectAccess = 0x00000010
11109 };
11110
11111 enum {
11112   gestaltUSBAttr = 'usb ',
11113   gestaltUSBPresent = 0,
11114   gestaltUSBHasIsoch = 1
11115 };
11116
11117 enum {
11118   gestaltUSBVersion = 'usbv'
11119 };
11120
11121 enum {
11122   gestaltVersion = 'vers',
11123   gestaltValueImplementedVers = 5
11124 };
11125
11126 enum {
11127   gestaltVIA1Addr = 'via1'
11128 };
11129
11130 enum {
11131   gestaltVIA2Addr = 'via2'
11132 };
11133
11134 enum {
11135   gestaltVMAttr = 'vm  ',
11136   gestaltVMPresent = 0,
11137   gestaltVMHasLockMemoryForOutput = 1,
11138   gestaltVMFilemappingOn = 3,
11139   gestaltVMHasPagingControl = 4
11140 };
11141
11142 enum {
11143   gestaltVMInfoType = 'vmin',
11144
11145   gestaltVMInfoSizeStorageType = 0,
11146   gestaltVMInfoSizeType = 1,
11147   gestaltVMInfoSimpleType = 2,
11148   gestaltVMInfoNoneType = 3
11149 };
11150
11151 enum {
11152   gestaltVMBackingStoreFileRefNum = 'vmbs'
11153 };
11154
11155
11156
11157 enum {
11158   gestaltALMVers = 'walk'
11159 };
11160
11161 enum {
11162   gestaltWindowMgrAttr = 'wind',
11163   gestaltWindowMgrPresent = (1L << 0),
11164
11165
11166   gestaltWindowMgrPresentBit = 0,
11167   gestaltExtendedWindowAttributes = 1,
11168   gestaltExtendedWindowAttributesBit = 1,
11169   gestaltHasFloatingWindows = 2,
11170   gestaltHasFloatingWindowsBit = 2,
11171   gestaltHasWindowBuffering = 3,
11172   gestaltHasWindowBufferingBit = 3,
11173   gestaltWindowLiveResizeBit = 4,
11174   gestaltWindowMinimizeToDockBit = 5,
11175   gestaltHasWindowShadowsBit = 6,
11176   gestaltSheetsAreWindowModalBit = 7,
11177   gestaltFrontWindowMayBeHiddenBit = 8,
11178
11179   gestaltWindowMgrPresentMask = (1L << gestaltWindowMgrPresentBit),
11180   gestaltExtendedWindowAttributesMask = (1L << gestaltExtendedWindowAttributesBit),
11181   gestaltHasFloatingWindowsMask = (1L << gestaltHasFloatingWindowsBit),
11182   gestaltHasWindowBufferingMask = (1L << gestaltHasWindowBufferingBit),
11183   gestaltWindowLiveResizeMask = (1L << gestaltWindowLiveResizeBit),
11184   gestaltWindowMinimizeToDockMask = (1L << gestaltWindowMinimizeToDockBit),
11185   gestaltHasWindowShadowsMask = (1L << gestaltHasWindowShadowsBit),
11186   gestaltSheetsAreWindowModalMask = (1L << gestaltSheetsAreWindowModalBit),
11187   gestaltFrontWindowMayBeHiddenMask = (1L << gestaltFrontWindowMayBeHiddenBit)
11188 };
11189
11190 enum {
11191   gestaltHasSingleWindowModeBit = 8,
11192   gestaltHasSingleWindowModeMask = (1L << gestaltHasSingleWindowModeBit)
11193 };
11194 enum {
11195   gestaltTranslationAttr = 'xlat',
11196   gestaltTranslationMgrExists = 0,
11197   gestaltTranslationMgrHintOrder = 1,
11198   gestaltTranslationPPCAvail = 2,
11199   gestaltTranslationGetPathAPIAvail = 3
11200 };
11201
11202 enum {
11203   gestaltExtToolboxTable = 'xttt'
11204 };
11205
11206 enum {
11207   gestaltUSBPrinterSharingVersion = 'zak ',
11208   gestaltUSBPrinterSharingVersionMask = 0x0000FFFF,
11209   gestaltUSBPrinterSharingAttr = 'zak ',
11210   gestaltUSBPrinterSharingAttrMask = (long)0xFFFF0000,
11211   gestaltUSBPrinterSharingAttrRunning = (long)0x80000000,
11212   gestaltUSBPrinterSharingAttrBooted = 0x40000000
11213 };
11214
11215
11216 enum {
11217   gestaltWorldScriptIIVersion = 'doub',
11218   gestaltWorldScriptIIAttr = 'wsat',
11219   gestaltWSIICanPrintWithoutPrGeneralBit = 0
11220 };
11221
11222
11223
11224
11225
11226
11227 }
11228
11229
11230
11231 extern "C" {
11232
11233
11234
11235 enum {
11236   maxSize = 0x7FFFFFF0
11237 };
11238
11239 enum {
11240   defaultPhysicalEntryCount = 8
11241 };
11242
11243 enum {
11244
11245   kPageInMemory = 0,
11246   kPageOnDisk = 1,
11247   kNotPaged = 2
11248 };
11249
11250 enum {
11251
11252   k32BitHeap = 1,
11253   kNewStyleHeap = 2,
11254   kNewDebugHeap = 4
11255 };
11256
11257
11258
11259 enum {
11260   kHandleIsResourceBit = 5,
11261   kHandlePurgeableBit = 6,
11262   kHandleLockedBit = 7
11263 };
11264
11265
11266 enum {
11267   kHandleIsResourceMask = 0x20,
11268   kHandlePurgeableMask = 0x40,
11269   kHandleLockedMask = 0x80
11270 };
11271
11272
11273 typedef long ( * GrowZoneProcPtr)(Size cbNeeded);
11274 typedef void ( * PurgeProcPtr)(Handle blockToPurge);
11275 typedef void ( * UserFnProcPtr)(void * parameter);
11276 typedef GrowZoneProcPtr GrowZoneUPP;
11277 typedef PurgeProcPtr PurgeUPP;
11278 typedef UserFnProcPtr UserFnUPP;
11279 struct Zone {
11280   Ptr bkLim;
11281   Ptr purgePtr;
11282   Ptr hFstFree;
11283   long zcbFree;
11284   GrowZoneUPP gzProc;
11285   short moreMast;
11286   short flags;
11287   short cntRel;
11288   short maxRel;
11289   short cntNRel;
11290   SInt8 heapType;
11291   SInt8 unused;
11292   short cntEmpty;
11293   short cntHandles;
11294   long minCBFree;
11295   PurgeUPP purgeProc;
11296   Ptr sparePtr;
11297   Ptr allocPtr;
11298   short heapData;
11299 };
11300 typedef struct Zone Zone;
11301 typedef Zone * THz;
11302 typedef THz * THzPtr;
11303 struct MemoryBlock {
11304   void * address;
11305   unsigned long count;
11306 };
11307 typedef struct MemoryBlock MemoryBlock;
11308 struct LogicalToPhysicalTable {
11309   MemoryBlock logical;
11310   MemoryBlock physical[8];
11311 };
11312 typedef struct LogicalToPhysicalTable LogicalToPhysicalTable;
11313
11314 typedef short PageState;
11315 typedef short StatusRegisterContents;
11316 enum {
11317   kVolumeVirtualMemoryInfoVersion1 = 1
11318 };
11319
11320 struct VolumeVirtualMemoryInfo {
11321   PBVersion version;
11322   SInt16 volumeRefNum;
11323   Boolean inUse;
11324   UInt8 _fill;
11325   UInt32 vmOptions;
11326
11327 };
11328 typedef struct VolumeVirtualMemoryInfo VolumeVirtualMemoryInfo;
11329 typedef VolumeVirtualMemoryInfo * VolumeVirtualMemoryInfoPtr;
11330 extern GrowZoneUPP
11331 NewGrowZoneUPP(GrowZoneProcPtr userRoutine) ;
11332 extern PurgeUPP
11333 NewPurgeUPP(PurgeProcPtr userRoutine) ;
11334 extern UserFnUPP
11335 NewUserFnUPP(UserFnProcPtr userRoutine) ;
11336 extern void
11337 DisposeGrowZoneUPP(GrowZoneUPP userUPP) ;
11338 extern void
11339 DisposePurgeUPP(PurgeUPP userUPP) ;
11340 extern void
11341 DisposeUserFnUPP(UserFnUPP userUPP) ;
11342 extern long
11343 InvokeGrowZoneUPP(
11344   Size cbNeeded,
11345   GrowZoneUPP userUPP) ;
11346 extern void
11347 InvokePurgeUPP(
11348   Handle blockToPurge,
11349   PurgeUPP userUPP) ;
11350 extern void
11351 InvokeUserFnUPP(
11352   void * parameter,
11353   UserFnUPP userUPP) ;
11354 extern Handle
11355 GZSaveHnd(void) ;
11356 extern Ptr
11357 TopMem(void) ;
11358 extern OSErr
11359 MemError(void) ;
11360 extern Handle
11361 NewHandle(Size byteCount) ;
11362 extern Handle
11363 NewHandleClear(Size byteCount) ;
11364 extern Handle
11365 RecoverHandle(Ptr p) ;
11366 extern Ptr
11367 NewPtr(Size byteCount) ;
11368 extern Ptr
11369 NewPtrClear(Size byteCount) ;
11370 extern long
11371 MaxBlock(void) ;
11372 extern long
11373 StackSpace(void) ;
11374 extern Handle
11375 NewEmptyHandle(void) ;
11376 extern void
11377 HLock(Handle h) ;
11378 extern void
11379 HUnlock(Handle h) ;
11380 extern void
11381 HPurge(Handle h) ;
11382 extern void
11383 HNoPurge(Handle h) ;
11384 extern void
11385 HLockHi(Handle h) ;
11386 extern Handle
11387 TempNewHandle(
11388   Size logicalSize,
11389   OSErr * resultCode) ;
11390 extern Size
11391 TempMaxMem(Size * grow) ;
11392 extern long
11393 TempFreeMem(void) ;
11394 extern Size
11395 CompactMem(Size cbNeeded) ;
11396 extern void
11397 PurgeMem(Size cbNeeded) ;
11398 extern long
11399 FreeMem(void) ;
11400 extern void
11401 ReserveMem(Size cbNeeded) ;
11402 extern Size
11403 MaxMem(Size * grow) ;
11404 extern void
11405 SetGrowZone(GrowZoneUPP growZone) ;
11406 extern GrowZoneUPP
11407 GetGrowZone(void) ;
11408 extern void
11409 MoveHHi(Handle h) ;
11410 extern void
11411 DisposePtr(Ptr p) ;
11412 extern Size
11413 GetPtrSize(Ptr p) ;
11414 extern void
11415 SetPtrSize(
11416   Ptr p,
11417   Size newSize) ;
11418 extern void
11419 DisposeHandle(Handle h) ;
11420 extern void
11421 SetHandleSize(
11422   Handle h,
11423   Size newSize) ;
11424 extern Size
11425 GetHandleSize(Handle h) ;
11426 extern void
11427 ReallocateHandle(
11428   Handle h,
11429   Size byteCount) ;
11430 extern void
11431 EmptyHandle(Handle h) ;
11432 extern void
11433 HSetRBit(Handle h) ;
11434 extern void
11435 HClrRBit(Handle h) ;
11436 extern SInt8
11437 HGetState(Handle h) ;
11438 extern void
11439 HSetState(
11440   Handle h,
11441   SInt8 flags) ;
11442 extern void
11443 PurgeSpace(
11444   long * total,
11445   long * contig) ;
11446 extern long
11447 PurgeSpaceTotal(void) ;
11448 extern long
11449 PurgeSpaceContiguous(void) ;
11450 extern void
11451 BlockMove(
11452   const void * srcPtr,
11453   void * destPtr,
11454   Size byteCount) ;
11455 extern void
11456 BlockMoveData(
11457   const void * srcPtr,
11458   void * destPtr,
11459   Size byteCount) ;
11460 extern void
11461 BlockMoveUncached(
11462   const void * srcPtr,
11463   void * destPtr,
11464   Size byteCount) ;
11465 extern void
11466 BlockMoveDataUncached(
11467   const void * srcPtr,
11468   void * destPtr,
11469   Size byteCount) ;
11470 extern void
11471 BlockZero(
11472   void * destPtr,
11473   Size byteCount) ;
11474 extern void
11475 BlockZeroUncached(
11476   void * destPtr,
11477   Size byteCount) ;
11478 extern void
11479 MoreMasters(void) ;
11480 extern void
11481 MoreMasterPointers(UInt32 inCount) ;
11482 extern void
11483 TempHLock(
11484   Handle h,
11485   OSErr * resultCode) ;
11486 extern void
11487 TempHUnlock(
11488   Handle h,
11489   OSErr * resultCode) ;
11490 extern void
11491 TempDisposeHandle(
11492   Handle h,
11493   OSErr * resultCode) ;
11494 extern Ptr
11495 TempTopMem(void) ;
11496 extern OSErr
11497 HoldMemory(
11498   void * address,
11499   unsigned long count) ;
11500 extern OSErr
11501 UnholdMemory(
11502   void * address,
11503   unsigned long count) ;
11504 extern OSErr
11505 MakeMemoryResident(
11506   void * address,
11507   unsigned long count) ;
11508 extern OSErr
11509 ReleaseMemoryData(
11510   void * address,
11511   unsigned long count) ;
11512 extern OSErr
11513 MakeMemoryNonResident(
11514   void * address,
11515   unsigned long count) ;
11516 extern OSErr
11517 FlushMemory(
11518   void * address,
11519   unsigned long count) ;
11520 extern OSErr
11521 HandToHand(Handle * theHndl) ;
11522 extern OSErr
11523 PtrToXHand(
11524   const void * srcPtr,
11525   Handle dstHndl,
11526   long size) ;
11527 extern OSErr
11528 PtrToHand(
11529   const void * srcPtr,
11530   Handle * dstHndl,
11531   long size) ;
11532 extern OSErr
11533 HandAndHand(
11534   Handle hand1,
11535   Handle hand2) ;
11536 extern OSErr
11537 PtrAndHand(
11538   const void * ptr1,
11539   Handle hand2,
11540   long size) ;
11541 extern Boolean
11542 CheckAllHeaps(void) ;
11543 extern Boolean
11544 IsHeapValid(void) ;
11545 extern Boolean
11546 IsHandleValid(Handle h) ;
11547 extern Boolean
11548 IsPointerValid(Ptr p) ;
11549
11550
11551 }
11552
11553
11554
11555 extern "C" {
11556 extern SInt64
11557 S64Max(void);
11558 extern SInt64
11559 S64Min(void);
11560 extern SInt64
11561 S64Add(
11562   SInt64 left,
11563   SInt64 right);
11564 extern SInt64
11565 S64Subtract(
11566   SInt64 left,
11567   SInt64 right);
11568 extern SInt64
11569 S64Negate(SInt64 value);
11570 extern SInt64
11571 S64Multiply(
11572   SInt64 left,
11573   SInt64 right);
11574 extern SInt64
11575 S64Mod(
11576   SInt64 dividend,
11577   SInt64 divisor);
11578 extern SInt64
11579 S64Divide(
11580   SInt64 dividend,
11581   SInt64 divisor,
11582   SInt64 * remainder);
11583 extern SInt64
11584 S64Div(
11585   SInt64 dividend,
11586   SInt64 divisor);
11587 extern SInt64
11588 S64Set(SInt32 value);
11589 extern SInt64
11590 S64SetU(UInt32 value);
11591 extern SInt32
11592 S32Set(SInt64 value);
11593 extern Boolean
11594 S64And(
11595   SInt64 left,
11596   SInt64 right);
11597 extern Boolean
11598 S64Or(
11599   SInt64 left,
11600   SInt64 right);
11601 extern Boolean
11602 S64Eor(
11603   SInt64 left,
11604   SInt64 right);
11605 extern Boolean
11606 S64Not(SInt64 value);
11607 extern SInt32
11608 S64Compare(
11609   SInt64 left,
11610   SInt64 right) ;
11611 extern SInt64
11612 S64BitwiseAnd(
11613   SInt64 left,
11614   SInt64 right);
11615 extern SInt64
11616 S64BitwiseOr(
11617   SInt64 left,
11618   SInt64 right);
11619 extern SInt64
11620 S64BitwiseEor(
11621   SInt64 left,
11622   SInt64 right);
11623 extern SInt64
11624 S64BitwiseNot(SInt64 value);
11625 extern SInt64
11626 S64ShiftRight(
11627   SInt64 value,
11628   UInt32 shift);
11629 extern SInt64
11630 S64ShiftLeft(
11631   SInt64 value,
11632   UInt32 shift);
11633 extern UInt64
11634 U64Max(void);
11635 extern UInt64
11636 U64Add(
11637   UInt64 left,
11638   UInt64 right);
11639 extern UInt64
11640 U64Subtract(
11641   UInt64 left,
11642   UInt64 right);
11643 extern UInt64
11644 U64Multiply(
11645   UInt64 left,
11646   UInt64 right);
11647 extern UInt64
11648 U64Mod(
11649   UInt64 dividend,
11650   UInt64 divisor);
11651 extern UInt64
11652 U64Divide(
11653   UInt64 dividend,
11654   UInt64 divisor,
11655   UInt64 * remainder);
11656 extern UInt64
11657 U64Div(
11658   UInt64 dividend,
11659   UInt64 divisor);
11660 extern UInt64
11661 U64Set(SInt32 value);
11662 extern UInt64
11663 U64SetU(UInt32 value);
11664 extern UInt32
11665 U32SetU(UInt64 value);
11666 extern Boolean
11667 U64And(
11668   UInt64 left,
11669   UInt64 right);
11670 extern Boolean
11671 U64Or(
11672   UInt64 left,
11673   UInt64 right);
11674 extern Boolean
11675 U64Eor(
11676   UInt64 left,
11677   UInt64 right);
11678 extern Boolean
11679 U64Not(UInt64 value);
11680 extern SInt32
11681 U64Compare(
11682   UInt64 left,
11683   UInt64 right) ;
11684 extern UInt64
11685 U64BitwiseAnd(
11686   UInt64 left,
11687   UInt64 right);
11688 extern UInt64
11689 U64BitwiseOr(
11690   UInt64 left,
11691   UInt64 right);
11692 extern UInt64
11693 U64BitwiseEor(
11694   UInt64 left,
11695   UInt64 right);
11696 extern UInt64
11697 U64BitwiseNot(UInt64 value);
11698 extern UInt64
11699 U64ShiftRight(
11700   UInt64 value,
11701   UInt32 shift);
11702 extern UInt64
11703 U64ShiftLeft(
11704   UInt64 value,
11705   UInt32 shift);
11706 extern SInt64
11707 UInt64ToSInt64(UInt64 value);
11708 extern UInt64
11709 SInt64ToUInt64(SInt64 value);
11710 }
11711 extern "C" {
11712
11713
11714 typedef SInt16 ToggleResults;
11715 enum {
11716
11717   toggleUndefined = 0,
11718   toggleOK = 1,
11719   toggleBadField = 2,
11720   toggleBadDelta = 3,
11721   toggleBadChar = 4,
11722   toggleUnknown = 5,
11723   toggleBadNum = 6,
11724   toggleOutOfRange = 7,
11725   toggleErr3 = 7,
11726   toggleErr4 = 8,
11727   toggleErr5 = 9
11728 };
11729
11730 enum {
11731
11732   smallDateBit = 31,
11733   togChar12HourBit = 30,
11734   togCharZCycleBit = 29,
11735   togDelta12HourBit = 28,
11736   genCdevRangeBit = 27,
11737   validDateFields = -1,
11738   maxDateField = 10
11739 };
11740
11741 enum {
11742   eraMask = 0x0001,
11743   yearMask = 0x0002,
11744   monthMask = 0x0004,
11745   dayMask = 0x0008,
11746   hourMask = 0x0010,
11747   minuteMask = 0x0020,
11748   secondMask = 0x0040,
11749   dayOfWeekMask = 0x0080,
11750   dayOfYearMask = 0x0100,
11751   weekOfYearMask = 0x0200,
11752   pmMask = 0x0400,
11753   dateStdMask = 0x007F
11754 };
11755
11756 typedef SInt8 LongDateField;
11757 enum {
11758   eraField = 0,
11759   yearField = 1,
11760   monthField = 2,
11761   dayField = 3,
11762   hourField = 4,
11763   minuteField = 5,
11764   secondField = 6,
11765   dayOfWeekField = 7,
11766   dayOfYearField = 8,
11767   weekOfYearField = 9,
11768   pmField = 10,
11769   res1Field = 11,
11770   res2Field = 12,
11771   res3Field = 13
11772 };
11773
11774 typedef SInt8 DateForm;
11775 enum {
11776   shortDate = 0,
11777   longDate = 1,
11778   abbrevDate = 2
11779 };
11780
11781 enum {
11782
11783   fatalDateTime = 0x8000,
11784   longDateFound = 1,
11785   leftOverChars = 2,
11786   sepNotIntlSep = 4,
11787   fieldOrderNotIntl = 8,
11788   extraneousStrings = 16,
11789   tooManySeps = 32,
11790   sepNotConsistent = 64,
11791   tokenErr = 0x8100,
11792   cantReadUtilities = 0x8200,
11793   dateTimeNotFound = 0x8400,
11794   dateTimeInvalid = 0x8800
11795 };
11796
11797 typedef short StringToDateStatus;
11798 typedef StringToDateStatus String2DateStatus;
11799 struct DateCacheRecord {
11800   short hidden[256];
11801 };
11802 typedef struct DateCacheRecord DateCacheRecord;
11803 typedef DateCacheRecord * DateCachePtr;
11804 struct DateTimeRec {
11805   short year;
11806   short month;
11807   short day;
11808   short hour;
11809   short minute;
11810   short second;
11811   short dayOfWeek;
11812 };
11813 typedef struct DateTimeRec DateTimeRec;
11814
11815 typedef SInt64 LongDateTime;
11816
11817 union LongDateCvt {
11818   SInt64 c;
11819   struct {
11820     UInt32 lHigh;
11821     UInt32 lLow;
11822   } hl;
11823 };
11824 typedef union LongDateCvt LongDateCvt;
11825 union LongDateRec {
11826   struct {
11827     short era;
11828     short year;
11829     short month;
11830     short day;
11831     short hour;
11832     short minute;
11833     short second;
11834     short dayOfWeek;
11835     short dayOfYear;
11836     short weekOfYear;
11837     short pm;
11838     short res1;
11839     short res2;
11840     short res3;
11841   } ld;
11842   short list[14];
11843   struct {
11844     short eraAlt;
11845     DateTimeRec oldDate;
11846   } od;
11847 };
11848 typedef union LongDateRec LongDateRec;
11849
11850 typedef SInt8 DateDelta;
11851 struct TogglePB {
11852   long togFlags;
11853   ResType amChars;
11854   ResType pmChars;
11855   long reserved[4];
11856 };
11857 typedef struct TogglePB TogglePB;
11858 extern OSStatus
11859 UCConvertUTCDateTimeToCFAbsoluteTime(
11860   const UTCDateTime * iUTCDate,
11861   CFAbsoluteTime * oCFTime) ;
11862 extern OSStatus
11863 UCConvertSecondsToCFAbsoluteTime(
11864   UInt32 iSeconds,
11865   CFAbsoluteTime * oCFTime) ;
11866 extern OSStatus
11867 UCConvertLongDateTimeToCFAbsoluteTime(
11868   LongDateTime iLongTime,
11869   CFAbsoluteTime * oCFTime) ;
11870 extern OSStatus
11871 UCConvertCFAbsoluteTimeToUTCDateTime(
11872   CFAbsoluteTime iCFTime,
11873   UTCDateTime * oUTCDate) ;
11874 extern OSStatus
11875 UCConvertCFAbsoluteTimeToSeconds(
11876   CFAbsoluteTime iCFTime,
11877   UInt32 * oSeconds) ;
11878 extern OSStatus
11879 UCConvertCFAbsoluteTimeToLongDateTime(
11880   CFAbsoluteTime iCFTime,
11881   LongDateTime * oLongDate) ;
11882 extern void
11883 DateString(
11884   long dateTime,
11885   DateForm longFlag,
11886   Str255 result,
11887   Handle intlHandle) ;
11888 extern void
11889 TimeString(
11890   long dateTime,
11891   Boolean wantSeconds,
11892   Str255 result,
11893   Handle intlHandle) ;
11894 extern void
11895 LongDateString(
11896   const LongDateTime * dateTime,
11897   DateForm longFlag,
11898   Str255 result,
11899   Handle intlHandle) ;
11900 extern void
11901 LongTimeString(
11902   const LongDateTime * dateTime,
11903   Boolean wantSeconds,
11904   Str255 result,
11905   Handle intlHandle) ;
11906 extern OSErr
11907 InitDateCache(DateCachePtr theCache) ;
11908 extern StringToDateStatus
11909 StringToDate(
11910   Ptr textPtr,
11911   long textLen,
11912   DateCachePtr theCache,
11913   long * lengthUsed,
11914   LongDateRec * dateTime) ;
11915 extern StringToDateStatus
11916 StringToTime(
11917   Ptr textPtr,
11918   long textLen,
11919   DateCachePtr theCache,
11920   long * lengthUsed,
11921   LongDateRec * dateTime) ;
11922 extern void
11923 LongDateToSeconds(
11924   const LongDateRec * lDate,
11925   LongDateTime * lSecs) ;
11926 extern void
11927 LongSecondsToDate(
11928   const LongDateTime * lSecs,
11929   LongDateRec * lDate) ;
11930 extern ToggleResults
11931 ToggleDate(
11932   LongDateTime * lSecs,
11933   LongDateField field,
11934   DateDelta delta,
11935   short ch,
11936   const TogglePB * params) ;
11937 extern short
11938 ValidDate(
11939   const LongDateRec * vDate,
11940   long flags,
11941   LongDateTime * newSecs) ;
11942 extern OSErr
11943 ReadDateTime(unsigned long * time) ;
11944 extern void
11945 GetDateTime(unsigned long * secs) ;
11946 extern OSErr
11947 SetDateTime(unsigned long time) ;
11948 extern void
11949 SetTime(const DateTimeRec * d) ;
11950 extern void
11951 GetTime(DateTimeRec * d) ;
11952 extern void
11953 DateToSeconds(
11954   const DateTimeRec * d,
11955   unsigned long * secs) ;
11956 extern void
11957 SecondsToDate(
11958   unsigned long secs,
11959   DateTimeRec * d) ;
11960
11961
11962 }
11963 extern "C" {
11964
11965
11966
11967 enum {
11968   useFree = 0,
11969   useATalk = 1,
11970   useAsync = 2,
11971   useExtClk = 3,
11972   useMIDI = 4
11973 };
11974
11975 enum {
11976   false32b = 0,
11977   true32b = 1
11978 };
11979
11980 enum {
11981
11982   sortsBefore = -1,
11983   sortsEqual = 0,
11984   sortsAfter = 1
11985 };
11986
11987 enum {
11988   dummyType = 0,
11989   vType = 1,
11990   ioQType = 2,
11991   drvQType = 3,
11992   evType = 4,
11993   fsQType = 5,
11994   sIQType = 6,
11995   dtQType = 7,
11996   nmType = 8
11997 };
11998
11999 typedef SignedByte QTypes;
12000 struct SysParmType {
12001   UInt8 valid;
12002   UInt8 aTalkA;
12003   UInt8 aTalkB;
12004   UInt8 config;
12005   short portA;
12006   short portB;
12007   long alarm;
12008   short font;
12009   short kbdPrint;
12010   short volClik;
12011   short misc;
12012 };
12013 typedef struct SysParmType SysParmType;
12014 typedef SysParmType * SysPPtr;
12015 struct QElem {
12016   struct QElem * qLink;
12017   short qType;
12018   short qData[1];
12019 };
12020 typedef struct QElem QElem;
12021 typedef QElem * QElemPtr;
12022 struct QHdr {
12023   volatile short qFlags;
12024   volatile QElemPtr qHead;
12025   volatile QElemPtr qTail;
12026 };
12027 typedef struct QHdr QHdr;
12028 typedef QHdr * QHdrPtr;
12029 typedef void ( * DeferredTaskProcPtr)(long dtParam);
12030 typedef DeferredTaskProcPtr DeferredTaskUPP;
12031 extern DeferredTaskUPP
12032 NewDeferredTaskUPP(DeferredTaskProcPtr userRoutine) ;
12033 extern void
12034 DisposeDeferredTaskUPP(DeferredTaskUPP userUPP) ;
12035 extern void
12036 InvokeDeferredTaskUPP(
12037   long dtParam,
12038   DeferredTaskUPP userUPP) ;
12039
12040 struct DeferredTask {
12041   volatile QElemPtr qLink;
12042   short qType;
12043   volatile short dtFlags;
12044   DeferredTaskUPP dtAddr;
12045   long dtParam;
12046   long dtReserved;
12047 };
12048 typedef struct DeferredTask DeferredTask;
12049 typedef DeferredTask * DeferredTaskPtr;
12050 struct MachineLocation {
12051     Fract latitude;
12052     Fract longitude;
12053     union {
12054
12055         SInt8 dlsDelta;
12056
12057         long gmtDelta;
12058         struct {
12059
12060
12061
12062             SInt8 Delta;
12063         } dls;
12064     } u;
12065 };
12066 typedef struct MachineLocation MachineLocation;
12067 extern Boolean
12068 IsMetric(void) ;
12069 extern SysPPtr
12070 GetSysPPtr(void) ;
12071 extern OSErr
12072 DTInstall(DeferredTaskPtr dtTaskPtr) ;
12073 extern void
12074 Delay(
12075   unsigned long numTicks,
12076   unsigned long * finalTicks) ;
12077 extern OSErr
12078 WriteParam(void) ;
12079 extern void
12080 Enqueue(
12081   QElemPtr qElement,
12082   QHdrPtr qHeader) ;
12083 extern OSErr
12084 Dequeue(
12085   QElemPtr qElement,
12086   QHdrPtr qHeader) ;
12087 extern long
12088 SetCurrentA5(void) ;
12089 extern long
12090 SetA5(long newA5) ;
12091 extern OSErr
12092 InitUtil(void) ;
12093 extern void
12094 MakeDataExecutable(
12095   void * baseAddress,
12096   unsigned long length) ;
12097 extern void
12098 ReadLocation(MachineLocation * loc) ;
12099 extern void
12100 WriteLocation(const MachineLocation * loc) ;
12101 extern UInt32
12102 TickCount(void) ;
12103 extern CFStringRef
12104 CSCopyUserName(Boolean useShortName) ;
12105 extern CFStringRef
12106 CSCopyMachineName(void) ;
12107 enum {
12108   curSysEnvVers = 2
12109 };
12110
12111 struct SysEnvRec {
12112   short environsVersion;
12113   short machineType;
12114   short systemVersion;
12115   short processor;
12116   Boolean hasFPU;
12117   Boolean hasColorQD;
12118   short keyBoardType;
12119   short atDrvrVersNum;
12120   short sysVRefNum;
12121 };
12122 typedef struct SysEnvRec SysEnvRec;
12123 enum {
12124
12125   envMac = -1,
12126   envXL = -2,
12127   envMachUnknown = 0,
12128   env512KE = 1,
12129   envMacPlus = 2,
12130   envSE = 3,
12131   envMacII = 4,
12132   envMacIIx = 5,
12133   envMacIIcx = 6,
12134   envSE30 = 7,
12135   envPortable = 8,
12136   envMacIIci = 9,
12137   envMacIIfx = 11
12138 };
12139
12140 enum {
12141
12142   envCPUUnknown = 0,
12143   env68000 = 1,
12144   env68010 = 2,
12145   env68020 = 3,
12146   env68030 = 4,
12147   env68040 = 5
12148 };
12149
12150 enum {
12151
12152   envUnknownKbd = 0,
12153   envMacKbd = 1,
12154   envMacAndPad = 2,
12155   envMacPlusKbd = 3,
12156   envAExtendKbd = 4,
12157   envStandADBKbd = 5,
12158   envPrtblADBKbd = 6,
12159   envPrtblISOKbd = 7,
12160   envStdISOADBKbd = 8,
12161   envExtISOADBKbd = 9
12162 };
12163
12164
12165 }
12166 extern "C" {
12167
12168
12169
12170
12171
12172 struct HFSUniStr255 {
12173   UInt16 length;
12174   UniChar unicode[255];
12175 };
12176 typedef struct HFSUniStr255 HFSUniStr255;
12177 typedef const HFSUniStr255 * ConstHFSUniStr255Param;
12178 enum {
12179   fsCurPerm = 0x00,
12180   fsRdPerm = 0x01,
12181   fsWrPerm = 0x02,
12182   fsRdWrPerm = 0x03,
12183   fsRdWrShPerm = 0x04,
12184   fsRdDenyPerm = 0x10,
12185   fsWrDenyPerm = 0x20
12186 };
12187
12188 enum {
12189   fsRtParID = 1,
12190   fsRtDirID = 2
12191 };
12192
12193 enum {
12194   fsAtMark = 0,
12195   fsFromStart = 1,
12196   fsFromLEOF = 2,
12197   fsFromMark = 3
12198 };
12199
12200 enum {
12201
12202   pleaseCacheBit = 4,
12203   pleaseCacheMask = 0x0010,
12204   noCacheBit = 5,
12205   noCacheMask = 0x0020,
12206   rdVerifyBit = 6,
12207   rdVerifyMask = 0x0040,
12208   rdVerify = 64,
12209   forceReadBit = 6,
12210   forceReadMask = 0x0040,
12211   newLineBit = 7,
12212   newLineMask = 0x0080,
12213   newLineCharMask = 0xFF00
12214 };
12215
12216
12217 enum {
12218
12219   fsSBPartialName = 1,
12220   fsSBFullName = 2,
12221   fsSBFlAttrib = 4,
12222   fsSBFlFndrInfo = 8,
12223   fsSBFlLgLen = 32,
12224   fsSBFlPyLen = 64,
12225   fsSBFlRLgLen = 128,
12226   fsSBFlRPyLen = 256,
12227   fsSBFlCrDat = 512,
12228   fsSBFlMdDat = 1024,
12229   fsSBFlBkDat = 2048,
12230   fsSBFlXFndrInfo = 4096,
12231   fsSBFlParID = 8192,
12232   fsSBNegate = 16384,
12233   fsSBDrUsrWds = 8,
12234   fsSBDrNmFls = 16,
12235   fsSBDrCrDat = 512,
12236   fsSBDrMdDat = 1024,
12237   fsSBDrBkDat = 2048,
12238   fsSBDrFndrInfo = 4096,
12239   fsSBDrParID = 8192
12240 };
12241
12242 enum {
12243
12244   fsSBPartialNameBit = 0,
12245   fsSBFullNameBit = 1,
12246   fsSBFlAttribBit = 2,
12247   fsSBFlFndrInfoBit = 3,
12248   fsSBFlLgLenBit = 5,
12249   fsSBFlPyLenBit = 6,
12250   fsSBFlRLgLenBit = 7,
12251   fsSBFlRPyLenBit = 8,
12252   fsSBFlCrDatBit = 9,
12253   fsSBFlMdDatBit = 10,
12254   fsSBFlBkDatBit = 11,
12255   fsSBFlXFndrInfoBit = 12,
12256   fsSBFlParIDBit = 13,
12257   fsSBNegateBit = 14,
12258   fsSBDrUsrWdsBit = 3,
12259   fsSBDrNmFlsBit = 4,
12260   fsSBDrCrDatBit = 9,
12261   fsSBDrMdDatBit = 10,
12262   fsSBDrBkDatBit = 11,
12263   fsSBDrFndrInfoBit = 12,
12264   fsSBDrParIDBit = 13
12265 };
12266
12267 enum {
12268
12269   bLimitFCBs = 31,
12270   bLocalWList = 30,
12271   bNoMiniFndr = 29,
12272   bNoVNEdit = 28,
12273   bNoLclSync = 27,
12274   bTrshOffLine = 26,
12275   bNoSwitchTo = 25,
12276   bNoDeskItems = 20,
12277   bNoBootBlks = 19,
12278   bAccessCntl = 18,
12279   bNoSysDir = 17,
12280   bHasExtFSVol = 16,
12281   bHasOpenDeny = 15,
12282   bHasCopyFile = 14,
12283   bHasMoveRename = 13,
12284   bHasDesktopMgr = 12,
12285   bHasShortName = 11,
12286   bHasFolderLock = 10,
12287   bHasPersonalAccessPrivileges = 9,
12288   bHasUserGroupList = 8,
12289   bHasCatSearch = 7,
12290   bHasFileIDs = 6,
12291   bHasBTreeMgr = 5,
12292   bHasBlankAccessPrivileges = 4,
12293   bSupportsAsyncRequests = 3,
12294   bSupportsTrashVolumeCache = 2
12295 };
12296
12297 enum {
12298
12299   bHasDirectIO = 1
12300 };
12301
12302 enum {
12303
12304   bIsEjectable = 0,
12305   bSupportsHFSPlusAPIs = 1,
12306   bSupportsFSCatalogSearch = 2,
12307   bSupportsFSExchangeObjects = 3,
12308   bSupports2TBFiles = 4,
12309   bSupportsLongNames = 5,
12310   bSupportsMultiScriptNames = 6,
12311   bSupportsNamedForks = 7,
12312   bSupportsSubtreeIterators = 8,
12313   bL2PCanMapFileBlocks = 9
12314 };
12315
12316 enum {
12317
12318   bParentModDateChanges = 10,
12319   bAncestorModDateChanges = 11
12320 };
12321
12322 enum {
12323
12324   bSupportsSymbolicLinks = 13,
12325   bIsAutoMounted = 14,
12326   bAllowCDiDataHandler = 17,
12327   bSupportsExclusiveLocks = 18
12328 };
12329
12330 enum {
12331
12332   kLargeIcon = 1,
12333   kLarge4BitIcon = 2,
12334   kLarge8BitIcon = 3,
12335   kSmallIcon = 4,
12336   kSmall4BitIcon = 5,
12337   kSmall8BitIcon = 6,
12338   kicnsIconFamily = 239
12339 };
12340
12341 enum {
12342   kLargeIconSize = 256,
12343   kLarge4BitIconSize = 512,
12344   kLarge8BitIconSize = 1024,
12345   kSmallIconSize = 64,
12346   kSmall4BitIconSize = 128,
12347   kSmall8BitIconSize = 256
12348 };
12349
12350 enum {
12351
12352   kWidePosOffsetBit = 8,
12353   kUseWidePositioning = (1 << kWidePosOffsetBit),
12354   kMaximumBlocksIn4GB = 0x007FFFFF
12355 };
12356
12357 enum {
12358
12359   fsUnixPriv = 1
12360 };
12361
12362 enum {
12363
12364   kNoUserAuthentication = 1,
12365   kPassword = 2,
12366   kEncryptPassword = 3,
12367   kTwoWayEncryptPassword = 6
12368 };
12369
12370
12371
12372 enum {
12373   kOwnerID2Name = 1,
12374   kGroupID2Name = 2,
12375   kOwnerName2ID = 3,
12376   kGroupName2ID = 4,
12377   kReturnNextUser = 1,
12378   kReturnNextGroup = 2,
12379   kReturnNextUG = 3
12380 };
12381
12382
12383 enum {
12384   kVCBFlagsIdleFlushBit = 3,
12385   kVCBFlagsIdleFlushMask = 0x0008,
12386   kVCBFlagsHFSPlusAPIsBit = 4,
12387   kVCBFlagsHFSPlusAPIsMask = 0x0010,
12388   kVCBFlagsHardwareGoneBit = 5,
12389   kVCBFlagsHardwareGoneMask = 0x0020,
12390   kVCBFlagsVolumeDirtyBit = 15,
12391   kVCBFlagsVolumeDirtyMask = 0x8000
12392 };
12393
12394
12395 enum {
12396   kioVAtrbDefaultVolumeBit = 5,
12397   kioVAtrbDefaultVolumeMask = 0x0020,
12398   kioVAtrbFilesOpenBit = 6,
12399   kioVAtrbFilesOpenMask = 0x0040,
12400   kioVAtrbHardwareLockedBit = 7,
12401   kioVAtrbHardwareLockedMask = 0x0080,
12402   kioVAtrbSoftwareLockedBit = 15,
12403   kioVAtrbSoftwareLockedMask = 0x8000
12404 };
12405
12406
12407 enum {
12408
12409   kioFlAttribLockedBit = 0,
12410   kioFlAttribLockedMask = 0x01,
12411   kioFlAttribResOpenBit = 2,
12412   kioFlAttribResOpenMask = 0x04,
12413   kioFlAttribDataOpenBit = 3,
12414   kioFlAttribDataOpenMask = 0x08,
12415   kioFlAttribDirBit = 4,
12416   kioFlAttribDirMask = 0x10,
12417   ioDirFlg = 4,
12418   ioDirMask = 0x10,
12419   kioFlAttribCopyProtBit = 6,
12420   kioFlAttribCopyProtMask = 0x40,
12421   kioFlAttribFileOpenBit = 7,
12422   kioFlAttribFileOpenMask = 0x80,
12423   kioFlAttribInSharedBit = 2,
12424   kioFlAttribInSharedMask = 0x04,
12425   kioFlAttribMountedBit = 3,
12426   kioFlAttribMountedMask = 0x08,
12427   kioFlAttribSharePointBit = 5,
12428   kioFlAttribSharePointMask = 0x20
12429 };
12430
12431
12432 enum {
12433   kioFCBWriteBit = 8,
12434   kioFCBWriteMask = 0x0100,
12435   kioFCBResourceBit = 9,
12436   kioFCBResourceMask = 0x0200,
12437   kioFCBWriteLockedBit = 10,
12438   kioFCBWriteLockedMask = 0x0400,
12439   kioFCBLargeFileBit = 11,
12440   kioFCBLargeFileMask = 0x0800,
12441   kioFCBSharedWriteBit = 12,
12442   kioFCBSharedWriteMask = 0x1000,
12443   kioFCBFileLockedBit = 13,
12444   kioFCBFileLockedMask = 0x2000,
12445   kioFCBOwnClumpBit = 14,
12446   kioFCBOwnClumpMask = 0x4000,
12447   kioFCBModifiedBit = 15,
12448   kioFCBModifiedMask = 0x8000
12449 };
12450
12451
12452
12453 enum {
12454   kioACUserNoSeeFolderBit = 0,
12455   kioACUserNoSeeFolderMask = 0x01,
12456   kioACUserNoSeeFilesBit = 1,
12457   kioACUserNoSeeFilesMask = 0x02,
12458   kioACUserNoMakeChangesBit = 2,
12459   kioACUserNoMakeChangesMask = 0x04,
12460   kioACUserNotOwnerBit = 7,
12461   kioACUserNotOwnerMask = 0x80
12462 };
12463
12464
12465 enum {
12466   kioACAccessOwnerBit = 31,
12467   kioACAccessOwnerMask = (long)0x80000000,
12468   kioACAccessBlankAccessBit = 28,
12469   kioACAccessBlankAccessMask = 0x10000000,
12470   kioACAccessUserWriteBit = 26,
12471   kioACAccessUserWriteMask = 0x04000000,
12472   kioACAccessUserReadBit = 25,
12473   kioACAccessUserReadMask = 0x02000000,
12474   kioACAccessUserSearchBit = 24,
12475   kioACAccessUserSearchMask = 0x01000000,
12476   kioACAccessEveryoneWriteBit = 18,
12477   kioACAccessEveryoneWriteMask = 0x00040000,
12478   kioACAccessEveryoneReadBit = 17,
12479   kioACAccessEveryoneReadMask = 0x00020000,
12480   kioACAccessEveryoneSearchBit = 16,
12481   kioACAccessEveryoneSearchMask = 0x00010000,
12482   kioACAccessGroupWriteBit = 10,
12483   kioACAccessGroupWriteMask = 0x00000400,
12484   kioACAccessGroupReadBit = 9,
12485   kioACAccessGroupReadMask = 0x00000200,
12486   kioACAccessGroupSearchBit = 8,
12487   kioACAccessGroupSearchMask = 0x00000100,
12488   kioACAccessOwnerWriteBit = 2,
12489   kioACAccessOwnerWriteMask = 0x00000004,
12490   kioACAccessOwnerReadBit = 1,
12491   kioACAccessOwnerReadMask = 0x00000002,
12492   kioACAccessOwnerSearchBit = 0,
12493   kioACAccessOwnerSearchMask = 0x00000001,
12494   kfullPrivileges = 0x00070007,
12495   kownerPrivileges = 0x00000007
12496 };
12497
12498
12499 enum {
12500   knoUser = 0,
12501   kadministratorUser = 1
12502 };
12503
12504 enum {
12505   knoGroup = 0
12506 };
12507
12508
12509 struct GetVolParmsInfoBuffer {
12510   short vMVersion;
12511   long vMAttrib;
12512   Handle vMLocalHand;
12513   long vMServerAdr;
12514
12515   long vMVolumeGrade;
12516   short vMForeignPrivID;
12517
12518   long vMExtendedAttributes;
12519
12520   void * vMDeviceID;
12521
12522   UniCharCount vMMaxNameLength;
12523
12524 };
12525 typedef struct GetVolParmsInfoBuffer GetVolParmsInfoBuffer;
12526 typedef union ParamBlockRec ParamBlockRec;
12527
12528 typedef ParamBlockRec * ParmBlkPtr;
12529 typedef void ( * IOCompletionProcPtr)(ParmBlkPtr paramBlock);
12530 typedef IOCompletionProcPtr IOCompletionUPP;
12531 struct IOParam {
12532   QElemPtr qLink;
12533   short qType;
12534   short ioTrap;
12535   Ptr ioCmdAddr;
12536   IOCompletionUPP ioCompletion;
12537   volatile OSErr ioResult;
12538   StringPtr ioNamePtr;
12539   short ioVRefNum;
12540   short ioRefNum;
12541   SInt8 ioVersNum;
12542   SInt8 ioPermssn;
12543   Ptr ioMisc;
12544   Ptr ioBuffer;
12545   long ioReqCount;
12546   long ioActCount;
12547   short ioPosMode;
12548   long ioPosOffset;
12549 };
12550 typedef struct IOParam IOParam;
12551 typedef IOParam * IOParamPtr;
12552 struct FileParam {
12553   QElemPtr qLink;
12554   short qType;
12555   short ioTrap;
12556   Ptr ioCmdAddr;
12557   IOCompletionUPP ioCompletion;
12558   volatile OSErr ioResult;
12559   StringPtr ioNamePtr;
12560   short ioVRefNum;
12561   short ioFRefNum;
12562   SInt8 ioFVersNum;
12563   SInt8 filler1;
12564   short ioFDirIndex;
12565   SInt8 ioFlAttrib;
12566   SInt8 ioFlVersNum;
12567   FInfo ioFlFndrInfo;
12568   unsigned long ioFlNum;
12569   unsigned short ioFlStBlk;
12570   long ioFlLgLen;
12571   long ioFlPyLen;
12572   unsigned short ioFlRStBlk;
12573   long ioFlRLgLen;
12574   long ioFlRPyLen;
12575   unsigned long ioFlCrDat;
12576   unsigned long ioFlMdDat;
12577 };
12578 typedef struct FileParam FileParam;
12579 typedef FileParam * FileParamPtr;
12580 struct VolumeParam {
12581   QElemPtr qLink;
12582   short qType;
12583   short ioTrap;
12584   Ptr ioCmdAddr;
12585   IOCompletionUPP ioCompletion;
12586   volatile OSErr ioResult;
12587   StringPtr ioNamePtr;
12588   short ioVRefNum;
12589   long filler2;
12590   short ioVolIndex;
12591   unsigned long ioVCrDate;
12592   unsigned long ioVLsBkUp;
12593   unsigned short ioVAtrb;
12594   unsigned short ioVNmFls;
12595   unsigned short ioVDirSt;
12596   short ioVBlLn;
12597   unsigned short ioVNmAlBlks;
12598   unsigned long ioVAlBlkSiz;
12599   unsigned long ioVClpSiz;
12600   unsigned short ioAlBlSt;
12601   unsigned long ioVNxtFNum;
12602   unsigned short ioVFrBlk;
12603 };
12604 typedef struct VolumeParam VolumeParam;
12605 typedef VolumeParam * VolumeParamPtr;
12606 struct CntrlParam {
12607   QElemPtr qLink;
12608   short qType;
12609   short ioTrap;
12610   Ptr ioCmdAddr;
12611   IOCompletionUPP ioCompletion;
12612   volatile OSErr ioResult;
12613   StringPtr ioNamePtr;
12614   short ioVRefNum;
12615   short ioCRefNum;
12616   short csCode;
12617   short csParam[11];
12618 };
12619 typedef struct CntrlParam CntrlParam;
12620 typedef CntrlParam * CntrlParamPtr;
12621 struct SlotDevParam {
12622   QElemPtr qLink;
12623   short qType;
12624   short ioTrap;
12625   Ptr ioCmdAddr;
12626   IOCompletionUPP ioCompletion;
12627   volatile OSErr ioResult;
12628   StringPtr ioNamePtr;
12629   short ioVRefNum;
12630   short ioSRefNum;
12631   SInt8 ioSVersNum;
12632   SInt8 ioSPermssn;
12633   Ptr ioSMix;
12634   short ioSFlags;
12635   SInt8 ioSlot;
12636   SInt8 ioID;
12637 };
12638 typedef struct SlotDevParam SlotDevParam;
12639 typedef SlotDevParam * SlotDevParamPtr;
12640 struct MultiDevParam {
12641   QElemPtr qLink;
12642   short qType;
12643   short ioTrap;
12644   Ptr ioCmdAddr;
12645   IOCompletionUPP ioCompletion;
12646   volatile OSErr ioResult;
12647   StringPtr ioNamePtr;
12648   short ioVRefNum;
12649   short ioMRefNum;
12650   SInt8 ioMVersNum;
12651   SInt8 ioMPermssn;
12652   Ptr ioMMix;
12653   short ioMFlags;
12654   Ptr ioSEBlkPtr;
12655 };
12656 typedef struct MultiDevParam MultiDevParam;
12657 typedef MultiDevParam * MultiDevParamPtr;
12658 union ParamBlockRec {
12659   IOParam ioParam;
12660   FileParam fileParam;
12661   VolumeParam volumeParam;
12662   CntrlParam cntrlParam;
12663   SlotDevParam slotDevParam;
12664   MultiDevParam multiDevParam;
12665 };
12666
12667 struct HFileInfo {
12668   QElemPtr qLink;
12669   short qType;
12670   short ioTrap;
12671   Ptr ioCmdAddr;
12672   IOCompletionUPP ioCompletion;
12673   volatile OSErr ioResult;
12674   StringPtr ioNamePtr;
12675   short ioVRefNum;
12676   short ioFRefNum;
12677   SInt8 ioFVersNum;
12678   SInt8 filler1;
12679   short ioFDirIndex;
12680   SInt8 ioFlAttrib;
12681   SInt8 ioACUser;
12682   FInfo ioFlFndrInfo;
12683   long ioDirID;
12684   unsigned short ioFlStBlk;
12685   long ioFlLgLen;
12686   long ioFlPyLen;
12687   unsigned short ioFlRStBlk;
12688   long ioFlRLgLen;
12689   long ioFlRPyLen;
12690   unsigned long ioFlCrDat;
12691   unsigned long ioFlMdDat;
12692   unsigned long ioFlBkDat;
12693   FXInfo ioFlXFndrInfo;
12694   long ioFlParID;
12695   long ioFlClpSiz;
12696 };
12697 typedef struct HFileInfo HFileInfo;
12698 struct DirInfo {
12699   QElemPtr qLink;
12700   short qType;
12701   short ioTrap;
12702   Ptr ioCmdAddr;
12703   IOCompletionUPP ioCompletion;
12704   volatile OSErr ioResult;
12705   StringPtr ioNamePtr;
12706   short ioVRefNum;
12707   short ioFRefNum;
12708   SInt8 ioFVersNum;
12709   SInt8 filler1;
12710   short ioFDirIndex;
12711   SInt8 ioFlAttrib;
12712   SInt8 ioACUser;
12713   DInfo ioDrUsrWds;
12714   long ioDrDirID;
12715   unsigned short ioDrNmFls;
12716   short filler3[9];
12717   unsigned long ioDrCrDat;
12718   unsigned long ioDrMdDat;
12719   unsigned long ioDrBkDat;
12720   DXInfo ioDrFndrInfo;
12721   long ioDrParID;
12722 };
12723 typedef struct DirInfo DirInfo;
12724 union CInfoPBRec {
12725   HFileInfo hFileInfo;
12726   DirInfo dirInfo;
12727 };
12728 typedef union CInfoPBRec CInfoPBRec;
12729 typedef CInfoPBRec * CInfoPBPtr;
12730 struct XCInfoPBRec {
12731   QElemPtr qLink;
12732   short qType;
12733   short ioTrap;
12734   Ptr ioCmdAddr;
12735   ProcPtr ioCompletion;
12736   volatile OSErr ioResult;
12737   StringPtr ioNamePtr;
12738   short ioVRefNum;
12739   long filler1;
12740   StringPtr ioShortNamePtr;
12741   short filler2;
12742   short ioPDType;
12743   long ioPDAuxType;
12744   long filler3[2];
12745   long ioDirID;
12746 };
12747 typedef struct XCInfoPBRec XCInfoPBRec;
12748 typedef XCInfoPBRec * XCInfoPBPtr;
12749
12750 struct CatPositionRec {
12751   long initialize;
12752   short priv[6];
12753 };
12754 typedef struct CatPositionRec CatPositionRec;
12755 struct FSSpec {
12756   short vRefNum;
12757   long parID;
12758   StrFileName name;
12759 };
12760 typedef struct FSSpec FSSpec;
12761 typedef FSSpec * FSSpecPtr;
12762 typedef FSSpecPtr * FSSpecHandle;
12763
12764 typedef FSSpecPtr FSSpecArrayPtr;
12765
12766
12767
12768
12769 typedef const FSSpec * ConstFSSpecPtr;
12770
12771
12772
12773
12774
12775 typedef OSType VolumeType;
12776 enum {
12777
12778   AppleShareMediaType = 'afpm'
12779 };
12780
12781
12782
12783
12784 struct VolMountInfoHeader {
12785   short length;
12786   VolumeType media;
12787 };
12788 typedef struct VolMountInfoHeader VolMountInfoHeader;
12789 typedef VolMountInfoHeader * VolMountInfoPtr;
12790
12791
12792
12793
12794 struct VolumeMountInfoHeader {
12795   short length;
12796   VolumeType media;
12797   short flags;
12798 };
12799 typedef struct VolumeMountInfoHeader VolumeMountInfoHeader;
12800 typedef VolumeMountInfoHeader * VolumeMountInfoHeaderPtr;
12801
12802 enum {
12803   volMountNoLoginMsgFlagBit = 0,
12804   volMountNoLoginMsgFlagMask = 0x0001,
12805   volMountExtendedFlagsBit = 7,
12806   volMountExtendedFlagsMask = 0x0080,
12807   volMountInteractBit = 15,
12808   volMountInteractMask = 0x8000,
12809   volMountChangedBit = 14,
12810   volMountChangedMask = 0x4000,
12811   volMountFSReservedMask = 0x00FF,
12812   volMountSysReservedMask = 0xFF00
12813 };
12814
12815
12816
12817 struct AFPVolMountInfo {
12818   short length;
12819   VolumeType media;
12820   short flags;
12821   SInt8 nbpInterval;
12822   SInt8 nbpCount;
12823   short uamType;
12824   short zoneNameOffset;
12825   short serverNameOffset;
12826   short volNameOffset;
12827   short userNameOffset;
12828   short userPasswordOffset;
12829   short volPasswordOffset;
12830   char AFPData[144];
12831 };
12832 typedef struct AFPVolMountInfo AFPVolMountInfo;
12833 typedef AFPVolMountInfo * AFPVolMountInfoPtr;
12834
12835
12836
12837 struct AFPXVolMountInfo {
12838   short length;
12839   VolumeType media;
12840   short flags;
12841   SInt8 nbpInterval;
12842   SInt8 nbpCount;
12843   short uamType;
12844   short zoneNameOffset;
12845   short serverNameOffset;
12846   short volNameOffset;
12847   short userNameOffset;
12848   short userPasswordOffset;
12849   short volPasswordOffset;
12850   short extendedFlags;
12851   short uamNameOffset;
12852   short alternateAddressOffset;
12853   char AFPData[176];
12854 };
12855 typedef struct AFPXVolMountInfo AFPXVolMountInfo;
12856 typedef AFPXVolMountInfo * AFPXVolMountInfoPtr;
12857 enum {
12858   kAFPExtendedFlagsAlternateAddressMask = 1
12859 };
12860
12861
12862 enum {
12863
12864   kAFPTagTypeIP = 0x01,
12865   kAFPTagTypeIPPort = 0x02,
12866   kAFPTagTypeDDP = 0x03,
12867   kAFPTagTypeDNS = 0x04
12868 };
12869
12870
12871 enum {
12872
12873   kAFPTagLengthIP = 0x06,
12874   kAFPTagLengthIPPort = 0x08,
12875   kAFPTagLengthDDP = 0x06
12876 };
12877
12878 struct AFPTagData {
12879   UInt8 fLength;
12880   UInt8 fType;
12881   UInt8 fData[1];
12882 };
12883 typedef struct AFPTagData AFPTagData;
12884 struct AFPAlternateAddress {
12885
12886   UInt8 fVersion;
12887   UInt8 fAddressCount;
12888   UInt8 fAddressList[1];
12889 };
12890 typedef struct AFPAlternateAddress AFPAlternateAddress;
12891 struct DTPBRec {
12892   QElemPtr qLink;
12893   short qType;
12894   short ioTrap;
12895   Ptr ioCmdAddr;
12896   IOCompletionUPP ioCompletion;
12897   volatile OSErr ioResult;
12898   StringPtr ioNamePtr;
12899   short ioVRefNum;
12900   short ioDTRefNum;
12901   short ioIndex;
12902   long ioTagInfo;
12903   Ptr ioDTBuffer;
12904   long ioDTReqCount;
12905   long ioDTActCount;
12906   SInt8 ioFiller1;
12907   UInt8 ioIconType;
12908   short ioFiller2;
12909   long ioDirID;
12910   OSType ioFileCreator;
12911   OSType ioFileType;
12912   long ioFiller3;
12913   long ioDTLgLen;
12914   long ioDTPyLen;
12915   short ioFiller4[14];
12916   long ioAPPLParID;
12917 };
12918 typedef struct DTPBRec DTPBRec;
12919 typedef DTPBRec * DTPBPtr;
12920
12921 struct HIOParam {
12922   QElemPtr qLink;
12923   short qType;
12924   short ioTrap;
12925   Ptr ioCmdAddr;
12926   IOCompletionUPP ioCompletion;
12927   volatile OSErr ioResult;
12928   StringPtr ioNamePtr;
12929   short ioVRefNum;
12930   short ioRefNum;
12931   SInt8 ioVersNum;
12932   SInt8 ioPermssn;
12933   Ptr ioMisc;
12934   Ptr ioBuffer;
12935   long ioReqCount;
12936   long ioActCount;
12937   short ioPosMode;
12938   long ioPosOffset;
12939 };
12940 typedef struct HIOParam HIOParam;
12941 typedef HIOParam * HIOParamPtr;
12942 struct HFileParam {
12943   QElemPtr qLink;
12944   short qType;
12945   short ioTrap;
12946   Ptr ioCmdAddr;
12947   IOCompletionUPP ioCompletion;
12948   volatile OSErr ioResult;
12949   StringPtr ioNamePtr;
12950   short ioVRefNum;
12951   short ioFRefNum;
12952   SInt8 ioFVersNum;
12953   SInt8 filler1;
12954   short ioFDirIndex;
12955   SInt8 ioFlAttrib;
12956   SInt8 ioFlVersNum;
12957   FInfo ioFlFndrInfo;
12958   long ioDirID;
12959   unsigned short ioFlStBlk;
12960   long ioFlLgLen;
12961   long ioFlPyLen;
12962   unsigned short ioFlRStBlk;
12963   long ioFlRLgLen;
12964   long ioFlRPyLen;
12965   unsigned long ioFlCrDat;
12966   unsigned long ioFlMdDat;
12967 };
12968 typedef struct HFileParam HFileParam;
12969 typedef HFileParam * HFileParamPtr;
12970 struct HVolumeParam {
12971   QElemPtr qLink;
12972   short qType;
12973   short ioTrap;
12974   Ptr ioCmdAddr;
12975   IOCompletionUPP ioCompletion;
12976   volatile OSErr ioResult;
12977   StringPtr ioNamePtr;
12978   short ioVRefNum;
12979   long filler2;
12980   short ioVolIndex;
12981   unsigned long ioVCrDate;
12982   unsigned long ioVLsMod;
12983   short ioVAtrb;
12984   unsigned short ioVNmFls;
12985   unsigned short ioVBitMap;
12986   unsigned short ioAllocPtr;
12987   unsigned short ioVNmAlBlks;
12988   unsigned long ioVAlBlkSiz;
12989   unsigned long ioVClpSiz;
12990   unsigned short ioAlBlSt;
12991   unsigned long ioVNxtCNID;
12992   unsigned short ioVFrBlk;
12993   unsigned short ioVSigWord;
12994   short ioVDrvInfo;
12995   short ioVDRefNum;
12996   short ioVFSID;
12997   unsigned long ioVBkUp;
12998   short ioVSeqNum;
12999   unsigned long ioVWrCnt;
13000   unsigned long ioVFilCnt;
13001   unsigned long ioVDirCnt;
13002   long ioVFndrInfo[8];
13003 };
13004 typedef struct HVolumeParam HVolumeParam;
13005 typedef HVolumeParam * HVolumeParamPtr;
13006 struct XIOParam {
13007   QElemPtr qLink;
13008   short qType;
13009   short ioTrap;
13010   Ptr ioCmdAddr;
13011   IOCompletionUPP ioCompletion;
13012   volatile OSErr ioResult;
13013   StringPtr ioNamePtr;
13014   short ioVRefNum;
13015   short ioRefNum;
13016   SInt8 ioVersNum;
13017   SInt8 ioPermssn;
13018   Ptr ioMisc;
13019   Ptr ioBuffer;
13020   long ioReqCount;
13021   long ioActCount;
13022   short ioPosMode;
13023   wide ioWPosOffset;
13024 };
13025 typedef struct XIOParam XIOParam;
13026 typedef XIOParam * XIOParamPtr;
13027 struct XVolumeParam {
13028   QElemPtr qLink;
13029   short qType;
13030   short ioTrap;
13031   Ptr ioCmdAddr;
13032   IOCompletionUPP ioCompletion;
13033   volatile OSErr ioResult;
13034   StringPtr ioNamePtr;
13035   short ioVRefNum;
13036   unsigned long ioXVersion;
13037   short ioVolIndex;
13038   unsigned long ioVCrDate;
13039   unsigned long ioVLsMod;
13040   short ioVAtrb;
13041   unsigned short ioVNmFls;
13042   unsigned short ioVBitMap;
13043   unsigned short ioAllocPtr;
13044   unsigned short ioVNmAlBlks;
13045   unsigned long ioVAlBlkSiz;
13046   unsigned long ioVClpSiz;
13047   unsigned short ioAlBlSt;
13048   unsigned long ioVNxtCNID;
13049   unsigned short ioVFrBlk;
13050   unsigned short ioVSigWord;
13051   short ioVDrvInfo;
13052   short ioVDRefNum;
13053   short ioVFSID;
13054   unsigned long ioVBkUp;
13055   short ioVSeqNum;
13056   unsigned long ioVWrCnt;
13057   unsigned long ioVFilCnt;
13058   unsigned long ioVDirCnt;
13059   long ioVFndrInfo[8];
13060   UInt64 ioVTotalBytes;
13061   UInt64 ioVFreeBytes;
13062 };
13063 typedef struct XVolumeParam XVolumeParam;
13064 typedef XVolumeParam * XVolumeParamPtr;
13065 struct AccessParam {
13066   QElemPtr qLink;
13067   short qType;
13068   short ioTrap;
13069   Ptr ioCmdAddr;
13070   IOCompletionUPP ioCompletion;
13071   volatile OSErr ioResult;
13072   StringPtr ioNamePtr;
13073   short ioVRefNum;
13074   short filler3;
13075   short ioDenyModes;
13076   short filler4;
13077   SInt8 filler5;
13078   SInt8 ioACUser;
13079   long filler6;
13080   long ioACOwnerID;
13081   long ioACGroupID;
13082   long ioACAccess;
13083   long ioDirID;
13084 };
13085 typedef struct AccessParam AccessParam;
13086 typedef AccessParam * AccessParamPtr;
13087 struct ObjParam {
13088   QElemPtr qLink;
13089   short qType;
13090   short ioTrap;
13091   Ptr ioCmdAddr;
13092   IOCompletionUPP ioCompletion;
13093   volatile OSErr ioResult;
13094   StringPtr ioNamePtr;
13095   short ioVRefNum;
13096   short filler7;
13097   short ioObjType;
13098   StringPtr ioObjNamePtr;
13099   long ioObjID;
13100 };
13101 typedef struct ObjParam ObjParam;
13102 typedef ObjParam * ObjParamPtr;
13103 struct CopyParam {
13104   QElemPtr qLink;
13105   short qType;
13106   short ioTrap;
13107   Ptr ioCmdAddr;
13108   IOCompletionUPP ioCompletion;
13109   volatile OSErr ioResult;
13110   StringPtr ioNamePtr;
13111   short ioVRefNum;
13112   short ioDstVRefNum;
13113   short filler8;
13114   StringPtr ioNewName;
13115   StringPtr ioCopyName;
13116   long ioNewDirID;
13117   long filler14;
13118   long filler15;
13119   long ioDirID;
13120 };
13121 typedef struct CopyParam CopyParam;
13122 typedef CopyParam * CopyParamPtr;
13123 struct WDParam {
13124   QElemPtr qLink;
13125   short qType;
13126   short ioTrap;
13127   Ptr ioCmdAddr;
13128   IOCompletionUPP ioCompletion;
13129   volatile OSErr ioResult;
13130   StringPtr ioNamePtr;
13131   short ioVRefNum;
13132   short ioWDCreated;
13133   short ioWDIndex;
13134   long ioWDProcID;
13135   short ioWDVRefNum;
13136   short filler10;
13137   long filler11;
13138   long filler12;
13139   long filler13;
13140   long ioWDDirID;
13141 };
13142 typedef struct WDParam WDParam;
13143 typedef WDParam * WDParamPtr;
13144 struct FIDParam {
13145   QElemPtr qLink;
13146   short qType;
13147   short ioTrap;
13148   Ptr ioCmdAddr;
13149   IOCompletionUPP ioCompletion;
13150   volatile OSErr ioResult;
13151   StringPtr ioNamePtr;
13152   short ioVRefNum;
13153   long filler14;
13154   StringPtr ioDestNamePtr;
13155   long filler15;
13156   long ioDestDirID;
13157   long filler16;
13158   long filler17;
13159   long ioSrcDirID;
13160   short filler18;
13161   long ioFileID;
13162 };
13163 typedef struct FIDParam FIDParam;
13164 typedef FIDParam * FIDParamPtr;
13165 struct ForeignPrivParam {
13166   QElemPtr qLink;
13167   short qType;
13168   short ioTrap;
13169   Ptr ioCmdAddr;
13170   IOCompletionUPP ioCompletion;
13171   volatile OSErr ioResult;
13172   StringPtr ioNamePtr;
13173   short ioVRefNum;
13174   long ioFiller21;
13175   long ioFiller22;
13176   Ptr ioForeignPrivBuffer;
13177   long ioForeignPrivActCount;
13178   long ioForeignPrivReqCount;
13179   long ioFiller23;
13180   long ioForeignPrivDirID;
13181   long ioForeignPrivInfo1;
13182   long ioForeignPrivInfo2;
13183   long ioForeignPrivInfo3;
13184   long ioForeignPrivInfo4;
13185 };
13186 typedef struct ForeignPrivParam ForeignPrivParam;
13187 typedef ForeignPrivParam * ForeignPrivParamPtr;
13188 struct CSParam {
13189   QElemPtr qLink;
13190   short qType;
13191   short ioTrap;
13192   Ptr ioCmdAddr;
13193   IOCompletionUPP ioCompletion;
13194   volatile OSErr ioResult;
13195   StringPtr ioNamePtr;
13196   short ioVRefNum;
13197   FSSpecPtr ioMatchPtr;
13198   long ioReqMatchCount;
13199   long ioActMatchCount;
13200   long ioSearchBits;
13201   CInfoPBPtr ioSearchInfo1;
13202   CInfoPBPtr ioSearchInfo2;
13203   long ioSearchTime;
13204   CatPositionRec ioCatPosition;
13205   Ptr ioOptBuffer;
13206   long ioOptBufSize;
13207 };
13208 typedef struct CSParam CSParam;
13209 typedef CSParam * CSParamPtr;
13210 union HParamBlockRec {
13211   HIOParam ioParam;
13212   HFileParam fileParam;
13213   HVolumeParam volumeParam;
13214   AccessParam accessParam;
13215   ObjParam objParam;
13216   CopyParam copyParam;
13217   WDParam wdParam;
13218   FIDParam fidParam;
13219   CSParam csParam;
13220   ForeignPrivParam foreignPrivParam;
13221 };
13222 typedef union HParamBlockRec HParamBlockRec;
13223
13224
13225 typedef HParamBlockRec * HParmBlkPtr;
13226
13227 struct CMovePBRec {
13228   QElemPtr qLink;
13229   short qType;
13230   short ioTrap;
13231   Ptr ioCmdAddr;
13232   IOCompletionUPP ioCompletion;
13233   volatile OSErr ioResult;
13234   StringPtr ioNamePtr;
13235   short ioVRefNum;
13236   long filler1;
13237   StringPtr ioNewName;
13238   long filler2;
13239   long ioNewDirID;
13240   long filler3[2];
13241   long ioDirID;
13242 };
13243 typedef struct CMovePBRec CMovePBRec;
13244 typedef CMovePBRec * CMovePBPtr;
13245 struct WDPBRec {
13246   QElemPtr qLink;
13247   short qType;
13248   short ioTrap;
13249   Ptr ioCmdAddr;
13250   IOCompletionUPP ioCompletion;
13251   volatile OSErr ioResult;
13252   StringPtr ioNamePtr;
13253   short ioVRefNum;
13254   short filler1;
13255   short ioWDIndex;
13256   long ioWDProcID;
13257   short ioWDVRefNum;
13258   short filler2[7];
13259   long ioWDDirID;
13260 };
13261 typedef struct WDPBRec WDPBRec;
13262 typedef WDPBRec * WDPBPtr;
13263 struct FCBPBRec {
13264   QElemPtr qLink;
13265   short qType;
13266   short ioTrap;
13267   Ptr ioCmdAddr;
13268   IOCompletionUPP ioCompletion;
13269   volatile OSErr ioResult;
13270   StringPtr ioNamePtr;
13271   short ioVRefNum;
13272   short ioRefNum;
13273   short filler;
13274   short ioFCBIndx;
13275   short filler1;
13276   long ioFCBFlNm;
13277   short ioFCBFlags;
13278   unsigned short ioFCBStBlk;
13279   long ioFCBEOF;
13280   long ioFCBPLen;
13281   long ioFCBCrPs;
13282   short ioFCBVRefNum;
13283   long ioFCBClpSiz;
13284   long ioFCBParID;
13285 };
13286 typedef struct FCBPBRec FCBPBRec;
13287 typedef FCBPBRec * FCBPBPtr;
13288 struct VCB {
13289   QElemPtr qLink;
13290   short qType;
13291   short vcbFlags;
13292   unsigned short vcbSigWord;
13293   unsigned long vcbCrDate;
13294   unsigned long vcbLsMod;
13295   short vcbAtrb;
13296   unsigned short vcbNmFls;
13297   short vcbVBMSt;
13298   short vcbAllocPtr;
13299   unsigned short vcbNmAlBlks;
13300   long vcbAlBlkSiz;
13301   long vcbClpSiz;
13302   short vcbAlBlSt;
13303   long vcbNxtCNID;
13304   unsigned short vcbFreeBks;
13305   Str27 vcbVN;
13306   short vcbDrvNum;
13307   short vcbDRefNum;
13308   short vcbFSID;
13309   short vcbVRefNum;
13310   Ptr vcbMAdr;
13311   Ptr vcbBufAdr;
13312   short vcbMLen;
13313   short vcbDirIndex;
13314   short vcbDirBlk;
13315   unsigned long vcbVolBkUp;
13316   unsigned short vcbVSeqNum;
13317   long vcbWrCnt;
13318   long vcbXTClpSiz;
13319   long vcbCTClpSiz;
13320   unsigned short vcbNmRtDirs;
13321   long vcbFilCnt;
13322   long vcbDirCnt;
13323   long vcbFndrInfo[8];
13324   unsigned short vcbVCSize;
13325   unsigned short vcbVBMCSiz;
13326   unsigned short vcbCtlCSiz;
13327   unsigned short vcbXTAlBlks;
13328   unsigned short vcbCTAlBlks;
13329   short vcbXTRef;
13330   short vcbCTRef;
13331   Ptr vcbCtlBuf;
13332   long vcbDirIDM;
13333   short vcbOffsM;
13334 };
13335 typedef struct VCB VCB;
13336 typedef VCB * VCBPtr;
13337 struct DrvQEl {
13338   QElemPtr qLink;
13339   short qType;
13340   short dQDrive;
13341   short dQRefNum;
13342   short dQFSID;
13343   unsigned short dQDrvSz;
13344   unsigned short dQDrvSz2;
13345 };
13346 typedef struct DrvQEl DrvQEl;
13347 typedef DrvQEl * DrvQElPtr;
13348 extern IOCompletionUPP
13349 NewIOCompletionUPP(IOCompletionProcPtr userRoutine) ;
13350 extern void
13351 DisposeIOCompletionUPP(IOCompletionUPP userUPP) ;
13352 extern void
13353 InvokeIOCompletionUPP(
13354   ParmBlkPtr paramBlock,
13355   IOCompletionUPP userUPP) ;
13356 extern OSErr PBXGetVolInfoSync(XVolumeParamPtr paramBlock) ;
13357 extern OSErr PBXGetVolInfoAsync(XVolumeParamPtr paramBlock) ;
13358 extern OSErr PBFlushVolSync(ParmBlkPtr paramBlock) ;
13359 extern OSErr PBFlushVolAsync(ParmBlkPtr paramBlock) ;
13360 extern OSErr PBAllocateSync(ParmBlkPtr paramBlock) ;
13361 extern OSErr PBAllocateAsync(ParmBlkPtr paramBlock) ;
13362 extern OSErr PBGetEOFSync(ParmBlkPtr paramBlock) ;
13363 extern OSErr PBGetEOFAsync(ParmBlkPtr paramBlock) ;
13364 extern OSErr PBSetEOFSync(ParmBlkPtr paramBlock) ;
13365 extern OSErr PBSetEOFAsync(ParmBlkPtr paramBlock) ;
13366 extern OSErr PBGetFPosSync(ParmBlkPtr paramBlock) ;
13367 extern OSErr PBGetFPosAsync(ParmBlkPtr paramBlock) ;
13368 extern OSErr PBSetFPosSync(ParmBlkPtr paramBlock) ;
13369 extern OSErr PBSetFPosAsync(ParmBlkPtr paramBlock) ;
13370 extern OSErr PBFlushFileSync(ParmBlkPtr paramBlock) ;
13371 extern OSErr PBFlushFileAsync(ParmBlkPtr paramBlock) ;
13372 extern OSErr PBUnmountVol(ParmBlkPtr paramBlock) ;
13373 extern OSErr PBCatSearchSync(CSParamPtr paramBlock) ;
13374 extern OSErr PBCatSearchAsync(CSParamPtr paramBlock) ;
13375 extern OSErr
13376 UnmountVol(
13377   ConstStr63Param volName,
13378   short vRefNum) ;
13379 extern OSErr
13380 FlushVol(
13381   ConstStr63Param volName,
13382   short vRefNum) ;
13383 extern OSErr
13384 HSetVol(
13385   ConstStr63Param volName,
13386   short vRefNum,
13387   long dirID) ;
13388 extern OSErr
13389 FSClose(short refNum) ;
13390 extern OSErr
13391 FSRead(
13392   short refNum,
13393   long * count,
13394   void * buffPtr) ;
13395 extern OSErr
13396 FSWrite(
13397   short refNum,
13398   long * count,
13399   const void * buffPtr) ;
13400 extern OSErr
13401 Allocate(
13402   short refNum,
13403   long * count) ;
13404 extern OSErr
13405 GetEOF(
13406   short refNum,
13407   long * logEOF) ;
13408 extern OSErr
13409 SetEOF(
13410   short refNum,
13411   long logEOF) ;
13412 extern OSErr
13413 GetFPos(
13414   short refNum,
13415   long * filePos) ;
13416 extern OSErr
13417 SetFPos(
13418   short refNum,
13419   short posMode,
13420   long posOff) ;
13421 extern OSErr
13422 GetVRefNum(
13423   short fileRefNum,
13424   short * vRefNum) ;
13425 extern OSErr PBHSetVolSync(WDPBPtr paramBlock) ;
13426 extern OSErr PBHSetVolAsync(WDPBPtr paramBlock) ;
13427 extern OSErr PBHGetVolSync(WDPBPtr paramBlock) ;
13428 extern OSErr PBHGetVolAsync(WDPBPtr paramBlock) ;
13429 extern OSErr PBCatMoveSync(CMovePBPtr paramBlock) ;
13430 extern OSErr PBCatMoveAsync(CMovePBPtr paramBlock) ;
13431 extern OSErr PBDirCreateSync(HParmBlkPtr paramBlock) ;
13432 extern OSErr PBDirCreateAsync(HParmBlkPtr paramBlock) ;
13433 extern OSErr PBGetFCBInfoSync(FCBPBPtr paramBlock) ;
13434 extern OSErr PBGetFCBInfoAsync(FCBPBPtr paramBlock) ;
13435 extern OSErr PBGetCatInfoSync(CInfoPBPtr paramBlock) ;
13436 extern OSErr PBGetCatInfoAsync(CInfoPBPtr paramBlock) ;
13437 extern OSErr PBSetCatInfoSync(CInfoPBPtr paramBlock) ;
13438 extern OSErr PBSetCatInfoAsync(CInfoPBPtr paramBlock) ;
13439 extern OSErr PBAllocContigSync(ParmBlkPtr paramBlock) ;
13440 extern OSErr PBAllocContigAsync(ParmBlkPtr paramBlock) ;
13441 extern OSErr PBLockRangeSync(ParmBlkPtr paramBlock) ;
13442 extern OSErr PBLockRangeAsync(ParmBlkPtr paramBlock) ;
13443 extern OSErr PBUnlockRangeSync(ParmBlkPtr paramBlock) ;
13444 extern OSErr PBUnlockRangeAsync(ParmBlkPtr paramBlock) ;
13445 extern OSErr PBSetVInfoSync(HParmBlkPtr paramBlock) ;
13446 extern OSErr PBSetVInfoAsync(HParmBlkPtr paramBlock) ;
13447 extern OSErr PBHGetVInfoSync(HParmBlkPtr paramBlock) ;
13448 extern OSErr PBHGetVInfoAsync(HParmBlkPtr paramBlock) ;
13449 extern OSErr PBHOpenSync(HParmBlkPtr paramBlock) ;
13450 extern OSErr PBHOpenAsync(HParmBlkPtr paramBlock) ;
13451 extern OSErr PBHOpenRFSync(HParmBlkPtr paramBlock) ;
13452 extern OSErr PBHOpenRFAsync(HParmBlkPtr paramBlock) ;
13453 extern OSErr PBHOpenDFSync(HParmBlkPtr paramBlock) ;
13454 extern OSErr PBHOpenDFAsync(HParmBlkPtr paramBlock) ;
13455 extern OSErr PBHCreateSync(HParmBlkPtr paramBlock) ;
13456 extern OSErr PBHCreateAsync(HParmBlkPtr paramBlock) ;
13457 extern OSErr PBHDeleteSync(HParmBlkPtr paramBlock) ;
13458 extern OSErr PBHDeleteAsync(HParmBlkPtr paramBlock) ;
13459 extern OSErr PBHRenameSync(HParmBlkPtr paramBlock) ;
13460 extern OSErr PBHRenameAsync(HParmBlkPtr paramBlock) ;
13461 extern OSErr PBHRstFLockSync(HParmBlkPtr paramBlock) ;
13462 extern OSErr PBHRstFLockAsync(HParmBlkPtr paramBlock) ;
13463 extern OSErr PBHSetFLockSync(HParmBlkPtr paramBlock) ;
13464 extern OSErr PBHSetFLockAsync(HParmBlkPtr paramBlock) ;
13465 extern OSErr PBHGetFInfoSync(HParmBlkPtr paramBlock) ;
13466 extern OSErr PBHGetFInfoAsync(HParmBlkPtr paramBlock) ;
13467 extern OSErr PBHSetFInfoSync(HParmBlkPtr paramBlock) ;
13468 extern OSErr PBHSetFInfoAsync(HParmBlkPtr paramBlock) ;
13469 extern OSErr PBMakeFSSpecSync(HParmBlkPtr paramBlock) ;
13470 extern OSErr PBMakeFSSpecAsync(HParmBlkPtr paramBlock) ;
13471 extern OSErr
13472 HGetVol(
13473   StringPtr volName,
13474   short * vRefNum,
13475   long * dirID) ;
13476 extern OSErr
13477 HOpen(
13478   short vRefNum,
13479   long dirID,
13480   ConstStr255Param fileName,
13481   SInt8 permission,
13482   short * refNum) ;
13483 extern OSErr
13484 HOpenDF(
13485   short vRefNum,
13486   long dirID,
13487   ConstStr255Param fileName,
13488   SInt8 permission,
13489   short * refNum) ;
13490 extern OSErr
13491 HOpenRF(
13492   short vRefNum,
13493   long dirID,
13494   ConstStr255Param fileName,
13495   SInt8 permission,
13496   short * refNum) ;
13497 extern OSErr
13498 AllocContig(
13499   short refNum,
13500   long * count) ;
13501 extern OSErr
13502 HCreate(
13503   short vRefNum,
13504   long dirID,
13505   ConstStr255Param fileName,
13506   OSType creator,
13507   OSType fileType) ;
13508 extern OSErr
13509 DirCreate(
13510   short vRefNum,
13511   long parentDirID,
13512   ConstStr255Param directoryName,
13513   long * createdDirID) ;
13514 extern OSErr
13515 HDelete(
13516   short vRefNum,
13517   long dirID,
13518   ConstStr255Param fileName) ;
13519 extern OSErr
13520 HGetFInfo(
13521   short vRefNum,
13522   long dirID,
13523   ConstStr255Param fileName,
13524   FInfo * fndrInfo) ;
13525 extern OSErr
13526 HSetFInfo(
13527   short vRefNum,
13528   long dirID,
13529   ConstStr255Param fileName,
13530   const FInfo * fndrInfo) ;
13531 extern OSErr
13532 HSetFLock(
13533   short vRefNum,
13534   long dirID,
13535   ConstStr255Param fileName) ;
13536 extern OSErr
13537 HRstFLock(
13538   short vRefNum,
13539   long dirID,
13540   ConstStr255Param fileName) ;
13541 extern OSErr
13542 HRename(
13543   short vRefNum,
13544   long dirID,
13545   ConstStr255Param oldName,
13546   ConstStr255Param newName) ;
13547 extern OSErr
13548 CatMove(
13549   short vRefNum,
13550   long dirID,
13551   ConstStr255Param oldName,
13552   long newDirID,
13553   ConstStr255Param newName) ;
13554 extern OSErr PBHGetVolParmsSync(HParmBlkPtr paramBlock) ;
13555 extern OSErr PBHGetVolParmsAsync(HParmBlkPtr paramBlock) ;
13556 extern OSErr PBHGetLogInInfoSync(HParmBlkPtr paramBlock) ;
13557 extern OSErr PBHGetLogInInfoAsync(HParmBlkPtr paramBlock) ;
13558 extern OSErr PBHGetDirAccessSync(HParmBlkPtr paramBlock) ;
13559 extern OSErr PBHGetDirAccessAsync(HParmBlkPtr paramBlock) ;
13560 extern OSErr PBHSetDirAccessSync(HParmBlkPtr paramBlock) ;
13561 extern OSErr PBHSetDirAccessAsync(HParmBlkPtr paramBlock) ;
13562 extern OSErr PBHMapIDSync(HParmBlkPtr paramBlock) ;
13563 extern OSErr PBHMapIDAsync(HParmBlkPtr paramBlock) ;
13564 extern OSErr PBHMapNameSync(HParmBlkPtr paramBlock) ;
13565 extern OSErr PBHMapNameAsync(HParmBlkPtr paramBlock) ;
13566 extern OSErr PBHCopyFileSync(HParmBlkPtr paramBlock) ;
13567 extern OSErr PBHCopyFileAsync(HParmBlkPtr paramBlock) ;
13568 extern OSErr PBHMoveRenameSync(HParmBlkPtr paramBlock) ;
13569 extern OSErr PBHMoveRenameAsync(HParmBlkPtr paramBlock) ;
13570 extern OSErr PBHOpenDenySync(HParmBlkPtr paramBlock) ;
13571 extern OSErr PBHOpenDenyAsync(HParmBlkPtr paramBlock) ;
13572 extern OSErr PBHOpenRFDenySync(HParmBlkPtr paramBlock) ;
13573 extern OSErr PBHOpenRFDenyAsync(HParmBlkPtr paramBlock) ;
13574 extern OSErr PBGetXCatInfoSync(XCInfoPBPtr paramBlock) ;
13575 extern OSErr PBGetXCatInfoAsync(XCInfoPBPtr paramBlock) ;
13576 extern OSErr PBExchangeFilesSync(HParmBlkPtr paramBlock) ;
13577 extern OSErr PBExchangeFilesAsync(HParmBlkPtr paramBlock) ;
13578 extern OSErr PBCreateFileIDRefSync(HParmBlkPtr paramBlock) ;
13579 extern OSErr PBCreateFileIDRefAsync(HParmBlkPtr paramBlock) ;
13580 extern OSErr PBResolveFileIDRefSync(HParmBlkPtr paramBlock) ;
13581 extern OSErr PBResolveFileIDRefAsync(HParmBlkPtr paramBlock) ;
13582 extern OSErr PBDeleteFileIDRefSync(HParmBlkPtr paramBlock) ;
13583 extern OSErr PBDeleteFileIDRefAsync(HParmBlkPtr paramBlock) ;
13584 extern OSErr PBGetForeignPrivsSync(HParmBlkPtr paramBlock) ;
13585 extern OSErr PBGetForeignPrivsAsync(HParmBlkPtr paramBlock) ;
13586 extern OSErr PBSetForeignPrivsSync(HParmBlkPtr paramBlock) ;
13587 extern OSErr PBSetForeignPrivsAsync(HParmBlkPtr paramBlock) ;
13588 extern OSErr PBDTGetPath(DTPBPtr paramBlock) ;
13589 extern OSErr PBDTCloseDown(DTPBPtr paramBlock) ;
13590 extern OSErr PBDTAddIconSync(DTPBPtr paramBlock) ;
13591 extern OSErr PBDTAddIconAsync(DTPBPtr paramBlock) ;
13592 extern OSErr PBDTGetIconSync(DTPBPtr paramBlock) ;
13593 extern OSErr PBDTGetIconAsync(DTPBPtr paramBlock) ;
13594 extern OSErr PBDTGetIconInfoSync(DTPBPtr paramBlock) ;
13595 extern OSErr PBDTGetIconInfoAsync(DTPBPtr paramBlock) ;
13596 extern OSErr PBDTAddAPPLSync(DTPBPtr paramBlock) ;
13597 extern OSErr PBDTAddAPPLAsync(DTPBPtr paramBlock) ;
13598 extern OSErr PBDTRemoveAPPLSync(DTPBPtr paramBlock) ;
13599 extern OSErr PBDTRemoveAPPLAsync(DTPBPtr paramBlock) ;
13600 extern OSErr PBDTGetAPPLSync(DTPBPtr paramBlock) ;
13601 extern OSErr PBDTGetAPPLAsync(DTPBPtr paramBlock) ;
13602 extern OSErr PBDTSetCommentSync(DTPBPtr paramBlock) ;
13603 extern OSErr PBDTSetCommentAsync(DTPBPtr paramBlock) ;
13604 extern OSErr PBDTRemoveCommentSync(DTPBPtr paramBlock) ;
13605 extern OSErr PBDTRemoveCommentAsync(DTPBPtr paramBlock) ;
13606 extern OSErr PBDTGetCommentSync(DTPBPtr paramBlock) ;
13607 extern OSErr PBDTGetCommentAsync(DTPBPtr paramBlock) ;
13608 extern OSErr PBDTFlushSync(DTPBPtr paramBlock) ;
13609 extern OSErr PBDTFlushAsync(DTPBPtr paramBlock) ;
13610 extern OSErr PBDTResetSync(DTPBPtr paramBlock) ;
13611 extern OSErr PBDTResetAsync(DTPBPtr paramBlock) ;
13612 extern OSErr PBDTGetInfoSync(DTPBPtr paramBlock) ;
13613 extern OSErr PBDTGetInfoAsync(DTPBPtr paramBlock) ;
13614 extern OSErr PBDTOpenInform(DTPBPtr paramBlock) ;
13615 extern OSErr PBDTDeleteSync(DTPBPtr paramBlock) ;
13616 extern OSErr PBDTDeleteAsync(DTPBPtr paramBlock) ;
13617 extern OSErr PBGetVolMountInfoSize(ParmBlkPtr paramBlock) ;
13618 extern OSErr PBGetVolMountInfo(ParmBlkPtr paramBlock) ;
13619 extern OSErr PBVolumeMount(ParmBlkPtr paramBlock) ;
13620 extern OSErr
13621 FSMakeFSSpec(
13622   short vRefNum,
13623   long dirID,
13624   ConstStr255Param fileName,
13625   FSSpec * spec) ;
13626 extern OSErr
13627 FSpOpenDF(
13628   const FSSpec * spec,
13629   SInt8 permission,
13630   short * refNum) ;
13631 extern OSErr
13632 FSpOpenRF(
13633   const FSSpec * spec,
13634   SInt8 permission,
13635   short * refNum) ;
13636 extern OSErr
13637 FSpCreate(
13638   const FSSpec * spec,
13639   OSType creator,
13640   OSType fileType,
13641   ScriptCode scriptTag) ;
13642 extern OSErr
13643 FSpDirCreate(
13644   const FSSpec * spec,
13645   ScriptCode scriptTag,
13646   long * createdDirID) ;
13647 extern OSErr
13648 FSpDelete(const FSSpec * spec) ;
13649 extern OSErr
13650 FSpGetFInfo(
13651   const FSSpec * spec,
13652   FInfo * fndrInfo) ;
13653 extern OSErr
13654 FSpSetFInfo(
13655   const FSSpec * spec,
13656   const FInfo * fndrInfo) ;
13657 extern OSErr
13658 FSpSetFLock(const FSSpec * spec) ;
13659 extern OSErr
13660 FSpRstFLock(const FSSpec * spec) ;
13661 extern OSErr
13662 FSpRename(
13663   const FSSpec * spec,
13664   ConstStr255Param newName) ;
13665 extern OSErr
13666 FSpCatMove(
13667   const FSSpec * source,
13668   const FSSpec * dest) ;
13669 extern OSErr
13670 FSpExchangeFiles(
13671   const FSSpec * source,
13672   const FSSpec * dest) ;
13673 extern OSErr PBShareSync(HParmBlkPtr paramBlock) ;
13674 extern OSErr PBShareAsync(HParmBlkPtr paramBlock) ;
13675 extern OSErr PBUnshareSync(HParmBlkPtr paramBlock) ;
13676 extern OSErr PBUnshareAsync(HParmBlkPtr paramBlock) ;
13677 extern OSErr PBGetUGEntrySync(HParmBlkPtr paramBlock) ;
13678 extern OSErr PBGetUGEntryAsync(HParmBlkPtr paramBlock) ;
13679 typedef SInt16 FSVolumeRefNum;
13680 enum {
13681   kFSInvalidVolumeRefNum = 0
13682 };
13683
13684 struct FSRef {
13685   UInt8 hidden[80];
13686 };
13687 typedef struct FSRef FSRef;
13688 typedef FSRef * FSRefPtr;
13689 struct FSPermissionInfo {
13690   UInt32 userID;
13691   UInt32 groupID;
13692   UInt8 reserved1;
13693   UInt8 userAccess;
13694   UInt16 mode;
13695   UInt32 reserved2;
13696 };
13697 typedef struct FSPermissionInfo FSPermissionInfo;
13698
13699
13700 typedef UInt32 FSCatalogInfoBitmap;
13701 enum {
13702   kFSCatInfoNone = 0x00000000,
13703   kFSCatInfoTextEncoding = 0x00000001,
13704   kFSCatInfoNodeFlags = 0x00000002,
13705   kFSCatInfoVolume = 0x00000004,
13706   kFSCatInfoParentDirID = 0x00000008,
13707   kFSCatInfoNodeID = 0x00000010,
13708   kFSCatInfoCreateDate = 0x00000020,
13709   kFSCatInfoContentMod = 0x00000040,
13710   kFSCatInfoAttrMod = 0x00000080,
13711   kFSCatInfoAccessDate = 0x00000100,
13712   kFSCatInfoBackupDate = 0x00000200,
13713   kFSCatInfoPermissions = 0x00000400,
13714   kFSCatInfoFinderInfo = 0x00000800,
13715   kFSCatInfoFinderXInfo = 0x00001000,
13716   kFSCatInfoValence = 0x00002000,
13717   kFSCatInfoDataSizes = 0x00004000,
13718   kFSCatInfoRsrcSizes = 0x00008000,
13719   kFSCatInfoSharingFlags = 0x00010000,
13720   kFSCatInfoUserPrivs = 0x00020000,
13721   kFSCatInfoUserAccess = 0x00080000,
13722   kFSCatInfoAllDates = 0x000003E0,
13723   kFSCatInfoGettableInfo = 0x0003FFFF,
13724   kFSCatInfoSettableInfo = 0x00001FE3,
13725   kFSCatInfoReserved = (long)0xFFFC0000
13726 };
13727
13728
13729 enum {
13730   kFSNodeLockedBit = 0,
13731   kFSNodeLockedMask = 0x0001,
13732   kFSNodeResOpenBit = 2,
13733   kFSNodeResOpenMask = 0x0004,
13734   kFSNodeDataOpenBit = 3,
13735   kFSNodeDataOpenMask = 0x0008,
13736   kFSNodeIsDirectoryBit = 4,
13737   kFSNodeIsDirectoryMask = 0x0010,
13738   kFSNodeCopyProtectBit = 6,
13739   kFSNodeCopyProtectMask = 0x0040,
13740   kFSNodeForkOpenBit = 7,
13741   kFSNodeForkOpenMask = 0x0080,
13742   kFSNodeHardLinkBit = 8,
13743   kFSNodeHardLinkMask = 0x00000100
13744 };
13745
13746
13747 enum {
13748   kFSNodeInSharedBit = 2,
13749   kFSNodeInSharedMask = 0x0004,
13750   kFSNodeIsMountedBit = 3,
13751   kFSNodeIsMountedMask = 0x0008,
13752   kFSNodeIsSharePointBit = 5,
13753   kFSNodeIsSharePointMask = 0x0020
13754 };
13755
13756
13757 struct FSCatalogInfo {
13758   UInt16 nodeFlags;
13759   FSVolumeRefNum volume;
13760   UInt32 parentDirID;
13761   UInt32 nodeID;
13762   UInt8 sharingFlags;
13763   UInt8 userPrivileges;
13764   UInt8 reserved1;
13765   UInt8 reserved2;
13766   UTCDateTime createDate;
13767   UTCDateTime contentModDate;
13768   UTCDateTime attributeModDate;
13769   UTCDateTime accessDate;
13770   UTCDateTime backupDate;
13771
13772   UInt32 permissions[4];
13773
13774   UInt8 finderInfo[16];
13775   UInt8 extFinderInfo[16];
13776
13777   UInt64 dataLogicalSize;
13778   UInt64 dataPhysicalSize;
13779   UInt64 rsrcLogicalSize;
13780   UInt64 rsrcPhysicalSize;
13781
13782   UInt32 valence;
13783   TextEncoding textEncodingHint;
13784 };
13785 typedef struct FSCatalogInfo FSCatalogInfo;
13786 typedef FSCatalogInfo * FSCatalogInfoPtr;
13787 struct FSRefParam {
13788   QElemPtr qLink;
13789   short qType;
13790   short ioTrap;
13791   Ptr ioCmdAddr;
13792   IOCompletionUPP ioCompletion;
13793   volatile OSErr ioResult;
13794   ConstStringPtr ioNamePtr;
13795   short ioVRefNum;
13796
13797   SInt16 reserved1;
13798   UInt8 reserved2;
13799   UInt8 reserved3;
13800
13801   const FSRef * ref;
13802   FSCatalogInfoBitmap whichInfo;
13803   FSCatalogInfo * catInfo;
13804   UniCharCount nameLength;
13805   const UniChar * name;
13806   long ioDirID;
13807   FSSpec * spec;
13808   FSRef * parentRef;
13809   FSRef * newRef;
13810   TextEncoding textEncodingHint;
13811   HFSUniStr255 * outName;
13812 };
13813 typedef struct FSRefParam FSRefParam;
13814 typedef FSRefParam * FSRefParamPtr;
13815 typedef struct OpaqueFSIterator* FSIterator;
13816 enum {
13817   kFSIterateFlat = 0,
13818   kFSIterateSubtree = 1,
13819   kFSIterateDelete = 2,
13820   kFSIterateReserved = (long)0xFFFFFFFC
13821 };
13822
13823 typedef OptionBits FSIteratorFlags;
13824 enum {
13825
13826   fsSBNodeID = 0x00008000,
13827   fsSBAttributeModDate = 0x00010000,
13828   fsSBAccessDate = 0x00020000,
13829   fsSBPermissions = 0x00040000,
13830   fsSBNodeIDBit = 15,
13831   fsSBAttributeModDateBit = 16,
13832   fsSBAccessDateBit = 17,
13833   fsSBPermissionsBit = 18
13834 };
13835
13836 struct FSSearchParams {
13837   Duration searchTime;
13838   OptionBits searchBits;
13839   UniCharCount searchNameLength;
13840   const UniChar * searchName;
13841   FSCatalogInfo * searchInfo1;
13842   FSCatalogInfo * searchInfo2;
13843 };
13844 typedef struct FSSearchParams FSSearchParams;
13845 typedef FSSearchParams * FSSearchParamsPtr;
13846 struct FSCatalogBulkParam {
13847   QElemPtr qLink;
13848   short qType;
13849   short ioTrap;
13850   Ptr ioCmdAddr;
13851   IOCompletionUPP ioCompletion;
13852   volatile OSErr ioResult;
13853   Boolean containerChanged;
13854   UInt8 reserved;
13855
13856   FSIteratorFlags iteratorFlags;
13857   FSIterator iterator;
13858   const FSRef * container;
13859   ItemCount maximumItems;
13860   ItemCount actualItems;
13861   FSCatalogInfoBitmap whichInfo;
13862   FSCatalogInfo * catalogInfo;
13863   FSRef * refs;
13864   FSSpec * specs;
13865   HFSUniStr255 * names;
13866   const FSSearchParams * searchParams;
13867 };
13868 typedef struct FSCatalogBulkParam FSCatalogBulkParam;
13869 typedef FSCatalogBulkParam * FSCatalogBulkParamPtr;
13870 typedef UInt16 FSAllocationFlags;
13871 enum {
13872   kFSAllocDefaultFlags = 0x0000,
13873   kFSAllocAllOrNothingMask = 0x0001,
13874   kFSAllocContiguousMask = 0x0002,
13875   kFSAllocNoRoundUpMask = 0x0004,
13876   kFSAllocReservedMask = 0xFFF8
13877 };
13878
13879 struct FSForkIOParam {
13880   QElemPtr qLink;
13881   short qType;
13882   short ioTrap;
13883   Ptr ioCmdAddr;
13884   IOCompletionUPP ioCompletion;
13885   volatile OSErr ioResult;
13886   void * reserved1;
13887   SInt16 reserved2;
13888   SInt16 forkRefNum;
13889   UInt8 reserved3;
13890   SInt8 permissions;
13891   const FSRef * ref;
13892
13893
13894   Ptr buffer;
13895   UInt32 requestCount;
13896   UInt32 actualCount;
13897   UInt16 positionMode;
13898   SInt64 positionOffset;
13899
13900   FSAllocationFlags allocationFlags;
13901   UInt64 allocationAmount;
13902
13903   UniCharCount forkNameLength;
13904   const UniChar * forkName;
13905
13906   CatPositionRec forkIterator;
13907   HFSUniStr255 * outForkName;
13908 };
13909 typedef struct FSForkIOParam FSForkIOParam;
13910 typedef FSForkIOParam * FSForkIOParamPtr;
13911 struct FSForkInfo {
13912   SInt8 flags;
13913   SInt8 permissions;
13914   FSVolumeRefNum volume;
13915   UInt32 reserved2;
13916   UInt32 nodeID;
13917   UInt32 forkID;
13918   UInt64 currentPosition;
13919   UInt64 logicalEOF;
13920   UInt64 physicalEOF;
13921   UInt64 process;
13922 };
13923 typedef struct FSForkInfo FSForkInfo;
13924 typedef FSForkInfo * FSForkInfoPtr;
13925 struct FSForkCBInfoParam {
13926   QElemPtr qLink;
13927   short qType;
13928   short ioTrap;
13929   Ptr ioCmdAddr;
13930   IOCompletionUPP ioCompletion;
13931   volatile OSErr ioResult;
13932   SInt16 desiredRefNum;
13933   SInt16 volumeRefNum;
13934   SInt16 iterator;
13935   SInt16 actualRefNum;
13936
13937   FSRef * ref;
13938   FSForkInfo * forkInfo;
13939   HFSUniStr255 * forkName;
13940 };
13941 typedef struct FSForkCBInfoParam FSForkCBInfoParam;
13942 typedef FSForkCBInfoParam * FSForkCBInfoParamPtr;
13943 typedef UInt32 FSVolumeInfoBitmap;
13944 enum {
13945   kFSVolInfoNone = 0x0000,
13946   kFSVolInfoCreateDate = 0x0001,
13947   kFSVolInfoModDate = 0x0002,
13948   kFSVolInfoBackupDate = 0x0004,
13949   kFSVolInfoCheckedDate = 0x0008,
13950   kFSVolInfoFileCount = 0x0010,
13951   kFSVolInfoDirCount = 0x0020,
13952   kFSVolInfoSizes = 0x0040,
13953   kFSVolInfoBlocks = 0x0080,
13954   kFSVolInfoNextAlloc = 0x0100,
13955   kFSVolInfoRsrcClump = 0x0200,
13956   kFSVolInfoDataClump = 0x0400,
13957   kFSVolInfoNextID = 0x0800,
13958   kFSVolInfoFinderInfo = 0x1000,
13959   kFSVolInfoFlags = 0x2000,
13960   kFSVolInfoFSInfo = 0x4000,
13961   kFSVolInfoDriveInfo = 0x8000,
13962   kFSVolInfoGettableInfo = 0xFFFF,
13963   kFSVolInfoSettableInfo = 0x3004
13964 };
13965
13966
13967 enum {
13968   kFSVolFlagDefaultVolumeBit = 5,
13969   kFSVolFlagDefaultVolumeMask = 0x0020,
13970   kFSVolFlagFilesOpenBit = 6,
13971   kFSVolFlagFilesOpenMask = 0x0040,
13972   kFSVolFlagHardwareLockedBit = 7,
13973   kFSVolFlagHardwareLockedMask = 0x0080,
13974   kFSVolFlagSoftwareLockedBit = 15,
13975   kFSVolFlagSoftwareLockedMask = 0x8000
13976 };
13977
13978
13979 struct FSVolumeInfo {
13980
13981   UTCDateTime createDate;
13982   UTCDateTime modifyDate;
13983   UTCDateTime backupDate;
13984   UTCDateTime checkedDate;
13985
13986
13987   UInt32 fileCount;
13988   UInt32 folderCount;
13989
13990
13991   UInt64 totalBytes;
13992   UInt64 freeBytes;
13993
13994
13995   UInt32 blockSize;
13996   UInt32 totalBlocks;
13997   UInt32 freeBlocks;
13998   UInt32 nextAllocation;
13999   UInt32 rsrcClumpSize;
14000   UInt32 dataClumpSize;
14001   UInt32 nextCatalogID;
14002   UInt8 finderInfo[32];
14003
14004
14005   UInt16 flags;
14006   UInt16 filesystemID;
14007   UInt16 signature;
14008   UInt16 driveNumber;
14009   short driverRefNum;
14010 };
14011 typedef struct FSVolumeInfo FSVolumeInfo;
14012 typedef FSVolumeInfo * FSVolumeInfoPtr;
14013 struct FSVolumeInfoParam {
14014   QElemPtr qLink;
14015   short qType;
14016   short ioTrap;
14017   Ptr ioCmdAddr;
14018   IOCompletionUPP ioCompletion;
14019   volatile OSErr ioResult;
14020   StringPtr ioNamePtr;
14021   FSVolumeRefNum ioVRefNum;
14022
14023   UInt32 volumeIndex;
14024   FSVolumeInfoBitmap whichInfo;
14025   FSVolumeInfo * volumeInfo;
14026   HFSUniStr255 * volumeName;
14027   FSRef * ref;
14028 };
14029 typedef struct FSVolumeInfoParam FSVolumeInfoParam;
14030 typedef FSVolumeInfoParam * FSVolumeInfoParamPtr;
14031 extern OSErr
14032 FSpMakeFSRef(
14033   const FSSpec * source,
14034   FSRef * newRef) ;
14035 extern OSErr
14036 PBMakeFSRefSync(FSRefParam * paramBlock) ;
14037 extern void
14038 PBMakeFSRefAsync(FSRefParam * paramBlock) ;
14039 extern OSErr
14040 FSMakeFSRefUnicode(
14041   const FSRef * parentRef,
14042   UniCharCount nameLength,
14043   const UniChar * name,
14044   TextEncoding textEncodingHint,
14045   FSRef * newRef) ;
14046 extern OSErr
14047 PBMakeFSRefUnicodeSync(FSRefParam * paramBlock) ;
14048 extern void
14049 PBMakeFSRefUnicodeAsync(FSRefParam * paramBlock) ;
14050 extern OSErr
14051 FSCompareFSRefs(
14052   const FSRef * ref1,
14053   const FSRef * ref2) ;
14054 extern OSErr
14055 PBCompareFSRefsSync(FSRefParam * paramBlock) ;
14056 extern void
14057 PBCompareFSRefsAsync(FSRefParam * paramBlock) ;
14058 extern OSErr
14059 FSCreateFileUnicode(
14060   const FSRef * parentRef,
14061   UniCharCount nameLength,
14062   const UniChar * name,
14063   FSCatalogInfoBitmap whichInfo,
14064   const FSCatalogInfo * catalogInfo,
14065   FSRef * newRef,
14066   FSSpec * newSpec) ;
14067 extern OSErr
14068 PBCreateFileUnicodeSync(FSRefParam * paramBlock) ;
14069 extern void
14070 PBCreateFileUnicodeAsync(FSRefParam * paramBlock) ;
14071 extern OSErr
14072 FSCreateDirectoryUnicode(
14073   const FSRef * parentRef,
14074   UniCharCount nameLength,
14075   const UniChar * name,
14076   FSCatalogInfoBitmap whichInfo,
14077   const FSCatalogInfo * catalogInfo,
14078   FSRef * newRef,
14079   FSSpec * newSpec,
14080   UInt32 * newDirID) ;
14081 extern OSErr
14082 PBCreateDirectoryUnicodeSync(FSRefParam * paramBlock) ;
14083 extern void
14084 PBCreateDirectoryUnicodeAsync(FSRefParam * paramBlock) ;
14085 extern OSErr
14086 FSDeleteObject(const FSRef * ref) ;
14087 extern OSErr
14088 PBDeleteObjectSync(FSRefParam * paramBlock) ;
14089 extern void
14090 PBDeleteObjectAsync(FSRefParam * paramBlock) ;
14091 extern OSErr
14092 FSMoveObject(
14093   const FSRef * ref,
14094   const FSRef * destDirectory,
14095   FSRef * newRef) ;
14096 extern OSErr
14097 PBMoveObjectSync(FSRefParam * paramBlock) ;
14098 extern void
14099 PBMoveObjectAsync(FSRefParam * paramBlock) ;
14100 extern OSErr
14101 FSExchangeObjects(
14102   const FSRef * ref,
14103   const FSRef * destRef) ;
14104 extern OSErr
14105 PBExchangeObjectsSync(FSRefParam * paramBlock) ;
14106 extern void
14107 PBExchangeObjectsAsync(FSRefParam * paramBlock) ;
14108 extern OSErr
14109 FSRenameUnicode(
14110   const FSRef * ref,
14111   UniCharCount nameLength,
14112   const UniChar * name,
14113   TextEncoding textEncodingHint,
14114   FSRef * newRef) ;
14115 extern OSErr
14116 PBRenameUnicodeSync(FSRefParam * paramBlock) ;
14117 extern void
14118 PBRenameUnicodeAsync(FSRefParam * paramBlock) ;
14119 extern OSErr
14120 FSGetCatalogInfo(
14121   const FSRef * ref,
14122   FSCatalogInfoBitmap whichInfo,
14123   FSCatalogInfo * catalogInfo,
14124   HFSUniStr255 * outName,
14125   FSSpec * fsSpec,
14126   FSRef * parentRef) ;
14127 extern OSErr
14128 PBGetCatalogInfoSync(FSRefParam * paramBlock) ;
14129 extern void
14130 PBGetCatalogInfoAsync(FSRefParam * paramBlock) ;
14131 extern OSErr
14132 FSSetCatalogInfo(
14133   const FSRef * ref,
14134   FSCatalogInfoBitmap whichInfo,
14135   const FSCatalogInfo * catalogInfo) ;
14136 extern OSErr
14137 PBSetCatalogInfoSync(FSRefParam * paramBlock) ;
14138 extern void
14139 PBSetCatalogInfoAsync(FSRefParam * paramBlock) ;
14140 extern OSErr
14141 FSOpenIterator(
14142   const FSRef * container,
14143   FSIteratorFlags iteratorFlags,
14144   FSIterator * iterator) ;
14145 extern OSErr
14146 PBOpenIteratorSync(FSCatalogBulkParam * paramBlock) ;
14147 extern void
14148 PBOpenIteratorAsync(FSCatalogBulkParam * paramBlock) ;
14149 extern OSErr
14150 FSCloseIterator(FSIterator iterator) ;
14151 extern OSErr
14152 PBCloseIteratorSync(FSCatalogBulkParam * paramBlock) ;
14153 extern void
14154 PBCloseIteratorAsync(FSCatalogBulkParam * paramBlock) ;
14155 extern OSErr
14156 FSGetCatalogInfoBulk(
14157   FSIterator iterator,
14158   ItemCount maximumObjects,
14159   ItemCount * actualObjects,
14160   Boolean * containerChanged,
14161   FSCatalogInfoBitmap whichInfo,
14162   FSCatalogInfo * catalogInfos,
14163   FSRef * refs,
14164   FSSpec * specs,
14165   HFSUniStr255 * names) ;
14166 extern OSErr
14167 PBGetCatalogInfoBulkSync(FSCatalogBulkParam * paramBlock) ;
14168 extern void
14169 PBGetCatalogInfoBulkAsync(FSCatalogBulkParam * paramBlock) ;
14170 extern OSErr
14171 FSCatalogSearch(
14172   FSIterator iterator,
14173   const FSSearchParams * searchCriteria,
14174   ItemCount maximumObjects,
14175   ItemCount * actualObjects,
14176   Boolean * containerChanged,
14177   FSCatalogInfoBitmap whichInfo,
14178   FSCatalogInfo * catalogInfos,
14179   FSRef * refs,
14180   FSSpec * specs,
14181   HFSUniStr255 * names) ;
14182 extern OSErr
14183 PBCatalogSearchSync(FSCatalogBulkParam * paramBlock) ;
14184 extern void
14185 PBCatalogSearchAsync(FSCatalogBulkParam * paramBlock) ;
14186 extern OSErr
14187 FSCreateFork(
14188   const FSRef * ref,
14189   UniCharCount forkNameLength,
14190   const UniChar * forkName) ;
14191 extern OSErr
14192 PBCreateForkSync(FSForkIOParam * paramBlock) ;
14193 extern void
14194 PBCreateForkAsync(FSForkIOParam * paramBlock) ;
14195 extern OSErr
14196 FSDeleteFork(
14197   const FSRef * ref,
14198   UniCharCount forkNameLength,
14199   const UniChar * forkName) ;
14200 extern OSErr
14201 PBDeleteForkSync(FSForkIOParam * paramBlock) ;
14202 extern void
14203 PBDeleteForkAsync(FSForkIOParam * paramBlock) ;
14204 extern OSErr
14205 FSIterateForks(
14206   const FSRef * ref,
14207   CatPositionRec * forkIterator,
14208   HFSUniStr255 * forkName,
14209   SInt64 * forkSize,
14210   UInt64 * forkPhysicalSize) ;
14211 extern OSErr
14212 PBIterateForksSync(FSForkIOParam * paramBlock) ;
14213 extern void
14214 PBIterateForksAsync(FSForkIOParam * paramBlock) ;
14215 extern OSErr
14216 FSOpenFork(
14217   const FSRef * ref,
14218   UniCharCount forkNameLength,
14219   const UniChar * forkName,
14220   SInt8 permissions,
14221   SInt16 * forkRefNum) ;
14222 extern OSErr
14223 PBOpenForkSync(FSForkIOParam * paramBlock) ;
14224 extern void
14225 PBOpenForkAsync(FSForkIOParam * paramBlock) ;
14226 extern OSErr
14227 FSReadFork(
14228   SInt16 forkRefNum,
14229   UInt16 positionMode,
14230   SInt64 positionOffset,
14231   ByteCount requestCount,
14232   void * buffer,
14233   ByteCount * actualCount) ;
14234 extern OSErr
14235 PBReadForkSync(FSForkIOParam * paramBlock) ;
14236 extern void
14237 PBReadForkAsync(FSForkIOParam * paramBlock) ;
14238 extern OSErr
14239 FSWriteFork(
14240   SInt16 forkRefNum,
14241   UInt16 positionMode,
14242   SInt64 positionOffset,
14243   ByteCount requestCount,
14244   const void * buffer,
14245   ByteCount * actualCount) ;
14246 extern OSErr
14247 PBWriteForkSync(FSForkIOParam * paramBlock) ;
14248 extern void
14249 PBWriteForkAsync(FSForkIOParam * paramBlock) ;
14250 extern OSErr
14251 FSGetForkPosition(
14252   SInt16 forkRefNum,
14253   SInt64 * position) ;
14254 extern OSErr
14255 PBGetForkPositionSync(FSForkIOParam * paramBlock) ;
14256 extern void
14257 PBGetForkPositionAsync(FSForkIOParam * paramBlock) ;
14258 extern OSErr
14259 FSSetForkPosition(
14260   SInt16 forkRefNum,
14261   UInt16 positionMode,
14262   SInt64 positionOffset) ;
14263 extern OSErr
14264 PBSetForkPositionSync(FSForkIOParam * paramBlock) ;
14265 extern void
14266 PBSetForkPositionAsync(FSForkIOParam * paramBlock) ;
14267 extern OSErr
14268 FSGetForkSize(
14269   SInt16 forkRefNum,
14270   SInt64 * forkSize) ;
14271 extern OSErr
14272 PBGetForkSizeSync(FSForkIOParam * paramBlock) ;
14273 extern void
14274 PBGetForkSizeAsync(FSForkIOParam * paramBlock) ;
14275 extern OSErr
14276 FSSetForkSize(
14277   SInt16 forkRefNum,
14278   UInt16 positionMode,
14279   SInt64 positionOffset) ;
14280 extern OSErr
14281 PBSetForkSizeSync(FSForkIOParam * paramBlock) ;
14282 extern void
14283 PBSetForkSizeAsync(FSForkIOParam * paramBlock) ;
14284 extern OSErr
14285 FSAllocateFork(
14286   SInt16 forkRefNum,
14287   FSAllocationFlags flags,
14288   UInt16 positionMode,
14289   SInt64 positionOffset,
14290   UInt64 requestCount,
14291   UInt64 * actualCount) ;
14292 extern OSErr
14293 PBAllocateForkSync(FSForkIOParam * paramBlock) ;
14294 extern void
14295 PBAllocateForkAsync(FSForkIOParam * paramBlock) ;
14296 extern OSErr
14297 FSFlushFork(SInt16 forkRefNum) ;
14298 extern OSErr
14299 PBFlushForkSync(FSForkIOParam * paramBlock) ;
14300 extern void
14301 PBFlushForkAsync(FSForkIOParam * paramBlock) ;
14302 extern OSErr
14303 FSCloseFork(SInt16 forkRefNum) ;
14304 extern OSErr
14305 PBCloseForkSync(FSForkIOParam * paramBlock) ;
14306 extern void
14307 PBCloseForkAsync(FSForkIOParam * paramBlock) ;
14308 extern OSErr
14309 FSGetForkCBInfo(
14310   SInt16 desiredRefNum,
14311   FSVolumeRefNum volume,
14312   SInt16 * iterator,
14313   SInt16 * actualRefNum,
14314   FSForkInfo * forkInfo,
14315   FSRef * ref,
14316   HFSUniStr255 * outForkName) ;
14317 extern OSErr
14318 PBGetForkCBInfoSync(FSForkCBInfoParam * paramBlock) ;
14319 extern void
14320 PBGetForkCBInfoAsync(FSForkCBInfoParam * paramBlock) ;
14321 extern OSErr
14322 FSGetVolumeInfo(
14323   FSVolumeRefNum volume,
14324   ItemCount volumeIndex,
14325   FSVolumeRefNum * actualVolume,
14326   FSVolumeInfoBitmap whichInfo,
14327   FSVolumeInfo * info,
14328   HFSUniStr255 * volumeName,
14329   FSRef * rootDirectory) ;
14330 extern OSErr
14331 PBGetVolumeInfoSync(FSVolumeInfoParam * paramBlock) ;
14332 extern void
14333 PBGetVolumeInfoAsync(FSVolumeInfoParam * paramBlock) ;
14334 extern OSErr
14335 FSSetVolumeInfo(
14336   FSVolumeRefNum volume,
14337   FSVolumeInfoBitmap whichInfo,
14338   const FSVolumeInfo * info) ;
14339 extern OSErr
14340 PBSetVolumeInfoSync(FSVolumeInfoParam * paramBlock) ;
14341 extern void
14342 PBSetVolumeInfoAsync(FSVolumeInfoParam * paramBlock) ;
14343 extern OSErr
14344 FSGetDataForkName(HFSUniStr255 * dataForkName) ;
14345 extern OSErr
14346 FSGetResourceForkName(HFSUniStr255 * resourceForkName) ;
14347 extern OSStatus
14348 FSRefMakePath(
14349   const FSRef * ref,
14350   UInt8 * path,
14351   UInt32 maxPathSize) ;
14352 extern OSStatus
14353 FSPathMakeRef(
14354   const UInt8 * path,
14355   FSRef * ref,
14356   Boolean * isDirectory) ;
14357 typedef UInt32 FNMessage;
14358 enum {
14359   kFNDirectoryModifiedMessage = 1
14360 };
14361 extern OSStatus
14362 FNNotify(
14363   const FSRef * ref,
14364   FNMessage message,
14365   OptionBits flags) ;
14366 extern OSStatus
14367 FNNotifyByPath(
14368   const UInt8 * path,
14369   FNMessage message,
14370   OptionBits flags) ;
14371 extern OSStatus
14372 FNNotifyAll(
14373   FNMessage message,
14374   OptionBits flags) ;
14375 typedef struct OpaqueFNSubscriptionRef* FNSubscriptionRef;
14376
14377
14378
14379
14380
14381 enum {
14382
14383
14384
14385
14386
14387
14388
14389   kFNNoImplicitAllSubscription = (1 << 0)
14390 };
14391 typedef void ( * FNSubscriptionProcPtr)(FNMessage message, OptionBits flags, void *refcon, FNSubscriptionRef subscription);
14392 typedef FNSubscriptionProcPtr FNSubscriptionUPP;
14393 extern FNSubscriptionUPP
14394 NewFNSubscriptionUPP(FNSubscriptionProcPtr userRoutine) ;
14395 extern void
14396 DisposeFNSubscriptionUPP(FNSubscriptionUPP userUPP) ;
14397 extern void
14398 InvokeFNSubscriptionUPP(
14399   FNMessage message,
14400   OptionBits flags,
14401   void * refcon,
14402   FNSubscriptionRef subscription,
14403   FNSubscriptionUPP userUPP) ;
14404 extern OSStatus
14405 FNSubscribe(
14406   const FSRef * directoryRef,
14407   FNSubscriptionUPP callback,
14408   void * refcon,
14409   OptionBits flags,
14410   FNSubscriptionRef * subscription) ;
14411 extern OSStatus
14412 FNSubscribeByPath(
14413   const UInt8 * directoryPath,
14414   FNSubscriptionUPP callback,
14415   void * refcon,
14416   OptionBits flags,
14417   FNSubscriptionRef * subscription) ;
14418 extern OSStatus
14419 FNUnsubscribe(FNSubscriptionRef subscription) ;
14420 extern OSStatus
14421 FNGetDirectoryForSubscription(
14422   FNSubscriptionRef subscription,
14423   FSRef * ref) ;
14424
14425
14426
14427 enum {
14428   kAsyncMountInProgress = 1,
14429   kAsyncMountComplete = 2,
14430   kAsyncUnmountInProgress = 3,
14431   kAsyncUnmountComplete = 4,
14432   kAsyncEjectInProgress = 5,
14433   kAsyncEjectComplete = 6
14434 };
14435
14436 typedef UInt32 FSMountStatus;
14437 typedef UInt32 FSEjectStatus;
14438 typedef UInt32 FSUnmountStatus;
14439 typedef struct OpaqueFSVolumeOperation* FSVolumeOperation;
14440 typedef void ( * FSVolumeMountProcPtr)(FSVolumeOperation volumeOp, void *clientData, OSStatus err, FSVolumeRefNum mountedVolumeRefNum);
14441 typedef void ( * FSVolumeUnmountProcPtr)(FSVolumeOperation volumeOp, void *clientData, OSStatus err, FSVolumeRefNum volumeRefNum, pid_t dissenter);
14442 typedef void ( * FSVolumeEjectProcPtr)(FSVolumeOperation volumeOp, void *clientData, OSStatus err, FSVolumeRefNum volumeRefNum, pid_t dissenter);
14443 typedef FSVolumeMountProcPtr FSVolumeMountUPP;
14444 typedef FSVolumeUnmountProcPtr FSVolumeUnmountUPP;
14445 typedef FSVolumeEjectProcPtr FSVolumeEjectUPP;
14446 extern FSVolumeMountUPP
14447 NewFSVolumeMountUPP(FSVolumeMountProcPtr userRoutine) ;
14448 extern FSVolumeUnmountUPP
14449 NewFSVolumeUnmountUPP(FSVolumeUnmountProcPtr userRoutine) ;
14450 extern FSVolumeEjectUPP
14451 NewFSVolumeEjectUPP(FSVolumeEjectProcPtr userRoutine) ;
14452 extern void
14453 DisposeFSVolumeMountUPP(FSVolumeMountUPP userUPP) ;
14454 extern void
14455 DisposeFSVolumeUnmountUPP(FSVolumeUnmountUPP userUPP) ;
14456 extern void
14457 DisposeFSVolumeEjectUPP(FSVolumeEjectUPP userUPP) ;
14458 extern void
14459 InvokeFSVolumeMountUPP(
14460   FSVolumeOperation volumeOp,
14461   void * clientData,
14462   OSStatus err,
14463   FSVolumeRefNum mountedVolumeRefNum,
14464   FSVolumeMountUPP userUPP) ;
14465 extern void
14466 InvokeFSVolumeUnmountUPP(
14467   FSVolumeOperation volumeOp,
14468   void * clientData,
14469   OSStatus err,
14470   FSVolumeRefNum volumeRefNum,
14471   pid_t dissenter,
14472   FSVolumeUnmountUPP userUPP) ;
14473 extern void
14474 InvokeFSVolumeEjectUPP(
14475   FSVolumeOperation volumeOp,
14476   void * clientData,
14477   OSStatus err,
14478   FSVolumeRefNum volumeRefNum,
14479   pid_t dissenter,
14480   FSVolumeEjectUPP userUPP) ;
14481 extern OSStatus
14482 FSCreateVolumeOperation(FSVolumeOperation * volumeOp) ;
14483 extern OSStatus
14484 FSDisposeVolumeOperation(FSVolumeOperation volumeOp) ;
14485 extern OSStatus
14486 FSMountLocalVolumeSync(
14487   CFStringRef diskID,
14488   CFURLRef mountDir,
14489   FSVolumeRefNum * mountedVolumeRefNum,
14490   OptionBits flags) ;
14491 extern OSStatus
14492 FSMountLocalVolumeAsync(
14493   CFStringRef diskID,
14494   CFURLRef mountDir,
14495   FSVolumeOperation volumeOp,
14496   void * clientData,
14497   OptionBits flags,
14498   FSVolumeMountUPP callback,
14499   CFRunLoopRef runloop,
14500   CFStringRef runloopMode) ;
14501 extern OSStatus
14502 FSMountServerVolumeSync(
14503   CFURLRef url,
14504   CFURLRef mountDir,
14505   CFStringRef user,
14506   CFStringRef password,
14507   FSVolumeRefNum * mountedVolumeRefNum,
14508   OptionBits flags) ;
14509 extern OSStatus
14510 FSMountServerVolumeAsync(
14511   CFURLRef url,
14512   CFURLRef mountDir,
14513   CFStringRef user,
14514   CFStringRef password,
14515   FSVolumeOperation volumeOp,
14516   void * clientData,
14517   OptionBits flags,
14518   FSVolumeMountUPP callback,
14519   CFRunLoopRef runloop,
14520   CFStringRef runloopMode) ;
14521 extern OSStatus
14522 FSGetAsyncMountStatus(
14523   FSVolumeOperation volumeOp,
14524   FSMountStatus * status,
14525   OSStatus * volumeOpStatus,
14526   FSVolumeRefNum * mountedVolumeRefNum,
14527   void ** clientData) ;
14528 extern OSStatus
14529 FSUnmountVolumeSync(
14530   FSVolumeRefNum vRefNum,
14531   OptionBits flags,
14532   pid_t * dissenter) ;
14533 extern OSStatus
14534 FSUnmountVolumeAsync(
14535   FSVolumeRefNum vRefNum,
14536   OptionBits flags,
14537   FSVolumeOperation volumeOp,
14538   void * clientData,
14539   FSVolumeUnmountUPP callback,
14540   CFRunLoopRef runloop,
14541   CFStringRef runloopMode) ;
14542 extern OSStatus
14543 FSGetAsyncUnmountStatus(
14544   FSVolumeOperation volumeOp,
14545   FSUnmountStatus * status,
14546   OSStatus * volumeOpStatus,
14547   FSVolumeRefNum * volumeRefNum,
14548   pid_t * dissenter,
14549   void ** clientData) ;
14550 extern OSStatus
14551 FSCancelVolumeOperation(FSVolumeOperation volumeOp) ;
14552 extern OSStatus
14553 FSEjectVolumeSync(
14554   FSVolumeRefNum vRefNum,
14555   OptionBits flags,
14556   pid_t * dissenter) ;
14557 extern OSStatus
14558 FSEjectVolumeAsync(
14559   FSVolumeRefNum vRefNum,
14560   OptionBits flags,
14561   FSVolumeOperation volumeOp,
14562   void * clientData,
14563   FSVolumeEjectUPP callback,
14564   CFRunLoopRef runloop,
14565   CFStringRef runloopMode) ;
14566 extern OSStatus
14567 FSGetAsyncEjectStatus(
14568   FSVolumeOperation volumeOp,
14569   FSEjectStatus * status,
14570   OSStatus * volumeOpStatus,
14571   FSVolumeRefNum * volumeRefNum,
14572   pid_t * dissenter,
14573   void ** clientData) ;
14574 extern OSStatus
14575 FSCopyDiskIDForVolume(
14576   FSVolumeRefNum vRefNum,
14577   CFStringRef * diskID) ;
14578
14579
14580
14581
14582
14583
14584 }
14585 extern "C" {
14586
14587
14588
14589 enum {
14590   kAppleManufacturer = 'appl',
14591   kComponentResourceType = 'thng',
14592   kComponentAliasResourceType = 'thga'
14593 };
14594
14595 enum {
14596   kAnyComponentType = 0,
14597   kAnyComponentSubType = 0,
14598   kAnyComponentManufacturer = 0,
14599   kAnyComponentFlagsMask = 0
14600 };
14601
14602 enum {
14603   cmpIsMissing = 1L << 29,
14604   cmpWantsRegisterMessage = 1L << 31
14605 };
14606
14607 enum {
14608   kComponentOpenSelect = -1,
14609   kComponentCloseSelect = -2,
14610   kComponentCanDoSelect = -3,
14611   kComponentVersionSelect = -4,
14612   kComponentRegisterSelect = -5,
14613   kComponentTargetSelect = -6,
14614   kComponentUnregisterSelect = -7,
14615   kComponentGetMPWorkFunctionSelect = -8,
14616   kComponentExecuteWiredActionSelect = -9,
14617   kComponentGetPublicResourceSelect = -10
14618 };
14619
14620
14621 enum {
14622   componentDoAutoVersion = (1 << 0),
14623   componentWantsUnregister = (1 << 1),
14624   componentAutoVersionIncludeFlags = (1 << 2),
14625   componentHasMultiplePlatforms = (1 << 3),
14626   componentLoadResident = (1 << 4)
14627 };
14628
14629
14630
14631
14632 enum {
14633   defaultComponentIdentical = 0,
14634   defaultComponentAnyFlags = 1,
14635   defaultComponentAnyManufacturer = 2,
14636   defaultComponentAnySubType = 4,
14637   defaultComponentAnyFlagsAnyManufacturer = (defaultComponentAnyFlags + defaultComponentAnyManufacturer),
14638   defaultComponentAnyFlagsAnyManufacturerAnySubType = (defaultComponentAnyFlags + defaultComponentAnyManufacturer + defaultComponentAnySubType)
14639 };
14640
14641
14642 enum {
14643   registerComponentGlobal = 1,
14644   registerComponentNoDuplicates = 2,
14645   registerComponentAfterExisting = 4,
14646   registerComponentAliasesOnly = 8
14647 };
14648
14649
14650 struct ComponentDescription {
14651   OSType componentType;
14652   OSType componentSubType;
14653   OSType componentManufacturer;
14654   unsigned long componentFlags;
14655   unsigned long componentFlagsMask;
14656 };
14657 typedef struct ComponentDescription ComponentDescription;
14658
14659 struct ResourceSpec {
14660   OSType resType;
14661   short resID;
14662 };
14663 typedef struct ResourceSpec ResourceSpec;
14664 struct ComponentResource {
14665   ComponentDescription cd;
14666   ResourceSpec component;
14667   ResourceSpec componentName;
14668   ResourceSpec componentInfo;
14669   ResourceSpec componentIcon;
14670 };
14671 typedef struct ComponentResource ComponentResource;
14672 typedef ComponentResource * ComponentResourcePtr;
14673 typedef ComponentResourcePtr * ComponentResourceHandle;
14674 struct ComponentPlatformInfo {
14675   long componentFlags;
14676   ResourceSpec component;
14677   short platformType;
14678 };
14679 typedef struct ComponentPlatformInfo ComponentPlatformInfo;
14680 struct ComponentResourceExtension {
14681   long componentVersion;
14682   long componentRegisterFlags;
14683   short componentIconFamily;
14684 };
14685 typedef struct ComponentResourceExtension ComponentResourceExtension;
14686 struct ComponentPlatformInfoArray {
14687   long count;
14688   ComponentPlatformInfo platformArray[1];
14689 };
14690 typedef struct ComponentPlatformInfoArray ComponentPlatformInfoArray;
14691 struct ExtComponentResource {
14692   ComponentDescription cd;
14693   ResourceSpec component;
14694   ResourceSpec componentName;
14695   ResourceSpec componentInfo;
14696   ResourceSpec componentIcon;
14697   long componentVersion;
14698   long componentRegisterFlags;
14699   short componentIconFamily;
14700   long count;
14701   ComponentPlatformInfo platformArray[1];
14702 };
14703 typedef struct ExtComponentResource ExtComponentResource;
14704 typedef ExtComponentResource * ExtComponentResourcePtr;
14705 typedef ExtComponentResourcePtr * ExtComponentResourceHandle;
14706 struct ComponentAliasResource {
14707   ComponentResource cr;
14708   ComponentDescription aliasCD;
14709 };
14710 typedef struct ComponentAliasResource ComponentAliasResource;
14711
14712 struct ComponentParameters {
14713   UInt8 flags;
14714   UInt8 paramSize;
14715   short what;
14716   long params[1];
14717 };
14718 typedef struct ComponentParameters ComponentParameters;
14719 struct ComponentRecord {
14720   long data[1];
14721 };
14722 typedef struct ComponentRecord ComponentRecord;
14723 typedef ComponentRecord * Component;
14724 struct ComponentInstanceRecord {
14725   long data[1];
14726 };
14727 typedef struct ComponentInstanceRecord ComponentInstanceRecord;
14728 typedef ComponentInstanceRecord * ComponentInstance;
14729 struct RegisteredComponentRecord {
14730   long data[1];
14731 };
14732 typedef struct RegisteredComponentRecord RegisteredComponentRecord;
14733 typedef RegisteredComponentRecord * RegisteredComponentRecordPtr;
14734 struct RegisteredComponentInstanceRecord {
14735   long data[1];
14736 };
14737 typedef struct RegisteredComponentInstanceRecord RegisteredComponentInstanceRecord;
14738 typedef RegisteredComponentInstanceRecord * RegisteredComponentInstanceRecordPtr;
14739 typedef long ComponentResult;
14740 enum {
14741   platform68k = 1,
14742   platformPowerPC = 2,
14743   platformInterpreted = 3,
14744   platformWin32 = 4,
14745   platformPowerPCNativeEntryPoint = 5
14746 };
14747
14748 enum {
14749   platformIRIXmips = 1000,
14750   platformSunOSsparc = 1100,
14751   platformSunOSintel = 1101,
14752   platformLinuxppc = 1200,
14753   platformLinuxintel = 1201,
14754   platformAIXppc = 1300,
14755   platformNeXTIntel = 1400,
14756   platformNeXTppc = 1401,
14757   platformNeXTsparc = 1402,
14758   platformNeXT68k = 1403,
14759   platformMacOSx86 = 1500
14760 };
14761
14762 enum {
14763   mpWorkFlagDoWork = (1 << 0),
14764   mpWorkFlagDoCompletion = (1 << 1),
14765   mpWorkFlagCopyWorkBlock = (1 << 2),
14766   mpWorkFlagDontBlock = (1 << 3),
14767   mpWorkFlagGetProcessorCount = (1 << 4),
14768   mpWorkFlagGetIsRunning = (1 << 6)
14769 };
14770
14771 enum {
14772   cmpAliasNoFlags = 0,
14773   cmpAliasOnlyThisFile = 1
14774 };
14775
14776 struct ComponentMPWorkFunctionHeaderRecord {
14777   UInt32 headerSize;
14778   UInt32 recordSize;
14779   UInt32 workFlags;
14780   UInt16 processorCount;
14781   UInt8 unused;
14782   UInt8 isRunning;
14783 };
14784 typedef struct ComponentMPWorkFunctionHeaderRecord ComponentMPWorkFunctionHeaderRecord;
14785 typedef ComponentMPWorkFunctionHeaderRecord * ComponentMPWorkFunctionHeaderRecordPtr;
14786 typedef ComponentResult ( * ComponentMPWorkFunctionProcPtr)(void *globalRefCon, ComponentMPWorkFunctionHeaderRecordPtr header);
14787 typedef ComponentResult ( * ComponentRoutineProcPtr)(ComponentParameters *cp, Handle componentStorage);
14788 typedef OSErr ( * GetMissingComponentResourceProcPtr)(Component c, OSType resType, short resID, void *refCon, Handle *resource);
14789 typedef ComponentMPWorkFunctionProcPtr ComponentMPWorkFunctionUPP;
14790 typedef ComponentRoutineProcPtr ComponentRoutineUPP;
14791 typedef GetMissingComponentResourceProcPtr GetMissingComponentResourceUPP;
14792
14793
14794
14795
14796
14797 typedef UniversalProcPtr ComponentFunctionUPP;
14798 extern ComponentFunctionUPP
14799 NewComponentFunctionUPP(
14800   ProcPtr userRoutine,
14801   ProcInfoType procInfo) ;
14802 extern void
14803 DisposeComponentFunctionUPP(ComponentFunctionUPP userUPP) ;
14804 extern Component
14805 RegisterComponent(
14806   ComponentDescription * cd,
14807   ComponentRoutineUPP componentEntryPoint,
14808   short global,
14809   Handle componentName,
14810   Handle componentInfo,
14811   Handle componentIcon) ;
14812 extern Component
14813 RegisterComponentResource(
14814   ComponentResourceHandle cr,
14815   short global) ;
14816 extern OSErr
14817 UnregisterComponent(Component aComponent) ;
14818 extern Component
14819 FindNextComponent(
14820   Component aComponent,
14821   ComponentDescription * looking) ;
14822 extern long
14823 CountComponents(ComponentDescription * looking) ;
14824 extern OSErr
14825 GetComponentInfo(
14826   Component aComponent,
14827   ComponentDescription * cd,
14828   Handle componentName,
14829   Handle componentInfo,
14830   Handle componentIcon) ;
14831 extern long
14832 GetComponentListModSeed(void) ;
14833 extern long
14834 GetComponentTypeModSeed(OSType componentType) ;
14835 extern OSErr
14836 OpenAComponent(
14837   Component aComponent,
14838   ComponentInstance * ci) ;
14839 extern ComponentInstance
14840 OpenComponent(Component aComponent) ;
14841 extern OSErr
14842 CloseComponent(ComponentInstance aComponentInstance) ;
14843 extern OSErr
14844 GetComponentInstanceError(ComponentInstance aComponentInstance) ;
14845 extern Component
14846 ResolveComponentAlias(Component aComponent) ;
14847 extern OSErr
14848 GetComponentPublicResource(
14849   Component aComponent,
14850   OSType resourceType,
14851   short resourceID,
14852   Handle * theResource) ;
14853 extern OSErr
14854 GetComponentPublicResourceList(
14855   OSType resourceType,
14856   short resourceID,
14857   long flags,
14858   ComponentDescription * cd,
14859   GetMissingComponentResourceUPP missingProc,
14860   void * refCon,
14861   void * atomContainerPtr) ;
14862 extern OSErr
14863 GetComponentPublicIndString(
14864   Component aComponent,
14865   Str255 theString,
14866   short strListID,
14867   short index) ;
14868 extern void
14869 SetComponentInstanceError(
14870   ComponentInstance aComponentInstance,
14871   OSErr theError) ;
14872 extern long
14873 GetComponentRefcon(Component aComponent) ;
14874 extern void
14875 SetComponentRefcon(
14876   Component aComponent,
14877   long theRefcon) ;
14878 extern short
14879 OpenComponentResFile(Component aComponent) ;
14880 extern OSErr
14881 OpenAComponentResFile(
14882   Component aComponent,
14883   short * resRef) ;
14884 extern OSErr
14885 CloseComponentResFile(short refnum) ;
14886 extern OSErr
14887 GetComponentResource(
14888   Component aComponent,
14889   OSType resType,
14890   short resID,
14891   Handle * theResource) ;
14892 extern OSErr
14893 GetComponentIndString(
14894   Component aComponent,
14895   Str255 theString,
14896   short strListID,
14897   short index) ;
14898 extern Handle
14899 GetComponentInstanceStorage(ComponentInstance aComponentInstance) ;
14900 extern void
14901 SetComponentInstanceStorage(
14902   ComponentInstance aComponentInstance,
14903   Handle theStorage) ;
14904 extern long
14905 CountComponentInstances(Component aComponent) ;
14906 extern long
14907 CallComponentFunction(
14908   ComponentParameters * params,
14909   ComponentFunctionUPP func) ;
14910 extern long
14911 CallComponentFunctionWithStorage(
14912   Handle storage,
14913   ComponentParameters * params,
14914   ComponentFunctionUPP func) ;
14915 extern long
14916 CallComponentFunctionWithStorageProcInfo(
14917   Handle storage,
14918   ComponentParameters * params,
14919   ProcPtr func,
14920   ProcInfoType funcProcInfo) ;
14921 extern long
14922 DelegateComponentCall(
14923   ComponentParameters * originalParams,
14924   ComponentInstance ci) ;
14925 extern OSErr
14926 SetDefaultComponent(
14927   Component aComponent,
14928   short flags) ;
14929 extern ComponentInstance
14930 OpenDefaultComponent(
14931   OSType componentType,
14932   OSType componentSubType) ;
14933 extern OSErr
14934 OpenADefaultComponent(
14935   OSType componentType,
14936   OSType componentSubType,
14937   ComponentInstance * ci) ;
14938 extern Component
14939 CaptureComponent(
14940   Component capturedComponent,
14941   Component capturingComponent) ;
14942 extern OSErr
14943 UncaptureComponent(Component aComponent) ;
14944 extern long
14945 RegisterComponentResourceFile(
14946   short resRefNum,
14947   short global) ;
14948 extern OSErr
14949 GetComponentIconSuite(
14950   Component aComponent,
14951   Handle * iconSuite) ;
14952 extern OSErr
14953 RegisterComponentFile(
14954   const FSSpec * spec,
14955   short global) ;
14956 extern OSErr
14957 RegisterComponentFileEntries(
14958   const FSSpec * spec,
14959   short global,
14960   const ComponentDescription * toRegister,
14961   UInt32 registerCount) ;
14962 extern OSErr
14963 RegisterComponentFileRef(
14964   const FSRef * ref,
14965   short global) ;
14966 extern OSErr
14967 RegisterComponentFileRefEntries(
14968   const FSRef * ref,
14969   short global,
14970   const ComponentDescription * toRegister,
14971   UInt32 registerCount) ;
14972 extern long
14973 ComponentFunctionImplemented(
14974   ComponentInstance ci,
14975   short ftnNumber) ;
14976 extern long
14977 GetComponentVersion(ComponentInstance ci) ;
14978 extern long
14979 ComponentSetTarget(
14980   ComponentInstance ci,
14981   ComponentInstance target) ;
14982 extern ComponentResult
14983 CallComponentOpen(
14984   ComponentInstance ci,
14985   ComponentInstance self) ;
14986 extern ComponentResult
14987 CallComponentClose(
14988   ComponentInstance ci,
14989   ComponentInstance self) ;
14990 extern ComponentResult
14991 CallComponentCanDo(
14992   ComponentInstance ci,
14993   short ftnNumber) ;
14994 extern ComponentResult
14995 CallComponentVersion(ComponentInstance ci) ;
14996 extern ComponentResult
14997 CallComponentRegister(ComponentInstance ci) ;
14998 extern ComponentResult
14999 CallComponentTarget(
15000   ComponentInstance ci,
15001   ComponentInstance target) ;
15002 extern ComponentResult
15003 CallComponentUnregister(ComponentInstance ci) ;
15004 extern ComponentResult
15005 CallComponentGetMPWorkFunction(
15006   ComponentInstance ci,
15007   ComponentMPWorkFunctionUPP * workFunction,
15008   void ** refCon) ;
15009 extern ComponentResult
15010 CallComponentGetPublicResource(
15011   ComponentInstance ci,
15012   OSType resourceType,
15013   short resourceID,
15014   Handle * resource) ;
15015 extern ComponentResult
15016 CallComponentDispatch(ComponentParameters * cp) ;
15017 extern ComponentMPWorkFunctionUPP
15018 NewComponentMPWorkFunctionUPP(ComponentMPWorkFunctionProcPtr userRoutine) ;
15019 extern ComponentRoutineUPP
15020 NewComponentRoutineUPP(ComponentRoutineProcPtr userRoutine) ;
15021 extern GetMissingComponentResourceUPP
15022 NewGetMissingComponentResourceUPP(GetMissingComponentResourceProcPtr userRoutine) ;
15023 extern void
15024 DisposeComponentMPWorkFunctionUPP(ComponentMPWorkFunctionUPP userUPP) ;
15025 extern void
15026 DisposeComponentRoutineUPP(ComponentRoutineUPP userUPP) ;
15027 extern void
15028 DisposeGetMissingComponentResourceUPP(GetMissingComponentResourceUPP userUPP) ;
15029 extern ComponentResult
15030 InvokeComponentMPWorkFunctionUPP(
15031   void * globalRefCon,
15032   ComponentMPWorkFunctionHeaderRecordPtr header,
15033   ComponentMPWorkFunctionUPP userUPP) ;
15034 extern ComponentResult
15035 InvokeComponentRoutineUPP(
15036   ComponentParameters * cp,
15037   Handle componentStorage,
15038   ComponentRoutineUPP userUPP) ;
15039 extern OSErr
15040 InvokeGetMissingComponentResourceUPP(
15041   Component c,
15042   OSType resType,
15043   short resID,
15044   void * refCon,
15045   Handle * resource,
15046   GetMissingComponentResourceUPP userUPP) ;
15047
15048
15049
15050
15051 enum {
15052     uppComponentFunctionImplementedProcInfo = 0x000002F0,
15053     uppGetComponentVersionProcInfo = 0x000000F0,
15054     uppComponentSetTargetProcInfo = 0x000003F0,
15055     uppCallComponentOpenProcInfo = 0x000003F0,
15056     uppCallComponentCloseProcInfo = 0x000003F0,
15057     uppCallComponentCanDoProcInfo = 0x000002F0,
15058     uppCallComponentVersionProcInfo = 0x000000F0,
15059     uppCallComponentRegisterProcInfo = 0x000000F0,
15060     uppCallComponentTargetProcInfo = 0x000003F0,
15061     uppCallComponentUnregisterProcInfo = 0x000000F0,
15062     uppCallComponentGetMPWorkFunctionProcInfo = 0x00000FF0,
15063     uppCallComponentGetPublicResourceProcInfo = 0x00003BF0
15064 };
15065
15066
15067
15068
15069
15070
15071
15072
15073
15074 }
15075 extern "C" {
15076
15077
15078
15079 enum {
15080   resSysHeap = 64,
15081   resPurgeable = 32,
15082   resLocked = 16,
15083   resProtected = 8,
15084   resPreload = 4,
15085   resChanged = 2,
15086   mapReadOnly = 128,
15087   mapCompact = 64,
15088   mapChanged = 32
15089 };
15090
15091 enum {
15092   resSysRefBit = 7,
15093   resSysHeapBit = 6,
15094   resPurgeableBit = 5,
15095   resLockedBit = 4,
15096   resProtectedBit = 3,
15097   resPreloadBit = 2,
15098   resChangedBit = 1,
15099   mapReadOnlyBit = 7,
15100   mapCompactBit = 6,
15101   mapChangedBit = 5
15102 };
15103
15104 enum {
15105   kResFileNotOpened = -1,
15106   kSystemResFile = 0
15107 };
15108
15109
15110 typedef void ( * ResErrProcPtr)(OSErr thErr);
15111 typedef ResErrProcPtr ResErrUPP;
15112 extern ResErrUPP
15113 NewResErrUPP(ResErrProcPtr userRoutine) ;
15114 extern void
15115 DisposeResErrUPP(ResErrUPP userUPP) ;
15116 extern void
15117 InvokeResErrUPP(
15118   OSErr thErr,
15119   ResErrUPP userUPP) ;
15120
15121
15122 typedef OSErr ( * ResourceEndianFilterPtr)(Handle theResource, Boolean currentlyNativeEndian);
15123 extern void
15124 CloseResFile(short refNum) ;
15125 extern OSErr
15126 ResError(void) ;
15127 extern short
15128 CurResFile(void) ;
15129 extern short
15130 HomeResFile(Handle theResource) ;
15131 extern void
15132 UseResFile(short refNum) ;
15133 extern short
15134 CountTypes(void) ;
15135 extern short
15136 Count1Types(void) ;
15137 extern void
15138 GetIndType(
15139   ResType * theType,
15140   short index) ;
15141 extern void
15142 Get1IndType(
15143   ResType * theType,
15144   short index) ;
15145 extern void
15146 SetResLoad(Boolean load) ;
15147 extern short
15148 CountResources(ResType theType) ;
15149 extern short
15150 Count1Resources(ResType theType) ;
15151 extern Handle
15152 GetIndResource(
15153   ResType theType,
15154   short index) ;
15155 extern Handle
15156 Get1IndResource(
15157   ResType theType,
15158   short index) ;
15159 extern Handle
15160 GetResource(
15161   ResType theType,
15162   short theID) ;
15163 extern Handle
15164 Get1Resource(
15165   ResType theType,
15166   short theID) ;
15167 extern Handle
15168 GetNamedResource(
15169   ResType theType,
15170   ConstStr255Param name) ;
15171 extern Handle
15172 Get1NamedResource(
15173   ResType theType,
15174   ConstStr255Param name) ;
15175 extern void
15176 LoadResource(Handle theResource) ;
15177 extern void
15178 ReleaseResource(Handle theResource) ;
15179 extern void
15180 DetachResource(Handle theResource) ;
15181 extern short
15182 UniqueID(ResType theType) ;
15183 extern short
15184 Unique1ID(ResType theType) ;
15185 extern short
15186 GetResAttrs(Handle theResource) ;
15187 extern void
15188 GetResInfo(
15189   Handle theResource,
15190   short * theID,
15191   ResType * theType,
15192   Str255 name) ;
15193 extern void
15194 SetResInfo(
15195   Handle theResource,
15196   short theID,
15197   ConstStr255Param name) ;
15198 extern void
15199 AddResource(
15200   Handle theData,
15201   ResType theType,
15202   short theID,
15203   ConstStr255Param name) ;
15204 extern long
15205 GetResourceSizeOnDisk(Handle theResource) ;
15206 extern long
15207 GetMaxResourceSize(Handle theResource) ;
15208 extern void
15209 SetResAttrs(
15210   Handle theResource,
15211   short attrs) ;
15212 extern void
15213 ChangedResource(Handle theResource) ;
15214 extern void
15215 RemoveResource(Handle theResource) ;
15216 extern void
15217 UpdateResFile(short refNum) ;
15218 extern void
15219 WriteResource(Handle theResource) ;
15220 extern void
15221 SetResPurge(Boolean install) ;
15222 extern short
15223 GetResFileAttrs(short refNum) ;
15224 extern void
15225 SetResFileAttrs(
15226   short refNum,
15227   short attrs) ;
15228 extern short
15229 OpenRFPerm(
15230   ConstStr255Param fileName,
15231   short vRefNum,
15232   SInt8 permission) ;
15233 extern short
15234 HOpenResFile(
15235   short vRefNum,
15236   long dirID,
15237   ConstStr255Param fileName,
15238   SInt8 permission) ;
15239 extern void
15240 HCreateResFile(
15241   short vRefNum,
15242   long dirID,
15243   ConstStr255Param fileName) ;
15244 extern short
15245 FSpOpenResFile(
15246   const FSSpec * spec,
15247   SignedByte permission) ;
15248 extern void
15249 FSpCreateResFile(
15250   const FSSpec * spec,
15251   OSType creator,
15252   OSType fileType,
15253   ScriptCode scriptTag) ;
15254 extern void
15255 ReadPartialResource(
15256   Handle theResource,
15257   long offset,
15258   void * buffer,
15259   long count) ;
15260 extern void
15261 WritePartialResource(
15262   Handle theResource,
15263   long offset,
15264   const void * buffer,
15265   long count) ;
15266 extern void
15267 SetResourceSize(
15268   Handle theResource,
15269   long newSize) ;
15270 extern Handle
15271 GetNextFOND(Handle fondHandle) ;
15272 typedef SInt16 RsrcChainLocation;
15273 enum {
15274   kRsrcChainBelowSystemMap = 0,
15275   kRsrcChainBelowApplicationMap = 1,
15276   kRsrcChainAboveApplicationMap = 2,
15277   kRsrcChainAboveAllMaps = 4
15278 };
15279 extern OSErr
15280 InsertResourceFile(
15281   SInt16 refNum,
15282   RsrcChainLocation where) ;
15283 extern OSErr
15284 DetachResourceFile(SInt16 refNum) ;
15285 extern Boolean
15286 FSpResourceFileAlreadyOpen(
15287   const FSSpec * resourceFile,
15288   Boolean * inChain,
15289   SInt16 * refNum) ;
15290 extern OSErr
15291 FSpOpenOrphanResFile(
15292   const FSSpec * spec,
15293   SignedByte permission,
15294   SInt16 * refNum) ;
15295 extern OSErr
15296 GetTopResourceFile(SInt16 * refNum) ;
15297 extern OSErr
15298 GetNextResourceFile(
15299   SInt16 curRefNum,
15300   SInt16 * nextRefNum) ;
15301 extern short
15302 FSOpenResFile(
15303   const FSRef * ref,
15304   SInt8 permission) ;
15305 extern void
15306 FSCreateResFile(
15307   const FSRef * parentRef,
15308   UniCharCount nameLength,
15309   const UniChar * name,
15310   FSCatalogInfoBitmap whichInfo,
15311   const FSCatalogInfo * catalogInfo,
15312   FSRef * newRef,
15313   FSSpec * newSpec) ;
15314 extern Boolean
15315 FSResourceFileAlreadyOpen(
15316   const FSRef * resourceFileRef,
15317   Boolean * inChain,
15318   SInt16 * refNum) ;
15319 extern OSErr
15320 FSCreateResourceFile(
15321   const FSRef * parentRef,
15322   UniCharCount nameLength,
15323   const UniChar * name,
15324   FSCatalogInfoBitmap whichInfo,
15325   const FSCatalogInfo * catalogInfo,
15326   UniCharCount forkNameLength,
15327   const UniChar * forkName,
15328   FSRef * newRef,
15329   FSSpec * newSpec) ;
15330 extern OSErr
15331 FSCreateResourceFork(
15332   const FSRef * ref,
15333   UniCharCount forkNameLength,
15334   const UniChar * forkName,
15335   UInt32 flags) ;
15336 extern OSErr
15337 FSOpenResourceFile(
15338   const FSRef * ref,
15339   UniCharCount forkNameLength,
15340   const UniChar * forkName,
15341   SInt8 permissions,
15342   SInt16 * refNum) ;
15343
15344
15345
15346
15347
15348 typedef short ResFileRefNum;
15349 typedef short ResID;
15350 typedef short ResAttributes;
15351 typedef short ResFileAttributes;
15352 }
15353
15354
15355
15356 extern "C" {
15357
15358
15359 enum {
15360   MPLibrary_MajorVersion = 2,
15361   MPLibrary_MinorVersion = 3,
15362   MPLibrary_Release = 1,
15363   MPLibrary_DevelopmentRevision = 1
15364 };
15365
15366
15367
15368 typedef struct OpaqueMPProcessID* MPProcessID;
15369 typedef struct OpaqueMPTaskID* MPTaskID;
15370 typedef struct OpaqueMPQueueID* MPQueueID;
15371 typedef struct OpaqueMPSemaphoreID* MPSemaphoreID;
15372 typedef struct OpaqueMPCriticalRegionID* MPCriticalRegionID;
15373 typedef struct OpaqueMPTimerID* MPTimerID;
15374 typedef struct OpaqueMPEventID* MPEventID;
15375 typedef struct OpaqueMPAddressSpaceID* MPAddressSpaceID;
15376 typedef struct OpaqueMPNotificationID* MPNotificationID;
15377 typedef struct OpaqueMPCoherenceID* MPCoherenceID;
15378 typedef struct OpaqueMPCpuID* MPCpuID;
15379 typedef struct OpaqueMPAreaID* MPAreaID;
15380 typedef struct OpaqueMPConsoleID* MPConsoleID;
15381 typedef struct OpaqueMPOpaqueID* MPOpaqueID;
15382 enum {
15383
15384   kOpaqueAnyID = 0,
15385   kOpaqueProcessID = 1,
15386   kOpaqueTaskID = 2,
15387   kOpaqueTimerID = 3,
15388   kOpaqueQueueID = 4,
15389   kOpaqueSemaphoreID = 5,
15390   kOpaqueCriticalRegionID = 6,
15391   kOpaqueCpuID = 7,
15392   kOpaqueAddressSpaceID = 8,
15393   kOpaqueEventID = 9,
15394   kOpaqueCoherenceID = 10,
15395   kOpaqueAreaID = 11,
15396   kOpaqueNotificationID = 12,
15397   kOpaqueConsoleID = 13
15398 };
15399
15400 typedef UInt32 MPOpaqueIDClass;
15401
15402 enum {
15403   kMPNoID = 0
15404 };
15405
15406
15407 typedef OptionBits MPTaskOptions;
15408 typedef UInt32 TaskStorageIndex;
15409 typedef UInt32 TaskStorageValue;
15410 typedef ItemCount MPSemaphoreCount;
15411 typedef UInt32 MPTaskWeight;
15412 typedef UInt32 MPEventFlags;
15413 typedef UInt32 MPExceptionKind;
15414 typedef UInt32 MPTaskStateKind;
15415 typedef UInt32 MPPageSizeClass;
15416
15417 enum {
15418   kDurationImmediate = 0L,
15419   kDurationForever = 0x7FFFFFFF,
15420   kDurationMillisecond = 1,
15421   kDurationMicrosecond = -1
15422 };
15423 extern ItemCount
15424 MPProcessors(void) ;
15425 extern ItemCount
15426 MPProcessorsScheduled(void) ;
15427 enum {
15428
15429   kMPCreateTaskSuspendedMask = 1L << 0,
15430   kMPCreateTaskTakesAllExceptionsMask = 1L << 1,
15431   kMPCreateTaskNotDebuggableMask = 1L << 2,
15432   kMPCreateTaskValidOptionsMask = kMPCreateTaskSuspendedMask | kMPCreateTaskTakesAllExceptionsMask | kMPCreateTaskNotDebuggableMask
15433 };
15434
15435
15436
15437
15438
15439
15440
15441 typedef OSStatus ( * TaskProc)(void * parameter);
15442 extern OSStatus
15443 MPCreateTask(
15444   TaskProc entryPoint,
15445   void * parameter,
15446   ByteCount stackSize,
15447   MPQueueID notifyQueue,
15448   void * terminationParameter1,
15449   void * terminationParameter2,
15450   MPTaskOptions options,
15451   MPTaskID * task) ;
15452 extern OSStatus
15453 MPTerminateTask(
15454   MPTaskID task,
15455   OSStatus terminationStatus) ;
15456 extern OSStatus
15457 MPSetTaskWeight(
15458   MPTaskID task,
15459   MPTaskWeight weight) ;
15460 extern Boolean
15461 MPTaskIsPreemptive(MPTaskID taskID) ;
15462 extern void
15463 MPExit(OSStatus status) ;
15464 extern void
15465 MPYield(void) ;
15466 extern MPTaskID
15467 MPCurrentTaskID(void) ;
15468 extern OSStatus
15469 MPSetTaskType(
15470   MPTaskID task,
15471   OSType taskType) ;
15472 extern OSStatus
15473 MPAllocateTaskStorageIndex(TaskStorageIndex * index) ;
15474 extern OSStatus
15475 MPDeallocateTaskStorageIndex(TaskStorageIndex index) ;
15476 extern OSStatus
15477 MPSetTaskStorageValue(
15478   TaskStorageIndex index,
15479   TaskStorageValue value) ;
15480 extern TaskStorageValue
15481 MPGetTaskStorageValue(TaskStorageIndex index) ;
15482 extern OSStatus
15483 MPCreateQueue(MPQueueID * queue) ;
15484 extern OSStatus
15485 MPDeleteQueue(MPQueueID queue) ;
15486 extern OSStatus
15487 MPNotifyQueue(
15488   MPQueueID queue,
15489   void * param1,
15490   void * param2,
15491   void * param3) ;
15492 extern OSStatus
15493 MPWaitOnQueue(
15494   MPQueueID queue,
15495   void ** param1,
15496   void ** param2,
15497   void ** param3,
15498   Duration timeout) ;
15499 extern OSStatus
15500 MPSetQueueReserve(
15501   MPQueueID queue,
15502   ItemCount count) ;
15503 extern OSStatus
15504 MPCreateSemaphore(
15505   MPSemaphoreCount maximumValue,
15506   MPSemaphoreCount initialValue,
15507   MPSemaphoreID * semaphore) ;
15508 extern OSStatus
15509 MPDeleteSemaphore(MPSemaphoreID semaphore) ;
15510 extern OSStatus
15511 MPSignalSemaphore(MPSemaphoreID semaphore) ;
15512 extern OSStatus
15513 MPWaitOnSemaphore(
15514   MPSemaphoreID semaphore,
15515   Duration timeout) ;
15516 extern OSStatus
15517 MPCreateCriticalRegion(MPCriticalRegionID * criticalRegion) ;
15518 extern OSStatus
15519 MPDeleteCriticalRegion(MPCriticalRegionID criticalRegion) ;
15520 extern OSStatus
15521 MPEnterCriticalRegion(
15522   MPCriticalRegionID criticalRegion,
15523   Duration timeout) ;
15524 extern OSStatus
15525 MPExitCriticalRegion(MPCriticalRegionID criticalRegion) ;
15526 extern OSStatus
15527 MPCreateEvent(MPEventID * event) ;
15528 extern OSStatus
15529 MPDeleteEvent(MPEventID event) ;
15530 extern OSStatus
15531 MPSetEvent(
15532   MPEventID event,
15533   MPEventFlags flags) ;
15534 extern OSStatus
15535 MPWaitForEvent(
15536   MPEventID event,
15537   MPEventFlags * flags,
15538   Duration timeout) ;
15539 extern OSStatus
15540 MPCreateNotification(MPNotificationID * notificationID) ;
15541 extern OSStatus
15542 MPDeleteNotification(MPNotificationID notificationID) ;
15543 extern OSStatus
15544 MPModifyNotification(
15545   MPNotificationID notificationID,
15546   MPOpaqueID anID,
15547   void * notifyParam1,
15548   void * notifyParam2,
15549   void * notifyParam3) ;
15550 extern OSStatus
15551 MPModifyNotificationParameters(
15552   MPNotificationID notificationID,
15553   MPOpaqueIDClass kind,
15554   void * notifyParam1,
15555   void * notifyParam2,
15556   void * notifyParam3) ;
15557 extern OSStatus
15558 MPCauseNotification(MPNotificationID notificationID) ;
15559 enum {
15560
15561   kMPPreserveTimerIDMask = 1L << 0,
15562   kMPTimeIsDeltaMask = 1L << 1,
15563   kMPTimeIsDurationMask = 1L << 2
15564 };
15565 extern OSStatus
15566 MPDelayUntil(AbsoluteTime * expirationTime) ;
15567 extern OSStatus
15568 MPCreateTimer(MPTimerID * timerID) ;
15569 extern OSStatus
15570 MPDeleteTimer(MPTimerID timerID) ;
15571 extern OSStatus
15572 MPSetTimerNotify(
15573   MPTimerID timerID,
15574   MPOpaqueID anID,
15575   void * notifyParam1,
15576   void * notifyParam2,
15577   void * notifyParam3) ;
15578 extern OSStatus
15579 MPArmTimer(
15580   MPTimerID timerID,
15581   AbsoluteTime * expirationTime,
15582   OptionBits options) ;
15583 extern OSStatus
15584 MPCancelTimer(
15585   MPTimerID timerID,
15586   AbsoluteTime * timeRemaining) ;
15587 enum {
15588
15589   kMPMaxAllocSize = 1024L * 1024 * 1024
15590 };
15591
15592 enum {
15593
15594   kMPAllocateDefaultAligned = 0,
15595   kMPAllocate8ByteAligned = 3,
15596   kMPAllocate16ByteAligned = 4,
15597   kMPAllocate32ByteAligned = 5,
15598   kMPAllocate1024ByteAligned = 10,
15599   kMPAllocate4096ByteAligned = 12,
15600   kMPAllocateMaxAlignment = 16,
15601   kMPAllocateAltiVecAligned = kMPAllocate16ByteAligned,
15602   kMPAllocateVMXAligned = kMPAllocateAltiVecAligned,
15603   kMPAllocateVMPageAligned = 254,
15604   kMPAllocateInterlockAligned = 255
15605 };
15606
15607
15608
15609 enum {
15610
15611   kMPAllocateClearMask = 0x0001,
15612   kMPAllocateGloballyMask = 0x0002,
15613   kMPAllocateResidentMask = 0x0004,
15614   kMPAllocateNoGrowthMask = 0x0010,
15615   kMPAllocateNoCreateMask = 0x0020
15616 };
15617 extern LogicalAddress
15618 MPAllocateAligned(
15619   ByteCount size,
15620   UInt8 alignment,
15621   OptionBits options) ;
15622 extern LogicalAddress
15623 MPAllocate(ByteCount size) ;
15624 extern void
15625 MPFree(LogicalAddress object) ;
15626 extern ByteCount
15627 MPGetAllocatedBlockSize(LogicalAddress object) ;
15628 extern void
15629 MPBlockCopy(
15630   LogicalAddress source,
15631   LogicalAddress destination,
15632   ByteCount size) ;
15633 extern void
15634 MPBlockClear(
15635   LogicalAddress address,
15636   ByteCount size) ;
15637 extern void
15638 MPDataToCode(
15639   LogicalAddress address,
15640   ByteCount size) ;
15641 enum {
15642
15643   kMPTaskStateRegisters = 0,
15644   kMPTaskStateFPU = 1,
15645   kMPTaskStateVectors = 2,
15646   kMPTaskStateMachine = 3,
15647   kMPTaskState32BitMemoryException = 4,
15648   kMPTaskStateTaskInfo = 5
15649 };
15650
15651
15652
15653 enum {
15654
15655   kMPTaskPropagate = 0,
15656   kMPTaskResumeStep = 1,
15657   kMPTaskResumeBranch = 2,
15658   kMPTaskResumeMask = 0x0000,
15659   kMPTaskPropagateMask = 1 << kMPTaskPropagate,
15660   kMPTaskResumeStepMask = 1 << kMPTaskResumeStep,
15661   kMPTaskResumeBranchMask = 1 << kMPTaskResumeBranch
15662 };
15663
15664
15665
15666 enum {
15667
15668   kMPTaskBlocked = 0,
15669   kMPTaskReady = 1,
15670   kMPTaskRunning = 2
15671 };
15672
15673 enum {
15674
15675   kMPTaskInfoVersion = 3
15676 };
15677
15678
15679 struct MPTaskInfoVersion2 {
15680   PBVersion version;
15681
15682   OSType name;
15683
15684   OSType queueName;
15685   UInt16 runState;
15686   UInt16 lastCPU;
15687   UInt32 weight;
15688
15689   MPProcessID processID;
15690
15691   AbsoluteTime cpuTime;
15692   AbsoluteTime schedTime;
15693   AbsoluteTime creationTime;
15694
15695   ItemCount codePageFaults;
15696   ItemCount dataPageFaults;
15697   ItemCount preemptions;
15698
15699   MPCpuID cpuID;
15700 };
15701 typedef struct MPTaskInfoVersion2 MPTaskInfoVersion2;
15702 struct MPTaskInfo {
15703   PBVersion version;
15704
15705   OSType name;
15706
15707   OSType queueName;
15708   UInt16 runState;
15709   UInt16 lastCPU;
15710   UInt32 weight;
15711
15712   MPProcessID processID;
15713
15714   AbsoluteTime cpuTime;
15715   AbsoluteTime schedTime;
15716   AbsoluteTime creationTime;
15717
15718   ItemCount codePageFaults;
15719   ItemCount dataPageFaults;
15720   ItemCount preemptions;
15721
15722   MPCpuID cpuID;
15723   MPOpaqueID blockedObject;
15724   MPAddressSpaceID spaceID;
15725
15726   LogicalAddress stackBase;
15727   LogicalAddress stackLimit;
15728   LogicalAddress stackCurr;
15729 };
15730 typedef struct MPTaskInfo MPTaskInfo;
15731 extern OSStatus
15732 MPSetExceptionHandler(
15733   MPTaskID task,
15734   MPQueueID exceptionQ) ;
15735 extern OSStatus
15736 MPDisposeTaskException(
15737   MPTaskID task,
15738   OptionBits action) ;
15739 extern OSStatus
15740 MPExtractTaskState(
15741   MPTaskID task,
15742   MPTaskStateKind kind,
15743   void * info) ;
15744 extern OSStatus
15745 MPSetTaskState(
15746   MPTaskID task,
15747   MPTaskStateKind kind,
15748   void * info) ;
15749 extern OSStatus
15750 MPThrowException(
15751   MPTaskID task,
15752   MPExceptionKind kind) ;
15753
15754
15755
15756
15757
15758
15759 typedef UInt32 MPDebuggerLevel;
15760 enum {
15761   kMPLowLevelDebugger = 0x00000000,
15762   kMPMidLevelDebugger = 0x10000000,
15763   kMPHighLevelDebugger = 0x20000000
15764 };
15765 extern OSStatus
15766 MPRegisterDebugger(
15767   MPQueueID queue,
15768   MPDebuggerLevel level) ;
15769 extern OSStatus
15770 MPUnregisterDebugger(MPQueueID queue) ;
15771 typedef void * ( * MPRemoteProcedure)(void * parameter);
15772
15773 typedef UInt8 MPRemoteContext;
15774 enum {
15775   kMPAnyRemoteContext = 0,
15776   kMPOwningProcessRemoteContext = 1,
15777   kMPInterruptRemoteContext = 2,
15778   kMPAsyncInterruptRemoteContext = 3
15779 };
15780 extern void *
15781 MPRemoteCall(
15782   MPRemoteProcedure remoteProc,
15783   void * parameter,
15784   MPRemoteContext context) ;
15785 extern Boolean
15786 _MPIsFullyInitialized(void) ;
15787
15788
15789 typedef Boolean ( * MPIsFullyInitializedProc)(void);
15790 extern void
15791 _MPLibraryVersion(
15792   const char ** versionCString,
15793   UInt32 * major,
15794   UInt32 * minor,
15795   UInt32 * release,
15796   UInt32 * revision) ;
15797 extern Boolean
15798 _MPLibraryIsCompatible(
15799   const char * versionCString,
15800   UInt32 major,
15801   UInt32 minor,
15802   UInt32 release,
15803   UInt32 revision) ;
15804
15805
15806 }
15807 extern "C" {
15808
15809
15810 enum {
15811   kCFragResourceType = 'cfrg',
15812   kCFragResourceID = 0,
15813   kCFragLibraryFileType = 'shlb',
15814   kCFragAllFileTypes = (long)0xFFFFFFFF
15815 };
15816
15817
15818 typedef OSType CFragArchitecture;
15819 enum {
15820
15821   kPowerPCCFragArch = 'pwpc',
15822   kMotorola68KCFragArch = 'm68k',
15823   kAnyCFragArch = 0x3F3F3F3F
15824 };
15825
15826
15827
15828 enum {
15829   kCompiledCFragArch = kPowerPCCFragArch
15830 };
15831 typedef UInt32 CFragVersionNumber;
15832 enum {
15833   kNullCFragVersion = 0,
15834   kWildcardCFragVersion = (long)0xFFFFFFFF
15835 };
15836
15837
15838 typedef UInt8 CFragUsage;
15839 enum {
15840
15841   kImportLibraryCFrag = 0,
15842   kApplicationCFrag = 1,
15843   kDropInAdditionCFrag = 2,
15844   kStubLibraryCFrag = 3,
15845   kWeakStubLibraryCFrag = 4
15846 };
15847
15848
15849 enum {
15850   kIsCompleteCFrag = 0,
15851   kFirstCFragUpdate = 1
15852 };
15853
15854
15855 enum {
15856   kCFragGoesToEOF = 0
15857 };
15858
15859
15860
15861
15862 typedef UInt8 CFragLocatorKind;
15863 enum {
15864
15865   kMemoryCFragLocator = 0,
15866   kDataForkCFragLocator = 1,
15867   kResourceCFragLocator = 2,
15868   kNamedFragmentCFragLocator = 4,
15869   kCFBundleCFragLocator = 5,
15870   kCFBundlePreCFragLocator = 6
15871 };
15872 union CFragUsage1Union {
15873   UInt32 appStackSize;
15874 };
15875 typedef union CFragUsage1Union CFragUsage1Union;
15876 union CFragUsage2Union {
15877   SInt16 appSubdirID;
15878   UInt16 libFlags;
15879 };
15880 typedef union CFragUsage2Union CFragUsage2Union;
15881 enum {
15882
15883   kCFragLibUsageMapPrivatelyMask = 0x0001
15884 };
15885
15886 union CFragWhere1Union {
15887   UInt32 spaceID;
15888 };
15889 typedef union CFragWhere1Union CFragWhere1Union;
15890 union CFragWhere2Union {
15891   UInt16 reserved;
15892 };
15893 typedef union CFragWhere2Union CFragWhere2Union;
15894 enum {
15895   kDefaultCFragNameLen = 16
15896 };
15897
15898
15899 struct CFragResourceMember {
15900   CFragArchitecture architecture;
15901   UInt16 reservedA;
15902   UInt8 reservedB;
15903   UInt8 updateLevel;
15904   CFragVersionNumber currentVersion;
15905   CFragVersionNumber oldDefVersion;
15906   CFragUsage1Union uUsage1;
15907   CFragUsage2Union uUsage2;
15908   CFragUsage usage;
15909   CFragLocatorKind where;
15910   UInt32 offset;
15911   UInt32 length;
15912   CFragWhere1Union uWhere1;
15913   CFragWhere2Union uWhere2;
15914   UInt16 extensionCount;
15915   UInt16 memberSize;
15916   unsigned char name[16];
15917 };
15918 typedef struct CFragResourceMember CFragResourceMember;
15919 typedef CFragResourceMember * CFragResourceMemberPtr;
15920 struct CFragResourceExtensionHeader {
15921   UInt16 extensionKind;
15922   UInt16 extensionSize;
15923 };
15924 typedef struct CFragResourceExtensionHeader CFragResourceExtensionHeader;
15925 typedef CFragResourceExtensionHeader * CFragResourceExtensionHeaderPtr;
15926 struct CFragResourceSearchExtension {
15927   CFragResourceExtensionHeader header;
15928   OSType libKind;
15929   unsigned char qualifiers[1];
15930 };
15931 typedef struct CFragResourceSearchExtension CFragResourceSearchExtension;
15932 typedef CFragResourceSearchExtension * CFragResourceSearchExtensionPtr;
15933 enum {
15934   kCFragResourceSearchExtensionKind = 0x30EE
15935 };
15936
15937
15938 struct CFragResource {
15939   UInt32 reservedA;
15940   UInt32 reservedB;
15941   UInt16 reservedC;
15942   UInt16 version;
15943   UInt32 reservedD;
15944   UInt32 reservedE;
15945   UInt32 reservedF;
15946   UInt32 reservedG;
15947   UInt16 reservedH;
15948   UInt16 memberCount;
15949   CFragResourceMember firstMember;
15950 };
15951 typedef struct CFragResource CFragResource;
15952 typedef CFragResource * CFragResourcePtr;
15953 typedef CFragResourcePtr * CFragResourceHandle;
15954 enum {
15955   kCurrCFragResourceVersion = 1
15956 };
15957 typedef MPProcessID CFragContextID;
15958 typedef struct OpaqueCFragConnectionID* CFragConnectionID;
15959 typedef struct OpaqueCFragClosureID* CFragClosureID;
15960 typedef struct OpaqueCFragContainerID* CFragContainerID;
15961 typedef OptionBits CFragLoadOptions;
15962 enum {
15963
15964   kReferenceCFrag = 0x0001,
15965   kFindCFrag = 0x0002,
15966   kPrivateCFragCopy = 0x0005
15967 };
15968
15969
15970 enum {
15971   kUnresolvedCFragSymbolAddress = 0
15972 };
15973
15974
15975 typedef UInt8 CFragSymbolClass;
15976 enum {
15977
15978   kCodeCFragSymbol = 0,
15979   kDataCFragSymbol = 1,
15980   kTVectorCFragSymbol = 2,
15981   kTOCCFragSymbol = 3,
15982   kGlueCFragSymbol = 4
15983 };
15984 extern OSErr
15985 GetSharedLibrary(
15986   ConstStr63Param libName,
15987   CFragArchitecture archType,
15988   CFragLoadOptions options,
15989   CFragConnectionID * connID,
15990   Ptr * mainAddr,
15991   Str255 errMessage) ;
15992 extern OSErr
15993 GetDiskFragment(
15994   const FSSpec * fileSpec,
15995   UInt32 offset,
15996   UInt32 length,
15997   ConstStr63Param fragName,
15998   CFragLoadOptions options,
15999   CFragConnectionID * connID,
16000   Ptr * mainAddr,
16001   Str255 errMessage) ;
16002 extern OSErr
16003 GetMemFragment(
16004   void * memAddr,
16005   UInt32 length,
16006   ConstStr63Param fragName,
16007   CFragLoadOptions options,
16008   CFragConnectionID * connID,
16009   Ptr * mainAddr,
16010   Str255 errMessage) ;
16011 extern OSErr
16012 CloseConnection(CFragConnectionID * connID) ;
16013 extern OSErr
16014 FindSymbol(
16015   CFragConnectionID connID,
16016   ConstStr255Param symName,
16017   Ptr * symAddr,
16018   CFragSymbolClass * symClass) ;
16019 extern OSErr
16020 CountSymbols(
16021   CFragConnectionID connID,
16022   long * symCount) ;
16023 extern OSErr
16024 GetIndSymbol(
16025   CFragConnectionID connID,
16026   long symIndex,
16027   Str255 symName,
16028   Ptr * symAddr,
16029   CFragSymbolClass * symClass) ;
16030 struct CFragSystem7MemoryLocator {
16031   LogicalAddress address;
16032   UInt32 length;
16033   Boolean inPlace;
16034   UInt8 reservedA;
16035   UInt16 reservedB;
16036 };
16037 typedef struct CFragSystem7MemoryLocator CFragSystem7MemoryLocator;
16038 struct CFragSystem7DiskFlatLocator {
16039   FSSpec * fileSpec;
16040   UInt32 offset;
16041   UInt32 length;
16042 };
16043 typedef struct CFragSystem7DiskFlatLocator CFragSystem7DiskFlatLocator;
16044
16045 struct CFragSystem7SegmentedLocator {
16046   FSSpec * fileSpec;
16047   OSType rsrcType;
16048   SInt16 rsrcID;
16049   UInt16 reservedA;
16050 };
16051 typedef struct CFragSystem7SegmentedLocator CFragSystem7SegmentedLocator;
16052
16053
16054
16055
16056 struct CFragCFBundleLocator {
16057   CFBundleRef fragmentBundle;
16058   UInt32 offset;
16059   UInt32 length;
16060 };
16061 typedef struct CFragCFBundleLocator CFragCFBundleLocator;
16062 struct CFragSystem7Locator {
16063   SInt32 where;
16064   union {
16065     CFragSystem7DiskFlatLocator onDisk;
16066     CFragSystem7MemoryLocator inMem;
16067     CFragSystem7SegmentedLocator inSegs;
16068     CFragCFBundleLocator inBundle;
16069   } u;
16070 };
16071 typedef struct CFragSystem7Locator CFragSystem7Locator;
16072 typedef CFragSystem7Locator * CFragSystem7LocatorPtr;
16073 struct CFragSystem7InitBlock {
16074   CFragContextID contextID;
16075   CFragClosureID closureID;
16076   CFragConnectionID connectionID;
16077   CFragSystem7Locator fragLocator;
16078   StringPtr libName;
16079   UInt32 reservedA;
16080 };
16081 typedef struct CFragSystem7InitBlock CFragSystem7InitBlock;
16082 typedef CFragSystem7InitBlock * CFragSystem7InitBlockPtr;
16083 typedef CFragSystem7InitBlock CFragInitBlock;
16084 typedef CFragSystem7InitBlockPtr CFragInitBlockPtr;
16085
16086 typedef OSErr ( * CFragInitFunction)(const CFragInitBlock * initBlock);
16087 typedef void ( * CFragTermProcedure)(void);
16088 extern OSErr
16089 ConvertBundlePreLocator(CFragSystem7LocatorPtr initBlockLocator) ;
16090 enum {
16091   kLoadCFrag = kReferenceCFrag
16092 };
16093
16094
16095 }
16096
16097
16098
16099 extern "C" {
16100
16101
16102
16103 typedef UInt32 FSAliasInfoBitmap;
16104 enum {
16105   kFSAliasInfoNone = 0x00000000,
16106   kFSAliasInfoVolumeCreateDate = 0x00000001,
16107   kFSAliasInfoTargetCreateDate = 0x00000002,
16108   kFSAliasInfoFinderInfo = 0x00000004,
16109   kFSAliasInfoIsDirectory = 0x00000008,
16110   kFSAliasInfoIDs = 0x00000010,
16111   kFSAliasInfoFSInfo = 0x00000020,
16112   kFSAliasInfoVolumeFlags = 0x00000040
16113 };
16114
16115 enum {
16116   rAliasType = 'alis'
16117 };
16118
16119 enum {
16120
16121   kARMMountVol = 0x00000001,
16122   kARMNoUI = 0x00000002,
16123   kARMMultVols = 0x00000008,
16124   kARMSearch = 0x00000100,
16125   kARMSearchMore = 0x00000200,
16126   kARMSearchRelFirst = 0x00000400,
16127   kARMTryFileIDFirst = 0x00000800
16128 };
16129
16130 enum {
16131
16132   asiZoneName = -3,
16133   asiServerName = -2,
16134   asiVolumeName = -1,
16135   asiAliasName = 0,
16136   asiParentName = 1
16137 };
16138
16139
16140 enum {
16141   kResolveAliasFileNoUI = 0x00000001,
16142   kResolveAliasTryFileIDFirst = 0x00000002
16143 };
16144
16145
16146 struct AliasRecord {
16147   OSType userType;
16148   unsigned short aliasSize;
16149 };
16150 typedef struct AliasRecord AliasRecord;
16151 typedef AliasRecord * AliasPtr;
16152 typedef AliasPtr * AliasHandle;
16153
16154 struct FSAliasInfo {
16155   UTCDateTime volumeCreateDate;
16156   UTCDateTime targetCreateDate;
16157   OSType fileType;
16158   OSType fileCreator;
16159   UInt32 parentDirID;
16160   UInt32 nodeID;
16161   UInt16 filesystemID;
16162   UInt16 signature;
16163   Boolean volumeIsBootVolume;
16164   Boolean volumeIsAutomounted;
16165   Boolean volumeIsEjectable;
16166   Boolean volumeHasPersistentFileIDs;
16167   Boolean isDirectory;
16168 };
16169 typedef struct FSAliasInfo FSAliasInfo;
16170 typedef FSAliasInfo * FSAliasInfoPtr;
16171
16172 typedef short AliasInfoType;
16173 extern OSErr
16174 NewAlias(
16175   const FSSpec * fromFile,
16176   const FSSpec * target,
16177   AliasHandle * alias) ;
16178 extern OSErr
16179 NewAliasMinimal(
16180   const FSSpec * target,
16181   AliasHandle * alias) ;
16182 extern OSErr
16183 NewAliasMinimalFromFullPath(
16184   short fullPathLength,
16185   const void * fullPath,
16186   ConstStr32Param zoneName,
16187   ConstStr31Param serverName,
16188   AliasHandle * alias) ;
16189 extern OSErr
16190 ResolveAlias(
16191   const FSSpec * fromFile,
16192   AliasHandle alias,
16193   FSSpec * target,
16194   Boolean * wasChanged) ;
16195 extern OSErr
16196 GetAliasInfo(
16197   AliasHandle alias,
16198   AliasInfoType index,
16199   Str63 theString) ;
16200 extern OSErr
16201 IsAliasFile(
16202   const FSSpec * fileFSSpec,
16203   Boolean * aliasFileFlag,
16204   Boolean * folderFlag) ;
16205 extern OSErr
16206 ResolveAliasWithMountFlags(
16207   const FSSpec * fromFile,
16208   AliasHandle alias,
16209   FSSpec * target,
16210   Boolean * wasChanged,
16211   unsigned long mountFlags) ;
16212 extern OSErr
16213 ResolveAliasFile(
16214   FSSpec * theSpec,
16215   Boolean resolveAliasChains,
16216   Boolean * targetIsFolder,
16217   Boolean * wasAliased) ;
16218 extern OSErr
16219 ResolveAliasFileWithMountFlags(
16220   FSSpec * theSpec,
16221   Boolean resolveAliasChains,
16222   Boolean * targetIsFolder,
16223   Boolean * wasAliased,
16224   unsigned long mountFlags) ;
16225 extern OSErr
16226 FollowFinderAlias(
16227   const FSSpec * fromFile,
16228   AliasHandle alias,
16229   Boolean logon,
16230   FSSpec * target,
16231   Boolean * wasChanged) ;
16232 extern OSErr
16233 UpdateAlias(
16234   const FSSpec * fromFile,
16235   const FSSpec * target,
16236   AliasHandle alias,
16237   Boolean * wasChanged) ;
16238
16239
16240
16241 typedef Boolean ( * AliasFilterProcPtr)(CInfoPBPtr cpbPtr, Boolean *quitFlag, Ptr myDataPtr);
16242 typedef AliasFilterProcPtr AliasFilterUPP;
16243 extern AliasFilterUPP
16244 NewAliasFilterUPP(AliasFilterProcPtr userRoutine) ;
16245 extern void
16246 DisposeAliasFilterUPP(AliasFilterUPP userUPP) ;
16247 extern Boolean
16248 InvokeAliasFilterUPP(
16249   CInfoPBPtr cpbPtr,
16250   Boolean * quitFlag,
16251   Ptr myDataPtr,
16252   AliasFilterUPP userUPP) ;
16253 extern OSErr
16254 MatchAlias(
16255   const FSSpec * fromFile,
16256   unsigned long rulesMask,
16257   AliasHandle alias,
16258   short * aliasCount,
16259   FSSpecArrayPtr aliasList,
16260   Boolean * needsUpdate,
16261   AliasFilterUPP aliasFilter,
16262   void * yourDataPtr) ;
16263 extern OSErr
16264 ResolveAliasFileWithMountFlagsNoUI(
16265   FSSpec * theSpec,
16266   Boolean resolveAliasChains,
16267   Boolean * targetIsFolder,
16268   Boolean * wasAliased,
16269   unsigned long mountFlags) ;
16270 extern OSErr
16271 MatchAliasNoUI(
16272   const FSSpec * fromFile,
16273   unsigned long rulesMask,
16274   AliasHandle alias,
16275   short * aliasCount,
16276   FSSpecArrayPtr aliasList,
16277   Boolean * needsUpdate,
16278   AliasFilterUPP aliasFilter,
16279   void * yourDataPtr) ;
16280 extern OSErr
16281 FSNewAlias(
16282   const FSRef * fromFile,
16283   const FSRef * target,
16284   AliasHandle * inAlias) ;
16285 extern OSErr
16286 FSNewAliasMinimal(
16287   const FSRef * target,
16288   AliasHandle * inAlias) ;
16289 extern OSErr
16290 FSIsAliasFile(
16291   const FSRef * fileRef,
16292   Boolean * aliasFileFlag,
16293   Boolean * folderFlag) ;
16294 extern OSErr
16295 FSResolveAliasWithMountFlags(
16296   const FSRef * fromFile,
16297   AliasHandle inAlias,
16298   FSRef * target,
16299   Boolean * wasChanged,
16300   unsigned long mountFlags) ;
16301 extern OSErr
16302 FSResolveAlias(
16303   const FSRef * fromFile,
16304   AliasHandle alias,
16305   FSRef * target,
16306   Boolean * wasChanged) ;
16307 extern OSErr
16308 FSResolveAliasFileWithMountFlags(
16309   FSRef * theRef,
16310   Boolean resolveAliasChains,
16311   Boolean * targetIsFolder,
16312   Boolean * wasAliased,
16313   unsigned long mountFlags) ;
16314 extern OSErr
16315 FSResolveAliasFile(
16316   FSRef * theRef,
16317   Boolean resolveAliasChains,
16318   Boolean * targetIsFolder,
16319   Boolean * wasAliased) ;
16320 extern OSErr
16321 FSFollowFinderAlias(
16322   FSRef * fromFile,
16323   AliasHandle alias,
16324   Boolean logon,
16325   FSRef * target,
16326   Boolean * wasChanged) ;
16327 extern OSErr
16328 FSUpdateAlias(
16329   const FSRef * fromFile,
16330   const FSRef * target,
16331   AliasHandle alias,
16332   Boolean * wasChanged) ;
16333 extern OSErr
16334 FSNewAliasUnicode(
16335   const FSRef * fromFile,
16336   const FSRef * targetParentRef,
16337   UniCharCount targetNameLength,
16338   const UniChar * targetName,
16339   AliasHandle * inAlias,
16340   Boolean * isDirectory) ;
16341 extern OSErr
16342 FSNewAliasMinimalUnicode(
16343   const FSRef * targetParentRef,
16344   UniCharCount targetNameLength,
16345   const UniChar * targetName,
16346   AliasHandle * inAlias,
16347   Boolean * isDirectory) ;
16348 extern OSErr
16349 FSMatchAlias(
16350   const FSRef * fromFile,
16351   unsigned long rulesMask,
16352   AliasHandle inAlias,
16353   short * aliasCount,
16354   FSRef * aliasList,
16355   Boolean * needsUpdate,
16356   AliasFilterUPP aliasFilter,
16357   void * yourDataPtr) ;
16358 extern OSErr
16359 FSMatchAliasNoUI(
16360   const FSRef * fromFile,
16361   unsigned long rulesMask,
16362   AliasHandle inAlias,
16363   short * aliasCount,
16364   FSRef * aliasList,
16365   Boolean * needsUpdate,
16366   AliasFilterUPP aliasFilter,
16367   void * yourDataPtr) ;
16368 extern OSStatus
16369 FSCopyAliasInfo(
16370   AliasHandle inAlias,
16371   HFSUniStr255 * targetName,
16372   HFSUniStr255 * volumeName,
16373   CFStringRef * pathString,
16374   FSAliasInfoBitmap * whichInfo,
16375   FSAliasInfo * info) ;
16376
16377
16378
16379
16380
16381
16382 }
16383
16384
16385
16386 extern "C" {
16387
16388
16389 typedef struct OpaqueLocaleRef* LocaleRef;
16390 typedef UInt32 LocalePartMask;
16391 enum {
16392
16393   kLocaleLanguageMask = 1L << 0,
16394   kLocaleLanguageVariantMask = 1L << 1,
16395   kLocaleScriptMask = 1L << 2,
16396   kLocaleScriptVariantMask = 1L << 3,
16397   kLocaleRegionMask = 1L << 4,
16398   kLocaleRegionVariantMask = 1L << 5,
16399   kLocaleAllPartsMask = 0x0000003F
16400 };
16401
16402 typedef FourCharCode LocaleOperationClass;
16403
16404 typedef FourCharCode LocaleOperationVariant;
16405 struct LocaleAndVariant {
16406   LocaleRef locale;
16407   LocaleOperationVariant opVariant;
16408 };
16409 typedef struct LocaleAndVariant LocaleAndVariant;
16410
16411 typedef UInt32 LocaleNameMask;
16412 enum {
16413
16414   kLocaleNameMask = 1L << 0,
16415   kLocaleOperationVariantNameMask = 1L << 1,
16416   kLocaleAndVariantNameMask = 0x00000003
16417 };
16418 extern OSStatus
16419 LocaleRefFromLangOrRegionCode(
16420   LangCode lang,
16421   RegionCode region,
16422   LocaleRef * locale) ;
16423 extern OSStatus
16424 LocaleRefFromLocaleString(
16425   const char localeString[],
16426   LocaleRef * locale) ;
16427 extern OSStatus
16428 LocaleRefGetPartString(
16429   LocaleRef locale,
16430   LocalePartMask partMask,
16431   ByteCount maxStringLen,
16432   char partString[]) ;
16433 extern OSStatus
16434 LocaleStringToLangAndRegionCodes(
16435   const char localeString[],
16436   LangCode * lang,
16437   RegionCode * region) ;
16438 extern OSStatus
16439 LocaleOperationCountLocales(
16440   LocaleOperationClass opClass,
16441   ItemCount * localeCount) ;
16442 extern OSStatus
16443 LocaleOperationGetLocales(
16444   LocaleOperationClass opClass,
16445   ItemCount maxLocaleCount,
16446   ItemCount * actualLocaleCount,
16447   LocaleAndVariant localeVariantList[]) ;
16448 extern OSStatus
16449 LocaleGetName(
16450   LocaleRef locale,
16451   LocaleOperationVariant opVariant,
16452   LocaleNameMask nameMask,
16453   LocaleRef displayLocale,
16454   UniCharCount maxNameLen,
16455   UniCharCount * actualNameLen,
16456   UniChar displayName[]) ;
16457 extern OSStatus
16458 LocaleCountNames(
16459   LocaleRef locale,
16460   LocaleOperationVariant opVariant,
16461   LocaleNameMask nameMask,
16462   ItemCount * nameCount) ;
16463 extern OSStatus
16464 LocaleGetIndName(
16465   LocaleRef locale,
16466   LocaleOperationVariant opVariant,
16467   LocaleNameMask nameMask,
16468   ItemCount nameIndex,
16469   UniCharCount maxNameLen,
16470   UniCharCount * actualNameLen,
16471   UniChar displayName[],
16472   LocaleRef * displayLocale) ;
16473 extern OSStatus
16474 LocaleGetRegionLanguageName(
16475   RegionCode region,
16476   Str255 languageName) ;
16477 extern OSStatus
16478 LocaleOperationGetName(
16479   LocaleOperationClass opClass,
16480   LocaleRef displayLocale,
16481   UniCharCount maxNameLen,
16482   UniCharCount * actualNameLen,
16483   UniChar displayName[]) ;
16484 extern OSStatus
16485 LocaleOperationCountNames(
16486   LocaleOperationClass opClass,
16487   ItemCount * nameCount) ;
16488 extern OSStatus
16489 LocaleOperationGetIndName(
16490   LocaleOperationClass opClass,
16491   ItemCount nameIndex,
16492   UniCharCount maxNameLen,
16493   UniCharCount * actualNameLen,
16494   UniChar displayName[],
16495   LocaleRef * displayLocale) ;
16496
16497
16498
16499
16500
16501 }
16502
16503
16504
16505 extern "C" {
16506 enum {
16507   kBlessedBusErrorBait = 0x68F168F1
16508 };
16509 extern void
16510 DebugAssert(
16511   OSType componentSignature,
16512   UInt32 options,
16513   const char * assertionString,
16514   const char * exceptionLabelString,
16515   const char * errorString,
16516   const char * fileName,
16517   long lineNumber,
16518   void * value) ;
16519
16520
16521
16522
16523
16524 enum {
16525   k68kInterruptLevelMask = 0x00000007,
16526   kInVBLTaskMask = 0x00000010,
16527   kInDeferredTaskMask = 0x00000020,
16528   kInSecondaryIntHandlerMask = 0x00000040,
16529   kInNestedInterruptMask = 0x00000080
16530 };
16531 extern UInt32
16532 TaskLevel(void) ;
16533
16534
16535
16536
16537
16538 enum {
16539   kComponentDebugOption = 0
16540 };
16541
16542 enum {
16543   kGetDebugOption = 1,
16544   kSetDebugOption = 2
16545 };
16546 typedef void ( * DebugComponentCallbackProcPtr)(SInt32 optionSelectorNum, UInt32 command, Boolean *optionSetting);
16547 typedef DebugComponentCallbackProcPtr DebugComponentCallbackUPP;
16548 extern OSStatus
16549 NewDebugComponent(
16550   OSType componentSignature,
16551   ConstStr255Param componentName,
16552   DebugComponentCallbackUPP componentCallback) ;
16553 extern OSStatus
16554 NewDebugOption(
16555   OSType componentSignature,
16556   SInt32 optionSelectorNum,
16557   ConstStr255Param optionName) ;
16558 extern OSStatus
16559 DisposeDebugComponent(OSType componentSignature) ;
16560 extern OSStatus
16561 GetDebugComponentInfo(
16562   UInt32 index,
16563   OSType * componentSignature,
16564   Str255 componentName) ;
16565 extern OSStatus
16566 GetDebugOptionInfo(
16567   UInt32 index,
16568   OSType componentSignature,
16569   SInt32 * optionSelectorNum,
16570   Str255 optionName,
16571   Boolean * optionSetting) ;
16572 extern OSStatus
16573 SetDebugOptionValue(
16574   OSType componentSignature,
16575   SInt32 optionSelectorNum,
16576   Boolean newOptionSetting) ;
16577 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);
16578 typedef DebugAssertOutputHandlerProcPtr DebugAssertOutputHandlerUPP;
16579 extern void
16580 InstallDebugAssertOutputHandler(DebugAssertOutputHandlerUPP handler) ;
16581 extern DebugComponentCallbackUPP
16582 NewDebugComponentCallbackUPP(DebugComponentCallbackProcPtr userRoutine) ;
16583 extern DebugAssertOutputHandlerUPP
16584 NewDebugAssertOutputHandlerUPP(DebugAssertOutputHandlerProcPtr userRoutine) ;
16585 extern void
16586 DisposeDebugComponentCallbackUPP(DebugComponentCallbackUPP userUPP) ;
16587 extern void
16588 DisposeDebugAssertOutputHandlerUPP(DebugAssertOutputHandlerUPP userUPP) ;
16589 extern void
16590 InvokeDebugComponentCallbackUPP(
16591   SInt32 optionSelectorNum,
16592   UInt32 command,
16593   Boolean * optionSetting,
16594   DebugComponentCallbackUPP userUPP) ;
16595 extern void
16596 InvokeDebugAssertOutputHandlerUPP(
16597   OSType componentSignature,
16598   UInt32 options,
16599   const char * assertionString,
16600   const char * exceptionLabelString,
16601   const char * errorString,
16602   const char * fileName,
16603   long lineNumber,
16604   void * value,
16605   ConstStr255Param outputMsg,
16606   DebugAssertOutputHandlerUPP userUPP) ;
16607
16608
16609
16610 }
16611
16612
16613
16614 extern "C" {
16615 extern short
16616 PLstrcmp(
16617   ConstStr255Param str1,
16618   ConstStr255Param str2) ;
16619 extern short
16620 PLstrncmp(
16621   ConstStr255Param str1,
16622   ConstStr255Param str2,
16623   short num) ;
16624 extern StringPtr
16625 PLstrcpy(
16626   StringPtr str1,
16627   ConstStr255Param str2) ;
16628 extern StringPtr
16629 PLstrncpy(
16630   StringPtr str1,
16631   ConstStr255Param str2,
16632   short num) ;
16633 extern StringPtr
16634 PLstrcat(
16635   StringPtr str1,
16636   ConstStr255Param str2) ;
16637 extern StringPtr
16638 PLstrncat(
16639   StringPtr str1,
16640   ConstStr255Param str2,
16641   short num) ;
16642 extern Ptr
16643 PLstrchr(
16644   ConstStr255Param str1,
16645   short ch1) ;
16646 extern Ptr
16647 PLstrrchr(
16648   ConstStr255Param str1,
16649   short ch1) ;
16650 extern Ptr
16651 PLstrpbrk(
16652   ConstStr255Param str1,
16653   ConstStr255Param str2) ;
16654 extern short
16655 PLstrspn(
16656   ConstStr255Param str1,
16657   ConstStr255Param str2) ;
16658 extern Ptr
16659 PLstrstr(
16660   ConstStr255Param str1,
16661   ConstStr255Param str2) ;
16662 extern short
16663 PLstrlen(ConstStr255Param str) ;
16664 extern short
16665 PLpos(
16666   ConstStr255Param str1,
16667   ConstStr255Param str2) ;
16668
16669
16670
16671
16672
16673 }
16674
16675
16676
16677 extern "C" {
16678 extern Boolean
16679 CompareAndSwap(
16680   UInt32 oldVvalue,
16681   UInt32 newValue,
16682   UInt32 * OldValueAdr) ;
16683 extern Boolean
16684 TestAndClear(
16685   UInt32 bit,
16686   UInt8 * startAddress) ;
16687 extern Boolean
16688 TestAndSet(
16689   UInt32 bit,
16690   UInt8 * startAddress) ;
16691 extern SInt8
16692 IncrementAtomic8(SInt8 * value) ;
16693 extern SInt8
16694 DecrementAtomic8(SInt8 * value) ;
16695 extern SInt8
16696 AddAtomic8(
16697   SInt32 amount,
16698   SInt8 * value) ;
16699 extern UInt8
16700 BitAndAtomic8(
16701   UInt32 mask,
16702   UInt8 * value) ;
16703 extern UInt8
16704 BitOrAtomic8(
16705   UInt32 mask,
16706   UInt8 * value) ;
16707 extern UInt8
16708 BitXorAtomic8(
16709   UInt32 mask,
16710   UInt8 * value) ;
16711 extern SInt16
16712 IncrementAtomic16(SInt16 * value) ;
16713 extern SInt16
16714 DecrementAtomic16(SInt16 * value) ;
16715 extern SInt16
16716 AddAtomic16(
16717   SInt32 amount,
16718   SInt16 * value) ;
16719 extern UInt16
16720 BitAndAtomic16(
16721   UInt32 mask,
16722   UInt16 * value) ;
16723 extern UInt16
16724 BitOrAtomic16(
16725   UInt32 mask,
16726   UInt16 * value) ;
16727 extern UInt16
16728 BitXorAtomic16(
16729   UInt32 mask,
16730   UInt16 * value) ;
16731 extern SInt32
16732 IncrementAtomic(SInt32 * value) ;
16733 extern SInt32
16734 DecrementAtomic(SInt32 * value) ;
16735 extern SInt32
16736 AddAtomic(
16737   SInt32 amount,
16738   SInt32 * value) ;
16739 extern UInt32
16740 BitAndAtomic(
16741   UInt32 mask,
16742   UInt32 * value) ;
16743 extern UInt32
16744 BitOrAtomic(
16745   UInt32 mask,
16746   UInt32 * value) ;
16747 extern UInt32
16748 BitXorAtomic(
16749   UInt32 mask,
16750   UInt32 * value) ;
16751
16752
16753
16754
16755
16756 }
16757
16758
16759
16760
16761
16762
16763
16764
16765
16766
16767 typedef void * RegPropertyValue;
16768
16769 typedef UInt32 RegPropertyValueSize;
16770
16771
16772
16773
16774
16775 typedef struct OpaqueDeviceNodePtr* DeviceNodePtr;
16776 struct RegEntryID {
16777   unsigned short es_ver;
16778   unsigned short es_gen;
16779   DeviceNodePtr es_devid;
16780   unsigned long es_spare1;
16781   unsigned long es_spare2;
16782 };
16783 typedef struct RegEntryID RegEntryID;
16784 typedef RegEntryID * RegEntryIDPtr;
16785
16786
16787
16788
16789 typedef RegEntryID RegEntryRef;
16790 enum {
16791   kRegCStrMaxEntryNameLength = 47
16792 };
16793
16794
16795 typedef char RegCStrEntryName;
16796 typedef char * RegCStrEntryNamePtr;
16797
16798 typedef char RegCStrEntryNameBuf[48];
16799 typedef char RegCStrPathName;
16800 typedef UInt32 RegPathNameSize;
16801 enum {
16802   kRegPathNameSeparator = ':',
16803   kRegEntryNameTerminator = 0x00,
16804   kRegPathNameTerminator = 0x00
16805 };
16806
16807
16808
16809
16810
16811
16812 enum {
16813   kRegMaximumPropertyNameLength = 31,
16814   kRegPropertyNameTerminator = 0x00
16815 };
16816
16817 typedef char RegPropertyNameBuf[32];
16818 typedef char RegPropertyName;
16819 typedef char * RegPropertyNamePtr;
16820 enum {
16821   kRegMaxPropertyNameLength = kRegMaximumPropertyNameLength
16822 };
16823
16824
16825
16826
16827
16828
16829
16830 typedef UInt32 RegIterationOp;
16831 typedef RegIterationOp RegEntryIterationOp;
16832 enum {
16833
16834   kRegIterRoot = 0x00000002,
16835   kRegIterParents = 0x00000003,
16836
16837   kRegIterChildren = 0x00000004,
16838   kRegIterSubTrees = 0x00000005,
16839   kRegIterDescendants = 0x00000005,
16840
16841   kRegIterSibling = 0x00000006,
16842
16843   kRegIterContinue = 0x00000001
16844 };
16845 typedef UInt32 RegModifiers;
16846 typedef RegModifiers RegEntryModifiers;
16847 typedef RegModifiers RegPropertyModifiers;
16848 enum {
16849   kRegNoModifiers = 0x00000000,
16850   kRegUniversalModifierMask = 0x0000FFFF,
16851   kRegNameSpaceModifierMask = 0x00FF0000,
16852   kRegModifierMask = (long)0xFF000000
16853 };
16854
16855
16856 enum {
16857   kRegPropertyValueIsSavedToNVRAM = 0x00000020,
16858   kRegPropertyValueIsSavedToDisk = 0x00000040
16859 };
16860
16861
16862 enum {
16863   LatestNR_PEFVersion = 0x01030000
16864 };
16865
16866
16867
16868
16869
16870
16871
16872 enum {
16873   kSelectRegistryEntryIDInit = 0,
16874   kSelectRegistryEntryIDCompare = 1,
16875   kSelectRegistryEntryIDCopy = 2,
16876   kSelectRegistryEntryIDDispose = 3,
16877   kSelectRegistryCStrEntryCreate = 4,
16878   kSelectRegistryEntryDelete = 5,
16879   kSelectRegistryEntryCopy = 6,
16880   kSelectRegistryEntryIterateCreate = 7,
16881   kSelectRegistryEntryIterateDispose = 8,
16882   kSelectRegistryEntryIterateSet = 9,
16883   kSelectRegistryEntryIterate = 10,
16884   kSelectRegistryEntrySearch = 11,
16885   kSelectRegistryCStrEntryLookup = 12,
16886   kSelectRegistryEntryToPathSize = 13,
16887   kSelectRegistryCStrEntryToPath = 14,
16888   kSelectRegistryCStrEntryToName = 15,
16889   kSelectRegistryPropertyCreate = 16,
16890   kSelectRegistryPropertyDelete = 17,
16891   kSelectRegistryPropertyRename = 18,
16892   kSelectRegistryPropertyIterateCreate = 19,
16893   kSelectRegistryPropertyIterateDispose = 20,
16894   kSelectRegistryPropertyIterate = 21,
16895   kSelectRegistryPropertyGetSize = 22,
16896   kSelectRegistryPropertyGet = 23,
16897   kSelectRegistryPropertySet = 24,
16898   kSelectRegistryEntryGetMod = 25,
16899   kSelectRegistryEntrySetMod = 26,
16900   kSelectRegistryPropertyGetMod = 27,
16901   kSelectRegistryPropertySetMod = 28,
16902   kSelectRegistryEntryMod = 29,
16903   kSelectRegistryEntryPropertyMod = 30,
16904   kSelectRegistryHighestSelector = kSelectRegistryEntryPropertyMod
16905 };
16906 typedef struct OpaqueRegEntryIter* RegEntryIter;
16907 typedef struct OpaqueRegPropertyIter* RegPropertyIter;
16908 extern "C" {
16909
16910
16911
16912
16913 enum {
16914   chooserInitMsg = 11,
16915   newSelMsg = 12,
16916   fillListMsg = 13,
16917   getSelMsg = 14,
16918   selectMsg = 15,
16919   deselectMsg = 16,
16920   terminateMsg = 17,
16921   buttonMsg = 19
16922 };
16923
16924
16925
16926 enum {
16927   chooserID = 1
16928 };
16929
16930
16931
16932 enum {
16933   initMsg = 1,
16934   okMsg = 2,
16935   cancelMsg = 3,
16936   hitMsg = 4,
16937   nulMsg = 5,
16938   updateMsg = 6,
16939   activateMsg = 7,
16940   deactivateMsg = 8,
16941   keyEvtMsg = 9,
16942   superMsg = 10,
16943   normalMsg = 11,
16944   startupMsg = 12
16945 };
16946
16947
16948
16949 enum {
16950   goodbye = -1,
16951   killCode = 1,
16952   accEvent = 64,
16953   accRun = 65,
16954   accCursor = 66,
16955   accMenu = 67,
16956   accUndo = 68,
16957   accCut = 70,
16958   accCopy = 71,
16959   accPaste = 72,
16960   accClear = 73
16961 };
16962
16963
16964
16965
16966
16967 enum {
16968   ioInProgress = 1,
16969   aRdCmd = 2,
16970   aWrCmd = 3,
16971   asyncTrpBit = 10,
16972   noQueueBit = 9
16973 };
16974
16975
16976 enum {
16977   dReadEnable = 0,
16978   dWritEnable = 1,
16979   dCtlEnable = 2,
16980   dStatEnable = 3,
16981   dNeedGoodBye = 4,
16982   dNeedTime = 5,
16983   dNeedLock = 6
16984 };
16985
16986 enum {
16987   dNeedLockMask = 0x4000,
16988   dNeedTimeMask = 0x2000,
16989   dNeedGoodByeMask = 0x1000,
16990   dStatEnableMask = 0x0800,
16991   dCtlEnableMask = 0x0400,
16992   dWritEnableMask = 0x0200,
16993   dReadEnableMask = 0x0100
16994 };
16995
16996
16997
16998 enum {
16999   dVMImmuneBit = 0,
17000   dOpened = 5,
17001   dRAMBased = 6,
17002   drvrActive = 7
17003 };
17004
17005 enum {
17006   dVMImmuneMask = 0x0001,
17007   dOpenedMask = 0x0020,
17008   dRAMBasedMask = 0x0040,
17009   drvrActiveMask = 0x0080
17010 };
17011
17012 struct DRVRHeader {
17013   short drvrFlags;
17014   short drvrDelay;
17015   short drvrEMask;
17016   short drvrMenu;
17017   short drvrOpen;
17018   short drvrPrime;
17019   short drvrCtl;
17020   short drvrStatus;
17021   short drvrClose;
17022   unsigned char drvrName[1];
17023 };
17024 typedef struct DRVRHeader DRVRHeader;
17025 typedef DRVRHeader * DRVRHeaderPtr;
17026 typedef DRVRHeaderPtr * DRVRHeaderHandle;
17027
17028 typedef UInt16 UnitNumber;
17029 typedef UInt32 DriverOpenCount;
17030 typedef SInt16 DriverRefNum;
17031 typedef SInt16 DriverFlags;
17032 typedef UInt32 IOCommandCode;
17033 enum {
17034   kOpenCommand = 0,
17035   kCloseCommand = 1,
17036   kReadCommand = 2,
17037   kWriteCommand = 3,
17038   kControlCommand = 4,
17039   kStatusCommand = 5,
17040   kKillIOCommand = 6,
17041   kInitializeCommand = 7,
17042   kFinalizeCommand = 8,
17043   kReplaceCommand = 9,
17044   kSupersededCommand = 10,
17045   kSuspendCommand = 11,
17046   kResumeCommand = 12
17047 };
17048
17049 enum {
17050
17051   kPowerManagementCommand = 13
17052 };
17053
17054 typedef MPAddressSpaceID AddressSpaceID;
17055 typedef struct OpaqueIOCommandID* IOCommandID;
17056 extern OSErr
17057 PBCloseSync(ParmBlkPtr paramBlock) ;
17058 extern OSErr
17059 PBCloseAsync(ParmBlkPtr paramBlock) ;
17060 extern OSErr
17061 PBReadSync(ParmBlkPtr paramBlock) ;
17062 extern OSErr
17063 PBReadAsync(ParmBlkPtr paramBlock) ;
17064 extern OSErr
17065 PBWriteSync(ParmBlkPtr paramBlock) ;
17066 extern OSErr
17067 PBWriteAsync(ParmBlkPtr paramBlock) ;
17068 extern OSErr
17069 PBWaitIOComplete(
17070   ParmBlkPtr paramBlock,
17071   Duration timeout) ;
17072 typedef OSStatus ( * ShimEntryPoint)(Ptr paramBlock, Ptr refcon);
17073
17074
17075 }
17076
17077
17078
17079 extern "C" {
17080
17081
17082
17083
17084 typedef struct OpaqueAreaID* AreaID;
17085
17086 struct MachineInformationPowerPC {
17087   UnsignedWide CTR;
17088   UnsignedWide LR;
17089   UnsignedWide PC;
17090   unsigned long CR;
17091   unsigned long XER;
17092   unsigned long MSR;
17093   unsigned long MQ;
17094   unsigned long ExceptKind;
17095   unsigned long DSISR;
17096   UnsignedWide DAR;
17097   UnsignedWide Reserved;
17098 };
17099 typedef struct MachineInformationPowerPC MachineInformationPowerPC;
17100 struct RegisterInformationPowerPC {
17101   UnsignedWide R0;
17102   UnsignedWide R1;
17103   UnsignedWide R2;
17104   UnsignedWide R3;
17105   UnsignedWide R4;
17106   UnsignedWide R5;
17107   UnsignedWide R6;
17108   UnsignedWide R7;
17109   UnsignedWide R8;
17110   UnsignedWide R9;
17111   UnsignedWide R10;
17112   UnsignedWide R11;
17113   UnsignedWide R12;
17114   UnsignedWide R13;
17115   UnsignedWide R14;
17116   UnsignedWide R15;
17117   UnsignedWide R16;
17118   UnsignedWide R17;
17119   UnsignedWide R18;
17120   UnsignedWide R19;
17121   UnsignedWide R20;
17122   UnsignedWide R21;
17123   UnsignedWide R22;
17124   UnsignedWide R23;
17125   UnsignedWide R24;
17126   UnsignedWide R25;
17127   UnsignedWide R26;
17128   UnsignedWide R27;
17129   UnsignedWide R28;
17130   UnsignedWide R29;
17131   UnsignedWide R30;
17132   UnsignedWide R31;
17133 };
17134 typedef struct RegisterInformationPowerPC RegisterInformationPowerPC;
17135 struct FPUInformationPowerPC {
17136   UnsignedWide Registers[32];
17137   unsigned long FPSCR;
17138   unsigned long Reserved;
17139 };
17140 typedef struct FPUInformationPowerPC FPUInformationPowerPC;
17141 union Vector128 {
17142
17143
17144
17145   unsigned long l[4];
17146   unsigned short s[8];
17147   unsigned char c[16];
17148 };
17149 typedef union Vector128 Vector128;
17150 struct VectorInformationPowerPC {
17151   Vector128 Registers[32];
17152   Vector128 VSCR;
17153   UInt32 VRsave;
17154 };
17155 typedef struct VectorInformationPowerPC VectorInformationPowerPC;
17156
17157 enum {
17158   kWriteReference = 0,
17159   kReadReference = 1,
17160   kFetchReference = 2,
17161   writeReference = kWriteReference,
17162   readReference = kReadReference,
17163   fetchReference = kFetchReference
17164 };
17165
17166
17167 typedef unsigned long MemoryReferenceKind;
17168 struct MemoryExceptionInformation {
17169   AreaID theArea;
17170   LogicalAddress theAddress;
17171   OSStatus theError;
17172   MemoryReferenceKind theReference;
17173 };
17174 typedef struct MemoryExceptionInformation MemoryExceptionInformation;
17175 enum {
17176   kUnknownException = 0,
17177   kIllegalInstructionException = 1,
17178   kTrapException = 2,
17179   kAccessException = 3,
17180   kUnmappedMemoryException = 4,
17181   kExcludedMemoryException = 5,
17182   kReadOnlyMemoryException = 6,
17183   kUnresolvablePageFaultException = 7,
17184   kPrivilegeViolationException = 8,
17185   kTraceException = 9,
17186   kInstructionBreakpointException = 10,
17187   kDataBreakpointException = 11,
17188   kIntegerException = 12,
17189   kFloatingPointException = 13,
17190   kStackOverflowException = 14,
17191   kTaskTerminationException = 15,
17192   kTaskCreationException = 16,
17193   kDataAlignmentException = 17
17194 };
17195 typedef unsigned long ExceptionKind;
17196 union ExceptionInfo {
17197   MemoryExceptionInformation * memoryInfo;
17198 };
17199 typedef union ExceptionInfo ExceptionInfo;
17200 struct ExceptionInformationPowerPC {
17201   ExceptionKind theKind;
17202   MachineInformationPowerPC * machineState;
17203   RegisterInformationPowerPC * registerImage;
17204   FPUInformationPowerPC * FPUImage;
17205   ExceptionInfo info;
17206   VectorInformationPowerPC * vectorImage;
17207 };
17208 typedef struct ExceptionInformationPowerPC ExceptionInformationPowerPC;
17209
17210 typedef ExceptionInformationPowerPC ExceptionInformation;
17211 typedef MachineInformationPowerPC MachineInformation;
17212 typedef RegisterInformationPowerPC RegisterInformation;
17213 typedef FPUInformationPowerPC FPUInformation;
17214 typedef VectorInformationPowerPC VectorInformation;
17215 typedef OSStatus ( * ExceptionHandlerProcPtr)(ExceptionInformation * theException);
17216 typedef ExceptionHandlerProcPtr ExceptionHandlerUPP;
17217 extern ExceptionHandlerUPP
17218 NewExceptionHandlerUPP(ExceptionHandlerProcPtr userRoutine) ;
17219 extern void
17220 DisposeExceptionHandlerUPP(ExceptionHandlerUPP userUPP) ;
17221 extern OSStatus
17222 InvokeExceptionHandlerUPP(
17223   ExceptionInformation * theException,
17224   ExceptionHandlerUPP userUPP) ;
17225 typedef ExceptionHandlerUPP ExceptionHandlerTPP;
17226 typedef ExceptionHandlerTPP ExceptionHandler;
17227 extern ExceptionHandlerTPP InstallExceptionHandler(ExceptionHandlerTPP theHandler) ;
17228
17229
17230
17231
17232
17233
17234 }
17235 extern "C" {
17236
17237
17238
17239
17240
17241
17242
17243
17244
17245 typedef struct OpaqueIOPreparationID* IOPreparationID;
17246 typedef struct OpaqueSoftwareInterruptID* SoftwareInterruptID;
17247 typedef struct OpaqueTaskID* TaskID;
17248 typedef struct OpaqueTimerID* TimerID;
17249
17250 typedef UInt32 ExecutionLevel;
17251 enum {
17252   kTaskLevel = 0,
17253   kSoftwareInterruptLevel = 1,
17254   kAcceptFunctionLevel = 2,
17255   kKernelLevel = 3,
17256   kSIHAcceptFunctionLevel = 4,
17257   kSecondaryInterruptLevel = 5,
17258   kHardwareInterruptLevel = 6,
17259   kMPTaskLevel = 7
17260 };
17261
17262 typedef void ( * SoftwareInterruptHandler)(void *p1, void *p2);
17263 typedef OSStatus ( * SecondaryInterruptHandler2)(void *p1, void *p2);
17264
17265
17266 struct LogicalAddressRange {
17267   LogicalAddress address;
17268   ByteCount count;
17269 };
17270 typedef struct LogicalAddressRange LogicalAddressRange;
17271 typedef LogicalAddressRange * LogicalAddressRangePtr;
17272 struct PhysicalAddressRange {
17273   PhysicalAddress address;
17274   ByteCount count;
17275 };
17276 typedef struct PhysicalAddressRange PhysicalAddressRange;
17277 typedef PhysicalAddressRange * PhysicalAddressRangePtr;
17278
17279 typedef OptionBits IOPreparationOptions;
17280 enum {
17281   kIOMultipleRanges = 0x00000001,
17282   kIOLogicalRanges = 0x00000002,
17283   kIOMinimalLogicalMapping = 0x00000004,
17284   kIOShareMappingTables = 0x00000008,
17285   kIOIsInput = 0x00000010,
17286   kIOIsOutput = 0x00000020,
17287   kIOCoherentDataPath = 0x00000040,
17288   kIOTransferIsLogical = 0x00000080,
17289   kIOClientIsUserMode = 0x00000080
17290 };
17291
17292 typedef OptionBits IOPreparationState;
17293 enum {
17294   kIOStateDone = 0x00000001
17295 };
17296
17297 enum {
17298   kInvalidPageAddress = (-1)
17299 };
17300
17301 struct AddressRange {
17302   void * base;
17303   ByteCount length;
17304 };
17305 typedef struct AddressRange AddressRange;
17306
17307
17308 typedef LogicalAddress * LogicalMappingTablePtr;
17309 typedef PhysicalAddress * PhysicalMappingTablePtr;
17310 typedef AddressRange * AddressRangeTablePtr;
17311 struct MultipleAddressRange {
17312   ItemCount entryCount;
17313   AddressRangeTablePtr rangeTable;
17314 };
17315 typedef struct MultipleAddressRange MultipleAddressRange;
17316
17317
17318
17319
17320 struct IOPreparationTable {
17321   IOPreparationOptions options;
17322   IOPreparationState state;
17323   IOPreparationID preparationID;
17324   AddressSpaceID addressSpace;
17325   ByteCount granularity;
17326   ByteCount firstPrepared;
17327   ByteCount lengthPrepared;
17328   ItemCount mappingEntryCount;
17329   LogicalMappingTablePtr logicalMapping;
17330   PhysicalMappingTablePtr physicalMapping;
17331   union {
17332     AddressRange range;
17333     MultipleAddressRange multipleRanges;
17334   } rangeInfo;
17335 };
17336 typedef struct IOPreparationTable IOPreparationTable;
17337
17338 typedef OptionBits IOCheckpointOptions;
17339 enum {
17340   kNextIOIsInput = 0x00000001,
17341   kNextIOIsOutput = 0x00000002,
17342   kMoreIOTransfers = 0x00000004
17343 };
17344
17345
17346
17347 typedef UInt32 ProcessorCacheMode;
17348 enum {
17349   kProcessorCacheModeDefault = 0,
17350   kProcessorCacheModeInhibited = 1,
17351   kProcessorCacheModeWriteThrough = 2,
17352   kProcessorCacheModeCopyBack = 3
17353 };
17354
17355
17356
17357
17358
17359
17360 enum {
17361   kPageInformationVersion = 1
17362 };
17363
17364 typedef UInt32 PageStateInformation;
17365 enum {
17366   kPageIsProtected = 0x00000001,
17367   kPageIsProtectedPrivileged = 0x00000002,
17368   kPageIsModified = 0x00000004,
17369   kPageIsReferenced = 0x00000008,
17370   kPageIsLockedResident = 0x00000010,
17371   kPageIsInMemory = 0x00000020,
17372   kPageIsShared = 0x00000040,
17373   kPageIsWriteThroughCached = 0x00000080,
17374   kPageIsCopyBackCached = 0x00000100,
17375   kPageIsHeldResident = 0x00000200,
17376   kPageIsLocked = kPageIsLockedResident,
17377   kPageIsResident = kPageIsInMemory
17378 };
17379
17380 struct PageInformation {
17381   AreaID area;
17382   ItemCount count;
17383   PageStateInformation information[1];
17384 };
17385 typedef struct PageInformation PageInformation;
17386 typedef PageInformation * PageInformationPtr;
17387 typedef LogicalAddress * DeviceLogicalAddressPtr;
17388 enum {
17389   durationMicrosecond = -1L,
17390   durationMillisecond = 1L,
17391   durationSecond = 1000L,
17392   durationMinute = 60000L,
17393   durationHour = 3600000L,
17394   durationDay = 86400000L,
17395   durationNoWait = 0L,
17396   durationForever = 0x7FFFFFFF
17397 };
17398
17399 enum {
17400   k8BitAccess = 0,
17401   k16BitAccess = 1,
17402   k32BitAccess = 2
17403 };
17404
17405 typedef UnsignedWide Nanoseconds;
17406 extern AbsoluteTime
17407 UpTime(void) ;
17408 extern Nanoseconds
17409 AbsoluteToNanoseconds(AbsoluteTime absoluteTime) ;
17410 extern Duration
17411 AbsoluteToDuration(AbsoluteTime absoluteTime) ;
17412 extern AbsoluteTime
17413 NanosecondsToAbsolute(Nanoseconds nanoseconds) ;
17414 extern AbsoluteTime
17415 DurationToAbsolute(Duration duration) ;
17416 extern AbsoluteTime
17417 AddAbsoluteToAbsolute(
17418   AbsoluteTime absoluteTime1,
17419   AbsoluteTime absoluteTime2) ;
17420 extern AbsoluteTime
17421 SubAbsoluteFromAbsolute(
17422   AbsoluteTime leftAbsoluteTime,
17423   AbsoluteTime rightAbsoluteTime) ;
17424 extern AbsoluteTime
17425 AddNanosecondsToAbsolute(
17426   Nanoseconds nanoseconds,
17427   AbsoluteTime absoluteTime) ;
17428 extern AbsoluteTime
17429 AddDurationToAbsolute(
17430   Duration duration,
17431   AbsoluteTime absoluteTime) ;
17432 extern AbsoluteTime
17433 SubNanosecondsFromAbsolute(
17434   Nanoseconds nanoseconds,
17435   AbsoluteTime absoluteTime) ;
17436 extern AbsoluteTime
17437 SubDurationFromAbsolute(
17438   Duration duration,
17439   AbsoluteTime absoluteTime) ;
17440 extern Nanoseconds
17441 AbsoluteDeltaToNanoseconds(
17442   AbsoluteTime leftAbsoluteTime,
17443   AbsoluteTime rightAbsoluteTime) ;
17444 extern Duration
17445 AbsoluteDeltaToDuration(
17446   AbsoluteTime leftAbsoluteTime,
17447   AbsoluteTime rightAbsoluteTime) ;
17448 extern Nanoseconds
17449 DurationToNanoseconds(Duration theDuration) ;
17450 extern Duration
17451 NanosecondsToDuration(Nanoseconds theNanoseconds) ;
17452 typedef struct OpaqueInterruptSetID* InterruptSetID;
17453 typedef long InterruptMemberNumber;
17454 struct InterruptSetMember {
17455   InterruptSetID setID;
17456   InterruptMemberNumber member;
17457 };
17458 typedef struct InterruptSetMember InterruptSetMember;
17459 enum {
17460   kISTChipInterruptSource = 0,
17461   kISTOutputDMAInterruptSource = 1,
17462   kISTInputDMAInterruptSource = 2,
17463   kISTPropertyMemberCount = 3
17464 };
17465
17466 typedef InterruptSetMember ISTProperty[3];
17467
17468
17469 typedef long InterruptReturnValue;
17470 enum {
17471   kFirstMemberNumber = 1,
17472   kIsrIsComplete = 0,
17473   kIsrIsNotComplete = -1,
17474   kMemberNumberParent = -2
17475 };
17476
17477 typedef Boolean InterruptSourceState;
17478 enum {
17479   kSourceWasEnabled = true,
17480   kSourceWasDisabled = false
17481 };
17482
17483
17484 typedef InterruptMemberNumber ( * InterruptHandler)(InterruptSetMember ISTmember, void *refCon, UInt32 theIntCount);
17485 typedef void ( * InterruptEnabler)(InterruptSetMember ISTmember, void *refCon);
17486 typedef InterruptSourceState ( * InterruptDisabler)(InterruptSetMember ISTmember, void *refCon);
17487 enum {
17488   kReturnToParentWhenComplete = 0x00000001,
17489   kReturnToParentWhenNotComplete = 0x00000002
17490 };
17491
17492 typedef OptionBits InterruptSetOptions;
17493
17494
17495 }
17496
17497
17498
17499
17500
17501
17502
17503 extern "C" {
17504
17505
17506 struct NumFormatString {
17507   UInt8 fLength;
17508   UInt8 fVersion;
17509   char data[254];
17510 };
17511 typedef struct NumFormatString NumFormatString;
17512 typedef NumFormatString NumFormatStringRec;
17513 typedef short FormatStatus;
17514 enum {
17515   fVNumber = 0
17516 };
17517
17518 typedef SInt8 FormatClass;
17519 enum {
17520   fPositive = 0,
17521   fNegative = 1,
17522   fZero = 2
17523 };
17524
17525 typedef SInt8 FormatResultType;
17526 enum {
17527   fFormatOK = 0,
17528   fBestGuess = 1,
17529   fOutOfSynch = 2,
17530   fSpuriousChars = 3,
17531   fMissingDelimiter = 4,
17532   fExtraDecimal = 5,
17533   fMissingLiteral = 6,
17534   fExtraExp = 7,
17535   fFormatOverflow = 8,
17536   fFormStrIsNAN = 9,
17537   fBadPartsTable = 10,
17538   fExtraPercent = 11,
17539   fExtraSeparator = 12,
17540   fEmptyFormatString = 13
17541 };
17542
17543 struct FVector {
17544   short start;
17545   short length;
17546 };
17547 typedef struct FVector FVector;
17548
17549 typedef FVector TripleInt[3];
17550 extern void
17551 StringToNum(
17552   ConstStr255Param theString,
17553   long * theNum) ;
17554 extern void
17555 NumToString(
17556   long theNum,
17557   Str255 theString) ;
17558 extern FormatStatus
17559 ExtendedToString(
17560   const extended80 * x,
17561   const NumFormatString * myCanonical,
17562   const NumberParts * partsTable,
17563   Str255 outString) ;
17564 extern FormatStatus
17565 StringToExtended(
17566   ConstStr255Param source,
17567   const NumFormatString * myCanonical,
17568   const NumberParts * partsTable,
17569   extended80 * x) ;
17570 extern FormatStatus
17571 StringToFormatRec(
17572   ConstStr255Param inString,
17573   const NumberParts * partsTable,
17574   NumFormatString * outString) ;
17575 extern FormatStatus
17576 FormatRecToString(
17577   const NumFormatString * myCanonical,
17578   const NumberParts * partsTable,
17579   Str255 outString,
17580   TripleInt positions) ;
17581
17582
17583 }
17584
17585
17586
17587
17588
17589
17590
17591 extern "C" {
17592 enum {
17593
17594   systemCurLang = -2,
17595   systemDefLang = -3,
17596   currentCurLang = -4,
17597   currentDefLang = -5,
17598   scriptCurLang = -6,
17599   scriptDefLang = -7
17600 };
17601
17602
17603 enum {
17604   iuSystemCurLang = systemCurLang,
17605   iuSystemDefLang = systemDefLang,
17606   iuCurrentCurLang = currentCurLang,
17607   iuCurrentDefLang = currentDefLang,
17608   iuScriptCurLang = scriptCurLang,
17609   iuScriptDefLang = scriptDefLang
17610 };
17611 extern short
17612 ReplaceText(
17613   Handle baseText,
17614   Handle substitutionText,
17615   Str15 key) ;
17616 extern short
17617 ScriptOrder(
17618   ScriptCode script1,
17619   ScriptCode script2) ;
17620 extern short
17621 CompareString(
17622   ConstStr255Param aStr,
17623   ConstStr255Param bStr,
17624   Handle itl2Handle) ;
17625 extern short
17626 IdenticalString(
17627   ConstStr255Param aStr,
17628   ConstStr255Param bStr,
17629   Handle itl2Handle) ;
17630 extern short
17631 StringOrder(
17632   ConstStr255Param aStr,
17633   ConstStr255Param bStr,
17634   ScriptCode aScript,
17635   ScriptCode bScript,
17636   LangCode aLang,
17637   LangCode bLang) ;
17638 extern short
17639 CompareText(
17640   const void * aPtr,
17641   const void * bPtr,
17642   short aLen,
17643   short bLen,
17644   Handle itl2Handle) ;
17645 extern short
17646 IdenticalText(
17647   const void * aPtr,
17648   const void * bPtr,
17649   short aLen,
17650   short bLen,
17651   Handle itl2Handle) ;
17652 extern short
17653 TextOrder(
17654   const void * aPtr,
17655   const void * bPtr,
17656   short aLen,
17657   short bLen,
17658   ScriptCode aScript,
17659   ScriptCode bScript,
17660   LangCode aLang,
17661   LangCode bLang) ;
17662 extern short
17663 LanguageOrder(
17664   LangCode language1,
17665   LangCode language2) ;
17666 extern short
17667 RelString(
17668   ConstStr255Param str1,
17669   ConstStr255Param str2,
17670   Boolean caseSensitive,
17671   Boolean diacSensitive) ;
17672 extern Boolean
17673 EqualString(
17674   ConstStr255Param str1,
17675   ConstStr255Param str2,
17676   Boolean caseSensitive,
17677   Boolean diacSensitive) ;
17678 extern short
17679 relstring(
17680   const char * str1,
17681   const char * str2,
17682   Boolean caseSensitive,
17683   Boolean diacSensitive) ;
17684 }
17685
17686
17687
17688 extern "C" {
17689
17690
17691 struct ScriptRunStatus {
17692   SInt8 script;
17693   SInt8 runVariant;
17694 };
17695 typedef struct ScriptRunStatus ScriptRunStatus;
17696 struct BreakTable {
17697   char charTypes[256];
17698   short tripleLength;
17699   short triples[1];
17700 };
17701 typedef struct BreakTable BreakTable;
17702 typedef BreakTable * BreakTablePtr;
17703 struct NBreakTable {
17704   SInt8 flags1;
17705   SInt8 flags2;
17706   short version;
17707   short classTableOff;
17708   short auxCTableOff;
17709   short backwdTableOff;
17710   short forwdTableOff;
17711   short doBackup;
17712   short length;
17713   char charTypes[256];
17714   short tables[1];
17715 };
17716 typedef struct NBreakTable NBreakTable;
17717 typedef NBreakTable * NBreakTablePtr;
17718 extern long
17719 Munger(
17720   Handle h,
17721   long offset,
17722   const void * ptr1,
17723   long len1,
17724   const void * ptr2,
17725   long len2) ;
17726 extern StringHandle
17727 NewString(ConstStr255Param theString) ;
17728 extern void
17729 SetString(
17730   StringHandle theString,
17731   ConstStr255Param strNew) ;
17732 extern StringHandle
17733 GetString(short stringID) ;
17734 extern void
17735 GetIndString(
17736   Str255 theString,
17737   short strListID,
17738   short index) ;
17739 extern void
17740 FindWordBreaks(
17741   Ptr textPtr,
17742   short textLength,
17743   short offset,
17744   Boolean leadingEdge,
17745   BreakTablePtr breaks,
17746   OffsetTable offsets,
17747   ScriptCode script) ;
17748 extern void
17749 LowercaseText(
17750   Ptr textPtr,
17751   short len,
17752   ScriptCode script) ;
17753 extern void
17754 UppercaseText(
17755   Ptr textPtr,
17756   short len,
17757   ScriptCode script) ;
17758 extern void
17759 StripDiacritics(
17760   Ptr textPtr,
17761   short len,
17762   ScriptCode script) ;
17763 extern void
17764 UppercaseStripDiacritics(
17765   Ptr textPtr,
17766   short len,
17767   ScriptCode script) ;
17768 extern ScriptRunStatus
17769 FindScriptRun(
17770   Ptr textPtr,
17771   long textLen,
17772   long * lenUsed) ;
17773 extern void
17774 UpperString(
17775   Str255 theString,
17776   Boolean diacSensitive) ;
17777 extern void
17778 upperstring(
17779   char * theString,
17780   Boolean diacSensitive) ;
17781 extern void
17782 c2pstrcpy(
17783   Str255 dst,
17784   const char * src) ;
17785 extern void
17786 p2cstrcpy(
17787   char * dst,
17788   ConstStr255Param src) ;
17789 extern void
17790 CopyPascalStringToC(
17791   ConstStr255Param src,
17792   char * dst) ;
17793 extern void
17794 CopyCStringToPascal(
17795   const char * src,
17796   Str255 dst) ;
17797
17798
17799 }
17800
17801
17802
17803 extern "C" {
17804
17805
17806 extern Boolean
17807 BitTst(
17808   const void * bytePtr,
17809   long bitNum) ;
17810 extern void
17811 BitSet(
17812   void * bytePtr,
17813   long bitNum) ;
17814 extern void
17815 BitClr(
17816   void * bytePtr,
17817   long bitNum) ;
17818 extern long
17819 BitAnd(
17820   long value1,
17821   long value2) ;
17822 extern long
17823 BitOr(
17824   long value1,
17825   long value2) ;
17826 extern long
17827 BitXor(
17828   long value1,
17829   long value2) ;
17830 extern long
17831 BitNot(long value) ;
17832 extern long
17833 BitShift(
17834   long value,
17835   short count) ;
17836
17837
17838
17839
17840
17841
17842
17843
17844 }
17845
17846
17847
17848
17849
17850
17851
17852 extern "C" {
17853
17854
17855 typedef UInt16 UCKeyOutput;
17856 typedef UInt16 UCKeyCharSeq;
17857 enum {
17858   kUCKeyOutputStateIndexMask = 0x4000,
17859   kUCKeyOutputSequenceIndexMask = 0x8000,
17860   kUCKeyOutputTestForIndexMask = 0xC000,
17861   kUCKeyOutputGetIndexMask = 0x3FFF
17862 };
17863 struct UCKeyStateRecord {
17864   UCKeyCharSeq stateZeroCharData;
17865   UInt16 stateZeroNextState;
17866   UInt16 stateEntryCount;
17867   UInt16 stateEntryFormat;
17868
17869
17870   UInt32 stateEntryData[1];
17871 };
17872 typedef struct UCKeyStateRecord UCKeyStateRecord;
17873
17874
17875
17876
17877 enum {
17878   kUCKeyStateEntryTerminalFormat = 0x0001,
17879   kUCKeyStateEntryRangeFormat = 0x0002
17880 };
17881
17882
17883
17884
17885
17886
17887 struct UCKeyStateEntryTerminal {
17888   UInt16 curState;
17889   UCKeyCharSeq charData;
17890 };
17891 typedef struct UCKeyStateEntryTerminal UCKeyStateEntryTerminal;
17892
17893
17894
17895
17896
17897
17898
17899 struct UCKeyStateEntryRange {
17900   UInt16 curStateStart;
17901   UInt8 curStateRange;
17902   UInt8 deltaMultiplier;
17903   UCKeyCharSeq charData;
17904   UInt16 nextState;
17905 };
17906 typedef struct UCKeyStateEntryRange UCKeyStateEntryRange;
17907 struct UCKeyboardTypeHeader {
17908   UInt32 keyboardTypeFirst;
17909   UInt32 keyboardTypeLast;
17910   ByteOffset keyModifiersToTableNumOffset;
17911   ByteOffset keyToCharTableIndexOffset;
17912   ByteOffset keyStateRecordsIndexOffset;
17913   ByteOffset keyStateTerminatorsOffset;
17914   ByteOffset keySequenceDataIndexOffset;
17915 };
17916 typedef struct UCKeyboardTypeHeader UCKeyboardTypeHeader;
17917 struct UCKeyboardLayout {
17918
17919   UInt16 keyLayoutHeaderFormat;
17920   UInt16 keyLayoutDataVersion;
17921   ByteOffset keyLayoutFeatureInfoOffset;
17922   ItemCount keyboardTypeCount;
17923   UCKeyboardTypeHeader keyboardTypeList[1];
17924 };
17925 typedef struct UCKeyboardLayout UCKeyboardLayout;
17926
17927 struct UCKeyLayoutFeatureInfo {
17928   UInt16 keyLayoutFeatureInfoFormat;
17929   UInt16 reserved;
17930   UniCharCount maxOutputStringLength;
17931 };
17932 typedef struct UCKeyLayoutFeatureInfo UCKeyLayoutFeatureInfo;
17933
17934 struct UCKeyModifiersToTableNum {
17935   UInt16 keyModifiersToTableNumFormat;
17936   UInt16 defaultTableNum;
17937   ItemCount modifiersCount;
17938   UInt8 tableNum[1];
17939
17940
17941 };
17942 typedef struct UCKeyModifiersToTableNum UCKeyModifiersToTableNum;
17943
17944 struct UCKeyToCharTableIndex {
17945   UInt16 keyToCharTableIndexFormat;
17946   UInt16 keyToCharTableSize;
17947   ItemCount keyToCharTableCount;
17948   ByteOffset keyToCharTableOffsets[1];
17949
17950
17951
17952
17953
17954
17955 };
17956 typedef struct UCKeyToCharTableIndex UCKeyToCharTableIndex;
17957
17958 struct UCKeyStateRecordsIndex {
17959   UInt16 keyStateRecordsIndexFormat;
17960   UInt16 keyStateRecordCount;
17961   ByteOffset keyStateRecordOffsets[1];
17962
17963
17964
17965
17966 };
17967 typedef struct UCKeyStateRecordsIndex UCKeyStateRecordsIndex;
17968
17969 struct UCKeyStateTerminators {
17970   UInt16 keyStateTerminatorsFormat;
17971   UInt16 keyStateTerminatorCount;
17972   UCKeyCharSeq keyStateTerminators[1];
17973
17974
17975
17976 };
17977 typedef struct UCKeyStateTerminators UCKeyStateTerminators;
17978
17979 struct UCKeySequenceDataIndex {
17980   UInt16 keySequenceDataIndexFormat;
17981   UInt16 charSequenceCount;
17982   UInt16 charSequenceOffsets[1];
17983
17984
17985
17986
17987
17988 };
17989 typedef struct UCKeySequenceDataIndex UCKeySequenceDataIndex;
17990
17991
17992
17993 enum {
17994   kUCKeyLayoutHeaderFormat = 0x1002,
17995   kUCKeyLayoutFeatureInfoFormat = 0x2001,
17996   kUCKeyModifiersToTableNumFormat = 0x3001,
17997   kUCKeyToCharTableIndexFormat = 0x4001,
17998   kUCKeyStateRecordsIndexFormat = 0x5001,
17999   kUCKeyStateTerminatorsFormat = 0x6001,
18000   kUCKeySequenceDataIndexFormat = 0x7001
18001 };
18002 enum {
18003   kUCKeyActionDown = 0,
18004   kUCKeyActionUp = 1,
18005   kUCKeyActionAutoKey = 2,
18006   kUCKeyActionDisplay = 3
18007 };
18008
18009
18010
18011
18012
18013
18014
18015 enum {
18016   kUCKeyTranslateNoDeadKeysBit = 0
18017 };
18018
18019 enum {
18020   kUCKeyTranslateNoDeadKeysMask = 1L << kUCKeyTranslateNoDeadKeysBit
18021 };
18022
18023
18024
18025
18026
18027
18028
18029 enum {
18030   kUnicodeCollationClass = 'ucol'
18031 };
18032
18033 typedef struct OpaqueCollatorRef* CollatorRef;
18034 typedef UInt32 UCCollateOptions;
18035 enum {
18036
18037   kUCCollateComposeInsensitiveMask = 1L << 1,
18038   kUCCollateWidthInsensitiveMask = 1L << 2,
18039   kUCCollateCaseInsensitiveMask = 1L << 3,
18040   kUCCollateDiacritInsensitiveMask = 1L << 4,
18041   kUCCollatePunctuationSignificantMask = 1L << 15,
18042   kUCCollateDigitsOverrideMask = 1L << 16,
18043   kUCCollateDigitsAsNumberMask = 1L << 17
18044 };
18045
18046 enum {
18047   kUCCollateStandardOptions = kUCCollateComposeInsensitiveMask | kUCCollateWidthInsensitiveMask
18048 };
18049
18050
18051
18052
18053
18054 enum {
18055   kUCCollateTypeHFSExtended = 1
18056 };
18057
18058
18059 enum {
18060   kUCCollateTypeSourceMask = 0x000000FF,
18061   kUCCollateTypeShiftBits = 24
18062 };
18063
18064 enum {
18065   kUCCollateTypeMask = kUCCollateTypeSourceMask << kUCCollateTypeShiftBits
18066 };
18067
18068
18069 typedef UInt32 UCCollationValue;
18070
18071
18072
18073
18074
18075
18076 enum {
18077   kUnicodeTextBreakClass = 'ubrk'
18078 };
18079
18080 typedef struct OpaqueTextBreakLocatorRef* TextBreakLocatorRef;
18081 typedef UInt32 UCTextBreakType;
18082 enum {
18083   kUCTextBreakCharMask = 1L << 0,
18084   kUCTextBreakClusterMask = 1L << 2,
18085   kUCTextBreakWordMask = 1L << 4,
18086   kUCTextBreakLineMask = 1L << 6
18087 };
18088
18089 typedef UInt32 UCTextBreakOptions;
18090 enum {
18091   kUCTextBreakLeadingEdgeMask = 1L << 0,
18092   kUCTextBreakGoBackwardsMask = 1L << 1,
18093   kUCTextBreakIterateMask = 1L << 2
18094 };
18095 extern OSStatus
18096 UCKeyTranslate(
18097   const UCKeyboardLayout * keyLayoutPtr,
18098   UInt16 virtualKeyCode,
18099   UInt16 keyAction,
18100   UInt32 modifierKeyState,
18101   UInt32 keyboardType,
18102   OptionBits keyTranslateOptions,
18103   UInt32 * deadKeyState,
18104   UniCharCount maxStringLength,
18105   UniCharCount * actualStringLength,
18106   UniChar unicodeString[]) ;
18107 extern OSStatus
18108 UCCreateCollator(
18109   LocaleRef locale,
18110   LocaleOperationVariant opVariant,
18111   UCCollateOptions options,
18112   CollatorRef * collatorRef) ;
18113 extern OSStatus
18114 UCGetCollationKey(
18115   CollatorRef collatorRef,
18116   const UniChar * textPtr,
18117   UniCharCount textLength,
18118   ItemCount maxKeySize,
18119   ItemCount * actualKeySize,
18120   UCCollationValue collationKey[]) ;
18121 extern OSStatus
18122 UCCompareCollationKeys(
18123   const UCCollationValue * key1Ptr,
18124   ItemCount key1Length,
18125   const UCCollationValue * key2Ptr,
18126   ItemCount key2Length,
18127   Boolean * equivalent,
18128   SInt32 * order) ;
18129 extern OSStatus
18130 UCCompareText(
18131   CollatorRef collatorRef,
18132   const UniChar * text1Ptr,
18133   UniCharCount text1Length,
18134   const UniChar * text2Ptr,
18135   UniCharCount text2Length,
18136   Boolean * equivalent,
18137   SInt32 * order) ;
18138 extern OSStatus
18139 UCDisposeCollator(CollatorRef * collatorRef) ;
18140 extern OSStatus
18141 UCCompareTextDefault(
18142   UCCollateOptions options,
18143   const UniChar * text1Ptr,
18144   UniCharCount text1Length,
18145   const UniChar * text2Ptr,
18146   UniCharCount text2Length,
18147   Boolean * equivalent,
18148   SInt32 * order) ;
18149 extern OSStatus
18150 UCCompareTextNoLocale(
18151   UCCollateOptions options,
18152   const UniChar * text1Ptr,
18153   UniCharCount text1Length,
18154   const UniChar * text2Ptr,
18155   UniCharCount text2Length,
18156   Boolean * equivalent,
18157   SInt32 * order) ;
18158 extern OSStatus
18159 UCCreateTextBreakLocator(
18160   LocaleRef locale,
18161   LocaleOperationVariant opVariant,
18162   UCTextBreakType breakTypes,
18163   TextBreakLocatorRef * breakRef) ;
18164 extern OSStatus
18165 UCFindTextBreak(
18166   TextBreakLocatorRef breakRef,
18167   UCTextBreakType breakType,
18168   UCTextBreakOptions options,
18169   const UniChar * textPtr,
18170   UniCharCount textLength,
18171   UniCharArrayOffset startOffset,
18172   UniCharArrayOffset * breakOffset) ;
18173 extern OSStatus
18174 UCDisposeTextBreakLocator(TextBreakLocatorRef * breakRef) ;
18175
18176
18177
18178
18179
18180 }
18181
18182
18183
18184 extern double acos (double);
18185 extern double asin (double);
18186 extern double atan (double);
18187 extern double atan2 (double, double);
18188 extern double ceil (double);
18189 extern double cos (double);
18190 extern double cosh (double);
18191 extern double exp (double);
18192 extern double fabs (double);
18193 extern double floor (double);
18194 extern double fmod (double, double);
18195 extern double frexp (double, int *);
18196 extern double ldexp (double, int);
18197 extern double log10 (double);
18198 extern double log (double);
18199 extern double modf (double, double *);
18200 extern double pow (double, double);
18201 extern double sin (double);
18202 extern double sinh (double);
18203 extern double sqrt (double);
18204 extern double tan (double);
18205 extern double tanh (double);
18206 extern "C" {
18207
18208
18209 extern const double_t pi;
18210 extern double_t compound(double_t rate, double_t periods) ;
18211 extern double_t annuity(double_t rate, double_t periods) ;
18212 extern double_t randomx(double_t * x) ;
18213 typedef short relop;
18214 enum {
18215   GREATERTHAN = 0,
18216   LESSTHAN = 1,
18217   EQUALTO = 2,
18218   UNORDERED = 3
18219 };
18220 extern relop relation(double_t x, double_t y) ;
18221 struct decimal {
18222     char sgn;
18223     char unused;
18224     short exp;
18225     struct {
18226         unsigned char length;
18227         unsigned char text[36];
18228         unsigned char unused;
18229     } sig;
18230 };
18231 typedef struct decimal decimal;
18232
18233 struct decform {
18234     char style;
18235     char unused;
18236     short digits;
18237 };
18238 typedef struct decform decform;
18239 extern void num2dec(const decform *f, double_t x, decimal *d) ;
18240 extern double_t dec2num(const decimal * d) ;
18241 extern void dec2str(const decform *f, const decimal *d, char *s) ;
18242 extern void str2dec(const char *s, short *ix, decimal *d, short *vp) ;
18243 extern float dec2f(const decimal * d) ;
18244 extern short dec2s(const decimal * d) ;
18245 extern long dec2l(const decimal * d) ;
18246 extern long double cosl(long double x);
18247
18248
18249     inline long double cosl(long double x) { return (long double) cos((double)(x)); }
18250 extern long double sinl(long double x);
18251
18252
18253     inline long double sinl(long double x) { return (long double) sin((double)(x)); }
18254 extern long double tanl(long double x);
18255
18256
18257     inline long double tanl(long double x) { return (long double) tan((double)(x)); }
18258 extern long double acosl(long double x);
18259
18260
18261     inline long double acosl(long double x) { return (long double) acos((double)(x)); }
18262 extern long double asinl(long double x);
18263
18264
18265     inline long double asinl(long double x) { return (long double) asin((double)(x)); }
18266 extern long double atanl(long double x);
18267
18268
18269     inline long double atanl(long double x) { return (long double) atan((double)(x)); }
18270 extern long double atan2l(long double y, long double x);
18271
18272
18273     inline long double atan2l(long double y, long double x) { return (long double) atan2((double)(y), (double)(x)); }
18274 extern long double coshl(long double x);
18275
18276
18277     inline long double coshl(long double x) { return (long double) cosh((double)(x)); }
18278 extern long double sinhl(long double x);
18279
18280
18281     inline long double sinhl(long double x) { return (long double) sinh((double)(x)); }
18282 extern long double tanhl(long double x);
18283
18284
18285     inline long double tanhl(long double x) { return (long double) tanh((double)(x)); }
18286 extern long double acoshl(long double x);
18287
18288
18289     inline long double acoshl(long double x) { return (long double) acosh((double)(x)); }
18290 extern long double asinhl(long double x);
18291
18292
18293     inline long double asinhl(long double x) { return (long double) asinh((double)(x)); }
18294 extern long double atanhl(long double x);
18295
18296
18297     inline long double atanhl(long double x) { return (long double) atanh((double)(x)); }
18298 extern long double expl(long double x);
18299
18300
18301     inline long double expl(long double x) { return (long double) exp((double)(x)); }
18302 extern long double expm1l(long double x);
18303
18304
18305     inline long double expm1l(long double x) { return (long double) expm1((double)(x)); }
18306 extern long double exp2l(long double x);
18307
18308
18309     inline long double exp2l(long double x) { return (long double) exp2((double)(x)); }
18310 extern long double frexpl(long double x, int *exponent);
18311
18312
18313     inline long double frexpl(long double x, int *exponent) { return (long double) frexp((double)(x), (exponent)); }
18314 extern long double ldexpl(long double x, int n);
18315
18316
18317     inline long double ldexpl(long double x, int n) { return (long double) ldexp((double)(x), (n)); }
18318 extern long double logl(long double x);
18319
18320
18321     inline long double logl(long double x) { return (long double) log((double)(x)); }
18322 extern long double log1pl(long double x);
18323
18324
18325     inline long double log1pl(long double x) { return (long double) log1p((double)(x)); }
18326 extern long double log10l(long double x);
18327
18328
18329     inline long double log10l(long double x) { return (long double) log10((double)(x)); }
18330 extern long double log2l(long double x);
18331
18332
18333     inline long double log2l(long double x) { return (long double) log2((double)(x)); }
18334 extern long double logbl(long double x);
18335
18336
18337     inline long double logbl(long double x) { return (long double) logb((double)(x)); }
18338 extern long double scalbl(long double x, long n);
18339
18340
18341     inline long double scalbl(long double x, long n) { return (long double) scalb((double)(x), (n)); }
18342 extern long double fabsl(long double x);
18343
18344
18345     inline long double fabsl(long double x) { return (long double) fabs((double)(x)); }
18346 extern long double hypotl(long double x, long double y);
18347
18348
18349     inline long double hypotl(long double x, long double y) { return (long double) hypot((double)(x), (double)(y)); }
18350 extern long double powl(long double x, long double y);
18351
18352
18353     inline long double powl(long double x, long double y) { return (long double) pow((double)(x), (double)(y)); }
18354 extern long double sqrtl(long double x);
18355
18356
18357     inline long double sqrtl(long double x) { return (long double) sqrt((double)(x)); }
18358 extern long double erfl(long double x);
18359
18360
18361     inline long double erfl(long double x) { return (long double) erf((double)(x)); }
18362 extern long double erfcl(long double x);
18363
18364
18365     inline long double erfcl(long double x) { return (long double) erfc((double)(x)); }
18366 extern long double gammal(long double x);
18367
18368
18369     inline long double gammal(long double x) { return (long double) gamma((double)(x)); }
18370 extern long double lgammal(long double x);
18371
18372
18373     inline long double lgammal(long double x) { return (long double) lgamma((double)(x)); }
18374 extern long double ceill(long double x);
18375
18376
18377     inline long double ceill(long double x) { return (long double) ceil((double)(x)); }
18378 extern long double floorl(long double x);
18379
18380
18381     inline long double floorl(long double x) { return (long double) floor((double)(x)); }
18382 extern long double rintl(long double x);
18383
18384
18385     inline long double rintl(long double x) { return (long double) rint((double)(x)); }
18386 extern long double nearbyintl(long double x);
18387
18388
18389     inline long double nearbyintl(long double x) { return (long double) nearbyint((double)(x)); }
18390 extern long rinttoll(long double x);
18391
18392
18393     inline long rinttoll(long double x) { return rinttol((double)(x)); }
18394 extern long double roundl(long double x);
18395
18396
18397     inline long double roundl(long double x) { return (long double) round((double)(x)); }
18398 extern long roundtoll(long double x);
18399
18400
18401     inline long roundtoll(long double x) { return roundtol((double)(x)); }
18402 extern long double truncl(long double x);
18403
18404
18405     inline long double truncl(long double x) { return (long double) trunc((double)(x)); }
18406 extern long double remainderl(long double x, long double y);
18407
18408
18409     inline long double remainderl(long double x, long double y) { return (long double) remainder((double)(x), (double)(y)); }
18410 extern long double remquol(long double x, long double y, int *quo);
18411
18412
18413     inline long double remquol(long double x, long double y, int *quo) { return (long double) remquo((double)(x), (double)(y), (quo)); }
18414 extern long double copysignl(long double x, long double y);
18415
18416
18417     inline long double copysignl(long double x, long double y) { return (long double) copysign((double)(x), (double)(y)); }
18418 extern long double fdiml(long double x, long double y);
18419
18420
18421     inline long double fdiml(long double x, long double y) { return (long double) fdim((double)(x), (double)(y)); }
18422 extern long double fmaxl(long double x, long double y);
18423
18424
18425     inline long double fmaxl(long double x, long double y) { return (long double) fmax((double)(x), (double)(y)); }
18426 extern long double fminl(long double x, long double y);
18427
18428
18429     inline long double fminl(long double x, long double y) { return (long double) fmin((double)(x), (double)(y)); }
18430 extern relop relationl(long double x, long double y);
18431
18432
18433     inline relop relationl(long double x, long double y) { return relation((double)(x), (double)(y)); }
18434 extern void num2decl(const decform *f, long double x, decimal *d);
18435
18436
18437     inline void num2decl(const decform *f, long double x, decimal *d) { num2dec((f), (double)(x), (d)); }
18438 extern long double dec2numl(const decimal * d);
18439
18440
18441     inline long double dec2numl(const decimal *d) { return (long double) dec2num(d); }
18442 extern double x80tod(const extended80 * x80) ;
18443 extern void dtox80(const double *x, extended80 *x80) ;
18444 extern void x80told(const extended80 *x80, long double *x);
18445
18446
18447     inline void x80told(const extended80 *x80, long double *x) { *(x) = (long double) x80tod(x80); }
18448 extern void ldtox80(const long double *x, extended80 *x80);
18449
18450
18451     inline void ldtox80(const long double *x, extended80 *x80) { double d = (double) *(x); dtox80(&d, (x80)); }
18452
18453
18454 }
18455
18456
18457 extern "C" {
18458 typedef long fenv_t;
18459 typedef long fexcept_t;
18460
18461
18462 enum {
18463   FE_INEXACT = 0x02000000,
18464   FE_DIVBYZERO = 0x04000000,
18465   FE_UNDERFLOW = 0x08000000,
18466   FE_OVERFLOW = 0x10000000,
18467   FE_INVALID = 0x20000000,
18468   FE_ALL_EXCEPT = 0x3E000000
18469 };
18470
18471
18472
18473 enum {
18474   FE_TONEAREST = 0x00000000,
18475   FE_TOWARDZERO = 0x00000001,
18476   FE_UPWARD = 0x00000002,
18477   FE_DOWNWARD = 0x00000003
18478 };
18479
18480
18481 extern const fenv_t _FE_DFL_ENV;
18482 extern void feclearexcept(int excepts);
18483 extern void fegetexceptflag(fexcept_t *flagp, int excepts);
18484
18485
18486
18487
18488
18489
18490
18491 extern void feraiseexcept(int excepts);
18492 extern void fesetexceptflag(const fexcept_t *flagp, int excepts);
18493 extern int fetestexcept(int excepts);
18494 extern int fegetround(void);
18495 extern int fesetround(int round);
18496
18497
18498
18499
18500
18501
18502
18503 extern void fegetenv(fenv_t * envp);
18504 extern int feholdexcept(fenv_t * envp);
18505 extern void fesetenv(const fenv_t * envp);
18506 extern void feupdateenv(const fenv_t * envp);
18507
18508
18509
18510 }
18511
18512 extern "C" {
18513
18514
18515
18516 typedef OSType TECPluginSignature;
18517 typedef UInt32 TECPluginVersion;
18518
18519 enum {
18520   kTECSignature = 'encv',
18521   kTECUnicodePluginSignature = 'puni',
18522   kTECJapanesePluginSignature = 'pjpn',
18523   kTECChinesePluginSignature = 'pzho',
18524   kTECKoreanPluginSignature = 'pkor'
18525 };
18526
18527
18528
18529 typedef struct OpaqueTECObjectRef* TECObjectRef;
18530 typedef struct OpaqueTECSnifferObjectRef* TECSnifferObjectRef;
18531 typedef OSType TECPluginSig;
18532 struct TECConversionInfo {
18533   TextEncoding sourceEncoding;
18534   TextEncoding destinationEncoding;
18535   UInt16 reserved1;
18536   UInt16 reserved2;
18537 };
18538 typedef struct TECConversionInfo TECConversionInfo;
18539 extern OSStatus
18540 TECCountAvailableTextEncodings(ItemCount * numberEncodings) ;
18541 extern OSStatus
18542 TECGetAvailableTextEncodings(
18543   TextEncoding availableEncodings[],
18544   ItemCount maxAvailableEncodings,
18545   ItemCount * actualAvailableEncodings) ;
18546 extern OSStatus
18547 TECCountDirectTextEncodingConversions(ItemCount * numberOfEncodings) ;
18548 extern OSStatus
18549 TECGetDirectTextEncodingConversions(
18550   TECConversionInfo availableConversions[],
18551   ItemCount maxAvailableConversions,
18552   ItemCount * actualAvailableConversions) ;
18553 extern OSStatus
18554 TECCountDestinationTextEncodings(
18555   TextEncoding inputEncoding,
18556   ItemCount * numberOfEncodings) ;
18557 extern OSStatus
18558 TECGetDestinationTextEncodings(
18559   TextEncoding inputEncoding,
18560   TextEncoding destinationEncodings[],
18561   ItemCount maxDestinationEncodings,
18562   ItemCount * actualDestinationEncodings) ;
18563 extern OSStatus
18564 TECGetTextEncodingInternetName(
18565   TextEncoding textEncoding,
18566   Str255 encodingName) ;
18567 extern OSStatus
18568 TECGetTextEncodingFromInternetName(
18569   TextEncoding * textEncoding,
18570   ConstStr255Param encodingName) ;
18571 extern OSStatus
18572 TECCreateConverter(
18573   TECObjectRef * newEncodingConverter,
18574   TextEncoding inputEncoding,
18575   TextEncoding outputEncoding) ;
18576 extern OSStatus
18577 TECCreateConverterFromPath(
18578   TECObjectRef * newEncodingConverter,
18579   const TextEncoding inPath[],
18580   ItemCount inEncodings) ;
18581 extern OSStatus
18582 TECDisposeConverter(TECObjectRef newEncodingConverter) ;
18583 extern OSStatus
18584 TECClearConverterContextInfo(TECObjectRef encodingConverter) ;
18585 extern OSStatus
18586 TECConvertText(
18587   TECObjectRef encodingConverter,
18588   ConstTextPtr inputBuffer,
18589   ByteCount inputBufferLength,
18590   ByteCount * actualInputLength,
18591   TextPtr outputBuffer,
18592   ByteCount outputBufferLength,
18593   ByteCount * actualOutputLength) ;
18594 extern OSStatus
18595 TECFlushText(
18596   TECObjectRef encodingConverter,
18597   TextPtr outputBuffer,
18598   ByteCount outputBufferLength,
18599   ByteCount * actualOutputLength) ;
18600 extern OSStatus
18601 TECCountSubTextEncodings(
18602   TextEncoding inputEncoding,
18603   ItemCount * numberOfEncodings) ;
18604 extern OSStatus
18605 TECGetSubTextEncodings(
18606   TextEncoding inputEncoding,
18607   TextEncoding subEncodings[],
18608   ItemCount maxSubEncodings,
18609   ItemCount * actualSubEncodings) ;
18610 extern OSStatus
18611 TECGetEncodingList(
18612   TECObjectRef encodingConverter,
18613   ItemCount * numEncodings,
18614   Handle * encodingList) ;
18615 extern OSStatus
18616 TECCreateOneToManyConverter(
18617   TECObjectRef * newEncodingConverter,
18618   TextEncoding inputEncoding,
18619   ItemCount numOutputEncodings,
18620   const TextEncoding outputEncodings[]) ;
18621 extern OSStatus
18622 TECConvertTextToMultipleEncodings(
18623   TECObjectRef encodingConverter,
18624   ConstTextPtr inputBuffer,
18625   ByteCount inputBufferLength,
18626   ByteCount * actualInputLength,
18627   TextPtr outputBuffer,
18628   ByteCount outputBufferLength,
18629   ByteCount * actualOutputLength,
18630   TextEncodingRun outEncodingsBuffer[],
18631   ItemCount maxOutEncodingRuns,
18632   ItemCount * actualOutEncodingRuns) ;
18633 extern OSStatus
18634 TECFlushMultipleEncodings(
18635   TECObjectRef encodingConverter,
18636   TextPtr outputBuffer,
18637   ByteCount outputBufferLength,
18638   ByteCount * actualOutputLength,
18639   TextEncodingRun outEncodingsBuffer[],
18640   ItemCount maxOutEncodingRuns,
18641   ItemCount * actualOutEncodingRuns) ;
18642 extern OSStatus
18643 TECCountWebTextEncodings(
18644   RegionCode locale,
18645   ItemCount * numberEncodings) ;
18646 extern OSStatus
18647 TECGetWebTextEncodings(
18648   RegionCode locale,
18649   TextEncoding availableEncodings[],
18650   ItemCount maxAvailableEncodings,
18651   ItemCount * actualAvailableEncodings) ;
18652 extern OSStatus
18653 TECCountMailTextEncodings(
18654   RegionCode locale,
18655   ItemCount * numberEncodings) ;
18656 extern OSStatus
18657 TECGetMailTextEncodings(
18658   RegionCode locale,
18659   TextEncoding availableEncodings[],
18660   ItemCount maxAvailableEncodings,
18661   ItemCount * actualAvailableEncodings) ;
18662 extern OSStatus
18663 TECCountAvailableSniffers(ItemCount * numberOfEncodings) ;
18664 extern OSStatus
18665 TECGetAvailableSniffers(
18666   TextEncoding availableSniffers[],
18667   ItemCount maxAvailableSniffers,
18668   ItemCount * actualAvailableSniffers) ;
18669 extern OSStatus
18670 TECCreateSniffer(
18671   TECSnifferObjectRef * encodingSniffer,
18672   TextEncoding testEncodings[],
18673   ItemCount numTextEncodings) ;
18674 extern OSStatus
18675 TECSniffTextEncoding(
18676   TECSnifferObjectRef encodingSniffer,
18677   TextPtr inputBuffer,
18678   ByteCount inputBufferLength,
18679   TextEncoding testEncodings[],
18680   ItemCount numTextEncodings,
18681   ItemCount numErrsArray[],
18682   ItemCount maxErrs,
18683   ItemCount numFeaturesArray[],
18684   ItemCount maxFeatures) ;
18685 extern OSStatus
18686 TECDisposeSniffer(TECSnifferObjectRef encodingSniffer) ;
18687 extern OSStatus
18688 TECClearSnifferContextInfo(TECSnifferObjectRef encodingSniffer) ;
18689
18690
18691 }
18692
18693
18694
18695 extern "C" {
18696
18697
18698
18699
18700 typedef struct OpaqueTextToUnicodeInfo* TextToUnicodeInfo;
18701 typedef struct OpaqueUnicodeToTextInfo* UnicodeToTextInfo;
18702 typedef struct OpaqueUnicodeToTextRunInfo* UnicodeToTextRunInfo;
18703 typedef const TextToUnicodeInfo ConstTextToUnicodeInfo;
18704 typedef const UnicodeToTextInfo ConstUnicodeToTextInfo;
18705
18706 typedef SInt32 UnicodeMapVersion;
18707 enum {
18708   kUnicodeUseLatestMapping = -1,
18709   kUnicodeUseHFSPlusMapping = 4
18710 };
18711
18712
18713 struct UnicodeMapping {
18714   TextEncoding unicodeEncoding;
18715   TextEncoding otherEncoding;
18716   UnicodeMapVersion mappingVersion;
18717 };
18718 typedef struct UnicodeMapping UnicodeMapping;
18719 typedef UnicodeMapping * UnicodeMappingPtr;
18720 typedef const UnicodeMapping * ConstUnicodeMappingPtr;
18721
18722 enum {
18723   kUnicodeUseFallbacksBit = 0,
18724   kUnicodeKeepInfoBit = 1,
18725   kUnicodeDirectionalityBits = 2,
18726   kUnicodeVerticalFormBit = 4,
18727   kUnicodeLooseMappingsBit = 5,
18728   kUnicodeStringUnterminatedBit = 6,
18729   kUnicodeTextRunBit = 7,
18730   kUnicodeKeepSameEncodingBit = 8,
18731   kUnicodeForceASCIIRangeBit = 9,
18732   kUnicodeNoHalfwidthCharsBit = 10,
18733   kUnicodeTextRunHeuristicsBit = 11,
18734   kUnicodeMapLineFeedToReturnBit = 12
18735 };
18736
18737 enum {
18738   kUnicodeUseFallbacksMask = 1L << kUnicodeUseFallbacksBit,
18739   kUnicodeKeepInfoMask = 1L << kUnicodeKeepInfoBit,
18740   kUnicodeDirectionalityMask = 3L << kUnicodeDirectionalityBits,
18741   kUnicodeVerticalFormMask = 1L << kUnicodeVerticalFormBit,
18742   kUnicodeLooseMappingsMask = 1L << kUnicodeLooseMappingsBit,
18743   kUnicodeStringUnterminatedMask = 1L << kUnicodeStringUnterminatedBit,
18744   kUnicodeTextRunMask = 1L << kUnicodeTextRunBit,
18745   kUnicodeKeepSameEncodingMask = 1L << kUnicodeKeepSameEncodingBit,
18746   kUnicodeForceASCIIRangeMask = 1L << kUnicodeForceASCIIRangeBit,
18747   kUnicodeNoHalfwidthCharsMask = 1L << kUnicodeNoHalfwidthCharsBit,
18748   kUnicodeTextRunHeuristicsMask = 1L << kUnicodeTextRunHeuristicsBit,
18749   kUnicodeMapLineFeedToReturnMask = 1L << kUnicodeMapLineFeedToReturnBit
18750 };
18751
18752
18753 enum {
18754   kUnicodeDefaultDirection = 0,
18755   kUnicodeLeftToRight = 1,
18756   kUnicodeRightToLeft = 2
18757 };
18758
18759
18760 enum {
18761   kUnicodeDefaultDirectionMask = kUnicodeDefaultDirection << kUnicodeDirectionalityBits,
18762   kUnicodeLeftToRightMask = kUnicodeLeftToRight << kUnicodeDirectionalityBits,
18763   kUnicodeRightToLeftMask = kUnicodeRightToLeft << kUnicodeDirectionalityBits
18764 };
18765 enum {
18766   kUnicodeMatchUnicodeBaseBit = 0,
18767   kUnicodeMatchUnicodeVariantBit = 1,
18768   kUnicodeMatchUnicodeFormatBit = 2,
18769   kUnicodeMatchOtherBaseBit = 3,
18770   kUnicodeMatchOtherVariantBit = 4,
18771   kUnicodeMatchOtherFormatBit = 5
18772 };
18773
18774 enum {
18775   kUnicodeMatchUnicodeBaseMask = 1L << kUnicodeMatchUnicodeBaseBit,
18776   kUnicodeMatchUnicodeVariantMask = 1L << kUnicodeMatchUnicodeVariantBit,
18777   kUnicodeMatchUnicodeFormatMask = 1L << kUnicodeMatchUnicodeFormatBit,
18778   kUnicodeMatchOtherBaseMask = 1L << kUnicodeMatchOtherBaseBit,
18779   kUnicodeMatchOtherVariantMask = 1L << kUnicodeMatchOtherVariantBit,
18780   kUnicodeMatchOtherFormatMask = 1L << kUnicodeMatchOtherFormatBit
18781 };
18782
18783
18784 enum {
18785   kUnicodeFallbackSequencingBits = 0
18786 };
18787
18788 enum {
18789   kUnicodeFallbackSequencingMask = 3L << kUnicodeFallbackSequencingBits,
18790   kUnicodeFallbackInterruptSafeMask = 1L << 2
18791 };
18792
18793
18794 enum {
18795   kUnicodeFallbackDefaultOnly = 0L,
18796   kUnicodeFallbackCustomOnly = 1L,
18797   kUnicodeFallbackDefaultFirst = 2L,
18798   kUnicodeFallbackCustomFirst = 3L
18799 };
18800
18801
18802
18803 typedef OSStatus ( * UnicodeToTextFallbackProcPtr)(UniChar *iSrcUniStr, ByteCount iSrcUniStrLen, ByteCount *oSrcConvLen, TextPtr oDestStr, ByteCount iDestStrLen, ByteCount *oDestConvLen, LogicalAddress iInfoPtr, ConstUnicodeMappingPtr iUnicodeMappingPtr);
18804 typedef UnicodeToTextFallbackProcPtr UnicodeToTextFallbackUPP;
18805 extern UnicodeToTextFallbackUPP
18806 NewUnicodeToTextFallbackUPP(UnicodeToTextFallbackProcPtr userRoutine) ;
18807 extern void
18808 DisposeUnicodeToTextFallbackUPP(UnicodeToTextFallbackUPP userUPP) ;
18809 extern OSStatus
18810 InvokeUnicodeToTextFallbackUPP(
18811   UniChar * iSrcUniStr,
18812   ByteCount iSrcUniStrLen,
18813   ByteCount * oSrcConvLen,
18814   TextPtr oDestStr,
18815   ByteCount iDestStrLen,
18816   ByteCount * oDestConvLen,
18817   LogicalAddress iInfoPtr,
18818   ConstUnicodeMappingPtr iUnicodeMappingPtr,
18819   UnicodeToTextFallbackUPP userUPP) ;
18820 extern OSStatus
18821 CreateTextToUnicodeInfo(
18822   ConstUnicodeMappingPtr iUnicodeMapping,
18823   TextToUnicodeInfo * oTextToUnicodeInfo) ;
18824 extern OSStatus
18825 CreateTextToUnicodeInfoByEncoding(
18826   TextEncoding iEncoding,
18827   TextToUnicodeInfo * oTextToUnicodeInfo) ;
18828 extern OSStatus
18829 CreateUnicodeToTextInfo(
18830   ConstUnicodeMappingPtr iUnicodeMapping,
18831   UnicodeToTextInfo * oUnicodeToTextInfo) ;
18832 extern OSStatus
18833 CreateUnicodeToTextInfoByEncoding(
18834   TextEncoding iEncoding,
18835   UnicodeToTextInfo * oUnicodeToTextInfo) ;
18836 extern OSStatus
18837 CreateUnicodeToTextRunInfo(
18838   ItemCount iNumberOfMappings,
18839   const UnicodeMapping iUnicodeMappings[],
18840   UnicodeToTextRunInfo * oUnicodeToTextInfo) ;
18841 extern OSStatus
18842 CreateUnicodeToTextRunInfoByEncoding(
18843   ItemCount iNumberOfEncodings,
18844   const TextEncoding iEncodings[],
18845   UnicodeToTextRunInfo * oUnicodeToTextInfo) ;
18846 extern OSStatus
18847 CreateUnicodeToTextRunInfoByScriptCode(
18848   ItemCount iNumberOfScriptCodes,
18849   const ScriptCode iScripts[],
18850   UnicodeToTextRunInfo * oUnicodeToTextInfo) ;
18851 extern OSStatus
18852 ChangeTextToUnicodeInfo(
18853   TextToUnicodeInfo ioTextToUnicodeInfo,
18854   ConstUnicodeMappingPtr iUnicodeMapping) ;
18855 extern OSStatus
18856 ChangeUnicodeToTextInfo(
18857   UnicodeToTextInfo ioUnicodeToTextInfo,
18858   ConstUnicodeMappingPtr iUnicodeMapping) ;
18859 extern OSStatus
18860 DisposeTextToUnicodeInfo(TextToUnicodeInfo * ioTextToUnicodeInfo) ;
18861 extern OSStatus
18862 DisposeUnicodeToTextInfo(UnicodeToTextInfo * ioUnicodeToTextInfo) ;
18863 extern OSStatus
18864 DisposeUnicodeToTextRunInfo(UnicodeToTextRunInfo * ioUnicodeToTextRunInfo) ;
18865 extern OSStatus
18866 ConvertFromTextToUnicode(
18867   TextToUnicodeInfo iTextToUnicodeInfo,
18868   ByteCount iSourceLen,
18869   ConstLogicalAddress iSourceStr,
18870   OptionBits iControlFlags,
18871   ItemCount iOffsetCount,
18872   ByteOffset iOffsetArray[],
18873   ItemCount * oOffsetCount,
18874   ByteOffset oOffsetArray[],
18875   ByteCount iOutputBufLen,
18876   ByteCount * oSourceRead,
18877   ByteCount * oUnicodeLen,
18878   UniChar oUnicodeStr[]) ;
18879 extern OSStatus
18880 ConvertFromUnicodeToText(
18881   UnicodeToTextInfo iUnicodeToTextInfo,
18882   ByteCount iUnicodeLen,
18883   const UniChar iUnicodeStr[],
18884   OptionBits iControlFlags,
18885   ItemCount iOffsetCount,
18886   ByteOffset iOffsetArray[],
18887   ItemCount * oOffsetCount,
18888   ByteOffset oOffsetArray[],
18889   ByteCount iOutputBufLen,
18890   ByteCount * oInputRead,
18891   ByteCount * oOutputLen,
18892   LogicalAddress oOutputStr) ;
18893 extern OSStatus
18894 ConvertFromUnicodeToTextRun(
18895   UnicodeToTextRunInfo iUnicodeToTextInfo,
18896   ByteCount iUnicodeLen,
18897   const UniChar iUnicodeStr[],
18898   OptionBits iControlFlags,
18899   ItemCount iOffsetCount,
18900   ByteOffset iOffsetArray[],
18901   ItemCount * oOffsetCount,
18902   ByteOffset oOffsetArray[],
18903   ByteCount iOutputBufLen,
18904   ByteCount * oInputRead,
18905   ByteCount * oOutputLen,
18906   LogicalAddress oOutputStr,
18907   ItemCount iEncodingRunBufLen,
18908   ItemCount * oEncodingRunOutLen,
18909   TextEncodingRun oEncodingRuns[]) ;
18910 extern OSStatus
18911 ConvertFromUnicodeToScriptCodeRun(
18912   UnicodeToTextRunInfo iUnicodeToTextInfo,
18913   ByteCount iUnicodeLen,
18914   const UniChar iUnicodeStr[],
18915   OptionBits iControlFlags,
18916   ItemCount iOffsetCount,
18917   ByteOffset iOffsetArray[],
18918   ItemCount * oOffsetCount,
18919   ByteOffset oOffsetArray[],
18920   ByteCount iOutputBufLen,
18921   ByteCount * oInputRead,
18922   ByteCount * oOutputLen,
18923   LogicalAddress oOutputStr,
18924   ItemCount iScriptRunBufLen,
18925   ItemCount * oScriptRunOutLen,
18926   ScriptCodeRun oScriptCodeRuns[]) ;
18927 extern OSStatus
18928 TruncateForTextToUnicode(
18929   ConstTextToUnicodeInfo iTextToUnicodeInfo,
18930   ByteCount iSourceLen,
18931   ConstLogicalAddress iSourceStr,
18932   ByteCount iMaxLen,
18933   ByteCount * oTruncatedLen) ;
18934 extern OSStatus
18935 TruncateForUnicodeToText(
18936   ConstUnicodeToTextInfo iUnicodeToTextInfo,
18937   ByteCount iSourceLen,
18938   const UniChar iSourceStr[],
18939   OptionBits iControlFlags,
18940   ByteCount iMaxLen,
18941   ByteCount * oTruncatedLen) ;
18942 extern OSStatus
18943 ConvertFromPStringToUnicode(
18944   TextToUnicodeInfo iTextToUnicodeInfo,
18945   ConstStr255Param iPascalStr,
18946   ByteCount iOutputBufLen,
18947   ByteCount * oUnicodeLen,
18948   UniChar oUnicodeStr[]) ;
18949 extern OSStatus
18950 ConvertFromUnicodeToPString(
18951   UnicodeToTextInfo iUnicodeToTextInfo,
18952   ByteCount iUnicodeLen,
18953   const UniChar iUnicodeStr[],
18954   Str255 oPascalStr) ;
18955 extern OSStatus
18956 CountUnicodeMappings(
18957   OptionBits iFilter,
18958   ConstUnicodeMappingPtr iFindMapping,
18959   ItemCount * oActualCount) ;
18960 extern OSStatus
18961 QueryUnicodeMappings(
18962   OptionBits iFilter,
18963   ConstUnicodeMappingPtr iFindMapping,
18964   ItemCount iMaxCount,
18965   ItemCount * oActualCount,
18966   UnicodeMapping oReturnedMappings[]) ;
18967 extern OSStatus
18968 SetFallbackUnicodeToText(
18969   UnicodeToTextInfo iUnicodeToTextInfo,
18970   UnicodeToTextFallbackUPP iFallback,
18971   OptionBits iControlFlags,
18972   LogicalAddress iInfoPtr) ;
18973 extern OSStatus
18974 SetFallbackUnicodeToTextRun(
18975   UnicodeToTextRunInfo iUnicodeToTextRunInfo,
18976   UnicodeToTextFallbackUPP iFallback,
18977   OptionBits iControlFlags,
18978   LogicalAddress iInfoPtr) ;
18979 extern OSStatus
18980 ResetTextToUnicodeInfo(TextToUnicodeInfo ioTextToUnicodeInfo) ;
18981 extern OSStatus
18982 ResetUnicodeToTextInfo(UnicodeToTextInfo ioUnicodeToTextInfo) ;
18983 extern OSStatus
18984 ResetUnicodeToTextRunInfo(UnicodeToTextRunInfo ioUnicodeToTextRunInfo) ;
18985
18986
18987
18988
18989
18990
18991 }
18992
18993
18994
18995 extern "C" {
18996
18997
18998
18999
19000 typedef UInt16 ThreadState;
19001 enum {
19002   kReadyThreadState = 0,
19003   kStoppedThreadState = 1,
19004   kRunningThreadState = 2
19005 };
19006
19007
19008
19009
19010 typedef void * ThreadTaskRef;
19011
19012 typedef UInt32 ThreadStyle;
19013 enum {
19014   kCooperativeThread = 1L << 0,
19015   kPreemptiveThread = 1L << 1
19016 };
19017
19018
19019 typedef UInt32 ThreadID;
19020 enum {
19021   kNoThreadID = 0,
19022   kCurrentThreadID = 1,
19023   kApplicationThreadID = 2
19024 };
19025
19026
19027 typedef UInt32 ThreadOptions;
19028 enum {
19029   kNewSuspend = (1 << 0),
19030   kUsePremadeThread = (1 << 1),
19031   kCreateIfNeeded = (1 << 2),
19032   kFPUNotNeeded = (1 << 3),
19033   kExactMatchThread = (1 << 4)
19034 };
19035
19036
19037 struct SchedulerInfoRec {
19038   UInt32 InfoRecSize;
19039   ThreadID CurrentThreadID;
19040   ThreadID SuggestedThreadID;
19041   ThreadID InterruptedCoopThreadID;
19042 };
19043 typedef struct SchedulerInfoRec SchedulerInfoRec;
19044 typedef SchedulerInfoRec * SchedulerInfoRecPtr;
19045
19046
19047
19048
19049
19050
19051 typedef void * voidPtr;
19052
19053 typedef voidPtr ( * ThreadEntryProcPtr)(void * threadParam);
19054
19055 typedef ThreadID ( * ThreadSchedulerProcPtr)(SchedulerInfoRecPtr schedulerInfo);
19056
19057 typedef void ( * ThreadSwitchProcPtr)(ThreadID threadBeingSwitched, void *switchProcParam);
19058
19059 typedef void ( * ThreadTerminationProcPtr)(ThreadID threadTerminated, void *terminationProcParam);
19060
19061 typedef void ( * DebuggerNewThreadProcPtr)(ThreadID threadCreated);
19062
19063 typedef void ( * DebuggerDisposeThreadProcPtr)(ThreadID threadDeleted);
19064
19065 typedef ThreadID ( * DebuggerThreadSchedulerProcPtr)(SchedulerInfoRecPtr schedulerInfo);
19066 typedef ThreadEntryProcPtr ThreadEntryUPP;
19067 typedef ThreadSchedulerProcPtr ThreadSchedulerUPP;
19068 typedef ThreadSwitchProcPtr ThreadSwitchUPP;
19069 typedef ThreadTerminationProcPtr ThreadTerminationUPP;
19070 typedef DebuggerNewThreadProcPtr DebuggerNewThreadUPP;
19071 typedef DebuggerDisposeThreadProcPtr DebuggerDisposeThreadUPP;
19072 typedef DebuggerThreadSchedulerProcPtr DebuggerThreadSchedulerUPP;
19073 extern ThreadEntryUPP
19074 NewThreadEntryUPP(ThreadEntryProcPtr userRoutine) ;
19075 extern ThreadSchedulerUPP
19076 NewThreadSchedulerUPP(ThreadSchedulerProcPtr userRoutine) ;
19077 extern ThreadSwitchUPP
19078 NewThreadSwitchUPP(ThreadSwitchProcPtr userRoutine) ;
19079 extern ThreadTerminationUPP
19080 NewThreadTerminationUPP(ThreadTerminationProcPtr userRoutine) ;
19081 extern DebuggerNewThreadUPP
19082 NewDebuggerNewThreadUPP(DebuggerNewThreadProcPtr userRoutine) ;
19083 extern DebuggerDisposeThreadUPP
19084 NewDebuggerDisposeThreadUPP(DebuggerDisposeThreadProcPtr userRoutine) ;
19085 extern DebuggerThreadSchedulerUPP
19086 NewDebuggerThreadSchedulerUPP(DebuggerThreadSchedulerProcPtr userRoutine) ;
19087 extern void
19088 DisposeThreadEntryUPP(ThreadEntryUPP userUPP) ;
19089 extern void
19090 DisposeThreadSchedulerUPP(ThreadSchedulerUPP userUPP) ;
19091 extern void
19092 DisposeThreadSwitchUPP(ThreadSwitchUPP userUPP) ;
19093 extern void
19094 DisposeThreadTerminationUPP(ThreadTerminationUPP userUPP) ;
19095 extern void
19096 DisposeDebuggerNewThreadUPP(DebuggerNewThreadUPP userUPP) ;
19097 extern void
19098 DisposeDebuggerDisposeThreadUPP(DebuggerDisposeThreadUPP userUPP) ;
19099 extern void
19100 DisposeDebuggerThreadSchedulerUPP(DebuggerThreadSchedulerUPP userUPP) ;
19101 extern voidPtr
19102 InvokeThreadEntryUPP(
19103   void * threadParam,
19104   ThreadEntryUPP userUPP) ;
19105 extern ThreadID
19106 InvokeThreadSchedulerUPP(
19107   SchedulerInfoRecPtr schedulerInfo,
19108   ThreadSchedulerUPP userUPP) ;
19109 extern void
19110 InvokeThreadSwitchUPP(
19111   ThreadID threadBeingSwitched,
19112   void * switchProcParam,
19113   ThreadSwitchUPP userUPP) ;
19114 extern void
19115 InvokeThreadTerminationUPP(
19116   ThreadID threadTerminated,
19117   void * terminationProcParam,
19118   ThreadTerminationUPP userUPP) ;
19119 extern void
19120 InvokeDebuggerNewThreadUPP(
19121   ThreadID threadCreated,
19122   DebuggerNewThreadUPP userUPP) ;
19123 extern void
19124 InvokeDebuggerDisposeThreadUPP(
19125   ThreadID threadDeleted,
19126   DebuggerDisposeThreadUPP userUPP) ;
19127 extern ThreadID
19128 InvokeDebuggerThreadSchedulerUPP(
19129   SchedulerInfoRecPtr schedulerInfo,
19130   DebuggerThreadSchedulerUPP userUPP) ;
19131 typedef ThreadEntryUPP ThreadEntryTPP;
19132 typedef ThreadSchedulerUPP ThreadSchedulerTPP;
19133 typedef ThreadSwitchUPP ThreadSwitchTPP;
19134 typedef ThreadTerminationUPP ThreadTerminationTPP;
19135 typedef DebuggerNewThreadUPP DebuggerNewThreadTPP;
19136 typedef DebuggerDisposeThreadUPP DebuggerDisposeThreadTPP;
19137 typedef DebuggerThreadSchedulerUPP DebuggerThreadSchedulerTPP;
19138 extern OSErr
19139 NewThread(
19140   ThreadStyle threadStyle,
19141   ThreadEntryTPP threadEntry,
19142   void * threadParam,
19143   Size stackSize,
19144   ThreadOptions options,
19145   void ** threadResult,
19146   ThreadID * threadMade) ;
19147 extern OSErr
19148 SetThreadScheduler(ThreadSchedulerTPP threadScheduler) ;
19149 extern OSErr
19150 SetThreadSwitcher(
19151   ThreadID thread,
19152   ThreadSwitchTPP threadSwitcher,
19153   void * switchProcParam,
19154   Boolean inOrOut) ;
19155 extern OSErr
19156 SetThreadTerminator(
19157   ThreadID thread,
19158   ThreadTerminationTPP threadTerminator,
19159   void * terminationProcParam) ;
19160 extern OSErr
19161 SetDebuggerNotificationProcs(
19162   DebuggerNewThreadTPP notifyNewThread,
19163   DebuggerDisposeThreadTPP notifyDisposeThread,
19164   DebuggerThreadSchedulerTPP notifyThreadScheduler) ;
19165 extern OSErr
19166 CreateThreadPool(
19167   ThreadStyle threadStyle,
19168   SInt16 numToCreate,
19169   Size stackSize) ;
19170 extern OSErr
19171 GetFreeThreadCount(
19172   ThreadStyle threadStyle,
19173   SInt16 * freeCount) ;
19174 extern OSErr
19175 GetSpecificFreeThreadCount(
19176   ThreadStyle threadStyle,
19177   Size stackSize,
19178   SInt16 * freeCount) ;
19179 extern OSErr
19180 GetDefaultThreadStackSize(
19181   ThreadStyle threadStyle,
19182   Size * stackSize) ;
19183 extern OSErr
19184 ThreadCurrentStackSpace(
19185   ThreadID thread,
19186   UInt32 * freeStack) ;
19187 extern OSErr
19188 DisposeThread(
19189   ThreadID threadToDump,
19190   void * threadResult,
19191   Boolean recycleThread) ;
19192 extern OSErr
19193 YieldToThread(ThreadID suggestedThread) ;
19194 extern OSErr
19195 YieldToAnyThread(void) ;
19196 extern OSErr
19197 GetCurrentThread(ThreadID * currentThreadID) ;
19198 extern OSErr
19199 GetThreadState(
19200   ThreadID threadToGet,
19201   ThreadState * threadState) ;
19202 extern OSErr
19203 SetThreadState(
19204   ThreadID threadToSet,
19205   ThreadState newState,
19206   ThreadID suggestedThread) ;
19207 extern OSErr
19208 SetThreadStateEndCritical(
19209   ThreadID threadToSet,
19210   ThreadState newState,
19211   ThreadID suggestedThread) ;
19212 extern OSErr
19213 ThreadBeginCritical(void) ;
19214 extern OSErr
19215 ThreadEndCritical(void) ;
19216 extern OSErr
19217 GetThreadCurrentTaskRef(ThreadTaskRef * threadTRef) ;
19218 extern OSErr
19219 GetThreadStateGivenTaskRef(
19220   ThreadTaskRef threadTRef,
19221   ThreadID threadToGet,
19222   ThreadState * threadState) ;
19223 extern OSErr
19224 SetThreadReadyGivenTaskRef(
19225   ThreadTaskRef threadTRef,
19226   ThreadID threadToSet) ;
19227
19228
19229
19230
19231
19232 }
19233
19234
19235
19236 extern "C" {
19237
19238
19239
19240 enum {
19241   kOnSystemDisk = -32768L,
19242   kOnAppropriateDisk = -32767,
19243
19244
19245   kSystemDomain = -32766,
19246   kLocalDomain = -32765,
19247   kNetworkDomain = -32764,
19248   kUserDomain = -32763,
19249   kClassicDomain = -32762
19250 };
19251
19252
19253
19254
19255
19256 enum {
19257   kLastDomainConstant = kUserDomain
19258 };
19259
19260 enum {
19261   kCreateFolder = true,
19262   kDontCreateFolder = false
19263 };
19264
19265 enum {
19266   kSystemFolderType = 'macs',
19267   kDesktopFolderType = 'desk',
19268   kSystemDesktopFolderType = 'sdsk',
19269   kTrashFolderType = 'trsh',
19270   kSystemTrashFolderType = 'strs',
19271   kWhereToEmptyTrashFolderType = 'empt',
19272   kPrintMonitorDocsFolderType = 'prnt',
19273   kStartupFolderType = 'strt',
19274   kShutdownFolderType = 'shdf',
19275   kAppleMenuFolderType = 'amnu',
19276   kControlPanelFolderType = 'ctrl',
19277   kSystemControlPanelFolderType = 'sctl',
19278   kExtensionFolderType = 'extn',
19279   kFontsFolderType = 'font',
19280   kPreferencesFolderType = 'pref',
19281   kSystemPreferencesFolderType = 'sprf',
19282   kTemporaryFolderType = 'temp'
19283 };
19284 extern OSErr
19285 FindFolder(
19286   short vRefNum,
19287   OSType folderType,
19288   Boolean createFolder,
19289   short * foundVRefNum,
19290   long * foundDirID) ;
19291 extern OSErr
19292 FindFolderExtended(
19293   short vol,
19294   OSType foldType,
19295   Boolean createFolder,
19296   UInt32 flags,
19297   void * data,
19298   short * vRefNum,
19299   long * dirID) ;
19300 extern OSErr
19301 ReleaseFolder(
19302   short vRefNum,
19303   OSType folderType) ;
19304 extern OSErr
19305 FSFindFolder(
19306   short vRefNum,
19307   OSType folderType,
19308   Boolean createFolder,
19309   FSRef * foundRef) ;
19310 extern OSErr
19311 FSFindFolderExtended(
19312   short vol,
19313   OSType foldType,
19314   Boolean createFolder,
19315   UInt32 flags,
19316   void * data,
19317   FSRef * foundRef) ;
19318 enum {
19319   kExtensionDisabledFolderType = 'extD',
19320   kControlPanelDisabledFolderType = 'ctrD',
19321   kSystemExtensionDisabledFolderType = 'macD',
19322   kStartupItemsDisabledFolderType = 'strD',
19323   kShutdownItemsDisabledFolderType = 'shdD',
19324   kApplicationsFolderType = 'apps',
19325   kDocumentsFolderType = 'docs'
19326 };
19327
19328 enum {
19329
19330   kVolumeRootFolderType = 'root',
19331   kChewableItemsFolderType = 'flnt',
19332   kApplicationSupportFolderType = 'asup',
19333   kTextEncodingsFolderType = 'Ätex',
19334   kStationeryFolderType = 'odst',
19335   kOpenDocFolderType = 'odod',
19336   kOpenDocShellPlugInsFolderType = 'odsp',
19337   kEditorsFolderType = 'oded',
19338   kOpenDocEditorsFolderType = 'Äodf',
19339   kOpenDocLibrariesFolderType = 'odlb',
19340   kGenEditorsFolderType = 'Äedi',
19341   kHelpFolderType = 'Ählp',
19342   kInternetPlugInFolderType = 'Änet',
19343   kModemScriptsFolderType = 'Ämod',
19344   kPrinterDescriptionFolderType = 'ppdf',
19345   kPrinterDriverFolderType = 'Äprd',
19346   kScriptingAdditionsFolderType = 'Äscr',
19347   kSharedLibrariesFolderType = 'Älib',
19348   kVoicesFolderType = 'fvoc',
19349   kControlStripModulesFolderType = 'sdev',
19350   kAssistantsFolderType = 'astÄ',
19351   kUtilitiesFolderType = 'utiÄ',
19352   kAppleExtrasFolderType = 'aexÄ',
19353   kContextualMenuItemsFolderType = 'cmnu',
19354   kMacOSReadMesFolderType = 'morÄ',
19355   kALMModulesFolderType = 'walk',
19356   kALMPreferencesFolderType = 'trip',
19357   kALMLocationsFolderType = 'fall',
19358   kColorSyncProfilesFolderType = 'prof',
19359   kThemesFolderType = 'thme',
19360   kFavoritesFolderType = 'favs',
19361   kInternetFolderType = 'intÄ',
19362   kAppearanceFolderType = 'appr',
19363   kSoundSetsFolderType = 'snds',
19364   kDesktopPicturesFolderType = 'dtpÄ',
19365   kInternetSearchSitesFolderType = 'issf',
19366   kFindSupportFolderType = 'fnds',
19367   kFindByContentFolderType = 'fbcf',
19368   kInstallerLogsFolderType = 'ilgf',
19369   kScriptsFolderType = 'scrÄ',
19370   kFolderActionsFolderType = 'fasf',
19371   kLauncherItemsFolderType = 'laun',
19372   kRecentApplicationsFolderType = 'rapp',
19373   kRecentDocumentsFolderType = 'rdoc',
19374   kRecentServersFolderType = 'rsvr',
19375   kSpeakableItemsFolderType = 'spki',
19376   kKeychainFolderType = 'kchn',
19377   kQuickTimeExtensionsFolderType = 'qtex',
19378   kDisplayExtensionsFolderType = 'dspl',
19379   kMultiprocessingFolderType = 'mpxf',
19380   kPrintingPlugInsFolderType = 'pplg'
19381 };
19382
19383
19384
19385
19386 enum {
19387   kDomainTopLevelFolderType = 'dtop',
19388   kDomainLibraryFolderType = 'dlib',
19389   kColorSyncFolderType = 'sync',
19390   kColorSyncCMMFolderType = 'ccmm',
19391   kColorSyncScriptingFolderType = 'cscr',
19392   kPrintersFolderType = 'impr',
19393   kSpeechFolderType = 'spch',
19394   kCarbonLibraryFolderType = 'carb',
19395   kDocumentationFolderType = 'info',
19396   kDeveloperDocsFolderType = 'ddoc',
19397   kDeveloperHelpFolderType = 'devh',
19398   kISSDownloadsFolderType = 'issd',
19399   kUserSpecificTmpFolderType = 'utmp',
19400   kCachedDataFolderType = 'cach',
19401   kFrameworksFolderType = 'fram',
19402   kPrivateFrameworksFolderType = 'pfrm',
19403   kClassicDesktopFolderType = 'sdsk',
19404
19405
19406   kDeveloperFolderType = 'devf',
19407   kSystemSoundsFolderType = 'ssnd',
19408   kComponentsFolderType = 'cmpd',
19409   kQuickTimeComponentsFolderType = 'wcmp',
19410   kCoreServicesFolderType = 'csrv',
19411   kPictureDocumentsFolderType = 'pdoc',
19412   kMovieDocumentsFolderType = 'mdoc',
19413   kMusicDocumentsFolderType = 'µdoc',
19414   kInternetSitesFolderType = 'site',
19415   kPublicFolderType = 'pubb',
19416   kAudioSupportFolderType = 'adio',
19417   kAudioSoundsFolderType = 'asnd',
19418   kAudioSoundBanksFolderType = 'bank',
19419   kAudioAlertSoundsFolderType = 'alrt',
19420   kAudioPlugInsFolderType = 'aplg',
19421   kAudioComponentsFolderType = 'acmp',
19422   kKernelExtensionsFolderType = 'kext',
19423   kDirectoryServicesFolderType = 'dsrv',
19424   kDirectoryServicesPlugInsFolderType = 'dplg',
19425   kInstallerReceiptsFolderType = 'rcpt',
19426   kFileSystemSupportFolderType = 'fsys',
19427   kAppleShareSupportFolderType = 'shar',
19428   kAppleShareAuthenticationFolderType = 'auth',
19429   kMIDIDriversFolderType = 'midi',
19430   kKeyboardLayoutsFolderType = 'klay',
19431   kIndexFilesFolderType = 'indx',
19432   kFindByContentIndexesFolderType = 'fbcx',
19433   kManagedItemsFolderType = 'mang',
19434   kBootTimeStartupItemsFolderType = 'empz'
19435 };
19436
19437 enum {
19438   kLocalesFolderType = 'Äloc',
19439   kFindByContentPluginsFolderType = 'fbcp'
19440 };
19441
19442 enum {
19443   kUsersFolderType = 'usrs',
19444   kCurrentUserFolderType = 'cusr',
19445   kCurrentUserRemoteFolderLocation = 'rusf',
19446   kCurrentUserRemoteFolderType = 'rusr',
19447   kSharedUserDataFolderType = 'sdat',
19448   kVolumeSettingsFolderType = 'vsfd'
19449 };
19450
19451 enum {
19452   kAppleshareAutomountServerAliasesFolderType = 'srvÄ',
19453   kPreMacOS91ApplicationsFolderType = '\8cpps',
19454   kPreMacOS91InstallerLogsFolderType = '\94lgf',
19455   kPreMacOS91AssistantsFolderType = '\8cstÄ',
19456   kPreMacOS91UtilitiesFolderType = '\9ftiÄ',
19457   kPreMacOS91AppleExtrasFolderType = '\8cexÄ',
19458   kPreMacOS91MacOSReadMesFolderType = 'µorÄ',
19459   kPreMacOS91InternetFolderType = '\94ntÄ',
19460   kPreMacOS91AutomountedServersFolderType = '§rvÄ',
19461   kPreMacOS91StationeryFolderType = '¿dst'
19462 };
19463
19464
19465 enum {
19466   kCreateFolderAtBoot = 0x00000002,
19467   kCreateFolderAtBootBit = 1,
19468   kFolderCreatedInvisible = 0x00000004,
19469   kFolderCreatedInvisibleBit = 2,
19470   kFolderCreatedNameLocked = 0x00000008,
19471   kFolderCreatedNameLockedBit = 3,
19472   kFolderCreatedAdminPrivs = 0x00000010,
19473   kFolderCreatedAdminPrivsBit = 4
19474 };
19475
19476 enum {
19477   kFolderInUserFolder = 0x00000020,
19478   kFolderInUserFolderBit = 5,
19479   kFolderTrackedByAlias = 0x00000040,
19480   kFolderTrackedByAliasBit = 6,
19481   kFolderInRemoteUserFolderIfAvailable = 0x00000080,
19482   kFolderInRemoteUserFolderIfAvailableBit = 7,
19483   kFolderNeverMatchedInIdentifyFolder = 0x00000100,
19484   kFolderNeverMatchedInIdentifyFolderBit = 8,
19485   kFolderMustStayOnSameVolume = 0x00000200,
19486   kFolderMustStayOnSameVolumeBit = 9,
19487   kFolderManagerFolderInMacOS9FolderIfMacOSXIsInstalledMask = 0x00000400,
19488   kFolderManagerFolderInMacOS9FolderIfMacOSXIsInstalledBit = 10,
19489   kFolderInLocalOrRemoteUserFolder = kFolderInUserFolder | kFolderInRemoteUserFolderIfAvailable
19490 };
19491
19492 typedef UInt32 FolderDescFlags;
19493
19494 enum {
19495   kRelativeFolder = 'relf',
19496   kSpecialFolder = 'spcf'
19497 };
19498
19499 typedef OSType FolderClass;
19500
19501 enum {
19502   kBlessedFolder = 'blsf',
19503   kRootFolder = 'rotf'
19504 };
19505
19506 enum {
19507   kCurrentUserFolderLocation = 'cusf'
19508 };
19509
19510 typedef OSType FolderType;
19511 typedef OSType FolderLocation;
19512
19513 struct FolderDesc {
19514   Size descSize;
19515   FolderType foldType;
19516   FolderDescFlags flags;
19517   FolderClass foldClass;
19518   FolderType foldLocation;
19519   OSType badgeSignature;
19520   OSType badgeType;
19521   UInt32 reserved;
19522   StrFileName name;
19523 };
19524 typedef struct FolderDesc FolderDesc;
19525 typedef FolderDesc * FolderDescPtr;
19526
19527 typedef UInt32 RoutingFlags;
19528 struct FolderRouting {
19529   Size descSize;
19530   OSType fileType;
19531   FolderType routeFromFolder;
19532   FolderType routeToFolder;
19533   RoutingFlags flags;
19534 };
19535 typedef struct FolderRouting FolderRouting;
19536 typedef FolderRouting * FolderRoutingPtr;
19537
19538
19539 enum {
19540
19541
19542
19543   kFindFolderRedirectionFlagUseDistinctUserFoldersBit = 0,
19544
19545
19546   kFindFolderRedirectionFlagUseGivenVRefAndDirIDAsUserFolderBit = 1,
19547
19548
19549   kFindFolderRedirectionFlagsUseGivenVRefNumAndDirIDAsRemoteUserFolderBit = 2
19550 };
19551
19552 struct FindFolderUserRedirectionGlobals {
19553   UInt32 version;
19554   UInt32 flags;
19555
19556   Str31 userName;
19557   short userNameScript;
19558
19559   short currentUserFolderVRefNum;
19560   long currentUserFolderDirID;
19561
19562   short remoteUserFolderVRefNum;
19563   long remoteUserFolderDirID;
19564 };
19565 typedef struct FindFolderUserRedirectionGlobals FindFolderUserRedirectionGlobals;
19566 typedef FindFolderUserRedirectionGlobals * FindFolderUserRedirectionGlobalsPtr;
19567 enum {
19568   kFolderManagerUserRedirectionGlobalsCurrentVersion = 1
19569 };
19570
19571
19572
19573
19574
19575 enum {
19576   kFindFolderExtendedFlagsDoNotFollowAliasesBit = 0,
19577   kFindFolderExtendedFlagsDoNotUseUserFolderBit = 1,
19578   kFindFolderExtendedFlagsUseOtherUserRecord = 0x01000000
19579 };
19580
19581 typedef OSStatus ( * FolderManagerNotificationProcPtr)(OSType message, void *arg, void *userRefCon);
19582 typedef FolderManagerNotificationProcPtr FolderManagerNotificationUPP;
19583 extern FolderManagerNotificationUPP
19584 NewFolderManagerNotificationUPP(FolderManagerNotificationProcPtr userRoutine) ;
19585 extern void
19586 DisposeFolderManagerNotificationUPP(FolderManagerNotificationUPP userUPP) ;
19587 extern OSStatus
19588 InvokeFolderManagerNotificationUPP(
19589   OSType message,
19590   void * arg,
19591   void * userRefCon,
19592   FolderManagerNotificationUPP userUPP) ;
19593
19594 enum {
19595   kFolderManagerNotificationMessageUserLogIn = 'log+',
19596   kFolderManagerNotificationMessagePreUserLogIn = 'logj',
19597   kFolderManagerNotificationMessageUserLogOut = 'log-',
19598   kFolderManagerNotificationMessagePostUserLogOut = 'logp',
19599   kFolderManagerNotificationDiscardCachedData = 'dche',
19600   kFolderManagerNotificationMessageLoginStartup = 'stup'
19601 };
19602
19603
19604
19605 enum {
19606   kDoNotRemoveWhenCurrentApplicationQuitsBit = 0,
19607   kDoNotRemoveWheCurrentApplicationQuitsBit = kDoNotRemoveWhenCurrentApplicationQuitsBit
19608 };
19609
19610
19611 enum {
19612   kStopIfAnyNotificationProcReturnsErrorBit = 31
19613 };
19614 extern OSErr
19615 AddFolderDescriptor(
19616   FolderType foldType,
19617   FolderDescFlags flags,
19618   FolderClass foldClass,
19619   FolderLocation foldLocation,
19620   OSType badgeSignature,
19621   OSType badgeType,
19622   ConstStrFileNameParam name,
19623   Boolean replaceFlag) ;
19624 extern OSErr
19625 GetFolderDescriptor(
19626   FolderType foldType,
19627   Size descSize,
19628   FolderDesc * foldDesc) ;
19629 extern OSErr
19630 GetFolderTypes(
19631   UInt32 requestedTypeCount,
19632   UInt32 * totalTypeCount,
19633   FolderType * theTypes) ;
19634 extern OSErr
19635 RemoveFolderDescriptor(FolderType foldType) ;
19636 extern OSErr
19637 GetFolderName(
19638   short vRefNum,
19639   OSType foldType,
19640   short * foundVRefNum,
19641   StrFileName name) ;
19642 extern OSErr
19643 AddFolderRouting(
19644   OSType fileType,
19645   FolderType routeFromFolder,
19646   FolderType routeToFolder,
19647   RoutingFlags flags,
19648   Boolean replaceFlag) ;
19649 extern OSErr
19650 RemoveFolderRouting(
19651   OSType fileType,
19652   FolderType routeFromFolder) ;
19653 extern OSErr
19654 FindFolderRouting(
19655   OSType fileType,
19656   FolderType routeFromFolder,
19657   FolderType * routeToFolder,
19658   RoutingFlags * flags) ;
19659 extern OSErr
19660 GetFolderRoutings(
19661   UInt32 requestedRoutingCount,
19662   UInt32 * totalRoutingCount,
19663   Size routingSize,
19664   FolderRouting * theRoutings) ;
19665 extern OSErr
19666 InvalidateFolderDescriptorCache(
19667   short vRefNum,
19668   long dirID) ;
19669 extern OSErr
19670 IdentifyFolder(
19671   short vRefNum,
19672   long dirID,
19673   FolderType * foldType) ;
19674 extern OSErr
19675 FolderManagerRegisterNotificationProc(
19676   FolderManagerNotificationUPP notificationProc,
19677   void * refCon,
19678   UInt32 options) ;
19679 extern OSErr
19680 FolderManagerUnregisterNotificationProc(
19681   FolderManagerNotificationUPP notificationProc,
19682   void * refCon) ;
19683 extern OSStatus
19684 FolderManagerRegisterCallNotificationProcs(
19685   OSType message,
19686   void * arg,
19687   UInt32 options) ;
19688 struct MultiUserGestalt {
19689
19690   short giVersion;
19691   short giReserved0;
19692   short giReserved1;
19693   short giReserved2;
19694   short giReserved3;
19695   FSSpec giReserved4;
19696
19697
19698   short giDocsVRefNum;
19699   long giDocsDirID;
19700   short giForceSaves;
19701   short giForceOpens;
19702   Str31 giSetupName;
19703   Str31 giUserName;
19704   Str31 giFrontAppName;
19705   short giReserved5;
19706   short giIsOn;
19707
19708
19709
19710
19711
19712   short giUserLoggedInType;
19713   char giUserEncryptPwd[16];
19714   short giUserEnvironment;
19715   long giReserved6;
19716   long giReserved7;
19717   Boolean giDisableScrnShots;
19718
19719
19720   Boolean giSupportsAsyncFSCalls;
19721   short giPrefsVRefNum;
19722   long giPrefsDirID;
19723   unsigned long giUserLogInTime;
19724   Boolean giUsingPrintQuotas;
19725   Boolean giUsingDiskQuotas;
19726
19727
19728   Boolean giInSystemAccess;
19729   Boolean giUserFolderEnabled;
19730   short giReserved8;
19731   long giReserved9;
19732   Boolean giInLoginScreen;
19733
19734
19735
19736
19737 };
19738 typedef struct MultiUserGestalt MultiUserGestalt;
19739 typedef MultiUserGestalt * MultiUserGestaltPtr;
19740 typedef MultiUserGestaltPtr * MultiUserGestaltHandle;
19741
19742
19743
19744
19745
19746 }
19747
19748
19749
19750 extern "C" {
19751
19752
19753
19754 enum {
19755
19756   kTMTaskActive = (1L << 15)
19757 };
19758
19759 typedef struct TMTask TMTask;
19760 typedef TMTask * TMTaskPtr;
19761 typedef void ( * TimerProcPtr)(TMTaskPtr tmTaskPtr);
19762 typedef TimerProcPtr TimerUPP;
19763 struct TMTask {
19764   QElemPtr qLink;
19765   short qType;
19766   TimerUPP tmAddr;
19767   long tmCount;
19768   long tmWakeUp;
19769   long tmReserved;
19770 };
19771 extern void
19772 InsTime(QElemPtr tmTaskPtr) ;
19773 extern void
19774 InsXTime(QElemPtr tmTaskPtr) ;
19775 extern void
19776 PrimeTime(
19777   QElemPtr tmTaskPtr,
19778   long count) ;
19779 extern void
19780 RmvTime(QElemPtr tmTaskPtr) ;
19781 extern OSErr
19782 InstallTimeTask(QElemPtr tmTaskPtr) ;
19783 extern OSErr
19784 InstallXTimeTask(QElemPtr tmTaskPtr) ;
19785 extern OSErr
19786 PrimeTimeTask(
19787   QElemPtr tmTaskPtr,
19788   long count) ;
19789 extern OSErr
19790 RemoveTimeTask(QElemPtr tmTaskPtr) ;
19791 extern void
19792 Microseconds(UnsignedWide * microTickCount) ;
19793 extern TimerUPP
19794 NewTimerUPP(TimerProcPtr userRoutine) ;
19795 extern void
19796 DisposeTimerUPP(TimerUPP userUPP) ;
19797 extern void
19798 InvokeTimerUPP(
19799   TMTaskPtr tmTaskPtr,
19800   TimerUPP userUPP) ;
19801
19802
19803
19804
19805
19806
19807 }
19808
19809
19810
19811 enum {
19812
19813   kMPQueueInfoVersion = 1L | (kOpaqueQueueID << 16),
19814   kMPSemaphoreInfoVersion = 1L | (kOpaqueSemaphoreID << 16),
19815   kMPEventInfoVersion = 1L | (kOpaqueEventID << 16),
19816   kMPCriticalRegionInfoVersion = 1L | (kOpaqueCriticalRegionID << 16),
19817   kMPNotificationInfoVersion = 1L | (kOpaqueNotificationID << 16),
19818   kMPAddressSpaceInfoVersion = 1L | (kOpaqueAddressSpaceID << 16)
19819 };
19820
19821
19822 struct MPQueueInfo {
19823   PBVersion version;
19824
19825   MPProcessID processID;
19826   OSType queueName;
19827
19828   ItemCount nWaiting;
19829   MPTaskID waitingTaskID;
19830
19831   ItemCount nMessages;
19832   ItemCount nReserved;
19833
19834   void * p1;
19835   void * p2;
19836   void * p3;
19837 };
19838 typedef struct MPQueueInfo MPQueueInfo;
19839 struct MPSemaphoreInfo {
19840   PBVersion version;
19841
19842   MPProcessID processID;
19843   OSType semaphoreName;
19844
19845   ItemCount nWaiting;
19846   MPTaskID waitingTaskID;
19847
19848   ItemCount maximum;
19849   ItemCount count;
19850 };
19851 typedef struct MPSemaphoreInfo MPSemaphoreInfo;
19852 struct MPEventInfo {
19853   PBVersion version;
19854
19855   MPProcessID processID;
19856   OSType eventName;
19857
19858   ItemCount nWaiting;
19859   MPTaskID waitingTaskID;
19860
19861   MPEventFlags events;
19862 };
19863 typedef struct MPEventInfo MPEventInfo;
19864 struct MPCriticalRegionInfo {
19865   PBVersion version;
19866
19867   MPProcessID processID;
19868   OSType regionName;
19869
19870   ItemCount nWaiting;
19871   MPTaskID waitingTaskID;
19872
19873   MPTaskID owningTask;
19874   ItemCount count;
19875 };
19876 typedef struct MPCriticalRegionInfo MPCriticalRegionInfo;
19877 struct MPNotificationInfo {
19878   PBVersion version;
19879
19880   MPProcessID processID;
19881   OSType notificationName;
19882
19883   MPQueueID queueID;
19884   void * p1;
19885   void * p2;
19886   void * p3;
19887
19888   MPEventID eventID;
19889   MPEventFlags events;
19890
19891   MPSemaphoreID semaphoreID;
19892 };
19893 typedef struct MPNotificationInfo MPNotificationInfo;
19894 struct MPAddressSpaceInfo {
19895   PBVersion version;
19896
19897   MPProcessID processID;
19898   MPCoherenceID groupID;
19899   ItemCount nTasks;
19900   UInt32 vsid[16];
19901 };
19902 typedef struct MPAddressSpaceInfo MPAddressSpaceInfo;
19903 extern "C" {
19904
19905
19906 extern Ptr LMGetMemTop(void) ;
19907 extern void LMSetMemTop(Ptr value) ;
19908 extern Ptr LMGetBufPtr(void) ;
19909 extern void LMSetBufPtr(Ptr value) ;
19910 extern Ptr LMGetHeapEnd(void) ;
19911 extern void LMSetHeapEnd(Ptr value) ;
19912 extern UInt8 LMGetCPUFlag(void) ;
19913 extern void LMSetCPUFlag(UInt8 value) ;
19914 extern SInt32 LMGetRndSeed(void) ;
19915 extern void LMSetRndSeed(SInt32 value) ;
19916 extern UInt8 LMGetSEvtEnb(void) ;
19917 extern void LMSetSEvtEnb(UInt8 value) ;
19918 extern SInt16 LMGetBootDrive(void) ;
19919 extern void LMSetBootDrive(SInt16 value) ;
19920 extern SInt16 LMGetMemErr(void) ;
19921 extern void LMSetMemErr(SInt16 value) ;
19922 extern UInt8 LMGetSdVolume(void) ;
19923 extern void LMSetSdVolume(UInt8 value) ;
19924 extern Ptr LMGetSoundPtr(void) ;
19925 extern void LMSetSoundPtr(Ptr value) ;
19926 extern Ptr LMGetSoundBase(void) ;
19927 extern void LMSetSoundBase(Ptr value) ;
19928 extern UInt8 LMGetSoundLevel(void) ;
19929 extern void LMSetSoundLevel(UInt8 value) ;
19930 extern SInt16 LMGetCurPitch(void) ;
19931 extern void LMSetCurPitch(SInt16 value) ;
19932 extern THz LMGetSysZone(void) ;
19933 extern void LMSetSysZone(THz value) ;
19934 extern THz LMGetApplZone(void) ;
19935 extern void LMSetApplZone(THz value) ;
19936 extern UInt8 LMGetScrDmpEnb(void) ;
19937 extern void LMSetScrDmpEnb(UInt8 value) ;
19938 extern SInt32 LMGetBufTgFNum(void) ;
19939 extern void LMSetBufTgFNum(SInt32 value) ;
19940 extern SInt16 LMGetBufTgFFlg(void) ;
19941 extern void LMSetBufTgFFlg(SInt16 value) ;
19942 extern SInt16 LMGetBufTgFBkNum(void) ;
19943 extern void LMSetBufTgFBkNum(SInt16 value) ;
19944 extern SInt32 LMGetBufTgDate(void) ;
19945 extern void LMSetBufTgDate(SInt32 value) ;
19946 extern SInt32 LMGetMinStack(void) ;
19947 extern void LMSetMinStack(SInt32 value) ;
19948 extern SInt32 LMGetDefltStack(void) ;
19949 extern void LMSetDefltStack(SInt32 value) ;
19950 extern Handle LMGetGZRootHnd(void) ;
19951 extern void LMSetGZRootHnd(Handle value) ;
19952 extern Handle LMGetGZMoveHnd(void) ;
19953 extern void LMSetGZMoveHnd(Handle value) ;
19954 extern UniversalProcPtr LMGetToExtFS(void) ;
19955 extern void LMSetToExtFS(UniversalProcPtr value) ;
19956 extern UniversalProcPtr LMGetJStash(void) ;
19957 extern void LMSetJStash(UniversalProcPtr value) ;
19958 extern SInt16 LMGetCurApRefNum(void) ;
19959 extern void LMSetCurApRefNum(SInt16 value) ;
19960 extern Ptr LMGetCurStackBase(void) ;
19961 extern void LMSetCurStackBase(Ptr value) ;
19962 extern SInt16 LMGetCurPageOption(void) ;
19963 extern void LMSetCurPageOption(SInt16 value) ;
19964 extern SInt16 LMGetPrintErr(void) ;
19965 extern void LMSetPrintErr(SInt16 value) ;
19966 extern SInt16 LMGetApFontID(void) ;
19967 extern void LMSetApFontID(SInt16 value) ;
19968 extern SInt32 LMGetOneOne(void) ;
19969 extern void LMSetOneOne(SInt32 value) ;
19970 extern SInt32 LMGetMinusOne(void) ;
19971 extern void LMSetMinusOne(SInt32 value) ;
19972 extern SInt16 LMGetSysMap(void) ;
19973 extern void LMSetSysMap(SInt16 value) ;
19974 extern UInt8 LMGetResLoad(void) ;
19975 extern void LMSetResLoad(UInt8 value) ;
19976 extern SInt16 LMGetResErr(void) ;
19977 extern void LMSetResErr(SInt16 value) ;
19978 extern UInt8 LMGetTmpResLoad(void) ;
19979 extern void LMSetTmpResLoad(UInt8 value) ;
19980 extern Ptr LMGetIntlSpec(void) ;
19981 extern void LMSetIntlSpec(Ptr value) ;
19982 extern SInt16 LMGetSysFontFam(void) ;
19983 extern void LMSetSysFontFam(SInt16 value) ;
19984 extern SInt16 LMGetSysFontSize(void) ;
19985 extern void LMSetSysFontSize(SInt16 value) ;
19986 extern StringPtr LMGetCurApName(void) ;
19987 extern void LMSetCurApName(ConstStr31Param curApNameValue) ;
19988 extern StringPtr LMGetSysResName(void) ;
19989 extern void LMSetSysResName(ConstStr15Param sysResNameValue) ;
19990 extern StringPtr LMGetFinderName(void) ;
19991 extern void LMSetFinderName(ConstStr15Param finderNameValue) ;
19992 extern Ptr LMGetToolScratch(void) ;
19993 extern void LMSetToolScratch(const void * toolScratchValue) ;
19994 extern UniversalProcPtr LMGetLvl2DT(short vectorNumber) ;
19995 extern void LMSetLvl2DT(UniversalProcPtr Lvl2DTValue, short vectorNumber) ;
19996 extern Ptr LMGetHighHeapMark(void) ;
19997 extern void LMSetHighHeapMark(Ptr value) ;
19998 extern Ptr LMGetStackLowPoint(void) ;
19999 extern void LMSetStackLowPoint(Ptr value) ;
20000 extern Ptr LMGetDiskFormatingHFSDefaults(void) ;
20001 extern void LMSetDiskFormatingHFSDefaults(Ptr value) ;
20002
20003
20004 }
20005
20006
20007
20008 extern "C" {
20009
20010
20011 typedef UInt16 AVLVisitStage;
20012 enum {
20013   kAVLPreOrder = 0,
20014   kAVLInOrder = 1,
20015   kAVLPostOrder = 2
20016 };
20017
20018
20019 typedef UInt16 AVLOrder;
20020 enum {
20021   kLeftToRight = 0,
20022   kRightToLeft = 1
20023 };
20024
20025
20026 typedef UInt16 AVLNodeType;
20027 enum {
20028   kAVLIsTree = 0,
20029   kAVLIsLeftBranch = 1,
20030   kAVLIsRightBranch = 2,
20031   kAVLIsLeaf = 3,
20032   kAVLNullNode = 4
20033 };
20034
20035 enum {
20036   errItemAlreadyInTree = -960,
20037   errNotValidTree = -961,
20038   errItemNotFoundInTree = -962,
20039   errCanNotInsertWhileWalkProcInProgress = -963,
20040   errTreeIsLocked = -964
20041 };
20042
20043
20044 struct AVLTreeStruct {
20045   OSType signature;
20046   unsigned long privateStuff[8];
20047 };
20048 typedef struct AVLTreeStruct AVLTreeStruct;
20049 typedef AVLTreeStruct * AVLTreePtr;
20050
20051
20052
20053
20054
20055
20056
20057 typedef SInt32 ( * AVLCompareItemsProcPtr)(AVLTreePtr tree, const void *i1, const void *i2, AVLNodeType nd_typ);
20058
20059
20060
20061
20062
20063
20064 typedef UInt32 ( * AVLItemSizeProcPtr)(AVLTreePtr tree, const void *itemPtr);
20065
20066
20067
20068
20069
20070
20071 typedef void ( * AVLDisposeItemProcPtr)(AVLTreePtr tree, const void *dataP);
20072 typedef OSErr ( * AVLWalkProcPtr)(AVLTreePtr tree, const void *dataP, AVLVisitStage visitStage, AVLNodeType node, UInt32 level, SInt32 balance, void *refCon);
20073 typedef AVLCompareItemsProcPtr AVLCompareItemsUPP;
20074 typedef AVLItemSizeProcPtr AVLItemSizeUPP;
20075 typedef AVLDisposeItemProcPtr AVLDisposeItemUPP;
20076 typedef AVLWalkProcPtr AVLWalkUPP;
20077 extern AVLCompareItemsUPP
20078 NewAVLCompareItemsUPP(AVLCompareItemsProcPtr userRoutine) ;
20079 extern AVLItemSizeUPP
20080 NewAVLItemSizeUPP(AVLItemSizeProcPtr userRoutine) ;
20081 extern AVLDisposeItemUPP
20082 NewAVLDisposeItemUPP(AVLDisposeItemProcPtr userRoutine) ;
20083 extern AVLWalkUPP
20084 NewAVLWalkUPP(AVLWalkProcPtr userRoutine) ;
20085 extern void
20086 DisposeAVLCompareItemsUPP(AVLCompareItemsUPP userUPP) ;
20087 extern void
20088 DisposeAVLItemSizeUPP(AVLItemSizeUPP userUPP) ;
20089 extern void
20090 DisposeAVLDisposeItemUPP(AVLDisposeItemUPP userUPP) ;
20091 extern void
20092 DisposeAVLWalkUPP(AVLWalkUPP userUPP) ;
20093 extern SInt32
20094 InvokeAVLCompareItemsUPP(
20095   AVLTreePtr tree,
20096   const void * i1,
20097   const void * i2,
20098   AVLNodeType nd_typ,
20099   AVLCompareItemsUPP userUPP) ;
20100 extern UInt32
20101 InvokeAVLItemSizeUPP(
20102   AVLTreePtr tree,
20103   const void * itemPtr,
20104   AVLItemSizeUPP userUPP) ;
20105 extern void
20106 InvokeAVLDisposeItemUPP(
20107   AVLTreePtr tree,
20108   const void * dataP,
20109   AVLDisposeItemUPP userUPP) ;
20110 extern OSErr
20111 InvokeAVLWalkUPP(
20112   AVLTreePtr tree,
20113   const void * dataP,
20114   AVLVisitStage visitStage,
20115   AVLNodeType node,
20116   UInt32 level,
20117   SInt32 balance,
20118   void * refCon,
20119   AVLWalkUPP userUPP) ;
20120 extern OSErr
20121 AVLInit(
20122   UInt32 flags,
20123   AVLCompareItemsUPP compareItemsProc,
20124   AVLItemSizeUPP sizeItemProc,
20125   AVLDisposeItemUPP disposeItemProc,
20126   void * refCon,
20127   AVLTreePtr * tree) ;
20128 extern OSErr
20129 AVLDispose(
20130   AVLTreePtr * tree,
20131   AVLOrder order) ;
20132 extern OSErr
20133 AVLWalk(
20134   AVLTreePtr tree,
20135   AVLWalkUPP walkProc,
20136   AVLOrder order,
20137   void * walkRefCon) ;
20138 extern OSErr
20139 AVLCount(
20140   AVLTreePtr tree,
20141   UInt32 * count) ;
20142 extern OSErr
20143 AVLGetIndItem(
20144   AVLTreePtr tree,
20145   UInt32 index,
20146   void * dataPtr,
20147   UInt32 * itemSize) ;
20148 extern OSErr
20149 AVLInsert(
20150   AVLTreePtr tree,
20151   const void * data) ;
20152 extern OSErr
20153 AVLRemove(
20154   AVLTreePtr tree,
20155   const void * key,
20156   void * dataPtr,
20157   UInt32 * itemSize) ;
20158 extern OSErr
20159 AVLFind(
20160   AVLTreePtr tree,
20161   const void * key,
20162   void * dataPtr,
20163   UInt32 * itemSize) ;
20164 extern OSErr
20165 AVLGetRefcon(
20166   AVLTreePtr tree,
20167   void ** refCon) ;
20168
20169
20170
20171
20172
20173 }
20174
20175
20176
20177 struct PEFContainerHeader {
20178   OSType tag1;
20179   OSType tag2;
20180   OSType architecture;
20181   UInt32 formatVersion;
20182   UInt32 dateTimeStamp;
20183   UInt32 oldDefVersion;
20184   UInt32 oldImpVersion;
20185   UInt32 currentVersion;
20186   UInt16 sectionCount;
20187   UInt16 instSectionCount;
20188   UInt32 reservedA;
20189 };
20190 typedef struct PEFContainerHeader PEFContainerHeader;
20191 enum {
20192   kPEFTag1 = 'Joy!',
20193   kPEFTag2 = 'peff',
20194   kPEFVersion = 0x00000001
20195 };
20196
20197
20198 enum {
20199   kPEFFirstSectionHeaderOffset = sizeof(PEFContainerHeader)
20200 };
20201 struct PEFSectionHeader {
20202   SInt32 nameOffset;
20203   UInt32 defaultAddress;
20204   UInt32 totalLength;
20205   UInt32 unpackedLength;
20206   UInt32 containerLength;
20207   UInt32 containerOffset;
20208   UInt8 sectionKind;
20209   UInt8 shareKind;
20210   UInt8 alignment;
20211   UInt8 reservedA;
20212 };
20213 typedef struct PEFSectionHeader PEFSectionHeader;
20214 enum {
20215
20216
20217   kPEFCodeSection = 0,
20218   kPEFUnpackedDataSection = 1,
20219   kPEFPackedDataSection = 2,
20220   kPEFConstantSection = 3,
20221   kPEFExecDataSection = 6,
20222
20223   kPEFLoaderSection = 4,
20224   kPEFDebugSection = 5,
20225   kPEFExceptionSection = 7,
20226   kPEFTracebackSection = 8
20227 };
20228
20229
20230 enum {
20231
20232   kPEFProcessShare = 1,
20233   kPEFGlobalShare = 4,
20234   kPEFProtectedShare = 5
20235 };
20236 enum {
20237
20238   kPEFPkDataZero = 0,
20239   kPEFPkDataBlock = 1,
20240   kPEFPkDataRepeat = 2,
20241   kPEFPkDataRepeatBlock = 3,
20242   kPEFPkDataRepeatZero = 4
20243 };
20244
20245
20246 enum {
20247   kPEFPkDataOpcodeShift = 5,
20248   kPEFPkDataCount5Mask = 0x1F,
20249   kPEFPkDataMaxCount5 = 31,
20250   kPEFPkDataVCountShift = 7,
20251   kPEFPkDataVCountMask = 0x7F,
20252   kPEFPkDataVCountEndMask = 0x80
20253 };
20254 struct PEFLoaderInfoHeader {
20255   SInt32 mainSection;
20256   UInt32 mainOffset;
20257   SInt32 initSection;
20258   UInt32 initOffset;
20259   SInt32 termSection;
20260   UInt32 termOffset;
20261   UInt32 importedLibraryCount;
20262   UInt32 totalImportedSymbolCount;
20263   UInt32 relocSectionCount;
20264   UInt32 relocInstrOffset;
20265   UInt32 loaderStringsOffset;
20266   UInt32 exportHashOffset;
20267   UInt32 exportHashTablePower;
20268   UInt32 exportedSymbolCount;
20269 };
20270 typedef struct PEFLoaderInfoHeader PEFLoaderInfoHeader;
20271
20272
20273
20274
20275
20276
20277
20278 struct PEFImportedLibrary {
20279   UInt32 nameOffset;
20280   UInt32 oldImpVersion;
20281   UInt32 currentVersion;
20282   UInt32 importedSymbolCount;
20283   UInt32 firstImportedSymbol;
20284   UInt8 options;
20285   UInt8 reservedA;
20286   UInt16 reservedB;
20287 };
20288 typedef struct PEFImportedLibrary PEFImportedLibrary;
20289 enum {
20290
20291   kPEFWeakImportLibMask = 0x40,
20292   kPEFInitLibBeforeMask = 0x80
20293 };
20294 struct PEFImportedSymbol {
20295   UInt32 classAndName;
20296 };
20297 typedef struct PEFImportedSymbol PEFImportedSymbol;
20298 enum {
20299   kPEFImpSymClassShift = 24,
20300   kPEFImpSymNameOffsetMask = 0x00FFFFFF,
20301   kPEFImpSymMaxNameOffset = 0x00FFFFFF
20302 };
20303
20304
20305
20306
20307
20308
20309
20310 enum {
20311
20312   kPEFCodeSymbol = 0x00,
20313   kPEFDataSymbol = 0x01,
20314   kPEFTVectorSymbol = 0x02,
20315   kPEFTOCSymbol = 0x03,
20316   kPEFGlueSymbol = 0x04,
20317   kPEFUndefinedSymbol = 0x0F,
20318   kPEFWeakImportSymMask = 0x80
20319 };
20320 struct PEFExportedSymbolHashSlot {
20321   UInt32 countAndStart;
20322 };
20323 typedef struct PEFExportedSymbolHashSlot PEFExportedSymbolHashSlot;
20324 enum {
20325   kPEFHashSlotSymCountShift = 18,
20326   kPEFHashSlotFirstKeyMask = 0x0003FFFF,
20327   kPEFHashSlotMaxSymbolCount = 0x00003FFF,
20328   kPEFHashSlotMaxKeyIndex = 0x0003FFFF
20329 };
20330 struct PEFSplitHashWord {
20331   UInt16 nameLength;
20332   UInt16 hashValue;
20333 };
20334 typedef struct PEFSplitHashWord PEFSplitHashWord;
20335 struct PEFExportedSymbolKey {
20336   union {
20337     UInt32 fullHashWord;
20338     PEFSplitHashWord splitHashWord;
20339   } u;
20340 };
20341 typedef struct PEFExportedSymbolKey PEFExportedSymbolKey;
20342 enum {
20343   kPEFHashLengthShift = 16,
20344   kPEFHashValueMask = 0x0000FFFF,
20345   kPEFHashMaxLength = 0x0000FFFF
20346 };
20347 struct PEFExportedSymbol {
20348   UInt32 classAndName;
20349   UInt32 symbolValue;
20350   SInt16 sectionIndex;
20351 };
20352 typedef struct PEFExportedSymbol PEFExportedSymbol;
20353 enum {
20354   kPEFExpSymClassShift = 24,
20355   kPEFExpSymNameOffsetMask = 0x00FFFFFF,
20356   kPEFExpSymMaxNameOffset = 0x00FFFFFF
20357 };
20358
20359
20360
20361
20362
20363
20364
20365 enum {
20366
20367   kPEFAbsoluteExport = -2,
20368   kPEFReexportedImport = -3
20369 };
20370 typedef UInt16 PEFRelocChunk;
20371 struct PEFLoaderRelocationHeader {
20372   UInt16 sectionIndex;
20373   UInt16 reservedA;
20374   UInt32 relocCount;
20375   UInt32 firstRelocOffset;
20376 };
20377 typedef struct PEFLoaderRelocationHeader PEFLoaderRelocationHeader;
20378 enum {
20379   kPEFRelocBasicOpcodeRange = 128
20380 };
20381 enum {
20382   kPEFRelocBySectDWithSkip = 0x00,
20383   kPEFRelocBySectC = 0x20,
20384   kPEFRelocBySectD = 0x21,
20385   kPEFRelocTVector12 = 0x22,
20386   kPEFRelocTVector8 = 0x23,
20387   kPEFRelocVTable8 = 0x24,
20388   kPEFRelocImportRun = 0x25,
20389   kPEFRelocSmByImport = 0x30,
20390   kPEFRelocSmSetSectC = 0x31,
20391   kPEFRelocSmSetSectD = 0x32,
20392   kPEFRelocSmBySection = 0x33,
20393   kPEFRelocIncrPosition = 0x40,
20394   kPEFRelocSmRepeat = 0x48,
20395   kPEFRelocSetPosition = 0x50,
20396   kPEFRelocLgByImport = 0x52,
20397   kPEFRelocLgRepeat = 0x58,
20398   kPEFRelocLgSetOrBySection = 0x5A,
20399   kPEFRelocUndefinedOpcode = 0xFF
20400 };
20401 enum {
20402   kPEFRelocLgBySectionSubopcode = 0x00,
20403   kPEFRelocLgSetSectCSubopcode = 0x01,
20404   kPEFRelocLgSetSectDSubopcode = 0x02
20405 };
20406 enum {
20407   kPEFRelocWithSkipMaxSkipCount = 255,
20408   kPEFRelocWithSkipMaxRelocCount = 63
20409 };
20410 enum {
20411   kPEFRelocRunMaxRunLength = 512
20412 };
20413 enum {
20414   kPEFRelocSmIndexMaxIndex = 511
20415 };
20416 enum {
20417   kPEFRelocIncrPositionMaxOffset = 4096
20418 };
20419 enum {
20420   kPEFRelocSmRepeatMaxChunkCount = 16,
20421   kPEFRelocSmRepeatMaxRepeatCount = 256
20422 };
20423 enum {
20424   kPEFRelocSetPosMaxOffset = 0x03FFFFFF
20425 };
20426 enum {
20427   kPEFRelocLgByImportMaxIndex = 0x03FFFFFF
20428 };
20429 enum {
20430   kPEFRelocLgRepeatMaxChunkCount = 16,
20431   kPEFRelocLgRepeatMaxRepeatCount = 0x003FFFFF
20432 };
20433 enum {
20434   kPEFRelocLgSetOrBySectionMaxIndex = 0x003FFFFF
20435 };
20436 struct XLibContainerHeader {
20437
20438
20439
20440   OSType tag1;
20441   OSType tag2;
20442   UInt32 currentFormat;
20443   UInt32 containerStringsOffset;
20444   UInt32 exportHashOffset;
20445   UInt32 exportKeyOffset;
20446   UInt32 exportSymbolOffset;
20447   UInt32 exportNamesOffset;
20448   UInt32 exportHashTablePower;
20449   UInt32 exportedSymbolCount;
20450
20451
20452
20453   UInt32 fragNameOffset;
20454   UInt32 fragNameLength;
20455   UInt32 dylibPathOffset;
20456   UInt32 dylibPathLength;
20457   OSType cpuFamily;
20458   OSType cpuModel;
20459   UInt32 dateTimeStamp;
20460   UInt32 currentVersion;
20461   UInt32 oldDefVersion;
20462   UInt32 oldImpVersion;
20463
20464 };
20465 typedef struct XLibContainerHeader XLibContainerHeader;
20466 enum {
20467   kXLibTag1 = 'ðMac',
20468   kVLibTag2 = 'VLib',
20469   kBLibTag2 = 'BLib',
20470   kXLibVersion = 0x00000001
20471 };
20472
20473
20474
20475 typedef PEFExportedSymbolHashSlot XLibExportedSymbolHashSlot;
20476 typedef PEFExportedSymbolKey XLibExportedSymbolKey;
20477 struct XLibExportedSymbol {
20478   UInt32 classAndName;
20479   UInt32 bpOffset;
20480 };
20481 typedef struct XLibExportedSymbol XLibExportedSymbol;
20482
20483
20484
20485
20486
20487 enum {
20488   kHFSSigWord = 0x4244,
20489   kHFSPlusSigWord = 0x482B,
20490   kHFSPlusVersion = 0x0004,
20491   kHFSPlusMountVersion = '8.10'
20492 };
20493
20494
20495
20496 typedef UInt32 HFSCatalogNodeID;
20497 enum {
20498   kHFSMaxVolumeNameChars = 27,
20499   kHFSMaxFileNameChars = 31,
20500   kHFSPlusMaxFileNameChars = 255
20501 };
20502
20503
20504
20505
20506 struct HFSExtentKey {
20507   UInt8 keyLength;
20508   UInt8 forkType;
20509   HFSCatalogNodeID fileID;
20510   UInt16 startBlock;
20511 };
20512 typedef struct HFSExtentKey HFSExtentKey;
20513
20514 struct HFSPlusExtentKey {
20515   UInt16 keyLength;
20516   UInt8 forkType;
20517   UInt8 pad;
20518   HFSCatalogNodeID fileID;
20519   UInt32 startBlock;
20520 };
20521 typedef struct HFSPlusExtentKey HFSPlusExtentKey;
20522
20523 enum {
20524   kHFSExtentDensity = 3,
20525   kHFSPlusExtentDensity = 8
20526 };
20527
20528
20529 struct HFSExtentDescriptor {
20530   UInt16 startBlock;
20531   UInt16 blockCount;
20532 };
20533 typedef struct HFSExtentDescriptor HFSExtentDescriptor;
20534
20535 struct HFSPlusExtentDescriptor {
20536   UInt32 startBlock;
20537   UInt32 blockCount;
20538 };
20539 typedef struct HFSPlusExtentDescriptor HFSPlusExtentDescriptor;
20540
20541
20542 typedef HFSExtentDescriptor HFSExtentRecord[3];
20543
20544 typedef HFSPlusExtentDescriptor HFSPlusExtentRecord[8];
20545
20546
20547 struct HFSPlusForkData {
20548   UInt64 logicalSize;
20549   UInt32 clumpSize;
20550   UInt32 totalBlocks;
20551   HFSPlusExtentRecord extents;
20552 };
20553 typedef struct HFSPlusForkData HFSPlusForkData;
20554
20555 struct HFSPlusPermissions {
20556   UInt32 ownerID;
20557   UInt32 groupID;
20558   UInt32 permissions;
20559   UInt32 specialDevice;
20560 };
20561 typedef struct HFSPlusPermissions HFSPlusPermissions;
20562
20563 enum {
20564   kHFSRootParentID = 1,
20565   kHFSRootFolderID = 2,
20566   kHFSExtentsFileID = 3,
20567   kHFSCatalogFileID = 4,
20568   kHFSBadBlockFileID = 5,
20569   kHFSAllocationFileID = 6,
20570   kHFSStartupFileID = 7,
20571   kHFSAttributesFileID = 8,
20572   kHFSBogusExtentFileID = 15,
20573   kHFSFirstUserCatalogNodeID = 16
20574 };
20575
20576
20577
20578 struct HFSCatalogKey {
20579   UInt8 keyLength;
20580   UInt8 reserved;
20581   HFSCatalogNodeID parentID;
20582   Str31 nodeName;
20583 };
20584 typedef struct HFSCatalogKey HFSCatalogKey;
20585
20586 struct HFSPlusCatalogKey {
20587   UInt16 keyLength;
20588   HFSCatalogNodeID parentID;
20589   HFSUniStr255 nodeName;
20590 };
20591 typedef struct HFSPlusCatalogKey HFSPlusCatalogKey;
20592
20593
20594 enum {
20595
20596   kHFSFolderRecord = 0x0100,
20597   kHFSFileRecord = 0x0200,
20598   kHFSFolderThreadRecord = 0x0300,
20599   kHFSFileThreadRecord = 0x0400,
20600
20601   kHFSPlusFolderRecord = 1,
20602   kHFSPlusFileRecord = 2,
20603   kHFSPlusFolderThreadRecord = 3,
20604   kHFSPlusFileThreadRecord = 4
20605 };
20606
20607
20608
20609 enum {
20610   kHFSFileLockedBit = 0x0000,
20611   kHFSFileLockedMask = 0x0001,
20612   kHFSThreadExistsBit = 0x0001,
20613   kHFSThreadExistsMask = 0x0002
20614 };
20615
20616
20617
20618 struct HFSCatalogFolder {
20619   SInt16 recordType;
20620   UInt16 flags;
20621   UInt16 valence;
20622   HFSCatalogNodeID folderID;
20623   UInt32 createDate;
20624   UInt32 modifyDate;
20625   UInt32 backupDate;
20626   DInfo userInfo;
20627   DXInfo finderInfo;
20628   UInt32 reserved[4];
20629 };
20630 typedef struct HFSCatalogFolder HFSCatalogFolder;
20631
20632 struct HFSPlusCatalogFolder {
20633   SInt16 recordType;
20634   UInt16 flags;
20635   UInt32 valence;
20636   HFSCatalogNodeID folderID;
20637   UInt32 createDate;
20638   UInt32 contentModDate;
20639   UInt32 attributeModDate;
20640   UInt32 accessDate;
20641   UInt32 backupDate;
20642   HFSPlusPermissions permissions;
20643   DInfo userInfo;
20644   DXInfo finderInfo;
20645   UInt32 textEncoding;
20646   UInt32 reserved;
20647 };
20648 typedef struct HFSPlusCatalogFolder HFSPlusCatalogFolder;
20649
20650 struct HFSCatalogFile {
20651   SInt16 recordType;
20652   UInt8 flags;
20653   SInt8 fileType;
20654   FInfo userInfo;
20655   HFSCatalogNodeID fileID;
20656   UInt16 dataStartBlock;
20657   SInt32 dataLogicalSize;
20658   SInt32 dataPhysicalSize;
20659   UInt16 rsrcStartBlock;
20660   SInt32 rsrcLogicalSize;
20661   SInt32 rsrcPhysicalSize;
20662   UInt32 createDate;
20663   UInt32 modifyDate;
20664   UInt32 backupDate;
20665   FXInfo finderInfo;
20666   UInt16 clumpSize;
20667   HFSExtentRecord dataExtents;
20668   HFSExtentRecord rsrcExtents;
20669   UInt32 reserved;
20670 };
20671 typedef struct HFSCatalogFile HFSCatalogFile;
20672
20673 struct HFSPlusCatalogFile {
20674   SInt16 recordType;
20675   UInt16 flags;
20676   UInt32 reserved1;
20677   HFSCatalogNodeID fileID;
20678   UInt32 createDate;
20679   UInt32 contentModDate;
20680   UInt32 attributeModDate;
20681   UInt32 accessDate;
20682   UInt32 backupDate;
20683   HFSPlusPermissions permissions;
20684   FInfo userInfo;
20685   FXInfo finderInfo;
20686   UInt32 textEncoding;
20687   UInt32 reserved2;
20688
20689
20690   HFSPlusForkData dataFork;
20691   HFSPlusForkData resourceFork;
20692 };
20693 typedef struct HFSPlusCatalogFile HFSPlusCatalogFile;
20694
20695 struct HFSCatalogThread {
20696   SInt16 recordType;
20697   SInt32 reserved[2];
20698   HFSCatalogNodeID parentID;
20699   Str31 nodeName;
20700 };
20701 typedef struct HFSCatalogThread HFSCatalogThread;
20702
20703 struct HFSPlusCatalogThread {
20704   SInt16 recordType;
20705   SInt16 reserved;
20706   HFSCatalogNodeID parentID;
20707   HFSUniStr255 nodeName;
20708 };
20709 typedef struct HFSPlusCatalogThread HFSPlusCatalogThread;
20710
20711
20712
20713
20714
20715 enum {
20716   kHFSPlusAttrInlineData = 0x10,
20717   kHFSPlusAttrForkData = 0x20,
20718   kHFSPlusAttrExtents = 0x30
20719 };
20720 struct HFSPlusAttrInlineData {
20721   UInt32 recordType;
20722   UInt32 reserved;
20723   UInt32 logicalSize;
20724   UInt8 userData[2];
20725 };
20726 typedef struct HFSPlusAttrInlineData HFSPlusAttrInlineData;
20727
20728
20729
20730
20731
20732
20733 struct HFSPlusAttrForkData {
20734   UInt32 recordType;
20735   UInt32 reserved;
20736   HFSPlusForkData theFork;
20737 };
20738 typedef struct HFSPlusAttrForkData HFSPlusAttrForkData;
20739
20740
20741
20742
20743
20744 struct HFSPlusAttrExtents {
20745   UInt32 recordType;
20746   UInt32 reserved;
20747   HFSPlusExtentRecord extents;
20748 };
20749 typedef struct HFSPlusAttrExtents HFSPlusAttrExtents;
20750
20751 union HFSPlusAttrRecord {
20752   UInt32 recordType;
20753   HFSPlusAttrInlineData inlineData;
20754   HFSPlusAttrForkData forkData;
20755   HFSPlusAttrExtents overflowExtents;
20756 };
20757 typedef union HFSPlusAttrRecord HFSPlusAttrRecord;
20758
20759 enum {
20760   kHFSPlusExtentKeyMaximumLength = sizeof(HFSPlusExtentKey) - sizeof(UInt16),
20761   kHFSExtentKeyMaximumLength = sizeof(HFSExtentKey) - sizeof(UInt8),
20762   kHFSPlusCatalogKeyMaximumLength = sizeof(HFSPlusCatalogKey) - sizeof(UInt16),
20763   kHFSPlusCatalogKeyMinimumLength = kHFSPlusCatalogKeyMaximumLength - sizeof(HFSUniStr255) + sizeof(UInt16),
20764   kHFSCatalogKeyMaximumLength = sizeof(HFSCatalogKey) - sizeof(UInt8),
20765   kHFSCatalogKeyMinimumLength = kHFSCatalogKeyMaximumLength - sizeof(Str31) + sizeof(UInt8),
20766   kHFSPlusCatalogMinNodeSize = 4096,
20767   kHFSPlusExtentMinNodeSize = 512,
20768   kHFSPlusAttrMinNodeSize = 4096
20769 };
20770
20771
20772
20773 enum {
20774
20775   kHFSVolumeHardwareLockBit = 7,
20776   kHFSVolumeUnmountedBit = 8,
20777   kHFSVolumeSparedBlocksBit = 9,
20778   kHFSVolumeNoCacheRequiredBit = 10,
20779   kHFSBootVolumeInconsistentBit = 11,
20780
20781   kHFSVolumeSoftwareLockBit = 15,
20782   kHFSVolumeHardwareLockMask = 1 << kHFSVolumeHardwareLockBit,
20783   kHFSVolumeUnmountedMask = 1 << kHFSVolumeUnmountedBit,
20784   kHFSVolumeSparedBlocksMask = 1 << kHFSVolumeSparedBlocksBit,
20785   kHFSVolumeNoCacheRequiredMask = 1 << kHFSVolumeNoCacheRequiredBit,
20786   kHFSBootVolumeInconsistentMask = 1 << kHFSBootVolumeInconsistentBit,
20787   kHFSVolumeSoftwareLockMask = 1 << kHFSVolumeSoftwareLockBit,
20788   kHFSMDBAttributesMask = 0x8380
20789 };
20790
20791 enum {
20792   kHFSCatalogNodeIDsReusedBit = 12,
20793   kHFSCatalogNodeIDsReusedMask = 1 << kHFSCatalogNodeIDsReusedBit
20794 };
20795
20796
20797
20798 struct HFSMasterDirectoryBlock {
20799
20800
20801
20802   UInt16 drSigWord;
20803   UInt32 drCrDate;
20804   UInt32 drLsMod;
20805   UInt16 drAtrb;
20806   UInt16 drNmFls;
20807   UInt16 drVBMSt;
20808   UInt16 drAllocPtr;
20809   UInt16 drNmAlBlks;
20810   UInt32 drAlBlkSiz;
20811   UInt32 drClpSiz;
20812   UInt16 drAlBlSt;
20813   UInt32 drNxtCNID;
20814   UInt16 drFreeBks;
20815   Str27 drVN;
20816
20817
20818
20819   UInt32 drVolBkUp;
20820   UInt16 drVSeqNum;
20821   UInt32 drWrCnt;
20822   UInt32 drXTClpSiz;
20823   UInt32 drCTClpSiz;
20824   UInt16 drNmRtDirs;
20825   UInt32 drFilCnt;
20826   UInt32 drDirCnt;
20827   SInt32 drFndrInfo[8];
20828   UInt16 drEmbedSigWord;
20829   HFSExtentDescriptor drEmbedExtent;
20830   UInt32 drXTFlSize;
20831   HFSExtentRecord drXTExtRec;
20832   UInt32 drCTFlSize;
20833   HFSExtentRecord drCTExtRec;
20834 };
20835 typedef struct HFSMasterDirectoryBlock HFSMasterDirectoryBlock;
20836
20837
20838 struct HFSPlusVolumeHeader {
20839   UInt16 signature;
20840   UInt16 version;
20841   UInt32 attributes;
20842   UInt32 lastMountedVersion;
20843   UInt32 reserved;
20844
20845   UInt32 createDate;
20846   UInt32 modifyDate;
20847   UInt32 backupDate;
20848   UInt32 checkedDate;
20849
20850   UInt32 fileCount;
20851   UInt32 folderCount;
20852
20853   UInt32 blockSize;
20854   UInt32 totalBlocks;
20855   UInt32 freeBlocks;
20856
20857   UInt32 nextAllocation;
20858   UInt32 rsrcClumpSize;
20859   UInt32 dataClumpSize;
20860   HFSCatalogNodeID nextCatalogID;
20861
20862   UInt32 writeCount;
20863   UInt64 encodingsBitmap;
20864
20865   UInt8 finderInfo[32];
20866
20867   HFSPlusForkData allocationFile;
20868   HFSPlusForkData extentsFile;
20869   HFSPlusForkData catalogFile;
20870   HFSPlusForkData attributesFile;
20871   HFSPlusForkData startupFile;
20872 };
20873 typedef struct HFSPlusVolumeHeader HFSPlusVolumeHeader;
20874
20875
20876 struct BTNodeDescriptor {
20877   UInt32 fLink;
20878   UInt32 bLink;
20879   SInt8 kind;
20880   UInt8 height;
20881   UInt16 numRecords;
20882   UInt16 reserved;
20883 };
20884 typedef struct BTNodeDescriptor BTNodeDescriptor;
20885
20886 enum {
20887   kBTLeafNode = -1,
20888   kBTIndexNode = 0,
20889   kBTHeaderNode = 1,
20890   kBTMapNode = 2
20891 };
20892
20893
20894 struct BTHeaderRec {
20895   UInt16 treeDepth;
20896   UInt32 rootNode;
20897   UInt32 leafRecords;
20898   UInt32 firstLeafNode;
20899   UInt32 lastLeafNode;
20900   UInt16 nodeSize;
20901   UInt16 maxKeyLength;
20902   UInt32 totalNodes;
20903   UInt32 freeNodes;
20904   UInt16 reserved1;
20905   UInt32 clumpSize;
20906   UInt8 btreeType;
20907   UInt8 reserved2;
20908   UInt32 attributes;
20909   UInt32 reserved3[16];
20910 };
20911 typedef struct BTHeaderRec BTHeaderRec;
20912
20913 enum {
20914   kBTBadCloseMask = 0x00000001,
20915   kBTBigKeysMask = 0x00000002,
20916   kBTVariableIndexKeysMask = 0x00000004
20917 };
20918
20919
20920
20921
20922
20923
20924 enum {
20925   AIFFID = 'AIFF',
20926   AIFCID = 'AIFC',
20927   FormatVersionID = 'FVER',
20928   CommonID = 'COMM',
20929   FORMID = 'FORM',
20930   SoundDataID = 'SSND',
20931   MarkerID = 'MARK',
20932   InstrumentID = 'INST',
20933   MIDIDataID = 'MIDI',
20934   AudioRecordingID = 'AESD',
20935   ApplicationSpecificID = 'APPL',
20936   CommentID = 'COMT',
20937   NameID = 'NAME',
20938   AuthorID = 'AUTH',
20939   CopyrightID = '(c) ',
20940   AnnotationID = 'ANNO'
20941 };
20942
20943 enum {
20944   NoLooping = 0,
20945   ForwardLooping = 1,
20946   ForwardBackwardLooping = 2
20947 };
20948
20949 enum {
20950
20951   AIFCVersion1 = (long)0xA2805140
20952 };
20953
20954
20955
20956
20957
20958
20959
20960 enum {
20961
20962   NoneType = 'NONE',
20963   ACE2Type = 'ACE2',
20964   ACE8Type = 'ACE8',
20965   MACE3Type = 'MAC3',
20966   MACE6Type = 'MAC6'
20967 };
20968
20969 typedef unsigned long ID;
20970 typedef short MarkerIdType;
20971 struct ChunkHeader {
20972   ID ckID;
20973   long ckSize;
20974 };
20975 typedef struct ChunkHeader ChunkHeader;
20976 struct ContainerChunk {
20977   ID ckID;
20978   long ckSize;
20979   ID formType;
20980 };
20981 typedef struct ContainerChunk ContainerChunk;
20982 struct FormatVersionChunk {
20983   ID ckID;
20984   long ckSize;
20985   unsigned long timestamp;
20986 };
20987 typedef struct FormatVersionChunk FormatVersionChunk;
20988 typedef FormatVersionChunk * FormatVersionChunkPtr;
20989 struct CommonChunk {
20990   ID ckID;
20991   long ckSize;
20992   short numChannels;
20993   unsigned long numSampleFrames;
20994   short sampleSize;
20995   extended80 sampleRate;
20996 };
20997 typedef struct CommonChunk CommonChunk;
20998 typedef CommonChunk * CommonChunkPtr;
20999 struct ExtCommonChunk {
21000   ID ckID;
21001   long ckSize;
21002   short numChannels;
21003   unsigned long numSampleFrames;
21004   short sampleSize;
21005   extended80 sampleRate;
21006   ID compressionType;
21007   char compressionName[1];
21008 };
21009 typedef struct ExtCommonChunk ExtCommonChunk;
21010 typedef ExtCommonChunk * ExtCommonChunkPtr;
21011 struct SoundDataChunk {
21012   ID ckID;
21013   long ckSize;
21014   unsigned long offset;
21015   unsigned long blockSize;
21016 };
21017 typedef struct SoundDataChunk SoundDataChunk;
21018 typedef SoundDataChunk * SoundDataChunkPtr;
21019 struct Marker {
21020   MarkerIdType id;
21021   unsigned long position;
21022   Str255 markerName;
21023 };
21024 typedef struct Marker Marker;
21025 struct MarkerChunk {
21026   ID ckID;
21027   long ckSize;
21028   unsigned short numMarkers;
21029   Marker Markers[1];
21030 };
21031 typedef struct MarkerChunk MarkerChunk;
21032 typedef MarkerChunk * MarkerChunkPtr;
21033 struct AIFFLoop {
21034   short playMode;
21035   MarkerIdType beginLoop;
21036   MarkerIdType endLoop;
21037 };
21038 typedef struct AIFFLoop AIFFLoop;
21039 struct InstrumentChunk {
21040   ID ckID;
21041   long ckSize;
21042   UInt8 baseFrequency;
21043   UInt8 detune;
21044   UInt8 lowFrequency;
21045   UInt8 highFrequency;
21046   UInt8 lowVelocity;
21047   UInt8 highVelocity;
21048   short gain;
21049   AIFFLoop sustainLoop;
21050   AIFFLoop releaseLoop;
21051 };
21052 typedef struct InstrumentChunk InstrumentChunk;
21053 typedef InstrumentChunk * InstrumentChunkPtr;
21054 struct MIDIDataChunk {
21055   ID ckID;
21056   long ckSize;
21057   UInt8 MIDIdata[1];
21058 };
21059 typedef struct MIDIDataChunk MIDIDataChunk;
21060 typedef MIDIDataChunk * MIDIDataChunkPtr;
21061 struct AudioRecordingChunk {
21062   ID ckID;
21063   long ckSize;
21064   UInt8 AESChannelStatus[24];
21065 };
21066 typedef struct AudioRecordingChunk AudioRecordingChunk;
21067 typedef AudioRecordingChunk * AudioRecordingChunkPtr;
21068 struct ApplicationSpecificChunk {
21069   ID ckID;
21070   long ckSize;
21071   OSType applicationSignature;
21072   UInt8 data[1];
21073 };
21074 typedef struct ApplicationSpecificChunk ApplicationSpecificChunk;
21075 typedef ApplicationSpecificChunk * ApplicationSpecificChunkPtr;
21076 struct Comment {
21077   unsigned long timeStamp;
21078   MarkerIdType marker;
21079   unsigned short count;
21080   char text[1];
21081 };
21082 typedef struct Comment Comment;
21083 struct CommentsChunk {
21084   ID ckID;
21085   long ckSize;
21086   unsigned short numComments;
21087   Comment comments[1];
21088 };
21089 typedef struct CommentsChunk CommentsChunk;
21090 typedef CommentsChunk * CommentsChunkPtr;
21091 struct TextChunk {
21092   ID ckID;
21093   long ckSize;
21094   char text[1];
21095 };
21096 typedef struct TextChunk TextChunk;
21097 typedef TextChunk * TextChunkPtr;
21098
21099
21100
21101
21102 struct TECBufferContextRec {
21103   TextPtr textInputBuffer;
21104   TextPtr textInputBufferEnd;
21105   TextPtr textOutputBuffer;
21106   TextPtr textOutputBufferEnd;
21107
21108   TextEncodingRunPtr encodingInputBuffer;
21109   TextEncodingRunPtr encodingInputBufferEnd;
21110   TextEncodingRunPtr encodingOutputBuffer;
21111   TextEncodingRunPtr encodingOutputBufferEnd;
21112 };
21113 typedef struct TECBufferContextRec TECBufferContextRec;
21114 struct TECPluginStateRec {
21115
21116   UInt8 state1;
21117   UInt8 state2;
21118   UInt8 state3;
21119   UInt8 state4;
21120
21121   UInt32 longState1;
21122   UInt32 longState2;
21123   UInt32 longState3;
21124   UInt32 longState4;
21125 };
21126 typedef struct TECPluginStateRec TECPluginStateRec;
21127 struct TECConverterContextRec {
21128
21129
21130   Ptr pluginRec;
21131   TextEncoding sourceEncoding;
21132   TextEncoding destEncoding;
21133   UInt32 reserved1;
21134   UInt32 reserved2;
21135   TECBufferContextRec bufferContext;
21136
21137   UInt32 contextRefCon;
21138   ProcPtr conversionProc;
21139   ProcPtr flushProc;
21140   ProcPtr clearContextInfoProc;
21141   UInt32 options1;
21142   UInt32 options2;
21143   TECPluginStateRec pluginState;
21144 };
21145 typedef struct TECConverterContextRec TECConverterContextRec;
21146 struct TECSnifferContextRec {
21147
21148   Ptr pluginRec;
21149   TextEncoding encoding;
21150   ItemCount maxErrors;
21151   ItemCount maxFeatures;
21152   TextPtr textInputBuffer;
21153   TextPtr textInputBufferEnd;
21154   ItemCount numFeatures;
21155   ItemCount numErrors;
21156
21157   UInt32 contextRefCon;
21158   ProcPtr sniffProc;
21159   ProcPtr clearContextInfoProc;
21160   TECPluginStateRec pluginState;
21161 };
21162 typedef struct TECSnifferContextRec TECSnifferContextRec;
21163
21164
21165
21166
21167
21168
21169 typedef OSStatus ( * TECPluginNewEncodingConverterPtr)(TECObjectRef *newEncodingConverter, TECConverterContextRec *plugContext, TextEncoding inputEncoding, TextEncoding outputEncoding);
21170 typedef OSStatus ( * TECPluginClearContextInfoPtr)(TECObjectRef encodingConverter, TECConverterContextRec *plugContext);
21171 typedef OSStatus ( * TECPluginConvertTextEncodingPtr)(TECObjectRef encodingConverter, TECConverterContextRec *plugContext);
21172 typedef OSStatus ( * TECPluginFlushConversionPtr)(TECObjectRef encodingConverter, TECConverterContextRec *plugContext);
21173 typedef OSStatus ( * TECPluginDisposeEncodingConverterPtr)(TECObjectRef newEncodingConverter, TECConverterContextRec *plugContext);
21174 typedef OSStatus ( * TECPluginNewEncodingSnifferPtr)(TECSnifferObjectRef *encodingSniffer, TECSnifferContextRec *snifContext, TextEncoding inputEncoding);
21175 typedef OSStatus ( * TECPluginClearSnifferContextInfoPtr)(TECSnifferObjectRef encodingSniffer, TECSnifferContextRec *snifContext);
21176 typedef OSStatus ( * TECPluginSniffTextEncodingPtr)(TECSnifferObjectRef encodingSniffer, TECSnifferContextRec *snifContext);
21177 typedef OSStatus ( * TECPluginDisposeEncodingSnifferPtr)(TECSnifferObjectRef encodingSniffer, TECSnifferContextRec *snifContext);
21178 typedef OSStatus ( * TECPluginGetCountAvailableTextEncodingsPtr)(TextEncoding *availableEncodings, ItemCount maxAvailableEncodings, ItemCount *actualAvailableEncodings);
21179 typedef OSStatus ( * TECPluginGetCountAvailableTextEncodingPairsPtr)(TECConversionInfo *availableEncodings, ItemCount maxAvailableEncodings, ItemCount *actualAvailableEncodings);
21180 typedef OSStatus ( * TECPluginGetCountDestinationTextEncodingsPtr)(TextEncoding inputEncoding, TextEncoding *destinationEncodings, ItemCount maxDestinationEncodings, ItemCount *actualDestinationEncodings);
21181 typedef OSStatus ( * TECPluginGetCountSubTextEncodingsPtr)(TextEncoding inputEncoding, TextEncoding subEncodings[], ItemCount maxSubEncodings, ItemCount *actualSubEncodings);
21182 typedef OSStatus ( * TECPluginGetCountAvailableSniffersPtr)(TextEncoding *availableEncodings, ItemCount maxAvailableEncodings, ItemCount *actualAvailableEncodings);
21183 typedef OSStatus ( * TECPluginGetTextEncodingInternetNamePtr)(TextEncoding textEncoding, Str255 encodingName);
21184 typedef OSStatus ( * TECPluginGetTextEncodingFromInternetNamePtr)(TextEncoding *textEncoding, ConstStr255Param encodingName);
21185 typedef OSStatus ( * TECPluginGetCountWebEncodingsPtr)(TextEncoding *availableEncodings, ItemCount maxAvailableEncodings, ItemCount *actualAvailableEncodings);
21186 typedef OSStatus ( * TECPluginGetCountMailEncodingsPtr)(TextEncoding *availableEncodings, ItemCount maxAvailableEncodings, ItemCount *actualAvailableEncodings);
21187
21188
21189
21190
21191
21192
21193 enum {
21194   kTECPluginDispatchTableVersion1 = 0x00010000,
21195   kTECPluginDispatchTableVersion1_1 = 0x00010001,
21196   kTECPluginDispatchTableVersion1_2 = 0x00010002,
21197   kTECPluginDispatchTableCurrentVersion = kTECPluginDispatchTableVersion1_2
21198 };
21199
21200 struct TECPluginDispatchTable {
21201
21202   TECPluginVersion version;
21203   TECPluginVersion compatibleVersion;
21204   TECPluginSignature PluginID;
21205
21206   TECPluginNewEncodingConverterPtr PluginNewEncodingConverter;
21207   TECPluginClearContextInfoPtr PluginClearContextInfo;
21208   TECPluginConvertTextEncodingPtr PluginConvertTextEncoding;
21209   TECPluginFlushConversionPtr PluginFlushConversion;
21210   TECPluginDisposeEncodingConverterPtr PluginDisposeEncodingConverter;
21211
21212   TECPluginNewEncodingSnifferPtr PluginNewEncodingSniffer;
21213   TECPluginClearSnifferContextInfoPtr PluginClearSnifferContextInfo;
21214   TECPluginSniffTextEncodingPtr PluginSniffTextEncoding;
21215   TECPluginDisposeEncodingSnifferPtr PluginDisposeEncodingSniffer;
21216
21217   TECPluginGetCountAvailableTextEncodingsPtr PluginGetCountAvailableTextEncodings;
21218   TECPluginGetCountAvailableTextEncodingPairsPtr PluginGetCountAvailableTextEncodingPairs;
21219   TECPluginGetCountDestinationTextEncodingsPtr PluginGetCountDestinationTextEncodings;
21220   TECPluginGetCountSubTextEncodingsPtr PluginGetCountSubTextEncodings;
21221   TECPluginGetCountAvailableSniffersPtr PluginGetCountAvailableSniffers;
21222   TECPluginGetCountWebEncodingsPtr PluginGetCountWebTextEncodings;
21223   TECPluginGetCountMailEncodingsPtr PluginGetCountMailTextEncodings;
21224
21225   TECPluginGetTextEncodingInternetNamePtr PluginGetTextEncodingInternetName;
21226   TECPluginGetTextEncodingFromInternetNamePtr PluginGetTextEncodingFromInternetName;
21227
21228 };
21229 typedef struct TECPluginDispatchTable TECPluginDispatchTable;
21230 typedef TECPluginDispatchTable * ( * TECPluginGetPluginDispatchTablePtr)(void);
21231
21232
21233
21234
21235
21236
21237
21238
21239
21240
21241
21242 enum {
21243   sbSIGWord = 0x4552,
21244   sbMac = 1
21245 };
21246
21247
21248 enum {
21249   pMapSIG = 0x504D,
21250   pdSigWord = 0x5453,
21251   oldPMSigWord = pdSigWord,
21252   newPMSigWord = pMapSIG
21253 };
21254
21255
21256
21257 struct Block0 {
21258   UInt16 sbSig;
21259   UInt16 sbBlkSize;
21260   UInt32 sbBlkCount;
21261   UInt16 sbDevType;
21262   UInt16 sbDevId;
21263   UInt32 sbData;
21264   UInt16 sbDrvrCount;
21265   UInt32 ddBlock;
21266   UInt16 ddSize;
21267   UInt16 ddType;
21268   UInt16 ddPad[243];
21269 };
21270 typedef struct Block0 Block0;
21271
21272 struct DDMap {
21273   UInt32 ddBlock;
21274   UInt16 ddSize;
21275   UInt16 ddType;
21276 };
21277 typedef struct DDMap DDMap;
21278
21279 enum {
21280   kDriverTypeMacSCSI = 0x0001,
21281   kDriverTypeMacATA = 0x0701,
21282   kDriverTypeMacSCSIChained = 0xFFFF,
21283   kDriverTypeMacATAChained = 0xF8FF
21284 };
21285
21286
21287 struct Partition {
21288   UInt16 pmSig;
21289   UInt16 pmSigPad;
21290   UInt32 pmMapBlkCnt;
21291   UInt32 pmPyPartStart;
21292   UInt32 pmPartBlkCnt;
21293   UInt8 pmPartName[32];
21294   UInt8 pmParType[32];
21295   UInt32 pmLgDataStart;
21296   UInt32 pmDataCnt;
21297   UInt32 pmPartStatus;
21298   UInt32 pmLgBootStart;
21299   UInt32 pmBootSize;
21300   UInt32 pmBootAddr;
21301   UInt32 pmBootAddr2;
21302   UInt32 pmBootEntry;
21303   UInt32 pmBootEntry2;
21304   UInt32 pmBootCksum;
21305   UInt8 pmProcessor[16];
21306   UInt16 pmPad[188];
21307 };
21308 typedef struct Partition Partition;
21309
21310
21311 enum {
21312   kPartitionAUXIsValid = 0x00000001,
21313   kPartitionAUXIsAllocated = 0x00000002,
21314   kPartitionAUXIsInUse = 0x00000004,
21315   kPartitionAUXIsBootValid = 0x00000008,
21316   kPartitionAUXIsReadable = 0x00000010,
21317   kPartitionAUXIsWriteable = 0x00000020,
21318   kPartitionAUXIsBootCodePositionIndependent = 0x00000040,
21319   kPartitionIsWriteable = 0x00000020,
21320   kPartitionIsMountedAtStartup = 0x40000000,
21321   kPartitionIsStartup = (long)0x80000000,
21322   kPartitionIsChainCompatible = 0x00000100,
21323   kPartitionIsRealDeviceDriver = 0x00000200,
21324   kPartitionCanChainToNext = 0x00000400
21325 };
21326
21327
21328
21329
21330
21331 enum {
21332   kPatchDriverSignature = 'ptDR',
21333   kSCSIDriverSignature = 0x00010600,
21334   kATADriverSignature = 'wiki',
21335   kSCSICDDriverSignature = 'CDvr',
21336   kATAPIDriverSignature = 'ATPI',
21337   kDriveSetupHFSSignature = 'DSU1'
21338 };
21339
21340
21341
21342
21343
21344
21345
21346 extern "C" {
21347
21348
21349
21350 enum {
21351
21352   modemOnBit = 0,
21353   ringWakeUpBit = 2,
21354   modemInstalledBit = 3,
21355   ringDetectBit = 4,
21356   modemOnHookBit = 5
21357 };
21358
21359 enum {
21360
21361   modemOnMask = 0x01,
21362   ringWakeUpMask = 0x04,
21363   modemInstalledMask = 0x08,
21364   ringDetectMask = 0x10,
21365   modemOnHookMask = 0x20
21366 };
21367
21368 enum {
21369
21370   chargerConnBit = 0,
21371   hiChargeBit = 1,
21372   chargeOverFlowBit = 2,
21373   batteryDeadBit = 3,
21374   batteryLowBit = 4,
21375   connChangedBit = 5
21376 };
21377
21378 enum {
21379
21380   chargerConnMask = 0x01,
21381   hiChargeMask = 0x02,
21382   chargeOverFlowMask = 0x04,
21383   batteryDeadMask = 0x08,
21384   batteryLowMask = 0x10,
21385   connChangedMask = 0x20
21386 };
21387
21388 enum {
21389
21390   MediaBaySndEnBit = 0,
21391   PCISndEnBit = 1,
21392   ZVSndEnBit = 2,
21393   PCCardSndEnBit = 3
21394 };
21395
21396 enum {
21397
21398   MediaBaySndEnMask = 0x01,
21399   PCISndEnMask = 0x02,
21400   ZVSndEnMask = 0x04,
21401   PCCardSndEnMask = 0x08
21402 };
21403
21404 enum {
21405
21406   kSleepRequest = 1,
21407   kSleepDemand = 2,
21408   kSleepWakeUp = 3,
21409   kSleepRevoke = 4,
21410   kSleepUnlock = 4,
21411   kSleepDeny = 5,
21412   kSleepNow = 6,
21413   kDozeDemand = 7,
21414   kDozeWakeUp = 8,
21415   kDozeRequest = 9,
21416   kEnterStandby = 10,
21417   kEnterRun = 11,
21418   kSuspendRequest = 12,
21419   kSuspendDemand = 13,
21420   kSuspendRevoke = 14,
21421   kSuspendWakeUp = 15,
21422   kGetPowerLevel = 16,
21423   kSetPowerLevel = 17,
21424   kDeviceInitiatedWake = 18,
21425   kWakeToDoze = 19,
21426   kDozeToFullWakeUp = 20,
21427   kGetPowerInfo = 21,
21428   kGetWakeOnNetInfo = 22,
21429   kSuspendWakeToDoze = 23,
21430   kEnterIdle = 24,
21431   kStillIdle = 25,
21432   kExitIdle = 26
21433 };
21434
21435 enum {
21436
21437   sleepRequest = kSleepRequest,
21438   sleepDemand = kSleepDemand,
21439   sleepWakeUp = kSleepWakeUp,
21440   sleepRevoke = kSleepRevoke,
21441   sleepUnlock = kSleepUnlock,
21442   sleepDeny = kSleepDeny,
21443   sleepNow = kSleepNow,
21444   dozeDemand = kDozeDemand,
21445   dozeWakeUp = kDozeWakeUp,
21446   dozeRequest = kDozeRequest,
21447   enterStandby = kEnterStandby,
21448   enterRun = kEnterRun,
21449   suspendRequestMsg = kSuspendRequest,
21450   suspendDemandMsg = kSuspendDemand,
21451   suspendRevokeMsg = kSuspendRevoke,
21452   suspendWakeUpMsg = kSuspendWakeUp,
21453   getPowerLevel = kGetPowerLevel,
21454   setPowerLevel = kSetPowerLevel
21455 };
21456
21457
21458 typedef UInt32 PowerLevel;
21459
21460 enum {
21461   kPMDevicePowerLevel_On = 0,
21462   kPMDevicePowerLevel_D1 = 1,
21463   kPMDevicePowerLevel_D2 = 2,
21464   kPMDevicePowerLevel_Off = 3
21465 };
21466
21467
21468 typedef OSStatus ( * PowerHandlerProcPtr)(UInt32 message, void *param, UInt32 refCon, RegEntryID *regEntryID);
21469 typedef PowerHandlerProcPtr PowerHandlerUPP;
21470 enum {
21471   kUseDefaultMinimumWakeTime = 0,
21472   kPowerSummaryVersion = 1,
21473   kDevicePowerInfoVersion = 1
21474 };
21475
21476 enum {
21477
21478   kPCIPowerOffAllowed = (1L << 0)
21479 };
21480
21481 enum {
21482
21483   kDevicePCIPowerOffAllowed = (1L << 0),
21484   kDeviceSupportsPMIS = (1L << 1),
21485   kDeviceCanAssertPMEDuringSleep = (1L << 2),
21486   kDeviceUsesCommonLogicPower = (1L << 3),
21487   kDeviceDriverPresent = (1L << 4),
21488   kDeviceDriverSupportsPowerMgt = (1L << 5)
21489 };
21490
21491 struct DevicePowerInfo {
21492   UInt32 version;
21493   RegEntryID regID;
21494   OptionBits flags;
21495   UInt32 minimumWakeTime;
21496   UInt32 sleepPowerNeeded;
21497 };
21498 typedef struct DevicePowerInfo DevicePowerInfo;
21499 struct PowerSummary {
21500   UInt32 version;
21501   OptionBits flags;
21502   UInt32 sleepPowerAvailable;
21503   UInt32 sleepPowerNeeded;
21504   UInt32 minimumWakeTime;
21505   ItemCount deviceCount;
21506   DevicePowerInfo devices[1];
21507 };
21508 typedef struct PowerSummary PowerSummary;
21509 enum {
21510
21511   noCalls = 1,
21512   noRequest = 2,
21513   slpQType = 16,
21514   sleepQType = 16
21515 };
21516
21517
21518 enum {
21519
21520   kAEMacPowerMgtEvt = 'pmgt',
21521   kAEMacToWake = 'wake',
21522   kAEMacLowPowerSaveData = 'pmsd',
21523   kAEMacEmergencySleep = 'emsl',
21524   kAEMacEmergencyShutdown = 'emsd'
21525 };
21526
21527
21528
21529
21530
21531
21532
21533 enum {
21534   kDeviceDidNotWakeMachine = 0,
21535   kDeviceRequestsFullWake = 1,
21536   kDeviceRequestsWakeToDoze = 2
21537 };
21538
21539
21540 enum {
21541   hasWakeupTimer = 0,
21542   hasSharedModemPort = 1,
21543   hasProcessorCycling = 2,
21544   mustProcessorCycle = 3,
21545   hasReducedSpeed = 4,
21546   dynamicSpeedChange = 5,
21547   hasSCSIDiskMode = 6,
21548   canGetBatteryTime = 7,
21549   canWakeupOnRing = 8,
21550   hasDimmingSupport = 9,
21551   hasStartupTimer = 10,
21552   hasChargeNotification = 11,
21553   hasDimSuspendSupport = 12,
21554   hasWakeOnNetActivity = 13,
21555   hasWakeOnLid = 14,
21556   canPowerOffPCIBus = 15,
21557   hasDeepSleep = 16,
21558   hasSleep = 17,
21559   supportsServerModeAPIs = 18,
21560   supportsUPSIntegration = 19,
21561   hasAggressiveIdling = 20,
21562   supportsIdleQueue = 21
21563 };
21564
21565
21566 enum {
21567   hasInternalModem = 0,
21568   intModemRingDetect = 1,
21569   intModemOffHook = 2,
21570   intModemRingWakeEnb = 3,
21571   extModemSelected = 4,
21572   modemSetBit = 15
21573 };
21574
21575
21576
21577 enum {
21578   batteryInstalled = 7,
21579   batteryCharging = 6,
21580   chargerConnected = 5,
21581   upsConnected = 4,
21582   upsIsPowerSource = 3
21583 };
21584
21585 enum {
21586   HDPwrQType = 0x4844,
21587   PMgrStateQType = 0x504D
21588 };
21589
21590
21591 enum {
21592   pmSleepTimeoutChanged = 0,
21593   pmSleepEnableChanged = 1,
21594   pmHardDiskTimeoutChanged = 2,
21595   pmHardDiskSpindownChanged = 3,
21596   pmDimmingTimeoutChanged = 4,
21597   pmDimmingEnableChanged = 5,
21598   pmDiskModeAddressChanged = 6,
21599   pmProcessorCyclingChanged = 7,
21600   pmProcessorSpeedChanged = 8,
21601   pmWakeupTimerChanged = 9,
21602   pmStartupTimerChanged = 10,
21603   pmHardDiskPowerRemovedbyUser = 11,
21604   pmChargeStatusChanged = 12,
21605   pmPowerLevelChanged = 13,
21606   pmWakeOnNetActivityChanged = 14
21607 };
21608
21609 enum {
21610   pmSleepTimeoutChangedMask = (1 << pmSleepTimeoutChanged),
21611   pmSleepEnableChangedMask = (1 << pmSleepEnableChanged),
21612   pmHardDiskTimeoutChangedMask = (1 << pmHardDiskTimeoutChanged),
21613   pmHardDiskSpindownChangedMask = (1 << pmHardDiskSpindownChanged),
21614   pmDimmingTimeoutChangedMask = (1 << pmDimmingTimeoutChanged),
21615   pmDimmingEnableChangedMask = (1 << pmDimmingEnableChanged),
21616   pmDiskModeAddressChangedMask = (1 << pmDiskModeAddressChanged),
21617   pmProcessorCyclingChangedMask = (1 << pmProcessorCyclingChanged),
21618   pmProcessorSpeedChangedMask = (1 << pmProcessorSpeedChanged),
21619   pmWakeupTimerChangedMask = (1 << pmWakeupTimerChanged),
21620   pmStartupTimerChangedMask = (1 << pmStartupTimerChanged),
21621   pmHardDiskPowerRemovedbyUserMask = (1 << pmHardDiskPowerRemovedbyUser),
21622   pmChargeStatusChangedMask = (1 << pmChargeStatusChanged),
21623   pmPowerLevelChangedMask = (1 << pmPowerLevelChanged),
21624   pmWakeOnNetActivityChangedMask = (1 << pmWakeOnNetActivityChanged)
21625 };
21626 enum {
21627   OverallAct = 0,
21628   UsrActivity = 1,
21629   NetActivity = 2,
21630   HDActivity = 3,
21631   IdleActivity = 4
21632 };
21633
21634
21635 enum {
21636   kMediaModeOn = 0,
21637   kMediaModeStandBy = 1,
21638   kMediaModeSuspend = 2,
21639   kMediaModeOff = 3
21640 };
21641
21642 enum {
21643   kMediaPowerCSCode = 70
21644 };
21645
21646
21647
21648 enum {
21649   kHDQueuePostBit = 0,
21650   kHDQueuePostMask = (1 << kHDQueuePostBit)
21651 };
21652
21653 struct ActivityInfo {
21654   short ActivityType;
21655   unsigned long ActivityTime;
21656 };
21657 typedef struct ActivityInfo ActivityInfo;
21658
21659 struct BatteryInfo {
21660   UInt8 flags;
21661   UInt8 warningLevel;
21662   UInt8 reserved;
21663   UInt8 batteryLevel;
21664 };
21665 typedef struct BatteryInfo BatteryInfo;
21666
21667 typedef SInt8 ModemByte;
21668 typedef SInt8 BatteryByte;
21669 typedef SInt8 SoundMixerByte;
21670 typedef long PMResultCode;
21671 typedef struct SleepQRec SleepQRec;
21672 typedef SleepQRec * SleepQRecPtr;
21673 typedef struct HDQueueElement HDQueueElement;
21674 typedef struct PMgrQueueElement PMgrQueueElement;
21675 typedef long ( * SleepQProcPtr)(long message, SleepQRecPtr qRecPtr);
21676 typedef void ( * HDSpindownProcPtr)(HDQueueElement * theElement);
21677 typedef void ( * PMgrStateChangeProcPtr)(PMgrQueueElement *theElement, long stateBits);
21678 typedef SleepQProcPtr SleepQUPP;
21679 typedef HDSpindownProcPtr HDSpindownUPP;
21680 typedef PMgrStateChangeProcPtr PMgrStateChangeUPP;
21681 struct SleepQRec {
21682   SleepQRecPtr sleepQLink;
21683   short sleepQType;
21684   SleepQUPP sleepQProc;
21685   short sleepQFlags;
21686 };
21687
21688 struct HDQueueElement {
21689   struct HDQueueElement * hdQLink;
21690   short hdQType;
21691   short hdFlags;
21692   HDSpindownUPP hdProc;
21693   long hdUser;
21694 };
21695
21696 struct PMgrQueueElement {
21697   struct PMgrQueueElement * pmQLink;
21698   short pmQType;
21699   short pmFlags;
21700   long pmNotifyBits;
21701   PMgrStateChangeUPP pmProc;
21702   long pmUser;
21703 };
21704
21705
21706 struct BatteryTimeRec {
21707   unsigned long expectedBatteryTime;
21708   unsigned long minimumBatteryTime;
21709   unsigned long maximumBatteryTime;
21710   unsigned long timeUntilCharged;
21711 };
21712 typedef struct BatteryTimeRec BatteryTimeRec;
21713
21714 struct WakeupTime {
21715   unsigned long wakeTime;
21716   Boolean wakeEnabled;
21717   SInt8 filler;
21718 };
21719 typedef struct WakeupTime WakeupTime;
21720
21721 struct StartupTime {
21722   unsigned long startTime;
21723   Boolean startEnabled;
21724   SInt8 filler;
21725 };
21726 typedef struct StartupTime StartupTime;
21727
21728 enum {
21729   kVersionOnePowerSource = 1,
21730   kVersionTwoPowerSource = 2,
21731   kCurrentPowerSourceVersion = kVersionTwoPowerSource
21732 };
21733
21734
21735
21736 enum {
21737   bSourceIsBattery = 0,
21738   bSourceIsAC = 1,
21739   bSourceCanBeCharged = 2,
21740   bSourceIsUPS = 3,
21741   bSourceProvidesWarnLevels = 4,
21742   kSourceIsBatteryMask = (1 << bSourceIsBattery),
21743   kSourceIsACMask = (1 << bSourceIsAC),
21744   kSourceCanBeChargedMask = (1 << bSourceCanBeCharged),
21745   kSourceIsUPSMask = (1 << bSourceIsUPS),
21746   kSourceProvidesWarnLevelsMask = (1 << bSourceProvidesWarnLevels)
21747 };
21748
21749
21750
21751 enum {
21752   bSourceIsAvailable = 0,
21753   bSourceIsCharging = 1,
21754   bChargerIsAttached = 2,
21755   kSourceIsAvailableMask = (1 << bSourceIsAvailable),
21756   kSourceIsChargingMask = (1 << bSourceIsCharging),
21757   kChargerIsAttachedMask = (1 << bChargerIsAttached)
21758 };
21759
21760
21761
21762 enum {
21763   kCapacityIsActual = 0,
21764   kCapacityIsPercentOfMax = 1
21765 };
21766
21767
21768 enum {
21769   kConfigSupportsWakeOnNetBit = 0,
21770   kWakeOnNetAdminAccessesBit = 1,
21771   kWakeOnAllNetAccessesBit = 2,
21772   kUnmountServersBeforeSleepingBit = 3,
21773   kConfigSupportsWakeOnNetMask = (1 << kConfigSupportsWakeOnNetBit),
21774   kWakeOnNetAdminAccessesMask = (1 << kWakeOnNetAdminAccessesBit),
21775   kWakeOnAllNetAccessesMask = (1 << kWakeOnAllNetAccessesBit),
21776   kUnmountServersBeforeSleepingMask = (1 << kUnmountServersBeforeSleepingBit)
21777 };
21778
21779
21780 enum {
21781   kCurrentCapacityIsActualValue = 0,
21782   kCurrentCapacityIsPercentOfMax = 1
21783 };
21784
21785
21786 typedef SInt16 PowerSourceID;
21787 struct PowerSourceParamBlock {
21788   PowerSourceID sourceID;
21789   UInt16 sourceCapacityUsage;
21790   UInt32 sourceVersion;
21791   OptionBits sourceAttr;
21792   OptionBits sourceState;
21793   UInt32 currentCapacity;
21794
21795   UInt32 maxCapacity;
21796   UInt32 timeRemaining;
21797
21798   UInt32 timeToFullCharge;
21799
21800   UInt32 voltage;
21801   SInt32 current;
21802
21803
21804   UInt32 lowWarnLevel;
21805   UInt32 deadWarnLevel;
21806   UInt32 reserved[16];
21807 };
21808 typedef struct PowerSourceParamBlock PowerSourceParamBlock;
21809 typedef PowerSourceParamBlock * PowerSourceParamBlockPtr;
21810 extern OSErr
21811 DisableWUTime(void) ;
21812 extern OSErr
21813 SetWUTime(long wuTime) ;
21814 extern OSErr
21815 GetWUTime(
21816   long * wuTime,
21817   Byte * wuFlag) ;
21818 extern OSErr
21819 BatteryStatus(
21820   Byte * status,
21821   Byte * power) ;
21822 extern OSErr
21823 ModemStatus(Byte * status) ;
21824 extern long
21825 IdleUpdate(void) ;
21826 extern long
21827 GetCPUSpeed(void) ;
21828 extern void
21829 EnableIdle(void) ;
21830 extern void
21831 DisableIdle(void) ;
21832 extern void
21833 SleepQInstall(SleepQRecPtr qRecPtr) ;
21834 extern void
21835 SleepQRemove(SleepQRecPtr qRecPtr) ;
21836 extern void
21837 AOn(void) ;
21838 extern void
21839 AOnIgnoreModem(void) ;
21840 extern void
21841 BOn(void) ;
21842 extern void
21843 AOff(void) ;
21844 extern void
21845 BOff(void) ;
21846 extern short
21847 PMSelectorCount(void) ;
21848 extern UInt32
21849 PMFeatures(void) ;
21850 extern UInt8
21851 GetSleepTimeout(void) ;
21852 extern void
21853 SetSleepTimeout(UInt8 timeout) ;
21854 extern UInt8
21855 GetHardDiskTimeout(void) ;
21856 extern void
21857 SetHardDiskTimeout(UInt8 timeout) ;
21858 extern Boolean
21859 HardDiskPowered(void) ;
21860 extern void
21861 SpinDownHardDisk(void) ;
21862 extern Boolean
21863 IsSpindownDisabled(void) ;
21864 extern void
21865 SetSpindownDisable(Boolean setDisable) ;
21866 extern OSErr
21867 HardDiskQInstall(HDQueueElement * theElement) ;
21868 extern OSErr
21869 HardDiskQRemove(HDQueueElement * theElement) ;
21870 extern void
21871 GetScaledBatteryInfo(
21872   short whichBattery,
21873   BatteryInfo * theInfo) ;
21874 extern void
21875 AutoSleepControl(Boolean enableSleep) ;
21876 extern UInt32
21877 GetIntModemInfo(void) ;
21878 extern void
21879 SetIntModemState(short theState) ;
21880 extern short
21881 MaximumProcessorSpeed(void) ;
21882 extern short
21883 MinimumProcessorSpeed(void) ;
21884 extern short
21885 CurrentProcessorSpeed(void) ;
21886 extern Boolean
21887 FullProcessorSpeed(void) ;
21888 extern Boolean
21889 SetProcessorSpeed(Boolean fullSpeed) ;
21890 extern short
21891 GetSCSIDiskModeAddress(void) ;
21892 extern void
21893 SetSCSIDiskModeAddress(short scsiAddress) ;
21894 extern void
21895 GetWakeupTimer(WakeupTime * theTime) ;
21896 extern void
21897 SetWakeupTimer(WakeupTime * theTime) ;
21898 extern Boolean
21899 IsProcessorCyclingEnabled(void) ;
21900 extern void
21901 EnableProcessorCycling(Boolean enable) ;
21902 extern short
21903 BatteryCount(void) ;
21904 extern Fixed
21905 GetBatteryVoltage(short whichBattery) ;
21906 extern void
21907 GetBatteryTimes(
21908   short whichBattery,
21909   BatteryTimeRec * theTimes) ;
21910 extern UInt8
21911 GetDimmingTimeout(void) ;
21912 extern void
21913 SetDimmingTimeout(UInt8 timeout) ;
21914 extern void
21915 DimmingControl(Boolean enableSleep) ;
21916 extern Boolean
21917 IsDimmingControlDisabled(void) ;
21918 extern Boolean
21919 IsAutoSlpControlDisabled(void) ;
21920 extern OSErr
21921 PMgrStateQInstall(PMgrQueueElement * theElement) ;
21922 extern OSErr
21923 PMgrStateQRemove(PMgrQueueElement * theElement) ;
21924 extern OSErr
21925 UpdateSystemActivity(UInt8 activity) ;
21926 extern OSErr
21927 DelaySystemIdle(void) ;
21928 extern OSErr
21929 GetStartupTimer(StartupTime * theTime) ;
21930 extern OSErr
21931 SetStartupTimer(StartupTime * theTime) ;
21932 extern OSErr
21933 GetLastActivity(ActivityInfo * theActivity) ;
21934 extern OSErr
21935 GetSoundMixerState(SoundMixerByte * theSoundMixerByte) ;
21936 extern OSErr
21937 SetSoundMixerState(SoundMixerByte * theSoundMixerByte) ;
21938 extern Boolean
21939 GetDimSuspendState(void) ;
21940 extern void
21941 SetDimSuspendState(Boolean dimSuspendState) ;
21942 extern SleepQUPP
21943 NewSleepQUPP(SleepQProcPtr userRoutine) ;
21944 extern HDSpindownUPP
21945 NewHDSpindownUPP(HDSpindownProcPtr userRoutine) ;
21946 extern PMgrStateChangeUPP
21947 NewPMgrStateChangeUPP(PMgrStateChangeProcPtr userRoutine) ;
21948 extern void
21949 DisposeSleepQUPP(SleepQUPP userUPP) ;
21950 extern void
21951 DisposeHDSpindownUPP(HDSpindownUPP userUPP) ;
21952 extern void
21953 DisposePMgrStateChangeUPP(PMgrStateChangeUPP userUPP) ;
21954 extern long
21955 InvokeSleepQUPP(
21956   long message,
21957   SleepQRecPtr qRecPtr,
21958   SleepQUPP userUPP) ;
21959 extern void
21960 InvokeHDSpindownUPP(
21961   HDQueueElement * theElement,
21962   HDSpindownUPP userUPP) ;
21963 extern void
21964 InvokePMgrStateChangeUPP(
21965   PMgrQueueElement * theElement,
21966   long stateBits,
21967   PMgrStateChangeUPP userUPP) ;
21968
21969
21970
21971
21972
21973 }
21974
21975
21976
21977 extern "C" {
21978
21979
21980
21981
21982 enum {
21983   scInc = 1,
21984   scNoInc = 2,
21985   scAdd = 3,
21986   scMove = 4,
21987   scLoop = 5,
21988   scNop = 6,
21989   scStop = 7,
21990   scComp = 8
21991 };
21992
21993
21994 struct SCSIInstr {
21995   unsigned short scOpcode;
21996   long scParam1;
21997   long scParam2;
21998 };
21999 typedef struct SCSIInstr SCSIInstr;
22000 enum {
22001   scsiVERSION = 43
22002 };
22003
22004
22005
22006
22007
22008 typedef void ( * SCSICallbackProcPtr)(void * scsiPB);
22009 typedef SCSICallbackProcPtr SCSICallbackUPP;
22010 extern SCSICallbackUPP
22011 NewSCSICallbackUPP(SCSICallbackProcPtr userRoutine) ;
22012 extern void
22013 DisposeSCSICallbackUPP(SCSICallbackUPP userUPP) ;
22014 extern void
22015 InvokeSCSICallbackUPP(
22016   void * scsiPB,
22017   SCSICallbackUPP userUPP) ;
22018
22019
22020
22021
22022
22023
22024 enum {
22025   SCSINop = 0x00,
22026   SCSIExecIO = 0x01,
22027   SCSIBusInquiry = 0x03,
22028   SCSIReleaseQ = 0x04,
22029   SCSIAbortCommand = 0x10,
22030   SCSIResetBus = 0x11,
22031   SCSIResetDevice = 0x12,
22032   SCSITerminateIO = 0x13
22033 };
22034
22035 enum {
22036   vendorUnique = 0xC0
22037 };
22038
22039
22040
22041 enum {
22042   handshakeDataLength = 8,
22043   maxCDBLength = 16,
22044   vendorIDLength = 16
22045 };
22046
22047
22048 struct DeviceIdent {
22049   UInt8 diReserved;
22050   UInt8 bus;
22051   UInt8 targetID;
22052   UInt8 LUN;
22053 };
22054 typedef struct DeviceIdent DeviceIdent;
22055
22056
22057
22058
22059
22060
22061 enum {
22062   kBusTypeSCSI = 0,
22063   kBusTypeATA = 1,
22064   kBusTypePCMCIA = 2,
22065   kBusTypeMediaBay = 3
22066 };
22067
22068
22069
22070
22071 struct DeviceIdentATA {
22072   UInt8 diReserved;
22073   UInt8 busNum;
22074   UInt8 devNum;
22075   UInt8 diReserved2;
22076 };
22077 typedef struct DeviceIdentATA DeviceIdentATA;
22078
22079
22080
22081 union CDB {
22082   BytePtr cdbPtr;
22083   UInt8 cdbBytes[16];
22084 };
22085 typedef union CDB CDB;
22086 typedef CDB * CDBPtr;
22087
22088 struct SGRecord {
22089   Ptr SGAddr;
22090   UInt32 SGCount;
22091 };
22092 typedef struct SGRecord SGRecord;
22093 struct SCSIHdr {
22094   struct SCSIHdr * qLink;
22095   short scsiReserved1;
22096   UInt16 scsiPBLength;
22097   UInt8 scsiFunctionCode;
22098   UInt8 scsiReserved2;
22099   volatile OSErr scsiResult;
22100   DeviceIdent scsiDevice;
22101   SCSICallbackUPP scsiCompletion;
22102   UInt32 scsiFlags;
22103   BytePtr scsiDriverStorage;
22104   Ptr scsiXPTprivate;
22105   long scsiReserved3;
22106 };
22107 typedef struct SCSIHdr SCSIHdr;
22108 struct SCSI_PB {
22109   SCSIHdr * qLink;
22110   short scsiReserved1;
22111   UInt16 scsiPBLength;
22112   UInt8 scsiFunctionCode;
22113   UInt8 scsiReserved2;
22114   volatile OSErr scsiResult;
22115   DeviceIdent scsiDevice;
22116   SCSICallbackUPP scsiCompletion;
22117   UInt32 scsiFlags;
22118   BytePtr scsiDriverStorage;
22119   Ptr scsiXPTprivate;
22120   long scsiReserved3;
22121 };
22122 typedef struct SCSI_PB SCSI_PB;
22123 struct SCSI_IO {
22124   SCSIHdr * qLink;
22125   short scsiReserved1;
22126   UInt16 scsiPBLength;
22127   UInt8 scsiFunctionCode;
22128   UInt8 scsiReserved2;
22129   volatile OSErr scsiResult;
22130   DeviceIdent scsiDevice;
22131   SCSICallbackUPP scsiCompletion;
22132   UInt32 scsiFlags;
22133   BytePtr scsiDriverStorage;
22134   Ptr scsiXPTprivate;
22135   long scsiReserved3;
22136
22137   UInt16 scsiResultFlags;
22138   UInt16 scsiReserved3pt5;
22139   BytePtr scsiDataPtr;
22140   UInt32 scsiDataLength;
22141   BytePtr scsiSensePtr;
22142   UInt8 scsiSenseLength;
22143   UInt8 scsiCDBLength;
22144   UInt16 scsiSGListCount;
22145   UInt32 scsiReserved4;
22146   UInt8 scsiSCSIstatus;
22147   SInt8 scsiSenseResidual;
22148   UInt16 scsiReserved5;
22149   long scsiDataResidual;
22150   CDB scsiCDB;
22151   long scsiTimeout;
22152   BytePtr scsiReserved5pt5;
22153   UInt16 scsiReserved5pt6;
22154   UInt16 scsiIOFlags;
22155   UInt8 scsiTagAction;
22156   UInt8 scsiReserved6;
22157   UInt16 scsiReserved7;
22158   UInt16 scsiSelectTimeout;
22159   UInt8 scsiDataType;
22160   UInt8 scsiTransferType;
22161   UInt32 scsiReserved8;
22162   UInt32 scsiReserved9;
22163   UInt16 scsiHandshake[8];
22164   UInt32 scsiReserved10;
22165   UInt32 scsiReserved11;
22166   struct SCSI_IO * scsiCommandLink;
22167
22168   UInt8 scsiSIMpublics[8];
22169   UInt8 scsiAppleReserved6[8];
22170
22171
22172
22173   UInt16 scsiCurrentPhase;
22174   short scsiSelector;
22175   OSErr scsiOldCallResult;
22176   UInt8 scsiSCSImessage;
22177   UInt8 XPTprivateFlags;
22178   UInt8 XPTextras[12];
22179 };
22180 typedef struct SCSI_IO SCSI_IO;
22181 typedef SCSI_IO SCSIExecIOPB;
22182
22183 struct SCSIBusInquiryPB {
22184   SCSIHdr * qLink;
22185   short scsiReserved1;
22186   UInt16 scsiPBLength;
22187   UInt8 scsiFunctionCode;
22188   UInt8 scsiReserved2;
22189   volatile OSErr scsiResult;
22190   DeviceIdent scsiDevice;
22191   SCSICallbackUPP scsiCompletion;
22192   UInt32 scsiFlags;
22193   BytePtr scsiDriverStorage;
22194   Ptr scsiXPTprivate;
22195   long scsiReserved3;
22196
22197   UInt16 scsiEngineCount;
22198   UInt16 scsiMaxTransferType;
22199
22200   UInt32 scsiDataTypes;
22201
22202   UInt16 scsiIOpbSize;
22203   UInt16 scsiMaxIOpbSize;
22204
22205   UInt32 scsiFeatureFlags;
22206
22207   UInt8 scsiVersionNumber;
22208   UInt8 scsiHBAInquiry;
22209   UInt8 scsiTargetModeFlags;
22210   UInt8 scsiScanFlags;
22211
22212   UInt32 scsiSIMPrivatesPtr;
22213   UInt32 scsiSIMPrivatesSize;
22214   UInt32 scsiAsyncFlags;
22215
22216   UInt8 scsiHiBusID;
22217   UInt8 scsiInitiatorID;
22218   UInt16 scsiBIReserved0;
22219
22220   UInt32 scsiBIReserved1;
22221   UInt32 scsiFlagsSupported;
22222
22223   UInt16 scsiIOFlagsSupported;
22224   UInt16 scsiWeirdStuff;
22225   UInt16 scsiMaxTarget;
22226   UInt16 scsiMaxLUN;
22227
22228   char scsiSIMVendor[16];
22229   char scsiHBAVendor[16];
22230   char scsiControllerFamily[16];
22231   char scsiControllerType[16];
22232
22233   char scsiXPTversion[4];
22234   char scsiSIMversion[4];
22235   char scsiHBAversion[4];
22236
22237   UInt8 scsiHBAslotType;
22238   UInt8 scsiHBAslotNumber;
22239   UInt16 scsiSIMsRsrcID;
22240
22241   UInt16 scsiBIReserved3;
22242   UInt16 scsiAdditionalLength;
22243 };
22244 typedef struct SCSIBusInquiryPB SCSIBusInquiryPB;
22245
22246 struct SCSIAbortCommandPB {
22247   SCSIHdr * qLink;
22248   short scsiReserved1;
22249   UInt16 scsiPBLength;
22250   UInt8 scsiFunctionCode;
22251   UInt8 scsiReserved2;
22252   volatile OSErr scsiResult;
22253   DeviceIdent scsiDevice;
22254   SCSICallbackUPP scsiCompletion;
22255   UInt32 scsiFlags;
22256   BytePtr scsiDriverStorage;
22257   Ptr scsiXPTprivate;
22258   long scsiReserved3;
22259   SCSI_IO * scsiIOptr;
22260 };
22261 typedef struct SCSIAbortCommandPB SCSIAbortCommandPB;
22262
22263 struct SCSITerminateIOPB {
22264   SCSIHdr * qLink;
22265   short scsiReserved1;
22266   UInt16 scsiPBLength;
22267   UInt8 scsiFunctionCode;
22268   UInt8 scsiReserved2;
22269   volatile OSErr scsiResult;
22270   DeviceIdent scsiDevice;
22271   SCSICallbackUPP scsiCompletion;
22272   UInt32 scsiFlags;
22273   BytePtr scsiDriverStorage;
22274   Ptr scsiXPTprivate;
22275   long scsiReserved3;
22276   SCSI_IO * scsiIOptr;
22277 };
22278 typedef struct SCSITerminateIOPB SCSITerminateIOPB;
22279
22280 struct SCSIResetBusPB {
22281   SCSIHdr * qLink;
22282   short scsiReserved1;
22283   UInt16 scsiPBLength;
22284   UInt8 scsiFunctionCode;
22285   UInt8 scsiReserved2;
22286   volatile OSErr scsiResult;
22287   DeviceIdent scsiDevice;
22288   SCSICallbackUPP scsiCompletion;
22289   UInt32 scsiFlags;
22290   BytePtr scsiDriverStorage;
22291   Ptr scsiXPTprivate;
22292   long scsiReserved3;
22293 };
22294 typedef struct SCSIResetBusPB SCSIResetBusPB;
22295
22296 struct SCSIResetDevicePB {
22297   SCSIHdr * qLink;
22298   short scsiReserved1;
22299   UInt16 scsiPBLength;
22300   UInt8 scsiFunctionCode;
22301   UInt8 scsiReserved2;
22302   volatile OSErr scsiResult;
22303   DeviceIdent scsiDevice;
22304   SCSICallbackUPP scsiCompletion;
22305   UInt32 scsiFlags;
22306   BytePtr scsiDriverStorage;
22307   Ptr scsiXPTprivate;
22308   long scsiReserved3;
22309 };
22310 typedef struct SCSIResetDevicePB SCSIResetDevicePB;
22311
22312 struct SCSIReleaseQPB {
22313   SCSIHdr * qLink;
22314   short scsiReserved1;
22315   UInt16 scsiPBLength;
22316   UInt8 scsiFunctionCode;
22317   UInt8 scsiReserved2;
22318   volatile OSErr scsiResult;
22319   DeviceIdent scsiDevice;
22320   SCSICallbackUPP scsiCompletion;
22321   UInt32 scsiFlags;
22322   BytePtr scsiDriverStorage;
22323   Ptr scsiXPTprivate;
22324   long scsiReserved3;
22325 };
22326 typedef struct SCSIReleaseQPB SCSIReleaseQPB;
22327
22328 struct SCSIGetVirtualIDInfoPB {
22329   SCSIHdr * qLink;
22330   short scsiReserved1;
22331   UInt16 scsiPBLength;
22332   UInt8 scsiFunctionCode;
22333   UInt8 scsiReserved2;
22334   volatile OSErr scsiResult;
22335   DeviceIdent scsiDevice;
22336   SCSICallbackUPP scsiCompletion;
22337   UInt32 scsiFlags;
22338   Ptr scsiDriverStorage;
22339   Ptr scsiXPTprivate;
22340   long scsiReserved3;
22341   UInt16 scsiOldCallID;
22342   Boolean scsiExists;
22343   SInt8 filler;
22344 };
22345 typedef struct SCSIGetVirtualIDInfoPB SCSIGetVirtualIDInfoPB;
22346
22347 struct SCSIDriverPB {
22348   SCSIHdr * qLink;
22349   short scsiReserved1;
22350   UInt16 scsiPBLength;
22351   UInt8 scsiFunctionCode;
22352   UInt8 scsiReserved2;
22353   volatile OSErr scsiResult;
22354   DeviceIdent scsiDevice;
22355   SCSICallbackUPP scsiCompletion;
22356   UInt32 scsiFlags;
22357   Ptr scsiDriverStorage;
22358   Ptr scsiXPTprivate;
22359   long scsiReserved3;
22360   short scsiDriver;
22361   UInt16 scsiDriverFlags;
22362   DeviceIdent scsiNextDevice;
22363 };
22364 typedef struct SCSIDriverPB SCSIDriverPB;
22365
22366 struct SCSILoadDriverPB {
22367   SCSIHdr * qLink;
22368   short scsiReserved1;
22369   UInt16 scsiPBLength;
22370   UInt8 scsiFunctionCode;
22371   UInt8 scsiReserved2;
22372   volatile OSErr scsiResult;
22373   DeviceIdent scsiDevice;
22374   SCSICallbackUPP scsiCompletion;
22375   UInt32 scsiFlags;
22376   Ptr scsiDriverStorage;
22377   Ptr scsiXPTprivate;
22378   long scsiReserved3;
22379   short scsiLoadedRefNum;
22380   Boolean scsiDiskLoadFailed;
22381   SInt8 filler;
22382 };
22383 typedef struct SCSILoadDriverPB SCSILoadDriverPB;
22384
22385
22386 enum {
22387   scsiTransferBlind = 0,
22388   scsiTransferPolled = 1
22389 };
22390
22391 enum {
22392   scsiErrorBase = -7936
22393 };
22394
22395 enum {
22396   scsiRequestInProgress = 1,
22397
22398   scsiRequestAborted = scsiErrorBase + 2,
22399   scsiUnableToAbort = scsiErrorBase + 3,
22400   scsiNonZeroStatus = scsiErrorBase + 4,
22401   scsiUnused05 = scsiErrorBase + 5,
22402   scsiUnused06 = scsiErrorBase + 6,
22403   scsiUnused07 = scsiErrorBase + 7,
22404   scsiUnused08 = scsiErrorBase + 8,
22405   scsiUnableToTerminate = scsiErrorBase + 9,
22406   scsiSelectTimeout = scsiErrorBase + 10,
22407   scsiCommandTimeout = scsiErrorBase + 11,
22408   scsiIdentifyMessageRejected = scsiErrorBase + 12,
22409   scsiMessageRejectReceived = scsiErrorBase + 13,
22410   scsiSCSIBusReset = scsiErrorBase + 14,
22411   scsiParityError = scsiErrorBase + 15,
22412   scsiAutosenseFailed = scsiErrorBase + 16,
22413   scsiUnused11 = scsiErrorBase + 17,
22414   scsiDataRunError = scsiErrorBase + 18,
22415   scsiUnexpectedBusFree = scsiErrorBase + 19,
22416   scsiSequenceFailed = scsiErrorBase + 20,
22417   scsiWrongDirection = scsiErrorBase + 21,
22418   scsiUnused16 = scsiErrorBase + 22,
22419   scsiBDRsent = scsiErrorBase + 23,
22420   scsiTerminated = scsiErrorBase + 24,
22421   scsiNoNexus = scsiErrorBase + 25,
22422   scsiCDBReceived = scsiErrorBase + 26,
22423
22424   scsiTooManyBuses = scsiErrorBase + 48,
22425   scsiBusy = scsiErrorBase + 49,
22426   scsiProvideFail = scsiErrorBase + 50,
22427   scsiDeviceNotThere = scsiErrorBase + 51,
22428   scsiNoHBA = scsiErrorBase + 52,
22429   scsiDeviceConflict = scsiErrorBase + 53,
22430   scsiNoSuchXref = scsiErrorBase + 54,
22431   scsiQLinkInvalid = scsiErrorBase + 55,
22432
22433
22434   scsiPBLengthError = scsiErrorBase + 64,
22435   scsiFunctionNotAvailable = scsiErrorBase + 65,
22436   scsiRequestInvalid = scsiErrorBase + 66,
22437   scsiBusInvalid = scsiErrorBase + 67,
22438   scsiTIDInvalid = scsiErrorBase + 68,
22439   scsiLUNInvalid = scsiErrorBase + 69,
22440   scsiIDInvalid = scsiErrorBase + 70,
22441   scsiDataTypeInvalid = scsiErrorBase + 71,
22442   scsiTransferTypeInvalid = scsiErrorBase + 72,
22443   scsiCDBLengthInvalid = scsiErrorBase + 73
22444 };
22445
22446
22447 enum {
22448   scsiUnused74 = scsiErrorBase + 74,
22449   scsiUnused75 = scsiErrorBase + 75,
22450   scsiBadDataLength = scsiErrorBase + 76,
22451   scsiPartialPrepared = scsiErrorBase + 77,
22452   scsiInvalidMsgType = scsiErrorBase + 78,
22453   scsiUnused79 = scsiErrorBase + 79,
22454   scsiBadConnID = scsiErrorBase + 80,
22455   scsiUnused81 = scsiErrorBase + 81,
22456   scsiIOInProgress = scsiErrorBase + 82,
22457   scsiTargetReserved = scsiErrorBase + 83,
22458   scsiUnused84 = scsiErrorBase + 84,
22459   scsiUnused85 = scsiErrorBase + 85,
22460   scsiBadConnType = scsiErrorBase + 86,
22461   scsiCannotLoadPlugin = scsiErrorBase + 87
22462 };
22463 enum {
22464   scsiFamilyInternalError = scsiErrorBase + 87,
22465   scsiPluginInternalError = scsiErrorBase + 88,
22466   scsiVendorSpecificErrorBase = scsiErrorBase + 128,
22467   scsiVendorSpecificErrorCount = 16
22468 };
22469
22470
22471 enum {
22472   scsiExecutionErrors = scsiErrorBase,
22473   scsiNotExecutedErrors = scsiTooManyBuses,
22474   scsiParameterErrors = scsiPBLengthError
22475 };
22476
22477
22478 enum {
22479   scsiSIMQFrozen = 0x0001,
22480   scsiAutosenseValid = 0x0002,
22481   scsiBusNotFree = 0x0004
22482 };
22483
22484
22485 enum {
22486   kbSCSIDisableAutosense = 29,
22487   kbSCSIFlagReservedA = 28,
22488   kbSCSIFlagReserved0 = 27,
22489   kbSCSICDBLinked = 26,
22490   kbSCSIQEnable = 25,
22491   kbSCSICDBIsPointer = 24,
22492   kbSCSIFlagReserved1 = 23,
22493   kbSCSIInitiateSyncData = 22,
22494   kbSCSIDisableSyncData = 21,
22495   kbSCSISIMQHead = 20,
22496   kbSCSISIMQFreeze = 19,
22497   kbSCSISIMQNoFreeze = 18,
22498   kbSCSIDoDisconnect = 17,
22499   kbSCSIDontDisconnect = 16,
22500   kbSCSIDataReadyForDMA = 15,
22501   kbSCSIFlagReserved3 = 14,
22502   kbSCSIDataPhysical = 13,
22503   kbSCSISensePhysical = 12,
22504   kbSCSIFlagReserved5 = 11,
22505   kbSCSIFlagReserved6 = 10,
22506   kbSCSIFlagReserved7 = 9,
22507   kbSCSIFlagReserved8 = 8,
22508   kbSCSIDataBufferValid = 7,
22509   kbSCSIStatusBufferValid = 6,
22510   kbSCSIMessageBufferValid = 5,
22511   kbSCSIFlagReserved9 = 4
22512 };
22513
22514
22515 enum {
22516   scsiDirectionMask = (long)0xC0000000,
22517   scsiDirectionNone = (long)0xC0000000,
22518   scsiDirectionReserved = 0x00000000,
22519   scsiDirectionOut = (long)0x80000000,
22520   scsiDirectionIn = 0x40000000,
22521   scsiDisableAutosense = 0x20000000,
22522   scsiFlagReservedA = 0x10000000,
22523   scsiFlagReserved0 = 0x08000000,
22524   scsiCDBLinked = 0x04000000,
22525   scsiQEnable = 0x02000000,
22526   scsiCDBIsPointer = 0x01000000,
22527   scsiFlagReserved1 = 0x00800000,
22528   scsiInitiateSyncData = 0x00400000,
22529   scsiDisableSyncData = 0x00200000,
22530   scsiSIMQHead = 0x00100000,
22531   scsiSIMQFreeze = 0x00080000,
22532   scsiSIMQNoFreeze = 0x00040000,
22533   scsiDoDisconnect = 0x00020000,
22534   scsiDontDisconnect = 0x00010000,
22535   scsiDataReadyForDMA = 0x00008000,
22536   scsiFlagReserved3 = 0x00004000,
22537   scsiDataPhysical = 0x00002000,
22538   scsiSensePhysical = 0x00001000,
22539   scsiFlagReserved5 = 0x00000800,
22540   scsiFlagReserved6 = 0x00000400,
22541   scsiFlagReserved7 = 0x00000200,
22542   scsiFlagReserved8 = 0x00000100
22543 };
22544
22545
22546 enum {
22547   scsiNoParityCheck = 0x0002,
22548   scsiDisableSelectWAtn = 0x0004,
22549   scsiSavePtrOnDisconnect = 0x0008,
22550   scsiNoBucketIn = 0x0010,
22551   scsiNoBucketOut = 0x0020,
22552   scsiDisableWide = 0x0040,
22553   scsiInitiateWide = 0x0080,
22554   scsiRenegotiateSense = 0x0100,
22555   scsiDisableDiscipline = 0x0200,
22556   scsiIOFlagReserved0080 = 0x0080,
22557   scsiIOFlagReserved8000 = 0x8000
22558 };
22559
22560
22561
22562 enum {
22563   scsiBusMDP = 0x80,
22564   scsiBusWide32 = 0x40,
22565   scsiBusWide16 = 0x20,
22566   scsiBusSDTR = 0x10,
22567   scsiBusLinkedCDB = 0x08,
22568   scsiBusTagQ = 0x02,
22569   scsiBusSoftReset = 0x01
22570 };
22571
22572
22573 enum {
22574   scsiDataBuffer = 0,
22575   scsiDataTIB = 1,
22576   scsiDataSG = 2,
22577   scsiDataIOTable = 3
22578 };
22579
22580
22581
22582 enum {
22583   scsiBusDataTIB = (1 << scsiDataTIB),
22584   scsiBusDataBuffer = (1 << scsiDataBuffer),
22585   scsiBusDataSG = (1 << scsiDataSG),
22586   scsiBusDataIOTable = (1 << scsiDataIOTable),
22587   scsiBusDataReserved = (long)0x80000000
22588 };
22589
22590
22591 enum {
22592   scsiBusScansDevices = 0x80,
22593   scsiBusScansOnInit = 0x40,
22594   scsiBusLoadsROMDrivers = 0x20
22595 };
22596
22597
22598 enum {
22599   scsiBusLVD = 0x00000400,
22600   scsiBusUltra3SCSI = 0x00000200,
22601   scsiBusUltra2SCSI = 0x00000100,
22602   scsiBusInternalExternalMask = 0x000000C0,
22603   scsiBusInternalExternalUnknown = 0x00000000,
22604   scsiBusInternalExternal = 0x000000C0,
22605   scsiBusInternal = 0x00000080,
22606   scsiBusExternal = 0x00000040,
22607   scsiBusCacheCoherentDMA = 0x00000020,
22608   scsiBusOldCallCapable = 0x00000010,
22609   scsiBusUltraSCSI = 0x00000008,
22610   scsiBusDifferential = 0x00000004,
22611   scsiBusFastSCSI = 0x00000002,
22612   scsiBusDMAavailable = 0x00000001
22613 };
22614
22615
22616 enum {
22617   scsiOddDisconnectUnsafeRead1 = 0x0001,
22618   scsiOddDisconnectUnsafeWrite1 = 0x0002,
22619   scsiBusErrorsUnsafe = 0x0004,
22620   scsiRequiresHandshake = 0x0008,
22621   scsiTargetDrivenSDTRSafe = 0x0010,
22622   scsiOddCountForPhysicalUnsafe = 0x0020,
22623   scsiAbortCmdFixed = 0x0040,
22624   scsiMeshACKTimingFixed = 0x0080
22625 };
22626
22627
22628 enum {
22629   scsiMotherboardBus = 0x00,
22630   scsiNuBus = 0x01,
22631   scsiPDSBus = 0x03,
22632   scsiPCIBus = 0x04,
22633   scsiPCMCIABus = 0x05,
22634   scsiFireWireBridgeBus = 0x06,
22635   scsiUSBBus = 0x07
22636 };
22637
22638
22639 enum {
22640   scsiDeviceSensitive = 0x0001,
22641   scsiDeviceNoOldCallAccess = 0x0002
22642 };
22643
22644
22645
22646
22647
22648
22649 enum {
22650   scsiStatGood = 0x00,
22651   scsiStatCheckCondition = 0x02,
22652   scsiStatConditionMet = 0x04,
22653   scsiStatBusy = 0x08,
22654   scsiStatIntermediate = 0x10,
22655   scsiStatIntermedMet = 0x14,
22656   scsiStatResvConflict = 0x18,
22657   scsiStatTerminated = 0x22,
22658   scsiStatQFull = 0x28
22659 };
22660
22661
22662 enum {
22663   kCmdCompleteMsg = 0,
22664   kExtendedMsg = 1,
22665   kSaveDataPointerMsg = 2,
22666   kRestorePointersMsg = 3,
22667   kDisconnectMsg = 4,
22668   kInitiatorDetectedErrorMsg = 5,
22669   kAbortMsg = 6,
22670   kMsgRejectMsg = 7,
22671   kNoOperationMsg = 8,
22672   kMsgParityErrorMsg = 9,
22673   kLinkedCmdCompleteMsg = 10,
22674   kLinkedCmdCompleteWithFlagMsg = 11,
22675   kBusDeviceResetMsg = 12,
22676   kAbortTagMsg = 13,
22677   kClearQueueMsg = 14,
22678   kInitiateRecoveryMsg = 15,
22679   kReleaseRecoveryMsg = 16,
22680   kTerminateIOProcessMsg = 17,
22681   kSimpleQueueTag = 0x20,
22682   kHeadOfQueueTagMsg = 0x21,
22683   kOrderedQueueTagMsg = 0x22,
22684   kIgnoreWideResidueMsg = 0x23
22685 };
22686 extern OSErr
22687 SCSIAction(SCSI_PB * parameterBlock) ;
22688
22689
22690 }
22691
22692
22693
22694 extern "C" {
22695
22696
22697
22698
22699
22700 enum {
22701   kSystemSoundNoError = 0,
22702   kSystemSoundUnspecifiedError = -1500
22703 };
22704
22705
22706
22707
22708 typedef UInt32 SystemSoundActionID;
22709 extern void
22710 AlertSoundPlay(void) ;
22711 extern void
22712 SystemSoundPlay(SystemSoundActionID inAction) ;
22713 extern OSStatus
22714 SystemSoundGetActionID(
22715   const FSRef * userFile,
22716   SystemSoundActionID * outAction) ;
22717 extern OSStatus
22718 SystemSoundRemoveActionID(SystemSoundActionID inAction) ;
22719
22720
22721
22722
22723 }
22724
22725
22726
22727
22728
22729
22730 enum {
22731   kThumbnail32BitData = 'it32',
22732   kThumbnail8BitMask = 't8mk'
22733 };
22734
22735 enum {
22736   kHuge1BitMask = 'ich#',
22737   kHuge4BitData = 'ich4',
22738   kHuge8BitData = 'ich8',
22739   kHuge32BitData = 'ih32',
22740   kHuge8BitMask = 'h8mk'
22741 };
22742
22743
22744
22745 enum {
22746   kLarge1BitMask = 'ICN#',
22747   kLarge4BitData = 'icl4',
22748   kLarge8BitData = 'icl8',
22749   kLarge32BitData = 'il32',
22750   kLarge8BitMask = 'l8mk',
22751   kSmall1BitMask = 'ics#',
22752   kSmall4BitData = 'ics4',
22753   kSmall8BitData = 'ics8',
22754   kSmall32BitData = 'is32',
22755   kSmall8BitMask = 's8mk',
22756   kMini1BitMask = 'icm#',
22757   kMini4BitData = 'icm4',
22758   kMini8BitData = 'icm8'
22759 };
22760
22761
22762 enum {
22763   large1BitMask = kLarge1BitMask,
22764   large4BitData = kLarge4BitData,
22765   large8BitData = kLarge8BitData,
22766   small1BitMask = kSmall1BitMask,
22767   small4BitData = kSmall4BitData,
22768   small8BitData = kSmall8BitData,
22769   mini1BitMask = kMini1BitMask,
22770   mini4BitData = kMini4BitData,
22771   mini8BitData = kMini8BitData
22772 };
22773 enum {
22774   kIconFamilyType = 'icns'
22775 };
22776
22777
22778 struct IconFamilyElement {
22779   OSType elementType;
22780   Size elementSize;
22781   unsigned char elementData[1];
22782 };
22783 typedef struct IconFamilyElement IconFamilyElement;
22784 struct IconFamilyResource {
22785   OSType resourceType;
22786   Size resourceSize;
22787   IconFamilyElement elements[1];
22788
22789 };
22790 typedef struct IconFamilyResource IconFamilyResource;
22791 typedef IconFamilyResource * IconFamilyPtr;
22792 typedef IconFamilyPtr * IconFamilyHandle;
22793
22794
22795
22796 enum {
22797   kTileIconVariant = 'tile',
22798   kRolloverIconVariant = 'over',
22799   kDropIconVariant = 'drop',
22800   kOpenIconVariant = 'open',
22801   kOpenDropIconVariant = 'odrp'
22802 };
22803
22804
22805
22806
22807
22808 extern "C" {
22809
22810
22811 typedef UInt8 OTUInt8Param;
22812 typedef UInt16 OTUInt16Param;
22813 typedef SInt16 OTSInt16Param;
22814 typedef SInt8 OTSInt8Param;
22815 typedef Boolean OTBooleanParam;
22816 typedef UInt8 uchar_p;
22817 typedef UInt16 ushort_p;
22818 typedef SInt16 short_p;
22819 typedef SInt8 char_p;
22820 typedef Boolean boolean_p;
22821
22822
22823
22824
22825
22826
22827
22828     typedef unsigned int OTByteCount;
22829     typedef unsigned int OTItemCount;
22830     typedef int OTInt32;
22831     typedef unsigned int OTUInt32;
22832
22833
22834 typedef long int_t;
22835 typedef unsigned long uint_t;
22836 enum {
22837   kOTCFMClass = 'otan'
22838 };
22839
22840
22841
22842
22843 typedef UInt32 OTTimeout;
22844
22845 typedef SInt32 OTSequence;
22846
22847 typedef SInt32 OTNameID;
22848
22849
22850
22851
22852 typedef SInt32 OTReason;
22853
22854 typedef UInt32 OTQLen;
22855
22856 typedef UInt8 * OTClientName;
22857
22858 typedef SInt32 OTCommand;
22859
22860 typedef void* OTClient;
22861 typedef UInt32 OTOpenFlags;
22862 enum {
22863   kO_ASYNC = 0x01,
22864   kO_NDELAY = 0x04,
22865   kO_NONBLOCK = 0x04
22866 };
22867 typedef UInt16 OTUnixErr;
22868 typedef UInt16 OTXTIErr;
22869 enum {
22870   TSUCCESS = 0,
22871   TBADADDR = 1,
22872   TBADOPT = 2,
22873   TACCES = 3,
22874   TBADF = 4,
22875   TNOADDR = 5,
22876   TOUTSTATE = 6,
22877   TBADSEQ = 7,
22878   TSYSERR = 8,
22879   TLOOK = 9,
22880   TBADDATA = 10,
22881   TBUFOVFLW = 11,
22882   TFLOW = 12,
22883   TNODATA = 13,
22884   TNODIS = 14,
22885   TNOUDERR = 15,
22886   TBADFLAG = 16,
22887   TNOREL = 17,
22888   TNOTSUPPORT = 18,
22889   TSTATECHNG = 19,
22890   TNOSTRUCTYPE = 20,
22891   TBADNAME = 21,
22892   TBADQLEN = 22,
22893   TADDRBUSY = 23,
22894   TINDOUT = 24,
22895   TPROVMISMATCH = 25,
22896   TRESQLEN = 26,
22897   TRESADDR = 27,
22898   TQFULL = 28,
22899   TPROTO = 29,
22900   TBADSYNC = 30,
22901   TCANCELED = 31,
22902   TLASTXTIERROR = 31
22903 };
22904 typedef SInt32 OTResult;
22905 enum {
22906   kOTGenericName = 0
22907 };
22908
22909 typedef UInt16 OTAddressType;
22910 struct OTAddress {
22911   OTAddressType fAddressType;
22912   UInt8 fAddress[1];
22913 };
22914 typedef struct OTAddress OTAddress;
22915 enum {
22916   T_BIND = 1,
22917   T_OPTMGMT = 2,
22918   T_CALL = 3,
22919   T_DIS = 4,
22920   T_UNITDATA = 5,
22921   T_UDERROR = 6,
22922   T_INFO = 7,
22923   T_REPLYDATA = 8,
22924   T_REQUESTDATA = 9,
22925   T_UNITREQUEST = 10,
22926   T_UNITREPLY = 11
22927 };
22928
22929
22930 typedef UInt32 OTStructType;
22931
22932
22933
22934
22935 enum {
22936   T_ADDR = 0x01,
22937   T_OPT = 0x02,
22938   T_UDATA = 0x04,
22939   T_ALL = 0xFFFF
22940 };
22941
22942 typedef UInt32 OTFieldsType;
22943
22944
22945
22946
22947
22948
22949
22950 typedef UInt32 OTFlags;
22951
22952
22953
22954
22955 enum {
22956   T_MORE = 0x0001,
22957   T_EXPEDITED = 0x0002,
22958   T_ACKNOWLEDGED = 0x0004,
22959   T_PARTIALDATA = 0x0008,
22960   T_NORECEIPT = 0x0010,
22961   T_TIMEDOUT = 0x0020
22962 };
22963
22964
22965
22966 enum {
22967   T_NEGOTIATE = 0x0004,
22968   T_CHECK = 0x0008,
22969   T_DEFAULT = 0x0010,
22970   T_CURRENT = 0x0080
22971 };
22972
22973
22974
22975
22976
22977
22978 enum {
22979   T_SUCCESS = 0x0020,
22980   T_FAILURE = 0x0040,
22981   T_PARTSUCCESS = 0x0100,
22982   T_READONLY = 0x0200,
22983   T_NOTSUPPORT = 0x0400
22984 };
22985 typedef UInt32 OTBand;
22986   typedef class TProvider* ProviderRef;
22987   typedef class TEndpoint* EndpointRef;
22988   typedef class TMapper* MapperRef;
22989 typedef UInt32 OTEventCode;
22990 enum {
22991   T_LISTEN = 0x0001,
22992   T_CONNECT = 0x0002,
22993   T_DATA = 0x0004,
22994   T_EXDATA = 0x0008,
22995   T_DISCONNECT = 0x0010,
22996   T_ERROR = 0x0020,
22997   T_UDERR = 0x0040,
22998   T_ORDREL = 0x0080,
22999   T_GODATA = 0x0100,
23000   T_GOEXDATA = 0x0200,
23001   T_REQUEST = 0x0400,
23002   T_REPLY = 0x0800,
23003   T_PASSCON = 0x1000,
23004   T_RESET = 0x2000,
23005   kPRIVATEEVENT = 0x10000000,
23006   kCOMPLETEEVENT = 0x20000000,
23007   T_BINDCOMPLETE = 0x20000001,
23008   T_UNBINDCOMPLETE = 0x20000002,
23009   T_ACCEPTCOMPLETE = 0x20000003,
23010   T_REPLYCOMPLETE = 0x20000004,
23011   T_DISCONNECTCOMPLETE = 0x20000005,
23012   T_OPTMGMTCOMPLETE = 0x20000006,
23013   T_OPENCOMPLETE = 0x20000007,
23014   T_GETPROTADDRCOMPLETE = 0x20000008,
23015   T_RESOLVEADDRCOMPLETE = 0x20000009,
23016   T_GETINFOCOMPLETE = 0x2000000A,
23017   T_SYNCCOMPLETE = 0x2000000B,
23018   T_MEMORYRELEASED = 0x2000000C,
23019   T_REGNAMECOMPLETE = 0x2000000D,
23020   T_DELNAMECOMPLETE = 0x2000000E,
23021   T_LKUPNAMECOMPLETE = 0x2000000F,
23022   T_LKUPNAMERESULT = 0x20000010,
23023   kOTSyncIdleEvent = 0x20000011,
23024   kSTREAMEVENT = 0x21000000,
23025   kOTReservedEvent1 = 0x21000001,
23026   kGetmsgEvent = 0x21000002,
23027   kStreamReadEvent = 0x21000003,
23028   kStreamWriteEvent = 0x21000004,
23029   kStreamIoctlEvent = 0x21000005,
23030   kOTReservedEvent2 = 0x21000006,
23031   kStreamOpenEvent = 0x21000007,
23032   kPollEvent = 0x21000008,
23033   kOTReservedEvent3 = 0x21000009,
23034   kOTReservedEvent4 = 0x2100000A,
23035   kOTReservedEvent5 = 0x2100000B,
23036   kOTReservedEvent6 = 0x2100000C,
23037   kOTReservedEvent7 = 0x2100000D,
23038   kOTReservedEvent8 = 0x2100000E,
23039   kSIGNALEVENT = 0x22000000,
23040   kPROTOCOLEVENT = 0x23000000,
23041   kOTProviderIsDisconnected = 0x23000001,
23042   kOTProviderIsReconnected = 0x23000002,
23043   kOTProviderWillClose = 0x24000001,
23044   kOTProviderIsClosed = 0x24000002,
23045   kOTPortDisabled = 0x25000001,
23046   kOTPortEnabled = 0x25000002,
23047   kOTPortOffline = 0x25000003,
23048   kOTPortOnline = 0x25000004,
23049   kOTClosePortRequest = 0x25000005,
23050   kOTYieldPortRequest = 0x25000005,
23051   kOTNewPortRegistered = 0x25000006,
23052   kOTPortNetworkChange = 0x25000007,
23053   kOTConfigurationChanged = 0x26000001,
23054   kOTSystemSleep = 0x26000002,
23055   kOTSystemShutdown = 0x26000003,
23056   kOTSystemAwaken = 0x26000004,
23057   kOTSystemIdle = 0x26000005,
23058   kOTSystemSleepPrep = 0x26000006,
23059   kOTSystemShutdownPrep = 0x26000007,
23060   kOTSystemAwakenPrep = 0x26000008,
23061   kOTStackIsLoading = 0x27000001,
23062   kOTStackWasLoaded = 0x27000002,
23063   kOTStackIsUnloading = 0x27000003
23064 };
23065 enum {
23066   kOTDisablePortEvent = 0x21000001,
23067   kStreamCloseEvent = 0x21000006,
23068   kBackgroundStreamEvent = 0x21000009,
23069   kIoctlRecvFdEvent = 0x2100000A,
23070   kOTTryShutdownEvent = 0x2100000B,
23071   kOTScheduleTerminationEvent = 0x2100000C,
23072   kOTEnablePortEvent = 0x2100000D,
23073   kOTNewPortRegisteredEvent = 0x2100000E,
23074   kOTPortOfflineEvent = 0x2100000F,
23075   kOTPortOnlineEvent = 0x21000010,
23076   kOTPortNetworkChangeEvent = 0x21000011
23077 };
23078 enum {
23079   kSIGHUP = 1,
23080   kSIGURG = 16,
23081   kSIGPOLL = 30
23082 };
23083 typedef void ( * OTNotifyProcPtr)(void *contextPtr, OTEventCode code, OTResult result, void *cookie);
23084 typedef OTNotifyProcPtr OTNotifyUPP;
23085 extern OTNotifyUPP
23086 NewOTNotifyUPP(OTNotifyProcPtr userRoutine) ;
23087 extern void
23088 DisposeOTNotifyUPP(OTNotifyUPP userUPP) ;
23089 extern void
23090 InvokeOTNotifyUPP(
23091   void * contextPtr,
23092   OTEventCode code,
23093   OTResult result,
23094   void * cookie,
23095   OTNotifyUPP userUPP) ;
23096
23097
23098
23099 enum {
23100   XTI_GENERIC = 0xFFFF
23101 };
23102
23103 typedef UInt32 OTXTILevel;
23104
23105 typedef UInt32 OTXTIName;
23106
23107 enum {
23108   XTI_DEBUG = 0x0001,
23109   XTI_LINGER = 0x0080,
23110   XTI_RCVBUF = 0x1002,
23111   XTI_RCVLOWAT = 0x1004,
23112   XTI_SNDBUF = 0x1001,
23113   XTI_SNDLOWAT = 0x1003,
23114   XTI_PROTOTYPE = 0x1005,
23115   OPT_CHECKSUM = 0x0600,
23116   OPT_RETRYCNT = 0x0601,
23117   OPT_INTERVAL = 0x0602,
23118   OPT_ENABLEEOM = 0x0603,
23119   OPT_SELFSEND = 0x0604,
23120   OPT_SERVERSTATUS = 0x0605,
23121   OPT_ALERTENABLE = 0x0606,
23122   OPT_KEEPALIVE = 0x0008
23123 };
23124 enum {
23125   MIOC_STREAMIO = 'A',
23126   MIOC_TMOD = 'a',
23127   MIOC_STRLOG = 'b',
23128   MIOC_ND = 'c',
23129   MIOC_ECHO = 'd',
23130   MIOC_TLI = 'e',
23131   MIOC_RESERVEDf = 'f',
23132   MIOC_SAD = 'g',
23133   MIOC_ARP = 'h',
23134   MIOC_HAVOC = 'H',
23135   MIOC_RESERVEDi = 'i',
23136   MIOC_SIOC = 'j',
23137   MIOC_TCP = 'k',
23138   MIOC_DLPI = 'l',
23139   MIOC_SOCKETS = 'm',
23140   MIOC_IPX = 'o',
23141   MIOC_OT = 'O',
23142   MIOC_ATALK = 'T',
23143   MIOC_SRL = 'U',
23144   MIOC_RESERVEDp = 'p',
23145   MIOC_RESERVEDr = 'r',
23146   MIOC_RESERVEDs = 's',
23147   MIOC_CFIG = 'z'
23148 };
23149
23150
23151
23152 enum {
23153   I_OTGetMiscellaneousEvents = ((MIOC_OT << 8) | 1),
23154   I_OTSetFramingType = ((MIOC_OT << 8) | 2),
23155   kOTGetFramingValue = (unsigned long)0xFFFFFFFF,
23156   I_OTSetRawMode = ((MIOC_OT << 8) | 3),
23157   kOTSetRecvMode = 0x01,
23158   kOTSendErrorPacket = 0x02,
23159   I_OTConnect = ((MIOC_OT << 8) | 4),
23160   I_OTDisconnect = ((MIOC_OT << 8) | 5),
23161   I_OTScript = ((MIOC_OT << 8) | 6)
23162 };
23163
23164
23165
23166 struct OTScriptInfo {
23167   UInt32 fScriptType;
23168   void * fTheScript;
23169   UInt32 fScriptLength;
23170 };
23171 typedef struct OTScriptInfo OTScriptInfo;
23172
23173
23174
23175
23176
23177 typedef UInt32 OTXTIStates;
23178 enum {
23179   T_UNINIT = 0,
23180   T_UNBND = 1,
23181   T_IDLE = 2,
23182   T_OUTCON = 3,
23183   T_INCON = 4,
23184   T_DATAXFER = 5,
23185   T_OUTREL = 6,
23186   T_INREL = 7
23187 };
23188
23189
23190
23191
23192
23193
23194 enum {
23195   T_YES = 1,
23196   T_NO = 0,
23197   T_UNUSED = (unsigned long)(-1),
23198   kT_NULL = 0,
23199   T_ABSREQ = 0x8000
23200 };
23201
23202 enum {
23203   kT_UNSPEC = (unsigned long)0xFFFFFFFD,
23204   T_ALLOPT = 0
23205 };
23206 typedef class OTConfiguration* OTConfigurationRef;
23207 struct TOptionHeader {
23208   ByteCount len;
23209
23210
23211   OTXTILevel level;
23212   OTXTIName name;
23213   UInt32 status;
23214 };
23215 typedef struct TOptionHeader TOptionHeader;
23216
23217
23218
23219
23220
23221 struct TOption {
23222   ByteCount len;
23223
23224
23225   OTXTILevel level;
23226   OTXTIName name;
23227   UInt32 status;
23228   UInt32 value[1];
23229 };
23230 typedef struct TOption TOption;
23231
23232 enum {
23233   kOTOptionHeaderSize = sizeof(TOptionHeader),
23234   kOTBooleanOptionDataSize = sizeof(UInt32),
23235   kOTBooleanOptionSize = kOTOptionHeaderSize + kOTBooleanOptionDataSize,
23236   kOTOneByteOptionSize = kOTOptionHeaderSize + 1,
23237   kOTTwoByteOptionSize = kOTOptionHeaderSize + 2,
23238   kOTFourByteOptionSize = kOTOptionHeaderSize + sizeof(UInt32)
23239 };
23240 struct t_kpalive {
23241   SInt32 kp_onoff;
23242   SInt32 kp_timeout;
23243 };
23244 typedef struct t_kpalive t_kpalive;
23245
23246 struct t_linger {
23247   SInt32 l_onoff;
23248   SInt32 l_linger;
23249 };
23250 typedef struct t_linger t_linger;
23251
23252
23253
23254
23255
23256
23257
23258 typedef UInt32 OTServiceType;
23259 enum {
23260   T_COTS = 1,
23261   T_COTS_ORD = 2,
23262   T_CLTS = 3,
23263   T_TRANS = 5,
23264   T_TRANS_ORD = 6,
23265   T_TRANS_CLTS = 7
23266 };
23267
23268
23269
23270 enum {
23271   T_SENDZERO = 0x0001,
23272   T_XPG4_1 = 0x0002,
23273   T_CAN_SUPPORT_MDATA = 0x10000000,
23274   T_CAN_RESOLVE_ADDR = 0x40000000,
23275   T_CAN_SUPPLY_MIB = 0x20000000
23276 };
23277
23278
23279
23280
23281
23282
23283 enum {
23284   T_INFINITE = -1,
23285   T_INVALID = -2
23286 };
23287
23288
23289 typedef SInt32 OTDataSize;
23290
23291 struct TEndpointInfo {
23292   OTDataSize addr;
23293   OTDataSize options;
23294   OTDataSize tsdu;
23295   OTDataSize etsdu;
23296   OTDataSize connect;
23297   OTDataSize discon;
23298   OTServiceType servtype;
23299   UInt32 flags;
23300 };
23301 typedef struct TEndpointInfo TEndpointInfo;
23302 typedef UInt32 OTPortRef;
23303 typedef OTPortRef * OTPortRefPtr;
23304 enum {
23305   kOTInvalidPortRef = 0
23306 };
23307
23308
23309
23310 typedef UInt8 OTBusType;
23311 enum {
23312   kOTUnknownBusPort = 0,
23313   kOTMotherboardBus = 1,
23314   kOTNuBus = 2,
23315   kOTPCIBus = 3,
23316   kOTGeoPort = 4,
23317   kOTPCCardBus = 5,
23318   kOTFireWireBus = 6,
23319   kOTLastBusIndex = 15
23320 };
23321
23322
23323
23324
23325
23326
23327 typedef UInt16 OTDeviceType;
23328 enum {
23329   kOTNoDeviceType = 0,
23330   kOTADEVDevice = 1,
23331   kOTMDEVDevice = 2,
23332   kOTLocalTalkDevice = 3,
23333   kOTIRTalkDevice = 4,
23334   kOTTokenRingDevice = 5,
23335   kOTISDNDevice = 6,
23336   kOTATMDevice = 7,
23337   kOTSMDSDevice = 8,
23338   kOTSerialDevice = 9,
23339   kOTEthernetDevice = 10,
23340   kOTSLIPDevice = 11,
23341   kOTPPPDevice = 12,
23342   kOTModemDevice = 13,
23343   kOTFastEthernetDevice = 14,
23344   kOTFDDIDevice = 15,
23345   kOTIrDADevice = 16,
23346   kOTATMSNAPDevice = 17,
23347   kOTFibreChannelDevice = 18,
23348   kOTFireWireDevice = 19,
23349   kOTPseudoDevice = 1023,
23350   kOTLastDeviceIndex = 1022
23351 };
23352
23353
23354
23355 enum {
23356   kOTLastSlotNumber = 255,
23357   kOTLastOtherNumber = 255
23358 };
23359
23360 typedef UInt16 OTSlotNumber;
23361 extern OTPortRef
23362 OTCreatePortRef(
23363   OTBusType busType,
23364   OTDeviceType devType,
23365   OTSlotNumber slot,
23366   UInt16 other) ;
23367 extern OTDeviceType
23368 OTGetDeviceTypeFromPortRef(OTPortRef ref) ;
23369 extern UInt16
23370 OTGetBusTypeFromPortRef(OTPortRef ref) ;
23371 extern OTSlotNumber
23372 OTGetSlotFromPortRef(
23373   OTPortRef ref,
23374   UInt16 * other) ;
23375 extern OTPortRef
23376 OTSetDeviceTypeInPortRef(
23377   OTPortRef ref,
23378   OTDeviceType devType) ;
23379 extern OTPortRef
23380 OTSetBusTypeInPortRef(
23381   OTPortRef ref,
23382   OTBusType busType) ;
23383 enum {
23384   kMaxModuleNameLength = 31,
23385   kMaxModuleNameSize = kMaxModuleNameLength + 1,
23386   kMaxProviderNameLength = kMaxModuleNameLength + 4,
23387   kMaxProviderNameSize = kMaxProviderNameLength + 1,
23388   kMaxSlotIDLength = 7,
23389   kMaxSlotIDSize = kMaxSlotIDLength + 1,
23390   kMaxResourceInfoLength = 31,
23391   kMaxResourceInfoSize = 32,
23392   kMaxPortNameLength = kMaxModuleNameLength + 4,
23393   kMaxPortNameSize = kMaxPortNameLength + 1
23394 };
23395
23396
23397
23398
23399
23400
23401 enum {
23402   kOTPortIsActive = 0x00000001,
23403   kOTPortIsDisabled = 0x00000002,
23404   kOTPortIsUnavailable = 0x00000004,
23405   kOTPortIsOffline = 0x00000008
23406 };
23407
23408
23409
23410 enum {
23411   kOTPortIsDLPI = 0x00000001,
23412   kOTPortIsTPI = 0x00000002,
23413   kOTPortCanYield = 0x00000004,
23414   kOTPortCanArbitrate = 0x00000008,
23415   kOTPortIsTransitory = 0x00000010,
23416   kOTPortAutoConnects = 0x00000020,
23417   kOTPortIsSystemRegistered = 0x00004000,
23418   kOTPortIsPrivate = 0x00008000,
23419   kOTPortIsAlias = (unsigned long)0x80000000
23420 };
23421 struct OTPortRecord {
23422   OTPortRef fRef;
23423   UInt32 fPortFlags;
23424   UInt32 fInfoFlags;
23425   UInt32 fCapabilities;
23426   ItemCount fNumChildPorts;
23427   OTPortRef * fChildPorts;
23428   char fPortName[36];
23429   char fModuleName[32];
23430   char fSlotID[8];
23431   char fResourceInfo[32];
23432   char fReserved[164];
23433 };
23434 typedef struct OTPortRecord OTPortRecord;
23435 extern Boolean
23436 OTGetIndexedPort(
23437   OTPortRecord * portRecord,
23438   OTItemCount index) ;
23439 extern Boolean
23440 OTFindPort(
23441   OTPortRecord * portRecord,
23442   const char * portName) ;
23443 extern Boolean
23444 OTFindPortByRef(
23445   OTPortRecord * portRecord,
23446   OTPortRef ref) ;
23447 struct TNetbuf {
23448   ByteCount maxlen;
23449   ByteCount len;
23450   UInt8 * buf;
23451 };
23452 typedef struct TNetbuf TNetbuf;
23453 struct strbuf {
23454   SInt32 maxlen;
23455   SInt32 len;
23456   char * buf;
23457 };
23458 typedef struct strbuf strbuf;
23459
23460
23461
23462
23463
23464
23465
23466 struct OTData {
23467   void * fNext;
23468   void * fData;
23469   ByteCount fLen;
23470 };
23471 typedef struct OTData OTData;
23472 enum {
23473   kNetbufDataIsOTData = (unsigned long)0xFFFFFFFE
23474 };
23475 struct OTBuffer {
23476   void * fLink;
23477   void * fLink2;
23478   struct OTBuffer * fNext;
23479   UInt8 * fData;
23480   ByteCount fLen;
23481   void * fSave;
23482   UInt8 fBand;
23483   UInt8 fType;
23484   UInt8 fPad1;
23485   UInt8 fFlags;
23486 };
23487 typedef struct OTBuffer OTBuffer;
23488 enum {
23489   kOTNetbufDataIsOTBufferStar = (unsigned long)0xFFFFFFFD
23490 };
23491
23492
23493
23494
23495
23496
23497 struct OTBufferInfo {
23498   OTBuffer * fBuffer;
23499   ByteCount fOffset;
23500   UInt8 fPad;
23501 };
23502 typedef struct OTBufferInfo OTBufferInfo;
23503 enum {
23504   kOTNetbufIsRawMode = (unsigned long)0xFFFFFFFF
23505 };
23506 struct TBind {
23507   TNetbuf addr;
23508   OTQLen qlen;
23509 };
23510 typedef struct TBind TBind;
23511
23512
23513
23514
23515 struct TDiscon {
23516   TNetbuf udata;
23517   OTReason reason;
23518   OTSequence sequence;
23519 };
23520 typedef struct TDiscon TDiscon;
23521
23522
23523
23524
23525 struct TCall {
23526   TNetbuf addr;
23527   TNetbuf opt;
23528   TNetbuf udata;
23529   OTSequence sequence;
23530 };
23531 typedef struct TCall TCall;
23532
23533 struct TUnitData {
23534   TNetbuf addr;
23535   TNetbuf opt;
23536   TNetbuf udata;
23537 };
23538 typedef struct TUnitData TUnitData;
23539
23540
23541
23542
23543 struct TUDErr {
23544   TNetbuf addr;
23545   TNetbuf opt;
23546   SInt32 error;
23547 };
23548 typedef struct TUDErr TUDErr;
23549
23550 struct TOptMgmt {
23551   TNetbuf opt;
23552   OTFlags flags;
23553 };
23554 typedef struct TOptMgmt TOptMgmt;
23555 struct TRequest {
23556   TNetbuf data;
23557   TNetbuf opt;
23558   OTSequence sequence;
23559 };
23560 typedef struct TRequest TRequest;
23561
23562 struct TReply {
23563   TNetbuf data;
23564   TNetbuf opt;
23565   OTSequence sequence;
23566 };
23567 typedef struct TReply TReply;
23568
23569
23570
23571
23572 struct TUnitRequest {
23573   TNetbuf addr;
23574   TNetbuf opt;
23575   TNetbuf udata;
23576   OTSequence sequence;
23577 };
23578 typedef struct TUnitRequest TUnitRequest;
23579
23580 struct TUnitReply {
23581   TNetbuf opt;
23582   TNetbuf udata;
23583   OTSequence sequence;
23584 };
23585 typedef struct TUnitReply TUnitReply;
23586
23587
23588
23589
23590
23591
23592
23593 struct TRegisterRequest {
23594   TNetbuf name;
23595   TNetbuf addr;
23596   OTFlags flags;
23597 };
23598 typedef struct TRegisterRequest TRegisterRequest;
23599
23600
23601
23602
23603 struct TRegisterReply {
23604   TNetbuf addr;
23605   OTNameID nameid;
23606 };
23607 typedef struct TRegisterReply TRegisterReply;
23608
23609 struct TLookupRequest {
23610   TNetbuf name;
23611   TNetbuf addr;
23612   UInt32 maxcnt;
23613   OTTimeout timeout;
23614   OTFlags flags;
23615 };
23616 typedef struct TLookupRequest TLookupRequest;
23617
23618
23619
23620
23621 struct TLookupReply {
23622   TNetbuf names;
23623   UInt32 rspcount;
23624 };
23625 typedef struct TLookupReply TLookupReply;
23626
23627
23628
23629
23630 struct TLookupBuffer {
23631   UInt16 fAddressLength;
23632   UInt16 fNameLength;
23633   UInt8 fAddressBuffer[1];
23634 };
23635 typedef struct TLookupBuffer TLookupBuffer;
23636 typedef struct OpaqueOTClientContextPtr* OTClientContextPtr;
23637 typedef UInt32 OTInitializationFlags;
23638 enum {
23639   kInitOTForApplicationMask = 1,
23640   kInitOTForExtensionMask = 2
23641 };
23642 extern OSStatus
23643 InitOpenTransportInContext(
23644   OTInitializationFlags flags,
23645   OTClientContextPtr * outClientContext) ;
23646 extern void
23647 CloseOpenTransportInContext(OTClientContextPtr clientContext) ;
23648 extern OSStatus
23649 OTRegisterAsClientInContext(
23650   OTClientName name,
23651   OTNotifyUPP proc,
23652   OTClientContextPtr clientContext) ;
23653 extern OSStatus
23654 OTUnregisterAsClientInContext(OTClientContextPtr clientContext) ;
23655 typedef void ( * OTProcessProcPtr)(void * arg);
23656 typedef OTProcessProcPtr OTProcessUPP;
23657 extern OTProcessUPP
23658 NewOTProcessUPP(OTProcessProcPtr userRoutine) ;
23659 extern void
23660 DisposeOTProcessUPP(OTProcessUPP userUPP) ;
23661 extern void
23662 InvokeOTProcessUPP(
23663   void * arg,
23664   OTProcessUPP userUPP) ;
23665 extern long
23666 OTCreateDeferredTaskInContext(
23667   OTProcessUPP upp,
23668   void * arg,
23669   OTClientContextPtr clientContext) ;
23670 typedef long OTDeferredTaskRef;
23671 extern Boolean
23672 OTScheduleDeferredTask(OTDeferredTaskRef dtCookie) ;
23673 extern OSStatus
23674 OTDestroyDeferredTask(OTDeferredTaskRef dtCookie) ;
23675 typedef long OTSystemTaskRef;
23676 extern Boolean
23677 OTCanMakeSyncCall(void) ;
23678 extern OSStatus
23679 OTCloseProvider(ProviderRef ref) ;
23680 extern SInt32
23681 OTIoctl(
23682   ProviderRef ref,
23683   UInt32 cmd,
23684   void * data) ;
23685 extern OSStatus
23686 OTSetAsynchronous(ProviderRef ref) ;
23687 extern OSStatus
23688 OTSetSynchronous(ProviderRef ref) ;
23689 extern Boolean
23690 OTIsSynchronous(ProviderRef ref) ;
23691 extern OSStatus
23692 OTSetBlocking(ProviderRef ref) ;
23693 extern OSStatus
23694 OTSetNonBlocking(ProviderRef ref) ;
23695 extern Boolean
23696 OTIsBlocking(ProviderRef ref) ;
23697 extern OSStatus
23698 OTInstallNotifier(
23699   ProviderRef ref,
23700   OTNotifyUPP proc,
23701   void * contextPtr) ;
23702 extern OSStatus
23703 OTUseSyncIdleEvents(
23704   ProviderRef ref,
23705   Boolean useEvents) ;
23706 extern void
23707 OTRemoveNotifier(ProviderRef ref) ;
23708 extern void
23709 OTLeaveNotifier(ProviderRef ref) ;
23710 extern Boolean
23711 OTEnterNotifier(ProviderRef ref) ;
23712 extern OSStatus
23713 OTAckSends(ProviderRef ref) ;
23714 extern OSStatus
23715 OTDontAckSends(ProviderRef ref) ;
23716 extern Boolean
23717 OTIsAckingSends(ProviderRef ref) ;
23718 extern OSStatus
23719 OTCancelSynchronousCalls(
23720   ProviderRef ref,
23721   OSStatus err) ;
23722 extern EndpointRef
23723 OTOpenEndpointInContext(
23724   OTConfigurationRef config,
23725   OTOpenFlags oflag,
23726   TEndpointInfo * info,
23727   OSStatus * err,
23728   OTClientContextPtr clientContext) ;
23729 extern OSStatus
23730 OTAsyncOpenEndpointInContext(
23731   OTConfigurationRef config,
23732   OTOpenFlags oflag,
23733   TEndpointInfo * info,
23734   OTNotifyUPP upp,
23735   void * contextPtr,
23736   OTClientContextPtr clientContext) ;
23737 extern OSStatus
23738 OTGetEndpointInfo(
23739   EndpointRef ref,
23740   TEndpointInfo * info) ;
23741 extern OTResult
23742 OTGetEndpointState(EndpointRef ref) ;
23743 extern OTResult
23744 OTLook(EndpointRef ref) ;
23745 extern OTResult
23746 OTCountDataBytes(
23747   EndpointRef ref,
23748   OTByteCount * countPtr) ;
23749 extern OSStatus
23750 OTGetProtAddress(
23751   EndpointRef ref,
23752   TBind * boundAddr,
23753   TBind * peerAddr) ;
23754 extern OSStatus
23755 OTResolveAddress(
23756   EndpointRef ref,
23757   TBind * reqAddr,
23758   TBind * retAddr,
23759   OTTimeout timeOut) ;
23760 extern void *
23761 OTAllocInContext(
23762   EndpointRef ref,
23763   OTStructType structType,
23764   UInt32 fields,
23765   OSStatus * err,
23766   OTClientContextPtr clientContext) ;
23767 extern OTResult
23768 OTFree(
23769   void * ptr,
23770   OTStructType structType) ;
23771 extern OSStatus
23772 OTOptionManagement(
23773   EndpointRef ref,
23774   TOptMgmt * req,
23775   TOptMgmt * ret) ;
23776 extern OSStatus
23777 OTNextOption(
23778   UInt8 * buffer,
23779   UInt32 buflen,
23780   TOption ** prevOptPtr) ;
23781 extern TOption *
23782 OTFindOption(
23783   UInt8 * buffer,
23784   UInt32 buflen,
23785   OTXTILevel level,
23786   OTXTIName name) ;
23787 extern OSStatus
23788 OTBind(
23789   EndpointRef ref,
23790   TBind * reqAddr,
23791   TBind * retAddr) ;
23792 extern OSStatus
23793 OTUnbind(EndpointRef ref) ;
23794 extern OSStatus
23795 OTConnect(
23796   EndpointRef ref,
23797   TCall * sndCall,
23798   TCall * rcvCall) ;
23799 extern OSStatus
23800 OTRcvConnect(
23801   EndpointRef ref,
23802   TCall * call) ;
23803 extern OSStatus
23804 OTListen(
23805   EndpointRef ref,
23806   TCall * call) ;
23807 extern OSStatus
23808 OTAccept(
23809   EndpointRef listener,
23810   EndpointRef worker,
23811   TCall * call) ;
23812 extern OSStatus
23813 OTSndDisconnect(
23814   EndpointRef ref,
23815   TCall * call) ;
23816 extern OSStatus
23817 OTSndOrderlyDisconnect(EndpointRef ref) ;
23818 extern OSStatus
23819 OTRcvDisconnect(
23820   EndpointRef ref,
23821   TDiscon * discon) ;
23822 extern OSStatus
23823 OTRcvOrderlyDisconnect(EndpointRef ref) ;
23824 extern OTResult
23825 OTRcv(
23826   EndpointRef ref,
23827   void * buf,
23828   OTByteCount nbytes,
23829   OTFlags * flags) ;
23830 extern OTResult
23831 OTSnd(
23832   EndpointRef ref,
23833   void * buf,
23834   OTByteCount nbytes,
23835   OTFlags flags) ;
23836 extern OSStatus
23837 OTSndUData(
23838   EndpointRef ref,
23839   TUnitData * udata) ;
23840 extern OSStatus
23841 OTRcvUData(
23842   EndpointRef ref,
23843   TUnitData * udata,
23844   OTFlags * flags) ;
23845 extern OSStatus
23846 OTRcvUDErr(
23847   EndpointRef ref,
23848   TUDErr * uderr) ;
23849 extern OSStatus
23850 OTAsyncOpenMapperInContext(
23851   OTConfigurationRef config,
23852   OTOpenFlags oflag,
23853   OTNotifyUPP upp,
23854   void * contextPtr,
23855   OTClientContextPtr clientContext) ;
23856 extern MapperRef
23857 OTOpenMapperInContext(
23858   OTConfigurationRef config,
23859   OTOpenFlags oflag,
23860   OSStatus * err,
23861   OTClientContextPtr clientContext) ;
23862 extern OSStatus
23863 OTRegisterName(
23864   MapperRef ref,
23865   TRegisterRequest * req,
23866   TRegisterReply * reply) ;
23867 extern OSStatus
23868 OTDeleteName(
23869   MapperRef ref,
23870   TNetbuf * name) ;
23871 extern OSStatus
23872 OTDeleteNameByID(
23873   MapperRef ref,
23874   OTNameID nameID) ;
23875 extern OSStatus
23876 OTLookupName(
23877   MapperRef ref,
23878   TLookupRequest * req,
23879   TLookupReply * reply) ;
23880 extern OTConfigurationRef
23881 OTCreateConfiguration(const char * path) ;
23882 extern OTConfigurationRef
23883 OTCloneConfiguration(OTConfigurationRef cfig) ;
23884 extern void
23885 OTDestroyConfiguration(OTConfigurationRef cfig) ;
23886 extern void *
23887 OTAllocMemInContext(
23888   OTByteCount size,
23889   OTClientContextPtr clientContext) ;
23890 extern void
23891 OTFreeMem(void * mem) ;
23892 extern void
23893 OTDelay(UInt32 seconds) ;
23894 extern void
23895 OTIdle(void) ;
23896 extern void
23897 OTMemcpy(
23898   void * dest,
23899   const void * src,
23900   OTByteCount nBytes) ;
23901 extern Boolean
23902 OTMemcmp(
23903   const void * mem1,
23904   const void * mem2,
23905   OTByteCount nBytes) ;
23906 extern void
23907 OTMemmove(
23908   void * dest,
23909   const void * src,
23910   OTByteCount nBytes) ;
23911 extern void
23912 OTMemzero(
23913   void * dest,
23914   OTByteCount nBytes) ;
23915 extern void
23916 OTMemset(
23917   void * dest,
23918   OTUInt8Param toSet,
23919   OTByteCount nBytes) ;
23920 extern OTByteCount
23921 OTStrLength(const char * str) ;
23922 extern void
23923 OTStrCopy(
23924   char * dest,
23925   const char * src) ;
23926 extern void
23927 OTStrCat(
23928   char * dest,
23929   const char * src) ;
23930 extern Boolean
23931 OTStrEqual(
23932   const char * src1,
23933   const char * src2) ;
23934 typedef UnsignedWide OTTimeStamp;
23935 extern void
23936 OTGetTimeStamp(OTTimeStamp * currentTime) ;
23937 extern OTTimeStamp *
23938 OTSubtractTimeStamps(
23939   OTTimeStamp * result,
23940   OTTimeStamp * startTime,
23941   OTTimeStamp * endEnd) ;
23942 extern UInt32
23943 OTTimeStampInMilliseconds(OTTimeStamp * delta) ;
23944 extern UInt32
23945 OTTimeStampInMicroseconds(OTTimeStamp * delta) ;
23946 extern UInt32
23947 OTElapsedMilliseconds(OTTimeStamp * startTime) ;
23948 extern UInt32
23949 OTElapsedMicroseconds(OTTimeStamp * startTime) ;
23950 extern UInt32
23951 OTGetClockTimeInSecs(void) ;
23952 struct OTLink {
23953   struct OTLink * fNext;
23954
23955
23956
23957
23958
23959    void Init() { fNext = __null; }
23960
23961
23962
23963 };
23964 typedef struct OTLink OTLink;
23965 struct OTLIFO {
23966   OTLink * fHead;
23967
23968
23969
23970
23971
23972   void Init();
23973     void Enqueue(OTLink* link);
23974  OTLink* Dequeue();
23975  OTLink* StealList();
23976    Boolean IsEmpty();
23977
23978
23979
23980 };
23981 typedef struct OTLIFO OTLIFO;
23982 extern void
23983 OTLIFOEnqueue(
23984   OTLIFO * list,
23985   OTLink * link) ;
23986 extern OTLink *
23987 OTLIFODequeue(OTLIFO * list) ;
23988 extern OTLink *
23989 OTLIFOStealList(OTLIFO * list) ;
23990 extern OTLink *
23991 OTReverseList(OTLink * list) ;
23992
23993
23994
23995
23996
23997
23998
23999   inline void OTLIFO::Init() { fHead = __null; }
24000   inline void OTLIFO::Enqueue(OTLink* link) { OTLIFOEnqueue(this, link); }
24001  inline OTLink* OTLIFO::Dequeue() { return OTLIFODequeue(this); }
24002     inline OTLink* OTLIFO::StealList() { return OTLIFOStealList(this); }
24003   inline Boolean OTLIFO::IsEmpty() { return fHead == __null; }
24004 typedef Boolean ( * OTListSearchProcPtr)(const void *ref, OTLink *linkToCheck);
24005 typedef OTListSearchProcPtr OTListSearchUPP;
24006 extern OTListSearchUPP
24007 NewOTListSearchUPP(OTListSearchProcPtr userRoutine) ;
24008 extern void
24009 DisposeOTListSearchUPP(OTListSearchUPP userUPP) ;
24010 extern Boolean
24011 InvokeOTListSearchUPP(
24012   const void * ref,
24013   OTLink * linkToCheck,
24014   OTListSearchUPP userUPP) ;
24015
24016 struct OTList {
24017   OTLink * fHead;
24018
24019
24020
24021
24022   void Init();
24023     Boolean IsEmpty();
24024  void AddFirst(OTLink* link);
24025     void AddLast(OTLink* link);
24026  OTLink* GetFirst();
24027     OTLink* GetLast();
24028  OTLink* RemoveFirst();
24029  OTLink* RemoveLast();
24030   Boolean IsInList(OTLink* link);
24031     OTLink* FindLink(OTListSearchUPP proc, const void* ref);
24032    Boolean RemoveLink(OTLink* link);
24033   OTLink* FindAndRemoveLink(OTListSearchUPP proc, const void* ref);
24034   OTLink* GetIndexedLink(OTItemCount index);
24035
24036
24037
24038 };
24039 typedef struct OTList OTList;
24040 extern void
24041 OTAddFirst(
24042   OTList * list,
24043   OTLink * link) ;
24044 extern void
24045 OTAddLast(
24046   OTList * list,
24047   OTLink * link) ;
24048 extern OTLink *
24049 OTRemoveFirst(OTList * list) ;
24050 extern OTLink *
24051 OTRemoveLast(OTList * list) ;
24052 extern OTLink *
24053 OTGetFirst(OTList * list) ;
24054 extern OTLink *
24055 OTGetLast(OTList * list) ;
24056 extern Boolean
24057 OTIsInList(
24058   OTList * list,
24059   OTLink * link) ;
24060 extern OTLink *
24061 OTFindLink(
24062   OTList * list,
24063   OTListSearchUPP proc,
24064   const void * ref) ;
24065 extern Boolean
24066 OTRemoveLink(
24067   OTList * list,
24068   OTLink * link) ;
24069 extern OTLink *
24070 OTFindAndRemoveLink(
24071   OTList * list,
24072   OTListSearchUPP proc,
24073   const void * ref) ;
24074 extern OTLink *
24075 OTGetIndexedLink(
24076   OTList * list,
24077   OTItemCount index) ;
24078 extern void
24079 OTEnqueue(
24080   void ** listHead,
24081   void * object,
24082   OTByteCount linkOffset) ;
24083 extern void *
24084 OTDequeue(
24085   void ** listHead,
24086   OTByteCount linkOffset) ;
24087
24088
24089
24090
24091
24092
24093   inline void OTList::Init() { fHead = __null; }
24094    inline Boolean OTList::IsEmpty() { return fHead == __null; }
24095   inline void OTList::AddFirst(OTLink* link) { OTAddFirst(this, link); }
24096     inline void OTList::AddLast(OTLink* link) { OTAddLast(this, link); }
24097  inline OTLink* OTList::GetFirst() { return OTGetFirst(this); }
24098    inline OTLink* OTList::GetLast() { return OTGetLast(this); }
24099     inline OTLink* OTList::RemoveFirst() { return OTRemoveFirst(this); }
24100     inline OTLink* OTList::RemoveLast() { return OTRemoveLast(this); }
24101  inline Boolean OTList::IsInList(OTLink* link) { return OTIsInList(this, link); }
24102  inline OTLink* OTList::FindLink(OTListSearchUPP proc, const void* ref)
24103                                                         { return OTFindLink(this, proc, ref); }
24104     inline Boolean OTList::RemoveLink(OTLink* link) { return OTRemoveLink(this, link); }
24105   inline OTLink* OTList::FindAndRemoveLink(OTListSearchUPP proc, const void* ref)
24106                                                        { return OTFindAndRemoveLink(this, proc, ref); }
24107    inline OTLink* OTList::GetIndexedLink(OTItemCount index)
24108                                                       { return OTGetIndexedLink(this, index); }
24109 extern Boolean
24110 OTAtomicSetBit(
24111   UInt8 * bytePtr,
24112   OTByteCount bitNumber) ;
24113 extern Boolean
24114 OTAtomicClearBit(
24115   UInt8 * bytePtr,
24116   OTByteCount bitNumber) ;
24117 extern Boolean
24118 OTAtomicTestBit(
24119   UInt8 * bytePtr,
24120   OTByteCount bitNumber) ;
24121 extern Boolean
24122 OTCompareAndSwapPtr(
24123   void * oldValue,
24124   void * newValue,
24125   void ** dest) ;
24126 extern Boolean
24127 OTCompareAndSwap32(
24128   UInt32 oldValue,
24129   UInt32 newValue,
24130   UInt32 * dest) ;
24131 extern Boolean
24132 OTCompareAndSwap16(
24133   UInt32 oldValue,
24134   UInt32 newValue,
24135   UInt16 * dest) ;
24136 extern Boolean
24137 OTCompareAndSwap8(
24138   UInt32 oldValue,
24139   UInt32 newValue,
24140   UInt8 * dest) ;
24141 extern SInt32
24142 OTAtomicAdd32(
24143   SInt32 toAdd,
24144   SInt32 * dest) ;
24145 extern SInt16
24146 OTAtomicAdd16(
24147   SInt32 toAdd,
24148   SInt16 * dest) ;
24149 extern SInt8
24150 OTAtomicAdd8(
24151   SInt32 toAdd,
24152   SInt8 * dest) ;
24153
24154
24155
24156
24157
24158
24159 typedef UInt8 OTLock;
24160 }
24161 class TProvider
24162 {
24163     private:
24164         void* operator new(size_t);
24165         void operator delete(void*) {}
24166
24167
24168
24169
24170
24171     public:
24172         OSStatus Close() { return OTCloseProvider(this); }
24173
24174         OSStatus SetNonBlocking() { return OTSetNonBlocking(this); }
24175         OSStatus SetBlocking() { return OTSetBlocking(this); }
24176         Boolean IsBlocking() { return OTIsBlocking(this); }
24177         Boolean IsNonBlocking() { return !OTIsBlocking(this); }
24178         OSStatus SetSynchronous() { return OTSetSynchronous(this); }
24179         OSStatus SetAsynchronous() { return OTSetAsynchronous(this); }
24180         Boolean IsSynchronous() { return OTIsSynchronous(this); }
24181         Boolean IsAsynchronous() { return !OTIsSynchronous(this); }
24182
24183         OSStatus AckSends() { return OTAckSends(this); }
24184         OSStatus DontAckSends() { return OTDontAckSends(this); }
24185         Boolean IsAckingSends() { return OTIsAckingSends(this); }
24186
24187         void CancelSynchronousCalls(OSStatus err)
24188                     { (void)OTCancelSynchronousCalls(this, err); }
24189
24190         OSStatus InstallNotifier(OTNotifyUPP proc, void* ptr)
24191                     { return OTInstallNotifier(this, proc, ptr); }
24192
24193         OSStatus UseSyncIdleEvents()
24194                     { return OTUseSyncIdleEvents(this, true); }
24195
24196         OSStatus DontUseSyncIdleEvents()
24197                     { return OTUseSyncIdleEvents(this, false); }
24198
24199         void RemoveNotifier()
24200                     { OTRemoveNotifier(this); }
24201
24202         Boolean EnterNotifier()
24203                     { return OTEnterNotifier(this); }
24204
24205         void LeaveNotifier()
24206                     { OTLeaveNotifier(this); }
24207         SInt32 Ioctl(UInt32 cmd, void* data)
24208                     { return OTIoctl(this, cmd, data); }
24209         SInt32 Ioctl(UInt32 cmd, long data)
24210                     { return OTIoctl(this, cmd, (void*)data); }
24211     public:
24212         void* fData;
24213 };
24214 class TEndpoint : public TProvider
24215 {
24216     public:
24217
24218
24219
24220         OSStatus GetEndpointInfo(TEndpointInfo* info)
24221                     { return OTGetEndpointInfo(this, info); }
24222
24223         OSStatus GetProtAddress(TBind* boundAddr, TBind* peerAddr)
24224                     { return OTGetProtAddress(this, boundAddr, peerAddr); }
24225
24226         OSStatus ResolveAddress(TBind* reqAddr, TBind* retAddr, OTTimeout timeout)
24227                     { return OTResolveAddress(this, reqAddr, retAddr, timeout); }
24228
24229         OTResult GetEndpointState()
24230                     { return OTGetEndpointState(this); }
24231
24232         OTResult Look()
24233                     { return OTLook(this); }
24234         void* AllocInContext(OTStructType structType, UInt32 fields, OSStatus* err = __null, OTClientContextPtr clientContext = __null)
24235                     { return OTAllocInContext(this, structType, fields, err, clientContext); }
24236
24237         void* Alloc(OTStructType structType, UInt32 fields, OSStatus* err = __null)
24238                     {
24239
24240                          return OTAllocInContext(this, structType, fields, err, __null);
24241
24242
24243
24244                     };
24245
24246         OTResult Free(void* ptr, OTStructType structType)
24247                     { return OTFree(ptr, structType); }
24248
24249
24250
24251         OSStatus OptionManagement(TOptMgmt* req, TOptMgmt* ret)
24252                     { return OTOptionManagement(this, req, ret); }
24253
24254
24255
24256         OSStatus Bind(TBind* reqAddr, TBind* retAddr)
24257                     { return OTBind(this, reqAddr, retAddr); }
24258
24259         OSStatus Unbind()
24260                     { return OTUnbind(this); }
24261
24262
24263
24264         OSStatus Connect(TCall* sndCall, TCall* rcvCall)
24265                     { return OTConnect(this, sndCall, rcvCall); }
24266
24267         OSStatus RcvConnect(TCall* call)
24268                     { return OTRcvConnect(this, call); }
24269
24270         OSStatus Listen(TCall* call)
24271                     { return OTListen(this, call); }
24272
24273         OSStatus Accept(EndpointRef resRef, TCall* call)
24274                     { return OTAccept(this, resRef, call); }
24275
24276         OSStatus SndDisconnect(TCall* call)
24277                     { return OTSndDisconnect(this, call); }
24278
24279         OSStatus SndOrderlyDisconnect()
24280                     { return OTSndOrderlyDisconnect(this); }
24281
24282         OSStatus RcvDisconnect(TDiscon* discon)
24283                     { return OTRcvDisconnect(this, discon); }
24284
24285         OSStatus RcvOrderlyDisconnect()
24286                     { return OTRcvOrderlyDisconnect(this); }
24287
24288
24289
24290         OTResult Snd(void* buf, OTByteCount nbytes, OTFlags flags)
24291                     { return OTSnd(this, buf, nbytes, flags); }
24292
24293         OTResult Rcv(void* buf, OTByteCount nbytes, OTFlags* flagP)
24294                     { return OTRcv(this, buf, nbytes, flagP); }
24295
24296
24297
24298         OSStatus SndUData(TUnitData* udata)
24299                     { return OTSndUData(this, udata); }
24300
24301         OSStatus RcvUData(TUnitData* udata, OTFlags* flagP)
24302                     { return OTRcvUData(this, udata, flagP); }
24303
24304         OSStatus RcvUDErr(TUDErr* uderr)
24305                     { return OTRcvUDErr(this, uderr); }
24306         OTResult CountDataBytes(OTByteCount* countPtr)
24307                     { return OTCountDataBytes(this, countPtr); }
24308 };
24309
24310
24311
24312
24313
24314
24315
24316 class TMapper : public TProvider
24317 {
24318     public:
24319         OSStatus RegisterName(TRegisterRequest* req, TRegisterReply* reply)
24320                     { return OTRegisterName(this, req, reply); }
24321
24322         OSStatus DeleteName(TNetbuf* name)
24323                     { return OTDeleteName(this, name); }
24324
24325         OSStatus DeleteName(OTNameID theID)
24326                     { return OTDeleteNameByID(this, theID); }
24327
24328         OSStatus LookupName(TLookupRequest* req, TLookupReply* reply)
24329                     { return OTLookupName(this, req, reply); }
24330 };
24331
24332
24333
24334 extern "C" {
24335
24336
24337 }
24338 extern "C" {
24339
24340
24341 typedef UInt16 InetPort;
24342 typedef UInt32 InetHost;
24343
24344
24345 enum {
24346   AF_DNS = 42
24347 };
24348
24349
24350
24351
24352
24353
24354
24355 enum {
24356   kOTAnyInetAddress = 0
24357 };
24358  typedef class TInternetServices* InetSvcRef;
24359 enum {
24360   INET_IP = 0x00,
24361   INET_TCP = 0x06,
24362   INET_UDP = 0x11
24363 };
24364
24365
24366
24367 enum {
24368   TCP_NODELAY = 0x01,
24369   TCP_MAXSEG = 0x02,
24370   TCP_NOTIFY_THRESHOLD = 0x10,
24371   TCP_ABORT_THRESHOLD = 0x11,
24372   TCP_CONN_NOTIFY_THRESHOLD = 0x12,
24373   TCP_CONN_ABORT_THRESHOLD = 0x13,
24374   TCP_OOBINLINE = 0x14,
24375   TCP_URGENT_PTR_TYPE = 0x15,
24376   TCP_KEEPALIVE = 0x0008
24377 };
24378 enum {
24379   T_GARBAGE = 2
24380 };
24381
24382
24383
24384 enum {
24385   UDP_CHECKSUM = 0x0600,
24386   UDP_RX_ICMP = 0x02
24387 };
24388 enum {
24389   kIP_OPTIONS = 0x01,
24390   kIP_TOS = 0x02,
24391   kIP_TTL = 0x03,
24392   kIP_REUSEADDR = 0x04,
24393   kIP_DONTROUTE = 0x10,
24394   kIP_BROADCAST = 0x20,
24395   kIP_REUSEPORT = 0x0200,
24396   kIP_HDRINCL = 0x1002,
24397   kIP_RCVOPTS = 0x1005,
24398   kIP_RCVDSTADDR = 0x1007,
24399   kIP_MULTICAST_IF = 0x1010,
24400   kIP_MULTICAST_TTL = 0x1011,
24401   kIP_MULTICAST_LOOP = 0x1012,
24402   kIP_ADD_MEMBERSHIP = 0x1013,
24403   kIP_DROP_MEMBERSHIP = 0x1014,
24404   kIP_BROADCAST_IFNAME = 0x1015,
24405   kIP_RCVIFADDR = 0x1016
24406 };
24407
24408
24409
24410
24411
24412
24413
24414 enum {
24415   DVMRP_INIT = 100,
24416   DVMRP_DONE = 101,
24417   DVMRP_ADD_VIF = 102,
24418   DVMRP_DEL_VIF = 103,
24419   DVMRP_ADD_LGRP = 104,
24420   DVMRP_DEL_LGRP = 105,
24421   DVMRP_ADD_MRT = 106,
24422   DVMRP_DEL_MRT = 107
24423 };
24424
24425
24426
24427
24428 enum {
24429   T_ROUTINE = 0,
24430   T_PRIORITY = 1,
24431   T_IMMEDIATE = 2,
24432   T_FLASH = 3,
24433   T_OVERRIDEFLASH = 4,
24434   T_CRITIC_ECP = 5,
24435   T_INETCONTROL = 6,
24436   T_NETCONTROL = 7
24437 };
24438
24439
24440
24441 enum {
24442   T_NOTOS = 0x00,
24443   T_LDELAY = (1 << 4),
24444   T_HITHRPT = (1 << 3),
24445   T_HIREL = (1 << 2)
24446 };
24447
24448
24449
24450
24451 struct TIPAddMulticast {
24452   InetHost multicastGroupAddress;
24453   InetHost interfaceAddress;
24454 };
24455 typedef struct TIPAddMulticast TIPAddMulticast;
24456
24457 enum {
24458   T_DNRSTRINGTOADDRCOMPLETE = kPRIVATEEVENT + 1,
24459   T_DNRADDRTONAMECOMPLETE = kPRIVATEEVENT + 2,
24460   T_DNRSYSINFOCOMPLETE = kPRIVATEEVENT + 3,
24461   T_DNRMAILEXCHANGECOMPLETE = kPRIVATEEVENT + 4,
24462   T_DNRQUERYCOMPLETE = kPRIVATEEVENT + 5
24463 };
24464
24465
24466
24467 struct InetAddress {
24468   OTAddressType fAddressType;
24469   InetPort fPort;
24470   InetHost fHost;
24471   UInt8 fUnused[8];
24472 };
24473 typedef struct InetAddress InetAddress;
24474
24475 enum {
24476   kMaxHostAddrs = 10,
24477   kMaxSysStringLen = 32,
24478   kMaxHostNameLen = 255
24479 };
24480
24481
24482 typedef char InetDomainName[256];
24483 struct InetHostInfo {
24484   InetDomainName name;
24485   InetHost addrs[10];
24486 };
24487 typedef struct InetHostInfo InetHostInfo;
24488 struct InetSysInfo {
24489   char cpuType[32];
24490   char osType[32];
24491 };
24492 typedef struct InetSysInfo InetSysInfo;
24493 struct InetMailExchange {
24494   UInt16 preference;
24495   InetDomainName exchange;
24496 };
24497 typedef struct InetMailExchange InetMailExchange;
24498 struct DNSQueryInfo {
24499   UInt16 qType;
24500   UInt16 qClass;
24501   UInt32 ttl;
24502   InetDomainName name;
24503   UInt16 responseType;
24504   UInt16 resourceLen;
24505   char resourceData[4];
24506 };
24507 typedef struct DNSQueryInfo DNSQueryInfo;
24508 struct DNSAddress {
24509   OTAddressType fAddressType;
24510   InetDomainName fName;
24511 };
24512 typedef struct DNSAddress DNSAddress;
24513
24514 enum {
24515   kDefaultInetInterface = -1
24516 };
24517
24518 enum {
24519   kInetInterfaceInfoVersion = 3
24520 };
24521
24522 struct InetInterfaceInfo {
24523   InetHost fAddress;
24524   InetHost fNetmask;
24525   InetHost fBroadcastAddr;
24526   InetHost fDefaultGatewayAddr;
24527   InetHost fDNSAddr;
24528   UInt16 fVersion;
24529   UInt16 fHWAddrLen;
24530   UInt8 * fHWAddr;
24531   UInt32 fIfMTU;
24532   UInt8 * fReservedPtrs[2];
24533   InetDomainName fDomainName;
24534   UInt32 fIPSecondaryCount;
24535   UInt8 fReserved[252];
24536 };
24537 typedef struct InetInterfaceInfo InetInterfaceInfo;
24538
24539 enum {
24540   kAllDHCPOptions = -1,
24541   kDHCPLongOption = 126,
24542   kDHCPLongOptionReq = 127
24543 };
24544
24545 struct InetDHCPOption {
24546   UInt8 fOptionTag;
24547   UInt8 fOptionLen;
24548   UInt8 fOptionValue;
24549 };
24550 typedef struct InetDHCPOption InetDHCPOption;
24551 extern void
24552 OTInitInetAddress(
24553   InetAddress * addr,
24554   InetPort port,
24555   InetHost host) ;
24556 extern OTByteCount
24557 OTInitDNSAddress(
24558   DNSAddress * addr,
24559   char * str) ;
24560 extern OSStatus
24561 OTInetStringToHost(
24562   const char * str,
24563   InetHost * host) ;
24564 extern void
24565 OTInetHostToString(
24566   InetHost host,
24567   char * str) ;
24568 extern OSStatus
24569 OTInetGetInterfaceInfo(
24570   InetInterfaceInfo * info,
24571   SInt32 val) ;
24572 extern OSStatus
24573 OTInetGetSecondaryAddresses(
24574   InetHost * addr,
24575   UInt32 * count,
24576   SInt32 val) ;
24577 extern InetSvcRef
24578 OTOpenInternetServicesInContext(
24579   OTConfigurationRef cfig,
24580   OTOpenFlags oflag,
24581   OSStatus * err,
24582   OTClientContextPtr clientContext) ;
24583 extern OSStatus
24584 OTAsyncOpenInternetServicesInContext(
24585   OTConfigurationRef cfig,
24586   OTOpenFlags oflag,
24587   OTNotifyUPP upp,
24588   void * contextPtr,
24589   OTClientContextPtr clientContext) ;
24590 extern OSStatus
24591 OTInetStringToAddress(
24592   InetSvcRef ref,
24593   char * name,
24594   InetHostInfo * hinfo) ;
24595 extern OSStatus
24596 OTInetAddressToName(
24597   InetSvcRef ref,
24598   InetHost addr,
24599   InetDomainName name) ;
24600 extern OSStatus
24601 OTInetSysInfo(
24602   InetSvcRef ref,
24603   char * name,
24604   InetSysInfo * sysinfo) ;
24605 extern OSStatus
24606 OTInetMailExchange(
24607   InetSvcRef ref,
24608   char * name,
24609   UInt16 * num,
24610   InetMailExchange * mx) ;
24611 extern OSStatus
24612 OTInetQuery(
24613   InetSvcRef ref,
24614   char * name,
24615   UInt16 qClass,
24616   UInt16 qType,
24617   char * buf,
24618   OTByteCount buflen,
24619   void ** argv,
24620   OTByteCount argvlen,
24621   OTFlags flags) ;
24622
24623
24624
24625 }
24626
24627 class TInternetServices : public TProvider
24628 {
24629     public:
24630             OSStatus StringToAddress(char* name, InetHostInfo* hinfo)
24631                         { return OTInetStringToAddress(this, name, hinfo); }
24632
24633             OSStatus AddressToName(InetHost addr, InetDomainName name)
24634                         { return OTInetAddressToName(this, addr, name); }
24635
24636             OSStatus SysInfo(char* name, InetSysInfo* sysinfo )
24637                         { return OTInetSysInfo(this, name, sysinfo); }
24638
24639             OSStatus MailExchange(char* name, UInt16* num, InetMailExchange* mx)
24640                         { return OTInetMailExchange(this, name, num, mx); }
24641
24642             OSStatus Query(char* name, UInt16 qClass, UInt16 qType,
24643                               char* buf, OTByteCount buflen,
24644                               void** argv, OTByteCount argvlen,
24645                               OTFlags flags)
24646                         { return OTInetQuery(this, name, qClass, qType, buf, buflen, argv, argvlen, flags); }
24647 };
24648
24649 extern "C" {
24650 enum {
24651   ATK_DDP = 'DDP ',
24652   ATK_AARP = 'AARP',
24653   ATK_ATP = 'ATP ',
24654   ATK_ADSP = 'ADSP',
24655   ATK_ASP = 'ASP ',
24656   ATK_PAP = 'PAP ',
24657   ATK_NBP = 'NBP ',
24658   ATK_ZIP = 'ZIP '
24659 };
24660 enum {
24661   DDP_OPT_HOPCOUNT = 0x2100
24662 };
24663
24664 enum {
24665   DDP_OPT_CHECKSUM = 0x0600,
24666   DDP_OPT_SRCADDR = 0x2101,
24667   ATP_OPT_REPLYCNT = 0x2110,
24668   ATP_OPT_DATALEN = 0x2111,
24669   ATP_OPT_RELTIMER = 0x2112,
24670   ATP_OPT_TRANID = 0x2113,
24671   PAP_OPT_OPENRETRY = 0x2120
24672 };
24673 enum {
24674   kAppleTalkEvent = kPROTOCOLEVENT | 0x00010000,
24675   T_GETMYZONECOMPLETE = kAppleTalkEvent + 1,
24676   T_GETLOCALZONESCOMPLETE = kAppleTalkEvent + 2,
24677   T_GETZONELISTCOMPLETE = kAppleTalkEvent + 3,
24678   T_GETATALKINFOCOMPLETE = kAppleTalkEvent + 4,
24679   T_ATALKROUTERDOWNEVENT = kAppleTalkEvent + 51,
24680   T_ATALKROUTERUPEVENT = kAppleTalkEvent + 52,
24681   T_ATALKZONENAMECHANGEDEVENT = kAppleTalkEvent + 53,
24682   T_ATALKCONNECTIVITYCHANGEDEVENT = kAppleTalkEvent + 54,
24683   T_ATALKINTERNETAVAILABLEEVENT = kAppleTalkEvent + 55,
24684   T_ATALKCABLERANGECHANGEDEVENT = kAppleTalkEvent + 56
24685 };
24686
24687 enum {
24688   T_ATALKBADROUTEREVENT = kAppleTalkEvent + 70,
24689   T_ALLNODESTAKENEVENT = kAppleTalkEvent + 71,
24690   T_FIXEDNODETAKENEVENT = kAppleTalkEvent + 72,
24691   T_MPPCOMPATCFIGEVENT = kAppleTalkEvent + 73,
24692   T_FIXEDNODEBADEVENT = kAppleTalkEvent + 74
24693 };
24694
24695 enum {
24696   kAllATalkRoutersDown = 0,
24697   kLocalATalkRoutersDown = -1L,
24698   kARARouterDisconnected = -2L
24699 };
24700
24701 enum {
24702   kARARouterOnline = -1L,
24703   kATalkRouterOnline = 0,
24704   kLocalATalkRouterOnline = -2L
24705 };
24706
24707
24708
24709
24710 enum {
24711   ATALK_IOC_FULLSELFSEND = ((MIOC_ATALK << 8) | 47),
24712   ADSP_IOC_FORWARDRESET = ((MIOC_ATALK << 8) | 60)
24713 };
24714
24715
24716
24717
24718
24719 enum {
24720   kECHO_TSDU = 585
24721 };
24722
24723
24724
24725 enum {
24726   kNBPMaxNameLength = 32,
24727   kNBPMaxTypeLength = 32,
24728   kNBPMaxZoneLength = 32,
24729   kNBPSlushLength = 9,
24730   kNBPMaxEntityLength = (kNBPMaxNameLength + kNBPMaxTypeLength + kNBPMaxZoneLength + 3),
24731   kNBPEntityBufferSize = (kNBPMaxNameLength + kNBPMaxTypeLength + kNBPMaxZoneLength + kNBPSlushLength),
24732   kNBPWildCard = 0x3D,
24733   kNBPImbeddedWildCard = 0xC5,
24734   kNBPDefaultZone = 0x2A
24735 };
24736
24737
24738
24739 enum {
24740   kZIPMaxZoneLength = kNBPMaxZoneLength
24741 };
24742
24743 enum {
24744   kDDPAddressLength = 8,
24745   kNBPAddressLength = kNBPEntityBufferSize,
24746   kAppleTalkAddressLength = kDDPAddressLength + kNBPEntityBufferSize
24747 };
24748     typedef class TAppleTalkServices* ATSvcRef;
24749 extern OSStatus
24750 OTAsyncOpenAppleTalkServicesInContext(
24751   OTConfigurationRef cfig,
24752   OTOpenFlags flags,
24753   OTNotifyUPP proc,
24754   void * contextPtr,
24755   OTClientContextPtr clientContext) ;
24756 extern ATSvcRef
24757 OTOpenAppleTalkServicesInContext(
24758   OTConfigurationRef cfig,
24759   OTOpenFlags flags,
24760   OSStatus * err,
24761   OTClientContextPtr clientContext) ;
24762 extern OSStatus
24763 OTATalkGetMyZone(
24764   ATSvcRef ref,
24765   TNetbuf * zone) ;
24766 extern OSStatus
24767 OTATalkGetLocalZones(
24768   ATSvcRef ref,
24769   TNetbuf * zones) ;
24770 extern OSStatus
24771 OTATalkGetZoneList(
24772   ATSvcRef ref,
24773   TNetbuf * zones) ;
24774 extern OSStatus
24775 OTATalkGetInfo(
24776   ATSvcRef ref,
24777   TNetbuf * info) ;
24778
24779
24780
24781 }
24782
24783 class TAppleTalkServices : public TProvider
24784 {
24785     public:
24786             OSStatus GetMyZone(TNetbuf* zone) { return OTATalkGetMyZone(this, zone); }
24787             OSStatus GetLocalZones(TNetbuf* zones) { return OTATalkGetLocalZones(this, zones); }
24788             OSStatus GetZoneList(TNetbuf* zones) { return OTATalkGetZoneList(this, zones); }
24789             OSStatus GetInfo(TNetbuf* info) { return OTATalkGetInfo(this, info); }
24790 };
24791
24792 extern "C" {
24793 enum {
24794   AF_ATALK_FAMILY = 0x0100,
24795   AF_ATALK_DDP = 0x0100,
24796   AF_ATALK_DDPNBP = AF_ATALK_FAMILY + 1,
24797   AF_ATALK_NBP = AF_ATALK_FAMILY + 2,
24798   AF_ATALK_MNODE = AF_ATALK_FAMILY + 3
24799 };
24800
24801 struct NBPEntity {
24802   UInt8 fEntity[99];
24803 };
24804 typedef struct NBPEntity NBPEntity;
24805 struct DDPAddress {
24806   OTAddressType fAddressType;
24807   UInt16 fNetwork;
24808   UInt8 fNodeID;
24809   UInt8 fSocket;
24810   UInt8 fDDPType;
24811   UInt8 fPad;
24812
24813
24814
24815
24816   void Init(const DDPAddress&);
24817    void Init(UInt16 net, UInt8 node, UInt8 socket);
24818     void Init(UInt16 net, UInt8 node, UInt8 socket, UInt8 type);
24819
24820    void SetSocket(UInt8);
24821   void SetType(UInt8);
24822     void SetNode(UInt8);
24823     void SetNetwork(UInt16);
24824
24825    OTByteCount GetAddressLength() const;
24826   OTAddressType GetAddressType() const;
24827     UInt8 GetSocket() const;
24828  UInt8 GetType() const;
24829    UInt8 GetNode() const;
24830    UInt16 GetNetwork() const;
24831
24832    Boolean operator==(const DDPAddress&) const;
24833    Boolean operator!=(const DDPAddress&) const;
24834    void operator=(const DDPAddress&);
24835
24836
24837
24838 };
24839 typedef struct DDPAddress DDPAddress;
24840 struct NBPAddress {
24841   OTAddressType fAddressType;
24842   UInt8 fNBPNameBuffer[105];
24843
24844
24845
24846
24847   OTByteCount Init();
24848     OTByteCount Init(const NBPEntity&);
24849     OTByteCount Init(const char*);
24850  OTByteCount Init(const char*, OTByteCount len);
24851     Boolean ExtractEntity(NBPEntity&, OTByteCount len);
24852
24853    OTAddressType GetAddressType() const;
24854
24855
24856
24857 };
24858 typedef struct NBPAddress NBPAddress;
24859 struct DDPNBPAddress {
24860   OTAddressType fAddressType;
24861   UInt16 fNetwork;
24862   UInt8 fNodeID;
24863   UInt8 fSocket;
24864   UInt8 fDDPType;
24865   UInt8 fPad;
24866   UInt8 fNBPNameBuffer[105];
24867
24868
24869
24870
24871   void Init(const DDPAddress&);
24872    void Init(UInt16 net, UInt8 node, UInt8 socket);
24873     void Init(UInt16 net, UInt8 node, UInt8 socket, UInt8 type);
24874
24875    void SetSocket(UInt8);
24876   void SetType(UInt8);
24877     void SetNode(UInt8);
24878     void SetNetwork(UInt16);
24879
24880    OTAddressType GetAddressType() const;
24881     UInt8 GetSocket() const;
24882  UInt8 GetType() const;
24883    UInt8 GetNode() const;
24884    UInt16 GetNetwork() const;
24885
24886    Boolean ExtractEntity(NBPEntity&, OTByteCount len);
24887     OTByteCount SetNBPEntity(const NBPEntity&);
24888     OTByteCount SetNBPEntity(const char*);
24889  OTByteCount SetNBPEntity(const char*, OTByteCount len);
24890
24891    Boolean operator==(const DDPAddress&) const;
24892
24893
24894
24895 };
24896 typedef struct DDPNBPAddress DDPNBPAddress;
24897 extern void
24898 OTInitDDPAddress(
24899   DDPAddress * addr,
24900   UInt16 net,
24901   UInt8 node,
24902   UInt8 socket,
24903   UInt8 ddpType) ;
24904 extern OTByteCount
24905 OTInitNBPAddress(
24906   NBPAddress * addr,
24907   const char * name) ;
24908 extern OTByteCount
24909 OTInitDDPNBPAddress(
24910   DDPNBPAddress * addr,
24911   const char * name,
24912   UInt16 net,
24913   UInt8 node,
24914   UInt8 socket,
24915   UInt8 ddpType) ;
24916 extern Boolean
24917 OTCompareDDPAddresses(
24918   const DDPAddress * addr1,
24919   const DDPAddress * addr2) ;
24920 extern void
24921 OTInitNBPEntity(NBPEntity * entity) ;
24922 extern OTByteCount
24923 OTGetNBPEntityLengthAsAddress(const NBPEntity * entity) ;
24924 extern OTByteCount
24925 OTSetAddressFromNBPEntity(
24926   UInt8 * nameBuf,
24927   const NBPEntity * entity) ;
24928 extern OTByteCount
24929 OTSetAddressFromNBPString(
24930   UInt8 * addrBuf,
24931   const char * name,
24932   SInt32 len) ;
24933 extern Boolean
24934 OTSetNBPEntityFromAddress(
24935   NBPEntity * entity,
24936   const UInt8 * addrBuf,
24937   OTByteCount len) ;
24938 extern Boolean
24939 OTSetNBPName(
24940   NBPEntity * entity,
24941   const char * name) ;
24942 extern Boolean
24943 OTSetNBPType(
24944   NBPEntity * entity,
24945   const char * typeVal) ;
24946 extern Boolean
24947 OTSetNBPZone(
24948   NBPEntity * entity,
24949   const char * zone) ;
24950 extern void
24951 OTExtractNBPName(
24952   const NBPEntity * entity,
24953   char * name) ;
24954 extern void
24955 OTExtractNBPType(
24956   const NBPEntity * entity,
24957   char * typeVal) ;
24958 extern void
24959 OTExtractNBPZone(
24960   const NBPEntity * entity,
24961   char * zone) ;
24962
24963
24964
24965
24966
24967
24968 inline void DDPAddress::operator=(const DDPAddress& addr)
24969 {
24970     *(UInt32*)&fAddressType = *(UInt32*)&addr.fAddressType;
24971     *(UInt32*)&fNodeID = *(UInt32*)&addr.fNodeID;
24972 }
24973
24974 inline Boolean DDPAddress::operator==(const DDPAddress& addr) const
24975 {
24976     return OTCompareDDPAddresses(&addr, this);
24977 }
24978
24979 inline Boolean DDPAddress::operator!=(const DDPAddress& addr) const
24980 {
24981     return !OTCompareDDPAddresses(&addr, this);
24982 }
24983
24984 inline void DDPAddress::SetSocket(UInt8 socket)
24985 {
24986     fSocket = socket;
24987 }
24988
24989 inline void DDPAddress::SetNode(UInt8 node)
24990 {
24991     fNodeID = node;
24992 }
24993
24994 inline void DDPAddress::SetType(UInt8 type)
24995 {
24996     fDDPType = type;
24997 }
24998
24999 inline void DDPAddress::SetNetwork(UInt16 net)
25000 {
25001     fNetwork = net;
25002 }
25003
25004 inline OTByteCount DDPAddress::GetAddressLength() const
25005 {
25006     return kDDPAddressLength;
25007 }
25008
25009 inline OTAddressType DDPAddress::GetAddressType() const
25010 {
25011     return fAddressType;
25012 }
25013
25014 inline UInt8 DDPAddress::GetSocket() const
25015 {
25016     return fSocket;
25017 }
25018
25019 inline UInt8 DDPAddress::GetNode() const
25020 {
25021     return fNodeID;
25022 }
25023
25024 inline UInt8 DDPAddress::GetType() const
25025 {
25026     return fDDPType;
25027 }
25028
25029 inline UInt16 DDPAddress::GetNetwork() const
25030 {
25031     return fNetwork;
25032 }
25033
25034 inline void DDPAddress::Init(UInt16 net, UInt8 node,
25035                               UInt8 socket)
25036 {
25037     fAddressType = AF_ATALK_DDP;
25038     SetNetwork(net);
25039     SetNode(node);
25040     SetSocket(socket);
25041     SetType(0);
25042 }
25043
25044 inline void DDPAddress::Init(UInt16 net, UInt8 node,
25045                               UInt8 socket, UInt8 type)
25046 {
25047     fAddressType = AF_ATALK_DDP;
25048     SetNetwork(net);
25049     SetNode(node);
25050     SetSocket(socket);
25051     SetType(type);
25052 }
25053
25054 inline void DDPAddress::Init(const DDPAddress& addr)
25055 {
25056     *(UInt32*)&fAddressType = *(UInt32*)&addr.fAddressType;
25057     *(UInt32*)&fNodeID = *(UInt32*)&addr.fNodeID;
25058 }
25059
25060
25061
25062 inline OTByteCount NBPAddress::Init()
25063 {
25064     fAddressType = AF_ATALK_NBP;
25065     return sizeof(OTAddressType);
25066 }
25067
25068 inline OTByteCount NBPAddress::Init(const NBPEntity& addr)
25069 {
25070     fAddressType = AF_ATALK_NBP;
25071     return sizeof(OTAddressType) + OTSetAddressFromNBPEntity(fNBPNameBuffer, &addr);
25072 }
25073
25074 inline OTByteCount NBPAddress::Init(const char* name)
25075 {
25076     fAddressType = AF_ATALK_NBP;
25077     return sizeof(OTAddressType) + OTSetAddressFromNBPString(fNBPNameBuffer, name, -1);
25078 }
25079
25080 inline OTByteCount NBPAddress::Init(const char* name, OTByteCount len)
25081 {
25082     fAddressType = AF_ATALK_NBP;
25083     return sizeof(OTAddressType) + OTSetAddressFromNBPString(fNBPNameBuffer, name, (SInt32)len);
25084 }
25085
25086 inline Boolean NBPAddress::ExtractEntity(NBPEntity& entity, OTByteCount len)
25087 {
25088     return OTSetNBPEntityFromAddress(&entity, fNBPNameBuffer, len);
25089 }
25090
25091 inline OTAddressType NBPAddress::GetAddressType() const
25092 {
25093     return fAddressType;
25094 }
25095
25096
25097
25098 inline Boolean DDPNBPAddress::operator==(const DDPAddress& addr) const
25099 {
25100     return OTCompareDDPAddresses((const DDPAddress*)this, &addr);
25101 }
25102
25103 inline void DDPNBPAddress::SetSocket(UInt8 socket)
25104 {
25105     fSocket = socket;
25106 }
25107
25108 inline void DDPNBPAddress::SetNode(UInt8 node)
25109 {
25110     fNodeID = node;
25111 }
25112
25113 inline void DDPNBPAddress::SetType(UInt8 type)
25114 {
25115     fDDPType = type;
25116 }
25117
25118 inline void DDPNBPAddress::SetNetwork(UInt16 net)
25119 {
25120     fNetwork = net;
25121 }
25122
25123 inline OTAddressType DDPNBPAddress::GetAddressType() const
25124 {
25125     return fAddressType;
25126 }
25127
25128 inline UInt8 DDPNBPAddress::GetSocket() const
25129 {
25130     return fSocket;
25131 }
25132
25133 inline UInt8 DDPNBPAddress::GetNode() const
25134 {
25135     return fNodeID;
25136 }
25137
25138 inline UInt8 DDPNBPAddress::GetType() const
25139 {
25140     return fDDPType;
25141 }
25142
25143 inline UInt16 DDPNBPAddress::GetNetwork() const
25144 {
25145     return fNetwork;
25146 }
25147
25148 inline void DDPNBPAddress::Init(UInt16 net, UInt8 node,
25149                                 UInt8 socket)
25150 {
25151     fAddressType = AF_ATALK_DDPNBP;
25152     SetNetwork(net);
25153     SetNode(node);
25154     SetSocket(socket);
25155     SetType(0);
25156 }
25157
25158 inline void DDPNBPAddress::Init(UInt16 net, UInt8 node,
25159                                 UInt8 socket, UInt8 type)
25160 {
25161     fAddressType = AF_ATALK_DDPNBP;
25162     SetNetwork(net);
25163     SetNode(node);
25164     SetSocket(socket);
25165     SetType(type);
25166 }
25167
25168 inline void DDPNBPAddress::Init(const DDPAddress& addr)
25169 {
25170     fAddressType = AF_ATALK_DDPNBP;
25171     SetNetwork(addr.GetNetwork());
25172     SetNode(addr.GetNode());
25173     SetSocket(addr.GetSocket());
25174     SetType(addr.GetType());
25175     fNBPNameBuffer[0] = 0;
25176 }
25177
25178 inline OTByteCount DDPNBPAddress::SetNBPEntity(const NBPEntity& entity)
25179 {
25180     return OTSetAddressFromNBPEntity(fNBPNameBuffer, &entity) + kDDPAddressLength;
25181 }
25182
25183 inline OTByteCount DDPNBPAddress::SetNBPEntity(const char* name)
25184 {
25185     return OTSetAddressFromNBPString(fNBPNameBuffer, name, -1) + kDDPAddressLength;
25186 }
25187
25188 inline OTByteCount DDPNBPAddress::SetNBPEntity(const char* name, OTByteCount len)
25189 {
25190     return OTSetAddressFromNBPString(fNBPNameBuffer, name, (SInt32)len) + kDDPAddressLength;
25191 }
25192
25193 inline Boolean DDPNBPAddress::ExtractEntity(NBPEntity& entity, OTByteCount len)
25194 {
25195     return OTSetNBPEntityFromAddress(&entity, fNBPNameBuffer, len);
25196 }
25197
25198
25199
25200
25201 struct AppleTalkInfo {
25202   DDPAddress fOurAddress;
25203   DDPAddress fRouterAddress;
25204   UInt16 fCableRange[2];
25205   UInt16 fFlags;
25206 };
25207 typedef struct AppleTalkInfo AppleTalkInfo;
25208
25209 enum {
25210   kATalkInfoIsExtended = 0x0001,
25211   kATalkInfoHasRouter = 0x0002,
25212   kATalkInfoOneZone = 0x0004
25213 };
25214
25215
25216
25217
25218
25219
25220
25221 enum {
25222   kOTFramingEthernet = 0x01,
25223   kOTFramingEthernetIPX = 0x02,
25224   kOTFraming8023 = 0x04,
25225   kOTFraming8022 = 0x08
25226 };
25227 enum {
25228   kOTRawRcvOn = 0,
25229   kOTRawRcvOff = 1,
25230   kOTRawRcvOnWithTimeStamp = 2
25231 };
25232
25233 enum {
25234   DL_PROMISC_OFF = 0
25235 };
25236
25237
25238
25239
25240
25241 enum {
25242   kT8022ModuleID = 7100,
25243   kEnetModuleID = 7101,
25244   kTokenRingModuleID = 7102,
25245   kFDDIModuleID = 7103
25246 };
25247 enum {
25248   AF_8022 = 8200
25249 };
25250
25251
25252
25253 enum {
25254   LNK_ENET = 'ENET',
25255   LNK_TOKN = 'TOKN',
25256   LNK_FDDI = 'FDDI',
25257   LNK_TPI = 'LTPI'
25258 };
25259
25260
25261
25262 enum {
25263   OPT_ADDMCAST = 0x1000,
25264   OPT_DELMCAST = 0x1001,
25265   OPT_RCVPACKETTYPE = 0x1002,
25266   OPT_RCVDESTADDR = 0x1003,
25267   OPT_SETRAWMODE = 0x1004,
25268   OPT_SETPROMISCUOUS = 0x1005
25269 };
25270
25271 typedef UInt32 OTPacketType;
25272 enum {
25273   kETypeStandard = 0,
25274   kETypeMulticast = 1,
25275   kETypeBroadcast = 2,
25276   kETRawPacketBit = (unsigned long)0x80000000,
25277   kETTimeStampBit = 0x40000000
25278 };
25279
25280
25281
25282 enum {
25283   kMulticastLength = 6,
25284   k48BitAddrLength = 6,
25285   k8022DLSAPLength = 2,
25286   k8022SNAPLength = 5,
25287   kEnetAddressLength = k48BitAddrLength + k8022DLSAPLength,
25288
25289   kSNAPSAP = 0x00AA,
25290   kIPXSAP = 0x00FF,
25291   kMax8022SAP = 0x00FE,
25292   k8022GlobalSAP = 0x00FF,
25293   kMinDIXSAP = 1501,
25294   kMaxDIXSAP = 0xFFFF
25295 };
25296
25297
25298
25299 struct T8022Address {
25300   OTAddressType fAddrFamily;
25301   UInt8 fHWAddr[6];
25302   UInt16 fSAP;
25303   UInt8 fSNAP[5];
25304 };
25305 typedef struct T8022Address T8022Address;
25306 enum {
25307   k8022BasicAddressLength = sizeof(OTAddressType) + k48BitAddrLength + sizeof(UInt16),
25308   k8022SNAPAddressLength = sizeof(OTAddressType) + k48BitAddrLength + sizeof(UInt16) + k8022SNAPLength
25309 };
25310 enum {
25311   kEnetPacketHeaderLength = (2 * k48BitAddrLength) + k8022DLSAPLength,
25312   kEnetTSDU = 1514,
25313   kTokenRingTSDU = 4458,
25314   kFDDITSDU = 4458,
25315   k8022SAPLength = 1,
25316   k8022BasicHeaderLength = 3,
25317
25318   k8022SNAPHeaderLength = k8022SNAPLength + k8022BasicHeaderLength
25319 };
25320
25321
25322
25323
25324 typedef UInt32 EAddrType;
25325 enum {
25326   keaStandardAddress = 0,
25327   keaMulticast = 1,
25328   keaBroadcast = 2,
25329   keaBadAddress = 3,
25330   keaRawPacketBit = (unsigned long)0x80000000,
25331   keaTimeStampBit = 0x40000000
25332 };
25333
25334
25335
25336 struct EnetPacketHeader {
25337   UInt8 fDestAddr[6];
25338   UInt8 fSourceAddr[6];
25339   UInt16 fProto;
25340 };
25341 typedef struct EnetPacketHeader EnetPacketHeader;
25342 struct T8022Header {
25343   UInt8 fDSAP;
25344   UInt8 fSSAP;
25345   UInt8 fCtrl;
25346 };
25347 typedef struct T8022Header T8022Header;
25348 struct T8022SNAPHeader {
25349   UInt8 fDSAP;
25350   UInt8 fSSAP;
25351   UInt8 fCtrl;
25352   UInt8 fSNAP[5];
25353 };
25354 typedef struct T8022SNAPHeader T8022SNAPHeader;
25355 struct T8022FullPacketHeader {
25356   EnetPacketHeader fEnetPart;
25357   T8022SNAPHeader f8022Part;
25358 };
25359 typedef struct T8022FullPacketHeader T8022FullPacketHeader;
25360
25361 enum {
25362   kT8022HeaderLength = 3,
25363   kT8022SNAPHeaderLength = 3 + k8022SNAPLength,
25364   kT8022FullPacketHeaderLength = kEnetPacketHeaderLength + kT8022SNAPHeaderLength
25365 };
25366
25367
25368
25369
25370
25371
25372
25373 enum {
25374   COM_SERIAL = 'SERL'
25375 };
25376 enum {
25377   kSerialABModuleID = 7200
25378 };
25379
25380 enum {
25381   kOTSerialFramingAsync = 0x01,
25382   kOTSerialFramingHDLC = 0x02,
25383   kOTSerialFramingSDLC = 0x04,
25384   kOTSerialFramingAsyncPackets = 0x08,
25385   kOTSerialFramingPPP = 0x10
25386 };
25387
25388
25389
25390 enum {
25391   I_SetSerialDTR = ((MIOC_SRL << 8) | 0),
25392   kOTSerialSetDTROff = 0,
25393   kOTSerialSetDTROn = 1,
25394   I_SetSerialBreak = ((MIOC_SRL << 8) | 1),
25395
25396
25397   kOTSerialSetBreakOn = (unsigned long)0xFFFFFFFF,
25398   kOTSerialSetBreakOff = 0,
25399   I_SetSerialXOffState = ((MIOC_SRL << 8) | 2),
25400   kOTSerialForceXOffTrue = 1,
25401   kOTSerialForceXOffFalse = 0,
25402   I_SetSerialXOn = ((MIOC_SRL << 8) | 3),
25403   kOTSerialSendXOnAlways = 1,
25404   kOTSerialSendXOnIfXOffTrue = 0,
25405   I_SetSerialXOff = ((MIOC_SRL << 8) | 4),
25406   kOTSerialSendXOffAlways = 1,
25407   kOTSerialSendXOffIfXOnTrue = 0
25408 };
25409 enum {
25410   SERIAL_OPT_BAUDRATE = 0x0100,
25411   SERIAL_OPT_DATABITS = 0x0101,
25412   SERIAL_OPT_STOPBITS = 0x0102,
25413   SERIAL_OPT_PARITY = 0x0103,
25414   SERIAL_OPT_STATUS = 0x0104,
25415
25416
25417   SERIAL_OPT_HANDSHAKE = 0x0105,
25418
25419
25420
25421
25422
25423   SERIAL_OPT_RCVTIMEOUT = 0x0106,
25424
25425
25426
25427
25428
25429
25430   SERIAL_OPT_ERRORCHARACTER = 0x0107,
25431   SERIAL_OPT_EXTCLOCK = 0x0108,
25432
25433
25434
25435   SERIAL_OPT_BURSTMODE = 0x0109,
25436
25437
25438   SERIAL_OPT_DUMMY = 0x010A
25439 };
25440
25441 typedef UInt32 ParityOptionValues;
25442 enum {
25443   kOTSerialNoParity = 0,
25444   kOTSerialOddParity = 1,
25445   kOTSerialEvenParity = 2
25446 };
25447
25448 enum {
25449   kOTSerialSwOverRunErr = 0x01,
25450   kOTSerialBreakOn = 0x08,
25451   kOTSerialParityErr = 0x10,
25452   kOTSerialOverrunErr = 0x20,
25453   kOTSerialFramingErr = 0x40,
25454   kOTSerialXOffSent = 0x00010000,
25455   kOTSerialDTRNegated = 0x00020000,
25456   kOTSerialCTLHold = 0x00040000,
25457   kOTSerialXOffHold = 0x00080000,
25458   kOTSerialOutputBreakOn = 0x01000000
25459 };
25460
25461 enum {
25462   kOTSerialXOnOffInputHandshake = 1,
25463   kOTSerialXOnOffOutputHandshake = 2,
25464   kOTSerialCTSInputHandshake = 4,
25465   kOTSerialDTROutputHandshake = 8
25466 };
25467
25468
25469
25470
25471    inline UInt32 OTSerialHandshakeData(UInt16 type, UInt8 onChar, UInt8 offChar)
25472   {
25473       return (((UInt32)type) << 16) | (((UInt32)onChar) << 8) | offChar;
25474  }
25475 inline UInt32 OTSerialSetErrorCharacter(UInt8 rep)
25476 {
25477   return (UInt32)rep & 0x000000ff;
25478 }
25479
25480 inline UInt32 OTSerialSetErrorCharacterWithAlternate(UInt8 rep, UInt8 alternate)
25481 {
25482  return (((rep & 0xff) | ((alternate & 0xff) << 8)) | 0x80000000L);
25483 }
25484 enum {
25485   kOTSerialDefaultBaudRate = 19200,
25486   kOTSerialDefaultDataBits = 8,
25487   kOTSerialDefaultStopBits = 10,
25488   kOTSerialDefaultParity = kOTSerialNoParity,
25489   kOTSerialDefaultHandshake = 0,
25490   kOTSerialDefaultOnChar = ('Q' & 0xFFFFFFBF),
25491   kOTSerialDefaultOffChar = ('S' & 0xFFFFFFBF),
25492   kOTSerialDefaultSndBufSize = 1024,
25493   kOTSerialDefaultRcvBufSize = 1024,
25494   kOTSerialDefaultSndLoWat = 96,
25495   kOTSerialDefaultRcvLoWat = 1,
25496   kOTSerialDefaultRcvTimeout = 10
25497 };
25498
25499
25500
25501
25502
25503
25504
25505 enum {
25506   COM_ISDN = 'ISDN'
25507 };
25508
25509
25510
25511
25512 enum {
25513   kISDNModuleID = 7300
25514 };
25515
25516
25517
25518
25519 enum {
25520   kOTISDNFramingTransparentSupported = 0x0010,
25521   kOTISDNFramingHDLCSupported = 0x0020,
25522   kOTISDNFramingV110Supported = 0x0040,
25523   kOTISDNFramingV14ESupported = 0x0080
25524 };
25525
25526
25527
25528
25529
25530 enum {
25531   kOTISDNUnallocatedNumber = 1,
25532   kOTISDNNoRouteToSpecifiedTransitNetwork = 2,
25533   kOTISDNNoRouteToDestination = 3,
25534   kOTISDNChannelUnacceptable = 6,
25535   kOTISDNNormal = 16,
25536   kOTISDNUserBusy = 17,
25537   kOTISDNNoUserResponding = 18,
25538   kOTISDNNoAnswerFromUser = 19,
25539   kOTISDNCallRejected = 21,
25540   kOTISDNNumberChanged = 22,
25541   kOTISDNNonSelectedUserClearing = 26,
25542   kOTISDNDestinationOutOfOrder = 27,
25543   kOTISDNInvalidNumberFormat = 28,
25544   kOTISDNFacilityRejected = 29,
25545   kOTISDNNormalUnspecified = 31,
25546   kOTISDNNoCircuitChannelAvailable = 34,
25547   kOTISDNNetworkOutOfOrder = 41,
25548   kOTISDNSwitchingEquipmentCongestion = 42,
25549   kOTISDNAccessInformationDiscarded = 43,
25550   kOTISDNRequestedCircuitChannelNotAvailable = 44,
25551   kOTISDNResourceUnavailableUnspecified = 45,
25552   kOTISDNQualityOfServiceUnvailable = 49,
25553   kOTISDNRequestedFacilityNotSubscribed = 50,
25554   kOTISDNBearerCapabilityNotAuthorized = 57,
25555   kOTISDNBearerCapabilityNotPresentlyAvailable = 58,
25556   kOTISDNCallRestricted = 59,
25557   kOTISDNServiceOrOptionNotAvilableUnspecified = 63,
25558   kOTISDNBearerCapabilityNotImplemented = 65,
25559   kOTISDNRequestedFacilityNotImplemented = 69,
25560   kOTISDNOnlyRestrictedDigitalBearer = 70,
25561   kOTISDNServiceOrOptionNotImplementedUnspecified = 79,
25562   kOTISDNCallIdentityNotUsed = 83,
25563   kOTISDNCallIdentityInUse = 84,
25564   kOTISDNNoCallSuspended = 85,
25565   kOTISDNCallIdentityCleared = 86,
25566   kOTISDNIncompatibleDestination = 88,
25567   kOTISDNInvalidTransitNetworkSelection = 91,
25568   kOTISDNInvalidMessageUnspecified = 95,
25569   kOTISDNMandatoryInformationElementIsMissing = 96,
25570   kOTISDNMessageTypeNonExistentOrNotImplemented = 97,
25571   kOTISDNInterworkingUnspecified = 127
25572 };
25573 enum {
25574   kAF_ISDN = 0x2000
25575 };
25576
25577
25578 enum {
25579   kOTISDNMaxPhoneSize = 32,
25580   kOTISDNMaxSubSize = 4
25581 };
25582
25583 struct OTISDNAddress {
25584   OTAddressType fAddressType;
25585   UInt16 fPhoneLength;
25586   char fPhoneNumber[37];
25587 };
25588 typedef struct OTISDNAddress OTISDNAddress;
25589
25590
25591
25592 enum {
25593   MIOC_ISDN = 'U'
25594 };
25595
25596 enum {
25597   I_OTISDNAlerting = ((MIOC_ISDN << 8) | 100),
25598   I_OTISDNSuspend = ((MIOC_ISDN << 8) | 101),
25599
25600   I_OTISDNSuspendAcknowledge = ((MIOC_ISDN << 8) | 102),
25601   I_OTISDNSuspendReject = ((MIOC_ISDN << 8) | 103),
25602   I_OTISDNResume = ((MIOC_ISDN << 8) | 104),
25603
25604   I_OTISDNResumeAcknowledge = ((MIOC_ISDN << 8) | 105),
25605   I_OTISDNResumeReject = ((MIOC_ISDN << 8) | 106),
25606   I_OTISDNFaciltity = ((MIOC_ISDN << 8) | 107)
25607 };
25608
25609
25610
25611 enum {
25612   kOTISDNMaxUserDataSize = 32
25613 };
25614
25615
25616
25617 enum {
25618   ISDN_OPT_COMMTYPE = 0x0200,
25619   ISDN_OPT_FRAMINGTYPE = 0x0201,
25620   ISDN_OPT_56KADAPTATION = 0x0202
25621 };
25622
25623
25624
25625 enum {
25626   kOTISDNTelephoneALaw = 1,
25627   kOTISDNTelephoneMuLaw = 26,
25628   kOTISDNDigital64k = 13,
25629   kOTISDNDigital56k = 37,
25630   kOTISDNVideo64k = 41,
25631   kOTISDNVideo56k = 42
25632 };
25633
25634
25635
25636 enum {
25637   kOTISDNFramingTransparent = 0x0010,
25638   kOTISDNFramingHDLC = 0x0020,
25639   kOTISDNFramingV110 = 0x0040,
25640   kOTISDNFramingV14E = 0x0080
25641 };
25642
25643
25644
25645 enum {
25646   kOTISDNNot56KAdaptation = false,
25647   kOTISDN56KAdaptation = true
25648 };
25649
25650
25651
25652 enum {
25653   kOTISDNDefaultCommType = kOTISDNDigital64k,
25654   kOTISDNDefaultFramingType = kOTISDNFramingHDLC,
25655   kOTISDNDefault56KAdaptation = kOTISDNNot56KAdaptation
25656 };
25657 enum {
25658   COM_PPP = 'PPPC'
25659 };
25660
25661
25662
25663 enum {
25664   kPPPMaxIDLength = 255,
25665   kPPPMaxPasswordLength = 255,
25666   kPPPMaxDTEAddressLength = 127,
25667   kPPPMaxCallInfoLength = 255
25668 };
25669
25670
25671
25672
25673 enum {
25674   kPPPStateInitial = 1,
25675   kPPPStateClosed = 2,
25676   kPPPStateClosing = 3,
25677   kPPPStateOpening = 4,
25678   kPPPStateOpened = 5
25679 };
25680
25681 enum {
25682   kPPPConnectionStatusIdle = 1,
25683   kPPPConnectionStatusConnecting = 2,
25684   kPPPConnectionStatusConnected = 3,
25685   kPPPConnectionStatusDisconnecting = 4
25686 };
25687
25688 enum {
25689   kPPPMinMRU = 0,
25690   kPPPMaxMRU = 4500
25691 };
25692
25693 enum {
25694   kIPCPTCPHdrCompressionDisabled = 0,
25695   kIPCPTCPHdrCompressionEnabled = 1
25696 };
25697
25698 enum {
25699   kPPPCompressionDisabled = 0x00000000,
25700   kPPPProtoCompression = 0x00000001,
25701   kPPPAddrCompression = 0x00000002
25702 };
25703
25704 enum {
25705   kPPPNoOutAuthentication = 0,
25706   kPPPCHAPOrPAPOutAuthentication = 1
25707 };
25708
25709 enum {
25710   kCCReminderTimerDisabled = 0,
25711   kCCIPIdleTimerDisabled = 0
25712 };
25713
25714 enum {
25715   kPPPScriptTypeModem = 1,
25716   kPPPScriptTypeConnect = 2,
25717   kPPPMaxScriptSize = 32000
25718 };
25719
25720 enum {
25721   kE164Address = 1,
25722   kPhoneAddress = 1,
25723   kCompoundPhoneAddress = 2,
25724   kX121Address = 3
25725 };
25726
25727 enum {
25728   kPPPConnectionStatusDialogsFlag = 0x00000001,
25729   kPPPConnectionRemindersFlag = 0x00000002,
25730   kPPPConnectionFlashingIconFlag = 0x00000004,
25731   kPPPOutPasswordDialogsFlag = 0x00000008,
25732   kPPPAllAlertsDisabledFlag = 0x00000000,
25733   kPPPAllAlertsEnabledFlag = 0x0000000F
25734 };
25735
25736 enum {
25737   kPPPAsyncMapCharsNone = 0x00000000,
25738   kPPPAsyncMapCharsXOnXOff = 0x000A0000,
25739   kPPPAsyncMapCharsAll = (unsigned long)0xFFFFFFFF
25740 };
25741
25742
25743
25744
25745 enum {
25746   IPCP_OPT_GETREMOTEPROTOADDR = 0x00007000,
25747   IPCP_OPT_GETLOCALPROTOADDR = 0x00007001,
25748   IPCP_OPT_TCPHDRCOMPRESSION = 0x00007002,
25749   LCP_OPT_PPPCOMPRESSION = 0x00007003,
25750   LCP_OPT_MRU = 0x00007004,
25751   LCP_OPT_RCACCMAP = 0x00007005,
25752   LCP_OPT_TXACCMAP = 0x00007006,
25753   SEC_OPT_OUTAUTHENTICATION = 0x00007007,
25754   SEC_OPT_ID = 0x00007008,
25755   SEC_OPT_PASSWORD = 0x00007009,
25756   CC_OPT_REMINDERTIMER = 0x00007010,
25757   CC_OPT_IPIDLETIMER = 0x00007011,
25758   CC_OPT_DTEADDRESSTYPE = 0x00007012,
25759   CC_OPT_DTEADDRESS = 0x00007013,
25760   CC_OPT_CALLINFO = 0x00007014,
25761   CC_OPT_GETMISCINFO = 0x00007015,
25762   PPP_OPT_GETCURRENTSTATE = 0x00007016,
25763   LCP_OPT_ECHO = 0x00007017,
25764   CC_OPT_SERIALPORTNAME = 0x00007200
25765 };
25766
25767
25768
25769 enum {
25770   kPPPEvent = kPROTOCOLEVENT | 0x000F0000,
25771   kPPPConnectCompleteEvent = kPPPEvent + 1,
25772   kPPPSetScriptCompleteEvent = kPPPEvent + 2,
25773   kPPPDisconnectCompleteEvent = kPPPEvent + 3,
25774   kPPPDisconnectEvent = kPPPEvent + 4,
25775   kPPPIPCPUpEvent = kPPPEvent + 5,
25776   kPPPIPCPDownEvent = kPPPEvent + 6,
25777   kPPPLCPUpEvent = kPPPEvent + 7,
25778   kPPPLCPDownEvent = kPPPEvent + 8,
25779   kPPPLowerLayerUpEvent = kPPPEvent + 9,
25780   kPPPLowerLayerDownEvent = kPPPEvent + 10,
25781   kPPPAuthenticationStartedEvent = kPPPEvent + 11,
25782   kPPPAuthenticationFinishedEvent = kPPPEvent + 12,
25783   kPPPDCEInitStartedEvent = kPPPEvent + 13,
25784   kPPPDCEInitFinishedEvent = kPPPEvent + 14,
25785   kPPPDCECallStartedEvent = kPPPEvent + 15,
25786   kPPPDCECallFinishedEvent = kPPPEvent + 16
25787 };
25788 struct PPPMRULimits {
25789   UInt32 mruSize;
25790   UInt32 upperMRULimit;
25791   UInt32 lowerMRULimit;
25792 };
25793 typedef struct PPPMRULimits PPPMRULimits;
25794
25795
25796
25797
25798 struct CCMiscInfo {
25799   UInt32 connectionStatus;
25800   UInt32 connectionTimeElapsed;
25801   UInt32 connectionTimeRemaining;
25802   UInt32 bytesTransmitted;
25803   UInt32 bytesReceived;
25804   UInt32 reserved;
25805 };
25806 typedef struct CCMiscInfo CCMiscInfo;
25807
25808
25809
25810
25811
25812
25813 struct LCPEcho {
25814   UInt32 retryCount;
25815   UInt32 retryPeriod;
25816 };
25817 typedef struct LCPEcho LCPEcho;
25818
25819
25820
25821
25822 enum {
25823   kRAProductClientOnly = 2,
25824   kRAProductOnePortServer = 3,
25825   kRAProductManyPortServer = 4
25826 };
25827
25828
25829
25830
25831
25832
25833
25834
25835
25836 }
25837 extern "C" {
25838
25839
25840 enum {
25841   I_NREAD = ((MIOC_STREAMIO << 8) | 1),
25842   I_PUSH = ((MIOC_STREAMIO << 8) | 2),
25843   I_POP = ((MIOC_STREAMIO << 8) | 3),
25844   I_LOOK = ((MIOC_STREAMIO << 8) | 4),
25845   I_FLUSH = ((MIOC_STREAMIO << 8) | 5),
25846   I_SRDOPT = ((MIOC_STREAMIO << 8) | 6),
25847   I_GRDOPT = ((MIOC_STREAMIO << 8) | 7),
25848   I_STR = ((MIOC_STREAMIO << 8) | 8),
25849   I_SETSIG = ((MIOC_STREAMIO << 8) | 9),
25850   I_GETSIG = ((MIOC_STREAMIO << 8) | 10),
25851   I_FIND = ((MIOC_STREAMIO << 8) | 11),
25852   I_LINK = ((MIOC_STREAMIO << 8) | 12),
25853   I_UNLINK = ((MIOC_STREAMIO << 8) | 13),
25854   I_PEEK = ((MIOC_STREAMIO << 8) | 15),
25855   I_FDINSERT = ((MIOC_STREAMIO << 8) | 16),
25856   I_SENDFD = ((MIOC_STREAMIO << 8) | 17),
25857   I_RECVFD = ((MIOC_STREAMIO << 8) | 18),
25858   I_FLUSHBAND = ((MIOC_STREAMIO << 8) | 19),
25859   I_SWROPT = ((MIOC_STREAMIO << 8) | 20),
25860   I_GWROPT = ((MIOC_STREAMIO << 8) | 21),
25861   I_LIST = ((MIOC_STREAMIO << 8) | 22),
25862   I_ATMARK = ((MIOC_STREAMIO << 8) | 23),
25863   I_CKBAND = ((MIOC_STREAMIO << 8) | 24),
25864   I_GETBAND = ((MIOC_STREAMIO << 8) | 25),
25865   I_CANPUT = ((MIOC_STREAMIO << 8) | 26),
25866   I_SETCLTIME = ((MIOC_STREAMIO << 8) | 27),
25867   I_GETCLTIME = ((MIOC_STREAMIO << 8) | 28),
25868   I_PLINK = ((MIOC_STREAMIO << 8) | 29),
25869   I_PUNLINK = ((MIOC_STREAMIO << 8) | 30),
25870   I_GETMSG = ((MIOC_STREAMIO << 8) | 40),
25871   I_PUTMSG = ((MIOC_STREAMIO << 8) | 41),
25872   I_POLL = ((MIOC_STREAMIO << 8) | 42),
25873   I_SETDELAY = ((MIOC_STREAMIO << 8) | 43),
25874   I_GETDELAY = ((MIOC_STREAMIO << 8) | 44),
25875   I_RUN_QUEUES = ((MIOC_STREAMIO << 8) | 45),
25876   I_GETPMSG = ((MIOC_STREAMIO << 8) | 46),
25877   I_PUTPMSG = ((MIOC_STREAMIO << 8) | 47),
25878   I_AUTOPUSH = ((MIOC_STREAMIO << 8) | 48),
25879   I_PIPE = ((MIOC_STREAMIO << 8) | 49),
25880   I_HEAP_REPORT = ((MIOC_STREAMIO << 8) | 50),
25881   I_FIFO = ((MIOC_STREAMIO << 8) | 51)
25882 };
25883 enum {
25884   RS_HIPRI = 0x01
25885 };
25886
25887
25888 enum {
25889   MSG_HIPRI = 0x01,
25890   MSG_BAND = 0x02,
25891   MSG_ANY = 0x04
25892 };
25893
25894
25895 enum {
25896   MORECTL = 0x01,
25897   MOREDATA = 0x02
25898 };
25899
25900
25901 enum {
25902   FMNAMESZ = 31
25903 };
25904
25905
25906
25907 enum {
25908   INFTIM = (unsigned long)0xFFFFFFFF
25909 };
25910
25911
25912 enum {
25913   FLUSHR = 0x01,
25914   FLUSHW = 0x02,
25915   FLUSHRW = (FLUSHW | FLUSHR)
25916 };
25917
25918 enum {
25919   FLUSHBAND = 0x40
25920 };
25921 struct bandinfo {
25922   unsigned char bi_pri;
25923   char pad1;
25924   SInt32 bi_flag;
25925 };
25926 typedef struct bandinfo bandinfo;
25927
25928 enum {
25929   ANYMARK = 0x01,
25930   LASTMARK = 0x02
25931 };
25932
25933
25934 enum {
25935   S_INPUT = 0x01,
25936   S_HIPRI = 0x02,
25937   S_OUTPUT = 0x04,
25938   S_MSG = 0x08,
25939   S_RDNORM = 0x10,
25940   S_RDBAND = 0x20,
25941   S_WRNORM = 0x40,
25942   S_WRBAND = 0x80,
25943   S_ERROR = 0x0100,
25944   S_HANGUP = 0x0200,
25945   S_BANDURG = 0x0400
25946 };
25947
25948
25949 enum {
25950   RNORM = 0x01,
25951   RMSGD = 0x02,
25952   RMSGN = 0x04,
25953   RFILL = 0x08
25954 };
25955
25956
25957 enum {
25958   RPROTNORM = 0x10,
25959   RPROTDIS = 0x20,
25960   RPROTDAT = 0x40
25961 };
25962
25963
25964 enum {
25965   SNDZERO = 0x01
25966 };
25967
25968 enum {
25969   MUXID_ALL = -1
25970 };
25971
25972
25973
25974
25975
25976
25977
25978 struct strfdinsert {
25979   strbuf ctlbuf;
25980   strbuf databuf;
25981   long flags;
25982   long fildes;
25983   SInt32 offset;
25984 };
25985 typedef struct strfdinsert strfdinsert;
25986
25987 struct str_mlist {
25988   char l_name[32];
25989 };
25990 typedef struct str_mlist str_mlist;
25991 struct str_list {
25992   SInt32 sl_nmods;
25993   str_mlist * sl_modlist;
25994 };
25995 typedef struct str_list str_list;
25996
25997 struct strpeek {
25998   strbuf ctlbuf;
25999   strbuf databuf;
26000   long flags;
26001 };
26002 typedef struct strpeek strpeek;
26003
26004 struct strpmsg {
26005   strbuf ctlbuf;
26006   strbuf databuf;
26007   SInt32 band;
26008   long flags;
26009 };
26010 typedef struct strpmsg strpmsg;
26011
26012 struct strrecvfd {
26013   long fd;
26014   unsigned short uid;
26015   unsigned short gid;
26016   char fill[8];
26017 };
26018 typedef struct strrecvfd strrecvfd;
26019
26020 struct strioctl {
26021   SInt32 ic_cmd;
26022   SInt32 ic_timout;
26023   SInt32 ic_len;
26024   char * ic_dp;
26025 };
26026 typedef struct strioctl strioctl;
26027
26028
26029 struct log_ctl {
26030   short mid;
26031   short sid;
26032   char level;
26033   char pad1;
26034   short flags;
26035   long ltime;
26036   long ttime;
26037   SInt32 seq_no;
26038 };
26039 typedef struct log_ctl log_ctl;
26040 enum {
26041   SL_FATAL = 0x01,
26042   SL_NOTIFY = 0x02,
26043   SL_ERROR = 0x04,
26044   SL_TRACE = 0x08,
26045   SL_CONSOLE = 0x00,
26046   SL_WARN = 0x20,
26047   SL_NOTE = 0x40
26048 };
26049
26050 struct trace_ids {
26051   short ti_mid;
26052   short ti_sid;
26053   char ti_level;
26054 };
26055 typedef struct trace_ids trace_ids;
26056 enum {
26057   I_TRCLOG = ((MIOC_STRLOG << 8) | 1),
26058   I_ERRLOG = ((MIOC_STRLOG << 8) | 2)
26059 };
26060
26061 enum {
26062   LOGMSGSZ = 128
26063 };
26064 struct OTPortCloseStruct {
26065   OTPortRef fPortRef;
26066   ProviderRef fTheProvider;
26067   OSStatus fDenyReason;
26068 };
26069 typedef struct OTPortCloseStruct OTPortCloseStruct;
26070
26071 struct OTClientList {
26072   ItemCount fNumClients;
26073   UInt8 fBuffer[4];
26074 };
26075 typedef struct OTClientList OTClientList;
26076 typedef long OTTimerTask;
26077 extern long
26078 OTCreateTimerTaskInContext(
26079   OTProcessUPP upp,
26080   void * arg,
26081   OTClientContextPtr clientContext) ;
26082 extern Boolean
26083 OTCancelTimerTask(OTTimerTask timerTask) ;
26084 extern void
26085 OTDestroyTimerTask(OTTimerTask timerTask) ;
26086 extern Boolean
26087 OTScheduleTimerTask(
26088   OTTimerTask timerTask,
26089   OTTimeout milliSeconds) ;
26090 extern OTByteCount
26091 OTBufferDataSize(OTBuffer * buffer) ;
26092 extern Boolean
26093 OTReadBuffer(
26094   OTBufferInfo * buffer,
26095   void * dest,
26096   OTByteCount * len) ;
26097 extern void
26098 OTReleaseBuffer(OTBuffer * buffer) ;
26099 extern OTResult
26100 OTSetFirstClearBit(
26101   UInt8 * bitMap,
26102   OTByteCount startBit,
26103   OTByteCount numBits) ;
26104 extern Boolean
26105 OTClearBit(
26106   UInt8 * bitMap,
26107   OTByteCount bitNo) ;
26108 extern Boolean
26109 OTSetBit(
26110   UInt8 * bitMap,
26111   OTByteCount bitNo) ;
26112 extern Boolean
26113 OTTestBit(
26114   UInt8 * bitMap,
26115   OTByteCount bitNo) ;
26116 typedef UInt32 ( * OTHashProcPtr)(OTLink * linkToHash);
26117 typedef Boolean ( * OTHashSearchProcPtr)(const void *ref, OTLink *linkToCheck);
26118 struct OTHashList {
26119   OTHashProcPtr fHashProc;
26120   ByteCount fHashTableSize;
26121   OTLink ** fHashBuckets;
26122
26123
26124
26125
26126
26127
26128     void Add(OTLink* toAdd);
26129
26130     Boolean RemoveLink(OTLink* toRemove);
26131
26132     OTLink* Remove(OTHashSearchProcPtr proc, const void* refPtr, UInt32 hashValue);
26133
26134     Boolean IsInList(OTLink* toFind);
26135
26136     OTLink* FindLink(OTHashSearchProcPtr proc, const void* refPtr, UInt32 hash);
26137
26138
26139
26140 };
26141 typedef struct OTHashList OTHashList;
26142 typedef Boolean ( * OTGateProcPtr)(OTLink * thisLink);
26143 struct OTGate {
26144   OTLIFO fLIFO;
26145   OTList fList;
26146   OTGateProcPtr fProc;
26147   SInt32 fNumQueued;
26148   SInt32 fInside;
26149 };
26150 typedef struct OTGate OTGate;
26151
26152
26153 }
26154 extern "C" {
26155
26156
26157
26158
26159 enum {
26160   kNSLMinSystemVersion = 0x0900,
26161   kNSLMinOTVersion = 0x0130
26162 };
26163
26164 enum {
26165   kNSLDefaultListSize = 256
26166 };
26167
26168 enum {
26169   kNSLURLDelimiter = ','
26170 };
26171
26172
26173
26174
26175 enum {
26176   kNSLNoContext = 0
26177 };
26178
26179 struct NSLError {
26180   OSStatus theErr;
26181   UInt32 theContext;
26182 };
26183 typedef struct NSLError NSLError;
26184 typedef NSLError * NSLErrorPtr;
26185 enum {
26186
26187
26188
26189
26190   kNSLDuplicateSearchInProgress = 100,
26191   kNSLUserCanceled = userCanceledErr,
26192
26193   kNSLInvalidEnumeratorRef = 0
26194 };
26195
26196 typedef UInt16 NSLSearchState;
26197 enum {
26198
26199   kNSLSearchStateBufferFull = 1,
26200   kNSLSearchStateOnGoing = 2,
26201   kNSLSearchStateComplete = 3,
26202   kNSLSearchStateStalled = 4,
26203   kNSLWaitingForContinue = 5
26204 };
26205
26206 typedef UInt32 NSLEventCode;
26207 enum {
26208
26209   kNSLServicesLookupDataEvent = 6,
26210   kNSLNeighborhoodLookupDataEvent = 7,
26211   kNSLNewDataEvent = 8,
26212   kNSLContinueLookupEvent = 9
26213 };
26214
26215
26216 typedef UInt32 NSLClientRef;
26217 typedef UInt32 NSLRequestRef;
26218 typedef UInt32 NSLOneBasedIndex;
26219 typedef char * NSLPath;
26220 typedef char * NSLServiceType;
26221 typedef Handle NSLServicesList;
26222 typedef unsigned char * NSLNeighborhood;
26223
26224
26225
26226
26227
26228
26229 struct NSLClientAsyncInfo {
26230   void * clientContextPtr;
26231   void * mgrContextPtr;
26232   char * resultBuffer;
26233   long bufferLen;
26234   long maxBufferSize;
26235   UInt32 startTime;
26236   UInt32 intStartTime;
26237   UInt32 maxSearchTime;
26238   UInt32 alertInterval;
26239   UInt32 totalItems;
26240   UInt32 alertThreshold;
26241   NSLSearchState searchState;
26242   NSLError searchResult;
26243   NSLEventCode searchDataType;
26244
26245 };
26246 typedef struct NSLClientAsyncInfo NSLClientAsyncInfo;
26247 typedef NSLClientAsyncInfo * NSLClientAsyncInfoPtr;
26248
26249
26250 struct NSLPluginAsyncInfo {
26251   void * mgrContextPtr;
26252   void * pluginContextPtr;
26253   void * pluginPtr;
26254   char * resultBuffer;
26255   long bufferLen;
26256   long maxBufferSize;
26257   UInt32 maxSearchTime;
26258   UInt32 reserved1;
26259   UInt32 reserved2;
26260   UInt32 reserved3;
26261   NSLClientRef clientRef;
26262   NSLRequestRef requestRef;
26263   NSLSearchState searchState;
26264   OSStatus searchResult;
26265 };
26266 typedef struct NSLPluginAsyncInfo NSLPluginAsyncInfo;
26267 typedef NSLPluginAsyncInfo * NSLPluginAsyncInfoPtr;
26268
26269
26270 typedef void ( * NSLMgrNotifyProcPtr)(NSLPluginAsyncInfo * thePluginAsyncInfo);
26271
26272
26273 typedef void ( * NSLClientNotifyProcPtr)(NSLClientAsyncInfo * theClientAsyncInfo);
26274 typedef NSLMgrNotifyProcPtr NSLMgrNotifyUPP;
26275 typedef NSLClientNotifyProcPtr NSLClientNotifyUPP;
26276 extern NSLMgrNotifyUPP
26277 NewNSLMgrNotifyUPP(NSLMgrNotifyProcPtr userRoutine) ;
26278 extern NSLClientNotifyUPP
26279 NewNSLClientNotifyUPP(NSLClientNotifyProcPtr userRoutine) ;
26280 extern void
26281 DisposeNSLMgrNotifyUPP(NSLMgrNotifyUPP userUPP) ;
26282 extern void
26283 DisposeNSLClientNotifyUPP(NSLClientNotifyUPP userUPP) ;
26284 extern void
26285 InvokeNSLMgrNotifyUPP(
26286   NSLPluginAsyncInfo * thePluginAsyncInfo,
26287   NSLMgrNotifyUPP userUPP) ;
26288 extern void
26289 InvokeNSLClientNotifyUPP(
26290   NSLClientAsyncInfo * theClientAsyncInfo,
26291   NSLClientNotifyUPP userUPP) ;
26292
26293
26294
26295
26296
26297
26298 struct NSLTypedData {
26299   unsigned long dataType;
26300   unsigned long lengthOfData;
26301
26302
26303 };
26304 typedef struct NSLTypedData NSLTypedData;
26305 typedef NSLTypedData * NSLTypedDataPtr;
26306
26307
26308
26309
26310
26311
26312
26313 struct NSLServicesListHeader {
26314   unsigned long numServices;
26315   unsigned long logicalLen;
26316
26317
26318 };
26319 typedef struct NSLServicesListHeader NSLServicesListHeader;
26320 typedef NSLServicesListHeader * NSLServicesListHeaderPtr;
26321 struct NSLPluginData {
26322   long reserved1;
26323   long reserved2;
26324   long reserved3;
26325   Boolean supportsRegistration;
26326   Boolean isPurgeable;
26327   UInt16 totalLen;
26328   UInt16 dataTypeOffset;
26329   UInt16 serviceListOffset;
26330   UInt16 protocolListOffset;
26331   UInt16 commentStringOffset;
26332
26333
26334 };
26335 typedef struct NSLPluginData NSLPluginData;
26336 typedef NSLPluginData * NSLPluginDataPtr;
26337 extern UInt32
26338 NSLLibraryVersion(void) ;
26339
26340
26341
26342
26343
26344      inline Boolean NSLLibraryPresent() { return NSLLibraryVersion != (void*)kUnresolvedCFragSymbolAddress; }
26345 extern NSLError
26346 NSLStandardRegisterURL(
26347   NSLPath urlToRegister,
26348   NSLNeighborhood neighborhoodToRegisterIn) ;
26349 extern NSLError
26350 NSLStandardDeregisterURL(
26351   NSLPath urlToDeregister,
26352   NSLNeighborhood neighborhoodToDeregisterIn) ;
26353 extern OSStatus
26354 NSLHexEncodeText(
26355   const char * rawText,
26356   UInt16 rawTextLen,
26357   char * newTextBuffer,
26358   UInt16 * newTextBufferLen,
26359   Boolean * textChanged) ;
26360 extern OSStatus
26361 NSLHexDecodeText(
26362   const char * encodedText,
26363   UInt16 encodedTextLen,
26364   char * decodedTextBuffer,
26365   UInt16 * decodedTextBufferLen,
26366   Boolean * textChanged) ;
26367 extern NSLServicesList
26368 NSLMakeNewServicesList(const char * initialServiceList) ;
26369 extern NSLError
26370 NSLAddServiceToServicesList(
26371   NSLServicesList serviceList,
26372   NSLServiceType serviceType) ;
26373 extern void
26374 NSLDisposeServicesList(NSLServicesList theList) ;
26375 extern NSLNeighborhood
26376 NSLMakeNewNeighborhood(
26377   const char * name,
26378   const char * protocolList) ;
26379 extern NSLNeighborhood
26380 NSLCopyNeighborhood(NSLNeighborhood neighborhood) ;
26381 extern NSLNeighborhood
26382 NSLFreeNeighborhood(NSLNeighborhood neighborhood) ;
26383 extern void
26384 NSLGetNameFromNeighborhood(
26385   NSLNeighborhood neighborhood,
26386   char ** name,
26387   long * length) ;
26388 extern OSStatus
26389 NSLMakeServicesRequestPB(
26390   NSLServicesList serviceList,
26391   NSLTypedDataPtr * newDataPtr) ;
26392 extern NSLTypedDataPtr
26393 NSLFreeTypedDataPtr(NSLTypedDataPtr nslTypeData) ;
26394 extern Boolean
26395 NSLGetNextUrl(
26396   NSLClientAsyncInfoPtr infoPtr,
26397   char ** urlPtr,
26398   long * urlLength) ;
26399 extern Boolean
26400 NSLGetNextNeighborhood(
26401   NSLClientAsyncInfoPtr infoPtr,
26402   NSLNeighborhood * neighborhood,
26403   long * neighborhoodLength) ;
26404 extern OSStatus
26405 NSLErrorToString(
26406   NSLError theErr,
26407   char * errorString,
26408   char * solutionString) ;
26409 extern OSStatus
26410 NSLOpenNavigationAPI(NSLClientRef * newRef) ;
26411 extern void
26412 NSLCloseNavigationAPI(NSLClientRef theClient) ;
26413 extern NSLError
26414 NSLPrepareRequest(
26415   NSLClientNotifyUPP notifier,
26416   void * contextPtr,
26417   NSLClientRef theClient,
26418   NSLRequestRef * ref,
26419   char * bufPtr,
26420   unsigned long bufLen,
26421   NSLClientAsyncInfoPtr * infoPtr) ;
26422 extern NSLError
26423 NSLStartNeighborhoodLookup(
26424   NSLRequestRef ref,
26425   NSLNeighborhood neighborhood,
26426   NSLClientAsyncInfo * asyncInfo) ;
26427 extern NSLError
26428 NSLStartServicesLookup(
26429   NSLRequestRef ref,
26430   NSLNeighborhood neighborhood,
26431   NSLTypedDataPtr requestData,
26432   NSLClientAsyncInfo * asyncInfo) ;
26433 extern NSLError
26434 NSLContinueLookup(NSLClientAsyncInfo * asyncInfo) ;
26435 extern NSLError
26436 NSLCancelRequest(NSLRequestRef ref) ;
26437 extern NSLError
26438 NSLDeleteRequest(NSLRequestRef ref) ;
26439 extern OSStatus
26440 NSLParseServicesRequestPB(
26441   NSLTypedDataPtr newDataPtr,
26442   char ** serviceListPtr,
26443   UInt16 * serviceListLen) ;
26444 extern OSStatus
26445 NSLParseServiceRegistrationPB(
26446   NSLTypedDataPtr newDataPtr,
26447   NSLNeighborhood * neighborhoodPtr,
26448   UInt16 * neighborhoodLen,
26449   char ** urlPtr,
26450   UInt16 * urlLen) ;
26451 extern OSStatus
26452 NSLGetErrorStringsFromResource(
26453   OSStatus theErr,
26454   const FSSpec * fileSpecPtr,
26455   SInt16 errorResID,
26456   char * errorString,
26457   char * solutionString) ;
26458 extern Boolean
26459 NSLServiceIsInServiceList(
26460   NSLServicesList serviceList,
26461   NSLServiceType svcToFind) ;
26462 extern OSStatus
26463 NSLGetServiceFromURL(
26464   char * theURL,
26465   char ** svcString,
26466   UInt16 * svcLen) ;
26467 extern long
26468 NSLGetNeighborhoodLength(NSLNeighborhood neighborhood) ;
26469 extern OSErr
26470 NSLNewThread(
26471   ThreadStyle threadStyle,
26472   ThreadEntryProcPtr threadEntry,
26473   void * threadParam,
26474   Size stackSize,
26475   ThreadOptions options,
26476   void ** threadResult,
26477   ThreadID * threadMade) ;
26478 extern OSErr
26479 NSLDisposeThread(
26480   ThreadID threadToDump,
26481   void * threadResult,
26482   Boolean recycleThread) ;
26483
26484
26485 }
26486 extern "C" {
26487
26488
26489
26490
26491
26492
26493 typedef struct OpaqueSecKeychainRef* SecKeychainRef;
26494 typedef struct OpaqueSecKeychainItemRef* SecKeychainItemRef;
26495 typedef struct OpaqueSecKeychainSearchRef* SecKeychainSearchRef;
26496 typedef OSType SecKeychainAttrType;
26497 typedef UInt32 SecKeychainStatus;
26498 struct SecKeychainAttribute {
26499   SecKeychainAttrType tag;
26500   UInt32 length;
26501   void * data;
26502 };
26503 typedef struct SecKeychainAttribute SecKeychainAttribute;
26504 typedef SecKeychainAttribute * SecKeychainAttributePtr;
26505 struct SecKeychainAttributeList {
26506   UInt32 count;
26507   SecKeychainAttribute * attr;
26508 };
26509 typedef struct SecKeychainAttributeList SecKeychainAttributeList;
26510
26511
26512 typedef SecKeychainRef KCRef;
26513 typedef SecKeychainItemRef KCItemRef;
26514 typedef SecKeychainSearchRef KCSearchRef;
26515 typedef SecKeychainAttribute KCAttribute;
26516 typedef SecKeychainAttributeList KCAttributeList;
26517 typedef SecKeychainAttrType KCAttrType;
26518 typedef SecKeychainStatus KCStatus;
26519 typedef UInt16 KCEvent;
26520 enum {
26521   kIdleKCEvent = 0,
26522   kLockKCEvent = 1,
26523   kUnlockKCEvent = 2,
26524   kAddKCEvent = 3,
26525   kDeleteKCEvent = 4,
26526   kUpdateKCEvent = 5,
26527   kPasswordChangedKCEvent = 6,
26528   kSystemKCEvent = 8,
26529   kDefaultChangedKCEvent = 9,
26530   kDataAccessKCEvent = 10,
26531   kKeychainListChangedKCEvent = 11
26532 };
26533
26534 typedef UInt16 KCEventMask;
26535 enum {
26536   kIdleKCEventMask = 1 << kIdleKCEvent,
26537   kLockKCEventMask = 1 << kLockKCEvent,
26538   kUnlockKCEventMask = 1 << kUnlockKCEvent,
26539   kAddKCEventMask = 1 << kAddKCEvent,
26540   kDeleteKCEventMask = 1 << kDeleteKCEvent,
26541   kUpdateKCEventMask = 1 << kUpdateKCEvent,
26542   kPasswordChangedKCEventMask = 1 << kPasswordChangedKCEvent,
26543   kSystemEventKCEventMask = 1 << kSystemKCEvent,
26544   kDefaultChangedKCEventMask = 1 << kDefaultChangedKCEvent,
26545   kDataAccessKCEventMask = 1 << kDataAccessKCEvent,
26546   kEveryKCEventMask = 0xFFFF
26547 };
26548
26549 typedef UInt8 AFPServerSignature[16];
26550 typedef UInt8 KCPublicKeyHash[20];
26551 struct KCCallbackInfo {
26552   UInt32 version;
26553   KCItemRef item;
26554   long processID[2];
26555   long event[4];
26556   KCRef keychain;
26557 };
26558 typedef struct KCCallbackInfo KCCallbackInfo;
26559 enum {
26560   kUnlockStateKCStatus = 1,
26561   kRdPermKCStatus = 2,
26562   kWrPermKCStatus = 4
26563 };
26564
26565
26566 enum {
26567   kCertificateKCItemClass = 'cert',
26568   kAppleSharePasswordKCItemClass = 'ashp',
26569   kInternetPasswordKCItemClass = 'inet',
26570   kGenericPasswordKCItemClass = 'genp'
26571 };
26572
26573
26574 typedef FourCharCode KCItemClass;
26575 enum {
26576
26577   kClassKCItemAttr = 'clas',
26578   kCreationDateKCItemAttr = 'cdat',
26579   kModDateKCItemAttr = 'mdat',
26580   kDescriptionKCItemAttr = 'desc',
26581   kCommentKCItemAttr = 'icmt',
26582   kCreatorKCItemAttr = 'crtr',
26583   kTypeKCItemAttr = 'type',
26584   kScriptCodeKCItemAttr = 'scrp',
26585   kLabelKCItemAttr = 'labl',
26586   kInvisibleKCItemAttr = 'invi',
26587   kNegativeKCItemAttr = 'nega',
26588   kCustomIconKCItemAttr = 'cusi',
26589   kAccountKCItemAttr = 'acct',
26590
26591   kServiceKCItemAttr = 'svce',
26592   kGenericKCItemAttr = 'gena',
26593
26594   kSecurityDomainKCItemAttr = 'sdmn',
26595   kServerKCItemAttr = 'srvr',
26596   kAuthTypeKCItemAttr = 'atyp',
26597   kPortKCItemAttr = 'port',
26598   kPathKCItemAttr = 'path',
26599
26600   kVolumeKCItemAttr = 'vlme',
26601   kAddressKCItemAttr = 'addr',
26602   kSignatureKCItemAttr = 'ssig',
26603
26604   kProtocolKCItemAttr = 'ptcl',
26605
26606   kSubjectKCItemAttr = 'subj',
26607   kCommonNameKCItemAttr = 'cn  ',
26608   kIssuerKCItemAttr = 'issu',
26609   kSerialNumberKCItemAttr = 'snbr',
26610   kEMailKCItemAttr = 'mail',
26611   kPublicKeyHashKCItemAttr = 'hpky',
26612   kIssuerURLKCItemAttr = 'iurl',
26613
26614   kEncryptKCItemAttr = 'encr',
26615   kDecryptKCItemAttr = 'decr',
26616   kSignKCItemAttr = 'sign',
26617   kVerifyKCItemAttr = 'veri',
26618   kWrapKCItemAttr = 'wrap',
26619   kUnwrapKCItemAttr = 'unwr',
26620   kStartDateKCItemAttr = 'sdat',
26621   kEndDateKCItemAttr = 'edat'
26622 };
26623
26624 typedef FourCharCode KCItemAttr;
26625 enum {
26626   kKCAuthTypeNTLM = 'ntlm',
26627   kKCAuthTypeMSN = 'msna',
26628   kKCAuthTypeDPA = 'dpaa',
26629   kKCAuthTypeRPA = 'rpaa',
26630   kKCAuthTypeHTTPDigest = 'httd',
26631   kKCAuthTypeDefault = 'dflt'
26632 };
26633
26634 typedef FourCharCode KCAuthType;
26635 enum {
26636   kKCProtocolTypeFTP = 'ftp ',
26637   kKCProtocolTypeFTPAccount = 'ftpa',
26638   kKCProtocolTypeHTTP = 'http',
26639   kKCProtocolTypeIRC = 'irc ',
26640   kKCProtocolTypeNNTP = 'nntp',
26641   kKCProtocolTypePOP3 = 'pop3',
26642   kKCProtocolTypeSMTP = 'smtp',
26643   kKCProtocolTypeSOCKS = 'sox ',
26644   kKCProtocolTypeIMAP = 'imap',
26645   kKCProtocolTypeLDAP = 'ldap',
26646   kKCProtocolTypeAppleTalk = 'atlk',
26647   kKCProtocolTypeAFP = 'afp ',
26648   kKCProtocolTypeTelnet = 'teln'
26649 };
26650
26651 typedef FourCharCode KCProtocolType;
26652 typedef UInt32 KCCertAddOptions;
26653 enum {
26654   kSecOptionReserved = 0x000000FF,
26655   kCertUsageShift = 8,
26656   kCertUsageSigningAdd = 1 << (kCertUsageShift + 0),
26657   kCertUsageSigningAskAndAdd = 1 << (kCertUsageShift + 1),
26658   kCertUsageVerifyAdd = 1 << (kCertUsageShift + 2),
26659   kCertUsageVerifyAskAndAdd = 1 << (kCertUsageShift + 3),
26660   kCertUsageEncryptAdd = 1 << (kCertUsageShift + 4),
26661   kCertUsageEncryptAskAndAdd = 1 << (kCertUsageShift + 5),
26662   kCertUsageDecryptAdd = 1 << (kCertUsageShift + 6),
26663   kCertUsageDecryptAskAndAdd = 1 << (kCertUsageShift + 7),
26664   kCertUsageKeyExchAdd = 1 << (kCertUsageShift + 8),
26665   kCertUsageKeyExchAskAndAdd = 1 << (kCertUsageShift + 9),
26666   kCertUsageRootAdd = 1 << (kCertUsageShift + 10),
26667   kCertUsageRootAskAndAdd = 1 << (kCertUsageShift + 11),
26668   kCertUsageSSLAdd = 1 << (kCertUsageShift + 12),
26669   kCertUsageSSLAskAndAdd = 1 << (kCertUsageShift + 13),
26670   kCertUsageAllAdd = 0x7FFFFF00
26671 };
26672
26673 typedef UInt16 KCVerifyStopOn;
26674 enum {
26675   kPolicyKCStopOn = 0,
26676   kNoneKCStopOn = 1,
26677   kFirstPassKCStopOn = 2,
26678   kFirstFailKCStopOn = 3
26679 };
26680
26681 typedef UInt32 KCCertSearchOptions;
26682 enum {
26683   kCertSearchShift = 0,
26684   kCertSearchSigningIgnored = 0,
26685   kCertSearchSigningAllowed = 1 << (kCertSearchShift + 0),
26686   kCertSearchSigningDisallowed = 1 << (kCertSearchShift + 1),
26687   kCertSearchSigningMask = ((kCertSearchSigningAllowed) | (kCertSearchSigningDisallowed)),
26688   kCertSearchVerifyIgnored = 0,
26689   kCertSearchVerifyAllowed = 1 << (kCertSearchShift + 2),
26690   kCertSearchVerifyDisallowed = 1 << (kCertSearchShift + 3),
26691   kCertSearchVerifyMask = ((kCertSearchVerifyAllowed) | (kCertSearchVerifyDisallowed)),
26692   kCertSearchEncryptIgnored = 0,
26693   kCertSearchEncryptAllowed = 1 << (kCertSearchShift + 4),
26694   kCertSearchEncryptDisallowed = 1 << (kCertSearchShift + 5),
26695   kCertSearchEncryptMask = ((kCertSearchEncryptAllowed) | (kCertSearchEncryptDisallowed)),
26696   kCertSearchDecryptIgnored = 0,
26697   kCertSearchDecryptAllowed = 1 << (kCertSearchShift + 6),
26698   kCertSearchDecryptDisallowed = 1 << (kCertSearchShift + 7),
26699   kCertSearchDecryptMask = ((kCertSearchDecryptAllowed) | (kCertSearchDecryptDisallowed)),
26700   kCertSearchWrapIgnored = 0,
26701   kCertSearchWrapAllowed = 1 << (kCertSearchShift + 8),
26702   kCertSearchWrapDisallowed = 1 << (kCertSearchShift + 9),
26703   kCertSearchWrapMask = ((kCertSearchWrapAllowed) | (kCertSearchWrapDisallowed)),
26704   kCertSearchUnwrapIgnored = 0,
26705   kCertSearchUnwrapAllowed = 1 << (kCertSearchShift + 10),
26706   kCertSearchUnwrapDisallowed = 1 << (kCertSearchShift + 11),
26707   kCertSearchUnwrapMask = ((kCertSearchUnwrapAllowed) | (kCertSearchUnwrapDisallowed)),
26708   kCertSearchPrivKeyRequired = 1 << (kCertSearchShift + 12),
26709   kCertSearchAny = 0
26710 };
26711
26712
26713 enum {
26714   kAnyPort = 0
26715 };
26716
26717 enum {
26718   kAnyProtocol = 0,
26719   kAnyAuthType = 0
26720 };
26721 extern OSStatus
26722 KCGetKeychainManagerVersion(UInt32 * returnVers);
26723     inline Boolean KeychainManagerAvailable() { return true; }
26724 extern OSStatus
26725 KCSetInteractionAllowed(Boolean state) ;
26726 extern Boolean
26727 KCIsInteractionAllowed(void) ;
26728 extern OSStatus
26729 KCMakeKCRefFromFSSpec(
26730   FSSpec * keychainFSSpec,
26731   KCRef * keychain) ;
26732 extern OSStatus
26733 KCMakeKCRefFromAlias(
26734   AliasHandle keychainAlias,
26735   KCRef * keychain) ;
26736 extern OSStatus
26737 KCMakeAliasFromKCRef(
26738   KCRef keychain,
26739   AliasHandle * keychainAlias) ;
26740 extern OSStatus
26741 KCReleaseKeychain(KCRef * keychain) ;
26742 extern OSStatus
26743 KCGetDefaultKeychain(KCRef * keychain) ;
26744 extern OSStatus
26745 KCSetDefaultKeychain(KCRef keychain) ;
26746 extern OSStatus
26747 KCGetStatus(
26748   KCRef keychain,
26749   UInt32 * keychainStatus) ;
26750 extern OSStatus
26751 KCGetKeychain(
26752   KCItemRef item,
26753   KCRef * keychain) ;
26754 extern OSStatus
26755 KCGetKeychainName(
26756   KCRef keychain,
26757   StringPtr keychainName) ;
26758 extern UInt16
26759 KCCountKeychains(void) ;
26760 extern OSStatus
26761 KCGetIndKeychain(
26762   UInt16 index,
26763   KCRef * keychain) ;
26764
26765
26766 typedef OSStatus ( * KCCallbackProcPtr)(KCEvent keychainEvent, KCCallbackInfo *info, void *userContext);
26767 typedef KCCallbackProcPtr KCCallbackUPP;
26768 extern KCCallbackUPP
26769 NewKCCallbackUPP(KCCallbackProcPtr userRoutine) ;
26770 extern void
26771 DisposeKCCallbackUPP(KCCallbackUPP userUPP) ;
26772 extern OSStatus
26773 InvokeKCCallbackUPP(
26774   KCEvent keychainEvent,
26775   KCCallbackInfo * info,
26776   void * userContext,
26777   KCCallbackUPP userUPP) ;
26778 extern OSStatus
26779 KCFindAppleSharePassword(
26780   AFPServerSignature * serverSignature,
26781   StringPtr serverAddress,
26782   StringPtr serverName,
26783   StringPtr volumeName,
26784   StringPtr accountName,
26785   UInt32 maxLength,
26786   void * passwordData,
26787   UInt32 * actualLength,
26788   KCItemRef * item) ;
26789 extern OSStatus
26790 KCFindInternetPassword(
26791   StringPtr serverName,
26792   StringPtr securityDomain,
26793   StringPtr accountName,
26794   UInt16 port,
26795   OSType protocol,
26796   OSType authType,
26797   UInt32 maxLength,
26798   void * passwordData,
26799   UInt32 * actualLength,
26800   KCItemRef * item) ;
26801 extern OSStatus
26802 KCFindInternetPasswordWithPath(
26803   StringPtr serverName,
26804   StringPtr securityDomain,
26805   StringPtr accountName,
26806   StringPtr path,
26807   UInt16 port,
26808   OSType protocol,
26809   OSType authType,
26810   UInt32 maxLength,
26811   void * passwordData,
26812   UInt32 * actualLength,
26813   KCItemRef * item) ;
26814 extern OSStatus
26815 KCFindGenericPassword(
26816   StringPtr serviceName,
26817   StringPtr accountName,
26818   UInt32 maxLength,
26819   void * passwordData,
26820   UInt32 * actualLength,
26821   KCItemRef * item) ;
26822 extern OSStatus
26823 KCAddCallback(
26824   KCCallbackUPP callbackProc,
26825   KCEventMask eventMask,
26826   void * userContext) ;
26827 extern OSStatus
26828 KCRemoveCallback(KCCallbackUPP callbackProc) ;
26829 extern OSStatus
26830 KCNewItem(
26831   KCItemClass itemClass,
26832   OSType itemCreator,
26833   UInt32 length,
26834   const void * data,
26835   KCItemRef * item) ;
26836 extern OSStatus
26837 KCSetAttribute(
26838   KCItemRef item,
26839   KCAttribute * attr) ;
26840 extern OSStatus
26841 KCGetAttribute(
26842   KCItemRef item,
26843   KCAttribute * attr,
26844   UInt32 * actualLength) ;
26845 extern OSStatus
26846 KCSetData(
26847   KCItemRef item,
26848   UInt32 length,
26849   const void * data) ;
26850 extern OSStatus
26851 KCUpdateItem(KCItemRef item) ;
26852 extern OSStatus
26853 KCReleaseItem(KCItemRef * item) ;
26854 extern OSStatus
26855 KCCopyItem(
26856   KCItemRef item,
26857   KCRef destKeychain,
26858   KCItemRef * copy) ;
26859 extern OSStatus
26860 KCFindFirstItem(
26861   KCRef keychain,
26862   const KCAttributeList * attrList,
26863   KCSearchRef * search,
26864   KCItemRef * item) ;
26865 extern OSStatus
26866 KCFindNextItem(
26867   KCSearchRef search,
26868   KCItemRef * item) ;
26869 extern OSStatus
26870 KCReleaseSearch(KCSearchRef * search) ;
26871 extern OSStatus
26872 KCDeleteItem(KCItemRef item) ;
26873 extern OSStatus
26874 KCGetData(
26875   KCItemRef item,
26876   UInt32 maxLength,
26877   void * data,
26878   UInt32 * actualLength) ;
26879 extern OSStatus
26880 KCLock(KCRef keychain) ;
26881 extern OSStatus
26882 kcgetkeychainname(
26883   KCRef keychain,
26884   char * keychainName) ;
26885 extern OSStatus
26886 kcfindapplesharepassword(
26887   AFPServerSignature * serverSignature,
26888   const char * serverAddress,
26889   const char * serverName,
26890   const char * volumeName,
26891   const char * accountName,
26892   UInt32 maxLength,
26893   void * passwordData,
26894   UInt32 * actualLength,
26895   KCItemRef * item) ;
26896 extern OSStatus
26897 kcfindinternetpassword(
26898   const char * serverName,
26899   const char * securityDomain,
26900   const char * accountName,
26901   UInt16 port,
26902   OSType protocol,
26903   OSType authType,
26904   UInt32 maxLength,
26905   void * passwordData,
26906   UInt32 * actualLength,
26907   KCItemRef * item) ;
26908 extern OSStatus
26909 kcfindinternetpasswordwithpath(
26910   const char * serverName,
26911   const char * securityDomain,
26912   const char * accountName,
26913   const char * path,
26914   UInt16 port,
26915   OSType protocol,
26916   OSType authType,
26917   UInt32 maxLength,
26918   void * passwordData,
26919   UInt32 * actualLength,
26920   KCItemRef * item) ;
26921 extern OSStatus
26922 kcfindgenericpassword(
26923   const char * serviceName,
26924   const char * accountName,
26925   UInt32 maxLength,
26926   void * passwordData,
26927   UInt32 * actualLength,
26928   KCItemRef * item) ;
26929
26930
26931
26932
26933
26934 }
26935
26936
26937
26938
26939
26940 extern double acos (double);
26941 extern double asin (double);
26942 extern double atan (double);
26943 extern double atan2 (double, double);
26944 extern double ceil (double);
26945 extern double cos (double);
26946 extern double cosh (double);
26947 extern double exp (double);
26948 extern double fabs (double);
26949 extern double floor (double);
26950 extern double fmod (double, double);
26951 extern double frexp (double, int *);
26952 extern double ldexp (double, int);
26953 extern double log10 (double);
26954 extern double log (double);
26955 extern double modf (double, double *);
26956 extern double pow (double, double);
26957 extern double sin (double);
26958 extern double sinh (double);
26959 extern double sqrt (double);
26960 extern double tan (double);
26961 extern double tanh (double);
26962
26963
26964
26965
26966
26967
26968
26969
26970
26971
26972 extern double acos (double);
26973 extern double asin (double);
26974 extern double atan (double);
26975 extern double atan2 (double, double);
26976 extern double ceil (double);
26977 extern double cos (double);
26978 extern double cosh (double);
26979 extern double exp (double);
26980 extern double fabs (double);
26981 extern double floor (double);
26982 extern double fmod (double, double);
26983 extern double frexp (double, int *);
26984 extern double ldexp (double, int);
26985 extern double log10 (double);
26986 extern double log (double);
26987 extern double modf (double, double *);
26988 extern double pow (double, double);
26989 extern double sin (double);
26990 extern double sinh (double);
26991 extern double sqrt (double);
26992 extern double tan (double);
26993 extern double tanh (double);
26994
26995
26996
26997 extern "C" {
26998
26999
27000
27001
27002
27003 extern const int kCFStreamErrorDomainSSL;
27004 extern const CFStringRef kCFStreamPropertySocketSecurityLevel;
27005 extern const CFStringRef kCFStreamSocketSecurityLevelNone;
27006 extern const CFStringRef kCFStreamSocketSecurityLevelSSLv2;
27007 extern const CFStringRef kCFStreamSocketSecurityLevelSSLv3;
27008 extern const CFStringRef kCFStreamSocketSecurityLevelTLSv1;
27009 extern const CFStringRef kCFStreamSocketSecurityLevelNegotiatedSSL;
27010
27011
27012
27013
27014
27015 extern const int kCFStreamErrorDomainSOCKS;
27016
27017
27018 static __inline__
27019 SInt32 CFSocketStreamSOCKSGetErrorSubdomain(CFStreamError* error) {
27020     return ((error->domain >> 16) & 0x0000FFFF);
27021 }
27022
27023 static __inline__
27024 SInt32 CFSocketStreamSOCKSGetError(CFStreamError* error) {
27025     return (error->domain & 0x0000FFFF);
27026 }
27027
27028
27029 enum {
27030         kCFStreamErrorSOCKSSubDomainNone = 0,
27031         kCFStreamErrorSOCKSSubDomainVersionCode,
27032         kCFStreamErrorSOCKS4SubDomainResponse,
27033         kCFStreamErrorSOCKS5SubDomainUserPass,
27034         kCFStreamErrorSOCKS5SubDomainMethod,
27035     kCFStreamErrorSOCKS5SubDomainResponse
27036 };
27037
27038 enum {
27039
27040         kCFStreamErrorSOCKS5BadResponseAddr = 1,
27041         kCFStreamErrorSOCKS5BadState,
27042         kCFStreamErrorSOCKSUnknownClientVersion,
27043
27044
27045         kCFStreamErrorSOCKS4RequestFailed = 91,
27046         kCFStreamErrorSOCKS4IdentdFailed = 92,
27047         kCFStreamErrorSOCKS4IdConflict = 93,
27048
27049
27050         kSOCKS5NoAcceptableMethod = 0xFF
27051 };
27052 extern const CFStringRef kCFStreamPropertySOCKSProxy;
27053 extern const CFStringRef kCFStreamPropertySOCKSProxyHost;
27054 extern const CFStringRef kCFStreamPropertySOCKSProxyPort;
27055 extern const CFStringRef kCFStreamPropertySOCKSVersion;
27056 extern const CFStringRef kCFStreamSocketSOCKSVersion4;
27057 extern const CFStringRef kCFStreamSocketSOCKSVersion5;
27058 extern const CFStringRef kCFStreamPropertySOCKSUser;
27059 extern const CFStringRef kCFStreamPropertySOCKSPassword;
27060 extern const CFStringRef kCFStreamPropertyShouldCloseNativeSocket;
27061 typedef enum {
27062     kCFStreamSocketSecurityNone = 0,
27063     kCFStreamSocketSecuritySSLv2,
27064     kCFStreamSocketSecuritySSLv3,
27065     kCFStreamSocketSecuritySSLv23,
27066     kCFStreamSocketSecurityTLSv1
27067 } CFStreamSocketSecurityProtocol;
27068 extern
27069 Boolean CFSocketStreamPairSetSecurityProtocol(CFReadStreamRef socketReadStream, CFWriteStreamRef socketWriteStream, CFStreamSocketSecurityProtocol securityProtocol);
27070
27071
27072
27073 }
27074 extern "C" {
27075
27076
27077 extern const CFStringRef kCFHTTPVersion1_0;
27078 extern const CFStringRef kCFHTTPVersion1_1;
27079 extern const CFStringRef kCFHTTPAuthenticationSchemeBasic;
27080 extern const CFStringRef kCFHTTPAuthenticationSchemeDigest;
27081
27082 typedef struct __CFHTTPMessage * CFHTTPMessageRef;
27083
27084 extern
27085 CFTypeID CFHTTPMessageGetTypeID(void);
27086
27087 extern
27088 CFHTTPMessageRef CFHTTPMessageCreateRequest(CFAllocatorRef allocator, CFStringRef requestMethod, CFURLRef url, CFStringRef httpVersion);
27089
27090
27091 extern
27092 CFHTTPMessageRef CFHTTPMessageCreateResponse(CFAllocatorRef allocator, int statusCode, CFStringRef statusDescription, CFStringRef httpVersion);
27093
27094
27095 extern
27096 CFHTTPMessageRef CFHTTPMessageCreateEmpty(CFAllocatorRef allocator, Boolean isRequest);
27097
27098 extern
27099 CFHTTPMessageRef CFHTTPMessageCreateCopy(CFAllocatorRef allocator, CFHTTPMessageRef message);
27100
27101
27102 extern
27103 Boolean CFHTTPMessageIsRequest(CFHTTPMessageRef message);
27104
27105 extern
27106 CFStringRef CFHTTPMessageCopyVersion(CFHTTPMessageRef message);
27107
27108 extern
27109 CFDataRef CFHTTPMessageCopyBody(CFHTTPMessageRef message);
27110
27111 extern
27112 void CFHTTPMessageSetBody(CFHTTPMessageRef message, CFDataRef bodyData);
27113
27114 extern
27115 CFStringRef CFHTTPMessageCopyHeaderFieldValue(CFHTTPMessageRef message, CFStringRef headerField);
27116
27117 extern
27118 CFDictionaryRef CFHTTPMessageCopyAllHeaderFields(CFHTTPMessageRef message);
27119
27120 extern
27121 void CFHTTPMessageSetHeaderFieldValue(CFHTTPMessageRef message, CFStringRef headerField, CFStringRef value);
27122
27123
27124 extern
27125 Boolean CFHTTPMessageAppendBytes(CFHTTPMessageRef message, const UInt8 *newBytes, CFIndex numBytes);
27126
27127
27128 extern
27129 Boolean CFHTTPMessageIsHeaderComplete(CFHTTPMessageRef message);
27130
27131 extern
27132 CFDataRef CFHTTPMessageCopySerializedMessage(CFHTTPMessageRef request);
27133
27134
27135 extern
27136 CFURLRef CFHTTPMessageCopyRequestURL(CFHTTPMessageRef request);
27137
27138 extern
27139 CFStringRef CFHTTPMessageCopyRequestMethod(CFHTTPMessageRef request);
27140
27141
27142
27143
27144
27145
27146 extern
27147 Boolean CFHTTPMessageAddAuthentication(CFHTTPMessageRef request, CFHTTPMessageRef authenticationFailureResponse, CFStringRef username, CFStringRef password, CFStringRef authenticationScheme, Boolean forProxy);
27148
27149
27150
27151 extern
27152 UInt32 CFHTTPMessageGetResponseStatusCode(CFHTTPMessageRef response);
27153
27154 extern
27155 CFStringRef CFHTTPMessageCopyResponseStatusLine(CFHTTPMessageRef response);
27156
27157
27158 }
27159 extern "C" {
27160
27161
27162 extern
27163 const SInt32 kCFStreamErrorDomainHTTP;
27164
27165 typedef enum {
27166     kCFStreamErrorHTTPParseFailure = -1,
27167     kCFStreamErrorHTTPRedirectionLoop = -2,
27168     kCFStreamErrorHTTPBadURL = -3
27169 } CFStreamErrorHTTP;
27170
27171
27172
27173
27174 extern
27175 const CFStringRef kCFStreamPropertyHTTPResponseHeader;
27176
27177
27178 extern
27179 const CFStringRef kCFStreamPropertyHTTPFinalURL;
27180
27181
27182
27183
27184
27185
27186
27187 extern const CFStringRef kCFStreamPropertyHTTPProxy;
27188
27189 extern const CFStringRef kCFStreamPropertyHTTPProxyHost;
27190 extern const CFStringRef kCFStreamPropertyHTTPProxyPort;
27191 extern const CFStringRef kCFStreamPropertyHTTPSProxyHost;
27192 extern const CFStringRef kCFStreamPropertyHTTPSProxyPort;
27193
27194
27195
27196 extern
27197 const CFStringRef kCFStreamPropertyHTTPShouldAutoredirect;
27198
27199
27200 extern
27201 const CFStringRef kCFStreamPropertyHTTPAttemptPersistentConnection;
27202
27203
27204
27205
27206 extern
27207 CFReadStreamRef CFReadStreamCreateForHTTPRequest(CFAllocatorRef alloc, CFHTTPMessageRef request);
27208
27209
27210 extern
27211 CFReadStreamRef CFReadStreamCreateForStreamedHTTPRequest(CFAllocatorRef alloc, CFHTTPMessageRef requestHeaders, CFReadStreamRef requestBody);
27212
27213 extern
27214 void CFHTTPReadStreamSetRedirectsAutomatically(CFReadStreamRef httpStream, Boolean shouldAutoRedirect);
27215
27216 extern
27217 void CFHTTPReadStreamSetProxy(CFReadStreamRef httpStream, CFStringRef proxyHost, CFIndex proxyPort);
27218
27219
27220 }
27221 extern "C" {
27222 extern
27223 const SInt32 kCFStreamErrorDomainNetServices;
27224
27225 extern
27226 const SInt32 kCFStreamErrorDomainMach;
27227
27228
27229 typedef enum {
27230     kCFNetServicesErrorUnknown = -72000,
27231         kCFNetServicesErrorCollision = -72001,
27232         kCFNetServicesErrorNotFound = -72002,
27233         kCFNetServicesErrorInProgress = -72003,
27234         kCFNetServicesErrorBadArgument = -72004,
27235     kCFNetServicesErrorCancel = -72005,
27236     kCFNetServicesErrorInvalid = -72006
27237 } CFNetServicesError;
27238
27239
27240
27241 enum {
27242         kCFNetServiceFlagMoreComing = 1,
27243         kCFNetServiceFlagIsDomain = 2,
27244         kCFNetServiceFlagIsRegistrationDomain = 4,
27245     kCFNetServiceFlagRemove = 8
27246 };
27247
27248
27249 typedef struct {
27250     CFIndex version;
27251     void *info;
27252     void *(*retain)(void *info);
27253     void (*release)(void *info);
27254     CFStringRef (*copyDescription)(void *info);
27255 } CFNetServiceClientContext;
27256
27257
27258 typedef struct __CFNetService* CFNetServiceRef;
27259 typedef void (*CFNetServiceClientCallBack)(CFNetServiceRef theService, CFStreamError* error, void* info);
27260
27261 typedef struct __CFNetServiceBrowser* CFNetServiceBrowserRef;
27262 typedef void (*CFNetServiceBrowserClientCallBack)(CFNetServiceBrowserRef browser, CFOptionFlags flags, CFTypeRef domainOrService, CFStreamError* error, void* info);
27263
27264
27265 extern
27266 CFTypeID CFNetServiceGetTypeID(void);
27267
27268 extern
27269 CFTypeID CFNetServiceBrowserGetTypeID(void);
27270 extern
27271 CFNetServiceRef CFNetServiceCreate(CFAllocatorRef alloc,
27272                                                                    CFStringRef domain,
27273                                                                    CFStringRef type,
27274                                                                    CFStringRef name,
27275                                                                    UInt32 port);
27276 extern
27277 CFStringRef CFNetServiceGetDomain(CFNetServiceRef theService);
27278 extern
27279 CFStringRef CFNetServiceGetType(CFNetServiceRef theService);
27280 extern
27281 CFStringRef CFNetServiceGetName(CFNetServiceRef theService);
27282 extern
27283 CFArrayRef CFNetServiceGetAddressing(CFNetServiceRef theService);
27284 extern
27285 CFStringRef CFNetServiceGetProtocolSpecificInformation(CFNetServiceRef theService);
27286 extern
27287 void CFNetServiceSetProtocolSpecificInformation(CFNetServiceRef theService, CFStringRef theInfo);
27288 extern
27289 Boolean CFNetServiceRegister(CFNetServiceRef theService, CFStreamError* error);
27290 extern
27291 Boolean CFNetServiceResolve(CFNetServiceRef theService, CFStreamError* error);
27292 extern
27293 void CFNetServiceCancel(CFNetServiceRef theService);
27294 extern
27295 Boolean CFNetServiceSetClient(CFNetServiceRef theService,
27296                                                           CFNetServiceClientCallBack clientCB,
27297                                                           CFNetServiceClientContext* clientContext);
27298 extern
27299 void CFNetServiceScheduleWithRunLoop(CFNetServiceRef theService,
27300                                                                          CFRunLoopRef runLoop,
27301                                                                          CFStringRef runLoopMode);
27302 extern
27303 void CFNetServiceUnscheduleFromRunLoop(CFNetServiceRef theService,
27304                                                                            CFRunLoopRef runLoop,
27305                                                                            CFStringRef runLoopMode);
27306 extern
27307 CFNetServiceBrowserRef CFNetServiceBrowserCreate(CFAllocatorRef alloc,
27308                                                                                                  CFNetServiceBrowserClientCallBack clientCB,
27309                                                                                                  CFNetServiceClientContext* clientContext);
27310 extern
27311 void CFNetServiceBrowserInvalidate(CFNetServiceBrowserRef browser);
27312 extern
27313 Boolean CFNetServiceBrowserSearchForDomains(CFNetServiceBrowserRef browser,
27314                                                                                         Boolean registrationDomains,
27315                                             CFStreamError* error);
27316 extern
27317 Boolean CFNetServiceBrowserSearchForServices(CFNetServiceBrowserRef browser,
27318                                                                                          CFStringRef domain,
27319                                                                                          CFStringRef type,
27320                                                                                          CFStreamError* error);
27321 extern
27322 void CFNetServiceBrowserStopSearch(CFNetServiceBrowserRef browser, CFStreamError* error);
27323 extern
27324 void CFNetServiceBrowserScheduleWithRunLoop(CFNetServiceBrowserRef browser,
27325                                                                                     CFRunLoopRef runLoop,
27326                                                                                     CFStringRef runLoopMode);
27327 extern
27328 void CFNetServiceBrowserUnscheduleFromRunLoop(CFNetServiceBrowserRef browser,
27329                                                                                           CFRunLoopRef runLoop,
27330                                                                                           CFStringRef runLoopMode);
27331
27332
27333
27334
27335 }
27336
27337
27338
27339
27340
27341
27342
27343
27344
27345 extern double acos (double);
27346 extern double asin (double);
27347 extern double atan (double);
27348 extern double atan2 (double, double);
27349 extern double ceil (double);
27350 extern double cos (double);
27351 extern double cosh (double);
27352 extern double exp (double);
27353 extern double fabs (double);
27354 extern double floor (double);
27355 extern double fmod (double, double);
27356 extern double frexp (double, int *);
27357 extern double ldexp (double, int);
27358 extern double log10 (double);
27359 extern double log (double);
27360 extern double modf (double, double *);
27361 extern double pow (double, double);
27362 extern double sin (double);
27363 extern double sinh (double);
27364 extern double sqrt (double);
27365 extern double tan (double);
27366 extern double tanh (double);
27367
27368
27369
27370
27371
27372
27373 extern "C" {
27374
27375
27376
27377
27378
27379
27380
27381 enum {
27382   errWSInternalError = -65793L,
27383   errWSTransportError = -65794L,
27384   errWSParseError = -65795L,
27385   errWSTimeoutError = -65796L
27386 };
27387 enum WSTypeID {
27388
27389
27390
27391
27392   eWSUnknownType = 0,
27393
27394
27395
27396
27397   eWSNullType = 1,
27398
27399
27400
27401
27402   eWSBooleanType = 2,
27403
27404
27405
27406
27407   eWSIntegerType = 3,
27408
27409
27410
27411
27412   eWSDoubleType = 4,
27413
27414
27415
27416
27417   eWSStringType = 5,
27418
27419
27420
27421
27422   eWSDateType = 6,
27423
27424
27425
27426
27427   eWSDataType = 7,
27428
27429
27430
27431
27432   eWSArrayType = 8,
27433
27434
27435
27436
27437   eWSDictionaryType = 9
27438 };
27439 typedef enum WSTypeID WSTypeID;
27440 extern WSTypeID
27441 WSGetWSTypeIDFromCFType(CFTypeRef ref) ;
27442 extern CFTypeID
27443 WSGetCFTypeIDFromWSTypeID(WSTypeID typeID) ;
27444
27445
27446 typedef void * ( * WSClientContextRetainCallBackProcPtr)(void * info);
27447 typedef void ( * WSClientContextReleaseCallBackProcPtr)(void * info);
27448 typedef CFStringRef ( * WSClientContextCopyDescriptionCallBackProcPtr)(void * info);
27449 struct WSClientContext {
27450
27451
27452
27453
27454   CFIndex version;
27455
27456
27457
27458
27459   void * info;
27460
27461
27462
27463
27464   WSClientContextRetainCallBackProcPtr retain;
27465
27466
27467
27468
27469   WSClientContextReleaseCallBackProcPtr release;
27470
27471
27472
27473
27474   WSClientContextCopyDescriptionCallBackProcPtr copyDescription;
27475 };
27476 typedef struct WSClientContext WSClientContext;
27477 extern CFStringRef kWSXMLRPCProtocol;
27478 extern CFStringRef kWSSOAP1999Protocol;
27479 extern CFStringRef kWSSOAP2001Protocol;
27480 extern CFStringRef kWSMethodInvocationResult;
27481
27482
27483
27484 extern CFStringRef kWSFaultString;
27485 extern CFStringRef kWSFaultCode;
27486 extern CFStringRef kWSFaultExtra;
27487 extern CFStringRef kWSNetworkStreamFaultString;
27488 extern CFStringRef kWSStreamErrorMessage;
27489 extern CFStringRef kWSStreamErrorDomain;
27490 extern CFStringRef kWSStreamErrorError;
27491 extern CFStringRef kWSHTTPMessage;
27492 extern CFStringRef kWSHTTPResponseMessage;
27493
27494
27495
27496
27497
27498 extern CFStringRef kWSHTTPVersion;
27499 extern CFStringRef kWSHTTPExtraHeaders;
27500 extern CFStringRef kWSHTTPProxy;
27501 extern CFStringRef kWSHTTPFollowsRedirects;
27502 extern CFStringRef kWSDebugOutgoingHeaders;
27503 extern CFStringRef kWSDebugOutgoingBody;
27504 extern CFStringRef kWSDebugIncomingHeaders;
27505 extern CFStringRef kWSDebugIncomingBody;
27506
27507
27508
27509
27510
27511 extern CFStringRef kWSSOAPMethodNamespaceURI;
27512 extern CFStringRef kWSSOAPBodyEncodingStyle;
27513 extern CFStringRef kWSSOAPStyleDoc;
27514 extern CFStringRef kWSSOAPStyleRPC;
27515
27516
27517
27518
27519
27520
27521
27522 extern CFStringRef kWSSOAPMessageHeaders;
27523
27524
27525
27526
27527
27528 extern CFStringRef kWSRecordParameterOrder;
27529 extern CFStringRef kWSRecordNamespaceURI;
27530 extern CFStringRef kWSRecordType;
27531
27532
27533
27534
27535
27536 extern CFStringRef kWSMethodInvocationResultParameterName;
27537
27538
27539
27540
27541
27542
27543 extern CFStringRef kWSMethodInvocationTimeoutValue;
27544 typedef struct OpaqueWSMethodInvocationRef* WSMethodInvocationRef;
27545 extern CFTypeID
27546 WSMethodInvocationGetTypeID(void) ;
27547 extern WSMethodInvocationRef
27548 WSMethodInvocationCreate(
27549   CFURLRef url,
27550   CFStringRef methodName,
27551   CFStringRef protocol) ;
27552 extern WSMethodInvocationRef
27553 WSMethodInvocationCreateFromSerialization(CFDataRef contract) ;
27554 extern CFDataRef
27555 WSMethodInvocationCopySerialization(WSMethodInvocationRef invocation) ;
27556 extern void
27557 WSMethodInvocationSetParameters(
27558   WSMethodInvocationRef invocation,
27559   CFDictionaryRef parameters,
27560   CFArrayRef parameterOrder) ;
27561 extern CFDictionaryRef
27562 WSMethodInvocationCopyParameters(
27563   WSMethodInvocationRef invocation,
27564   CFArrayRef * parameterOrder) ;
27565 extern void
27566 WSMethodInvocationSetProperty(
27567   WSMethodInvocationRef invocation,
27568   CFStringRef propertyName,
27569   CFTypeRef propertyValue) ;
27570 extern CFTypeRef
27571 WSMethodInvocationCopyProperty(
27572   WSMethodInvocationRef invocation,
27573   CFStringRef propertyName) ;
27574 extern CFDictionaryRef
27575 WSMethodInvocationInvoke(WSMethodInvocationRef invocation) ;
27576 typedef void ( * WSMethodInvocationCallBackProcPtr)(WSMethodInvocationRef invocation, void *info, CFDictionaryRef outRef);
27577 extern void
27578 WSMethodInvocationSetCallBack(
27579   WSMethodInvocationRef invocation,
27580   WSMethodInvocationCallBackProcPtr clientCB,
27581   WSClientContext * context) ;
27582 extern void
27583 WSMethodInvocationScheduleWithRunLoop(
27584   WSMethodInvocationRef invocation,
27585   CFRunLoopRef runLoop,
27586   CFStringRef runLoopMode) ;
27587 extern void
27588 WSMethodInvocationUnscheduleFromRunLoop(
27589   WSMethodInvocationRef invocation,
27590   CFRunLoopRef runLoop,
27591   CFStringRef runLoopMode) ;
27592 extern Boolean
27593 WSMethodResultIsFault(CFDictionaryRef methodResult) ;
27594 typedef CFStringRef ( * WSMethodInvocationSerializationProcPtr)(WSMethodInvocationRef invocation, CFTypeRef obj, void *info);
27595 extern void
27596 WSMethodInvocationAddSerializationOverride(
27597   WSMethodInvocationRef invocation,
27598   CFTypeID objType,
27599   WSMethodInvocationSerializationProcPtr serializationProc,
27600   WSClientContext * context) ;
27601 typedef CFTypeRef ( * WSMethodInvocationDeserializationProcPtr)(WSMethodInvocationRef invocation, CFXMLTreeRef msgRoot, CFXMLTreeRef deserializeRoot, void *info);
27602 extern void
27603 WSMethodInvocationAddDeserializationOverride(
27604   WSMethodInvocationRef invocation,
27605   CFStringRef typeNamespace,
27606   CFStringRef typeName,
27607   WSMethodInvocationDeserializationProcPtr deserializationProc,
27608   WSClientContext * context) ;
27609
27610
27611
27612
27613
27614
27615
27616
27617
27618 }
27619
27620
27621
27622 enum {
27623   kAllTypographicFeaturesType = 0,
27624   kLigaturesType = 1,
27625   kCursiveConnectionType = 2,
27626   kLetterCaseType = 3,
27627   kVerticalSubstitutionType = 4,
27628   kLinguisticRearrangementType = 5,
27629   kNumberSpacingType = 6,
27630   kSmartSwashType = 8,
27631   kDiacriticsType = 9,
27632   kVerticalPositionType = 10,
27633   kFractionsType = 11,
27634   kOverlappingCharactersType = 13,
27635   kTypographicExtrasType = 14,
27636   kMathematicalExtrasType = 15,
27637   kOrnamentSetsType = 16,
27638   kCharacterAlternativesType = 17,
27639   kDesignComplexityType = 18,
27640   kStyleOptionsType = 19,
27641   kCharacterShapeType = 20,
27642   kNumberCaseType = 21,
27643   kTextSpacingType = 22,
27644   kTransliterationType = 23,
27645   kAnnotationType = 24,
27646   kKanaSpacingType = 25,
27647   kIdeographicSpacingType = 26,
27648   kUnicodeDecompositionType = 27,
27649   kRubyKanaType = 28,
27650   kCJKSymbolAlternativesType = 29,
27651   kIdeographicAlternativesType = 30,
27652   kCJKVerticalRomanPlacementType = 31,
27653   kItalicCJKRomanType = 32,
27654   kCJKRomanSpacingType = 103,
27655   kLastFeatureType = -1
27656 };
27657
27658
27659
27660
27661
27662
27663 enum {
27664   kAllTypeFeaturesOnSelector = 0,
27665   kAllTypeFeaturesOffSelector = 1
27666 };
27667
27668
27669
27670
27671
27672
27673
27674 enum {
27675   kRequiredLigaturesOnSelector = 0,
27676   kRequiredLigaturesOffSelector = 1,
27677   kCommonLigaturesOnSelector = 2,
27678   kCommonLigaturesOffSelector = 3,
27679   kRareLigaturesOnSelector = 4,
27680   kRareLigaturesOffSelector = 5,
27681   kLogosOnSelector = 6,
27682   kLogosOffSelector = 7,
27683   kRebusPicturesOnSelector = 8,
27684   kRebusPicturesOffSelector = 9,
27685   kDiphthongLigaturesOnSelector = 10,
27686   kDiphthongLigaturesOffSelector = 11,
27687   kSquaredLigaturesOnSelector = 12,
27688   kSquaredLigaturesOffSelector = 13,
27689   kAbbrevSquaredLigaturesOnSelector = 14,
27690   kAbbrevSquaredLigaturesOffSelector = 15,
27691   kSymbolLigaturesOnSelector = 16,
27692   kSymbolLigaturesOffSelector = 17
27693 };
27694
27695
27696
27697
27698
27699
27700 enum {
27701   kUnconnectedSelector = 0,
27702   kPartiallyConnectedSelector = 1,
27703   kCursiveSelector = 2
27704 };
27705
27706
27707
27708
27709
27710
27711 enum {
27712   kUpperAndLowerCaseSelector = 0,
27713   kAllCapsSelector = 1,
27714   kAllLowerCaseSelector = 2,
27715   kSmallCapsSelector = 3,
27716   kInitialCapsSelector = 4,
27717   kInitialCapsAndSmallCapsSelector = 5
27718 };
27719
27720
27721
27722
27723
27724
27725 enum {
27726   kSubstituteVerticalFormsOnSelector = 0,
27727   kSubstituteVerticalFormsOffSelector = 1
27728 };
27729
27730
27731
27732
27733
27734
27735 enum {
27736   kLinguisticRearrangementOnSelector = 0,
27737   kLinguisticRearrangementOffSelector = 1
27738 };
27739
27740
27741
27742
27743
27744
27745 enum {
27746   kMonospacedNumbersSelector = 0,
27747   kProportionalNumbersSelector = 1,
27748   kThirdWidthNumbersSelector = 2,
27749   kQuarterWidthNumbersSelector = 3
27750 };
27751
27752
27753
27754
27755
27756
27757 enum {
27758   kWordInitialSwashesOnSelector = 0,
27759   kWordInitialSwashesOffSelector = 1,
27760   kWordFinalSwashesOnSelector = 2,
27761   kWordFinalSwashesOffSelector = 3,
27762   kLineInitialSwashesOnSelector = 4,
27763   kLineInitialSwashesOffSelector = 5,
27764   kLineFinalSwashesOnSelector = 6,
27765   kLineFinalSwashesOffSelector = 7,
27766   kNonFinalSwashesOnSelector = 8,
27767   kNonFinalSwashesOffSelector = 9
27768 };
27769
27770
27771
27772
27773
27774
27775 enum {
27776   kShowDiacriticsSelector = 0,
27777   kHideDiacriticsSelector = 1,
27778   kDecomposeDiacriticsSelector = 2
27779 };
27780
27781
27782
27783
27784
27785
27786 enum {
27787   kNormalPositionSelector = 0,
27788   kSuperiorsSelector = 1,
27789   kInferiorsSelector = 2,
27790   kOrdinalsSelector = 3
27791 };
27792
27793
27794
27795
27796
27797
27798 enum {
27799   kNoFractionsSelector = 0,
27800   kVerticalFractionsSelector = 1,
27801   kDiagonalFractionsSelector = 2
27802 };
27803
27804
27805
27806
27807
27808
27809 enum {
27810   kPreventOverlapOnSelector = 0,
27811   kPreventOverlapOffSelector = 1
27812 };
27813
27814
27815
27816
27817
27818
27819 enum {
27820   kHyphensToEmDashOnSelector = 0,
27821   kHyphensToEmDashOffSelector = 1,
27822   kHyphenToEnDashOnSelector = 2,
27823   kHyphenToEnDashOffSelector = 3,
27824   kSlashedZeroOnSelector = 4,
27825   kSlashedZeroOffSelector = 5,
27826   kFormInterrobangOnSelector = 6,
27827   kFormInterrobangOffSelector = 7,
27828   kSmartQuotesOnSelector = 8,
27829   kSmartQuotesOffSelector = 9,
27830   kPeriodsToEllipsisOnSelector = 10,
27831   kPeriodsToEllipsisOffSelector = 11
27832 };
27833
27834
27835
27836
27837
27838
27839 enum {
27840   kHyphenToMinusOnSelector = 0,
27841   kHyphenToMinusOffSelector = 1,
27842   kAsteriskToMultiplyOnSelector = 2,
27843   kAsteriskToMultiplyOffSelector = 3,
27844   kSlashToDivideOnSelector = 4,
27845   kSlashToDivideOffSelector = 5,
27846   kInequalityLigaturesOnSelector = 6,
27847   kInequalityLigaturesOffSelector = 7,
27848   kExponentsOnSelector = 8,
27849   kExponentsOffSelector = 9
27850 };
27851
27852
27853
27854
27855
27856
27857 enum {
27858   kNoOrnamentsSelector = 0,
27859   kDingbatsSelector = 1,
27860   kPiCharactersSelector = 2,
27861   kFleuronsSelector = 3,
27862   kDecorativeBordersSelector = 4,
27863   kInternationalSymbolsSelector = 5,
27864   kMathSymbolsSelector = 6
27865 };
27866
27867
27868
27869
27870
27871
27872 enum {
27873   kNoAlternatesSelector = 0
27874 };
27875
27876
27877
27878
27879
27880
27881 enum {
27882   kDesignLevel1Selector = 0,
27883   kDesignLevel2Selector = 1,
27884   kDesignLevel3Selector = 2,
27885   kDesignLevel4Selector = 3,
27886   kDesignLevel5Selector = 4
27887 };
27888
27889
27890
27891
27892
27893
27894 enum {
27895   kNoStyleOptionsSelector = 0,
27896   kDisplayTextSelector = 1,
27897   kEngravedTextSelector = 2,
27898   kIlluminatedCapsSelector = 3,
27899   kTitlingCapsSelector = 4,
27900   kTallCapsSelector = 5
27901 };
27902
27903
27904
27905
27906
27907
27908 enum {
27909   kTraditionalCharactersSelector = 0,
27910   kSimplifiedCharactersSelector = 1,
27911   kJIS1978CharactersSelector = 2,
27912   kJIS1983CharactersSelector = 3,
27913   kJIS1990CharactersSelector = 4,
27914   kTraditionalAltOneSelector = 5,
27915   kTraditionalAltTwoSelector = 6,
27916   kTraditionalAltThreeSelector = 7,
27917   kTraditionalAltFourSelector = 8,
27918   kTraditionalAltFiveSelector = 9,
27919   kExpertCharactersSelector = 10
27920 };
27921
27922
27923
27924
27925
27926
27927 enum {
27928   kLowerCaseNumbersSelector = 0,
27929   kUpperCaseNumbersSelector = 1
27930 };
27931
27932
27933
27934
27935
27936
27937 enum {
27938   kProportionalTextSelector = 0,
27939   kMonospacedTextSelector = 1,
27940   kHalfWidthTextSelector = 2
27941 };
27942
27943
27944
27945
27946
27947
27948 enum {
27949   kNoTransliterationSelector = 0,
27950   kHanjaToHangulSelector = 1,
27951   kHiraganaToKatakanaSelector = 2,
27952   kKatakanaToHiraganaSelector = 3,
27953   kKanaToRomanizationSelector = 4,
27954   kRomanizationToHiraganaSelector = 5,
27955   kRomanizationToKatakanaSelector = 6,
27956   kHanjaToHangulAltOneSelector = 7,
27957   kHanjaToHangulAltTwoSelector = 8,
27958   kHanjaToHangulAltThreeSelector = 9
27959 };
27960
27961
27962
27963
27964
27965
27966 enum {
27967   kNoAnnotationSelector = 0,
27968   kBoxAnnotationSelector = 1,
27969   kRoundedBoxAnnotationSelector = 2,
27970   kCircleAnnotationSelector = 3,
27971   kInvertedCircleAnnotationSelector = 4,
27972   kParenthesisAnnotationSelector = 5,
27973   kPeriodAnnotationSelector = 6,
27974   kRomanNumeralAnnotationSelector = 7,
27975   kDiamondAnnotationSelector = 8,
27976   kInvertedBoxAnnotationSelector = 9,
27977   kInvertedRoundedBoxAnnotationSelector = 10
27978 };
27979
27980
27981
27982
27983
27984
27985 enum {
27986   kFullWidthKanaSelector = 0,
27987   kProportionalKanaSelector = 1
27988 };
27989
27990
27991
27992
27993
27994
27995 enum {
27996   kFullWidthIdeographsSelector = 0,
27997   kProportionalIdeographsSelector = 1,
27998   kHalfWidthIdeographsSelector = 2
27999 };
28000
28001
28002
28003
28004
28005
28006 enum {
28007   kCanonicalCompositionOnSelector = 0,
28008   kCanonicalCompositionOffSelector = 1,
28009   kCompatibilityCompositionOnSelector = 2,
28010   kCompatibilityCompositionOffSelector = 3,
28011   kTranscodingCompositionOnSelector = 4,
28012   kTranscodingCompositionOffSelector = 5
28013 };
28014
28015
28016
28017
28018
28019
28020 enum {
28021   kNoRubyKanaSelector = 0,
28022   kRubyKanaSelector = 1
28023 };
28024
28025
28026
28027
28028
28029
28030 enum {
28031   kNoCJKSymbolAlternativesSelector = 0,
28032   kCJKSymbolAltOneSelector = 1,
28033   kCJKSymbolAltTwoSelector = 2,
28034   kCJKSymbolAltThreeSelector = 3,
28035   kCJKSymbolAltFourSelector = 4,
28036   kCJKSymbolAltFiveSelector = 5
28037 };
28038
28039
28040
28041
28042
28043
28044 enum {
28045   kNoIdeographicAlternativesSelector = 0,
28046   kIdeographicAltOneSelector = 1,
28047   kIdeographicAltTwoSelector = 2,
28048   kIdeographicAltThreeSelector = 3,
28049   kIdeographicAltFourSelector = 4,
28050   kIdeographicAltFiveSelector = 5
28051 };
28052
28053
28054
28055
28056
28057
28058 enum {
28059   kCJKVerticalRomanCenteredSelector = 0,
28060   kCJKVerticalRomanHBaselineSelector = 1
28061 };
28062
28063
28064
28065
28066
28067
28068 enum {
28069   kNoCJKItalicRomanSelector = 0,
28070   kCJKItalicRomanSelector = 1
28071 };
28072
28073
28074
28075
28076
28077
28078 enum {
28079   kHalfWidthCJKRomanSelector = 0,
28080   kProportionalCJKRomanSelector = 1,
28081   kDefaultCJKRomanSelector = 2,
28082   kFullWidthCJKRomanSelector = 3
28083 };
28084
28085
28086
28087
28088
28089 enum {
28090   kSFNTLookupSimpleArray = 0,
28091   kSFNTLookupSegmentSingle = 2,
28092   kSFNTLookupSegmentArray = 4,
28093   kSFNTLookupSingleTable = 6,
28094   kSFNTLookupTrimmedArray = 8
28095 };
28096
28097 typedef UInt16 SFNTLookupTableFormat;
28098 typedef UInt16 SFNTLookupValue;
28099 typedef UInt16 SFNTLookupOffset;
28100 typedef UInt32 SFNTLookupKind;
28101
28102
28103
28104
28105
28106
28107 struct SFNTLookupBinarySearchHeader {
28108   UInt16 unitSize;
28109   UInt16 nUnits;
28110   UInt16 searchRange;
28111   UInt16 entrySelector;
28112   UInt16 rangeShift;
28113 };
28114 typedef struct SFNTLookupBinarySearchHeader SFNTLookupBinarySearchHeader;
28115
28116 struct SFNTLookupArrayHeader {
28117   SFNTLookupValue lookupValues[1];
28118 };
28119 typedef struct SFNTLookupArrayHeader SFNTLookupArrayHeader;
28120
28121 struct SFNTLookupTrimmedArrayHeader {
28122   UInt16 firstGlyph;
28123   UInt16 count;
28124   SFNTLookupValue valueArray[1];
28125 };
28126 typedef struct SFNTLookupTrimmedArrayHeader SFNTLookupTrimmedArrayHeader;
28127
28128
28129
28130
28131
28132
28133 struct SFNTLookupSegment {
28134   UInt16 lastGlyph;
28135   UInt16 firstGlyph;
28136   UInt16 value[1];
28137 };
28138 typedef struct SFNTLookupSegment SFNTLookupSegment;
28139 struct SFNTLookupSegmentHeader {
28140   SFNTLookupBinarySearchHeader binSearch;
28141   SFNTLookupSegment segments[1];
28142 };
28143 typedef struct SFNTLookupSegmentHeader SFNTLookupSegmentHeader;
28144
28145 struct SFNTLookupSingle {
28146   UInt16 glyph;
28147   UInt16 value[1];
28148 };
28149 typedef struct SFNTLookupSingle SFNTLookupSingle;
28150 struct SFNTLookupSingleHeader {
28151   SFNTLookupBinarySearchHeader binSearch;
28152   SFNTLookupSingle entries[1];
28153 };
28154 typedef struct SFNTLookupSingleHeader SFNTLookupSingleHeader;
28155
28156 union SFNTLookupFormatSpecificHeader {
28157   SFNTLookupArrayHeader theArray;
28158   SFNTLookupSegmentHeader segment;
28159   SFNTLookupSingleHeader single;
28160   SFNTLookupTrimmedArrayHeader trimmedArray;
28161 };
28162 typedef union SFNTLookupFormatSpecificHeader SFNTLookupFormatSpecificHeader;
28163
28164 struct SFNTLookupTable {
28165   SFNTLookupTableFormat format;
28166   SFNTLookupFormatSpecificHeader fsHeader;
28167 };
28168 typedef struct SFNTLookupTable SFNTLookupTable;
28169 typedef SFNTLookupTable * SFNTLookupTablePtr;
28170 typedef SFNTLookupTablePtr * SFNTLookupTableHandle;
28171
28172
28173 enum {
28174   kSTClassEndOfText = 0,
28175   kSTClassOutOfBounds = 1,
28176   kSTClassDeletedGlyph = 2,
28177   kSTClassEndOfLine = 3,
28178   kSTSetMark = 0x8000,
28179   kSTNoAdvance = 0x4000,
28180   kSTMarkEnd = 0x2000,
28181   kSTLigActionMask = 0x3FFF,
28182   kSTRearrVerbMask = 0x000F
28183 };
28184
28185 typedef UInt8 STClass;
28186 typedef UInt8 STEntryIndex;
28187 struct STHeader {
28188   UInt8 filler;
28189   STClass nClasses;
28190   UInt16 classTableOffset;
28191   UInt16 stateArrayOffset;
28192   UInt16 entryTableOffset;
28193 };
28194 typedef struct STHeader STHeader;
28195 struct STClassTable {
28196   UInt16 firstGlyph;
28197   UInt16 nGlyphs;
28198   STClass classes[1];
28199 };
28200 typedef struct STClassTable STClassTable;
28201 struct STEntryZero {
28202   UInt16 newState;
28203   UInt16 flags;
28204 };
28205 typedef struct STEntryZero STEntryZero;
28206 struct STEntryOne {
28207   UInt16 newState;
28208   UInt16 flags;
28209   UInt16 offset1;
28210 };
28211 typedef struct STEntryOne STEntryOne;
28212 struct STEntryTwo {
28213   UInt16 newState;
28214   UInt16 flags;
28215   UInt16 offset1;
28216   UInt16 offset2;
28217 };
28218 typedef struct STEntryTwo STEntryTwo;
28219
28220
28221 enum {
28222   kSTXHasLigAction = 0x2000
28223 };
28224
28225
28226 typedef UInt16 STXClass;
28227 typedef UInt16 STXStateIndex;
28228 typedef UInt16 STXEntryIndex;
28229 struct STXHeader {
28230   UInt32 nClasses;
28231   UInt32 classTableOffset;
28232   UInt32 stateArrayOffset;
28233   UInt32 entryTableOffset;
28234 };
28235 typedef struct STXHeader STXHeader;
28236
28237 typedef SFNTLookupTable STXClassTable;
28238 struct STXEntryZero {
28239   STXStateIndex newState;
28240   UInt16 flags;
28241 };
28242 typedef struct STXEntryZero STXEntryZero;
28243 struct STXEntryOne {
28244   STXStateIndex newState;
28245   UInt16 flags;
28246   UInt16 index1;
28247 };
28248 typedef struct STXEntryOne STXEntryOne;
28249 struct STXEntryTwo {
28250   STXStateIndex newState;
28251   UInt16 flags;
28252   UInt16 index1;
28253   UInt16 index2;
28254 };
28255 typedef struct STXEntryTwo STXEntryTwo;
28256
28257
28258
28259 enum {
28260   kLCARTag = 0x6C636172,
28261   kLCARCurrentVersion = 0x00010000,
28262   kLCARLinearFormat = 0,
28263   kLCARCtlPointFormat = 1
28264 };
28265
28266
28267 struct LcarCaretClassEntry {
28268   UInt16 count;
28269   UInt16 partials[1];
28270 };
28271 typedef struct LcarCaretClassEntry LcarCaretClassEntry;
28272 struct LcarCaretTable {
28273   Fixed version;
28274   UInt16 format;
28275   SFNTLookupTable lookup;
28276 };
28277 typedef struct LcarCaretTable LcarCaretTable;
28278 typedef LcarCaretTable * LcarCaretTablePtr;
28279
28280
28281
28282 enum {
28283   kJUSTTag = 0x6A757374,
28284   kJUSTCurrentVersion = 0x00010000,
28285   kJUSTStandardFormat = 0,
28286   kJUSTnoGlyphcode = 0xFFFF,
28287   kJUSTpcDecompositionAction = 0,
28288   kJUSTpcUnconditionalAddAction = 1,
28289   kJUSTpcConditionalAddAction = 2,
28290   kJUSTpcGlyphStretchAction = 3,
28291   kJUSTpcDuctilityAction = 4,
28292   kJUSTpcGlyphRepeatAddAction = 5
28293 };
28294
28295
28296 enum {
28297   kJUSTKashidaPriority = 0,
28298   kJUSTSpacePriority = 1,
28299   kJUSTLetterPriority = 2,
28300   kJUSTNullPriority = 3,
28301   kJUSTPriorityCount = 4
28302 };
28303
28304
28305 enum {
28306   kJUSTOverridePriority = 0x8000,
28307   kJUSTOverrideLimits = 0x4000,
28308   kJUSTOverrideUnlimited = 0x2000,
28309   kJUSTUnlimited = 0x1000,
28310   kJUSTPriorityMask = 0x0003
28311 };
28312
28313
28314 typedef UInt16 JustPCActionType;
28315 typedef UInt16 JustificationFlags;
28316
28317 struct JustPCDecompositionAction {
28318   Fixed lowerLimit;
28319   Fixed upperLimit;
28320   UInt16 order;
28321   UInt16 count;
28322   UInt16 glyphs[1];
28323 };
28324 typedef struct JustPCDecompositionAction JustPCDecompositionAction;
28325
28326
28327 typedef UInt16 JustPCUnconditionalAddAction;
28328
28329
28330
28331
28332
28333 struct JustPCConditionalAddAction {
28334   Fixed substThreshhold;
28335   UInt16 addGlyph;
28336   UInt16 substGlyph;
28337 };
28338 typedef struct JustPCConditionalAddAction JustPCConditionalAddAction;
28339
28340 struct JustPCDuctilityAction {
28341   UInt32 ductilityAxis;
28342   Fixed minimumLimit;
28343   Fixed noStretchValue;
28344   Fixed maximumLimit;
28345 };
28346 typedef struct JustPCDuctilityAction JustPCDuctilityAction;
28347
28348
28349
28350
28351
28352 struct JustPCGlyphRepeatAddAction {
28353   UInt16 flags;
28354   UInt16 glyph;
28355 };
28356 typedef struct JustPCGlyphRepeatAddAction JustPCGlyphRepeatAddAction;
28357
28358 struct JustPCActionSubrecord {
28359   UInt16 theClass;
28360   JustPCActionType theType;
28361   UInt32 length;
28362   UInt32 data;
28363 };
28364 typedef struct JustPCActionSubrecord JustPCActionSubrecord;
28365
28366 struct JustPCAction {
28367   UInt32 actionCount;
28368   JustPCActionSubrecord actions[1];
28369 };
28370 typedef struct JustPCAction JustPCAction;
28371
28372
28373
28374
28375 struct JustWidthDeltaEntry {
28376   UInt32 justClass;
28377   Fixed beforeGrowLimit;
28378   Fixed beforeShrinkLimit;
28379   Fixed afterGrowLimit;
28380   Fixed afterShrinkLimit;
28381   JustificationFlags growFlags;
28382   JustificationFlags shrinkFlags;
28383 };
28384 typedef struct JustWidthDeltaEntry JustWidthDeltaEntry;
28385 struct JustWidthDeltaGroup {
28386   UInt32 count;
28387   JustWidthDeltaEntry entries[1];
28388 };
28389 typedef struct JustWidthDeltaGroup JustWidthDeltaGroup;
28390
28391 struct JustPostcompTable {
28392   SFNTLookupTable lookupTable;
28393
28394 };
28395 typedef struct JustPostcompTable JustPostcompTable;
28396 struct JustDirectionTable {
28397   UInt16 justClass;
28398   UInt16 widthDeltaClusters;
28399   UInt16 postcomp;
28400   SFNTLookupTable lookup;
28401 };
28402 typedef struct JustDirectionTable JustDirectionTable;
28403 struct JustTable {
28404   Fixed version;
28405   UInt16 format;
28406   UInt16 horizHeaderOffset;
28407   UInt16 vertHeaderOffset;
28408 };
28409 typedef struct JustTable JustTable;
28410
28411
28412
28413 enum {
28414   kOPBDTag = 0x6F706264,
28415   kOPBDCurrentVersion = 0x00010000,
28416   kOPBDDistanceFormat = 0,
28417   kOPBDControlPointFormat = 1
28418 };
28419
28420
28421
28422 typedef UInt16 OpbdTableFormat;
28423
28424
28425
28426
28427
28428 struct OpbdSideValues {
28429   SInt16 leftSideShift;
28430   SInt16 topSideShift;
28431   SInt16 rightSideShift;
28432   SInt16 bottomSideShift;
28433 };
28434 typedef struct OpbdSideValues OpbdSideValues;
28435 struct OpbdTable {
28436   Fixed version;
28437   OpbdTableFormat format;
28438   SFNTLookupTable lookupTable;
28439 };
28440 typedef struct OpbdTable OpbdTable;
28441
28442
28443
28444 enum {
28445   kMORTTag = 0x6D6F7274,
28446   kMORTCurrentVersion = 0x00010000,
28447
28448   kMORTCoverVertical = 0x8000,
28449   kMORTCoverDescending = 0x4000,
28450   kMORTCoverIgnoreVertical = 0x2000,
28451   kMORTCoverTypeMask = 0x000F,
28452   kMORTRearrangementType = 0,
28453   kMORTContextualType = 1,
28454   kMORTLigatureType = 2,
28455   kMORTSwashType = 4,
28456   kMORTInsertionType = 5,
28457   kMORTLigLastAction = (long)0x80000000,
28458   kMORTLigStoreLigature = 0x40000000,
28459   kMORTLigFormOffsetMask = 0x3FFFFFFF,
28460   kMORTLigFormOffsetShift = 2,
28461   kMORTraNoAction = 0,
28462   kMORTraxA = 1,
28463   kMORTraDx = 2,
28464   kMORTraDxA = 3,
28465   kMORTraxAB = 4,
28466   kMORTraxBA = 5,
28467   kMORTraCDx = 6,
28468   kMORTraDCx = 7,
28469   kMORTraCDxA = 8,
28470   kMORTraDCxA = 9,
28471   kMORTraDxAB = 10,
28472   kMORTraDxBA = 11,
28473   kMORTraCDxAB = 12,
28474   kMORTraCDxBA = 13,
28475   kMORTraDCxAB = 14,
28476   kMORTraDCxBA = 15,
28477
28478   kMORTDoInsertionsBefore = 0x80,
28479   kMORTIsSplitVowelPiece = 0x40,
28480   kMORTInsertionsCountMask = 0x3F,
28481   kMORTCurrInsertKashidaLike = 0x2000,
28482   kMORTMarkInsertKashidaLike = 0x1000,
28483   kMORTCurrInsertBefore = 0x0800,
28484   kMORTMarkInsertBefore = 0x0400,
28485   kMORTMarkJustTableCountMask = 0x3F80,
28486   kMORTMarkJustTableCountShift = 7,
28487   kMORTCurrJustTableCountMask = 0x007F,
28488   kMORTCurrJustTableCountShift = 0,
28489   kMORTCurrInsertCountMask = 0x03E0,
28490   kMORTCurrInsertCountShift = 5,
28491   kMORTMarkInsertCountMask = 0x001F,
28492   kMORTMarkInsertCountShift = 0
28493 };
28494
28495
28496
28497 typedef UInt32 MortSubtableMaskFlags;
28498 typedef UInt32 MortLigatureActionEntry;
28499 struct MortRearrangementSubtable {
28500   STHeader header;
28501 };
28502 typedef struct MortRearrangementSubtable MortRearrangementSubtable;
28503 struct MortContextualSubtable {
28504   STHeader header;
28505   UInt16 substitutionTableOffset;
28506 };
28507 typedef struct MortContextualSubtable MortContextualSubtable;
28508 struct MortLigatureSubtable {
28509   STHeader header;
28510   UInt16 ligatureActionTableOffset;
28511   UInt16 componentTableOffset;
28512   UInt16 ligatureTableOffset;
28513 };
28514 typedef struct MortLigatureSubtable MortLigatureSubtable;
28515 struct MortSwashSubtable {
28516   SFNTLookupTable lookup;
28517 };
28518 typedef struct MortSwashSubtable MortSwashSubtable;
28519 struct MortInsertionSubtable {
28520   STHeader header;
28521 };
28522 typedef struct MortInsertionSubtable MortInsertionSubtable;
28523 union MortSpecificSubtable {
28524   MortRearrangementSubtable rearrangement;
28525   MortContextualSubtable contextual;
28526   MortLigatureSubtable ligature;
28527   MortSwashSubtable swash;
28528   MortInsertionSubtable insertion;
28529 };
28530 typedef union MortSpecificSubtable MortSpecificSubtable;
28531 struct MortSubtable {
28532   UInt16 length;
28533   UInt16 coverage;
28534   MortSubtableMaskFlags flags;
28535   MortSpecificSubtable u;
28536 };
28537 typedef struct MortSubtable MortSubtable;
28538 struct MortFeatureEntry {
28539   UInt16 featureType;
28540   UInt16 featureSelector;
28541   MortSubtableMaskFlags enableFlags;
28542   MortSubtableMaskFlags disableFlags;
28543 };
28544 typedef struct MortFeatureEntry MortFeatureEntry;
28545 struct MortChain {
28546   MortSubtableMaskFlags defaultFlags;
28547   UInt32 length;
28548   UInt16 nFeatures;
28549   UInt16 nSubtables;
28550   MortFeatureEntry featureEntries[1];
28551
28552 };
28553 typedef struct MortChain MortChain;
28554 struct MortTable {
28555   Fixed version;
28556   UInt32 nChains;
28557   MortChain chains[1];
28558 };
28559 typedef struct MortTable MortTable;
28560
28561
28562
28563 enum {
28564   kMORXTag = 0x6D6F7278,
28565   kMORXCurrentVersion = 0x00020000,
28566
28567   kMORXCoverVertical = (long)0x80000000,
28568   kMORXCoverDescending = 0x40000000,
28569   kMORXCoverIgnoreVertical = 0x20000000,
28570   kMORXCoverTypeMask = 0x000000FF
28571 };
28572
28573
28574 struct MorxRearrangementSubtable {
28575   STXHeader header;
28576 };
28577 typedef struct MorxRearrangementSubtable MorxRearrangementSubtable;
28578 struct MorxContextualSubtable {
28579   STXHeader header;
28580   UInt32 substitutionTableOffset;
28581 };
28582 typedef struct MorxContextualSubtable MorxContextualSubtable;
28583 struct MorxLigatureSubtable {
28584   STXHeader header;
28585   UInt32 ligatureActionTableOffset;
28586   UInt32 componentTableOffset;
28587   UInt32 ligatureTableOffset;
28588 };
28589 typedef struct MorxLigatureSubtable MorxLigatureSubtable;
28590 struct MorxInsertionSubtable {
28591   STXHeader header;
28592   UInt32 insertionGlyphTableOffset;
28593 };
28594 typedef struct MorxInsertionSubtable MorxInsertionSubtable;
28595 union MorxSpecificSubtable {
28596   MorxRearrangementSubtable rearrangement;
28597   MorxContextualSubtable contextual;
28598   MorxLigatureSubtable ligature;
28599   MortSwashSubtable swash;
28600   MorxInsertionSubtable insertion;
28601 };
28602 typedef union MorxSpecificSubtable MorxSpecificSubtable;
28603 struct MorxSubtable {
28604   UInt32 length;
28605   UInt32 coverage;
28606   MortSubtableMaskFlags flags;
28607   MorxSpecificSubtable u;
28608 };
28609 typedef struct MorxSubtable MorxSubtable;
28610 struct MorxChain {
28611   MortSubtableMaskFlags defaultFlags;
28612   UInt32 length;
28613   UInt32 nFeatures;
28614   UInt32 nSubtables;
28615   MortFeatureEntry featureEntries[1];
28616
28617 };
28618 typedef struct MorxChain MorxChain;
28619 struct MorxTable {
28620   Fixed version;
28621   UInt32 nChains;
28622   MorxChain chains[1];
28623 };
28624 typedef struct MorxTable MorxTable;
28625
28626
28627
28628 enum {
28629   kPROPTag = 0x70726F70,
28630   kPROPCurrentVersion = 0x00030000,
28631   kPROPPairOffsetShift = 8,
28632   kPROPPairOffsetSign = 7,
28633   kPROPIsFloaterMask = 0x8000,
28634   kPROPCanHangLTMask = 0x4000,
28635   kPROPCanHangRBMask = 0x2000,
28636   kPROPUseRLPairMask = 0x1000,
28637   kPROPPairOffsetMask = 0x0F00,
28638   kPROPRightConnectMask = 0x0080,
28639   kPROPZeroReserved = 0x0060,
28640   kPROPDirectionMask = 0x001F
28641 };
28642
28643
28644 enum {
28645   kPROPLDirectionClass = 0,
28646   kPROPRDirectionClass = 1,
28647   kPROPALDirectionClass = 2,
28648   kPROPENDirectionClass = 3,
28649   kPROPESDirectionClass = 4,
28650   kPROPETDirectionClass = 5,
28651   kPROPANDirectionClass = 6,
28652   kPROPCSDirectionClass = 7,
28653   kPROPPSDirectionClass = 8,
28654   kPROPSDirectionClass = 9,
28655   kPROPWSDirectionClass = 10,
28656   kPROPONDirectionClass = 11,
28657   kPROPSENDirectionClass = 12,
28658   kPROPLREDirectionClass = 13,
28659   kPROPLRODirectionClass = 14,
28660   kPROPRLEDirectionClass = 15,
28661   kPROPRLODirectionClass = 16,
28662   kPROPPDFDirectionClass = 17,
28663   kPROPNSMDirectionClass = 18,
28664   kPROPBNDirectionClass = 19,
28665   kPROPNumDirectionClasses = 20
28666 };
28667
28668
28669
28670 typedef UInt16 PropCharProperties;
28671 struct PropTable {
28672   Fixed version;
28673   UInt16 format;
28674   PropCharProperties defaultProps;
28675   SFNTLookupTable lookup;
28676 };
28677 typedef struct PropTable PropTable;
28678 struct PropLookupSegment {
28679   UInt16 lastGlyph;
28680   UInt16 firstGlyph;
28681   UInt16 value;
28682 };
28683 typedef struct PropLookupSegment PropLookupSegment;
28684 struct PropLookupSingle {
28685   UInt16 glyph;
28686   PropCharProperties props;
28687 };
28688 typedef struct PropLookupSingle PropLookupSingle;
28689
28690
28691
28692 enum {
28693   kTRAKTag = 0x7472616B,
28694   kTRAKCurrentVersion = 0x00010000,
28695   kTRAKUniformFormat = 0
28696 };
28697
28698
28699
28700 typedef SInt16 TrakValue;
28701 struct TrakTableEntry {
28702   Fixed track;
28703   UInt16 nameTableIndex;
28704   UInt16 sizesOffset;
28705 };
28706 typedef struct TrakTableEntry TrakTableEntry;
28707 struct TrakTableData {
28708   UInt16 nTracks;
28709   UInt16 nSizes;
28710   UInt32 sizeTableOffset;
28711   TrakTableEntry trakTable[1];
28712 };
28713 typedef struct TrakTableData TrakTableData;
28714 struct TrakTable {
28715   Fixed version;
28716   UInt16 format;
28717   UInt16 horizOffset;
28718   UInt16 vertOffset;
28719 };
28720 typedef struct TrakTable TrakTable;
28721
28722
28723
28724 enum {
28725   kKERNTag = 0x6B65726E,
28726   kKERNCurrentVersion = 0x00010000,
28727   kKERNVertical = 0x8000,
28728   kKERNResetCrossStream = 0x8000,
28729   kKERNCrossStream = 0x4000,
28730   kKERNVariation = 0x2000,
28731   kKERNUnusedBits = 0x1F00,
28732   kKERNFormatMask = 0x00FF
28733 };
28734
28735 enum {
28736   kKERNOrderedList = 0,
28737   kKERNStateTable = 1,
28738   kKERNSimpleArray = 2,
28739   kKERNIndexArray = 3
28740 };
28741
28742
28743 enum {
28744   kKERNLineStart = 0x00000001,
28745   kKERNLineEndKerning = 0x00000002,
28746   kKERNNoCrossKerning = 0x00000004,
28747   kKERNNotesRequested = 0x00000008,
28748   kKERNNoStakeNote = 1,
28749   kKERNCrossStreamResetNote = 2,
28750   kKERNNotApplied = 0x00000001
28751 };
28752
28753
28754
28755 typedef UInt8 KernTableFormat;
28756 typedef UInt16 KernSubtableInfo;
28757 typedef SInt16 KernKerningValue;
28758 typedef UInt16 KernArrayOffset;
28759
28760 struct KernVersion0Header {
28761   UInt16 version;
28762   UInt16 nTables;
28763   UInt16 firstSubtable[1];
28764 };
28765 typedef struct KernVersion0Header KernVersion0Header;
28766
28767 struct KernTableHeader {
28768   Fixed version;
28769   SInt32 nTables;
28770   UInt16 firstSubtable[1];
28771 };
28772 typedef struct KernTableHeader KernTableHeader;
28773 typedef KernTableHeader * KernTableHeaderPtr;
28774 typedef KernTableHeaderPtr * KernTableHeaderHandle;
28775 struct KernKerningPair {
28776   UInt16 left;
28777   UInt16 right;
28778 };
28779 typedef struct KernKerningPair KernKerningPair;
28780
28781 struct KernOrderedListEntry {
28782   KernKerningPair pair;
28783   KernKerningValue value;
28784 };
28785 typedef struct KernOrderedListEntry KernOrderedListEntry;
28786 typedef KernOrderedListEntry * KernOrderedListEntryPtr;
28787
28788 struct KernOrderedListHeader {
28789   UInt16 nPairs;
28790   UInt16 searchRange;
28791   UInt16 entrySelector;
28792   UInt16 rangeShift;
28793   UInt16 table[1];
28794 };
28795 typedef struct KernOrderedListHeader KernOrderedListHeader;
28796
28797 struct KernStateHeader {
28798   STHeader header;
28799   UInt16 valueTable;
28800   UInt8 firstTable[1];
28801 };
28802 typedef struct KernStateHeader KernStateHeader;
28803 struct KernStateEntry {
28804   UInt16 newState;
28805   UInt16 flags;
28806 };
28807 typedef struct KernStateEntry KernStateEntry;
28808
28809
28810
28811
28812
28813
28814 struct KernOffsetTable {
28815   UInt16 firstGlyph;
28816   UInt16 nGlyphs;
28817   KernArrayOffset offsetTable[1];
28818 };
28819 typedef struct KernOffsetTable KernOffsetTable;
28820 typedef KernOffsetTable * KernOffsetTablePtr;
28821 struct KernSimpleArrayHeader {
28822   UInt16 rowWidth;
28823   UInt16 leftOffsetTable;
28824   UInt16 rightOffsetTable;
28825   KernArrayOffset theArray;
28826   UInt16 firstTable[1];
28827 };
28828 typedef struct KernSimpleArrayHeader KernSimpleArrayHeader;
28829
28830 struct KernIndexArrayHeader {
28831   UInt16 glyphCount;
28832   UInt8 kernValueCount;
28833   UInt8 leftClassCount;
28834   UInt8 rightClassCount;
28835   UInt8 flags;
28836   SInt16 kernValue[1];
28837   UInt8 leftClass[1];
28838   UInt8 rightClass[1];
28839   UInt8 kernIndex[1];
28840 };
28841 typedef struct KernIndexArrayHeader KernIndexArrayHeader;
28842
28843 union KernFormatSpecificHeader {
28844   KernOrderedListHeader orderedList;
28845   KernStateHeader stateTable;
28846   KernSimpleArrayHeader simpleArray;
28847   KernIndexArrayHeader indexArray;
28848 };
28849 typedef union KernFormatSpecificHeader KernFormatSpecificHeader;
28850
28851 struct KernVersion0SubtableHeader {
28852   UInt16 version;
28853   UInt16 length;
28854   KernSubtableInfo stInfo;
28855   KernFormatSpecificHeader fsHeader;
28856 };
28857 typedef struct KernVersion0SubtableHeader KernVersion0SubtableHeader;
28858
28859 struct KernSubtableHeader {
28860   SInt32 length;
28861   KernSubtableInfo stInfo;
28862   SInt16 tupleIndex;
28863   KernFormatSpecificHeader fsHeader;
28864 };
28865 typedef struct KernSubtableHeader KernSubtableHeader;
28866 typedef KernSubtableHeader * KernSubtableHeaderPtr;
28867
28868
28869
28870 enum {
28871   kBSLNTag = 0x62736C6E,
28872   kBSLNCurrentVersion = 0x00010000,
28873   kBSLNDistanceFormatNoMap = 0,
28874   kBSLNDistanceFormatWithMap = 1,
28875   kBSLNControlPointFormatNoMap = 2,
28876   kBSLNControlPointFormatWithMap = 3
28877 };
28878
28879
28880 enum {
28881   kBSLNRomanBaseline = 0,
28882   kBSLNIdeographicCenterBaseline = 1,
28883   kBSLNIdeographicLowBaseline = 2,
28884   kBSLNHangingBaseline = 3,
28885   kBSLNMathBaseline = 4,
28886   kBSLNLastBaseline = 31,
28887   kBSLNNumBaselineClasses = kBSLNLastBaseline + 1,
28888   kBSLNNoBaselineOverride = 255
28889 };
28890
28891
28892 typedef UInt32 BslnBaselineClass;
28893
28894 typedef Fixed BslnBaselineRecord[32];
28895
28896
28897
28898
28899 struct BslnFormat0Part {
28900   SInt16 deltas[32];
28901 };
28902 typedef struct BslnFormat0Part BslnFormat0Part;
28903
28904 struct BslnFormat1Part {
28905   SInt16 deltas[32];
28906   SFNTLookupTable mappingData;
28907 };
28908 typedef struct BslnFormat1Part BslnFormat1Part;
28909
28910
28911
28912
28913
28914
28915 struct BslnFormat2Part {
28916   UInt16 stdGlyph;
28917   SInt16 ctlPoints[32];
28918 };
28919 typedef struct BslnFormat2Part BslnFormat2Part;
28920
28921
28922
28923
28924
28925 struct BslnFormat3Part {
28926   UInt16 stdGlyph;
28927   SInt16 ctlPoints[32];
28928   SFNTLookupTable mappingData;
28929 };
28930 typedef struct BslnFormat3Part BslnFormat3Part;
28931
28932 union BslnFormatUnion {
28933   BslnFormat0Part fmt0Part;
28934   BslnFormat1Part fmt1Part;
28935   BslnFormat2Part fmt2Part;
28936   BslnFormat3Part fmt3Part;
28937 };
28938 typedef union BslnFormatUnion BslnFormatUnion;
28939
28940
28941 typedef UInt16 BslnTableFormat;
28942
28943 struct BslnTable {
28944   Fixed version;
28945   BslnTableFormat format;
28946   UInt16 defaultBaseline;
28947   BslnFormatUnion parts;
28948 };
28949 typedef struct BslnTable BslnTable;
28950 typedef BslnTable * BslnTablePtr;
28951
28952
28953
28954
28955
28956 extern "C" {
28957
28958
28959
28960 typedef UInt32 FMGeneration;
28961
28962
28963
28964
28965
28966
28967
28968 typedef SInt16 FMFontFamily;
28969 typedef SInt16 FMFontStyle;
28970 typedef SInt16 FMFontSize;
28971
28972
28973
28974
28975
28976
28977
28978 typedef UInt32 FMFont;
28979 struct FMFontFamilyInstance {
28980   FMFontFamily fontFamily;
28981   FMFontStyle fontStyle;
28982 };
28983 typedef struct FMFontFamilyInstance FMFontFamilyInstance;
28984 struct FMFontFamilyIterator {
28985   UInt32 reserved[16];
28986 };
28987 typedef struct FMFontFamilyIterator FMFontFamilyIterator;
28988 struct FMFontIterator {
28989   UInt32 reserved[16];
28990 };
28991 typedef struct FMFontIterator FMFontIterator;
28992 struct FMFontFamilyInstanceIterator {
28993   UInt32 reserved[16];
28994 };
28995 typedef struct FMFontFamilyInstanceIterator FMFontFamilyInstanceIterator;
28996 enum {
28997   kInvalidGeneration = 0L,
28998   kInvalidFontFamily = -1,
28999   kInvalidFont = 0L
29000 };
29001
29002 enum {
29003   kFMCurrentFilterFormat = 0L
29004 };
29005
29006 typedef UInt32 FMFilterSelector;
29007 enum {
29008   kFMFontTechnologyFilterSelector = 1L,
29009   kFMFontContainerFilterSelector = 2L,
29010   kFMGenerationFilterSelector = 3L,
29011   kFMFontFamilyCallbackFilterSelector = 4L,
29012   kFMFontCallbackFilterSelector = 5L,
29013   kFMFontDirectoryFilterSelector = 6L
29014 };
29015
29016 enum {
29017   kFMTrueTypeFontTechnology = 'true',
29018   kFMPostScriptFontTechnology = 'typ1'
29019 };
29020
29021 typedef OSStatus ( * FMFontFamilyCallbackFilterProcPtr)(FMFontFamily iFontFamily, void *iRefCon);
29022 typedef OSStatus ( * FMFontCallbackFilterProcPtr)(FMFont iFont, void *iRefCon);
29023 typedef FMFontFamilyCallbackFilterProcPtr FMFontFamilyCallbackFilterUPP;
29024 typedef FMFontCallbackFilterProcPtr FMFontCallbackFilterUPP;
29025 extern FMFontFamilyCallbackFilterUPP
29026 NewFMFontFamilyCallbackFilterUPP(FMFontFamilyCallbackFilterProcPtr userRoutine) ;
29027 extern FMFontCallbackFilterUPP
29028 NewFMFontCallbackFilterUPP(FMFontCallbackFilterProcPtr userRoutine) ;
29029 extern void
29030 DisposeFMFontFamilyCallbackFilterUPP(FMFontFamilyCallbackFilterUPP userUPP) ;
29031 extern void
29032 DisposeFMFontCallbackFilterUPP(FMFontCallbackFilterUPP userUPP) ;
29033 extern OSStatus
29034 InvokeFMFontFamilyCallbackFilterUPP(
29035   FMFontFamily iFontFamily,
29036   void * iRefCon,
29037   FMFontFamilyCallbackFilterUPP userUPP) ;
29038 extern OSStatus
29039 InvokeFMFontCallbackFilterUPP(
29040   FMFont iFont,
29041   void * iRefCon,
29042   FMFontCallbackFilterUPP userUPP) ;
29043
29044 struct FMFontDirectoryFilter {
29045   SInt16 fontFolderDomain;
29046   UInt32 reserved[2];
29047 };
29048 typedef struct FMFontDirectoryFilter FMFontDirectoryFilter;
29049 struct FMFilter {
29050   UInt32 format;
29051   FMFilterSelector selector;
29052   union {
29053     FourCharCode fontTechnologyFilter;
29054     FSSpec fontContainerFilter;
29055     FMGeneration generationFilter;
29056     FMFontFamilyCallbackFilterUPP fontFamilyCallbackFilter;
29057     FMFontCallbackFilterUPP fontCallbackFilter;
29058     FMFontDirectoryFilter fontDirectoryFilter;
29059   } filter;
29060 };
29061 typedef struct FMFilter FMFilter;
29062
29063 typedef OptionBits ATSOptionFlags;
29064 typedef UInt32 ATSGeneration;
29065 typedef UInt32 ATSFontContainerRef;
29066 typedef UInt32 ATSFontFamilyRef;
29067 typedef UInt32 ATSFontRef;
29068 typedef UInt16 ATSGlyphRef;
29069 typedef Float32 ATSFontSize;
29070 enum {
29071   kATSGenerationUnspecified = 0L,
29072   kATSFontContainerRefUnspecified = 0L,
29073   kATSFontFamilyRefUnspecified = 0L,
29074   kATSFontRefUnspecified = 0L
29075 };
29076
29077 struct ATSFontMetrics {
29078   UInt32 version;
29079   Float32 ascent;
29080
29081   Float32 descent;
29082
29083   Float32 leading;
29084   Float32 avgAdvanceWidth;
29085   Float32 maxAdvanceWidth;
29086   Float32 minLeftSideBearing;
29087   Float32 minRightSideBearing;
29088   Float32 stemWidth;
29089   Float32 stemHeight;
29090   Float32 capHeight;
29091   Float32 xHeight;
29092   Float32 italicAngle;
29093   Float32 underlinePosition;
29094   Float32 underlineThickness;
29095 };
29096 typedef struct ATSFontMetrics ATSFontMetrics;
29097 enum {
29098   kATSItalicQDSkew = (1 << 16) / 4,
29099   kATSBoldQDStretch = (1 << 16) * 3 / 2,
29100   kATSRadiansFactor = 1144
29101 };
29102
29103
29104 typedef UInt16 ATSCurveType;
29105 enum {
29106   kATSCubicCurveType = 0x0001,
29107   kATSQuadCurveType = 0x0002,
29108   kATSOtherCurveType = 0x0003
29109 };
29110
29111
29112
29113
29114
29115
29116 enum {
29117   kATSDeletedGlyphcode = 0xFFFF
29118 };
29119
29120 struct ATSUCurvePath {
29121   UInt32 vectors;
29122   UInt32 controlBits[1];
29123   Float32Point vector[1];
29124 };
29125 typedef struct ATSUCurvePath ATSUCurvePath;
29126 struct ATSUCurvePaths {
29127   UInt32 contours;
29128   ATSUCurvePath contour[1];
29129 };
29130 typedef struct ATSUCurvePaths ATSUCurvePaths;
29131
29132 struct ATSGlyphIdealMetrics {
29133   Float32Point advance;
29134   Float32Point sideBearing;
29135   Float32Point otherSideBearing;
29136 };
29137 typedef struct ATSGlyphIdealMetrics ATSGlyphIdealMetrics;
29138
29139 struct ATSGlyphScreenMetrics {
29140   Float32Point deviceAdvance;
29141   Float32Point topLeft;
29142   UInt32 height;
29143   UInt32 width;
29144   Float32Point sideBearing;
29145   Float32Point otherSideBearing;
29146 };
29147 typedef struct ATSGlyphScreenMetrics ATSGlyphScreenMetrics;
29148
29149
29150 typedef ATSGlyphRef GlyphID;
29151
29152
29153
29154 }
29155 extern "C" {
29156
29157
29158
29159
29160
29161
29162
29163
29164
29165 enum {
29166   kATSUseGlyphAdvance = 0x7FFFFFFF,
29167   kATSUseLineHeight = 0x7FFFFFFF,
29168   kATSNoTracking = (long)0x80000000
29169 };
29170 enum {
29171
29172
29173
29174
29175
29176
29177   kATSUseCaretOrigins = 0,
29178
29179
29180
29181
29182
29183
29184   kATSUseDeviceOrigins = 1,
29185   kATSUseFractionalOrigins = 2,
29186   kATSUseOriginFlags = 3
29187 };
29188 typedef UInt32 ATSULayoutOperationSelector;
29189 enum {
29190
29191
29192
29193
29194   kATSULayoutOperationNone = 0x00000000,
29195
29196
29197
29198
29199   kATSULayoutOperationJustification = 0x00000001,
29200
29201
29202
29203
29204   kATSULayoutOperationMorph = 0x00000002,
29205
29206
29207
29208
29209   kATSULayoutOperationKerningAdjustment = 0x00000004,
29210
29211
29212
29213
29214   kATSULayoutOperationBaselineAdjustment = 0x00000008,
29215
29216
29217
29218
29219   kATSULayoutOperationTrackingAdjustment = 0x00000010,
29220
29221
29222
29223
29224
29225   kATSULayoutOperationPostLayoutAdjustment = 0x00000020,
29226   kATSULayoutOperationAppleReserved = (unsigned long)0xFFFFFFC0
29227 };
29228 typedef UInt32 ATSULayoutOperationCallbackStatus;
29229 enum {
29230
29231
29232
29233
29234
29235
29236   kATSULayoutOperationCallbackStatusHandled = 0x00000000,
29237
29238
29239
29240
29241
29242
29243   kATSULayoutOperationCallbackStatusContinue = 0x00000001
29244 };
29245 typedef UInt32 ATSLineLayoutOptions;
29246 enum {
29247
29248
29249
29250
29251   kATSLineNoLayoutOptions = 0x00000000,
29252
29253
29254
29255
29256   kATSLineIsDisplayOnly = 0x00000001,
29257
29258
29259
29260
29261   kATSLineHasNoHangers = 0x00000002,
29262
29263
29264
29265
29266   kATSLineHasNoOpticalAlignment = 0x00000004,
29267
29268
29269
29270
29271   kATSLineKeepSpacesOutOfMargin = 0x00000008,
29272
29273
29274
29275
29276   kATSLineNoSpecialJustification = 0x00000010,
29277
29278
29279
29280
29281
29282   kATSLineLastNoJustification = 0x00000020,
29283
29284
29285
29286
29287
29288   kATSLineFractDisable = 0x00000040,
29289
29290
29291
29292
29293
29294   kATSLineImposeNoAngleForEnds = 0x00000080,
29295
29296
29297
29298
29299
29300   kATSLineFillOutToWidth = 0x00000100,
29301
29302
29303
29304
29305
29306   kATSLineTabAdjustEnabled = 0x00000200,
29307
29308
29309
29310
29311
29312   kATSLineIgnoreFontLeading = 0x00000400,
29313
29314
29315
29316
29317
29318   kATSLineApplyAntiAliasing = 0x00000800,
29319
29320
29321
29322
29323
29324
29325   kATSLineNoAntiAliasing = 0x00001000,
29326
29327
29328
29329
29330
29331
29332   kATSLineDisableNegativeJustification = 0x00002000,
29333
29334
29335
29336
29337
29338
29339
29340   kATSLineDisableAutoAdjustDisplayPos = 0x00004000,
29341
29342
29343
29344
29345
29346   kATSLineUseQDRendering = 0x00008000,
29347
29348
29349
29350
29351   kATSLineDisableAllJustification = 0x00010000,
29352
29353
29354
29355
29356   kATSLineDisableAllGlyphMorphing = 0x00020000,
29357
29358
29359
29360
29361   kATSLineDisableAllKerningAdjustments = 0x00040000,
29362
29363
29364
29365
29366   kATSLineDisableAllBaselineAdjustments = 0x00080000,
29367
29368
29369
29370
29371   kATSLineDisableAllTrackingAdjustments = 0x00100000,
29372
29373
29374
29375
29376   kATSLineDisableAllLayoutOperations = kATSLineDisableAllJustification | kATSLineDisableAllGlyphMorphing | kATSLineDisableAllKerningAdjustments | kATSLineDisableAllBaselineAdjustments | kATSLineDisableAllTrackingAdjustments,
29377
29378
29379
29380
29381
29382   kATSLineUseDeviceMetrics = 0x01000000,
29383
29384
29385
29386
29387
29388   kATSLineAppleReserved = (unsigned long)0xFEE00000
29389 };
29390 typedef UInt32 ATSStyleRenderingOptions;
29391 enum {
29392
29393
29394
29395
29396   kATSStyleNoOptions = 0x00000000,
29397
29398
29399
29400
29401
29402   kATSStyleNoHinting = 0x00000001,
29403
29404
29405
29406
29407
29408   kATSStyleApplyAntiAliasing = 0x00000002,
29409
29410
29411
29412
29413
29414
29415   kATSStyleNoAntiAliasing = 0x00000004,
29416
29417
29418
29419
29420
29421   kATSStyleAppleReserved = (unsigned long)0xFFFFFFF8,
29422
29423
29424
29425
29426
29427
29428   kATSStyleApplyHints = kATSStyleNoOptions
29429 };
29430 typedef UInt32 ATSGlyphInfoFlags;
29431 enum {
29432
29433
29434
29435
29436
29437   kATSGlyphInfoAppleReserved = 0x1FFBFFE8,
29438
29439
29440
29441
29442   kATSGlyphInfoIsAttachment = (unsigned long)0x80000000,
29443
29444
29445
29446
29447   kATSGlyphInfoIsLTHanger = 0x40000000,
29448
29449
29450
29451
29452   kATSGlyphInfoIsRBHanger = 0x20000000,
29453
29454
29455
29456
29457
29458   kATSGlyphInfoTerminatorGlyph = 0x00080000,
29459
29460
29461
29462
29463   kATSGlyphInfoIsWhiteSpace = 0x00040000,
29464
29465
29466
29467
29468   kATSGlyphInfoHasImposedWidth = 0x00000010,
29469
29470
29471
29472
29473
29474
29475
29476   kATSGlyphInfoByteSizeMask = 0x00000007
29477 };
29478 struct ATSLayoutRecord {
29479
29480
29481
29482
29483   ATSGlyphRef glyphID;
29484
29485
29486
29487
29488   ATSGlyphInfoFlags flags;
29489
29490
29491
29492
29493   ByteCount originalOffset;
29494
29495
29496
29497
29498   Fixed realPos;
29499 };
29500 typedef struct ATSLayoutRecord ATSLayoutRecord;
29501 struct ATSTrapezoid {
29502   FixedPoint upperLeft;
29503   FixedPoint upperRight;
29504   FixedPoint lowerRight;
29505   FixedPoint lowerLeft;
29506 };
29507 typedef struct ATSTrapezoid ATSTrapezoid;
29508 struct ATSJustWidthDeltaEntryOverride {
29509
29510
29511
29512
29513   Fixed beforeGrowLimit;
29514
29515
29516
29517
29518   Fixed beforeShrinkLimit;
29519
29520
29521
29522
29523   Fixed afterGrowLimit;
29524
29525
29526
29527
29528   Fixed afterShrinkLimit;
29529
29530
29531
29532
29533   JustificationFlags growFlags;
29534
29535
29536
29537
29538   JustificationFlags shrinkFlags;
29539 };
29540 typedef struct ATSJustWidthDeltaEntryOverride ATSJustWidthDeltaEntryOverride;
29541
29542 typedef ATSJustWidthDeltaEntryOverride ATSJustPriorityWidthDeltaOverrides[4];
29543 typedef struct ATSGlyphVector* ATSULineRef;
29544 typedef OSStatus ( * ATSUDirectLayoutOperationOverrideProcPtr)(ATSULayoutOperationSelector iCurrentOperation, ATSULineRef iLineRef, UInt32 iRefCon, void *iOperationCallbackParameterPtr, ATSULayoutOperationCallbackStatus *oCallbackStatus);
29545 typedef ATSUDirectLayoutOperationOverrideProcPtr ATSUDirectLayoutOperationOverrideUPP;
29546 extern ATSUDirectLayoutOperationOverrideUPP
29547 NewATSUDirectLayoutOperationOverrideUPP(ATSUDirectLayoutOperationOverrideProcPtr userRoutine) ;
29548 extern void
29549 DisposeATSUDirectLayoutOperationOverrideUPP(ATSUDirectLayoutOperationOverrideUPP userUPP) ;
29550 extern OSStatus
29551 InvokeATSUDirectLayoutOperationOverrideUPP(
29552   ATSULayoutOperationSelector iCurrentOperation,
29553   ATSULineRef iLineRef,
29554   UInt32 iRefCon,
29555   void * iOperationCallbackParameterPtr,
29556   ATSULayoutOperationCallbackStatus * oCallbackStatus,
29557   ATSUDirectLayoutOperationOverrideUPP userUPP) ;
29558 struct ATSULayoutOperationOverrideSpecifier {
29559
29560
29561
29562
29563
29564
29565   ATSULayoutOperationSelector operationSelector;
29566   ATSUDirectLayoutOperationOverrideUPP overrideUPP;
29567
29568 };
29569 typedef struct ATSULayoutOperationOverrideSpecifier ATSULayoutOperationOverrideSpecifier;
29570
29571
29572
29573 }
29574
29575
29576
29577
29578
29579 extern double acos (double);
29580 extern double asin (double);
29581 extern double atan (double);
29582 extern double atan2 (double, double);
29583 extern double ceil (double);
29584 extern double cos (double);
29585 extern double cosh (double);
29586 extern double exp (double);
29587 extern double fabs (double);
29588 extern double floor (double);
29589 extern double fmod (double, double);
29590 extern double frexp (double, int *);
29591 extern double ldexp (double, int);
29592 extern double log10 (double);
29593 extern double log (double);
29594 extern double modf (double, double *);
29595 extern double pow (double, double);
29596 extern double sin (double);
29597 extern double sinh (double);
29598 extern double sqrt (double);
29599 extern double tan (double);
29600 extern double tanh (double);
29601
29602
29603
29604
29605
29606
29607
29608
29609
29610
29611 struct sfntDirectoryEntry {
29612   FourCharCode tableTag;
29613   UInt32 checkSum;
29614   UInt32 offset;
29615   UInt32 length;
29616 };
29617 typedef struct sfntDirectoryEntry sfntDirectoryEntry;
29618
29619 struct sfntDirectory {
29620   FourCharCode format;
29621   UInt16 numOffsets;
29622   UInt16 searchRange;
29623   UInt16 entrySelector;
29624   UInt16 rangeShift;
29625   sfntDirectoryEntry table[1];
29626 };
29627 typedef struct sfntDirectory sfntDirectory;
29628 enum {
29629   sizeof_sfntDirectory = 12
29630 };
29631
29632
29633 enum {
29634   cmapFontTableTag = 'cmap'
29635 };
29636
29637 enum {
29638   kFontUnicodePlatform = 0,
29639   kFontMacintoshPlatform = 1,
29640   kFontReservedPlatform = 2,
29641   kFontMicrosoftPlatform = 3,
29642   kFontCustomPlatform = 4
29643 };
29644
29645 enum {
29646   kFontUnicodeDefaultSemantics = 0,
29647   kFontUnicodeV1_1Semantics = 1,
29648   kFontISO10646_1993Semantics = 2
29649 };
29650
29651 enum {
29652   kFontRomanScript = 0,
29653   kFontJapaneseScript = 1,
29654   kFontTraditionalChineseScript = 2,
29655   kFontChineseScript = kFontTraditionalChineseScript,
29656   kFontKoreanScript = 3,
29657   kFontArabicScript = 4,
29658   kFontHebrewScript = 5,
29659   kFontGreekScript = 6,
29660   kFontCyrillicScript = 7,
29661   kFontRussian = kFontCyrillicScript,
29662   kFontRSymbolScript = 8,
29663   kFontDevanagariScript = 9,
29664   kFontGurmukhiScript = 10,
29665   kFontGujaratiScript = 11,
29666   kFontOriyaScript = 12,
29667   kFontBengaliScript = 13,
29668   kFontTamilScript = 14,
29669   kFontTeluguScript = 15,
29670   kFontKannadaScript = 16,
29671   kFontMalayalamScript = 17,
29672   kFontSinhaleseScript = 18,
29673   kFontBurmeseScript = 19,
29674   kFontKhmerScript = 20,
29675   kFontThaiScript = 21,
29676   kFontLaotianScript = 22,
29677   kFontGeorgianScript = 23,
29678   kFontArmenianScript = 24,
29679   kFontSimpleChineseScript = 25,
29680   kFontTibetanScript = 26,
29681   kFontMongolianScript = 27,
29682   kFontGeezScript = 28,
29683   kFontEthiopicScript = kFontGeezScript,
29684   kFontAmharicScript = kFontGeezScript,
29685   kFontSlavicScript = 29,
29686   kFontEastEuropeanRomanScript = kFontSlavicScript,
29687   kFontVietnameseScript = 30,
29688   kFontExtendedArabicScript = 31,
29689   kFontSindhiScript = kFontExtendedArabicScript,
29690   kFontUninterpretedScript = 32
29691 };
29692
29693 enum {
29694   kFontMicrosoftSymbolScript = 0,
29695   kFontMicrosoftStandardScript = 1,
29696   kFontMicrosoftUCS4Script = 10
29697 };
29698
29699
29700 enum {
29701   kFontCustom8BitScript = 0,
29702   kFontCustom816BitScript = 1,
29703   kFontCustom16BitScript = 2
29704 };
29705
29706
29707 enum {
29708   kFontEnglishLanguage = 0,
29709   kFontFrenchLanguage = 1,
29710   kFontGermanLanguage = 2,
29711   kFontItalianLanguage = 3,
29712   kFontDutchLanguage = 4,
29713   kFontSwedishLanguage = 5,
29714   kFontSpanishLanguage = 6,
29715   kFontDanishLanguage = 7,
29716   kFontPortugueseLanguage = 8,
29717   kFontNorwegianLanguage = 9,
29718   kFontHebrewLanguage = 10,
29719   kFontJapaneseLanguage = 11,
29720   kFontArabicLanguage = 12,
29721   kFontFinnishLanguage = 13,
29722   kFontGreekLanguage = 14,
29723   kFontIcelandicLanguage = 15,
29724   kFontMalteseLanguage = 16,
29725   kFontTurkishLanguage = 17,
29726   kFontCroatianLanguage = 18,
29727   kFontTradChineseLanguage = 19,
29728   kFontUrduLanguage = 20,
29729   kFontHindiLanguage = 21,
29730   kFontThaiLanguage = 22,
29731   kFontKoreanLanguage = 23,
29732   kFontLithuanianLanguage = 24,
29733   kFontPolishLanguage = 25,
29734   kFontHungarianLanguage = 26,
29735   kFontEstonianLanguage = 27,
29736   kFontLettishLanguage = 28,
29737   kFontLatvianLanguage = kFontLettishLanguage,
29738   kFontSaamiskLanguage = 29,
29739   kFontLappishLanguage = kFontSaamiskLanguage,
29740   kFontFaeroeseLanguage = 30,
29741   kFontFarsiLanguage = 31,
29742   kFontPersianLanguage = kFontFarsiLanguage,
29743   kFontRussianLanguage = 32,
29744   kFontSimpChineseLanguage = 33,
29745   kFontFlemishLanguage = 34,
29746   kFontIrishLanguage = 35,
29747   kFontAlbanianLanguage = 36,
29748   kFontRomanianLanguage = 37,
29749   kFontCzechLanguage = 38,
29750   kFontSlovakLanguage = 39,
29751   kFontSlovenianLanguage = 40,
29752   kFontYiddishLanguage = 41,
29753   kFontSerbianLanguage = 42,
29754   kFontMacedonianLanguage = 43,
29755   kFontBulgarianLanguage = 44,
29756   kFontUkrainianLanguage = 45,
29757   kFontByelorussianLanguage = 46,
29758   kFontUzbekLanguage = 47,
29759   kFontKazakhLanguage = 48,
29760   kFontAzerbaijaniLanguage = 49,
29761   kFontAzerbaijanArLanguage = 50,
29762   kFontArmenianLanguage = 51,
29763   kFontGeorgianLanguage = 52,
29764   kFontMoldavianLanguage = 53,
29765   kFontKirghizLanguage = 54,
29766   kFontTajikiLanguage = 55,
29767   kFontTurkmenLanguage = 56,
29768   kFontMongolianLanguage = 57,
29769   kFontMongolianCyrLanguage = 58,
29770   kFontPashtoLanguage = 59,
29771   kFontKurdishLanguage = 60,
29772   kFontKashmiriLanguage = 61,
29773   kFontSindhiLanguage = 62,
29774   kFontTibetanLanguage = 63,
29775   kFontNepaliLanguage = 64,
29776   kFontSanskritLanguage = 65,
29777   kFontMarathiLanguage = 66,
29778   kFontBengaliLanguage = 67,
29779   kFontAssameseLanguage = 68,
29780   kFontGujaratiLanguage = 69,
29781   kFontPunjabiLanguage = 70,
29782   kFontOriyaLanguage = 71,
29783   kFontMalayalamLanguage = 72,
29784   kFontKannadaLanguage = 73,
29785   kFontTamilLanguage = 74,
29786   kFontTeluguLanguage = 75,
29787   kFontSinhaleseLanguage = 76,
29788   kFontBurmeseLanguage = 77,
29789   kFontKhmerLanguage = 78,
29790   kFontLaoLanguage = 79,
29791   kFontVietnameseLanguage = 80,
29792   kFontIndonesianLanguage = 81,
29793   kFontTagalogLanguage = 82,
29794   kFontMalayRomanLanguage = 83,
29795   kFontMalayArabicLanguage = 84,
29796   kFontAmharicLanguage = 85,
29797   kFontTigrinyaLanguage = 86,
29798   kFontGallaLanguage = 87,
29799   kFontOromoLanguage = kFontGallaLanguage,
29800   kFontSomaliLanguage = 88,
29801   kFontSwahiliLanguage = 89,
29802   kFontRuandaLanguage = 90,
29803   kFontRundiLanguage = 91,
29804   kFontChewaLanguage = 92,
29805   kFontMalagasyLanguage = 93,
29806   kFontEsperantoLanguage = 94,
29807   kFontWelshLanguage = 128,
29808   kFontBasqueLanguage = 129,
29809   kFontCatalanLanguage = 130,
29810   kFontLatinLanguage = 131,
29811   kFontQuechuaLanguage = 132,
29812   kFontGuaraniLanguage = 133,
29813   kFontAymaraLanguage = 134,
29814   kFontTatarLanguage = 135,
29815   kFontUighurLanguage = 136,
29816   kFontDzongkhaLanguage = 137,
29817   kFontJavaneseRomLanguage = 138,
29818   kFontSundaneseRomLanguage = 139
29819 };
29820
29821
29822 enum {
29823   kFontNoPlatformCode = (unsigned long)(-1),
29824   kFontNoScriptCode = (unsigned long)(-1),
29825   kFontNoLanguageCode = (unsigned long)(-1)
29826 };
29827
29828 struct sfntCMapSubHeader {
29829   UInt16 format;
29830   UInt16 length;
29831   UInt16 languageID;
29832 };
29833 typedef struct sfntCMapSubHeader sfntCMapSubHeader;
29834 enum {
29835   sizeof_sfntCMapSubHeader = 6
29836 };
29837
29838 struct sfntCMapExtendedSubHeader {
29839   UInt16 format;
29840   UInt16 reserved;
29841   UInt32 length;
29842   UInt32 language;
29843 };
29844 typedef struct sfntCMapExtendedSubHeader sfntCMapExtendedSubHeader;
29845 enum {
29846   sizeof_sfntCMapExtendedSubHeader = 12
29847 };
29848
29849 struct sfntCMapEncoding {
29850   UInt16 platformID;
29851   UInt16 scriptID;
29852   UInt32 offset;
29853 };
29854 typedef struct sfntCMapEncoding sfntCMapEncoding;
29855 enum {
29856   sizeof_sfntCMapEncoding = 8
29857 };
29858
29859 struct sfntCMapHeader {
29860   UInt16 version;
29861   UInt16 numTables;
29862   sfntCMapEncoding encoding[1];
29863 };
29864 typedef struct sfntCMapHeader sfntCMapHeader;
29865 enum {
29866   sizeof_sfntCMapHeader = 4
29867 };
29868
29869
29870 enum {
29871   nameFontTableTag = 'name'
29872 };
29873
29874 enum {
29875   kFontCopyrightName = 0,
29876   kFontFamilyName = 1,
29877   kFontStyleName = 2,
29878   kFontUniqueName = 3,
29879   kFontFullName = 4,
29880   kFontVersionName = 5,
29881   kFontPostscriptName = 6,
29882   kFontTrademarkName = 7,
29883   kFontManufacturerName = 8,
29884   kFontDesignerName = 9,
29885   kFontDescriptionName = 10,
29886   kFontVendorURLName = 11,
29887   kFontDesignerURLName = 12,
29888   kFontLicenseDescriptionName = 13,
29889   kFontLicenseInfoURLName = 14,
29890   kFontLastReservedName = 255
29891 };
29892
29893
29894 enum {
29895   kFontNoNameCode = (unsigned long)(-1)
29896 };
29897
29898 struct sfntNameRecord {
29899   UInt16 platformID;
29900   UInt16 scriptID;
29901   UInt16 languageID;
29902   UInt16 nameID;
29903   UInt16 length;
29904   UInt16 offset;
29905 };
29906 typedef struct sfntNameRecord sfntNameRecord;
29907 enum {
29908   sizeof_sfntNameRecord = 12
29909 };
29910
29911 struct sfntNameHeader {
29912   UInt16 format;
29913   UInt16 count;
29914   UInt16 stringOffset;
29915   sfntNameRecord rec[1];
29916 };
29917 typedef struct sfntNameHeader sfntNameHeader;
29918 enum {
29919   sizeof_sfntNameHeader = 6
29920 };
29921
29922
29923 enum {
29924   variationFontTableTag = 'fvar'
29925 };
29926
29927
29928 struct sfntVariationAxis {
29929   FourCharCode axisTag;
29930   Fixed minValue;
29931   Fixed defaultValue;
29932   Fixed maxValue;
29933   SInt16 flags;
29934   SInt16 nameID;
29935 };
29936 typedef struct sfntVariationAxis sfntVariationAxis;
29937 enum {
29938   sizeof_sfntVariationAxis = 20
29939 };
29940
29941
29942 struct sfntInstance {
29943   SInt16 nameID;
29944   SInt16 flags;
29945   Fixed coord[1];
29946
29947 };
29948 typedef struct sfntInstance sfntInstance;
29949 enum {
29950   sizeof_sfntInstance = 4
29951 };
29952
29953 struct sfntVariationHeader {
29954   Fixed version;
29955   UInt16 offsetToData;
29956   UInt16 countSizePairs;
29957   UInt16 axisCount;
29958   UInt16 axisSize;
29959   UInt16 instanceCount;
29960   UInt16 instanceSize;
29961
29962   sfntVariationAxis axis[1];
29963   sfntInstance instance[1];
29964 };
29965 typedef struct sfntVariationHeader sfntVariationHeader;
29966 enum {
29967   sizeof_sfntVariationHeader = 16
29968 };
29969
29970
29971 enum {
29972   descriptorFontTableTag = 'fdsc'
29973 };
29974
29975 struct sfntFontDescriptor {
29976   FourCharCode name;
29977   Fixed value;
29978 };
29979 typedef struct sfntFontDescriptor sfntFontDescriptor;
29980 struct sfntDescriptorHeader {
29981   Fixed version;
29982   SInt32 descriptorCount;
29983   sfntFontDescriptor descriptor[1];
29984 };
29985 typedef struct sfntDescriptorHeader sfntDescriptorHeader;
29986 enum {
29987   sizeof_sfntDescriptorHeader = 8
29988 };
29989
29990
29991 enum {
29992   featureFontTableTag = 'feat'
29993 };
29994
29995 struct sfntFeatureName {
29996   UInt16 featureType;
29997   UInt16 settingCount;
29998   SInt32 offsetToSettings;
29999   UInt16 featureFlags;
30000   UInt16 nameID;
30001 };
30002 typedef struct sfntFeatureName sfntFeatureName;
30003 struct sfntFontFeatureSetting {
30004   UInt16 setting;
30005   UInt16 nameID;
30006 };
30007 typedef struct sfntFontFeatureSetting sfntFontFeatureSetting;
30008 struct sfntFontRunFeature {
30009   UInt16 featureType;
30010   UInt16 setting;
30011 };
30012 typedef struct sfntFontRunFeature sfntFontRunFeature;
30013 struct sfntFeatureHeader {
30014   SInt32 version;
30015   UInt16 featureNameCount;
30016   UInt16 featureSetCount;
30017   SInt32 reserved;
30018   sfntFeatureName names[1];
30019   sfntFontFeatureSetting settings[1];
30020   sfntFontRunFeature runs[1];
30021 };
30022 typedef struct sfntFeatureHeader sfntFeatureHeader;
30023
30024 enum {
30025   os2FontTableTag = 'OS/2'
30026 };
30027
30028
30029 enum {
30030   nonGlyphID = 65535L
30031 };
30032
30033
30034
30035
30036
30037 enum {
30038   kFontNoPlatform = -1,
30039   kFontNoScript = -1,
30040   kFontNoLanguage = -1,
30041   kFontNoName = -1
30042 };
30043
30044
30045
30046
30047
30048 typedef UInt32 FontNameCode;
30049
30050 typedef UInt32 FontPlatformCode;
30051 typedef UInt32 FontScriptCode;
30052 typedef UInt32 FontLanguageCode;
30053
30054
30055
30056
30057 struct FontVariation {
30058   FourCharCode name;
30059   Fixed value;
30060 };
30061 typedef struct FontVariation FontVariation;
30062
30063 extern "C" {
30064
30065
30066
30067
30068
30069
30070
30071 enum {
30072   kATSOptionFlagsDefault = kNilOptions,
30073   kATSOptionFlagsComposeFontPostScriptName = 1 << 0,
30074   kATSOptionFlagsUseDataForkAsResourceFork = 1 << 8,
30075   kATSOptionFlagsUseResourceFork = 2 << 8,
30076   kATSOptionFlagsUseDataFork = 3 << 8
30077 };
30078
30079 enum {
30080   kATSIterationCompleted = -980L,
30081   kATSInvalidFontFamilyAccess = -981L,
30082   kATSInvalidFontAccess = -982L,
30083   kATSIterationScopeModified = -983L,
30084   kATSInvalidFontTableAccess = -984L,
30085   kATSInvalidFontContainerAccess = -985L
30086 };
30087
30088
30089 typedef UInt32 ATSFontContext;
30090 enum {
30091   kATSFontContextUnspecified = 0,
30092   kATSFontContextGlobal = 1,
30093   kATSFontContextLocal = 2
30094 };
30095
30096 enum {
30097   kATSOptionFlagsDoNotNotify = 0x00000001 << 8,
30098   kATSOptionFlagsIterationScopeMask = 0x00000007 << 12,
30099   kATSOptionFlagsDefaultScope = 0x00000000 << 12,
30100   kATSOptionFlagsUnRestrictedScope = 0x00000001 << 12,
30101   kATSOptionFlagsRestrictedScope = 0x00000002 << 12,
30102   kATSOptionFlagsProcessSubdirectories = 0x00000001 << 6
30103 };
30104
30105
30106 enum {
30107   kATSOptionFlagsIterateByPrecedenceMask = 0x00000001 << 5
30108 };
30109
30110 typedef UInt32 ATSFontFormat;
30111 enum {
30112   kATSFontFormatUnspecified = 0
30113 };
30114
30115 typedef OSStatus ( * ATSFontFamilyApplierFunction)(ATSFontFamilyRef iFamily, void *iRefCon);
30116 typedef OSStatus ( * ATSFontApplierFunction)(ATSFontRef iFont, void *iRefCon);
30117 typedef struct ATSFontFamilyIterator_* ATSFontFamilyIterator;
30118 typedef struct ATSFontIterator_* ATSFontIterator;
30119 enum {
30120   kATSFontFilterCurrentVersion = 0
30121 };
30122
30123 enum ATSFontFilterSelector {
30124   kATSFontFilterSelectorUnspecified = 0,
30125   kATSFontFilterSelectorGeneration = 3,
30126   kATSFontFilterSelectorFontFamily = 7,
30127   kATSFontFilterSelectorFontFamilyApplierFunction = 8,
30128   kATSFontFilterSelectorFontApplierFunction = 9
30129 };
30130 typedef enum ATSFontFilterSelector ATSFontFilterSelector;
30131
30132 struct ATSFontFilter {
30133   UInt32 version;
30134   ATSFontFilterSelector filterSelector;
30135   union {
30136     ATSGeneration generationFilter;
30137     ATSFontFamilyRef fontFamilyFilter;
30138     ATSFontFamilyApplierFunction fontFamilyApplierFunctionFilter;
30139     ATSFontApplierFunction fontApplierFunctionFilter;
30140   } filter;
30141 };
30142 typedef struct ATSFontFilter ATSFontFilter;
30143
30144 typedef struct ATSFontNotificationRef_* ATSFontNotificationRef;
30145 typedef struct ATSFontNotificationInfoRef_* ATSFontNotificationInfoRef;
30146 enum ATSFontNotifyOption {
30147
30148
30149
30150
30151   kATSFontNotifyOptionDefault = 0,
30152   kATSFontNotifyOptionReceiveWhileSuspended = 1L << 0
30153 };
30154 typedef enum ATSFontNotifyOption ATSFontNotifyOption;
30155 enum ATSFontNotifyAction {
30156   kATSFontNotifyActionFontsChanged = 1,
30157   kATSFontNotifyActionDirectoriesChanged = 2
30158 };
30159 typedef enum ATSFontNotifyAction ATSFontNotifyAction;
30160 typedef void ( * ATSNotificationCallback)(ATSFontNotificationInfoRef info, void *refCon);
30161 extern ATSGeneration
30162 ATSGetGeneration(void) ;
30163 extern OSStatus
30164 ATSFontActivateFromFileSpecification(
30165   const FSSpec * iFile,
30166   ATSFontContext iContext,
30167   ATSFontFormat iFormat,
30168   void * iReserved,
30169   ATSOptionFlags iOptions,
30170   ATSFontContainerRef * oContainer) ;
30171 extern OSStatus
30172 ATSFontActivateFromMemory(
30173   LogicalAddress iData,
30174   ByteCount iLength,
30175   ATSFontContext iContext,
30176   ATSFontFormat iFormat,
30177   void * iReserved,
30178   ATSOptionFlags iOptions,
30179   ATSFontContainerRef * oContainer) ;
30180 extern OSStatus
30181 ATSFontDeactivate(
30182   ATSFontContainerRef iContainer,
30183   void * iRefCon,
30184   ATSOptionFlags iOptions) ;
30185 extern OSStatus
30186 ATSFontFamilyApplyFunction(
30187   ATSFontFamilyApplierFunction iFunction,
30188   void * iRefCon) ;
30189 extern OSStatus
30190 ATSFontFamilyIteratorCreate(
30191   ATSFontContext iContext,
30192   const ATSFontFilter * iFilter,
30193   void * iRefCon,
30194   ATSOptionFlags iOptions,
30195   ATSFontFamilyIterator * ioIterator) ;
30196 extern OSStatus
30197 ATSFontFamilyIteratorRelease(ATSFontFamilyIterator * ioIterator) ;
30198 extern OSStatus
30199 ATSFontFamilyIteratorReset(
30200   ATSFontContext iContext,
30201   const ATSFontFilter * iFilter,
30202   void * iRefCon,
30203   ATSOptionFlags iOptions,
30204   ATSFontFamilyIterator * ioIterator) ;
30205 extern OSStatus
30206 ATSFontFamilyIteratorNext(
30207   ATSFontFamilyIterator iIterator,
30208   ATSFontFamilyRef * oFamily) ;
30209 extern ATSFontFamilyRef
30210 ATSFontFamilyFindFromName(
30211   CFStringRef iName,
30212   ATSOptionFlags iOptions) ;
30213 extern ATSGeneration
30214 ATSFontFamilyGetGeneration(ATSFontFamilyRef iFamily) ;
30215 extern OSStatus
30216 ATSFontFamilyGetName(
30217   ATSFontFamilyRef iFamily,
30218   ATSOptionFlags iOptions,
30219   CFStringRef * oName) ;
30220 extern TextEncoding
30221 ATSFontFamilyGetEncoding(ATSFontFamilyRef iFamily) ;
30222 extern OSStatus
30223 ATSFontApplyFunction(
30224   ATSFontApplierFunction iFunction,
30225   void * iRefCon) ;
30226 extern OSStatus
30227 ATSFontIteratorCreate(
30228   ATSFontContext iContext,
30229   const ATSFontFilter * iFilter,
30230   void * iRefCon,
30231   ATSOptionFlags iOptions,
30232   ATSFontIterator * ioIterator) ;
30233 extern OSStatus
30234 ATSFontIteratorRelease(ATSFontIterator * ioIterator) ;
30235 extern OSStatus
30236 ATSFontIteratorReset(
30237   ATSFontContext iContext,
30238   const ATSFontFilter * iFilter,
30239   void * iRefCon,
30240   ATSOptionFlags iOptions,
30241   ATSFontIterator * ioIterator) ;
30242 extern OSStatus
30243 ATSFontIteratorNext(
30244   ATSFontIterator iIterator,
30245   ATSFontRef * oFont) ;
30246 extern ATSFontRef
30247 ATSFontFindFromName(
30248   CFStringRef iName,
30249   ATSOptionFlags iOptions) ;
30250 extern ATSFontRef
30251 ATSFontFindFromPostScriptName(
30252   CFStringRef iName,
30253   ATSOptionFlags iOptions) ;
30254 extern OSStatus
30255 ATSFontFindFromContainer(
30256   ATSFontContainerRef iContainer,
30257   ATSOptionFlags iOptions,
30258   ItemCount iCount,
30259   ATSFontRef ioArray[],
30260   ItemCount * oCount) ;
30261 extern ATSGeneration
30262 ATSFontGetGeneration(ATSFontRef iFont) ;
30263 extern OSStatus
30264 ATSFontGetName(
30265   ATSFontRef iFont,
30266   ATSOptionFlags iOptions,
30267   CFStringRef * oName) ;
30268 extern OSStatus
30269 ATSFontGetPostScriptName(
30270   ATSFontRef iFont,
30271   ATSOptionFlags iOptions,
30272   CFStringRef * oName) ;
30273 extern OSStatus
30274 ATSFontGetTableDirectory(
30275   ATSFontRef iFont,
30276   ByteCount iBufferSize,
30277   void * ioBuffer,
30278   ByteCount * oSize) ;
30279 extern OSStatus
30280 ATSFontGetTable(
30281   ATSFontRef iFont,
30282   FourCharCode iTag,
30283   ByteOffset iOffset,
30284   ByteCount iBufferSize,
30285   void * ioBuffer,
30286   ByteCount * oSize) ;
30287 extern OSStatus
30288 ATSFontGetHorizontalMetrics(
30289   ATSFontRef iFont,
30290   ATSOptionFlags iOptions,
30291   ATSFontMetrics * oMetrics) ;
30292 extern OSStatus
30293 ATSFontGetVerticalMetrics(
30294   ATSFontRef iFont,
30295   ATSOptionFlags iOptions,
30296   ATSFontMetrics * oMetrics) ;
30297 extern ATSFontFamilyRef
30298 ATSFontFamilyFindFromQuickDrawName(ConstStr255Param iName) ;
30299 extern OSStatus
30300 ATSFontFamilyGetQuickDrawName(
30301   ATSFontFamilyRef iFamily,
30302   Str255 oName) ;
30303 extern OSStatus
30304 ATSFontGetFileSpecification(
30305   ATSFontRef iFont,
30306   FSSpec * oFile) ;
30307 extern OSStatus
30308 ATSFontGetFontFamilyResource(
30309   ATSFontRef iFont,
30310   ByteCount iBufferSize,
30311   void * ioBuffer,
30312   ByteCount * oSize) ;
30313 extern OSStatus
30314 ATSFontNotify(
30315   ATSFontNotifyAction action,
30316   void * info) ;
30317 extern OSStatus
30318 ATSFontNotificationSubscribe(
30319   ATSNotificationCallback callback,
30320   ATSFontNotifyOption options,
30321   void * iRefcon,
30322   ATSFontNotificationRef * oNotificationRef) ;
30323 extern OSStatus
30324 ATSFontNotificationUnsubscribe(ATSFontNotificationRef notificationRef) ;
30325 struct ATSFontQuerySourceContext {
30326
30327
30328
30329
30330
30331   UInt32 version;
30332
30333
30334
30335
30336
30337   void * refCon;
30338
30339
30340
30341
30342   CFAllocatorRetainCallBack retain;
30343
30344
30345
30346
30347   CFAllocatorReleaseCallBack release;
30348 };
30349 typedef struct ATSFontQuerySourceContext ATSFontQuerySourceContext;
30350
30351
30352
30353
30354
30355
30356
30357 enum ATSFontQueryMessageID {
30358
30359
30360
30361
30362
30363
30364
30365   kATSQueryActivateFontMessage = 'atsa'
30366 };
30367 typedef enum ATSFontQueryMessageID ATSFontQueryMessageID;
30368 typedef CFPropertyListRef ( * ATSFontQueryCallback)(ATSFontQueryMessageID msgid, CFPropertyListRef data, void *refCon);
30369 extern CFRunLoopSourceRef
30370 ATSCreateFontQueryRunLoopSource(
30371   CFIndex queryOrder,
30372   CFIndex sourceOrder,
30373   ATSFontQueryCallback callout,
30374   const ATSFontQuerySourceContext * context) ;
30375
30376
30377 }
30378
30379
30380
30381
30382
30383
30384
30385
30386
30387 enum {
30388   cexec68K = 0x00000001,
30389   truetypeStreamType = 0x00000001,
30390   type1StreamType = 0x00000002,
30391   type3StreamType = 0x00000004,
30392   type42StreamType = 0x00000008,
30393   type42GXStreamType = 0x00000010,
30394   portableStreamType = 0x00000020,
30395   flattenedStreamType = 0x00000040,
30396   cidType2StreamType = 0x00000080,
30397   cidType0StreamType = 0x00000100,
30398   type1CFFStreamType = 0x00000200,
30399   evenOddModifierStreamType = 0x00008000,
30400   eexecBinaryModifierStreamType = 0x00010000,
30401   unicodeMappingModifierStreamType = 0x00020000,
30402   scalerSpecifcModifierMask = 0x0000F000,
30403   streamTypeModifierMask = (long)0xFFFFF000
30404 };
30405
30406
30407 typedef unsigned long scalerStreamTypeFlag;
30408 enum {
30409   downloadStreamAction = 0,
30410   asciiDownloadStreamAction = 1,
30411   fontSizeQueryStreamAction = 2,
30412   encodingOnlyStreamAction = 3,
30413   prerequisiteQueryStreamAction = 4,
30414   prerequisiteItemStreamAction = 5,
30415   variationQueryStreamAction = 6,
30416   variationPSOperatorStreamAction = 7
30417 };
30418
30419 typedef long scalerStreamAction;
30420 enum {
30421   selectAllVariations = -1
30422 };
30423
30424 struct scalerPrerequisiteItem {
30425   long enumeration;
30426   long size;
30427   unsigned char name[1];
30428 };
30429 typedef struct scalerPrerequisiteItem scalerPrerequisiteItem;
30430 struct scalerStream {
30431   const void * streamRefCon;
30432   const char * targetVersion;
30433   scalerStreamTypeFlag types;
30434   scalerStreamAction action;
30435   unsigned long memorySize;
30436   long variationCount;
30437   const void * variations;
30438   union {
30439
30440     struct {
30441       const unsigned short * encoding;
30442       long * glyphBits;
30443       char * name;
30444     } font;
30445
30446
30447     struct {
30448       long size;
30449       void * list;
30450     } prerequisiteQuery;
30451
30452     long prerequisiteItem;
30453
30454     long variationQueryResult;
30455   } info;
30456 };
30457 typedef struct scalerStream scalerStream;
30458 struct scalerStreamData {
30459   long hexFlag;
30460   long byteCount;
30461   const void * data;
30462 };
30463 typedef struct scalerStreamData scalerStreamData;
30464
30465
30466
30467
30468 extern "C" {
30469 }
30470
30471 typedef struct CGAffineTransform CGAffineTransform;
30472
30473
30474 extern "C" {
30475
30476
30477
30478 struct CGPoint {
30479     float x;
30480     float y;
30481 };
30482 typedef struct CGPoint CGPoint;
30483
30484
30485
30486 struct CGSize {
30487     float width;
30488     float height;
30489 };
30490 typedef struct CGSize CGSize;
30491
30492
30493
30494 struct CGRect {
30495     CGPoint origin;
30496     CGSize size;
30497 };
30498 typedef struct CGRect CGRect;
30499
30500
30501
30502 enum CGRectEdge {
30503     CGRectMinXEdge, CGRectMinYEdge, CGRectMaxXEdge, CGRectMaxYEdge
30504 };
30505 typedef enum CGRectEdge CGRectEdge;
30506
30507
30508
30509 extern const CGPoint CGPointZero;
30510
30511
30512
30513 extern const CGSize CGSizeZero;
30514
30515
30516
30517 extern const CGRect CGRectZero;
30518
30519
30520
30521
30522
30523 extern const CGRect CGRectNull;
30524
30525
30526
30527 static inline CGPoint CGPointMake(float x, float y);
30528
30529
30530
30531 static inline CGSize CGSizeMake(float width, float height);
30532
30533
30534
30535 static inline CGRect CGRectMake(float x, float y, float width, float height);
30536
30537
30538
30539 extern float CGRectGetMinX(CGRect rect);
30540
30541
30542
30543 extern float CGRectGetMidX(CGRect rect);
30544
30545
30546
30547 extern float CGRectGetMaxX(CGRect rect);
30548
30549
30550
30551 extern float CGRectGetMinY(CGRect rect);
30552
30553
30554
30555 extern float CGRectGetMidY(CGRect rect);
30556
30557
30558
30559 extern float CGRectGetMaxY(CGRect rect);
30560
30561
30562
30563 extern float CGRectGetWidth(CGRect rect);
30564
30565
30566
30567 extern float CGRectGetHeight(CGRect rect);
30568
30569
30570
30571 extern int CGPointEqualToPoint(CGPoint point1, CGPoint point2);
30572
30573
30574
30575 extern int CGSizeEqualToSize(CGSize size1, CGSize size2);
30576
30577
30578
30579 extern int CGRectEqualToRect(CGRect rect1, CGRect rect2);
30580
30581
30582
30583
30584 extern CGRect CGRectStandardize(CGRect rect);
30585
30586
30587
30588
30589 extern int CGRectIsEmpty(CGRect rect);
30590
30591
30592
30593
30594 extern int CGRectIsNull(CGRect rect);
30595
30596
30597
30598
30599 extern CGRect CGRectInset(CGRect rect, float dx, float dy);
30600
30601
30602
30603
30604 extern CGRect CGRectIntegral(CGRect rect);
30605
30606
30607
30608 extern CGRect CGRectUnion(CGRect r1, CGRect r2);
30609
30610
30611
30612
30613 extern CGRect CGRectIntersection(CGRect r1, CGRect r2);
30614
30615
30616
30617 extern CGRect CGRectOffset(CGRect rect, float dx, float dy);
30618
30619
30620
30621
30622
30623
30624
30625 extern void CGRectDivide(CGRect rect, CGRect *slice, CGRect *remainder, float amount, CGRectEdge edge);
30626
30627
30628
30629 extern int CGRectContainsPoint(CGRect rect, CGPoint point);
30630
30631
30632
30633
30634
30635 extern int CGRectContainsRect(CGRect rect1, CGRect rect2);
30636
30637
30638
30639
30640
30641 extern int CGRectIntersectsRect(CGRect rect1, CGRect rect2);
30642
30643
30644
30645 static inline CGPoint CGPointMake(float x, float y)
30646 {
30647     CGPoint p; p.x = x; p.y = y; return p;
30648 }
30649
30650 static inline CGSize CGSizeMake(float width, float height)
30651 {
30652     CGSize size; size.width = width; size.height = height; return size;
30653 }
30654
30655 static inline CGRect CGRectMake(float x, float y, float width, float height)
30656 {
30657     CGRect rect;
30658     rect.origin.x = x; rect.origin.y = y;
30659     rect.size.width = width; rect.size.height = height;
30660     return rect;
30661 }
30662
30663 }
30664
30665 extern "C" {
30666
30667 struct CGAffineTransform {
30668     float a, b, c, d;
30669     float tx, ty;
30670 };
30671
30672
30673
30674 extern const CGAffineTransform CGAffineTransformIdentity;
30675
30676
30677
30678 extern CGAffineTransform CGAffineTransformMake(float a, float b, float c, float d, float tx, float ty);
30679
30680
30681
30682
30683 extern CGAffineTransform CGAffineTransformMakeTranslation(float tx, float ty);
30684
30685
30686
30687
30688 extern CGAffineTransform CGAffineTransformMakeScale(float sx, float sy);
30689
30690
30691
30692
30693 extern CGAffineTransform CGAffineTransformMakeRotation(float angle);
30694
30695
30696
30697
30698 extern CGAffineTransform CGAffineTransformTranslate(CGAffineTransform t, float tx, float ty);
30699
30700
30701
30702
30703 extern CGAffineTransform CGAffineTransformScale(CGAffineTransform t, float sx, float sy);
30704
30705
30706
30707
30708 extern CGAffineTransform CGAffineTransformRotate(CGAffineTransform t, float angle);
30709
30710
30711
30712
30713 extern CGAffineTransform CGAffineTransformInvert(CGAffineTransform t);
30714
30715
30716
30717
30718 extern CGAffineTransform CGAffineTransformConcat(CGAffineTransform t1, CGAffineTransform t2);
30719
30720
30721
30722
30723
30724 extern CGPoint CGPointApplyAffineTransform(CGPoint point, CGAffineTransform t);
30725
30726
30727
30728
30729
30730 extern CGSize CGSizeApplyAffineTransform(CGSize size, CGAffineTransform t);
30731
30732
30733
30734 static inline CGAffineTransform
30735 __CGAffineTransformMake(float a, float b, float c, float d, float tx, float ty)
30736 {
30737     CGAffineTransform t;
30738
30739     t.a = a; t.b = b; t.c = c; t.d = d; t.tx = tx; t.ty = ty;
30740     return t;
30741 }
30742
30743
30744
30745 static inline CGPoint
30746 __CGPointApplyAffineTransform(CGPoint point, CGAffineTransform t)
30747 {
30748     CGPoint p;
30749
30750     p.x = t.a * point.x + t.c * point.y + t.tx;
30751     p.y = t.b * point.x + t.d * point.y + t.ty;
30752     return p;
30753 }
30754
30755
30756
30757 static inline CGSize
30758 __CGSizeApplyAffineTransform(CGSize size, CGAffineTransform t)
30759 {
30760     CGSize s;
30761
30762     s.width = t.a * size.width + t.c * size.height;
30763     s.height = t.b * size.width + t.d * size.height;
30764     return s;
30765 }
30766
30767
30768
30769 }
30770 typedef struct CGContext *CGContextRef;
30771
30772
30773
30774 typedef struct CGColorSpace *CGColorSpaceRef;
30775
30776
30777 typedef struct CGDataProvider *CGDataProviderRef;
30778
30779
30780
30781
30782 extern "C" {
30783 struct CGDataProviderCallbacks {
30784     size_t (*getBytes)(void *info, void *buffer, size_t count);
30785     void (*skipBytes)(void *info, size_t count);
30786     void (*rewind)(void *info);
30787     void (*releaseProvider)(void *info);
30788 };
30789 typedef struct CGDataProviderCallbacks CGDataProviderCallbacks;
30790 struct CGDataProviderDirectAccessCallbacks {
30791     const void *(*getBytePointer)(void *info);
30792     void (*releaseBytePointer)(void *info, const void *pointer);
30793     size_t (*getBytes)(void *info, void *buffer, size_t offset, size_t count);
30794     void (*releaseProvider)(void *info);
30795 };
30796 typedef struct CGDataProviderDirectAccessCallbacks CGDataProviderDirectAccessCallbacks;
30797
30798
30799
30800 extern CFTypeID CGDataProviderGetTypeID(void);
30801
30802
30803
30804
30805 extern CGDataProviderRef CGDataProviderCreate(void *info, const CGDataProviderCallbacks *callbacks);
30806
30807
30808
30809
30810 extern CGDataProviderRef CGDataProviderCreateDirectAccess(void *info, size_t size, const CGDataProviderDirectAccessCallbacks *callbacks);
30811
30812
30813
30814
30815
30816 extern CGDataProviderRef CGDataProviderCreateWithData(void *info, const void *data, size_t size, void (*releaseData)(void *info, const void *data, size_t size));
30817
30818
30819
30820 extern CGDataProviderRef CGDataProviderCreateWithURL(CFURLRef url);
30821
30822
30823
30824 extern CGDataProviderRef CGDataProviderRetain(CGDataProviderRef provider);
30825
30826
30827
30828 extern void CGDataProviderRelease(CGDataProviderRef provider);
30829
30830
30831
30832
30833
30834 extern CGDataProviderRef CGDataProviderCreateWithFilename(const char *filename);
30835
30836 }
30837
30838 enum CGColorRenderingIntent {
30839     kCGRenderingIntentDefault,
30840     kCGRenderingIntentAbsoluteColorimetric,
30841     kCGRenderingIntentRelativeColorimetric,
30842     kCGRenderingIntentPerceptual,
30843     kCGRenderingIntentSaturation
30844 };
30845 typedef enum CGColorRenderingIntent CGColorRenderingIntent;
30846
30847
30848
30849
30850
30851 extern "C" {
30852
30853
30854
30855 extern CFTypeID CGColorSpaceGetTypeID(void);
30856
30857
30858
30859
30860
30861 extern CGColorSpaceRef CGColorSpaceCreateDeviceGray(void);
30862
30863
30864
30865 extern CGColorSpaceRef CGColorSpaceCreateDeviceRGB(void);
30866
30867
30868
30869 extern CGColorSpaceRef CGColorSpaceCreateDeviceCMYK(void);
30870 extern CGColorSpaceRef CGColorSpaceCreateCalibratedGray(const float whitePoint[3], const float blackPoint[3], float gamma);
30871 extern CGColorSpaceRef CGColorSpaceCreateCalibratedRGB(const float whitePoint[3], const float blackPoint[3], const float gamma[3], const float matrix[9]);
30872 extern CGColorSpaceRef CGColorSpaceCreateLab(const float whitePoint[3], const float blackPoint[3], const float range[4]);
30873 extern CGColorSpaceRef CGColorSpaceCreateICCBased(size_t nComponents, const float *range, CGDataProviderRef profile, CGColorSpaceRef alternate);
30874 extern CGColorSpaceRef CGColorSpaceCreateIndexed(CGColorSpaceRef baseSpace, size_t lastIndex, const unsigned char *colorTable);
30875
30876
30877
30878
30879
30880
30881 extern CGColorSpaceRef CGColorSpaceCreatePattern(CGColorSpaceRef baseSpace);
30882
30883
30884
30885
30886
30887 extern CGColorSpaceRef CGColorSpaceCreateWithPlatformColorSpace(void *platformColorSpaceReference);
30888
30889
30890
30891 extern CGColorSpaceRef CGColorSpaceCreateWithName(CFStringRef name);
30892
30893
30894
30895
30896
30897 extern size_t CGColorSpaceGetNumberOfComponents(const CGColorSpaceRef cs);
30898
30899
30900
30901
30902
30903 extern CGColorSpaceRef CGColorSpaceRetain(CGColorSpaceRef cs);
30904
30905
30906
30907 extern void CGColorSpaceRelease(CGColorSpaceRef cs);
30908
30909 }
30910 typedef struct CGFont *CGFontRef;
30911 typedef unsigned short CGFontIndex;
30912 typedef CGFontIndex CGGlyph;
30913
30914
30915
30916
30917
30918 enum {
30919     kCGFontIndexMax = ((1 << 16) - 2),
30920     kCGFontIndexInvalid = ((1 << 16) - 1),
30921     kCGGlyphMax = kCGFontIndexMax
30922 };
30923
30924 extern "C" {
30925
30926
30927
30928 extern CFTypeID CGFontGetTypeID(void);
30929
30930
30931
30932
30933
30934 extern CGFontRef CGFontCreateWithPlatformFont(void *platformFontReference);
30935
30936
30937
30938 extern CGFontRef CGFontRetain(CGFontRef font);
30939
30940
30941
30942 extern void CGFontRelease(CGFontRef font);
30943
30944 }
30945
30946
30947
30948 enum {
30949     CGGlyphMin = 0,
30950     CGGlyphMax = kCGGlyphMax
30951 };
30952 typedef struct CGImage *CGImageRef;
30953
30954
30955
30956
30957
30958
30959 extern "C" {
30960
30961 enum CGImageAlphaInfo {
30962     kCGImageAlphaNone,
30963     kCGImageAlphaPremultipliedLast,
30964     kCGImageAlphaPremultipliedFirst,
30965     kCGImageAlphaLast,
30966     kCGImageAlphaFirst,
30967     kCGImageAlphaNoneSkipLast,
30968     kCGImageAlphaNoneSkipFirst
30969 };
30970 typedef enum CGImageAlphaInfo CGImageAlphaInfo;
30971
30972
30973
30974 extern CFTypeID CGImageGetTypeID(void);
30975
30976
30977
30978 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);
30979
30980
30981
30982 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);
30983
30984
30985
30986 extern CGImageRef CGImageCreateWithJPEGDataProvider(CGDataProviderRef source, const float decode[], bool shouldInterpolate, CGColorRenderingIntent intent);
30987
30988
30989
30990 extern CGImageRef CGImageCreateWithPNGDataProvider(CGDataProviderRef source, const float decode[], bool shouldInterpolate, CGColorRenderingIntent intent);
30991
30992
30993
30994 extern CGImageRef CGImageRetain(CGImageRef image);
30995
30996
30997
30998 extern void CGImageRelease(CGImageRef image);
30999
31000
31001
31002 extern bool CGImageIsMask(CGImageRef image);
31003
31004
31005
31006 extern size_t CGImageGetWidth(CGImageRef image);
31007
31008
31009
31010 extern size_t CGImageGetHeight(CGImageRef image);
31011
31012
31013
31014 extern size_t CGImageGetBitsPerComponent(CGImageRef image);
31015
31016
31017
31018 extern size_t CGImageGetBitsPerPixel(CGImageRef image);
31019
31020
31021
31022 extern size_t CGImageGetBytesPerRow(CGImageRef image);
31023
31024
31025
31026
31027 extern CGColorSpaceRef CGImageGetColorSpace(CGImageRef image);
31028
31029
31030
31031 extern CGImageAlphaInfo CGImageGetAlphaInfo(CGImageRef image);
31032
31033
31034
31035 extern CGDataProviderRef CGImageGetDataProvider(CGImageRef image);
31036
31037
31038
31039 extern const float *CGImageGetDecode(CGImageRef image);
31040
31041
31042
31043 extern bool CGImageGetShouldInterpolate(CGImageRef image);
31044
31045
31046
31047 extern CGColorRenderingIntent CGImageGetRenderingIntent(CGImageRef image);
31048
31049 }
31050 typedef struct CGPath *CGMutablePathRef;
31051 typedef const struct CGPath *CGPathRef;
31052
31053
31054
31055
31056
31057 extern "C" {
31058
31059
31060
31061 extern CFTypeID CGPathGetTypeID(void);
31062
31063
31064
31065 extern CGMutablePathRef CGPathCreateMutable(void);
31066
31067
31068
31069 extern CGPathRef CGPathCreateCopy(CGPathRef path);
31070
31071
31072
31073 extern CGMutablePathRef CGPathCreateMutableCopy(CGPathRef path);
31074
31075
31076
31077 extern CGPathRef CGPathRetain(CGPathRef path);
31078
31079
31080
31081 extern void CGPathRelease(CGPathRef path);
31082
31083
31084
31085 extern bool CGPathEqualToPath(CGPathRef path1, CGPathRef path2);
31086
31087
31088
31089
31090
31091
31092 extern void CGPathMoveToPoint(CGMutablePathRef path, const CGAffineTransform *m, float x, float y);
31093
31094
31095
31096
31097
31098 extern void CGPathAddLineToPoint(CGMutablePathRef path, const CGAffineTransform *m, float x, float y);
31099
31100
31101
31102
31103
31104 extern void CGPathAddQuadCurveToPoint(CGMutablePathRef path, const CGAffineTransform *m, float cpx, float cpy, float x, float y);
31105
31106
31107
31108
31109
31110
31111 extern void CGPathAddCurveToPoint(CGMutablePathRef path, const CGAffineTransform *m, float cp1x, float cp1y, float cp2x, float cp2y, float x, float y);
31112
31113
31114
31115
31116 extern void CGPathCloseSubpath(CGMutablePathRef path);
31117
31118
31119
31120
31121
31122
31123 extern void CGPathAddRect(CGMutablePathRef path, const CGAffineTransform *m, CGRect rect);
31124
31125
31126
31127
31128
31129 extern void CGPathAddRects(CGMutablePathRef path, const CGAffineTransform *m, const CGRect rects[], size_t count);
31130
31131
31132
31133
31134
31135 extern void CGPathAddLines(CGMutablePathRef path, const CGAffineTransform *m, const CGPoint points[], size_t count);
31136 extern void CGPathAddArc(CGMutablePathRef path, const CGAffineTransform *m, float x, float y, float radius, float startAngle, float endAngle, bool clockwise);
31137 extern void CGPathAddArcToPoint(CGMutablePathRef path, const CGAffineTransform *m, float x1, float y1, float x2, float y2, float radius);
31138
31139
31140
31141
31142 extern void CGPathAddPath(CGMutablePathRef path1, const CGAffineTransform *m, CGPathRef path2);
31143
31144
31145
31146
31147
31148 extern bool CGPathIsEmpty(CGPathRef path);
31149
31150
31151
31152 extern bool CGPathIsRect(CGPathRef path, CGRect *rect);
31153
31154
31155
31156
31157 extern CGPoint CGPathGetCurrentPoint(CGPathRef path);
31158
31159
31160
31161
31162
31163
31164 extern CGRect CGPathGetBoundingBox(CGPathRef path);
31165
31166 enum CGPathElementType {
31167     kCGPathElementMoveToPoint,
31168     kCGPathElementAddLineToPoint,
31169     kCGPathElementAddQuadCurveToPoint,
31170     kCGPathElementAddCurveToPoint,
31171     kCGPathElementCloseSubpath
31172 };
31173 typedef enum CGPathElementType CGPathElementType;
31174
31175 struct CGPathElement {
31176     CGPathElementType type;
31177     CGPoint *points;
31178 };
31179 typedef struct CGPathElement CGPathElement;
31180
31181 typedef void (*CGPathApplierFunction)(void *info, const CGPathElement *element);
31182
31183 extern void CGPathApply(CGPathRef path, void *info, CGPathApplierFunction function);
31184
31185 }
31186 typedef struct CGPattern *CGPatternRef;
31187
31188
31189 enum CGPatternTiling {
31190     kCGPatternTilingNoDistortion,
31191     kCGPatternTilingConstantSpacingMinimalDistortion,
31192     kCGPatternTilingConstantSpacing
31193 };
31194 typedef enum CGPatternTiling CGPatternTiling;
31195
31196 extern "C" {
31197 typedef void (*CGPatternDrawPatternCallback)(void *info, CGContextRef c);
31198 typedef void (*CGPatternReleaseInfoCallback)(void *info);
31199
31200 struct CGPatternCallbacks {
31201     unsigned int version;
31202     CGPatternDrawPatternCallback drawPattern;
31203     CGPatternReleaseInfoCallback releaseInfo;
31204 };
31205 typedef struct CGPatternCallbacks CGPatternCallbacks;
31206
31207
31208
31209 extern CFTypeID CGPatternGetTypeID(void);
31210
31211
31212
31213 extern CGPatternRef CGPatternCreate(void *info, CGRect bounds, CGAffineTransform matrix, float xStep, float yStep, CGPatternTiling tiling, bool isColored, const CGPatternCallbacks *callbacks);
31214
31215
31216
31217 extern CGPatternRef CGPatternRetain(CGPatternRef pattern);
31218
31219
31220
31221 extern void CGPatternRelease(CGPatternRef pattern);
31222
31223 }
31224 typedef struct CGPDFDocument *CGPDFDocumentRef;
31225
31226
31227
31228
31229
31230
31231 extern "C" {
31232
31233
31234
31235 extern CFTypeID CGPDFDocumentGetTypeID(void);
31236
31237
31238
31239
31240 extern CGPDFDocumentRef CGPDFDocumentCreateWithProvider(CGDataProviderRef provider);
31241
31242
31243
31244 extern CGPDFDocumentRef CGPDFDocumentCreateWithURL(CFURLRef url);
31245
31246
31247
31248 extern CGPDFDocumentRef CGPDFDocumentRetain(CGPDFDocumentRef document);
31249
31250
31251
31252 extern void CGPDFDocumentRelease(CGPDFDocumentRef document);
31253
31254
31255
31256
31257
31258
31259 extern bool CGPDFDocumentIsEncrypted(CGPDFDocumentRef document);
31260
31261
31262
31263
31264
31265 extern bool CGPDFDocumentUnlockWithPassword(CGPDFDocumentRef document, const char *password);
31266
31267
31268
31269
31270
31271 extern bool CGPDFDocumentIsUnlocked(CGPDFDocumentRef document);
31272
31273
31274
31275
31276
31277
31278 extern bool CGPDFDocumentAllowsPrinting(CGPDFDocumentRef document);
31279
31280
31281
31282
31283
31284
31285 extern bool CGPDFDocumentAllowsCopying(CGPDFDocumentRef document);
31286
31287
31288
31289 extern size_t CGPDFDocumentGetNumberOfPages(CGPDFDocumentRef document);
31290
31291
31292
31293 extern CGRect CGPDFDocumentGetMediaBox(CGPDFDocumentRef document, int page);
31294
31295
31296
31297 extern CGRect CGPDFDocumentGetCropBox(CGPDFDocumentRef document, int page);
31298
31299
31300
31301 extern CGRect CGPDFDocumentGetBleedBox(CGPDFDocumentRef document, int page);
31302
31303
31304
31305 extern CGRect CGPDFDocumentGetTrimBox(CGPDFDocumentRef document, int page);
31306
31307
31308
31309 extern CGRect CGPDFDocumentGetArtBox(CGPDFDocumentRef document, int page);
31310
31311
31312
31313
31314 extern int CGPDFDocumentGetRotationAngle(CGPDFDocumentRef document, int page);
31315
31316 }
31317 typedef struct CGFunction *CGFunctionRef;
31318 typedef void (*CGFunctionEvaluateCallback)(void *info, const float *in, float *out);
31319 typedef void (*CGFunctionReleaseInfoCallback)(void *info);
31320 struct CGFunctionCallbacks {
31321     unsigned int version;
31322     CGFunctionEvaluateCallback evaluate;
31323     CGFunctionReleaseInfoCallback releaseInfo;
31324 };
31325 typedef struct CGFunctionCallbacks CGFunctionCallbacks;
31326
31327 extern "C" {
31328
31329
31330
31331
31332
31333 extern CFTypeID CGFunctionGetTypeID(void);
31334 extern CGFunctionRef CGFunctionCreate(void *info, size_t domainDimension, const float *domain, size_t rangeDimension, const float *range, const CGFunctionCallbacks *callbacks);
31335
31336
31337
31338
31339
31340
31341 extern CGFunctionRef CGFunctionRetain(CGFunctionRef function);
31342
31343
31344
31345
31346
31347
31348 extern void CGFunctionRelease(CGFunctionRef function);
31349
31350 }
31351
31352
31353
31354 typedef struct CGShading *CGShadingRef;
31355
31356 extern "C" {
31357
31358
31359
31360
31361
31362 extern CFTypeID CGShadingGetTypeID(void);
31363 extern CGShadingRef CGShadingCreateAxial(CGColorSpaceRef colorspace, CGPoint start, CGPoint end, CGFunctionRef function, bool extendStart, bool extendEnd);
31364 extern CGShadingRef CGShadingCreateRadial(CGColorSpaceRef colorspace, CGPoint start, float startRadius, CGPoint end, float endRadius, CGFunctionRef function, bool extendStart, bool extendEnd);
31365
31366
31367
31368
31369
31370
31371 extern CGShadingRef CGShadingRetain(CGShadingRef shading);
31372
31373
31374
31375
31376
31377
31378 extern void CGShadingRelease(CGShadingRef shading);
31379
31380 }
31381
31382
31383 extern "C" {
31384
31385
31386
31387 enum CGLineJoin {
31388     kCGLineJoinMiter,
31389     kCGLineJoinRound,
31390     kCGLineJoinBevel
31391 };
31392 typedef enum CGLineJoin CGLineJoin;
31393
31394
31395
31396 enum CGLineCap {
31397     kCGLineCapButt,
31398     kCGLineCapRound,
31399     kCGLineCapSquare
31400 };
31401 typedef enum CGLineCap CGLineCap;
31402
31403
31404
31405 enum CGPathDrawingMode {
31406     kCGPathFill,
31407     kCGPathEOFill,
31408     kCGPathStroke,
31409     kCGPathFillStroke,
31410     kCGPathEOFillStroke
31411 };
31412 typedef enum CGPathDrawingMode CGPathDrawingMode;
31413
31414
31415
31416 enum CGTextDrawingMode {
31417     kCGTextFill,
31418     kCGTextStroke,
31419     kCGTextFillStroke,
31420     kCGTextInvisible,
31421     kCGTextFillClip,
31422     kCGTextStrokeClip,
31423     kCGTextFillStrokeClip,
31424     kCGTextClip
31425 };
31426 typedef enum CGTextDrawingMode CGTextDrawingMode;
31427
31428
31429
31430 enum CGTextEncoding {
31431     kCGEncodingFontSpecific,
31432     kCGEncodingMacRoman
31433 };
31434 typedef enum CGTextEncoding CGTextEncoding;
31435
31436 enum CGInterpolationQuality {
31437     kCGInterpolationDefault,
31438     kCGInterpolationNone,
31439     kCGInterpolationLow,
31440     kCGInterpolationHigh
31441 };
31442 typedef enum CGInterpolationQuality CGInterpolationQuality;
31443
31444
31445
31446 extern CFTypeID CGContextGetTypeID(void);
31447
31448
31449
31450
31451
31452
31453
31454 extern void CGContextSaveGState(CGContextRef c);
31455
31456
31457
31458
31459
31460 extern void CGContextRestoreGState(CGContextRef c);
31461
31462
31463
31464
31465
31466
31467 extern void CGContextScaleCTM(CGContextRef c, float sx, float sy);
31468
31469
31470
31471
31472 extern void CGContextTranslateCTM(CGContextRef c, float tx, float ty);
31473
31474
31475
31476
31477 extern void CGContextRotateCTM(CGContextRef c, float angle);
31478
31479
31480
31481
31482 extern void CGContextConcatCTM(CGContextRef c, CGAffineTransform transform);
31483
31484
31485
31486 extern CGAffineTransform CGContextGetCTM(CGContextRef c);
31487
31488
31489
31490
31491
31492 extern void CGContextSetLineWidth(CGContextRef c, float width);
31493
31494
31495
31496 extern void CGContextSetLineCap(CGContextRef c, CGLineCap cap);
31497
31498
31499
31500 extern void CGContextSetLineJoin(CGContextRef c, CGLineJoin join);
31501
31502
31503
31504 extern void CGContextSetMiterLimit(CGContextRef c, float limit);
31505
31506
31507
31508 extern void CGContextSetLineDash(CGContextRef c, float phase, const float lengths[], size_t count);
31509
31510
31511
31512
31513 extern void CGContextSetFlatness(CGContextRef c, float flatness);
31514
31515
31516
31517 extern void CGContextSetAlpha(CGContextRef c, float alpha);
31518 extern void CGContextBeginPath(CGContextRef c);
31519
31520
31521
31522 extern void CGContextMoveToPoint(CGContextRef c, float x, float y);
31523
31524
31525
31526 extern void CGContextAddLineToPoint(CGContextRef c, float x, float y);
31527
31528
31529
31530
31531 extern void CGContextAddCurveToPoint(CGContextRef c, float cp1x, float cp1y, float cp2x, float cp2y, float x, float y);
31532
31533
31534
31535
31536 extern void CGContextAddQuadCurveToPoint(CGContextRef c, float cpx, float cpy, float x, float y);
31537
31538
31539
31540 extern void CGContextClosePath(CGContextRef c);
31541
31542
31543
31544
31545
31546 extern void CGContextAddRect(CGContextRef c, CGRect rect);
31547
31548
31549
31550 extern void CGContextAddRects(CGContextRef c, const CGRect rects[], size_t count);
31551
31552
31553
31554 extern void CGContextAddLines(CGContextRef c, const CGPoint points[], size_t count);
31555 extern void CGContextAddArc(CGContextRef c, float x, float y, float radius, float startAngle, float endAngle, int clockwise);
31556
31557
31558
31559
31560
31561
31562 extern void CGContextAddArcToPoint(CGContextRef c, float x1, float y1, float x2, float y2, float radius);
31563
31564
31565
31566
31567 extern void CGContextAddPath(CGContextRef context, CGPathRef path);
31568
31569
31570
31571
31572
31573 extern int CGContextIsPathEmpty(CGContextRef c);
31574
31575
31576
31577
31578 extern CGPoint CGContextGetPathCurrentPoint(CGContextRef c);
31579
31580
31581
31582
31583
31584 extern CGRect CGContextGetPathBoundingBox(CGContextRef c);
31585
31586
31587
31588
31589
31590 extern void CGContextDrawPath(CGContextRef c, CGPathDrawingMode mode);
31591
31592
31593
31594
31595
31596
31597 extern void CGContextFillPath(CGContextRef c);
31598
31599
31600
31601
31602 extern void CGContextEOFillPath(CGContextRef c);
31603
31604
31605
31606 extern void CGContextStrokePath(CGContextRef c);
31607
31608
31609
31610 extern void CGContextFillRect(CGContextRef c, CGRect rect);
31611
31612
31613
31614
31615 extern void CGContextFillRects(CGContextRef c, const CGRect rects[], size_t count);
31616
31617
31618
31619 extern void CGContextStrokeRect(CGContextRef c, CGRect rect);
31620
31621
31622
31623
31624 extern void CGContextStrokeRectWithWidth(CGContextRef c, CGRect rect, float width);
31625
31626
31627
31628
31629 extern void CGContextClearRect(CGContextRef c, CGRect rect);
31630
31631
31632
31633
31634
31635
31636
31637 extern void CGContextClip(CGContextRef c);
31638
31639
31640
31641
31642
31643 extern void CGContextEOClip(CGContextRef c);
31644
31645
31646
31647
31648
31649
31650 extern void CGContextClipToRect(CGContextRef c, CGRect rect);
31651
31652
31653
31654
31655
31656 extern void CGContextClipToRects(CGContextRef c, const CGRect rects[], size_t count);
31657
31658
31659
31660
31661
31662
31663
31664 extern void CGContextSetFillColorSpace(CGContextRef c, CGColorSpaceRef colorspace);
31665
31666
31667
31668
31669
31670 extern void CGContextSetStrokeColorSpace(CGContextRef c, CGColorSpaceRef colorspace);
31671 extern void CGContextSetFillColor(CGContextRef c, const float components[]);
31672
31673
31674
31675
31676
31677
31678
31679 extern void CGContextSetStrokeColor(CGContextRef c, const float components[]);
31680 extern void CGContextSetFillPattern(CGContextRef c, CGPatternRef pattern, const float components[]);
31681 extern void CGContextSetStrokePattern(CGContextRef c, CGPatternRef pattern, const float components[]);
31682
31683
31684
31685 extern void CGContextSetPatternPhase(CGContextRef c, CGSize phase);
31686
31687
31688
31689
31690
31691
31692 extern void CGContextSetGrayFillColor(CGContextRef c, float gray, float alpha);
31693
31694
31695
31696
31697 extern void CGContextSetGrayStrokeColor(CGContextRef c, float gray, float alpha);
31698
31699
31700
31701
31702
31703 extern void CGContextSetRGBFillColor(CGContextRef c, float red, float green, float blue, float alpha);
31704
31705
31706
31707
31708
31709 extern void CGContextSetRGBStrokeColor(CGContextRef c, float red, float green, float blue, float alpha);
31710
31711
31712
31713
31714
31715 extern void CGContextSetCMYKFillColor(CGContextRef c, float cyan, float magenta, float yellow, float black, float alpha);
31716
31717
31718
31719
31720
31721 extern void CGContextSetCMYKStrokeColor(CGContextRef c, float cyan, float magenta, float yellow, float black, float alpha);
31722
31723
31724
31725
31726
31727 extern void CGContextSetRenderingIntent(CGContextRef c, CGColorRenderingIntent intent);
31728
31729
31730
31731
31732
31733
31734 extern void CGContextDrawImage(CGContextRef c, CGRect rect, CGImageRef image);
31735
31736
31737
31738
31739
31740
31741
31742 extern CGInterpolationQuality CGContextGetInterpolationQuality(CGContextRef c);
31743
31744
31745
31746 extern void CGContextSetInterpolationQuality(CGContextRef c, CGInterpolationQuality quality);
31747
31748
31749
31750
31751
31752 extern void CGContextDrawShading(CGContextRef c, CGShadingRef shading);
31753
31754
31755
31756
31757
31758
31759
31760 extern void CGContextSetCharacterSpacing(CGContextRef c, float spacing);
31761
31762
31763
31764
31765 extern void CGContextSetTextPosition(CGContextRef c, float x, float y);
31766
31767
31768
31769
31770 extern CGPoint CGContextGetTextPosition(CGContextRef c);
31771
31772
31773
31774 extern void CGContextSetTextMatrix(CGContextRef c, CGAffineTransform t);
31775
31776
31777
31778 extern CGAffineTransform CGContextGetTextMatrix(CGContextRef c);
31779
31780
31781
31782 extern void CGContextSetTextDrawingMode(CGContextRef c, CGTextDrawingMode mode);
31783
31784
31785
31786 extern void CGContextSetFont(CGContextRef c, CGFontRef font);
31787
31788
31789
31790 extern void CGContextSetFontSize(CGContextRef c, float size);
31791
31792
31793
31794
31795
31796 extern void CGContextSelectFont(CGContextRef c, const char *name, float size, CGTextEncoding textEncoding);
31797
31798
31799
31800
31801
31802
31803 extern void CGContextShowText(CGContextRef c, const char *string, size_t length);
31804
31805
31806
31807
31808 extern void CGContextShowGlyphs(CGContextRef c, const CGGlyph g[], size_t count);
31809 extern void CGContextShowTextAtPoint(CGContextRef c, float x, float y, const char *string, size_t length);
31810
31811
31812
31813
31814
31815 extern void CGContextShowGlyphsAtPoint(CGContextRef c, float x, float y, const CGGlyph glyphs[], size_t count);
31816
31817
31818
31819
31820
31821
31822
31823 extern void CGContextDrawPDFDocument(CGContextRef c, CGRect rect, CGPDFDocumentRef document, int page);
31824
31825
31826
31827
31828
31829 extern void CGContextBeginPage(CGContextRef c, const CGRect *mediaBox);
31830
31831
31832
31833 extern void CGContextEndPage(CGContextRef c);
31834
31835
31836
31837
31838
31839 extern CGContextRef CGContextRetain(CGContextRef c);
31840
31841
31842
31843 extern void CGContextRelease(CGContextRef c);
31844
31845
31846
31847 extern void CGContextFlush(CGContextRef c);
31848
31849
31850
31851 extern void CGContextSynchronize(CGContextRef c);
31852
31853
31854
31855
31856
31857
31858 extern void CGContextSetShouldAntialias(CGContextRef c, bool shouldAntialias);
31859
31860
31861
31862
31863
31864
31865 extern void CGContextSetShouldSmoothFonts(CGContextRef c, bool shouldSmoothFonts);
31866
31867 }
31868
31869 extern "C" {
31870 extern CGContextRef CGBitmapContextCreate(void *data, size_t width, size_t height, size_t bitsPerComponent, size_t bytesPerRow, CGColorSpaceRef colorspace, CGImageAlphaInfo alphaInfo);
31871
31872
31873
31874
31875 extern void *CGBitmapContextGetData(CGContextRef c);
31876
31877
31878
31879
31880 extern size_t CGBitmapContextGetWidth(CGContextRef c);
31881
31882
31883
31884
31885 extern size_t CGBitmapContextGetHeight(CGContextRef c);
31886
31887
31888
31889
31890 extern size_t CGBitmapContextGetBitsPerComponent(CGContextRef c);
31891
31892
31893
31894
31895 extern size_t CGBitmapContextGetBitsPerPixel(CGContextRef c);
31896
31897
31898
31899
31900 extern size_t CGBitmapContextGetBytesPerRow(CGContextRef c);
31901
31902
31903
31904
31905 extern CGColorSpaceRef CGBitmapContextGetColorSpace(CGContextRef c);
31906
31907
31908
31909
31910 extern CGImageAlphaInfo CGBitmapContextGetAlphaInfo(CGContextRef c);
31911
31912 }
31913
31914
31915 typedef struct CGDataConsumer *CGDataConsumerRef;
31916
31917
31918
31919
31920 extern "C" {
31921
31922
31923
31924
31925
31926
31927
31928 struct CGDataConsumerCallbacks {
31929     size_t (*putBytes)(void *info, const void *buffer, size_t count);
31930     void (*releaseConsumer)(void *info);
31931 };
31932 typedef struct CGDataConsumerCallbacks CGDataConsumerCallbacks;
31933
31934
31935
31936 extern CFTypeID CGDataConsumerGetTypeID(void);
31937
31938
31939
31940
31941 extern CGDataConsumerRef CGDataConsumerCreate(void *info, const CGDataConsumerCallbacks *callbacks);
31942
31943
31944
31945 extern CGDataConsumerRef CGDataConsumerCreateWithURL(CFURLRef url);
31946
31947
31948
31949 extern CGDataConsumerRef CGDataConsumerRetain(CGDataConsumerRef consumer);
31950
31951
31952
31953 extern void CGDataConsumerRelease(CGDataConsumerRef consumer);
31954
31955 }
31956
31957 extern "C" {
31958
31959
31960 enum _CGError {
31961     kCGErrorSuccess = 0,
31962     kCGErrorFirst = 1000,
31963     kCGErrorFailure = kCGErrorFirst,
31964     kCGErrorIllegalArgument = 1001,
31965     kCGErrorInvalidConnection = 1002,
31966     kCGErrorInvalidContext = 1003,
31967     kCGErrorCannotComplete = 1004,
31968     kCGErrorNameTooLong = 1005,
31969     kCGErrorNotImplemented = 1006,
31970     kCGErrorRangeCheck = 1007,
31971     kCGErrorTypeCheck = 1008,
31972     kCGErrorNoCurrentPoint = 1009,
31973     kCGErrorInvalidOperation = 1010,
31974     kCGErrorNoneAvailable = 1011,
31975
31976
31977         kCGErrorApplicationRequiresNewerSystem = 1015,
31978
31979
31980
31981         kCGErrorApplicationNotPermittedToExecute = 1016,
31982
31983
31984     kCGErrorLast = kCGErrorApplicationRequiresNewerSystem
31985 };
31986 typedef int32_t CGError;
31987
31988 }
31989
31990
31991 extern double acos (double);
31992 extern double asin (double);
31993 extern double atan (double);
31994 extern double atan2 (double, double);
31995 extern double ceil (double);
31996 extern double cos (double);
31997 extern double cosh (double);
31998 extern double exp (double);
31999 extern double fabs (double);
32000 extern double floor (double);
32001 extern double fmod (double, double);
32002 extern double frexp (double, int *);
32003 extern double ldexp (double, int);
32004 extern double log10 (double);
32005 extern double log (double);
32006 extern double modf (double, double *);
32007 extern double pow (double, double);
32008 extern double sin (double);
32009 extern double sinh (double);
32010 extern double sqrt (double);
32011 extern double tan (double);
32012 extern double tanh (double);
32013
32014
32015 extern "C" {
32016
32017 typedef struct _CGDirectDisplayID * CGDirectDisplayID;
32018 typedef struct _CGDirectPaletteRef * CGDirectPaletteRef;
32019 typedef uint32_t CGDisplayCount;
32020 typedef uint32_t CGTableCount;
32021 typedef int32_t CGDisplayCoord;
32022 typedef uint8_t CGByteValue;
32023 typedef uint32_t CGOpenGLDisplayMask;
32024 typedef uint32_t CGBeamPosition;
32025 typedef int32_t CGMouseDelta;
32026 typedef double CGRefreshRate;
32027
32028 typedef CGError CGDisplayErr;
32029 CGDirectDisplayID CGMainDisplayID(void);
32030 CGDisplayErr CGGetDisplaysWithPoint(CGPoint point,
32031                              CGDisplayCount maxDisplays,
32032                              CGDirectDisplayID * dspys,
32033                              CGDisplayCount * dspyCnt);
32034
32035 CGDisplayErr CGGetDisplaysWithRect(CGRect rect,
32036                             CGDisplayCount maxDisplays,
32037                             CGDirectDisplayID * dspys,
32038                             CGDisplayCount * dspyCnt);
32039
32040 CGDisplayErr CGGetDisplaysWithOpenGLDisplayMask(CGOpenGLDisplayMask mask,
32041                             CGDisplayCount maxDisplays,
32042                             CGDirectDisplayID * dspys,
32043                             CGDisplayCount * dspyCnt);
32044 CGDisplayErr CGGetActiveDisplayList(CGDisplayCount maxDisplays,
32045                              CGDirectDisplayID * activeDspys,
32046                              CGDisplayCount * dspyCnt);
32047 CGDisplayErr CGGetOnlineDisplayList(CGDisplayCount maxDisplays,
32048                                     CGDirectDisplayID * onlineDspys,
32049                                     CGDisplayCount * dspyCnt);
32050
32051
32052 CGOpenGLDisplayMask CGDisplayIDToOpenGLDisplayMask(CGDirectDisplayID display);
32053
32054
32055
32056
32057
32058
32059
32060 CGDirectDisplayID CGOpenGLDisplayMaskToDisplayID(CGOpenGLDisplayMask mask);
32061
32062
32063 CGRect CGDisplayBounds(CGDirectDisplayID display);
32064
32065 size_t CGDisplayPixelsWide(CGDirectDisplayID display);
32066 size_t CGDisplayPixelsHigh(CGDirectDisplayID display);
32067 CFArrayRef CGDisplayAvailableModes(CGDirectDisplayID display);
32068 CFDictionaryRef CGDisplayBestModeForParameters(CGDirectDisplayID display, size_t bitsPerPixel, size_t width, size_t height, boolean_t * exactMatch);
32069
32070 CFDictionaryRef CGDisplayBestModeForParametersAndRefreshRate(CGDirectDisplayID display, size_t bitsPerPixel, size_t width, size_t height, CGRefreshRate refresh, boolean_t * exactMatch);
32071
32072 CFDictionaryRef CGDisplayBestModeForParametersAndRefreshRateWithProperty(CGDirectDisplayID display, size_t bitsPerPixel, size_t width, size_t height, CGRefreshRate refresh, CFStringRef property, boolean_t * exactMatch);
32073
32074
32075
32076
32077
32078 CFDictionaryRef CGDisplayCurrentMode(CGDirectDisplayID display);
32079 CGDisplayErr CGDisplaySwitchToMode(CGDirectDisplayID display, CFDictionaryRef mode);
32080
32081
32082 size_t CGDisplayBitsPerPixel(CGDirectDisplayID display);
32083 size_t CGDisplayBitsPerSample(CGDirectDisplayID display);
32084 size_t CGDisplaySamplesPerPixel(CGDirectDisplayID display);
32085 size_t CGDisplayBytesPerRow(CGDirectDisplayID display);
32086 typedef float CGGammaValue;
32087
32088 CGDisplayErr CGSetDisplayTransferByFormula(CGDirectDisplayID display,
32089                                     CGGammaValue redMin,
32090                                     CGGammaValue redMax,
32091                                     CGGammaValue redGamma,
32092                                     CGGammaValue greenMin,
32093                                     CGGammaValue greenMax,
32094                                     CGGammaValue greenGamma,
32095                                     CGGammaValue blueMin,
32096                                     CGGammaValue blueMax,
32097                                     CGGammaValue blueGamma);
32098
32099 CGDisplayErr CGGetDisplayTransferByFormula(CGDirectDisplayID display,
32100                                     CGGammaValue *redMin,
32101                                     CGGammaValue *redMax,
32102                                     CGGammaValue *redGamma,
32103                                     CGGammaValue *greenMin,
32104                                     CGGammaValue *greenMax,
32105                                     CGGammaValue *greenGamma,
32106                                     CGGammaValue *blueMin,
32107                                     CGGammaValue *blueMax,
32108                                     CGGammaValue *blueGamma);
32109 CGDisplayErr CGSetDisplayTransferByTable(CGDirectDisplayID display,
32110                                   CGTableCount tableSize,
32111                                   const CGGammaValue *redTable,
32112                                   const CGGammaValue *greenTable,
32113                                   const CGGammaValue *blueTable);
32114
32115
32116
32117
32118
32119
32120 CGDisplayErr CGGetDisplayTransferByTable(CGDirectDisplayID display,
32121                                   CGTableCount capacity,
32122                                   CGGammaValue *redTable,
32123                                   CGGammaValue *greenTable,
32124                                   CGGammaValue *blueTable,
32125                                   CGTableCount *sampleCount);
32126
32127
32128 CGDisplayErr CGSetDisplayTransferByByteTable(CGDirectDisplayID display,
32129                                       CGTableCount tableSize,
32130                                       const CGByteValue *redTable,
32131                                       const CGByteValue *greenTable,
32132                                       const CGByteValue *blueTable);
32133
32134
32135 void CGDisplayRestoreColorSyncSettings(void);
32136
32137
32138
32139 boolean_t CGDisplayIsCaptured(CGDirectDisplayID display);
32140 CGDisplayErr CGDisplayCapture(CGDirectDisplayID display);
32141 CGDisplayErr CGDisplayRelease(CGDirectDisplayID display);
32142
32143
32144
32145
32146
32147
32148 CGDisplayErr CGCaptureAllDisplays(void);
32149
32150
32151
32152
32153
32154 CGDisplayErr CGReleaseAllDisplays(void);
32155
32156
32157
32158
32159
32160 void * CGShieldingWindowID(CGDirectDisplayID display);
32161
32162
32163
32164
32165
32166
32167 int32_t CGShieldingWindowLevel(void);
32168
32169
32170
32171
32172
32173
32174 void * CGDisplayBaseAddress(CGDirectDisplayID display);
32175
32176
32177
32178
32179
32180
32181
32182 void * CGDisplayAddressForPosition(CGDirectDisplayID display, CGDisplayCoord x, CGDisplayCoord y);
32183
32184
32185
32186 CGDisplayErr CGDisplayHideCursor(CGDirectDisplayID display);
32187 CGDisplayErr CGDisplayShowCursor(CGDirectDisplayID display);
32188
32189
32190
32191
32192
32193
32194
32195 CGDisplayErr CGDisplayMoveCursorToPoint(CGDirectDisplayID display, CGPoint point);
32196
32197
32198
32199
32200
32201 void CGGetLastMouseDelta( CGMouseDelta * deltaX, CGMouseDelta * deltaY );
32202 boolean_t CGDisplayCanSetPalette(CGDirectDisplayID display);
32203 CGDisplayErr CGDisplaySetPalette(CGDirectDisplayID display, const CGDirectPaletteRef palette);
32204 CGDisplayErr CGDisplayWaitForBeamPositionOutsideLines( CGDirectDisplayID display,
32205                                                        CGBeamPosition upperScanLine,
32206                                                        CGBeamPosition lowerScanLine );
32207
32208
32209
32210
32211
32212
32213 CGBeamPosition CGDisplayBeamPosition( CGDirectDisplayID display );
32214
32215 }
32216 extern "C" {
32217
32218 typedef float CGPaletteBlendFraction;
32219
32220
32221
32222
32223
32224
32225
32226 struct _CGDeviceColor
32227 {
32228     float red;
32229     float green;
32230     float blue;
32231 };
32232 typedef struct _CGDeviceColor CGDeviceColor;
32233
32234 struct _CGDeviceByteColor
32235 {
32236     CGByteValue red;
32237     CGByteValue green;
32238     CGByteValue blue;
32239 };
32240 typedef struct _CGDeviceByteColor CGDeviceByteColor;
32241
32242
32243
32244
32245
32246 CGDirectPaletteRef CGPaletteCreateDefaultColorPalette(void);
32247
32248
32249
32250
32251
32252
32253 CGDirectPaletteRef CGPaletteCreateWithDisplay(CGDirectDisplayID display);
32254
32255
32256
32257
32258
32259 CGDirectPaletteRef CGPaletteCreateWithCapacity( CGTableCount capacity );
32260
32261
32262
32263
32264
32265 CGDirectPaletteRef CGPaletteCreateWithSamples(CGDeviceColor * sampleTable, CGTableCount sampleCount);
32266
32267
32268
32269
32270
32271
32272 CGDirectPaletteRef CGPaletteCreateWithByteSamples(CGDeviceByteColor * sampleTable, CGTableCount sampleCount);
32273
32274
32275
32276
32277 void CGPaletteRelease( CGDirectPaletteRef palette );
32278
32279
32280
32281
32282 CGDeviceColor CGPaletteGetColorAtIndex(CGDirectPaletteRef palette, CGTableCount index);
32283
32284
32285
32286
32287
32288
32289 CGTableCount CGPaletteGetIndexForColor(CGDirectPaletteRef palette, CGDeviceColor color);
32290
32291
32292
32293
32294 CGTableCount CGPaletteGetNumberOfSamples(CGDirectPaletteRef palette);
32295
32296
32297
32298
32299
32300 void CGPaletteSetColorAtIndex(CGDirectPaletteRef palette, CGDeviceColor color, CGTableCount index);
32301
32302
32303
32304
32305 CGDirectPaletteRef CGPaletteCreateCopy(CGDirectPaletteRef palette);
32306
32307
32308
32309
32310 Boolean CGPaletteIsEqualToPalette(CGDirectPaletteRef palette1, CGDirectPaletteRef palette2);
32311
32312
32313
32314
32315
32316 CGDirectPaletteRef CGPaletteCreateFromPaletteBlendedWithColor(
32317                                           CGDirectPaletteRef palette,
32318                                           CGPaletteBlendFraction fraction,
32319                                           CGDeviceColor color);
32320
32321 }
32322 extern "C" {
32323 typedef struct _CGDisplayConfigRef * CGDisplayConfigRef;
32324
32325
32326 CGError CGBeginDisplayConfiguration(CGDisplayConfigRef *pConfigRef);
32327 CGError CGConfigureDisplayOrigin(CGDisplayConfigRef configRef,
32328                                  CGDirectDisplayID display,
32329                                  CGDisplayCoord x,
32330                                  CGDisplayCoord y);
32331 CGError CGConfigureDisplayMode(CGDisplayConfigRef configRef,
32332                                 CGDirectDisplayID display,
32333                                 CFDictionaryRef mode);
32334 CGError CGConfigureDisplayMirrorOfDisplay(CGDisplayConfigRef configRef,
32335                                                      CGDirectDisplayID display,
32336                                                      CGDirectDisplayID masterDisplay);
32337
32338
32339 CGError CGCancelDisplayConfiguration(CGDisplayConfigRef configRef);
32340 enum {
32341     kCGConfigureForAppOnly = 0,
32342     kCGConfigureForSession = 1,
32343     kCGConfigurePermanently = 2
32344 };
32345 typedef u_int32_t CGConfigureOption;
32346
32347 CGError CGCompleteDisplayConfiguration( CGDisplayConfigRef configRef, CGConfigureOption option );
32348
32349
32350 void CGRestorePermanentDisplayConfiguration(void);
32351 boolean_t CGDisplayIsActive(CGDirectDisplayID display);
32352
32353
32354 boolean_t CGDisplayIsAsleep(CGDirectDisplayID display);
32355
32356
32357
32358
32359
32360  boolean_t CGDisplayIsOnline(CGDirectDisplayID display);
32361
32362
32363 boolean_t CGDisplayIsMain(CGDirectDisplayID display);
32364
32365
32366 boolean_t CGDisplayIsBuiltin(CGDirectDisplayID display);
32367
32368
32369 boolean_t CGDisplayIsInMirrorSet(CGDirectDisplayID display);
32370
32371
32372 boolean_t CGDisplayIsAlwaysInMirrorSet(CGDirectDisplayID display);
32373
32374
32375 boolean_t CGDisplayIsInHWMirrorSet(CGDirectDisplayID display);
32376
32377
32378 CGDirectDisplayID CGDisplayMirrorsDisplay(CGDirectDisplayID display);
32379
32380
32381 boolean_t CGDisplayUsesOpenGLAcceleration(CGDirectDisplayID display);
32382
32383
32384
32385
32386
32387
32388 CGDirectDisplayID CGDisplayPrimaryDisplay(CGDirectDisplayID display);
32389
32390
32391
32392
32393
32394 uint32_t CGDisplayUnitNumber(CGDirectDisplayID display);
32395 uint32_t CGDisplayVendorNumber(CGDirectDisplayID display);
32396 uint32_t CGDisplayModelNumber(CGDirectDisplayID display);
32397 uint32_t CGDisplaySerialNumber(CGDirectDisplayID display);
32398
32399
32400
32401
32402 }
32403 extern "C" {
32404
32405 typedef uint32_t CGDisplayFadeReservationToken;
32406
32407
32408 typedef float CGDisplayBlendFraction;
32409 typedef float CGDisplayFadeInterval;
32410 CGError CGConfigureDisplayFadeEffect(CGDisplayConfigRef configRef,
32411                                      CGDisplayFadeInterval fadeOutSeconds,
32412                                      CGDisplayFadeInterval fadeInSeconds,
32413                                      float fadeRed,
32414                                      float fadeGreen,
32415                                      float fadeBlue);
32416
32417
32418
32419
32420
32421
32422
32423 typedef float CGDisplayReservationInterval;
32424 CGError CGAcquireDisplayFadeReservation(CGDisplayReservationInterval seconds,
32425                                         CGDisplayFadeReservationToken * pNewToken);
32426 CGError CGReleaseDisplayFadeReservation(CGDisplayFadeReservationToken myToken);
32427 CGError CGDisplayFade(CGDisplayFadeReservationToken myToken,
32428                       CGDisplayFadeInterval seconds,
32429                       CGDisplayBlendFraction startBlend,
32430                       CGDisplayBlendFraction endBlend,
32431                       float redBlend, float greenBlend, float blueBlend,
32432                       boolean_t synchronous );
32433
32434
32435
32436
32437 boolean_t CGDisplayFadeOperationInProgress(void);
32438
32439
32440
32441 }
32442
32443
32444
32445
32446
32447
32448
32449 extern "C" {
32450
32451
32452
32453
32454
32455
32456
32457 extern CGContextRef CGPDFContextCreate(CGDataConsumerRef consumer, const CGRect *mediaBox, CFDictionaryRef auxiliaryInfo);
32458
32459
32460
32461 extern CGContextRef CGPDFContextCreateWithURL(CFURLRef url, const CGRect *mediaBox, CFDictionaryRef auxiliaryInfo);
32462 }
32463
32464 extern "C" {
32465
32466 typedef CGError CGEventErr;
32467 typedef u_int32_t CGRectCount;
32468 typedef void (*CGScreenRefreshCallback)(CGRectCount count, const CGRect * rectArray, void * userParameter);
32469
32470
32471
32472
32473
32474
32475
32476 extern void CGRegisterScreenRefreshCallback( CGScreenRefreshCallback function, void * userParameter );
32477
32478
32479
32480
32481
32482 extern void CGUnregisterScreenRefreshCallback( CGScreenRefreshCallback function, void * userParameter );
32483 extern CGEventErr CGWaitForScreenRefreshRects( CGRect ** pRectArray, CGRectCount * pCount );
32484
32485
32486
32487
32488 extern void CGReleaseScreenRefreshRects( CGRect * rectArray );
32489 typedef u_int32_t CGButtonCount;
32490 extern CGEventErr CGPostMouseEvent( CGPoint mouseCursorPosition,
32491                                         boolean_t updateMouseCursorPosition,
32492                                         CGButtonCount buttonCount,
32493                                         boolean_t mouseButtonDown, ... );
32494 typedef u_int32_t CGWheelCount;
32495 extern CGEventErr CGPostScrollWheelEvent( CGWheelCount wheelCount,
32496                                             int32_t wheel1, ... );
32497 typedef u_int16_t CGCharCode;
32498 typedef u_int16_t CGKeyCode;
32499
32500 extern CGEventErr CGPostKeyboardEvent( CGCharCode keyChar,
32501                                           CGKeyCode virtualKey,
32502                                           boolean_t keyDown );
32503
32504
32505
32506
32507
32508 extern CGEventErr CGWarpMouseCursorPosition( CGPoint newCursorPosition );
32509 extern CGEventErr CGInhibitLocalEvents( boolean_t doInhibit);
32510
32511
32512
32513
32514
32515 extern CGEventErr CGSetLocalEventsSuppressionInterval(CFTimeInterval seconds);
32516 extern CGEventErr CGEnableEventStateCombining(boolean_t doCombineState);
32517 enum
32518 {
32519     kCGEventFilterMaskPermitLocalMouseEvents = 0x00000001,
32520     kCGEventFilterMaskPermitLocalKeyboardEvents = 0x00000002,
32521     kCGEventFilterMaskPermitSystemDefinedEvents = 0x00000004
32522 };
32523 typedef uint32_t CGEventFilterMask;
32524
32525 enum
32526 {
32527     kCGEventSupressionStateSupressionInterval = 0,
32528     kCGEventSupressionStateRemoteMouseDrag,
32529     kCGNumberOfEventSupressionStates
32530 };
32531 typedef uint32_t CGEventSupressionState;
32532
32533
32534
32535
32536
32537 extern CGEventErr CGSetLocalEventsFilterDuringSupressionState(CGEventFilterMask filter,
32538 CGEventSupressionState state);
32539 extern CGEventErr CGAssociateMouseAndMouseCursorPosition(boolean_t connected);
32540 extern CFMachPortRef CGWindowServerCFMachPort(void);
32541
32542
32543 }
32544
32545 extern "C" {
32546 typedef int32_t CGWindowLevel;
32547 typedef int32_t CGWindowLevelKey;
32548
32549 enum _CGCommonWindowLevelKey {
32550     kCGBaseWindowLevelKey = 0,
32551     kCGMinimumWindowLevelKey,
32552     kCGDesktopWindowLevelKey,
32553     kCGBackstopMenuLevelKey,
32554     kCGNormalWindowLevelKey,
32555     kCGFloatingWindowLevelKey,
32556     kCGTornOffMenuWindowLevelKey,
32557     kCGDockWindowLevelKey,
32558     kCGMainMenuWindowLevelKey,
32559     kCGStatusWindowLevelKey,
32560     kCGModalPanelWindowLevelKey,
32561     kCGPopUpMenuWindowLevelKey,
32562     kCGDraggingWindowLevelKey,
32563     kCGScreenSaverWindowLevelKey,
32564     kCGMaximumWindowLevelKey,
32565     kCGOverlayWindowLevelKey,
32566     kCGHelpWindowLevelKey,
32567     kCGUtilityWindowLevelKey,
32568     kCGDesktopIconWindowLevelKey,
32569     kCGCursorWindowLevelKey,
32570     kCGNumberOfWindowLevelKeys
32571 };
32572
32573 CGWindowLevel CGWindowLevelForKey( CGWindowLevelKey key );
32574 }
32575
32576
32577
32578 extern "C" {
32579
32580
32581 typedef long CMError;
32582
32583 typedef struct OpaqueCMProfileRef* CMProfileRef;
32584
32585 typedef struct OpaqueCMProfileSearchRef* CMProfileSearchRef;
32586
32587 typedef struct OpaqueCMMatchRef* CMMatchRef;
32588
32589 typedef struct OpaqueCMWorldRef* CMWorldRef;
32590
32591
32592
32593 typedef UInt32 CMDisplayIDType;
32594
32595
32596 typedef OSErr ( * CMFlattenProcPtr)(long command, long *size, void *data, void *refCon);
32597
32598 typedef Boolean ( * CMBitmapCallBackProcPtr)(long progress, void *refCon);
32599
32600 typedef Boolean ( * CMConcatCallBackProcPtr)(long progress, void *refCon);
32601
32602 typedef Boolean ( * CMProfileFilterProcPtr)(CMProfileRef prof, void *refCon);
32603
32604 typedef OSErr ( * CMProfileAccessProcPtr)(long command, long offset, long *size, void *data, void *refCon);
32605 typedef CMFlattenProcPtr CMFlattenUPP;
32606 typedef CMBitmapCallBackProcPtr CMBitmapCallBackUPP;
32607 typedef CMConcatCallBackProcPtr CMConcatCallBackUPP;
32608 typedef CMProfileFilterProcPtr CMProfileFilterUPP;
32609 typedef CMProfileAccessProcPtr CMProfileAccessUPP;
32610 extern CMFlattenUPP
32611 NewCMFlattenUPP(CMFlattenProcPtr userRoutine) ;
32612 extern CMBitmapCallBackUPP
32613 NewCMBitmapCallBackUPP(CMBitmapCallBackProcPtr userRoutine) ;
32614 extern CMConcatCallBackUPP
32615 NewCMConcatCallBackUPP(CMConcatCallBackProcPtr userRoutine) ;
32616 extern CMProfileFilterUPP
32617 NewCMProfileFilterUPP(CMProfileFilterProcPtr userRoutine) ;
32618 extern CMProfileAccessUPP
32619 NewCMProfileAccessUPP(CMProfileAccessProcPtr userRoutine) ;
32620 extern void
32621 DisposeCMFlattenUPP(CMFlattenUPP userUPP) ;
32622 extern void
32623 DisposeCMBitmapCallBackUPP(CMBitmapCallBackUPP userUPP) ;
32624 extern void
32625 DisposeCMConcatCallBackUPP(CMConcatCallBackUPP userUPP) ;
32626 extern void
32627 DisposeCMProfileFilterUPP(CMProfileFilterUPP userUPP) ;
32628 extern void
32629 DisposeCMProfileAccessUPP(CMProfileAccessUPP userUPP) ;
32630 extern OSErr
32631 InvokeCMFlattenUPP(
32632   long command,
32633   long * size,
32634   void * data,
32635   void * refCon,
32636   CMFlattenUPP userUPP) ;
32637 extern Boolean
32638 InvokeCMBitmapCallBackUPP(
32639   long progress,
32640   void * refCon,
32641   CMBitmapCallBackUPP userUPP) ;
32642 extern Boolean
32643 InvokeCMConcatCallBackUPP(
32644   long progress,
32645   void * refCon,
32646   CMConcatCallBackUPP userUPP) ;
32647 extern Boolean
32648 InvokeCMProfileFilterUPP(
32649   CMProfileRef prof,
32650   void * refCon,
32651   CMProfileFilterUPP userUPP) ;
32652 extern OSErr
32653 InvokeCMProfileAccessUPP(
32654   long command,
32655   long offset,
32656   long * size,
32657   void * data,
32658   void * refCon,
32659   CMProfileAccessUPP userUPP) ;
32660
32661
32662
32663 }
32664
32665
32666
32667
32668
32669 enum {
32670   cmICCProfileVersion4 = 0x04000000,
32671   cmICCProfileVersion2 = 0x02000000,
32672   cmICCProfileVersion21 = 0x02100000,
32673   cmCS2ProfileVersion = cmICCProfileVersion2,
32674   cmCS1ProfileVersion = 0x00000100
32675 };
32676
32677
32678 enum {
32679   cmProfileMajorVersionMask = (long)0xFF000000,
32680   cmCurrentProfileMajorVersion = 0x02000000
32681 };
32682
32683
32684 enum {
32685   cmMagicNumber = 'acsp'
32686 };
32687
32688
32689
32690
32691
32692
32693 enum {
32694   cmICCReservedFlagsMask = 0x0000FFFF,
32695   cmEmbeddedMask = 0x00000001,
32696   cmEmbeddedUseMask = 0x00000002,
32697   cmCMSReservedFlagsMask = (long)0xFFFF0000,
32698   cmQualityMask = 0x00030000,
32699   cmInterpolationMask = 0x00040000,
32700   cmGamutCheckingMask = 0x00080000
32701 };
32702
32703
32704 enum {
32705   cmEmbeddedProfile = 0,
32706   cmEmbeddedUse = 1
32707 };
32708
32709
32710 enum {
32711   cmNormalMode = 0,
32712   cmDraftMode = 1,
32713   cmBestMode = 2
32714 };
32715
32716
32717
32718
32719
32720
32721 enum {
32722   cmReflectiveTransparentMask = 0x00000001,
32723   cmGlossyMatteMask = 0x00000002
32724 };
32725
32726
32727 enum {
32728   cmReflective = 0,
32729   cmGlossy = 1
32730 };
32731
32732
32733
32734 enum {
32735   cmPerceptual = 0,
32736   cmRelativeColorimetric = 1,
32737   cmSaturation = 2,
32738   cmAbsoluteColorimetric = 3
32739 };
32740
32741
32742
32743
32744 enum {
32745   cmAsciiData = 0,
32746   cmBinaryData = 1
32747 };
32748
32749
32750 enum {
32751   cmPrtrDefaultScreens = 0,
32752   cmLinesPer = 1
32753 };
32754
32755
32756 enum {
32757   cmNumHeaderElements = 10
32758 };
32759
32760
32761 enum {
32762   cmAToB0Tag = 'A2B0',
32763   cmAToB1Tag = 'A2B1',
32764   cmAToB2Tag = 'A2B2',
32765   cmBlueColorantTag = 'bXYZ',
32766   cmBlueTRCTag = 'bTRC',
32767   cmBToA0Tag = 'B2A0',
32768   cmBToA1Tag = 'B2A1',
32769   cmBToA2Tag = 'B2A2',
32770   cmCalibrationDateTimeTag = 'calt',
32771   cmChromaticAdaptationTag = 'chad',
32772   cmCharTargetTag = 'targ',
32773   cmCopyrightTag = 'cprt',
32774   cmDeviceMfgDescTag = 'dmnd',
32775   cmDeviceModelDescTag = 'dmdd',
32776   cmGamutTag = 'gamt',
32777   cmGrayTRCTag = 'kTRC',
32778   cmGreenColorantTag = 'gXYZ',
32779   cmGreenTRCTag = 'gTRC',
32780   cmLuminanceTag = 'lumi',
32781   cmMeasurementTag = 'meas',
32782   cmMediaBlackPointTag = 'bkpt',
32783   cmMediaWhitePointTag = 'wtpt',
32784   cmNamedColorTag = 'ncol',
32785   cmNamedColor2Tag = 'ncl2',
32786   cmPreview0Tag = 'pre0',
32787   cmPreview1Tag = 'pre1',
32788   cmPreview2Tag = 'pre2',
32789   cmProfileDescriptionTag = 'desc',
32790   cmProfileSequenceDescTag = 'pseq',
32791   cmPS2CRD0Tag = 'psd0',
32792   cmPS2CRD1Tag = 'psd1',
32793   cmPS2CRD2Tag = 'psd2',
32794   cmPS2CRD3Tag = 'psd3',
32795   cmPS2CSATag = 'ps2s',
32796   cmPS2RenderingIntentTag = 'ps2i',
32797   cmRedColorantTag = 'rXYZ',
32798   cmRedTRCTag = 'rTRC',
32799   cmScreeningDescTag = 'scrd',
32800   cmScreeningTag = 'scrn',
32801   cmTechnologyTag = 'tech',
32802   cmUcrBgTag = 'bfd ',
32803   cmViewingConditionsDescTag = 'vued',
32804   cmViewingConditionsTag = 'view'
32805 };
32806
32807
32808 enum {
32809   cmPS2CRDVMSizeTag = 'psvm',
32810   cmVideoCardGammaTag = 'vcgt',
32811   cmMakeAndModelTag = 'mmod',
32812   cmProfileDescriptionMLTag = 'dscm',
32813   cmNativeDisplayInfoTag = 'ndin'
32814 };
32815
32816
32817 enum {
32818   cmSigCrdInfoType = 'crdi',
32819   cmSigCurveType = 'curv',
32820   cmSigDataType = 'data',
32821   cmSigDateTimeType = 'dtim',
32822   cmSigLut16Type = 'mft2',
32823   cmSigLut8Type = 'mft1',
32824   cmSigMeasurementType = 'meas',
32825   cmSigMultiFunctA2BType = 'mAB ',
32826   cmSigMultiFunctB2AType = 'mBA ',
32827   cmSigNamedColorType = 'ncol',
32828   cmSigNamedColor2Type = 'ncl2',
32829   cmSigParametricCurveType = 'para',
32830   cmSigProfileDescriptionType = 'desc',
32831   cmSigProfileSequenceDescType = 'pseq',
32832   cmSigScreeningType = 'scrn',
32833   cmSigS15Fixed16Type = 'sf32',
32834   cmSigSignatureType = 'sig ',
32835   cmSigTextType = 'text',
32836   cmSigU16Fixed16Type = 'uf32',
32837   cmSigU1Fixed15Type = 'uf16',
32838   cmSigUInt8Type = 'ui08',
32839   cmSigUInt16Type = 'ui16',
32840   cmSigUInt32Type = 'ui32',
32841   cmSigUInt64Type = 'ui64',
32842   cmSigUcrBgType = 'bfd ',
32843   cmSigUnicodeTextType = 'utxt',
32844   cmSigViewingConditionsType = 'view',
32845   cmSigXYZType = 'XYZ '
32846 };
32847
32848
32849 enum {
32850   cmSigPS2CRDVMSizeType = 'psvm',
32851   cmSigVideoCardGammaType = 'vcgt',
32852   cmSigMakeAndModelType = 'mmod',
32853   cmSigNativeDisplayInfoType = 'ndin',
32854   cmSigMultiLocalizedUniCodeType = 'mluc'
32855 };
32856
32857
32858
32859 enum {
32860   cmTechnologyDigitalCamera = 'dcam',
32861   cmTechnologyFilmScanner = 'fscn',
32862   cmTechnologyReflectiveScanner = 'rscn',
32863   cmTechnologyInkJetPrinter = 'ijet',
32864   cmTechnologyThermalWaxPrinter = 'twax',
32865   cmTechnologyElectrophotographicPrinter = 'epho',
32866   cmTechnologyElectrostaticPrinter = 'esta',
32867   cmTechnologyDyeSublimationPrinter = 'dsub',
32868   cmTechnologyPhotographicPaperPrinter = 'rpho',
32869   cmTechnologyFilmWriter = 'fprn',
32870   cmTechnologyVideoMonitor = 'vidm',
32871   cmTechnologyVideoCamera = 'vidc',
32872   cmTechnologyProjectionTelevision = 'pjtv',
32873   cmTechnologyCRTDisplay = 'CRT ',
32874   cmTechnologyPMDisplay = 'PMD ',
32875   cmTechnologyAMDisplay = 'AMD ',
32876   cmTechnologyPhotoCD = 'KPCD',
32877   cmTechnologyPhotoImageSetter = 'imgs',
32878   cmTechnologyGravure = 'grav',
32879   cmTechnologyOffsetLithography = 'offs',
32880   cmTechnologySilkscreen = 'silk',
32881   cmTechnologyFlexography = 'flex'
32882 };
32883
32884
32885
32886
32887 enum {
32888   cmFlare0 = 0x00000000,
32889   cmFlare100 = 0x00000001
32890 };
32891
32892
32893 enum {
32894   cmGeometryUnknown = 0x00000000,
32895   cmGeometry045or450 = 0x00000001,
32896   cmGeometry0dord0 = 0x00000002
32897 };
32898
32899
32900 enum {
32901   cmStdobsUnknown = 0x00000000,
32902   cmStdobs1931TwoDegrees = 0x00000001,
32903   cmStdobs1964TenDegrees = 0x00000002
32904 };
32905
32906
32907 enum {
32908   cmIlluminantUnknown = 0x00000000,
32909   cmIlluminantD50 = 0x00000001,
32910   cmIlluminantD65 = 0x00000002,
32911   cmIlluminantD93 = 0x00000003,
32912   cmIlluminantF2 = 0x00000004,
32913   cmIlluminantD55 = 0x00000005,
32914   cmIlluminantA = 0x00000006,
32915   cmIlluminantEquiPower = 0x00000007,
32916   cmIlluminantF8 = 0x00000008
32917 };
32918
32919
32920 enum {
32921   cmSpotFunctionUnknown = 0,
32922   cmSpotFunctionDefault = 1,
32923   cmSpotFunctionRound = 2,
32924   cmSpotFunctionDiamond = 3,
32925   cmSpotFunctionEllipse = 4,
32926   cmSpotFunctionLine = 5,
32927   cmSpotFunctionSquare = 6,
32928   cmSpotFunctionCross = 7
32929 };
32930
32931
32932 enum {
32933   cmXYZData = 'XYZ ',
32934   cmLabData = 'Lab ',
32935   cmLuvData = 'Luv ',
32936   cmYCbCrData = 'YCbr',
32937   cmYxyData = 'Yxy ',
32938   cmRGBData = 'RGB ',
32939   cmSRGBData = 'sRGB',
32940   cmGrayData = 'GRAY',
32941   cmHSVData = 'HSV ',
32942   cmHLSData = 'HLS ',
32943   cmCMYKData = 'CMYK',
32944   cmCMYData = 'CMY ',
32945   cmMCH5Data = 'MCH5',
32946   cmMCH6Data = 'MCH6',
32947   cmMCH7Data = 'MCH7',
32948   cmMCH8Data = 'MCH8',
32949   cm3CLRData = '3CLR',
32950   cm4CLRData = '4CLR',
32951   cm5CLRData = '5CLR',
32952   cm6CLRData = '6CLR',
32953   cm7CLRData = '7CLR',
32954   cm8CLRData = '8CLR',
32955   cm9CLRData = '9CLR',
32956   cm10CLRData = 'ACLR',
32957   cm11CLRData = 'BCLR',
32958   cm12CLRData = 'CCLR',
32959   cm13CLRData = 'DCLR',
32960   cm14CLRData = 'ECLR',
32961   cm15CLRData = 'FCLR',
32962   cmNamedData = 'NAME'
32963 };
32964
32965
32966 enum {
32967   cmInputClass = 'scnr',
32968   cmDisplayClass = 'mntr',
32969   cmOutputClass = 'prtr',
32970   cmLinkClass = 'link',
32971   cmAbstractClass = 'abst',
32972   cmColorSpaceClass = 'spac',
32973   cmNamedColorClass = 'nmcl'
32974 };
32975
32976
32977 enum {
32978   cmMacintosh = 'APPL',
32979   cmMicrosoft = 'MSFT',
32980   cmSolaris = 'SUNW',
32981   cmSiliconGraphics = 'SGI ',
32982   cmTaligent = 'TGNT'
32983 };
32984
32985
32986 enum {
32987   cmParametricType0 = 0,
32988   cmParametricType1 = 1,
32989   cmParametricType2 = 2,
32990   cmParametricType3 = 3,
32991   cmParametricType4 = 4
32992 };
32993
32994
32995
32996 enum {
32997   cmCS1ChromTag = 'chrm',
32998   cmCS1TRCTag = 'trc ',
32999   cmCS1NameTag = 'name',
33000   cmCS1CustTag = 'cust'
33001 };
33002
33003
33004 struct CMDateTime {
33005   UInt16 year;
33006   UInt16 month;
33007   UInt16 dayOfTheMonth;
33008   UInt16 hours;
33009   UInt16 minutes;
33010   UInt16 seconds;
33011 };
33012 typedef struct CMDateTime CMDateTime;
33013 struct CMFixedXYColor {
33014   Fixed x;
33015   Fixed y;
33016 };
33017 typedef struct CMFixedXYColor CMFixedXYColor;
33018 struct CMFixedXYZColor {
33019   Fixed X;
33020   Fixed Y;
33021   Fixed Z;
33022 };
33023 typedef struct CMFixedXYZColor CMFixedXYZColor;
33024
33025 typedef UInt16 CMXYZComponent;
33026 struct CMXYZColor {
33027   CMXYZComponent X;
33028   CMXYZComponent Y;
33029   CMXYZComponent Z;
33030 };
33031 typedef struct CMXYZColor CMXYZColor;
33032
33033
33034
33035 typedef unsigned char CMProfileMD5[16];
33036 typedef CMProfileMD5 * CMProfileMD5Ptr;
33037
33038
33039
33040
33041
33042
33043
33044   inline Boolean CMProfileMD5AreEqual(CMProfileMD5 a, CMProfileMD5 b)
33045   {
33046     return ((long*)a)[0]==((long*)b)[0] && ((long*)a)[1]==((long*)b)[1] &&
33047          ((long*)a)[2]==((long*)b)[2] && ((long*)a)[3]==((long*)b)[3];
33048   }
33049
33050
33051
33052
33053
33054
33055 struct CM2Header {
33056   UInt32 size;
33057   OSType CMMType;
33058   UInt32 profileVersion;
33059   OSType profileClass;
33060   OSType dataColorSpace;
33061   OSType profileConnectionSpace;
33062   CMDateTime dateTime;
33063   OSType CS2profileSignature;
33064   OSType platform;
33065   UInt32 flags;
33066   OSType deviceManufacturer;
33067   UInt32 deviceModel;
33068   UInt32 deviceAttributes[2];
33069   UInt32 renderingIntent;
33070   CMFixedXYZColor white;
33071   OSType creator;
33072   char reserved[44];
33073 };
33074 typedef struct CM2Header CM2Header;
33075 struct CM4Header {
33076   UInt32 size;
33077   OSType CMMType;
33078   UInt32 profileVersion;
33079   OSType profileClass;
33080   OSType dataColorSpace;
33081   OSType profileConnectionSpace;
33082   CMDateTime dateTime;
33083   OSType CS2profileSignature;
33084   OSType platform;
33085   UInt32 flags;
33086   OSType deviceManufacturer;
33087   UInt32 deviceModel;
33088   UInt32 deviceAttributes[2];
33089   UInt32 renderingIntent;
33090   CMFixedXYZColor white;
33091   OSType creator;
33092   CMProfileMD5 digest;
33093   char reserved[28];
33094 };
33095 typedef struct CM4Header CM4Header;
33096 struct CMTagRecord {
33097   OSType tag;
33098   UInt32 elementOffset;
33099   UInt32 elementSize;
33100 };
33101 typedef struct CMTagRecord CMTagRecord;
33102 struct CMTagElemTable {
33103   UInt32 count;
33104   CMTagRecord tagList[1];
33105 };
33106 typedef struct CMTagElemTable CMTagElemTable;
33107 struct CM2Profile {
33108   CM2Header header;
33109   CMTagElemTable tagTable;
33110   char elemData[1];
33111 };
33112 typedef struct CM2Profile CM2Profile;
33113 typedef CM2Profile * CM2ProfilePtr;
33114 typedef CM2ProfilePtr * CM2ProfileHandle;
33115
33116 struct CMAdaptationMatrixType {
33117   OSType typeDescriptor;
33118   unsigned long reserved;
33119   Fixed adaptationMatrix[9];
33120 };
33121 typedef struct CMAdaptationMatrixType CMAdaptationMatrixType;
33122 struct CMCurveType {
33123   OSType typeDescriptor;
33124   UInt32 reserved;
33125   UInt32 countValue;
33126   UInt16 data[1];
33127 };
33128 typedef struct CMCurveType CMCurveType;
33129 struct CMDataType {
33130   OSType typeDescriptor;
33131   UInt32 reserved;
33132   UInt32 dataFlag;
33133   char data[1];
33134 };
33135 typedef struct CMDataType CMDataType;
33136 struct CMDateTimeType {
33137   OSType typeDescriptor;
33138   UInt32 reserved;
33139   CMDateTime dateTime;
33140 };
33141 typedef struct CMDateTimeType CMDateTimeType;
33142 struct CMLut16Type {
33143   OSType typeDescriptor;
33144   UInt32 reserved;
33145   UInt8 inputChannels;
33146   UInt8 outputChannels;
33147   UInt8 gridPoints;
33148   UInt8 reserved2;
33149   Fixed matrix[3][3];
33150   UInt16 inputTableEntries;
33151   UInt16 outputTableEntries;
33152   UInt16 inputTable[1];
33153 };
33154 typedef struct CMLut16Type CMLut16Type;
33155 struct CMLut8Type {
33156   OSType typeDescriptor;
33157   UInt32 reserved;
33158   UInt8 inputChannels;
33159   UInt8 outputChannels;
33160   UInt8 gridPoints;
33161   UInt8 reserved2;
33162   Fixed matrix[3][3];
33163   UInt8 inputTable[1];
33164 };
33165 typedef struct CMLut8Type CMLut8Type;
33166 struct CMMultiFunctLutType {
33167   OSType typeDescriptor;
33168   UInt32 reserved;
33169   UInt8 inputChannels;
33170   UInt8 outputChannels;
33171   UInt16 reserved2;
33172   UInt32 offsetBcurves;
33173   UInt32 offsetMatrix;
33174   UInt32 offsetMcurves;
33175   UInt32 offsetCLUT;
33176   UInt32 offsetAcurves;
33177   UInt8 data[1];
33178 };
33179 typedef struct CMMultiFunctLutType CMMultiFunctLutType;
33180 typedef CMMultiFunctLutType CMMultiFunctLutA2BType;
33181 typedef CMMultiFunctLutType CMMultiFunctLutB2AType;
33182 struct CMMultiFunctCLUTType {
33183   UInt8 gridPoints[16];
33184   UInt8 entrySize;
33185   UInt8 reserved[3];
33186   UInt8 data[1];
33187 };
33188 typedef struct CMMultiFunctCLUTType CMMultiFunctCLUTType;
33189 struct CMMeasurementType {
33190   OSType typeDescriptor;
33191   UInt32 reserved;
33192   UInt32 standardObserver;
33193   CMFixedXYZColor backingXYZ;
33194   UInt32 geometry;
33195   UInt32 flare;
33196   UInt32 illuminant;
33197 };
33198 typedef struct CMMeasurementType CMMeasurementType;
33199 struct CMNamedColorType {
33200   OSType typeDescriptor;
33201   UInt32 reserved;
33202   UInt32 vendorFlag;
33203   UInt32 count;
33204   UInt8 prefixName[1];
33205 };
33206 typedef struct CMNamedColorType CMNamedColorType;
33207 struct CMNamedColor2EntryType {
33208   UInt8 rootName[32];
33209   UInt16 PCSColorCoords[3];
33210   UInt16 DeviceColorCoords[1];
33211 };
33212 typedef struct CMNamedColor2EntryType CMNamedColor2EntryType;
33213 struct CMNamedColor2Type {
33214   OSType typeDescriptor;
33215   UInt32 reserved;
33216   UInt32 vendorFlag;
33217   UInt32 count;
33218   UInt32 deviceChannelCount;
33219   UInt8 prefixName[32];
33220   UInt8 suffixName[32];
33221   char data[1];
33222 };
33223 typedef struct CMNamedColor2Type CMNamedColor2Type;
33224 struct CMNativeDisplayInfo {
33225   UInt32 dataSize;
33226   CMFixedXYColor redPhosphor;
33227   CMFixedXYColor greenPhosphor;
33228   CMFixedXYColor bluePhosphor;
33229   CMFixedXYColor whitePoint;
33230   Fixed redGammaValue;
33231   Fixed greenGammaValue;
33232   Fixed blueGammaValue;
33233
33234
33235
33236   UInt16 gammaChannels;
33237   UInt16 gammaEntryCount;
33238   UInt16 gammaEntrySize;
33239   char gammaData[1];
33240 };
33241 typedef struct CMNativeDisplayInfo CMNativeDisplayInfo;
33242 struct CMNativeDisplayInfoType {
33243   OSType typeDescriptor;
33244   unsigned long reserved;
33245   CMNativeDisplayInfo nativeDisplayInfo;
33246 };
33247 typedef struct CMNativeDisplayInfoType CMNativeDisplayInfoType;
33248 struct CMParametricCurveType {
33249   OSType typeDescriptor;
33250   UInt32 reserved;
33251   UInt16 functionType;
33252   UInt16 reserved2;
33253   Fixed value[1];
33254 };
33255 typedef struct CMParametricCurveType CMParametricCurveType;
33256 struct CMTextDescriptionType {
33257   OSType typeDescriptor;
33258   UInt32 reserved;
33259   UInt32 ASCIICount;
33260   UInt8 ASCIIName[2];
33261 };
33262 typedef struct CMTextDescriptionType CMTextDescriptionType;
33263 struct CMTextType {
33264   OSType typeDescriptor;
33265   UInt32 reserved;
33266   UInt8 text[1];
33267 };
33268 typedef struct CMTextType CMTextType;
33269 struct CMUnicodeTextType {
33270   OSType typeDescriptor;
33271   UInt32 reserved;
33272   UniChar text[1];
33273 };
33274 typedef struct CMUnicodeTextType CMUnicodeTextType;
33275 struct CMScreeningChannelRec {
33276   Fixed frequency;
33277   Fixed angle;
33278   UInt32 spotFunction;
33279 };
33280 typedef struct CMScreeningChannelRec CMScreeningChannelRec;
33281 struct CMScreeningType {
33282   OSType typeDescriptor;
33283   UInt32 reserved;
33284   UInt32 screeningFlag;
33285   UInt32 channelCount;
33286   CMScreeningChannelRec channelInfo[1];
33287 };
33288 typedef struct CMScreeningType CMScreeningType;
33289 struct CMSignatureType {
33290   OSType typeDescriptor;
33291   UInt32 reserved;
33292   OSType signature;
33293 };
33294 typedef struct CMSignatureType CMSignatureType;
33295 struct CMS15Fixed16ArrayType {
33296   OSType typeDescriptor;
33297   UInt32 reserved;
33298   Fixed value[1];
33299 };
33300 typedef struct CMS15Fixed16ArrayType CMS15Fixed16ArrayType;
33301 struct CMU16Fixed16ArrayType {
33302   OSType typeDescriptor;
33303   UInt32 reserved;
33304   UInt32 value[1];
33305 };
33306 typedef struct CMU16Fixed16ArrayType CMU16Fixed16ArrayType;
33307 struct CMUInt8ArrayType {
33308   OSType typeDescriptor;
33309   UInt32 reserved;
33310   UInt8 value[1];
33311 };
33312 typedef struct CMUInt8ArrayType CMUInt8ArrayType;
33313 struct CMUInt16ArrayType {
33314   OSType typeDescriptor;
33315   UInt32 reserved;
33316   UInt16 value[1];
33317 };
33318 typedef struct CMUInt16ArrayType CMUInt16ArrayType;
33319 struct CMUInt32ArrayType {
33320   OSType typeDescriptor;
33321   UInt32 reserved;
33322   UInt32 value[1];
33323 };
33324 typedef struct CMUInt32ArrayType CMUInt32ArrayType;
33325 struct CMUInt64ArrayType {
33326   OSType typeDescriptor;
33327   UInt32 reserved;
33328   UInt32 value[1];
33329 };
33330 typedef struct CMUInt64ArrayType CMUInt64ArrayType;
33331 struct CMViewingConditionsType {
33332   OSType typeDescriptor;
33333   UInt32 reserved;
33334   CMFixedXYZColor illuminant;
33335   CMFixedXYZColor surround;
33336   UInt32 stdIlluminant;
33337 };
33338 typedef struct CMViewingConditionsType CMViewingConditionsType;
33339 struct CMXYZType {
33340   OSType typeDescriptor;
33341   UInt32 reserved;
33342   CMFixedXYZColor XYZ[1];
33343 };
33344 typedef struct CMXYZType CMXYZType;
33345 struct CMProfileSequenceDescType {
33346   OSType typeDescriptor;
33347   UInt32 reserved;
33348   UInt32 count;
33349   char data[1];
33350 };
33351 typedef struct CMProfileSequenceDescType CMProfileSequenceDescType;
33352 struct CMUcrBgType {
33353   OSType typeDescriptor;
33354   UInt32 reserved;
33355   UInt32 ucrCount;
33356   UInt16 ucrValues[1];
33357 };
33358 typedef struct CMUcrBgType CMUcrBgType;
33359
33360 struct CMIntentCRDVMSize {
33361   long renderingIntent;
33362   UInt32 VMSize;
33363 };
33364 typedef struct CMIntentCRDVMSize CMIntentCRDVMSize;
33365 struct CMPS2CRDVMSizeType {
33366   OSType typeDescriptor;
33367   UInt32 reserved;
33368   UInt32 count;
33369   CMIntentCRDVMSize intentCRD[1];
33370 };
33371 typedef struct CMPS2CRDVMSizeType CMPS2CRDVMSizeType;
33372 enum {
33373   cmVideoCardGammaTableType = 0,
33374   cmVideoCardGammaFormulaType = 1
33375 };
33376
33377 struct CMVideoCardGammaTable {
33378   UInt16 channels;
33379   UInt16 entryCount;
33380   UInt16 entrySize;
33381   char data[1];
33382 };
33383 typedef struct CMVideoCardGammaTable CMVideoCardGammaTable;
33384 struct CMVideoCardGammaFormula {
33385   Fixed redGamma;
33386   Fixed redMin;
33387   Fixed redMax;
33388   Fixed greenGamma;
33389   Fixed greenMin;
33390   Fixed greenMax;
33391   Fixed blueGamma;
33392   Fixed blueMin;
33393   Fixed blueMax;
33394 };
33395 typedef struct CMVideoCardGammaFormula CMVideoCardGammaFormula;
33396 struct CMVideoCardGamma {
33397   UInt32 tagType;
33398   union {
33399     CMVideoCardGammaTable table;
33400     CMVideoCardGammaFormula formula;
33401   } u;
33402 };
33403 typedef struct CMVideoCardGamma CMVideoCardGamma;
33404 struct CMVideoCardGammaType {
33405   OSType typeDescriptor;
33406   UInt32 reserved;
33407   CMVideoCardGamma gamma;
33408 };
33409 typedef struct CMVideoCardGammaType CMVideoCardGammaType;
33410 struct CMMakeAndModel {
33411   OSType manufacturer;
33412   UInt32 model;
33413   UInt32 serialNumber;
33414   UInt32 manufactureDate;
33415   UInt32 reserved1;
33416   UInt32 reserved2;
33417   UInt32 reserved3;
33418   UInt32 reserved4;
33419 };
33420 typedef struct CMMakeAndModel CMMakeAndModel;
33421 struct CMMakeAndModelType {
33422   OSType typeDescriptor;
33423   UInt32 reserved;
33424   CMMakeAndModel makeAndModel;
33425 };
33426 typedef struct CMMakeAndModelType CMMakeAndModelType;
33427 struct CMMultiLocalizedUniCodeEntryRec {
33428   char languageCode[2];
33429   char regionCode[2];
33430   UInt32 textLength;
33431   UInt32 textOffset;
33432 };
33433 typedef struct CMMultiLocalizedUniCodeEntryRec CMMultiLocalizedUniCodeEntryRec;
33434 struct CMMultiLocalizedUniCodeType {
33435   OSType typeDescriptor;
33436   UInt32 reserved;
33437   UInt32 entryCount;
33438   UInt32 entrySize;
33439
33440
33441
33442
33443 };
33444 typedef struct CMMultiLocalizedUniCodeType CMMultiLocalizedUniCodeType;
33445
33446
33447
33448 enum {
33449   cmGrayResponse = 0,
33450   cmRedResponse = 1,
33451   cmGreenResponse = 2,
33452   cmBlueResponse = 3,
33453   cmCyanResponse = 4,
33454   cmMagentaResponse = 5,
33455   cmYellowResponse = 6,
33456   cmUcrResponse = 7,
33457   cmBgResponse = 8,
33458   cmOnePlusLastResponse = 9
33459 };
33460
33461
33462
33463 enum {
33464   cmMonitorDevice = 'mntr',
33465   cmScannerDevice = 'scnr',
33466   cmPrinterDevice = 'prtr'
33467 };
33468
33469
33470 struct CMIString {
33471   ScriptCode theScript;
33472   Str63 theString;
33473 };
33474 typedef struct CMIString CMIString;
33475
33476 enum {
33477   cmPerceptualMatch = 0x0000,
33478   cmColorimetricMatch = 0x0001,
33479   cmSaturationMatch = 0x0002
33480 };
33481
33482
33483 enum {
33484   cmNativeMatchingPreferred = 0x00000001,
33485   cmTurnOffCache = 0x00000002
33486 };
33487
33488
33489 typedef long CMMatchOption;
33490 typedef long CMMatchFlag;
33491 struct CMHeader {
33492   UInt32 size;
33493   OSType CMMType;
33494   UInt32 applProfileVersion;
33495   OSType dataType;
33496   OSType deviceType;
33497   OSType deviceManufacturer;
33498   UInt32 deviceModel;
33499   UInt32 deviceAttributes[2];
33500   UInt32 profileNameOffset;
33501   UInt32 customDataOffset;
33502   CMMatchFlag flags;
33503   CMMatchOption options;
33504   CMXYZColor white;
33505   CMXYZColor black;
33506 };
33507 typedef struct CMHeader CMHeader;
33508 struct CMProfileChromaticities {
33509   CMXYZColor red;
33510   CMXYZColor green;
33511   CMXYZColor blue;
33512   CMXYZColor cyan;
33513   CMXYZColor magenta;
33514   CMXYZColor yellow;
33515 };
33516 typedef struct CMProfileChromaticities CMProfileChromaticities;
33517 struct CMProfileResponse {
33518   UInt16 counts[9];
33519   UInt16 data[1];
33520 };
33521 typedef struct CMProfileResponse CMProfileResponse;
33522 struct CMProfile {
33523   CMHeader header;
33524   CMProfileChromaticities profile;
33525   CMProfileResponse response;
33526   CMIString profileName;
33527   char customData[1];
33528 };
33529 typedef struct CMProfile CMProfile;
33530 typedef CMProfile * CMProfilePtr;
33531 typedef CMProfilePtr * CMProfileHandle;
33532 extern "C" {
33533
33534
33535
33536 enum {
33537   kDefaultCMMSignature = 'appl'
33538 };
33539
33540
33541 enum {
33542   cmTrap = 0xABEE
33543 };
33544
33545
33546
33547 enum {
33548   cmBeginProfile = 220,
33549   cmEndProfile = 221,
33550   cmEnableMatching = 222,
33551   cmDisableMatching = 223,
33552   cmComment = 224
33553 };
33554
33555
33556 enum {
33557   cmBeginProfileSel = 0,
33558   cmContinueProfileSel = 1,
33559   cmEndProfileSel = 2,
33560   cmProfileIdentifierSel = 3
33561 };
33562
33563
33564
33565 enum {
33566   cmMatchCMMType = 0x00000001,
33567   cmMatchApplProfileVersion = 0x00000002,
33568   cmMatchDataType = 0x00000004,
33569   cmMatchDeviceType = 0x00000008,
33570   cmMatchDeviceManufacturer = 0x00000010,
33571   cmMatchDeviceModel = 0x00000020,
33572   cmMatchDeviceAttributes = 0x00000040,
33573   cmMatchFlags = 0x00000080,
33574   cmMatchOptions = 0x00000100,
33575   cmMatchWhite = 0x00000200,
33576   cmMatchBlack = 0x00000400
33577 };
33578
33579
33580 enum {
33581   cmMatchAnyProfile = 0x00000000,
33582   cmMatchProfileCMMType = 0x00000001,
33583   cmMatchProfileClass = 0x00000002,
33584   cmMatchDataColorSpace = 0x00000004,
33585   cmMatchProfileConnectionSpace = 0x00000008,
33586   cmMatchManufacturer = 0x00000010,
33587   cmMatchModel = 0x00000020,
33588   cmMatchAttributes = 0x00000040,
33589   cmMatchProfileFlags = 0x00000080
33590 };
33591
33592
33593
33594 enum {
33595   cmPS7bit = 1,
33596   cmPS8bit = 2
33597 };
33598
33599
33600 enum {
33601   cmEmbedWholeProfile = 0x00000000,
33602   cmEmbedProfileIdentifier = 0x00000001
33603 };
33604
33605
33606 enum {
33607   cmOpenReadSpool = 1,
33608   cmOpenWriteSpool = 2,
33609   cmReadSpool = 3,
33610   cmWriteSpool = 4,
33611   cmCloseSpool = 5
33612 };
33613
33614
33615 enum {
33616   cmOpenReadAccess = 1,
33617   cmOpenWriteAccess = 2,
33618   cmReadAccess = 3,
33619   cmWriteAccess = 4,
33620   cmCloseAccess = 5,
33621   cmCreateNewAccess = 6,
33622   cmAbortWriteAccess = 7,
33623   cmBeginAccess = 8,
33624   cmEndAccess = 9
33625 };
33626
33627
33628
33629 enum {
33630   cmInputUse = 'inpt',
33631   cmOutputUse = 'outp',
33632   cmDisplayUse = 'dply',
33633   cmProofUse = 'pruf'
33634 };
33635
33636
33637
33638 union CMAppleProfileHeader {
33639   CMHeader cm1;
33640   CM2Header cm2;
33641   CM4Header cm4;
33642 };
33643 typedef union CMAppleProfileHeader CMAppleProfileHeader;
33644
33645 struct CMConcatProfileSet {
33646   UInt16 keyIndex;
33647   UInt16 count;
33648   CMProfileRef profileSet[1];
33649 };
33650 typedef struct CMConcatProfileSet CMConcatProfileSet;
33651
33652 struct NCMConcatProfileSpec {
33653   UInt32 renderingIntent;
33654   UInt32 transformTag;
33655   CMProfileRef profile;
33656 };
33657 typedef struct NCMConcatProfileSpec NCMConcatProfileSpec;
33658 struct NCMConcatProfileSet {
33659   OSType cmm;
33660   UInt32 flags;
33661   UInt32 flagsMask;
33662   UInt32 profileCount;
33663   NCMConcatProfileSpec profileSpecs[1];
33664 };
33665 typedef struct NCMConcatProfileSet NCMConcatProfileSet;
33666 enum {
33667   kNoTransform = 0,
33668   kUseAtoB = 1,
33669   kUseBtoA = 2,
33670   kUseBtoB = 3,
33671
33672   kDeviceToPCS = kUseAtoB,
33673   kPCSToDevice = kUseBtoA,
33674   kPCSToPCS = kUseBtoB,
33675   kUseProfileIntent = (long)0xFFFFFFFF
33676 };
33677
33678
33679
33680 struct CMRGBColor {
33681   UInt16 red;
33682   UInt16 green;
33683   UInt16 blue;
33684 };
33685 typedef struct CMRGBColor CMRGBColor;
33686 struct CMCMYKColor {
33687   UInt16 cyan;
33688   UInt16 magenta;
33689   UInt16 yellow;
33690   UInt16 black;
33691 };
33692 typedef struct CMCMYKColor CMCMYKColor;
33693 struct CMCMYColor {
33694   UInt16 cyan;
33695   UInt16 magenta;
33696   UInt16 yellow;
33697 };
33698 typedef struct CMCMYColor CMCMYColor;
33699 struct CMHLSColor {
33700   UInt16 hue;
33701   UInt16 lightness;
33702   UInt16 saturation;
33703 };
33704 typedef struct CMHLSColor CMHLSColor;
33705 struct CMHSVColor {
33706   UInt16 hue;
33707   UInt16 saturation;
33708   UInt16 value;
33709 };
33710 typedef struct CMHSVColor CMHSVColor;
33711 struct CMLabColor {
33712   UInt16 L;
33713   UInt16 a;
33714   UInt16 b;
33715 };
33716 typedef struct CMLabColor CMLabColor;
33717 struct CMLuvColor {
33718   UInt16 L;
33719   UInt16 u;
33720   UInt16 v;
33721 };
33722 typedef struct CMLuvColor CMLuvColor;
33723 struct CMYxyColor {
33724   UInt16 capY;
33725   UInt16 x;
33726   UInt16 y;
33727 };
33728 typedef struct CMYxyColor CMYxyColor;
33729 struct CMGrayColor {
33730   UInt16 gray;
33731 };
33732 typedef struct CMGrayColor CMGrayColor;
33733 struct CMMultichannel5Color {
33734   UInt8 components[5];
33735 };
33736 typedef struct CMMultichannel5Color CMMultichannel5Color;
33737 struct CMMultichannel6Color {
33738   UInt8 components[6];
33739 };
33740 typedef struct CMMultichannel6Color CMMultichannel6Color;
33741 struct CMMultichannel7Color {
33742   UInt8 components[7];
33743 };
33744 typedef struct CMMultichannel7Color CMMultichannel7Color;
33745 struct CMMultichannel8Color {
33746   UInt8 components[8];
33747 };
33748 typedef struct CMMultichannel8Color CMMultichannel8Color;
33749 struct CMNamedColor {
33750   UInt32 namedColorIndex;
33751 };
33752 typedef struct CMNamedColor CMNamedColor;
33753 union CMColor {
33754   CMRGBColor rgb;
33755   CMHSVColor hsv;
33756   CMHLSColor hls;
33757   CMXYZColor XYZ;
33758   CMLabColor Lab;
33759   CMLuvColor Luv;
33760   CMYxyColor Yxy;
33761   CMCMYKColor cmyk;
33762   CMCMYColor cmy;
33763   CMGrayColor gray;
33764   CMMultichannel5Color mc5;
33765   CMMultichannel6Color mc6;
33766   CMMultichannel7Color mc7;
33767   CMMultichannel8Color mc8;
33768   CMNamedColor namedColor;
33769 };
33770 typedef union CMColor CMColor;
33771
33772 struct CMProfileSearchRecord {
33773   CMHeader header;
33774   UInt32 fieldMask;
33775   UInt32 reserved[2];
33776 };
33777 typedef struct CMProfileSearchRecord CMProfileSearchRecord;
33778 typedef CMProfileSearchRecord * CMProfileSearchRecordPtr;
33779 typedef CMProfileSearchRecordPtr * CMProfileSearchRecordHandle;
33780
33781 struct CMSearchRecord {
33782   OSType CMMType;
33783   OSType profileClass;
33784   OSType dataColorSpace;
33785   OSType profileConnectionSpace;
33786   UInt32 deviceManufacturer;
33787   UInt32 deviceModel;
33788   UInt32 deviceAttributes[2];
33789   UInt32 profileFlags;
33790   UInt32 searchMask;
33791   CMProfileFilterUPP filter;
33792 };
33793 typedef struct CMSearchRecord CMSearchRecord;
33794
33795 struct CMMInfo {
33796   UInt32 dataSize;
33797   OSType CMMType;
33798   OSType CMMMfr;
33799   UInt32 CMMVersion;
33800   unsigned char ASCIIName[32];
33801   unsigned char ASCIIDesc[256];
33802   UniCharCount UniCodeNameCount;
33803   UniChar UniCodeName[32];
33804   UniCharCount UniCodeDescCount;
33805   UniChar UniCodeDesc[256];
33806 };
33807 typedef struct CMMInfo CMMInfo;
33808
33809 struct CMMInfoRecord {
33810   OSType CMMType;
33811   long CMMVersion;
33812 };
33813 typedef struct CMMInfoRecord CMMInfoRecord;
33814 struct CMCWInfoRecord {
33815   UInt32 cmmCount;
33816   CMMInfoRecord cmmInfo[2];
33817 };
33818 typedef struct CMCWInfoRecord CMCWInfoRecord;
33819
33820 struct CMProfileIdentifier {
33821   CM2Header profileHeader;
33822   CMDateTime calibrationDate;
33823   UInt32 ASCIIProfileDescriptionLen;
33824   char ASCIIProfileDescription[1];
33825 };
33826 typedef struct CMProfileIdentifier CMProfileIdentifier;
33827 typedef CMProfileIdentifier * CMProfileIdentifierPtr;
33828
33829 enum {
33830   cmColorSpaceSpaceMask = 0x0000003F,
33831   cmColorSpacePremulAlphaMask = 0x00000040,
33832   cmColorSpaceAlphaMask = 0x00000080,
33833   cmColorSpaceSpaceAndAlphaMask = 0x000000FF,
33834   cmColorSpacePackingMask = 0x0000FF00,
33835   cmColorSpaceEncodingMask = 0x000F0000,
33836   cmColorSpaceReservedMask = (long)0xFFF00000
33837 };
33838
33839
33840 enum {
33841   cmNoColorPacking = 0x0000,
33842   cmWord5ColorPacking = 0x0500,
33843   cmWord565ColorPacking = 0x0600,
33844   cmLong8ColorPacking = 0x0800,
33845   cmLong10ColorPacking = 0x0A00,
33846   cmAlphaFirstPacking = 0x1000,
33847   cmOneBitDirectPacking = 0x0B00,
33848   cmAlphaLastPacking = 0x0000,
33849   cm8_8ColorPacking = 0x2800,
33850   cm16_8ColorPacking = 0x2000,
33851   cm24_8ColorPacking = 0x2100,
33852   cm32_8ColorPacking = cmLong8ColorPacking,
33853   cm40_8ColorPacking = 0x2200,
33854   cm48_8ColorPacking = 0x2300,
33855   cm56_8ColorPacking = 0x2400,
33856   cm64_8ColorPacking = 0x2500,
33857   cm32_16ColorPacking = 0x2600,
33858   cm48_16ColorPacking = 0x2900,
33859   cm64_16ColorPacking = 0x2A00,
33860   cm32_32ColorPacking = 0x2700,
33861   cmLittleEndianPacking = 0x4000,
33862   cmReverseChannelPacking = 0x8000
33863 };
33864
33865
33866 enum {
33867   cmSRGB16ChannelEncoding = 0x00010000
33868 };
33869
33870
33871 enum {
33872   cmNoSpace = 0x0000,
33873   cmRGBSpace = 0x0001,
33874   cmCMYKSpace = 0x0002,
33875   cmHSVSpace = 0x0003,
33876   cmHLSSpace = 0x0004,
33877   cmYXYSpace = 0x0005,
33878   cmXYZSpace = 0x0006,
33879   cmLUVSpace = 0x0007,
33880   cmLABSpace = 0x0008,
33881   cmReservedSpace1 = 0x0009,
33882   cmGraySpace = 0x000A,
33883   cmReservedSpace2 = 0x000B,
33884   cmGamutResultSpace = 0x000C,
33885   cmNamedIndexedSpace = 0x0010,
33886   cmMCFiveSpace = 0x0011,
33887   cmMCSixSpace = 0x0012,
33888   cmMCSevenSpace = 0x0013,
33889   cmMCEightSpace = 0x0014,
33890   cmAlphaPmulSpace = 0x0040,
33891   cmAlphaSpace = 0x0080,
33892   cmRGBASpace = cmRGBSpace + cmAlphaSpace,
33893   cmGrayASpace = cmGraySpace + cmAlphaSpace,
33894   cmRGBAPmulSpace = cmRGBASpace + cmAlphaPmulSpace,
33895   cmGrayAPmulSpace = cmGrayASpace + cmAlphaPmulSpace
33896 };
33897
33898
33899
33900
33901 enum {
33902   cmGray8Space = cmGraySpace + cm8_8ColorPacking,
33903   cmGray16Space = cmGraySpace,
33904   cmGray16LSpace = cmGraySpace + cmLittleEndianPacking,
33905   cmGrayA16Space = cmGrayASpace + cm16_8ColorPacking,
33906   cmGrayA32Space = cmGrayASpace,
33907   cmGrayA32LSpace = cmGrayASpace + cmLittleEndianPacking,
33908   cmGrayA16PmulSpace = cmGrayAPmulSpace + cm16_8ColorPacking,
33909   cmGrayA32PmulSpace = cmGrayAPmulSpace,
33910   cmGrayA32LPmulSpace = cmGrayAPmulSpace + cmLittleEndianPacking,
33911   cmRGB16Space = cmRGBSpace + cmWord5ColorPacking,
33912   cmRGB16LSpace = cmRGBSpace + cmWord5ColorPacking + cmLittleEndianPacking,
33913   cmRGB565Space = cmRGBSpace + cmWord565ColorPacking,
33914   cmRGB565LSpace = cmRGBSpace + cmWord565ColorPacking + cmLittleEndianPacking,
33915   cmRGB24Space = cmRGBSpace + cm24_8ColorPacking,
33916   cmRGB32Space = cmRGBSpace + cm32_8ColorPacking,
33917   cmRGB48Space = cmRGBSpace + cm48_16ColorPacking,
33918   cmRGB48LSpace = cmRGBSpace + cm48_16ColorPacking + cmLittleEndianPacking,
33919   cmARGB32Space = cmRGBASpace + cm32_8ColorPacking + cmAlphaFirstPacking,
33920   cmARGB64Space = cmRGBASpace + cm64_16ColorPacking + cmAlphaFirstPacking,
33921   cmARGB64LSpace = cmRGBASpace + cm64_16ColorPacking + cmAlphaFirstPacking + cmLittleEndianPacking,
33922   cmRGBA32Space = cmRGBASpace + cm32_8ColorPacking + cmAlphaLastPacking,
33923   cmRGBA64Space = cmRGBASpace + cm64_16ColorPacking + cmAlphaLastPacking,
33924   cmRGBA64LSpace = cmRGBASpace + cm64_16ColorPacking + cmAlphaLastPacking + cmLittleEndianPacking,
33925   cmARGB32PmulSpace = cmRGBAPmulSpace + cm32_8ColorPacking + cmAlphaFirstPacking,
33926   cmARGB64PmulSpace = cmRGBAPmulSpace + cm64_16ColorPacking + cmAlphaFirstPacking,
33927   cmARGB64LPmulSpace = cmRGBAPmulSpace + cm64_16ColorPacking + cmAlphaFirstPacking + cmLittleEndianPacking,
33928   cmRGBA32PmulSpace = cmRGBAPmulSpace + cm32_8ColorPacking + cmAlphaLastPacking,
33929   cmRGBA64PmulSpace = cmRGBAPmulSpace + cm64_16ColorPacking + cmAlphaLastPacking,
33930   cmRGBA64LPmulSpace = cmRGBAPmulSpace + cm64_16ColorPacking + cmAlphaLastPacking + cmLittleEndianPacking,
33931   cmCMYK32Space = cmCMYKSpace + cm32_8ColorPacking,
33932   cmCMYK64Space = cmCMYKSpace + cm64_16ColorPacking,
33933   cmCMYK64LSpace = cmCMYKSpace + cm64_16ColorPacking + cmLittleEndianPacking,
33934   cmHSV32Space = cmHSVSpace + cmLong10ColorPacking,
33935   cmHLS32Space = cmHLSSpace + cmLong10ColorPacking,
33936   cmYXY32Space = cmYXYSpace + cmLong10ColorPacking,
33937   cmXYZ24Space = cmXYZSpace + cm24_8ColorPacking,
33938   cmXYZ32Space = cmXYZSpace + cmLong10ColorPacking,
33939   cmXYZ48Space = cmXYZSpace + cm48_16ColorPacking,
33940   cmXYZ48LSpace = cmXYZSpace + cm48_16ColorPacking + cmLittleEndianPacking,
33941   cmLUV32Space = cmLUVSpace + cmLong10ColorPacking,
33942   cmLAB24Space = cmLABSpace + cm24_8ColorPacking,
33943   cmLAB32Space = cmLABSpace + cmLong10ColorPacking,
33944   cmLAB48Space = cmLABSpace + cm48_16ColorPacking,
33945   cmLAB48LSpace = cmLABSpace + cm48_16ColorPacking + cmLittleEndianPacking,
33946   cmGamutResult1Space = cmOneBitDirectPacking + cmGamutResultSpace,
33947   cmNamedIndexed32Space = cm32_32ColorPacking + cmNamedIndexedSpace,
33948   cmNamedIndexed32LSpace = cm32_32ColorPacking + cmNamedIndexedSpace + cmLittleEndianPacking,
33949   cmMCFive8Space = cm40_8ColorPacking + cmMCFiveSpace,
33950   cmMCSix8Space = cm48_8ColorPacking + cmMCSixSpace,
33951   cmMCSeven8Space = cm56_8ColorPacking + cmMCSevenSpace,
33952   cmMCEight8Space = cm64_8ColorPacking + cmMCEightSpace
33953 };
33954
33955
33956 typedef UInt32 CMBitmapColorSpace;
33957 struct CMBitmap {
33958   char * image;
33959   long width;
33960   long height;
33961   long rowBytes;
33962   long pixelSize;
33963   CMBitmapColorSpace space;
33964   long user1;
33965   long user2;
33966 };
33967 typedef struct CMBitmap CMBitmap;
33968
33969
33970 typedef UInt32 CMChromaticAdaptation;
33971 enum {
33972   cmUseDefaultChromaticAdaptation = 0,
33973   cmLinearChromaticAdaptation = 1,
33974   cmVonKriesChromaticAdaptation = 2,
33975   cmBradfordChromaticAdaptation = 3
33976 };
33977
33978
33979
33980 enum {
33981   CS_MAX_PATH = 256
33982 };
33983
33984 enum {
33985   cmNoProfileBase = 0,
33986   cmFileBasedProfile = 1,
33987   cmHandleBasedProfile = 2,
33988   cmPtrBasedProfile = 3,
33989   cmProcedureBasedProfile = 4,
33990   cmPathBasedProfile = 5,
33991   cmBufferBasedProfile = 6
33992 };
33993
33994 struct CMFileLocation {
33995   FSSpec spec;
33996 };
33997 typedef struct CMFileLocation CMFileLocation;
33998 struct CMHandleLocation {
33999   Handle h;
34000 };
34001 typedef struct CMHandleLocation CMHandleLocation;
34002 struct CMPtrLocation {
34003   Ptr p;
34004 };
34005 typedef struct CMPtrLocation CMPtrLocation;
34006 struct CMProcedureLocation {
34007   CMProfileAccessUPP proc;
34008   void * refCon;
34009 };
34010 typedef struct CMProcedureLocation CMProcedureLocation;
34011 struct CMPathLocation {
34012   char path[256];
34013 };
34014 typedef struct CMPathLocation CMPathLocation;
34015 struct CMBufferLocation {
34016   void * buffer;
34017   UInt32 size;
34018 };
34019 typedef struct CMBufferLocation CMBufferLocation;
34020 union CMProfLoc {
34021   CMFileLocation fileLoc;
34022   CMHandleLocation handleLoc;
34023   CMPtrLocation ptrLoc;
34024   CMProcedureLocation procLoc;
34025   CMPathLocation pathLoc;
34026   CMBufferLocation bufferLoc;
34027 };
34028 typedef union CMProfLoc CMProfLoc;
34029 struct CMProfileLocation {
34030   short locType;
34031   CMProfLoc u;
34032 };
34033 typedef struct CMProfileLocation CMProfileLocation;
34034 enum {
34035   cmOriginalProfileLocationSize = 72,
34036   cmCurrentProfileLocationSize = 2 + CS_MAX_PATH
34037 };
34038
34039
34040 enum {
34041   cmProfileIterateDataVersion1 = 0x00010000,
34042   cmProfileIterateDataVersion2 = 0x00020000,
34043   cmProfileIterateDataVersion3 = 0x00030000
34044 };
34045
34046 struct CMProfileIterateData {
34047   UInt32 dataVersion;
34048   CM2Header header;
34049   ScriptCode code;
34050   Str255 name;
34051   CMProfileLocation location;
34052   UniCharCount uniCodeNameCount;
34053   UniChar * uniCodeName;
34054   unsigned char * asciiName;
34055   CMMakeAndModel * makeAndModel;
34056   CMProfileMD5 * digest;
34057 };
34058 typedef struct CMProfileIterateData CMProfileIterateData;
34059
34060 typedef OSErr ( * CMProfileIterateProcPtr)(CMProfileIterateData *iterateData, void *refCon);
34061 typedef OSErr ( * CMMIterateProcPtr)(CMMInfo *iterateData, void *refCon);
34062 typedef CMProfileIterateProcPtr CMProfileIterateUPP;
34063 typedef CMMIterateProcPtr CMMIterateUPP;
34064 extern CMProfileIterateUPP
34065 NewCMProfileIterateUPP(CMProfileIterateProcPtr userRoutine) ;
34066 extern CMMIterateUPP
34067 NewCMMIterateUPP(CMMIterateProcPtr userRoutine) ;
34068 extern void
34069 DisposeCMProfileIterateUPP(CMProfileIterateUPP userUPP) ;
34070 extern void
34071 DisposeCMMIterateUPP(CMMIterateUPP userUPP) ;
34072 extern OSErr
34073 InvokeCMProfileIterateUPP(
34074   CMProfileIterateData * iterateData,
34075   void * refCon,
34076   CMProfileIterateUPP userUPP) ;
34077 extern OSErr
34078 InvokeCMMIterateUPP(
34079   CMMInfo * iterateData,
34080   void * refCon,
34081   CMMIterateUPP userUPP) ;
34082 extern CMError
34083 CMNewProfile(
34084   CMProfileRef * prof,
34085   const CMProfileLocation * theProfile) ;
34086 extern CMError
34087 CMOpenProfile(
34088   CMProfileRef * prof,
34089   const CMProfileLocation * theProfile) ;
34090 extern CMError
34091 CMCloseProfile(CMProfileRef prof) ;
34092 extern CMError
34093 CMUpdateProfile(CMProfileRef prof) ;
34094 extern CMError
34095 CMCopyProfile(
34096   CMProfileRef * targetProf,
34097   const CMProfileLocation * targetLocation,
34098   CMProfileRef srcProf) ;
34099 extern CMError
34100 CMValidateProfile(
34101   CMProfileRef prof,
34102   Boolean * valid,
34103   Boolean * preferredCMMnotfound) ;
34104 extern CMError
34105 CMGetProfileLocation(
34106   CMProfileRef prof,
34107   CMProfileLocation * theProfile) ;
34108 extern CMError
34109 NCMGetProfileLocation(
34110   CMProfileRef prof,
34111   CMProfileLocation * theProfile,
34112   UInt32 * locationSize) ;
34113 extern CMError
34114 CMFlattenProfile(
34115   CMProfileRef prof,
34116   UInt32 flags,
34117   CMFlattenUPP proc,
34118   void * refCon,
34119   Boolean * preferredCMMnotfound) ;
34120 extern CMError
34121 CMGetProfileHeader(
34122   CMProfileRef prof,
34123   CMAppleProfileHeader * header) ;
34124 extern CMError
34125 CMSetProfileHeader(
34126   CMProfileRef prof,
34127   const CMAppleProfileHeader * header) ;
34128 extern CMError
34129 CMProfileElementExists(
34130   CMProfileRef prof,
34131   OSType tag,
34132   Boolean * found) ;
34133 extern CMError
34134 CMCountProfileElements(
34135   CMProfileRef prof,
34136   UInt32 * elementCount) ;
34137 extern CMError
34138 CMGetProfileElement(
34139   CMProfileRef prof,
34140   OSType tag,
34141   UInt32 * elementSize,
34142   void * elementData) ;
34143 extern CMError
34144 CMSetProfileElement(
34145   CMProfileRef prof,
34146   OSType tag,
34147   UInt32 elementSize,
34148   const void * elementData) ;
34149 extern CMError
34150 CMSetProfileElementSize(
34151   CMProfileRef prof,
34152   OSType tag,
34153   UInt32 elementSize) ;
34154 extern CMError
34155 CMSetProfileElementReference(
34156   CMProfileRef prof,
34157   OSType elementTag,
34158   OSType referenceTag) ;
34159 extern CMError
34160 CMGetPartialProfileElement(
34161   CMProfileRef prof,
34162   OSType tag,
34163   UInt32 offset,
34164   UInt32 * byteCount,
34165   void * elementData) ;
34166 extern CMError
34167 CMSetPartialProfileElement(
34168   CMProfileRef prof,
34169   OSType tag,
34170   UInt32 offset,
34171   UInt32 byteCount,
34172   const void * elementData) ;
34173 extern CMError
34174 CMGetIndProfileElementInfo(
34175   CMProfileRef prof,
34176   UInt32 index,
34177   OSType * tag,
34178   UInt32 * elementSize,
34179   Boolean * refs) ;
34180 extern CMError
34181 CMGetIndProfileElement(
34182   CMProfileRef prof,
34183   UInt32 index,
34184   UInt32 * elementSize,
34185   void * elementData) ;
34186 extern CMError
34187 CMRemoveProfileElement(
34188   CMProfileRef prof,
34189   OSType tag) ;
34190 extern CMError
34191 CMGetScriptProfileDescription(
34192   CMProfileRef prof,
34193   Str255 name,
34194   ScriptCode * code) ;
34195 extern CMError
34196 CMGetProfileDescriptions(
34197   CMProfileRef prof,
34198   char * aName,
34199   UInt32 * aCount,
34200   Str255 mName,
34201   ScriptCode * mCode,
34202   UniChar * uName,
34203   UniCharCount * uCount) ;
34204 extern CMError
34205 CMSetProfileDescriptions(
34206   CMProfileRef prof,
34207   const char * aName,
34208   UInt32 aCount,
34209   ConstStr255Param mName,
34210   ScriptCode mCode,
34211   const UniChar * uName,
34212   UniCharCount uCount) ;
34213 extern CMError
34214 CMCopyProfileLocalizedStringDictionary(
34215   CMProfileRef prof,
34216   OSType tag,
34217   CFDictionaryRef * theDict) ;
34218 extern CMError
34219 CMSetProfileLocalizedStringDictionary(
34220   CMProfileRef prof,
34221   OSType tag,
34222   CFDictionaryRef theDict) ;
34223 extern CMError
34224 CMCopyProfileLocalizedString(
34225   CMProfileRef prof,
34226   OSType tag,
34227   CFStringRef reqLocale,
34228   CFStringRef * locale,
34229   CFStringRef * str) ;
34230 extern CMError
34231 CMCloneProfileRef(CMProfileRef prof) ;
34232 extern CMError
34233 CMGetProfileRefCount(
34234   CMProfileRef prof,
34235   long * count) ;
34236 extern CMError
34237 CMProfileModified(
34238   CMProfileRef prof,
34239   Boolean * modified) ;
34240 extern CMError
34241 CMGetProfileMD5(
34242   CMProfileRef prof,
34243   CMProfileMD5 digest) ;
34244 extern CMError
34245 CMGetNamedColorInfo(
34246   CMProfileRef prof,
34247   UInt32 * deviceChannels,
34248   OSType * deviceColorSpace,
34249   OSType * PCSColorSpace,
34250   UInt32 * count,
34251   StringPtr prefix,
34252   StringPtr suffix) ;
34253 extern CMError
34254 CMGetNamedColorValue(
34255   CMProfileRef prof,
34256   StringPtr name,
34257   CMColor * deviceColor,
34258   CMColor * PCSColor) ;
34259 extern CMError
34260 CMGetIndNamedColorValue(
34261   CMProfileRef prof,
34262   UInt32 index,
34263   CMColor * deviceColor,
34264   CMColor * PCSColor) ;
34265 extern CMError
34266 CMGetNamedColorIndex(
34267   CMProfileRef prof,
34268   StringPtr name,
34269   UInt32 * index) ;
34270 extern CMError
34271 CMGetNamedColorName(
34272   CMProfileRef prof,
34273   UInt32 index,
34274   StringPtr name) ;
34275 extern CMError
34276 NCWNewColorWorld(
34277   CMWorldRef * cw,
34278   CMProfileRef src,
34279   CMProfileRef dst) ;
34280 extern CMError
34281 CWConcatColorWorld(
34282   CMWorldRef * cw,
34283   CMConcatProfileSet * profileSet) ;
34284 extern CMError
34285 CWNewLinkProfile(
34286   CMProfileRef * prof,
34287   const CMProfileLocation * targetLocation,
34288   CMConcatProfileSet * profileSet) ;
34289 extern CMError
34290 NCWConcatColorWorld(
34291   CMWorldRef * cw,
34292   NCMConcatProfileSet * profileSet,
34293   CMConcatCallBackUPP proc,
34294   void * refCon) ;
34295 extern CMError
34296 NCWNewLinkProfile(
34297   CMProfileRef * prof,
34298   const CMProfileLocation * targetLocation,
34299   NCMConcatProfileSet * profileSet,
34300   CMConcatCallBackUPP proc,
34301   void * refCon) ;
34302 extern void
34303 CWDisposeColorWorld(CMWorldRef cw) ;
34304 extern CMError
34305 CWMatchColors(
34306   CMWorldRef cw,
34307   CMColor * myColors,
34308   UInt32 count) ;
34309 extern CMError
34310 CWCheckColors(
34311   CMWorldRef cw,
34312   CMColor * myColors,
34313   UInt32 count,
34314   UInt32 * result) ;
34315 extern CMError
34316 CWMatchBitmap(
34317   CMWorldRef cw,
34318   CMBitmap * bitmap,
34319   CMBitmapCallBackUPP progressProc,
34320   void * refCon,
34321   CMBitmap * matchedBitmap) ;
34322 extern CMError
34323 CWCheckBitmap(
34324   CMWorldRef cw,
34325   const CMBitmap * bitmap,
34326   CMBitmapCallBackUPP progressProc,
34327   void * refCon,
34328   CMBitmap * resultBitmap) ;
34329 extern CMError
34330 CMCreateProfileIdentifier(
34331   CMProfileRef prof,
34332   CMProfileIdentifierPtr ident,
34333   UInt32 * size) ;
34334 extern CMError
34335 CMGetSystemProfile(CMProfileRef * prof) ;
34336 extern CMError
34337 CMSetSystemProfile(const FSSpec * profileFileSpec) ;
34338 extern CMError
34339 NCMSetSystemProfile(const CMProfileLocation * profLoc) ;
34340 extern CMError
34341 CMGetDefaultProfileBySpace(
34342   OSType dataColorSpace,
34343   CMProfileRef * prof) ;
34344 extern CMError
34345 CMSetDefaultProfileBySpace(
34346   OSType dataColorSpace,
34347   CMProfileRef prof) ;
34348 extern CMError
34349 CMGetProfileByAVID(
34350   CMDisplayIDType theID,
34351   CMProfileRef * prof) ;
34352 extern CMError
34353 CMSetProfileByAVID(
34354   CMDisplayIDType theID,
34355   CMProfileRef prof) ;
34356 extern CMError
34357 CMGetGammaByAVID(
34358   CMDisplayIDType theID,
34359   CMVideoCardGamma * gamma,
34360   UInt32 * size) ;
34361 extern CMError
34362 CMSetGammaByAVID(
34363   CMDisplayIDType theID,
34364   CMVideoCardGamma * gamma) ;
34365 extern CMError
34366 CMGetDefaultProfileByUse(
34367   OSType use,
34368   CMProfileRef * prof) ;
34369 extern CMError
34370 CMSetDefaultProfileByUse(
34371   OSType use,
34372   CMProfileRef prof) ;
34373 extern CMError
34374 CMNewProfileSearch(
34375   CMSearchRecord * searchSpec,
34376   void * refCon,
34377   UInt32 * count,
34378   CMProfileSearchRef * searchResult) ;
34379 extern CMError
34380 CMUpdateProfileSearch(
34381   CMProfileSearchRef search,
34382   void * refCon,
34383   UInt32 * count) ;
34384 extern void
34385 CMDisposeProfileSearch(CMProfileSearchRef search) ;
34386 extern CMError
34387 CMSearchGetIndProfile(
34388   CMProfileSearchRef search,
34389   UInt32 index,
34390   CMProfileRef * prof) ;
34391 extern CMError
34392 CMSearchGetIndProfileFileSpec(
34393   CMProfileSearchRef search,
34394   UInt32 index,
34395   FSSpec * profileFile) ;
34396 extern CMError
34397 CMProfileIdentifierFolderSearch(
34398   CMProfileIdentifierPtr ident,
34399   UInt32 * matchedCount,
34400   CMProfileSearchRef * searchResult) ;
34401 extern CMError
34402 CMProfileIdentifierListSearch(
34403   CMProfileIdentifierPtr ident,
34404   CMProfileRef * profileList,
34405   UInt32 listSize,
34406   UInt32 * matchedCount,
34407   CMProfileRef * matchedList) ;
34408 extern CMError
34409 CMIterateColorSyncFolder(
34410   CMProfileIterateUPP proc,
34411   UInt32 * seed,
34412   UInt32 * count,
34413   void * refCon) ;
34414 extern CMError
34415 NCMUnflattenProfile(
34416   CMProfileLocation * targetLocation,
34417   CMFlattenUPP proc,
34418   void * refCon,
34419   Boolean * preferredCMMnotfound) ;
34420 extern CMError
34421 CMGetColorSyncFolderSpec(
34422   short vRefNum,
34423   Boolean createFolder,
34424   short * foundVRefNum,
34425   long * foundDirID) ;
34426 extern CMError
34427 CMGetCWInfo(
34428   CMWorldRef cw,
34429   CMCWInfoRecord * info) ;
34430 extern CMError
34431 CMGetPreferredCMM(
34432   OSType * cmmType,
34433   Boolean * preferredCMMnotfound) ;
34434 extern CMError
34435 CMIterateCMMInfo(
34436   CMMIterateUPP proc,
34437   UInt32 * count,
34438   void * refCon) ;
34439 extern CMError
34440 CMGetColorSyncVersion(UInt32 * version) ;
34441 extern CMError
34442 CMLaunchControlPanel(UInt32 flags) ;
34443 extern CMError
34444 CMConvertXYZToLab(
34445   const CMColor * src,
34446   const CMXYZColor * white,
34447   CMColor * dst,
34448   UInt32 count) ;
34449 extern CMError
34450 CMConvertLabToXYZ(
34451   const CMColor * src,
34452   const CMXYZColor * white,
34453   CMColor * dst,
34454   UInt32 count) ;
34455 extern CMError
34456 CMConvertXYZToLuv(
34457   const CMColor * src,
34458   const CMXYZColor * white,
34459   CMColor * dst,
34460   UInt32 count) ;
34461 extern CMError
34462 CMConvertLuvToXYZ(
34463   const CMColor * src,
34464   const CMXYZColor * white,
34465   CMColor * dst,
34466   UInt32 count) ;
34467 extern CMError
34468 CMConvertXYZToYxy(
34469   const CMColor * src,
34470   CMColor * dst,
34471   UInt32 count) ;
34472 extern CMError
34473 CMConvertYxyToXYZ(
34474   const CMColor * src,
34475   CMColor * dst,
34476   UInt32 count) ;
34477 extern CMError
34478 CMConvertRGBToHLS(
34479   const CMColor * src,
34480   CMColor * dst,
34481   UInt32 count) ;
34482 extern CMError
34483 CMConvertHLSToRGB(
34484   const CMColor * src,
34485   CMColor * dst,
34486   UInt32 count) ;
34487 extern CMError
34488 CMConvertRGBToHSV(
34489   const CMColor * src,
34490   CMColor * dst,
34491   UInt32 count) ;
34492 extern CMError
34493 CMConvertHSVToRGB(
34494   const CMColor * src,
34495   CMColor * dst,
34496   UInt32 count) ;
34497 extern CMError
34498 CMConvertRGBToGray(
34499   const CMColor * src,
34500   CMColor * dst,
34501   UInt32 count) ;
34502 extern CMError
34503 CMConvertXYZToFixedXYZ(
34504   const CMXYZColor * src,
34505   CMFixedXYZColor * dst,
34506   UInt32 count) ;
34507 extern CMError
34508 CMConvertFixedXYZToXYZ(
34509   const CMFixedXYZColor * src,
34510   CMXYZColor * dst,
34511   UInt32 count) ;
34512 extern CMError
34513 CMConvertXYZToXYZ(
34514   const CMColor * src,
34515   const CMXYZColor * srcIlluminant,
34516   CMColor * dst,
34517   const CMXYZColor * dstIlluminant,
34518   CMChromaticAdaptation method,
34519   UInt32 count) ;
34520 extern CMError
34521 CMGetPS2ColorSpace(
34522   CMProfileRef srcProf,
34523   UInt32 flags,
34524   CMFlattenUPP proc,
34525   void * refCon,
34526   Boolean * preferredCMMnotfound) ;
34527 extern CMError
34528 CMGetPS2ColorRenderingIntent(
34529   CMProfileRef srcProf,
34530   UInt32 flags,
34531   CMFlattenUPP proc,
34532   void * refCon,
34533   Boolean * preferredCMMnotfound) ;
34534 extern CMError
34535 CMGetPS2ColorRendering(
34536   CMProfileRef srcProf,
34537   CMProfileRef dstProf,
34538   UInt32 flags,
34539   CMFlattenUPP proc,
34540   void * refCon,
34541   Boolean * preferredCMMnotfound) ;
34542 extern CMError
34543 CMGetPS2ColorRenderingVMSize(
34544   CMProfileRef srcProf,
34545   CMProfileRef dstProf,
34546   UInt32 * vmSize,
34547   Boolean * preferredCMMnotfound) ;
34548
34549
34550 }
34551
34552
34553
34554
34555
34556
34557
34558 extern "C" {
34559
34560
34561
34562
34563
34564
34565
34566 enum {
34567   cmDeviceInfoVersion1 = 0x00010000,
34568   cmDeviceProfileInfoVersion1 = 0x00010000,
34569   cmDeviceProfileInfoVersion2 = 0x00020000
34570 };
34571
34572 enum {
34573   cmCurrentDeviceInfoVersion = cmDeviceInfoVersion1,
34574   cmCurrentProfileInfoVersion = cmDeviceProfileInfoVersion1
34575 };
34576
34577
34578
34579
34580
34581 enum {
34582   cmDefaultDeviceID = 0,
34583   cmDefaultProfileID = 0
34584 };
34585
34586
34587
34588
34589
34590 enum {
34591   cmDeviceStateDefault = 0x00000000,
34592   cmDeviceStateOffline = 0x00000001,
34593   cmDeviceStateBusy = 0x00000002,
34594   cmDeviceStateForceNotify = (long)0x80000000,
34595   cmDeviceStateDeviceRsvdBits = 0x00FF0000,
34596   cmDeviceStateAppleRsvdBits = (long)0xFF00FFFF
34597 };
34598 enum {
34599   cmIterateFactoryDeviceProfiles = 0x00000001,
34600   cmIterateCustomDeviceProfiles = 0x00000002,
34601   cmIterateCurrentDeviceProfiles = 0x00000003,
34602   cmIterateAllDeviceProfiles = 0x00000004,
34603   cmIterateDeviceProfilesMask = 0x0000000F
34604 };
34605
34606
34607
34608
34609 enum {
34610   cmDeviceDBNotFoundErr = -4227,
34611   cmDeviceAlreadyRegistered = -4228,
34612   cmDeviceNotRegistered = -4229,
34613   cmDeviceProfilesNotFound = -4230,
34614   cmInternalCFErr = -4231
34615 };
34616 typedef UInt32 CMDeviceState;
34617
34618
34619
34620 typedef UInt32 CMDeviceID;
34621
34622
34623
34624 typedef UInt32 CMDeviceProfileID;
34625
34626
34627
34628 enum {
34629   cmScannerDeviceClass = 'scnr',
34630   cmCameraDeviceClass = 'cmra',
34631   cmDisplayDeviceClass = 'mntr',
34632   cmPrinterDeviceClass = 'prtr',
34633   cmProofDeviceClass = 'pruf'
34634 };
34635
34636 typedef OSType CMDeviceClass;
34637
34638
34639
34640
34641 struct CMDeviceScope {
34642   CFStringRef deviceUser;
34643   CFStringRef deviceHost;
34644 };
34645 typedef struct CMDeviceScope CMDeviceScope;
34646 typedef CMDeviceScope CMDeviceProfileScope;
34647
34648
34649
34650
34651 struct CMDeviceInfo {
34652   UInt32 dataVersion;
34653   CMDeviceClass deviceClass;
34654   CMDeviceID deviceID;
34655   CMDeviceScope deviceScope;
34656   CMDeviceState deviceState;
34657   CMDeviceProfileID defaultProfileID;
34658   CFDictionaryRef * deviceName;
34659
34660   UInt32 profileCount;
34661   UInt32 reserved;
34662 };
34663 typedef struct CMDeviceInfo CMDeviceInfo;
34664 typedef CMDeviceInfo * CMDeviceInfoPtr;
34665
34666
34667
34668
34669 struct CMDeviceProfileInfo {
34670   UInt32 dataVersion;
34671   CMDeviceProfileID profileID;
34672   CMProfileLocation profileLoc;
34673   CFDictionaryRef profileName;
34674   UInt32 reserved;
34675 };
34676 typedef struct CMDeviceProfileInfo CMDeviceProfileInfo;
34677 struct NCMDeviceProfileInfo {
34678   UInt32 dataVersion;
34679   CMDeviceProfileID profileID;
34680   CMProfileLocation profileLoc;
34681   CFDictionaryRef profileName;
34682   CMDeviceProfileScope profileScope;
34683   UInt32 reserved;
34684 };
34685 typedef struct NCMDeviceProfileInfo NCMDeviceProfileInfo;
34686
34687
34688
34689
34690 struct CMDeviceProfileArray {
34691   UInt32 profileCount;
34692   CMDeviceProfileInfo profiles[1];
34693 };
34694 typedef struct CMDeviceProfileArray CMDeviceProfileArray;
34695 typedef CMDeviceProfileArray * CMDeviceProfileArrayPtr;
34696
34697
34698
34699 typedef OSErr ( * CMIterateDeviceInfoProcPtr)(const CMDeviceInfo *deviceInfo, void *refCon);
34700 typedef OSErr ( * CMIterateDeviceProfileProcPtr)(const CMDeviceInfo *deviceInfo, const NCMDeviceProfileInfo *profileInfo, void *refCon);
34701 extern CMError
34702 CMRegisterColorDevice(
34703   CMDeviceClass deviceClass,
34704   CMDeviceID deviceID,
34705   CFDictionaryRef deviceName,
34706   const CMDeviceScope * deviceScope) ;
34707 extern CMError
34708 CMUnregisterColorDevice(
34709   CMDeviceClass deviceClass,
34710   CMDeviceID deviceID) ;
34711 extern CMError
34712 CMSetDefaultDevice(
34713   CMDeviceClass deviceClass,
34714   CMDeviceID deviceID) ;
34715 extern CMError
34716 CMGetDefaultDevice(
34717   CMDeviceClass deviceClass,
34718   CMDeviceID * deviceID) ;
34719 extern CMError
34720 CMSetDeviceFactoryProfiles(
34721   CMDeviceClass deviceClass,
34722   CMDeviceID deviceID,
34723   CMDeviceProfileID defaultProfID,
34724   const CMDeviceProfileArray * deviceProfiles) ;
34725 extern CMError
34726 CMGetDeviceFactoryProfiles(
34727   CMDeviceClass deviceClass,
34728   CMDeviceID deviceID,
34729   CMDeviceProfileID * defaultProfID,
34730   UInt32 * arraySize,
34731   CMDeviceProfileArray * deviceProfiles) ;
34732 extern CMError
34733 CMSetDeviceProfiles(
34734   CMDeviceClass deviceClass,
34735   CMDeviceID deviceID,
34736   const CMDeviceProfileScope * profileScope,
34737   const CMDeviceProfileArray * deviceProfiles) ;
34738 extern CMError
34739 CMGetDeviceProfiles(
34740   CMDeviceClass deviceClass,
34741   CMDeviceID deviceID,
34742   UInt32 * arraySize,
34743   CMDeviceProfileArray * deviceProfiles) ;
34744 extern CMError
34745 CMSetDeviceDefaultProfileID(
34746   CMDeviceClass deviceClass,
34747   CMDeviceID deviceID,
34748   CMDeviceProfileID defaultProfID) ;
34749 extern CMError
34750 CMGetDeviceDefaultProfileID(
34751   CMDeviceClass deviceClass,
34752   CMDeviceID deviceID,
34753   CMDeviceProfileID * defaultProfID) ;
34754 extern CMError
34755 CMGetDeviceProfile(
34756   CMDeviceClass deviceClass,
34757   CMDeviceID deviceID,
34758   CMDeviceProfileID profileID,
34759   CMProfileLocation * deviceProfLoc) ;
34760 extern CMError
34761 CMSetDeviceProfile(
34762   CMDeviceClass deviceClass,
34763   CMDeviceID deviceID,
34764   const CMDeviceProfileScope * profileScope,
34765   CMDeviceProfileID profileID,
34766   const CMProfileLocation * deviceProfLoc) ;
34767 extern CMError
34768 CMSetDeviceState(
34769   CMDeviceClass deviceClass,
34770   CMDeviceID deviceID,
34771   CMDeviceState deviceState) ;
34772 extern CMError
34773 CMGetDeviceState(
34774   CMDeviceClass deviceClass,
34775   CMDeviceID deviceID,
34776   CMDeviceState * deviceState) ;
34777 extern CMError
34778 CMGetDeviceInfo(
34779   CMDeviceClass deviceClass,
34780   CMDeviceID deviceID,
34781   CMDeviceInfo * deviceInfo) ;
34782 extern CMError
34783 CMIterateColorDevices(
34784   CMIterateDeviceInfoProcPtr proc,
34785   UInt32 * seed,
34786   UInt32 * count,
34787   void * refCon) ;
34788 extern CMError
34789 CMIterateDeviceProfiles(
34790   CMIterateDeviceProfileProcPtr proc,
34791   UInt32 * seed,
34792   UInt32 * count,
34793   UInt32 flags,
34794   void * refCon) ;
34795
34796
34797
34798
34799
34800 }
34801
34802
34803
34804 enum {
34805   CMMInterfaceVersion = 1
34806 };
34807
34808
34809
34810 enum {
34811
34812   kCMMOpen = -1,
34813   kCMMClose = -2,
34814   kCMMGetInfo = -4,
34815   kNCMMInit = 6,
34816   kCMMMatchColors = 1,
34817   kCMMCheckColors = 2,
34818
34819
34820   kCMMValidateProfile = 8,
34821   kCMMMatchBitmap = 9,
34822   kCMMCheckBitmap = 10,
34823   kCMMConcatenateProfiles = 5,
34824   kCMMConcatInit = 7,
34825   kCMMNewLinkProfile = 16,
34826   kNCMMConcatInit = 18,
34827   kNCMMNewLinkProfile = 19,
34828   kCMMGetPS2ColorSpace = 11,
34829   kCMMGetPS2ColorRenderingIntent = 12,
34830   kCMMGetPS2ColorRendering = 13,
34831   kCMMGetPS2ColorRenderingVMSize = 17,
34832
34833
34834   kCMMFlattenProfile = 14,
34835   kCMMUnflattenProfile = 15,
34836
34837
34838   kCMMInit = 0,
34839   kCMMGetNamedColorInfo = 70,
34840   kCMMGetNamedColorValue = 71,
34841   kCMMGetIndNamedColorValue = 72,
34842   kCMMGetNamedColorIndex = 73,
34843   kCMMGetNamedColorName = 74,
34844
34845
34846   kCMMMatchPixMap = 3,
34847   kCMMCheckPixMap = 4
34848 };
34849
34850
34851
34852 extern "C" {
34853
34854
34855 enum {
34856
34857   cmspInvalidImageFile = -4220,
34858   cmspInvalidImageSpace = -4221,
34859   cmspInvalidProfileEmbed = -4222,
34860   cmspInvalidProfileSource = -4223,
34861   cmspInvalidProfileDest = -4224,
34862   cmspInvalidProfileProof = -4225,
34863   cmspInvalidProfileLink = -4226
34864 };
34865
34866
34867
34868
34869
34870
34871 enum {
34872   cmspFavorEmbeddedMask = 0x00000001
34873 };
34874
34875
34876
34877 typedef CMError ( * ValidateImageProcPtr)(const FSSpec * spec);
34878 typedef CMError ( * GetImageSpaceProcPtr)(const FSSpec *spec, OSType *space);
34879 typedef CMError ( * ValidateSpaceProcPtr)(const FSSpec *spec, OSType *space);
34880 typedef CMError ( * EmbedImageProcPtr)(const FSSpec *specFrom, const FSSpec *specInto, CMProfileRef embedProf, UInt32 embedFlags);
34881 typedef CMError ( * UnembedImageProcPtr)(const FSSpec *specFrom, const FSSpec *specInto);
34882 typedef CMError ( * MatchImageProcPtr)(const FSSpec *specFrom, const FSSpec *specInto, UInt32 qual, UInt32 srcIntent, CMProfileRef srcProf, CMProfileRef dstProf, CMProfileRef prfProf, UInt32 matchFlags);
34883 typedef CMError ( * CountImageProfilesProcPtr)(const FSSpec *spec, UInt32 *count);
34884 typedef CMError ( * GetIndImageProfileProcPtr)(const FSSpec *spec, UInt32 index, CMProfileRef *prof);
34885 typedef CMError ( * SetIndImageProfileProcPtr)(const FSSpec *specFrom, const FSSpec *specInto, UInt32 index, CMProfileRef prof, UInt32 embedFlags);
34886
34887 typedef CMError ( * CMValidImageProcPtr)(const FSSpec * spec);
34888 typedef CMError ( * CMGetImageSpaceProcPtr)(const FSSpec *spec, OSType *space);
34889 typedef CMError ( * CMEmbedImageProcPtr)(const FSSpec *specFrom, const FSSpec *specInto, Boolean repl, CMProfileRef embProf);
34890 typedef CMError ( * CMUnembedImageProcPtr)(const FSSpec *specFrom, const FSSpec *specInto, Boolean repl);
34891 typedef CMError ( * CMMatchImageProcPtr)(const FSSpec *specFrom, const FSSpec *specInto, Boolean repl, UInt32 qual, CMProfileRef srcProf, UInt32 srcIntent, CMProfileRef dstProf);
34892 typedef CMError ( * CMProofImageProcPtr)(const FSSpec *specFrom, const FSSpec *specInto, Boolean repl, UInt32 qual, CMProfileRef srcProf, UInt32 srcIntent, CMProfileRef dstProf, CMProfileRef prfProf);
34893 typedef CMError ( * CMLinkImageProcPtr)(const FSSpec *specFrom, const FSSpec *specInto, Boolean repl, UInt32 qual, CMProfileRef lnkProf, UInt32 lnkIntent);
34894 typedef CMError ( * CMCountImageProfilesProcPtr)(const FSSpec *spec, UInt32 *count);
34895 typedef CMError ( * CMGetIndImageProfileProcPtr)(const FSSpec *spec, UInt32 index, CMProfileRef *prof);
34896 typedef CMError ( * CMSetIndImageProfileProcPtr)(const FSSpec *specFrom, const FSSpec *specInto, Boolean repl, UInt32 index, CMProfileRef prof);
34897 extern CMError
34898 CMValidImage(const FSSpec * spec);
34899 extern CMError
34900 CMGetImageSpace(
34901   const FSSpec * spec,
34902   OSType * space);
34903 extern CMError
34904 CMEmbedImage(
34905   const FSSpec * specFrom,
34906   const FSSpec * specInto,
34907   Boolean repl,
34908   CMProfileRef embProf);
34909 extern CMError
34910 CMUnembedImage(
34911   const FSSpec * specFrom,
34912   const FSSpec * specInto,
34913   Boolean repl);
34914 extern CMError
34915 CMMatchImage(
34916   const FSSpec * specFrom,
34917   const FSSpec * specInto,
34918   Boolean repl,
34919   UInt32 qual,
34920   CMProfileRef srcProf,
34921   UInt32 srcIntent,
34922   CMProfileRef dstProf);
34923 extern CMError
34924 CMProofImage(
34925   const FSSpec * specFrom,
34926   const FSSpec * specInto,
34927   Boolean repl,
34928   UInt32 qual,
34929   CMProfileRef srcProf,
34930   UInt32 srcIntent,
34931   CMProfileRef dstProf,
34932   CMProfileRef prfProf);
34933 extern CMError
34934 CMLinkImage(
34935   const FSSpec * specFrom,
34936   const FSSpec * specInto,
34937   Boolean repl,
34938   UInt32 qual,
34939   CMProfileRef lnkProf,
34940   UInt32 lnkIntent);
34941 extern CMError
34942 CMCountImageProfiles(
34943   const FSSpec * spec,
34944   UInt32 * count);
34945 extern CMError
34946 CMGetIndImageProfile(
34947   const FSSpec * spec,
34948   UInt32 index,
34949   CMProfileRef * prof);
34950 extern CMError
34951 CMSetIndImageProfile(
34952   const FSSpec * specFrom,
34953   const FSSpec * specInto,
34954   Boolean repl,
34955   UInt32 index,
34956   CMProfileRef prof);
34957
34958
34959
34960
34961 }
34962
34963
34964
34965
34966
34967
34968
34969 extern "C" {
34970
34971
34972
34973
34974 enum {
34975   typeBoolean = 'bool',
34976   typeChar = 'TEXT'
34977 };
34978
34979
34980 enum {
34981   typeSInt16 = 'shor',
34982   typeSInt32 = 'long',
34983   typeUInt32 = 'magn',
34984   typeSInt64 = 'comp',
34985   typeIEEE32BitFloatingPoint = 'sing',
34986   typeIEEE64BitFloatingPoint = 'doub',
34987   type128BitFloatingPoint = 'ldbl',
34988   typeDecimalStruct = 'decm'
34989 };
34990
34991
34992 enum {
34993   typeSMInt = typeSInt16,
34994   typeShortInteger = typeSInt16,
34995   typeInteger = typeSInt32,
34996   typeLongInteger = typeSInt32,
34997   typeMagnitude = typeUInt32,
34998   typeComp = typeSInt64,
34999   typeSMFloat = typeIEEE32BitFloatingPoint,
35000   typeShortFloat = typeIEEE32BitFloatingPoint,
35001   typeFloat = typeIEEE64BitFloatingPoint,
35002   typeLongFloat = typeIEEE64BitFloatingPoint,
35003   typeExtended = 'exte'
35004 };
35005
35006
35007 enum {
35008   typeAEList = 'list',
35009   typeAERecord = 'reco',
35010   typeAppleEvent = 'aevt',
35011   typeEventRecord = 'evrc',
35012   typeTrue = 'true',
35013   typeFalse = 'fals',
35014   typeAlias = 'alis',
35015   typeEnumerated = 'enum',
35016   typeType = 'type',
35017   typeAppParameters = 'appa',
35018   typeProperty = 'prop',
35019   typeFSS = 'fss ',
35020   typeFSRef = 'fsrf',
35021   typeFileURL = 'furl',
35022   typeKeyword = 'keyw',
35023   typeSectionH = 'sect',
35024   typeWildCard = '****',
35025   typeApplSignature = 'sign',
35026   typeQDRectangle = 'qdrt',
35027   typeFixed = 'fixd',
35028   typeProcessSerialNumber = 'psn ',
35029   typeApplicationURL = 'aprl',
35030   typeNull = 'null'
35031 };
35032
35033
35034 enum {
35035   typeKernelProcessID = 'kpid',
35036   typeMachPort = 'port'
35037 };
35038
35039
35040 enum {
35041   keyTransactionIDAttr = 'tran',
35042   keyReturnIDAttr = 'rtid',
35043   keyEventClassAttr = 'evcl',
35044   keyEventIDAttr = 'evid',
35045   keyAddressAttr = 'addr',
35046   keyOptionalKeywordAttr = 'optk',
35047   keyTimeoutAttr = 'timo',
35048   keyInteractLevelAttr = 'inte',
35049   keyEventSourceAttr = 'esrc',
35050   keyMissedKeywordAttr = 'miss',
35051   keyOriginalAddressAttr = 'from',
35052   keyAcceptTimeoutAttr = 'actm'
35053 };
35054
35055
35056 enum {
35057   kAEDebugPOSTHeader = (1 << 0),
35058   kAEDebugReplyHeader = (1 << 1),
35059   kAEDebugXMLRequest = (1 << 2),
35060   kAEDebugXMLResponse = (1 << 3),
35061   kAEDebugXMLDebugAll = (long)0xFFFFFFFF
35062 };
35063
35064
35065
35066
35067
35068 enum {
35069   kSOAP1999Schema = 'ss99',
35070   kSOAP2001Schema = 'ss01'
35071 };
35072
35073 enum {
35074
35075   keyUserNameAttr = 'unam',
35076   keyUserPasswordAttr = 'pass',
35077   keyDisableAuthenticationAttr = 'auth',
35078
35079
35080   keyXMLDebuggingAttr = 'xdbg',
35081
35082   kAERPCClass = 'rpc ',
35083   kAEXMLRPCScheme = 'RPC2',
35084   kAESOAPScheme = 'SOAP',
35085   kAESharedScriptHandler = 'wscp',
35086
35087   keyRPCMethodName = 'meth',
35088   keyRPCMethodParam = 'parm',
35089   keyRPCMethodParamOrder = '/ord',
35090
35091   keyAEPOSTHeaderData = 'phed',
35092   keyAEReplyHeaderData = 'rhed',
35093   keyAEXMLRequestData = 'xreq',
35094   keyAEXMLReplyData = 'xrep',
35095
35096   keyAdditionalHTTPHeaders = 'ahed',
35097   keySOAPAction = 'sact',
35098   keySOAPMethodNameSpace = 'mspc',
35099   keySOAPMethodNameSpaceURI = 'mspu',
35100   keySOAPSchemaVersion = 'ssch'
35101 };
35102 enum {
35103   keySOAPStructureMetaData = '/smd',
35104   keySOAPSMDNamespace = 'ssns',
35105   keySOAPSMDNamespaceURI = 'ssnu',
35106   keySOAPSMDType = 'sstp'
35107 };
35108
35109
35110
35111
35112
35113
35114 enum {
35115
35116   kAEUseHTTPProxyAttr = 'xupr',
35117
35118   kAEHTTPProxyPortAttr = 'xhtp',
35119   kAEHTTPProxyHostAttr = 'xhth'
35120 };
35121
35122
35123
35124
35125
35126
35127 enum {
35128   kAESocks4Protocol = 4,
35129   kAESocks5Protocol = 5
35130 };
35131
35132 enum {
35133   kAEUseSocksAttr = 'xscs',
35134
35135   kAESocksProxyAttr = 'xsok',
35136
35137   kAESocksHostAttr = 'xshs',
35138   kAESocksPortAttr = 'xshp',
35139   kAESocksUserAttr = 'xshu',
35140
35141   kAESocksPasswordAttr = 'xshw'
35142 };
35143
35144
35145
35146 enum {
35147   kAEDescListFactorNone = 0,
35148   kAEDescListFactorType = 4,
35149   kAEDescListFactorTypeAndSize = 8
35150 };
35151
35152
35153 enum {
35154
35155   kAutoGenerateReturnID = -1,
35156
35157   kAnyTransactionID = 0
35158 };
35159
35160
35161 typedef ResType DescType;
35162 typedef FourCharCode AEKeyword;
35163
35164 typedef struct OpaqueAEDataStorageType* AEDataStorageType;
35165
35166
35167
35168
35169 typedef AEDataStorageType * AEDataStorage;
35170 struct AEDesc {
35171   DescType descriptorType;
35172   AEDataStorage dataHandle;
35173 };
35174 typedef struct AEDesc AEDesc;
35175 typedef AEDesc * AEDescPtr;
35176 struct AEKeyDesc {
35177   AEKeyword descKey;
35178   AEDesc descContent;
35179 };
35180 typedef struct AEKeyDesc AEKeyDesc;
35181
35182
35183 typedef AEDesc AEDescList;
35184
35185 typedef AEDescList AERecord;
35186
35187 typedef AEDesc AEAddressDesc;
35188
35189 typedef AERecord AppleEvent;
35190 typedef AppleEvent * AppleEventPtr;
35191 typedef SInt16 AEReturnID;
35192 typedef SInt32 AETransactionID;
35193 typedef FourCharCode AEEventClass;
35194 typedef FourCharCode AEEventID;
35195 typedef SInt8 AEArrayType;
35196 enum {
35197   kAEDataArray = 0,
35198   kAEPackedArray = 1,
35199   kAEDescArray = 3,
35200   kAEKeyDescArray = 4
35201 };
35202
35203
35204 enum {
35205   kAEHandleArray = 2
35206 };
35207
35208 union AEArrayData {
35209   short kAEDataArray[1];
35210   char kAEPackedArray[1];
35211   Handle kAEHandleArray[1];
35212   AEDesc kAEDescArray[1];
35213   AEKeyDesc kAEKeyDescArray[1];
35214 };
35215 typedef union AEArrayData AEArrayData;
35216 typedef AEArrayData * AEArrayDataPointer;
35217
35218
35219
35220
35221 typedef SInt16 AESendPriority;
35222 enum {
35223   kAENormalPriority = 0x00000000,
35224   kAEHighPriority = 0x00000001
35225 };
35226
35227
35228 typedef SInt32 AESendMode;
35229 enum {
35230   kAENoReply = 0x00000001,
35231   kAEQueueReply = 0x00000002,
35232   kAEWaitReply = 0x00000003,
35233   kAEDontReconnect = 0x00000080,
35234   kAEWantReceipt = 0x00000200,
35235   kAENeverInteract = 0x00000010,
35236   kAECanInteract = 0x00000020,
35237   kAEAlwaysInteract = 0x00000030,
35238   kAECanSwitchLayer = 0x00000040,
35239   kAEDontRecord = 0x00001000,
35240   kAEDontExecute = 0x00002000,
35241   kAEProcessNonReplyEvents = 0x00008000
35242 };
35243
35244
35245
35246 enum {
35247   kAEDefaultTimeout = -1,
35248   kNoTimeOut = -2
35249 };
35250
35251
35252
35253
35254
35255 typedef OSErr ( * AECoerceDescProcPtr)(const AEDesc *fromDesc, DescType toType, long handlerRefcon, AEDesc *toDesc);
35256 typedef OSErr ( * AECoercePtrProcPtr)(DescType typeCode, const void *dataPtr, Size dataSize, DescType toType, long handlerRefcon, AEDesc *result);
35257 typedef AECoerceDescProcPtr AECoerceDescUPP;
35258 typedef AECoercePtrProcPtr AECoercePtrUPP;
35259 extern AECoerceDescUPP
35260 NewAECoerceDescUPP(AECoerceDescProcPtr userRoutine) ;
35261 extern AECoercePtrUPP
35262 NewAECoercePtrUPP(AECoercePtrProcPtr userRoutine) ;
35263 extern void
35264 DisposeAECoerceDescUPP(AECoerceDescUPP userUPP) ;
35265 extern void
35266 DisposeAECoercePtrUPP(AECoercePtrUPP userUPP) ;
35267 extern OSErr
35268 InvokeAECoerceDescUPP(
35269   const AEDesc * fromDesc,
35270   DescType toType,
35271   long handlerRefcon,
35272   AEDesc * toDesc,
35273   AECoerceDescUPP userUPP) ;
35274 extern OSErr
35275 InvokeAECoercePtrUPP(
35276   DescType typeCode,
35277   const void * dataPtr,
35278   Size dataSize,
35279   DescType toType,
35280   long handlerRefcon,
35281   AEDesc * result,
35282   AECoercePtrUPP userUPP) ;
35283
35284
35285
35286
35287
35288 typedef AECoerceDescUPP AECoercionHandlerUPP;
35289 extern OSErr
35290 AEInstallCoercionHandler(
35291   DescType fromType,
35292   DescType toType,
35293   AECoercionHandlerUPP handler,
35294   long handlerRefcon,
35295   Boolean fromTypeIsDesc,
35296   Boolean isSysHandler) ;
35297 extern OSErr
35298 AERemoveCoercionHandler(
35299   DescType fromType,
35300   DescType toType,
35301   AECoercionHandlerUPP handler,
35302   Boolean isSysHandler) ;
35303 extern OSErr
35304 AEGetCoercionHandler(
35305   DescType fromType,
35306   DescType toType,
35307   AECoercionHandlerUPP * handler,
35308   long * handlerRefcon,
35309   Boolean * fromTypeIsDesc,
35310   Boolean isSysHandler) ;
35311 extern OSErr
35312 AECoercePtr(
35313   DescType typeCode,
35314   const void * dataPtr,
35315   Size dataSize,
35316   DescType toType,
35317   AEDesc * result) ;
35318 extern OSErr
35319 AECoerceDesc(
35320   const AEDesc * theAEDesc,
35321   DescType toType,
35322   AEDesc * result) ;
35323 extern void
35324 AEInitializeDesc(AEDesc * desc) ;
35325
35326
35327
35328
35329     inline void AEInitializeDescInline(AEDesc* d) { d->descriptorType = typeNull; d->dataHandle = __null; };
35330 extern OSErr
35331 AECreateDesc(
35332   DescType typeCode,
35333   const void * dataPtr,
35334   Size dataSize,
35335   AEDesc * result) ;
35336 extern OSErr
35337 AEDisposeDesc(AEDesc * theAEDesc) ;
35338 extern OSErr
35339 AEDuplicateDesc(
35340   const AEDesc * theAEDesc,
35341   AEDesc * result) ;
35342 typedef void ( * AEDisposeExternalProcPtr)(const void *dataPtr, Size dataLength, long refcon);
35343 typedef AEDisposeExternalProcPtr AEDisposeExternalUPP;
35344 extern OSStatus
35345 AECreateDescFromExternalPtr(
35346   OSType descriptorType,
35347   const void * dataPtr,
35348   Size dataLength,
35349   AEDisposeExternalUPP disposeCallback,
35350   long disposeRefcon,
35351   AEDesc * theDesc) ;
35352 extern OSErr
35353 AECreateList(
35354   const void * factoringPtr,
35355   Size factoredSize,
35356   Boolean isRecord,
35357   AEDescList * resultList) ;
35358 extern OSErr
35359 AECountItems(
35360   const AEDescList * theAEDescList,
35361   long * theCount) ;
35362 extern OSErr
35363 AEPutPtr(
35364   AEDescList * theAEDescList,
35365   long index,
35366   DescType typeCode,
35367   const void * dataPtr,
35368   Size dataSize) ;
35369 extern OSErr
35370 AEPutDesc(
35371   AEDescList * theAEDescList,
35372   long index,
35373   const AEDesc * theAEDesc) ;
35374 extern OSErr
35375 AEGetNthPtr(
35376   const AEDescList * theAEDescList,
35377   long index,
35378   DescType desiredType,
35379   AEKeyword * theAEKeyword,
35380   DescType * typeCode,
35381   void * dataPtr,
35382   Size maximumSize,
35383   Size * actualSize) ;
35384 extern OSErr
35385 AEGetNthDesc(
35386   const AEDescList * theAEDescList,
35387   long index,
35388   DescType desiredType,
35389   AEKeyword * theAEKeyword,
35390   AEDesc * result) ;
35391 extern OSErr
35392 AESizeOfNthItem(
35393   const AEDescList * theAEDescList,
35394   long index,
35395   DescType * typeCode,
35396   Size * dataSize) ;
35397 extern OSErr
35398 AEGetArray(
35399   const AEDescList * theAEDescList,
35400   AEArrayType arrayType,
35401   AEArrayDataPointer arrayPtr,
35402   Size maximumSize,
35403   DescType * itemType,
35404   Size * itemSize,
35405   long * itemCount) ;
35406 extern OSErr
35407 AEPutArray(
35408   AEDescList * theAEDescList,
35409   AEArrayType arrayType,
35410   const AEArrayData * arrayPtr,
35411   DescType itemType,
35412   Size itemSize,
35413   long itemCount) ;
35414 extern OSErr
35415 AEDeleteItem(
35416   AEDescList * theAEDescList,
35417   long index) ;
35418 extern Boolean
35419 AECheckIsRecord(const AEDesc * theDesc) ;
35420 extern OSErr
35421 AECreateAppleEvent(
35422   AEEventClass theAEEventClass,
35423   AEEventID theAEEventID,
35424   const AEAddressDesc * target,
35425   AEReturnID returnID,
35426   AETransactionID transactionID,
35427   AppleEvent * result) ;
35428 extern OSErr
35429 AEPutParamPtr(
35430   AppleEvent * theAppleEvent,
35431   AEKeyword theAEKeyword,
35432   DescType typeCode,
35433   const void * dataPtr,
35434   Size dataSize) ;
35435 extern OSErr
35436 AEPutParamDesc(
35437   AppleEvent * theAppleEvent,
35438   AEKeyword theAEKeyword,
35439   const AEDesc * theAEDesc) ;
35440 extern OSErr
35441 AEGetParamPtr(
35442   const AppleEvent * theAppleEvent,
35443   AEKeyword theAEKeyword,
35444   DescType desiredType,
35445   DescType * typeCode,
35446   void * dataPtr,
35447   Size maximumSize,
35448   Size * actualSize) ;
35449 extern OSErr
35450 AEGetParamDesc(
35451   const AppleEvent * theAppleEvent,
35452   AEKeyword theAEKeyword,
35453   DescType desiredType,
35454   AEDesc * result) ;
35455 extern OSErr
35456 AESizeOfParam(
35457   const AppleEvent * theAppleEvent,
35458   AEKeyword theAEKeyword,
35459   DescType * typeCode,
35460   Size * dataSize) ;
35461 extern OSErr
35462 AEDeleteParam(
35463   AppleEvent * theAppleEvent,
35464   AEKeyword theAEKeyword) ;
35465 extern OSErr
35466 AEGetAttributePtr(
35467   const AppleEvent * theAppleEvent,
35468   AEKeyword theAEKeyword,
35469   DescType desiredType,
35470   DescType * typeCode,
35471   void * dataPtr,
35472   Size maximumSize,
35473   Size * actualSize) ;
35474 extern OSErr
35475 AEGetAttributeDesc(
35476   const AppleEvent * theAppleEvent,
35477   AEKeyword theAEKeyword,
35478   DescType desiredType,
35479   AEDesc * result) ;
35480 extern OSErr
35481 AESizeOfAttribute(
35482   const AppleEvent * theAppleEvent,
35483   AEKeyword theAEKeyword,
35484   DescType * typeCode,
35485   Size * dataSize) ;
35486 extern OSErr
35487 AEPutAttributePtr(
35488   AppleEvent * theAppleEvent,
35489   AEKeyword theAEKeyword,
35490   DescType typeCode,
35491   const void * dataPtr,
35492   Size dataSize) ;
35493 extern OSErr
35494 AEPutAttributeDesc(
35495   AppleEvent * theAppleEvent,
35496   AEKeyword theAEKeyword,
35497   const AEDesc * theAEDesc) ;
35498 extern Size
35499 AESizeOfFlattenedDesc(const AEDesc * theAEDesc) ;
35500 extern OSStatus
35501 AEFlattenDesc(
35502   const AEDesc * theAEDesc,
35503   Ptr buffer,
35504   Size bufferSize,
35505   Size * actualSize) ;
35506 extern OSStatus
35507 AEUnflattenDesc(
35508   Ptr buffer,
35509   AEDesc * result) ;
35510 extern OSErr
35511 AEGetDescData(
35512   const AEDesc * theAEDesc,
35513   void * dataPtr,
35514   Size maximumSize) ;
35515 extern Size
35516 AEGetDescDataSize(const AEDesc * theAEDesc) ;
35517 extern OSErr
35518 AEReplaceDescData(
35519   DescType typeCode,
35520   const void * dataPtr,
35521   Size dataSize,
35522   AEDesc * theAEDesc) ;
35523 extern OSStatus
35524 AEGetDescDataRange(
35525   const AEDesc * dataDesc,
35526   void * buffer,
35527   Size offset,
35528   Size length) ;
35529
35530
35531
35532
35533
35534 typedef OSErr ( * AEEventHandlerProcPtr)(const AppleEvent *theAppleEvent, AppleEvent *reply, long handlerRefcon);
35535 typedef AEEventHandlerProcPtr AEEventHandlerUPP;
35536 extern AEDisposeExternalUPP
35537 NewAEDisposeExternalUPP(AEDisposeExternalProcPtr userRoutine) ;
35538 extern AEEventHandlerUPP
35539 NewAEEventHandlerUPP(AEEventHandlerProcPtr userRoutine) ;
35540 extern void
35541 DisposeAEDisposeExternalUPP(AEDisposeExternalUPP userUPP) ;
35542 extern void
35543 DisposeAEEventHandlerUPP(AEEventHandlerUPP userUPP) ;
35544 extern void
35545 InvokeAEDisposeExternalUPP(
35546   const void * dataPtr,
35547   Size dataLength,
35548   long refcon,
35549   AEDisposeExternalUPP userUPP) ;
35550 extern OSErr
35551 InvokeAEEventHandlerUPP(
35552   const AppleEvent * theAppleEvent,
35553   AppleEvent * reply,
35554   long handlerRefcon,
35555   AEEventHandlerUPP userUPP) ;
35556
35557
35558
35559
35560
35561 }
35562
35563
35564
35565 extern "C" {
35566
35567
35568 enum {
35569
35570   keyDirectObject = '----',
35571   keyErrorNumber = 'errn',
35572   keyErrorString = 'errs',
35573   keyProcessSerialNumber = 'psn ',
35574   keyPreDispatch = 'phac',
35575   keySelectProc = 'selh',
35576
35577   keyAERecorderCount = 'recr',
35578
35579   keyAEVersion = 'vers'
35580 };
35581
35582
35583 enum {
35584   kCoreEventClass = 'aevt'
35585 };
35586
35587
35588 enum {
35589   kAEOpenApplication = 'oapp',
35590   kAEOpenDocuments = 'odoc',
35591   kAEPrintDocuments = 'pdoc',
35592   kAEQuitApplication = 'quit',
35593   kAEAnswer = 'ansr',
35594   kAEApplicationDied = 'obit',
35595   kAEShowPreferences = 'pref'
35596 };
35597
35598
35599 enum {
35600   kAEStartRecording = 'reca',
35601   kAEStopRecording = 'recc',
35602   kAENotifyStartRecording = 'rec1',
35603   kAENotifyStopRecording = 'rec0',
35604   kAENotifyRecording = 'recr'
35605 };
35606 typedef SInt8 AEEventSource;
35607 enum {
35608   kAEUnknownSource = 0,
35609   kAEDirectCall = 1,
35610   kAESameProcess = 2,
35611   kAELocalProcess = 3,
35612   kAERemoteProcess = 4
35613 };
35614 extern OSErr
35615 AEInstallEventHandler(
35616   AEEventClass theAEEventClass,
35617   AEEventID theAEEventID,
35618   AEEventHandlerUPP handler,
35619   long handlerRefcon,
35620   Boolean isSysHandler) ;
35621 extern OSErr
35622 AERemoveEventHandler(
35623   AEEventClass theAEEventClass,
35624   AEEventID theAEEventID,
35625   AEEventHandlerUPP handler,
35626   Boolean isSysHandler) ;
35627 extern OSErr
35628 AEGetEventHandler(
35629   AEEventClass theAEEventClass,
35630   AEEventID theAEEventID,
35631   AEEventHandlerUPP * handler,
35632   long * handlerRefcon,
35633   Boolean isSysHandler) ;
35634 extern OSErr
35635 AEInstallSpecialHandler(
35636   AEKeyword functionClass,
35637   AEEventHandlerUPP handler,
35638   Boolean isSysHandler) ;
35639 extern OSErr
35640 AERemoveSpecialHandler(
35641   AEKeyword functionClass,
35642   AEEventHandlerUPP handler,
35643   Boolean isSysHandler) ;
35644 extern OSErr
35645 AEGetSpecialHandler(
35646   AEKeyword functionClass,
35647   AEEventHandlerUPP * handler,
35648   Boolean isSysHandler) ;
35649 extern OSErr
35650 AEManagerInfo(
35651   AEKeyword keyWord,
35652   long * result) ;
35653 }
35654
35655
35656
35657 extern "C" {
35658 extern OSErr
35659 CreateOffsetDescriptor(
35660   long theOffset,
35661   AEDesc * theDescriptor) ;
35662 extern OSErr
35663 CreateCompDescriptor(
35664   DescType comparisonOperator,
35665   AEDesc * operand1,
35666   AEDesc * operand2,
35667   Boolean disposeInputs,
35668   AEDesc * theDescriptor) ;
35669 extern OSErr
35670 CreateLogicalDescriptor(
35671   AEDescList * theLogicalTerms,
35672   DescType theLogicOperator,
35673   Boolean disposeInputs,
35674   AEDesc * theDescriptor) ;
35675 extern OSErr
35676 CreateObjSpecifier(
35677   DescType desiredClass,
35678   AEDesc * theContainer,
35679   DescType keyForm,
35680   AEDesc * keyData,
35681   Boolean disposeInputs,
35682   AEDesc * objSpecifier) ;
35683 extern OSErr
35684 CreateRangeDescriptor(
35685   AEDesc * rangeStart,
35686   AEDesc * rangeStop,
35687   Boolean disposeInputs,
35688   AEDesc * theDescriptor) ;
35689
35690
35691
35692
35693 }
35694
35695
35696
35697 extern "C" {
35698
35699
35700
35701 enum {
35702
35703   kAEAND = 'AND ',
35704   kAEOR = 'OR  ',
35705   kAENOT = 'NOT ',
35706
35707   kAEFirst = 'firs',
35708   kAELast = 'last',
35709   kAEMiddle = 'midd',
35710   kAEAny = 'any ',
35711   kAEAll = 'all ',
35712
35713   kAENext = 'next',
35714   kAEPrevious = 'prev',
35715
35716   keyAECompOperator = 'relo',
35717   keyAELogicalTerms = 'term',
35718   keyAELogicalOperator = 'logc',
35719   keyAEObject1 = 'obj1',
35720   keyAEObject2 = 'obj2',
35721
35722   keyAEDesiredClass = 'want',
35723   keyAEContainer = 'from',
35724   keyAEKeyForm = 'form',
35725   keyAEKeyData = 'seld'
35726 };
35727
35728 enum {
35729
35730   keyAERangeStart = 'star',
35731   keyAERangeStop = 'stop',
35732
35733   keyDisposeTokenProc = 'xtok',
35734   keyAECompareProc = 'cmpr',
35735   keyAECountProc = 'cont',
35736   keyAEMarkTokenProc = 'mkid',
35737   keyAEMarkProc = 'mark',
35738   keyAEAdjustMarksProc = 'adjm',
35739   keyAEGetErrDescProc = 'indc'
35740 };
35741
35742
35743 enum {
35744
35745   formAbsolutePosition = 'indx',
35746   formRelativePosition = 'rele',
35747   formTest = 'test',
35748   formRange = 'rang',
35749   formPropertyID = 'prop',
35750   formName = 'name',
35751
35752   typeObjectSpecifier = 'obj ',
35753   typeObjectBeingExamined = 'exmn',
35754   typeCurrentContainer = 'ccnt',
35755   typeToken = 'toke',
35756   typeRelativeDescriptor = 'rel ',
35757   typeAbsoluteOrdinal = 'abso',
35758   typeIndexDescriptor = 'inde',
35759   typeRangeDescriptor = 'rang',
35760   typeLogicalDescriptor = 'logi',
35761   typeCompDescriptor = 'cmpd',
35762   typeOSLTokenList = 'ostl'
35763 };
35764
35765
35766 enum {
35767   kAEIDoMinimum = 0x0000,
35768   kAEIDoWhose = 0x0001,
35769   kAEIDoMarking = 0x0004,
35770   kAEPassSubDescs = 0x0008,
35771   kAEResolveNestedLists = 0x0010,
35772   kAEHandleSimpleRanges = 0x0020,
35773   kAEUseRelativeIterators = 0x0040
35774 };
35775
35776
35777 enum {
35778   typeWhoseDescriptor = 'whos',
35779   formWhose = 'whos',
35780   typeWhoseRange = 'wrng',
35781   keyAEWhoseRangeStart = 'wstr',
35782   keyAEWhoseRangeStop = 'wstp',
35783   keyAEIndex = 'kidx',
35784   keyAETest = 'ktst'
35785 };
35786
35787
35788
35789
35790
35791
35792
35793 struct ccntTokenRecord {
35794   DescType tokenClass;
35795   AEDesc token;
35796 };
35797 typedef struct ccntTokenRecord ccntTokenRecord;
35798 typedef ccntTokenRecord * ccntTokenRecPtr;
35799 typedef ccntTokenRecPtr * ccntTokenRecHandle;
35800
35801
35802
35803
35804
35805
35806 typedef OSErr ( * OSLAccessorProcPtr)(DescType desiredClass, const AEDesc *container, DescType containerClass, DescType form, const AEDesc *selectionData, AEDesc *value, long accessorRefcon);
35807 typedef OSErr ( * OSLCompareProcPtr)(DescType oper, const AEDesc *obj1, const AEDesc *obj2, Boolean *result);
35808 typedef OSErr ( * OSLCountProcPtr)(DescType desiredType, DescType containerClass, const AEDesc *container, long *result);
35809 typedef OSErr ( * OSLDisposeTokenProcPtr)(AEDesc * unneededToken);
35810 typedef OSErr ( * OSLGetMarkTokenProcPtr)(const AEDesc *dContainerToken, DescType containerClass, AEDesc *result);
35811 typedef OSErr ( * OSLGetErrDescProcPtr)(AEDesc ** appDescPtr);
35812 typedef OSErr ( * OSLMarkProcPtr)(const AEDesc *dToken, const AEDesc *markToken, long index);
35813 typedef OSErr ( * OSLAdjustMarksProcPtr)(long newStart, long newStop, const AEDesc *markToken);
35814 typedef OSLAccessorProcPtr OSLAccessorUPP;
35815 typedef OSLCompareProcPtr OSLCompareUPP;
35816 typedef OSLCountProcPtr OSLCountUPP;
35817 typedef OSLDisposeTokenProcPtr OSLDisposeTokenUPP;
35818 typedef OSLGetMarkTokenProcPtr OSLGetMarkTokenUPP;
35819 typedef OSLGetErrDescProcPtr OSLGetErrDescUPP;
35820 typedef OSLMarkProcPtr OSLMarkUPP;
35821 typedef OSLAdjustMarksProcPtr OSLAdjustMarksUPP;
35822 extern OSLAccessorUPP
35823 NewOSLAccessorUPP(OSLAccessorProcPtr userRoutine) ;
35824 extern OSLCompareUPP
35825 NewOSLCompareUPP(OSLCompareProcPtr userRoutine) ;
35826 extern OSLCountUPP
35827 NewOSLCountUPP(OSLCountProcPtr userRoutine) ;
35828 extern OSLDisposeTokenUPP
35829 NewOSLDisposeTokenUPP(OSLDisposeTokenProcPtr userRoutine) ;
35830 extern OSLGetMarkTokenUPP
35831 NewOSLGetMarkTokenUPP(OSLGetMarkTokenProcPtr userRoutine) ;
35832 extern OSLGetErrDescUPP
35833 NewOSLGetErrDescUPP(OSLGetErrDescProcPtr userRoutine) ;
35834 extern OSLMarkUPP
35835 NewOSLMarkUPP(OSLMarkProcPtr userRoutine) ;
35836 extern OSLAdjustMarksUPP
35837 NewOSLAdjustMarksUPP(OSLAdjustMarksProcPtr userRoutine) ;
35838 extern void
35839 DisposeOSLAccessorUPP(OSLAccessorUPP userUPP) ;
35840 extern void
35841 DisposeOSLCompareUPP(OSLCompareUPP userUPP) ;
35842 extern void
35843 DisposeOSLCountUPP(OSLCountUPP userUPP) ;
35844 extern void
35845 DisposeOSLDisposeTokenUPP(OSLDisposeTokenUPP userUPP) ;
35846 extern void
35847 DisposeOSLGetMarkTokenUPP(OSLGetMarkTokenUPP userUPP) ;
35848 extern void
35849 DisposeOSLGetErrDescUPP(OSLGetErrDescUPP userUPP) ;
35850 extern void
35851 DisposeOSLMarkUPP(OSLMarkUPP userUPP) ;
35852 extern void
35853 DisposeOSLAdjustMarksUPP(OSLAdjustMarksUPP userUPP) ;
35854 extern OSErr
35855 InvokeOSLAccessorUPP(
35856   DescType desiredClass,
35857   const AEDesc * container,
35858   DescType containerClass,
35859   DescType form,
35860   const AEDesc * selectionData,
35861   AEDesc * value,
35862   long accessorRefcon,
35863   OSLAccessorUPP userUPP) ;
35864 extern OSErr
35865 InvokeOSLCompareUPP(
35866   DescType oper,
35867   const AEDesc * obj1,
35868   const AEDesc * obj2,
35869   Boolean * result,
35870   OSLCompareUPP userUPP) ;
35871 extern OSErr
35872 InvokeOSLCountUPP(
35873   DescType desiredType,
35874   DescType containerClass,
35875   const AEDesc * container,
35876   long * result,
35877   OSLCountUPP userUPP) ;
35878 extern OSErr
35879 InvokeOSLDisposeTokenUPP(
35880   AEDesc * unneededToken,
35881   OSLDisposeTokenUPP userUPP) ;
35882 extern OSErr
35883 InvokeOSLGetMarkTokenUPP(
35884   const AEDesc * dContainerToken,
35885   DescType containerClass,
35886   AEDesc * result,
35887   OSLGetMarkTokenUPP userUPP) ;
35888 extern OSErr
35889 InvokeOSLGetErrDescUPP(
35890   AEDesc ** appDescPtr,
35891   OSLGetErrDescUPP userUPP) ;
35892 extern OSErr
35893 InvokeOSLMarkUPP(
35894   const AEDesc * dToken,
35895   const AEDesc * markToken,
35896   long index,
35897   OSLMarkUPP userUPP) ;
35898 extern OSErr
35899 InvokeOSLAdjustMarksUPP(
35900   long newStart,
35901   long newStop,
35902   const AEDesc * markToken,
35903   OSLAdjustMarksUPP userUPP) ;
35904 extern OSErr
35905 AEObjectInit(void) ;
35906 extern OSErr
35907 AESetObjectCallbacks(
35908   OSLCompareUPP myCompareProc,
35909   OSLCountUPP myCountProc,
35910   OSLDisposeTokenUPP myDisposeTokenProc,
35911   OSLGetMarkTokenUPP myGetMarkTokenProc,
35912   OSLMarkUPP myMarkProc,
35913   OSLAdjustMarksUPP myAdjustMarksProc,
35914   OSLGetErrDescUPP myGetErrDescProcPtr) ;
35915 extern OSErr
35916 AEResolve(
35917   const AEDesc * objectSpecifier,
35918   short callbackFlags,
35919   AEDesc * theToken) ;
35920 extern OSErr
35921 AEInstallObjectAccessor(
35922   DescType desiredClass,
35923   DescType containerType,
35924   OSLAccessorUPP theAccessor,
35925   long accessorRefcon,
35926   Boolean isSysHandler) ;
35927 extern OSErr
35928 AERemoveObjectAccessor(
35929   DescType desiredClass,
35930   DescType containerType,
35931   OSLAccessorUPP theAccessor,
35932   Boolean isSysHandler) ;
35933 extern OSErr
35934 AEGetObjectAccessor(
35935   DescType desiredClass,
35936   DescType containerType,
35937   OSLAccessorUPP * accessor,
35938   long * accessorRefcon,
35939   Boolean isSysHandler) ;
35940 extern OSErr
35941 AEDisposeToken(AEDesc * theToken) ;
35942 extern OSErr
35943 AECallObjectAccessor(
35944   DescType desiredClass,
35945   const AEDesc * containerToken,
35946   DescType containerClass,
35947   DescType keyForm,
35948   const AEDesc * keyData,
35949   AEDesc * token) ;
35950
35951
35952
35953
35954
35955
35956 }
35957
35958
35959
35960
35961 enum {
35962   cAEList = 'list',
35963   cApplication = 'capp',
35964   cArc = 'carc',
35965   cBoolean = 'bool',
35966   cCell = 'ccel',
35967   cChar = 'cha ',
35968   cColorTable = 'clrt',
35969   cColumn = 'ccol',
35970   cDocument = 'docu',
35971   cDrawingArea = 'cdrw',
35972   cEnumeration = 'enum',
35973   cFile = 'file',
35974   cFixed = 'fixd',
35975   cFixedPoint = 'fpnt',
35976   cFixedRectangle = 'frct',
35977   cGraphicLine = 'glin',
35978   cGraphicObject = 'cgob',
35979   cGraphicShape = 'cgsh',
35980   cGraphicText = 'cgtx',
35981   cGroupedGraphic = 'cpic'
35982 };
35983
35984 enum {
35985   cInsertionLoc = 'insl',
35986   cInsertionPoint = 'cins',
35987   cIntlText = 'itxt',
35988   cIntlWritingCode = 'intl',
35989   cItem = 'citm',
35990   cLine = 'clin',
35991   cLongDateTime = 'ldt ',
35992   cLongFixed = 'lfxd',
35993   cLongFixedPoint = 'lfpt',
35994   cLongFixedRectangle = 'lfrc',
35995   cLongInteger = 'long',
35996   cLongPoint = 'lpnt',
35997   cLongRectangle = 'lrct',
35998   cMachineLoc = 'mLoc',
35999   cMenu = 'cmnu',
36000   cMenuItem = 'cmen',
36001   cObject = 'cobj',
36002   cObjectSpecifier = 'obj ',
36003   cOpenableObject = 'coob',
36004   cOval = 'covl'
36005 };
36006
36007 enum {
36008   cParagraph = 'cpar',
36009   cPICT = 'PICT',
36010   cPixel = 'cpxl',
36011   cPixelMap = 'cpix',
36012   cPolygon = 'cpgn',
36013   cProperty = 'prop',
36014   cQDPoint = 'QDpt',
36015   cQDRectangle = 'qdrt',
36016   cRectangle = 'crec',
36017   cRGBColor = 'cRGB',
36018   cRotation = 'trot',
36019   cRoundedRectangle = 'crrc',
36020   cRow = 'crow',
36021   cSelection = 'csel',
36022   cShortInteger = 'shor',
36023   cTable = 'ctbl',
36024   cText = 'ctxt',
36025   cTextFlow = 'cflo',
36026   cTextStyles = 'tsty',
36027   cType = 'type'
36028 };
36029
36030 enum {
36031   cVersion = 'vers',
36032   cWindow = 'cwin',
36033   cWord = 'cwor',
36034   enumArrows = 'arro',
36035   enumJustification = 'just',
36036   enumKeyForm = 'kfrm',
36037   enumPosition = 'posi',
36038   enumProtection = 'prtn',
36039   enumQuality = 'qual',
36040   enumSaveOptions = 'savo',
36041   enumStyle = 'styl',
36042   enumTransferMode = 'tran',
36043   formUniqueID = 'ID  ',
36044   kAEAbout = 'abou',
36045   kAEAfter = 'afte',
36046   kAEAliasSelection = 'sali',
36047   kAEAllCaps = 'alcp',
36048   kAEArrowAtEnd = 'aren',
36049   kAEArrowAtStart = 'arst',
36050   kAEArrowBothEnds = 'arbo'
36051 };
36052
36053 enum {
36054   kAEAsk = 'ask ',
36055   kAEBefore = 'befo',
36056   kAEBeginning = 'bgng',
36057   kAEBeginsWith = 'bgwt',
36058   kAEBeginTransaction = 'begi',
36059   kAEBold = 'bold',
36060   kAECaseSensEquals = 'cseq',
36061   kAECentered = 'cent',
36062   kAEChangeView = 'view',
36063   kAEClone = 'clon',
36064   kAEClose = 'clos',
36065   kAECondensed = 'cond',
36066   kAEContains = 'cont',
36067   kAECopy = 'copy',
36068   kAECoreSuite = 'core',
36069   kAECountElements = 'cnte',
36070   kAECreateElement = 'crel',
36071   kAECreatePublisher = 'cpub',
36072   kAECut = 'cut ',
36073   kAEDelete = 'delo'
36074 };
36075
36076 enum {
36077   kAEDoObjectsExist = 'doex',
36078   kAEDoScript = 'dosc',
36079   kAEDrag = 'drag',
36080   kAEDuplicateSelection = 'sdup',
36081   kAEEditGraphic = 'edit',
36082   kAEEmptyTrash = 'empt',
36083   kAEEnd = 'end ',
36084   kAEEndsWith = 'ends',
36085   kAEEndTransaction = 'endt',
36086   kAEEquals = '=   ',
36087   kAEExpanded = 'pexp',
36088   kAEFast = 'fast',
36089   kAEFinderEvents = 'FNDR',
36090   kAEFormulaProtect = 'fpro',
36091   kAEFullyJustified = 'full',
36092   kAEGetClassInfo = 'qobj',
36093   kAEGetData = 'getd',
36094   kAEGetDataSize = 'dsiz',
36095   kAEGetEventInfo = 'gtei',
36096   kAEGetInfoSelection = 'sinf'
36097 };
36098
36099 enum {
36100   kAEGetPrivilegeSelection = 'sprv',
36101   kAEGetSuiteInfo = 'gtsi',
36102   kAEGreaterThan = '>   ',
36103   kAEGreaterThanEquals = '>=  ',
36104   kAEGrow = 'grow',
36105   kAEHidden = 'hidn',
36106   kAEHiQuality = 'hiqu',
36107   kAEImageGraphic = 'imgr',
36108   kAEIsUniform = 'isun',
36109   kAEItalic = 'ital',
36110   kAELeftJustified = 'left',
36111   kAELessThan = '<   ',
36112   kAELessThanEquals = '<=  ',
36113   kAELowercase = 'lowc',
36114   kAEMakeObjectsVisible = 'mvis',
36115   kAEMiscStandards = 'misc',
36116   kAEModifiable = 'modf',
36117   kAEMove = 'move',
36118   kAENo = 'no  ',
36119   kAENoArrow = 'arno'
36120 };
36121
36122 enum {
36123   kAENonmodifiable = 'nmod',
36124   kAEOpen = 'odoc',
36125   kAEOpenSelection = 'sope',
36126   kAEOutline = 'outl',
36127   kAEPageSetup = 'pgsu',
36128   kAEPaste = 'past',
36129   kAEPlain = 'plan',
36130   kAEPrint = 'pdoc',
36131   kAEPrintSelection = 'spri',
36132   kAEPrintWindow = 'pwin',
36133   kAEPutAwaySelection = 'sput',
36134   kAEQDAddOver = 'addo',
36135   kAEQDAddPin = 'addp',
36136   kAEQDAdMax = 'admx',
36137   kAEQDAdMin = 'admn',
36138   kAEQDBic = 'bic ',
36139   kAEQDBlend = 'blnd',
36140   kAEQDCopy = 'cpy ',
36141   kAEQDNotBic = 'nbic',
36142   kAEQDNotCopy = 'ncpy'
36143 };
36144
36145 enum {
36146   kAEQDNotOr = 'ntor',
36147   kAEQDNotXor = 'nxor',
36148   kAEQDOr = 'or  ',
36149   kAEQDSubOver = 'subo',
36150   kAEQDSubPin = 'subp',
36151   kAEQDSupplementalSuite = 'qdsp',
36152   kAEQDXor = 'xor ',
36153   kAEQuickdrawSuite = 'qdrw',
36154   kAEQuitAll = 'quia',
36155   kAERedo = 'redo',
36156   kAERegular = 'regl',
36157   kAEReopenApplication = 'rapp',
36158   kAEReplace = 'rplc',
36159   kAERequiredSuite = 'reqd',
36160   kAERestart = 'rest',
36161   kAERevealSelection = 'srev',
36162   kAERevert = 'rvrt',
36163   kAERightJustified = 'rght',
36164   kAESave = 'save',
36165   kAESelect = 'slct',
36166   kAESetData = 'setd'
36167 };
36168
36169 enum {
36170   kAESetPosition = 'posn',
36171   kAEShadow = 'shad',
36172   kAEShowClipboard = 'shcl',
36173   kAEShutDown = 'shut',
36174   kAESleep = 'slep',
36175   kAESmallCaps = 'smcp',
36176   kAESpecialClassProperties = 'c@#!',
36177   kAEStrikethrough = 'strk',
36178   kAESubscript = 'sbsc',
36179   kAESuperscript = 'spsc',
36180   kAETableSuite = 'tbls',
36181   kAETextSuite = 'TEXT',
36182   kAETransactionTerminated = 'ttrm',
36183   kAEUnderline = 'undl',
36184   kAEUndo = 'undo',
36185   kAEWholeWordEquals = 'wweq',
36186   kAEYes = 'yes ',
36187   kAEZoom = 'zoom'
36188 };
36189
36190
36191 enum {
36192   kAELogOut = 'logo',
36193   kAEReallyLogOut = 'rlgo',
36194   kAEShowRestartDialog = 'rrst',
36195   kAEShowShutdownDialog = 'rsdn'
36196 };
36197
36198
36199 enum {
36200   kAEMouseClass = 'mous',
36201   kAEDown = 'down',
36202   kAEUp = 'up  ',
36203   kAEMoved = 'move',
36204   kAEStoppedMoving = 'stop',
36205   kAEWindowClass = 'wind',
36206   kAEUpdate = 'updt',
36207   kAEActivate = 'actv',
36208   kAEDeactivate = 'dact',
36209   kAECommandClass = 'cmnd',
36210   kAEKeyClass = 'keyc',
36211   kAERawKey = 'rkey',
36212   kAEVirtualKey = 'keyc',
36213   kAENavigationKey = 'nave',
36214   kAEAutoDown = 'auto',
36215   kAEApplicationClass = 'appl',
36216   kAESuspend = 'susp',
36217   kAEResume = 'rsme',
36218   kAEDiskEvent = 'disk',
36219   kAENullEvent = 'null',
36220   kAEWakeUpEvent = 'wake',
36221   kAEScrapEvent = 'scrp',
36222   kAEHighLevel = 'high'
36223 };
36224
36225 enum {
36226   keyAEAngle = 'kang',
36227   keyAEArcAngle = 'parc'
36228 };
36229
36230 enum {
36231   keyAEBaseAddr = 'badd',
36232   keyAEBestType = 'pbst',
36233   keyAEBgndColor = 'kbcl',
36234   keyAEBgndPattern = 'kbpt',
36235   keyAEBounds = 'pbnd',
36236   keyAECellList = 'kclt',
36237   keyAEClassID = 'clID',
36238   keyAEColor = 'colr',
36239   keyAEColorTable = 'cltb',
36240   keyAECurveHeight = 'kchd',
36241   keyAECurveWidth = 'kcwd',
36242   keyAEDashStyle = 'pdst',
36243   keyAEData = 'data',
36244   keyAEDefaultType = 'deft',
36245   keyAEDefinitionRect = 'pdrt',
36246   keyAEDescType = 'dstp',
36247   keyAEDestination = 'dest',
36248   keyAEDoAntiAlias = 'anta',
36249   keyAEDoDithered = 'gdit',
36250   keyAEDoRotate = 'kdrt'
36251 };
36252
36253 enum {
36254   keyAEDoScale = 'ksca',
36255   keyAEDoTranslate = 'ktra',
36256   keyAEEditionFileLoc = 'eloc',
36257   keyAEElements = 'elms',
36258   keyAEEndPoint = 'pend',
36259   keyAEEventClass = 'evcl',
36260   keyAEEventID = 'evti',
36261   keyAEFile = 'kfil',
36262   keyAEFileType = 'fltp',
36263   keyAEFillColor = 'flcl',
36264   keyAEFillPattern = 'flpt',
36265   keyAEFlipHorizontal = 'kfho',
36266   keyAEFlipVertical = 'kfvt',
36267   keyAEFont = 'font',
36268   keyAEFormula = 'pfor',
36269   keyAEGraphicObjects = 'gobs',
36270   keyAEID = 'ID  ',
36271   keyAEImageQuality = 'gqua',
36272   keyAEInsertHere = 'insh',
36273   keyAEKeyForms = 'keyf'
36274 };
36275
36276 enum {
36277   keyAEKeyword = 'kywd',
36278   keyAELevel = 'levl',
36279   keyAELineArrow = 'arro',
36280   keyAEName = 'pnam',
36281   keyAENewElementLoc = 'pnel',
36282   keyAEObject = 'kobj',
36283   keyAEObjectClass = 'kocl',
36284   keyAEOffStyles = 'ofst',
36285   keyAEOnStyles = 'onst',
36286   keyAEParameters = 'prms',
36287   keyAEParamFlags = 'pmfg',
36288   keyAEPenColor = 'ppcl',
36289   keyAEPenPattern = 'pppa',
36290   keyAEPenWidth = 'ppwd',
36291   keyAEPixelDepth = 'pdpt',
36292   keyAEPixMapMinus = 'kpmm',
36293   keyAEPMTable = 'kpmt',
36294   keyAEPointList = 'ptlt',
36295   keyAEPointSize = 'ptsz',
36296   keyAEPosition = 'kpos'
36297 };
36298
36299 enum {
36300   keyAEPropData = 'prdt',
36301   keyAEProperties = 'qpro',
36302   keyAEProperty = 'kprp',
36303   keyAEPropFlags = 'prfg',
36304   keyAEPropID = 'prop',
36305   keyAEProtection = 'ppro',
36306   keyAERenderAs = 'kren',
36307   keyAERequestedType = 'rtyp',
36308   keyAEResult = '----',
36309   keyAEResultInfo = 'rsin',
36310   keyAERotation = 'prot',
36311   keyAERotPoint = 'krtp',
36312   keyAERowList = 'krls',
36313   keyAESaveOptions = 'savo',
36314   keyAEScale = 'pscl',
36315   keyAEScriptTag = 'psct',
36316   keyAEShowWhere = 'show',
36317   keyAEStartAngle = 'pang',
36318   keyAEStartPoint = 'pstp',
36319   keyAEStyles = 'ksty'
36320 };
36321
36322 enum {
36323   keyAESuiteID = 'suit',
36324   keyAEText = 'ktxt',
36325   keyAETextColor = 'ptxc',
36326   keyAETextFont = 'ptxf',
36327   keyAETextPointSize = 'ptps',
36328   keyAETextStyles = 'txst',
36329   keyAETextLineHeight = 'ktlh',
36330   keyAETextLineAscent = 'ktas',
36331   keyAETheText = 'thtx',
36332   keyAETransferMode = 'pptm',
36333   keyAETranslation = 'ptrs',
36334   keyAETryAsStructGraf = 'toog',
36335   keyAEUniformStyles = 'ustl',
36336   keyAEUpdateOn = 'pupd',
36337   keyAEUserTerm = 'utrm',
36338   keyAEWindow = 'wndw',
36339   keyAEWritingCode = 'wrcd'
36340 };
36341
36342 enum {
36343   keyMiscellaneous = 'fmsc',
36344   keySelection = 'fsel',
36345   keyWindow = 'kwnd',
36346
36347   keyWhen = 'when',
36348   keyWhere = 'wher',
36349   keyModifiers = 'mods',
36350   keyKey = 'key ',
36351   keyKeyCode = 'code',
36352   keyKeyboard = 'keyb',
36353   keyDriveNumber = 'drv#',
36354   keyErrorCode = 'err#',
36355   keyHighLevelClass = 'hcls',
36356   keyHighLevelID = 'hid '
36357 };
36358
36359 enum {
36360   pArcAngle = 'parc',
36361   pBackgroundColor = 'pbcl',
36362   pBackgroundPattern = 'pbpt',
36363   pBestType = 'pbst',
36364   pBounds = 'pbnd',
36365   pClass = 'pcls',
36366   pClipboard = 'pcli',
36367   pColor = 'colr',
36368   pColorTable = 'cltb',
36369   pContents = 'pcnt',
36370   pCornerCurveHeight = 'pchd',
36371   pCornerCurveWidth = 'pcwd',
36372   pDashStyle = 'pdst',
36373   pDefaultType = 'deft',
36374   pDefinitionRect = 'pdrt',
36375   pEnabled = 'enbl',
36376   pEndPoint = 'pend',
36377   pFillColor = 'flcl',
36378   pFillPattern = 'flpt',
36379   pFont = 'font'
36380 };
36381
36382 enum {
36383   pFormula = 'pfor',
36384   pGraphicObjects = 'gobs',
36385   pHasCloseBox = 'hclb',
36386   pHasTitleBar = 'ptit',
36387   pID = 'ID  ',
36388   pIndex = 'pidx',
36389   pInsertionLoc = 'pins',
36390   pIsFloating = 'isfl',
36391   pIsFrontProcess = 'pisf',
36392   pIsModal = 'pmod',
36393   pIsModified = 'imod',
36394   pIsResizable = 'prsz',
36395   pIsStationeryPad = 'pspd',
36396   pIsZoomable = 'iszm',
36397   pIsZoomed = 'pzum',
36398   pItemNumber = 'itmn',
36399   pJustification = 'pjst',
36400   pLineArrow = 'arro',
36401   pMenuID = 'mnid',
36402   pName = 'pnam'
36403 };
36404
36405 enum {
36406   pNewElementLoc = 'pnel',
36407   pPenColor = 'ppcl',
36408   pPenPattern = 'pppa',
36409   pPenWidth = 'ppwd',
36410   pPixelDepth = 'pdpt',
36411   pPointList = 'ptlt',
36412   pPointSize = 'ptsz',
36413   pProtection = 'ppro',
36414   pRotation = 'prot',
36415   pScale = 'pscl',
36416   pScript = 'scpt',
36417   pScriptTag = 'psct',
36418   pSelected = 'selc',
36419   pSelection = 'sele',
36420   pStartAngle = 'pang',
36421   pStartPoint = 'pstp',
36422   pTextColor = 'ptxc',
36423   pTextFont = 'ptxf',
36424   pTextItemDelimiters = 'txdl',
36425   pTextPointSize = 'ptps'
36426 };
36427
36428 enum {
36429   pTextStyles = 'txst',
36430   pTransferMode = 'pptm',
36431   pTranslation = 'ptrs',
36432   pUniformStyles = 'ustl',
36433   pUpdateOn = 'pupd',
36434   pUserSelection = 'pusl',
36435   pVersion = 'vers',
36436   pVisible = 'pvis'
36437 };
36438
36439 enum {
36440   typeAEText = 'tTXT',
36441   typeArc = 'carc',
36442   typeBest = 'best',
36443   typeCell = 'ccel',
36444   typeClassInfo = 'gcli',
36445   typeColorTable = 'clrt',
36446   typeColumn = 'ccol',
36447   typeDashStyle = 'tdas',
36448   typeData = 'tdta',
36449   typeDrawingArea = 'cdrw',
36450   typeElemInfo = 'elin',
36451   typeEnumeration = 'enum',
36452   typeEPS = 'EPS ',
36453   typeEventInfo = 'evin'
36454 };
36455
36456 enum {
36457   typeFinderWindow = 'fwin',
36458   typeFixedPoint = 'fpnt',
36459   typeFixedRectangle = 'frct',
36460   typeGraphicLine = 'glin',
36461   typeGraphicText = 'cgtx',
36462   typeGroupedGraphic = 'cpic',
36463   typeInsertionLoc = 'insl',
36464   typeIntlText = 'itxt',
36465   typeIntlWritingCode = 'intl',
36466   typeLongDateTime = 'ldt ',
36467   typeISO8601DateTime = 'isot',
36468   typeLongFixed = 'lfxd',
36469   typeLongFixedPoint = 'lfpt',
36470   typeLongFixedRectangle = 'lfrc',
36471   typeLongPoint = 'lpnt',
36472   typeLongRectangle = 'lrct',
36473   typeMachineLoc = 'mLoc',
36474   typeOval = 'covl',
36475   typeParamInfo = 'pmin',
36476   typePict = 'PICT'
36477 };
36478
36479 enum {
36480   typePixelMap = 'cpix',
36481   typePixMapMinus = 'tpmm',
36482   typePolygon = 'cpgn',
36483   typePropInfo = 'pinf',
36484   typePtr = 'ptr ',
36485   typeQDPoint = 'QDpt',
36486   typeQDRegion = 'Qrgn',
36487   typeRectangle = 'crec',
36488   typeRGB16 = 'tr16',
36489   typeRGB96 = 'tr96',
36490   typeRGBColor = 'cRGB',
36491   typeRotation = 'trot',
36492   typeRoundedRectangle = 'crrc',
36493   typeRow = 'crow',
36494   typeScrapStyles = 'styl',
36495   typeScript = 'scpt',
36496   typeStyledText = 'STXT',
36497   typeSuiteInfo = 'suin',
36498   typeTable = 'ctbl',
36499   typeTextStyles = 'tsty'
36500 };
36501
36502 enum {
36503   typeTIFF = 'TIFF',
36504   typeVersion = 'vers'
36505 };
36506
36507 enum {
36508   kAEMenuClass = 'menu',
36509   kAEMenuSelect = 'mhit',
36510   kAEMouseDown = 'mdwn',
36511   kAEMouseDownInBack = 'mdbk',
36512   kAEKeyDown = 'kdwn',
36513   kAEResized = 'rsiz',
36514   kAEPromise = 'prom'
36515 };
36516
36517 enum {
36518   keyMenuID = 'mid ',
36519   keyMenuItem = 'mitm',
36520   keyCloseAllWindows = 'caw ',
36521   keyOriginalBounds = 'obnd',
36522   keyNewBounds = 'nbnd',
36523   keyLocalWhere = 'lwhr'
36524 };
36525
36526 enum {
36527   typeHIMenu = 'mobj',
36528   typeHIWindow = 'wobj'
36529 };
36530
36531 enum {
36532   kBySmallIcon = 0,
36533   kByIconView = 1,
36534   kByNameView = 2,
36535   kByDateView = 3,
36536   kBySizeView = 4,
36537   kByKindView = 5,
36538   kByCommentView = 6,
36539   kByLabelView = 7,
36540   kByVersionView = 8
36541 };
36542
36543 enum {
36544   kAEInfo = 11,
36545   kAEMain = 0,
36546   kAESharing = 13
36547 };
36548
36549 enum {
36550   kAEZoomIn = 7,
36551   kAEZoomOut = 8
36552 };
36553
36554 enum {
36555   kTextServiceClass = 'tsvc',
36556   kUpdateActiveInputArea = 'updt',
36557   kShowHideInputWindow = 'shiw',
36558   kPos2Offset = 'p2st',
36559   kOffset2Pos = 'st2p',
36560   kUnicodeNotFromInputMethod = 'unim',
36561   kGetSelectedText = 'gtxt',
36562   keyAETSMDocumentRefcon = 'refc',
36563   keyAEServerInstance = 'srvi',
36564   keyAETheData = 'kdat',
36565   keyAEFixLength = 'fixl',
36566   keyAEUpdateRange = 'udng',
36567   keyAECurrentPoint = 'cpos',
36568   keyAEBufferSize = 'buff',
36569   keyAEMoveView = 'mvvw',
36570   keyAENextBody = 'nxbd',
36571   keyAETSMScriptTag = 'sclg',
36572   keyAETSMTextFont = 'ktxf',
36573   keyAETSMTextFMFont = 'ktxm',
36574   keyAETSMTextPointSize = 'ktps',
36575   keyAETSMEventRecord = 'tevt',
36576   keyAETSMEventRef = 'tevr',
36577   keyAETextServiceEncoding = 'tsen',
36578   keyAETextServiceMacEncoding = 'tmen',
36579   keyAETSMGlyphInfoArray = 'tgia',
36580   typeTextRange = 'txrn',
36581   typeComponentInstance = 'cmpi',
36582   typeOffsetArray = 'ofay',
36583   typeTextRangeArray = 'tray',
36584   typeLowLevelEventRecord = 'evtr',
36585   typeGlyphInfoArray = 'glia',
36586   typeEventRef = 'evrf',
36587   typeText = typeChar
36588 };
36589
36590
36591
36592 enum {
36593   kTSMOutsideOfBody = 1,
36594   kTSMInsideOfBody = 2,
36595   kTSMInsideOfActiveInputArea = 3
36596 };
36597
36598 enum {
36599   kNextBody = 1,
36600   kPreviousBody = 2
36601 };
36602
36603 struct TextRange {
36604   long fStart;
36605   long fEnd;
36606   short fHiliteStyle;
36607 };
36608 typedef struct TextRange TextRange;
36609 typedef TextRange * TextRangePtr;
36610 typedef TextRangePtr * TextRangeHandle;
36611 struct TextRangeArray {
36612   short fNumOfRanges;
36613   TextRange fRange[1];
36614 };
36615 typedef struct TextRangeArray TextRangeArray;
36616 typedef TextRangeArray * TextRangeArrayPtr;
36617 typedef TextRangeArrayPtr * TextRangeArrayHandle;
36618 struct OffsetArray {
36619   short fNumOfOffsets;
36620   long fOffset[1];
36621 };
36622 typedef struct OffsetArray OffsetArray;
36623 typedef OffsetArray * OffsetArrayPtr;
36624 typedef OffsetArrayPtr * OffsetArrayHandle;
36625 struct WritingCode {
36626   ScriptCode theScriptCode;
36627   LangCode theLangCode;
36628 };
36629 typedef struct WritingCode WritingCode;
36630 struct IntlText {
36631   ScriptCode theScriptCode;
36632   LangCode theLangCode;
36633   char theText[1];
36634 };
36635 typedef struct IntlText IntlText;
36636
36637
36638 enum {
36639   kCaretPosition = 1,
36640   kRawText = 2,
36641   kSelectedRawText = 3,
36642   kConvertedText = 4,
36643   kSelectedConvertedText = 5,
36644   kBlockFillText = 6,
36645   kOutlineText = 7,
36646   kSelectedText = 8
36647 };
36648
36649 enum {
36650   keyAEHiliteRange = 'hrng',
36651   keyAEPinRange = 'pnrg',
36652   keyAEClauseOffsets = 'clau',
36653   keyAEOffset = 'ofst',
36654   keyAEPoint = 'gpos',
36655   keyAELeftSide = 'klef',
36656   keyAERegionClass = 'rgnc',
36657   keyAEDragging = 'bool'
36658 };
36659 enum {
36660
36661   typeUnicodeText = 'utxt',
36662   typeStyledUnicodeText = 'sutx',
36663   typeUTF8Text = 'utf8',
36664   typeEncodedString = 'encs',
36665   typeCString = 'cstr',
36666   typePString = 'pstr'
36667 };
36668
36669 enum {
36670
36671   typeMeters = 'metr',
36672   typeInches = 'inch',
36673   typeFeet = 'feet',
36674   typeYards = 'yard',
36675   typeMiles = 'mile',
36676   typeKilometers = 'kmtr',
36677   typeCentimeters = 'cmtr',
36678   typeSquareMeters = 'sqrm',
36679   typeSquareFeet = 'sqft',
36680   typeSquareYards = 'sqyd',
36681   typeSquareMiles = 'sqmi',
36682   typeSquareKilometers = 'sqkm',
36683   typeLiters = 'litr',
36684   typeQuarts = 'qrts',
36685   typeGallons = 'galn',
36686   typeCubicMeters = 'cmet',
36687   typeCubicFeet = 'cfet',
36688   typeCubicInches = 'cuin',
36689   typeCubicCentimeter = 'ccmt',
36690   typeCubicYards = 'cyrd',
36691   typeKilograms = 'kgrm',
36692   typeGrams = 'gram',
36693   typeOunces = 'ozs ',
36694   typePounds = 'lbs ',
36695   typeDegreesC = 'degc',
36696   typeDegreesF = 'degf',
36697   typeDegreesK = 'degk'
36698 };
36699
36700 enum {
36701
36702   kFAServerApp = 'ssrv',
36703   kDoFolderActionEvent = 'fola',
36704   kFolderActionCode = 'actn',
36705   kFolderOpenedEvent = 'fopn',
36706   kFolderClosedEvent = 'fclo',
36707   kFolderWindowMovedEvent = 'fsiz',
36708   kFolderItemsAddedEvent = 'fget',
36709   kFolderItemsRemovedEvent = 'flos',
36710   kItemList = 'flst',
36711   kNewSizeParameter = 'fnsz',
36712   kFASuiteCode = 'faco',
36713   kFAAttachCommand = 'atfa',
36714   kFARemoveCommand = 'rmfa',
36715   kFAEditCommand = 'edfa',
36716   kFAFileParam = 'faal',
36717   kFAIndexParam = 'indx'
36718 };
36719
36720
36721 enum {
36722
36723   kAEInternetSuite = 'gurl',
36724   kAEISWebStarSuite = 'WWW½'
36725 };
36726
36727 enum {
36728
36729   kAEISGetURL = 'gurl',
36730   KAEISHandleCGI = 'sdoc'
36731 };
36732
36733 enum {
36734
36735   cURL = 'url ',
36736   cInternetAddress = 'IPAD',
36737   cHTML = 'html',
36738   cFTPItem = 'ftp '
36739 };
36740
36741 enum {
36742
36743   kAEISHTTPSearchArgs = 'kfor',
36744   kAEISPostArgs = 'post',
36745   kAEISMethod = 'meth',
36746   kAEISClientAddress = 'addr',
36747   kAEISUserName = 'user',
36748   kAEISPassword = 'pass',
36749   kAEISFromUser = 'frmu',
36750   kAEISServerName = 'svnm',
36751   kAEISServerPort = 'svpt',
36752   kAEISScriptName = 'scnm',
36753   kAEISContentType = 'ctyp',
36754   kAEISReferrer = 'refr',
36755   kAEISUserAgent = 'Agnt',
36756   kAEISAction = 'Kact',
36757   kAEISActionPath = 'Kapt',
36758   kAEISClientIP = 'Kcip',
36759   kAEISFullRequest = 'Kfrq'
36760 };
36761
36762 enum {
36763
36764   pScheme = 'pusc',
36765   pHost = 'HOST',
36766   pPath = 'FTPc',
36767   pUserName = 'RAun',
36768   pUserPassword = 'RApw',
36769   pDNSForm = 'pDNS',
36770   pURL = 'pURL',
36771   pTextEncoding = 'ptxe',
36772   pFTPKind = 'kind'
36773 };
36774
36775 enum {
36776
36777   eScheme = 'esch',
36778   eurlHTTP = 'http',
36779   eurlHTTPS = 'htps',
36780   eurlFTP = 'ftp ',
36781   eurlMail = 'mail',
36782   eurlFile = 'file',
36783   eurlGopher = 'gphr',
36784   eurlTelnet = 'tlnt',
36785   eurlNews = 'news',
36786   eurlSNews = 'snws',
36787   eurlNNTP = 'nntp',
36788   eurlMessage = 'mess',
36789   eurlMailbox = 'mbox',
36790   eurlMulti = 'mult',
36791   eurlLaunch = 'laun',
36792   eurlAFP = 'afp ',
36793   eurlAT = 'at  ',
36794   eurlEPPC = 'eppc',
36795   eurlRTSP = 'rtsp',
36796   eurlIMAP = 'imap',
36797   eurlNFS = 'unfs',
36798   eurlPOP = 'upop',
36799   eurlLDAP = 'uldp',
36800   eurlUnknown = 'url?'
36801 };
36802
36803 enum {
36804
36805   kConnSuite = 'macc',
36806   cDevSpec = 'cdev',
36807   cAddressSpec = 'cadr',
36808   cADBAddress = 'cadb',
36809   cAppleTalkAddress = 'cat ',
36810   cBusAddress = 'cbus',
36811   cEthernetAddress = 'cen ',
36812   cFireWireAddress = 'cfw ',
36813   cIPAddress = 'cip ',
36814   cLocalTalkAddress = 'clt ',
36815   cSCSIAddress = 'cscs',
36816   cTokenRingAddress = 'ctok',
36817   cUSBAddress = 'cusb',
36818
36819   pDeviceType = 'pdvt',
36820   pDeviceAddress = 'pdva',
36821   pConduit = 'pcon',
36822   pProtocol = 'pprt',
36823   pATMachine = 'patm',
36824   pATZone = 'patz',
36825   pATType = 'patt',
36826   pDottedDecimal = 'pipd',
36827   pDNS = 'pdns',
36828   pPort = 'ppor',
36829   pNetwork = 'pnet',
36830   pNode = 'pnod',
36831   pSocket = 'psoc',
36832   pSCSIBus = 'pscb',
36833   pSCSILUN = 'pslu',
36834
36835   eDeviceType = 'edvt',
36836   eAddressSpec = 'eads',
36837   eConduit = 'econ',
36838   eProtocol = 'epro',
36839   eADB = 'eadb',
36840   eAnalogAudio = 'epau',
36841   eAppleTalk = 'epat',
36842   eAudioLineIn = 'ecai',
36843   eAudioLineOut = 'ecal',
36844   eAudioOut = 'ecao',
36845   eBus = 'ebus',
36846   eCDROM = 'ecd ',
36847   eCommSlot = 'eccm',
36848   eDigitalAudio = 'epda',
36849   eDisplay = 'edds',
36850   eDVD = 'edvd',
36851   eEthernet = 'ecen',
36852   eFireWire = 'ecfw',
36853   eFloppy = 'efd ',
36854   eHD = 'ehd ',
36855   eInfrared = 'ecir',
36856   eIP = 'epip',
36857   eIrDA = 'epir',
36858   eIRTalk = 'epit',
36859   eKeyboard = 'ekbd',
36860   eLCD = 'edlc',
36861   eLocalTalk = 'eclt',
36862   eMacIP = 'epmi',
36863   eMacVideo = 'epmv',
36864   eMicrophone = 'ecmi',
36865   eModemPort = 'ecmp',
36866   eModemPrinterPort = 'empp',
36867   eModem = 'edmm',
36868   eMonitorOut = 'ecmn',
36869   eMouse = 'emou',
36870   eNuBusCard = 'ednb',
36871   eNuBus = 'enub',
36872   ePCcard = 'ecpc',
36873   ePCIbus = 'ecpi',
36874   ePCIcard = 'edpi',
36875   ePDSslot = 'ecpd',
36876   ePDScard = 'epds',
36877   ePointingDevice = 'edpd',
36878   ePostScript = 'epps',
36879   ePPP = 'eppp',
36880   ePrinterPort = 'ecpp',
36881   ePrinter = 'edpr',
36882   eSvideo = 'epsv',
36883   eSCSI = 'ecsc',
36884   eSerial = 'epsr',
36885   eSpeakers = 'edsp',
36886   eStorageDevice = 'edst',
36887   eSVGA = 'epsg',
36888   eTokenRing = 'etok',
36889   eTrackball = 'etrk',
36890   eTrackpad = 'edtp',
36891   eUSB = 'ecus',
36892   eVideoIn = 'ecvi',
36893   eVideoMonitor = 'edvm',
36894   eVideoOut = 'ecvo'
36895 };
36896
36897 enum {
36898
36899   cKeystroke = 'kprs',
36900   pKeystrokeKey = 'kMsg',
36901   pModifiers = 'kMod',
36902   pKeyKind = 'kknd',
36903   eModifiers = 'eMds',
36904   eOptionDown = 'Kopt',
36905   eCommandDown = 'Kcmd',
36906   eControlDown = 'Kctl',
36907   eShiftDown = 'Ksft',
36908   eCapsLockDown = 'Kclk',
36909   eKeyKind = 'ekst',
36910
36911   eEscapeKey = 0x6B733500,
36912   eDeleteKey = 0x6B733300,
36913   eTabKey = 0x6B733000,
36914   eReturnKey = 0x6B732400,
36915   eClearKey = 0x6B734700,
36916   eEnterKey = 0x6B734C00,
36917   eUpArrowKey = 0x6B737E00,
36918   eDownArrowKey = 0x6B737D00,
36919   eLeftArrowKey = 0x6B737B00,
36920   eRightArrowKey = 0x6B737C00,
36921   eHelpKey = 0x6B737200,
36922   eHomeKey = 0x6B737300,
36923   ePageUpKey = 0x6B737400,
36924   ePageDownKey = 0x6B737900,
36925   eForwardDelKey = 0x6B737500,
36926   eEndKey = 0x6B737700,
36927   eF1Key = 0x6B737A00,
36928   eF2Key = 0x6B737800,
36929   eF3Key = 0x6B736300,
36930   eF4Key = 0x6B737600,
36931   eF5Key = 0x6B736000,
36932   eF6Key = 0x6B736100,
36933   eF7Key = 0x6B736200,
36934   eF8Key = 0x6B736400,
36935   eF9Key = 0x6B736500,
36936   eF10Key = 0x6B736D00,
36937   eF11Key = 0x6B736700,
36938   eF12Key = 0x6B736F00,
36939   eF13Key = 0x6B736900,
36940   eF14Key = 0x6B736B00,
36941   eF15Key = 0x6B737100
36942 };
36943
36944
36945
36946
36947
36948
36949 enum {
36950   kAEUserTerminology = 'aeut',
36951   kAETerminologyExtension = 'aete',
36952   kAEScriptingSizeResource = 'scsz',
36953   kAEOSAXSizeResource = 'osiz'
36954 };
36955
36956 enum {
36957   kAEUTHasReturningParam = 31,
36958   kAEUTOptional = 15,
36959   kAEUTlistOfItems = 14,
36960   kAEUTEnumerated = 13,
36961   kAEUTReadWrite = 12,
36962   kAEUTChangesState = 12,
36963   kAEUTTightBindingFunction = 12,
36964
36965   kAEUTEnumsAreTypes = 11,
36966   kAEUTEnumListIsExclusive = 10,
36967   kAEUTReplyIsReference = 9,
36968   kAEUTDirectParamIsReference = 9,
36969   kAEUTParamIsReference = 9,
36970   kAEUTPropertyIsReference = 9,
36971   kAEUTNotDirectParamIsTarget = 8,
36972   kAEUTParamIsTarget = 8,
36973   kAEUTApostrophe = 3,
36974   kAEUTFeminine = 2,
36975   kAEUTMasculine = 1,
36976   kAEUTPlural = 0
36977 };
36978
36979 struct TScriptingSizeResource {
36980   short scriptingSizeFlags;
36981   unsigned long minStackSize;
36982   unsigned long preferredStackSize;
36983   unsigned long maxStackSize;
36984   unsigned long minHeapSize;
36985   unsigned long preferredHeapSize;
36986   unsigned long maxHeapSize;
36987 };
36988 typedef struct TScriptingSizeResource TScriptingSizeResource;
36989 enum {
36990   kLaunchToGetTerminology = (1 << 15),
36991   kDontFindAppBySignature = (1 << 14),
36992   kAlwaysSendSubject = (1 << 13)
36993 };
36994
36995
36996 enum {
36997   kReadExtensionTermsMask = (1 << 15)
36998 };
36999
37000 enum {
37001
37002
37003   kOSIZDontOpenResourceFile = 15,
37004   kOSIZdontAcceptRemoteEvents = 14,
37005   kOSIZOpenWithReadPermission = 13,
37006   kOSIZCodeInSharedLibraries = 11
37007 };
37008
37009
37010
37011
37012
37013 extern "C" {
37014
37015
37016 typedef UInt32 AEBuildErrorCode;
37017 enum {
37018   aeBuildSyntaxNoErr = 0,
37019   aeBuildSyntaxBadToken = 1,
37020   aeBuildSyntaxBadEOF = 2,
37021   aeBuildSyntaxNoEOF = 3,
37022   aeBuildSyntaxBadNegative = 4,
37023   aeBuildSyntaxMissingQuote = 5,
37024   aeBuildSyntaxBadHex = 6,
37025   aeBuildSyntaxOddHex = 7,
37026   aeBuildSyntaxNoCloseHex = 8,
37027   aeBuildSyntaxUncoercedHex = 9,
37028   aeBuildSyntaxNoCloseString = 10,
37029   aeBuildSyntaxBadDesc = 11,
37030   aeBuildSyntaxBadData = 12,
37031   aeBuildSyntaxNoCloseParen = 13,
37032   aeBuildSyntaxNoCloseBracket = 14,
37033   aeBuildSyntaxNoCloseBrace = 15,
37034   aeBuildSyntaxNoKey = 16,
37035   aeBuildSyntaxNoColon = 17,
37036   aeBuildSyntaxCoercedList = 18,
37037   aeBuildSyntaxUncoercedDoubleAt = 19
37038 };
37039
37040
37041
37042 struct AEBuildError {
37043   AEBuildErrorCode fError;
37044   UInt32 fErrorPos;
37045 };
37046 typedef struct AEBuildError AEBuildError;
37047 extern OSStatus
37048 AEBuildDesc(
37049   AEDesc * dst,
37050   AEBuildError * error,
37051   const char * src,
37052   ...) ;
37053 extern OSStatus
37054 vAEBuildDesc(
37055   AEDesc * dst,
37056   AEBuildError * error,
37057   const char * src,
37058   va_list args) ;
37059 extern OSStatus
37060 AEBuildParameters(
37061   AppleEvent * event,
37062   AEBuildError * error,
37063   const char * format,
37064   ...) ;
37065 extern OSStatus
37066 vAEBuildParameters(
37067   AppleEvent * event,
37068   AEBuildError * error,
37069   const char * format,
37070   va_list args) ;
37071 extern OSStatus
37072 AEBuildAppleEvent(
37073   AEEventClass theClass,
37074   AEEventID theID,
37075   DescType addressType,
37076   const void * addressData,
37077   long addressLength,
37078   short returnID,
37079   long transactionID,
37080   AppleEvent * result,
37081   AEBuildError * error,
37082   const char * paramsFmt,
37083   ...) ;
37084 extern OSStatus
37085 vAEBuildAppleEvent(
37086   AEEventClass theClass,
37087   AEEventID theID,
37088   DescType addressType,
37089   const void * addressData,
37090   long addressLength,
37091   short returnID,
37092   long transactionID,
37093   AppleEvent * resultEvt,
37094   AEBuildError * error,
37095   const char * paramsFmt,
37096   va_list args) ;
37097 extern OSStatus
37098 AEPrintDescToHandle(
37099   const AEDesc * desc,
37100   Handle * result) ;
37101 typedef struct OpaqueAEStreamRef* AEStreamRef;
37102 extern AEStreamRef
37103 AEStreamOpen(void) ;
37104 extern OSStatus
37105 AEStreamClose(
37106   AEStreamRef ref,
37107   AEDesc * desc) ;
37108 extern OSStatus
37109 AEStreamOpenDesc(
37110   AEStreamRef ref,
37111   DescType newType) ;
37112 extern OSStatus
37113 AEStreamWriteData(
37114   AEStreamRef ref,
37115   const void * data,
37116   Size length) ;
37117 extern OSStatus
37118 AEStreamCloseDesc(AEStreamRef ref) ;
37119 extern OSStatus
37120 AEStreamWriteDesc(
37121   AEStreamRef ref,
37122   DescType newType,
37123   const void * data,
37124   Size length) ;
37125 extern OSStatus
37126 AEStreamWriteAEDesc(
37127   AEStreamRef ref,
37128   const AEDesc * desc) ;
37129 extern OSStatus
37130 AEStreamOpenList(AEStreamRef ref) ;
37131 extern OSStatus
37132 AEStreamCloseList(AEStreamRef ref) ;
37133 extern OSStatus
37134 AEStreamOpenRecord(
37135   AEStreamRef ref,
37136   DescType newType) ;
37137 extern OSStatus
37138 AEStreamSetRecordType(
37139   AEStreamRef ref,
37140   DescType newType) ;
37141 extern OSStatus
37142 AEStreamCloseRecord(AEStreamRef ref) ;
37143 extern OSStatus
37144 AEStreamWriteKeyDesc(
37145   AEStreamRef ref,
37146   AEKeyword key,
37147   DescType newType,
37148   const void * data,
37149   Size length) ;
37150 extern OSStatus
37151 AEStreamOpenKeyDesc(
37152   AEStreamRef ref,
37153   AEKeyword key,
37154   DescType newType) ;
37155 extern OSStatus
37156 AEStreamWriteKey(
37157   AEStreamRef ref,
37158   AEKeyword key) ;
37159 extern AEStreamRef
37160 AEStreamCreateEvent(
37161   AEEventClass clazz,
37162   AEEventID id,
37163   DescType targetType,
37164   const void * targetData,
37165   long targetLength,
37166   short returnID,
37167   long transactionID) ;
37168 extern AEStreamRef
37169 AEStreamOpenEvent(AppleEvent * event) ;
37170 extern OSStatus
37171 AEStreamOptionalParam(
37172   AEStreamRef ref,
37173   AEKeyword key) ;
37174
37175
37176
37177
37178
37179 }
37180
37181
37182
37183 extern "C" {
37184 enum {
37185   keyReplyPortAttr = 'repp'
37186 };
37187
37188
37189 enum {
37190   typeReplyPortAttr = keyReplyPortAttr
37191 };
37192
37193
37194
37195
37196
37197 }
37198
37199
37200
37201
37202 extern "C" {
37203
37204
37205 extern OSStatus
37206 StandardGlyphs(
37207   void * dataStream,
37208   ByteCount size) ;
37209
37210
37211
37212 enum {
37213
37214   leftCaret = 0,
37215   rightCaret = -1,
37216   kHilite = 1
37217 };
37218
37219 enum {
37220   smLeftCaret = 0,
37221   smRightCaret = -1,
37222   smHilite = 1
37223 };
37224
37225 enum {
37226
37227   onlyStyleRun = 0,
37228   leftStyleRun = 1,
37229   rightStyleRun = 2,
37230   middleStyleRun = 3,
37231   smOnlyStyleRun = 0,
37232   smLeftStyleRun = 1,
37233   smRightStyleRun = 2,
37234   smMiddleStyleRun = 3
37235 };
37236
37237
37238 typedef short JustStyleCode;
37239
37240 typedef short TruncCode;
37241 enum {
37242
37243   truncEnd = 0,
37244   truncMiddle = 0x4000,
37245   smTruncEnd = 0,
37246   smTruncMiddle = 0x4000
37247 };
37248
37249 enum {
37250
37251   notTruncated = 0,
37252   truncated = 1,
37253   truncErr = -1,
37254   smNotTruncated = 0,
37255   smTruncated = 1,
37256   smTruncErr = -1
37257 };
37258
37259 typedef SInt8 StyledLineBreakCode;
37260 enum {
37261   smBreakWord = 0,
37262   smBreakChar = 1,
37263   smBreakOverflow = 2
37264 };
37265
37266
37267 enum {
37268
37269   tfAntiAlias = 1 << 0,
37270   tfUnicode = 1 << 1
37271 };
37272
37273
37274 struct FontInfo {
37275   short ascent;
37276   short descent;
37277   short widMax;
37278   short leading;
37279 };
37280 typedef struct FontInfo FontInfo;
37281
37282 typedef short FormatOrder[1];
37283 typedef FormatOrder * FormatOrderPtr;
37284
37285
37286
37287 typedef Boolean ( * StyleRunDirectionProcPtr)(short styleRunIndex, void *dirParam);
37288 typedef StyleRunDirectionProcPtr StyleRunDirectionUPP;
37289 extern StyleRunDirectionUPP
37290 NewStyleRunDirectionUPP(StyleRunDirectionProcPtr userRoutine) ;
37291 extern void
37292 DisposeStyleRunDirectionUPP(StyleRunDirectionUPP userUPP) ;
37293 extern Boolean
37294 InvokeStyleRunDirectionUPP(
37295   short styleRunIndex,
37296   void * dirParam,
37297   StyleRunDirectionUPP userUPP) ;
37298 extern short
37299 PixelToChar(
37300   Ptr textBuf,
37301   long textLength,
37302   Fixed slop,
37303   Fixed pixelWidth,
37304   Boolean * leadingEdge,
37305   Fixed * widthRemaining,
37306   JustStyleCode styleRunPosition,
37307   Point numer,
37308   Point denom) ;
37309 extern short
37310 CharToPixel(
37311   Ptr textBuf,
37312   long textLength,
37313   Fixed slop,
37314   long offset,
37315   short direction,
37316   JustStyleCode styleRunPosition,
37317   Point numer,
37318   Point denom) ;
37319 extern void
37320 DrawJustified(
37321   Ptr textPtr,
37322   long textLength,
37323   Fixed slop,
37324   JustStyleCode styleRunPosition,
37325   Point numer,
37326   Point denom) ;
37327 extern void
37328 MeasureJustified(
37329   Ptr textPtr,
37330   long textLength,
37331   Fixed slop,
37332   Ptr charLocs,
37333   JustStyleCode styleRunPosition,
37334   Point numer,
37335   Point denom) ;
37336 extern Fixed
37337 PortionLine(
37338   Ptr textPtr,
37339   long textLen,
37340   JustStyleCode styleRunPosition,
37341   Point numer,
37342   Point denom) ;
37343 extern void
37344 HiliteText(
37345   Ptr textPtr,
37346   short textLength,
37347   short firstOffset,
37348   short secondOffset,
37349   OffsetTable offsets) ;
37350 extern long
37351 VisibleLength(
37352   Ptr textPtr,
37353   long textLength) ;
37354 extern void
37355 GetFormatOrder(
37356   FormatOrderPtr ordering,
37357   short firstFormat,
37358   short lastFormat,
37359   Boolean lineRight,
37360   StyleRunDirectionUPP rlDirProc,
37361   Ptr dirParam) ;
37362 extern void
37363 TextFont(short font) ;
37364 extern void
37365 TextFace(StyleParameter face) ;
37366 extern void
37367 TextMode(short mode) ;
37368 extern void
37369 TextSize(short size) ;
37370 extern void
37371 SpaceExtra(Fixed extra) ;
37372 extern void
37373 DrawChar(CharParameter ch) ;
37374 extern void
37375 DrawString(ConstStr255Param s) ;
37376 extern void
37377 DrawText(
37378   const void * textBuf,
37379   short firstByte,
37380   short byteCount) ;
37381 extern short
37382 CharWidth(CharParameter ch) ;
37383 extern short
37384 StringWidth(ConstStr255Param s) ;
37385 extern short
37386 TextWidth(
37387   const void * textBuf,
37388   short firstByte,
37389   short byteCount) ;
37390 extern void
37391 MeasureText(
37392   short count,
37393   const void * textAddr,
37394   void * charLocs) ;
37395 extern void
37396 GetFontInfo(FontInfo * info) ;
37397 extern void
37398 CharExtra(Fixed extra) ;
37399 extern void
37400 StdText(
37401   short count,
37402   const void * textAddr,
37403   Point numer,
37404   Point denom) ;
37405 extern short
37406 StdTxMeas(
37407   short byteCount,
37408   const void * textAddr,
37409   Point * numer,
37410   Point * denom,
37411   FontInfo * info) ;
37412 extern StyledLineBreakCode
37413 StyledLineBreak(
37414   Ptr textPtr,
37415   long textLen,
37416   long textStart,
37417   long textEnd,
37418   long flags,
37419   Fixed * textWidth,
37420   long * textOffset) ;
37421 extern short
37422 TruncString(
37423   short width,
37424   Str255 theString,
37425   TruncCode truncWhere) ;
37426 extern short
37427 TruncText(
37428   short width,
37429   Ptr textPtr,
37430   short * length,
37431   TruncCode truncWhere) ;
37432 extern void
37433 stdtext(
37434   short count,
37435   const void * textAddr,
37436   const Point * numer,
37437   const Point * denom) ;
37438 extern UInt32
37439 SwapQDTextFlags(UInt32 newFlags) ;
37440
37441
37442 }
37443 extern "C" {
37444
37445
37446
37447 enum {
37448   invalColReq = -1
37449 };
37450
37451 enum {
37452
37453   srcCopy = 0,
37454   srcOr = 1,
37455   srcXor = 2,
37456   srcBic = 3,
37457   notSrcCopy = 4,
37458   notSrcOr = 5,
37459   notSrcXor = 6,
37460   notSrcBic = 7,
37461   patCopy = 8,
37462   patOr = 9,
37463   patXor = 10,
37464   patBic = 11,
37465   notPatCopy = 12,
37466   notPatOr = 13,
37467   notPatXor = 14,
37468   notPatBic = 15,
37469   grayishTextOr = 49,
37470   hilitetransfermode = 50,
37471   hilite = 50,
37472   blend = 32,
37473   addPin = 33,
37474   addOver = 34,
37475   subPin = 35,
37476   addMax = 37,
37477   adMax = 37,
37478   subOver = 38,
37479   adMin = 39,
37480   ditherCopy = 64,
37481   transparent = 36
37482 };
37483
37484 enum {
37485   italicBit = 1,
37486   ulineBit = 2,
37487   outlineBit = 3,
37488   shadowBit = 4,
37489   condenseBit = 5,
37490   extendBit = 6
37491 };
37492
37493 enum {
37494
37495   normalBit = 0,
37496   inverseBit = 1,
37497   redBit = 4,
37498   greenBit = 3,
37499   blueBit = 2,
37500   cyanBit = 8,
37501   magentaBit = 7,
37502   yellowBit = 6,
37503   blackBit = 5
37504 };
37505
37506 enum {
37507   blackColor = 33,
37508   whiteColor = 30,
37509   redColor = 205,
37510   greenColor = 341,
37511   blueColor = 409,
37512   cyanColor = 273,
37513   magentaColor = 137,
37514   yellowColor = 69
37515 };
37516
37517 enum {
37518   picLParen = 0,
37519   picRParen = 1,
37520   clutType = 0,
37521   fixedType = 1,
37522   directType = 2,
37523   gdDevType = 0
37524 };
37525
37526 enum {
37527   interlacedDevice = 2,
37528   hwMirroredDevice = 4,
37529   roundedDevice = 5,
37530   hasAuxMenuBar = 6,
37531   burstDevice = 7,
37532   ext32Device = 8,
37533   ramInit = 10,
37534   mainScreen = 11,
37535   allInit = 12,
37536   screenDevice = 13,
37537   noDriver = 14,
37538   screenActive = 15,
37539   hiliteBit = 7,
37540   pHiliteBit = 0,
37541   defQDColors = 127,
37542
37543   RGBDirect = 16,
37544
37545   baseAddr32 = 4
37546 };
37547
37548
37549 enum {
37550   sysPatListID = 0,
37551   iBeamCursor = 1,
37552   crossCursor = 2,
37553   plusCursor = 3,
37554   watchCursor = 4
37555 };
37556
37557 enum {
37558   kQDGrafVerbFrame = 0,
37559   kQDGrafVerbPaint = 1,
37560   kQDGrafVerbErase = 2,
37561   kQDGrafVerbInvert = 3,
37562   kQDGrafVerbFill = 4
37563 };
37564 typedef SInt8 GrafVerb;
37565 enum {
37566   chunky = 0,
37567   chunkyPlanar = 1,
37568   planar = 2
37569 };
37570
37571 typedef SInt8 PixelType;
37572 typedef short Bits16[16];
37573 struct Pattern {
37574   UInt8 pat[8];
37575 };
37576 typedef struct Pattern Pattern;
37577
37578
37579
37580
37581
37582 typedef const Pattern * ConstPatternParam;
37583 typedef Pattern * PatPtr;
37584 typedef PatPtr * PatHandle;
37585 typedef SignedByte QDByte;
37586 typedef QDByte * QDPtr;
37587 typedef QDPtr * QDHandle;
37588 typedef short QDErr;
37589 enum {
37590   singleDevicesBit = 0,
37591   dontMatchSeedsBit = 1,
37592   allDevicesBit = 2
37593 };
37594
37595 enum {
37596   singleDevices = 1 << singleDevicesBit,
37597   dontMatchSeeds = 1 << dontMatchSeedsBit,
37598   allDevices = 1 << allDevicesBit
37599 };
37600
37601 typedef unsigned long DeviceLoopFlags;
37602
37603
37604
37605 typedef SInt32 PrinterStatusOpcode;
37606 enum {
37607   kPrinterFontStatus = 0,
37608   kPrinterScalingStatus = 1
37609 };
37610
37611 struct PrinterFontStatus {
37612   SInt32 oResult;
37613   SInt16 iFondID;
37614   Style iStyle;
37615 };
37616 typedef struct PrinterFontStatus PrinterFontStatus;
37617 struct PrinterScalingStatus {
37618   Point oScalingFactors;
37619 };
37620 typedef struct PrinterScalingStatus PrinterScalingStatus;
37621 struct BitMap {
37622   Ptr baseAddr;
37623   short rowBytes;
37624   Rect bounds;
37625 };
37626 typedef struct BitMap BitMap;
37627 typedef BitMap * BitMapPtr;
37628 typedef BitMapPtr * BitMapHandle;
37629 struct Cursor {
37630   Bits16 data;
37631   Bits16 mask;
37632   Point hotSpot;
37633 };
37634 typedef struct Cursor Cursor;
37635 typedef Cursor * CursPtr;
37636 typedef CursPtr * CursHandle;
37637 struct PenState {
37638   Point pnLoc;
37639   Point pnSize;
37640   short pnMode;
37641   Pattern pnPat;
37642 };
37643 typedef struct PenState PenState;
37644 typedef struct OpaqueRgnHandle* RgnHandle;
37645
37646
37647 struct Picture {
37648   short picSize;
37649   Rect picFrame;
37650 };
37651 typedef struct Picture Picture;
37652 typedef Picture * PicPtr;
37653 typedef PicPtr * PicHandle;
37654 struct MacPolygon {
37655   short polySize;
37656   Rect polyBBox;
37657   Point polyPoints[1];
37658 };
37659 typedef struct MacPolygon MacPolygon;
37660
37661
37662
37663
37664 typedef MacPolygon Polygon;
37665 typedef MacPolygon * PolyPtr;
37666 typedef PolyPtr * PolyHandle;
37667 typedef void ( * QDTextProcPtr)(short byteCount, const void *textBuf, Point numer, Point denom);
37668 typedef void ( * QDLineProcPtr)(Point newPt);
37669 typedef void ( * QDRectProcPtr)(GrafVerb verb, const Rect *r);
37670 typedef void ( * QDRRectProcPtr)(GrafVerb verb, const Rect *r, short ovalWidth, short ovalHeight);
37671 typedef void ( * QDOvalProcPtr)(GrafVerb verb, const Rect *r);
37672 typedef void ( * QDArcProcPtr)(GrafVerb verb, const Rect *r, short startAngle, short arcAngle);
37673 typedef void ( * QDPolyProcPtr)(GrafVerb verb, PolyHandle poly);
37674 typedef void ( * QDRgnProcPtr)(GrafVerb verb, RgnHandle rgn);
37675 typedef void ( * QDBitsProcPtr)(const BitMap *srcBits, const Rect *srcRect, const Rect *dstRect, short mode, RgnHandle maskRgn);
37676 typedef void ( * QDCommentProcPtr)(short kind, short dataSize, Handle dataHandle);
37677 typedef short ( * QDTxMeasProcPtr)(short byteCount, const void *textAddr, Point *numer, Point *denom, FontInfo *info);
37678 typedef void ( * QDGetPicProcPtr)(void *dataPtr, short byteCount);
37679 typedef void ( * QDPutPicProcPtr)(const void *dataPtr, short byteCount);
37680 typedef void ( * QDOpcodeProcPtr)(const Rect *fromRect, const Rect *toRect, UInt16 opcode, SInt16 version);
37681 typedef OSStatus ( * QDStdGlyphsProcPtr)(void *dataStream, ByteCount size);
37682 typedef void ( * QDJShieldCursorProcPtr)(short left, short top, short right, short bottom);
37683 typedef QDTextProcPtr QDTextUPP;
37684 typedef QDLineProcPtr QDLineUPP;
37685 typedef QDRectProcPtr QDRectUPP;
37686 typedef QDRRectProcPtr QDRRectUPP;
37687 typedef QDOvalProcPtr QDOvalUPP;
37688 typedef QDArcProcPtr QDArcUPP;
37689 typedef QDPolyProcPtr QDPolyUPP;
37690 typedef QDRgnProcPtr QDRgnUPP;
37691 typedef QDBitsProcPtr QDBitsUPP;
37692 typedef QDCommentProcPtr QDCommentUPP;
37693 typedef QDTxMeasProcPtr QDTxMeasUPP;
37694 typedef QDGetPicProcPtr QDGetPicUPP;
37695 typedef QDPutPicProcPtr QDPutPicUPP;
37696 typedef QDOpcodeProcPtr QDOpcodeUPP;
37697 typedef QDStdGlyphsProcPtr QDStdGlyphsUPP;
37698 typedef QDJShieldCursorProcPtr QDJShieldCursorUPP;
37699 struct QDProcs {
37700   QDTextUPP textProc;
37701   QDLineUPP lineProc;
37702   QDRectUPP rectProc;
37703   QDRRectUPP rRectProc;
37704   QDOvalUPP ovalProc;
37705   QDArcUPP arcProc;
37706   QDPolyUPP polyProc;
37707   QDRgnUPP rgnProc;
37708   QDBitsUPP bitsProc;
37709   QDCommentUPP commentProc;
37710   QDTxMeasUPP txMeasProc;
37711   QDGetPicUPP getPicProc;
37712   QDPutPicUPP putPicProc;
37713 };
37714 typedef struct QDProcs QDProcs;
37715 typedef QDProcs * QDProcsPtr;
37716 extern QDTextUPP
37717 NewQDTextUPP(QDTextProcPtr userRoutine) ;
37718 extern QDLineUPP
37719 NewQDLineUPP(QDLineProcPtr userRoutine) ;
37720 extern QDRectUPP
37721 NewQDRectUPP(QDRectProcPtr userRoutine) ;
37722 extern QDRRectUPP
37723 NewQDRRectUPP(QDRRectProcPtr userRoutine) ;
37724 extern QDOvalUPP
37725 NewQDOvalUPP(QDOvalProcPtr userRoutine) ;
37726 extern QDArcUPP
37727 NewQDArcUPP(QDArcProcPtr userRoutine) ;
37728 extern QDPolyUPP
37729 NewQDPolyUPP(QDPolyProcPtr userRoutine) ;
37730 extern QDRgnUPP
37731 NewQDRgnUPP(QDRgnProcPtr userRoutine) ;
37732 extern QDBitsUPP
37733 NewQDBitsUPP(QDBitsProcPtr userRoutine) ;
37734 extern QDCommentUPP
37735 NewQDCommentUPP(QDCommentProcPtr userRoutine) ;
37736 extern QDTxMeasUPP
37737 NewQDTxMeasUPP(QDTxMeasProcPtr userRoutine) ;
37738 extern QDGetPicUPP
37739 NewQDGetPicUPP(QDGetPicProcPtr userRoutine) ;
37740 extern QDPutPicUPP
37741 NewQDPutPicUPP(QDPutPicProcPtr userRoutine) ;
37742 extern QDOpcodeUPP
37743 NewQDOpcodeUPP(QDOpcodeProcPtr userRoutine) ;
37744 extern QDStdGlyphsUPP
37745 NewQDStdGlyphsUPP(QDStdGlyphsProcPtr userRoutine) ;
37746 extern QDJShieldCursorUPP
37747 NewQDJShieldCursorUPP(QDJShieldCursorProcPtr userRoutine) ;
37748 extern void
37749 DisposeQDTextUPP(QDTextUPP userUPP) ;
37750 extern void
37751 DisposeQDLineUPP(QDLineUPP userUPP) ;
37752 extern void
37753 DisposeQDRectUPP(QDRectUPP userUPP) ;
37754 extern void
37755 DisposeQDRRectUPP(QDRRectUPP userUPP) ;
37756 extern void
37757 DisposeQDOvalUPP(QDOvalUPP userUPP) ;
37758 extern void
37759 DisposeQDArcUPP(QDArcUPP userUPP) ;
37760 extern void
37761 DisposeQDPolyUPP(QDPolyUPP userUPP) ;
37762 extern void
37763 DisposeQDRgnUPP(QDRgnUPP userUPP) ;
37764 extern void
37765 DisposeQDBitsUPP(QDBitsUPP userUPP) ;
37766 extern void
37767 DisposeQDCommentUPP(QDCommentUPP userUPP) ;
37768 extern void
37769 DisposeQDTxMeasUPP(QDTxMeasUPP userUPP) ;
37770 extern void
37771 DisposeQDGetPicUPP(QDGetPicUPP userUPP) ;
37772 extern void
37773 DisposeQDPutPicUPP(QDPutPicUPP userUPP) ;
37774 extern void
37775 DisposeQDOpcodeUPP(QDOpcodeUPP userUPP) ;
37776 extern void
37777 DisposeQDStdGlyphsUPP(QDStdGlyphsUPP userUPP) ;
37778 extern void
37779 DisposeQDJShieldCursorUPP(QDJShieldCursorUPP userUPP) ;
37780 extern void
37781 InvokeQDTextUPP(
37782   short byteCount,
37783   const void * textBuf,
37784   Point numer,
37785   Point denom,
37786   QDTextUPP userUPP) ;
37787 extern void
37788 InvokeQDLineUPP(
37789   Point newPt,
37790   QDLineUPP userUPP) ;
37791 extern void
37792 InvokeQDRectUPP(
37793   GrafVerb verb,
37794   const Rect * r,
37795   QDRectUPP userUPP) ;
37796 extern void
37797 InvokeQDRRectUPP(
37798   GrafVerb verb,
37799   const Rect * r,
37800   short ovalWidth,
37801   short ovalHeight,
37802   QDRRectUPP userUPP) ;
37803 extern void
37804 InvokeQDOvalUPP(
37805   GrafVerb verb,
37806   const Rect * r,
37807   QDOvalUPP userUPP) ;
37808 extern void
37809 InvokeQDArcUPP(
37810   GrafVerb verb,
37811   const Rect * r,
37812   short startAngle,
37813   short arcAngle,
37814   QDArcUPP userUPP) ;
37815 extern void
37816 InvokeQDPolyUPP(
37817   GrafVerb verb,
37818   PolyHandle poly,
37819   QDPolyUPP userUPP) ;
37820 extern void
37821 InvokeQDRgnUPP(
37822   GrafVerb verb,
37823   RgnHandle rgn,
37824   QDRgnUPP userUPP) ;
37825 extern void
37826 InvokeQDBitsUPP(
37827   const BitMap * srcBits,
37828   const Rect * srcRect,
37829   const Rect * dstRect,
37830   short mode,
37831   RgnHandle maskRgn,
37832   QDBitsUPP userUPP) ;
37833 extern void
37834 InvokeQDCommentUPP(
37835   short kind,
37836   short dataSize,
37837   Handle dataHandle,
37838   QDCommentUPP userUPP) ;
37839 extern short
37840 InvokeQDTxMeasUPP(
37841   short byteCount,
37842   const void * textAddr,
37843   Point * numer,
37844   Point * denom,
37845   FontInfo * info,
37846   QDTxMeasUPP userUPP) ;
37847 extern void
37848 InvokeQDGetPicUPP(
37849   void * dataPtr,
37850   short byteCount,
37851   QDGetPicUPP userUPP) ;
37852 extern void
37853 InvokeQDPutPicUPP(
37854   const void * dataPtr,
37855   short byteCount,
37856   QDPutPicUPP userUPP) ;
37857 extern void
37858 InvokeQDOpcodeUPP(
37859   const Rect * fromRect,
37860   const Rect * toRect,
37861   UInt16 opcode,
37862   SInt16 version,
37863   QDOpcodeUPP userUPP) ;
37864 extern OSStatus
37865 InvokeQDStdGlyphsUPP(
37866   void * dataStream,
37867   ByteCount size,
37868   QDStdGlyphsUPP userUPP) ;
37869 extern void
37870 InvokeQDJShieldCursorUPP(
37871   short left,
37872   short top,
37873   short right,
37874   short bottom,
37875   QDJShieldCursorUPP userUPP) ;
37876 typedef struct OpaqueWindowPtr* WindowPtr;
37877 typedef struct OpaqueDialogPtr* DialogPtr;
37878 typedef struct OpaqueGrafPtr* GrafPtr;
37879
37880
37881 typedef WindowPtr WindowRef;
37882
37883 typedef UInt16 DragConstraint;
37884 enum {
37885   kNoConstraint = 0,
37886   kVerticalConstraint = 1,
37887   kHorizontalConstraint = 2
37888 };
37889
37890
37891 typedef void ( * DragGrayRgnProcPtr)(void);
37892
37893
37894
37895
37896
37897 struct RGBColor {
37898   unsigned short red;
37899   unsigned short green;
37900   unsigned short blue;
37901 };
37902 typedef struct RGBColor RGBColor;
37903 typedef RGBColor * RGBColorPtr;
37904 typedef RGBColorPtr * RGBColorHdl;
37905 typedef Boolean ( * ColorSearchProcPtr)(RGBColor *rgb, long *position);
37906 typedef Boolean ( * ColorComplementProcPtr)(RGBColor * rgb);
37907 typedef DragGrayRgnProcPtr DragGrayRgnUPP;
37908 typedef ColorSearchProcPtr ColorSearchUPP;
37909 typedef ColorComplementProcPtr ColorComplementUPP;
37910 extern DragGrayRgnUPP
37911 NewDragGrayRgnUPP(DragGrayRgnProcPtr userRoutine) ;
37912 extern ColorSearchUPP
37913 NewColorSearchUPP(ColorSearchProcPtr userRoutine) ;
37914 extern ColorComplementUPP
37915 NewColorComplementUPP(ColorComplementProcPtr userRoutine) ;
37916 extern void
37917 DisposeDragGrayRgnUPP(DragGrayRgnUPP userUPP) ;
37918 extern void
37919 DisposeColorSearchUPP(ColorSearchUPP userUPP) ;
37920 extern void
37921 DisposeColorComplementUPP(ColorComplementUPP userUPP) ;
37922 extern void
37923 InvokeDragGrayRgnUPP(DragGrayRgnUPP userUPP) ;
37924 extern Boolean
37925 InvokeColorSearchUPP(
37926   RGBColor * rgb,
37927   long * position,
37928   ColorSearchUPP userUPP) ;
37929 extern Boolean
37930 InvokeColorComplementUPP(
37931   RGBColor * rgb,
37932   ColorComplementUPP userUPP) ;
37933
37934 struct ColorSpec {
37935   short value;
37936   RGBColor rgb;
37937 };
37938 typedef struct ColorSpec ColorSpec;
37939 typedef ColorSpec * ColorSpecPtr;
37940 typedef ColorSpec CSpecArray[1];
37941 struct ColorTable {
37942   long ctSeed;
37943   short ctFlags;
37944   short ctSize;
37945   CSpecArray ctTable;
37946 };
37947 typedef struct ColorTable ColorTable;
37948 typedef ColorTable * CTabPtr;
37949 typedef CTabPtr * CTabHandle;
37950 struct xColorSpec {
37951   short value;
37952   RGBColor rgb;
37953   short xalpha;
37954 };
37955 typedef struct xColorSpec xColorSpec;
37956 typedef xColorSpec * xColorSpecPtr;
37957 typedef xColorSpec xCSpecArray[1];
37958 struct MatchRec {
37959   unsigned short red;
37960   unsigned short green;
37961   unsigned short blue;
37962   long matchData;
37963 };
37964 typedef struct MatchRec MatchRec;
37965 enum {
37966   k1MonochromePixelFormat = 0x00000001,
37967   k2IndexedPixelFormat = 0x00000002,
37968   k4IndexedPixelFormat = 0x00000004,
37969   k8IndexedPixelFormat = 0x00000008,
37970   k16BE555PixelFormat = 0x00000010,
37971   k24RGBPixelFormat = 0x00000018,
37972   k32ARGBPixelFormat = 0x00000020,
37973   k1IndexedGrayPixelFormat = 0x00000021,
37974   k2IndexedGrayPixelFormat = 0x00000022,
37975   k4IndexedGrayPixelFormat = 0x00000024,
37976   k8IndexedGrayPixelFormat = 0x00000028
37977 };
37978
37979
37980
37981 enum {
37982   k16LE555PixelFormat = 'L555',
37983   k16LE5551PixelFormat = '5551',
37984   k16BE565PixelFormat = 'B565',
37985   k16LE565PixelFormat = 'L565',
37986   k24BGRPixelFormat = '24BG',
37987   k32BGRAPixelFormat = 'BGRA',
37988   k32ABGRPixelFormat = 'ABGR',
37989   k32RGBAPixelFormat = 'RGBA',
37990   kYUVSPixelFormat = 'yuvs',
37991   kYUVUPixelFormat = 'yuvu',
37992   kYVU9PixelFormat = 'YVU9',
37993   kYUV411PixelFormat = 'Y411',
37994   kYVYU422PixelFormat = 'YVYU',
37995   kUYVY422PixelFormat = 'UYVY',
37996   kYUV211PixelFormat = 'Y211',
37997   k2vuyPixelFormat = '2vuy'
37998 };
37999
38000
38001 struct PixMap {
38002   Ptr baseAddr;
38003   short rowBytes;
38004   Rect bounds;
38005   short pmVersion;
38006   short packType;
38007   long packSize;
38008   Fixed hRes;
38009   Fixed vRes;
38010   short pixelType;
38011   short pixelSize;
38012   short cmpCount;
38013   short cmpSize;
38014
38015
38016
38017
38018
38019   OSType pixelFormat;
38020     CTabHandle pmTable;
38021   void* pmExt;
38022
38023 };
38024 typedef struct PixMap PixMap;
38025 typedef PixMap * PixMapPtr;
38026 typedef PixMapPtr * PixMapHandle;
38027 struct PixPat {
38028   short patType;
38029   PixMapHandle patMap;
38030   Handle patData;
38031   Handle patXData;
38032   short patXValid;
38033   Handle patXMap;
38034   Pattern pat1Data;
38035 };
38036 typedef struct PixPat PixPat;
38037 typedef PixPat * PixPatPtr;
38038 typedef PixPatPtr * PixPatHandle;
38039 struct CCrsr {
38040   short crsrType;
38041   PixMapHandle crsrMap;
38042   Handle crsrData;
38043   Handle crsrXData;
38044   short crsrXValid;
38045   Handle crsrXHandle;
38046   Bits16 crsr1Data;
38047   Bits16 crsrMask;
38048   Point crsrHotSpot;
38049   long crsrXTable;
38050   long crsrID;
38051 };
38052 typedef struct CCrsr CCrsr;
38053 typedef CCrsr * CCrsrPtr;
38054 typedef CCrsrPtr * CCrsrHandle;
38055 struct GammaTbl {
38056   short gVersion;
38057   short gType;
38058   short gFormulaSize;
38059   short gChanCnt;
38060   short gDataCnt;
38061   short gDataWidth;
38062   short gFormulaData[1];
38063 };
38064 typedef struct GammaTbl GammaTbl;
38065 typedef GammaTbl * GammaTblPtr;
38066 typedef GammaTblPtr * GammaTblHandle;
38067 struct ITab {
38068   long iTabSeed;
38069   short iTabRes;
38070   Byte iTTable[1];
38071 };
38072 typedef struct ITab ITab;
38073 typedef ITab * ITabPtr;
38074 typedef ITabPtr * ITabHandle;
38075 struct SProcRec {
38076   Handle nxtSrch;
38077   ColorSearchUPP srchProc;
38078 };
38079 typedef struct SProcRec SProcRec;
38080 typedef SProcRec * SProcPtr;
38081 typedef SProcPtr * SProcHndl;
38082 struct CProcRec {
38083   Handle nxtComp;
38084   ColorComplementUPP compProc;
38085 };
38086 typedef struct CProcRec CProcRec;
38087 typedef CProcRec * CProcPtr;
38088 typedef CProcPtr * CProcHndl;
38089 typedef struct GDevice GDevice;
38090 typedef GDevice * GDPtr;
38091 typedef GDPtr * GDHandle;
38092 struct GDevice {
38093   short gdRefNum;
38094   short gdID;
38095   short gdType;
38096   ITabHandle gdITable;
38097   short gdResPref;
38098   SProcHndl gdSearchProc;
38099   CProcHndl gdCompProc;
38100   short gdFlags;
38101   PixMapHandle gdPMap;
38102   long gdRefCon;
38103   GDHandle gdNextGD;
38104   Rect gdRect;
38105   long gdMode;
38106   short gdCCBytes;
38107   short gdCCDepth;
38108   Handle gdCCXData;
38109   Handle gdCCXMask;
38110
38111
38112
38113   Handle gdExt;
38114
38115 };
38116
38117 struct GrafVars {
38118   RGBColor rgbOpColor;
38119   RGBColor rgbHiliteColor;
38120   Handle pmFgColor;
38121   short pmFgIndex;
38122   Handle pmBkColor;
38123   short pmBkIndex;
38124   short pmFlags;
38125 };
38126 typedef struct GrafVars GrafVars;
38127 typedef GrafVars * GVarPtr;
38128 typedef GVarPtr * GVarHandle;
38129
38130
38131
38132
38133
38134 typedef GrafPtr CGrafPtr;
38135
38136
38137 typedef OSStatus ( * QDPrinterStatusProcPtr)(PrinterStatusOpcode opcode, CGrafPtr currentPort, void *printerStatus);
38138 typedef QDPrinterStatusProcPtr QDPrinterStatusUPP;
38139
38140 struct CQDProcs {
38141   QDTextUPP textProc;
38142   QDLineUPP lineProc;
38143   QDRectUPP rectProc;
38144   QDRRectUPP rRectProc;
38145   QDOvalUPP ovalProc;
38146   QDArcUPP arcProc;
38147   QDPolyUPP polyProc;
38148   QDRgnUPP rgnProc;
38149   QDBitsUPP bitsProc;
38150   QDCommentUPP commentProc;
38151   QDTxMeasUPP txMeasProc;
38152   QDGetPicUPP getPicProc;
38153   QDPutPicUPP putPicProc;
38154   QDOpcodeUPP opcodeProc;
38155   UniversalProcPtr newProc1;
38156   QDStdGlyphsUPP glyphsProc;
38157   QDPrinterStatusUPP printerStatusProc;
38158   UniversalProcPtr newProc4;
38159   UniversalProcPtr newProc5;
38160   UniversalProcPtr newProc6;
38161 };
38162 typedef struct CQDProcs CQDProcs;
38163 typedef CQDProcs * CQDProcsPtr;
38164 typedef WindowPtr CWindowPtr;
38165
38166
38167
38168
38169 struct ReqListRec {
38170   short reqLSize;
38171   short reqLData[1];
38172 };
38173 typedef struct ReqListRec ReqListRec;
38174 struct OpenCPicParams {
38175   Rect srcRect;
38176   Fixed hRes;
38177   Fixed vRes;
38178   short version;
38179   short reserved1;
38180   long reserved2;
38181 };
38182 typedef struct OpenCPicParams OpenCPicParams;
38183 enum {
38184   kCursorImageMajorVersion = 0x0001,
38185   kCursorImageMinorVersion = 0x0000
38186 };
38187
38188 struct CursorImageRec {
38189   UInt16 majorVersion;
38190   UInt16 minorVersion;
38191   PixMapHandle cursorPixMap;
38192   BitMapHandle cursorBitMask;
38193 };
38194 typedef struct CursorImageRec CursorImageRec;
38195 typedef CursorImageRec * CursorImagePtr;
38196 typedef void ( * DeviceLoopDrawingProcPtr)(short depth, short deviceFlags, GDHandle targetDevice, long userData);
38197 typedef DeviceLoopDrawingProcPtr DeviceLoopDrawingUPP;
38198 extern DeviceLoopDrawingUPP
38199 NewDeviceLoopDrawingUPP(DeviceLoopDrawingProcPtr userRoutine) ;
38200 extern void
38201 DisposeDeviceLoopDrawingUPP(DeviceLoopDrawingUPP userUPP) ;
38202 extern void
38203 InvokeDeviceLoopDrawingUPP(
38204   short depth,
38205   short deviceFlags,
38206   GDHandle targetDevice,
38207   long userData,
38208   DeviceLoopDrawingUPP userUPP) ;
38209 extern OSErr
38210 LockPortBits(GrafPtr port) ;
38211 extern OSErr
38212 UnlockPortBits(GrafPtr port) ;
38213
38214
38215
38216
38217 enum {
38218   kQDParseRegionFromTop = (1 << 0),
38219   kQDParseRegionFromBottom = (1 << 1),
38220   kQDParseRegionFromLeft = (1 << 2),
38221   kQDParseRegionFromRight = (1 << 3),
38222   kQDParseRegionFromTopLeft = kQDParseRegionFromTop | kQDParseRegionFromLeft,
38223   kQDParseRegionFromBottomRight = kQDParseRegionFromBottom | kQDParseRegionFromRight
38224 };
38225
38226 typedef SInt32 QDRegionParseDirection;
38227 enum {
38228   kQDRegionToRectsMsgInit = 1,
38229   kQDRegionToRectsMsgParse = 2,
38230   kQDRegionToRectsMsgTerminate = 3
38231 };
38232
38233 typedef OSStatus ( * RegionToRectsProcPtr)(UInt16 message, RgnHandle rgn, const Rect *rect, void *refCon);
38234 typedef RegionToRectsProcPtr RegionToRectsUPP;
38235 extern RegionToRectsUPP
38236 NewRegionToRectsUPP(RegionToRectsProcPtr userRoutine) ;
38237 extern void
38238 DisposeRegionToRectsUPP(RegionToRectsUPP userUPP) ;
38239 extern OSStatus
38240 InvokeRegionToRectsUPP(
38241   UInt16 message,
38242   RgnHandle rgn,
38243   const Rect * rect,
38244   void * refCon,
38245   RegionToRectsUPP userUPP) ;
38246 extern OSStatus
38247 QDRegionToRects(
38248   RgnHandle rgn,
38249   QDRegionParseDirection dir,
38250   RegionToRectsUPP proc,
38251   void * userData) ;
38252 extern void
38253 SetPort(GrafPtr port) ;
38254 extern void
38255 GetPort(GrafPtr * port) ;
38256 extern Boolean
38257 QDSwapPort(
38258   CGrafPtr inNewPort,
38259   CGrafPtr * outOldPort) ;
38260 extern void
38261 GrafDevice(short device) ;
38262 extern void
38263 SetPortBits(const BitMap * bm) ;
38264 extern void
38265 PortSize(
38266   short width,
38267   short height) ;
38268 extern void
38269 MovePortTo(
38270   short leftGlobal,
38271   short topGlobal) ;
38272 extern void
38273 SetOrigin(
38274   short h,
38275   short v) ;
38276 extern void
38277 SetClip(RgnHandle rgn) ;
38278 extern void
38279 GetClip(RgnHandle rgn) ;
38280 extern void
38281 ClipRect(const Rect * r) ;
38282 extern void
38283 BackPat(const Pattern * pat) ;
38284 extern void
38285 InitCursor(void) ;
38286 extern void
38287 SetCursor(const Cursor * crsr) ;
38288 extern void
38289 HideCursor(void) ;
38290 extern void
38291 ShowCursor(void) ;
38292 extern void
38293 ObscureCursor(void) ;
38294 extern void
38295 HidePen(void) ;
38296 extern void
38297 ShowPen(void) ;
38298 extern void
38299 GetPen(Point * pt) ;
38300 extern void
38301 GetPenState(PenState * pnState) ;
38302 extern void
38303 SetPenState(const PenState * pnState) ;
38304 extern void
38305 PenSize(
38306   short width,
38307   short height) ;
38308 extern void
38309 PenMode(short mode) ;
38310 extern void
38311 PenPat(const Pattern * pat) ;
38312 extern void
38313 PenNormal(void) ;
38314 extern void
38315 MoveTo(
38316   short h,
38317   short v) ;
38318 extern void
38319 Move(
38320   short dh,
38321   short dv) ;
38322 extern void
38323 LineTo(
38324   short h,
38325   short v) ;
38326 extern void
38327 Line(
38328   short dh,
38329   short dv) ;
38330 extern void
38331 ForeColor(long color) ;
38332 extern void
38333 BackColor(long color) ;
38334 extern void
38335 ColorBit(short whichBit) ;
38336 extern void
38337 SetRect(
38338   Rect * r,
38339   short left,
38340   short top,
38341   short right,
38342   short bottom) ;
38343 extern void
38344 OffsetRect(
38345   Rect * r,
38346   short dh,
38347   short dv) ;
38348 extern void
38349 InsetRect(
38350   Rect * r,
38351   short dh,
38352   short dv) ;
38353 extern Boolean
38354 SectRect(
38355   const Rect * src1,
38356   const Rect * src2,
38357   Rect * dstRect) ;
38358 extern void
38359 UnionRect(
38360   const Rect * src1,
38361   const Rect * src2,
38362   Rect * dstRect) ;
38363 extern Boolean
38364 EqualRect(
38365   const Rect * rect1,
38366   const Rect * rect2) ;
38367 extern Boolean
38368 EmptyRect(const Rect * r) ;
38369 extern void
38370 FrameRect(const Rect * r) ;
38371 extern void
38372 PaintRect(const Rect * r) ;
38373 extern void
38374 EraseRect(const Rect * r) ;
38375 extern void
38376 InvertRect(const Rect * r) ;
38377 extern void
38378 FillRect(
38379   const Rect * r,
38380   const Pattern * pat) ;
38381 extern void
38382 FrameOval(const Rect * r) ;
38383 extern void
38384 PaintOval(const Rect * r) ;
38385 extern void
38386 EraseOval(const Rect * r) ;
38387 extern void
38388 InvertOval(const Rect * r) ;
38389 extern void
38390 FillOval(
38391   const Rect * r,
38392   const Pattern * pat) ;
38393 extern void
38394 FrameRoundRect(
38395   const Rect * r,
38396   short ovalWidth,
38397   short ovalHeight) ;
38398 extern void
38399 PaintRoundRect(
38400   const Rect * r,
38401   short ovalWidth,
38402   short ovalHeight) ;
38403 extern void
38404 EraseRoundRect(
38405   const Rect * r,
38406   short ovalWidth,
38407   short ovalHeight) ;
38408 extern void
38409 InvertRoundRect(
38410   const Rect * r,
38411   short ovalWidth,
38412   short ovalHeight) ;
38413 extern void
38414 FillRoundRect(
38415   const Rect * r,
38416   short ovalWidth,
38417   short ovalHeight,
38418   const Pattern * pat) ;
38419 extern void
38420 FrameArc(
38421   const Rect * r,
38422   short startAngle,
38423   short arcAngle) ;
38424 extern void
38425 PaintArc(
38426   const Rect * r,
38427   short startAngle,
38428   short arcAngle) ;
38429 extern void
38430 EraseArc(
38431   const Rect * r,
38432   short startAngle,
38433   short arcAngle) ;
38434 extern void
38435 InvertArc(
38436   const Rect * r,
38437   short startAngle,
38438   short arcAngle) ;
38439 extern void
38440 FillArc(
38441   const Rect * r,
38442   short startAngle,
38443   short arcAngle,
38444   const Pattern * pat) ;
38445 extern RgnHandle
38446 NewRgn(void) ;
38447 extern void
38448 OpenRgn(void) ;
38449 extern void
38450 CloseRgn(RgnHandle dstRgn) ;
38451 extern OSErr
38452 BitMapToRegion(
38453   RgnHandle region,
38454   const BitMap * bMap) ;
38455 extern void
38456 HandleToRgn(
38457   Handle oldRegion,
38458   RgnHandle region) ;
38459 extern void
38460 RgnToHandle(
38461   RgnHandle region,
38462   Handle flattenedRgnDataHdl) ;
38463 extern void
38464 DisposeRgn(RgnHandle rgn) ;
38465 extern void
38466 CopyRgn(
38467   RgnHandle srcRgn,
38468   RgnHandle dstRgn) ;
38469 extern void
38470 SetEmptyRgn(RgnHandle rgn) ;
38471 extern void
38472 SetRectRgn(
38473   RgnHandle rgn,
38474   short left,
38475   short top,
38476   short right,
38477   short bottom) ;
38478 extern void
38479 RectRgn(
38480   RgnHandle rgn,
38481   const Rect * r) ;
38482 extern void
38483 OffsetRgn(
38484   RgnHandle rgn,
38485   short dh,
38486   short dv) ;
38487 extern void
38488 InsetRgn(
38489   RgnHandle rgn,
38490   short dh,
38491   short dv) ;
38492 extern void
38493 SectRgn(
38494   RgnHandle srcRgnA,
38495   RgnHandle srcRgnB,
38496   RgnHandle dstRgn) ;
38497 extern void
38498 UnionRgn(
38499   RgnHandle srcRgnA,
38500   RgnHandle srcRgnB,
38501   RgnHandle dstRgn) ;
38502 extern void
38503 DiffRgn(
38504   RgnHandle srcRgnA,
38505   RgnHandle srcRgnB,
38506   RgnHandle dstRgn) ;
38507 extern void
38508 XorRgn(
38509   RgnHandle srcRgnA,
38510   RgnHandle srcRgnB,
38511   RgnHandle dstRgn) ;
38512 extern Boolean
38513 RectInRgn(
38514   const Rect * r,
38515   RgnHandle rgn) ;
38516 extern Boolean
38517 EqualRgn(
38518   RgnHandle rgnA,
38519   RgnHandle rgnB) ;
38520 extern Boolean
38521 EmptyRgn(RgnHandle rgn) ;
38522 extern void
38523 FrameRgn(RgnHandle rgn) ;
38524 extern void
38525 PaintRgn(RgnHandle rgn) ;
38526 extern void
38527 EraseRgn(RgnHandle rgn) ;
38528 extern void
38529 InvertRgn(RgnHandle rgn) ;
38530 extern void
38531 FillRgn(
38532   RgnHandle rgn,
38533   const Pattern * pat) ;
38534 extern void
38535 ScrollRect(
38536   const Rect * r,
38537   short dh,
38538   short dv,
38539   RgnHandle updateRgn) ;
38540 extern void
38541 CopyBits(
38542   const BitMap * srcBits,
38543   const BitMap * dstBits,
38544   const Rect * srcRect,
38545   const Rect * dstRect,
38546   short mode,
38547   RgnHandle maskRgn) ;
38548 extern void
38549 SeedFill(
38550   const void * srcPtr,
38551   void * dstPtr,
38552   short srcRow,
38553   short dstRow,
38554   short height,
38555   short words,
38556   short seedH,
38557   short seedV) ;
38558 extern void
38559 CalcMask(
38560   const void * srcPtr,
38561   void * dstPtr,
38562   short srcRow,
38563   short dstRow,
38564   short height,
38565   short words) ;
38566 extern void
38567 CopyMask(
38568   const BitMap * srcBits,
38569   const BitMap * maskBits,
38570   const BitMap * dstBits,
38571   const Rect * srcRect,
38572   const Rect * maskRect,
38573   const Rect * dstRect) ;
38574 extern PicHandle
38575 OpenPicture(const Rect * picFrame) ;
38576 extern void
38577 PicComment(
38578   short kind,
38579   short dataSize,
38580   Handle dataHandle) ;
38581 extern void
38582 ClosePicture(void) ;
38583 extern void
38584 DrawPicture(
38585   PicHandle myPicture,
38586   const Rect * dstRect) ;
38587 extern void
38588 KillPicture(PicHandle myPicture) ;
38589 extern PolyHandle
38590 OpenPoly(void) ;
38591 extern void
38592 ClosePoly(void) ;
38593 extern void
38594 KillPoly(PolyHandle poly) ;
38595 extern void
38596 OffsetPoly(
38597   PolyHandle poly,
38598   short dh,
38599   short dv) ;
38600 extern void
38601 FramePoly(PolyHandle poly) ;
38602 extern void
38603 PaintPoly(PolyHandle poly) ;
38604 extern void
38605 ErasePoly(PolyHandle poly) ;
38606 extern void
38607 InvertPoly(PolyHandle poly) ;
38608 extern void
38609 FillPoly(
38610   PolyHandle poly,
38611   const Pattern * pat) ;
38612 extern void
38613 SetPt(
38614   Point * pt,
38615   short h,
38616   short v) ;
38617 extern void
38618 LocalToGlobal(Point * pt) ;
38619 extern void
38620 GlobalToLocal(Point * pt) ;
38621 extern short
38622 Random(void) ;
38623 extern void
38624 StuffHex(
38625   void * thingPtr,
38626   ConstStr255Param s) ;
38627 extern Boolean
38628 GetPixel(
38629   short h,
38630   short v) ;
38631 extern void
38632 ScalePt(
38633   Point * pt,
38634   const Rect * srcRect,
38635   const Rect * dstRect) ;
38636 extern void
38637 MapPt(
38638   Point * pt,
38639   const Rect * srcRect,
38640   const Rect * dstRect) ;
38641 extern void
38642 MapRect(
38643   Rect * r,
38644   const Rect * srcRect,
38645   const Rect * dstRect) ;
38646 extern void
38647 MapRgn(
38648   RgnHandle rgn,
38649   const Rect * srcRect,
38650   const Rect * dstRect) ;
38651 extern void
38652 MapPoly(
38653   PolyHandle poly,
38654   const Rect * srcRect,
38655   const Rect * dstRect) ;
38656 extern void
38657 SetStdProcs(QDProcs * procs) ;
38658 extern void
38659 StdRect(
38660   GrafVerb verb,
38661   const Rect * r) ;
38662 extern void
38663 StdRRect(
38664   GrafVerb verb,
38665   const Rect * r,
38666   short ovalWidth,
38667   short ovalHeight) ;
38668 extern void
38669 StdOval(
38670   GrafVerb verb,
38671   const Rect * r) ;
38672 extern void
38673 StdArc(
38674   GrafVerb verb,
38675   const Rect * r,
38676   short startAngle,
38677   short arcAngle) ;
38678 extern void
38679 StdPoly(
38680   GrafVerb verb,
38681   PolyHandle poly) ;
38682 extern void
38683 StdRgn(
38684   GrafVerb verb,
38685   RgnHandle rgn) ;
38686 extern void
38687 StdBits(
38688   const BitMap * srcBits,
38689   const Rect * srcRect,
38690   const Rect * dstRect,
38691   short mode,
38692   RgnHandle maskRgn) ;
38693 extern void
38694 StdComment(
38695   short kind,
38696   short dataSize,
38697   Handle dataHandle) ;
38698 extern void
38699 StdGetPic(
38700   void * dataPtr,
38701   short byteCount) ;
38702 extern void
38703 StdPutPic(
38704   const void * dataPtr,
38705   short byteCount) ;
38706 extern void
38707 StdOpcode(
38708   const Rect * fromRect,
38709   const Rect * toRect,
38710   UInt16 opcode,
38711   SInt16 version) ;
38712 extern void
38713 AddPt(
38714   Point src,
38715   Point * dst) ;
38716 extern Boolean
38717 EqualPt(
38718   Point pt1,
38719   Point pt2) ;
38720 extern Boolean
38721 PtInRect(
38722   Point pt,
38723   const Rect * r) ;
38724 extern void
38725 Pt2Rect(
38726   Point pt1,
38727   Point pt2,
38728   Rect * dstRect) ;
38729 extern void
38730 PtToAngle(
38731   const Rect * r,
38732   Point pt,
38733   short * angle) ;
38734 extern void
38735 SubPt(
38736   Point src,
38737   Point * dst) ;
38738 extern Boolean
38739 PtInRgn(
38740   Point pt,
38741   RgnHandle rgn) ;
38742 extern void
38743 StdLine(Point newPt) ;
38744 extern PixMapHandle
38745 NewPixMap(void) ;
38746 extern void
38747 DisposePixMap(PixMapHandle pm) ;
38748 extern void
38749 CopyPixMap(
38750   PixMapHandle srcPM,
38751   PixMapHandle dstPM) ;
38752 extern PixPatHandle
38753 NewPixPat(void) ;
38754 extern void
38755 DisposePixPat(PixPatHandle pp) ;
38756 extern void
38757 CopyPixPat(
38758   PixPatHandle srcPP,
38759   PixPatHandle dstPP) ;
38760 extern void
38761 PenPixPat(PixPatHandle pp) ;
38762 extern void
38763 BackPixPat(PixPatHandle pp) ;
38764 extern PixPatHandle
38765 GetPixPat(short patID) ;
38766 extern void
38767 MakeRGBPat(
38768   PixPatHandle pp,
38769   const RGBColor * myColor) ;
38770 extern void
38771 FillCRect(
38772   const Rect * r,
38773   PixPatHandle pp) ;
38774 extern void
38775 FillCOval(
38776   const Rect * r,
38777   PixPatHandle pp) ;
38778 extern void
38779 FillCRoundRect(
38780   const Rect * r,
38781   short ovalWidth,
38782   short ovalHeight,
38783   PixPatHandle pp) ;
38784 extern void
38785 FillCArc(
38786   const Rect * r,
38787   short startAngle,
38788   short arcAngle,
38789   PixPatHandle pp) ;
38790 extern void
38791 FillCRgn(
38792   RgnHandle rgn,
38793   PixPatHandle pp) ;
38794 extern void
38795 FillCPoly(
38796   PolyHandle poly,
38797   PixPatHandle pp) ;
38798 extern void
38799 RGBForeColor(const RGBColor * color) ;
38800 extern void
38801 RGBBackColor(const RGBColor * color) ;
38802 extern void
38803 SetCPixel(
38804   short h,
38805   short v,
38806   const RGBColor * cPix) ;
38807 extern void
38808 SetPortPix(PixMapHandle pm) ;
38809 extern void
38810 GetCPixel(
38811   short h,
38812   short v,
38813   RGBColor * cPix) ;
38814 extern void
38815 GetForeColor(RGBColor * color) ;
38816 extern void
38817 GetBackColor(RGBColor * color) ;
38818 extern void
38819 SeedCFill(
38820   const BitMap * srcBits,
38821   const BitMap * dstBits,
38822   const Rect * srcRect,
38823   const Rect * dstRect,
38824   short seedH,
38825   short seedV,
38826   ColorSearchUPP matchProc,
38827   long matchData) ;
38828 extern void
38829 CalcCMask(
38830   const BitMap * srcBits,
38831   const BitMap * dstBits,
38832   const Rect * srcRect,
38833   const Rect * dstRect,
38834   const RGBColor * seedRGB,
38835   ColorSearchUPP matchProc,
38836   long matchData) ;
38837 extern PicHandle
38838 OpenCPicture(const OpenCPicParams * newHeader) ;
38839 extern void
38840 OpColor(const RGBColor * color) ;
38841 extern void
38842 HiliteColor(const RGBColor * color) ;
38843 extern void
38844 DisposeCTable(CTabHandle cTable) ;
38845 extern CTabHandle
38846 GetCTable(short ctID) ;
38847 extern CCrsrHandle
38848 GetCCursor(short crsrID) ;
38849 extern void
38850 SetCCursor(CCrsrHandle cCrsr) ;
38851 extern void
38852 AllocCursor(void) ;
38853 extern void
38854 DisposeCCursor(CCrsrHandle cCrsr) ;
38855 extern void
38856 SetStdCProcs(CQDProcs * procs) ;
38857 extern GDHandle
38858 GetMaxDevice(const Rect * globalRect) ;
38859 extern long
38860 GetCTSeed(void) ;
38861 extern GDHandle
38862 GetDeviceList(void) ;
38863 extern GDHandle
38864 GetMainDevice(void) ;
38865 extern GDHandle
38866 GetNextDevice(GDHandle curDevice) ;
38867 extern Boolean
38868 TestDeviceAttribute(
38869   GDHandle gdh,
38870   short attribute) ;
38871 extern void
38872 SetDeviceAttribute(
38873   GDHandle gdh,
38874   short attribute,
38875   Boolean value) ;
38876 extern void
38877 InitGDevice(
38878   short qdRefNum,
38879   long mode,
38880   GDHandle gdh) ;
38881 extern GDHandle
38882 NewGDevice(
38883   short refNum,
38884   long mode) ;
38885 extern void
38886 DisposeGDevice(GDHandle gdh) ;
38887 extern void
38888 SetGDevice(GDHandle gd) ;
38889 extern GDHandle
38890 GetGDevice(void) ;
38891 extern long
38892 Color2Index(const RGBColor * myColor) ;
38893 extern void
38894 Index2Color(
38895   long index,
38896   RGBColor * aColor) ;
38897 extern void
38898 InvertColor(RGBColor * myColor) ;
38899 extern Boolean
38900 RealColor(const RGBColor * color) ;
38901 extern void
38902 GetSubTable(
38903   CTabHandle myColors,
38904   short iTabRes,
38905   CTabHandle targetTbl) ;
38906 extern void
38907 MakeITable(
38908   CTabHandle cTabH,
38909   ITabHandle iTabH,
38910   short res) ;
38911 extern void
38912 AddSearch(ColorSearchUPP searchProc) ;
38913 extern void
38914 AddComp(ColorComplementUPP compProc) ;
38915 extern void
38916 DelSearch(ColorSearchUPP searchProc) ;
38917 extern void
38918 DelComp(ColorComplementUPP compProc) ;
38919 extern void
38920 SetClientID(short id) ;
38921 extern void
38922 ProtectEntry(
38923   short index,
38924   Boolean protect) ;
38925 extern void
38926 ReserveEntry(
38927   short index,
38928   Boolean reserve) ;
38929 extern void
38930 SetEntries(
38931   short start,
38932   short count,
38933   CSpecArray aTable) ;
38934 extern void
38935 SaveEntries(
38936   CTabHandle srcTable,
38937   CTabHandle resultTable,
38938   ReqListRec * selection) ;
38939 extern void
38940 RestoreEntries(
38941   CTabHandle srcTable,
38942   CTabHandle dstTable,
38943   ReqListRec * selection) ;
38944 extern short
38945 QDError(void) ;
38946 extern void
38947 CopyDeepMask(
38948   const BitMap * srcBits,
38949   const BitMap * maskBits,
38950   const BitMap * dstBits,
38951   const Rect * srcRect,
38952   const Rect * maskRect,
38953   const Rect * dstRect,
38954   short mode,
38955   RgnHandle maskRgn) ;
38956 extern void
38957 DeviceLoop(
38958   RgnHandle drawingRgn,
38959   DeviceLoopDrawingUPP drawingProc,
38960   long userData,
38961   DeviceLoopFlags flags) ;
38962 extern Ptr
38963 GetMaskTable(void) ;
38964 extern PatHandle
38965 GetPattern(short patternID) ;
38966 extern CursHandle
38967 GetCursor(short cursorID) ;
38968 extern PicHandle
38969 GetPicture(short pictureID) ;
38970 extern long
38971 DeltaPoint(
38972   Point ptA,
38973   Point ptB) ;
38974 extern void
38975 ShieldCursor(
38976   const Rect * shieldRect,
38977   Point offsetPt) ;
38978 extern void
38979 ScreenRes(
38980   short * scrnHRes,
38981   short * scrnVRes) ;
38982 extern void
38983 GetIndPattern(
38984   Pattern * thePat,
38985   short patternListID,
38986   short index) ;
38987 extern long
38988 deltapoint(
38989   Point * ptA,
38990   Point * ptB) ;
38991 extern void
38992 PackBits(
38993   Ptr * srcPtr,
38994   Ptr * dstPtr,
38995   short srcBytes) ;
38996 extern void
38997 UnpackBits(
38998   Ptr * srcPtr,
38999   Ptr * dstPtr,
39000   short dstBytes) ;
39001 extern Fixed
39002 SlopeFromAngle(short angle) ;
39003 extern short
39004 AngleFromSlope(Fixed slope) ;
39005
39006
39007
39008 enum {
39009   colorXorXFer = 52,
39010   noiseXFer = 53,
39011   customXFer = 54
39012 };
39013
39014
39015 enum {
39016   kXFer1PixelAtATime = 0x00000001,
39017   kXFerConvertPixelToRGB32 = 0x00000002
39018 };
39019
39020 struct CustomXFerRec {
39021   UInt32 version;
39022   void * srcPixels;
39023   void * destPixels;
39024   void * resultPixels;
39025   UInt32 refCon;
39026   UInt32 pixelSize;
39027   UInt32 pixelCount;
39028   Point firstPixelHV;
39029   Rect destBounds;
39030 };
39031 typedef struct CustomXFerRec CustomXFerRec;
39032 typedef CustomXFerRec * CustomXFerRecPtr;
39033 typedef void ( * CustomXFerProcPtr)(CustomXFerRecPtr info);
39034 extern OSErr
39035 GetPortCustomXFerProc(
39036   CGrafPtr port,
39037   CustomXFerProcPtr * proc,
39038   UInt32 * flags,
39039   UInt32 * refCon) ;
39040 extern OSErr
39041 SetPortCustomXFerProc(
39042   CGrafPtr port,
39043   CustomXFerProcPtr proc,
39044   UInt32 flags,
39045   UInt32 refCon) ;
39046
39047
39048
39049 enum {
39050   kCursorComponentsVersion = 0x00010001
39051 };
39052
39053 enum {
39054   kCursorComponentType = 'curs'
39055 };
39056
39057
39058 enum {
39059   cursorDoesAnimate = 1L << 0,
39060   cursorDoesHardware = 1L << 1,
39061   cursorDoesUnreadableScreenBits = 1L << 2
39062 };
39063
39064
39065 enum {
39066   kRenderCursorInHardware = 1L << 0,
39067   kRenderCursorInSoftware = 1L << 1
39068 };
39069
39070
39071 struct CursorInfo {
39072   long version;
39073   long capabilities;
39074   long animateDuration;
39075   Rect bounds;
39076   Point hotspot;
39077   long reserved;
39078
39079 };
39080 typedef struct CursorInfo CursorInfo;
39081
39082 enum {
39083   kCursorComponentInit = 0x0001,
39084   kCursorComponentGetInfo = 0x0002,
39085   kCursorComponentSetOutputMode = 0x0003,
39086   kCursorComponentSetData = 0x0004,
39087   kCursorComponentReconfigure = 0x0005,
39088   kCursorComponentDraw = 0x0006,
39089   kCursorComponentErase = 0x0007,
39090   kCursorComponentMove = 0x0008,
39091   kCursorComponentAnimate = 0x0009,
39092   kCursorComponentLastReserved = 0x0050
39093 };
39094 extern OSErr
39095 OpenCursorComponent(
39096   Component c,
39097   ComponentInstance * ci) ;
39098 extern OSErr
39099 CloseCursorComponent(ComponentInstance ci) ;
39100 extern OSErr
39101 SetCursorComponent(ComponentInstance ci) ;
39102 extern OSErr
39103 CursorComponentChanged(ComponentInstance ci) ;
39104 extern OSErr
39105 CursorComponentSetData(
39106   ComponentInstance ci,
39107   long data) ;
39108 extern CMError
39109 CWMatchPixMap(
39110   CMWorldRef cw,
39111   PixMap * myPixMap,
39112   CMBitmapCallBackUPP progressProc,
39113   void * refCon) ;
39114 extern CMError
39115 CWCheckPixMap(
39116   CMWorldRef cw,
39117   PixMap * myPixMap,
39118   CMBitmapCallBackUPP progressProc,
39119   void * refCon,
39120   BitMap * resultBitMap) ;
39121 extern CMError
39122 NCMBeginMatching(
39123   CMProfileRef src,
39124   CMProfileRef dst,
39125   CMMatchRef * myRef) ;
39126 extern void
39127 CMEndMatching(CMMatchRef myRef) ;
39128 extern void
39129 NCMDrawMatchedPicture(
39130   PicHandle myPicture,
39131   CMProfileRef dst,
39132   Rect * myRect) ;
39133 extern void
39134 CMEnableMatchingComment(Boolean enableIt) ;
39135 extern CMError
39136 NCMUseProfileComment(
39137   CMProfileRef prof,
39138   UInt32 flags) ;
39139 extern Boolean
39140 IsValidPort(CGrafPtr port) ;
39141 extern PixMapHandle
39142 GetPortPixMap(CGrafPtr port) ;
39143 extern const BitMap *
39144 GetPortBitMapForCopyBits(CGrafPtr port) ;
39145 extern Rect *
39146 GetPortBounds(
39147   CGrafPtr port,
39148   Rect * rect) ;
39149 extern RGBColor *
39150 GetPortForeColor(
39151   CGrafPtr port,
39152   RGBColor * foreColor) ;
39153 extern RGBColor *
39154 GetPortBackColor(
39155   CGrafPtr port,
39156   RGBColor * backColor) ;
39157 extern RGBColor *
39158 GetPortOpColor(
39159   CGrafPtr port,
39160   RGBColor * opColor) ;
39161 extern RGBColor *
39162 GetPortHiliteColor(
39163   CGrafPtr port,
39164   RGBColor * hiliteColor) ;
39165 extern CQDProcsPtr
39166 GetPortGrafProcs(CGrafPtr port) ;
39167 extern short
39168 GetPortTextFont(CGrafPtr port) ;
39169 extern Style
39170 GetPortTextFace(CGrafPtr port) ;
39171 extern short
39172 GetPortTextMode(CGrafPtr port) ;
39173 extern short
39174 GetPortTextSize(CGrafPtr port) ;
39175 extern short
39176 GetPortChExtra(CGrafPtr port) ;
39177 extern short
39178 GetPortFracHPenLocation(CGrafPtr port) ;
39179 extern Fixed
39180 GetPortSpExtra(CGrafPtr port) ;
39181 extern short
39182 GetPortPenVisibility(CGrafPtr port) ;
39183 extern RgnHandle
39184 GetPortVisibleRegion(
39185   CGrafPtr port,
39186   RgnHandle visRgn) ;
39187 extern RgnHandle
39188 GetPortClipRegion(
39189   CGrafPtr port,
39190   RgnHandle clipRgn) ;
39191 extern PixPatHandle
39192 GetPortBackPixPat(
39193   CGrafPtr port,
39194   PixPatHandle backPattern) ;
39195 extern PixPatHandle
39196 GetPortPenPixPat(
39197   CGrafPtr port,
39198   PixPatHandle penPattern) ;
39199 extern PixPatHandle
39200 GetPortFillPixPat(
39201   CGrafPtr port,
39202   PixPatHandle fillPattern) ;
39203 extern Point *
39204 GetPortPenSize(
39205   CGrafPtr port,
39206   Point * penSize) ;
39207 extern SInt32
39208 GetPortPenMode(CGrafPtr port) ;
39209 extern Point *
39210 GetPortPenLocation(
39211   CGrafPtr port,
39212   Point * penLocation) ;
39213 extern Boolean
39214 IsPortRegionBeingDefined(CGrafPtr port) ;
39215 extern Boolean
39216 IsPortPictureBeingDefined(CGrafPtr port) ;
39217 extern Boolean
39218 IsPortPolyBeingDefined(CGrafPtr port) ;
39219 extern Boolean
39220 IsPortOffscreen(CGrafPtr port) ;
39221 extern Boolean
39222 IsPortColor(CGrafPtr port) ;
39223 extern Boolean
39224 IsPortVisibleRegionEmpty(CGrafPtr port) ;
39225 extern Boolean
39226 IsPortClipRegionEmpty(CGrafPtr port) ;
39227 extern void
39228 SectRegionWithPortClipRegion(
39229   CGrafPtr port,
39230   RgnHandle ioRegion) ;
39231 extern void
39232 SectRegionWithPortVisibleRegion(
39233   CGrafPtr port,
39234   RgnHandle ioRegion) ;
39235 extern Handle
39236 SwapPortPicSaveHandle(
39237   CGrafPtr port,
39238   Handle inPicSaveHdl) ;
39239 extern Handle
39240 SwapPortPolySaveHandle(
39241   CGrafPtr port,
39242   Handle inPolySaveHdl) ;
39243 extern Handle
39244 SwapPortRegionSaveHandle(
39245   CGrafPtr port,
39246   Handle inRegionSaveHdl) ;
39247 extern void
39248 SetPortBounds(
39249   CGrafPtr port,
39250   const Rect * rect) ;
39251 extern void
39252 SetPortOpColor(
39253   CGrafPtr port,
39254   const RGBColor * opColor) ;
39255 extern void
39256 SetPortGrafProcs(
39257   CGrafPtr port,
39258   CQDProcsPtr procs) ;
39259 extern void
39260 SetPortTextFont(
39261   CGrafPtr port,
39262   short txFont) ;
39263 extern void
39264 SetPortTextSize(
39265   CGrafPtr port,
39266   short txSize) ;
39267 extern void
39268 SetPortTextFace(
39269   CGrafPtr port,
39270   StyleParameter face) ;
39271 extern void
39272 SetPortTextMode(
39273   CGrafPtr port,
39274   short mode) ;
39275 extern void
39276 SetPortVisibleRegion(
39277   CGrafPtr port,
39278   RgnHandle visRgn) ;
39279 extern void
39280 SetPortClipRegion(
39281   CGrafPtr port,
39282   RgnHandle clipRgn) ;
39283 extern void
39284 SetPortPenPixPat(
39285   CGrafPtr port,
39286   PixPatHandle penPattern) ;
39287 extern void
39288 SetPortFillPixPat(
39289   CGrafPtr port,
39290   PixPatHandle penPattern) ;
39291 extern void
39292 SetPortBackPixPat(
39293   CGrafPtr port,
39294   PixPatHandle backPattern) ;
39295 extern void
39296 SetPortPenSize(
39297   CGrafPtr port,
39298   Point penSize) ;
39299 extern void
39300 SetPortPenMode(
39301   CGrafPtr port,
39302   SInt32 penMode) ;
39303 extern void
39304 SetPortFracHPenLocation(
39305   CGrafPtr port,
39306   short pnLocHFrac) ;
39307 extern Rect *
39308 GetPixBounds(
39309   PixMapHandle pixMap,
39310   Rect * bounds) ;
39311 extern short
39312 GetPixDepth(PixMapHandle pixMap) ;
39313 extern long
39314 GetQDGlobalsRandomSeed(void) ;
39315 extern BitMap *
39316 GetQDGlobalsScreenBits(BitMap * screenBits) ;
39317 extern Cursor *
39318 GetQDGlobalsArrow(Cursor * arrow) ;
39319 extern Pattern *
39320 GetQDGlobalsDarkGray(Pattern * dkGray) ;
39321 extern Pattern *
39322 GetQDGlobalsLightGray(Pattern * ltGray) ;
39323 extern Pattern *
39324 GetQDGlobalsGray(Pattern * gray) ;
39325 extern Pattern *
39326 GetQDGlobalsBlack(Pattern * black) ;
39327 extern Pattern *
39328 GetQDGlobalsWhite(Pattern * white) ;
39329 extern CGrafPtr
39330 GetQDGlobalsThePort(void) ;
39331 extern void
39332 SetQDGlobalsRandomSeed(long randomSeed) ;
39333 extern void
39334 SetQDGlobalsArrow(const Cursor * arrow) ;
39335 extern Rect *
39336 GetRegionBounds(
39337   RgnHandle region,
39338   Rect * bounds) ;
39339 extern Boolean
39340 IsRegionRectangular(RgnHandle region) ;
39341 extern CGrafPtr
39342 CreateNewPort(void) ;
39343 extern void
39344 DisposePort(CGrafPtr port) ;
39345 extern void
39346 SetQDError(OSErr err) ;
39347 extern Point *
39348 QDLocalToGlobalPoint(
39349   CGrafPtr port,
39350   Point * point) ;
39351 extern Point *
39352 QDGlobalToLocalPoint(
39353   CGrafPtr port,
39354   Point * point) ;
39355 extern Rect *
39356 QDLocalToGlobalRect(
39357   CGrafPtr port,
39358   Rect * bounds) ;
39359 extern Rect *
39360 QDGlobalToLocalRect(
39361   CGrafPtr port,
39362   Rect * bounds) ;
39363 extern RgnHandle
39364 QDLocalToGlobalRegion(
39365   CGrafPtr port,
39366   RgnHandle region) ;
39367 extern RgnHandle
39368 QDGlobalToLocalRegion(
39369   CGrafPtr port,
39370   RgnHandle region) ;
39371 extern Boolean
39372 QDIsPortBuffered(CGrafPtr port) ;
39373 extern Boolean
39374 QDIsPortBufferDirty(CGrafPtr port) ;
39375 extern void
39376 QDFlushPortBuffer(
39377   CGrafPtr port,
39378   RgnHandle region) ;
39379 extern OSStatus
39380 QDGetDirtyRegion(
39381   CGrafPtr port,
39382   RgnHandle rgn) ;
39383 extern OSStatus
39384 QDSetDirtyRegion(
39385   CGrafPtr port,
39386   RgnHandle rgn) ;
39387 extern OSStatus
39388 QDAddRectToDirtyRegion(
39389   CGrafPtr inPort,
39390   const Rect * inBounds) ;
39391 extern OSStatus
39392 QDAddRegionToDirtyRegion(
39393   CGrafPtr inPort,
39394   RgnHandle inRegion) ;
39395 extern OSStatus
39396 CreateCGContextForPort(
39397   CGrafPtr inPort,
39398   CGContextRef * outContext) ;
39399 extern OSStatus
39400 ClipCGContextToRegion(
39401   CGContextRef gc,
39402   const Rect * portRect,
39403   RgnHandle region) ;
39404 extern OSStatus
39405 SyncCGContextOriginWithPort(
39406   CGContextRef inContext,
39407   CGrafPtr port) ;
39408 extern OSStatus
39409 QDBeginCGContext(
39410   CGrafPtr inPort,
39411   CGContextRef * outContext) ;
39412 extern OSStatus
39413 QDEndCGContext(
39414   CGrafPtr inPort,
39415   CGContextRef * inoutContext) ;
39416 typedef struct OpaqueQDRegionBitsRef* QDRegionBitsRef;
39417 extern QDRegionBitsRef
39418 QDSaveRegionBits(RgnHandle region) ;
39419 extern OSStatus
39420 QDRestoreRegionBits(
39421   RgnHandle region,
39422   QDRegionBitsRef regionBits) ;
39423 extern OSStatus
39424 QDDisposeRegionBits(QDRegionBitsRef regionBits) ;
39425 extern CGrafPtr
39426 CreateNewPortForCGDisplayID(UInt32 inCGDisplayID) ;
39427 extern void
39428 QDDisplayWaitCursor(Boolean forceWaitCursor) ;
39429 extern void
39430 QDSetPatternOrigin(Point origin) ;
39431 extern void
39432 QDGetPatternOrigin(Point * origin) ;
39433 extern Boolean
39434 QDIsNamedPixMapCursorRegistered(const char name[128]) ;
39435 extern OSStatus
39436 QDRegisterNamedPixMapCursor(
39437   PixMapHandle crsrData,
39438   PixMapHandle crsrMask,
39439   Point hotSpot,
39440   const char name[128]) ;
39441 extern OSStatus
39442 QDUnregisterNamedPixMapCursur(const char name[128]) ;
39443 extern OSStatus
39444 QDSetNamedPixMapCursor(const char name[128]) ;
39445 extern OSStatus
39446 QDSetCursorScale(float scale) ;
39447
39448
39449
39450
39451 enum {
39452   kQDUseDefaultTextRendering = 0,
39453
39454   kQDUseTrueTypeScalerGlyphs = (1 << 0),
39455   kQDUseCGTextRendering = (1 << 1),
39456   kQDUseCGTextMetrics = (1 << 2),
39457   kQDSupportedFlags = kQDUseTrueTypeScalerGlyphs | kQDUseCGTextRendering | kQDUseCGTextMetrics,
39458   kQDDontChangeFlags = (long)0xFFFFFFFF
39459 };
39460 extern UInt32
39461 QDSwapTextFlags(UInt32 newFlags) ;
39462 extern UInt32
39463 QDSwapPortTextFlags(
39464   CGrafPtr port,
39465   UInt32 newFlags) ;
39466 extern SInt16
39467 LMGetScrVRes(void) ;
39468 extern void
39469 LMSetScrVRes(SInt16 value) ;
39470 extern SInt16
39471 LMGetScrHRes(void) ;
39472 extern void
39473 LMSetScrHRes(SInt16 value) ;
39474 extern GDHandle
39475 LMGetMainDevice(void) ;
39476 extern void
39477 LMSetMainDevice(GDHandle value) ;
39478 extern GDHandle
39479 LMGetDeviceList(void) ;
39480 extern void
39481 LMSetDeviceList(GDHandle value) ;
39482 extern Handle
39483 LMGetQDColors(void) ;
39484 extern void
39485 LMSetQDColors(Handle value) ;
39486 extern Handle
39487 LMGetWidthListHand(void) ;
39488 extern void
39489 LMSetWidthListHand(Handle value) ;
39490 extern UInt8
39491 LMGetHiliteMode(void) ;
39492 extern void
39493 LMSetHiliteMode(UInt8 value) ;
39494 extern Ptr
39495 LMGetWidthPtr(void) ;
39496 extern void
39497 LMSetWidthPtr(Ptr value) ;
39498 extern Handle
39499 LMGetWidthTabHandle(void) ;
39500 extern void
39501 LMSetWidthTabHandle(Handle value) ;
39502 extern SInt32
39503 LMGetLastSPExtra(void) ;
39504 extern void
39505 LMSetLastSPExtra(SInt32 value) ;
39506 extern Handle
39507 LMGetLastFOND(void) ;
39508 extern void
39509 LMSetLastFOND(Handle value) ;
39510 extern UInt8
39511 LMGetFractEnable(void) ;
39512 extern void
39513 LMSetFractEnable(UInt8 value) ;
39514 extern GDHandle
39515 LMGetTheGDevice(void) ;
39516 extern void
39517 LMSetTheGDevice(GDHandle value) ;
39518 extern void
39519 LMGetHiliteRGB(RGBColor * hiliteRGBValue) ;
39520 extern void
39521 LMSetHiliteRGB(const RGBColor * hiliteRGBValue) ;
39522 extern Boolean
39523 LMGetCursorNew(void) ;
39524 extern void
39525 LMSetCursorNew(Boolean value) ;
39526
39527
39528 }
39529
39530
39531
39532 extern "C" {
39533
39534
39535 enum {
39536   pixPurgeBit = 0,
39537   noNewDeviceBit = 1,
39538   useTempMemBit = 2,
39539   keepLocalBit = 3,
39540   useDistantHdwrMemBit = 4,
39541   useLocalHdwrMemBit = 5,
39542   pixelsPurgeableBit = 6,
39543   pixelsLockedBit = 7,
39544   mapPixBit = 16,
39545   newDepthBit = 17,
39546   alignPixBit = 18,
39547   newRowBytesBit = 19,
39548   reallocPixBit = 20,
39549   clipPixBit = 28,
39550   stretchPixBit = 29,
39551   ditherPixBit = 30,
39552   gwFlagErrBit = 31
39553 };
39554
39555 enum {
39556   pixPurge = 1L << pixPurgeBit,
39557   noNewDevice = 1L << noNewDeviceBit,
39558   useTempMem = 1L << useTempMemBit,
39559   keepLocal = 1L << keepLocalBit,
39560   useDistantHdwrMem = 1L << useDistantHdwrMemBit,
39561   useLocalHdwrMem = 1L << useLocalHdwrMemBit,
39562   pixelsPurgeable = 1L << pixelsPurgeableBit,
39563   pixelsLocked = 1L << pixelsLockedBit,
39564   kAllocDirectDrawSurface = 1L << 14,
39565   mapPix = 1L << mapPixBit,
39566   newDepth = 1L << newDepthBit,
39567   alignPix = 1L << alignPixBit,
39568   newRowBytes = 1L << newRowBytesBit,
39569   reallocPix = 1L << reallocPixBit,
39570   clipPix = 1L << clipPixBit,
39571   stretchPix = 1L << stretchPixBit,
39572   ditherPix = 1L << ditherPixBit,
39573   gwFlagErr = 1L << gwFlagErrBit
39574 };
39575
39576 typedef unsigned long GWorldFlags;
39577
39578 typedef CGrafPtr GWorldPtr;
39579 extern QDErr
39580 NewGWorld(
39581   GWorldPtr * offscreenGWorld,
39582   short PixelDepth,
39583   const Rect * boundsRect,
39584   CTabHandle cTable,
39585   GDHandle aGDevice,
39586   GWorldFlags flags) ;
39587
39588
39589
39590 enum {
39591   deviceIsIndirect = (1L << 0),
39592   deviceNeedsLock = (1L << 1),
39593   deviceIsStatic = (1L << 2),
39594   deviceIsExternalBuffer = (1L << 3),
39595   deviceIsDDSurface = (1L << 4),
39596   deviceIsDCISurface = (1L << 5),
39597   deviceIsGDISurface = (1L << 6),
39598   deviceIsAScreen = (1L << 7),
39599   deviceIsOverlaySurface = (1L << 8)
39600 };
39601 extern QDErr
39602 NewGWorldFromPtr(
39603   GWorldPtr * offscreenGWorld,
39604   unsigned long PixelFormat,
39605   const Rect * boundsRect,
39606   CTabHandle cTable,
39607   GDHandle aGDevice,
39608   GWorldFlags flags,
39609   Ptr newBuffer,
39610   long rowBytes) ;
39611 extern Boolean
39612 LockPixels(PixMapHandle pm) ;
39613 extern void
39614 UnlockPixels(PixMapHandle pm) ;
39615 extern GWorldFlags
39616 UpdateGWorld(
39617   GWorldPtr * offscreenGWorld,
39618   short pixelDepth,
39619   const Rect * boundsRect,
39620   CTabHandle cTable,
39621   GDHandle aGDevice,
39622   GWorldFlags flags) ;
39623 extern void
39624 DisposeGWorld(GWorldPtr offscreenGWorld) ;
39625 extern void
39626 GetGWorld(
39627   CGrafPtr * port,
39628   GDHandle * gdh) ;
39629 extern void
39630 SetGWorld(
39631   CGrafPtr port,
39632   GDHandle gdh) ;
39633 extern void
39634 CTabChanged(CTabHandle ctab) ;
39635 extern void
39636 PixPatChanged(PixPatHandle ppat) ;
39637 extern void
39638 PortChanged(GrafPtr port) ;
39639 extern void
39640 GDeviceChanged(GDHandle gdh) ;
39641 extern void
39642 AllowPurgePixels(PixMapHandle pm) ;
39643 extern void
39644 NoPurgePixels(PixMapHandle pm) ;
39645 extern GWorldFlags
39646 GetPixelsState(PixMapHandle pm) ;
39647 extern void
39648 SetPixelsState(
39649   PixMapHandle pm,
39650   GWorldFlags state) ;
39651 extern Ptr
39652 GetPixBaseAddr(PixMapHandle pm) ;
39653 extern long
39654 GetPixRowBytes(PixMapHandle pm) ;
39655 extern QDErr
39656 NewScreenBuffer(
39657   const Rect * globalRect,
39658   Boolean purgeable,
39659   GDHandle * gdh,
39660   PixMapHandle * offscreenPixMap) ;
39661 extern void
39662 DisposeScreenBuffer(PixMapHandle offscreenPixMap) ;
39663 extern GDHandle
39664 GetGWorldDevice(GWorldPtr offscreenGWorld) ;
39665 extern Boolean
39666 QDDone(GrafPtr port) ;
39667 extern long
39668 OffscreenVersion(void) ;
39669 extern QDErr
39670 NewTempScreenBuffer(
39671   const Rect * globalRect,
39672   Boolean purgeable,
39673   GDHandle * gdh,
39674   PixMapHandle * offscreenPixMap) ;
39675 extern Boolean
39676 PixMap32Bit(PixMapHandle pmHandle) ;
39677 extern PixMapHandle
39678 GetGWorldPixMap(GWorldPtr offscreenGWorld) ;
39679
39680
39681
39682
39683 }
39684
39685
39686
39687 extern "C" {
39688
39689
39690 typedef struct QDPict* QDPictRef;
39691 extern QDPictRef
39692 QDPictCreateWithProvider(CGDataProviderRef provider) ;
39693 extern QDPictRef
39694 QDPictCreateWithURL(CFURLRef url) ;
39695 extern QDPictRef
39696 QDPictRetain(QDPictRef pictRef) ;
39697 extern void
39698 QDPictRelease(QDPictRef pictRef) ;
39699 extern CGRect
39700 QDPictGetBounds(QDPictRef pictRef) ;
39701 extern void
39702 QDPictGetResolution(
39703   QDPictRef pictRef,
39704   float * xRes,
39705   float * yRes) ;
39706 extern OSStatus
39707 QDPictDrawToCGContext(
39708   CGContextRef ctx,
39709   CGRect rect,
39710   QDPictRef pictRef) ;
39711
39712
39713
39714
39715 }
39716
39717
39718
39719
39720
39721
39722
39723 extern "C" {
39724
39725
39726
39727 enum {
39728   systemFont = 0,
39729   applFont = 1
39730 };
39731
39732 enum {
39733   kFMDefaultOptions = kNilOptions
39734 };
39735
39736
39737 enum {
39738   kFMDefaultActivationContext = kFMDefaultOptions,
39739   kFMGlobalActivationContext = 0x00000001,
39740   kFMLocalActivationContext = kFMDefaultActivationContext
39741 };
39742
39743
39744 enum {
39745   kFMDefaultIterationScope = kFMDefaultOptions,
39746   kFMGlobalIterationScope = 0x00000001,
39747   kFMLocalIterationScope = kFMDefaultIterationScope
39748 };
39749
39750
39751
39752 enum {
39753   kPlatformDefaultGuiFontID = applFont
39754 };
39755
39756 enum {
39757   commandMark = 17,
39758   checkMark = 18,
39759   diamondMark = 19,
39760   appleMark = 20
39761 };
39762
39763 enum {
39764   propFont = 36864L,
39765   prpFntH = 36865L,
39766   prpFntW = 36866L,
39767   prpFntHW = 36867L,
39768   fixedFont = 45056L,
39769   fxdFntH = 45057L,
39770   fxdFntW = 45058L,
39771   fxdFntHW = 45059L,
39772   fontWid = 44208L
39773 };
39774
39775 struct FMInput {
39776   short family;
39777   short size;
39778   Style face;
39779   Boolean needBits;
39780   short device;
39781   Point numer;
39782   Point denom;
39783 };
39784 typedef struct FMInput FMInput;
39785 struct FMOutput {
39786   short errNum;
39787   Handle fontHandle;
39788   UInt8 boldPixels;
39789   UInt8 italicPixels;
39790   UInt8 ulOffset;
39791   UInt8 ulShadow;
39792   UInt8 ulThick;
39793   UInt8 shadowPixels;
39794   SInt8 extra;
39795   UInt8 ascent;
39796   UInt8 descent;
39797   UInt8 widMax;
39798   SInt8 leading;
39799   SInt8 curStyle;
39800   Point numer;
39801   Point denom;
39802 };
39803 typedef struct FMOutput FMOutput;
39804 typedef FMOutput * FMOutputPtr;
39805 typedef FMOutputPtr FMOutPtr;
39806 struct FMetricRec {
39807   Fixed ascent;
39808   Fixed descent;
39809   Fixed leading;
39810   Fixed widMax;
39811   Handle wTabHandle;
39812 };
39813 typedef struct FMetricRec FMetricRec;
39814 typedef FMetricRec * FMetricRecPtr;
39815 typedef FMetricRecPtr * FMetricRecHandle;
39816 extern void
39817 GetFontName(
39818   short familyID,
39819   Str255 name) ;
39820 extern void
39821 GetFNum(
39822   ConstStr255Param name,
39823   short * familyID) ;
39824 extern Boolean
39825 RealFont(
39826   short fontNum,
39827   short size) ;
39828 extern FMOutPtr
39829 FMSwapFont(const FMInput * inRec) ;
39830 extern void
39831 SetFScaleDisable(Boolean fscaleDisable) ;
39832 extern void
39833 FontMetrics(FMetricRecPtr theMetrics) ;
39834 extern void
39835 SetFractEnable(Boolean fractEnable) ;
39836 extern short
39837 GetDefFontSize(void) ;
39838 extern Boolean
39839 IsOutline(
39840   Point numer,
39841   Point denom) ;
39842 extern void
39843 SetOutlinePreferred(Boolean outlinePreferred) ;
39844 extern Boolean
39845 GetOutlinePreferred(void) ;
39846 extern OSErr
39847 OutlineMetrics(
39848   short byteCount,
39849   const void * textPtr,
39850   Point numer,
39851   Point denom,
39852   short * yMax,
39853   short * yMin,
39854   FixedPtr awArray,
39855   FixedPtr lsbArray,
39856   RectPtr boundsArray) ;
39857 extern void
39858 SetPreserveGlyph(Boolean preserveGlyph) ;
39859 extern Boolean
39860 GetPreserveGlyph(void) ;
39861 extern short
39862 GetSysFont(void) ;
39863 extern short
39864 GetAppFont(void) ;
39865 extern OSStatus
39866 SetAntiAliasedTextEnabled(
39867   Boolean iEnable,
39868   SInt16 iMinFontSize) ;
39869 extern Boolean
39870 IsAntiAliasedTextEnabled(SInt16 * oMinFontSize) ;
39871 extern void
39872 QDTextBounds(
39873   short byteCount,
39874   const void * textAddr,
39875   Rect * bounds) ;
39876 extern OSErr
39877 FetchFontInfo(
39878   SInt16 fontID,
39879   SInt16 fontSize,
39880   SInt16 fontStyle,
39881   FontInfo * info) ;
39882 extern OSStatus
39883 FMCreateFontFamilyIterator(
39884   const FMFilter * iFilter,
39885   void * iRefCon,
39886   OptionBits iOptions,
39887   FMFontFamilyIterator * ioIterator) ;
39888 extern OSStatus
39889 FMDisposeFontFamilyIterator(FMFontFamilyIterator * ioIterator) ;
39890 extern OSStatus
39891 FMResetFontFamilyIterator(
39892   const FMFilter * iFilter,
39893   void * iRefCon,
39894   OptionBits iOptions,
39895   FMFontFamilyIterator * ioIterator) ;
39896 extern OSStatus
39897 FMGetNextFontFamily(
39898   FMFontFamilyIterator * ioIterator,
39899   FMFontFamily * oFontFamily) ;
39900 extern OSStatus
39901 FMCreateFontIterator(
39902   const FMFilter * iFilter,
39903   void * iRefCon,
39904   OptionBits iOptions,
39905   FMFontIterator * ioIterator) ;
39906 extern OSStatus
39907 FMDisposeFontIterator(FMFontIterator * ioIterator) ;
39908 extern OSStatus
39909 FMResetFontIterator(
39910   const FMFilter * iFilter,
39911   void * iRefCon,
39912   OptionBits iOptions,
39913   FMFontIterator * ioIterator) ;
39914 extern OSStatus
39915 FMGetNextFont(
39916   FMFontIterator * ioIterator,
39917   FMFont * oFont) ;
39918 extern OSStatus
39919 FMCreateFontFamilyInstanceIterator(
39920   FMFontFamily iFontFamily,
39921   FMFontFamilyInstanceIterator * ioIterator) ;
39922 extern OSStatus
39923 FMDisposeFontFamilyInstanceIterator(FMFontFamilyInstanceIterator * ioIterator) ;
39924 extern OSStatus
39925 FMResetFontFamilyInstanceIterator(
39926   FMFontFamily iFontFamily,
39927   FMFontFamilyInstanceIterator * ioIterator) ;
39928 extern OSStatus
39929 FMGetNextFontFamilyInstance(
39930   FMFontFamilyInstanceIterator * ioIterator,
39931   FMFont * oFont,
39932   FMFontStyle * oStyle,
39933   FMFontSize * oSize) ;
39934 extern FMFontFamily
39935 FMGetFontFamilyFromName(ConstStr255Param iName) ;
39936 extern OSStatus
39937 FMGetFontFamilyName(
39938   FMFontFamily iFontFamily,
39939   Str255 oName) ;
39940 extern OSStatus
39941 FMGetFontFamilyTextEncoding(
39942   FMFontFamily iFontFamily,
39943   TextEncoding * oTextEncoding) ;
39944 extern OSStatus
39945 FMGetFontFamilyGeneration(
39946   FMFontFamily iFontFamily,
39947   FMGeneration * oGeneration) ;
39948 extern OSStatus
39949 FMGetFontFormat(
39950   FMFont iFont,
39951   FourCharCode * oFormat) ;
39952 extern OSStatus
39953 FMGetFontTableDirectory(
39954   FMFont iFont,
39955   ByteCount iLength,
39956   void * iBuffer,
39957   ByteCount * oActualLength) ;
39958 extern OSStatus
39959 FMGetFontTable(
39960   FMFont iFont,
39961   FourCharCode iTag,
39962   ByteOffset iOffset,
39963   ByteCount iLength,
39964   void * iBuffer,
39965   ByteCount * oActualLength) ;
39966 extern OSStatus
39967 FMGetFontGeneration(
39968   FMFont iFont,
39969   FMGeneration * oGeneration) ;
39970 extern OSStatus
39971 FMGetFontContainer(
39972   FMFont iFont,
39973   FSSpec * oFontContainer) ;
39974 extern OSStatus
39975 FMGetFontFromFontFamilyInstance(
39976   FMFontFamily iFontFamily,
39977   FMFontStyle iStyle,
39978   FMFont * oFont,
39979   FMFontStyle * oIntrinsicStyle) ;
39980 extern OSStatus
39981 FMGetFontFamilyInstanceFromFont(
39982   FMFont iFont,
39983   FMFontFamily * oFontFamily,
39984   FMFontStyle * oStyle) ;
39985 extern ATSFontRef
39986 FMGetATSFontRefFromFont(FMFont iFont) ;
39987 extern ATSFontFamilyRef
39988 FMGetATSFontFamilyRefFromFontFamily(FMFontFamily iFamily) ;
39989 extern FMFont
39990 FMGetFontFromATSFontRef(ATSFontRef iFont) ;
39991 extern FMFontFamily
39992 FMGetFontFamilyFromATSFontFamilyRef(ATSFontFamilyRef iFamily) ;
39993 extern OSStatus
39994 FMActivateFonts(
39995   const FSSpec * iFontContainer,
39996   const FMFilter * iFilter,
39997   void * iRefCon,
39998   OptionBits iOptions) ;
39999 extern OSStatus
40000 FMDeactivateFonts(
40001   const FSSpec * iFontContainer,
40002   const FMFilter * iFilter,
40003   void * iRefCon,
40004   OptionBits iOptions) ;
40005 extern FMGeneration
40006 FMGetGeneration(void) ;
40007 extern OSStatus
40008 FMGetFontContainerFromFontFamilyInstance(
40009   FMFontFamily iFontFamily,
40010   FMFontStyle iStyle,
40011   FMFontSize iFontSize,
40012   FSSpec * oFontContainer) ;
40013 extern OSStatus
40014 FMGetFontFamilyResource(
40015   FMFontFamily iFontFamily,
40016   FMFontStyle iFontStyle,
40017   FMFontSize iFontSize,
40018   ByteCount iBufferSize,
40019   void * ioBuffer,
40020   ByteCount * oSize) ;
40021
40022
40023
40024 typedef FMFontFamily FontFamilyID;
40025 typedef FMFontSize FontPointSize;
40026
40027
40028
40029
40030
40031
40032 enum {
40033   kFMUseGlobalScopeOption = 0x00000001
40034 };
40035
40036 enum {
40037   kFontIDNewYork = 2,
40038   kFontIDGeneva = 3,
40039   kFontIDMonaco = 4,
40040   kFontIDVenice = 5,
40041   kFontIDLondon = 6,
40042   kFontIDAthens = 7,
40043   kFontIDSanFrancisco = 8,
40044   kFontIDToronto = 9,
40045   kFontIDCairo = 11,
40046   kFontIDLosAngeles = 12,
40047   kFontIDTimes = 20,
40048   kFontIDHelvetica = 21,
40049   kFontIDCourier = 22,
40050   kFontIDSymbol = 23,
40051   kFontIDMobile = 24
40052 };
40053 struct WidEntry {
40054   short widStyle;
40055 };
40056 typedef struct WidEntry WidEntry;
40057 struct WidTable {
40058   short numWidths;
40059 };
40060 typedef struct WidTable WidTable;
40061 struct AsscEntry {
40062   short fontSize;
40063   short fontStyle;
40064   short fontID;
40065 };
40066 typedef struct AsscEntry AsscEntry;
40067 struct FontAssoc {
40068   short numAssoc;
40069 };
40070 typedef struct FontAssoc FontAssoc;
40071 struct StyleTable {
40072   short fontClass;
40073   long offset;
40074   long reserved;
40075   char indexes[48];
40076 };
40077 typedef struct StyleTable StyleTable;
40078 struct NameTable {
40079   short stringCount;
40080   Str255 baseFontName;
40081 };
40082 typedef struct NameTable NameTable;
40083 struct KernPair {
40084   char kernFirst;
40085   char kernSecond;
40086   short kernWidth;
40087 };
40088 typedef struct KernPair KernPair;
40089 struct KernEntry {
40090   short kernStyle;
40091   short kernLength;
40092 };
40093 typedef struct KernEntry KernEntry;
40094 struct KernTable {
40095   short numKerns;
40096 };
40097 typedef struct KernTable KernTable;
40098 struct WidthTable {
40099   Fixed tabData[256];
40100   Handle tabFont;
40101   long sExtra;
40102   long style;
40103   short fID;
40104   short fSize;
40105   short face;
40106   short device;
40107   Point inNumer;
40108   Point inDenom;
40109   short aFID;
40110   Handle fHand;
40111   Boolean usedFam;
40112   UInt8 aFace;
40113   short vOutput;
40114   short hOutput;
40115   short vFactor;
40116   short hFactor;
40117   short aSize;
40118   short tabSize;
40119 };
40120 typedef struct WidthTable WidthTable;
40121 typedef WidthTable * WidthTablePtr;
40122 typedef WidthTablePtr * WidthTableHdl;
40123 struct FamRec {
40124   short ffFlags;
40125   short ffFamID;
40126   short ffFirstChar;
40127   short ffLastChar;
40128   short ffAscent;
40129   short ffDescent;
40130   short ffLeading;
40131   short ffWidMax;
40132   long ffWTabOff;
40133   long ffKernOff;
40134   long ffStylOff;
40135   short ffProperty[9];
40136   short ffIntl[2];
40137   short ffVersion;
40138 };
40139 typedef struct FamRec FamRec;
40140 struct FontRec {
40141   short fontType;
40142   short firstChar;
40143   short lastChar;
40144   short widMax;
40145   short kernMax;
40146   short nDescent;
40147   short fRectWidth;
40148   short fRectHeight;
40149   unsigned short owTLoc;
40150   short ascent;
40151   short descent;
40152   short leading;
40153   short rowWords;
40154 };
40155 typedef struct FontRec FontRec;
40156 typedef FontRec * FontRecPtr;
40157 typedef FontRecPtr * FontRecHdl;
40158
40159
40160 }
40161
40162
40163
40164 extern "C" {
40165
40166
40167
40168 enum {
40169   pmCourteous = 0,
40170   pmDithered = 0x0001,
40171   pmTolerant = 0x0002,
40172   pmAnimated = 0x0004,
40173   pmExplicit = 0x0008,
40174   pmWhite = 0x0010,
40175   pmBlack = 0x0020,
40176   pmInhibitG2 = 0x0100,
40177   pmInhibitC2 = 0x0200,
40178   pmInhibitG4 = 0x0400,
40179   pmInhibitC4 = 0x0800,
40180   pmInhibitG8 = 0x1000,
40181   pmInhibitC8 = 0x2000,
40182   pmNoUpdates = 0x8000,
40183   pmBkUpdates = 0xA000,
40184   pmFgUpdates = 0xC000,
40185   pmAllUpdates = 0xE000
40186 };
40187
40188 struct ColorInfo {
40189   RGBColor ciRGB;
40190   short ciUsage;
40191   short ciTolerance;
40192   short ciDataFields[3];
40193 };
40194 typedef struct ColorInfo ColorInfo;
40195 typedef ColorInfo * ColorInfoPtr;
40196 typedef ColorInfoPtr * ColorInfoHandle;
40197 struct Palette {
40198   short pmEntries;
40199   short pmDataFields[7];
40200   ColorInfo pmInfo[1];
40201 };
40202 typedef struct Palette Palette;
40203 typedef Palette * PalettePtr;
40204 typedef PalettePtr * PaletteHandle;
40205 extern void
40206 InitPalettes(void) ;
40207 extern PaletteHandle
40208 NewPalette(
40209   short entries,
40210   CTabHandle srcColors,
40211   short srcUsage,
40212   short srcTolerance) ;
40213 extern PaletteHandle
40214 GetNewPalette(short PaletteID) ;
40215 extern void
40216 DisposePalette(PaletteHandle srcPalette) ;
40217 extern void
40218 ActivatePalette(WindowRef srcWindow) ;
40219 extern void
40220 SetPalette(
40221   WindowRef dstWindow,
40222   PaletteHandle srcPalette,
40223   Boolean cUpdates) ;
40224 extern void
40225 NSetPalette(
40226   WindowRef dstWindow,
40227   PaletteHandle srcPalette,
40228   short nCUpdates) ;
40229 extern PaletteHandle
40230 GetPalette(WindowRef srcWindow) ;
40231 extern void
40232 CopyPalette(
40233   PaletteHandle srcPalette,
40234   PaletteHandle dstPalette,
40235   short srcEntry,
40236   short dstEntry,
40237   short dstLength) ;
40238 extern void
40239 PmForeColor(short dstEntry) ;
40240 extern void
40241 PmBackColor(short dstEntry) ;
40242 extern void
40243 AnimateEntry(
40244   WindowRef dstWindow,
40245   short dstEntry,
40246   const RGBColor * srcRGB) ;
40247 extern void
40248 AnimatePalette(
40249   WindowRef dstWindow,
40250   CTabHandle srcCTab,
40251   short srcIndex,
40252   short dstEntry,
40253   short dstLength) ;
40254 extern void
40255 GetEntryColor(
40256   PaletteHandle srcPalette,
40257   short srcEntry,
40258   RGBColor * dstRGB) ;
40259 extern void
40260 SetEntryColor(
40261   PaletteHandle dstPalette,
40262   short dstEntry,
40263   const RGBColor * srcRGB) ;
40264 extern void
40265 GetEntryUsage(
40266   PaletteHandle srcPalette,
40267   short srcEntry,
40268   short * dstUsage,
40269   short * dstTolerance) ;
40270 extern void
40271 SetEntryUsage(
40272   PaletteHandle dstPalette,
40273   short dstEntry,
40274   short srcUsage,
40275   short srcTolerance) ;
40276 extern void
40277 CTab2Palette(
40278   CTabHandle srcCTab,
40279   PaletteHandle dstPalette,
40280   short srcUsage,
40281   short srcTolerance) ;
40282 extern void
40283 Palette2CTab(
40284   PaletteHandle srcPalette,
40285   CTabHandle dstCTab) ;
40286 extern long
40287 Entry2Index(short entry) ;
40288 extern void
40289 RestoreDeviceClut(GDHandle gd) ;
40290 extern void
40291 ResizePalette(
40292   PaletteHandle p,
40293   short size) ;
40294 extern void
40295 SaveFore(ColorSpec * c) ;
40296 extern void
40297 SaveBack(ColorSpec * c) ;
40298 extern void
40299 RestoreFore(const ColorSpec * c) ;
40300 extern void
40301 RestoreBack(const ColorSpec * c) ;
40302 extern OSErr
40303 SetDepth(
40304   GDHandle gd,
40305   short depth,
40306   short whichFlags,
40307   short flags) ;
40308 extern short
40309 HasDepth(
40310   GDHandle gd,
40311   short depth,
40312   short whichFlags,
40313   short flags) ;
40314 extern short
40315 PMgrVersion(void) ;
40316 extern void
40317 SetPaletteUpdates(
40318   PaletteHandle p,
40319   short updates) ;
40320 extern short
40321 GetPaletteUpdates(PaletteHandle p) ;
40322 extern Boolean
40323 GetGray(
40324   GDHandle device,
40325   const RGBColor * backGround,
40326   RGBColor * foreGround) ;
40327
40328
40329
40330
40331
40332
40333
40334 }
40335
40336
40337
40338 extern "C" {
40339
40340
40341
40342
40343 enum {
40344   returnColorTable = 0x0001,
40345   returnPalette = 0x0002,
40346   recordComments = 0x0004,
40347   recordFontInfo = 0x0008,
40348   suppressBlackAndWhite = 0x0010
40349 };
40350
40351 enum {
40352
40353   systemMethod = 0,
40354   popularMethod = 1,
40355   medianMethod = 2
40356 };
40357
40358 enum {
40359
40360   ColorBankIsCustom = -1,
40361   ColorBankIsExactAnd555 = 0,
40362   ColorBankIs555 = 1
40363 };
40364
40365 typedef long PictInfoID;
40366 struct CommentSpec {
40367   short count;
40368   short ID;
40369 };
40370 typedef struct CommentSpec CommentSpec;
40371 typedef CommentSpec * CommentSpecPtr;
40372 typedef CommentSpecPtr * CommentSpecHandle;
40373 struct FontSpec {
40374   short pictFontID;
40375   short sysFontID;
40376   long size[4];
40377   short style;
40378   long nameOffset;
40379 };
40380 typedef struct FontSpec FontSpec;
40381 typedef FontSpec * FontSpecPtr;
40382 typedef FontSpecPtr * FontSpecHandle;
40383 struct PictInfo {
40384   short version;
40385   long uniqueColors;
40386   PaletteHandle thePalette;
40387   CTabHandle theColorTable;
40388   Fixed hRes;
40389   Fixed vRes;
40390   short depth;
40391   Rect sourceRect;
40392   long textCount;
40393   long lineCount;
40394   long rectCount;
40395   long rRectCount;
40396   long ovalCount;
40397   long arcCount;
40398   long polyCount;
40399   long regionCount;
40400   long bitMapCount;
40401   long pixMapCount;
40402   long commentCount;
40403   long uniqueComments;
40404   CommentSpecHandle commentHandle;
40405   long uniqueFonts;
40406   FontSpecHandle fontHandle;
40407   Handle fontNamesHandle;
40408   long reserved1;
40409   long reserved2;
40410 };
40411 typedef struct PictInfo PictInfo;
40412 typedef PictInfo * PictInfoPtr;
40413 typedef PictInfoPtr * PictInfoHandle;
40414 typedef OSErr ( * InitPickMethodProcPtr)(SInt16 colorsRequested, UInt32 *dataRef, SInt16 *colorBankType);
40415 typedef OSErr ( * RecordColorsProcPtr)(UInt32 dataRef, RGBColor *colorsArray, SInt32 colorCount, SInt32 *uniqueColors);
40416 typedef OSErr ( * CalcColorTableProcPtr)(UInt32 dataRef, SInt16 colorsRequested, void *colorBankPtr, CSpecArray resultPtr);
40417 typedef OSErr ( * DisposeColorPickMethodProcPtr)(UInt32 dataRef);
40418 typedef InitPickMethodProcPtr InitPickMethodUPP;
40419 typedef RecordColorsProcPtr RecordColorsUPP;
40420 typedef CalcColorTableProcPtr CalcColorTableUPP;
40421 typedef DisposeColorPickMethodProcPtr DisposeColorPickMethodUPP;
40422 extern InitPickMethodUPP
40423 NewInitPickMethodUPP(InitPickMethodProcPtr userRoutine) ;
40424 extern RecordColorsUPP
40425 NewRecordColorsUPP(RecordColorsProcPtr userRoutine) ;
40426 extern CalcColorTableUPP
40427 NewCalcColorTableUPP(CalcColorTableProcPtr userRoutine) ;
40428 extern DisposeColorPickMethodUPP
40429 NewDisposeColorPickMethodUPP(DisposeColorPickMethodProcPtr userRoutine) ;
40430 extern void
40431 DisposeInitPickMethodUPP(InitPickMethodUPP userUPP) ;
40432 extern void
40433 DisposeRecordColorsUPP(RecordColorsUPP userUPP) ;
40434 extern void
40435 DisposeCalcColorTableUPP(CalcColorTableUPP userUPP) ;
40436 extern void
40437 DisposeDisposeColorPickMethodUPP(DisposeColorPickMethodUPP userUPP) ;
40438 extern OSErr
40439 InvokeInitPickMethodUPP(
40440   SInt16 colorsRequested,
40441   UInt32 * dataRef,
40442   SInt16 * colorBankType,
40443   InitPickMethodUPP userUPP) ;
40444 extern OSErr
40445 InvokeRecordColorsUPP(
40446   UInt32 dataRef,
40447   RGBColor * colorsArray,
40448   SInt32 colorCount,
40449   SInt32 * uniqueColors,
40450   RecordColorsUPP userUPP) ;
40451 extern OSErr
40452 InvokeCalcColorTableUPP(
40453   UInt32 dataRef,
40454   SInt16 colorsRequested,
40455   void * colorBankPtr,
40456   CSpecArray resultPtr,
40457   CalcColorTableUPP userUPP) ;
40458 extern OSErr
40459 InvokeDisposeColorPickMethodUPP(
40460   UInt32 dataRef,
40461   DisposeColorPickMethodUPP userUPP) ;
40462 extern OSErr
40463 GetPictInfo(
40464   PicHandle thePictHandle,
40465   PictInfo * thePictInfo,
40466   short verb,
40467   short colorsRequested,
40468   short colorPickMethod,
40469   short version) ;
40470 extern OSErr
40471 GetPixMapInfo(
40472   PixMapHandle thePixMapHandle,
40473   PictInfo * thePictInfo,
40474   short verb,
40475   short colorsRequested,
40476   short colorPickMethod,
40477   short version) ;
40478 extern OSErr
40479 NewPictInfo(
40480   PictInfoID * thePictInfoID,
40481   short verb,
40482   short colorsRequested,
40483   short colorPickMethod,
40484   short version) ;
40485 extern OSErr
40486 RecordPictInfo(
40487   PictInfoID thePictInfoID,
40488   PicHandle thePictHandle) ;
40489 extern OSErr
40490 RecordPixMapInfo(
40491   PictInfoID thePictInfoID,
40492   PixMapHandle thePixMapHandle) ;
40493 extern OSErr
40494 RetrievePictInfo(
40495   PictInfoID thePictInfoID,
40496   PictInfo * thePictInfo,
40497   short colorsRequested) ;
40498 extern OSErr
40499 DisposePictInfo(PictInfoID thePictInfoID) ;
40500
40501
40502 }
40503
40504
40505
40506 extern "C" {
40507
40508
40509 typedef Fixed ATSUTextMeasurement;
40510
40511
40512
40513
40514
40515
40516
40517 typedef FMFont ATSUFontID;
40518
40519
40520
40521
40522 typedef UInt16 ATSUFontFeatureType;
40523 typedef UInt16 ATSUFontFeatureSelector;
40524
40525
40526
40527
40528 typedef FourCharCode ATSUFontVariationAxis;
40529 typedef Fixed ATSUFontVariationValue;
40530
40531
40532
40533
40534
40535 typedef struct OpaqueATSUTextLayout* ATSUTextLayout;
40536
40537
40538
40539
40540
40541 typedef struct OpaqueATSUStyle* ATSUStyle;
40542
40543
40544
40545
40546
40547 typedef struct OpaqueATSUFontFallbacks* ATSUFontFallbacks;
40548 typedef UInt32 ATSUAttributeTag;
40549 enum {
40550
40551   kATSULineWidthTag = 1L,
40552
40553   kATSULineRotationTag = 2L,
40554
40555   kATSULineDirectionTag = 3L,
40556
40557   kATSULineJustificationFactorTag = 4L,
40558
40559   kATSULineFlushFactorTag = 5L,
40560
40561   kATSULineBaselineValuesTag = 6L,
40562
40563   kATSULineLayoutOptionsTag = 7L,
40564
40565   kATSULineAscentTag = 8L,
40566
40567   kATSULineDescentTag = 9L,
40568
40569   kATSULineLangRegionTag = 10L,
40570
40571   kATSULineTextLocatorTag = 11L,
40572
40573   kATSULineTruncationTag = 12L,
40574
40575   kATSULineFontFallbacksTag = 13L,
40576
40577   kATSULayoutOperationOverrideTag = 15L,
40578
40579   kATSUMaxLineTag = 16L,
40580
40581   kATSULineLanguageTag = 10L,
40582
40583   kATSUCGContextTag = 32767L,
40584
40585
40586
40587   kATSUQDBoldfaceTag = 256L,
40588
40589   kATSUQDItalicTag = 257L,
40590
40591   kATSUQDUnderlineTag = 258L,
40592
40593   kATSUQDCondensedTag = 259L,
40594
40595   kATSUQDExtendedTag = 260L,
40596
40597
40598   kATSUFontTag = 261L,
40599
40600   kATSUSizeTag = 262L,
40601
40602   kATSUColorTag = 263L,
40603
40604
40605   kATSULangRegionTag = 264L,
40606
40607   kATSUVerticalCharacterTag = 265L,
40608
40609   kATSUImposeWidthTag = 266L,
40610
40611   kATSUBeforeWithStreamShiftTag = 267L,
40612
40613   kATSUAfterWithStreamShiftTag = 268L,
40614
40615   kATSUCrossStreamShiftTag = 269L,
40616
40617   kATSUTrackingTag = 270L,
40618
40619   kATSUHangingInhibitFactorTag = 271L,
40620
40621   kATSUKerningInhibitFactorTag = 272L,
40622
40623   kATSUDecompositionFactorTag = 273L,
40624
40625   kATSUBaselineClassTag = 274L,
40626
40627   kATSUPriorityJustOverrideTag = 275L,
40628
40629   kATSUNoLigatureSplitTag = 276L,
40630
40631   kATSUNoCaretAngleTag = 277L,
40632
40633   kATSUSuppressCrossKerningTag = 278L,
40634
40635   kATSUNoOpticalAlignmentTag = 279L,
40636
40637   kATSUForceHangingTag = 280L,
40638
40639   kATSUNoSpecialJustificationTag = 281L,
40640
40641   kATSUStyleTextLocatorTag = 282L,
40642
40643   kATSUStyleRenderingOptionsTag = 283L,
40644
40645   kATSUAscentTag = 284L,
40646
40647   kATSUDescentTag = 285L,
40648
40649   kATSULeadingTag = 286L,
40650
40651   kATSUGlyphSelectorTag = 287L,
40652
40653   kATSURGBAlphaColorTag = 288L,
40654
40655   kATSUFontMatrixTag = 289L,
40656
40657   kATSUMaxStyleTag = 290L,
40658
40659   kATSULanguageTag = 264L,
40660
40661   kATSUMaxATSUITagValue = 65535L
40662 };
40663
40664
40665
40666
40667
40668
40669 typedef void * ATSUAttributeValuePtr;
40670 typedef const void * ConstATSUAttributeValuePtr;
40671 struct ATSUAttributeInfo {
40672   ATSUAttributeTag fTag;
40673   ByteCount fValueSize;
40674 };
40675 typedef struct ATSUAttributeInfo ATSUAttributeInfo;
40676 struct ATSUCaret {
40677   Fixed fX;
40678   Fixed fY;
40679   Fixed fDeltaX;
40680   Fixed fDeltaY;
40681 };
40682 typedef struct ATSUCaret ATSUCaret;
40683
40684
40685
40686
40687
40688
40689 typedef UInt16 ATSUCursorMovementType;
40690 enum {
40691   kATSUByCharacter = 0,
40692   kATSUByTypographicCluster = 1,
40693   kATSUByWord = 2,
40694   kATSUByCharacterCluster = 3,
40695   kATSUByCluster = 1
40696 };
40697
40698
40699
40700
40701
40702 typedef UInt32 ATSULineTruncation;
40703 enum {
40704   kATSUTruncateNone = 0,
40705   kATSUTruncateStart = 1,
40706   kATSUTruncateEnd = 2,
40707   kATSUTruncateMiddle = 3,
40708   kATSUTruncateSpecificationMask = 0x00000007,
40709
40710   kATSUTruncFeatNoSquishing = 0x00000008
40711 };
40712
40713
40714
40715
40716
40717
40718 typedef UInt16 ATSUVerticalCharacterType;
40719 enum {
40720   kATSUStronglyHorizontal = 0,
40721   kATSUStronglyVertical = 1
40722 };
40723
40724
40725
40726
40727
40728
40729
40730 typedef UInt16 ATSUStyleComparison;
40731 enum {
40732   kATSUStyleUnequal = 0,
40733   kATSUStyleContains = 1,
40734   kATSUStyleEquals = 2,
40735   kATSUStyleContainedBy = 3
40736 };
40737 typedef UInt16 ATSUFontFallbackMethod;
40738 enum {
40739   kATSUDefaultFontFallbacks = 0,
40740   kATSULastResortOnlyFallback = 1,
40741   kATSUSequentialFallbacksPreferred = 2,
40742   kATSUSequentialFallbacksExclusive = 3
40743 };
40744 typedef UInt16 ATSUTabType;
40745 enum {
40746   kATSULeftTab = 0,
40747   kATSUCenterTab = 1,
40748   kATSURightTab = 2,
40749   kATSUNumberTabTypes = 3
40750 };
40751
40752
40753
40754
40755
40756
40757 struct ATSUTab {
40758   ATSUTextMeasurement tabPosition;
40759   ATSUTabType tabType;
40760 };
40761 typedef struct ATSUTab ATSUTab;
40762
40763
40764
40765
40766
40767
40768 typedef UInt16 GlyphCollection;
40769 enum {
40770   kGlyphCollectionGID = 0,
40771   kGlyphCollectionAdobeCNS1 = 1,
40772   kGlyphCollectionAdobeGB1 = 2,
40773   kGlyphCollectionAdobeJapan1 = 3,
40774   kGlyphCollectionAdobeJapan2 = 4,
40775   kGlyphCollectionAdobeKorea1 = 5,
40776   kGlyphCollectionUnspecified = 0xFF
40777 };
40778
40779
40780
40781
40782
40783
40784 struct ATSUGlyphSelector {
40785   GlyphCollection collection;
40786   GlyphID glyphID;
40787 };
40788 typedef struct ATSUGlyphSelector ATSUGlyphSelector;
40789 struct ATSUGlyphInfo {
40790   GlyphID glyphID;
40791   UInt16 reserved;
40792   UInt32 layoutFlags;
40793   UniCharArrayOffset charIndex;
40794   ATSUStyle style;
40795   Float32 deltaY;
40796   Float32 idealX;
40797   SInt16 screenX;
40798   SInt16 caretX;
40799 };
40800 typedef struct ATSUGlyphInfo ATSUGlyphInfo;
40801 struct ATSUGlyphInfoArray {
40802   ATSUTextLayout layout;
40803   ItemCount numGlyphs;
40804   ATSUGlyphInfo glyphs[1];
40805 };
40806 typedef struct ATSUGlyphInfoArray ATSUGlyphInfoArray;
40807
40808
40809
40810 typedef UInt32 ATSUHighlightMethod;
40811 enum {
40812   kInvertHighlighting = 0,
40813   kRedrawHighlighting = 1
40814 };
40815
40816 typedef UInt32 ATSUBackgroundDataType;
40817 enum {
40818   kATSUBackgroundColor = 0,
40819   kATSUBackgroundCallback = 1
40820 };
40821
40822 struct ATSURGBAlphaColor {
40823   float red;
40824   float green;
40825   float blue;
40826   float alpha;
40827 };
40828 typedef struct ATSURGBAlphaColor ATSURGBAlphaColor;
40829 typedef ATSURGBAlphaColor ATSUBackgroundColor;
40830 typedef Boolean ( * RedrawBackgroundProcPtr)(ATSUTextLayout iLayout, UniCharArrayOffset iTextOffset, UniCharCount iTextLength, ATSTrapezoid iUnhighlightArea[], ItemCount iTrapezoidCount);
40831 typedef RedrawBackgroundProcPtr RedrawBackgroundUPP;
40832 extern RedrawBackgroundUPP
40833 NewRedrawBackgroundUPP(RedrawBackgroundProcPtr userRoutine) ;
40834 extern void
40835 DisposeRedrawBackgroundUPP(RedrawBackgroundUPP userUPP) ;
40836 extern Boolean
40837 InvokeRedrawBackgroundUPP(
40838   ATSUTextLayout iLayout,
40839   UniCharArrayOffset iTextOffset,
40840   UniCharCount iTextLength,
40841   ATSTrapezoid iUnhighlightArea[],
40842   ItemCount iTrapezoidCount,
40843   RedrawBackgroundUPP userUPP) ;
40844
40845 union ATSUBackgroundData {
40846   ATSUBackgroundColor backgroundColor;
40847   RedrawBackgroundUPP backgroundUPP;
40848 };
40849 typedef union ATSUBackgroundData ATSUBackgroundData;
40850 struct ATSUUnhighlightData {
40851   ATSUBackgroundDataType dataType;
40852   ATSUBackgroundData unhighlightData;
40853 };
40854 typedef struct ATSUUnhighlightData ATSUUnhighlightData;
40855
40856
40857
40858
40859 enum {
40860   kATSULeftToRightBaseDirection = 0,
40861   kATSURightToLeftBaseDirection = 1
40862 };
40863 enum {
40864   kATSUInvalidFontID = 0
40865 };
40866
40867
40868 enum {
40869   kATSUUseLineControlWidth = 0x7FFFFFFF
40870 };
40871
40872
40873 enum {
40874   kATSUNoSelector = 0x0000FFFF
40875 };
40876
40877
40878 enum {
40879   kATSUUseGrafPortPenLoc = (unsigned long)0xFFFFFFFF,
40880   kATSUClearAll = (unsigned long)0xFFFFFFFF
40881 };
40882
40883
40884 enum {
40885   kATSUFromTextBeginning = (unsigned long)0xFFFFFFFF,
40886   kATSUToTextEnd = (unsigned long)0xFFFFFFFF
40887 };
40888 extern OSStatus
40889 ATSUCopyToHandle(
40890   ATSUStyle iStyle,
40891   Handle oStyleHandle) ;
40892 extern OSStatus
40893 ATSUPasteFromHandle(
40894   ATSUStyle iStyle,
40895   Handle iStyleHandle) ;
40896 extern OSStatus
40897 ATSUCreateFontFallbacks(ATSUFontFallbacks * oFontFallback) ;
40898 extern OSStatus
40899 ATSUDisposeFontFallbacks(ATSUFontFallbacks iFontFallbacks) ;
40900 extern OSStatus
40901 ATSUSetObjFontFallbacks(
40902   ATSUFontFallbacks iFontFallbacks,
40903   ItemCount iFontFallbacksCount,
40904   const ATSUFontID iFonts[],
40905   ATSUFontFallbackMethod iFontFallbackMethod) ;
40906 extern OSStatus
40907 ATSUGetObjFontFallbacks(
40908   ATSUFontFallbacks iFontFallbacks,
40909   ItemCount iMaxFontFallbacksCount,
40910   ATSUFontID oFonts[],
40911   ATSUFontFallbackMethod * oFontFallbackMethod,
40912   ItemCount * oActualFallbacksCount) ;
40913 extern OSStatus
40914 ATSUCreateStyle(ATSUStyle * oStyle) ;
40915 extern OSStatus
40916 ATSUCreateAndCopyStyle(
40917   ATSUStyle iStyle,
40918   ATSUStyle * oStyle) ;
40919 extern OSStatus
40920 ATSUDisposeStyle(ATSUStyle iStyle) ;
40921 extern OSStatus
40922 ATSUSetStyleRefCon(
40923   ATSUStyle iStyle,
40924   UInt32 iRefCon) ;
40925 extern OSStatus
40926 ATSUGetStyleRefCon(
40927   ATSUStyle iStyle,
40928   UInt32 * oRefCon) ;
40929 extern OSStatus
40930 ATSUCompareStyles(
40931   ATSUStyle iFirstStyle,
40932   ATSUStyle iSecondStyle,
40933   ATSUStyleComparison * oComparison) ;
40934 extern OSStatus
40935 ATSUCopyAttributes(
40936   ATSUStyle iSourceStyle,
40937   ATSUStyle iDestinationStyle) ;
40938 extern OSStatus
40939 ATSUOverwriteAttributes(
40940   ATSUStyle iSourceStyle,
40941   ATSUStyle iDestinationStyle) ;
40942 extern OSStatus
40943 ATSUUnderwriteAttributes(
40944   ATSUStyle iSourceStyle,
40945   ATSUStyle iDestinationStyle) ;
40946 extern OSStatus
40947 ATSUClearStyle(ATSUStyle iStyle) ;
40948 extern OSStatus
40949 ATSUStyleIsEmpty(
40950   ATSUStyle iStyle,
40951   Boolean * oIsClear) ;
40952 extern OSStatus
40953 ATSUCalculateBaselineDeltas(
40954   ATSUStyle iStyle,
40955   BslnBaselineClass iBaselineClass,
40956   BslnBaselineRecord oBaselineDeltas) ;
40957 extern OSStatus
40958 ATSUSetAttributes(
40959   ATSUStyle iStyle,
40960   ItemCount iAttributeCount,
40961   const ATSUAttributeTag iTag[],
40962   const ByteCount iValueSize[],
40963   const ATSUAttributeValuePtr iValue[]) ;
40964 extern OSStatus
40965 ATSUGetAttribute(
40966   ATSUStyle iStyle,
40967   ATSUAttributeTag iTag,
40968   ByteCount iExpectedValueSize,
40969   ATSUAttributeValuePtr oValue,
40970   ByteCount * oActualValueSize) ;
40971 extern OSStatus
40972 ATSUGetAllAttributes(
40973   ATSUStyle iStyle,
40974   ATSUAttributeInfo oAttributeInfoArray[],
40975   ItemCount iTagValuePairArraySize,
40976   ItemCount * oTagValuePairCount) ;
40977 extern OSStatus
40978 ATSUClearAttributes(
40979   ATSUStyle iStyle,
40980   ItemCount iTagCount,
40981   const ATSUAttributeTag iTag[]) ;
40982 extern OSStatus
40983 ATSUSetFontFeatures(
40984   ATSUStyle iStyle,
40985   ItemCount iFeatureCount,
40986   const ATSUFontFeatureType iType[],
40987   const ATSUFontFeatureSelector iSelector[]) ;
40988 extern OSStatus
40989 ATSUGetFontFeature(
40990   ATSUStyle iStyle,
40991   ItemCount iFeatureIndex,
40992   ATSUFontFeatureType * oFeatureType,
40993   ATSUFontFeatureSelector * oFeatureSelector) ;
40994 extern OSStatus
40995 ATSUGetAllFontFeatures(
40996   ATSUStyle iStyle,
40997   ItemCount iMaximumFeatureCount,
40998   ATSUFontFeatureType oFeatureType[],
40999   ATSUFontFeatureSelector oFeatureSelector[],
41000   ItemCount * oActualFeatureCount) ;
41001 extern OSStatus
41002 ATSUClearFontFeatures(
41003   ATSUStyle iStyle,
41004   ItemCount iFeatureCount,
41005   const ATSUFontFeatureType iType[],
41006   const ATSUFontFeatureSelector iSelector[]) ;
41007 extern OSStatus
41008 ATSUSetVariations(
41009   ATSUStyle iStyle,
41010   ItemCount iVariationCount,
41011   const ATSUFontVariationAxis iAxes[],
41012   const ATSUFontVariationValue iValue[]) ;
41013 extern OSStatus
41014 ATSUGetFontVariationValue(
41015   ATSUStyle iStyle,
41016   ATSUFontVariationAxis iFontVariationAxis,
41017   ATSUFontVariationValue * oFontVariationValue) ;
41018 extern OSStatus
41019 ATSUGetAllFontVariations(
41020   ATSUStyle iStyle,
41021   ItemCount iVariationCount,
41022   ATSUFontVariationAxis oVariationAxes[],
41023   ATSUFontVariationValue oFontVariationValues[],
41024   ItemCount * oActualVariationCount) ;
41025 extern OSStatus
41026 ATSUClearFontVariations(
41027   ATSUStyle iStyle,
41028   ItemCount iAxisCount,
41029   const ATSUFontVariationAxis iAxis[]) ;
41030 extern OSStatus
41031 ATSUCreateTextLayout(ATSUTextLayout * oTextLayout) ;
41032 extern OSStatus
41033 ATSUCreateAndCopyTextLayout(
41034   ATSUTextLayout iTextLayout,
41035   ATSUTextLayout * oTextLayout) ;
41036 extern OSStatus
41037 ATSUCreateTextLayoutWithTextPtr(
41038   ConstUniCharArrayPtr iText,
41039   UniCharArrayOffset iTextOffset,
41040   UniCharCount iTextLength,
41041   UniCharCount iTextTotalLength,
41042   ItemCount iNumberOfRuns,
41043   const UniCharCount iRunLengths[],
41044   ATSUStyle iStyles[],
41045   ATSUTextLayout * oTextLayout) ;
41046 extern OSStatus
41047 ATSUCreateTextLayoutWithTextHandle(
41048   UniCharArrayHandle iText,
41049   UniCharArrayOffset iTextOffset,
41050   UniCharCount iTextLength,
41051   UniCharCount iTextTotalLength,
41052   ItemCount iNumberOfRuns,
41053   const UniCharCount iRunLengths[],
41054   ATSUStyle iStyles[],
41055   ATSUTextLayout * oTextLayout) ;
41056 extern OSStatus
41057 ATSUClearLayoutCache(
41058   ATSUTextLayout iTextLayout,
41059   UniCharArrayOffset iLineStart) ;
41060 extern OSStatus
41061 ATSUDisposeTextLayout(ATSUTextLayout iTextLayout) ;
41062 extern OSStatus
41063 ATSUSetTextLayoutRefCon(
41064   ATSUTextLayout iTextLayout,
41065   UInt32 iRefCon) ;
41066 extern OSStatus
41067 ATSUGetTextLayoutRefCon(
41068   ATSUTextLayout iTextLayout,
41069   UInt32 * oRefCon) ;
41070 extern OSStatus
41071 ATSUGetGlyphBounds(
41072   ATSUTextLayout iTextLayout,
41073   ATSUTextMeasurement iTextBasePointX,
41074   ATSUTextMeasurement iTextBasePointY,
41075   UniCharArrayOffset iBoundsCharStart,
41076   UniCharCount iBoundsCharLength,
41077   UInt16 iTypeOfBounds,
41078   ItemCount iMaxNumberOfBounds,
41079   ATSTrapezoid oGlyphBounds[],
41080   ItemCount * oActualNumberOfBounds) ;
41081 extern OSStatus
41082 ATSUIdle(ATSUTextLayout iTextLayout) ;
41083 extern OSStatus
41084 ATSUSetTextPointerLocation(
41085   ATSUTextLayout iTextLayout,
41086   ConstUniCharArrayPtr iText,
41087   UniCharArrayOffset iTextOffset,
41088   UniCharCount iTextLength,
41089   UniCharCount iTextTotalLength) ;
41090 extern OSStatus
41091 ATSUSetTextHandleLocation(
41092   ATSUTextLayout iTextLayout,
41093   UniCharArrayHandle iText,
41094   UniCharArrayOffset iTextOffset,
41095   UniCharCount iTextLength,
41096   UniCharCount iTextTotalLength) ;
41097 extern OSStatus
41098 ATSUGetTextLocation(
41099   ATSUTextLayout iTextLayout,
41100   void ** oText,
41101   Boolean * oTextIsStoredInHandle,
41102   UniCharArrayOffset * oOffset,
41103   UniCharCount * oTextLength,
41104   UniCharCount * oTextTotalLength) ;
41105 extern OSStatus
41106 ATSUTextDeleted(
41107   ATSUTextLayout iTextLayout,
41108   UniCharArrayOffset iDeletedRangeStart,
41109   UniCharCount iDeletedRangeLength) ;
41110 extern OSStatus
41111 ATSUTextInserted(
41112   ATSUTextLayout iTextLayout,
41113   UniCharArrayOffset iInsertionLocation,
41114   UniCharCount iInsertionLength) ;
41115 extern OSStatus
41116 ATSUTextMoved(
41117   ATSUTextLayout iTextLayout,
41118   ConstUniCharArrayPtr iNewLocation) ;
41119 extern OSStatus
41120 ATSUCopyLayoutControls(
41121   ATSUTextLayout iSourceTextLayout,
41122   ATSUTextLayout iDestTextLayout) ;
41123 extern OSStatus
41124 ATSUSetLayoutControls(
41125   ATSUTextLayout iTextLayout,
41126   ItemCount iAttributeCount,
41127   const ATSUAttributeTag iTag[],
41128   const ByteCount iValueSize[],
41129   const ATSUAttributeValuePtr iValue[]) ;
41130 extern OSStatus
41131 ATSUGetLayoutControl(
41132   ATSUTextLayout iTextLayout,
41133   ATSUAttributeTag iTag,
41134   ByteCount iExpectedValueSize,
41135   ATSUAttributeValuePtr oValue,
41136   ByteCount * oActualValueSize) ;
41137 extern OSStatus
41138 ATSUGetAllLayoutControls(
41139   ATSUTextLayout iTextLayout,
41140   ATSUAttributeInfo oAttributeInfoArray[],
41141   ItemCount iTagValuePairArraySize,
41142   ItemCount * oTagValuePairCount) ;
41143 extern OSStatus
41144 ATSUClearLayoutControls(
41145   ATSUTextLayout iTextLayout,
41146   ItemCount iTagCount,
41147   const ATSUAttributeTag iTag[]) ;
41148 extern OSStatus
41149 ATSUCopyLineControls(
41150   ATSUTextLayout iSourceTextLayout,
41151   UniCharArrayOffset iSourceLineStart,
41152   ATSUTextLayout iDestTextLayout,
41153   UniCharArrayOffset iDestLineStart) ;
41154 extern OSStatus
41155 ATSUSetLineControls(
41156   ATSUTextLayout iTextLayout,
41157   UniCharArrayOffset iLineStart,
41158   ItemCount iAttributeCount,
41159   const ATSUAttributeTag iTag[],
41160   const ByteCount iValueSize[],
41161   const ATSUAttributeValuePtr iValue[]) ;
41162 extern OSStatus
41163 ATSUGetLineControl(
41164   ATSUTextLayout iTextLayout,
41165   UniCharArrayOffset iLineStart,
41166   ATSUAttributeTag iTag,
41167   ByteCount iExpectedValueSize,
41168   ATSUAttributeValuePtr oValue,
41169   ByteCount * oActualValueSize) ;
41170 extern OSStatus
41171 ATSUGetAllLineControls(
41172   ATSUTextLayout iTextLayout,
41173   UniCharArrayOffset iLineStart,
41174   ATSUAttributeInfo oAttributeInfoArray[],
41175   ItemCount iTagValuePairArraySize,
41176   ItemCount * oTagValuePairCount) ;
41177 extern OSStatus
41178 ATSUClearLineControls(
41179   ATSUTextLayout iTextLayout,
41180   UniCharArrayOffset iLineStart,
41181   ItemCount iTagCount,
41182   const ATSUAttributeTag iTag[]) ;
41183 extern OSStatus
41184 ATSUSetRunStyle(
41185   ATSUTextLayout iTextLayout,
41186   ATSUStyle iStyle,
41187   UniCharArrayOffset iRunStart,
41188   UniCharCount iRunLength) ;
41189 extern OSStatus
41190 ATSUGetRunStyle(
41191   ATSUTextLayout iTextLayout,
41192   UniCharArrayOffset iOffset,
41193   ATSUStyle * oStyle,
41194   UniCharArrayOffset * oRunStart,
41195   UniCharCount * oRunLength) ;
41196 extern OSStatus
41197 ATSUGetContinuousAttributes(
41198   ATSUTextLayout iTextLayout,
41199   UniCharArrayOffset iOffset,
41200   UniCharCount iLength,
41201   ATSUStyle oStyle) ;
41202 extern OSStatus
41203 ATSUDrawText(
41204   ATSUTextLayout iTextLayout,
41205   UniCharArrayOffset iLineOffset,
41206   UniCharCount iLineLength,
41207   ATSUTextMeasurement iLocationX,
41208   ATSUTextMeasurement iLocationY) ;
41209 extern OSStatus
41210 ATSUMeasureText(
41211   ATSUTextLayout iTextLayout,
41212   UniCharArrayOffset iLineStart,
41213   UniCharCount iLineLength,
41214   ATSUTextMeasurement * oTextBefore,
41215   ATSUTextMeasurement * oTextAfter,
41216   ATSUTextMeasurement * oAscent,
41217   ATSUTextMeasurement * oDescent) ;
41218 extern OSStatus
41219 ATSUGetUnjustifiedBounds(
41220   ATSUTextLayout iTextLayout,
41221   UniCharArrayOffset iLineStart,
41222   UniCharCount iLineLength,
41223   ATSUTextMeasurement * oTextBefore,
41224   ATSUTextMeasurement * oTextAfter,
41225   ATSUTextMeasurement * oAscent,
41226   ATSUTextMeasurement * oDescent) ;
41227 extern OSStatus
41228 ATSUMeasureTextImage(
41229   ATSUTextLayout iTextLayout,
41230   UniCharArrayOffset iLineOffset,
41231   UniCharCount iLineLength,
41232   ATSUTextMeasurement iLocationX,
41233   ATSUTextMeasurement iLocationY,
41234   Rect * oTextImageRect) ;
41235 extern OSStatus
41236 ATSUHighlightText(
41237   ATSUTextLayout iTextLayout,
41238   ATSUTextMeasurement iTextBasePointX,
41239   ATSUTextMeasurement iTextBasePointY,
41240   UniCharArrayOffset iHighlightStart,
41241   UniCharCount iHighlightLength) ;
41242 extern OSStatus
41243 ATSUUnhighlightText(
41244   ATSUTextLayout iTextLayout,
41245   ATSUTextMeasurement iTextBasePointX,
41246   ATSUTextMeasurement iTextBasePointY,
41247   UniCharArrayOffset iHighlightStart,
41248   UniCharCount iHighlightLength) ;
41249 extern OSStatus
41250 ATSUGetTextHighlight(
41251   ATSUTextLayout iTextLayout,
41252   ATSUTextMeasurement iTextBasePointX,
41253   ATSUTextMeasurement iTextBasePointY,
41254   UniCharArrayOffset iHighlightStart,
41255   UniCharCount iHighlightLength,
41256   RgnHandle oHighlightRegion) ;
41257 extern OSStatus
41258 ATSUHighlightInactiveText(
41259   ATSUTextLayout iTextLayout,
41260   ATSUTextMeasurement iTextBasePointX,
41261   ATSUTextMeasurement iTextBasePointY,
41262   UniCharArrayOffset iHighlightStart,
41263   UniCharCount iHighlightLength) ;
41264 extern OSStatus
41265 ATSUPositionToOffset(
41266   ATSUTextLayout iTextLayout,
41267   ATSUTextMeasurement iLocationX,
41268   ATSUTextMeasurement iLocationY,
41269   UniCharArrayOffset * ioPrimaryOffset,
41270   Boolean * oIsLeading,
41271   UniCharArrayOffset * oSecondaryOffset) ;
41272 extern OSStatus
41273 ATSUOffsetToPosition(
41274   ATSUTextLayout iTextLayout,
41275   UniCharArrayOffset iOffset,
41276   Boolean iIsLeading,
41277   ATSUCaret * oMainCaret,
41278   ATSUCaret * oSecondCaret,
41279   Boolean * oCaretIsSplit) ;
41280 extern OSStatus
41281 ATSUPositionToCursorOffset(
41282   ATSUTextLayout iTextLayout,
41283   ATSUTextMeasurement iLocationX,
41284   ATSUTextMeasurement iLocationY,
41285   ATSUCursorMovementType iMovementType,
41286   UniCharArrayOffset * ioPrimaryOffset,
41287   Boolean * oIsLeading,
41288   UniCharArrayOffset * oSecondaryOffset) ;
41289 extern OSStatus
41290 ATSUOffsetToCursorPosition(
41291   ATSUTextLayout iTextLayout,
41292   UniCharArrayOffset iOffset,
41293   Boolean iIsLeading,
41294   ATSUCursorMovementType iMovementType,
41295   ATSUCaret * oMainCaret,
41296   ATSUCaret * oSecondCaret,
41297   Boolean * oCaretIsSplit) ;
41298 extern OSStatus
41299 ATSUNextCursorPosition(
41300   ATSUTextLayout iTextLayout,
41301   UniCharArrayOffset iOldOffset,
41302   ATSUCursorMovementType iMovementType,
41303   UniCharArrayOffset * oNewOffset) ;
41304 extern OSStatus
41305 ATSUPreviousCursorPosition(
41306   ATSUTextLayout iTextLayout,
41307   UniCharArrayOffset iOldOffset,
41308   ATSUCursorMovementType iMovementType,
41309   UniCharArrayOffset * oNewOffset) ;
41310 extern OSStatus
41311 ATSURightwardCursorPosition(
41312   ATSUTextLayout iTextLayout,
41313   UniCharArrayOffset iOldOffset,
41314   ATSUCursorMovementType iMovementType,
41315   UniCharArrayOffset * oNewOffset) ;
41316 extern OSStatus
41317 ATSULeftwardCursorPosition(
41318   ATSUTextLayout iTextLayout,
41319   UniCharArrayOffset iOldOffset,
41320   ATSUCursorMovementType iMovementType,
41321   UniCharArrayOffset * oNewOffset) ;
41322 extern OSStatus
41323 ATSUBatchBreakLines(
41324   ATSUTextLayout iTextLayout,
41325   UniCharArrayOffset iRangeStart,
41326   UniCharCount iRangeLength,
41327   ATSUTextMeasurement iLineWidth,
41328   ItemCount * oBreakCount) ;
41329 extern OSStatus
41330 ATSUBreakLine(
41331   ATSUTextLayout iTextLayout,
41332   UniCharArrayOffset iLineStart,
41333   ATSUTextMeasurement iLineWidth,
41334   Boolean iUseAsSoftLineBreak,
41335   UniCharArrayOffset * oLineBreak) ;
41336 extern OSStatus
41337 ATSUSetSoftLineBreak(
41338   ATSUTextLayout iTextLayout,
41339   UniCharArrayOffset iLineBreak) ;
41340 extern OSStatus
41341 ATSUGetSoftLineBreaks(
41342   ATSUTextLayout iTextLayout,
41343   UniCharArrayOffset iRangeStart,
41344   UniCharCount iRangeLength,
41345   ItemCount iMaximumBreaks,
41346   UniCharArrayOffset oBreaks[],
41347   ItemCount * oBreakCount) ;
41348 extern OSStatus
41349 ATSUClearSoftLineBreaks(
41350   ATSUTextLayout iTextLayout,
41351   UniCharArrayOffset iRangeStart,
41352   UniCharCount iRangeLength) ;
41353 extern OSStatus
41354 ATSUSetTabArray(
41355   ATSUTextLayout iTextLayout,
41356   const ATSUTab iTabs[],
41357   ItemCount iTabCount) ;
41358 extern OSStatus
41359 ATSUGetTabArray(
41360   ATSUTextLayout iTextLayout,
41361   ItemCount iMaxTabCount,
41362   ATSUTab oTabs[],
41363   ItemCount * oTabCount) ;
41364 extern OSStatus
41365 ATSUSetFontFallbacks(
41366   ItemCount iFontFallbacksCount,
41367   const ATSUFontID iFontIDs[],
41368   ATSUFontFallbackMethod iFontFallbackMethod) ;
41369 extern OSStatus
41370 ATSUGetFontFallbacks(
41371   ItemCount iMaxFontFallbacksCount,
41372   ATSUFontID oFontIDs[],
41373   ATSUFontFallbackMethod * oFontFallbackMethod,
41374   ItemCount * oActualFallbacksCount) ;
41375 extern OSStatus
41376 ATSUMatchFontsToText(
41377   ATSUTextLayout iTextLayout,
41378   UniCharArrayOffset iTextStart,
41379   UniCharCount iTextLength,
41380   ATSUFontID * oFontID,
41381   UniCharArrayOffset * oChangedOffset,
41382   UniCharCount * oChangedLength) ;
41383 extern OSStatus
41384 ATSUSetTransientFontMatching(
41385   ATSUTextLayout iTextLayout,
41386   Boolean iTransientFontMatching) ;
41387 extern OSStatus
41388 ATSUGetTransientFontMatching(
41389   ATSUTextLayout iTextLayout,
41390   Boolean * oTransientFontMatching) ;
41391 extern OSStatus
41392 ATSUFontCount(ItemCount * oFontCount) ;
41393 extern OSStatus
41394 ATSUGetFontIDs(
41395   ATSUFontID oFontIDs[],
41396   ItemCount iArraySize,
41397   ItemCount * oFontCount) ;
41398 extern OSStatus
41399 ATSUFONDtoFontID(
41400   short iFONDNumber,
41401   Style iFONDStyle,
41402   ATSUFontID * oFontID) ;
41403 extern OSStatus
41404 ATSUFontIDtoFOND(
41405   ATSUFontID iFontID,
41406   short * oFONDNumber,
41407   Style * oFONDStyle) ;
41408 extern OSStatus
41409 ATSUCountFontNames(
41410   ATSUFontID iFontID,
41411   ItemCount * oFontNameCount) ;
41412 extern OSStatus
41413 ATSUGetIndFontName(
41414   ATSUFontID iFontID,
41415   ItemCount iFontNameIndex,
41416   ByteCount iMaximumNameLength,
41417   Ptr oName,
41418   ByteCount * oActualNameLength,
41419   FontNameCode * oFontNameCode,
41420   FontPlatformCode * oFontNamePlatform,
41421   FontScriptCode * oFontNameScript,
41422   FontLanguageCode * oFontNameLanguage) ;
41423 extern OSStatus
41424 ATSUFindFontName(
41425   ATSUFontID iFontID,
41426   FontNameCode iFontNameCode,
41427   FontPlatformCode iFontNamePlatform,
41428   FontScriptCode iFontNameScript,
41429   FontLanguageCode iFontNameLanguage,
41430   ByteCount iMaximumNameLength,
41431   Ptr oName,
41432   ByteCount * oActualNameLength,
41433   ItemCount * oFontNameIndex) ;
41434 extern OSStatus
41435 ATSUFindFontFromName(
41436   Ptr iName,
41437   ByteCount iNameLength,
41438   FontNameCode iFontNameCode,
41439   FontPlatformCode iFontNamePlatform,
41440   FontScriptCode iFontNameScript,
41441   FontLanguageCode iFontNameLanguage,
41442   ATSUFontID * oFontID) ;
41443 extern OSStatus
41444 ATSUCountFontFeatureTypes(
41445   ATSUFontID iFontID,
41446   ItemCount * oTypeCount) ;
41447 extern OSStatus
41448 ATSUCountFontFeatureSelectors(
41449   ATSUFontID iFontID,
41450   ATSUFontFeatureType iType,
41451   ItemCount * oSelectorCount) ;
41452 extern OSStatus
41453 ATSUGetFontFeatureTypes(
41454   ATSUFontID iFontID,
41455   ItemCount iMaximumTypes,
41456   ATSUFontFeatureType oTypes[],
41457   ItemCount * oActualTypeCount) ;
41458 extern OSStatus
41459 ATSUGetFontFeatureSelectors(
41460   ATSUFontID iFontID,
41461   ATSUFontFeatureType iType,
41462   ItemCount iMaximumSelectors,
41463   ATSUFontFeatureSelector oSelectors[],
41464   Boolean oSelectorIsOnByDefault[],
41465   ItemCount * oActualSelectorCount,
41466   Boolean * oIsMutuallyExclusive) ;
41467 extern OSStatus
41468 ATSUGetFontFeatureNameCode(
41469   ATSUFontID iFontID,
41470   ATSUFontFeatureType iType,
41471   ATSUFontFeatureSelector iSelector,
41472   FontNameCode * oNameCode) ;
41473 extern OSStatus
41474 ATSUCountFontTracking(
41475   ATSUFontID iFontID,
41476   ATSUVerticalCharacterType iCharacterOrientation,
41477   ItemCount * oTrackingCount) ;
41478 extern OSStatus
41479 ATSUGetIndFontTracking(
41480   ATSUFontID iFontID,
41481   ATSUVerticalCharacterType iCharacterOrientation,
41482   ItemCount iTrackIndex,
41483   Fixed * oFontTrackingValue,
41484   FontNameCode * oNameCode) ;
41485 extern OSStatus
41486 ATSUCountFontVariations(
41487   ATSUFontID iFontID,
41488   ItemCount * oVariationCount) ;
41489 extern OSStatus
41490 ATSUGetIndFontVariation(
41491   ATSUFontID iFontID,
41492   ItemCount iVariationIndex,
41493   ATSUFontVariationAxis * oATSUFontVariationAxis,
41494   ATSUFontVariationValue * oMinimumValue,
41495   ATSUFontVariationValue * oMaximumValue,
41496   ATSUFontVariationValue * oDefaultValue) ;
41497 extern OSStatus
41498 ATSUGetFontVariationNameCode(
41499   ATSUFontID iFontID,
41500   ATSUFontVariationAxis iAxis,
41501   FontNameCode * oNameCode) ;
41502 extern OSStatus
41503 ATSUCountFontInstances(
41504   ATSUFontID iFontID,
41505   ItemCount * oInstances) ;
41506 extern OSStatus
41507 ATSUGetFontInstance(
41508   ATSUFontID iFontID,
41509   ItemCount iFontInstanceIndex,
41510   ItemCount iMaximumVariations,
41511   ATSUFontVariationAxis oAxes[],
41512   ATSUFontVariationValue oValues[],
41513   ItemCount * oActualVariationCount) ;
41514 extern OSStatus
41515 ATSUGetFontInstanceNameCode(
41516   ATSUFontID iFontID,
41517   ItemCount iInstanceIndex,
41518   FontNameCode * oNameCode) ;
41519 extern OSStatus
41520 ATSUGetGlyphInfo(
41521   ATSUTextLayout iTextLayout,
41522   UniCharArrayOffset iLineStart,
41523   UniCharCount iLineLength,
41524   ByteCount * ioBufferSize,
41525   ATSUGlyphInfoArray * oGlyphInfoPtr) ;
41526 extern OSStatus
41527 ATSUDrawGlyphInfo(
41528   ATSUGlyphInfoArray * iGlyphInfoArray,
41529   Float32Point iLocation) ;
41530 extern OSStatus
41531 ATSUGlyphGetIdealMetrics(
41532   ATSUStyle iATSUStyle,
41533   ItemCount iNumOfGlyphs,
41534   GlyphID iGlyphIDs[],
41535   ByteOffset iInputOffset,
41536   ATSGlyphIdealMetrics oIdealMetrics[]) ;
41537 extern OSStatus
41538 ATSUGetNativeCurveType(
41539   ATSUStyle iATSUStyle,
41540   ATSCurveType * oCurveType) ;
41541 extern OSStatus
41542 ATSUGlyphGetScreenMetrics(
41543   ATSUStyle iATSUStyle,
41544   ItemCount iNumOfGlyphs,
41545   GlyphID iGlyphIDs[],
41546   ByteOffset iInputOffset,
41547   Boolean iForcingAntiAlias,
41548   Boolean iAntiAliasSwitch,
41549   ATSGlyphScreenMetrics oScreenMetrics[]) ;
41550
41551
41552
41553
41554
41555 typedef OSStatus ( * ATSQuadraticLineProcPtr)(const Float32Point *pt1, const Float32Point *pt2, void *callBackDataPtr);
41556 typedef OSStatus ( * ATSQuadraticCurveProcPtr)(const Float32Point *pt1, const Float32Point *controlPt, const Float32Point *pt2, void *callBackDataPtr);
41557 typedef OSStatus ( * ATSQuadraticNewPathProcPtr)(void * callBackDataPtr);
41558 typedef OSStatus ( * ATSQuadraticClosePathProcPtr)(void * callBackDataPtr);
41559 typedef ATSQuadraticLineProcPtr ATSQuadraticLineUPP;
41560 typedef ATSQuadraticCurveProcPtr ATSQuadraticCurveUPP;
41561 typedef ATSQuadraticNewPathProcPtr ATSQuadraticNewPathUPP;
41562 typedef ATSQuadraticClosePathProcPtr ATSQuadraticClosePathUPP;
41563 extern ATSQuadraticLineUPP
41564 NewATSQuadraticLineUPP(ATSQuadraticLineProcPtr userRoutine) ;
41565 extern ATSQuadraticCurveUPP
41566 NewATSQuadraticCurveUPP(ATSQuadraticCurveProcPtr userRoutine) ;
41567 extern ATSQuadraticNewPathUPP
41568 NewATSQuadraticNewPathUPP(ATSQuadraticNewPathProcPtr userRoutine) ;
41569 extern ATSQuadraticClosePathUPP
41570 NewATSQuadraticClosePathUPP(ATSQuadraticClosePathProcPtr userRoutine) ;
41571 extern void
41572 DisposeATSQuadraticLineUPP(ATSQuadraticLineUPP userUPP) ;
41573 extern void
41574 DisposeATSQuadraticCurveUPP(ATSQuadraticCurveUPP userUPP) ;
41575 extern void
41576 DisposeATSQuadraticNewPathUPP(ATSQuadraticNewPathUPP userUPP) ;
41577 extern void
41578 DisposeATSQuadraticClosePathUPP(ATSQuadraticClosePathUPP userUPP) ;
41579 extern OSStatus
41580 InvokeATSQuadraticLineUPP(
41581   const Float32Point * pt1,
41582   const Float32Point * pt2,
41583   void * callBackDataPtr,
41584   ATSQuadraticLineUPP userUPP) ;
41585 extern OSStatus
41586 InvokeATSQuadraticCurveUPP(
41587   const Float32Point * pt1,
41588   const Float32Point * controlPt,
41589   const Float32Point * pt2,
41590   void * callBackDataPtr,
41591   ATSQuadraticCurveUPP userUPP) ;
41592 extern OSStatus
41593 InvokeATSQuadraticNewPathUPP(
41594   void * callBackDataPtr,
41595   ATSQuadraticNewPathUPP userUPP) ;
41596 extern OSStatus
41597 InvokeATSQuadraticClosePathUPP(
41598   void * callBackDataPtr,
41599   ATSQuadraticClosePathUPP userUPP) ;
41600 extern OSStatus
41601 ATSUGlyphGetQuadraticPaths(
41602   ATSUStyle iATSUStyle,
41603   GlyphID iGlyphID,
41604   ATSQuadraticNewPathUPP iNewPathProc,
41605   ATSQuadraticLineUPP iLineProc,
41606   ATSQuadraticCurveUPP iCurveProc,
41607   ATSQuadraticClosePathUPP iClosePathProc,
41608   void * iCallbackDataPtr,
41609   OSStatus * oCallbackResult) ;
41610
41611
41612
41613 typedef OSStatus ( * ATSCubicMoveToProcPtr)(const Float32Point *pt, void *callBackDataPtr);
41614 typedef OSStatus ( * ATSCubicLineToProcPtr)(const Float32Point *pt, void *callBackDataPtr);
41615 typedef OSStatus ( * ATSCubicCurveToProcPtr)(const Float32Point *pt1, const Float32Point *pt2, const Float32Point *pt3, void *callBackDataPtr);
41616 typedef OSStatus ( * ATSCubicClosePathProcPtr)(void * callBackDataPtr);
41617 typedef ATSCubicMoveToProcPtr ATSCubicMoveToUPP;
41618 typedef ATSCubicLineToProcPtr ATSCubicLineToUPP;
41619 typedef ATSCubicCurveToProcPtr ATSCubicCurveToUPP;
41620 typedef ATSCubicClosePathProcPtr ATSCubicClosePathUPP;
41621 extern ATSCubicMoveToUPP
41622 NewATSCubicMoveToUPP(ATSCubicMoveToProcPtr userRoutine) ;
41623 extern ATSCubicLineToUPP
41624 NewATSCubicLineToUPP(ATSCubicLineToProcPtr userRoutine) ;
41625 extern ATSCubicCurveToUPP
41626 NewATSCubicCurveToUPP(ATSCubicCurveToProcPtr userRoutine) ;
41627 extern ATSCubicClosePathUPP
41628 NewATSCubicClosePathUPP(ATSCubicClosePathProcPtr userRoutine) ;
41629 extern void
41630 DisposeATSCubicMoveToUPP(ATSCubicMoveToUPP userUPP) ;
41631 extern void
41632 DisposeATSCubicLineToUPP(ATSCubicLineToUPP userUPP) ;
41633 extern void
41634 DisposeATSCubicCurveToUPP(ATSCubicCurveToUPP userUPP) ;
41635 extern void
41636 DisposeATSCubicClosePathUPP(ATSCubicClosePathUPP userUPP) ;
41637 extern OSStatus
41638 InvokeATSCubicMoveToUPP(
41639   const Float32Point * pt,
41640   void * callBackDataPtr,
41641   ATSCubicMoveToUPP userUPP) ;
41642 extern OSStatus
41643 InvokeATSCubicLineToUPP(
41644   const Float32Point * pt,
41645   void * callBackDataPtr,
41646   ATSCubicLineToUPP userUPP) ;
41647 extern OSStatus
41648 InvokeATSCubicCurveToUPP(
41649   const Float32Point * pt1,
41650   const Float32Point * pt2,
41651   const Float32Point * pt3,
41652   void * callBackDataPtr,
41653   ATSCubicCurveToUPP userUPP) ;
41654 extern OSStatus
41655 InvokeATSCubicClosePathUPP(
41656   void * callBackDataPtr,
41657   ATSCubicClosePathUPP userUPP) ;
41658 extern OSStatus
41659 ATSUGlyphGetCubicPaths(
41660   ATSUStyle iATSUStyle,
41661   GlyphID iGlyphID,
41662   ATSCubicMoveToUPP iMoveToProc,
41663   ATSCubicLineToUPP iLineToProc,
41664   ATSCubicCurveToUPP iCurveToProc,
41665   ATSCubicClosePathUPP iClosePathProc,
41666   void * iCallbackDataPtr,
41667   OSStatus * oCallbackResult) ;
41668 extern OSStatus
41669 ATSUGlyphGetCurvePaths(
41670   ATSUStyle iATSUStyle,
41671   GlyphID iGlyphID,
41672   ByteCount * ioBufferSize,
41673   ATSUCurvePaths * oPaths) ;
41674 extern OSStatus
41675 ATSUSetHighlightingMethod(
41676   ATSUTextLayout iTextLayout,
41677   ATSUHighlightMethod iMethod,
41678   const ATSUUnhighlightData * iUnhighlightData) ;
41679
41680
41681
41682
41683
41684
41685 }
41686
41687
41688
41689
41690 enum {
41691   mBaseOffset = 1,
41692   mRowBytes = 2,
41693   mBounds = 3,
41694   mVersion = 4,
41695   mHRes = 5,
41696   mVRes = 6,
41697   mPixelType = 7,
41698   mPixelSize = 8,
41699   mCmpCount = 9,
41700   mCmpSize = 10,
41701   mPlaneBytes = 11,
41702   mVertRefRate = 14,
41703   mVidParams = 1,
41704   mTable = 2,
41705   mPageCnt = 3,
41706   mDevType = 4,
41707   oneBitMode = 128,
41708   twoBitMode = 129,
41709   fourBitMode = 130,
41710   eightBitMode = 131
41711 };
41712
41713 enum {
41714   sixteenBitMode = 132,
41715   thirtyTwoBitMode = 133,
41716   firstVidMode = 128,
41717   secondVidMode = 129,
41718   thirdVidMode = 130,
41719   fourthVidMode = 131,
41720   fifthVidMode = 132,
41721   sixthVidMode = 133,
41722   spGammaDir = 64,
41723   spVidNamesDir = 65
41724 };
41725
41726
41727
41728
41729 enum {
41730   kDeclROMtables = 'decl',
41731   kDetailedTimingFormat = 'arba'
41732 };
41733
41734
41735 enum {
41736   kDDCBlockSize = 128
41737 };
41738
41739
41740 enum {
41741   kDDCBlockTypeEDID = 0
41742 };
41743
41744
41745 enum {
41746   kDDCForceReadBit = 0,
41747   kDDCForceReadMask = (1 << kDDCForceReadBit)
41748 };
41749 enum {
41750   timingInvalid = 0,
41751   timingInvalid_SM_T24 = 8,
41752   timingApple_FixedRateLCD = 42,
41753   timingApple_512x384_60hz = 130,
41754   timingApple_560x384_60hz = 135,
41755   timingApple_640x480_67hz = 140,
41756   timingApple_640x400_67hz = 145,
41757   timingVESA_640x480_60hz = 150,
41758   timingVESA_640x480_72hz = 152,
41759   timingVESA_640x480_75hz = 154,
41760   timingVESA_640x480_85hz = 158,
41761   timingGTF_640x480_120hz = 159,
41762   timingApple_640x870_75hz = 160,
41763   timingApple_640x818_75hz = 165,
41764   timingApple_832x624_75hz = 170,
41765   timingVESA_800x600_56hz = 180,
41766   timingVESA_800x600_60hz = 182,
41767   timingVESA_800x600_72hz = 184,
41768   timingVESA_800x600_75hz = 186,
41769   timingVESA_800x600_85hz = 188,
41770   timingVESA_1024x768_60hz = 190,
41771   timingVESA_1024x768_70hz = 200,
41772   timingVESA_1024x768_75hz = 204,
41773   timingVESA_1024x768_85hz = 208,
41774   timingApple_1024x768_75hz = 210,
41775   timingApple_1152x870_75hz = 220,
41776   timingAppleNTSC_ST = 230,
41777   timingAppleNTSC_FF = 232,
41778   timingAppleNTSC_STconv = 234,
41779   timingAppleNTSC_FFconv = 236,
41780   timingApplePAL_ST = 238,
41781   timingApplePAL_FF = 240,
41782   timingApplePAL_STconv = 242,
41783   timingApplePAL_FFconv = 244,
41784   timingVESA_1280x960_75hz = 250,
41785   timingVESA_1280x960_60hz = 252,
41786   timingVESA_1280x960_85hz = 254,
41787   timingVESA_1280x1024_60hz = 260,
41788   timingVESA_1280x1024_75hz = 262,
41789   timingVESA_1280x1024_85hz = 268,
41790   timingVESA_1600x1200_60hz = 280,
41791   timingVESA_1600x1200_65hz = 282,
41792   timingVESA_1600x1200_70hz = 284,
41793   timingVESA_1600x1200_75hz = 286,
41794   timingVESA_1600x1200_80hz = 288,
41795   timingVESA_1600x1200_85hz = 289,
41796   timingVESA_1792x1344_60hz = 296,
41797   timingVESA_1792x1344_75hz = 298,
41798   timingVESA_1856x1392_60hz = 300,
41799   timingVESA_1856x1392_75hz = 302,
41800   timingVESA_1920x1440_60hz = 304,
41801   timingVESA_1920x1440_75hz = 306,
41802   timingSMPTE240M_60hz = 400,
41803   timingFilmRate_48hz = 410,
41804   timingSony_1600x1024_76hz = 500,
41805   timingSony_1920x1080_60hz = 510,
41806   timingSony_1920x1080_72hz = 520,
41807   timingSony_1920x1200_76hz = 540,
41808   timingApple_0x0_0hz_Offline = 550
41809 };
41810
41811
41812
41813 enum {
41814   timingApple12 = timingApple_512x384_60hz,
41815   timingApple12x = timingApple_560x384_60hz,
41816   timingApple13 = timingApple_640x480_67hz,
41817   timingApple13x = timingApple_640x400_67hz,
41818   timingAppleVGA = timingVESA_640x480_60hz,
41819   timingApple15 = timingApple_640x870_75hz,
41820   timingApple15x = timingApple_640x818_75hz,
41821   timingApple16 = timingApple_832x624_75hz,
41822   timingAppleSVGA = timingVESA_800x600_56hz,
41823   timingApple1Ka = timingVESA_1024x768_60hz,
41824   timingApple1Kb = timingVESA_1024x768_70hz,
41825   timingApple19 = timingApple_1024x768_75hz,
41826   timingApple21 = timingApple_1152x870_75hz,
41827   timingSony_1900x1200_74hz = 530,
41828   timingSony_1900x1200_76hz = timingSony_1920x1200_76hz
41829 };
41830
41831
41832 enum {
41833   kAllModesValid = 0,
41834   kAllModesSafe = 1,
41835   kReportsTagging = 2,
41836   kHasDirectConnection = 3,
41837   kIsMonoDev = 4,
41838   kUncertainConnection = 5,
41839   kTaggingInfoNonStandard = 6,
41840   kReportsDDCConnection = 7,
41841   kHasDDCConnection = 8,
41842   kConnectionInactive = 9,
41843   kDependentConnection = 10,
41844   kBuiltInConnection = 11,
41845   kOverrideConnection = 12,
41846   kFastCheckForDDC = 13,
41847   kReportsHotPlugging = 14
41848 };
41849
41850
41851
41852 enum {
41853   kUnknownConnect = 1,
41854   kPanelConnect = 2,
41855   kPanelTFTConnect = 2,
41856   kFixedModeCRTConnect = 3,
41857   kMultiModeCRT1Connect = 4,
41858   kMultiModeCRT2Connect = 5,
41859   kMultiModeCRT3Connect = 6,
41860   kMultiModeCRT4Connect = 7,
41861   kModelessConnect = 8,
41862   kFullPageConnect = 9,
41863   kVGAConnect = 10,
41864   kNTSCConnect = 11,
41865   kPALConnect = 12,
41866   kHRConnect = 13,
41867   kPanelFSTNConnect = 14,
41868   kMonoTwoPageConnect = 15,
41869   kColorTwoPageConnect = 16,
41870   kColor16Connect = 17,
41871   kColor19Connect = 18,
41872   kGenericCRT = 19,
41873   kGenericLCD = 20,
41874   kDDCConnect = 21,
41875   kNoConnect = 22
41876 };
41877
41878
41879 enum {
41880   kModeValid = 0,
41881   kModeSafe = 1,
41882   kModeDefault = 2,
41883   kModeShowNow = 3,
41884   kModeNotResize = 4,
41885   kModeRequiresPan = 5,
41886   kModeInterlaced = 6,
41887   kModeShowNever = 7,
41888   kModeSimulscan = 8,
41889   kModeNotPreset = 9,
41890   kModeBuiltIn = 10,
41891   kModeStretched = 11
41892 };
41893
41894
41895 enum {
41896   kDepthDependent = 0
41897 };
41898
41899
41900 enum {
41901   kResolutionHasMultipleDepthSizes = 0
41902 };
41903
41904
41905 enum {
41906
41907   kAVPowerOff = 0,
41908   kAVPowerStandby = 1,
41909   kAVPowerSuspend = 2,
41910   kAVPowerOn = 3,
41911   kHardwareSleep = 128,
41912   kHardwareWake = 129,
41913   kHardwareWakeFromSuspend = 130,
41914   kHardwareWakeToDoze = 131,
41915   kHardwareWakeToDozeFromSuspend = 132
41916 };
41917
41918 enum {
41919
41920   kPowerStateNeedsRefresh = 0,
41921   kPowerStateSleepAwareBit = 1,
41922   kPowerStateSleepForbiddenBit = 2,
41923   kPowerStateSleepCanPowerOffBit = 3,
41924   kPowerStateSleepNoDPMSBit = 4,
41925   kPowerStateSleepWaketoDozeBit = 5,
41926   kPowerStateNeedsRefreshMask = (1L << kPowerStateNeedsRefresh),
41927   kPowerStateSleepAwareMask = (1L << kPowerStateSleepAwareBit),
41928   kPowerStateSleepForbiddenMask = (1L << kPowerStateSleepForbiddenBit),
41929   kPowerStateSleepCanPowerOffMask = (1L << kPowerStateSleepCanPowerOffBit),
41930   kPowerStateSleepNoDPMSMask = (1L << kPowerStateSleepNoDPMSBit),
41931   kPowerStateSleepWaketoDozeMask = (1L << kPowerStateSleepWaketoDozeBit)
41932 };
41933
41934
41935 enum {
41936
41937   cscReset = 0,
41938   cscKillIO = 1,
41939   cscSetMode = 2,
41940   cscSetEntries = 3,
41941   cscSetGamma = 4,
41942   cscGrayPage = 5,
41943   cscGrayScreen = 5,
41944   cscSetGray = 6,
41945   cscSetInterrupt = 7,
41946   cscDirectSetEntries = 8,
41947   cscSetDefaultMode = 9,
41948   cscSwitchMode = 10,
41949   cscSetSync = 11,
41950   cscSavePreferredConfiguration = 16,
41951   cscSetHardwareCursor = 22,
41952   cscDrawHardwareCursor = 23,
41953   cscSetConvolution = 24,
41954   cscSetPowerState = 25,
41955   cscPrivateControlCall = 26,
41956   cscSetMultiConnect = 28,
41957   cscSetClutBehavior = 29,
41958   cscSetDetailedTiming = 31,
41959   cscDoCommunication = 33,
41960   cscProbeConnection = 34,
41961   cscUnusedCall = 127
41962 };
41963
41964 enum {
41965
41966   cscGetMode = 2,
41967   cscGetEntries = 3,
41968   cscGetPageCnt = 4,
41969   cscGetPages = 4,
41970   cscGetPageBase = 5,
41971   cscGetBaseAddr = 5,
41972   cscGetGray = 6,
41973   cscGetInterrupt = 7,
41974   cscGetGamma = 8,
41975   cscGetDefaultMode = 9,
41976   cscGetCurMode = 10,
41977   cscGetSync = 11,
41978   cscGetConnection = 12,
41979   cscGetModeTiming = 13,
41980   cscGetModeBaseAddress = 14,
41981   cscGetScanProc = 15,
41982   cscGetPreferredConfiguration = 16,
41983   cscGetNextResolution = 17,
41984   cscGetVideoParameters = 18,
41985   cscGetGammaInfoList = 20,
41986   cscRetrieveGammaTable = 21,
41987   cscSupportsHardwareCursor = 22,
41988   cscGetHardwareCursorDrawState = 23,
41989   cscGetConvolution = 24,
41990   cscGetPowerState = 25,
41991   cscPrivateStatusCall = 26,
41992   cscGetDDCBlock = 27,
41993   cscGetMultiConnect = 28,
41994   cscGetClutBehavior = 29,
41995   cscGetTimingRanges = 30,
41996   cscGetDetailedTiming = 31,
41997   cscGetCommunicationInfo = 32
41998 };
41999
42000
42001 enum {
42002   kDisableHorizontalSyncBit = 0,
42003   kDisableVerticalSyncBit = 1,
42004   kDisableCompositeSyncBit = 2,
42005   kEnableSyncOnBlue = 3,
42006   kEnableSyncOnGreen = 4,
42007   kEnableSyncOnRed = 5,
42008   kNoSeparateSyncControlBit = 6,
42009   kTriStateSyncBit = 7,
42010   kHorizontalSyncMask = 0x01,
42011   kVerticalSyncMask = 0x02,
42012   kCompositeSyncMask = 0x04,
42013   kDPMSSyncMask = 0x07,
42014   kTriStateSyncMask = 0x80,
42015   kSyncOnBlueMask = 0x08,
42016   kSyncOnGreenMask = 0x10,
42017   kSyncOnRedMask = 0x20,
42018   kSyncOnMask = 0x38
42019 };
42020
42021 enum {
42022
42023   kDPMSSyncOn = 0,
42024   kDPMSSyncStandby = 1,
42025   kDPMSSyncSuspend = 2,
42026   kDPMSSyncOff = 7
42027 };
42028
42029
42030 enum {
42031   kConvolved = 0,
42032   kLiveVideoPassThru = 1,
42033   kConvolvedMask = 0x01,
42034   kLiveVideoPassThruMask = 0x02
42035 };
42036
42037
42038 struct VPBlock {
42039   long vpBaseOffset;
42040   short vpRowBytes;
42041   Rect vpBounds;
42042   short vpVersion;
42043   short vpPackType;
42044   long vpPackSize;
42045   long vpHRes;
42046   long vpVRes;
42047   short vpPixelType;
42048   short vpPixelSize;
42049   short vpCmpCount;
42050   short vpCmpSize;
42051   long vpPlaneBytes;
42052 };
42053 typedef struct VPBlock VPBlock;
42054 typedef VPBlock * VPBlockPtr;
42055 struct VDEntryRecord {
42056   Ptr csTable;
42057 };
42058 typedef struct VDEntryRecord VDEntryRecord;
42059 typedef VDEntryRecord * VDEntRecPtr;
42060
42061 struct VDGrayRecord {
42062   Boolean csMode;
42063   SInt8 filler;
42064 };
42065 typedef struct VDGrayRecord VDGrayRecord;
42066 typedef VDGrayRecord * VDGrayPtr;
42067
42068 struct VDFlagRecord {
42069   SInt8 csMode;
42070   SInt8 filler;
42071 };
42072 typedef struct VDFlagRecord VDFlagRecord;
42073 typedef VDFlagRecord * VDFlagRecPtr;
42074
42075 struct VDSetEntryRecord {
42076   ColorSpec * csTable;
42077   short csStart;
42078   short csCount;
42079 };
42080 typedef struct VDSetEntryRecord VDSetEntryRecord;
42081 typedef VDSetEntryRecord * VDSetEntryPtr;
42082
42083 struct VDGammaRecord {
42084   Ptr csGTable;
42085 };
42086 typedef struct VDGammaRecord VDGammaRecord;
42087 typedef VDGammaRecord * VDGamRecPtr;
42088 struct VDBaseAddressInfoRec {
42089   long csDevData;
42090   long csDevBase;
42091   short csModeReserved;
42092   long csModeBase;
42093 };
42094 typedef struct VDBaseAddressInfoRec VDBaseAddressInfoRec;
42095 typedef VDBaseAddressInfoRec * VDBaseAddressInfoPtr;
42096 struct VDSwitchInfoRec {
42097   unsigned short csMode;
42098   unsigned long csData;
42099   unsigned short csPage;
42100   Ptr csBaseAddr;
42101   unsigned long csReserved;
42102 };
42103 typedef struct VDSwitchInfoRec VDSwitchInfoRec;
42104 typedef VDSwitchInfoRec * VDSwitchInfoPtr;
42105 struct VDTimingInfoRec {
42106   unsigned long csTimingMode;
42107   unsigned long csTimingReserved;
42108   unsigned long csTimingFormat;
42109   unsigned long csTimingData;
42110   unsigned long csTimingFlags;
42111 };
42112 typedef struct VDTimingInfoRec VDTimingInfoRec;
42113 typedef VDTimingInfoRec * VDTimingInfoPtr;
42114 struct VDDisplayConnectInfoRec {
42115   unsigned short csDisplayType;
42116   unsigned char csConnectTaggedType;
42117   unsigned char csConnectTaggedData;
42118   unsigned long csConnectFlags;
42119   unsigned long csDisplayComponent;
42120   unsigned long csConnectReserved;
42121 };
42122 typedef struct VDDisplayConnectInfoRec VDDisplayConnectInfoRec;
42123 typedef VDDisplayConnectInfoRec * VDDisplayConnectInfoPtr;
42124 struct VDMultiConnectInfoRec {
42125   unsigned long csDisplayCountOrNumber;
42126   VDDisplayConnectInfoRec csConnectInfo;
42127 };
42128 typedef struct VDMultiConnectInfoRec VDMultiConnectInfoRec;
42129 typedef VDMultiConnectInfoRec * VDMultiConnectInfoPtr;
42130 typedef unsigned char RawSenseCode;
42131 enum {
42132   kRSCZero = 0,
42133   kRSCOne = 1,
42134   kRSCTwo = 2,
42135   kRSCThree = 3,
42136   kRSCFour = 4,
42137   kRSCFive = 5,
42138   kRSCSix = 6,
42139   kRSCSeven = 7
42140 };
42141 typedef unsigned char ExtendedSenseCode;
42142 enum {
42143   kESCZero21Inch = 0x00,
42144   kESCOnePortraitMono = 0x14,
42145   kESCTwo12Inch = 0x21,
42146   kESCThree21InchRadius = 0x31,
42147   kESCThree21InchMonoRadius = 0x34,
42148   kESCThree21InchMono = 0x35,
42149   kESCFourNTSC = 0x0A,
42150   kESCFivePortrait = 0x1E,
42151   kESCSixMSB1 = 0x03,
42152   kESCSixMSB2 = 0x0B,
42153   kESCSixMSB3 = 0x23,
42154   kESCSixStandard = 0x2B,
42155   kESCSevenPAL = 0x00,
42156   kESCSevenNTSC = 0x14,
42157   kESCSevenVGA = 0x17,
42158   kESCSeven16Inch = 0x2D,
42159   kESCSevenPALAlternate = 0x30,
42160   kESCSeven19Inch = 0x3A,
42161   kESCSevenDDC = 0x3E,
42162   kESCSevenNoDisplay = 0x3F
42163 };
42164 typedef unsigned short DepthMode;
42165 enum {
42166   kDepthMode1 = 128,
42167   kDepthMode2 = 129,
42168   kDepthMode3 = 130,
42169   kDepthMode4 = 131,
42170   kDepthMode5 = 132,
42171   kDepthMode6 = 133
42172 };
42173
42174 enum {
42175   kFirstDepthMode = 128,
42176   kSecondDepthMode = 129,
42177   kThirdDepthMode = 130,
42178   kFourthDepthMode = 131,
42179   kFifthDepthMode = 132,
42180   kSixthDepthMode = 133
42181 };
42182
42183
42184 struct VDPageInfo {
42185   short csMode;
42186   long csData;
42187   short csPage;
42188   Ptr csBaseAddr;
42189 };
42190 typedef struct VDPageInfo VDPageInfo;
42191 typedef VDPageInfo * VDPgInfoPtr;
42192 struct VDSizeInfo {
42193   short csHSize;
42194   short csHPos;
42195   short csVSize;
42196   short csVPos;
42197 };
42198 typedef struct VDSizeInfo VDSizeInfo;
42199 typedef VDSizeInfo * VDSzInfoPtr;
42200 struct VDSettings {
42201   short csParamCnt;
42202   short csBrightMax;
42203   short csBrightDef;
42204   short csBrightVal;
42205   short csCntrstMax;
42206   short csCntrstDef;
42207   short csCntrstVal;
42208   short csTintMax;
42209   short csTintDef;
42210   short csTintVal;
42211   short csHueMax;
42212   short csHueDef;
42213   short csHueVal;
42214   short csHorizDef;
42215   short csHorizVal;
42216   short csHorizMax;
42217   short csVertDef;
42218   short csVertVal;
42219   short csVertMax;
42220 };
42221 typedef struct VDSettings VDSettings;
42222 typedef VDSettings * VDSettingsPtr;
42223 struct VDDefMode {
42224   UInt8 csID;
42225   SInt8 filler;
42226 };
42227 typedef struct VDDefMode VDDefMode;
42228 typedef VDDefMode * VDDefModePtr;
42229 struct VDSyncInfoRec {
42230   UInt8 csMode;
42231   UInt8 csFlags;
42232 };
42233 typedef struct VDSyncInfoRec VDSyncInfoRec;
42234 typedef VDSyncInfoRec * VDSyncInfoPtr;
42235 typedef UInt32 AVIDType;
42236 typedef AVIDType DisplayIDType;
42237 typedef UInt32 DisplayModeID;
42238 typedef UInt32 VideoDeviceType;
42239 typedef UInt32 GammaTableID;
42240
42241
42242
42243
42244
42245 enum {
42246   kDisplayModeIDCurrent = 0x00,
42247   kDisplayModeIDInvalid = (long)0xFFFFFFFF,
42248   kDisplayModeIDFindFirstResolution = (long)0xFFFFFFFE,
42249   kDisplayModeIDNoMoreResolutions = (long)0xFFFFFFFD,
42250   kDisplayModeIDFindFirstProgrammable = (long)0xFFFFFFFC,
42251   kDisplayModeIDBootProgrammable = (long)0xFFFFFFFB,
42252   kDisplayModeIDReservedBase = (long)0x80000000
42253 };
42254
42255
42256 enum {
42257   kGammaTableIDFindFirst = (long)0xFFFFFFFE,
42258   kGammaTableIDNoMoreTables = (long)0xFFFFFFFD,
42259   kGammaTableIDSpecific = 0x00
42260 };
42261
42262
42263 enum {
42264   kGetConnectionCount = (long)0xFFFFFFFF,
42265   kActivateConnection = (0 << kConnectionInactive),
42266   kDeactivateConnection = (1 << kConnectionInactive)
42267 };
42268
42269
42270 enum {
42271   kVideoDefaultBus = 0
42272 };
42273
42274
42275
42276 enum {
42277   kVideoBusTypeInvalid = 0,
42278   kVideoBusTypeI2C = 1
42279 };
42280
42281
42282
42283 enum {
42284   kVideoNoTransactionType = 0,
42285   kVideoSimpleI2CType = 1,
42286   kVideoDDCciReplyType = 2
42287 };
42288
42289
42290 enum {
42291   kVideoReplyMicroSecDelayMask = (1 << 0)
42292 };
42293
42294
42295
42296 struct VDResolutionInfoRec {
42297   DisplayModeID csPreviousDisplayModeID;
42298   DisplayModeID csDisplayModeID;
42299   unsigned long csHorizontalPixels;
42300   unsigned long csVerticalLines;
42301   Fixed csRefreshRate;
42302   DepthMode csMaxDepthMode;
42303   unsigned long csResolutionFlags;
42304   unsigned long csReserved;
42305 };
42306 typedef struct VDResolutionInfoRec VDResolutionInfoRec;
42307 typedef VDResolutionInfoRec * VDResolutionInfoPtr;
42308 struct VDVideoParametersInfoRec {
42309   DisplayModeID csDisplayModeID;
42310   DepthMode csDepthMode;
42311   VPBlockPtr csVPBlockPtr;
42312   unsigned long csPageCount;
42313   VideoDeviceType csDeviceType;
42314   UInt32 csDepthFlags;
42315 };
42316 typedef struct VDVideoParametersInfoRec VDVideoParametersInfoRec;
42317 typedef VDVideoParametersInfoRec * VDVideoParametersInfoPtr;
42318 struct VDGammaInfoRec {
42319   GammaTableID csLastGammaID;
42320   GammaTableID csNextGammaID;
42321   Ptr csGammaPtr;
42322   unsigned long csReserved;
42323 };
42324 typedef struct VDGammaInfoRec VDGammaInfoRec;
42325 typedef VDGammaInfoRec * VDGammaInfoPtr;
42326 struct VDGetGammaListRec {
42327   GammaTableID csPreviousGammaTableID;
42328   GammaTableID csGammaTableID;
42329   unsigned long csGammaTableSize;
42330   char * csGammaTableName;
42331 };
42332 typedef struct VDGetGammaListRec VDGetGammaListRec;
42333 typedef VDGetGammaListRec * VDGetGammaListPtr;
42334 struct VDRetrieveGammaRec {
42335   GammaTableID csGammaTableID;
42336   GammaTbl * csGammaTablePtr;
42337 };
42338 typedef struct VDRetrieveGammaRec VDRetrieveGammaRec;
42339 typedef VDRetrieveGammaRec * VDRetrieveGammaPtr;
42340 struct VDSetHardwareCursorRec {
42341   void * csCursorRef;
42342   UInt32 csReserved1;
42343   UInt32 csReserved2;
42344 };
42345 typedef struct VDSetHardwareCursorRec VDSetHardwareCursorRec;
42346 typedef VDSetHardwareCursorRec * VDSetHardwareCursorPtr;
42347 struct VDDrawHardwareCursorRec {
42348   SInt32 csCursorX;
42349   SInt32 csCursorY;
42350   UInt32 csCursorVisible;
42351   UInt32 csReserved1;
42352   UInt32 csReserved2;
42353 };
42354 typedef struct VDDrawHardwareCursorRec VDDrawHardwareCursorRec;
42355 typedef VDDrawHardwareCursorRec * VDDrawHardwareCursorPtr;
42356 struct VDSupportsHardwareCursorRec {
42357   UInt32 csSupportsHardwareCursor;
42358
42359   UInt32 csReserved1;
42360   UInt32 csReserved2;
42361 };
42362 typedef struct VDSupportsHardwareCursorRec VDSupportsHardwareCursorRec;
42363 typedef VDSupportsHardwareCursorRec * VDSupportsHardwareCursorPtr;
42364 struct VDHardwareCursorDrawStateRec {
42365   SInt32 csCursorX;
42366   SInt32 csCursorY;
42367   UInt32 csCursorVisible;
42368   UInt32 csCursorSet;
42369   UInt32 csReserved1;
42370   UInt32 csReserved2;
42371 };
42372 typedef struct VDHardwareCursorDrawStateRec VDHardwareCursorDrawStateRec;
42373 typedef VDHardwareCursorDrawStateRec * VDHardwareCursorDrawStatePtr;
42374 struct VDConvolutionInfoRec {
42375   DisplayModeID csDisplayModeID;
42376   DepthMode csDepthMode;
42377   unsigned long csPage;
42378   UInt32 csFlags;
42379   UInt32 csReserved;
42380 };
42381 typedef struct VDConvolutionInfoRec VDConvolutionInfoRec;
42382 typedef VDConvolutionInfoRec * VDConvolutionInfoPtr;
42383 struct VDPowerStateRec {
42384   unsigned long powerState;
42385   unsigned long powerFlags;
42386
42387   unsigned long powerReserved1;
42388   unsigned long powerReserved2;
42389 };
42390 typedef struct VDPowerStateRec VDPowerStateRec;
42391 typedef VDPowerStateRec * VDPowerStatePtr;
42392 struct VDPrivateSelectorDataRec {
42393   LogicalAddress privateParameters;
42394   ByteCount privateParametersSize;
42395   LogicalAddress privateResults;
42396   ByteCount privateResultsSize;
42397 };
42398 typedef struct VDPrivateSelectorDataRec VDPrivateSelectorDataRec;
42399
42400 struct VDPrivateSelectorRec {
42401   UInt32 reserved;
42402   VDPrivateSelectorDataRec data[1];
42403 };
42404 typedef struct VDPrivateSelectorRec VDPrivateSelectorRec;
42405 struct VDDDCBlockRec {
42406   UInt32 ddcBlockNumber;
42407   ResType ddcBlockType;
42408   UInt32 ddcFlags;
42409   UInt32 ddcReserved;
42410   Byte ddcBlockData[128];
42411 };
42412 typedef struct VDDDCBlockRec VDDDCBlockRec;
42413 typedef VDDDCBlockRec * VDDDCBlockPtr;
42414
42415 enum {
42416
42417   kSyncInterlaceMask = (1 << 7),
42418   kSyncAnalogCompositeMask = 0,
42419   kSyncAnalogCompositeSerrateMask = (1 << 2),
42420   kSyncAnalogCompositeRGBSyncMask = (1 << 1),
42421   kSyncAnalogBipolarMask = (1 << 3),
42422   kSyncAnalogBipolarSerrateMask = (1 << 2),
42423   kSyncAnalogBipolarSRGBSyncMask = (1 << 1),
42424   kSyncDigitalCompositeMask = (1 << 4),
42425   kSyncDigitalCompositeSerrateMask = (1 << 2),
42426   kSyncDigitalCompositeMatchHSyncMask = (1 << 2),
42427   kSyncDigitalSeperateMask = (1 << 4) + (1 << 3),
42428   kSyncDigitalVSyncPositiveMask = (1 << 2),
42429   kSyncDigitalHSyncPositiveMask = (1 << 1)
42430 };
42431
42432
42433
42434 struct VDDisplayTimingRangeRec {
42435   UInt32 csRangeSize;
42436   UInt32 csRangeType;
42437   UInt32 csRangeVersion;
42438   UInt32 csRangeReserved;
42439
42440   UInt32 csRangeBlockIndex;
42441   UInt32 csRangeGroup;
42442   UInt32 csRangeBlockCount;
42443   UInt32 csRangeFlags;
42444
42445   UInt64 csMinPixelClock;
42446   UInt64 csMaxPixelClock;
42447
42448   UInt32 csMaxPixelError;
42449   UInt32 csTimingRangeSyncFlags;
42450   UInt32 csTimingRangeSignalLevels;
42451   UInt32 csReserved0;
42452
42453   UInt32 csMinFrameRate;
42454   UInt32 csMaxFrameRate;
42455   UInt32 csMinLineRate;
42456   UInt32 csMaxLineRate;
42457
42458
42459   UInt32 csMaxHorizontalTotal;
42460   UInt32 csMaxVerticalTotal;
42461   UInt32 csMaxTotalReserved1;
42462   UInt32 csMaxTotalReserved2;
42463   UInt8 csCharSizeHorizontalActive;
42464   UInt8 csCharSizeHorizontalBlanking;
42465   UInt8 csCharSizeHorizontalSyncOffset;
42466   UInt8 csCharSizeHorizontalSyncPulse;
42467
42468   UInt8 csCharSizeVerticalActive;
42469   UInt8 csCharSizeVerticalBlanking;
42470   UInt8 csCharSizeVerticalSyncOffset;
42471   UInt8 csCharSizeVerticalSyncPulse;
42472
42473   UInt8 csCharSizeHorizontalBorderLeft;
42474   UInt8 csCharSizeHorizontalBorderRight;
42475   UInt8 csCharSizeVerticalBorderTop;
42476   UInt8 csCharSizeVerticalBorderBottom;
42477
42478   UInt8 csCharSizeHorizontalTotal;
42479   UInt8 csCharSizeVerticalTotal;
42480   UInt16 csCharSizeReserved1;
42481
42482
42483   UInt32 csMinHorizontalActiveClocks;
42484   UInt32 csMaxHorizontalActiveClocks;
42485   UInt32 csMinHorizontalBlankingClocks;
42486   UInt32 csMaxHorizontalBlankingClocks;
42487
42488   UInt32 csMinHorizontalSyncOffsetClocks;
42489   UInt32 csMaxHorizontalSyncOffsetClocks;
42490   UInt32 csMinHorizontalPulseWidthClocks;
42491   UInt32 csMaxHorizontalPulseWidthClocks;
42492
42493   UInt32 csMinVerticalActiveClocks;
42494   UInt32 csMaxVerticalActiveClocks;
42495   UInt32 csMinVerticalBlankingClocks;
42496   UInt32 csMaxVerticalBlankingClocks;
42497
42498   UInt32 csMinVerticalSyncOffsetClocks;
42499   UInt32 csMaxVerticalSyncOffsetClocks;
42500   UInt32 csMinVerticalPulseWidthClocks;
42501   UInt32 csMaxVerticalPulseWidthClocks;
42502
42503
42504   UInt32 csMinHorizontalBorderLeft;
42505   UInt32 csMaxHorizontalBorderLeft;
42506   UInt32 csMinHorizontalBorderRight;
42507   UInt32 csMaxHorizontalBorderRight;
42508
42509   UInt32 csMinVerticalBorderTop;
42510   UInt32 csMaxVerticalBorderTop;
42511   UInt32 csMinVerticalBorderBottom;
42512   UInt32 csMaxVerticalBorderBottom;
42513
42514   UInt32 csReserved1;
42515   UInt32 csReserved2;
42516   UInt32 csReserved3;
42517   UInt32 csReserved4;
42518
42519   UInt32 csReserved5;
42520   UInt32 csReserved6;
42521   UInt32 csReserved7;
42522   UInt32 csReserved8;
42523 };
42524 typedef struct VDDisplayTimingRangeRec VDDisplayTimingRangeRec;
42525 typedef VDDisplayTimingRangeRec * VDDisplayTimingRangePtr;
42526
42527 enum {
42528
42529   kDMSModeReady = 0,
42530   kDMSModeNotReady = 1,
42531   kDMSModeFree = 2
42532 };
42533
42534
42535
42536 enum {
42537   kTimingChangeRestrictedErr = -10930,
42538   kVideoI2CReplyPendingErr = -10931,
42539   kVideoI2CTransactionErr = -10932,
42540   kVideoI2CBusyErr = -10933,
42541   kVideoI2CTransactionTypeErr = -10934,
42542   kVideoBufferSizeErr = -10935
42543 };
42544
42545
42546 enum {
42547
42548   kRangeSupportsSignal_0700_0300_Bit = 0,
42549   kRangeSupportsSignal_0714_0286_Bit = 1,
42550   kRangeSupportsSignal_1000_0400_Bit = 2,
42551   kRangeSupportsSignal_0700_0000_Bit = 3,
42552   kRangeSupportsSignal_0700_0300_Mask = (1 << kRangeSupportsSignal_0700_0300_Bit),
42553   kRangeSupportsSignal_0714_0286_Mask = (1 << kRangeSupportsSignal_0714_0286_Bit),
42554   kRangeSupportsSignal_1000_0400_Mask = (1 << kRangeSupportsSignal_1000_0400_Bit),
42555   kRangeSupportsSignal_0700_0000_Mask = (1 << kRangeSupportsSignal_0700_0000_Bit)
42556 };
42557
42558
42559 enum {
42560
42561   kDigitalSignalBit = 0,
42562   kAnalogSetupExpectedBit = 1,
42563   kDigitalSignalMask = (1 << kDigitalSignalBit),
42564   kAnalogSetupExpectedMask = (1 << kAnalogSetupExpectedBit)
42565 };
42566
42567
42568 enum {
42569
42570   kAnalogSignalLevel_0700_0300 = 0,
42571   kAnalogSignalLevel_0714_0286 = 1,
42572   kAnalogSignalLevel_1000_0400 = 2,
42573   kAnalogSignalLevel_0700_0000 = 3
42574 };
42575
42576
42577 enum {
42578
42579   kRangeSupportsSeperateSyncsBit = 0,
42580   kRangeSupportsSyncOnGreenBit = 1,
42581   kRangeSupportsCompositeSyncBit = 2,
42582   kRangeSupportsVSyncSerrationBit = 3,
42583   kRangeSupportsSeperateSyncsMask = (1 << kRangeSupportsSeperateSyncsBit),
42584   kRangeSupportsSyncOnGreenMask = (1 << kRangeSupportsSyncOnGreenBit),
42585   kRangeSupportsCompositeSyncMask = (1 << kRangeSupportsCompositeSyncBit),
42586   kRangeSupportsVSyncSerrationMask = (1 << kRangeSupportsVSyncSerrationBit)
42587 };
42588
42589
42590
42591 enum {
42592
42593   kSyncPositivePolarityBit = 0,
42594   kSyncPositivePolarityMask = (1 << kSyncPositivePolarityBit)
42595 };
42596
42597
42598
42599
42600
42601 struct VDDetailedTimingRec {
42602   UInt32 csTimingSize;
42603   UInt32 csTimingType;
42604   UInt32 csTimingVersion;
42605   UInt32 csTimingReserved;
42606
42607   DisplayModeID csDisplayModeID;
42608   UInt32 csDisplayModeSeed;
42609   UInt32 csDisplayModeState;
42610   UInt32 csDisplayModeAlias;
42611
42612   UInt32 csSignalConfig;
42613   UInt32 csSignalLevels;
42614
42615   UInt64 csPixelClock;
42616
42617   UInt64 csMinPixelClock;
42618   UInt64 csMaxPixelClock;
42619
42620
42621   UInt32 csHorizontalActive;
42622   UInt32 csHorizontalBlanking;
42623   UInt32 csHorizontalSyncOffset;
42624   UInt32 csHorizontalSyncPulseWidth;
42625
42626   UInt32 csVerticalActive;
42627   UInt32 csVerticalBlanking;
42628   UInt32 csVerticalSyncOffset;
42629   UInt32 csVerticalSyncPulseWidth;
42630
42631   UInt32 csHorizontalBorderLeft;
42632   UInt32 csHorizontalBorderRight;
42633   UInt32 csVerticalBorderTop;
42634   UInt32 csVerticalBorderBottom;
42635
42636   UInt32 csHorizontalSyncConfig;
42637   UInt32 csHorizontalSyncLevel;
42638   UInt32 csVerticalSyncConfig;
42639   UInt32 csVerticalSyncLevel;
42640
42641   UInt32 csReserved1;
42642   UInt32 csReserved2;
42643   UInt32 csReserved3;
42644   UInt32 csReserved4;
42645
42646   UInt32 csReserved5;
42647   UInt32 csReserved6;
42648   UInt32 csReserved7;
42649   UInt32 csReserved8;
42650 };
42651 typedef struct VDDetailedTimingRec VDDetailedTimingRec;
42652 typedef VDDetailedTimingRec * VDDetailedTimingPtr;
42653 typedef UInt32 VDClutBehavior;
42654 typedef VDClutBehavior * VDClutBehaviorPtr;
42655 enum {
42656   kSetClutAtSetEntries = 0,
42657   kSetClutAtVBL = 1
42658 };
42659
42660
42661 struct VDCommunicationRec {
42662   SInt32 csBusID;
42663   UInt32 csCommFlags;
42664   UInt32 csMinReplyDelay;
42665   UInt32 csReserved2;
42666
42667   UInt32 csSendAddress;
42668   UInt32 csSendType;
42669   LogicalAddress csSendBuffer;
42670   ByteCount csSendSize;
42671
42672   UInt32 csReplyAddress;
42673   UInt32 csReplyType;
42674   LogicalAddress csReplyBuffer;
42675   ByteCount csReplySize;
42676
42677   UInt32 csReserved3;
42678   UInt32 csReserved4;
42679   UInt32 csReserved5;
42680   UInt32 csReserved6;
42681 };
42682 typedef struct VDCommunicationRec VDCommunicationRec;
42683 typedef VDCommunicationRec * VDCommunicationPtr;
42684 struct VDCommunicationInfoRec {
42685   SInt32 csBusID;
42686   UInt32 csBusType;
42687   SInt32 csMinBus;
42688   SInt32 csMaxBus;
42689
42690   UInt32 csSupportedTypes;
42691   UInt32 csSupportedCommFlags;
42692   UInt32 csReserved2;
42693   UInt32 csReserved3;
42694
42695   UInt32 csReserved4;
42696   UInt32 csReserved5;
42697   UInt32 csReserved6;
42698   UInt32 csReserved7;
42699 };
42700 typedef struct VDCommunicationInfoRec VDCommunicationInfoRec;
42701 typedef VDCommunicationInfoRec * VDCommunicationInfoPtr;
42702
42703
42704
42705
42706 extern "C" {
42707
42708
42709
42710 typedef void * DMProcessInfoPtr;
42711 typedef void * DMModalFilterUPP;
42712 enum {
42713
42714   kAESystemConfigNotice = 'cnfg',
42715   kAEDisplayNotice = 'dspl',
42716   kAEDisplaySummary = 'dsum',
42717   keyDMConfigVersion = 'dmcv',
42718   keyDMConfigFlags = 'dmcf',
42719   keyDMConfigReserved = 'dmcr',
42720   keyDisplayID = 'dmid',
42721   keyDisplayComponent = 'dmdc',
42722   keyDisplayDevice = 'dmdd',
42723   keyDisplayFlags = 'dmdf',
42724   keyDisplayMode = 'dmdm',
42725   keyDisplayModeReserved = 'dmmr',
42726   keyDisplayReserved = 'dmdr',
42727   keyDisplayMirroredId = 'dmmi',
42728   keyDeviceFlags = 'dddf',
42729   keyDeviceDepthMode = 'dddm',
42730   keyDeviceRect = 'dddr',
42731   keyPixMapRect = 'dpdr',
42732   keyPixMapHResolution = 'dphr',
42733   keyPixMapVResolution = 'dpvr',
42734   keyPixMapPixelType = 'dppt',
42735   keyPixMapPixelSize = 'dpps',
42736   keyPixMapCmpCount = 'dpcc',
42737   keyPixMapCmpSize = 'dpcs',
42738   keyPixMapAlignment = 'dppa',
42739   keyPixMapResReserved = 'dprr',
42740   keyPixMapReserved = 'dppr',
42741   keyPixMapColorTableSeed = 'dpct',
42742   keySummaryMenubar = 'dsmb',
42743   keySummaryChanges = 'dsch',
42744   keyDisplayOldConfig = 'dold',
42745   keyDisplayNewConfig = 'dnew'
42746 };
42747
42748 enum {
42749   dmOnlyActiveDisplays = true,
42750   dmAllDisplays = false
42751 };
42752
42753
42754 enum {
42755
42756   kDependentNotifyClassShowCursor = 'shcr',
42757   kDependentNotifyClassDriverOverride = 'ndrv',
42758   kDependentNotifyClassDisplayMgrOverride = 'dmgr',
42759   kDependentNotifyClassProfileChanged = 'prof'
42760 };
42761
42762
42763 enum {
42764
42765   kNoSwitchConfirmBit = 0,
42766   kDepthNotAvailableBit = 1,
42767   kShowModeBit = 3,
42768   kModeNotResizeBit = 4,
42769   kNeverShowModeBit = 5
42770 };
42771
42772
42773
42774
42775 enum {
42776   kBeginEndConfigureBit = 0,
42777   kMovedDisplayBit = 1,
42778   kSetMainDisplayBit = 2,
42779   kSetDisplayModeBit = 3,
42780   kAddDisplayBit = 4,
42781   kRemoveDisplayBit = 5,
42782   kNewDisplayBit = 6,
42783   kDisposeDisplayBit = 7,
42784   kEnabledDisplayBit = 8,
42785   kDisabledDisplayBit = 9,
42786   kMirrorDisplayBit = 10,
42787   kUnMirrorDisplayBit = 11
42788 };
42789
42790
42791 enum {
42792
42793   kDMNotifyRequestConnectionProbe = 0,
42794   kDMNotifyInstalled = 1,
42795   kDMNotifyEvent = 2,
42796   kDMNotifyRemoved = 3,
42797   kDMNotifyPrep = 4,
42798   kDMNotifyExtendEvent = 5,
42799   kDMNotifyDependents = 6,
42800   kDMNotifySuspendConfigure = 7,
42801   kDMNotifyResumeConfigure = 8,
42802   kDMNotifyRequestDisplayProbe = 9,
42803   kDMNotifyDisplayWillSleep = 10,
42804   kDMNotifyDisplayDidWake = 11,
42805
42806   kExtendedNotificationProc = (1L << 16)
42807 };
42808
42809
42810
42811 enum {
42812   kFullNotify = 0,
42813   kFullDependencyNotify = 1
42814 };
42815
42816
42817 enum {
42818   kDummyDeviceID = 0x00FF,
42819   kInvalidDisplayID = 0x0000,
42820   kFirstDisplayID = 0x0100
42821 };
42822
42823 enum {
42824
42825   kAllowDuplicatesBit = 0
42826 };
42827
42828 enum {
42829
42830   kSuppressNumberBit = 0,
42831   kSuppressNumberMask = 1,
42832   kForceNumberBit = 1,
42833   kForceNumberMask = 2,
42834   kSuppressNameBit = 2,
42835   kSuppressNameMask = 4
42836 };
42837
42838
42839 enum {
42840   kDMSupressNumbersMask = (1 << 0),
42841   kDMForceNumbersMask = (1 << 1),
42842   kDMSupressNameMask = (1 << 2)
42843 };
42844
42845
42846
42847
42848 enum {
42849   kNoFidelity = 0,
42850   kMinimumFidelity = 1,
42851   kDefaultFidelity = 500,
42852   kDefaultManufacturerFidelity = 1000
42853 };
42854
42855 enum {
42856   kAnyPanelType = 0,
42857   kAnyEngineType = 0,
42858   kAnyDeviceType = 0,
42859   kAnyPortType = 0
42860 };
42861
42862
42863 enum {
42864
42865   kPLIncludeOfflineDevicesBit = 0
42866 };
42867
42868
42869
42870 enum {
42871   kForceConfirmBit = 0,
42872   kForceConfirmMask = (1 << kForceConfirmBit)
42873 };
42874
42875
42876
42877 enum {
42878   kDisplayModeListNotPreferredBit = 0,
42879   kDisplayModeListNotPreferredMask = (1 << kDisplayModeListNotPreferredBit)
42880 };
42881
42882
42883
42884 enum {
42885   kComponentListNotPreferredBit = 0,
42886   kComponentListNotPreferredMask = (1 << kComponentListNotPreferredBit)
42887 };
42888
42889 enum {
42890   kDisplayTimingInfoVersionZero = 1,
42891   kDisplayTimingInfoReservedCountVersionZero = 16,
42892   kDisplayModeEntryVersionZero = 0,
42893   kDisplayModeEntryVersionOne = 1
42894 };
42895
42896
42897 enum {
42898   kMakeAndModelReservedCount = 4
42899 };
42900
42901
42902
42903 enum {
42904   kDisplayGestaltDisplayCommunicationAttr = 'comm',
42905   kDisplayGestaltForbidI2CMask = (1 << 0),
42906   kDisplayGestaltUseI2CPowerMask = (1 << 1),
42907   kDisplayGestaltCalibratorAttr = 'cali',
42908   kDisplayGestaltBrightnessAffectsGammaMask = (1 << 0),
42909   kDisplayGestaltViewAngleAffectsGammaMask = (1 << 1)
42910 };
42911
42912
42913 typedef UInt32 DMFidelityType;
42914
42915
42916
42917
42918
42919
42920 typedef void * DMListType;
42921 typedef unsigned long DMListIndexType;
42922 typedef VDPowerStateRec AVPowerStateRec;
42923 typedef VDPowerStateRec * AVPowerStatePtr;
42924 struct DMDisplayTimingInfoRec {
42925   UInt32 timingInfoVersion;
42926   UInt32 timingInfoAttributes;
42927   SInt32 timingInfoRelativeQuality;
42928   SInt32 timingInfoRelativeDefault;
42929
42930   UInt32 timingInfoReserved[16];
42931 };
42932 typedef struct DMDisplayTimingInfoRec DMDisplayTimingInfoRec;
42933 typedef DMDisplayTimingInfoRec * DMDisplayTimingInfoPtr;
42934
42935 struct DMComponentListEntryRec {
42936   DisplayIDType itemID;
42937   Component itemComponent;
42938   ComponentDescription itemDescription;
42939
42940   ResType itemClass;
42941   DMFidelityType itemFidelity;
42942   ResType itemSubClass;
42943   Point itemSort;
42944
42945   unsigned long itemFlags;
42946   ResType itemReserved;
42947   unsigned long itemFuture1;
42948   unsigned long itemFuture2;
42949   unsigned long itemFuture3;
42950   unsigned long itemFuture4;
42951 };
42952 typedef struct DMComponentListEntryRec DMComponentListEntryRec;
42953 typedef DMComponentListEntryRec * DMComponentListEntryPtr;
42954
42955 struct AVLocationRec {
42956   unsigned long locationConstant;
42957 };
42958 typedef struct AVLocationRec AVLocationRec;
42959 typedef AVLocationRec * AVLocationPtr;
42960 struct DMDepthInfoRec {
42961   VDSwitchInfoPtr depthSwitchInfo;
42962   VPBlockPtr depthVPBlock;
42963   UInt32 depthFlags;
42964   UInt32 depthReserved1;
42965   UInt32 depthReserved2;
42966 };
42967 typedef struct DMDepthInfoRec DMDepthInfoRec;
42968 typedef DMDepthInfoRec * DMDepthInfoPtr;
42969 struct DMDepthInfoBlockRec {
42970   unsigned long depthBlockCount;
42971   DMDepthInfoPtr depthVPBlock;
42972   unsigned long depthBlockFlags;
42973   unsigned long depthBlockReserved1;
42974   unsigned long depthBlockReserved2;
42975 };
42976 typedef struct DMDepthInfoBlockRec DMDepthInfoBlockRec;
42977 typedef DMDepthInfoBlockRec * DMDepthInfoBlockPtr;
42978 struct DMDisplayModeListEntryRec {
42979   UInt32 displayModeFlags;
42980   VDSwitchInfoPtr displayModeSwitchInfo;
42981   VDResolutionInfoPtr displayModeResolutionInfo;
42982   VDTimingInfoPtr displayModeTimingInfo;
42983   DMDepthInfoBlockPtr displayModeDepthBlockInfo;
42984   UInt32 displayModeVersion;
42985   StringPtr displayModeName;
42986   DMDisplayTimingInfoPtr displayModeDisplayInfo;
42987 };
42988 typedef struct DMDisplayModeListEntryRec DMDisplayModeListEntryRec;
42989 typedef DMDisplayModeListEntryRec * DMDisplayModeListEntryPtr;
42990
42991 struct DependentNotifyRec {
42992   ResType notifyType;
42993   ResType notifyClass;
42994   DisplayIDType notifyPortID;
42995   ComponentInstance notifyComponent;
42996
42997   unsigned long notifyVersion;
42998   unsigned long notifyFlags;
42999   unsigned long notifyReserved;
43000   unsigned long notifyFuture;
43001 };
43002 typedef struct DependentNotifyRec DependentNotifyRec;
43003 typedef DependentNotifyRec * DependentNotifyPtr;
43004
43005 struct DMMakeAndModelRec {
43006   ResType manufacturer;
43007   UInt32 model;
43008   UInt32 serialNumber;
43009   UInt32 manufactureDate;
43010
43011   UInt32 makeReserved[4];
43012 };
43013 typedef struct DMMakeAndModelRec DMMakeAndModelRec;
43014 typedef DMMakeAndModelRec * DMMakeAndModelPtr;
43015
43016 enum {
43017   kIncludeOnlineActiveDisplaysMask = (1 << 0),
43018   kIncludeOnlineDisabledDisplaysMask = (1 << 1),
43019   kIncludeOfflineDisplaysMask = (1 << 2),
43020   kIncludeOfflineDummyDisplaysMask = (1 << 3),
43021   kIncludeHardwareMirroredDisplaysMask = (1 << 4)
43022 };
43023
43024
43025 enum {
43026
43027   kDMModeListIncludeAllModesMask = (1 << 0),
43028   kDMModeListIncludeOfflineModesMask = (1 << 1),
43029   kDMModeListExcludeDriverModesMask = (1 << 2),
43030   kDMModeListExcludeDisplayModesMask = (1 << 3),
43031   kDMModeListExcludeCustomModesMask = (1 << 4),
43032   kDMModeListPreferStretchedModesMask = (1 << 5),
43033   kDMModeListPreferSafeModesMask = (1 << 6)
43034 };
43035
43036
43037
43038 struct DisplayListEntryRec {
43039   GDHandle displayListEntryGDevice;
43040   DisplayIDType displayListEntryDisplayID;
43041   UInt32 displayListEntryIncludeFlags;
43042   UInt32 displayListEntryReserved1;
43043
43044   UInt32 displayListEntryReserved2;
43045   UInt32 displayListEntryReserved3;
43046   UInt32 displayListEntryReserved4;
43047   UInt32 displayListEntryReserved5;
43048 };
43049 typedef struct DisplayListEntryRec DisplayListEntryRec;
43050 typedef DisplayListEntryRec * DisplayListEntryPtr;
43051 struct DMProfileListEntryRec {
43052   CMProfileRef profileRef;
43053   Ptr profileReserved1;
43054   Ptr profileReserved2;
43055   Ptr profileReserved3;
43056 };
43057 typedef struct DMProfileListEntryRec DMProfileListEntryRec;
43058 typedef DMProfileListEntryRec * DMProfileListEntryPtr;
43059 typedef void ( * DMNotificationProcPtr)(AppleEvent * theEvent);
43060 typedef void ( * DMExtendedNotificationProcPtr)(void *userData, short theMessage, void *notifyData);
43061 typedef void ( * DMComponentListIteratorProcPtr)(void *userData, DMListIndexType itemIndex, DMComponentListEntryPtr componentInfo);
43062 typedef void ( * DMDisplayModeListIteratorProcPtr)(void *userData, DMListIndexType itemIndex, DMDisplayModeListEntryPtr displaymodeInfo);
43063 typedef void ( * DMProfileListIteratorProcPtr)(void *userData, DMListIndexType itemIndex, DMProfileListEntryPtr profileInfo);
43064 typedef void ( * DMDisplayListIteratorProcPtr)(void *userData, DMListIndexType itemIndex, DisplayListEntryPtr displaymodeInfo);
43065 typedef DMNotificationProcPtr DMNotificationUPP;
43066 typedef DMExtendedNotificationProcPtr DMExtendedNotificationUPP;
43067 typedef DMComponentListIteratorProcPtr DMComponentListIteratorUPP;
43068 typedef DMDisplayModeListIteratorProcPtr DMDisplayModeListIteratorUPP;
43069 typedef DMProfileListIteratorProcPtr DMProfileListIteratorUPP;
43070 typedef DMDisplayListIteratorProcPtr DMDisplayListIteratorUPP;
43071 extern DMNotificationUPP
43072 NewDMNotificationUPP(DMNotificationProcPtr userRoutine) ;
43073 extern DMExtendedNotificationUPP
43074 NewDMExtendedNotificationUPP(DMExtendedNotificationProcPtr userRoutine) ;
43075 extern DMComponentListIteratorUPP
43076 NewDMComponentListIteratorUPP(DMComponentListIteratorProcPtr userRoutine) ;
43077 extern DMDisplayModeListIteratorUPP
43078 NewDMDisplayModeListIteratorUPP(DMDisplayModeListIteratorProcPtr userRoutine) ;
43079 extern DMProfileListIteratorUPP
43080 NewDMProfileListIteratorUPP(DMProfileListIteratorProcPtr userRoutine) ;
43081 extern DMDisplayListIteratorUPP
43082 NewDMDisplayListIteratorUPP(DMDisplayListIteratorProcPtr userRoutine) ;
43083 extern void
43084 DisposeDMNotificationUPP(DMNotificationUPP userUPP) ;
43085 extern void
43086 DisposeDMExtendedNotificationUPP(DMExtendedNotificationUPP userUPP) ;
43087 extern void
43088 DisposeDMComponentListIteratorUPP(DMComponentListIteratorUPP userUPP) ;
43089 extern void
43090 DisposeDMDisplayModeListIteratorUPP(DMDisplayModeListIteratorUPP userUPP) ;
43091 extern void
43092 DisposeDMProfileListIteratorUPP(DMProfileListIteratorUPP userUPP) ;
43093 extern void
43094 DisposeDMDisplayListIteratorUPP(DMDisplayListIteratorUPP userUPP) ;
43095 extern void
43096 InvokeDMNotificationUPP(
43097   AppleEvent * theEvent,
43098   DMNotificationUPP userUPP) ;
43099 extern void
43100 InvokeDMExtendedNotificationUPP(
43101   void * userData,
43102   short theMessage,
43103   void * notifyData,
43104   DMExtendedNotificationUPP userUPP) ;
43105 extern void
43106 InvokeDMComponentListIteratorUPP(
43107   void * userData,
43108   DMListIndexType itemIndex,
43109   DMComponentListEntryPtr componentInfo,
43110   DMComponentListIteratorUPP userUPP) ;
43111 extern void
43112 InvokeDMDisplayModeListIteratorUPP(
43113   void * userData,
43114   DMListIndexType itemIndex,
43115   DMDisplayModeListEntryPtr displaymodeInfo,
43116   DMDisplayModeListIteratorUPP userUPP) ;
43117 extern void
43118 InvokeDMProfileListIteratorUPP(
43119   void * userData,
43120   DMListIndexType itemIndex,
43121   DMProfileListEntryPtr profileInfo,
43122   DMProfileListIteratorUPP userUPP) ;
43123 extern void
43124 InvokeDMDisplayListIteratorUPP(
43125   void * userData,
43126   DMListIndexType itemIndex,
43127   DisplayListEntryPtr displaymodeInfo,
43128   DMDisplayListIteratorUPP userUPP) ;
43129 extern GDHandle
43130 DMGetFirstScreenDevice(Boolean activeOnly) ;
43131 extern GDHandle
43132 DMGetNextScreenDevice(
43133   GDHandle theDevice,
43134   Boolean activeOnly) ;
43135 extern void
43136 DMDrawDesktopRect(Rect * globalRect) ;
43137 extern void
43138 DMDrawDesktopRegion(RgnHandle globalRgn) ;
43139 extern OSErr
43140 DMBeginConfigureDisplays(Handle * displayState) ;
43141 extern OSErr
43142 DMEndConfigureDisplays(Handle displayState) ;
43143 extern OSErr
43144 DMAddDisplay(
43145   GDHandle newDevice,
43146   short driver,
43147   unsigned long mode,
43148   unsigned long reserved,
43149   unsigned long displayID,
43150   Component displayComponent,
43151   Handle displayState) ;
43152 extern OSErr
43153 DMMoveDisplay(
43154   GDHandle moveDevice,
43155   short x,
43156   short y,
43157   Handle displayState) ;
43158 extern OSErr
43159 DMDisableDisplay(
43160   GDHandle disableDevice,
43161   Handle displayState) ;
43162 extern OSErr
43163 DMEnableDisplay(
43164   GDHandle enableDevice,
43165   Handle displayState) ;
43166 extern OSErr
43167 DMRemoveDisplay(
43168   GDHandle removeDevice,
43169   Handle displayState) ;
43170 extern OSErr
43171 DMSetMainDisplay(
43172   GDHandle newMainDevice,
43173   Handle displayState) ;
43174 extern OSErr
43175 DMSetDisplayMode(
43176   GDHandle theDevice,
43177   unsigned long mode,
43178   unsigned long * depthMode,
43179   unsigned long reserved,
43180   Handle displayState) ;
43181 extern OSErr
43182 DMCheckDisplayMode(
43183   GDHandle theDevice,
43184   unsigned long mode,
43185   unsigned long depthMode,
43186   unsigned long * switchFlags,
43187   unsigned long reserved,
43188   Boolean * modeOk) ;
43189 extern OSErr
43190 DMGetDeskRegion(RgnHandle * desktopRegion) ;
43191 extern OSErr
43192 DMRegisterNotifyProc(
43193   DMNotificationUPP notificationProc,
43194   DMProcessInfoPtr whichPSN) ;
43195 extern OSErr
43196 DMRemoveNotifyProc(
43197   DMNotificationUPP notificationProc,
43198   DMProcessInfoPtr whichPSN) ;
43199 extern OSErr
43200 DMQDIsMirroringCapable(Boolean * qdIsMirroringCapable) ;
43201 extern OSErr
43202 DMCanMirrorNow(Boolean * canMirrorNow) ;
43203 extern OSErr
43204 DMIsMirroringOn(Boolean * isMirroringOn) ;
43205 extern OSErr
43206 DMMirrorDevices(
43207   GDHandle gD1,
43208   GDHandle gD2,
43209   Handle displayState) ;
43210 extern OSErr
43211 DMUnmirrorDevice(
43212   GDHandle gDevice,
43213   Handle displayState) ;
43214 extern OSErr
43215 DMGetNextMirroredDevice(
43216   GDHandle gDevice,
43217   GDHandle * mirroredDevice) ;
43218 extern OSErr
43219 DMBlockMirroring(void) ;
43220 extern OSErr
43221 DMUnblockMirroring(void) ;
43222 extern OSErr
43223 DMGetDisplayIDByGDevice(
43224   GDHandle displayDevice,
43225   DisplayIDType * displayID,
43226   Boolean failToMain) ;
43227 extern OSErr
43228 DMGetGDeviceByDisplayID(
43229   DisplayIDType displayID,
43230   GDHandle * displayDevice,
43231   Boolean failToMain) ;
43232 extern OSErr
43233 DMSetDisplayComponent(
43234   GDHandle theDevice,
43235   Component displayComponent) ;
43236 extern OSErr
43237 DMGetDisplayComponent(
43238   GDHandle theDevice,
43239   Component * displayComponent) ;
43240 extern OSErr
43241 DMNewDisplay(
43242   GDHandle * newDevice,
43243   short driverRefNum,
43244   unsigned long mode,
43245   unsigned long reserved,
43246   DisplayIDType displayID,
43247   Component displayComponent,
43248   Handle displayState) ;
43249 extern OSErr
43250 DMDisposeDisplay(
43251   GDHandle disposeDevice,
43252   Handle displayState) ;
43253 extern OSErr
43254 DMResolveDisplayComponents(void) ;
43255 extern OSErr
43256 DMRegisterExtendedNotifyProc(
43257   DMExtendedNotificationUPP notifyProc,
43258   void * notifyUserData,
43259   unsigned short nofifyOnFlags,
43260   DMProcessInfoPtr whichPSN) ;
43261 extern OSErr
43262 DMRemoveExtendedNotifyProc(
43263   DMExtendedNotificationUPP notifyProc,
43264   void * notifyUserData,
43265   DMProcessInfoPtr whichPSN,
43266   unsigned short removeFlags) ;
43267 extern OSErr
43268 DMNewAVPanelList(
43269   DisplayIDType displayID,
43270   ResType panelType,
43271   DMFidelityType minimumFidelity,
43272   unsigned long panelListFlags,
43273   unsigned long reserved,
43274   DMListIndexType * thePanelCount,
43275   DMListType * thePanelList) ;
43276 extern OSErr
43277 DMNewAVEngineList(
43278   DisplayIDType displayID,
43279   ResType engineType,
43280   DMFidelityType minimumFidelity,
43281   unsigned long engineListFlags,
43282   unsigned long reserved,
43283   DMListIndexType * engineCount,
43284   DMListType * engineList) ;
43285 extern OSErr
43286 DMNewAVDeviceList(
43287   ResType deviceType,
43288   unsigned long deviceListFlags,
43289   unsigned long reserved,
43290   DMListIndexType * deviceCount,
43291   DMListType * deviceList) ;
43292 extern OSErr
43293 DMNewAVPortListByPortType(
43294   ResType subType,
43295   unsigned long portListFlags,
43296   unsigned long reserved,
43297   DMListIndexType * devicePortCount,
43298   DMListType * theDevicePortList) ;
43299 extern OSErr
43300 DMGetIndexedComponentFromList(
43301   DMListType panelList,
43302   DMListIndexType itemIndex,
43303   unsigned long reserved,
43304   DMComponentListIteratorUPP listIterator,
43305   void * userData) ;
43306 extern OSErr
43307 DMDisposeList(DMListType panelList) ;
43308 extern OSErr
43309 DMGetNameByAVID(
43310   AVIDType theID,
43311   unsigned long nameFlags,
43312   Str255 name) ;
43313 extern OSErr
43314 DMNewAVIDByPortComponent(
43315   Component thePortComponent,
43316   ResType portKind,
43317   unsigned long reserved,
43318   AVIDType * newID) ;
43319 extern OSErr
43320 DMGetPortComponentByAVID(
43321   DisplayIDType thePortID,
43322   Component * thePortComponent,
43323   ComponentDescription * theDesciption,
43324   ResType * thePortKind) ;
43325 extern OSErr
43326 DMSendDependentNotification(
43327   ResType notifyType,
43328   ResType notifyClass,
43329   AVIDType displayID,
43330   ComponentInstance notifyComponent) ;
43331 extern OSErr
43332 DMDisposeAVComponent(Component theAVComponent) ;
43333 extern OSErr
43334 DMSaveScreenPrefs(
43335   unsigned long reserved1,
43336   unsigned long saveFlags,
43337   unsigned long reserved2) ;
43338 extern OSErr
43339 DMNewAVIDByDeviceComponent(
43340   Component theDeviceComponent,
43341   ResType portKind,
43342   unsigned long reserved,
43343   DisplayIDType * newID) ;
43344 extern OSErr
43345 DMNewAVPortListByDeviceAVID(
43346   AVIDType theID,
43347   DMFidelityType minimumFidelity,
43348   unsigned long portListFlags,
43349   unsigned long reserved,
43350   DMListIndexType * devicePortCount,
43351   DMListType * theDevicePortList) ;
43352 extern OSErr
43353 DMGetDeviceComponentByAVID(
43354   AVIDType theDeviceID,
43355   Component * theDeviceComponent,
43356   ComponentDescription * theDesciption,
43357   ResType * theDeviceKind) ;
43358 extern OSErr
43359 DMNewDisplayModeList(
43360   DisplayIDType displayID,
43361   unsigned long modeListFlags,
43362   unsigned long reserved,
43363   DMListIndexType * thePanelCount,
43364   DMListType * thePanelList) ;
43365 extern OSErr
43366 DMGetIndexedDisplayModeFromList(
43367   DMListType panelList,
43368   DMListIndexType itemIndex,
43369   unsigned long reserved,
43370   DMDisplayModeListIteratorUPP listIterator,
43371   void * userData) ;
43372 extern OSErr
43373 DMGetGraphicInfoByAVID(
43374   AVIDType theID,
43375   PicHandle * theAVPcit,
43376   Handle * theAVIconSuite,
43377   AVLocationRec * theAVLocation) ;
43378 extern OSErr
43379 DMGetAVPowerState(
43380   AVIDType theID,
43381   AVPowerStatePtr getPowerState,
43382   unsigned long reserved1) ;
43383 extern OSErr
43384 DMSetAVPowerState(
43385   AVIDType theID,
43386   AVPowerStatePtr setPowerState,
43387   unsigned long powerFlags,
43388   Handle displayState) ;
43389 extern OSErr
43390 DMGetDeviceAVIDByPortAVID(
43391   AVIDType portAVID,
43392   AVIDType * deviceAVID) ;
43393 extern OSErr
43394 DMGetEnableByAVID(
43395   AVIDType theAVID,
43396   Boolean * isAVIDEnabledNow,
43397   Boolean * canChangeEnableNow) ;
43398 extern OSErr
43399 DMSetEnableByAVID(
43400   AVIDType theAVID,
43401   Boolean doEnable,
43402   Handle displayState) ;
43403 extern OSErr
43404 DMGetDisplayMode(
43405   GDHandle theDevice,
43406   VDSwitchInfoPtr switchInfo) ;
43407 extern OSErr
43408 DMConfirmConfiguration(
43409   DMModalFilterUPP filterProc,
43410   UInt32 confirmFlags,
43411   UInt32 reserved,
43412   Handle displayState) ;
43413
43414
43415
43416
43417
43418 }
43419
43420
43421
43422 extern "C" {
43423
43424
43425
43426
43427
43428 typedef UInt32 FNSMatchOptions;
43429 enum {
43430   kFNSMatchNames = 0x00000001,
43431   kFNSMatchTechnology = 0x00000002,
43432   kFNSMatchGlyphs = 0x00000004,
43433   kFNSMatchEncodings = 0x00000008,
43434   kFNSMatchQDMetrics = 0x00000010,
43435   kFNSMatchATSUMetrics = 0x00000020,
43436   kFNSMatchKerning = 0x00000040,
43437   kFNSMatchWSLayout = 0x00000080,
43438   kFNSMatchAATLayout = 0x00000100,
43439   kFNSMatchPrintEncoding = 0x00000200,
43440   kFNSMissingDataNoMatch = (unsigned long)0x80000000,
43441   kFNSMatchAll = (unsigned long)0xFFFFFFFF,
43442   kFNSMatchDefaults = 0
43443 };
43444 extern FNSMatchOptions
43445 FNSMatchDefaultsGet(void) ;
43446
43447
43448
43449
43450 typedef UInt32 FNSObjectVersion;
43451 enum {
43452   kFNSVersionDontCare = 0,
43453   kFNSCurSysInfoVersion = 1
43454 };
43455
43456
43457 typedef UInt32 FNSFeatureFlags;
43458
43459
43460
43461
43462 struct FNSSysInfo {
43463   FNSObjectVersion iSysInfoVersion;
43464   FNSFeatureFlags oFeatures;
43465   FNSObjectVersion oCurRefVersion;
43466   FNSObjectVersion oMinRefVersion;
43467   FNSObjectVersion oCurProfileVersion;
43468   FNSObjectVersion oMinProfileVersion;
43469   UInt16 oFontSyncVersion;
43470 };
43471 typedef struct FNSSysInfo FNSSysInfo;
43472 extern void
43473 FNSSysInfoGet(FNSSysInfo * ioInfo) ;
43474
43475
43476
43477
43478 typedef struct OpaqueFNSFontReference* FNSFontReference;
43479 extern OSStatus
43480 FNSReferenceGetVersion(
43481   FNSFontReference iReference,
43482   FNSObjectVersion * oVersion) ;
43483 extern OSStatus
43484 FNSReferenceDispose(FNSFontReference iReference) ;
43485 extern OSStatus
43486 FNSReferenceMatch(
43487   FNSFontReference iReference1,
43488   FNSFontReference iReference2,
43489   FNSMatchOptions iOptions,
43490   FNSMatchOptions * oFailedMatchOptions) ;
43491 extern OSStatus
43492 FNSReferenceFlattenedSize(
43493   FNSFontReference iReference,
43494   ByteCount * oFlattenedSize) ;
43495 extern OSStatus
43496 FNSReferenceFlatten(
43497   FNSFontReference iReference,
43498   void * oFlatReference,
43499   ByteCount * oFlattenedSize) ;
43500 extern OSStatus
43501 FNSReferenceUnflatten(
43502   const void * iFlatReference,
43503   ByteCount iFlattenedSize,
43504   FNSFontReference * oReference) ;
43505
43506
43507
43508
43509 enum {
43510   kFNSCreatorDefault = 0,
43511   kFNSProfileFileType = 'fnsp'
43512 };
43513
43514 typedef struct OpaqueFNSFontProfile* FNSFontProfile;
43515 extern OSStatus
43516 FNSProfileCreate(
43517   const FSSpec * iFile,
43518   FourCharCode iCreator,
43519   ItemCount iEstNumRefs,
43520   FNSObjectVersion iDesiredVersion,
43521   FNSFontProfile * oProfile) ;
43522 extern OSStatus
43523 FNSProfileOpen(
43524   const FSSpec * iFile,
43525   Boolean iOpenForWrite,
43526   FNSFontProfile * oProfile) ;
43527 extern OSStatus
43528 FNSProfileCreateWithFSRef(
43529   const FSRef * iParentDirectory,
43530   UniCharCount iNameLength,
43531   const UniChar * iName,
43532   FourCharCode iCreator,
43533   ItemCount iEstNumRefs,
43534   FNSObjectVersion iDesiredVersion,
43535   FNSFontProfile * oProfile) ;
43536 extern OSStatus
43537 FNSProfileOpenWithFSRef(
43538   const FSRef * iFile,
43539   Boolean iOpenForWrite,
43540   FNSFontProfile * oProfile) ;
43541 extern OSStatus
43542 FNSProfileGetVersion(
43543   FNSFontProfile iProfile,
43544   FNSObjectVersion * oVersion) ;
43545 extern OSStatus
43546 FNSProfileCompact(FNSFontProfile iProfile) ;
43547 extern OSStatus
43548 FNSProfileClose(FNSFontProfile iProfile) ;
43549 extern OSStatus
43550 FNSProfileAddReference(
43551   FNSFontProfile iProfile,
43552   FNSFontReference iReference) ;
43553 extern OSStatus
43554 FNSProfileRemoveReference(
43555   FNSFontProfile iProfile,
43556   FNSFontReference iReference) ;
43557 extern OSStatus
43558 FNSProfileRemoveIndReference(
43559   FNSFontProfile iProfile,
43560   UInt32 iIndex) ;
43561 extern OSStatus
43562 FNSProfileClear(FNSFontProfile iProfile) ;
43563 extern OSStatus
43564 FNSProfileCountReferences(
43565   FNSFontProfile iProfile,
43566   ItemCount * oCount) ;
43567 extern OSStatus
43568 FNSProfileGetIndReference(
43569   FNSFontProfile iProfile,
43570   UInt32 iWhichReference,
43571   FNSFontReference * oReference) ;
43572 extern OSStatus
43573 FNSProfileMatchReference(
43574   FNSFontProfile iProfile,
43575   FNSFontReference iReference,
43576   FNSMatchOptions iMatchOptions,
43577   ItemCount iOutputSize,
43578   UInt32 oIndices[],
43579   ItemCount * oNumMatches) ;
43580 extern OSStatus
43581 FNSReferenceCreate(
43582   FMFont iFont,
43583   FNSObjectVersion iDesiredVersion,
43584   FNSFontReference * oReference) ;
43585 extern OSStatus
43586 FNSReferenceMatchFonts(
43587   FNSFontReference iReference,
43588   FNSMatchOptions iMatchOptions,
43589   ItemCount iOutputSize,
43590   FMFont oFonts[],
43591   ItemCount * oNumMatches) ;
43592 extern OSStatus
43593 FNSReferenceCreateFromFamily(
43594   FMFontFamily iFamily,
43595   FMFontStyle iStyle,
43596   FNSObjectVersion iDesiredVersion,
43597   FNSFontReference * oReference,
43598   FMFontStyle * oActualStyle) ;
43599 extern OSStatus
43600 FNSReferenceMatchFamilies(
43601   FNSFontReference iReference,
43602   FNSMatchOptions iMatchOptions,
43603   ItemCount iOutputSize,
43604   FMFontFamilyInstance oFonts[],
43605   ItemCount * oNumMatches) ;
43606 extern OSStatus
43607 FNSReferenceGetFamilyInfo(
43608   FNSFontReference iReference,
43609   Str255 oFamilyName,
43610   ScriptCode * oFamilyNameScript,
43611   FMFontStyle * oActualStyle) ;
43612 extern OSStatus
43613 FNSReferenceCountNames(
43614   FNSFontReference iReference,
43615   ItemCount * oNameCount) ;
43616 extern OSStatus
43617 FNSReferenceGetIndName(
43618   FNSFontReference iReference,
43619   ItemCount iFontNameIndex,
43620   ByteCount iMaximumNameLength,
43621   Ptr oName,
43622   ByteCount * oActualNameLength,
43623   FontNameCode * oFontNameCode,
43624   FontPlatformCode * oFontNamePlatform,
43625   FontScriptCode * oFontNameScript,
43626   FontLanguageCode * oFontNameLanguage) ;
43627 extern OSStatus
43628 FNSReferenceFindName(
43629   FNSFontReference iReference,
43630   FontNameCode iFontNameCode,
43631   FontPlatformCode iFontNamePlatform,
43632   FontScriptCode iFontNameScript,
43633   FontLanguageCode iFontNameLanguage,
43634   ByteCount iMaximumNameLength,
43635   Ptr oName,
43636   ByteCount * oActualNameLength,
43637   ItemCount * oFontNameIndex) ;
43638 extern Boolean
43639 FNSEnabled(void) ;
43640
43641
43642
43643
43644
43645 }
43646
43647
43648
43649 extern "C" {
43650
43651
43652 typedef UInt32 ATSUFlattenedDataStreamFormat;
43653 enum {
43654   kATSUDataStreamUnicodeStyledText = 'ustl'
43655 };
43656
43657
43658
43659
43660
43661
43662
43663 typedef UInt32 ATSUFlattenStyleRunOptions;
43664 enum {
43665   kATSUFlattenOptionNoOptionsMask = 0x00000000
43666 };
43667
43668
43669
43670
43671
43672
43673 typedef UInt32 ATSUUnFlattenStyleRunOptions;
43674 enum {
43675   kATSUUnFlattenOptionNoOptionsMask = 0x00000000
43676 };
43677 struct ATSUStyleRunInfo {
43678   UniCharCount runLength;
43679   ItemCount styleObjectIndex;
43680 };
43681 typedef struct ATSUStyleRunInfo ATSUStyleRunInfo;
43682 enum {
43683   kATSFlatDataUstlVersion0 = 0,
43684   kATSFlatDataUstlVersion1 = 1,
43685   kATSFlatDataUstlVersion2 = 2,
43686   kATSFlatDataUstlCurrentVersion = kATSFlatDataUstlVersion2
43687 };
43688 struct ATSFlatDataMainHeaderBlock {
43689
43690
43691
43692
43693   UInt32 version;
43694
43695
43696
43697   ByteCount sizeOfDataBlock;
43698
43699
43700
43701   ByteCount offsetToTextLayouts;
43702
43703
43704
43705   ByteCount offsetToStyleRuns;
43706
43707
43708
43709   ByteCount offsetToStyleList;
43710 };
43711 typedef struct ATSFlatDataMainHeaderBlock ATSFlatDataMainHeaderBlock;
43712 struct ATSFlatDataTextLayoutDataHeader {
43713
43714
43715
43716   ByteCount sizeOfLayoutData;
43717
43718
43719   ByteCount textLayoutLength;
43720
43721
43722
43723
43724   ByteCount offsetToLayoutControls;
43725
43726
43727
43728
43729   ByteCount offsetToLineInfo;
43730
43731
43732
43733
43734
43735
43736
43737 };
43738 typedef struct ATSFlatDataTextLayoutDataHeader ATSFlatDataTextLayoutDataHeader;
43739
43740
43741
43742
43743
43744 struct ATSFlatDataLayoutControlsDataHeader {
43745
43746
43747
43748   ItemCount numberOfLayoutControls;
43749   ATSUAttributeInfo controlArray[1];
43750 };
43751 typedef struct ATSFlatDataLayoutControlsDataHeader ATSFlatDataLayoutControlsDataHeader;
43752 struct ATSFlatDataLineInfoData {
43753
43754
43755   UniCharCount lineLength;
43756
43757
43758
43759   ItemCount numberOfLineControls;
43760
43761
43762
43763
43764 };
43765 typedef struct ATSFlatDataLineInfoData ATSFlatDataLineInfoData;
43766
43767
43768
43769
43770
43771 struct ATSFlatDataLineInfoHeader {
43772
43773
43774
43775
43776
43777   ItemCount numberOfLines;
43778
43779
43780
43781
43782   ATSFlatDataLineInfoData lineInfoArray[1];
43783 };
43784 typedef struct ATSFlatDataLineInfoHeader ATSFlatDataLineInfoHeader;
43785 struct ATSFlatDataStyleRunDataHeader {
43786
43787
43788   ItemCount numberOfStyleRuns;
43789
43790
43791
43792
43793   ATSUStyleRunInfo styleRunArray[1];
43794 };
43795 typedef struct ATSFlatDataStyleRunDataHeader ATSFlatDataStyleRunDataHeader;
43796 struct ATSFlatDataStyleListStyleDataHeader {
43797
43798
43799
43800
43801   ByteCount sizeOfStyleInfo;
43802
43803
43804
43805
43806   ItemCount numberOfSetAttributes;
43807
43808
43809
43810   ItemCount numberOfSetFeatures;
43811
43812
43813
43814   ItemCount numberOfSetVariations;
43815 };
43816 typedef struct ATSFlatDataStyleListStyleDataHeader ATSFlatDataStyleListStyleDataHeader;
43817
43818
43819
43820
43821
43822 struct ATSFlatDataStyleListHeader {
43823
43824
43825   ItemCount numberOfStyles;
43826
43827
43828
43829
43830
43831
43832   ATSFlatDataStyleListStyleDataHeader styleDataArray[1];
43833
43834 };
43835 typedef struct ATSFlatDataStyleListHeader ATSFlatDataStyleListHeader;
43836
43837
43838
43839
43840
43841 struct ATSFlatDataStyleListFeatureData {
43842
43843
43844   ATSUFontFeatureType theFeatureType;
43845
43846
43847   ATSUFontFeatureSelector theFeatureSelector;
43848 };
43849 typedef struct ATSFlatDataStyleListFeatureData ATSFlatDataStyleListFeatureData;
43850
43851
43852
43853
43854
43855
43856 struct ATSFlatDataStyleListVariationData {
43857
43858
43859   ATSUFontVariationAxis theVariationAxis;
43860
43861
43862   ATSUFontVariationValue theVariationValue;
43863 };
43864 typedef struct ATSFlatDataStyleListVariationData ATSFlatDataStyleListVariationData;
43865 typedef UInt32 ATSFlatDataFontSpeciferType;
43866 enum {
43867
43868
43869   kATSFlattenedFontSpecifierRawNameData = 'namd'
43870 };
43871
43872
43873
43874
43875
43876
43877 struct ATSFlatDataFontNameDataHeader {
43878
43879
43880   ATSFlatDataFontSpeciferType nameSpecifierType;
43881
43882
43883
43884
43885
43886   ByteCount nameSpecifierSize;
43887
43888
43889
43890
43891
43892
43893
43894 };
43895 typedef struct ATSFlatDataFontNameDataHeader ATSFlatDataFontNameDataHeader;
43896
43897
43898
43899
43900
43901
43902
43903 struct ATSFlatDataFontSpecRawNameData {
43904
43905
43906   FontNameCode fontNameType;
43907
43908
43909
43910
43911
43912   FontPlatformCode fontNamePlatform;
43913
43914
43915
43916
43917
43918   FontScriptCode fontNameScript;
43919
43920
43921
43922
43923   FontLanguageCode fontNameLanguage;
43924
43925
43926
43927   ByteCount fontNameLength;
43928
43929
43930
43931
43932 };
43933 typedef struct ATSFlatDataFontSpecRawNameData ATSFlatDataFontSpecRawNameData;
43934 struct ATSFlatDataFontSpecRawNameDataHeader {
43935
43936
43937
43938   ItemCount numberOfFlattenedNames;
43939
43940
43941
43942
43943
43944   ATSFlatDataFontSpecRawNameData nameDataArray[1];
43945
43946 };
43947 typedef struct ATSFlatDataFontSpecRawNameDataHeader ATSFlatDataFontSpecRawNameDataHeader;
43948 extern OSStatus
43949 ATSUFlattenStyleRunsToStream(
43950   ATSUFlattenedDataStreamFormat iStreamFormat,
43951   ATSUFlattenStyleRunOptions iFlattenOptions,
43952   ItemCount iNumberOfRunInfo,
43953   const ATSUStyleRunInfo iRunInfoArray[],
43954   ItemCount iNumberOfStyleObjects,
43955   const ATSUStyle iStyleArray[],
43956   ByteCount iStreamBufferSize,
43957   void * oStreamBuffer,
43958   ByteCount * oActualStreamBufferSize) ;
43959 extern OSStatus
43960 ATSUUnflattenStyleRunsFromStream(
43961   ATSUFlattenedDataStreamFormat iStreamFormat,
43962   ATSUUnFlattenStyleRunOptions iUnflattenOptions,
43963   ByteCount iStreamBufferSize,
43964   const void * iStreamBuffer,
43965   ItemCount iNumberOfRunInfo,
43966   ItemCount iNumberOfStyleObjects,
43967   ATSUStyleRunInfo oRunInfoArray[],
43968   ATSUStyle oStyleArray[],
43969   ItemCount * oActualNumberOfRunInfo,
43970   ItemCount * oActualNumberOfStyleObjects) ;
43971
43972
43973
43974
43975
43976 }
43977
43978
43979
43980 extern "C" {
43981 typedef UInt32 ATSUDirectDataSelector;
43982 enum {
43983   kATSUDirectDataAdvanceDeltaFixedArray = 0L,
43984   kATSUDirectDataBaselineDeltaFixedArray = 1L,
43985   kATSUDirectDataDeviceDeltaSInt16Array = 2L,
43986   kATSUDirectDataStyleIndexUInt16Array = 3L,
43987   kATSUDirectDataStyleSettingATSUStyleSettingRefArray = 4L,
43988   kATSUDirectDataLayoutRecordATSLayoutRecordVersion1 = 100L,
43989   kATSUDirectDataLayoutRecordATSLayoutRecordCurrent = kATSUDirectDataLayoutRecordATSLayoutRecordVersion1
43990 };
43991 typedef struct ATSStyleSetting* ATSUStyleSettingRef;
43992 extern OSStatus
43993 ATSUDirectGetLayoutDataArrayPtrFromLineRef(
43994   ATSULineRef iLineRef,
43995   ATSUDirectDataSelector iDataSelector,
43996   Boolean iCreate,
43997   void * oLayoutDataArrayPtr[],
43998   ItemCount * oLayoutDataCount) ;
43999 extern OSStatus
44000 ATSUDirectGetLayoutDataArrayPtrFromTextLayout(
44001   ATSUTextLayout iTextLayout,
44002   UniCharArrayOffset iLineOffset,
44003   ATSUDirectDataSelector iDataSelector,
44004   void * oLayoutDataArrayPtr[],
44005   ItemCount * oLayoutDataCount) ;
44006 extern OSStatus
44007 ATSUDirectReleaseLayoutDataArrayPtr(
44008   ATSULineRef iLineRef,
44009   ATSUDirectDataSelector iDataSelector,
44010   void * iLayoutDataArrayPtr[]) ;
44011 extern OSStatus
44012 ATSUDirectAddStyleSettingRef(
44013   ATSULineRef iLineRef,
44014   ATSUStyleSettingRef iStyleSettingRef,
44015   UInt16 * oStyleIndex) ;
44016
44017
44018
44019
44020
44021 }
44022
44023
44024
44025
44026
44027
44028
44029 extern "C" {
44030
44031
44032
44033
44034
44035 enum {
44036   kGenericDocumentIconResource = -4000,
44037   kGenericStationeryIconResource = -3985,
44038   kGenericEditionFileIconResource = -3989,
44039   kGenericApplicationIconResource = -3996,
44040   kGenericDeskAccessoryIconResource = -3991,
44041   kGenericFolderIconResource = -3999,
44042   kPrivateFolderIconResource = -3994,
44043   kFloppyIconResource = -3998,
44044   kTrashIconResource = -3993,
44045   kGenericRAMDiskIconResource = -3988,
44046   kGenericCDROMIconResource = -3987
44047 };
44048
44049
44050
44051 enum {
44052   kDesktopIconResource = -3992,
44053   kOpenFolderIconResource = -3997,
44054   kGenericHardDiskIconResource = -3995,
44055   kGenericFileServerIconResource = -3972,
44056   kGenericSuitcaseIconResource = -3970,
44057   kGenericMoverObjectIconResource = -3969
44058 };
44059
44060
44061
44062 enum {
44063   kGenericPreferencesIconResource = -3971,
44064   kGenericQueryDocumentIconResource = -16506,
44065   kGenericExtensionIconResource = -16415,
44066   kSystemFolderIconResource = -3983,
44067   kHelpIconResource = -20271,
44068   kAppleMenuFolderIconResource = -3982
44069 };
44070
44071
44072 enum {
44073   genericDocumentIconResource = kGenericDocumentIconResource,
44074   genericStationeryIconResource = kGenericStationeryIconResource,
44075   genericEditionFileIconResource = kGenericEditionFileIconResource,
44076   genericApplicationIconResource = kGenericApplicationIconResource,
44077   genericDeskAccessoryIconResource = kGenericDeskAccessoryIconResource,
44078   genericFolderIconResource = kGenericFolderIconResource,
44079   privateFolderIconResource = kPrivateFolderIconResource,
44080   floppyIconResource = kFloppyIconResource,
44081   trashIconResource = kTrashIconResource,
44082   genericRAMDiskIconResource = kGenericRAMDiskIconResource,
44083   genericCDROMIconResource = kGenericCDROMIconResource,
44084   desktopIconResource = kDesktopIconResource,
44085   openFolderIconResource = kOpenFolderIconResource,
44086   genericHardDiskIconResource = kGenericHardDiskIconResource,
44087   genericFileServerIconResource = kGenericFileServerIconResource,
44088   genericSuitcaseIconResource = kGenericSuitcaseIconResource,
44089   genericMoverObjectIconResource = kGenericMoverObjectIconResource,
44090   genericPreferencesIconResource = kGenericPreferencesIconResource,
44091   genericQueryDocumentIconResource = kGenericQueryDocumentIconResource,
44092   genericExtensionIconResource = kGenericExtensionIconResource,
44093   systemFolderIconResource = kSystemFolderIconResource,
44094   appleMenuFolderIconResource = kAppleMenuFolderIconResource
44095 };
44096
44097
44098 enum {
44099   kStartupFolderIconResource = -3981,
44100   kOwnedFolderIconResource = -3980,
44101   kDropFolderIconResource = -3979,
44102   kSharedFolderIconResource = -3978,
44103   kMountedFolderIconResource = -3977,
44104   kControlPanelFolderIconResource = -3976,
44105   kPrintMonitorFolderIconResource = -3975,
44106   kPreferencesFolderIconResource = -3974,
44107   kExtensionsFolderIconResource = -3973,
44108   kFontsFolderIconResource = -3968,
44109   kFullTrashIconResource = -3984
44110 };
44111
44112
44113 enum {
44114   startupFolderIconResource = kStartupFolderIconResource,
44115   ownedFolderIconResource = kOwnedFolderIconResource,
44116   dropFolderIconResource = kDropFolderIconResource,
44117   sharedFolderIconResource = kSharedFolderIconResource,
44118   mountedFolderIconResource = kMountedFolderIconResource,
44119   controlPanelFolderIconResource = kControlPanelFolderIconResource,
44120   printMonitorFolderIconResource = kPrintMonitorFolderIconResource,
44121   preferencesFolderIconResource = kPreferencesFolderIconResource,
44122   extensionsFolderIconResource = kExtensionsFolderIconResource,
44123   fontsFolderIconResource = kFontsFolderIconResource,
44124   fullTrashIconResource = kFullTrashIconResource
44125 };
44126
44127
44128 enum {
44129   kAlignNone = 0x00,
44130   kAlignVerticalCenter = 0x01,
44131   kAlignTop = 0x02,
44132   kAlignBottom = 0x03,
44133   kAlignHorizontalCenter = 0x04,
44134   kAlignAbsoluteCenter = kAlignVerticalCenter | kAlignHorizontalCenter,
44135   kAlignCenterTop = kAlignTop | kAlignHorizontalCenter,
44136   kAlignCenterBottom = kAlignBottom | kAlignHorizontalCenter,
44137   kAlignLeft = 0x08,
44138   kAlignCenterLeft = kAlignVerticalCenter | kAlignLeft,
44139   kAlignTopLeft = kAlignTop | kAlignLeft,
44140   kAlignBottomLeft = kAlignBottom | kAlignLeft,
44141   kAlignRight = 0x0C,
44142   kAlignCenterRight = kAlignVerticalCenter | kAlignRight,
44143   kAlignTopRight = kAlignTop | kAlignRight,
44144   kAlignBottomRight = kAlignBottom | kAlignRight
44145 };
44146
44147
44148 enum {
44149   atNone = kAlignNone,
44150   atVerticalCenter = kAlignVerticalCenter,
44151   atTop = kAlignTop,
44152   atBottom = kAlignBottom,
44153   atHorizontalCenter = kAlignHorizontalCenter,
44154   atAbsoluteCenter = kAlignAbsoluteCenter,
44155   atCenterTop = kAlignCenterTop,
44156   atCenterBottom = kAlignCenterBottom,
44157   atLeft = kAlignLeft,
44158   atCenterLeft = kAlignCenterLeft,
44159   atTopLeft = kAlignTopLeft,
44160   atBottomLeft = kAlignBottomLeft,
44161   atRight = kAlignRight,
44162   atCenterRight = kAlignCenterRight,
44163   atTopRight = kAlignTopRight,
44164   atBottomRight = kAlignBottomRight
44165 };
44166
44167 typedef SInt16 IconAlignmentType;
44168
44169 enum {
44170   kTransformNone = 0x00,
44171   kTransformDisabled = 0x01,
44172   kTransformOffline = 0x02,
44173   kTransformOpen = 0x03,
44174   kTransformLabel1 = 0x0100,
44175   kTransformLabel2 = 0x0200,
44176   kTransformLabel3 = 0x0300,
44177   kTransformLabel4 = 0x0400,
44178   kTransformLabel5 = 0x0500,
44179   kTransformLabel6 = 0x0600,
44180   kTransformLabel7 = 0x0700,
44181   kTransformSelected = 0x4000,
44182   kTransformSelectedDisabled = kTransformSelected | kTransformDisabled,
44183   kTransformSelectedOffline = kTransformSelected | kTransformOffline,
44184   kTransformSelectedOpen = kTransformSelected | kTransformOpen
44185 };
44186
44187
44188 enum {
44189   ttNone = kTransformNone,
44190   ttDisabled = kTransformDisabled,
44191   ttOffline = kTransformOffline,
44192   ttOpen = kTransformOpen,
44193   ttLabel1 = kTransformLabel1,
44194   ttLabel2 = kTransformLabel2,
44195   ttLabel3 = kTransformLabel3,
44196   ttLabel4 = kTransformLabel4,
44197   ttLabel5 = kTransformLabel5,
44198   ttLabel6 = kTransformLabel6,
44199   ttLabel7 = kTransformLabel7,
44200   ttSelected = kTransformSelected,
44201   ttSelectedDisabled = kTransformSelectedDisabled,
44202   ttSelectedOffline = kTransformSelectedOffline,
44203   ttSelectedOpen = kTransformSelectedOpen
44204 };
44205
44206 typedef SInt16 IconTransformType;
44207
44208 enum {
44209   kSelectorLarge1Bit = 0x00000001,
44210   kSelectorLarge4Bit = 0x00000002,
44211   kSelectorLarge8Bit = 0x00000004,
44212   kSelectorLarge32Bit = 0x00000008,
44213   kSelectorLarge8BitMask = 0x00000010,
44214   kSelectorSmall1Bit = 0x00000100,
44215   kSelectorSmall4Bit = 0x00000200,
44216   kSelectorSmall8Bit = 0x00000400,
44217   kSelectorSmall32Bit = 0x00000800,
44218   kSelectorSmall8BitMask = 0x00001000,
44219   kSelectorMini1Bit = 0x00010000,
44220   kSelectorMini4Bit = 0x00020000,
44221   kSelectorMini8Bit = 0x00040000,
44222   kSelectorHuge1Bit = 0x01000000,
44223   kSelectorHuge4Bit = 0x02000000,
44224   kSelectorHuge8Bit = 0x04000000,
44225   kSelectorHuge32Bit = 0x08000000,
44226   kSelectorHuge8BitMask = 0x10000000,
44227   kSelectorAllLargeData = 0x000000FF,
44228   kSelectorAllSmallData = 0x0000FF00,
44229   kSelectorAllMiniData = 0x00FF0000,
44230   kSelectorAllHugeData = (long)0xFF000000,
44231   kSelectorAll1BitData = kSelectorLarge1Bit | kSelectorSmall1Bit | kSelectorMini1Bit | kSelectorHuge1Bit,
44232   kSelectorAll4BitData = kSelectorLarge4Bit | kSelectorSmall4Bit | kSelectorMini4Bit | kSelectorHuge4Bit,
44233   kSelectorAll8BitData = kSelectorLarge8Bit | kSelectorSmall8Bit | kSelectorMini8Bit | kSelectorHuge8Bit,
44234   kSelectorAll32BitData = kSelectorLarge32Bit | kSelectorSmall32Bit | kSelectorHuge32Bit,
44235   kSelectorAllAvailableData = (long)0xFFFFFFFF
44236 };
44237
44238
44239
44240 enum {
44241   svLarge1Bit = kSelectorLarge1Bit,
44242   svLarge4Bit = kSelectorLarge4Bit,
44243   svLarge8Bit = kSelectorLarge8Bit,
44244   svSmall1Bit = kSelectorSmall1Bit,
44245   svSmall4Bit = kSelectorSmall4Bit,
44246   svSmall8Bit = kSelectorSmall8Bit,
44247   svMini1Bit = kSelectorMini1Bit,
44248   svMini4Bit = kSelectorMini4Bit,
44249   svMini8Bit = kSelectorMini8Bit,
44250   svAllLargeData = kSelectorAllLargeData,
44251   svAllSmallData = kSelectorAllSmallData,
44252   svAllMiniData = kSelectorAllMiniData,
44253   svAll1BitData = kSelectorAll1BitData,
44254   svAll4BitData = kSelectorAll4BitData,
44255   svAll8BitData = kSelectorAll8BitData,
44256   svAllAvailableData = kSelectorAllAvailableData
44257 };
44258
44259 typedef UInt32 IconSelectorValue;
44260 typedef OSErr ( * IconActionProcPtr)(ResType theType, Handle *theIcon, void *yourDataPtr);
44261 typedef Handle ( * IconGetterProcPtr)(ResType theType, void *yourDataPtr);
44262 typedef IconActionProcPtr IconActionUPP;
44263 typedef IconGetterProcPtr IconGetterUPP;
44264 extern IconActionUPP
44265 NewIconActionUPP(IconActionProcPtr userRoutine) ;
44266 extern IconGetterUPP
44267 NewIconGetterUPP(IconGetterProcPtr userRoutine) ;
44268 extern void
44269 DisposeIconActionUPP(IconActionUPP userUPP) ;
44270 extern void
44271 DisposeIconGetterUPP(IconGetterUPP userUPP) ;
44272 extern OSErr
44273 InvokeIconActionUPP(
44274   ResType theType,
44275   Handle * theIcon,
44276   void * yourDataPtr,
44277   IconActionUPP userUPP) ;
44278 extern Handle
44279 InvokeIconGetterUPP(
44280   ResType theType,
44281   void * yourDataPtr,
44282   IconGetterUPP userUPP) ;
44283
44284 typedef IconGetterProcPtr IconGetter;
44285 typedef IconActionProcPtr IconAction;
44286
44287 struct CIcon {
44288   PixMap iconPMap;
44289   BitMap iconMask;
44290   BitMap iconBMap;
44291   Handle iconData;
44292   SInt16 iconMaskData[1];
44293 };
44294 typedef struct CIcon CIcon;
44295 typedef CIcon * CIconPtr;
44296 typedef CIconPtr * CIconHandle;
44297 extern CIconHandle
44298 GetCIcon(SInt16 iconID) ;
44299 extern void
44300 PlotCIcon(
44301   const Rect * theRect,
44302   CIconHandle theIcon) ;
44303 extern void
44304 DisposeCIcon(CIconHandle theIcon) ;
44305 extern Handle
44306 GetIcon(SInt16 iconID) ;
44307 extern void
44308 PlotIcon(
44309   const Rect * theRect,
44310   Handle theIcon) ;
44311 typedef Handle IconSuiteRef;
44312 typedef Handle IconCacheRef;
44313
44314 typedef struct OpaqueIconRef* IconRef;
44315 extern OSErr
44316 PlotIconID(
44317   const Rect * theRect,
44318   IconAlignmentType align,
44319   IconTransformType transform,
44320   SInt16 theResID) ;
44321 extern OSErr
44322 NewIconSuite(IconSuiteRef * theIconSuite) ;
44323 extern OSErr
44324 AddIconToSuite(
44325   Handle theIconData,
44326   IconSuiteRef theSuite,
44327   ResType theType) ;
44328 extern OSErr
44329 GetIconFromSuite(
44330   Handle * theIconData,
44331   IconSuiteRef theSuite,
44332   ResType theType) ;
44333 extern OSErr
44334 ForEachIconDo(
44335   IconSuiteRef theSuite,
44336   IconSelectorValue selector,
44337   IconActionUPP action,
44338   void * yourDataPtr) ;
44339 extern OSErr
44340 GetIconSuite(
44341   IconSuiteRef * theIconSuite,
44342   SInt16 theResID,
44343   IconSelectorValue selector) ;
44344 extern OSErr
44345 DisposeIconSuite(
44346   IconSuiteRef theIconSuite,
44347   Boolean disposeData) ;
44348 extern OSErr
44349 PlotIconSuite(
44350   const Rect * theRect,
44351   IconAlignmentType align,
44352   IconTransformType transform,
44353   IconSuiteRef theIconSuite) ;
44354 extern OSErr
44355 MakeIconCache(
44356   IconCacheRef * theCache,
44357   IconGetterUPP makeIcon,
44358   void * yourDataPtr) ;
44359 extern OSErr
44360 LoadIconCache(
44361   const Rect * theRect,
44362   IconAlignmentType align,
44363   IconTransformType transform,
44364   IconCacheRef theIconCache) ;
44365 extern OSErr
44366 PlotIconMethod(
44367   const Rect * theRect,
44368   IconAlignmentType align,
44369   IconTransformType transform,
44370   IconGetterUPP theMethod,
44371   void * yourDataPtr) ;
44372 extern OSErr
44373 GetLabel(
44374   SInt16 labelNumber,
44375   RGBColor * labelColor,
44376   Str255 labelString) ;
44377 extern Boolean
44378 PtInIconID(
44379   Point testPt,
44380   const Rect * iconRect,
44381   IconAlignmentType align,
44382   SInt16 iconID) ;
44383 extern Boolean
44384 PtInIconSuite(
44385   Point testPt,
44386   const Rect * iconRect,
44387   IconAlignmentType align,
44388   IconSuiteRef theIconSuite) ;
44389 extern Boolean
44390 PtInIconMethod(
44391   Point testPt,
44392   const Rect * iconRect,
44393   IconAlignmentType align,
44394   IconGetterUPP theMethod,
44395   void * yourDataPtr) ;
44396 extern Boolean
44397 RectInIconID(
44398   const Rect * testRect,
44399   const Rect * iconRect,
44400   IconAlignmentType align,
44401   SInt16 iconID) ;
44402 extern Boolean
44403 RectInIconSuite(
44404   const Rect * testRect,
44405   const Rect * iconRect,
44406   IconAlignmentType align,
44407   IconSuiteRef theIconSuite) ;
44408 extern Boolean
44409 RectInIconMethod(
44410   const Rect * testRect,
44411   const Rect * iconRect,
44412   IconAlignmentType align,
44413   IconGetterUPP theMethod,
44414   void * yourDataPtr) ;
44415 extern OSErr
44416 IconIDToRgn(
44417   RgnHandle theRgn,
44418   const Rect * iconRect,
44419   IconAlignmentType align,
44420   SInt16 iconID) ;
44421 extern OSErr
44422 IconSuiteToRgn(
44423   RgnHandle theRgn,
44424   const Rect * iconRect,
44425   IconAlignmentType align,
44426   IconSuiteRef theIconSuite) ;
44427 extern OSErr
44428 IconMethodToRgn(
44429   RgnHandle theRgn,
44430   const Rect * iconRect,
44431   IconAlignmentType align,
44432   IconGetterUPP theMethod,
44433   void * yourDataPtr) ;
44434 extern OSErr
44435 SetSuiteLabel(
44436   IconSuiteRef theSuite,
44437   SInt16 theLabel) ;
44438 extern SInt16
44439 GetSuiteLabel(IconSuiteRef theSuite) ;
44440 extern OSErr
44441 GetIconCacheData(
44442   IconCacheRef theCache,
44443   void ** theData) ;
44444 extern OSErr
44445 SetIconCacheData(
44446   IconCacheRef theCache,
44447   void * theData) ;
44448 extern OSErr
44449 GetIconCacheProc(
44450   IconCacheRef theCache,
44451   IconGetterUPP * theProc) ;
44452 extern OSErr
44453 SetIconCacheProc(
44454   IconCacheRef theCache,
44455   IconGetterUPP theProc) ;
44456 extern OSErr
44457 PlotIconHandle(
44458   const Rect * theRect,
44459   IconAlignmentType align,
44460   IconTransformType transform,
44461   Handle theIcon) ;
44462 extern OSErr
44463 PlotSICNHandle(
44464   const Rect * theRect,
44465   IconAlignmentType align,
44466   IconTransformType transform,
44467   Handle theSICN) ;
44468 extern OSErr
44469 PlotCIconHandle(
44470   const Rect * theRect,
44471   IconAlignmentType align,
44472   IconTransformType transform,
44473   CIconHandle theCIcon) ;
44474 enum {
44475   kSystemIconsCreator = 'macs'
44476 };
44477 enum {
44478   kClipboardIcon = 'CLIP',
44479   kClippingUnknownTypeIcon = 'clpu',
44480   kClippingPictureTypeIcon = 'clpp',
44481   kClippingTextTypeIcon = 'clpt',
44482   kClippingSoundTypeIcon = 'clps',
44483   kDesktopIcon = 'desk',
44484   kFinderIcon = 'FNDR',
44485   kFontSuitcaseIcon = 'FFIL',
44486   kFullTrashIcon = 'ftrh',
44487   kGenericApplicationIcon = 'APPL',
44488   kGenericCDROMIcon = 'cddr',
44489   kGenericControlPanelIcon = 'APPC',
44490   kGenericControlStripModuleIcon = 'sdev',
44491   kGenericComponentIcon = 'thng',
44492   kGenericDeskAccessoryIcon = 'APPD',
44493   kGenericDocumentIcon = 'docu',
44494   kGenericEditionFileIcon = 'edtf',
44495   kGenericExtensionIcon = 'INIT',
44496   kGenericFileServerIcon = 'srvr',
44497   kGenericFontIcon = 'ffil',
44498   kGenericFontScalerIcon = 'sclr',
44499   kGenericFloppyIcon = 'flpy',
44500   kGenericHardDiskIcon = 'hdsk',
44501   kGenericIDiskIcon = 'idsk',
44502   kGenericRemovableMediaIcon = 'rmov',
44503   kGenericMoverObjectIcon = 'movr',
44504   kGenericPCCardIcon = 'pcmc',
44505   kGenericPreferencesIcon = 'pref',
44506   kGenericQueryDocumentIcon = 'qery',
44507   kGenericRAMDiskIcon = 'ramd',
44508   kGenericSharedLibaryIcon = 'shlb',
44509   kGenericStationeryIcon = 'sdoc',
44510   kGenericSuitcaseIcon = 'suit',
44511   kGenericURLIcon = 'gurl',
44512   kGenericWORMIcon = 'worm',
44513   kInternationalResourcesIcon = 'ifil',
44514   kKeyboardLayoutIcon = 'kfil',
44515   kSoundFileIcon = 'sfil',
44516   kSystemSuitcaseIcon = 'zsys',
44517   kTrashIcon = 'trsh',
44518   kTrueTypeFontIcon = 'tfil',
44519   kTrueTypeFlatFontIcon = 'sfnt',
44520   kTrueTypeMultiFlatFontIcon = 'ttcf',
44521   kUserIDiskIcon = 'udsk',
44522   kUnknownFSObjectIcon = 'unfs',
44523   kInternationResourcesIcon = kInternationalResourcesIcon
44524 };
44525
44526
44527 enum {
44528   kInternetLocationHTTPIcon = 'ilht',
44529   kInternetLocationFTPIcon = 'ilft',
44530   kInternetLocationAppleShareIcon = 'ilaf',
44531   kInternetLocationAppleTalkZoneIcon = 'ilat',
44532   kInternetLocationFileIcon = 'ilfi',
44533   kInternetLocationMailIcon = 'ilma',
44534   kInternetLocationNewsIcon = 'ilnw',
44535   kInternetLocationNSLNeighborhoodIcon = 'ilns',
44536   kInternetLocationGenericIcon = 'ilge'
44537 };
44538
44539
44540 enum {
44541   kGenericFolderIcon = 'fldr',
44542   kDropFolderIcon = 'dbox',
44543   kMountedFolderIcon = 'mntd',
44544   kOpenFolderIcon = 'ofld',
44545   kOwnedFolderIcon = 'ownd',
44546   kPrivateFolderIcon = 'prvf',
44547   kSharedFolderIcon = 'shfl'
44548 };
44549
44550
44551 enum {
44552   kSharingPrivsNotApplicableIcon = 'shna',
44553   kSharingPrivsReadOnlyIcon = 'shro',
44554   kSharingPrivsReadWriteIcon = 'shrw',
44555   kSharingPrivsUnknownIcon = 'shuk',
44556   kSharingPrivsWritableIcon = 'writ'
44557 };
44558
44559
44560
44561 enum {
44562   kUserFolderIcon = 'ufld',
44563   kWorkgroupFolderIcon = 'wfld',
44564   kGuestUserIcon = 'gusr',
44565   kUserIcon = 'user',
44566   kOwnerIcon = 'susr',
44567   kGroupIcon = 'grup'
44568 };
44569
44570
44571 enum {
44572   kAppearanceFolderIcon = 'appr',
44573   kAppleExtrasFolderIcon = 'aexÄ',
44574   kAppleMenuFolderIcon = 'amnu',
44575   kApplicationsFolderIcon = 'apps',
44576   kApplicationSupportFolderIcon = 'asup',
44577   kAssistantsFolderIcon = 'astÄ',
44578   kColorSyncFolderIcon = 'prof',
44579   kContextualMenuItemsFolderIcon = 'cmnu',
44580   kControlPanelDisabledFolderIcon = 'ctrD',
44581   kControlPanelFolderIcon = 'ctrl',
44582   kControlStripModulesFolderIcon = 'sdvÄ',
44583   kDocumentsFolderIcon = 'docs',
44584   kExtensionsDisabledFolderIcon = 'extD',
44585   kExtensionsFolderIcon = 'extn',
44586   kFavoritesFolderIcon = 'favs',
44587   kFontsFolderIcon = 'font',
44588   kHelpFolderIcon = 'Ählp',
44589   kInternetFolderIcon = 'intÄ',
44590   kInternetPlugInFolderIcon = 'Änet',
44591   kInternetSearchSitesFolderIcon = 'issf',
44592   kLocalesFolderIcon = 'Äloc',
44593   kMacOSReadMeFolderIcon = 'morÄ',
44594   kPublicFolderIcon = 'pubf',
44595   kPreferencesFolderIcon = 'prfÄ',
44596   kPrinterDescriptionFolderIcon = 'ppdf',
44597   kPrinterDriverFolderIcon = 'Äprd',
44598   kPrintMonitorFolderIcon = 'prnt',
44599   kRecentApplicationsFolderIcon = 'rapp',
44600   kRecentDocumentsFolderIcon = 'rdoc',
44601   kRecentServersFolderIcon = 'rsrv',
44602   kScriptingAdditionsFolderIcon = 'Äscr',
44603   kSharedLibrariesFolderIcon = 'Älib',
44604   kScriptsFolderIcon = 'scrÄ',
44605   kShutdownItemsDisabledFolderIcon = 'shdD',
44606   kShutdownItemsFolderIcon = 'shdf',
44607   kSpeakableItemsFolder = 'spki',
44608   kStartupItemsDisabledFolderIcon = 'strD',
44609   kStartupItemsFolderIcon = 'strt',
44610   kSystemExtensionDisabledFolderIcon = 'macD',
44611   kSystemFolderIcon = 'macs',
44612   kTextEncodingsFolderIcon = 'Ätex',
44613   kUsersFolderIcon = 'usrÄ',
44614   kUtilitiesFolderIcon = 'utiÄ',
44615   kVoicesFolderIcon = 'fvoc'
44616 };
44617
44618
44619 enum {
44620   kAppleScriptBadgeIcon = 'scrp',
44621   kLockedBadgeIcon = 'lbdg',
44622   kMountedBadgeIcon = 'mbdg',
44623   kSharedBadgeIcon = 'sbdg',
44624   kAliasBadgeIcon = 'abdg',
44625   kAlertCautionBadgeIcon = 'cbdg'
44626 };
44627
44628
44629 enum {
44630   kAlertNoteIcon = 'note',
44631   kAlertCautionIcon = 'caut',
44632   kAlertStopIcon = 'stop'
44633 };
44634
44635
44636 enum {
44637   kAppleTalkIcon = 'atlk',
44638   kAppleTalkZoneIcon = 'atzn',
44639   kAFPServerIcon = 'afps',
44640   kFTPServerIcon = 'ftps',
44641   kHTTPServerIcon = 'htps',
44642   kGenericNetworkIcon = 'gnet',
44643   kIPFileServerIcon = 'isrv'
44644 };
44645
44646
44647 enum {
44648   kToolbarCustomizeIcon = 'tcus',
44649   kToolbarDeleteIcon = 'tdel',
44650   kToolbarFavoritesIcon = 'tfav',
44651   kToolbarHomeIcon = 'thom'
44652 };
44653
44654
44655 enum {
44656   kAppleLogoIcon = 'capl',
44657   kAppleMenuIcon = 'sapl',
44658   kBackwardArrowIcon = 'baro',
44659   kFavoriteItemsIcon = 'favr',
44660   kForwardArrowIcon = 'faro',
44661   kGridIcon = 'grid',
44662   kHelpIcon = 'help',
44663   kKeepArrangedIcon = 'arng',
44664   kLockedIcon = 'lock',
44665   kNoFilesIcon = 'nfil',
44666   kNoFolderIcon = 'nfld',
44667   kNoWriteIcon = 'nwrt',
44668   kProtectedApplicationFolderIcon = 'papp',
44669   kProtectedSystemFolderIcon = 'psys',
44670   kRecentItemsIcon = 'rcnt',
44671   kShortcutIcon = 'shrt',
44672   kSortAscendingIcon = 'asnd',
44673   kSortDescendingIcon = 'dsnd',
44674   kUnlockedIcon = 'ulck',
44675   kConnectToIcon = 'cnct',
44676   kGenericWindowIcon = 'gwin',
44677   kQuestionMarkIcon = 'ques',
44678   kDeleteAliasIcon = 'dali',
44679   kEjectMediaIcon = 'ejec',
44680   kBurningIcon = 'burn',
44681   kRightContainerArrowIcon = 'rcar'
44682 };
44683
44684
44685
44686
44687 typedef UInt32 IconServicesUsageFlags;
44688 enum {
44689   kIconServicesNormalUsageFlag = 0
44690 };
44691
44692
44693
44694
44695
44696
44697
44698 enum {
44699   kIconServicesCatalogInfoMask = (kFSCatInfoNodeID | kFSCatInfoParentDirID | kFSCatInfoVolume | kFSCatInfoNodeFlags | kFSCatInfoFinderInfo | kFSCatInfoFinderXInfo | kFSCatInfoUserAccess)
44700 };
44701 typedef UInt32 PlotIconRefFlags;
44702 enum {
44703
44704
44705
44706
44707   kPlotIconRefNormalFlags = 0L,
44708
44709
44710
44711
44712   kPlotIconRefNoImage = (1 << 1),
44713
44714
44715
44716
44717   kPlotIconRefNoMask = (1 << 2)
44718 };
44719 extern OSErr
44720 IconRefToIconFamily(
44721   IconRef theIconRef,
44722   IconSelectorValue whichIcons,
44723   IconFamilyHandle * iconFamily) ;
44724 extern OSErr
44725 IconFamilyToIconSuite(
44726   IconFamilyHandle iconFamily,
44727   IconSelectorValue whichIcons,
44728   IconSuiteRef * iconSuite) ;
44729 extern OSErr
44730 IconSuiteToIconFamily(
44731   IconSuiteRef iconSuite,
44732   IconSelectorValue whichIcons,
44733   IconFamilyHandle * iconFamily) ;
44734 extern OSErr
44735 SetIconFamilyData(
44736   IconFamilyHandle iconFamily,
44737   OSType iconType,
44738   Handle h) ;
44739 extern OSErr
44740 GetIconFamilyData(
44741   IconFamilyHandle iconFamily,
44742   OSType iconType,
44743   Handle h) ;
44744 extern OSErr
44745 GetIconRefOwners(
44746   IconRef theIconRef,
44747   UInt16 * owners) ;
44748 extern OSErr
44749 AcquireIconRef(IconRef theIconRef) ;
44750 extern OSErr
44751 ReleaseIconRef(IconRef theIconRef) ;
44752 extern OSErr
44753 GetIconRefFromFile(
44754   const FSSpec * theFile,
44755   IconRef * theIconRef,
44756   SInt16 * theLabel) ;
44757 extern OSErr
44758 GetIconRef(
44759   SInt16 vRefNum,
44760   OSType creator,
44761   OSType iconType,
44762   IconRef * theIconRef) ;
44763 extern OSErr
44764 GetIconRefFromFolder(
44765   SInt16 vRefNum,
44766   SInt32 parentFolderID,
44767   SInt32 folderID,
44768   SInt8 attributes,
44769   SInt8 accessPrivileges,
44770   IconRef * theIconRef) ;
44771 extern OSStatus
44772 GetIconRefFromFileInfo(
44773   const FSRef * inRef,
44774   UniCharCount inFileNameLength,
44775   const UniChar * inFileName,
44776   FSCatalogInfoBitmap inWhichInfo,
44777   const FSCatalogInfo * inCatalogInfo,
44778   IconServicesUsageFlags inUsageFlags,
44779   IconRef * outIconRef,
44780   SInt16 * outLabel) ;
44781 extern OSErr
44782 RegisterIconRefFromIconFamily(
44783   OSType creator,
44784   OSType iconType,
44785   IconFamilyHandle iconFamily,
44786   IconRef * theIconRef) ;
44787 extern OSErr
44788 RegisterIconRefFromResource(
44789   OSType creator,
44790   OSType iconType,
44791   const FSSpec * resourceFile,
44792   SInt16 resourceID,
44793   IconRef * theIconRef) ;
44794 extern OSStatus
44795 RegisterIconRefFromFSRef(
44796   OSType creator,
44797   OSType iconType,
44798   const FSRef * iconFile,
44799   IconRef * theIconRef) ;
44800 extern OSErr
44801 UnregisterIconRef(
44802   OSType creator,
44803   OSType iconType) ;
44804 extern OSErr
44805 UpdateIconRef(IconRef theIconRef) ;
44806 extern OSErr
44807 OverrideIconRefFromResource(
44808   IconRef theIconRef,
44809   const FSSpec * resourceFile,
44810   SInt16 resourceID) ;
44811 extern OSErr
44812 OverrideIconRef(
44813   IconRef oldIconRef,
44814   IconRef newIconRef) ;
44815 extern OSErr
44816 RemoveIconRefOverride(IconRef theIconRef) ;
44817 extern OSErr
44818 CompositeIconRef(
44819   IconRef backgroundIconRef,
44820   IconRef foregroundIconRef,
44821   IconRef * compositeIconRef) ;
44822 extern OSErr
44823 IsIconRefComposite(
44824   IconRef compositeIconRef,
44825   IconRef * backgroundIconRef,
44826   IconRef * foregroundIconRef) ;
44827 extern Boolean
44828 IsValidIconRef(IconRef theIconRef) ;
44829 extern OSErr
44830 PlotIconRef(
44831   const Rect * theRect,
44832   IconAlignmentType align,
44833   IconTransformType transform,
44834   IconServicesUsageFlags theIconServicesUsageFlags,
44835   IconRef theIconRef) ;
44836 extern OSStatus
44837 PlotIconRefInContext(
44838   CGContextRef inContext,
44839   const CGRect * inRect,
44840   IconAlignmentType inAlign,
44841   IconTransformType inTransform,
44842   const RGBColor * inLabelColor,
44843   PlotIconRefFlags inFlags,
44844   IconRef inIconRef) ;
44845 extern Boolean
44846 PtInIconRef(
44847   const Point * testPt,
44848   const Rect * iconRect,
44849   IconAlignmentType align,
44850   IconServicesUsageFlags theIconServicesUsageFlags,
44851   IconRef theIconRef) ;
44852 extern Boolean
44853 RectInIconRef(
44854   const Rect * testRect,
44855   const Rect * iconRect,
44856   IconAlignmentType align,
44857   IconServicesUsageFlags iconServicesUsageFlags,
44858   IconRef theIconRef) ;
44859 extern OSErr
44860 IconRefToRgn(
44861   RgnHandle theRgn,
44862   const Rect * iconRect,
44863   IconAlignmentType align,
44864   IconServicesUsageFlags iconServicesUsageFlags,
44865   IconRef theIconRef) ;
44866 extern OSErr
44867 GetIconSizesFromIconRef(
44868   IconSelectorValue iconSelectorInput,
44869   IconSelectorValue * iconSelectorOutputPtr,
44870   IconServicesUsageFlags iconServicesUsageFlags,
44871   IconRef theIconRef) ;
44872 extern OSErr
44873 FlushIconRefs(
44874   OSType creator,
44875   OSType iconType) ;
44876 extern OSErr
44877 FlushIconRefsByVolume(SInt16 vRefNum) ;
44878 extern OSErr
44879 SetCustomIconsEnabled(
44880   SInt16 vRefNum,
44881   Boolean enableCustomIcons) ;
44882 extern OSErr
44883 GetCustomIconsEnabled(
44884   SInt16 vRefNum,
44885   Boolean * customIconsEnabled) ;
44886 extern Boolean
44887 IsIconRefMaskEmpty(IconRef iconRef) ;
44888 extern IconRef
44889 GetIconRefVariant(
44890   IconRef inIconRef,
44891   OSType inVariant,
44892   IconTransformType * outTransform) ;
44893 extern OSErr
44894 RegisterIconRefFromIconFile(
44895   OSType creator,
44896   OSType iconType,
44897   const FSSpec * iconFile,
44898   IconRef * theIconRef) ;
44899 extern OSErr
44900 ReadIconFile(
44901   const FSSpec * iconFile,
44902   IconFamilyHandle * iconFamily) ;
44903 extern OSStatus
44904 ReadIconFromFSRef(
44905   const FSRef * ref,
44906   IconFamilyHandle * iconFamily) ;
44907 extern OSErr
44908 WriteIconFile(
44909   IconFamilyHandle iconFamily,
44910   const FSSpec * iconFile) ;
44911
44912
44913
44914
44915
44916
44917 }
44918
44919
44920
44921 extern "C" {
44922
44923
44924
44925
44926
44927
44928
44929 enum {
44930   icPrefNotFoundErr = -666,
44931   icPermErr = -667,
44932   icPrefDataErr = -668,
44933   icInternalErr = -669,
44934   icTruncatedErr = -670,
44935   icNoMoreWritersErr = -671,
44936   icNothingToOverrideErr = -672,
44937   icNoURLErr = -673,
44938   icConfigNotFoundErr = -674,
44939   icConfigInappropriateErr = -675,
44940   icProfileNotFoundErr = -676,
44941   icTooManyProfilesErr = -677
44942 };
44943
44944
44945
44946
44947
44948 enum {
44949   kICComponentInterfaceVersion0 = 0x00000000,
44950   kICComponentInterfaceVersion1 = 0x00010000,
44951   kICComponentInterfaceVersion2 = 0x00020000,
44952   kICComponentInterfaceVersion3 = 0x00030000,
44953   kICComponentInterfaceVersion4 = 0x00040000,
44954   kICComponentInterfaceVersion = kICComponentInterfaceVersion4
44955 };
44956
44957
44958
44959
44960
44961 typedef struct OpaqueICInstance* ICInstance;
44962
44963
44964
44965
44966 struct ICDirSpec {
44967   short vRefNum;
44968   long dirID;
44969 };
44970 typedef struct ICDirSpec ICDirSpec;
44971 typedef ICDirSpec ICDirSpecArray[4];
44972 typedef ICDirSpecArray * ICDirSpecArrayPtr;
44973
44974
44975
44976
44977 typedef UInt32 ICAttr;
44978
44979 enum {
44980   kICAttrLockedBit = 0,
44981   kICAttrVolatileBit = 1
44982 };
44983
44984 enum {
44985   kICAttrNoChange = (unsigned long)0xFFFFFFFF,
44986   kICAttrLockedMask = 0x00000001,
44987   kICAttrVolatileMask = 0x00000002
44988 };
44989
44990
44991
44992
44993
44994 typedef UInt8 ICPerm;
44995
44996 enum {
44997   icNoPerm = 0,
44998   icReadOnlyPerm = 1,
44999   icReadWritePerm = 2
45000 };
45001 typedef long ICProfileID;
45002 typedef ICProfileID * ICProfileIDPtr;
45003
45004 enum {
45005   kICNilProfileID = 0
45006 };
45007
45008
45009
45010
45011
45012 enum {
45013   kICNoUserInteractionBit = 0
45014 };
45015
45016 enum {
45017   kICNoUserInteractionMask = 0x00000001
45018 };
45019
45020 enum {
45021   kICFileType = 'ICAp',
45022   kICCreator = 'ICAp'
45023 };
45024
45025
45026
45027
45028
45029 enum {
45030   kInternetEventClass = 'GURL',
45031   kAEGetURL = 'GURL',
45032   kAEFetchURL = 'FURL',
45033   keyAEAttaching = 'Atch'
45034 };
45035
45036
45037
45038 enum {
45039   kICEditPreferenceEventClass = 'ICAp',
45040   kICEditPreferenceEvent = 'ICAp',
45041   keyICEditPreferenceDestination = 'dest'
45042 };
45043
45044
45045
45046
45047
45048 enum {
45049   kICComponentVersion = 0,
45050   kICNumVersion = 1
45051 };
45052
45053
45054
45055
45056 struct ICFontRecord {
45057   short size;
45058   Style face;
45059   char pad;
45060   Str255 font;
45061 };
45062 typedef struct ICFontRecord ICFontRecord;
45063 typedef ICFontRecord * ICFontRecordPtr;
45064 typedef ICFontRecordPtr * ICFontRecordHandle;
45065
45066
45067
45068
45069 struct ICCharTable {
45070   unsigned char netToMac[256];
45071   unsigned char macToNet[256];
45072 };
45073 typedef struct ICCharTable ICCharTable;
45074 typedef ICCharTable * ICCharTablePtr;
45075 typedef ICCharTablePtr * ICCharTableHandle;
45076
45077
45078
45079
45080 struct ICAppSpec {
45081   OSType fCreator;
45082   Str63 name;
45083 };
45084 typedef struct ICAppSpec ICAppSpec;
45085 typedef ICAppSpec * ICAppSpecPtr;
45086 typedef ICAppSpecPtr * ICAppSpecHandle;
45087 struct ICAppSpecList {
45088   short numberOfItems;
45089   ICAppSpec appSpecs[1];
45090 };
45091 typedef struct ICAppSpecList ICAppSpecList;
45092 typedef ICAppSpecList * ICAppSpecListPtr;
45093 typedef ICAppSpecListPtr * ICAppSpecListHandle;
45094
45095
45096
45097
45098
45099
45100 struct ICFileSpec {
45101   Str31 volName;
45102   long volCreationDate;
45103   FSSpec fss;
45104   AliasRecord alias;
45105
45106
45107 };
45108 typedef struct ICFileSpec ICFileSpec;
45109 typedef ICFileSpec * ICFileSpecPtr;
45110 typedef ICFileSpecPtr * ICFileSpecHandle;
45111 enum {
45112   kICFileSpecHeaderSize = sizeof(ICFileSpec) - sizeof(AliasRecord)
45113 };
45114
45115
45116
45117
45118 typedef long ICMapEntryFlags;
45119 typedef short ICFixedLength;
45120
45121
45122 struct ICMapEntry {
45123   short totalLength;
45124   ICFixedLength fixedLength;
45125   short version;
45126   OSType fileType;
45127   OSType fileCreator;
45128   OSType postCreator;
45129   ICMapEntryFlags flags;
45130
45131   Str255 extension;
45132   Str255 creatorAppName;
45133   Str255 postAppName;
45134   Str255 MIMEType;
45135   Str255 entryName;
45136 };
45137 typedef struct ICMapEntry ICMapEntry;
45138 typedef ICMapEntry * ICMapEntryPtr;
45139 typedef ICMapEntryPtr * ICMapEntryHandle;
45140 enum {
45141   kICMapFixedLength = 22
45142 };
45143
45144 enum {
45145   kICMapBinaryBit = 0,
45146   kICMapResourceForkBit = 1,
45147   kICMapDataForkBit = 2,
45148   kICMapPostBit = 3,
45149   kICMapNotIncomingBit = 4,
45150   kICMapNotOutgoingBit = 5
45151 };
45152
45153 enum {
45154   kICMapBinaryMask = 0x00000001,
45155   kICMapResourceForkMask = 0x00000002,
45156   kICMapDataForkMask = 0x00000004,
45157   kICMapPostMask = 0x00000008,
45158   kICMapNotIncomingMask = 0x00000010,
45159   kICMapNotOutgoingMask = 0x00000020
45160 };
45161
45162
45163
45164
45165 typedef short ICServiceEntryFlags;
45166 struct ICServiceEntry {
45167   Str255 name;
45168   short port;
45169   ICServiceEntryFlags flags;
45170 };
45171 typedef struct ICServiceEntry ICServiceEntry;
45172 typedef ICServiceEntry * ICServiceEntryPtr;
45173 typedef ICServiceEntryPtr * ICServiceEntryHandle;
45174
45175 enum {
45176   kICServicesTCPBit = 0,
45177   kICServicesUDPBit = 1
45178 };
45179
45180 enum {
45181   kICServicesTCPMask = 0x00000001,
45182   kICServicesUDPMask = 0x00000002
45183 };
45184
45185 struct ICServices {
45186   short count;
45187   ICServiceEntry services[1];
45188 };
45189 typedef struct ICServices ICServices;
45190 typedef ICServices * ICServicesPtr;
45191 typedef ICServicesPtr * ICServicesHandle;
45192 extern OSStatus
45193 ICStart(
45194   ICInstance * inst,
45195   OSType signature) ;
45196 extern OSStatus
45197 ICStop(ICInstance inst) ;
45198 extern OSStatus
45199 ICGetVersion(
45200   ICInstance inst,
45201   long whichVersion,
45202   UInt32 * version) ;
45203 extern OSStatus
45204 ICGetConfigName(
45205   ICInstance inst,
45206   Boolean longname,
45207   Str255 name) ;
45208 extern OSStatus
45209 ICGetSeed(
45210   ICInstance inst,
45211   long * seed) ;
45212 extern OSStatus
45213 ICGetPerm(
45214   ICInstance inst,
45215   ICPerm * perm) ;
45216 extern OSStatus
45217 ICBegin(
45218   ICInstance inst,
45219   ICPerm perm) ;
45220 extern OSStatus
45221 ICGetPref(
45222   ICInstance inst,
45223   ConstStr255Param key,
45224   ICAttr * attr,
45225   void * buf,
45226   long * size) ;
45227 extern OSStatus
45228 ICSetPref(
45229   ICInstance inst,
45230   ConstStr255Param key,
45231   ICAttr attr,
45232   const void * buf,
45233   long size) ;
45234 extern OSStatus
45235 ICFindPrefHandle(
45236   ICInstance inst,
45237   ConstStr255Param key,
45238   ICAttr * attr,
45239   Handle prefh) ;
45240 extern OSStatus
45241 ICGetPrefHandle(
45242   ICInstance inst,
45243   ConstStr255Param key,
45244   ICAttr * attr,
45245   Handle * prefh) ;
45246 extern OSStatus
45247 ICSetPrefHandle(
45248   ICInstance inst,
45249   ConstStr255Param key,
45250   ICAttr attr,
45251   Handle prefh) ;
45252 extern OSStatus
45253 ICCountPref(
45254   ICInstance inst,
45255   long * count) ;
45256 extern OSStatus
45257 ICGetIndPref(
45258   ICInstance inst,
45259   long index,
45260   Str255 key) ;
45261 extern OSStatus
45262 ICDeletePref(
45263   ICInstance inst,
45264   ConstStr255Param key) ;
45265 extern OSStatus
45266 ICEnd(ICInstance inst) ;
45267 extern OSStatus
45268 ICGetDefaultPref(
45269   ICInstance inst,
45270   ConstStr255Param key,
45271   Handle prefH) ;
45272 extern OSStatus
45273 ICEditPreferences(
45274   ICInstance inst,
45275   ConstStr255Param key) ;
45276 extern OSStatus
45277 ICLaunchURL(
45278   ICInstance inst,
45279   ConstStr255Param hint,
45280   const void * data,
45281   long len,
45282   long * selStart,
45283   long * selEnd) ;
45284 extern OSStatus
45285 ICParseURL(
45286   ICInstance inst,
45287   ConstStr255Param hint,
45288   const void * data,
45289   long len,
45290   long * selStart,
45291   long * selEnd,
45292   Handle url) ;
45293 extern OSStatus
45294 ICCreateGURLEvent(
45295   ICInstance inst,
45296   OSType helperCreator,
45297   Handle urlH,
45298   AppleEvent * theEvent) ;
45299 extern OSStatus
45300 ICSendGURLEvent(
45301   ICInstance inst,
45302   AppleEvent * theEvent) ;
45303 extern OSStatus
45304 ICMapFilename(
45305   ICInstance inst,
45306   ConstStr255Param filename,
45307   ICMapEntry * entry) ;
45308 extern OSStatus
45309 ICMapTypeCreator(
45310   ICInstance inst,
45311   OSType fType,
45312   OSType fCreator,
45313   ConstStr255Param filename,
45314   ICMapEntry * entry) ;
45315 extern OSStatus
45316 ICMapEntriesFilename(
45317   ICInstance inst,
45318   Handle entries,
45319   ConstStr255Param filename,
45320   ICMapEntry * entry) ;
45321 extern OSStatus
45322 ICMapEntriesTypeCreator(
45323   ICInstance inst,
45324   Handle entries,
45325   OSType fType,
45326   OSType fCreator,
45327   ConstStr255Param filename,
45328   ICMapEntry * entry) ;
45329 extern OSStatus
45330 ICCountMapEntries(
45331   ICInstance inst,
45332   Handle entries,
45333   long * count) ;
45334 extern OSStatus
45335 ICGetIndMapEntry(
45336   ICInstance inst,
45337   Handle entries,
45338   long index,
45339   long * pos,
45340   ICMapEntry * entry) ;
45341 extern OSStatus
45342 ICGetMapEntry(
45343   ICInstance inst,
45344   Handle entries,
45345   long pos,
45346   ICMapEntry * entry) ;
45347 extern OSStatus
45348 ICSetMapEntry(
45349   ICInstance inst,
45350   Handle entries,
45351   long pos,
45352   const ICMapEntry * entry) ;
45353 extern OSStatus
45354 ICDeleteMapEntry(
45355   ICInstance inst,
45356   Handle entries,
45357   long pos) ;
45358 extern OSStatus
45359 ICAddMapEntry(
45360   ICInstance inst,
45361   Handle entries,
45362   const ICMapEntry * entry) ;
45363 extern OSStatus
45364 ICGetCurrentProfile(
45365   ICInstance inst,
45366   ICProfileID * currentID) ;
45367 extern OSStatus
45368 ICSetCurrentProfile(
45369   ICInstance inst,
45370   ICProfileID newID) ;
45371 extern OSStatus
45372 ICCountProfiles(
45373   ICInstance inst,
45374   long * count) ;
45375 extern OSStatus
45376 ICGetIndProfile(
45377   ICInstance inst,
45378   long index,
45379   ICProfileID * thisID) ;
45380 extern OSStatus
45381 ICGetProfileName(
45382   ICInstance inst,
45383   ICProfileID thisID,
45384   Str255 name) ;
45385 extern OSStatus
45386 ICSetProfileName(
45387   ICInstance inst,
45388   ICProfileID thisID,
45389   ConstStr255Param name) ;
45390 extern OSStatus
45391 ICAddProfile(
45392   ICInstance inst,
45393   ICProfileID prototypeID,
45394   ICProfileID * newID) ;
45395 extern OSStatus
45396 ICDeleteProfile(
45397   ICInstance inst,
45398   ICProfileID thisID) ;
45399
45400
45401 }
45402
45403
45404
45405 extern "C" {
45406
45407
45408
45409
45410 struct ProcessSerialNumber {
45411   unsigned long highLongOfPSN;
45412   unsigned long lowLongOfPSN;
45413 };
45414 typedef struct ProcessSerialNumber ProcessSerialNumber;
45415 typedef ProcessSerialNumber * ProcessSerialNumberPtr;
45416 enum {
45417
45418   kNoProcess = 0,
45419   kSystemProcess = 1,
45420   kCurrentProcess = 2
45421 };
45422
45423
45424
45425 typedef unsigned short LaunchFlags;
45426 enum {
45427   launchContinue = 0x4000,
45428   launchNoFileFlags = 0x0800,
45429   launchUseMinimum = 0x0400,
45430   launchDontSwitch = 0x0200,
45431   launchAllow24Bit = 0x0100,
45432   launchInhibitDaemon = 0x0080
45433 };
45434
45435
45436
45437 struct AppParameters {
45438   struct {
45439     UInt16 what;
45440     UInt32 message;
45441     UInt32 when;
45442     Point where;
45443     UInt16 modifiers;
45444   } theMsgEvent;
45445   unsigned long eventRefCon;
45446   unsigned long messageLength;
45447 };
45448 typedef struct AppParameters AppParameters;
45449 typedef AppParameters * AppParametersPtr;
45450
45451 struct LaunchParamBlockRec {
45452   unsigned long reserved1;
45453   unsigned short reserved2;
45454   unsigned short launchBlockID;
45455   unsigned long launchEPBLength;
45456   unsigned short launchFileFlags;
45457   LaunchFlags launchControlFlags;
45458   FSSpecPtr launchAppSpec;
45459   ProcessSerialNumber launchProcessSN;
45460   unsigned long launchPreferredSize;
45461   unsigned long launchMinimumSize;
45462   unsigned long launchAvailableSize;
45463   AppParametersPtr launchAppParameters;
45464 };
45465 typedef struct LaunchParamBlockRec LaunchParamBlockRec;
45466 typedef LaunchParamBlockRec * LaunchPBPtr;
45467
45468
45469 enum {
45470   extendedBlock = 0x4C43,
45471   extendedBlockLen = sizeof(LaunchParamBlockRec) - 12
45472 };
45473
45474 enum {
45475
45476   modeReserved = 0x01000000,
45477   modeControlPanel = 0x00080000,
45478   modeLaunchDontSwitch = 0x00040000,
45479   modeDeskAccessory = 0x00020000,
45480   modeMultiLaunch = 0x00010000,
45481   modeNeedSuspendResume = 0x00004000,
45482   modeCanBackground = 0x00001000,
45483   modeDoesActivateOnFGSwitch = 0x00000800,
45484   modeOnlyBackground = 0x00000400,
45485   modeGetFrontClicks = 0x00000200,
45486   modeGetAppDiedMsg = 0x00000100,
45487   mode32BitCompatible = 0x00000080,
45488   modeHighLevelEventAware = 0x00000040,
45489   modeLocalAndRemoteHLEvents = 0x00000020,
45490   modeStationeryAware = 0x00000010,
45491   modeUseTextEditServices = 0x00000008,
45492   modeDisplayManagerAware = 0x00000004
45493 };
45494 struct ProcessInfoRec {
45495   unsigned long processInfoLength;
45496   StringPtr processName;
45497   ProcessSerialNumber processNumber;
45498   unsigned long processType;
45499   OSType processSignature;
45500   unsigned long processMode;
45501   Ptr processLocation;
45502   unsigned long processSize;
45503   unsigned long processFreeMem;
45504   ProcessSerialNumber processLauncher;
45505   unsigned long processLaunchDate;
45506   unsigned long processActiveTime;
45507   FSSpecPtr processAppSpec;
45508 };
45509 typedef struct ProcessInfoRec ProcessInfoRec;
45510 typedef ProcessInfoRec * ProcessInfoRecPtr;
45511 struct ProcessInfoExtendedRec {
45512   unsigned long processInfoLength;
45513   StringPtr processName;
45514   ProcessSerialNumber processNumber;
45515   unsigned long processType;
45516   OSType processSignature;
45517   unsigned long processMode;
45518   Ptr processLocation;
45519   unsigned long processSize;
45520   unsigned long processFreeMem;
45521   ProcessSerialNumber processLauncher;
45522   unsigned long processLaunchDate;
45523   unsigned long processActiveTime;
45524   FSSpecPtr processAppSpec;
45525   unsigned long processTempMemTotal;
45526   unsigned long processPurgeableTempMemTotal;
45527 };
45528 typedef struct ProcessInfoExtendedRec ProcessInfoExtendedRec;
45529 typedef ProcessInfoExtendedRec * ProcessInfoExtendedRecPtr;
45530
45531 struct SizeResourceRec {
45532   unsigned short flags;
45533   unsigned long preferredHeapSize;
45534   unsigned long minimumHeapSize;
45535 };
45536 typedef struct SizeResourceRec SizeResourceRec;
45537 typedef SizeResourceRec * SizeResourceRecPtr;
45538 typedef SizeResourceRecPtr * SizeResourceRecHandle;
45539
45540
45541
45542
45543
45544 enum {
45545
45546
45547
45548
45549
45550   kProcessDictionaryIncludeAllInformationMask = (long)0xFFFFFFFF
45551 };
45552 enum {
45553   kQuitBeforeNormalTimeMask = 1,
45554   kQuitAtNormalTimeMask = 2,
45555   kQuitBeforeFBAsQuitMask = 4,
45556   kQuitBeforeShellQuitsMask = 8,
45557   kQuitBeforeTerminatorAppQuitsMask = 16,
45558   kQuitNeverMask = 32,
45559   kQuitOptionsMask = 0x7F,
45560   kQuitNotQuitDuringInstallMask = 0x0100,
45561   kQuitNotQuitDuringLogoutMask = 0x0200
45562 };
45563 extern OSErr
45564 LaunchApplication(LaunchPBPtr LaunchParams) ;
45565 extern OSErr
45566 GetCurrentProcess(ProcessSerialNumber * PSN) ;
45567 extern OSErr
45568 GetFrontProcess(ProcessSerialNumber * PSN) ;
45569 extern OSErr
45570 GetNextProcess(ProcessSerialNumber * PSN) ;
45571 extern OSErr
45572 GetProcessInformation(
45573   const ProcessSerialNumber * PSN,
45574   ProcessInfoRec * info) ;
45575 extern CFDictionaryRef
45576 ProcessInformationCopyDictionary(
45577   const ProcessSerialNumber * PSN,
45578   UInt32 infoToReturn) ;
45579 extern OSErr
45580 SetFrontProcess(const ProcessSerialNumber * PSN) ;
45581
45582
45583
45584
45585
45586
45587
45588 enum {
45589
45590
45591
45592
45593
45594
45595   kSetFrontProcessFrontWindowOnly = (1 << 0)
45596 };
45597 extern OSStatus
45598 SetFrontProcessWithOptions(
45599   const ProcessSerialNumber * inProcess,
45600   OptionBits inOptions) ;
45601 extern OSErr
45602 WakeUpProcess(const ProcessSerialNumber * PSN) ;
45603 extern OSErr
45604 SameProcess(
45605   const ProcessSerialNumber * PSN1,
45606   const ProcessSerialNumber * PSN2,
45607   Boolean * result) ;
45608 extern void
45609 ExitToShell(void) ;
45610 extern OSStatus
45611 GetProcessBundleLocation(
45612   const ProcessSerialNumber * psn,
45613   FSRef * location) ;
45614 extern OSStatus
45615 CopyProcessName(
45616   const ProcessSerialNumber * psn,
45617   CFStringRef * name) ;
45618 extern OSStatus
45619 GetProcessPID(
45620   const ProcessSerialNumber * psn,
45621   pid_t * pid) ;
45622 extern OSStatus
45623 GetProcessForPID(
45624   pid_t pid,
45625   ProcessSerialNumber * psn) ;
45626 extern Boolean
45627 IsProcessVisible(const ProcessSerialNumber * psn) ;
45628 extern OSErr
45629 ShowHideProcess(
45630   const ProcessSerialNumber * psn,
45631   Boolean visible) ;
45632
45633
45634
45635
45636 enum {
45637   initDev = 0,
45638   hitDev = 1,
45639   closeDev = 2,
45640   nulDev = 3,
45641   updateDev = 4,
45642   activDev = 5,
45643   deactivDev = 6,
45644   keyEvtDev = 7,
45645   macDev = 8,
45646   undoDev = 9,
45647   cutDev = 10,
45648   copyDev = 11,
45649   pasteDev = 12,
45650   clearDev = 13,
45651   cursorDev = 14
45652 };
45653
45654
45655 enum {
45656   cdevGenErr = -1,
45657   cdevMemErr = 0,
45658   cdevResErr = 1,
45659   cdevUnset = 3
45660 };
45661
45662
45663
45664
45665
45666
45667
45668 }
45669
45670
45671
45672 extern "C" {
45673
45674
45675
45676
45677 extern double acos (double);
45678 extern double asin (double);
45679 extern double atan (double);
45680 extern double atan2 (double, double);
45681 extern double ceil (double);
45682 extern double cos (double);
45683 extern double cosh (double);
45684 extern double exp (double);
45685 extern double fabs (double);
45686 extern double floor (double);
45687 extern double fmod (double, double);
45688 extern double frexp (double, int *);
45689 extern double ldexp (double, int);
45690 extern double log10 (double);
45691 extern double log (double);
45692 extern double modf (double, double *);
45693 extern double pow (double, double);
45694 extern double sin (double);
45695 extern double sinh (double);
45696 extern double sqrt (double);
45697 extern double tan (double);
45698 extern double tanh (double);
45699
45700
45701
45702 enum {
45703     kAXErrorSuccess = 0,
45704     kAXErrorFailure = -25200,
45705     kAXErrorIllegalArgument = -25201,
45706     kAXErrorInvalidUIElement = -25202,
45707     kAXErrorInvalidUIElementObserver = -25203,
45708     kAXErrorCannotComplete = -25204,
45709     kAXErrorAttributeUnsupported = -25205,
45710     kAXErrorActionUnsupported = -25206,
45711     kAXErrorNotificationUnsupported = -25207,
45712     kAXErrorNotImplemented = -25208,
45713     kAXErrorNotificationAlreadyRegistered = -25209,
45714     kAXErrorNotificationNotRegistered = -25210,
45715     kAXErrorAPIDisabled = -25211,
45716     kAXErrorNoValue = -25212
45717 };
45718 typedef SInt32 AXError;
45719
45720
45721
45722 }
45723
45724
45725 extern double acos (double);
45726 extern double asin (double);
45727 extern double atan (double);
45728 extern double atan2 (double, double);
45729 extern double ceil (double);
45730 extern double cos (double);
45731 extern double cosh (double);
45732 extern double exp (double);
45733 extern double fabs (double);
45734 extern double floor (double);
45735 extern double fmod (double, double);
45736 extern double frexp (double, int *);
45737 extern double ldexp (double, int);
45738 extern double log10 (double);
45739 extern double log (double);
45740 extern double modf (double, double *);
45741 extern double pow (double, double);
45742 extern double sin (double);
45743 extern double sinh (double);
45744 extern double sqrt (double);
45745 extern double tan (double);
45746 extern double tanh (double);
45747
45748
45749 extern "C" {
45750
45751
45752
45753
45754 extern double acos (double);
45755 extern double asin (double);
45756 extern double atan (double);
45757 extern double atan2 (double, double);
45758 extern double ceil (double);
45759 extern double cos (double);
45760 extern double cosh (double);
45761 extern double exp (double);
45762 extern double fabs (double);
45763 extern double floor (double);
45764 extern double fmod (double, double);
45765 extern double frexp (double, int *);
45766 extern double ldexp (double, int);
45767 extern double log10 (double);
45768 extern double log (double);
45769 extern double modf (double, double *);
45770 extern double pow (double, double);
45771 extern double sin (double);
45772 extern double sinh (double);
45773 extern double sqrt (double);
45774 extern double tan (double);
45775 extern double tanh (double);
45776
45777
45778
45779 extern Boolean AXAPIEnabled ();
45780
45781 typedef struct __AXUIElement *AXUIElementRef;
45782
45783 extern CFTypeID AXUIElementGetTypeID (void);
45784
45785 extern AXError AXUIElementCopyAttributeNames (AXUIElementRef element, CFArrayRef *names);
45786 extern AXError AXUIElementCopyAttributeValue (AXUIElementRef element, CFStringRef attribute, CFTypeRef *value);
45787 extern AXError AXUIElementGetAttributeValueCount (AXUIElementRef element, CFStringRef attribute, CFIndex *count);
45788 extern AXError AXUIElementCopyAttributeValues (AXUIElementRef element, CFStringRef attribute, CFIndex index, CFIndex maxValues, CFArrayRef *values);
45789 extern AXError AXUIElementIsAttributeSettable (AXUIElementRef element, CFStringRef attribute, Boolean *settable);
45790 extern AXError AXUIElementSetAttributeValue (AXUIElementRef element, CFStringRef attribute, CFTypeRef value);
45791
45792 extern AXError AXUIElementCopyActionNames (AXUIElementRef element, CFArrayRef *names);
45793 extern AXError AXUIElementCopyActionDescription (AXUIElementRef element, CFStringRef action, CFStringRef *description);
45794 extern AXError AXUIElementPerformAction (AXUIElementRef element, CFStringRef action);
45795
45796 extern AXError AXUIElementCopyElementAtPosition (AXUIElementRef application, float x,float y, AXUIElementRef *element);
45797
45798 extern AXUIElementRef AXUIElementCreateApplication (pid_t pid);
45799 extern AXUIElementRef AXUIElementCreateSystemWide (void);
45800
45801 extern AXError AXUIElementGetPid (AXUIElementRef element, pid_t *pid);
45802
45803
45804
45805 extern AXError AXUIElementPostKeyboardEvent (AXUIElementRef application, CGCharCode keyChar, CGKeyCode virtualKey, Boolean keyDown);
45806
45807
45808
45809 typedef struct __AXObserver *AXObserverRef;
45810
45811 typedef void (*AXObserverCallback)(AXObserverRef observer, AXUIElementRef element, CFStringRef notification, void *refcon);
45812
45813 CFTypeID AXObserverGetTypeID (void);
45814
45815 extern AXError AXObserverCreate (pid_t application, AXObserverCallback callback, AXObserverRef *outObserver);
45816
45817 extern AXError AXObserverAddNotification (AXObserverRef observer, AXUIElementRef element, CFStringRef notification, void *refcon);
45818 extern AXError AXObserverRemoveNotification (AXObserverRef observer, AXUIElementRef element, CFStringRef notification);
45819
45820 extern CFRunLoopSourceRef AXObserverGetRunLoopSource (AXObserverRef observer);
45821
45822
45823 }
45824 extern "C" {
45825
45826
45827
45828
45829 extern double acos (double);
45830 extern double asin (double);
45831 extern double atan (double);
45832 extern double atan2 (double, double);
45833 extern double ceil (double);
45834 extern double cos (double);
45835 extern double cosh (double);
45836 extern double exp (double);
45837 extern double fabs (double);
45838 extern double floor (double);
45839 extern double fmod (double, double);
45840 extern double frexp (double, int *);
45841 extern double ldexp (double, int);
45842 extern double log10 (double);
45843 extern double log (double);
45844 extern double modf (double, double *);
45845 extern double pow (double, double);
45846 extern double sin (double);
45847 extern double sinh (double);
45848 extern double sqrt (double);
45849 extern double tan (double);
45850 extern double tanh (double);
45851
45852
45853
45854 typedef enum {
45855
45856     kAXValueCGPointType = 1,
45857     kAXValueCGSizeType = 2,
45858     kAXValueCGRectType = 3,
45859
45860
45861     kAXValueCFRangeType = 4,
45862
45863
45864     kAXValueIllegalType = 0
45865
45866 } AXValueType;
45867
45868
45869 extern CFTypeRef AXValueCreate (AXValueType theType, const void *valuePtr);
45870 extern AXValueType AXValueGetType(CFTypeRef value);
45871
45872 extern Boolean AXValueGetValue(CFTypeRef value, AXValueType theType, void *valuePtr);
45873
45874
45875
45876 }
45877 extern "C" {
45878
45879
45880 enum {
45881
45882   kFBCenglishHighWord = (long)0x80000000,
45883   kFBCdutchHighWord = 0x40000000,
45884   kFBCgermanHighWord = 0x20000000,
45885   kFBCswedishHighWord = 0x10000000,
45886   kFBCdanishHighWord = 0x08000000,
45887   kFBCspanishHighWord = 0x04000000,
45888   kFBCportugueseHighWord = 0x02000000,
45889   kFBCitalianHighWord = 0x01000000,
45890   kFBCfrenchHighWord = 0x00800000,
45891   kFBCromanHighWord = 0x00400000,
45892
45893   kFBCicelandicHighWord = 0x00200000,
45894   kFBChebrewHighWord = 0x00100000,
45895   kFBCarabicHighWord = 0x00080000,
45896   kFBCcenteuroHighWord = 0x00040000,
45897   kFBCcroatianHighWord = 0x00020000,
45898   kFBCturkishHighWord = 0x00010000,
45899   kFBCromanianHighWord = 0x00008000,
45900   kFBCgreekHighWord = 0x00004000,
45901   kFBCcyrillicHighWord = 0x00002000,
45902   kFBCdevanagariHighWord = 0x00001000,
45903   kFBCgujuratiHighWord = 0x00000800,
45904   kFBCgurmukhiHighWord = 0x00000400,
45905   kFBCjapaneseHighWord = 0x00000200,
45906   kFBCkoreanHighWord = 0x00000100,
45907   kFBCdefaultLanguagesHighWord = (long)0xFF800000
45908 };
45909
45910
45911 enum {
45912   kFBCnotAllFoldersSearchable = -30533
45913 };
45914 enum {
45915
45916   kFBCphIndexing = 0,
45917   kFBCphFlushing = 1,
45918   kFBCphMerging = 2,
45919   kFBCphMakingIndexAccessor = 3,
45920   kFBCphCompacting = 4,
45921   kFBCphIndexWaiting = 5,
45922   kFBCphSearching = 6,
45923   kFBCphMakingAccessAccessor = 7,
45924   kFBCphAccessWaiting = 8,
45925   kFBCphSummarizing = 9,
45926   kFBCphIdle = 10,
45927   kFBCphCanceling = 11
45928 };
45929
45930 enum {
45931   kFBCsummarizationFailed = -30533
45932 };
45933 typedef struct OpaqueFBCSearchSession* FBCSearchSession;
45934
45935 typedef struct OpaqueFBCSummaryRef* FBCSummaryRef;
45936
45937 typedef char * FBCWordItem;
45938
45939 typedef FBCWordItem * FBCWordList;
45940 typedef Boolean ( * FBCCallbackProcPtr)(UInt16 phase, float percentDone, void *data);
45941 typedef FBCCallbackProcPtr FBCCallbackUPP;
45942 extern FBCCallbackUPP
45943 NewFBCCallbackUPP(FBCCallbackProcPtr userRoutine) ;
45944 extern void
45945 DisposeFBCCallbackUPP(FBCCallbackUPP userUPP) ;
45946 extern Boolean
45947 InvokeFBCCallbackUPP(
45948   UInt16 phase,
45949   float percentDone,
45950   void * data,
45951   FBCCallbackUPP userUPP) ;
45952 extern void
45953 FBCSetSessionCallback(
45954   FBCSearchSession searchSession,
45955   FBCCallbackUPP fn,
45956   void * data) ;
45957 extern void
45958 FBCSetCallback(
45959   FBCCallbackUPP fn,
45960   void * data) ;
45961 typedef Boolean ( * FBCHitTestProcPtr)(const FSRef *theFile, void *data);
45962 typedef FBCHitTestProcPtr FBCHitTestUPP;
45963 extern FBCHitTestUPP
45964 NewFBCHitTestUPP(FBCHitTestProcPtr userRoutine) ;
45965 extern void
45966 DisposeFBCHitTestUPP(FBCHitTestUPP userUPP) ;
45967 extern Boolean
45968 InvokeFBCHitTestUPP(
45969   const FSRef * theFile,
45970   void * data,
45971   FBCHitTestUPP userUPP) ;
45972 extern void
45973 FBCSetSessionHitTest(
45974   FBCSearchSession theSession,
45975   FBCHitTestUPP fn,
45976   void * data) ;
45977 extern void
45978 FBCSetHeapReservation(UInt32 bytes) ;
45979 extern Boolean
45980 FBCVolumeIsIndexed(SInt16 theVRefNum) ;
45981 extern Boolean
45982 FBCVolumeIsRemote(SInt16 theVRefNum) ;
45983 extern OSErr
45984 FBCVolumeIndexTimeStamp(
45985   SInt16 theVRefNum,
45986   UInt32 * timeStamp) ;
45987 extern OSErr
45988 FBCVolumeIndexPhysicalSize(
45989   SInt16 theVRefNum,
45990   UInt32 * size) ;
45991 extern OSErr
45992 FBCCreateSearchSession(FBCSearchSession * searchSession) ;
45993 extern OSErr
45994 FBCCloneSearchSession(
45995   FBCSearchSession original,
45996   FBCSearchSession * clone) ;
45997 extern OSErr
45998 FBCAddAllVolumesToSession(
45999   FBCSearchSession theSession,
46000   Boolean includeRemote) ;
46001 extern OSErr
46002 FBCSetSessionVolumes(
46003   FBCSearchSession theSession,
46004   const SInt16 vRefNums[],
46005   UInt16 numVolumes) ;
46006 extern OSErr
46007 FBCAddVolumeToSession(
46008   FBCSearchSession theSession,
46009   SInt16 vRefNum) ;
46010 extern OSErr
46011 FBCRemoveVolumeFromSession(
46012   FBCSearchSession theSession,
46013   SInt16 vRefNum) ;
46014 extern OSErr
46015 FBCGetSessionVolumeCount(
46016   FBCSearchSession theSession,
46017   UInt16 * count) ;
46018 extern OSErr
46019 FBCGetSessionVolumes(
46020   FBCSearchSession theSession,
46021   SInt16 vRefNums[],
46022   UInt16 * numVolumes) ;
46023 extern OSErr
46024 FBCDoQuerySearch(
46025   FBCSearchSession theSession,
46026   char * queryText,
46027   const FSSpec targetDirs[],
46028   UInt32 numTargets,
46029   UInt32 maxHits,
46030   UInt32 maxHitWords) ;
46031 extern OSErr
46032 FBCDoCFStringSearch(
46033   FBCSearchSession theSession,
46034   CFStringRef queryString,
46035   const FSSpec targetDirs[],
46036   UInt32 numTargets,
46037   UInt32 maxHits,
46038   UInt32 maxHitWords) ;
46039 extern OSErr
46040 FBCDoExampleSearch(
46041   FBCSearchSession theSession,
46042   const UInt32 * exampleHitNums,
46043   UInt32 numExamples,
46044   const FSSpec targetDirs[],
46045   UInt32 numTargets,
46046   UInt32 maxHits,
46047   UInt32 maxHitWords) ;
46048 extern OSErr
46049 FBCBlindExampleSearch(
46050   const FSSpec examples[],
46051   UInt32 numExamples,
46052   const FSSpec targetDirs[],
46053   UInt32 numTargets,
46054   UInt32 maxHits,
46055   UInt32 maxHitWords,
46056   Boolean allIndexes,
46057   Boolean includeRemote,
46058   FBCSearchSession * theSession) ;
46059 extern OSErr
46060 FBCBlindExampleSearchWithCallback(
46061   const FSSpec examples[],
46062   UInt32 numExamples,
46063   const FSSpec targetDirs[],
46064   UInt32 numTargets,
46065   UInt32 maxHits,
46066   UInt32 maxHitWords,
46067   Boolean allIndexes,
46068   Boolean includeRemote,
46069   FBCSearchSession * theSession,
46070   FBCCallbackUPP callback,
46071   void * callbackData,
46072   FBCHitTestUPP userHitTest,
46073   void * userHitTestData) ;
46074 extern OSErr
46075 FBCGetHitCount(
46076   FBCSearchSession theSession,
46077   UInt32 * count) ;
46078 extern OSErr
46079 FBCGetHitDocument(
46080   FBCSearchSession theSession,
46081   UInt32 hitNumber,
46082   FSSpec * theDocument) ;
46083 extern OSErr
46084 FBCGetHitDocumentRef(
46085   FBCSearchSession theSession,
46086   UInt32 hitNumber,
46087   FSRef * theDocument) ;
46088 extern OSErr
46089 FBCGetHitScore(
46090   FBCSearchSession theSession,
46091   UInt32 hitNumber,
46092   float * score) ;
46093 extern OSErr
46094 FBCSummarize(
46095   const void * inBuf,
46096   UInt32 inLength,
46097   void * outBuf,
46098   UInt32 * outLength,
46099   UInt32 * numSentences) ;
46100 extern OSStatus
46101 FBCSummarizeCFString(
46102   CFStringRef inString,
46103   CFStringRef * outString,
46104   UInt32 * numSentences) ;
46105 extern OSStatus
46106 FBCGetSummaryOfCFString(
46107   CFStringRef inString,
46108   FBCSummaryRef * summary) ;
46109 extern OSStatus
46110 FBCGetSummarySentenceCount(
46111   FBCSummaryRef summary,
46112   UInt32 * numSentences) ;
46113 extern OSStatus
46114 FBCGetSummarySentences(
46115   FBCSummaryRef summary,
46116   CFStringRef * outString,
46117   UInt32 * numSentences,
46118   Boolean paragraphs) ;
46119 extern OSStatus
46120 FBCDisposeSummary(FBCSummaryRef summary) ;
46121 extern OSErr
46122 FBCReleaseSessionHits(FBCSearchSession theSession) ;
46123 extern OSErr
46124 FBCDestroySearchSession(FBCSearchSession theSession) ;
46125 extern OSErr
46126 FBCIndexItems(
46127   FSSpecArrayPtr theItems,
46128   UInt32 itemCount) ;
46129 extern OSErr
46130 FBCIndexItemsInLanguages(
46131   FSSpecArrayPtr theItems,
46132   UInt32 itemCount,
46133   UInt32 languageHighBits,
46134   UInt32 languageLowBits) ;
46135 extern OSErr
46136 FBCFindIndexFileFolderForFolder(
46137   const FSRef * inFolder,
46138   FSRef * outFolder) ;
46139 extern OSErr
46140 FBCDeleteIndexFileForFolder(const FSRef * folder) ;
46141 extern OSErr
46142 FBCGetMatchedWords(
46143   FBCSearchSession theSession,
46144   UInt32 hitNumber,
46145   UInt32 * wordCount,
46146   FBCWordList * list) ;
46147 extern OSErr
46148 FBCGetTopicWords(
46149   FBCSearchSession theSession,
46150   UInt32 hitNumber,
46151   UInt32 * wordCount,
46152   FBCWordList * list) ;
46153 extern OSErr
46154 FBCDestroyWordList(
46155   FBCWordList theList,
46156   UInt32 wordCount) ;
46157
46158
46159
46160 enum {
46161
46162   englishHighWord = kFBCenglishHighWord,
46163   dutchHighWord = kFBCdutchHighWord,
46164   germanHighWord = kFBCgermanHighWord,
46165   swedishHighWord = kFBCswedishHighWord,
46166   danishHighWord = kFBCdanishHighWord,
46167   spanishHighWord = kFBCspanishHighWord,
46168   portugueseHighWord = kFBCportugueseHighWord,
46169   italianHighWord = kFBCitalianHighWord,
46170   frenchHighWord = kFBCfrenchHighWord,
46171   romanHighWord = kFBCromanHighWord,
46172
46173   icelandicHighWord = kFBCicelandicHighWord,
46174   hebrewHighWord = kFBChebrewHighWord,
46175   arabicHighWord = kFBCarabicHighWord,
46176   centeuroHighWord = kFBCcenteuroHighWord,
46177   croatianHighWord = kFBCcroatianHighWord,
46178   turkishHighWord = kFBCturkishHighWord,
46179   romanianHighWord = kFBCromanianHighWord,
46180   greekHighWord = kFBCgreekHighWord,
46181   cyrillicHighWord = kFBCcyrillicHighWord,
46182   devanagariHighWord = kFBCdevanagariHighWord,
46183   gujuratiHighWord = kFBCgujuratiHighWord,
46184   gurmukhiHighWord = kFBCgurmukhiHighWord,
46185   japaneseHighWord = kFBCjapaneseHighWord,
46186   koreanHighWord = kFBCkoreanHighWord,
46187   kDefaultLanguagesHighWord = kFBCdefaultLanguagesHighWord
46188 };
46189
46190
46191
46192
46193 }
46194
46195
46196
46197
46198
46199 typedef const void * PMObject;
46200 typedef struct OpaquePMDialog* PMDialog;
46201 typedef struct OpaquePMPrintSettings* PMPrintSettings;
46202 typedef struct OpaquePMPageFormat* PMPageFormat;
46203 typedef struct OpaquePMPrintContext* PMPrintContext;
46204 typedef struct OpaquePMPrintSession* PMPrintSession;
46205 typedef struct OpaquePMPrinter* PMPrinter;
46206 typedef struct OpaquePMServer* PMServer;
46207 enum {
46208   kPMCancel = 0x0080
46209 };
46210 typedef UInt16 PMDestinationType;
46211 enum {
46212   kPMDestinationInvalid = 0,
46213   kPMDestinationPrinter = 1,
46214   kPMDestinationFile = 2,
46215   kPMDestinationFax = 3,
46216   kPMDestinationPreview = 4
46217 };
46218
46219
46220 typedef UInt32 PMTag;
46221 enum {
46222
46223   kPMCurrentValue = 'curr',
46224   kPMDefaultValue = 'dflt',
46225   kPMMinimumValue = 'minv',
46226   kPMMaximumValue = 'maxv',
46227
46228   kPMSourceProfile = 'srcp',
46229
46230   kPMMinRange = 'mnrg',
46231   kPMMaxRange = 'mxrg',
46232   kPMMinSquareResolution = 'mins',
46233   kPMMaxSquareResolution = 'maxs',
46234   kPMDefaultResolution = 'dftr'
46235 };
46236
46237
46238 typedef UInt16 PMOrientation;
46239 enum {
46240   kPMPortrait = 1,
46241   kPMLandscape = 2,
46242   kPMReversePortrait = 3,
46243   kPMReverseLandscape = 4
46244 };
46245
46246
46247 typedef UInt16 PMPrinterState;
46248 enum {
46249   kPMPrinterIdle = 3,
46250   kPMPrinterProcessing = 4,
46251   kPMPrinterStopped = 5
46252 };
46253
46254 enum {
46255   kSizeOfTPrint = 120
46256 };
46257
46258 typedef UInt16 PMColorMode;
46259 enum {
46260   kPMBlackAndWhite = 1,
46261   kPMGray = 2,
46262   kPMColor = 3,
46263   kPMColorModeDuotone = 4,
46264   kPMColorModeSpecialColor = 5
46265 };
46266
46267
46268
46269 typedef UInt32 PMColorSyncIntent;
46270 enum {
46271   kPMColorIntentUndefined = 0x0000,
46272   kPMColorIntentAutomatic = 0x0001,
46273   kPMColorIntentPhoto = 0x0002,
46274   kPMColorIntentBusiness = 0x0004,
46275   kPMColorIntentRelColor = 0x0008,
46276   kPMColorIntentAbsColor = 0x0010,
46277   kPMColorIntentUnused = 0xFFE0
46278 };
46279
46280
46281 typedef UInt32 PMQualityMode;
46282 enum {
46283   kPMQualityLowest = 0x0000,
46284   kPMQualityInkSaver = 0x0001,
46285   kPMQualityDraft = 0x0004,
46286   kPMQualityNormal = 0x0008,
46287   kPMQualityPhoto = 0x000B,
46288   kPMQualityBest = 0x000D,
46289   kPMQualityHighest = 0x000F
46290 };
46291
46292
46293
46294 typedef UInt32 PMPaperType;
46295 enum {
46296   kPMPaperTypeUnknown = 0x0000,
46297   kPMPaperTypePlain = 0x0001,
46298   kPMPaperTypeCoated = 0x0002,
46299   kPMPaperTypePremium = 0x0003,
46300   kPMPaperTypeGlossy = 0x0004,
46301   kPMPaperTypeTransparency = 0x0005,
46302   kPMPaperTypeTShirt = 0x0006
46303 };
46304
46305
46306 typedef UInt16 PMScalingAlignment;
46307 enum {
46308   kPMScalingPinTopLeft = 1,
46309   kPMScalingPinTopRight = 2,
46310   kPMScalingPinBottomLeft = 3,
46311   kPMScalingPinBottomRight = 4,
46312   kPMScalingCenterOnPaper = 5,
46313   kPMScalingCenterOnImgArea = 6
46314 };
46315
46316
46317 typedef UInt16 PMDuplexBinding;
46318 enum {
46319   kPMDuplexBindingLeftRight = 1,
46320   kPMDuplexBindingTopDown = 2
46321 };
46322
46323
46324 typedef UInt16 PMLayoutDirection;
46325 enum {
46326
46327   kPMLayoutLeftRightTopBottom = 1,
46328   kPMLayoutLeftRightBottomTop = 2,
46329   kPMLayoutRightLeftTopBottom = 3,
46330   kPMLayoutRightLeftBottomTop = 4,
46331   kPMLayoutTopBottomLeftRight = 5,
46332   kPMLayoutTopBottomRightLeft = 6,
46333   kPMLayoutBottomTopLeftRight = 7,
46334   kPMLayoutBottomTopRightLeft = 8
46335 };
46336
46337
46338 typedef UInt16 PMBorderType;
46339 enum {
46340   kPMBorderSingleHairline = 1,
46341   kPMBorderDoubleHairline = 2,
46342   kPMBorderSingleThickline = 3,
46343   kPMBorderDoubleThickline = 4
46344 };
46345
46346
46347 enum {
46348   kPSPageInjectAllPages = -1,
46349   kPSInjectionMaxDictSize = 5
46350 };
46351
46352
46353 typedef UInt16 PSInjectionPlacement;
46354 enum {
46355   kPSInjectionBeforeSubsection = 1,
46356   kPSInjectionAfterSubsection = 2,
46357   kPSInjectionReplaceSubsection = 3
46358 };
46359
46360
46361 typedef SInt32 PSInjectionSection;
46362 enum {
46363
46364   kInjectionSectJob = 1,
46365   kInjectionSectCoverPage = 2
46366 };
46367
46368
46369 typedef SInt32 PSInjectionSubsection;
46370 enum {
46371   kInjectionSubPSAdobe = 1,
46372   kInjectionSubPSAdobeEPS = 2,
46373   kInjectionSubBoundingBox = 3,
46374   kInjectionSubEndComments = 4,
46375   kInjectionSubOrientation = 5,
46376   kInjectionSubPages = 6,
46377   kInjectionSubPageOrder = 7,
46378   kInjectionSubBeginProlog = 8,
46379   kInjectionSubEndProlog = 9,
46380   kInjectionSubBeginSetup = 10,
46381   kInjectionSubEndSetup = 11,
46382   kInjectionSubBeginDefaults = 12,
46383   kInjectionSubEndDefaults = 13,
46384   kInjectionSubDocFonts = 14,
46385   kInjectionSubDocNeededFonts = 15,
46386   kInjectionSubDocSuppliedFonts = 16,
46387   kInjectionSubDocNeededRes = 17,
46388   kInjectionSubDocSuppliedRes = 18,
46389   kInjectionSubDocCustomColors = 19,
46390   kInjectionSubDocProcessColors = 20,
46391   kInjectionSubPlateColor = 21,
46392   kInjectionSubPageTrailer = 22,
46393   kInjectionSubTrailer = 23,
46394   kInjectionSubEOF = 24,
46395   kInjectionSubBeginFont = 25,
46396   kInjectionSubEndFont = 26,
46397   kInjectionSubBeginResource = 27,
46398   kInjectionSubEndResource = 28,
46399   kInjectionSubPage = 29,
46400   kInjectionSubBeginPageSetup = 30,
46401   kInjectionSubEndPageSetup = 31
46402 };
46403 enum {
46404   kPMNoError = noErr,
46405   kPMGeneralError = -30870,
46406   kPMOutOfScope = -30871,
46407   kPMInvalidParameter = paramErr,
46408   kPMNoDefaultPrinter = -30872,
46409   kPMNotImplemented = -30873,
46410   kPMNoSuchEntry = -30874,
46411   kPMInvalidPrintSettings = -30875,
46412   kPMInvalidPageFormat = -30876,
46413   kPMValueOutOfRange = -30877,
46414   kPMLockIgnored = -30878
46415 };
46416
46417 enum {
46418   kPMInvalidPrintSession = -30879,
46419   kPMInvalidPrinter = -30880,
46420   kPMObjectInUse = -30881
46421 };
46422
46423
46424 enum {
46425   kPMPrintAllPages = -1
46426 };
46427
46428 enum {
46429   kPMUnlocked = false,
46430   kPMLocked = true
46431 };
46432
46433 struct PMRect {
46434   double top;
46435   double left;
46436   double bottom;
46437   double right;
46438 };
46439 typedef struct PMRect PMRect;
46440 struct PMResolution {
46441   double hRes;
46442   double vRes;
46443 };
46444 typedef struct PMResolution PMResolution;
46445 struct PMLanguageInfo {
46446   Str32 level;
46447   Str32 version;
46448   Str32 release;
46449 };
46450 typedef struct PMLanguageInfo PMLanguageInfo;
46451
46452 extern "C" {
46453
46454
46455
46456
46457
46458
46459
46460 typedef void ( * PMIdleProcPtr)(void);
46461 typedef PMIdleProcPtr PMIdleUPP;
46462 extern PMIdleUPP
46463 NewPMIdleUPP(PMIdleProcPtr userRoutine) ;
46464 extern void
46465 DisposePMIdleUPP(PMIdleUPP userUPP) ;
46466 extern void
46467 InvokePMIdleUPP(PMIdleUPP userUPP) ;
46468 extern OSStatus
46469 PMRetain(PMObject object) ;
46470 extern OSStatus
46471 PMRelease(PMObject object) ;
46472 extern OSStatus
46473 PMCreateSession(PMPrintSession * printSession) ;
46474 extern OSStatus
46475 PMCreatePageFormat(PMPageFormat * pageFormat) ;
46476 extern OSStatus
46477 PMSessionDefaultPageFormat(
46478   PMPrintSession printSession,
46479   PMPageFormat pageFormat) ;
46480 extern OSStatus
46481 PMSessionValidatePageFormat(
46482   PMPrintSession printSession,
46483   PMPageFormat pageFormat,
46484   Boolean * result) ;
46485 extern OSStatus
46486 PMCreatePrintSettings(PMPrintSettings * printSettings) ;
46487 extern OSStatus
46488 PMSessionDefaultPrintSettings(
46489   PMPrintSession printSession,
46490   PMPrintSettings printSettings) ;
46491 extern OSStatus
46492 PMSessionValidatePrintSettings(
46493   PMPrintSession printSession,
46494   PMPrintSettings printSettings,
46495   Boolean * result) ;
46496 extern OSStatus
46497 PMSessionGeneral(
46498   PMPrintSession printSession,
46499   Ptr pData) ;
46500 extern OSStatus
46501 PMSessionConvertOldPrintRecord(
46502   PMPrintSession printSession,
46503   Handle printRecordHandle,
46504   PMPrintSettings * printSettings,
46505   PMPageFormat * pageFormat) ;
46506 extern OSStatus
46507 PMSessionMakeOldPrintRecord(
46508   PMPrintSession printSession,
46509   PMPrintSettings printSettings,
46510   PMPageFormat pageFormat,
46511   Handle * printRecordHandle) ;
46512 extern OSStatus
46513 PMPrinterGetDescriptionURL(
46514   PMPrinter printer,
46515   CFStringRef descriptionType,
46516   CFURLRef * fileURL) ;
46517 extern OSStatus
46518 PMSessionGetCurrentPrinter(
46519   PMPrintSession printSession,
46520   PMPrinter * currentPrinter) ;
46521 extern OSStatus
46522 PMPrinterGetLanguageInfo(
46523   PMPrinter printer,
46524   PMLanguageInfo * info) ;
46525 extern OSStatus
46526 PMPrinterGetDriverCreator(
46527   PMPrinter printer,
46528   OSType * creator) ;
46529 extern OSStatus
46530 PMPrinterGetDriverReleaseInfo(
46531   PMPrinter printer,
46532   VersRec * release) ;
46533 extern OSStatus
46534 PMPrinterGetPrinterResolutionCount(
46535   PMPrinter printer,
46536   UInt32 * count) ;
46537 extern OSStatus
46538 PMPrinterGetPrinterResolution(
46539   PMPrinter printer,
46540   PMTag tag,
46541   PMResolution * res) ;
46542 extern OSStatus
46543 PMPrinterGetIndexedPrinterResolution(
46544   PMPrinter printer,
46545   UInt32 index,
46546   PMResolution * res) ;
46547 extern Boolean
46548 PMPrinterIsPostScriptCapable(PMPrinter printer) ;
46549 extern OSStatus
46550 PMPrinterGetMakeAndModelName(
46551   PMPrinter printer,
46552   CFStringRef * makeAndModel) ;
46553 extern OSStatus
46554 PMSessionEnableColorSync(PMPrintSession printSession) ;
46555 extern OSStatus
46556 PMSessionDisableColorSync(PMPrintSession printSession) ;
46557 extern OSStatus
46558 PMSessionPostScriptBegin(PMPrintSession printSession) ;
46559 extern OSStatus
46560 PMSessionPostScriptEnd(PMPrintSession printSession) ;
46561 extern OSStatus
46562 PMSessionPostScriptHandle(
46563   PMPrintSession printSession,
46564   Handle psHandle) ;
46565 extern OSStatus
46566 PMSessionPostScriptData(
46567   PMPrintSession printSession,
46568   Ptr psPtr,
46569   Size len) ;
46570 extern OSStatus
46571 PMSessionPostScriptFile(
46572   PMPrintSession printSession,
46573   FSSpec * psFile) ;
46574 extern OSStatus
46575 PMSessionSetPSInjectionData(
46576   PMPrintSession printSession,
46577   PMPrintSettings printSettings,
46578   CFArrayRef injectionDictArray) ;
46579 extern OSStatus
46580 PMSessionError(PMPrintSession printSession) ;
46581 extern OSStatus
46582 PMSessionSetError(
46583   PMPrintSession printSession,
46584   OSStatus printError) ;
46585 extern OSStatus
46586 PMSessionGetDocumentFormatGeneration(
46587   PMPrintSession printSession,
46588   CFArrayRef * docFormats) ;
46589 extern OSStatus
46590 PMSessionSetDocumentFormatGeneration(
46591   PMPrintSession printSession,
46592   CFStringRef docFormat,
46593   CFArrayRef graphicsContextTypes,
46594   CFTypeRef options) ;
46595 extern OSStatus
46596 PMSessionGetDocumentFormatSupported(
46597   PMPrintSession printSession,
46598   CFArrayRef * docFormats,
46599   UInt32 limit) ;
46600 extern OSStatus
46601 PMSessionIsDocumentFormatSupported(
46602   PMPrintSession printSession,
46603   CFStringRef docFormat,
46604   Boolean * supported) ;
46605 extern OSStatus
46606 PMSessionGetGraphicsContext(
46607   PMPrintSession printSession,
46608   CFStringRef graphicsContextType,
46609   void ** graphicsContext) ;
46610 extern OSStatus
46611 PMSessionSetIdleProc(
46612   PMPrintSession printSession,
46613   PMIdleUPP idleProc) ;
46614 extern OSStatus
46615 PMSessionSetDataInSession(
46616   PMPrintSession printSession,
46617   CFStringRef key,
46618   CFTypeRef data) ;
46619 extern OSStatus
46620 PMSessionGetDataFromSession(
46621   PMPrintSession printSession,
46622   CFStringRef key,
46623   CFTypeRef * data) ;
46624 extern OSStatus
46625 PMSessionCreatePrinterList(
46626   PMPrintSession printSession,
46627   CFArrayRef * printerList,
46628   CFIndex * currentIndex,
46629   PMPrinter * currentPrinter) ;
46630 extern OSStatus
46631 PMSessionSetCurrentPrinter(
46632   PMPrintSession session,
46633   CFStringRef printerName) ;
46634 extern OSStatus
46635 PMSessionSetDestination(
46636   PMPrintSession printSession,
46637   PMPrintSettings printSettings,
46638   PMDestinationType destType,
46639   CFStringRef destFormat,
46640   CFURLRef destLocation) ;
46641 extern OSStatus
46642 PMSessionGetDestinationType(
46643   PMPrintSession printSession,
46644   PMPrintSettings printSettings,
46645   PMDestinationType * destTypeP) ;
46646 extern OSStatus
46647 PMSessionCopyDestinationFormat(
46648   PMPrintSession printSession,
46649   PMPrintSettings printSettings,
46650   CFStringRef * destFormatP) ;
46651 extern OSStatus
46652 PMSessionCopyDestinationLocation(
46653   PMPrintSession printSession,
46654   PMPrintSettings printSettings,
46655   CFURLRef * destLocationP) ;
46656 extern OSStatus
46657 PMSessionCopyOutputFormatList(
46658   PMPrintSession printSession,
46659   PMDestinationType destType,
46660   CFArrayRef * documentFormatP) ;
46661 extern OSStatus
46662 PMSessionCreatePageFormatList(
46663   PMPrintSession printSession,
46664   PMPrinter printer,
46665   CFArrayRef * pageFormatList) ;
46666 extern OSStatus
46667 PMSessionBeginDocumentNoDialog(
46668   PMPrintSession printSession,
46669   PMPrintSettings printSettings,
46670   PMPageFormat pageFormat) ;
46671 extern OSStatus
46672 PMSessionEndDocumentNoDialog(PMPrintSession printSession) ;
46673 extern OSStatus
46674 PMSessionBeginPageNoDialog(
46675   PMPrintSession printSession,
46676   PMPageFormat pageFormat,
46677   const PMRect * pageFrame) ;
46678 extern OSStatus
46679 PMSessionEndPageNoDialog(PMPrintSession printSession) ;
46680 extern OSStatus
46681 PMCopyPageFormat(
46682   PMPageFormat formatSrc,
46683   PMPageFormat formatDest) ;
46684 extern OSStatus
46685 PMFlattenPageFormat(
46686   PMPageFormat pageFormat,
46687   Handle * flatFormat) ;
46688 extern OSStatus
46689 PMUnflattenPageFormat(
46690   Handle flatFormat,
46691   PMPageFormat * pageFormat) ;
46692 extern OSStatus
46693 PMGetPageFormatExtendedData(
46694   PMPageFormat pageFormat,
46695   OSType dataID,
46696   UInt32 * size,
46697   void * extendedData) ;
46698 extern OSStatus
46699 PMSetPageFormatExtendedData(
46700   PMPageFormat pageFormat,
46701   OSType dataID,
46702   UInt32 size,
46703   void * extendedData) ;
46704 extern OSStatus
46705 PMGetScale(
46706   PMPageFormat pageFormat,
46707   double * scale) ;
46708 extern OSStatus
46709 PMSetScale(
46710   PMPageFormat pageFormat,
46711   double scale) ;
46712 extern OSStatus
46713 PMGetResolution(
46714   PMPageFormat pageFormat,
46715   PMResolution * res) ;
46716 extern OSStatus
46717 PMSetResolution(
46718   PMPageFormat pageFormat,
46719   const PMResolution * res) ;
46720 extern OSStatus
46721 PMGetPhysicalPaperSize(
46722   PMPageFormat pageFormat,
46723   PMRect * paperSize) ;
46724 extern OSStatus
46725 PMSetPhysicalPaperSize(
46726   PMPageFormat pageFormat,
46727   const PMRect * paperSize) ;
46728 extern OSStatus
46729 PMGetPhysicalPageSize(
46730   PMPageFormat pageFormat,
46731   PMRect * pageSize) ;
46732 extern OSStatus
46733 PMGetAdjustedPaperRect(
46734   PMPageFormat pageFormat,
46735   PMRect * paperRect) ;
46736 extern OSStatus
46737 PMGetAdjustedPageRect(
46738   PMPageFormat pageFormat,
46739   PMRect * pageRect) ;
46740 extern OSStatus
46741 PMGetUnadjustedPaperRect(
46742   PMPageFormat pageFormat,
46743   PMRect * paperRect) ;
46744 extern OSStatus
46745 PMSetUnadjustedPaperRect(
46746   PMPageFormat pageFormat,
46747   const PMRect * paperRect) ;
46748 extern OSStatus
46749 PMGetUnadjustedPageRect(
46750   PMPageFormat pageFormat,
46751   PMRect * pageRect) ;
46752 extern OSStatus
46753 PMSetAdjustedPageRect(
46754   PMPageFormat pageFormat,
46755   const PMRect * pageRect) ;
46756 extern OSStatus
46757 PMGetOrientation(
46758   PMPageFormat pageFormat,
46759   PMOrientation * orientation) ;
46760 extern OSStatus
46761 PMSetOrientation(
46762   PMPageFormat pageFormat,
46763   PMOrientation orientation,
46764   Boolean lock) ;
46765 extern OSStatus
46766 PMCopyPrintSettings(
46767   PMPrintSettings settingSrc,
46768   PMPrintSettings settingDest) ;
46769 extern OSStatus
46770 PMFlattenPrintSettings(
46771   PMPrintSettings printSettings,
46772   Handle * flatSettings) ;
46773 extern OSStatus
46774 PMUnflattenPrintSettings(
46775   Handle flatSettings,
46776   PMPrintSettings * printSettings) ;
46777 extern OSStatus
46778 PMGetPrintSettingsExtendedData(
46779   PMPrintSettings printSettings,
46780   OSType dataID,
46781   UInt32 * size,
46782   void * extendedData) ;
46783 extern OSStatus
46784 PMSetPrintSettingsExtendedData(
46785   PMPrintSettings printSettings,
46786   OSType dataID,
46787   UInt32 size,
46788   void * extendedData) ;
46789 extern OSStatus
46790 PMGetDestination(
46791   PMPrintSettings printSettings,
46792   PMDestinationType * destType,
46793   CFURLRef * fileURL) ;
46794 extern OSStatus
46795 PMGetJobName(
46796   PMPrintSettings printSettings,
46797   StringPtr name) ;
46798 extern OSStatus
46799 PMSetJobName(
46800   PMPrintSettings printSettings,
46801   StringPtr name) ;
46802 extern OSStatus
46803 PMGetCopies(
46804   PMPrintSettings printSettings,
46805   UInt32 * copies) ;
46806 extern OSStatus
46807 PMSetCopies(
46808   PMPrintSettings printSettings,
46809   UInt32 copies,
46810   Boolean lock) ;
46811 extern OSStatus
46812 PMGetFirstPage(
46813   PMPrintSettings printSettings,
46814   UInt32 * first) ;
46815 extern OSStatus
46816 PMSetFirstPage(
46817   PMPrintSettings printSettings,
46818   UInt32 first,
46819   Boolean lock) ;
46820 extern OSStatus
46821 PMGetLastPage(
46822   PMPrintSettings printSettings,
46823   UInt32 * last) ;
46824 extern OSStatus
46825 PMSetLastPage(
46826   PMPrintSettings printSettings,
46827   UInt32 last,
46828   Boolean lock) ;
46829 extern OSStatus
46830 PMGetPageRange(
46831   PMPrintSettings printSettings,
46832   UInt32 * minPage,
46833   UInt32 * maxPage) ;
46834 extern OSStatus
46835 PMSetPageRange(
46836   PMPrintSettings printSettings,
46837   UInt32 minPage,
46838   UInt32 maxPage) ;
46839 extern OSStatus
46840 PMSetProfile(
46841   PMPrintSettings printSettings,
46842   PMTag tag,
46843   const CMProfileLocation * profile) ;
46844 extern OSStatus
46845 PMGetColorMode(
46846   PMPrintSettings printSettings,
46847   PMColorMode * colorMode) ;
46848 extern OSStatus
46849 PMSetColorMode(
46850   PMPrintSettings printSettings,
46851   PMColorMode colorMode) ;
46852 extern OSStatus
46853 PMGetJobNameCFString(
46854   PMPrintSettings printSettings,
46855   CFStringRef * name) ;
46856 extern OSStatus
46857 PMSetJobNameCFString(
46858   PMPrintSettings printSettings,
46859   CFStringRef name) ;
46860 extern OSStatus
46861 PMSetCollate(
46862   PMPrintSettings printSettings,
46863   Boolean collate) ;
46864 extern OSStatus
46865 PMGetCollate(
46866   PMPrintSettings printSettings,
46867   Boolean * collate) ;
46868 extern OSStatus
46869 PMServerCreatePrinterList(
46870   PMServer server,
46871   CFArrayRef * printerList) ;
46872 extern CFStringRef
46873 PMPrinterGetName(PMPrinter printer) ;
46874 extern CFStringRef
46875 PMPrinterGetID(PMPrinter printer) ;
46876 extern Boolean
46877 PMPrinterIsDefault(PMPrinter printer) ;
46878 extern CFStringRef
46879 PMPrinterGetLocation(PMPrinter printer) ;
46880 extern OSStatus
46881 PMPrinterGetState(
46882   PMPrinter printer,
46883   PMPrinterState * state) ;
46884 extern OSStatus
46885 PMPrinterGetDeviceURI(
46886   PMPrinter printer,
46887   CFURLRef * deviceURI) ;
46888 extern Boolean
46889 PMPrinterIsFavorite(PMPrinter printer) ;
46890 extern CGImageRef
46891 PMCGImageCreateWithEPSDataProvider(
46892   CGDataProviderRef epsDataProvider,
46893   CGImageRef epsPreview) ;
46894
46895
46896
46897
46898 }
46899
46900
46901
46902 extern "C" {
46903
46904
46905 enum {
46906   kDictionaryFileType = 'dict',
46907   kDCMDictionaryHeaderSignature = 'dict',
46908   kDCMDictionaryHeaderVersion = 2
46909 };
46910
46911 enum {
46912   kDCMAnyFieldTag = typeWildCard,
46913   kDCMAnyFieldType = typeWildCard
46914 };
46915
46916
46917
46918
46919 enum {
46920   keyDCMFieldTag = 'ftag',
46921   keyDCMFieldType = 'ftyp',
46922   keyDCMMaxRecordSize = 'mrsz',
46923   keyDCMFieldAttributes = 'fatr',
46924   keyDCMFieldDefaultData = 'fdef',
46925   keyDCMFieldName = 'fnam',
46926   keyDCMFieldFindMethods = 'ffnd'
46927 };
46928
46929
46930
46931
46932 enum {
46933   typeDCMFieldAttributes = 'fatr',
46934   typeDCMFindMethod = 'fmth'
46935 };
46936
46937
46938
46939
46940
46941 enum {
46942   kDCMIndexedFieldMask = 0x00000001,
46943   kDCMRequiredFieldMask = 0x00000002,
46944   kDCMIdentifyFieldMask = 0x00000004,
46945   kDCMFixedSizeFieldMask = 0x00000008,
46946   kDCMHiddenFieldMask = (long)0x80000000
46947 };
46948
46949 typedef OptionBits DCMFieldAttributes;
46950
46951
46952
46953 enum {
46954   pDCMAccessMethod = 'amtd',
46955   pDCMPermission = 'perm',
46956   pDCMListing = 'list',
46957   pDCMMaintenance = 'mtnc',
46958   pDCMLocale = 'locl',
46959   pDCMClass = pClass,
46960   pDCMCopyright = 'info'
46961 };
46962
46963
46964
46965
46966 enum {
46967   kDCMReadOnlyDictionary = 0,
46968   kDCMReadWriteDictionary = 1
46969 };
46970
46971
46972
46973
46974 enum {
46975   kDCMAllowListing = 0,
46976   kDCMProhibitListing = 1
46977 };
46978
46979
46980
46981
46982 enum {
46983   kDCMUserDictionaryClass = 0,
46984   kDCMSpecificDictionaryClass = 1,
46985   kDCMBasicDictionaryClass = 2
46986 };
46987
46988
46989
46990
46991 enum {
46992   kDCMFindMethodExactMatch = kAEEquals,
46993   kDCMFindMethodBeginningMatch = kAEBeginsWith,
46994   kDCMFindMethodContainsMatch = kAEContains,
46995   kDCMFindMethodEndingMatch = kAEEndsWith,
46996   kDCMFindMethodForwardTrie = 'ftri',
46997   kDCMFindMethodBackwardTrie = 'btri'
46998 };
46999
47000 typedef OSType DCMFindMethod;
47001
47002
47003
47004 enum {
47005   kDCMCanUseFileDictionaryMask = 0x00000001,
47006   kDCMCanUseMemoryDictionaryMask = 0x00000002,
47007   kDCMCanStreamDictionaryMask = 0x00000004,
47008   kDCMCanHaveMultipleIndexMask = 0x00000008,
47009   kDCMCanModifyDictionaryMask = 0x00000010,
47010   kDCMCanCreateDictionaryMask = 0x00000020,
47011   kDCMCanAddDictionaryFieldMask = 0x00000040,
47012   kDCMCanUseTransactionMask = 0x00000080
47013 };
47014
47015 typedef OptionBits DCMAccessMethodFeature;
47016 typedef UInt32 DCMUniqueID;
47017 typedef struct OpaqueDCMObjectID* DCMObjectID;
47018 typedef DCMObjectID DCMAccessMethodID;
47019 typedef DCMObjectID DCMDictionaryID;
47020
47021 typedef struct OpaqueDCMObjectRef* DCMObjectRef;
47022 typedef DCMObjectRef DCMDictionaryRef;
47023 typedef DCMObjectRef DCMDictionaryStreamRef;
47024
47025 typedef struct OpaqueDCMObjectIterator* DCMObjectIterator;
47026 typedef DCMObjectIterator DCMAccessMethodIterator;
47027 typedef DCMObjectIterator DCMDictionaryIterator;
47028 typedef struct OpaqueDCMFoundRecordIterator* DCMFoundRecordIterator;
47029
47030
47031
47032 typedef DescType DCMFieldTag;
47033 typedef DescType DCMFieldType;
47034
47035
47036
47037 struct DCMDictionaryHeader {
47038   FourCharCode headerSignature;
47039   UInt32 headerVersion;
47040   ByteCount headerSize;
47041   Str63 accessMethod;
47042 };
47043 typedef struct DCMDictionaryHeader DCMDictionaryHeader;
47044
47045
47046
47047 typedef Boolean ( * DCMProgressFilterProcPtr)(Boolean determinateProcess, UInt16 percentageComplete, UInt32 callbackUD);
47048 typedef DCMProgressFilterProcPtr DCMProgressFilterUPP;
47049 extern UInt32
47050 DCMLibraryVersion(void) ;
47051 extern OSStatus
47052 DCMNewDictionary(
47053   DCMAccessMethodID accessMethodID,
47054   const FSSpec * newDictionaryFile,
47055   ScriptCode scriptTag,
47056   const AEDesc * listOfFieldInfoRecords,
47057   Boolean invisible,
47058   ItemCount recordCapacity,
47059   DCMDictionaryID * newDictionary) ;
47060 extern OSStatus
47061 DCMDeriveNewDictionary(
47062   DCMDictionaryID srcDictionary,
47063   const FSSpec * newDictionaryFile,
47064   ScriptCode scriptTag,
47065   Boolean invisible,
47066   ItemCount recordCapacity,
47067   DCMDictionaryID * newDictionary) ;
47068 extern OSStatus
47069 DCMDeleteDictionary(DCMDictionaryID dictionaryID) ;
47070 extern OSStatus
47071 DCMRegisterDictionaryFile(
47072   const FSSpec * dictionaryFile,
47073   DCMDictionaryID * dictionaryID) ;
47074 extern OSStatus
47075 DCMUnregisterDictionary(DCMDictionaryID dictionaryID) ;
47076 extern OSStatus
47077 DCMOpenDictionary(
47078   DCMDictionaryID dictionaryID,
47079   ByteCount protectKeySize,
47080   ConstLogicalAddress protectKey,
47081   DCMDictionaryRef * dictionaryRef) ;
47082 extern OSStatus
47083 DCMCloseDictionary(DCMDictionaryRef dictionaryRef) ;
47084 extern OSStatus
47085 DCMGetDictionaryWriteAccess(
47086   DCMDictionaryRef dictionaryRef,
47087   Duration timeOutDuration) ;
47088 extern OSStatus
47089 DCMReleaseDictionaryWriteAccess(
47090   DCMDictionaryRef dictionaryRef,
47091   Boolean commitTransaction) ;
47092 extern OSStatus
47093 DCMFindRecords(
47094   DCMDictionaryRef dictionaryRef,
47095   DCMFieldTag keyFieldTag,
47096   ByteCount keySize,
47097   ConstLogicalAddress keyData,
47098   DCMFindMethod findMethod,
47099   ItemCount preFetchedDataNum,
47100   DCMFieldTag preFetchedData[],
47101   ItemCount skipCount,
47102   ItemCount maxRecordCount,
47103   DCMFoundRecordIterator * recordIterator) ;
47104 extern ItemCount
47105 DCMCountRecordIterator(DCMFoundRecordIterator recordIterator) ;
47106 extern OSStatus
47107 DCMIterateFoundRecord(
47108   DCMFoundRecordIterator recordIterator,
47109   ByteCount maxKeySize,
47110   ByteCount * actualKeySize,
47111   LogicalAddress keyData,
47112   DCMUniqueID * uniqueID,
47113   AEDesc * dataList) ;
47114 extern OSStatus
47115 DCMDisposeRecordIterator(DCMFoundRecordIterator recordIterator) ;
47116 extern OSStatus
47117 DCMCountRecord(
47118   DCMDictionaryID dictionaryID,
47119   ItemCount * count) ;
47120 extern OSStatus
47121 DCMGetRecordSequenceNumber(
47122   DCMDictionaryRef dictionaryRef,
47123   DCMFieldTag keyFieldTag,
47124   ByteCount keySize,
47125   ConstLogicalAddress keyData,
47126   DCMUniqueID uniqueID,
47127   ItemCount * sequenceNum) ;
47128 extern OSStatus
47129 DCMGetNthRecord(
47130   DCMDictionaryRef dictionaryRef,
47131   DCMFieldTag keyFieldTag,
47132   ItemCount serialNum,
47133   ByteCount maxKeySize,
47134   ByteCount * keySize,
47135   LogicalAddress keyData,
47136   DCMUniqueID * uniqueID) ;
47137 extern OSStatus
47138 DCMGetNextRecord(
47139   DCMDictionaryRef dictionaryRef,
47140   DCMFieldTag keyFieldTag,
47141   ByteCount keySize,
47142   ConstLogicalAddress keyData,
47143   DCMUniqueID uniqueID,
47144   ByteCount maxKeySize,
47145   ByteCount * nextKeySize,
47146   LogicalAddress nextKeyData,
47147   DCMUniqueID * nextUniqueID) ;
47148 extern OSStatus
47149 DCMGetPrevRecord(
47150   DCMDictionaryRef dictionaryRef,
47151   DCMFieldTag keyFieldTag,
47152   ByteCount keySize,
47153   ConstLogicalAddress keyData,
47154   DCMUniqueID uniqueID,
47155   ByteCount maxKeySize,
47156   ByteCount * prevKeySize,
47157   LogicalAddress prevKeyData,
47158   DCMUniqueID * prevUniqueID) ;
47159 extern OSStatus
47160 DCMGetFieldData(
47161   DCMDictionaryRef dictionaryRef,
47162   DCMFieldTag keyFieldTag,
47163   ByteCount keySize,
47164   ConstLogicalAddress keyData,
47165   DCMUniqueID uniqueID,
47166   ItemCount numOfData,
47167   const DCMFieldTag dataTag[],
47168   AEDesc * dataList) ;
47169 extern OSStatus
47170 DCMSetFieldData(
47171   DCMDictionaryRef dictionaryRef,
47172   DCMFieldTag keyFieldTag,
47173   ByteCount keySize,
47174   ConstLogicalAddress keyData,
47175   DCMUniqueID uniqueID,
47176   const AEDesc * dataList) ;
47177 extern OSStatus
47178 DCMAddRecord(
47179   DCMDictionaryRef dictionaryRef,
47180   DCMFieldTag keyFieldTag,
47181   ByteCount keySize,
47182   ConstLogicalAddress keyData,
47183   Boolean checkOnly,
47184   const AEDesc * dataList,
47185   DCMUniqueID * newUniqueID) ;
47186 extern OSStatus
47187 DCMDeleteRecord(
47188   DCMDictionaryRef dictionaryRef,
47189   DCMFieldTag keyFieldTag,
47190   ByteCount keySize,
47191   ConstLogicalAddress keyData,
47192   DCMUniqueID uniqueID) ;
47193 extern OSStatus
47194 DCMReorganizeDictionary(
47195   DCMDictionaryID dictionaryID,
47196   ItemCount extraCapacity,
47197   DCMProgressFilterUPP progressProc,
47198   UInt32 userData) ;
47199 extern OSStatus
47200 DCMCompactDictionary(
47201   DCMDictionaryID dictionaryID,
47202   DCMProgressFilterUPP progressProc,
47203   UInt32 userData) ;
47204 extern OSStatus
47205 DCMGetFileFromDictionaryID(
47206   DCMDictionaryID dictionaryID,
47207   FSSpec * fileRef) ;
47208 extern OSStatus
47209 DCMGetDictionaryIDFromFile(
47210   const FSSpec * fileRef,
47211   DCMDictionaryID * dictionaryID) ;
47212 extern DCMDictionaryID
47213 DCMGetDictionaryIDFromRef(DCMDictionaryRef dictionaryRef) ;
47214 extern OSStatus
47215 DCMGetDictionaryFieldInfo(
47216   DCMDictionaryID dictionaryID,
47217   DCMFieldTag fieldTag,
47218   AEDesc * fieldInfoRecord) ;
47219 extern OSStatus
47220 DCMGetDictionaryProperty(
47221   DCMDictionaryID dictionaryID,
47222   DCMFieldTag propertyTag,
47223   ByteCount maxPropertySize,
47224   ByteCount * actualSize,
47225   LogicalAddress propertyValue) ;
47226 extern OSStatus
47227 DCMSetDictionaryProperty(
47228   DCMDictionaryID dictionaryID,
47229   DCMFieldTag propertyTag,
47230   ByteCount propertySize,
47231   ConstLogicalAddress propertyValue) ;
47232 extern OSStatus
47233 DCMGetDictionaryPropertyList(
47234   DCMDictionaryID dictionaryID,
47235   ItemCount maxPropertyNum,
47236   ItemCount * numProperties,
47237   DCMFieldTag propertyTag[]) ;
47238 extern OSStatus
47239 DCMCreateDictionaryIterator(DCMDictionaryIterator * dictionaryIterator) ;
47240 extern OSStatus
47241 DCMCreateAccessMethodIterator(DCMAccessMethodIterator * accessMethodIterator) ;
47242 extern ItemCount
47243 DCMCountObjectIterator(DCMObjectIterator iterator) ;
47244 extern OSStatus
47245 DCMIterateObject(
47246   DCMObjectIterator iterator,
47247   DCMObjectID * objectID) ;
47248 extern OSStatus
47249 DCMResetObjectIterator(DCMObjectIterator iterator) ;
47250 extern OSStatus
47251 DCMDisposeObjectIterator(DCMObjectIterator iterator) ;
47252 extern OSStatus
47253 DCMGetAccessMethodIDFromName(
47254   ConstStr63Param accessMethodName,
47255   DCMAccessMethodID * accessMethodID) ;
47256 extern OSStatus
47257 DCMCreateFieldInfoRecord(
47258   DescType fieldTag,
47259   DescType fieldType,
47260   ByteCount maxRecordSize,
47261   DCMFieldAttributes fieldAttributes,
47262   AEDesc * fieldDefaultData,
47263   ItemCount numberOfFindMethods,
47264   DCMFindMethod findMethods[],
47265   AEDesc * fieldInfoRecord) ;
47266 extern OSStatus
47267 DCMGetFieldTagAndType(
47268   const AEDesc * fieldInfoRecord,
47269   DCMFieldTag * fieldTag,
47270   DCMFieldType * fieldType) ;
47271 extern OSStatus
47272 DCMGetFieldMaxRecordSize(
47273   const AEDesc * fieldInfoRecord,
47274   ByteCount * maxRecordSize) ;
47275 extern OSStatus
47276 DCMGetFieldAttributes(
47277   const AEDesc * fieldInfoRecord,
47278   DCMFieldAttributes * attributes) ;
47279 extern OSStatus
47280 DCMGetFieldDefaultData(
47281   const AEDesc * fieldInfoRecord,
47282   DescType desiredType,
47283   AEDesc * fieldDefaultData) ;
47284 extern OSStatus
47285 DCMGetFieldFindMethods(
47286   const AEDesc * fieldInfoRecord,
47287   ItemCount findMethodsArrayMaxSize,
47288   DCMFindMethod findMethods[],
47289   ItemCount * actualNumberOfFindMethods) ;
47290     inline Boolean DCMDictionaryManagerAvailable() { return true; }
47291 enum {
47292   kMaxYomiLengthInAppleJapaneseDictionary = 40,
47293   kMaxKanjiLengthInAppleJapaneseDictionary = 64
47294 };
47295
47296
47297
47298
47299 enum {
47300   kDCMJapaneseYomiTag = 'yomi',
47301   kDCMJapaneseHyokiTag = 'hyok',
47302   kDCMJapaneseHinshiTag = 'hins',
47303   kDCMJapaneseWeightTag = 'hind',
47304   kDCMJapanesePhoneticTag = 'hton',
47305   kDCMJapaneseAccentTag = 'acnt',
47306   kDCMJapaneseOnKunReadingTag = 'OnKn',
47307   kDCMJapaneseFukugouInfoTag = 'fuku'
47308 };
47309
47310 enum {
47311   kDCMJapaneseYomiType = typeUnicodeText,
47312   kDCMJapaneseHyokiType = typeUnicodeText,
47313   kDCMJapaneseHinshiType = 'hins',
47314   kDCMJapaneseWeightType = typeShortInteger,
47315   kDCMJapanesePhoneticType = typeUnicodeText,
47316   kDCMJapaneseAccentType = 'byte',
47317   kDCMJapaneseOnKunReadingType = typeUnicodeText,
47318   kDCMJapaneseFukugouInfoType = 'fuku'
47319 };
47320
47321 enum {
47322
47323   kInsert = 0,
47324   kReplace = 1,
47325   kInsertOrReplace = 2
47326 };
47327
47328
47329
47330 typedef short DictionaryDataInsertMode;
47331 enum {
47332
47333   kIsCaseSensitive = 0x10,
47334   kIsNotDiacriticalSensitive = 0x20
47335 };
47336
47337 enum {
47338
47339   kNoun = -1,
47340   kVerb = -2,
47341   kAdjective = -3,
47342   kAdverb = -4
47343 };
47344
47345
47346 typedef SInt8 DictionaryEntryAttribute;
47347
47348 struct DictionaryInformation {
47349   FSSpec dictionaryFSSpec;
47350   SInt32 numberOfRecords;
47351   SInt32 currentGarbageSize;
47352   ScriptCode script;
47353   SInt16 maximumKeyLength;
47354   SInt8 keyAttributes;
47355 };
47356 typedef struct DictionaryInformation DictionaryInformation;
47357 struct DictionaryAttributeTable {
47358   UInt8 datSize;
47359   DictionaryEntryAttribute datTable[1];
47360 };
47361 typedef struct DictionaryAttributeTable DictionaryAttributeTable;
47362 typedef DictionaryAttributeTable * DictionaryAttributeTablePtr;
47363
47364
47365 }
47366 extern "C" {
47367
47368
47369
47370 typedef struct OpaqueLAEnvironmentRef* LAEnvironmentRef;
47371 typedef struct OpaqueLAContextRef* LAContextRef;
47372 typedef AEKeyword LAPropertyKey;
47373 typedef DescType LAPropertyType;
47374
47375
47376
47377 struct LAMorphemeRec {
47378   ByteCount sourceTextLength;
47379   LogicalAddress sourceTextPtr;
47380   ByteCount morphemeTextLength;
47381   LogicalAddress morphemeTextPtr;
47382   UInt32 partOfSpeech;
47383 };
47384 typedef struct LAMorphemeRec LAMorphemeRec;
47385 struct LAMorphemesArray {
47386   ItemCount morphemesCount;
47387   ByteCount processedTextLength;
47388   ByteCount morphemesTextLength;
47389   LAMorphemeRec morphemes[1];
47390 };
47391 typedef struct LAMorphemesArray LAMorphemesArray;
47392 typedef LAMorphemesArray * LAMorphemesArrayPtr;
47393 enum {
47394   kLAMorphemesArrayVersion = 0
47395 };
47396
47397
47398
47399
47400 typedef AERecord LAMorphemeBundle;
47401 typedef AERecord LAMorphemePath;
47402 typedef AERecord LAMorpheme;
47403 typedef AERecord LAHomograph;
47404 enum {
47405   keyAELAMorphemeBundle = 'lmfb',
47406   keyAELAMorphemePath = 'lmfp',
47407   keyAELAMorpheme = 'lmfn',
47408   keyAELAHomograph = 'lmfh'
47409 };
47410
47411 enum {
47412   typeLAMorphemeBundle = typeAERecord,
47413   typeLAMorphemePath = typeAERecord,
47414   typeLAMorpheme = typeAEList,
47415   typeLAHomograph = typeAEList
47416 };
47417
47418
47419
47420
47421 enum {
47422   keyAEMorphemePartOfSpeechCode = 'lamc',
47423   keyAEMorphemeTextRange = 'lamt'
47424 };
47425
47426 enum {
47427   typeAEMorphemePartOfSpeechCode = 'lamc',
47428   typeAEMorphemeTextRange = 'lamt'
47429 };
47430
47431 typedef UInt32 MorphemePartOfSpeech;
47432 struct MorphemeTextRange {
47433   UInt32 sourceOffset;
47434   UInt32 length;
47435 };
47436 typedef struct MorphemeTextRange MorphemeTextRange;
47437
47438
47439
47440 enum {
47441   kLAEndOfSourceTextMask = 0x00000001
47442 };
47443
47444
47445
47446
47447 enum {
47448   kLADefaultEdge = 0,
47449   kLAFreeEdge = 1,
47450   kLAIncompleteEdge = 2
47451 };
47452
47453
47454
47455
47456 enum {
47457   kLAAllMorphemes = 0
47458 };
47459 extern UInt32
47460 LALibraryVersion(void) ;
47461 extern OSStatus
47462 LATextToMorphemes(
47463   LAContextRef context,
47464   TextEncoding preferedEncoding,
47465   ByteCount textLength,
47466   ConstLogicalAddress sourceText,
47467   ByteCount bufferSize,
47468   OptionBits convertFlags,
47469   UInt32 structureVersion,
47470   ByteCount * acceptedLength,
47471   LAMorphemesArrayPtr resultBuffer) ;
47472 extern OSStatus
47473 LAOpenAnalysisContext(
47474   LAEnvironmentRef environ,
47475   LAContextRef * context) ;
47476 extern OSStatus
47477 LACloseAnalysisContext(LAContextRef context) ;
47478 extern OSStatus
47479 LAGetEnvironmentList(
47480   UInt32 maxCount,
47481   UInt32 * actualCount,
47482   LAEnvironmentRef environmentList[]) ;
47483 extern OSStatus
47484 LAGetEnvironmentName(
47485   LAEnvironmentRef environment,
47486   Str63 environmentName) ;
47487 extern OSStatus
47488 LAGetEnvironmentRef(
47489   ConstStr63Param targetEnvironmentName,
47490   LAEnvironmentRef * environment) ;
47491 extern OSStatus
47492 LACreateCustomEnvironment(
47493   LAEnvironmentRef baseEnvironment,
47494   ConstStr63Param newEnvironmentName,
47495   Boolean persistent,
47496   LAEnvironmentRef * newEnvironment) ;
47497 extern OSStatus
47498 LADeleteCustomEnvironment(LAEnvironmentRef environment) ;
47499 extern OSStatus
47500 LAOpenDictionary(
47501   LAEnvironmentRef environ,
47502   const FSSpec * dictionary) ;
47503 extern OSStatus
47504 LACloseDictionary(
47505   LAEnvironmentRef environ,
47506   const FSSpec * dictionary) ;
47507 extern OSStatus
47508 LAListAvailableDictionaries(
47509   LAEnvironmentRef environ,
47510   ItemCount maxCount,
47511   ItemCount * actualCount,
47512   FSSpec dictionaryList[],
47513   Boolean opened[]) ;
47514 extern OSStatus
47515 LAAddNewWord(
47516   LAEnvironmentRef environ,
47517   const FSSpec * dictionary,
47518   const AEDesc * dataList) ;
47519 extern OSStatus
47520 LAMorphemeAnalysis(
47521   LAContextRef context,
47522   ConstUniCharArrayPtr text,
47523   UniCharCount textLength,
47524   LAMorphemePath * leadingPath,
47525   LAMorphemePath * trailingPath,
47526   ItemCount pathCount,
47527   LAMorphemeBundle * result) ;
47528 extern OSStatus
47529 LAContinuousMorphemeAnalysis(
47530   LAContextRef context,
47531   ConstUniCharArrayPtr text,
47532   UniCharCount textLength,
47533   Boolean incrementalText,
47534   LAMorphemePath * leadingPath,
47535   LAMorphemePath * trailingPath,
47536   Boolean * modified) ;
47537 extern OSStatus
47538 LAGetMorphemes(
47539   LAContextRef context,
47540   LAMorphemePath * result) ;
47541 extern OSStatus
47542 LAShiftMorphemes(
47543   LAContextRef context,
47544   ItemCount morphemeCount,
47545   LAMorphemePath * path,
47546   UniCharCount * shiftedLength) ;
47547 extern OSStatus
47548 LAResetAnalysis(LAContextRef context) ;
47549     inline Boolean LALanguageAnalysisAvailable() { return true; }
47550 enum {
47551   kAppleJapaneseDictionarySignature = 'jlan'
47552 };
47553
47554
47555
47556
47557 enum {
47558   kMaxInputLengthOfAppleJapaneseEngine = 200
47559 };
47560
47561
47562
47563
47564
47565 typedef MorphemePartOfSpeech JapanesePartOfSpeech;
47566 typedef UInt16 HomographWeight;
47567 typedef UInt8 HomographAccent;
47568
47569
47570
47571 enum {
47572   keyAEHomographDicInfo = 'lahd',
47573   keyAEHomographWeight = 'lahw',
47574   keyAEHomographAccent = 'laha'
47575 };
47576
47577 enum {
47578   typeAEHomographDicInfo = 'lahd',
47579   typeAEHomographWeight = typeShortInteger,
47580   typeAEHomographAccent = 'laha'
47581 };
47582
47583
47584
47585
47586 struct HomographDicInfoRec {
47587   DCMDictionaryID dictionaryID;
47588   DCMUniqueID uniqueID;
47589 };
47590 typedef struct HomographDicInfoRec HomographDicInfoRec;
47591 enum {
47592   kLASpeechRoughClassMask = 0x0000F000,
47593   kLASpeechMediumClassMask = 0x0000FF00,
47594   kLASpeechStrictClassMask = 0x0000FFF0,
47595   kLASpeechKatsuyouMask = 0x0000000F
47596 };
47597
47598
47599
47600
47601
47602 enum {
47603   kLASpeechMeishi = 0x00000000,
47604   kLASpeechFutsuuMeishi = 0x00000000,
47605   kLASpeechJinmei = 0x00000100,
47606   kLASpeechJinmeiSei = 0x00000110,
47607   kLASpeechJinmeiMei = 0x00000120,
47608   kLASpeechChimei = 0x00000200,
47609   kLASpeechSetsubiChimei = 0x00000210,
47610   kLASpeechSoshikimei = 0x00000300,
47611   kLASpeechKoyuuMeishi = 0x00000400,
47612   kLASpeechSahenMeishi = 0x00000500,
47613   kLASpeechKeidouMeishi = 0x00000600,
47614   kLASpeechRentaishi = 0x00001000,
47615   kLASpeechFukushi = 0x00002000,
47616   kLASpeechSetsuzokushi = 0x00003000,
47617   kLASpeechKandoushi = 0x00004000,
47618   kLASpeechDoushi = 0x00005000,
47619   kLASpeechGodanDoushi = 0x00005000,
47620   kLASpeechKagyouGodan = 0x00005000,
47621   kLASpeechSagyouGodan = 0x00005010,
47622   kLASpeechTagyouGodan = 0x00005020,
47623   kLASpeechNagyouGodan = 0x00005030,
47624   kLASpeechMagyouGodan = 0x00005040,
47625   kLASpeechRagyouGodan = 0x00005050,
47626   kLASpeechWagyouGodan = 0x00005060,
47627   kLASpeechGagyouGodan = 0x00005070,
47628   kLASpeechBagyouGodan = 0x00005080,
47629   kLASpeechIchidanDoushi = 0x00005100,
47630   kLASpeechKahenDoushi = 0x00005200,
47631   kLASpeechSahenDoushi = 0x00005300,
47632   kLASpeechZahenDoushi = 0x00005400,
47633   kLASpeechKeiyoushi = 0x00006000,
47634   kLASpeechKeiyoudoushi = 0x00007000,
47635   kLASpeechSettougo = 0x00008000,
47636   kLASpeechSuujiSettougo = 0x00008100,
47637   kLASpeechSetsubigo = 0x00009000,
47638   kLASpeechJinmeiSetsubigo = 0x00009100,
47639   kLASpeechChimeiSetsubigo = 0x00009200,
47640   kLASpeechSoshikimeiSetsubigo = 0x00009300,
47641   kLASpeechSuujiSetsubigo = 0x00009400,
47642   kLASpeechMuhinshi = 0x0000A000,
47643   kLASpeechTankanji = 0x0000A000,
47644   kLASpeechKigou = 0x0000A100,
47645   kLASpeechKuten = 0x0000A110,
47646   kLASpeechTouten = 0x0000A120,
47647   kLASpeechSuushi = 0x0000A200,
47648   kLASpeechDokuritsugo = 0x0000A300,
47649   kLASpeechSeiku = 0x0000A400,
47650   kLASpeechJodoushi = 0x0000B000,
47651   kLASpeechJoshi = 0x0000C000
47652 };
47653
47654
47655
47656
47657
47658 enum {
47659   kLASpeechKatsuyouGokan = 0x00000001,
47660   kLASpeechKatsuyouMizen = 0x00000002,
47661   kLASpeechKatsuyouRenyou = 0x00000003,
47662   kLASpeechKatsuyouSyuushi = 0x00000004,
47663   kLASpeechKatsuyouRentai = 0x00000005,
47664   kLASpeechKatsuyouKatei = 0x00000006,
47665   kLASpeechKatsuyouMeirei = 0x00000007
47666 };
47667
47668
47669
47670
47671
47672 }
47673
47674
47675
47676 extern "C" {
47677
47678
47679
47680 enum {
47681   kTextToSpeechSynthType = 'ttsc',
47682   kTextToSpeechVoiceType = 'ttvd',
47683   kTextToSpeechVoiceFileType = 'ttvf',
47684   kTextToSpeechVoiceBundleType = 'ttvb'
47685 };
47686
47687 enum {
47688   kNoEndingProsody = 1,
47689   kNoSpeechInterrupt = 2,
47690   kPreflightThenPause = 4
47691 };
47692
47693 enum {
47694   kImmediate = 0,
47695   kEndOfWord = 1,
47696   kEndOfSentence = 2
47697 };
47698
47699
47700
47701
47702
47703 enum {
47704   soStatus = 'stat',
47705   soErrors = 'erro',
47706   soInputMode = 'inpt',
47707   soCharacterMode = 'char',
47708   soNumberMode = 'nmbr',
47709   soRate = 'rate',
47710   soPitchBase = 'pbas',
47711   soPitchMod = 'pmod',
47712   soVolume = 'volm',
47713   soSynthType = 'vers',
47714   soRecentSync = 'sync',
47715   soPhonemeSymbols = 'phsy',
47716   soCurrentVoice = 'cvox',
47717   soCommandDelimiter = 'dlim',
47718   soReset = 'rset',
47719   soCurrentA5 = 'myA5',
47720   soRefCon = 'refc',
47721   soTextDoneCallBack = 'tdcb',
47722   soSpeechDoneCallBack = 'sdcb',
47723   soSyncCallBack = 'sycb',
47724   soErrorCallBack = 'ercb',
47725   soPhonemeCallBack = 'phcb',
47726   soWordCallBack = 'wdcb',
47727   soSynthExtension = 'xtnd',
47728   soSoundOutput = 'sndo'
47729 };
47730
47731
47732
47733
47734
47735 enum {
47736   modeText = 'TEXT',
47737   modePhonemes = 'PHON',
47738   modeNormal = 'NORM',
47739   modeLiteral = 'LTRL'
47740 };
47741
47742
47743 enum {
47744   soVoiceDescription = 'info',
47745   soVoiceFile = 'fref'
47746 };
47747
47748
47749
47750
47751
47752
47753 struct SpeechChannelRecord {
47754   long data[1];
47755 };
47756 typedef struct SpeechChannelRecord SpeechChannelRecord;
47757 typedef SpeechChannelRecord * SpeechChannel;
47758
47759 struct VoiceSpec {
47760   OSType creator;
47761   OSType id;
47762 };
47763 typedef struct VoiceSpec VoiceSpec;
47764 typedef VoiceSpec * VoiceSpecPtr;
47765
47766 enum {
47767   kNeuter = 0,
47768   kMale = 1,
47769   kFemale = 2
47770 };
47771
47772
47773
47774
47775 struct VoiceDescription {
47776   long length;
47777   VoiceSpec voice;
47778   long version;
47779   Str63 name;
47780   Str255 comment;
47781   short gender;
47782   short age;
47783   short script;
47784   short language;
47785   short region;
47786   long reserved[4];
47787 };
47788 typedef struct VoiceDescription VoiceDescription;
47789
47790
47791 struct VoiceFileInfo {
47792   FSSpec fileSpec;
47793   short resID;
47794 };
47795 typedef struct VoiceFileInfo VoiceFileInfo;
47796 struct SpeechStatusInfo {
47797   Boolean outputBusy;
47798   Boolean outputPaused;
47799   long inputBytesLeft;
47800   short phonemeCode;
47801 };
47802 typedef struct SpeechStatusInfo SpeechStatusInfo;
47803
47804
47805 struct SpeechErrorInfo {
47806   short count;
47807   OSErr oldest;
47808   long oldPos;
47809   OSErr newest;
47810   long newPos;
47811 };
47812 typedef struct SpeechErrorInfo SpeechErrorInfo;
47813
47814
47815 struct SpeechVersionInfo {
47816   OSType synthType;
47817   OSType synthSubType;
47818   OSType synthManufacturer;
47819   long synthFlags;
47820   NumVersion synthVersion;
47821 };
47822 typedef struct SpeechVersionInfo SpeechVersionInfo;
47823
47824
47825 struct PhonemeInfo {
47826   short opcode;
47827   Str15 phStr;
47828   Str31 exampleStr;
47829   short hiliteStart;
47830   short hiliteEnd;
47831 };
47832 typedef struct PhonemeInfo PhonemeInfo;
47833
47834 struct PhonemeDescriptor {
47835   short phonemeCount;
47836   PhonemeInfo thePhonemes[1];
47837 };
47838 typedef struct PhonemeDescriptor PhonemeDescriptor;
47839 struct SpeechXtndData {
47840   OSType synthCreator;
47841   Byte synthData[2];
47842 };
47843 typedef struct SpeechXtndData SpeechXtndData;
47844
47845 struct DelimiterInfo {
47846   Byte startDelimiter[2];
47847   Byte endDelimiter[2];
47848 };
47849 typedef struct DelimiterInfo DelimiterInfo;
47850
47851 typedef void ( * SpeechTextDoneProcPtr)(SpeechChannel chan, long refCon, const void **nextBuf, unsigned long *byteLen, long *controlFlags);
47852 typedef void ( * SpeechDoneProcPtr)(SpeechChannel chan, long refCon);
47853 typedef void ( * SpeechSyncProcPtr)(SpeechChannel chan, long refCon, OSType syncMessage);
47854 typedef void ( * SpeechErrorProcPtr)(SpeechChannel chan, long refCon, OSErr theError, long bytePos);
47855 typedef void ( * SpeechPhonemeProcPtr)(SpeechChannel chan, long refCon, short phonemeOpcode);
47856 typedef void ( * SpeechWordProcPtr)(SpeechChannel chan, long refCon, unsigned long wordPos, unsigned short wordLen);
47857 typedef SpeechTextDoneProcPtr SpeechTextDoneUPP;
47858 typedef SpeechDoneProcPtr SpeechDoneUPP;
47859 typedef SpeechSyncProcPtr SpeechSyncUPP;
47860 typedef SpeechErrorProcPtr SpeechErrorUPP;
47861 typedef SpeechPhonemeProcPtr SpeechPhonemeUPP;
47862 typedef SpeechWordProcPtr SpeechWordUPP;
47863 extern SpeechTextDoneUPP
47864 NewSpeechTextDoneUPP(SpeechTextDoneProcPtr userRoutine) ;
47865 extern SpeechDoneUPP
47866 NewSpeechDoneUPP(SpeechDoneProcPtr userRoutine) ;
47867 extern SpeechSyncUPP
47868 NewSpeechSyncUPP(SpeechSyncProcPtr userRoutine) ;
47869 extern SpeechErrorUPP
47870 NewSpeechErrorUPP(SpeechErrorProcPtr userRoutine) ;
47871 extern SpeechPhonemeUPP
47872 NewSpeechPhonemeUPP(SpeechPhonemeProcPtr userRoutine) ;
47873 extern SpeechWordUPP
47874 NewSpeechWordUPP(SpeechWordProcPtr userRoutine) ;
47875 extern void
47876 DisposeSpeechTextDoneUPP(SpeechTextDoneUPP userUPP) ;
47877 extern void
47878 DisposeSpeechDoneUPP(SpeechDoneUPP userUPP) ;
47879 extern void
47880 DisposeSpeechSyncUPP(SpeechSyncUPP userUPP) ;
47881 extern void
47882 DisposeSpeechErrorUPP(SpeechErrorUPP userUPP) ;
47883 extern void
47884 DisposeSpeechPhonemeUPP(SpeechPhonemeUPP userUPP) ;
47885 extern void
47886 DisposeSpeechWordUPP(SpeechWordUPP userUPP) ;
47887 extern void
47888 InvokeSpeechTextDoneUPP(
47889   SpeechChannel chan,
47890   long refCon,
47891   const void ** nextBuf,
47892   unsigned long * byteLen,
47893   long * controlFlags,
47894   SpeechTextDoneUPP userUPP) ;
47895 extern void
47896 InvokeSpeechDoneUPP(
47897   SpeechChannel chan,
47898   long refCon,
47899   SpeechDoneUPP userUPP) ;
47900 extern void
47901 InvokeSpeechSyncUPP(
47902   SpeechChannel chan,
47903   long refCon,
47904   OSType syncMessage,
47905   SpeechSyncUPP userUPP) ;
47906 extern void
47907 InvokeSpeechErrorUPP(
47908   SpeechChannel chan,
47909   long refCon,
47910   OSErr theError,
47911   long bytePos,
47912   SpeechErrorUPP userUPP) ;
47913 extern void
47914 InvokeSpeechPhonemeUPP(
47915   SpeechChannel chan,
47916   long refCon,
47917   short phonemeOpcode,
47918   SpeechPhonemeUPP userUPP) ;
47919 extern void
47920 InvokeSpeechWordUPP(
47921   SpeechChannel chan,
47922   long refCon,
47923   unsigned long wordPos,
47924   unsigned short wordLen,
47925   SpeechWordUPP userUPP) ;
47926 extern NumVersion
47927 SpeechManagerVersion(void) ;
47928 extern OSErr
47929 MakeVoiceSpec(
47930   OSType creator,
47931   OSType id,
47932   VoiceSpec * voice) ;
47933 extern OSErr
47934 CountVoices(short * numVoices) ;
47935 extern OSErr
47936 GetIndVoice(
47937   short index,
47938   VoiceSpec * voice) ;
47939 extern OSErr
47940 GetVoiceDescription(
47941   const VoiceSpec * voice,
47942   VoiceDescription * info,
47943   long infoLength) ;
47944 extern OSErr
47945 GetVoiceInfo(
47946   const VoiceSpec * voice,
47947   OSType selector,
47948   void * voiceInfo) ;
47949 extern OSErr
47950 NewSpeechChannel(
47951   VoiceSpec * voice,
47952   SpeechChannel * chan) ;
47953 extern OSErr
47954 DisposeSpeechChannel(SpeechChannel chan) ;
47955 extern OSErr
47956 SpeakString(ConstStr255Param textToBeSpoken) ;
47957 extern OSErr
47958 SpeakText(
47959   SpeechChannel chan,
47960   const void * textBuf,
47961   unsigned long textBytes) ;
47962 extern OSErr
47963 SpeakBuffer(
47964   SpeechChannel chan,
47965   const void * textBuf,
47966   unsigned long textBytes,
47967   long controlFlags) ;
47968 extern OSErr
47969 StopSpeech(SpeechChannel chan) ;
47970 extern OSErr
47971 StopSpeechAt(
47972   SpeechChannel chan,
47973   long whereToStop) ;
47974 extern OSErr
47975 PauseSpeechAt(
47976   SpeechChannel chan,
47977   long whereToPause) ;
47978 extern OSErr
47979 ContinueSpeech(SpeechChannel chan) ;
47980 extern short
47981 SpeechBusy(void) ;
47982 extern short
47983 SpeechBusySystemWide(void) ;
47984 extern OSErr
47985 SetSpeechRate(
47986   SpeechChannel chan,
47987   Fixed rate) ;
47988 extern OSErr
47989 GetSpeechRate(
47990   SpeechChannel chan,
47991   Fixed * rate) ;
47992 extern OSErr
47993 SetSpeechPitch(
47994   SpeechChannel chan,
47995   Fixed pitch) ;
47996 extern OSErr
47997 GetSpeechPitch(
47998   SpeechChannel chan,
47999   Fixed * pitch) ;
48000 extern OSErr
48001 SetSpeechInfo(
48002   SpeechChannel chan,
48003   OSType selector,
48004   const void * speechInfo) ;
48005 extern OSErr
48006 GetSpeechInfo(
48007   SpeechChannel chan,
48008   OSType selector,
48009   void * speechInfo) ;
48010 extern OSErr
48011 TextToPhonemes(
48012   SpeechChannel chan,
48013   const void * textBuf,
48014   unsigned long textBytes,
48015   Handle phonemeBuf,
48016   long * phonemeBytes) ;
48017 extern OSErr
48018 UseDictionary(
48019   SpeechChannel chan,
48020   Handle dictionary) ;
48021
48022
48023
48024
48025
48026
48027
48028 }
48029
48030
48031
48032 extern "C" {
48033
48034
48035
48036
48037
48038
48039
48040
48041
48042 enum {
48043   kLSUnknownErr = -10810,
48044   kLSNotAnApplicationErr = -10811,
48045   kLSNotInitializedErr = -10812,
48046   kLSDataUnavailableErr = -10813,
48047   kLSApplicationNotFoundErr = -10814,
48048   kLSUnknownTypeErr = -10815,
48049   kLSDataTooOldErr = -10816,
48050   kLSDataErr = -10817,
48051   kLSLaunchInProgressErr = -10818,
48052   kLSNotRegisteredErr = -10819,
48053   kLSAppDoesNotClaimTypeErr = -10820,
48054   kLSAppDoesNotSupportSchemeWarning = -10821,
48055   kLSServerCommunicationErr = -10822,
48056   kLSCannotSetInfoErr = -10823
48057 };
48058
48059 typedef OptionBits LSInitializeFlags;
48060 enum {
48061   kLSInitializeDefaults = 0x00000001
48062 };
48063
48064 enum {
48065   kLSMinCatInfoBitmap = (kFSCatInfoNodeFlags | kFSCatInfoParentDirID | kFSCatInfoFinderInfo | kFSCatInfoFinderXInfo)
48066 };
48067
48068 enum {
48069   kLSInvalidExtensionIndex = (unsigned long)0xFFFFFFFF
48070 };
48071
48072 typedef OptionBits LSRequestedInfo;
48073 enum {
48074   kLSRequestExtension = 0x00000001,
48075   kLSRequestTypeCreator = 0x00000002,
48076   kLSRequestBasicFlagsOnly = 0x00000004,
48077   kLSRequestAppTypeFlags = 0x00000008,
48078   kLSRequestAllFlags = 0x00000010,
48079   kLSRequestIconAndKind = 0x00000020,
48080   kLSRequestExtensionFlagsOnly = 0x00000040,
48081   kLSRequestAllInfo = (unsigned long)0xFFFFFFFF
48082 };
48083
48084 typedef OptionBits LSItemInfoFlags;
48085 enum {
48086   kLSItemInfoIsPlainFile = 0x00000001,
48087   kLSItemInfoIsPackage = 0x00000002,
48088   kLSItemInfoIsApplication = 0x00000004,
48089   kLSItemInfoIsContainer = 0x00000008,
48090   kLSItemInfoIsAliasFile = 0x00000010,
48091   kLSItemInfoIsSymlink = 0x00000020,
48092   kLSItemInfoIsInvisible = 0x00000040,
48093   kLSItemInfoIsNativeApp = 0x00000080,
48094   kLSItemInfoIsClassicApp = 0x00000100,
48095   kLSItemInfoAppPrefersNative = 0x00000200,
48096   kLSItemInfoAppPrefersClassic = 0x00000400,
48097   kLSItemInfoAppIsScriptable = 0x00000800,
48098   kLSItemInfoIsVolume = 0x00001000,
48099   kLSItemInfoExtensionIsHidden = 0x00100000
48100 };
48101
48102 typedef OptionBits LSRolesMask;
48103 enum {
48104   kLSRolesNone = 0x00000001,
48105   kLSRolesViewer = 0x00000002,
48106   kLSRolesEditor = 0x00000004,
48107   kLSRolesAll = (unsigned long)0xFFFFFFFF
48108 };
48109
48110 typedef UInt32 LSKindID;
48111 enum {
48112   kLSUnknownKindID = 0
48113 };
48114
48115 enum {
48116   kLSUnknownType = 0,
48117   kLSUnknownCreator = 0
48118 };
48119
48120 struct LSItemInfoRecord {
48121   LSItemInfoFlags flags;
48122   OSType filetype;
48123   OSType creator;
48124   CFStringRef extension;
48125   CFStringRef iconFileName;
48126   LSKindID kindID;
48127 };
48128 typedef struct LSItemInfoRecord LSItemInfoRecord;
48129
48130 typedef OptionBits LSAcceptanceFlags;
48131 enum {
48132   kLSAcceptDefault = 0x00000001,
48133   kLSAcceptAllowLoginUI = 0x00000002
48134 };
48135
48136 typedef OptionBits LSLaunchFlags;
48137 enum {
48138   kLSLaunchDefaults = 0x00000001,
48139   kLSLaunchAndPrint = 0x00000002,
48140   kLSLaunchReserved2 = 0x00000004,
48141   kLSLaunchReserved3 = 0x00000008,
48142   kLSLaunchReserved4 = 0x00000010,
48143   kLSLaunchReserved5 = 0x00000020,
48144   kLSLaunchReserved6 = 0x00000040,
48145   kLSLaunchInhibitBGOnly = 0x00000080,
48146   kLSLaunchDontAddToRecents = 0x00000100,
48147   kLSLaunchDontSwitch = 0x00000200,
48148   kLSLaunchNoParams = 0x00000800,
48149   kLSLaunchAsync = 0x00010000,
48150   kLSLaunchStartClassic = 0x00020000,
48151   kLSLaunchInClassic = 0x00040000,
48152   kLSLaunchNewInstance = 0x00080000,
48153   kLSLaunchAndHide = 0x00100000,
48154   kLSLaunchAndHideOthers = 0x00200000
48155 };
48156
48157 struct LSLaunchFSRefSpec {
48158   const FSRef * appRef;
48159   UInt32 numDocs;
48160   const FSRef * itemRefs;
48161   const AEDesc * passThruParams;
48162   LSLaunchFlags launchFlags;
48163   void * asyncRefCon;
48164 };
48165 typedef struct LSLaunchFSRefSpec LSLaunchFSRefSpec;
48166 struct LSLaunchURLSpec {
48167   CFURLRef appURL;
48168   CFArrayRef itemURLs;
48169   const AEDesc * passThruParams;
48170   LSLaunchFlags launchFlags;
48171   void * asyncRefCon;
48172 };
48173 typedef struct LSLaunchURLSpec LSLaunchURLSpec;
48174 extern OSStatus
48175 LSInit(LSInitializeFlags inFlags) ;
48176 extern OSStatus
48177 LSTerm(void) ;
48178 extern OSStatus
48179 LSCopyItemInfoForRef(
48180   const FSRef * inItemRef,
48181   LSRequestedInfo inWhichInfo,
48182   LSItemInfoRecord * outItemInfo) ;
48183 extern OSStatus
48184 LSCopyItemInfoForURL(
48185   CFURLRef inURL,
48186   LSRequestedInfo inWhichInfo,
48187   LSItemInfoRecord * outItemInfo) ;
48188 extern OSStatus
48189 LSGetExtensionInfo(
48190   UniCharCount inNameLen,
48191   const UniChar inNameBuffer[],
48192   UniCharCount * outExtStartIndex) ;
48193 extern OSStatus
48194 LSCopyDisplayNameForRef(
48195   const FSRef * inRef,
48196   CFStringRef * outDisplayName) ;
48197 extern OSStatus
48198 LSCopyDisplayNameForURL(
48199   CFURLRef inURL,
48200   CFStringRef * outDisplayName) ;
48201 extern OSStatus
48202 LSSetExtensionHiddenForRef(
48203   const FSRef * inRef,
48204   Boolean inHide) ;
48205 extern OSStatus
48206 LSSetExtensionHiddenForURL(
48207   CFURLRef inURL,
48208   Boolean inHide) ;
48209 extern OSStatus
48210 LSCopyKindStringForRef(
48211   const FSRef * inFSRef,
48212   CFStringRef * outKindString) ;
48213 extern OSStatus
48214 LSCopyKindStringForURL(
48215   CFURLRef inURL,
48216   CFStringRef * outKindString) ;
48217 extern OSStatus
48218 LSCopyKindStringForTypeInfo(
48219   OSType inType,
48220   OSType inCreator,
48221   CFStringRef inExtension,
48222   CFStringRef * outKindString) ;
48223 extern OSStatus
48224 LSCopyKindStringForMIMEType(
48225   CFStringRef inMIMEType,
48226   CFStringRef * outKindString) ;
48227 extern OSStatus
48228 LSGetApplicationForItem(
48229   const FSRef * inItemRef,
48230   LSRolesMask inRoleMask,
48231   FSRef * outAppRef,
48232   CFURLRef * outAppURL) ;
48233 extern OSStatus
48234 LSGetApplicationForInfo(
48235   OSType inType,
48236   OSType inCreator,
48237   CFStringRef inExtension,
48238   LSRolesMask inRoleMask,
48239   FSRef * outAppRef,
48240   CFURLRef * outAppURL) ;
48241 extern OSStatus
48242 LSCopyApplicationForMIMEType(
48243   CFStringRef inMIMEType,
48244   LSRolesMask inRoleMask,
48245   CFURLRef * outAppURL) ;
48246 extern OSStatus
48247 LSGetApplicationForURL(
48248   CFURLRef inURL,
48249   LSRolesMask inRoleMask,
48250   FSRef * outAppRef,
48251   CFURLRef * outAppURL) ;
48252 extern OSStatus
48253 LSFindApplicationForInfo(
48254   OSType inCreator,
48255   CFStringRef inBundleID,
48256   CFStringRef inName,
48257   FSRef * outAppRef,
48258   CFURLRef * outAppURL) ;
48259 extern OSStatus
48260 LSCanRefAcceptItem(
48261   const FSRef * inItemFSRef,
48262   const FSRef * inTargetRef,
48263   LSRolesMask inRoleMask,
48264   LSAcceptanceFlags inFlags,
48265   Boolean * outAcceptsItem) ;
48266 extern OSStatus
48267 LSCanURLAcceptURL(
48268   CFURLRef inItemURL,
48269   CFURLRef inTargetURL,
48270   LSRolesMask inRoleMask,
48271   LSAcceptanceFlags inFlags,
48272   Boolean * outAcceptsItem) ;
48273 extern OSStatus
48274 LSOpenFSRef(
48275   const FSRef * inRef,
48276   FSRef * outLaunchedRef) ;
48277 extern OSStatus
48278 LSOpenCFURLRef(
48279   CFURLRef inURL,
48280   CFURLRef * outLaunchedURL) ;
48281 extern OSStatus
48282 LSOpenFromRefSpec(
48283   const LSLaunchFSRefSpec * inLaunchSpec,
48284   FSRef * outLaunchedRef) ;
48285 extern OSStatus
48286 LSOpenFromURLSpec(
48287   const LSLaunchURLSpec * inLaunchSpec,
48288   CFURLRef * outLaunchedURL) ;
48289
48290
48291
48292
48293
48294
48295 }
48296
48297
48298
48299
48300
48301
48302 extern double acos (double);
48303 extern double asin (double);
48304 extern double atan (double);
48305 extern double atan2 (double, double);
48306 extern double ceil (double);
48307 extern double cos (double);
48308 extern double cosh (double);
48309 extern double exp (double);
48310 extern double fabs (double);
48311 extern double floor (double);
48312 extern double fmod (double, double);
48313 extern double frexp (double, int *);
48314 extern double ldexp (double, int);
48315 extern double log10 (double);
48316 extern double log (double);
48317 extern double modf (double, double *);
48318 extern double pow (double, double);
48319 extern double sin (double);
48320 extern double sinh (double);
48321 extern double sqrt (double);
48322 extern double tan (double);
48323 extern double tanh (double);
48324
48325
48326
48327
48328
48329 extern "C" {
48330
48331
48332
48333
48334
48335
48336 typedef struct OpaqueEventRef* EventRef;
48337 enum {
48338
48339
48340
48341
48342
48343   eventAlreadyPostedErr = -9860,
48344
48345
48346
48347
48348
48349   eventTargetBusyErr = -9861,
48350
48351
48352
48353
48354   eventClassInvalidErr = -9862,
48355
48356
48357
48358
48359   eventClassIncorrectErr = -9864,
48360
48361
48362
48363
48364
48365
48366   eventHandlerAlreadyInstalledErr = -9866,
48367
48368
48369
48370
48371   eventInternalErr = -9868,
48372
48373
48374
48375
48376   eventKindIncorrectErr = -9869,
48377
48378
48379
48380
48381   eventParameterNotFoundErr = -9870,
48382   eventNotHandledErr = -9874,
48383
48384
48385
48386
48387
48388   eventLoopTimedOutErr = -9875,
48389
48390
48391
48392
48393
48394   eventLoopQuitErr = -9876,
48395
48396
48397
48398
48399
48400   eventNotInQueueErr = -9877,
48401   eventHotKeyExistsErr = -9878,
48402   eventHotKeyInvalidErr = -9879
48403 };
48404 typedef SInt16 EventPriority;
48405 enum {
48406
48407
48408
48409
48410
48411   kEventPriorityLow = 0,
48412
48413
48414
48415
48416   kEventPriorityStandard = 1,
48417
48418
48419
48420
48421   kEventPriorityHigh = 2
48422 };
48423
48424 enum {
48425   kEventLeaveInQueue = false,
48426   kEventRemoveFromQueue = true
48427 };
48428
48429
48430
48431
48432
48433
48434 typedef double EventTime;
48435 typedef EventTime EventTimeout;
48436 typedef EventTime EventTimerInterval;
48437     inline EventTime TicksToEventTime( UInt32 t ) { return ( (t) / 60.0 ); }
48438     inline UInt32 EventTimeToTicks( EventTime t ) { return (UInt32)( ((t) * 60) + 0.5 ); }
48439 struct EventTypeSpec {
48440   UInt32 eventClass;
48441   UInt32 eventKind;
48442 };
48443 typedef struct EventTypeSpec EventTypeSpec;
48444
48445
48446
48447 typedef OSType EventParamName;
48448 typedef OSType EventParamType;
48449 typedef struct OpaqueEventLoopRef* EventLoopRef;
48450 extern EventLoopRef
48451 GetCurrentEventLoop(void) ;
48452 extern EventLoopRef
48453 GetMainEventLoop(void) ;
48454 extern OSStatus
48455 RunCurrentEventLoop(EventTimeout inTimeout) ;
48456 extern OSStatus
48457 QuitEventLoop(EventLoopRef inEventLoop) ;
48458 extern CFTypeRef
48459 GetCFRunLoopFromEventLoop(EventLoopRef inEventLoop) ;
48460 extern OSStatus
48461 ReceiveNextEvent(
48462   UInt32 inNumTypes,
48463   const EventTypeSpec * inList,
48464   EventTimeout inTimeout,
48465   Boolean inPullEvent,
48466   EventRef * outEvent) ;
48467
48468
48469
48470
48471
48472 typedef UInt32 EventAttributes;
48473 enum {
48474   kEventAttributeNone = 0,
48475   kEventAttributeUserEvent = (1 << 0)
48476 };
48477 extern OSStatus
48478 CreateEvent(
48479   CFAllocatorRef inAllocator,
48480   UInt32 inClassID,
48481   UInt32 kind,
48482   EventTime when,
48483   EventAttributes flags,
48484   EventRef * outEvent) ;
48485 extern EventRef
48486 CopyEvent(EventRef inOther) ;
48487 extern EventRef
48488 RetainEvent(EventRef inEvent) ;
48489 extern UInt32
48490 GetEventRetainCount(EventRef inEvent) ;
48491 extern void
48492 ReleaseEvent(EventRef inEvent) ;
48493 extern OSStatus
48494 SetEventParameter(
48495   EventRef inEvent,
48496   EventParamName inName,
48497   EventParamType inType,
48498   UInt32 inSize,
48499   const void * inDataPtr) ;
48500 extern OSStatus
48501 GetEventParameter(
48502   EventRef inEvent,
48503   EventParamName inName,
48504   EventParamType inDesiredType,
48505   EventParamType * outActualType,
48506   UInt32 inBufferSize,
48507   UInt32 * outActualSize,
48508   void * outData) ;
48509 extern UInt32
48510 GetEventClass(EventRef inEvent) ;
48511 extern UInt32
48512 GetEventKind(EventRef inEvent) ;
48513 extern EventTime
48514 GetEventTime(EventRef inEvent) ;
48515 extern OSStatus
48516 SetEventTime(
48517   EventRef inEvent,
48518   EventTime inTime) ;
48519
48520
48521
48522
48523
48524
48525 typedef struct OpaqueEventQueueRef* EventQueueRef;
48526 extern EventQueueRef
48527 GetCurrentEventQueue(void) ;
48528 extern EventQueueRef
48529 GetMainEventQueue(void) ;
48530 typedef Boolean ( * EventComparatorProcPtr)(EventRef inEvent, void *inCompareData);
48531 typedef EventComparatorProcPtr EventComparatorUPP;
48532 extern EventComparatorUPP
48533 NewEventComparatorUPP(EventComparatorProcPtr userRoutine) ;
48534 extern void
48535 DisposeEventComparatorUPP(EventComparatorUPP userUPP) ;
48536 extern Boolean
48537 InvokeEventComparatorUPP(
48538   EventRef inEvent,
48539   void * inCompareData,
48540   EventComparatorUPP userUPP) ;
48541 extern OSStatus
48542 PostEventToQueue(
48543   EventQueueRef inQueue,
48544   EventRef inEvent,
48545   EventPriority inPriority) ;
48546 extern OSStatus
48547 FlushEventsMatchingListFromQueue(
48548   EventQueueRef inQueue,
48549   UInt32 inNumTypes,
48550   const EventTypeSpec * inList) ;
48551 extern OSStatus
48552 FlushSpecificEventsFromQueue(
48553   EventQueueRef inQueue,
48554   EventComparatorUPP inComparator,
48555   void * inCompareData) ;
48556 extern OSStatus
48557 FlushEventQueue(EventQueueRef inQueue) ;
48558 extern EventRef
48559 FindSpecificEventInQueue(
48560   EventQueueRef inQueue,
48561   EventComparatorUPP inComparator,
48562   void * inCompareData) ;
48563 extern UInt32
48564 GetNumEventsInQueue(EventQueueRef inQueue) ;
48565 extern OSStatus
48566 RemoveEventFromQueue(
48567   EventQueueRef inQueue,
48568   EventRef inEvent) ;
48569 extern Boolean
48570 IsEventInQueue(
48571   EventQueueRef inQueue,
48572   EventRef inEvent) ;
48573 extern EventRef
48574 GetCurrentEvent(void) ;
48575 extern UInt32
48576 GetCurrentEventButtonState(void) ;
48577 extern UInt32
48578 GetCurrentEventKeyModifiers(void) ;
48579 extern UInt32
48580 GetCurrentButtonState(void) ;
48581 extern EventTime
48582 GetCurrentEventTime(void) ;
48583 typedef struct __EventLoopTimer* EventLoopTimerRef;
48584 typedef void ( * EventLoopTimerProcPtr)(EventLoopTimerRef inTimer, void *inUserData);
48585
48586
48587
48588
48589
48590 enum {
48591
48592
48593
48594
48595
48596
48597   kEventLoopIdleTimerStarted = 1,
48598
48599
48600
48601
48602
48603
48604
48605   kEventLoopIdleTimerIdling = 2,
48606
48607
48608
48609
48610
48611   kEventLoopIdleTimerStopped = 3
48612 };
48613
48614 typedef UInt16 EventLoopIdleTimerMessage;
48615 typedef void ( * EventLoopIdleTimerProcPtr)(EventLoopTimerRef inTimer, EventLoopIdleTimerMessage inState, void *inUserData);
48616 typedef EventLoopTimerProcPtr EventLoopTimerUPP;
48617 typedef EventLoopIdleTimerProcPtr EventLoopIdleTimerUPP;
48618 extern EventLoopTimerUPP
48619 NewEventLoopTimerUPP(EventLoopTimerProcPtr userRoutine) ;
48620 extern EventLoopIdleTimerUPP
48621 NewEventLoopIdleTimerUPP(EventLoopIdleTimerProcPtr userRoutine) ;
48622 extern void
48623 DisposeEventLoopTimerUPP(EventLoopTimerUPP userUPP) ;
48624 extern void
48625 DisposeEventLoopIdleTimerUPP(EventLoopIdleTimerUPP userUPP) ;
48626 extern void
48627 InvokeEventLoopTimerUPP(
48628   EventLoopTimerRef inTimer,
48629   void * inUserData,
48630   EventLoopTimerUPP userUPP) ;
48631 extern void
48632 InvokeEventLoopIdleTimerUPP(
48633   EventLoopTimerRef inTimer,
48634   EventLoopIdleTimerMessage inState,
48635   void * inUserData,
48636   EventLoopIdleTimerUPP userUPP) ;
48637 extern OSStatus
48638 InstallEventLoopTimer(
48639   EventLoopRef inEventLoop,
48640   EventTimerInterval inFireDelay,
48641   EventTimerInterval inInterval,
48642   EventLoopTimerUPP inTimerProc,
48643   void * inTimerData,
48644   EventLoopTimerRef * outTimer) ;
48645 extern OSStatus
48646 InstallEventLoopIdleTimer(
48647   EventLoopRef inEventLoop,
48648   EventTimerInterval inDelay,
48649   EventTimerInterval inInterval,
48650   EventLoopIdleTimerUPP inTimerProc,
48651   void * inTimerData,
48652   EventLoopTimerRef * outTimer) ;
48653 extern OSStatus
48654 InstallIdleTimer(
48655   EventLoopRef inEventLoop,
48656   EventTimerInterval inDelay,
48657   EventTimerInterval inInterval,
48658   EventLoopTimerUPP inTimerProc,
48659   void * inTimerData,
48660   EventLoopTimerRef * outTimer) ;
48661 extern OSStatus
48662 RemoveEventLoopTimer(EventLoopTimerRef inTimer) ;
48663 extern OSStatus
48664 SetEventLoopTimerNextFireTime(
48665   EventLoopTimerRef inTimer,
48666   EventTimerInterval inNextFire) ;
48667 typedef struct OpaqueEventHandlerRef* EventHandlerRef;
48668 typedef struct OpaqueEventHandlerCallRef* EventHandlerCallRef;
48669 typedef OSStatus ( * EventHandlerProcPtr)(EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData);
48670 typedef EventHandlerProcPtr EventHandlerUPP;
48671 extern EventHandlerUPP
48672 NewEventHandlerUPP(EventHandlerProcPtr userRoutine) ;
48673 extern void
48674 DisposeEventHandlerUPP(EventHandlerUPP userUPP) ;
48675 extern OSStatus
48676 InvokeEventHandlerUPP(
48677   EventHandlerCallRef inHandlerCallRef,
48678   EventRef inEvent,
48679   void * inUserData,
48680   EventHandlerUPP userUPP) ;
48681
48682 typedef struct OpaqueEventTargetRef* EventTargetRef;
48683 extern OSStatus
48684 InstallEventHandler(
48685   EventTargetRef inTarget,
48686   EventHandlerUPP inHandler,
48687   UInt32 inNumTypes,
48688   const EventTypeSpec * inList,
48689   void * inUserData,
48690   EventHandlerRef * outRef) ;
48691 extern OSStatus
48692 InstallStandardEventHandler(EventTargetRef inTarget) ;
48693 extern OSStatus
48694 RemoveEventHandler(EventHandlerRef inHandlerRef) ;
48695 extern OSStatus
48696 AddEventTypesToHandler(
48697   EventHandlerRef inHandlerRef,
48698   UInt32 inNumTypes,
48699   const EventTypeSpec * inList) ;
48700 extern OSStatus
48701 RemoveEventTypesFromHandler(
48702   EventHandlerRef inHandlerRef,
48703   UInt32 inNumTypes,
48704   const EventTypeSpec * inList) ;
48705 extern OSStatus
48706 CallNextEventHandler(
48707   EventHandlerCallRef inCallRef,
48708   EventRef inEvent) ;
48709 enum {
48710
48711
48712
48713
48714
48715
48716
48717   kEventTargetDontPropagate = (1 << 0),
48718   kEventTargetSendToAllHandlers = (1 << 1)
48719 };
48720 extern OSStatus
48721 SendEventToEventTarget(
48722   EventRef inEvent,
48723   EventTargetRef inTarget) ;
48724 extern OSStatus
48725 SendEventToEventTargetWithOptions(
48726   EventRef inEvent,
48727   EventTargetRef inTarget,
48728   OptionBits inOptions) ;
48729
48730
48731
48732
48733
48734
48735 }
48736 extern "C" {
48737 typedef struct OpaqueHIObjectClassRef* HIObjectClassRef;
48738 typedef struct OpaqueHIObjectRef* HIObjectRef;
48739
48740
48741
48742
48743
48744 enum {
48745
48746
48747
48748
48749   hiObjectClassExistsErr = -22080,
48750
48751
48752
48753
48754
48755   hiObjectClassHasInstancesErr = -22081,
48756   hiObjectClassHasSubclassesErr = -22082,
48757
48758
48759
48760
48761
48762
48763   hiObjectClassIsAbstractErr = -22083
48764 };
48765 enum {
48766
48767
48768
48769
48770   kEventClassHIObject = 'hiob',
48771   kEventHIObjectConstruct = 1,
48772   kEventHIObjectInitialize = 2,
48773
48774
48775
48776
48777
48778
48779
48780   kEventHIObjectDestruct = 3,
48781
48782
48783
48784
48785
48786
48787   kEventHIObjectIsEqual = 4,
48788
48789
48790
48791
48792
48793
48794   kEventHIObjectPrintDebugInfo = 5
48795 };
48796
48797 enum {
48798   kEventParamHIObjectInstance = 'hioi',
48799   typeHIObjectRef = 'hiob'
48800 };
48801 extern OSStatus
48802 HIObjectRegisterSubclass(
48803   CFStringRef inClassID,
48804   CFStringRef inBaseClassID,
48805   OptionBits inOptions,
48806   EventHandlerUPP inConstructProc,
48807   UInt32 inNumEvents,
48808   const EventTypeSpec * inEventList,
48809   void * inConstructData,
48810   HIObjectClassRef * outClassRef) ;
48811 extern OSStatus
48812 HIObjectUnregisterClass(HIObjectClassRef inClassRef) ;
48813 extern OSStatus
48814 HIObjectCreate(
48815   CFStringRef inClassID,
48816   EventRef inConstructData,
48817   HIObjectRef * outObject) ;
48818 extern EventTargetRef
48819 HIObjectGetEventTarget(HIObjectRef inObject) ;
48820 extern void
48821 HIObjectPrintDebugInfo(HIObjectRef inObject) ;
48822 extern CFStringRef
48823 HIObjectCopyClassID(HIObjectRef inObject) ;
48824 extern Boolean
48825 HIObjectIsOfClass(
48826   HIObjectRef inObject,
48827   CFStringRef inObjectClassID) ;
48828 extern void *
48829 HIObjectDynamicCast(
48830   HIObjectRef inObject,
48831   CFStringRef inClassID) ;
48832 extern OSStatus
48833 HIObjectCreateFromBundle(
48834   CFBundleRef inBundle,
48835   HIObjectRef * outObject) ;
48836 extern Boolean
48837 HIObjectIsAccessibilityIgnored(HIObjectRef inObject) ;
48838 extern OSStatus
48839 HIObjectSetAccessibilityIgnored(
48840   HIObjectRef inObject,
48841   Boolean inIgnored) ;
48842 extern HIObjectRef
48843 _HIObjectRetain(HIObjectRef inObject) ;
48844 extern void
48845 _HIObjectRelease(HIObjectRef inObject) ;
48846 extern UInt32
48847 _HIObjectGetRetainCount(HIObjectRef inObject) ;
48848 extern Boolean
48849 _HIObjectIsEqual(
48850   HIObjectRef inObject,
48851   HIObjectRef inOtherObject) ;
48852 extern const CFArrayCallBacks kHIObjectCFArrayCallbacks;
48853 extern const CFDictionaryKeyCallBacks kHIObjectCFDictKeyCallbacks;
48854 extern const CFDictionaryValueCallBacks kHIObjectCFDictValueCallbacks;
48855
48856
48857
48858
48859 }
48860
48861
48862
48863 extern "C" {
48864
48865
48866
48867 typedef UInt16 EventKind;
48868 typedef UInt16 EventMask;
48869 enum {
48870   nullEvent = 0,
48871   mouseDown = 1,
48872   mouseUp = 2,
48873   keyDown = 3,
48874   keyUp = 4,
48875   autoKey = 5,
48876   updateEvt = 6,
48877   diskEvt = 7,
48878   activateEvt = 8,
48879   osEvt = 15,
48880   kHighLevelEvent = 23
48881 };
48882
48883 enum {
48884   mDownMask = 1 << mouseDown,
48885   mUpMask = 1 << mouseUp,
48886   keyDownMask = 1 << keyDown,
48887   keyUpMask = 1 << keyUp,
48888   autoKeyMask = 1 << autoKey,
48889   updateMask = 1 << updateEvt,
48890   diskMask = 1 << diskEvt,
48891   activMask = 1 << activateEvt,
48892   highLevelEventMask = 0x0400,
48893   osMask = 1 << osEvt,
48894   everyEvent = 0xFFFF
48895 };
48896
48897 enum {
48898   charCodeMask = 0x000000FF,
48899   keyCodeMask = 0x0000FF00,
48900   adbAddrMask = 0x00FF0000,
48901   osEvtMessageMask = (unsigned long)0xFF000000
48902 };
48903
48904 enum {
48905
48906   mouseMovedMessage = 0x00FA,
48907   suspendResumeMessage = 0x0001
48908 };
48909
48910 enum {
48911   resumeFlag = 1
48912 };
48913 typedef UInt16 EventModifiers;
48914 enum {
48915
48916   activeFlagBit = 0,
48917   btnStateBit = 7,
48918   cmdKeyBit = 8,
48919   shiftKeyBit = 9,
48920   alphaLockBit = 10,
48921   optionKeyBit = 11,
48922   controlKeyBit = 12,
48923   rightShiftKeyBit = 13,
48924   rightOptionKeyBit = 14,
48925   rightControlKeyBit = 15
48926 };
48927
48928 enum {
48929   activeFlag = 1 << activeFlagBit,
48930   btnState = 1 << btnStateBit,
48931   cmdKey = 1 << cmdKeyBit,
48932   shiftKey = 1 << shiftKeyBit,
48933   alphaLock = 1 << alphaLockBit,
48934   optionKey = 1 << optionKeyBit,
48935   controlKey = 1 << controlKeyBit,
48936   rightShiftKey = 1 << rightShiftKeyBit,
48937   rightOptionKey = 1 << rightOptionKeyBit,
48938   rightControlKey = 1 << rightControlKeyBit
48939 };
48940
48941
48942 enum {
48943   kNullCharCode = 0,
48944   kHomeCharCode = 1,
48945   kEnterCharCode = 3,
48946   kEndCharCode = 4,
48947   kHelpCharCode = 5,
48948   kBellCharCode = 7,
48949   kBackspaceCharCode = 8,
48950   kTabCharCode = 9,
48951   kLineFeedCharCode = 10,
48952   kVerticalTabCharCode = 11,
48953   kPageUpCharCode = 11,
48954   kFormFeedCharCode = 12,
48955   kPageDownCharCode = 12,
48956   kReturnCharCode = 13,
48957   kFunctionKeyCharCode = 16,
48958   kCommandCharCode = 17,
48959   kCheckCharCode = 18,
48960   kDiamondCharCode = 19,
48961   kAppleLogoCharCode = 20,
48962   kEscapeCharCode = 27,
48963   kClearCharCode = 27,
48964   kLeftArrowCharCode = 28,
48965   kRightArrowCharCode = 29,
48966   kUpArrowCharCode = 30,
48967   kDownArrowCharCode = 31,
48968   kSpaceCharCode = 32,
48969   kDeleteCharCode = 127,
48970   kBulletCharCode = 165,
48971   kNonBreakingSpaceCharCode = 202
48972 };
48973
48974
48975 enum {
48976   kShiftUnicode = 0x21E7,
48977   kControlUnicode = 0x2303,
48978   kOptionUnicode = 0x2325,
48979   kCommandUnicode = 0x2318,
48980   kPencilUnicode = 0x270E,
48981   kCheckUnicode = 0x2713,
48982   kDiamondUnicode = 0x25C6,
48983   kBulletUnicode = 0x2022,
48984   kAppleLogoUnicode = 0xF8FF
48985 };
48986
48987 struct EventRecord {
48988   EventKind what;
48989   UInt32 message;
48990   UInt32 when;
48991   Point where;
48992   EventModifiers modifiers;
48993 };
48994 typedef struct EventRecord EventRecord;
48995 typedef void ( * FKEYProcPtr)(void);
48996 typedef FKEYProcPtr FKEYUPP;
48997 extern void
48998 GetMouse(Point * mouseLoc) ;
48999 extern Boolean
49000 Button(void) ;
49001 extern Boolean
49002 StillDown(void) ;
49003 extern Boolean
49004 WaitMouseUp(void) ;
49005 extern UInt32
49006 KeyTranslate(
49007   const void * transData,
49008   UInt16 keycode,
49009   UInt32 * state) ;
49010 extern UInt32
49011 GetCaretTime(void) ;
49012 typedef BigEndianLong KeyMap[4];
49013
49014
49015 typedef UInt8 KeyMapByteArray[16];
49016 extern void
49017 GetKeys(KeyMap theKeys) ;
49018
49019
49020
49021 enum {
49022   networkEvt = 10,
49023   driverEvt = 11,
49024   app1Evt = 12,
49025   app2Evt = 13,
49026   app3Evt = 14,
49027   app4Evt = 15,
49028   networkMask = 0x0400,
49029   driverMask = 0x0800,
49030   app1Mask = 0x1000,
49031   app2Mask = 0x2000,
49032   app3Mask = 0x4000,
49033   app4Mask = 0x8000
49034 };
49035
49036 struct EvQEl {
49037   QElemPtr qLink;
49038   SInt16 qType;
49039   EventKind evtQWhat;
49040   UInt32 evtQMessage;
49041   UInt32 evtQWhen;
49042   Point evtQWhere;
49043   EventModifiers evtQModifiers;
49044 };
49045 typedef struct EvQEl EvQEl;
49046 typedef EvQEl * EvQElPtr;
49047 typedef void ( * GetNextEventFilterProcPtr)(EventRecord *theEvent, Boolean *result);
49048 typedef GetNextEventFilterProcPtr GetNextEventFilterUPP;
49049 typedef GetNextEventFilterUPP GNEFilterUPP;
49050 extern UInt32
49051 GetDblTime(void) ;
49052 extern void
49053 SetEventMask(EventMask value) ;
49054 extern Boolean
49055 GetNextEvent(
49056   EventMask eventMask,
49057   EventRecord * theEvent) ;
49058 extern Boolean
49059 WaitNextEvent(
49060   EventMask eventMask,
49061   EventRecord * theEvent,
49062   UInt32 sleep,
49063   RgnHandle mouseRgn) ;
49064 extern Boolean
49065 EventAvail(
49066   EventMask eventMask,
49067   EventRecord * theEvent) ;
49068 extern OSErr
49069 PostEvent(
49070   EventKind eventNum,
49071   UInt32 eventMsg) ;
49072 extern void
49073 FlushEvents(
49074   EventMask whichMask,
49075   EventMask stopMask) ;
49076 extern void
49077 GetGlobalMouse(Point * globalMouse) ;
49078 extern UInt32
49079 GetCurrentKeyModifiers(void) ;
49080 extern Boolean
49081 CheckEventQueueForUserCancel(void) ;
49082 extern void
49083 KeyScript(short code) ;
49084 extern Boolean
49085 IsCmdChar(
49086   const EventRecord * event,
49087   short test) ;
49088 extern SInt16
49089 LMGetKeyThresh(void) ;
49090 extern void
49091 LMSetKeyThresh(SInt16 value) ;
49092 extern SInt16
49093 LMGetKeyRepThresh(void) ;
49094 extern void
49095 LMSetKeyRepThresh(SInt16 value) ;
49096 extern UInt8
49097 LMGetKbdLast(void) ;
49098 extern void
49099 LMSetKbdLast(UInt8 value) ;
49100 extern UInt8
49101 LMGetKbdType(void) ;
49102 extern void
49103 LMSetKbdType(UInt8 value) ;
49104
49105
49106
49107
49108
49109 }
49110 extern "C" {
49111
49112
49113 enum {
49114   noMark = 0
49115 };
49116 enum {
49117
49118   kMenuDrawMsg = 0,
49119   kMenuSizeMsg = 2,
49120   kMenuPopUpMsg = 3,
49121   kMenuCalcItemMsg = 5,
49122   kMenuThemeSavvyMsg = 7,
49123   mDrawMsg = 0,
49124   mSizeMsg = 2,
49125   mPopUpMsg = 3,
49126   mCalcItemMsg = 5
49127 };
49128 enum {
49129   kThemeSavvyMenuResponse = 0x7473
49130 };
49131
49132
49133 enum {
49134   kMenuInitMsg = 8,
49135   kMenuDisposeMsg = 9,
49136   kMenuFindItemMsg = 10,
49137   kMenuHiliteItemMsg = 11,
49138   kMenuDrawItemsMsg = 12
49139 };
49140
49141 enum {
49142   textMenuProc = 0,
49143   hMenuCmd = 27,
49144   hierMenu = -1,
49145   kInsertHierarchicalMenu = -1,
49146   mctAllItems = -98,
49147   mctLastIDIndic = -99
49148 };
49149
49150
49151 enum {
49152   kMenuStdMenuProc = 63,
49153   kMenuStdMenuBarProc = 63
49154 };
49155
49156
49157 enum {
49158   kMenuNoModifiers = 0,
49159   kMenuShiftModifier = (1 << 0),
49160   kMenuOptionModifier = (1 << 1),
49161   kMenuControlModifier = (1 << 2),
49162   kMenuNoCommandModifier = (1 << 3)
49163 };
49164
49165
49166 enum {
49167   kMenuNoIcon = 0,
49168   kMenuIconType = 1,
49169   kMenuShrinkIconType = 2,
49170   kMenuSmallIconType = 3,
49171   kMenuColorIconType = 4,
49172   kMenuIconSuiteType = 5,
49173   kMenuIconRefType = 6,
49174   kMenuCGImageRefType = 7,
49175   kMenuSystemIconSelectorType = 8,
49176   kMenuIconResourceType = 9
49177 };
49178
49179
49180 enum {
49181   kMenuNullGlyph = 0x00,
49182   kMenuTabRightGlyph = 0x02,
49183   kMenuTabLeftGlyph = 0x03,
49184   kMenuEnterGlyph = 0x04,
49185   kMenuShiftGlyph = 0x05,
49186   kMenuControlGlyph = 0x06,
49187   kMenuOptionGlyph = 0x07,
49188   kMenuSpaceGlyph = 0x09,
49189   kMenuDeleteRightGlyph = 0x0A,
49190   kMenuReturnGlyph = 0x0B,
49191   kMenuReturnR2LGlyph = 0x0C,
49192   kMenuNonmarkingReturnGlyph = 0x0D,
49193   kMenuPencilGlyph = 0x0F,
49194   kMenuDownwardArrowDashedGlyph = 0x10,
49195   kMenuCommandGlyph = 0x11,
49196   kMenuCheckmarkGlyph = 0x12,
49197   kMenuDiamondGlyph = 0x13,
49198   kMenuAppleLogoFilledGlyph = 0x14,
49199   kMenuParagraphKoreanGlyph = 0x15,
49200   kMenuDeleteLeftGlyph = 0x17,
49201   kMenuLeftArrowDashedGlyph = 0x18,
49202   kMenuUpArrowDashedGlyph = 0x19,
49203   kMenuRightArrowDashedGlyph = 0x1A,
49204   kMenuEscapeGlyph = 0x1B,
49205   kMenuClearGlyph = 0x1C,
49206   kMenuLeftDoubleQuotesJapaneseGlyph = 0x1D,
49207   kMenuRightDoubleQuotesJapaneseGlyph = 0x1E,
49208   kMenuTrademarkJapaneseGlyph = 0x1F,
49209   kMenuBlankGlyph = 0x61,
49210   kMenuPageUpGlyph = 0x62,
49211   kMenuCapsLockGlyph = 0x63,
49212   kMenuLeftArrowGlyph = 0x64,
49213   kMenuRightArrowGlyph = 0x65,
49214   kMenuNorthwestArrowGlyph = 0x66,
49215   kMenuHelpGlyph = 0x67,
49216   kMenuUpArrowGlyph = 0x68,
49217   kMenuSoutheastArrowGlyph = 0x69,
49218   kMenuDownArrowGlyph = 0x6A,
49219   kMenuPageDownGlyph = 0x6B,
49220   kMenuAppleLogoOutlineGlyph = 0x6C,
49221   kMenuContextualMenuGlyph = 0x6D,
49222   kMenuPowerGlyph = 0x6E,
49223   kMenuF1Glyph = 0x6F,
49224   kMenuF2Glyph = 0x70,
49225   kMenuF3Glyph = 0x71,
49226   kMenuF4Glyph = 0x72,
49227   kMenuF5Glyph = 0x73,
49228   kMenuF6Glyph = 0x74,
49229   kMenuF7Glyph = 0x75,
49230   kMenuF8Glyph = 0x76,
49231   kMenuF9Glyph = 0x77,
49232   kMenuF10Glyph = 0x78,
49233   kMenuF11Glyph = 0x79,
49234   kMenuF12Glyph = 0x7A,
49235   kMenuF13Glyph = 0x87,
49236   kMenuF14Glyph = 0x88,
49237   kMenuF15Glyph = 0x89,
49238   kMenuControlISOGlyph = 0x8A,
49239   kMenuEjectGlyph = 0x8C
49240 };
49241 typedef UInt32 MenuAttributes;
49242 enum {
49243
49244
49245
49246
49247
49248   kMenuAttrExcludesMarkColumn = (1 << 0),
49249
49250
49251
49252
49253
49254   kMenuAttrAutoDisable = (1 << 2),
49255
49256
49257
49258
49259
49260
49261
49262   kMenuAttrUsePencilGlyph = (1 << 3),
49263   kMenuAttrHidden = (1 << 4)
49264 };
49265 typedef UInt32 MenuItemAttributes;
49266 enum {
49267
49268
49269
49270
49271   kMenuItemAttrDisabled = (1 << 0),
49272
49273
49274
49275
49276   kMenuItemAttrIconDisabled = (1 << 1),
49277
49278
49279
49280
49281   kMenuItemAttrSubmenuParentChoosable = (1 << 2),
49282
49283
49284
49285
49286   kMenuItemAttrDynamic = (1 << 3),
49287
49288
49289
49290
49291
49292   kMenuItemAttrNotPreviousAlternate = (1 << 4),
49293
49294
49295
49296
49297
49298
49299   kMenuItemAttrHidden = (1 << 5),
49300
49301
49302
49303
49304   kMenuItemAttrSeparator = (1 << 6),
49305
49306
49307
49308
49309
49310   kMenuItemAttrSectionHeader = (1 << 7),
49311
49312
49313
49314
49315
49316   kMenuItemAttrIgnoreMeta = (1 << 8),
49317
49318
49319
49320
49321
49322   kMenuItemAttrAutoRepeat = (1 << 9),
49323
49324
49325
49326
49327
49328
49329   kMenuItemAttrUseVirtualKey = (1 << 10),
49330
49331
49332
49333
49334
49335
49336
49337   kMenuItemAttrCustomDraw = (1 << 11),
49338   kMenuItemAttrIncludeInCmdKeyMatching = (1 << 12)
49339 };
49340 typedef UInt32 MenuTrackingMode;
49341 enum {
49342
49343
49344
49345
49346   kMenuTrackingModeMouse = 1,
49347
49348
49349
49350
49351   kMenuTrackingModeKeyboard = 2
49352 };
49353 typedef UInt32 MenuEventOptions;
49354 enum {
49355
49356
49357
49358
49359   kMenuEventIncludeDisabledItems = 0x0001,
49360
49361
49362
49363
49364   kMenuEventQueryOnly = 0x0002,
49365
49366
49367
49368
49369   kMenuEventDontCheckSubmenus = 0x0004
49370 };
49371
49372
49373
49374
49375 typedef SInt16 MenuID;
49376 typedef UInt16 MenuItemIndex;
49377 typedef UInt32 MenuCommand;
49378 typedef struct OpaqueMenuRef* MenuRef;
49379
49380 typedef MenuRef MenuHandle;
49381 typedef Handle MenuBarHandle;
49382 struct MenuBarHeader {
49383
49384
49385
49386
49387
49388   UInt16 lastMenu;
49389
49390
49391
49392
49393
49394   SInt16 lastRight;
49395
49396
49397
49398
49399
49400   SInt16 mbResID;
49401 };
49402 typedef struct MenuBarHeader MenuBarHeader;
49403 struct HMenuBarHeader {
49404
49405
49406
49407
49408
49409   UInt16 lastHMenu;
49410
49411
49412
49413
49414
49415   PixMapHandle menuTitleBits;
49416 };
49417 typedef struct HMenuBarHeader HMenuBarHeader;
49418 struct MenuBarMenu {
49419
49420
49421
49422
49423   MenuRef menu;
49424
49425
49426
49427
49428
49429   SInt16 menuLeft;
49430 };
49431 typedef struct MenuBarMenu MenuBarMenu;
49432 struct HMenuBarMenu {
49433
49434
49435
49436
49437   MenuRef menu;
49438
49439
49440
49441
49442   SInt16 reserved;
49443 };
49444 typedef struct HMenuBarMenu HMenuBarMenu;
49445 struct MCEntry {
49446   MenuID mctID;
49447   short mctItem;
49448   RGBColor mctRGB1;
49449   RGBColor mctRGB2;
49450   RGBColor mctRGB3;
49451   RGBColor mctRGB4;
49452   short mctReserved;
49453 };
49454 typedef struct MCEntry MCEntry;
49455 typedef MCEntry * MCEntryPtr;
49456 typedef MCEntry MCTable[1];
49457 typedef MCEntry * MCTablePtr;
49458 typedef MCTablePtr * MCTableHandle;
49459 struct MenuCRsrc {
49460   short numEntries;
49461   MCTable mcEntryRecs;
49462 };
49463 typedef struct MenuCRsrc MenuCRsrc;
49464 typedef MenuCRsrc * MenuCRsrcPtr;
49465 typedef MenuCRsrcPtr * MenuCRsrcHandle;
49466 struct MenuTrackingData {
49467   MenuRef menu;
49468   MenuItemIndex itemSelected;
49469   MenuItemIndex itemUnderMouse;
49470   Rect itemRect;
49471   SInt32 virtualMenuTop;
49472   SInt32 virtualMenuBottom;
49473 };
49474 typedef struct MenuTrackingData MenuTrackingData;
49475 typedef MenuTrackingData * MenuTrackingDataPtr;
49476 struct MDEFHiliteItemData {
49477
49478
49479
49480
49481
49482   MenuItemIndex previousItem;
49483
49484
49485
49486
49487
49488   MenuItemIndex newItem;
49489
49490
49491
49492
49493
49494   void * context;
49495 };
49496 typedef struct MDEFHiliteItemData MDEFHiliteItemData;
49497 typedef MDEFHiliteItemData * MDEFHiliteItemDataPtr;
49498 typedef MDEFHiliteItemData HiliteMenuItemData;
49499 typedef MDEFHiliteItemDataPtr HiliteMenuItemDataPtr;
49500 struct MDEFDrawData {
49501
49502
49503
49504
49505
49506
49507   MenuTrackingData trackingData;
49508
49509
49510
49511
49512
49513   void * context;
49514 };
49515 typedef struct MDEFDrawData MDEFDrawData;
49516 typedef MDEFDrawData * MDEFDrawDataPtr;
49517 struct MDEFFindItemData {
49518
49519
49520
49521
49522
49523
49524   MenuTrackingData trackingData;
49525
49526
49527
49528
49529
49530
49531   void * context;
49532 };
49533 typedef struct MDEFFindItemData MDEFFindItemData;
49534 typedef MDEFFindItemData * MDEFFindItemDataPtr;
49535 struct MDEFDrawItemsData {
49536
49537
49538
49539
49540   MenuItemIndex firstItem;
49541
49542
49543
49544
49545   MenuItemIndex lastItem;
49546
49547
49548
49549
49550
49551
49552   MenuTrackingData * trackingData;
49553
49554
49555
49556
49557
49558   void * context;
49559 };
49560 typedef struct MDEFDrawItemsData MDEFDrawItemsData;
49561 typedef MDEFDrawItemsData * MDEFDrawItemsDataPtr;
49562 enum {
49563   kMenuItemDataText = (1 << 0),
49564
49565
49566
49567
49568
49569   kMenuItemDataMark = (1 << 1),
49570
49571
49572
49573
49574
49575   kMenuItemDataCmdKey = (1 << 2),
49576
49577
49578
49579
49580
49581   kMenuItemDataCmdKeyGlyph = (1 << 3),
49582
49583
49584
49585
49586
49587   kMenuItemDataCmdKeyModifiers = (1 << 4),
49588
49589
49590
49591
49592
49593   kMenuItemDataStyle = (1 << 5),
49594
49595
49596
49597
49598
49599
49600   kMenuItemDataEnabled = (1 << 6),
49601
49602
49603
49604
49605
49606   kMenuItemDataIconEnabled = (1 << 7),
49607
49608
49609
49610
49611
49612   kMenuItemDataIconID = (1 << 8),
49613   kMenuItemDataIconHandle = (1 << 9),
49614
49615
49616
49617
49618
49619   kMenuItemDataCommandID = (1 << 10),
49620
49621
49622
49623
49624
49625   kMenuItemDataTextEncoding = (1 << 11),
49626   kMenuItemDataSubmenuID = (1 << 12),
49627   kMenuItemDataSubmenuHandle = (1 << 13),
49628   kMenuItemDataFontID = (1 << 14),
49629   kMenuItemDataRefcon = (1 << 15),
49630   kMenuItemDataAttributes = (1 << 16),
49631   kMenuItemDataCFString = (1 << 17),
49632   kMenuItemDataProperties = (1 << 18),
49633
49634
49635
49636
49637
49638   kMenuItemDataIndent = (1 << 19),
49639
49640
49641
49642
49643
49644
49645
49646   kMenuItemDataCmdVirtualKey = (1 << 20),
49647   kMenuItemDataAllDataVersionOne = 0x000FFFFF,
49648   kMenuItemDataAllDataVersionTwo = kMenuItemDataAllDataVersionOne | kMenuItemDataCmdVirtualKey
49649 };
49650
49651 enum {
49652   kMenuItemDataAllData = kMenuItemDataAllDataVersionTwo
49653 };
49654
49655 typedef UInt64 MenuItemDataFlags;
49656 struct MenuItemDataRec {
49657   MenuItemDataFlags whichData;
49658   StringPtr text;
49659   UniChar mark;
49660   UniChar cmdKey;
49661   UInt32 cmdKeyGlyph;
49662   UInt32 cmdKeyModifiers;
49663   Style style;
49664   Boolean enabled;
49665   Boolean iconEnabled;
49666   UInt8 filler1;
49667   SInt32 iconID;
49668   UInt32 iconType;
49669   Handle iconHandle;
49670   MenuCommand cmdID;
49671   TextEncoding encoding;
49672   MenuID submenuID;
49673   MenuRef submenuHandle;
49674   SInt32 fontID;
49675   UInt32 refcon;
49676   OptionBits attr;
49677   CFStringRef cfText;
49678   Collection properties;
49679   UInt32 indent;
49680   UInt16 cmdVirtualKey;
49681 };
49682 typedef struct MenuItemDataRec MenuItemDataRec;
49683 typedef MenuItemDataRec * MenuItemDataPtr;
49684 typedef UInt32 MenuItemID;
49685
49686
49687
49688
49689
49690
49691 typedef void ( * MenuDefProcPtr)(short message, MenuRef theMenu, Rect *menuRect, Point hitPt, short *whichItem);
49692 typedef MenuDefProcPtr MenuDefUPP;
49693 extern MenuDefUPP
49694 NewMenuDefUPP(MenuDefProcPtr userRoutine) ;
49695 extern void
49696 DisposeMenuDefUPP(MenuDefUPP userUPP) ;
49697 extern void
49698 InvokeMenuDefUPP(
49699   short message,
49700   MenuRef theMenu,
49701   Rect * menuRect,
49702   Point hitPt,
49703   short * whichItem,
49704   MenuDefUPP userUPP) ;
49705
49706 typedef long ( * MenuBarDefProcPtr)(short selector, short message, short parameter1, long parameter2);
49707 typedef void ( * MenuHookProcPtr)(void);
49708 typedef short ( * MBarHookProcPtr)(Rect * menuRect);
49709 typedef MenuBarDefProcPtr MenuBarDefUPP;
49710 typedef MenuHookProcPtr MenuHookUPP;
49711 typedef MBarHookProcPtr MBarHookUPP;
49712 enum {
49713   kMenuDefProcPtr = 0
49714 };
49715
49716 typedef UInt32 MenuDefType;
49717 enum {
49718   kMenuDefObjectClass = 1
49719 };
49720
49721 typedef struct OpaqueMenuLayoutRef* MenuLayoutRef;
49722 struct MenuDefSpec {
49723   MenuDefType defType;
49724   union {
49725     MenuDefUPP defProc;
49726   } u;
49727 };
49728 typedef struct MenuDefSpec MenuDefSpec;
49729 typedef MenuDefSpec * MenuDefSpecPtr;
49730 extern MenuRef
49731 NewMenu(
49732   MenuID menuID,
49733   ConstStr255Param menuTitle) ;
49734 extern MenuRef
49735 GetMenu(short resourceID) ;
49736 extern void
49737 DisposeMenu(MenuRef theMenu) ;
49738 extern void
49739 CalcMenuSize(MenuRef theMenu) ;
49740 extern UInt16
49741 CountMenuItems(MenuRef theMenu) ;
49742 extern OSStatus
49743 GetMenuFont(
49744   MenuRef menu,
49745   SInt16 * outFontID,
49746   UInt16 * outFontSize) ;
49747 extern OSStatus
49748 SetMenuFont(
49749   MenuRef menu,
49750   SInt16 inFontID,
49751   UInt16 inFontSize) ;
49752 extern Boolean
49753 GetMenuExcludesMarkColumn(MenuRef menu) ;
49754 extern OSStatus
49755 SetMenuExcludesMarkColumn(
49756   MenuRef menu,
49757   Boolean excludesMark) ;
49758 extern OSStatus
49759 RegisterMenuDefinition(
49760   SInt16 inResID,
49761   MenuDefSpecPtr inDefSpec) ;
49762 extern OSStatus
49763 CreateNewMenu(
49764   MenuID inMenuID,
49765   MenuAttributes inMenuAttributes,
49766   MenuRef * outMenuRef) ;
49767 extern OSStatus
49768 CreateCustomMenu(
49769   const MenuDefSpec * inDefSpec,
49770   MenuID inMenuID,
49771   MenuAttributes inMenuAttributes,
49772   MenuRef * outMenuRef) ;
49773 extern Boolean
49774 IsValidMenu(MenuRef inMenu) ;
49775 extern ItemCount
49776 GetMenuRetainCount(MenuRef inMenu) ;
49777 extern OSStatus
49778 RetainMenu(MenuRef inMenu) ;
49779 extern OSStatus
49780 ReleaseMenu(MenuRef inMenu) ;
49781 extern OSStatus
49782 DuplicateMenu(
49783   MenuRef inSourceMenu,
49784   MenuRef * outMenu) ;
49785 extern OSStatus
49786 CopyMenuTitleAsCFString(
49787   MenuRef inMenu,
49788   CFStringRef * outString) ;
49789 extern OSStatus
49790 SetMenuTitleWithCFString(
49791   MenuRef inMenu,
49792   CFStringRef inString) ;
49793 extern OSStatus
49794 SetMenuTitleIcon(
49795   MenuRef inMenu,
49796   UInt32 inType,
49797   void * inIcon) ;
49798 extern OSStatus
49799 GetMenuTitleIcon(
49800   MenuRef inMenu,
49801   UInt32 * outType,
49802   void ** outIcon) ;
49803 extern OSStatus
49804 InvalidateMenuSize(MenuRef inMenu) ;
49805 extern Boolean
49806 IsMenuSizeInvalid(MenuRef inMenu) ;
49807 extern OSStatus
49808 EraseMenuBackground(
49809   MenuRef inMenu,
49810   const Rect * inEraseRect,
49811   CGContextRef inContext) ;
49812 extern OSStatus
49813 ScrollMenuImage(
49814   MenuRef inMenu,
49815   const Rect * inScrollRect,
49816   int inHScroll,
49817   int inVScroll,
49818   CGContextRef inContext) ;
49819 extern void
49820 AppendMenu(
49821   MenuRef menu,
49822   ConstStr255Param data) ;
49823 extern void
49824 InsertResMenu(
49825   MenuRef theMenu,
49826   ResType theType,
49827   short afterItem) ;
49828 extern void
49829 AppendResMenu(
49830   MenuRef theMenu,
49831   ResType theType) ;
49832 extern void
49833 InsertMenuItem(
49834   MenuRef theMenu,
49835   ConstStr255Param itemString,
49836   short afterItem) ;
49837 extern void
49838 DeleteMenuItem(
49839   MenuRef theMenu,
49840   short item) ;
49841 extern void
49842 InsertFontResMenu(
49843   MenuRef theMenu,
49844   short afterItem,
49845   short scriptFilter) ;
49846 extern void
49847 InsertIntlResMenu(
49848   MenuRef theMenu,
49849   ResType theType,
49850   short afterItem,
49851   short scriptFilter) ;
49852 extern OSStatus
49853 AppendMenuItemText(
49854   MenuRef menu,
49855   ConstStr255Param inString) ;
49856 extern OSStatus
49857 InsertMenuItemText(
49858   MenuRef menu,
49859   ConstStr255Param inString,
49860   MenuItemIndex afterItem) ;
49861 extern OSStatus
49862 CopyMenuItems(
49863   MenuRef inSourceMenu,
49864   MenuItemIndex inFirstItem,
49865   ItemCount inNumItems,
49866   MenuRef inDestMenu,
49867   MenuItemIndex inInsertAfter) ;
49868 extern OSStatus
49869 DeleteMenuItems(
49870   MenuRef inMenu,
49871   MenuItemIndex inFirstItem,
49872   ItemCount inNumItems) ;
49873 extern OSStatus
49874 AppendMenuItemTextWithCFString(
49875   MenuRef inMenu,
49876   CFStringRef inString,
49877   MenuItemAttributes inAttributes,
49878   MenuCommand inCommandID,
49879   MenuItemIndex * outNewItem) ;
49880 extern OSStatus
49881 InsertMenuItemTextWithCFString(
49882   MenuRef inMenu,
49883   CFStringRef inString,
49884   MenuItemIndex inAfterItem,
49885   MenuItemAttributes inAttributes,
49886   MenuCommand inCommandID) ;
49887 extern long
49888 MenuKey(CharParameter ch) ;
49889 extern long
49890 MenuSelect(Point startPt) ;
49891 extern long
49892 PopUpMenuSelect(
49893   MenuRef menu,
49894   short top,
49895   short left,
49896   short popUpItem) ;
49897 extern long
49898 MenuChoice(void) ;
49899 extern UInt32
49900 MenuEvent(const EventRecord * inEvent) ;
49901 extern Boolean
49902 IsMenuKeyEvent(
49903   MenuRef inStartMenu,
49904   EventRef inEvent,
49905   MenuEventOptions inOptions,
49906   MenuRef * outMenu,
49907   MenuItemIndex * outMenuItem) ;
49908 extern OSStatus
49909 InvalidateMenuEnabling(MenuRef inMenu) ;
49910 extern short
49911 GetMBarHeight(void) ;
49912 extern void
49913 DrawMenuBar(void) ;
49914 extern void
49915 InvalMenuBar(void) ;
49916 extern Boolean
49917 IsMenuBarInvalid(MenuRef rootMenu) ;
49918 extern void
49919 HiliteMenu(MenuID menuID) ;
49920 extern MenuBarHandle
49921 GetNewMBar(short menuBarID) ;
49922 extern MenuBarHandle
49923 GetMenuBar(void) ;
49924 extern void
49925 SetMenuBar(MenuBarHandle mbar) ;
49926 extern OSStatus
49927 DuplicateMenuBar(
49928   MenuBarHandle inMbar,
49929   MenuBarHandle * outMbar) ;
49930 extern OSStatus
49931 DisposeMenuBar(MenuBarHandle inMbar) ;
49932 extern MenuRef
49933 GetMenuHandle(MenuID menuID) ;
49934 extern void
49935 InsertMenu(
49936   MenuRef theMenu,
49937   MenuID beforeID) ;
49938 extern void
49939 DeleteMenu(MenuID menuID) ;
49940 extern void
49941 ClearMenuBar(void) ;
49942 extern void
49943 SetMenuFlashCount(short count) ;
49944 extern void
49945 FlashMenuBar(MenuID menuID) ;
49946 extern Boolean
49947 IsMenuBarVisible(void) ;
49948 extern void
49949 ShowMenuBar(void) ;
49950 extern void
49951 HideMenuBar(void) ;
49952 extern MenuRef
49953 AcquireRootMenu(void) ;
49954 extern OSStatus
49955 SetRootMenu(MenuRef inMenu) ;
49956 extern void
49957 CheckMenuItem(
49958   MenuRef theMenu,
49959   short item,
49960   Boolean checked) ;
49961 extern void
49962 SetMenuItemText(
49963   MenuRef theMenu,
49964   short item,
49965   ConstStr255Param itemString) ;
49966 extern void
49967 GetMenuItemText(
49968   MenuRef theMenu,
49969   short item,
49970   Str255 itemString) ;
49971 extern void
49972 SetItemMark(
49973   MenuRef theMenu,
49974   short item,
49975   CharParameter markChar) ;
49976 extern void
49977 GetItemMark(
49978   MenuRef theMenu,
49979   short item,
49980   CharParameter * markChar) ;
49981 extern void
49982 SetItemCmd(
49983   MenuRef theMenu,
49984   short item,
49985   CharParameter cmdChar) ;
49986 extern void
49987 GetItemCmd(
49988   MenuRef theMenu,
49989   short item,
49990   CharParameter * cmdChar) ;
49991 extern void
49992 SetItemIcon(
49993   MenuRef theMenu,
49994   short item,
49995   short iconIndex) ;
49996 extern void
49997 GetItemIcon(
49998   MenuRef theMenu,
49999   short item,
50000   short * iconIndex) ;
50001 extern void
50002 SetItemStyle(
50003   MenuRef theMenu,
50004   short item,
50005   StyleParameter chStyle) ;
50006 extern void
50007 GetItemStyle(
50008   MenuRef theMenu,
50009   short item,
50010   Style * chStyle) ;
50011 extern OSErr
50012 SetMenuItemCommandID(
50013   MenuRef inMenu,
50014   SInt16 inItem,
50015   MenuCommand inCommandID) ;
50016 extern OSErr
50017 GetMenuItemCommandID(
50018   MenuRef inMenu,
50019   SInt16 inItem,
50020   MenuCommand * outCommandID) ;
50021 extern OSErr
50022 SetMenuItemModifiers(
50023   MenuRef inMenu,
50024   SInt16 inItem,
50025   UInt8 inModifiers) ;
50026 extern OSErr
50027 GetMenuItemModifiers(
50028   MenuRef inMenu,
50029   SInt16 inItem,
50030   UInt8 * outModifiers) ;
50031 extern OSErr
50032 SetMenuItemIconHandle(
50033   MenuRef inMenu,
50034   SInt16 inItem,
50035   UInt8 inIconType,
50036   Handle inIconHandle) ;
50037 extern OSErr
50038 GetMenuItemIconHandle(
50039   MenuRef inMenu,
50040   SInt16 inItem,
50041   UInt8 * outIconType,
50042   Handle * outIconHandle) ;
50043 extern OSErr
50044 SetMenuItemTextEncoding(
50045   MenuRef inMenu,
50046   SInt16 inItem,
50047   TextEncoding inScriptID) ;
50048 extern OSErr
50049 GetMenuItemTextEncoding(
50050   MenuRef inMenu,
50051   SInt16 inItem,
50052   TextEncoding * outScriptID) ;
50053 extern OSErr
50054 SetMenuItemHierarchicalID(
50055   MenuRef inMenu,
50056   SInt16 inItem,
50057   MenuID inHierID) ;
50058 extern OSErr
50059 GetMenuItemHierarchicalID(
50060   MenuRef inMenu,
50061   SInt16 inItem,
50062   MenuID * outHierID) ;
50063 extern OSErr
50064 SetMenuItemFontID(
50065   MenuRef inMenu,
50066   SInt16 inItem,
50067   SInt16 inFontID) ;
50068 extern OSErr
50069 GetMenuItemFontID(
50070   MenuRef inMenu,
50071   SInt16 inItem,
50072   SInt16 * outFontID) ;
50073 extern OSErr
50074 SetMenuItemRefCon(
50075   MenuRef inMenu,
50076   SInt16 inItem,
50077   UInt32 inRefCon) ;
50078 extern OSErr
50079 GetMenuItemRefCon(
50080   MenuRef inMenu,
50081   SInt16 inItem,
50082   UInt32 * outRefCon) ;
50083 extern OSErr
50084 SetMenuItemKeyGlyph(
50085   MenuRef inMenu,
50086   SInt16 inItem,
50087   SInt16 inGlyph) ;
50088 extern OSErr
50089 GetMenuItemKeyGlyph(
50090   MenuRef inMenu,
50091   SInt16 inItem,
50092   SInt16 * outGlyph) ;
50093 extern void
50094 EnableMenuItem(
50095   MenuRef theMenu,
50096   MenuItemIndex item) ;
50097 extern void
50098 DisableMenuItem(
50099   MenuRef theMenu,
50100   MenuItemIndex item) ;
50101 extern Boolean
50102 IsMenuItemEnabled(
50103   MenuRef menu,
50104   MenuItemIndex item) ;
50105 extern void
50106 EnableMenuItemIcon(
50107   MenuRef theMenu,
50108   MenuItemIndex item) ;
50109 extern void
50110 DisableMenuItemIcon(
50111   MenuRef theMenu,
50112   MenuItemIndex item) ;
50113 extern Boolean
50114 IsMenuItemIconEnabled(
50115   MenuRef menu,
50116   MenuItemIndex item) ;
50117 extern OSStatus
50118 SetMenuItemHierarchicalMenu(
50119   MenuRef inMenu,
50120   MenuItemIndex inItem,
50121   MenuRef inHierMenu) ;
50122 extern OSStatus
50123 GetMenuItemHierarchicalMenu(
50124   MenuRef inMenu,
50125   MenuItemIndex inItem,
50126   MenuRef * outHierMenu) ;
50127 extern OSStatus
50128 CopyMenuItemTextAsCFString(
50129   MenuRef inMenu,
50130   MenuItemIndex inItem,
50131   CFStringRef * outString) ;
50132 extern OSStatus
50133 SetMenuItemTextWithCFString(
50134   MenuRef inMenu,
50135   MenuItemIndex inItem,
50136   CFStringRef inString) ;
50137 extern OSStatus
50138 GetMenuItemIndent(
50139   MenuRef inMenu,
50140   MenuItemIndex inItem,
50141   UInt32 * outIndent) ;
50142 extern OSStatus
50143 SetMenuItemIndent(
50144   MenuRef inMenu,
50145   MenuItemIndex inItem,
50146   UInt32 inIndent) ;
50147 extern OSStatus
50148 GetMenuItemCommandKey(
50149   MenuRef inMenu,
50150   MenuItemIndex inItem,
50151   Boolean inGetVirtualKey,
50152   UInt16 * outKey) ;
50153 extern OSStatus
50154 SetMenuItemCommandKey(
50155   MenuRef inMenu,
50156   MenuItemIndex inItem,
50157   Boolean inSetVirtualKey,
50158   UInt16 inKey) ;
50159 extern void
50160 DeleteMCEntries(
50161   MenuID menuID,
50162   short menuItem) ;
50163 extern MCTableHandle
50164 GetMCInfo(void) ;
50165 extern void
50166 SetMCInfo(MCTableHandle menuCTbl) ;
50167 extern void
50168 DisposeMCInfo(MCTableHandle menuCTbl) ;
50169 extern MCEntryPtr
50170 GetMCEntry(
50171   MenuID menuID,
50172   short menuItem) ;
50173 extern void
50174 SetMCEntries(
50175   short numEntries,
50176   MCTablePtr menuCEntries) ;
50177 enum {
50178   kMenuPropertyPersistent = 0x00000001
50179 };
50180 extern OSStatus
50181 GetMenuItemProperty(
50182   MenuRef menu,
50183   MenuItemIndex item,
50184   OSType propertyCreator,
50185   OSType propertyTag,
50186   UInt32 bufferSize,
50187   UInt32 * actualSize,
50188   void * propertyBuffer) ;
50189 extern OSStatus
50190 GetMenuItemPropertySize(
50191   MenuRef menu,
50192   MenuItemIndex item,
50193   OSType propertyCreator,
50194   OSType propertyTag,
50195   UInt32 * size) ;
50196 extern OSStatus
50197 SetMenuItemProperty(
50198   MenuRef menu,
50199   MenuItemIndex item,
50200   OSType propertyCreator,
50201   OSType propertyTag,
50202   UInt32 propertySize,
50203   const void * propertyData) ;
50204 extern OSStatus
50205 RemoveMenuItemProperty(
50206   MenuRef menu,
50207   MenuItemIndex item,
50208   OSType propertyCreator,
50209   OSType propertyTag) ;
50210 extern OSStatus
50211 GetMenuItemPropertyAttributes(
50212   MenuRef menu,
50213   MenuItemIndex item,
50214   OSType propertyCreator,
50215   OSType propertyTag,
50216   UInt32 * attributes) ;
50217 extern OSStatus
50218 ChangeMenuItemPropertyAttributes(
50219   MenuRef menu,
50220   MenuItemIndex item,
50221   OSType propertyCreator,
50222   OSType propertyTag,
50223   UInt32 attributesToSet,
50224   UInt32 attributesToClear) ;
50225 extern OSStatus
50226 GetMenuAttributes(
50227   MenuRef menu,
50228   MenuAttributes * outAttributes) ;
50229 extern OSStatus
50230 ChangeMenuAttributes(
50231   MenuRef menu,
50232   MenuAttributes setTheseAttributes,
50233   MenuAttributes clearTheseAttributes) ;
50234 extern OSStatus
50235 GetMenuItemAttributes(
50236   MenuRef menu,
50237   MenuItemIndex item,
50238   MenuItemAttributes * outAttributes) ;
50239 extern OSStatus
50240 ChangeMenuItemAttributes(
50241   MenuRef menu,
50242   MenuItemIndex item,
50243   MenuItemAttributes setTheseAttributes,
50244   MenuItemAttributes clearTheseAttributes) ;
50245 extern void
50246 DisableAllMenuItems(MenuRef theMenu) ;
50247 extern void
50248 EnableAllMenuItems(MenuRef theMenu) ;
50249 extern Boolean
50250 MenuHasEnabledItems(MenuRef theMenu) ;
50251 extern OSStatus
50252 GetMenuTrackingData(
50253   MenuRef theMenu,
50254   MenuTrackingData * outData) ;
50255 extern OSStatus
50256 GetMenuType(
50257   MenuRef theMenu,
50258   UInt16 * outType) ;
50259 extern ItemCount
50260 CountMenuItemsWithCommandID(
50261   MenuRef inMenu,
50262   MenuCommand inCommandID) ;
50263 extern OSStatus
50264 GetIndMenuItemWithCommandID(
50265   MenuRef inMenu,
50266   MenuCommand inCommandID,
50267   UInt32 inItemIndex,
50268   MenuRef * outMenu,
50269   MenuItemIndex * outIndex) ;
50270 extern void
50271 EnableMenuCommand(
50272   MenuRef inMenu,
50273   MenuCommand inCommandID) ;
50274 extern void
50275 DisableMenuCommand(
50276   MenuRef inMenu,
50277   MenuCommand inCommandID) ;
50278 extern Boolean
50279 IsMenuCommandEnabled(
50280   MenuRef inMenu,
50281   MenuCommand inCommandID) ;
50282 extern OSStatus
50283 SetMenuCommandMark(
50284   MenuRef inMenu,
50285   MenuCommand inCommandID,
50286   UniChar inMark) ;
50287 extern OSStatus
50288 GetMenuCommandMark(
50289   MenuRef inMenu,
50290   MenuCommand inCommandID,
50291   UniChar * outMark) ;
50292 extern OSStatus
50293 GetMenuCommandProperty(
50294   MenuRef inMenu,
50295   MenuCommand inCommandID,
50296   OSType inPropertyCreator,
50297   OSType inPropertyTag,
50298   ByteCount inBufferSize,
50299   ByteCount * outActualSize,
50300   void * inPropertyBuffer) ;
50301 extern OSStatus
50302 GetMenuCommandPropertySize(
50303   MenuRef inMenu,
50304   MenuCommand inCommandID,
50305   OSType inPropertyCreator,
50306   OSType inPropertyTag,
50307   ByteCount * outSize) ;
50308 extern OSStatus
50309 SetMenuCommandProperty(
50310   MenuRef inMenu,
50311   MenuCommand inCommandID,
50312   OSType inPropertyCreator,
50313   OSType inPropertyTag,
50314   ByteCount inPropertySize,
50315   const void * inPropertyData) ;
50316 extern OSStatus
50317 RemoveMenuCommandProperty(
50318   MenuRef inMenu,
50319   MenuCommand inCommandID,
50320   OSType inPropertyCreator,
50321   OSType inPropertyTag) ;
50322 extern OSStatus
50323 CopyMenuItemData(
50324   MenuRef inMenu,
50325   MenuItemID inItem,
50326   Boolean inIsCommandID,
50327   MenuItemDataPtr ioData) ;
50328 extern OSStatus
50329 SetMenuItemData(
50330   MenuRef inMenu,
50331   MenuItemID inItem,
50332   Boolean inIsCommandID,
50333   const MenuItemDataRec * inData) ;
50334 extern Boolean
50335 IsMenuItemInvalid(
50336   MenuRef inMenu,
50337   MenuItemIndex inItem) ;
50338 extern OSStatus
50339 InvalidateMenuItems(
50340   MenuRef inMenu,
50341   MenuItemIndex inFirstItem,
50342   ItemCount inNumItems) ;
50343 extern OSStatus
50344 UpdateInvalidMenuItems(MenuRef inMenu) ;
50345 enum {
50346   kHierarchicalFontMenuOption = 0x00000001
50347 };
50348 extern OSStatus
50349 CreateStandardFontMenu(
50350   MenuRef menu,
50351   MenuItemIndex afterItem,
50352   MenuID firstHierMenuID,
50353   OptionBits options,
50354   ItemCount * outHierMenuCount) ;
50355 extern OSStatus
50356 UpdateStandardFontMenu(
50357   MenuRef menu,
50358   ItemCount * outHierMenuCount) ;
50359 extern OSStatus
50360 GetFontFamilyFromMenuSelection(
50361   MenuRef menu,
50362   MenuItemIndex item,
50363   FMFontFamily * outFontFamily,
50364   FMFontStyle * outStyle) ;
50365 enum {
50366   gestaltContextualMenuAttr = 'cmnu',
50367   gestaltContextualMenuUnusedBit = 0,
50368   gestaltContextualMenuTrapAvailable = 1,
50369   gestaltContextualMenuHasAttributeAndModifierKeys = 2,
50370   gestaltContextualMenuHasUnicodeSupport = 3
50371 };
50372
50373
50374
50375
50376
50377
50378 enum {
50379
50380
50381
50382
50383
50384
50385   kCMHelpItemNoHelp = 0,
50386
50387
50388
50389
50390
50391
50392   kCMHelpItemAppleGuide = 1,
50393   kCMHelpItemOtherHelp = 2,
50394   kCMHelpItemRemoveHelp = 3
50395 };
50396
50397
50398
50399
50400
50401
50402 enum {
50403
50404
50405
50406
50407
50408   kCMNothingSelected = 0,
50409
50410
50411
50412
50413
50414
50415
50416   kCMMenuItemSelected = 1,
50417
50418
50419
50420
50421
50422
50423
50424   kCMShowHelpSelected = 3
50425 };
50426 enum {
50427   keyContextualMenuName = 'pnam',
50428
50429
50430
50431
50432
50433   keyContextualMenuCommandID = 'cmcd',
50434
50435
50436
50437
50438
50439
50440   keyContextualMenuSubmenu = 'cmsb',
50441
50442
50443
50444
50445
50446
50447   keyContextualMenuAttributes = 'cmat',
50448   keyContextualMenuModifiers = 'cmmd'
50449 };
50450 extern OSStatus
50451 InitContextualMenus(void) ;
50452 extern Boolean
50453 IsShowContextualMenuClick(const EventRecord * inEvent) ;
50454 extern Boolean
50455 IsShowContextualMenuEvent(EventRef inEvent) ;
50456 extern OSStatus
50457 ContextualMenuSelect(
50458   MenuRef inMenu,
50459   Point inGlobalLocation,
50460   Boolean inReserved,
50461   UInt32 inHelpType,
50462   ConstStr255Param inHelpItemString,
50463   const AEDesc * inSelection,
50464   UInt32 * outUserSelectionType,
50465   SInt16 * outMenuID,
50466   MenuItemIndex * outMenuItem) ;
50467 extern Boolean
50468 ProcessIsContextualMenuClient(ProcessSerialNumber * inPSN) ;
50469 struct ContextualMenuInterfaceStruct
50470 {
50471     void *_reserved; SInt32 (*QueryInterface)(void *thisPointer, CFUUIDBytes iid, void ** ppv); UInt32 (*AddRef)(void *thisPointer); UInt32 (*Release)(void *thisPointer);
50472     OSStatus ( *ExamineContext )(
50473           void* thisInstance,
50474           const AEDesc* inContext,
50475          AEDescList* outCommandPairs );
50476  OSStatus ( *HandleSelection )(
50477          void* thisInstance,
50478           AEDesc* inContext,
50479          SInt32 inCommandID );
50480  void ( *PostMenuCleanup )(
50481          void* thisInstance );
50482 };
50483 typedef struct ContextualMenuInterfaceStruct ContextualMenuInterfaceStruct;
50484
50485
50486
50487
50488
50489
50490
50491 extern OSStatus
50492 CMPluginExamineContext(
50493   void * thisInstance,
50494   const AEDesc * inContext,
50495   AEDescList * outCommandPairs);
50496 extern OSStatus
50497 CMPluginHandleSelection(
50498   void * thisInstance,
50499   AEDesc * inContext,
50500   SInt32 inCommandID);
50501 extern void
50502 CMPluginPostMenuCleanup(void * thisInstance);
50503 extern SInt16
50504 LMGetTheMenu(void) ;
50505 extern MenuID
50506 GetMenuID(MenuRef menu) ;
50507 extern SInt16
50508 GetMenuWidth(MenuRef menu) ;
50509 extern SInt16
50510 GetMenuHeight(MenuRef menu) ;
50511 extern StringPtr
50512 GetMenuTitle(
50513   MenuRef menu,
50514   Str255 title) ;
50515 extern OSStatus
50516 GetMenuDefinition(
50517   MenuRef menu,
50518   MenuDefSpecPtr outDefSpec) ;
50519 extern void
50520 SetMenuID(
50521   MenuRef menu,
50522   MenuID menuID) ;
50523 extern void
50524 SetMenuWidth(
50525   MenuRef menu,
50526   SInt16 width) ;
50527 extern void
50528 SetMenuHeight(
50529   MenuRef menu,
50530   SInt16 height) ;
50531 extern OSStatus
50532 SetMenuTitle(
50533   MenuRef menu,
50534   ConstStr255Param title) ;
50535 extern OSStatus
50536 SetMenuDefinition(
50537   MenuRef menu,
50538   const MenuDefSpec * defSpec) ;
50539
50540
50541 }
50542 extern "C" {
50543
50544
50545 typedef HIObjectRef HIToolbarRef;
50546 typedef HIObjectRef HIToolbarItemRef;
50547 enum {
50548
50549
50550
50551
50552
50553
50554   kHIToolbarDisplayModeDefault = 0,
50555
50556
50557
50558
50559
50560   kHIToolbarDisplayModeIconAndLabel = 1,
50561
50562
50563
50564
50565   kHIToolbarDisplayModeIconOnly = 2,
50566
50567
50568
50569
50570   kHIToolbarDisplayModeLabelOnly = 3
50571 };
50572
50573 typedef UInt32 HIToolbarDisplayMode;
50574
50575
50576
50577
50578
50579 enum {
50580
50581
50582
50583
50584
50585   kHIToolbarDisplaySizeDefault = 0,
50586
50587
50588
50589
50590   kHIToolbarDisplaySizeNormal = 1,
50591
50592
50593
50594
50595   kHIToolbarDisplaySizeSmall = 2
50596 };
50597
50598 typedef UInt32 HIToolbarDisplaySize;
50599
50600
50601
50602
50603
50604 enum {
50605
50606
50607
50608
50609   kHIToolbarNoAttributes = 0,
50610   kHIToolbarAutoSavesConfig = (1 << 0),
50611
50612
50613
50614
50615
50616
50617   kHIToolbarIsConfigurable = (1 << 1),
50618   kHIToolbarValidAttrs = kHIToolbarAutoSavesConfig | kHIToolbarIsConfigurable
50619 };
50620
50621
50622
50623
50624
50625
50626
50627 enum {
50628
50629
50630
50631
50632
50633
50634
50635   kHICommandCustomizeToolbar = 'tcfg',
50636
50637
50638
50639
50640
50641
50642   kHICommandShowToolbar = 'tbsh',
50643
50644
50645
50646
50647
50648
50649   kHICommandHideToolbar = 'tbhd'
50650 };
50651 enum {
50652
50653
50654
50655
50656
50657
50658   kEventToolbarGetDefaultIdentifiers = 1,
50659
50660
50661
50662
50663
50664
50665
50666   kEventToolbarGetAllowedIdentifiers = 2,
50667
50668
50669
50670
50671
50672   kEventToolbarCreateItemWithIdentifier = 3,
50673
50674
50675
50676
50677
50678
50679
50680   kEventToolbarCreateItemFromDrag = 4
50681 };
50682
50683
50684
50685
50686
50687
50688 enum {
50689
50690
50691
50692
50693
50694
50695   kEventToolbarItemImageChanged = 1,
50696
50697
50698
50699
50700
50701
50702   kEventToolbarItemLabelChanged = 2,
50703
50704
50705
50706
50707
50708
50709   kEventToolbarItemHelpTextChanged = 3,
50710
50711
50712
50713
50714
50715
50716   kEventToolbarItemCommandIDChanged = 4,
50717   kEventToolbarItemGetPersistentData = 5,
50718
50719
50720
50721
50722
50723
50724
50725   kEventToolbarItemCreateCustomView = 6,
50726
50727
50728
50729
50730
50731
50732   kEventToolbarItemEnabledStateChanged = 7,
50733
50734
50735
50736
50737
50738
50739
50740   kEventToolbarItemPerformAction = 8
50741 };
50742
50743
50744
50745
50746
50747
50748 enum {
50749   kHIToolbarItemNoAttributes = 0,
50750   kHIToolbarItemAllowDuplicates = (1 << 0),
50751   kHIToolbarItemCantBeRemoved = (1 << 1),
50752   kHIToolbarItemAnchoredLeft = (1 << 2),
50753   kHIToolbarItemIsSeparator = (1 << 3),
50754
50755
50756
50757
50758
50759
50760   kHIToolbarItemSendCmdToUserFocus = (1 << 4),
50761   kHIToolbarItemValidAttrs = kHIToolbarItemAllowDuplicates | kHIToolbarItemIsSeparator | kHIToolbarItemCantBeRemoved | kHIToolbarItemAnchoredLeft | kHIToolbarItemSendCmdToUserFocus,
50762   kHIToolbarItemMutableAttrs = kHIToolbarItemCantBeRemoved | kHIToolbarItemAnchoredLeft
50763 };
50764 extern OSStatus
50765 HIToolbarCreate(
50766   CFStringRef inIdentifier,
50767   OptionBits inAttributes,
50768   HIToolbarRef * outToolbar) ;
50769 extern OSStatus
50770 HIToolbarGetAttributes(
50771   HIToolbarRef inToolbar,
50772   OptionBits * outAttributes) ;
50773 extern OSStatus
50774 HIToolbarChangeAttributes(
50775   HIToolbarRef inToolbar,
50776   OptionBits inAttrsToSet,
50777   OptionBits inAttrsToClear) ;
50778 extern OSStatus
50779 HIToolbarGetDisplayMode(
50780   HIToolbarRef inToolbar,
50781   HIToolbarDisplayMode * outDisplayMode) ;
50782 extern OSStatus
50783 HIToolbarSetDisplayMode(
50784   HIToolbarRef inToolbar,
50785   HIToolbarDisplayMode inDisplayMode) ;
50786 extern OSStatus
50787 HIToolbarGetDisplaySize(
50788   HIToolbarRef inToolbar,
50789   HIToolbarDisplaySize * outSize) ;
50790 extern OSStatus
50791 HIToolbarSetDisplaySize(
50792   HIToolbarRef inToolbar,
50793   HIToolbarDisplaySize inSize) ;
50794 extern OSStatus
50795 HIToolbarCopyIdentifier(
50796   HIToolbarRef inToolbar,
50797   CFStringRef * outIdentifier) ;
50798 extern OSStatus
50799 HIToolbarCopyItems(
50800   HIToolbarRef inToolbar,
50801   CFArrayRef * outItems) ;
50802 extern OSStatus
50803 HIToolbarCreateItemWithIdentifier(
50804   HIToolbarRef inToolbar,
50805   CFStringRef inIdentifier,
50806   CFTypeRef inConfigData,
50807   HIToolbarItemRef * outItem) ;
50808 extern OSStatus
50809 HIToolbarInsertItemAtIndex(
50810   HIToolbarRef inToolbar,
50811   HIToolbarItemRef inItem,
50812   CFIndex inIndex) ;
50813 extern OSStatus
50814 HIToolbarAppendItem(
50815   HIToolbarRef inToolbar,
50816   HIToolbarItemRef inItem) ;
50817 extern OSStatus
50818 HIToolbarRemoveItemAtIndex(
50819   HIToolbarRef inToolbar,
50820   CFIndex inIndex) ;
50821 extern OSStatus
50822 HIToolbarSetDelegate(
50823   HIToolbarRef inToolbar,
50824   HIObjectRef inDelegate) ;
50825 extern HIObjectRef
50826 HIToolbarGetDelegate(HIToolbarRef inToolbar) ;
50827 extern OSStatus
50828 HIToolbarItemCreate(
50829   CFStringRef inIdentifier,
50830   OptionBits inOptions,
50831   HIToolbarItemRef * outItem) ;
50832 extern OSStatus
50833 HIToolbarItemCopyIdentifier(
50834   HIToolbarItemRef inItem,
50835   CFStringRef * outIdentifier) ;
50836 extern OSStatus
50837 HIToolbarItemGetAttributes(
50838   HIToolbarItemRef inItem,
50839   OptionBits * outAttributes) ;
50840 extern OSStatus
50841 HIToolbarItemChangeAttributes(
50842   HIToolbarItemRef inItem,
50843   OptionBits inAttrsToSet,
50844   OptionBits inAttrsToClear) ;
50845 extern OSStatus
50846 HIToolbarItemSetLabel(
50847   HIToolbarItemRef inItem,
50848   CFStringRef inLabel) ;
50849 extern OSStatus
50850 HIToolbarItemCopyLabel(
50851   HIToolbarItemRef inItem,
50852   CFStringRef * outLabel) ;
50853 extern OSStatus
50854 HIToolbarItemSetHelpText(
50855   HIToolbarItemRef inItem,
50856   CFStringRef inShortText,
50857   CFStringRef inLongText) ;
50858 extern OSStatus
50859 HIToolbarItemCopyHelpText(
50860   HIToolbarItemRef inItem,
50861   CFStringRef * outShortText,
50862   CFStringRef * outLongText) ;
50863 extern OSStatus
50864 HIToolbarItemSetCommandID(
50865   HIToolbarItemRef inItem,
50866   MenuCommand inCommandID) ;
50867 extern OSStatus
50868 HIToolbarItemGetCommandID(
50869   HIToolbarItemRef inItem,
50870   MenuCommand * outCommandID) ;
50871 extern OSStatus
50872 HIToolbarItemSetIconRef(
50873   HIToolbarItemRef inItem,
50874   IconRef inIcon) ;
50875 extern OSStatus
50876 HIToolbarItemSetImage(
50877   HIToolbarItemRef inItem,
50878   CGImageRef inImage) ;
50879 extern OSStatus
50880 HIToolbarItemCopyImage(
50881   HIToolbarItemRef inItem,
50882   CGImageRef * outImage) ;
50883 extern OSStatus
50884 HIToolbarItemSetMenu(
50885   HIToolbarItemRef inItem,
50886   MenuRef inMenu) ;
50887 extern OSStatus
50888 HIToolbarItemCopyMenu(
50889   HIToolbarItemRef inItem,
50890   MenuRef * outMenu) ;
50891 extern HIToolbarRef
50892 HIToolbarItemGetToolbar(HIToolbarItemRef inItem) ;
50893 extern Boolean
50894 HIToolbarItemIsEnabled(HIToolbarItemRef inItem) ;
50895 extern OSStatus
50896 HIToolbarItemSetEnabled(
50897   HIToolbarItemRef inItem,
50898   Boolean inEnabled) ;
50899
50900
50901
50902
50903 }
50904
50905
50906
50907 extern "C" {
50908
50909
50910
50911 typedef struct TERec TERec;
50912 typedef TERec * TEPtr;
50913 typedef TEPtr * TEHandle;
50914 typedef void ( * HighHookProcPtr)(const Rect *r, TEPtr pTE);
50915 typedef Boolean ( * EOLHookProcPtr)(char theChar, TEPtr pTE, TEHandle hTE);
50916 typedef void ( * CaretHookProcPtr)(const Rect *r, TEPtr pTE);
50917 typedef unsigned short ( * WidthHookProcPtr)(unsigned short textLen, unsigned short textOffset, void *textBufferPtr, TEPtr pTE, TEHandle hTE);
50918 typedef unsigned short ( * TextWidthHookProcPtr)(unsigned short textLen, unsigned short textOffset, void *textBufferPtr, TEPtr pTE, TEHandle hTE);
50919 typedef unsigned short ( * NWidthHookProcPtr)(unsigned short styleRunLen, unsigned short styleRunOffset, short slop, short direction, void *textBufferPtr, short *lineStart, TEPtr pTE, TEHandle hTE);
50920 typedef void ( * DrawHookProcPtr)(unsigned short textOffset, unsigned short drawLen, void *textBufferPtr, TEPtr pTE, TEHandle hTE);
50921 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);
50922 typedef void ( * TEFindWordProcPtr)(unsigned short currentPos, short caller, TEPtr pTE, TEHandle hTE, unsigned short *wordStart, unsigned short *wordEnd);
50923 typedef void ( * TERecalcProcPtr)(TEPtr pTE, unsigned short changeLength, unsigned short *lineStart, unsigned short *firstChar, unsigned short *lastChar);
50924 typedef void ( * TEDoTextProcPtr)(TEPtr pTE, unsigned short firstChar, unsigned short lastChar, short selector, GrafPtr *currentGrafPort, short *charPosition);
50925 typedef Boolean ( * TEClickLoopProcPtr)(TEPtr pTE);
50926 typedef Boolean ( * WordBreakProcPtr)(Ptr text, short charPos);
50927 typedef HighHookProcPtr HighHookUPP;
50928 typedef EOLHookProcPtr EOLHookUPP;
50929 typedef CaretHookProcPtr CaretHookUPP;
50930 typedef WidthHookProcPtr WidthHookUPP;
50931 typedef TextWidthHookProcPtr TextWidthHookUPP;
50932 typedef NWidthHookProcPtr NWidthHookUPP;
50933 typedef DrawHookProcPtr DrawHookUPP;
50934 typedef HitTestHookProcPtr HitTestHookUPP;
50935 typedef TEFindWordProcPtr TEFindWordUPP;
50936 typedef TERecalcProcPtr TERecalcUPP;
50937 typedef TEDoTextProcPtr TEDoTextUPP;
50938 typedef TEClickLoopProcPtr TEClickLoopUPP;
50939 typedef WordBreakProcPtr WordBreakUPP;
50940 struct TERec {
50941   Rect destRect;
50942   Rect viewRect;
50943   Rect selRect;
50944   short lineHeight;
50945   short fontAscent;
50946   Point selPoint;
50947   short selStart;
50948   short selEnd;
50949   short active;
50950   WordBreakUPP wordBreak;
50951   TEClickLoopUPP clickLoop;
50952   long clickTime;
50953   short clickLoc;
50954   long caretTime;
50955   short caretState;
50956   short just;
50957   short teLength;
50958   Handle hText;
50959   long hDispatchRec;
50960   short clikStuff;
50961   short crOnly;
50962   short txFont;
50963   StyleField txFace;
50964   short txMode;
50965   short txSize;
50966   GrafPtr inPort;
50967   HighHookUPP highHook;
50968   CaretHookUPP caretHook;
50969   short nLines;
50970   short lineStarts[16001];
50971 };
50972
50973 enum {
50974
50975   teJustLeft = 0,
50976   teJustCenter = 1,
50977   teJustRight = -1,
50978   teForceLeft = -2,
50979   teFlushDefault = 0,
50980   teCenter = 1,
50981   teFlushRight = -1,
50982   teFlushLeft = -2
50983 };
50984
50985 enum {
50986
50987   fontBit = 0,
50988   faceBit = 1,
50989   sizeBit = 2,
50990   clrBit = 3,
50991   addSizeBit = 4,
50992   toggleBit = 5
50993 };
50994
50995 enum {
50996
50997   doFont = 1,
50998   doFace = 2,
50999   doSize = 4,
51000   doColor = 8,
51001   doAll = 15,
51002   addSize = 16,
51003   doToggle = 32
51004 };
51005
51006 enum {
51007
51008   EOLHook = 0,
51009   DRAWHook = 4,
51010   WIDTHHook = 8,
51011   HITTESTHook = 12,
51012   nWIDTHHook = 24,
51013   TextWidthHook = 28
51014 };
51015
51016 enum {
51017
51018   intEOLHook = 0,
51019   intDrawHook = 1,
51020   intWidthHook = 2,
51021   intHitTestHook = 3,
51022   intNWidthHook = 6,
51023   intTextWidthHook = 7,
51024   intInlineInputTSMTEPreUpdateHook = 8,
51025   intInlineInputTSMTEPostUpdateHook = 9
51026 };
51027
51028 enum {
51029
51030   teFAutoScroll = 0,
51031   teFTextBuffering = 1,
51032   teFOutlineHilite = 2,
51033   teFInlineInput = 3,
51034   teFUseWhiteBackground = 4,
51035   teFUseInlineInput = 5,
51036   teFInlineInputAutoScroll = 6
51037 };
51038
51039 enum {
51040
51041
51042
51043
51044
51045
51046   teFIdleWithEventLoopTimer = 7
51047 };
51048
51049 enum {
51050
51051   teBitClear = 0,
51052   teBitSet = 1,
51053   teBitTest = -1
51054 };
51055
51056 enum {
51057
51058   teWordSelect = 4,
51059   teWordDrag = 8,
51060   teFromFind = 12,
51061   teFromRecal = 16
51062 };
51063
51064 enum {
51065
51066   teFind = 0,
51067   teHighlight = 1,
51068   teDraw = -1,
51069   teCaret = -2
51070 };
51071
51072
51073 typedef char Chars[32001];
51074 typedef char * CharsPtr;
51075 typedef CharsPtr * CharsHandle;
51076 struct StyleRun {
51077   short startChar;
51078   short styleIndex;
51079 };
51080 typedef struct StyleRun StyleRun;
51081 struct STElement {
51082   short stCount;
51083   short stHeight;
51084   short stAscent;
51085   short stFont;
51086   StyleField stFace;
51087   short stSize;
51088   RGBColor stColor;
51089 };
51090 typedef struct STElement STElement;
51091 typedef STElement TEStyleTable[1777];
51092 typedef STElement * STPtr;
51093 typedef STPtr * STHandle;
51094 struct LHElement {
51095   short lhHeight;
51096   short lhAscent;
51097 };
51098 typedef struct LHElement LHElement;
51099 typedef LHElement LHTable[8001];
51100 typedef LHElement * LHPtr;
51101 typedef LHPtr * LHHandle;
51102 struct ScrpSTElement {
51103   long scrpStartChar;
51104   short scrpHeight;
51105   short scrpAscent;
51106   short scrpFont;
51107   StyleField scrpFace;
51108   short scrpSize;
51109   RGBColor scrpColor;
51110 };
51111 typedef struct ScrpSTElement ScrpSTElement;
51112
51113 typedef ScrpSTElement ScrpSTTable[1601];
51114 struct StScrpRec {
51115   short scrpNStyles;
51116   ScrpSTTable scrpStyleTab;
51117 };
51118 typedef struct StScrpRec StScrpRec;
51119 typedef StScrpRec * StScrpPtr;
51120 typedef StScrpPtr * StScrpHandle;
51121 struct NullStRec {
51122   long teReserved;
51123   StScrpHandle nullScrap;
51124 };
51125 typedef struct NullStRec NullStRec;
51126 typedef NullStRec * NullStPtr;
51127 typedef NullStPtr * NullStHandle;
51128 struct TEStyleRec {
51129   short nRuns;
51130   short nStyles;
51131   STHandle styleTab;
51132   LHHandle lhTab;
51133   long teRefCon;
51134   NullStHandle nullStyle;
51135   StyleRun runs[8001];
51136 };
51137 typedef struct TEStyleRec TEStyleRec;
51138 typedef TEStyleRec * TEStylePtr;
51139 typedef TEStylePtr * TEStyleHandle;
51140 struct TextStyle {
51141   short tsFont;
51142   StyleField tsFace;
51143   short tsSize;
51144   RGBColor tsColor;
51145 };
51146 typedef struct TextStyle TextStyle;
51147 typedef TextStyle * TextStylePtr;
51148 typedef TextStylePtr * TextStyleHandle;
51149 typedef short TEIntHook;
51150 extern HighHookUPP
51151 NewHighHookUPP(HighHookProcPtr userRoutine) ;
51152 extern EOLHookUPP
51153 NewEOLHookUPP(EOLHookProcPtr userRoutine) ;
51154 extern CaretHookUPP
51155 NewCaretHookUPP(CaretHookProcPtr userRoutine) ;
51156 extern WidthHookUPP
51157 NewWidthHookUPP(WidthHookProcPtr userRoutine) ;
51158 extern TextWidthHookUPP
51159 NewTextWidthHookUPP(TextWidthHookProcPtr userRoutine) ;
51160 extern NWidthHookUPP
51161 NewNWidthHookUPP(NWidthHookProcPtr userRoutine) ;
51162 extern DrawHookUPP
51163 NewDrawHookUPP(DrawHookProcPtr userRoutine) ;
51164 extern HitTestHookUPP
51165 NewHitTestHookUPP(HitTestHookProcPtr userRoutine) ;
51166 extern TEFindWordUPP
51167 NewTEFindWordUPP(TEFindWordProcPtr userRoutine) ;
51168 extern TERecalcUPP
51169 NewTERecalcUPP(TERecalcProcPtr userRoutine) ;
51170 extern TEDoTextUPP
51171 NewTEDoTextUPP(TEDoTextProcPtr userRoutine) ;
51172 extern TEClickLoopUPP
51173 NewTEClickLoopUPP(TEClickLoopProcPtr userRoutine) ;
51174 extern void
51175 DisposeHighHookUPP(HighHookUPP userUPP) ;
51176 extern void
51177 DisposeEOLHookUPP(EOLHookUPP userUPP) ;
51178 extern void
51179 DisposeCaretHookUPP(CaretHookUPP userUPP) ;
51180 extern void
51181 DisposeWidthHookUPP(WidthHookUPP userUPP) ;
51182 extern void
51183 DisposeTextWidthHookUPP(TextWidthHookUPP userUPP) ;
51184 extern void
51185 DisposeNWidthHookUPP(NWidthHookUPP userUPP) ;
51186 extern void
51187 DisposeDrawHookUPP(DrawHookUPP userUPP) ;
51188 extern void
51189 DisposeHitTestHookUPP(HitTestHookUPP userUPP) ;
51190 extern void
51191 DisposeTEFindWordUPP(TEFindWordUPP userUPP) ;
51192 extern void
51193 DisposeTERecalcUPP(TERecalcUPP userUPP) ;
51194 extern void
51195 DisposeTEDoTextUPP(TEDoTextUPP userUPP) ;
51196 extern void
51197 DisposeTEClickLoopUPP(TEClickLoopUPP userUPP) ;
51198 extern void
51199 InvokeHighHookUPP(
51200   const Rect * r,
51201   TEPtr pTE,
51202   HighHookUPP userUPP) ;
51203 extern Boolean
51204 InvokeEOLHookUPP(
51205   char theChar,
51206   TEPtr pTE,
51207   TEHandle hTE,
51208   EOLHookUPP userUPP) ;
51209 extern void
51210 InvokeCaretHookUPP(
51211   const Rect * r,
51212   TEPtr pTE,
51213   CaretHookUPP userUPP) ;
51214 extern unsigned short
51215 InvokeWidthHookUPP(
51216   unsigned short textLen,
51217   unsigned short textOffset,
51218   void * textBufferPtr,
51219   TEPtr pTE,
51220   TEHandle hTE,
51221   WidthHookUPP userUPP) ;
51222 extern unsigned short
51223 InvokeTextWidthHookUPP(
51224   unsigned short textLen,
51225   unsigned short textOffset,
51226   void * textBufferPtr,
51227   TEPtr pTE,
51228   TEHandle hTE,
51229   TextWidthHookUPP userUPP) ;
51230 extern unsigned short
51231 InvokeNWidthHookUPP(
51232   unsigned short styleRunLen,
51233   unsigned short styleRunOffset,
51234   short slop,
51235   short direction,
51236   void * textBufferPtr,
51237   short * lineStart,
51238   TEPtr pTE,
51239   TEHandle hTE,
51240   NWidthHookUPP userUPP) ;
51241 extern void
51242 InvokeDrawHookUPP(
51243   unsigned short textOffset,
51244   unsigned short drawLen,
51245   void * textBufferPtr,
51246   TEPtr pTE,
51247   TEHandle hTE,
51248   DrawHookUPP userUPP) ;
51249 extern Boolean
51250 InvokeHitTestHookUPP(
51251   unsigned short styleRunLen,
51252   unsigned short styleRunOffset,
51253   unsigned short slop,
51254   void * textBufferPtr,
51255   TEPtr pTE,
51256   TEHandle hTE,
51257   unsigned short * pixelWidth,
51258   unsigned short * charOffset,
51259   Boolean * pixelInChar,
51260   HitTestHookUPP userUPP) ;
51261 extern void
51262 InvokeTEFindWordUPP(
51263   unsigned short currentPos,
51264   short caller,
51265   TEPtr pTE,
51266   TEHandle hTE,
51267   unsigned short * wordStart,
51268   unsigned short * wordEnd,
51269   TEFindWordUPP userUPP) ;
51270 extern void
51271 InvokeTERecalcUPP(
51272   TEPtr pTE,
51273   unsigned short changeLength,
51274   unsigned short * lineStart,
51275   unsigned short * firstChar,
51276   unsigned short * lastChar,
51277   TERecalcUPP userUPP) ;
51278 extern void
51279 InvokeTEDoTextUPP(
51280   TEPtr pTE,
51281   unsigned short firstChar,
51282   unsigned short lastChar,
51283   short selector,
51284   GrafPtr * currentGrafPort,
51285   short * charPosition,
51286   TEDoTextUPP userUPP) ;
51287 extern Boolean
51288 InvokeTEClickLoopUPP(
51289   TEPtr pTE,
51290   TEClickLoopUPP userUPP) ;
51291 enum {
51292
51293   teFUseTextServices = 4
51294 };
51295 extern Handle
51296 TEScrapHandle(void) ;
51297 extern long
51298 TEGetScrapLength(void) ;
51299 extern TEHandle
51300 TENew(
51301   const Rect * destRect,
51302   const Rect * viewRect) ;
51303 extern void
51304 TEDispose(TEHandle hTE) ;
51305 extern void
51306 TESetText(
51307   const void * text,
51308   long length,
51309   TEHandle hTE) ;
51310 extern CharsHandle
51311 TEGetText(TEHandle hTE) ;
51312 extern void
51313 TEIdle(TEHandle hTE) ;
51314 extern void
51315 TESetSelect(
51316   long selStart,
51317   long selEnd,
51318   TEHandle hTE) ;
51319 extern void
51320 TEActivate(TEHandle hTE) ;
51321 extern void
51322 TEDeactivate(TEHandle hTE) ;
51323 extern void
51324 TEKey(
51325   CharParameter key,
51326   TEHandle hTE) ;
51327 extern void
51328 TECut(TEHandle hTE) ;
51329 extern void
51330 TECopy(TEHandle hTE) ;
51331 extern void
51332 TEPaste(TEHandle hTE) ;
51333 extern void
51334 TEDelete(TEHandle hTE) ;
51335 extern void
51336 TEInsert(
51337   const void * text,
51338   long length,
51339   TEHandle hTE) ;
51340 extern void
51341 TESetAlignment(
51342   short just,
51343   TEHandle hTE) ;
51344 extern void
51345 TEUpdate(
51346   const Rect * rUpdate,
51347   TEHandle hTE) ;
51348 extern void
51349 TETextBox(
51350   const void * text,
51351   long length,
51352   const Rect * box,
51353   short just) ;
51354 extern void
51355 TEScroll(
51356   short dh,
51357   short dv,
51358   TEHandle hTE) ;
51359 extern void
51360 TESelView(TEHandle hTE) ;
51361 extern void
51362 TEPinScroll(
51363   short dh,
51364   short dv,
51365   TEHandle hTE) ;
51366 extern void
51367 TEAutoView(
51368   Boolean fAuto,
51369   TEHandle hTE) ;
51370 extern void
51371 TECalText(TEHandle hTE) ;
51372 extern short
51373 TEGetOffset(
51374   Point pt,
51375   TEHandle hTE) ;
51376 extern Point
51377 TEGetPoint(
51378   short offset,
51379   TEHandle hTE) ;
51380 extern void
51381 TEClick(
51382   Point pt,
51383   Boolean fExtend,
51384   TEHandle h) ;
51385 extern TEHandle
51386 TEStyleNew(
51387   const Rect * destRect,
51388   const Rect * viewRect) ;
51389 extern void
51390 TESetStyleHandle(
51391   TEStyleHandle theHandle,
51392   TEHandle hTE) ;
51393 extern TEStyleHandle
51394 TEGetStyleHandle(TEHandle hTE) ;
51395 extern void
51396 TEGetStyle(
51397   short offset,
51398   TextStyle * theStyle,
51399   short * lineHeight,
51400   short * fontAscent,
51401   TEHandle hTE) ;
51402 extern void
51403 TEStylePaste(TEHandle hTE) ;
51404 extern void
51405 TESetStyle(
51406   short mode,
51407   const TextStyle * newStyle,
51408   Boolean fRedraw,
51409   TEHandle hTE) ;
51410 extern void
51411 TEReplaceStyle(
51412   short mode,
51413   const TextStyle * oldStyle,
51414   const TextStyle * newStyle,
51415   Boolean fRedraw,
51416   TEHandle hTE) ;
51417 extern StScrpHandle
51418 TEGetStyleScrapHandle(TEHandle hTE) ;
51419 extern void
51420 TEStyleInsert(
51421   const void * text,
51422   long length,
51423   StScrpHandle hST,
51424   TEHandle hTE) ;
51425 extern long
51426 TEGetHeight(
51427   long endLine,
51428   long startLine,
51429   TEHandle hTE) ;
51430 extern Boolean
51431 TEContinuousStyle(
51432   short * mode,
51433   TextStyle * aStyle,
51434   TEHandle hTE) ;
51435 extern void
51436 TEUseStyleScrap(
51437   long rangeStart,
51438   long rangeEnd,
51439   StScrpHandle newStyles,
51440   Boolean fRedraw,
51441   TEHandle hTE) ;
51442 extern void
51443 TECustomHook(
51444   TEIntHook which,
51445   UniversalProcPtr * addr,
51446   TEHandle hTE) ;
51447 extern long
51448 TENumStyles(
51449   long rangeStart,
51450   long rangeEnd,
51451   TEHandle hTE) ;
51452 extern short
51453 TEFeatureFlag(
51454   short feature,
51455   short action,
51456   TEHandle hTE) ;
51457 extern OSErr
51458 TEGetHiliteRgn(
51459   RgnHandle region,
51460   TEHandle hTE) ;
51461 extern void
51462 TESetScrapLength(long length) ;
51463 extern OSErr
51464 TEFromScrap(void) ;
51465 extern OSErr
51466 TEToScrap(void) ;
51467 extern void
51468 TESetClickLoop(
51469   TEClickLoopUPP clikProc,
51470   TEHandle hTE) ;
51471 extern TEDoTextUPP
51472 TEGetDoTextHook(void) ;
51473 extern void
51474 TESetDoTextHook(TEDoTextUPP value) ;
51475 extern TERecalcUPP
51476 TEGetRecalcHook(void) ;
51477 extern void
51478 TESetRecalcHook(TERecalcUPP value) ;
51479 extern TEFindWordUPP
51480 TEGetFindWordHook(void) ;
51481 extern void
51482 TESetFindWordHook(TEFindWordUPP value) ;
51483 extern Handle
51484 TEGetScrapHandle(void) ;
51485 extern void
51486 TESetScrapHandle(Handle value) ;
51487 extern UInt8
51488 LMGetWordRedraw(void) ;
51489 extern void
51490 LMSetWordRedraw(UInt8 value) ;
51491
51492
51493 }
51494
51495
51496
51497 extern "C" {
51498
51499
51500 typedef CGPoint HIPoint;
51501 typedef CGSize HISize;
51502 typedef CGRect HIRect;
51503
51504
51505
51506
51507
51508
51509 typedef struct OpaqueDragRef* DragRef;
51510 typedef UInt32 DragItemRef;
51511 typedef OSType FlavorType;
51512
51513
51514
51515
51516
51517
51518 typedef UInt32 DragAttributes;
51519 enum {
51520   kDragHasLeftSenderWindow = (1L << 0),
51521   kDragInsideSenderApplication = (1L << 1),
51522   kDragInsideSenderWindow = (1L << 2)
51523 };
51524
51525
51526
51527
51528
51529
51530
51531 typedef UInt32 DragBehaviors;
51532 enum {
51533   kDragBehaviorNone = 0,
51534   kDragBehaviorZoomBackAnimation = (1L << 0)
51535 };
51536
51537
51538
51539
51540
51541
51542
51543 typedef UInt32 DragImageFlags;
51544 enum {
51545   kDragRegionAndImage = (1L << 4)
51546 };
51547 enum {
51548   kDragStandardTranslucency = 0L,
51549   kDragDarkTranslucency = 1L,
51550   kDragDarkerTranslucency = 2L,
51551   kDragOpaqueTranslucency = 3L
51552 };
51553 typedef SInt16 DragRegionMessage;
51554 enum {
51555   kDragRegionBegin = 1,
51556   kDragRegionDraw = 2,
51557   kDragRegionHide = 3,
51558   kDragRegionIdle = 4,
51559   kDragRegionEnd = 5
51560 };
51561 typedef SInt16 ZoomAcceleration;
51562 enum {
51563   kZoomNoAcceleration = 0,
51564   kZoomAccelerate = 1,
51565   kZoomDecelerate = 2
51566 };
51567 typedef UInt32 FlavorFlags;
51568 enum {
51569   flavorSenderOnly = (1 << 0),
51570   flavorSenderTranslated = (1 << 1),
51571   flavorNotSaved = (1 << 2),
51572   flavorSystemTranslated = (1 << 8),
51573   flavorDataPromised = (1 << 9)
51574 };
51575 enum {
51576   kDragFlavorTypeHFS = 'hfs ',
51577   kDragFlavorTypePromiseHFS = 'phfs',
51578   flavorTypeHFS = kDragFlavorTypeHFS,
51579   flavorTypePromiseHFS = kDragFlavorTypePromiseHFS
51580 };
51581
51582 enum {
51583   kDragPromisedFlavorFindFile = 'rWm1',
51584   kDragPromisedFlavor = 'fssP'
51585 };
51586
51587 enum {
51588   kDragPseudoCreatorVolumeOrDirectory = 'MACS',
51589   kDragPseudoFileTypeVolume = 'disk',
51590   kDragPseudoFileTypeDirectory = 'fold'
51591 };
51592 enum {
51593   flavorTypeDirectory = 'diry'
51594 };
51595 enum {
51596   kFlavorTypeClippingName = 'clnm',
51597   kFlavorTypeClippingFilename = 'clfn',
51598   kFlavorTypeUnicodeClippingName = 'ucln',
51599   kFlavorTypeUnicodeClippingFilename = 'uclf',
51600   kFlavorTypeDragToTrashOnly = 'fdtt',
51601   kFlavorTypeFinderNoTrackingBehavior = 'fntb'
51602 };
51603 typedef SInt16 DragTrackingMessage;
51604 enum {
51605   kDragTrackingEnterHandler = 1,
51606   kDragTrackingEnterWindow = 2,
51607   kDragTrackingInWindow = 3,
51608   kDragTrackingLeaveWindow = 4,
51609   kDragTrackingLeaveHandler = 5
51610 };
51611 enum {
51612
51613
51614
51615
51616
51617
51618
51619   kDragStandardDropLocationTrash = 'trsh',
51620
51621
51622
51623
51624   kDragStandardDropLocationUnknown = 'unkn'
51625 };
51626
51627 typedef OSType StandardDropLocation;
51628 enum {
51629
51630
51631
51632
51633
51634
51635   kDragActionNothing = 0L,
51636
51637
51638
51639
51640   kDragActionCopy = 1L,
51641
51642
51643
51644
51645   kDragActionAlias = (1L << 1),
51646
51647
51648
51649
51650
51651   kDragActionGeneric = (1L << 2),
51652
51653
51654
51655
51656
51657   kDragActionPrivate = (1L << 3),
51658
51659
51660
51661
51662   kDragActionMove = (1L << 4),
51663
51664
51665
51666
51667   kDragActionDelete = (1L << 5),
51668
51669
51670
51671
51672   kDragActionAll = (long)0xFFFFFFFF
51673 };
51674
51675 typedef UInt32 DragActions;
51676
51677
51678
51679
51680
51681
51682 struct HFSFlavor {
51683   OSType fileType;
51684   OSType fileCreator;
51685   UInt16 fdFlags;
51686   FSSpec fileSpec;
51687 };
51688 typedef struct HFSFlavor HFSFlavor;
51689 struct PromiseHFSFlavor {
51690   OSType fileType;
51691   OSType fileCreator;
51692   UInt16 fdFlags;
51693   FlavorType promisedFlavor;
51694 };
51695 typedef struct PromiseHFSFlavor PromiseHFSFlavor;
51696
51697
51698
51699
51700
51701
51702 typedef OSErr ( * DragTrackingHandlerProcPtr)(DragTrackingMessage message, WindowRef theWindow, void *handlerRefCon, DragRef theDrag);
51703 typedef OSErr ( * DragReceiveHandlerProcPtr)(WindowRef theWindow, void *handlerRefCon, DragRef theDrag);
51704 typedef DragTrackingHandlerProcPtr DragTrackingHandlerUPP;
51705 typedef DragReceiveHandlerProcPtr DragReceiveHandlerUPP;
51706 extern DragTrackingHandlerUPP
51707 NewDragTrackingHandlerUPP(DragTrackingHandlerProcPtr userRoutine) ;
51708 extern DragReceiveHandlerUPP
51709 NewDragReceiveHandlerUPP(DragReceiveHandlerProcPtr userRoutine) ;
51710 extern void
51711 DisposeDragTrackingHandlerUPP(DragTrackingHandlerUPP userUPP) ;
51712 extern void
51713 DisposeDragReceiveHandlerUPP(DragReceiveHandlerUPP userUPP) ;
51714 extern OSErr
51715 InvokeDragTrackingHandlerUPP(
51716   DragTrackingMessage message,
51717   WindowRef theWindow,
51718   void * handlerRefCon,
51719   DragRef theDrag,
51720   DragTrackingHandlerUPP userUPP) ;
51721 extern OSErr
51722 InvokeDragReceiveHandlerUPP(
51723   WindowRef theWindow,
51724   void * handlerRefCon,
51725   DragRef theDrag,
51726   DragReceiveHandlerUPP userUPP) ;
51727
51728
51729
51730
51731
51732
51733
51734 typedef OSErr ( * DragSendDataProcPtr)(FlavorType theType, void *dragSendRefCon, DragItemRef theItemRef, DragRef theDrag);
51735 typedef OSErr ( * DragInputProcPtr)(Point *mouse, SInt16 *modifiers, void *dragInputRefCon, DragRef theDrag);
51736 typedef OSErr ( * DragDrawingProcPtr)(DragRegionMessage message, RgnHandle showRegion, Point showOrigin, RgnHandle hideRegion, Point hideOrigin, void *dragDrawingRefCon, DragRef theDrag);
51737 typedef DragSendDataProcPtr DragSendDataUPP;
51738 typedef DragInputProcPtr DragInputUPP;
51739 typedef DragDrawingProcPtr DragDrawingUPP;
51740 extern DragSendDataUPP
51741 NewDragSendDataUPP(DragSendDataProcPtr userRoutine) ;
51742 extern DragInputUPP
51743 NewDragInputUPP(DragInputProcPtr userRoutine) ;
51744 extern DragDrawingUPP
51745 NewDragDrawingUPP(DragDrawingProcPtr userRoutine) ;
51746 extern void
51747 DisposeDragSendDataUPP(DragSendDataUPP userUPP) ;
51748 extern void
51749 DisposeDragInputUPP(DragInputUPP userUPP) ;
51750 extern void
51751 DisposeDragDrawingUPP(DragDrawingUPP userUPP) ;
51752 extern OSErr
51753 InvokeDragSendDataUPP(
51754   FlavorType theType,
51755   void * dragSendRefCon,
51756   DragItemRef theItemRef,
51757   DragRef theDrag,
51758   DragSendDataUPP userUPP) ;
51759 extern OSErr
51760 InvokeDragInputUPP(
51761   Point * mouse,
51762   SInt16 * modifiers,
51763   void * dragInputRefCon,
51764   DragRef theDrag,
51765   DragInputUPP userUPP) ;
51766 extern OSErr
51767 InvokeDragDrawingUPP(
51768   DragRegionMessage message,
51769   RgnHandle showRegion,
51770   Point showOrigin,
51771   RgnHandle hideRegion,
51772   Point hideOrigin,
51773   void * dragDrawingRefCon,
51774   DragRef theDrag,
51775   DragDrawingUPP userUPP) ;
51776 extern OSErr
51777 InstallTrackingHandler(
51778   DragTrackingHandlerUPP trackingHandler,
51779   WindowRef theWindow,
51780   void * handlerRefCon) ;
51781 extern OSErr
51782 InstallReceiveHandler(
51783   DragReceiveHandlerUPP receiveHandler,
51784   WindowRef theWindow,
51785   void * handlerRefCon) ;
51786 extern OSErr
51787 RemoveTrackingHandler(
51788   DragTrackingHandlerUPP trackingHandler,
51789   WindowRef theWindow) ;
51790 extern OSErr
51791 RemoveReceiveHandler(
51792   DragReceiveHandlerUPP receiveHandler,
51793   WindowRef theWindow) ;
51794 extern OSErr
51795 NewDrag(DragRef * theDrag) ;
51796 extern OSErr
51797 DisposeDrag(DragRef theDrag) ;
51798 extern OSErr
51799 AddDragItemFlavor(
51800   DragRef theDrag,
51801   DragItemRef theItemRef,
51802   FlavorType theType,
51803   const void * dataPtr,
51804   Size dataSize,
51805   FlavorFlags theFlags) ;
51806 extern OSErr
51807 SetDragItemFlavorData(
51808   DragRef theDrag,
51809   DragItemRef theItemRef,
51810   FlavorType theType,
51811   const void * dataPtr,
51812   Size dataSize,
51813   UInt32 dataOffset) ;
51814 extern OSErr
51815 SetDragSendProc(
51816   DragRef theDrag,
51817   DragSendDataUPP sendProc,
51818   void * dragSendRefCon) ;
51819 extern OSErr
51820 SetDragInputProc(
51821   DragRef theDrag,
51822   DragInputUPP inputProc,
51823   void * dragInputRefCon) ;
51824 extern OSErr
51825 SetDragDrawingProc(
51826   DragRef theDrag,
51827   DragDrawingUPP drawingProc,
51828   void * dragDrawingRefCon) ;
51829 extern OSErr
51830 SetDragImage(
51831   DragRef theDrag,
51832   PixMapHandle imagePixMap,
51833   RgnHandle imageRgn,
51834   Point imageOffsetPt,
51835   DragImageFlags theImageFlags) ;
51836 extern OSStatus
51837 SetDragImageWithCGImage(
51838   DragRef inDrag,
51839   CGImageRef inCGImage,
51840   const HIPoint * inImageOffsetPt,
51841   DragImageFlags inImageFlags) ;
51842 extern OSErr
51843 ChangeDragBehaviors(
51844   DragRef theDrag,
51845   DragBehaviors inBehaviorsToSet,
51846   DragBehaviors inBehaviorsToClear) ;
51847 extern OSErr
51848 TrackDrag(
51849   DragRef theDrag,
51850   const EventRecord * theEvent,
51851   RgnHandle theRegion) ;
51852 extern OSErr
51853 CountDragItems(
51854   DragRef theDrag,
51855   UInt16 * numItems) ;
51856 extern OSErr
51857 GetDragItemReferenceNumber(
51858   DragRef theDrag,
51859   UInt16 index,
51860   DragItemRef * theItemRef) ;
51861 extern OSErr
51862 CountDragItemFlavors(
51863   DragRef theDrag,
51864   DragItemRef theItemRef,
51865   UInt16 * numFlavors) ;
51866 extern OSErr
51867 GetFlavorType(
51868   DragRef theDrag,
51869   DragItemRef theItemRef,
51870   UInt16 index,
51871   FlavorType * theType) ;
51872 extern OSErr
51873 GetFlavorFlags(
51874   DragRef theDrag,
51875   DragItemRef theItemRef,
51876   FlavorType theType,
51877   FlavorFlags * theFlags) ;
51878 extern OSErr
51879 GetFlavorDataSize(
51880   DragRef theDrag,
51881   DragItemRef theItemRef,
51882   FlavorType theType,
51883   Size * dataSize) ;
51884 extern OSErr
51885 GetFlavorData(
51886   DragRef theDrag,
51887   DragItemRef theItemRef,
51888   FlavorType theType,
51889   void * dataPtr,
51890   Size * dataSize,
51891   UInt32 dataOffset) ;
51892 extern OSErr
51893 GetDragItemBounds(
51894   DragRef theDrag,
51895   DragItemRef theItemRef,
51896   Rect * itemBounds) ;
51897 extern OSErr
51898 SetDragItemBounds(
51899   DragRef theDrag,
51900   DragItemRef theItemRef,
51901   const Rect * itemBounds) ;
51902 extern OSErr
51903 GetDropLocation(
51904   DragRef theDrag,
51905   AEDesc * dropLocation) ;
51906 extern OSErr
51907 SetDropLocation(
51908   DragRef theDrag,
51909   const AEDesc * dropLocation) ;
51910 extern OSStatus
51911 GetStandardDropLocation(
51912   DragRef theDrag,
51913   StandardDropLocation * outDropLocation) ;
51914 extern OSStatus
51915 SetStandardDropLocation(
51916   DragRef theDrag,
51917   StandardDropLocation dropLocation) ;
51918 extern OSErr
51919 GetDragAttributes(
51920   DragRef theDrag,
51921   DragAttributes * flags) ;
51922 extern OSErr
51923 GetDragMouse(
51924   DragRef theDrag,
51925   Point * mouse,
51926   Point * globalPinnedMouse) ;
51927 extern OSErr
51928 SetDragMouse(
51929   DragRef theDrag,
51930   Point globalPinnedMouse) ;
51931 extern OSErr
51932 GetDragOrigin(
51933   DragRef theDrag,
51934   Point * globalInitialMouse) ;
51935 extern OSErr
51936 GetDragModifiers(
51937   DragRef theDrag,
51938   SInt16 * modifiers,
51939   SInt16 * mouseDownModifiers,
51940   SInt16 * mouseUpModifiers) ;
51941 extern OSStatus
51942 GetDragAllowableActions(
51943   DragRef theDrag,
51944   DragActions * outActions) ;
51945 extern OSStatus
51946 SetDragAllowableActions(
51947   DragRef theDrag,
51948   DragActions inActions,
51949   Boolean isLocal) ;
51950 extern OSStatus
51951 GetDragDropAction(
51952   DragRef theDrag,
51953   DragActions * outAction) ;
51954 extern OSStatus
51955 SetDragDropAction(
51956   DragRef theDrag,
51957   DragActions inAction) ;
51958 extern OSErr
51959 ShowDragHilite(
51960   DragRef theDrag,
51961   RgnHandle hiliteFrame,
51962   Boolean inside) ;
51963 extern OSErr
51964 HideDragHilite(DragRef theDrag) ;
51965 extern OSErr
51966 DragPreScroll(
51967   DragRef theDrag,
51968   SInt16 dH,
51969   SInt16 dV) ;
51970 extern OSErr
51971 DragPostScroll(DragRef theDrag) ;
51972 extern OSErr
51973 UpdateDragHilite(
51974   DragRef theDrag,
51975   RgnHandle updateRgn) ;
51976 extern OSErr
51977 GetDragHiliteColor(
51978   WindowRef window,
51979   RGBColor * color) ;
51980 extern Boolean
51981 WaitMouseMoved(Point initialGlobalMouse) ;
51982 extern OSErr
51983 ZoomRects(
51984   const Rect * fromRect,
51985   const Rect * toRect,
51986   SInt16 zoomSteps,
51987   ZoomAcceleration acceleration) ;
51988 extern OSErr
51989 ZoomRegion(
51990   RgnHandle region,
51991   Point zoomDistance,
51992   SInt16 zoomSteps,
51993   ZoomAcceleration acceleration) ;
51994 typedef DragRef DragReference;
51995 typedef DragItemRef ItemReference;
51996
51997
51998 }
51999 extern "C" {
52000
52001
52002
52003
52004
52005
52006 enum {
52007   kControlDefProcType = 'CDEF',
52008   kControlTemplateResourceType = 'CNTL',
52009   kControlColorTableResourceType = 'cctb',
52010   kControlDefProcResourceType = 'CDEF'
52011 };
52012
52013
52014
52015
52016 struct ControlTemplate {
52017   Rect controlRect;
52018   SInt16 controlValue;
52019   Boolean controlVisible;
52020   UInt8 fill;
52021   SInt16 controlMaximum;
52022   SInt16 controlMinimum;
52023   SInt16 controlDefProcID;
52024   SInt32 controlReference;
52025   Str255 controlTitle;
52026 };
52027 typedef struct ControlTemplate ControlTemplate;
52028 typedef ControlTemplate * ControlTemplatePtr;
52029 typedef ControlTemplatePtr * ControlTemplateHandle;
52030 typedef struct OpaqueControlRef* ControlRef;
52031
52032
52033
52034 typedef ControlRef ControlHandle;
52035 typedef SInt16 ControlPartCode;
52036
52037
52038
52039 typedef void ( * ControlActionProcPtr)(ControlRef theControl, ControlPartCode partCode);
52040 typedef ControlActionProcPtr ControlActionUPP;
52041 extern ControlActionUPP
52042 NewControlActionUPP(ControlActionProcPtr userRoutine) ;
52043 extern void
52044 DisposeControlActionUPP(ControlActionUPP userUPP) ;
52045 extern void
52046 InvokeControlActionUPP(
52047   ControlRef theControl,
52048   ControlPartCode partCode,
52049   ControlActionUPP userUPP) ;
52050
52051
52052
52053
52054 enum {
52055   cFrameColor = 0,
52056   cBodyColor = 1,
52057   cTextColor = 2,
52058   cThumbColor = 3,
52059   kNumberCtlCTabEntries = 4
52060 };
52061
52062 struct CtlCTab {
52063   SInt32 ccSeed;
52064   SInt16 ccRider;
52065   SInt16 ctSize;
52066   ColorSpec ctTable[4];
52067 };
52068 typedef struct CtlCTab CtlCTab;
52069 typedef CtlCTab * CCTabPtr;
52070 typedef CCTabPtr * CCTabHandle;
52071 typedef SInt16 ControlVariant;
52072 enum {
52073   kControlNoVariant = 0,
52074   kControlUsesOwningWindowsFontVariant = 1 << 3
52075 };
52076
52077
52078
52079
52080
52081
52082 enum {
52083   kControlNoPart = 0,
52084   kControlIndicatorPart = 129,
52085   kControlDisabledPart = 254,
52086   kControlInactivePart = 255
52087 };
52088
52089
52090
52091
52092 enum {
52093   kControlEntireControl = 0
52094 };
52095 enum {
52096   kControlStructureMetaPart = -1,
52097   kControlContentMetaPart = -2
52098 };
52099
52100
52101 enum {
52102   kControlFocusNoPart = 0,
52103   kControlFocusNextPart = -1,
52104   kControlFocusPrevPart = -2
52105 };
52106
52107 typedef SInt16 ControlFocusPart;
52108 enum {
52109   kControlCollectionTagBounds = 'boun',
52110   kControlCollectionTagValue = 'valu',
52111   kControlCollectionTagMinimum = 'min ',
52112   kControlCollectionTagMaximum = 'max ',
52113   kControlCollectionTagViewSize = 'view',
52114   kControlCollectionTagVisibility = 'visi',
52115   kControlCollectionTagRefCon = 'refc',
52116   kControlCollectionTagTitle = 'titl',
52117   kControlCollectionTagUnicodeTitle = 'uttl',
52118   kControlCollectionTagIDSignature = 'idsi',
52119   kControlCollectionTagIDID = 'idid',
52120   kControlCollectionTagCommand = 'cmd ',
52121   kControlCollectionTagVarCode = 'varc'
52122 };
52123
52124
52125 enum {
52126   kControlCollectionTagSubControls = 'subc'
52127 };
52128
52129
52130
52131
52132 enum {
52133   kControlContentTextOnly = 0,
52134   kControlNoContent = 0,
52135   kControlContentIconSuiteRes = 1,
52136   kControlContentCIconRes = 2,
52137   kControlContentPictRes = 3,
52138   kControlContentICONRes = 4,
52139   kControlContentIconSuiteHandle = 129,
52140   kControlContentCIconHandle = 130,
52141   kControlContentPictHandle = 131,
52142   kControlContentIconRef = 132,
52143   kControlContentICON = 133
52144 };
52145
52146 typedef SInt16 ControlContentType;
52147 struct ControlButtonContentInfo {
52148   ControlContentType contentType;
52149   union {
52150     SInt16 resID;
52151     CIconHandle cIconHandle;
52152     Handle iconSuite;
52153     IconRef iconRef;
52154     PicHandle picture;
52155     Handle ICONHandle;
52156   } u;
52157 };
52158 typedef struct ControlButtonContentInfo ControlButtonContentInfo;
52159 typedef ControlButtonContentInfo * ControlButtonContentInfoPtr;
52160 typedef ControlButtonContentInfo ControlImageContentInfo;
52161 typedef ControlButtonContentInfo * ControlImageContentInfoPtr;
52162
52163
52164
52165 enum {
52166   kControlKeyScriptBehaviorAllowAnyScript = 'any ',
52167   kControlKeyScriptBehaviorPrefersRoman = 'prmn',
52168   kControlKeyScriptBehaviorRequiresRoman = 'rrmn'
52169 };
52170
52171 typedef UInt32 ControlKeyScriptBehavior;
52172 enum {
52173   kControlFontBigSystemFont = -1,
52174   kControlFontSmallSystemFont = -2,
52175   kControlFontSmallBoldSystemFont = -3,
52176   kControlFontViewSystemFont = -4
52177 };
52178
52179
52180
52181
52182 enum {
52183   kControlUseFontMask = 0x0001,
52184   kControlUseFaceMask = 0x0002,
52185   kControlUseSizeMask = 0x0004,
52186   kControlUseForeColorMask = 0x0008,
52187   kControlUseBackColorMask = 0x0010,
52188   kControlUseModeMask = 0x0020,
52189   kControlUseJustMask = 0x0040,
52190   kControlUseAllMask = 0x00FF,
52191   kControlAddFontSizeMask = 0x0100
52192 };
52193
52194
52195
52196
52197 enum {
52198   kControlAddToMetaFontMask = 0x0200
52199 };
52200
52201
52202
52203
52204
52205 enum {
52206   kControlUseThemeFontIDMask = 0x0080
52207 };
52208
52209 struct ControlFontStyleRec {
52210   SInt16 flags;
52211   SInt16 font;
52212   SInt16 size;
52213   SInt16 style;
52214   SInt16 mode;
52215   SInt16 just;
52216   RGBColor foreColor;
52217   RGBColor backColor;
52218 };
52219 typedef struct ControlFontStyleRec ControlFontStyleRec;
52220 typedef ControlFontStyleRec * ControlFontStylePtr;
52221 enum {
52222   kDoNotActivateAndIgnoreClick = 0,
52223   kDoNotActivateAndHandleClick = 1,
52224   kActivateAndIgnoreClick = 2,
52225   kActivateAndHandleClick = 3
52226 };
52227
52228 typedef UInt32 ClickActivationResult;
52229 enum {
52230   kControlFontStyleTag = 'font',
52231   kControlKeyFilterTag = 'fltr',
52232
52233
52234
52235
52236
52237   kControlKindTag = 'kind',
52238
52239
52240
52241
52242
52243
52244
52245   kControlSizeTag = 'size'
52246 };
52247
52248
52249
52250
52251 enum {
52252
52253   kControlSupportsGhosting = 1 << 0,
52254   kControlSupportsEmbedding = 1 << 1,
52255   kControlSupportsFocus = 1 << 2,
52256   kControlWantsIdle = 1 << 3,
52257   kControlWantsActivate = 1 << 4,
52258   kControlHandlesTracking = 1 << 5,
52259   kControlSupportsDataAccess = 1 << 6,
52260   kControlHasSpecialBackground = 1 << 7,
52261   kControlGetsFocusOnClick = 1 << 8,
52262   kControlSupportsCalcBestRect = 1 << 9,
52263   kControlSupportsLiveFeedback = 1 << 10,
52264   kControlHasRadioBehavior = 1 << 11,
52265   kControlSupportsDragAndDrop = 1 << 12,
52266   kControlAutoToggles = 1 << 14,
52267   kControlSupportsGetRegion = 1 << 17,
52268   kControlSupportsFlattening = 1 << 19,
52269   kControlSupportsSetCursor = 1 << 20,
52270   kControlSupportsContextualMenus = 1 << 21,
52271   kControlSupportsClickActivation = 1 << 22,
52272   kControlIdlesWithTimer = 1 << 23
52273 };
52274
52275
52276
52277
52278 enum {
52279   drawCntl = 0,
52280   testCntl = 1,
52281   calcCRgns = 2,
52282   initCntl = 3,
52283   dispCntl = 4,
52284   posCntl = 5,
52285   thumbCntl = 6,
52286   dragCntl = 7,
52287   autoTrack = 8,
52288   calcCntlRgn = 10,
52289   calcThumbRgn = 11,
52290   drawThumbOutline = 12,
52291   kControlMsgDrawGhost = 13,
52292   kControlMsgCalcBestRect = 14,
52293   kControlMsgHandleTracking = 15,
52294   kControlMsgFocus = 16,
52295   kControlMsgKeyDown = 17,
52296   kControlMsgIdle = 18,
52297   kControlMsgGetFeatures = 19,
52298   kControlMsgSetData = 20,
52299   kControlMsgGetData = 21,
52300   kControlMsgActivate = 22,
52301   kControlMsgSetUpBackground = 23,
52302   kControlMsgCalcValueFromPos = 26,
52303   kControlMsgTestNewMsgSupport = 27,
52304   kControlMsgSubValueChanged = 25,
52305   kControlMsgSubControlAdded = 28,
52306   kControlMsgSubControlRemoved = 29,
52307   kControlMsgApplyTextColor = 30,
52308   kControlMsgGetRegion = 31,
52309   kControlMsgFlatten = 32,
52310   kControlMsgSetCursor = 33,
52311   kControlMsgDragEnter = 38,
52312   kControlMsgDragLeave = 39,
52313   kControlMsgDragWithin = 40,
52314   kControlMsgDragReceive = 41,
52315   kControlMsgDisplayDebugInfo = 46,
52316   kControlMsgContextualMenuClick = 47,
52317   kControlMsgGetClickActivation = 48
52318 };
52319
52320 typedef SInt16 ControlDefProcMessage;
52321 enum {
52322
52323
52324
52325
52326
52327   kControlSizeNormal = 0,
52328
52329
52330
52331
52332
52333
52334   kControlSizeSmall = 1,
52335
52336
52337
52338
52339
52340
52341   kControlSizeLarge = 2,
52342
52343
52344
52345
52346
52347
52348   kControlSizeAuto = 0xFFFF
52349 };
52350
52351 typedef UInt16 ControlSize;
52352
52353
52354
52355 enum {
52356   kDrawControlEntireControl = 0,
52357   kDrawControlIndicatorOnly = 129
52358 };
52359
52360
52361
52362
52363 enum {
52364   kDragControlEntireControl = 0,
52365   kDragControlIndicator = 1
52366 };
52367
52368
52369
52370
52371 struct IndicatorDragConstraint {
52372   Rect limitRect;
52373   Rect slopRect;
52374   DragConstraint axis;
52375 };
52376 typedef struct IndicatorDragConstraint IndicatorDragConstraint;
52377 typedef IndicatorDragConstraint * IndicatorDragConstraintPtr;
52378
52379
52380
52381 enum {
52382   kControlSupportsNewMessages = ' ok '
52383 };
52384
52385
52386
52387
52388
52389 struct ControlTrackingRec {
52390   Point startPt;
52391   EventModifiers modifiers;
52392   ControlActionUPP action;
52393 };
52394 typedef struct ControlTrackingRec ControlTrackingRec;
52395 typedef ControlTrackingRec * ControlTrackingPtr;
52396
52397
52398
52399 struct ControlKeyDownRec {
52400   EventModifiers modifiers;
52401   SInt16 keyCode;
52402   SInt16 charCode;
52403 };
52404 typedef struct ControlKeyDownRec ControlKeyDownRec;
52405 typedef ControlKeyDownRec * ControlKeyDownPtr;
52406
52407
52408
52409
52410 struct ControlDataAccessRec {
52411   ResType tag;
52412   ResType part;
52413   Size size;
52414   Ptr dataPtr;
52415 };
52416 typedef struct ControlDataAccessRec ControlDataAccessRec;
52417 typedef ControlDataAccessRec * ControlDataAccessPtr;
52418
52419
52420
52421 struct ControlCalcSizeRec {
52422   SInt16 height;
52423   SInt16 width;
52424   SInt16 baseLine;
52425 };
52426 typedef struct ControlCalcSizeRec ControlCalcSizeRec;
52427 typedef ControlCalcSizeRec * ControlCalcSizePtr;
52428
52429
52430
52431
52432 struct ControlBackgroundRec {
52433   SInt16 depth;
52434   Boolean colorDevice;
52435 };
52436 typedef struct ControlBackgroundRec ControlBackgroundRec;
52437 typedef ControlBackgroundRec * ControlBackgroundPtr;
52438
52439
52440
52441
52442 struct ControlApplyTextColorRec {
52443   SInt16 depth;
52444   Boolean colorDevice;
52445   Boolean active;
52446 };
52447 typedef struct ControlApplyTextColorRec ControlApplyTextColorRec;
52448 typedef ControlApplyTextColorRec * ControlApplyTextColorPtr;
52449
52450
52451
52452
52453 struct ControlGetRegionRec {
52454   RgnHandle region;
52455   ControlPartCode part;
52456 };
52457 typedef struct ControlGetRegionRec ControlGetRegionRec;
52458 typedef ControlGetRegionRec * ControlGetRegionPtr;
52459
52460
52461
52462
52463 struct ControlSetCursorRec {
52464   Point localPoint;
52465   EventModifiers modifiers;
52466   Boolean cursorWasSet;
52467 };
52468 typedef struct ControlSetCursorRec ControlSetCursorRec;
52469 typedef ControlSetCursorRec * ControlSetCursorPtr;
52470
52471
52472
52473
52474
52475 struct ControlContextualMenuClickRec {
52476   Point localPoint;
52477   Boolean menuDisplayed;
52478 };
52479 typedef struct ControlContextualMenuClickRec ControlContextualMenuClickRec;
52480 typedef ControlContextualMenuClickRec * ControlContextualMenuClickPtr;
52481
52482
52483
52484
52485
52486 struct ControlClickActivationRec {
52487   Point localPoint;
52488   EventModifiers modifiers;
52489   ClickActivationResult result;
52490 };
52491 typedef struct ControlClickActivationRec ControlClickActivationRec;
52492 typedef ControlClickActivationRec * ControlClickActivationPtr;
52493
52494
52495
52496 typedef SInt32 ( * ControlDefProcPtr)(SInt16 varCode, ControlRef theControl, ControlDefProcMessage message, SInt32 param);
52497 typedef ControlDefProcPtr ControlDefUPP;
52498 extern ControlDefUPP
52499 NewControlDefUPP(ControlDefProcPtr userRoutine) ;
52500 extern void
52501 DisposeControlDefUPP(ControlDefUPP userUPP) ;
52502 extern SInt32
52503 InvokeControlDefUPP(
52504   SInt16 varCode,
52505   ControlRef theControl,
52506   ControlDefProcMessage message,
52507   SInt32 param,
52508   ControlDefUPP userUPP) ;
52509 enum {
52510   kControlKeyFilterBlockKey = 0,
52511   kControlKeyFilterPassKey = 1
52512 };
52513
52514 typedef SInt16 ControlKeyFilterResult;
52515 typedef ControlKeyFilterResult ( * ControlKeyFilterProcPtr)(ControlRef theControl, SInt16 *keyCode, SInt16 *charCode, EventModifiers *modifiers);
52516 typedef ControlKeyFilterProcPtr ControlKeyFilterUPP;
52517 extern ControlKeyFilterUPP
52518 NewControlKeyFilterUPP(ControlKeyFilterProcPtr userRoutine) ;
52519 extern void
52520 DisposeControlKeyFilterUPP(ControlKeyFilterUPP userUPP) ;
52521 extern ControlKeyFilterResult
52522 InvokeControlKeyFilterUPP(
52523   ControlRef theControl,
52524   SInt16 * keyCode,
52525   SInt16 * charCode,
52526   EventModifiers * modifiers,
52527   ControlKeyFilterUPP userUPP) ;
52528
52529
52530
52531
52532
52533
52534
52535 enum {
52536   noConstraint = kNoConstraint,
52537   hAxisOnly = 1,
52538   vAxisOnly = 2
52539 };
52540
52541
52542
52543
52544
52545 enum {
52546   kControlDefProcPtr = 0,
52547   kControlDefObjectClass = 1
52548 };
52549
52550 typedef UInt32 ControlDefType;
52551 struct ControlDefSpec {
52552   ControlDefType defType;
52553   union {
52554     ControlDefUPP defProc;
52555     void * classRef;
52556   } u;
52557 };
52558 typedef struct ControlDefSpec ControlDefSpec;
52559 extern OSStatus
52560 CreateCustomControl(
52561   WindowRef owningWindow,
52562   const Rect * contBounds,
52563   const ControlDefSpec * def,
52564   Collection initData,
52565   ControlRef * outControl) ;
52566 extern ControlRef
52567 NewControl(
52568   WindowRef owningWindow,
52569   const Rect * boundsRect,
52570   ConstStr255Param controlTitle,
52571   Boolean initiallyVisible,
52572   SInt16 initialValue,
52573   SInt16 minimumValue,
52574   SInt16 maximumValue,
52575   SInt16 procID,
52576   SInt32 controlReference) ;
52577 extern ControlRef
52578 GetNewControl(
52579   SInt16 resourceID,
52580   WindowRef owningWindow) ;
52581 extern void
52582 DisposeControl(ControlRef theControl) ;
52583 extern void
52584 KillControls(WindowRef theWindow) ;
52585 typedef OSStatus ( * ControlCNTLToCollectionProcPtr)(const Rect *bounds, SInt16 value, Boolean visible, SInt16 max, SInt16 min, SInt16 procID, SInt32 refCon, ConstStr255Param title, Collection collection);
52586 typedef ControlCNTLToCollectionProcPtr ControlCNTLToCollectionUPP;
52587 extern ControlCNTLToCollectionUPP
52588 NewControlCNTLToCollectionUPP(ControlCNTLToCollectionProcPtr userRoutine) ;
52589 extern void
52590 DisposeControlCNTLToCollectionUPP(ControlCNTLToCollectionUPP userUPP) ;
52591 extern OSStatus
52592 InvokeControlCNTLToCollectionUPP(
52593   const Rect * bounds,
52594   SInt16 value,
52595   Boolean visible,
52596   SInt16 max,
52597   SInt16 min,
52598   SInt16 procID,
52599   SInt32 refCon,
52600   ConstStr255Param title,
52601   Collection collection,
52602   ControlCNTLToCollectionUPP userUPP) ;
52603 extern OSStatus
52604 RegisterControlDefinition(
52605   SInt16 inCDEFResID,
52606   const ControlDefSpec * inControlDef,
52607   ControlCNTLToCollectionUPP inConversionProc) ;
52608 extern void
52609 HiliteControl(
52610   ControlRef theControl,
52611   ControlPartCode hiliteState) ;
52612 extern void
52613 ShowControl(ControlRef theControl) ;
52614 extern void
52615 HideControl(ControlRef theControl) ;
52616 extern Boolean
52617 IsControlActive(ControlRef inControl) ;
52618 extern Boolean
52619 IsControlVisible(ControlRef inControl) ;
52620 extern OSErr
52621 ActivateControl(ControlRef inControl) ;
52622 extern OSErr
52623 DeactivateControl(ControlRef inControl) ;
52624 extern OSErr
52625 SetControlVisibility(
52626   ControlRef inControl,
52627   Boolean inIsVisible,
52628   Boolean inDoDraw) ;
52629 extern Boolean
52630 IsControlEnabled(ControlRef inControl) ;
52631 extern OSStatus
52632 EnableControl(ControlRef inControl) ;
52633 extern OSStatus
52634 DisableControl(ControlRef inControl) ;
52635 extern void
52636 DrawControls(WindowRef theWindow) ;
52637 extern void
52638 Draw1Control(ControlRef theControl) ;
52639 extern void
52640 UpdateControls(
52641   WindowRef inWindow,
52642   RgnHandle inUpdateRegion) ;
52643 extern OSErr
52644 GetBestControlRect(
52645   ControlRef inControl,
52646   Rect * outRect,
52647   SInt16 * outBaseLineOffset) ;
52648 extern OSErr
52649 SetControlFontStyle(
52650   ControlRef inControl,
52651   const ControlFontStyleRec * inStyle) ;
52652 extern void
52653 DrawControlInCurrentPort(ControlRef inControl) ;
52654 extern OSErr
52655 SetUpControlBackground(
52656   ControlRef inControl,
52657   SInt16 inDepth,
52658   Boolean inIsColorDevice) ;
52659 extern OSErr
52660 SetUpControlTextColor(
52661   ControlRef inControl,
52662   SInt16 inDepth,
52663   Boolean inIsColorDevice) ;
52664 typedef OSStatus ( * ControlColorProcPtr)(ControlRef inControl, SInt16 inMessage, SInt16 inDrawDepth, Boolean inDrawInColor);
52665 typedef ControlColorProcPtr ControlColorUPP;
52666 extern ControlColorUPP
52667 NewControlColorUPP(ControlColorProcPtr userRoutine) ;
52668 extern void
52669 DisposeControlColorUPP(ControlColorUPP userUPP) ;
52670 extern OSStatus
52671 InvokeControlColorUPP(
52672   ControlRef inControl,
52673   SInt16 inMessage,
52674   SInt16 inDrawDepth,
52675   Boolean inDrawInColor,
52676   ControlColorUPP userUPP) ;
52677 extern OSStatus
52678 SetControlColorProc(
52679   ControlRef inControl,
52680   ControlColorUPP inProc) ;
52681 extern ControlPartCode
52682 TrackControl(
52683   ControlRef theControl,
52684   Point startPoint,
52685   ControlActionUPP actionProc) ;
52686 extern void
52687 DragControl(
52688   ControlRef theControl,
52689   Point startPoint,
52690   const Rect * limitRect,
52691   const Rect * slopRect,
52692   DragConstraint axis) ;
52693 extern ControlPartCode
52694 TestControl(
52695   ControlRef theControl,
52696   Point testPoint) ;
52697 extern ControlPartCode
52698 FindControl(
52699   Point testPoint,
52700   WindowRef theWindow,
52701   ControlRef * theControl) ;
52702 extern ControlRef
52703 FindControlUnderMouse(
52704   Point inWhere,
52705   WindowRef inWindow,
52706   ControlPartCode * outPart) ;
52707 extern ControlPartCode
52708 HandleControlClick(
52709   ControlRef inControl,
52710   Point inWhere,
52711   EventModifiers inModifiers,
52712   ControlActionUPP inAction) ;
52713 extern OSStatus
52714 HandleControlContextualMenuClick(
52715   ControlRef inControl,
52716   Point inWhere,
52717   Boolean * menuDisplayed) ;
52718 extern OSStatus
52719 GetControlClickActivation(
52720   ControlRef inControl,
52721   Point inWhere,
52722   EventModifiers inModifiers,
52723   ClickActivationResult * outResult) ;
52724 extern ControlPartCode
52725 HandleControlKey(
52726   ControlRef inControl,
52727   SInt16 inKeyCode,
52728   SInt16 inCharCode,
52729   EventModifiers inModifiers) ;
52730 extern void
52731 IdleControls(WindowRef inWindow) ;
52732 extern OSStatus
52733 HandleControlSetCursor(
52734   ControlRef control,
52735   Point localPoint,
52736   EventModifiers modifiers,
52737   Boolean * cursorWasSet) ;
52738 extern void
52739 MoveControl(
52740   ControlRef theControl,
52741   SInt16 h,
52742   SInt16 v) ;
52743 extern void
52744 SizeControl(
52745   ControlRef theControl,
52746   SInt16 w,
52747   SInt16 h) ;
52748 extern void
52749 SetControlTitle(
52750   ControlRef theControl,
52751   ConstStr255Param title) ;
52752 extern void
52753 GetControlTitle(
52754   ControlRef theControl,
52755   Str255 title) ;
52756 extern OSStatus
52757 SetControlTitleWithCFString(
52758   ControlRef inControl,
52759   CFStringRef inString) ;
52760 extern OSStatus
52761 CopyControlTitleAsCFString(
52762   ControlRef inControl,
52763   CFStringRef * outString) ;
52764 extern SInt16
52765 GetControlValue(ControlRef theControl) ;
52766 extern void
52767 SetControlValue(
52768   ControlRef theControl,
52769   SInt16 newValue) ;
52770 extern SInt16
52771 GetControlMinimum(ControlRef theControl) ;
52772 extern void
52773 SetControlMinimum(
52774   ControlRef theControl,
52775   SInt16 newMinimum) ;
52776 extern SInt16
52777 GetControlMaximum(ControlRef theControl) ;
52778 extern void
52779 SetControlMaximum(
52780   ControlRef theControl,
52781   SInt16 newMaximum) ;
52782 extern SInt32
52783 GetControlViewSize(ControlRef theControl) ;
52784 extern void
52785 SetControlViewSize(
52786   ControlRef theControl,
52787   SInt32 newViewSize) ;
52788 extern SInt32
52789 GetControl32BitValue(ControlRef theControl) ;
52790 extern void
52791 SetControl32BitValue(
52792   ControlRef theControl,
52793   SInt32 newValue) ;
52794 extern SInt32
52795 GetControl32BitMaximum(ControlRef theControl) ;
52796 extern void
52797 SetControl32BitMaximum(
52798   ControlRef theControl,
52799   SInt32 newMaximum) ;
52800 extern SInt32
52801 GetControl32BitMinimum(ControlRef theControl) ;
52802 extern void
52803 SetControl32BitMinimum(
52804   ControlRef theControl,
52805   SInt32 newMinimum) ;
52806 extern Boolean
52807 IsValidControlHandle(ControlRef theControl) ;
52808
52809
52810
52811
52812
52813
52814 struct ControlID {
52815   OSType signature;
52816   SInt32 id;
52817 };
52818 typedef struct ControlID ControlID;
52819 extern OSStatus
52820 SetControlID(
52821   ControlRef inControl,
52822   const ControlID * inID) ;
52823 extern OSStatus
52824 GetControlID(
52825   ControlRef inControl,
52826   ControlID * outID) ;
52827 extern OSStatus
52828 GetControlByID(
52829   WindowRef inWindow,
52830   const ControlID * inID,
52831   ControlRef * outControl) ;
52832 extern OSStatus
52833 SetControlCommandID(
52834   ControlRef inControl,
52835   UInt32 inCommandID) ;
52836 extern OSStatus
52837 GetControlCommandID(
52838   ControlRef inControl,
52839   UInt32 * outCommandID) ;
52840
52841
52842
52843
52844
52845
52846 struct ControlKind {
52847   OSType signature;
52848   OSType kind;
52849 };
52850 typedef struct ControlKind ControlKind;
52851
52852
52853
52854
52855
52856 enum {
52857
52858
52859
52860
52861   kControlKindSignatureApple = 'appl'
52862 };
52863 extern OSStatus
52864 GetControlKind(
52865   ControlRef inControl,
52866   ControlKind * outControlKind) ;
52867
52868
52869
52870
52871
52872 enum {
52873   kControlPropertyPersistent = 0x00000001
52874 };
52875 extern OSStatus
52876 GetControlProperty(
52877   ControlRef control,
52878   OSType propertyCreator,
52879   OSType propertyTag,
52880   UInt32 bufferSize,
52881   UInt32 * actualSize,
52882   void * propertyBuffer) ;
52883 extern OSStatus
52884 GetControlPropertySize(
52885   ControlRef control,
52886   OSType propertyCreator,
52887   OSType propertyTag,
52888   UInt32 * size) ;
52889 extern OSStatus
52890 SetControlProperty(
52891   ControlRef control,
52892   OSType propertyCreator,
52893   OSType propertyTag,
52894   UInt32 propertySize,
52895   const void * propertyData) ;
52896 extern OSStatus
52897 RemoveControlProperty(
52898   ControlRef control,
52899   OSType propertyCreator,
52900   OSType propertyTag) ;
52901 extern OSStatus
52902 GetControlPropertyAttributes(
52903   ControlRef control,
52904   OSType propertyCreator,
52905   OSType propertyTag,
52906   UInt32 * attributes) ;
52907 extern OSStatus
52908 ChangeControlPropertyAttributes(
52909   ControlRef control,
52910   OSType propertyCreator,
52911   OSType propertyTag,
52912   UInt32 attributesToSet,
52913   UInt32 attributesToClear) ;
52914 extern OSStatus
52915 GetControlRegion(
52916   ControlRef inControl,
52917   ControlPartCode inPart,
52918   RgnHandle outRegion) ;
52919 extern ControlVariant
52920 GetControlVariant(ControlRef theControl) ;
52921 extern void
52922 SetControlAction(
52923   ControlRef theControl,
52924   ControlActionUPP actionProc) ;
52925 extern ControlActionUPP
52926 GetControlAction(ControlRef theControl) ;
52927 extern void
52928 SetControlReference(
52929   ControlRef theControl,
52930   SInt32 data) ;
52931 extern SInt32
52932 GetControlReference(ControlRef theControl) ;
52933 extern SInt32
52934 SendControlMessage(
52935   ControlRef inControl,
52936   SInt16 inMessage,
52937   void * inParam) ;
52938 extern OSErr
52939 DumpControlHierarchy(
52940   WindowRef inWindow,
52941   const FSSpec * inDumpFile) ;
52942 extern OSErr
52943 CreateRootControl(
52944   WindowRef inWindow,
52945   ControlRef * outControl) ;
52946 extern OSErr
52947 GetRootControl(
52948   WindowRef inWindow,
52949   ControlRef * outControl) ;
52950 extern OSErr
52951 EmbedControl(
52952   ControlRef inControl,
52953   ControlRef inContainer) ;
52954 extern OSErr
52955 AutoEmbedControl(
52956   ControlRef inControl,
52957   WindowRef inWindow) ;
52958 extern OSErr
52959 GetSuperControl(
52960   ControlRef inControl,
52961   ControlRef * outParent) ;
52962 extern OSErr
52963 CountSubControls(
52964   ControlRef inControl,
52965   UInt16 * outNumChildren) ;
52966 extern OSErr
52967 GetIndexedSubControl(
52968   ControlRef inControl,
52969   UInt16 inIndex,
52970   ControlRef * outSubControl) ;
52971 extern OSErr
52972 SetControlSupervisor(
52973   ControlRef inControl,
52974   ControlRef inBoss) ;
52975 extern OSErr
52976 GetKeyboardFocus(
52977   WindowRef inWindow,
52978   ControlRef * outControl) ;
52979 extern OSErr
52980 SetKeyboardFocus(
52981   WindowRef inWindow,
52982   ControlRef inControl,
52983   ControlFocusPart inPart) ;
52984 extern OSErr
52985 AdvanceKeyboardFocus(WindowRef inWindow) ;
52986 extern OSErr
52987 ReverseKeyboardFocus(WindowRef inWindow) ;
52988 extern OSErr
52989 ClearKeyboardFocus(WindowRef inWindow) ;
52990 extern OSErr
52991 GetControlFeatures(
52992   ControlRef inControl,
52993   UInt32 * outFeatures) ;
52994 extern OSErr
52995 SetControlData(
52996   ControlRef inControl,
52997   ControlPartCode inPart,
52998   ResType inTagName,
52999   Size inSize,
53000   const void * inData) ;
53001 extern OSErr
53002 GetControlData(
53003   ControlRef inControl,
53004   ControlPartCode inPart,
53005   ResType inTagName,
53006   Size inBufferSize,
53007   void * inBuffer,
53008   Size * outActualSize) ;
53009 extern OSErr
53010 GetControlDataSize(
53011   ControlRef inControl,
53012   ControlPartCode inPart,
53013   ResType inTagName,
53014   Size * outMaxSize) ;
53015 enum {
53016
53017
53018
53019
53020
53021   kDragTrackingEnterControl = 2,
53022
53023
53024
53025
53026
53027   kDragTrackingInControl = 3,
53028
53029
53030
53031
53032
53033   kDragTrackingLeaveControl = 4
53034 };
53035 extern OSStatus
53036 HandleControlDragTracking(
53037   ControlRef inControl,
53038   DragTrackingMessage inMessage,
53039   DragReference inDrag,
53040   Boolean * outLikesDrag) ;
53041 extern OSStatus
53042 HandleControlDragReceive(
53043   ControlRef inControl,
53044   DragReference inDrag) ;
53045 extern OSStatus
53046 SetControlDragTrackingEnabled(
53047   ControlRef inControl,
53048   Boolean inTracks) ;
53049 extern OSStatus
53050 IsControlDragTrackingEnabled(
53051   ControlRef inControl,
53052   Boolean * outTracks) ;
53053 extern OSStatus
53054 SetAutomaticControlDragTrackingEnabledForWindow(
53055   WindowRef inWindow,
53056   Boolean inTracks) ;
53057 extern OSStatus
53058 IsAutomaticControlDragTrackingEnabledForWindow(
53059   WindowRef inWindow,
53060   Boolean * outTracks) ;
53061 extern Rect *
53062 GetControlBounds(
53063   ControlRef control,
53064   Rect * bounds) ;
53065 extern Boolean
53066 IsControlHilited(ControlRef control) ;
53067 extern UInt16
53068 GetControlHilite(ControlRef control) ;
53069 extern WindowRef
53070 GetControlOwner(ControlRef control) ;
53071 extern Handle
53072 GetControlDataHandle(ControlRef control) ;
53073 extern MenuRef
53074 GetControlPopupMenuHandle(ControlRef control) ;
53075 extern short
53076 GetControlPopupMenuID(ControlRef control) ;
53077 extern void
53078 SetControlDataHandle(
53079   ControlRef control,
53080   Handle dataHandle) ;
53081 extern void
53082 SetControlBounds(
53083   ControlRef control,
53084   const Rect * bounds) ;
53085 extern void
53086 SetControlPopupMenuHandle(
53087   ControlRef control,
53088   MenuRef popupMenu) ;
53089 extern void
53090 SetControlPopupMenuID(
53091   ControlRef control,
53092   short menuID) ;
53093
53094
53095
53096
53097
53098
53099 }
53100
53101
53102
53103 extern "C" {
53104
53105
53106 typedef OSType PropertyCreator;
53107 typedef OSType PropertyTag;
53108 typedef UInt32 WindowClass;
53109 enum {
53110   kAlertWindowClass = 1,
53111   kMovableAlertWindowClass = 2,
53112   kModalWindowClass = 3,
53113   kMovableModalWindowClass = 4,
53114   kFloatingWindowClass = 5,
53115   kDocumentWindowClass = 6,
53116   kUtilityWindowClass = 8,
53117   kHelpWindowClass = 10,
53118   kSheetWindowClass = 11,
53119   kToolbarWindowClass = 12,
53120   kPlainWindowClass = 13,
53121   kOverlayWindowClass = 14,
53122   kSheetAlertWindowClass = 15,
53123   kAltPlainWindowClass = 16,
53124   kDrawerWindowClass = 20,
53125   kAllWindowClasses = (unsigned long)0xFFFFFFFF
53126 };
53127
53128
53129
53130
53131
53132
53133 typedef UInt32 WindowAttributes;
53134
53135
53136
53137
53138
53139 enum {
53140
53141
53142
53143
53144   kWindowNoAttributes = 0L,
53145
53146
53147
53148
53149
53150
53151   kWindowCloseBoxAttribute = (1L << 0),
53152
53153
53154
53155
53156
53157
53158   kWindowHorizontalZoomAttribute = (1L << 1),
53159
53160
53161
53162
53163
53164
53165   kWindowVerticalZoomAttribute = (1L << 2),
53166
53167
53168
53169
53170
53171
53172   kWindowFullZoomAttribute = (kWindowVerticalZoomAttribute | kWindowHorizontalZoomAttribute),
53173
53174
53175
53176
53177
53178
53179
53180   kWindowCollapseBoxAttribute = (1L << 3),
53181
53182
53183
53184
53185
53186
53187   kWindowResizableAttribute = (1L << 4),
53188
53189
53190
53191
53192
53193
53194   kWindowSideTitlebarAttribute = (1L << 5),
53195
53196
53197
53198
53199
53200   kWindowToolbarButtonAttribute = (1L << 6),
53201   kWindowMetalAttribute = (1L << 8),
53202
53203
53204
53205
53206   kWindowNoUpdatesAttribute = (1L << 16),
53207
53208
53209
53210
53211   kWindowNoActivatesAttribute = (1L << 17),
53212
53213
53214
53215
53216
53217
53218
53219   kWindowOpaqueForEventsAttribute = (1L << 18),
53220   kWindowCompositingAttribute = (1L << 19),
53221
53222
53223
53224
53225
53226
53227   kWindowNoShadowAttribute = (1L << 21),
53228
53229
53230
53231
53232
53233
53234
53235   kWindowHideOnSuspendAttribute = (1L << 24),
53236
53237
53238
53239
53240
53241   kWindowStandardHandlerAttribute = (1L << 25),
53242
53243
53244
53245
53246
53247
53248
53249   kWindowHideOnFullScreenAttribute = (1L << 26),
53250
53251
53252
53253
53254
53255
53256   kWindowInWindowMenuAttribute = (1L << 27),
53257
53258
53259
53260
53261
53262   kWindowLiveResizeAttribute = (1L << 28),
53263
53264
53265
53266
53267
53268
53269
53270   kWindowIgnoreClicksAttribute = (1L << 29),
53271
53272
53273
53274
53275
53276
53277
53278   kWindowNoConstrainAttribute = (unsigned long)((1L << 31)),
53279
53280
53281
53282
53283
53284   kWindowStandardDocumentAttributes = (kWindowCloseBoxAttribute | kWindowFullZoomAttribute | kWindowCollapseBoxAttribute | kWindowResizableAttribute),
53285
53286
53287
53288
53289
53290   kWindowStandardFloatingAttributes = (kWindowCloseBoxAttribute | kWindowCollapseBoxAttribute)
53291 };
53292
53293
53294
53295
53296
53297 enum {
53298   kWindowDefProcType = 'WDEF'
53299 };
53300
53301
53302
53303
53304 enum {
53305   kStandardWindowDefinition = 0,
53306   kRoundWindowDefinition = 1,
53307   kFloatingWindowDefinition = 124
53308 };
53309
53310
53311
53312
53313 enum {
53314
53315   kDocumentWindowVariantCode = 0,
53316   kModalDialogVariantCode = 1,
53317   kPlainDialogVariantCode = 2,
53318   kShadowDialogVariantCode = 3,
53319   kMovableModalDialogVariantCode = 5,
53320   kAlertVariantCode = 7,
53321   kMovableAlertVariantCode = 9,
53322   kSideFloaterVariantCode = 8
53323 };
53324
53325
53326
53327
53328
53329 enum {
53330
53331   documentProc = 0,
53332   dBoxProc = 1,
53333   plainDBox = 2,
53334   altDBoxProc = 3,
53335   noGrowDocProc = 4,
53336   movableDBoxProc = 5,
53337   zoomDocProc = 8,
53338   zoomNoGrow = 12,
53339   floatProc = 1985,
53340   floatGrowProc = 1987,
53341   floatZoomProc = 1989,
53342   floatZoomGrowProc = 1991,
53343   floatSideProc = 1993,
53344   floatSideGrowProc = 1995,
53345   floatSideZoomProc = 1997,
53346   floatSideZoomGrowProc = 1999
53347 };
53348 enum {
53349
53350   kWindowDocumentDefProcResID = 64,
53351   kWindowDialogDefProcResID = 65,
53352   kWindowUtilityDefProcResID = 66,
53353   kWindowUtilitySideTitleDefProcResID = 67,
53354   kWindowSheetDefProcResID = 68,
53355   kWindowSimpleDefProcResID = 69,
53356   kWindowSheetAlertDefProcResID = 70
53357 };
53358
53359 enum {
53360
53361   kWindowDocumentProc = 1024,
53362   kWindowGrowDocumentProc = 1025,
53363   kWindowVertZoomDocumentProc = 1026,
53364   kWindowVertZoomGrowDocumentProc = 1027,
53365   kWindowHorizZoomDocumentProc = 1028,
53366   kWindowHorizZoomGrowDocumentProc = 1029,
53367   kWindowFullZoomDocumentProc = 1030,
53368   kWindowFullZoomGrowDocumentProc = 1031
53369 };
53370
53371
53372 enum {
53373
53374   kWindowPlainDialogProc = 1040,
53375   kWindowShadowDialogProc = 1041,
53376   kWindowModalDialogProc = 1042,
53377   kWindowMovableModalDialogProc = 1043,
53378   kWindowAlertProc = 1044,
53379   kWindowMovableAlertProc = 1045
53380 };
53381
53382
53383 enum {
53384
53385   kWindowMovableModalGrowProc = 1046
53386 };
53387
53388
53389 enum {
53390
53391   kWindowFloatProc = 1057,
53392   kWindowFloatGrowProc = 1059,
53393   kWindowFloatVertZoomProc = 1061,
53394   kWindowFloatVertZoomGrowProc = 1063,
53395   kWindowFloatHorizZoomProc = 1065,
53396   kWindowFloatHorizZoomGrowProc = 1067,
53397   kWindowFloatFullZoomProc = 1069,
53398   kWindowFloatFullZoomGrowProc = 1071
53399 };
53400
53401
53402 enum {
53403
53404   kWindowFloatSideProc = 1073,
53405   kWindowFloatSideGrowProc = 1075,
53406   kWindowFloatSideVertZoomProc = 1077,
53407   kWindowFloatSideVertZoomGrowProc = 1079,
53408   kWindowFloatSideHorizZoomProc = 1081,
53409   kWindowFloatSideHorizZoomGrowProc = 1083,
53410   kWindowFloatSideFullZoomProc = 1085,
53411   kWindowFloatSideFullZoomGrowProc = 1087
53412 };
53413
53414
53415 enum {
53416
53417   kWindowSheetProc = 1088,
53418   kWindowSheetAlertProc = 1120
53419 };
53420
53421
53422
53423
53424
53425
53426
53427 enum {
53428
53429
53430
53431
53432
53433
53434   kWindowSimpleProc = 1104,
53435
53436
53437
53438
53439   kWindowSimpleFrameProc = 1105
53440 };
53441 enum {
53442   kWindowNoPosition = 0x0000,
53443   kWindowDefaultPosition = 0x0000,
53444   kWindowCenterMainScreen = 0x280A,
53445   kWindowAlertPositionMainScreen = 0x300A,
53446   kWindowStaggerMainScreen = 0x380A,
53447   kWindowCenterParentWindow = 0xA80A,
53448   kWindowAlertPositionParentWindow = 0xB00A,
53449   kWindowStaggerParentWindow = 0xB80A,
53450   kWindowCenterParentWindowScreen = 0x680A,
53451   kWindowAlertPositionParentWindowScreen = 0x700A,
53452   kWindowStaggerParentWindowScreen = 0x780A
53453 };
53454 typedef UInt32 WindowPositionMethod;
53455 enum {
53456
53457
53458
53459
53460   kWindowCenterOnMainScreen = 1,
53461
53462
53463
53464
53465   kWindowCenterOnParentWindow = 2,
53466
53467
53468
53469
53470
53471   kWindowCenterOnParentWindowScreen = 3,
53472
53473
53474
53475
53476   kWindowCascadeOnMainScreen = 4,
53477
53478
53479
53480
53481   kWindowCascadeOnParentWindow = 5,
53482
53483
53484
53485
53486
53487   kWindowCascadeOnParentWindowScreen = 6,
53488
53489
53490
53491
53492
53493
53494
53495   kWindowCascadeStartAtParentWindowScreen = 10,
53496
53497
53498
53499
53500   kWindowAlertPositionOnMainScreen = 7,
53501
53502
53503
53504
53505   kWindowAlertPositionOnParentWindow = 8,
53506
53507
53508
53509
53510
53511   kWindowAlertPositionOnParentWindowScreen = 9
53512 };
53513
53514
53515
53516
53517
53518 typedef UInt16 WindowRegionCode;
53519 enum {
53520
53521   kWindowTitleBarRgn = 0,
53522   kWindowTitleTextRgn = 1,
53523   kWindowCloseBoxRgn = 2,
53524   kWindowZoomBoxRgn = 3,
53525   kWindowDragRgn = 5,
53526   kWindowGrowRgn = 6,
53527   kWindowCollapseBoxRgn = 7,
53528   kWindowTitleProxyIconRgn = 8,
53529   kWindowStructureRgn = 32,
53530   kWindowContentRgn = 33,
53531   kWindowUpdateRgn = 34,
53532   kWindowOpaqueRgn = 35,
53533   kWindowGlobalPortRgn = 40
53534 };
53535
53536
53537 struct GetWindowRegionRec {
53538   RgnHandle winRgn;
53539   WindowRegionCode regionCode;
53540 };
53541 typedef struct GetWindowRegionRec GetWindowRegionRec;
53542 typedef GetWindowRegionRec * GetWindowRegionPtr;
53543 typedef GetWindowRegionRec * GetWindowRegionRecPtr;
53544 struct SetupWindowProxyDragImageRec {
53545   GWorldPtr imageGWorld;
53546   RgnHandle imageRgn;
53547   RgnHandle outlineRgn;
53548 };
53549 typedef struct SetupWindowProxyDragImageRec SetupWindowProxyDragImageRec;
53550
53551 struct MeasureWindowTitleRec {
53552
53553   SInt16 fullTitleWidth;
53554   SInt16 titleTextWidth;
53555
53556
53557   Boolean isUnicodeTitle;
53558   Boolean unused;
53559 };
53560 typedef struct MeasureWindowTitleRec MeasureWindowTitleRec;
53561 typedef MeasureWindowTitleRec * MeasureWindowTitleRecPtr;
53562
53563
53564
53565
53566
53567
53568
53569 struct GetGrowImageRegionRec {
53570   Rect growRect;
53571   RgnHandle growImageRegion;
53572 };
53573 typedef struct GetGrowImageRegionRec GetGrowImageRegionRec;
53574
53575
53576
53577 enum {
53578   dialogKind = 2,
53579   userKind = 8,
53580   kDialogWindowKind = 2,
53581   kApplicationWindowKind = 8
53582 };
53583
53584
53585
53586
53587
53588 typedef SInt16 WindowPartCode;
53589 enum {
53590   inDesk = 0,
53591   inNoWindow = 0,
53592   inMenuBar = 1,
53593   inSysWindow = 2,
53594   inContent = 3,
53595   inDrag = 4,
53596   inGrow = 5,
53597   inGoAway = 6,
53598   inZoomIn = 7,
53599   inZoomOut = 8,
53600   inCollapseBox = 11,
53601   inProxyIcon = 12,
53602   inToolbarButton = 13,
53603   inStructure = 15
53604 };
53605
53606
53607
53608
53609 typedef SInt16 WindowDefPartCode;
53610 enum {
53611   wNoHit = 0,
53612   wInContent = 1,
53613   wInDrag = 2,
53614   wInGrow = 3,
53615   wInGoAway = 4,
53616   wInZoomIn = 5,
53617   wInZoomOut = 6,
53618   wInCollapseBox = 9,
53619   wInProxyIcon = 10,
53620   wInToolbarButton = 11,
53621   wInStructure = 13
53622 };
53623
53624
53625
53626
53627
53628 enum {
53629   kWindowMsgDraw = 0,
53630   kWindowMsgHitTest = 1,
53631   kWindowMsgCalculateShape = 2,
53632   kWindowMsgInitialize = 3,
53633   kWindowMsgCleanUp = 4,
53634   kWindowMsgDrawGrowOutline = 5,
53635   kWindowMsgDrawGrowBox = 6
53636 };
53637
53638
53639 enum {
53640   kWindowMsgGetFeatures = 7,
53641   kWindowMsgGetRegion = 8
53642 };
53643
53644
53645 enum {
53646   kWindowMsgDragHilite = 9,
53647   kWindowMsgModified = 10,
53648   kWindowMsgDrawInCurrentPort = 11,
53649   kWindowMsgSetupProxyDragImage = 12,
53650   kWindowMsgStateChanged = 13,
53651   kWindowMsgMeasureTitle = 14
53652 };
53653
53654
53655 enum {
53656   kWindowMsgGetGrowImageRegion = 19
53657 };
53658
53659
53660 enum {
53661   wDraw = 0,
53662   wHit = 1,
53663   wCalcRgns = 2,
53664   wNew = 3,
53665   wDispose = 4,
53666   wGrow = 5,
53667   wDrawGIcon = 6
53668 };
53669
53670
53671
53672
53673 enum {
53674   kWindowStateTitleChanged = (1 << 0)
53675 };
53676
53677
53678
53679
53680
53681 enum {
53682   kWindowCanGrow = (1 << 0),
53683   kWindowCanZoom = (1 << 1),
53684   kWindowCanCollapse = (1 << 2),
53685   kWindowIsModal = (1 << 3),
53686   kWindowCanGetWindowRegion = (1 << 4),
53687   kWindowIsAlert = (1 << 5),
53688   kWindowHasTitleBar = (1 << 6)
53689 };
53690
53691
53692 enum {
53693   kWindowSupportsDragHilite = (1 << 7),
53694   kWindowSupportsModifiedBit = (1 << 8),
53695   kWindowCanDrawInCurrentPort = (1 << 9),
53696   kWindowCanSetupProxyDragImage = (1 << 10),
53697   kWindowCanMeasureTitle = (1 << 11),
53698   kWindowWantsDisposeAtProcessDeath = (1 << 12),
53699   kWindowSupportsGetGrowImageRegion = (1 << 13),
53700   kWindowDefSupportsColorGrafPort = 0x40000002
53701 };
53702
53703
53704 enum {
53705   kWindowIsOpaque = (1 << 14)
53706 };
53707
53708
53709
53710
53711
53712 enum {
53713   kWindowSupportsSetGrowImageRegion = (1 << 13)
53714 };
53715
53716
53717
53718
53719 enum {
53720   deskPatID = 16
53721 };
53722
53723
53724
53725
53726
53727
53728 enum {
53729   wContentColor = 0,
53730   wFrameColor = 1,
53731   wTextColor = 2,
53732   wHiliteColor = 3,
53733   wTitleBarColor = 4
53734 };
53735
53736
53737
53738
53739
53740
53741 enum {
53742   kMouseUpOutOfSlop = (long)0x80008000
53743 };
53744
53745
53746
53747
53748
53749 struct WinCTab {
53750   long wCSeed;
53751   short wCReserved;
53752   short ctSize;
53753   ColorSpec ctTable[5];
53754 };
53755 typedef struct WinCTab WinCTab;
53756 typedef WinCTab * WCTabPtr;
53757 typedef WCTabPtr * WCTabHandle;
53758 enum {
53759   kWindowDefinitionVersionOne = 1,
53760   kWindowDefinitionVersionTwo = 2
53761 };
53762
53763
53764 enum {
53765   kWindowIsCollapsedState = (1 << 0L)
53766 };
53767
53768 struct BasicWindowDescription {
53769   UInt32 descriptionSize;
53770
53771   Rect windowContentRect;
53772   Rect windowZoomRect;
53773   UInt32 windowRefCon;
53774   UInt32 windowStateFlags;
53775   WindowPositionMethod windowPositionMethod;
53776
53777   UInt32 windowDefinitionVersion;
53778   union {
53779     struct {
53780       SInt16 windowDefProc;
53781       Boolean windowHasCloseBox;
53782     } versionOne;
53783
53784     struct {
53785       WindowClass windowClass;
53786       WindowAttributes windowAttributes;
53787     } versionTwo;
53788
53789   } windowDefinition;
53790 };
53791 typedef struct BasicWindowDescription BasicWindowDescription;
53792
53793 enum {
53794   kStoredWindowSystemTag = 'appl',
53795   kStoredBasicWindowDescriptionID = 'sbas',
53796   kStoredWindowPascalTitleID = 's255'
53797 };
53798
53799 enum {
53800   kStoredWindowUnicodeTitleID = 'ustr',
53801   kStoredWindowTitleCFStringID = 'cfst'
53802 };
53803 struct WStateData {
53804   Rect userState;
53805   Rect stdState;
53806 };
53807 typedef struct WStateData WStateData;
53808 typedef WStateData * WStateDataPtr;
53809 typedef WStateDataPtr * WStateDataHandle;
53810
53811
53812
53813 typedef long ( * WindowDefProcPtr)(short varCode, WindowRef window, short message, long param);
53814 typedef void ( * DeskHookProcPtr)(Boolean mouseClick, EventRecord *theEvent);
53815 typedef OSStatus ( * WindowPaintProcPtr)(GDHandle device, GrafPtr qdContext, WindowRef window, RgnHandle inClientPaintRgn, RgnHandle outSystemPaintRgn, void *refCon);
53816 typedef WindowDefProcPtr WindowDefUPP;
53817 typedef DeskHookProcPtr DeskHookUPP;
53818 typedef WindowPaintProcPtr WindowPaintUPP;
53819 extern WindowDefUPP
53820 NewWindowDefUPP(WindowDefProcPtr userRoutine) ;
53821 extern WindowPaintUPP
53822 NewWindowPaintUPP(WindowPaintProcPtr userRoutine) ;
53823 extern void
53824 DisposeWindowDefUPP(WindowDefUPP userUPP) ;
53825 extern void
53826 DisposeWindowPaintUPP(WindowPaintUPP userUPP) ;
53827 extern long
53828 InvokeWindowDefUPP(
53829   short varCode,
53830   WindowRef window,
53831   short message,
53832   long param,
53833   WindowDefUPP userUPP) ;
53834 extern OSStatus
53835 InvokeWindowPaintUPP(
53836   GDHandle device,
53837   GrafPtr qdContext,
53838   WindowRef window,
53839   RgnHandle inClientPaintRgn,
53840   RgnHandle outSystemPaintRgn,
53841   void * refCon,
53842   WindowPaintUPP userUPP) ;
53843
53844
53845
53846
53847 enum {
53848   kWindowDefProcPtr = 0,
53849   kWindowDefObjectClass = 1,
53850   kWindowDefProcID = 2,
53851   kWindowDefHIView = 3
53852 };
53853
53854 typedef UInt32 WindowDefType;
53855 struct WindowDefSpec {
53856   WindowDefType defType;
53857   union {
53858     WindowDefUPP defProc;
53859     void * classRef;
53860     short procID;
53861     void * rootView;
53862   } u;
53863 };
53864 typedef struct WindowDefSpec WindowDefSpec;
53865 typedef WindowDefSpec * WindowDefSpecPtr;
53866 extern WindowRef
53867 GetNewCWindow(
53868   short windowID,
53869   void * wStorage,
53870   WindowRef behind) ;
53871 extern WindowRef
53872 NewWindow(
53873   void * wStorage,
53874   const Rect * boundsRect,
53875   ConstStr255Param title,
53876   Boolean visible,
53877   short theProc,
53878   WindowRef behind,
53879   Boolean goAwayFlag,
53880   long refCon) ;
53881 extern WindowRef
53882 GetNewWindow(
53883   short windowID,
53884   void * wStorage,
53885   WindowRef behind) ;
53886 extern WindowRef
53887 NewCWindow(
53888   void * wStorage,
53889   const Rect * boundsRect,
53890   ConstStr255Param title,
53891   Boolean visible,
53892   short procID,
53893   WindowRef behind,
53894   Boolean goAwayFlag,
53895   long refCon) ;
53896 extern void
53897 DisposeWindow(WindowRef window) ;
53898 extern OSStatus
53899 CreateNewWindow(
53900   WindowClass windowClass,
53901   WindowAttributes attributes,
53902   const Rect * contentBounds,
53903   WindowRef * outWindow) ;
53904 extern OSStatus
53905 CreateWindowFromResource(
53906   SInt16 resID,
53907   WindowRef * outWindow) ;
53908 extern OSStatus
53909 StoreWindowIntoCollection(
53910   WindowRef window,
53911   Collection collection) ;
53912 extern OSStatus
53913 CreateWindowFromCollection(
53914   Collection collection,
53915   WindowRef * outWindow) ;
53916 extern OSStatus
53917 GetWindowOwnerCount(
53918   WindowRef window,
53919   UInt32 * outCount) ;
53920 extern OSStatus
53921 CloneWindow(WindowRef window) ;
53922 extern ItemCount
53923 GetWindowRetainCount(WindowRef inWindow) ;
53924 extern OSStatus
53925 RetainWindow(WindowRef inWindow) ;
53926 extern OSStatus
53927 ReleaseWindow(WindowRef inWindow) ;
53928 extern OSStatus
53929 CreateCustomWindow(
53930   const WindowDefSpec * def,
53931   WindowClass windowClass,
53932   WindowAttributes attributes,
53933   const Rect * contentBounds,
53934   WindowRef * outWindow) ;
53935 extern OSStatus
53936 ReshapeCustomWindow(WindowRef window) ;
53937 extern OSStatus
53938 RegisterWindowDefinition(
53939   SInt16 inResID,
53940   const WindowDefSpec * inDefSpec) ;
53941 extern OSStatus
53942 GetWindowWidgetHilite(
53943   WindowRef inWindow,
53944   WindowDefPartCode * outHilite) ;
53945 extern Boolean
53946 IsValidWindowClass(WindowClass inClass) ;
53947 extern WindowAttributes
53948 GetAvailableWindowAttributes(WindowClass inClass) ;
53949 extern OSStatus
53950 GetWindowClass(
53951   WindowRef window,
53952   WindowClass * outClass) ;
53953 extern OSStatus
53954 GetWindowAttributes(
53955   WindowRef window,
53956   WindowAttributes * outAttributes) ;
53957 extern OSStatus
53958 ChangeWindowAttributes(
53959   WindowRef window,
53960   WindowAttributes setTheseAttributes,
53961   WindowAttributes clearTheseAttributes) ;
53962 extern OSStatus
53963 SetWindowClass(
53964   WindowRef inWindow,
53965   WindowClass inWindowClass) ;
53966 typedef UInt32 WindowModality;
53967 enum {
53968
53969
53970
53971
53972
53973   kWindowModalityNone = 0,
53974
53975
53976
53977
53978
53979
53980   kWindowModalitySystemModal = 1,
53981
53982
53983
53984
53985
53986   kWindowModalityAppModal = 2,
53987
53988
53989
53990
53991   kWindowModalityWindowModal = 3
53992 };
53993 extern OSStatus
53994 SetWindowModality(
53995   WindowRef inWindow,
53996   WindowModality inModalKind,
53997   WindowRef inUnavailableWindow) ;
53998 extern OSStatus
53999 GetWindowModality(
54000   WindowRef inWindow,
54001   WindowModality * outModalKind,
54002   WindowRef * outUnavailableWindow) ;
54003 extern OSStatus
54004 ShowFloatingWindows(void) ;
54005 extern OSStatus
54006 HideFloatingWindows(void) ;
54007 extern Boolean
54008 AreFloatingWindowsVisible(void) ;
54009 typedef struct OpaqueWindowGroupRef* WindowGroupRef;
54010 typedef UInt32 WindowGroupAttributes;
54011 enum {
54012
54013
54014
54015
54016
54017
54018
54019   kWindowGroupAttrSelectAsLayer = 1 << 0,
54020
54021
54022
54023
54024
54025
54026   kWindowGroupAttrMoveTogether = 1 << 1,
54027   kWindowGroupAttrLayerTogether = 1 << 2,
54028
54029
54030
54031
54032
54033
54034
54035   kWindowGroupAttrSharedActivation = 1 << 3,
54036   kWindowGroupAttrHideOnCollapse = 1 << 4
54037 };
54038 typedef UInt32 WindowActivationScope;
54039 enum {
54040   kWindowActivationScopeNone = 0,
54041
54042
54043
54044
54045
54046
54047
54048   kWindowActivationScopeIndependent = 1,
54049
54050
54051
54052
54053
54054
54055
54056   kWindowActivationScopeAll = 2
54057 };
54058
54059
54060
54061
54062
54063
54064
54065 enum {
54066
54067
54068
54069
54070
54071   kNextWindowGroup = true,
54072
54073
54074
54075
54076
54077   kPreviousWindowGroup = false
54078 };
54079 typedef UInt32 WindowGroupContentOptions;
54080 enum {
54081
54082
54083
54084
54085
54086
54087   kWindowGroupContentsReturnWindows = 1 << 0,
54088
54089
54090
54091
54092
54093
54094
54095   kWindowGroupContentsRecurse = 1 << 1,
54096
54097
54098
54099
54100
54101
54102   kWindowGroupContentsVisible = 1 << 2
54103 };
54104 extern OSStatus
54105 CreateWindowGroup(
54106   WindowGroupAttributes inAttributes,
54107   WindowGroupRef * outGroup) ;
54108 extern OSStatus
54109 RetainWindowGroup(WindowGroupRef inGroup) ;
54110 extern OSStatus
54111 ReleaseWindowGroup(WindowGroupRef inGroup) ;
54112 extern ItemCount
54113 GetWindowGroupRetainCount(WindowGroupRef inGroup) ;
54114 extern WindowGroupRef
54115 GetWindowGroupOfClass(WindowClass windowClass) ;
54116 extern OSStatus
54117 SetWindowGroupName(
54118   WindowGroupRef inGroup,
54119   CFStringRef inName) ;
54120 extern OSStatus
54121 CopyWindowGroupName(
54122   WindowGroupRef inGroup,
54123   CFStringRef * outName) ;
54124 extern OSStatus
54125 GetWindowGroupAttributes(
54126   WindowGroupRef inGroup,
54127   WindowGroupAttributes * outAttributes) ;
54128 extern OSStatus
54129 ChangeWindowGroupAttributes(
54130   WindowGroupRef inGroup,
54131   WindowGroupAttributes setTheseAttributes,
54132   WindowGroupAttributes clearTheseAttributes) ;
54133 extern OSStatus
54134 SetWindowGroupLevel(
54135   WindowGroupRef inGroup,
54136   SInt32 inLevel) ;
54137 extern OSStatus
54138 GetWindowGroupLevel(
54139   WindowGroupRef inGroup,
54140   SInt32 * outLevel) ;
54141 extern OSStatus
54142 SendWindowGroupBehind(
54143   WindowGroupRef inGroup,
54144   WindowGroupRef behindGroup) ;
54145 extern WindowGroupRef
54146 GetWindowGroup(WindowRef inWindow) ;
54147 extern OSStatus
54148 SetWindowGroup(
54149   WindowRef inWindow,
54150   WindowGroupRef inNewGroup) ;
54151 extern Boolean
54152 IsWindowContainedInGroup(
54153   WindowRef inWindow,
54154   WindowGroupRef inGroup) ;
54155 extern WindowGroupRef
54156 GetWindowGroupParent(WindowGroupRef inGroup) ;
54157 extern OSStatus
54158 SetWindowGroupParent(
54159   WindowGroupRef inGroup,
54160   WindowGroupRef inNewGroup) ;
54161 extern WindowGroupRef
54162 GetWindowGroupSibling(
54163   WindowGroupRef inGroup,
54164   Boolean inNextGroup) ;
54165 extern WindowRef
54166 GetWindowGroupOwner(WindowGroupRef inGroup) ;
54167 extern OSStatus
54168 SetWindowGroupOwner(
54169   WindowGroupRef inGroup,
54170   WindowRef inWindow) ;
54171 extern ItemCount
54172 CountWindowGroupContents(
54173   WindowGroupRef inGroup,
54174   WindowGroupContentOptions inOptions) ;
54175 extern OSStatus
54176 GetWindowGroupContents(
54177   WindowGroupRef inGroup,
54178   WindowGroupContentOptions inOptions,
54179   ItemCount inAllowedItems,
54180   ItemCount * outNumItems,
54181   void ** outItems) ;
54182 extern OSStatus
54183 GetIndexedWindow(
54184   WindowGroupRef inGroup,
54185   UInt32 inIndex,
54186   WindowGroupContentOptions inOptions,
54187   WindowRef * outWindow) ;
54188 extern OSStatus
54189 GetWindowIndex(
54190   WindowRef inWindow,
54191   WindowGroupRef inStartGroup,
54192   WindowGroupContentOptions inOptions,
54193   UInt32 * outIndex) ;
54194 extern WindowRef
54195 ActiveNonFloatingWindow(void) ;
54196 extern Boolean
54197 IsWindowActive(WindowRef inWindow) ;
54198 extern OSStatus
54199 ActivateWindow(
54200   WindowRef inWindow,
54201   Boolean inActivate) ;
54202 extern OSStatus
54203 GetWindowActivationScope(
54204   WindowRef inWindow,
54205   WindowActivationScope * outScope) ;
54206 extern OSStatus
54207 SetWindowActivationScope(
54208   WindowRef inWindow,
54209   WindowActivationScope inScope) ;
54210 extern void
54211 DebugPrintWindowGroup(WindowGroupRef inGroup) ;
54212 extern void
54213 DebugPrintAllWindowGroups(void) ;
54214 extern OSStatus
54215 SetWindowContentColor(
54216   WindowRef window,
54217   const RGBColor * color) ;
54218 extern OSStatus
54219 GetWindowContentColor(
54220   WindowRef window,
54221   RGBColor * color) ;
54222 extern OSStatus
54223 GetWindowContentPattern(
54224   WindowRef window,
54225   PixPatHandle outPixPat) ;
54226 extern OSStatus
54227 SetWindowContentPattern(
54228   WindowRef window,
54229   PixPatHandle pixPat) ;
54230
54231
54232
54233 typedef OptionBits WindowPaintProcOptions;
54234 enum {
54235   kWindowPaintProcOptionsNone = 0
54236 };
54237 extern OSStatus
54238 InstallWindowContentPaintProc(
54239   WindowRef window,
54240   WindowPaintUPP paintProc,
54241   WindowPaintProcOptions options,
54242   void * refCon) ;
54243
54244
54245
54246
54247
54248 typedef UInt32 ScrollWindowOptions;
54249 enum {
54250   kScrollWindowNoOptions = 0,
54251   kScrollWindowInvalidate = (1L << 0),
54252   kScrollWindowEraseToPortBackground = (1L << 1)
54253 };
54254 extern OSStatus
54255 ScrollWindowRect(
54256   WindowRef inWindow,
54257   const Rect * inScrollRect,
54258   SInt16 inHPixels,
54259   SInt16 inVPixels,
54260   ScrollWindowOptions inOptions,
54261   RgnHandle outExposedRgn) ;
54262 extern OSStatus
54263 ScrollWindowRegion(
54264   WindowRef inWindow,
54265   RgnHandle inScrollRgn,
54266   SInt16 inHPixels,
54267   SInt16 inVPixels,
54268   ScrollWindowOptions inOptions,
54269   RgnHandle outExposedRgn) ;
54270 extern void
54271 ClipAbove(WindowRef window) ;
54272 extern void
54273 PaintOne(
54274   WindowRef window,
54275   RgnHandle clobberedRgn) ;
54276 extern void
54277 PaintBehind(
54278   WindowRef startWindow,
54279   RgnHandle clobberedRgn) ;
54280 extern void
54281 CalcVis(WindowRef window) ;
54282 extern void
54283 CalcVisBehind(
54284   WindowRef startWindow,
54285   RgnHandle clobberedRgn) ;
54286 extern Boolean
54287 CheckUpdate(EventRecord * theEvent) ;
54288 extern WindowPartCode
54289 FindWindow(
54290   Point thePoint,
54291   WindowRef * window) ;
54292 extern WindowRef
54293 FrontWindow(void) ;
54294 extern void
54295 BringToFront(WindowRef window) ;
54296 extern void
54297 SendBehind(
54298   WindowRef window,
54299   WindowRef behindWindow) ;
54300 extern void
54301 SelectWindow(WindowRef window) ;
54302 extern WindowRef
54303 FrontNonFloatingWindow(void) ;
54304 extern WindowRef
54305 GetNextWindowOfClass(
54306   WindowRef inWindow,
54307   WindowClass inWindowClass,
54308   Boolean mustBeVisible) ;
54309 extern WindowRef
54310 GetFrontWindowOfClass(
54311   WindowClass inWindowClass,
54312   Boolean mustBeVisible) ;
54313 extern OSStatus
54314 FindWindowOfClass(
54315   const Point * where,
54316   WindowClass inWindowClass,
54317   WindowRef * outWindow,
54318   WindowPartCode * outWindowPart) ;
54319
54320
54321
54322
54323
54324
54325
54326 enum {
54327
54328
54329
54330
54331
54332   kWindowMenuIncludeRotate = 1 << 0
54333 };
54334 extern OSStatus
54335 CreateStandardWindowMenu(
54336   OptionBits inOptions,
54337   MenuRef * outMenu) ;
54338 extern OSStatus
54339 SetWindowAlternateTitle(
54340   WindowRef inWindow,
54341   CFStringRef inTitle) ;
54342 extern OSStatus
54343 CopyWindowAlternateTitle(
54344   WindowRef inWindow,
54345   CFStringRef * outTitle) ;
54346 extern Boolean
54347 IsValidWindowPtr(WindowRef possibleWindow) ;
54348 extern void
54349 HiliteWindow(
54350   WindowRef window,
54351   Boolean fHilite) ;
54352 extern void
54353 SetWRefCon(
54354   WindowRef window,
54355   long data) ;
54356 extern long
54357 GetWRefCon(WindowRef window) ;
54358 extern void
54359 SetWindowPic(
54360   WindowRef window,
54361   PicHandle pic) ;
54362 extern PicHandle
54363 GetWindowPic(WindowRef window) ;
54364 extern short
54365 GetWVariant(WindowRef window) ;
54366 extern OSStatus
54367 GetWindowFeatures(
54368   WindowRef window,
54369   UInt32 * outFeatures) ;
54370 extern OSStatus
54371 GetWindowRegion(
54372   WindowRef window,
54373   WindowRegionCode inRegionCode,
54374   RgnHandle ioWinRgn) ;
54375 extern OSStatus
54376 GetWindowStructureWidths(
54377   WindowRef inWindow,
54378   Rect * outRect) ;
54379 extern void
54380 BeginUpdate(WindowRef window) ;
54381 extern void
54382 EndUpdate(WindowRef window) ;
54383 extern OSStatus
54384 InvalWindowRgn(
54385   WindowRef window,
54386   RgnHandle region) ;
54387 extern OSStatus
54388 InvalWindowRect(
54389   WindowRef window,
54390   const Rect * bounds) ;
54391 extern OSStatus
54392 ValidWindowRgn(
54393   WindowRef window,
54394   RgnHandle region) ;
54395 extern OSStatus
54396 ValidWindowRect(
54397   WindowRef window,
54398   const Rect * bounds) ;
54399 extern void
54400 DrawGrowIcon(WindowRef window) ;
54401 extern void
54402 SetWTitle(
54403   WindowRef window,
54404   ConstStr255Param title) ;
54405 extern void
54406 GetWTitle(
54407   WindowRef window,
54408   Str255 title) ;
54409 extern OSStatus
54410 SetWindowTitleWithCFString(
54411   WindowRef inWindow,
54412   CFStringRef inString) ;
54413 extern OSStatus
54414 CopyWindowTitleAsCFString(
54415   WindowRef inWindow,
54416   CFStringRef * outString) ;
54417 extern OSStatus
54418 SetWindowProxyFSSpec(
54419   WindowRef window,
54420   const FSSpec * inFile) ;
54421 extern OSStatus
54422 GetWindowProxyFSSpec(
54423   WindowRef window,
54424   FSSpec * outFile) ;
54425 extern OSStatus
54426 SetWindowProxyAlias(
54427   WindowRef inWindow,
54428   AliasHandle inAlias) ;
54429 extern OSStatus
54430 GetWindowProxyAlias(
54431   WindowRef window,
54432   AliasHandle * alias) ;
54433 extern OSStatus
54434 SetWindowProxyCreatorAndType(
54435   WindowRef window,
54436   OSType fileCreator,
54437   OSType fileType,
54438   SInt16 vRefNum) ;
54439 extern OSStatus
54440 GetWindowProxyIcon(
54441   WindowRef window,
54442   IconRef * outIcon) ;
54443 extern OSStatus
54444 SetWindowProxyIcon(
54445   WindowRef window,
54446   IconRef icon) ;
54447 extern OSStatus
54448 RemoveWindowProxy(WindowRef window) ;
54449 extern OSStatus
54450 BeginWindowProxyDrag(
54451   WindowRef window,
54452   DragReference * outNewDrag,
54453   RgnHandle outDragOutlineRgn) ;
54454 extern OSStatus
54455 EndWindowProxyDrag(
54456   WindowRef window,
54457   DragReference theDrag) ;
54458 extern OSStatus
54459 TrackWindowProxyFromExistingDrag(
54460   WindowRef window,
54461   Point startPt,
54462   DragReference drag,
54463   RgnHandle inDragOutlineRgn) ;
54464 extern OSStatus
54465 TrackWindowProxyDrag(
54466   WindowRef window,
54467   Point startPt) ;
54468 extern Boolean
54469 IsWindowModified(WindowRef window) ;
54470 extern OSStatus
54471 SetWindowModified(
54472   WindowRef window,
54473   Boolean modified) ;
54474 extern Boolean
54475 IsWindowPathSelectClick(
54476   WindowRef window,
54477   const EventRecord * event) ;
54478 extern OSStatus
54479 WindowPathSelect(
54480   WindowRef window,
54481   MenuRef menu,
54482   SInt32 * outMenuResult) ;
54483 extern Boolean
54484 IsWindowPathSelectEvent(
54485   WindowRef window,
54486   EventRef inEvent) ;
54487 extern OSStatus
54488 HiliteWindowFrameForDrag(
54489   WindowRef window,
54490   Boolean hilited) ;
54491 typedef UInt32 WindowTransitionEffect;
54492 enum {
54493
54494
54495
54496
54497
54498   kWindowZoomTransitionEffect = 1,
54499
54500
54501
54502
54503
54504
54505   kWindowSheetTransitionEffect = 2,
54506
54507
54508
54509
54510
54511
54512   kWindowSlideTransitionEffect = 3
54513 };
54514 typedef UInt32 WindowTransitionAction;
54515 enum {
54516
54517
54518
54519
54520
54521
54522
54523   kWindowShowTransitionAction = 1,
54524
54525
54526
54527
54528
54529
54530
54531   kWindowHideTransitionAction = 2,
54532
54533
54534
54535
54536
54537
54538
54539   kWindowMoveTransitionAction = 3,
54540
54541
54542
54543
54544
54545
54546
54547   kWindowResizeTransitionAction = 4
54548 };
54549 extern OSStatus
54550 TransitionWindow(
54551   WindowRef inWindow,
54552   WindowTransitionEffect inEffect,
54553   WindowTransitionAction inAction,
54554   const Rect * inRect) ;
54555 extern OSStatus
54556 TransitionWindowAndParent(
54557   WindowRef inWindow,
54558   WindowRef inParentWindow,
54559   WindowTransitionEffect inEffect,
54560   WindowTransitionAction inAction,
54561   const Rect * inRect) ;
54562 extern void
54563 MoveWindow(
54564   WindowRef window,
54565   short hGlobal,
54566   short vGlobal,
54567   Boolean front) ;
54568 extern void
54569 SizeWindow(
54570   WindowRef window,
54571   short w,
54572   short h,
54573   Boolean fUpdate) ;
54574 extern long
54575 GrowWindow(
54576   WindowRef window,
54577   Point startPt,
54578   const Rect * bBox) ;
54579 extern void
54580 DragWindow(
54581   WindowRef window,
54582   Point startPt,
54583   const Rect * boundsRect) ;
54584 extern void
54585 ZoomWindow(
54586   WindowRef window,
54587   WindowPartCode partCode,
54588   Boolean front) ;
54589 extern Boolean
54590 IsWindowCollapsable(WindowRef window) ;
54591 extern Boolean
54592 IsWindowCollapsed(WindowRef window) ;
54593 extern OSStatus
54594 CollapseWindow(
54595   WindowRef window,
54596   Boolean collapse) ;
54597 extern OSStatus
54598 CollapseAllWindows(Boolean collapse) ;
54599 extern OSStatus
54600 CreateQDContextForCollapsedWindowDockTile(
54601   WindowRef inWindow,
54602   CGrafPtr * outContext) ;
54603 extern OSStatus
54604 ReleaseQDContextForCollapsedWindowDockTile(
54605   WindowRef inWindow,
54606   CGrafPtr inContext) ;
54607 extern OSStatus
54608 UpdateCollapsedWindowDockTile(WindowRef inWindow) ;
54609 extern OSStatus
54610 SetWindowDockTileMenu(
54611   WindowRef inWindow,
54612   MenuRef inMenu) ;
54613 extern MenuRef
54614 GetWindowDockTileMenu(WindowRef inWindow) ;
54615 extern OSStatus
54616 GetWindowBounds(
54617   WindowRef window,
54618   WindowRegionCode regionCode,
54619   Rect * globalBounds) ;
54620 extern OSStatus
54621 SetWindowResizeLimits(
54622   WindowRef inWindow,
54623   const HISize * inMinLimits,
54624   const HISize * inMaxLimits) ;
54625 extern OSStatus
54626 GetWindowResizeLimits(
54627   WindowRef inWindow,
54628   HISize * outMinLimits,
54629   HISize * outMaxLimits) ;
54630 extern Boolean
54631 ResizeWindow(
54632   WindowRef inWindow,
54633   Point inStartPoint,
54634   const Rect * inSizeConstraints,
54635   Rect * outNewContentRect) ;
54636 extern OSStatus
54637 SetWindowBounds(
54638   WindowRef window,
54639   WindowRegionCode regionCode,
54640   const Rect * globalBounds) ;
54641 extern OSStatus
54642 RepositionWindow(
54643   WindowRef window,
54644   WindowRef parentWindow,
54645   WindowPositionMethod method) ;
54646 extern OSStatus
54647 MoveWindowStructure(
54648   WindowRef window,
54649   short hGlobal,
54650   short vGlobal) ;
54651 extern Boolean
54652 IsWindowInStandardState(
54653   WindowRef inWindow,
54654   const Point * inIdealSize,
54655   Rect * outIdealStandardState) ;
54656 extern OSStatus
54657 ZoomWindowIdeal(
54658   WindowRef inWindow,
54659   WindowPartCode inPartCode,
54660   Point * ioIdealSize) ;
54661 extern OSStatus
54662 GetWindowIdealUserState(
54663   WindowRef inWindow,
54664   Rect * outUserState) ;
54665 extern OSStatus
54666 SetWindowIdealUserState(
54667   WindowRef inWindow,
54668   const Rect * inUserState) ;
54669 extern OSStatus
54670 GetWindowGreatestAreaDevice(
54671   WindowRef inWindow,
54672   WindowRegionCode inRegion,
54673   GDHandle * outGreatestDevice,
54674   Rect * outGreatestDeviceRect) ;
54675
54676
54677
54678
54679
54680
54681
54682 typedef UInt32 WindowConstrainOptions;
54683 enum {
54684
54685
54686
54687
54688   kWindowConstrainMayResize = (1L << 0),
54689
54690
54691
54692
54693   kWindowConstrainMoveRegardlessOfFit = (1L << 1),
54694
54695
54696
54697
54698
54699   kWindowConstrainAllowPartial = (1L << 2),
54700
54701
54702
54703
54704
54705   kWindowConstrainCalcOnly = (1L << 3),
54706
54707
54708
54709
54710
54711   kWindowConstrainUseTransitionWindow = (1L << 4),
54712
54713
54714
54715
54716
54717
54718
54719   kWindowConstrainStandardOptions = kWindowConstrainMoveRegardlessOfFit
54720 };
54721 extern OSStatus
54722 ConstrainWindowToScreen(
54723   WindowRef inWindowRef,
54724   WindowRegionCode inRegionCode,
54725   WindowConstrainOptions inOptions,
54726   const Rect * inScreenRect,
54727   Rect * outStructure) ;
54728 extern OSStatus
54729 GetAvailableWindowPositioningBounds(
54730   GDHandle inDevice,
54731   Rect * outAvailableRect) ;
54732 extern OSStatus
54733 GetAvailableWindowPositioningRegion(
54734   GDHandle inDevice,
54735   RgnHandle ioRgn) ;
54736 extern void
54737 HideWindow(WindowRef window) ;
54738 extern void
54739 ShowWindow(WindowRef window) ;
54740 extern void
54741 ShowHide(
54742   WindowRef window,
54743   Boolean showFlag) ;
54744 extern Boolean
54745 IsWindowVisible(WindowRef window) ;
54746 typedef UInt32 WindowLatentVisibility;
54747 enum {
54748
54749
54750
54751
54752   kWindowLatentVisibleFloater = 1 << 0,
54753
54754
54755
54756
54757   kWindowLatentVisibleSuspend = 1 << 1,
54758
54759
54760
54761
54762   kWindowLatentVisibleFullScreen = 1 << 2,
54763
54764
54765
54766
54767   kWindowLatentVisibleAppHidden = 1 << 3,
54768
54769
54770
54771
54772   kWindowLatentVisibleCollapsedOwner = 1 << 4,
54773
54774
54775
54776
54777
54778   kWindowLatentVisibleCollapsedGroup = 1 << 5
54779 };
54780 extern Boolean
54781 IsWindowLatentVisible(
54782   WindowRef inWindow,
54783   WindowLatentVisibility * outLatentVisible) ;
54784 extern OSStatus
54785 ShowSheetWindow(
54786   WindowRef inSheet,
54787   WindowRef inParentWindow) ;
54788 extern OSStatus
54789 HideSheetWindow(WindowRef inSheet) ;
54790 extern OSStatus
54791 GetSheetWindowParent(
54792   WindowRef inSheet,
54793   WindowRef * outParentWindow) ;
54794 enum {
54795
54796
54797
54798
54799
54800
54801
54802   kWindowEdgeDefault = 0,
54803
54804
54805
54806
54807   kWindowEdgeTop = 1 << 0,
54808
54809
54810
54811
54812   kWindowEdgeLeft = 1 << 1,
54813
54814
54815
54816
54817   kWindowEdgeBottom = 1 << 2,
54818
54819
54820
54821
54822   kWindowEdgeRight = 1 << 3
54823 };
54824
54825
54826
54827
54828
54829
54830 enum {
54831
54832
54833
54834
54835   kWindowDrawerOpening = 1,
54836
54837
54838
54839
54840   kWindowDrawerOpen = 2,
54841
54842
54843
54844
54845   kWindowDrawerClosing = 3,
54846
54847
54848
54849
54850   kWindowDrawerClosed = 4
54851 };
54852
54853 typedef UInt32 WindowDrawerState;
54854 extern OptionBits
54855 GetDrawerPreferredEdge(WindowRef inDrawerWindow) ;
54856 extern OSStatus
54857 SetDrawerPreferredEdge(
54858   WindowRef inDrawerWindow,
54859   OptionBits inEdge) ;
54860 extern OptionBits
54861 GetDrawerCurrentEdge(WindowRef inDrawerWindow) ;
54862 extern WindowDrawerState
54863 GetDrawerState(WindowRef inDrawerWindow) ;
54864 extern WindowRef
54865 GetDrawerParent(WindowRef inDrawerWindow) ;
54866 extern OSStatus
54867 SetDrawerParent(
54868   WindowRef inDrawerWindow,
54869   WindowRef inParent) ;
54870 extern OSStatus
54871 SetDrawerOffsets(
54872   WindowRef inDrawerWindow,
54873   float inLeadingOffset,
54874   float inTrailingOffset) ;
54875 extern OSStatus
54876 GetDrawerOffsets(
54877   WindowRef inDrawerWindow,
54878   float * outLeadingOffset,
54879   float * outTrailingOffset) ;
54880 extern OSStatus
54881 ToggleDrawer(WindowRef inDrawerWindow) ;
54882 extern OSStatus
54883 OpenDrawer(
54884   WindowRef inDrawerWindow,
54885   OptionBits inEdge,
54886   Boolean inAsync) ;
54887 extern OSStatus
54888 CloseDrawer(
54889   WindowRef inDrawerWindow,
54890   Boolean inAsync) ;
54891 extern OSStatus
54892 DisableScreenUpdates(void) ;
54893 extern OSStatus
54894 EnableScreenUpdates(void) ;
54895 extern OSStatus
54896 SetWindowToolbar(
54897   WindowRef inWindow,
54898   HIToolbarRef inToolbar) ;
54899 extern OSStatus
54900 GetWindowToolbar(
54901   WindowRef inWindow,
54902   HIToolbarRef * outToolbar) ;
54903 extern OSStatus
54904 ShowHideWindowToolbar(
54905   WindowRef inWindow,
54906   Boolean inShow,
54907   Boolean inAnimate) ;
54908 extern Boolean
54909 IsWindowToolbarVisible(WindowRef inWindow) ;
54910 extern OSStatus
54911 SetWindowAlpha(
54912   WindowRef inWindow,
54913   float inAlpha) ;
54914 extern OSStatus
54915 GetWindowAlpha(
54916   WindowRef inWindow,
54917   float * outAlpha) ;
54918 extern OSStatus
54919 GetWindowProperty(
54920   WindowRef window,
54921   PropertyCreator propertyCreator,
54922   PropertyTag propertyTag,
54923   UInt32 bufferSize,
54924   UInt32 * actualSize,
54925   void * propertyBuffer) ;
54926 extern OSStatus
54927 GetWindowPropertySize(
54928   WindowRef window,
54929   PropertyCreator creator,
54930   PropertyTag tag,
54931   UInt32 * size) ;
54932 extern OSStatus
54933 SetWindowProperty(
54934   WindowRef window,
54935   PropertyCreator propertyCreator,
54936   PropertyTag propertyTag,
54937   UInt32 propertySize,
54938   const void * propertyBuffer) ;
54939 extern OSStatus
54940 RemoveWindowProperty(
54941   WindowRef window,
54942   PropertyCreator propertyCreator,
54943   PropertyTag propertyTag) ;
54944
54945
54946
54947
54948
54949 enum {
54950   kWindowPropertyPersistent = 0x00000001
54951 };
54952 extern OSStatus
54953 GetWindowPropertyAttributes(
54954   WindowRef window,
54955   OSType propertyCreator,
54956   OSType propertyTag,
54957   UInt32 * attributes) ;
54958 extern OSStatus
54959 ChangeWindowPropertyAttributes(
54960   WindowRef window,
54961   OSType propertyCreator,
54962   OSType propertyTag,
54963   UInt32 attributesToSet,
54964   UInt32 attributesToClear) ;
54965 extern long
54966 PinRect(
54967   const Rect * theRect,
54968   Point thePt) ;
54969 extern RgnHandle
54970 GetGrayRgn(void) ;
54971 extern Boolean
54972 TrackBox(
54973   WindowRef window,
54974   Point thePt,
54975   WindowPartCode partCode) ;
54976 extern Boolean
54977 TrackGoAway(
54978   WindowRef window,
54979   Point thePt) ;
54980 extern long
54981 DragGrayRgn(
54982   RgnHandle theRgn,
54983   Point startPt,
54984   const Rect * limitRect,
54985   const Rect * slopRect,
54986   short axis,
54987   DragGrayRgnUPP actionProc) ;
54988 extern long
54989 DragTheRgn(
54990   RgnHandle theRgn,
54991   Point startPt,
54992   const Rect * limitRect,
54993   const Rect * slopRect,
54994   short axis,
54995   DragGrayRgnUPP actionProc) ;
54996 extern WindowRef
54997 GetWindowList(void) ;
54998 extern CGrafPtr
54999 GetWindowPort(WindowRef window) ;
55000 extern CGrafPtr
55001 GetWindowStructurePort(WindowRef inWindow) ;
55002 extern short
55003 GetWindowKind(WindowRef window) ;
55004 extern Boolean
55005 IsWindowHilited(WindowRef window) ;
55006 extern Boolean
55007 IsWindowUpdatePending(WindowRef window) ;
55008 extern WindowRef
55009 GetNextWindow(WindowRef window) ;
55010 extern WindowRef
55011 GetPreviousWindow(WindowRef inWindow) ;
55012 extern Rect *
55013 GetWindowStandardState(
55014   WindowRef window,
55015   Rect * rect) ;
55016 extern Rect *
55017 GetWindowUserState(
55018   WindowRef window,
55019   Rect * rect) ;
55020 extern void
55021 SetWindowKind(
55022   WindowRef window,
55023   short kind) ;
55024 extern void
55025 SetWindowStandardState(
55026   WindowRef window,
55027   const Rect * rect) ;
55028 extern void
55029 SetWindowUserState(
55030   WindowRef window,
55031   const Rect * rect) ;
55032 extern void
55033 SetPortWindowPort(WindowRef window) ;
55034 extern Rect *
55035 GetWindowPortBounds(
55036   WindowRef window,
55037   Rect * bounds) ;
55038 extern WindowRef
55039 GetWindowFromPort(CGrafPtr port) ;
55040 enum {
55041   kWindowGroupAttrSelectable = kWindowGroupAttrSelectAsLayer,
55042   kWindowGroupAttrPositionFixed = kWindowGroupAttrMoveTogether,
55043   kWindowGroupAttrZOrderFixed = kWindowGroupAttrLayerTogether
55044 };
55045
55046
55047 }
55048 extern "C" {
55049
55050
55051 enum {
55052   kTrackMouseLocationOptionDontConsumeMouseUp = (1 << 0)
55053 };
55054
55055 typedef UInt16 MouseTrackingResult;
55056 enum {
55057   kMouseTrackingMouseDown = 1,
55058   kMouseTrackingMouseUp = 2,
55059   kMouseTrackingMouseExited = 3,
55060   kMouseTrackingMouseEntered = 4,
55061   kMouseTrackingMouseDragged = 5,
55062   kMouseTrackingKeyModifiersChanged = 6,
55063   kMouseTrackingUserCancelled = 7,
55064   kMouseTrackingTimedOut = 8,
55065   kMouseTrackingMouseMoved = 9
55066 };
55067 extern Boolean
55068 IsUserCancelEventRef(EventRef event) ;
55069 extern OSStatus
55070 TrackMouseLocation(
55071   GrafPtr inPort,
55072   Point * outPt,
55073   MouseTrackingResult * outResult) ;
55074 extern OSStatus
55075 TrackMouseLocationWithOptions(
55076   GrafPtr inPort,
55077   OptionBits inOptions,
55078   EventTimeout inTimeout,
55079   Point * outPt,
55080   UInt32 * outModifiers,
55081   MouseTrackingResult * outResult) ;
55082 extern OSStatus
55083 TrackMouseRegion(
55084   GrafPtr inPort,
55085   RgnHandle inRegion,
55086   Boolean * ioWasInRgn,
55087   MouseTrackingResult * outResult) ;
55088 extern Boolean
55089 ConvertEventRefToEventRecord(
55090   EventRef inEvent,
55091   EventRecord * outEvent) ;
55092 extern Boolean
55093 IsEventInMask(
55094   EventRef inEvent,
55095   EventMask inMask) ;
55096 extern EventTime
55097 GetLastUserEventTime(void) ;
55098 extern Boolean
55099 IsMouseCoalescingEnabled(void) ;
55100 extern OSStatus
55101 SetMouseCoalescingEnabled(
55102   Boolean inNewState,
55103   Boolean * outOldState) ;
55104 enum {
55105
55106
55107
55108
55109   kEventClassMouse = 'mous',
55110
55111
55112
55113
55114   kEventClassKeyboard = 'keyb',
55115
55116
55117
55118
55119   kEventClassTextInput = 'text',
55120
55121
55122
55123
55124   kEventClassApplication = 'appl',
55125
55126
55127
55128
55129   kEventClassAppleEvent = 'eppc',
55130
55131
55132
55133
55134   kEventClassMenu = 'menu',
55135
55136
55137
55138
55139   kEventClassWindow = 'wind',
55140
55141
55142
55143
55144   kEventClassControl = 'cntl',
55145
55146
55147
55148
55149   kEventClassCommand = 'cmds',
55150
55151
55152
55153
55154   kEventClassTablet = 'tblt',
55155
55156
55157
55158
55159   kEventClassVolume = 'vol ',
55160
55161
55162
55163
55164   kEventClassAppearance = 'appm',
55165
55166
55167
55168
55169   kEventClassService = 'serv',
55170
55171
55172
55173
55174   kEventClassToolbar = 'tbar',
55175
55176
55177
55178
55179   kEventClassToolbarItem = 'tbit',
55180
55181
55182
55183
55184   kEventClassAccessibility = 'acce'
55185 };
55186 enum {
55187
55188
55189
55190
55191   kEventMouseDown = 1,
55192
55193
55194
55195
55196   kEventMouseUp = 2,
55197
55198
55199
55200
55201   kEventMouseMoved = 5,
55202
55203
55204
55205
55206   kEventMouseDragged = 6,
55207
55208
55209
55210
55211   kEventMouseEntered = 8,
55212
55213
55214
55215
55216   kEventMouseExited = 9,
55217
55218
55219
55220
55221   kEventMouseWheelMoved = 10
55222 };
55223 typedef UInt16 EventMouseButton;
55224 enum {
55225
55226
55227
55228
55229
55230   kEventMouseButtonPrimary = 1,
55231
55232
55233
55234
55235   kEventMouseButtonSecondary = 2,
55236
55237
55238
55239
55240   kEventMouseButtonTertiary = 3
55241 };
55242
55243
55244
55245
55246
55247
55248
55249 typedef UInt16 EventMouseWheelAxis;
55250 enum {
55251
55252
55253
55254
55255   kEventMouseWheelAxisX = 0,
55256
55257
55258
55259
55260   kEventMouseWheelAxisY = 1
55261 };
55262 enum {
55263
55264
55265
55266
55267
55268   kEventTextInputUpdateActiveInputArea = 1,
55269   kEventTextInputUnicodeForKeyEvent = 2,
55270
55271
55272
55273
55274
55275
55276
55277   kEventTextInputOffsetToPos = 3,
55278   kEventTextInputPosToOffset = 4,
55279
55280
55281
55282
55283
55284
55285   kEventTextInputShowHideBottomWindow = 5,
55286
55287
55288
55289
55290
55291   kEventTextInputGetSelectedText = 6,
55292   kEventTextInputUnicodeText = 7
55293 };
55294 enum {
55295
55296
55297
55298
55299   kEventRawKeyDown = 1,
55300
55301
55302
55303
55304   kEventRawKeyRepeat = 2,
55305
55306
55307
55308
55309   kEventRawKeyUp = 3,
55310
55311
55312
55313
55314   kEventRawKeyModifiersChanged = 4,
55315
55316
55317
55318
55319   kEventHotKeyPressed = 5,
55320
55321
55322
55323
55324   kEventHotKeyReleased = 6
55325 };
55326 enum {
55327
55328
55329
55330
55331   kEventKeyModifierNumLockBit = 16,
55332
55333
55334
55335
55336   kEventKeyModifierFnBit = 17
55337 };
55338
55339 enum {
55340   kEventKeyModifierNumLockMask = 1L << kEventKeyModifierNumLockBit,
55341   kEventKeyModifierFnMask = 1L << kEventKeyModifierFnBit
55342 };
55343 enum {
55344
55345
55346
55347
55348
55349
55350   kEventAppActivated = 1,
55351
55352
55353
55354
55355   kEventAppDeactivated = 2,
55356   kEventAppQuit = 3,
55357
55358
55359
55360
55361
55362
55363   kEventAppLaunchNotification = 4,
55364
55365
55366
55367
55368
55369   kEventAppLaunched = 5,
55370
55371
55372
55373
55374
55375   kEventAppTerminated = 6,
55376
55377
55378
55379
55380
55381   kEventAppFrontSwitched = 7,
55382
55383
55384
55385
55386
55387
55388
55389   kEventAppFocusMenuBar = 8,
55390   kEventAppFocusNextDocumentWindow = 9,
55391   kEventAppFocusNextFloatingWindow = 10,
55392   kEventAppFocusToolbar = 11,
55393   kEventAppGetDockTileMenu = 20,
55394
55395
55396
55397
55398   kEventAppHidden = 107,
55399
55400
55401
55402
55403
55404   kEventAppShown = 108,
55405
55406
55407
55408
55409
55410   kEventAppSystemUIModeChanged = 109
55411 };
55412 enum {
55413
55414
55415
55416
55417
55418   kEventAppleEvent = 1
55419 };
55420 enum {
55421
55422
55423
55424
55425
55426
55427
55428   kEventWindowUpdate = 1,
55429
55430
55431
55432
55433
55434
55435   kEventWindowDrawContent = 2
55436 };
55437 enum {
55438
55439
55440
55441
55442
55443
55444   kEventWindowActivated = 5,
55445
55446
55447
55448
55449
55450
55451   kEventWindowDeactivated = 6,
55452   kEventWindowGetClickActivation = 7
55453 };
55454 enum {
55455
55456
55457
55458
55459   kEventWindowShowing = 22,
55460
55461
55462
55463
55464   kEventWindowHiding = 23,
55465
55466
55467
55468
55469   kEventWindowShown = 24,
55470
55471
55472
55473
55474   kEventWindowHidden = 25,
55475
55476
55477
55478
55479
55480   kEventWindowCollapsing = 86,
55481
55482
55483
55484
55485   kEventWindowCollapsed = 67,
55486
55487
55488
55489
55490
55491   kEventWindowExpanding = 87,
55492
55493
55494
55495
55496   kEventWindowExpanded = 70,
55497   kEventWindowZoomed = 76,
55498   kEventWindowBoundsChanging = 26,
55499
55500
55501
55502
55503
55504
55505
55506
55507   kEventWindowBoundsChanged = 27,
55508
55509
55510
55511
55512   kEventWindowResizeStarted = 28,
55513
55514
55515
55516
55517   kEventWindowResizeCompleted = 29,
55518
55519
55520
55521
55522   kEventWindowDragStarted = 30,
55523
55524
55525
55526
55527   kEventWindowDragCompleted = 31,
55528
55529
55530
55531
55532   kEventWindowClosed = 73
55533 };
55534 enum {
55535
55536
55537
55538
55539
55540   kWindowBoundsChangeUserDrag = (1 << 0),
55541
55542
55543
55544
55545   kWindowBoundsChangeUserResize = (1 << 1),
55546
55547
55548
55549
55550   kWindowBoundsChangeSizeChanged = (1 << 2),
55551
55552
55553
55554
55555   kWindowBoundsChangeOriginChanged = (1 << 3),
55556   kWindowBoundsChangeZoom = (1 << 4)
55557 };
55558 enum {
55559
55560
55561
55562
55563
55564   kEventWindowClickDragRgn = 32,
55565
55566
55567
55568
55569
55570   kEventWindowClickResizeRgn = 33,
55571
55572
55573
55574
55575
55576
55577
55578   kEventWindowClickCollapseRgn = 34,
55579
55580
55581
55582
55583
55584   kEventWindowClickCloseRgn = 35,
55585
55586
55587
55588
55589
55590   kEventWindowClickZoomRgn = 36,
55591
55592
55593
55594
55595
55596
55597
55598   kEventWindowClickContentRgn = 37,
55599
55600
55601
55602
55603
55604
55605   kEventWindowClickProxyIconRgn = 38,
55606
55607
55608
55609
55610
55611
55612   kEventWindowClickToolbarButtonRgn = 41,
55613
55614
55615
55616
55617
55618   kEventWindowClickStructureRgn = 42
55619 };
55620 enum {
55621   kEventWindowCursorChange = 40
55622 };
55623 enum {
55624   kEventWindowCollapse = 66,
55625   kEventWindowCollapseAll = 68,
55626   kEventWindowExpand = 69,
55627   kEventWindowExpandAll = 71,
55628
55629
55630
55631
55632
55633
55634
55635   kEventWindowClose = 72,
55636   kEventWindowCloseAll = 74,
55637   kEventWindowZoom = 75,
55638   kEventWindowZoomAll = 77,
55639
55640
55641
55642
55643
55644
55645   kEventWindowContextualMenuSelect = 78,
55646
55647
55648
55649
55650
55651
55652   kEventWindowPathSelect = 79,
55653
55654
55655
55656
55657
55658   kEventWindowGetIdealSize = 80,
55659   kEventWindowGetMinimumSize = 81,
55660   kEventWindowGetMaximumSize = 82,
55661   kEventWindowConstrain = 83,
55662
55663
55664
55665
55666
55667
55668
55669   kEventWindowHandleContentClick = 85,
55670   kEventWindowGetDockTileMenu = 90,
55671
55672
55673
55674
55675
55676   kEventWindowProxyBeginDrag = 128,
55677
55678
55679
55680
55681
55682   kEventWindowProxyEndDrag = 129,
55683   kEventWindowToolbarSwitchMode = 150
55684 };
55685 enum {
55686
55687
55688
55689
55690
55691
55692
55693   kEventWindowFocusAcquired = 200,
55694
55695
55696
55697
55698
55699
55700   kEventWindowFocusRelinquish = 201,
55701
55702
55703
55704
55705
55706
55707
55708   kEventWindowFocusContent = 202,
55709
55710
55711
55712
55713
55714
55715
55716   kEventWindowFocusToolbar = 203
55717 };
55718 enum {
55719
55720
55721
55722
55723
55724
55725   kEventWindowDrawerOpening = 220,
55726
55727
55728
55729
55730
55731   kEventWindowDrawerOpened = 221,
55732
55733
55734
55735
55736
55737
55738   kEventWindowDrawerClosing = 222,
55739
55740
55741
55742
55743
55744   kEventWindowDrawerClosed = 223
55745 };
55746 enum {
55747
55748
55749
55750
55751
55752
55753
55754   kEventWindowDrawFrame = 1000,
55755
55756
55757
55758
55759
55760
55761   kEventWindowDrawPart = 1001,
55762
55763
55764
55765
55766
55767
55768
55769   kEventWindowGetRegion = 1002,
55770
55771
55772
55773
55774
55775
55776
55777   kEventWindowHitTest = 1003,
55778   kEventWindowInit = 1004,
55779   kEventWindowDispose = 1005,
55780
55781
55782
55783
55784
55785
55786   kEventWindowDragHilite = 1006,
55787
55788
55789
55790
55791
55792
55793   kEventWindowModified = 1007,
55794
55795
55796
55797
55798
55799
55800   kEventWindowSetupProxyDragImage = 1008,
55801
55802
55803
55804
55805
55806   kEventWindowStateChanged = 1009,
55807
55808
55809
55810
55811
55812   kEventWindowMeasureTitle = 1010,
55813   kEventWindowDrawGrowBox = 1011,
55814   kEventWindowGetGrowImageRegion = 1012,
55815   kEventWindowPaint = 1013
55816 };
55817 enum {
55818   kEventMenuBeginTracking = 1,
55819
55820
55821
55822
55823   kEventMenuEndTracking = 2,
55824
55825
55826
55827
55828
55829
55830
55831   kEventMenuChangeTrackingMode = 3,
55832   kEventMenuOpening = 4,
55833
55834
55835
55836
55837   kEventMenuClosed = 5,
55838
55839
55840
55841
55842
55843   kEventMenuTargetItem = 6,
55844   kEventMenuMatchKey = 7,
55845   kEventMenuEnableItems = 8,
55846   kEventMenuPopulate = 9,
55847   kEventMenuMeasureItemWidth = 100,
55848   kEventMenuMeasureItemHeight = 101,
55849   kEventMenuDrawItem = 102,
55850   kEventMenuDrawItemContent = 103,
55851
55852
55853
55854
55855   kEventMenuDispose = 1001
55856 };
55857
55858
55859
55860
55861
55862
55863
55864 enum {
55865
55866
55867
55868
55869
55870
55871
55872   kMenuContextMenuBar = 1 << 0,
55873
55874
55875
55876
55877
55878   kMenuContextPullDown = 1 << 8,
55879
55880
55881
55882
55883
55884   kMenuContextPopUp = 1 << 9,
55885
55886
55887
55888
55889
55890   kMenuContextSubmenu = 1 << 10,
55891
55892
55893
55894
55895
55896   kMenuContextMenuBarTracking = 1 << 16,
55897
55898
55899
55900
55901
55902   kMenuContextPopUpTracking = 1 << 17,
55903
55904
55905
55906
55907
55908   kMenuContextKeyMatching = 1 << 18,
55909   kMenuContextMenuEnabling = 1 << 19,
55910
55911
55912
55913
55914
55915
55916
55917   kMenuContextCommandIDSearch = 1 << 20
55918 };
55919 enum {
55920   kEventProcessCommand = 1,
55921   kEventCommandProcess = 1,
55922   kEventCommandUpdateStatus = 2
55923 };
55924 enum {
55925
55926
55927
55928
55929   kHICommandOK = 'ok  ',
55930
55931
55932
55933
55934   kHICommandCancel = 'not!',
55935
55936
55937
55938
55939   kHICommandQuit = 'quit',
55940
55941
55942
55943
55944   kHICommandUndo = 'undo',
55945
55946
55947
55948
55949   kHICommandRedo = 'redo',
55950
55951
55952
55953
55954   kHICommandCut = 'cut ',
55955
55956
55957
55958
55959   kHICommandCopy = 'copy',
55960
55961
55962
55963
55964   kHICommandPaste = 'past',
55965
55966
55967
55968
55969   kHICommandClear = 'clea',
55970
55971
55972
55973
55974   kHICommandSelectAll = 'sall',
55975
55976
55977
55978
55979
55980
55981   kHICommandHide = 'hide',
55982
55983
55984
55985
55986
55987
55988   kHICommandHideOthers = 'hido',
55989
55990
55991
55992
55993
55994
55995   kHICommandShowAll = 'shal',
55996
55997
55998
55999
56000   kHICommandPreferences = 'pref',
56001   kHICommandZoomWindow = 'zoom',
56002
56003
56004
56005
56006
56007
56008   kHICommandMinimizeWindow = 'mini',
56009
56010
56011
56012
56013
56014
56015
56016   kHICommandMinimizeAll = 'mina',
56017
56018
56019
56020
56021
56022
56023   kHICommandMaximizeWindow = 'maxi',
56024
56025
56026
56027
56028
56029
56030
56031   kHICommandMaximizeAll = 'maxa',
56032
56033
56034
56035
56036
56037
56038   kHICommandArrangeInFront = 'frnt',
56039
56040
56041
56042
56043
56044
56045
56046   kHICommandBringAllToFront = 'bfrt',
56047   kHICommandWindowListSeparator = 'wldv',
56048   kHICommandWindowListTerminator = 'wlst',
56049
56050
56051
56052
56053
56054
56055   kHICommandSelectWindow = 'swin',
56056   kHICommandRotateWindowsForward = 'rotw',
56057   kHICommandRotateWindowsBackward = 'rotb',
56058   kHICommandRotateFloatingWindowsForward = 'rtfw',
56059   kHICommandRotateFloatingWindowsBackward = 'rtfb',
56060
56061
56062
56063
56064   kHICommandAbout = 'abou',
56065
56066
56067
56068
56069   kHICommandNew = 'new ',
56070
56071
56072
56073
56074   kHICommandOpen = 'open',
56075
56076
56077
56078
56079   kHICommandClose = 'clos',
56080
56081
56082
56083
56084   kHICommandSave = 'save',
56085
56086
56087
56088
56089   kHICommandSaveAs = 'svas',
56090
56091
56092
56093
56094
56095   kHICommandRevert = 'rvrt',
56096
56097
56098
56099
56100   kHICommandPrint = 'prnt',
56101
56102
56103
56104
56105
56106   kHICommandPageSetup = 'page',
56107
56108
56109
56110
56111
56112
56113
56114   kHICommandAppHelp = 'ahlp'
56115 };
56116 enum {
56117
56118
56119
56120
56121
56122   kHICommandFromMenu = (1L << 0),
56123
56124
56125
56126
56127
56128   kHICommandFromControl = (1L << 1),
56129
56130
56131
56132
56133
56134   kHICommandFromWindow = (1L << 2)
56135 };
56136
56137 struct HICommand {
56138   UInt32 attributes;
56139   UInt32 commandID;
56140   struct {
56141     MenuRef menuRef;
56142     MenuItemIndex menuItemIndex;
56143   } menu;
56144 };
56145 typedef struct HICommand HICommand;
56146 struct HICommandExtended {
56147   UInt32 attributes;
56148   UInt32 commandID;
56149   union {
56150     ControlRef control;
56151     WindowRef window;
56152     struct {
56153       MenuRef menuRef;
56154       MenuItemIndex menuItemIndex;
56155     } menu;
56156   } source;
56157 };
56158 typedef struct HICommandExtended HICommandExtended;
56159 enum {
56160
56161
56162
56163
56164   kEventControlInitialize = 1000,
56165
56166
56167
56168
56169   kEventControlDispose = 1001,
56170   kEventControlGetOptimalBounds = 1003,
56171   kEventControlDefInitialize = kEventControlInitialize,
56172   kEventControlDefDispose = kEventControlDispose,
56173
56174
56175
56176
56177
56178   kEventControlHit = 1,
56179   kEventControlSimulateHit = 2,
56180
56181
56182
56183
56184
56185
56186
56187   kEventControlHitTest = 3,
56188
56189
56190
56191
56192
56193
56194   kEventControlDraw = 4,
56195
56196
56197
56198
56199
56200
56201
56202   kEventControlApplyBackground = 5,
56203   kEventControlApplyTextColor = 6,
56204   kEventControlSetFocusPart = 7,
56205
56206
56207
56208
56209
56210
56211   kEventControlGetFocusPart = 8,
56212
56213
56214
56215
56216
56217   kEventControlActivate = 9,
56218
56219
56220
56221
56222
56223   kEventControlDeactivate = 10,
56224
56225
56226
56227
56228
56229   kEventControlSetCursor = 11,
56230
56231
56232
56233
56234
56235
56236   kEventControlContextualMenuClick = 12,
56237
56238
56239
56240
56241
56242
56243
56244   kEventControlClick = 13,
56245   kEventControlGetNextFocusCandidate = 14,
56246
56247
56248
56249
56250
56251
56252   kEventControlGetAutoToggleValue = 15,
56253   kEventControlInterceptSubviewClick = 16,
56254   kEventControlGetClickActivation = 17,
56255   kEventControlDragEnter = 18,
56256
56257
56258
56259
56260
56261
56262
56263   kEventControlDragWithin = 19,
56264
56265
56266
56267
56268
56269   kEventControlDragLeave = 20,
56270
56271
56272
56273
56274   kEventControlDragReceive = 21,
56275
56276
56277
56278
56279
56280
56281
56282   kEventControlTrack = 51,
56283   kEventControlGetScrollToHereStartPoint = 52,
56284
56285
56286
56287
56288
56289
56290   kEventControlGetIndicatorDragConstraint = 53,
56291
56292
56293
56294
56295
56296
56297
56298   kEventControlIndicatorMoved = 54,
56299
56300
56301
56302
56303
56304   kEventControlGhostingFinished = 55,
56305
56306
56307
56308
56309
56310
56311
56312   kEventControlGetActionProcPart = 56,
56313
56314
56315
56316
56317
56318
56319
56320   kEventControlGetPartRegion = 101,
56321
56322
56323
56324
56325
56326
56327
56328   kEventControlGetPartBounds = 102,
56329
56330
56331
56332
56333
56334   kEventControlSetData = 103,
56335
56336
56337
56338
56339
56340   kEventControlGetData = 104,
56341   kEventControlGetSizeConstraints = 105,
56342
56343
56344
56345
56346
56347
56348   kEventControlValueFieldChanged = 151,
56349
56350
56351
56352
56353
56354   kEventControlAddedSubControl = 152,
56355
56356
56357
56358
56359
56360   kEventControlRemovingSubControl = 153,
56361
56362
56363
56364
56365
56366   kEventControlBoundsChanged = 154,
56367
56368
56369
56370
56371
56372   kEventControlTitleChanged = 158,
56373
56374
56375
56376
56377
56378
56379   kEventControlOwningWindowChanged = 159,
56380
56381
56382
56383
56384
56385
56386
56387   kEventControlHiliteChanged = 160,
56388
56389
56390
56391
56392
56393
56394
56395   kEventControlEnabledStateChanged = 161,
56396
56397
56398
56399
56400
56401   kEventControlArbitraryMessage = 201
56402 };
56403 enum {
56404
56405
56406
56407
56408   kControlBoundsChangeSizeChanged = (1 << 2),
56409
56410
56411
56412
56413   kControlBoundsChangePositionChanged = (1 << 3)
56414 };
56415 enum {
56416
56417
56418
56419
56420
56421   kEventTabletPoint = 1,
56422
56423
56424
56425
56426
56427   kEventTabletProximity = 2,
56428   kEventTabletPointer = 1
56429 };
56430
56431 struct TabletPointRec {
56432   SInt32 absX;
56433   SInt32 absY;
56434   SInt32 absZ;
56435   UInt16 buttons;
56436   UInt16 pressure;
56437   SInt16 tiltX;
56438   SInt16 tiltY;
56439   UInt16 rotation;
56440   SInt16 tangentialPressure;
56441   UInt16 deviceID;
56442   SInt16 vendor1;
56443   SInt16 vendor2;
56444   SInt16 vendor3;
56445 };
56446 typedef struct TabletPointRec TabletPointRec;
56447 typedef TabletPointRec TabletPointerRec;
56448 struct TabletProximityRec {
56449   UInt16 vendorID;
56450   UInt16 tabletID;
56451   UInt16 pointerID;
56452   UInt16 deviceID;
56453   UInt16 systemTabletID;
56454   UInt16 vendorPointerType;
56455   UInt32 pointerSerialNumber;
56456   UInt64 uniqueID;
56457   UInt32 capabilityMask;
56458   UInt8 pointerType;
56459   UInt8 enterProximity;
56460 };
56461 typedef struct TabletProximityRec TabletProximityRec;
56462 enum {
56463
56464
56465
56466
56467
56468   kEventVolumeMounted = 1,
56469
56470
56471
56472
56473
56474   kEventVolumeUnmounted = 2
56475 };
56476 enum {
56477   typeFSVolumeRefNum = 'voln'
56478 };
56479 enum {
56480
56481
56482
56483
56484
56485   kEventAppearanceScrollBarVariantChanged = 1
56486 };
56487 enum {
56488
56489
56490
56491
56492
56493
56494   kEventServiceCopy = 1,
56495
56496
56497
56498
56499
56500
56501   kEventServicePaste = 2,
56502   kEventServiceGetTypes = 3,
56503   kEventServicePerform = 4
56504 };
56505 extern CFStringRef
56506 CreateTypeStringWithOSType(OSType inType) ;
56507 enum {
56508   kEventAccessibleGetChildAtPoint = 1,
56509   kEventAccessibleGetFocusedChild = 2,
56510
56511
56512
56513
56514
56515
56516   kEventAccessibleGetAllAttributeNames = 21,
56517
56518
56519
56520
56521
56522
56523
56524   kEventAccessibleGetNamedAttribute = 22,
56525   kEventAccessibleSetNamedAttribute = 23,
56526   kEventAccessibleIsNamedAttributeSettable = 24,
56527
56528
56529
56530
56531
56532
56533   kEventAccessibleGetAllActionNames = 41,
56534
56535
56536
56537
56538
56539
56540   kEventAccessiblePerformNamedAction = 42,
56541   kEventAccessibleGetNamedActionDescription = 44
56542 };
56543 extern AXUIElementRef
56544 AXUIElementCreateWithHIObjectAndIdentifier(
56545   HIObjectRef inHIObject,
56546   UInt64 inIdentifier) ;
56547 extern HIObjectRef
56548 AXUIElementGetHIObject(AXUIElementRef inUIElement) ;
56549 extern void
56550 AXUIElementGetIdentifier(
56551   AXUIElementRef inUIElement,
56552   UInt64 * outIdentifier) ;
56553 extern void
56554 AXNotificationHIObjectNotify(
56555   CFStringRef inNotification,
56556   HIObjectRef inHIObject,
56557   UInt64 inIdentifier) ;
56558
56559
56560
56561
56562
56563 enum {
56564   kEventParamDirectObject = '----'
56565 };
56566
56567
56568
56569
56570 enum {
56571   kEventParamPostTarget = 'ptrg',
56572
56573
56574
56575
56576   typeEventTargetRef = 'etrg'
56577 };
56578
56579
56580
56581 enum {
56582   kEventParamWindowRef = 'wind',
56583   kEventParamGrafPort = 'graf',
56584   kEventParamDragRef = 'drag',
56585   kEventParamMenuRef = 'menu',
56586   kEventParamEventRef = 'evnt',
56587   kEventParamControlRef = 'ctrl',
56588   kEventParamRgnHandle = 'rgnh',
56589   kEventParamEnabled = 'enab',
56590   kEventParamDimensions = 'dims',
56591   kEventParamAvailableBounds = 'avlb',
56592   kEventParamAEEventID = keyAEEventID,
56593   kEventParamAEEventClass = keyAEEventClass,
56594   kEventParamCGContextRef = 'cntx',
56595   kEventParamDeviceDepth = 'devd',
56596   kEventParamDeviceColor = 'devc',
56597   kEventParamMutableArray = 'marr',
56598   kEventParamResult = 'ansr',
56599   kEventParamMinimumSize = 'mnsz',
56600   kEventParamMaximumSize = 'mxsz',
56601   typeWindowRef = 'wind',
56602   typeGrafPtr = 'graf',
56603   typeGWorldPtr = 'gwld',
56604   typeDragRef = 'drag',
56605   typeMenuRef = 'menu',
56606   typeControlRef = 'ctrl',
56607   typeCollection = 'cltn',
56608   typeQDRgnHandle = 'rgnh',
56609   typeOSStatus = 'osst',
56610   typeCFStringRef = 'cfst',
56611   typeCFMutableStringRef = 'cfms',
56612   typeCFIndex = 'cfix',
56613   typeCFTypeRef = 'cfty',
56614   typeCGContextRef = 'cntx',
56615   typeHIPoint = 'hipt',
56616   typeHISize = 'hisz',
56617   typeHIRect = 'hirc',
56618   typeVoidPtr = 'void'
56619 };
56620
56621
56622
56623 enum {
56624   kEventParamMouseLocation = 'mloc',
56625   kEventParamWindowMouseLocation = 'wmou',
56626   kEventParamMouseButton = 'mbtn',
56627   kEventParamClickCount = 'ccnt',
56628   kEventParamMouseWheelAxis = 'mwax',
56629   kEventParamMouseWheelDelta = 'mwdl',
56630   kEventParamMouseDelta = 'mdta',
56631   kEventParamMouseChord = 'chor',
56632   kEventParamTabletEventType = 'tblt',
56633   kEventParamMouseTrackingRef = 'mtrf',
56634   typeMouseButton = 'mbtn',
56635   typeMouseWheelAxis = 'mwax',
56636   typeMouseTrackingRef = 'mtrf'
56637 };
56638
56639
56640
56641 enum {
56642   kEventParamKeyCode = 'kcod',
56643   kEventParamKeyMacCharCodes = 'kchr',
56644   kEventParamKeyModifiers = 'kmod',
56645   kEventParamKeyUnicodes = 'kuni',
56646   kEventParamKeyboardType = 'kbdt',
56647   typeEventHotKeyID = 'hkid'
56648 };
56649
56650
56651
56652 enum {
56653   kEventParamTextInputSendRefCon = 'tsrc',
56654   kEventParamTextInputSendComponentInstance = 'tsci',
56655   kEventParamTextInputSendSLRec = 'tssl',
56656   kEventParamTextInputReplySLRec = 'trsl',
56657   kEventParamTextInputSendText = 'tstx',
56658   kEventParamTextInputReplyText = 'trtx',
56659   kEventParamTextInputSendUpdateRng = 'tsup',
56660   kEventParamTextInputSendHiliteRng = 'tshi',
56661   kEventParamTextInputSendClauseRng = 'tscl',
56662   kEventParamTextInputSendPinRng = 'tspn',
56663   kEventParamTextInputSendFixLen = 'tsfx',
56664   kEventParamTextInputSendLeadingEdge = 'tsle',
56665   kEventParamTextInputReplyLeadingEdge = 'trle',
56666   kEventParamTextInputSendTextOffset = 'tsto',
56667   kEventParamTextInputReplyTextOffset = 'trto',
56668   kEventParamTextInputReplyRegionClass = 'trrg',
56669   kEventParamTextInputSendCurrentPoint = 'tscp',
56670   kEventParamTextInputSendDraggingMode = 'tsdm',
56671   kEventParamTextInputReplyPoint = 'trpt',
56672   kEventParamTextInputReplyFont = 'trft',
56673   kEventParamTextInputReplyFMFont = 'trfm',
56674   kEventParamTextInputReplyPointSize = 'trpz',
56675   kEventParamTextInputReplyLineHeight = 'trlh',
56676   kEventParamTextInputReplyLineAscent = 'trla',
56677   kEventParamTextInputReplyTextAngle = 'trta',
56678   kEventParamTextInputSendShowHide = 'tssh',
56679   kEventParamTextInputReplyShowHide = 'trsh',
56680   kEventParamTextInputSendKeyboardEvent = 'tske',
56681   kEventParamTextInputSendTextServiceEncoding = 'tsse',
56682   kEventParamTextInputSendTextServiceMacEncoding = 'tssm',
56683   kEventParamTextInputGlyphInfoArray = 'glph'
56684 };
56685
56686
56687
56688 enum {
56689   kEventParamHICommand = 'hcmd',
56690   typeHICommand = 'hcmd'
56691 };
56692
56693
56694
56695 enum {
56696   kEventParamWindowFeatures = 'wftr',
56697   kEventParamWindowDefPart = 'wdpc',
56698   kEventParamCurrentBounds = 'crct',
56699   kEventParamOriginalBounds = 'orct',
56700   kEventParamPreviousBounds = 'prct',
56701   kEventParamClickActivation = 'clac',
56702   kEventParamWindowRegionCode = 'wshp',
56703   kEventParamWindowDragHiliteFlag = 'wdhf',
56704   kEventParamWindowModifiedFlag = 'wmff',
56705   kEventParamWindowProxyGWorldPtr = 'wpgw',
56706   kEventParamWindowProxyImageRgn = 'wpir',
56707   kEventParamWindowProxyOutlineRgn = 'wpor',
56708   kEventParamWindowStateChangedFlags = 'wscf',
56709   kEventParamWindowTitleFullWidth = 'wtfw',
56710   kEventParamWindowTitleTextWidth = 'wttw',
56711   kEventParamWindowGrowRect = 'grct',
56712   kEventParamAttributes = 'attr',
56713   kEventParamPreviousDockRect = 'pdrc',
56714   kEventParamCurrentDockRect = 'cdrc',
56715   typeWindowRegionCode = 'wshp',
56716   typeWindowDefPartCode = 'wdpt',
56717   typeClickActivationResult = 'clac'
56718 };
56719
56720
56721
56722 enum {
56723   kEventParamControlPart = 'cprt',
56724   kEventParamInitCollection = 'icol',
56725   kEventParamControlMessage = 'cmsg',
56726   kEventParamControlParam = 'cprm',
56727   kEventParamControlResult = 'crsl',
56728   kEventParamControlRegion = 'crgn',
56729   kEventParamControlAction = 'caup',
56730   kEventParamControlIndicatorDragConstraint = 'cidc',
56731   kEventParamControlIndicatorRegion = 'cirn',
56732   kEventParamControlIsGhosting = 'cgst',
56733   kEventParamControlIndicatorOffset = 'ciof',
56734   kEventParamControlClickActivationResult = 'ccar',
56735   kEventParamControlSubControl = 'csub',
56736   kEventParamControlOptimalBounds = 'cobn',
56737   kEventParamControlOptimalBaselineOffset = 'cobo',
56738   kEventParamControlDataTag = 'cdtg',
56739   kEventParamControlDataBuffer = 'cdbf',
56740   kEventParamControlDataBufferSize = 'cdbs',
56741   kEventParamControlDrawDepth = 'cddp',
56742   kEventParamControlDrawInColor = 'cdic',
56743   kEventParamControlFeatures = 'cftr',
56744   kEventParamControlPartBounds = 'cpbd',
56745   kEventParamControlOriginalOwningWindow = 'coow',
56746   kEventParamControlCurrentOwningWindow = 'ccow',
56747   kEventParamControlFocusEverything = 'cfev',
56748   kEventParamNextControl = 'cnxc',
56749   kEventParamStartControl = 'cstc',
56750   kEventParamControlSubview = 'csvw',
56751   kEventParamControlPreviousPart = 'copc',
56752   kEventParamControlCurrentPart = 'cnpc',
56753   kEventParamControlInvalRgn = 'civr',
56754   kEventParamControlValue = 'cval',
56755   typeControlActionUPP = 'caup',
56756   typeIndicatorDragConstraint = 'cidc',
56757   typeControlPartCode = 'cprt'
56758 };
56759
56760
56761
56762 enum {
56763   kEventParamCurrentMenuTrackingMode = 'cmtm',
56764   kEventParamNewMenuTrackingMode = 'nmtm',
56765   kEventParamMenuFirstOpen = '1sto',
56766   kEventParamMenuItemIndex = 'item',
56767   kEventParamMenuCommand = 'mcmd',
56768   kEventParamEnableMenuForKeyEvent = 'fork',
56769   kEventParamMenuEventOptions = 'meop',
56770   kEventParamMenuContext = 'mctx',
56771   kEventParamMenuItemBounds = 'mitb',
56772   kEventParamMenuMarkBounds = 'mmkb',
56773   kEventParamMenuIconBounds = 'micb',
56774   kEventParamMenuTextBounds = 'mtxb',
56775   kEventParamMenuTextBaseline = 'mtbl',
56776   kEventParamMenuCommandKeyBounds = 'mcmb',
56777   kEventParamMenuVirtualTop = 'mvrt',
56778   kEventParamMenuVirtualBottom = 'mvrb',
56779   kEventParamMenuDrawState = 'mdrs',
56780   kEventParamMenuItemType = 'mitp',
56781   kEventParamMenuItemWidth = 'mitw',
56782   kEventParamMenuItemHeight = 'mith',
56783   typeMenuItemIndex = 'midx',
56784   typeMenuCommand = 'mcmd',
56785   typeMenuTrackingMode = 'mtmd',
56786   typeMenuEventOptions = 'meop',
56787   typeThemeMenuState = 'tmns',
56788   typeThemeMenuItemType = 'tmit'
56789 };
56790
56791
56792
56793 enum {
56794   kEventParamProcessID = 'psn ',
56795   kEventParamLaunchRefCon = 'lref',
56796   kEventParamLaunchErr = 'err ',
56797   kEventParamSystemUIMode = 'uimd'
56798 };
56799
56800
56801
56802 enum {
56803   kEventParamTabletPointRec = 'tbrc',
56804   kEventParamTabletProximityRec = 'tbpx',
56805   typeTabletPointRec = 'tbrc',
56806   typeTabletProximityRec = 'tbpx',
56807   kEventParamTabletPointerRec = 'tbrc',
56808   typeTabletPointerRec = 'tbrc'
56809 };
56810
56811
56812
56813 enum {
56814   kEventParamNewScrollBarVariant = 'nsbv'
56815 };
56816
56817
56818
56819 enum {
56820   kEventParamScrapRef = 'scrp',
56821   kEventParamServiceCopyTypes = 'svsd',
56822   kEventParamServicePasteTypes = 'svpt',
56823   kEventParamServiceMessageName = 'svmg',
56824   kEventParamServiceUserData = 'svud',
56825   typeScrapRef = 'scrp',
56826   typeCFMutableArrayRef = 'cfma'
56827 };
56828
56829
56830
56831 enum {
56832   kEventParamToolbar = 'tbar',
56833   kEventParamToolbarItem = 'tbit',
56834   kEventParamToolbarItemIdentifier = 'tbii',
56835   kEventParamToolbarItemConfigData = 'tbid',
56836   typeHIToolbarRef = 'tbar',
56837   typeHIToolbarItemRef = 'tbit'
56838 };
56839
56840
56841
56842 enum {
56843   kEventParamAccessibleObject = 'aobj',
56844   kEventParamAccessibleChild = 'achl',
56845   kEventParamAccessibleAttributeName = 'atnm',
56846   kEventParamAccessibleAttributeNames = 'atns',
56847   kEventParamAccessibleAttributeValue = 'atvl',
56848   kEventParamAccessibleAttributeSettable = 'atst',
56849   kEventParamAccessibleActionName = 'acnm',
56850   kEventParamAccessibleActionNames = 'acns',
56851   kEventParamAccessibleActionDescription = 'acds'
56852 };
56853 extern EventTargetRef
56854 GetWindowEventTarget(WindowRef inWindow) ;
56855 extern EventTargetRef
56856 GetControlEventTarget(ControlRef inControl) ;
56857 extern EventTargetRef
56858 GetMenuEventTarget(MenuRef inMenu) ;
56859 extern EventTargetRef
56860 GetApplicationEventTarget(void) ;
56861 extern EventTargetRef
56862 GetUserFocusEventTarget(void) ;
56863 extern EventTargetRef
56864 GetEventDispatcherTarget(void) ;
56865 typedef struct OpaqueToolboxObjectClassRef* ToolboxObjectClassRef;
56866 extern OSStatus
56867 RegisterToolboxObjectClass(
56868   CFStringRef inClassID,
56869   ToolboxObjectClassRef inBaseClass,
56870   UInt32 inNumEvents,
56871   const EventTypeSpec * inEventList,
56872   EventHandlerUPP inEventHandler,
56873   void * inEventHandlerData,
56874   ToolboxObjectClassRef * outClassRef) ;
56875 extern OSStatus
56876 UnregisterToolboxObjectClass(ToolboxObjectClassRef inClassRef) ;
56877 extern OSStatus
56878 ProcessHICommand(const HICommand * inCommand) ;
56879 extern void
56880 RunApplicationEventLoop(void) ;
56881 extern void
56882 QuitApplicationEventLoop(void) ;
56883 extern OSStatus
56884 RunAppModalLoopForWindow(WindowRef inWindow) ;
56885 extern OSStatus
56886 QuitAppModalLoopForWindow(WindowRef inWindow) ;
56887 extern OSStatus
56888 BeginAppModalStateForWindow(WindowRef inWindow) ;
56889 extern OSStatus
56890 EndAppModalStateForWindow(WindowRef inWindow) ;
56891 extern OSStatus
56892 SetUserFocusWindow(WindowRef inWindow) ;
56893 extern WindowRef
56894 GetUserFocusWindow(void) ;
56895 extern OSStatus
56896 SetWindowDefaultButton(
56897   WindowRef inWindow,
56898   ControlRef inControl) ;
56899 extern OSStatus
56900 SetWindowCancelButton(
56901   WindowRef inWindow,
56902   ControlRef inControl) ;
56903 extern OSStatus
56904 GetWindowDefaultButton(
56905   WindowRef inWindow,
56906   ControlRef * outControl) ;
56907 extern OSStatus
56908 GetWindowCancelButton(
56909   WindowRef inWindow,
56910   ControlRef * outControl) ;
56911
56912
56913
56914
56915
56916
56917 struct EventHotKeyID {
56918   OSType signature;
56919   UInt32 id;
56920 };
56921 typedef struct EventHotKeyID EventHotKeyID;
56922 typedef struct OpaqueEventHotKeyRef* EventHotKeyRef;
56923 extern OSStatus
56924 RegisterEventHotKey(
56925   UInt32 inHotKeyCode,
56926   UInt32 inHotKeyModifiers,
56927   EventHotKeyID inHotKeyID,
56928   EventTargetRef inTarget,
56929   OptionBits inOptions,
56930   EventHotKeyRef * outRef) ;
56931 extern OSStatus
56932 UnregisterEventHotKey(EventHotKeyRef inHotKey) ;
56933 typedef struct OpaqueMouseTrackingRef* MouseTrackingRef;
56934 typedef UInt32 MouseTrackingOptions;
56935 enum {
56936
56937
56938
56939
56940
56941   kMouseTrackingOptionsLocalClip = 0,
56942
56943
56944
56945
56946
56947   kMouseTrackingOptionsGlobalClip = 1,
56948
56949
56950
56951
56952
56953   kMouseTrackingOptionsStandard = kMouseTrackingOptionsLocalClip
56954 };
56955
56956 struct MouseTrackingRegionID {
56957   OSType signature;
56958   SInt32 id;
56959 };
56960 typedef struct MouseTrackingRegionID MouseTrackingRegionID;
56961 extern OSStatus
56962 CreateMouseTrackingRegion(
56963   WindowRef inWindow,
56964   RgnHandle inRegion,
56965   RgnHandle inClip,
56966   MouseTrackingOptions inOptions,
56967   MouseTrackingRegionID inID,
56968   void * inRefCon,
56969   EventTargetRef inTargetToNotify,
56970   MouseTrackingRef * outTrackingRef) ;
56971 extern OSStatus
56972 RetainMouseTrackingRegion(MouseTrackingRef inMouseRef) ;
56973 extern OSStatus
56974 ReleaseMouseTrackingRegion(MouseTrackingRef inMouseRef) ;
56975 extern OSStatus
56976 ChangeMouseTrackingRegion(
56977   MouseTrackingRef inMouseRef,
56978   RgnHandle inRegion,
56979   RgnHandle inClip) ;
56980 extern OSStatus
56981 ClipMouseTrackingRegion(
56982   MouseTrackingRef inMouseRef,
56983   RgnHandle inRegion) ;
56984 extern OSStatus
56985 GetMouseTrackingRegionID(
56986   MouseTrackingRef inMouseRef,
56987   MouseTrackingRegionID * outID) ;
56988 extern OSStatus
56989 GetMouseTrackingRegionRefCon(
56990   MouseTrackingRef inMouseRef,
56991   void ** outRefCon) ;
56992 extern OSStatus
56993 MoveMouseTrackingRegion(
56994   MouseTrackingRef inMouseRef,
56995   SInt16 deltaH,
56996   SInt16 deltaV,
56997   RgnHandle inClip) ;
56998 extern OSStatus
56999 SetMouseTrackingRegionEnabled(
57000   MouseTrackingRef inMouseRef,
57001   Boolean inEnabled) ;
57002 extern OSStatus
57003 ClipWindowMouseTrackingRegions(
57004   WindowRef inWindow,
57005   OSType inSignature,
57006   RgnHandle inClip) ;
57007 extern OSStatus
57008 MoveWindowMouseTrackingRegions(
57009   WindowRef inWindow,
57010   OSType inSignature,
57011   SInt16 deltaH,
57012   SInt16 deltaV,
57013   RgnHandle inClip) ;
57014 extern OSStatus
57015 SetWindowMouseTrackingRegionsEnabled(
57016   WindowRef inWindow,
57017   OSType inSignature,
57018   Boolean inEnabled) ;
57019 extern OSStatus
57020 ReleaseWindowMouseTrackingRegions(
57021   WindowRef inWindow,
57022   OSType inSignature) ;
57023
57024
57025
57026
57027
57028
57029 enum {
57030   kEventWindowDefDrawFrame = kEventWindowDrawFrame,
57031   kEventWindowDefDrawPart = kEventWindowDrawPart,
57032   kEventWindowDefGetRegion = kEventWindowGetRegion,
57033   kEventWindowDefHitTest = kEventWindowHitTest,
57034   kEventWindowDefInit = kEventWindowInit,
57035   kEventWindowDefDispose = kEventWindowDispose,
57036   kEventWindowDefDragHilite = kEventWindowDragHilite,
57037   kEventWindowDefModified = kEventWindowModified,
57038   kEventWindowDefSetupProxyDragImage = kEventWindowSetupProxyDragImage,
57039   kEventWindowDefStateChanged = kEventWindowStateChanged,
57040   kEventWindowDefMeasureTitle = kEventWindowMeasureTitle,
57041   kEventWindowDefDrawGrowBox = kEventWindowDrawGrowBox,
57042   kEventWindowDefGetGrowImageRegion = kEventWindowGetGrowImageRegion
57043 };
57044
57045
57046 enum {
57047   kEventClassEPPC = kEventClassAppleEvent,
57048   kEventHighLevelEvent = kEventAppleEvent
57049 };
57050
57051 enum {
57052   kEventUpdateActiveInputArea = kEventTextInputUpdateActiveInputArea,
57053   kEventUnicodeForKeyEvent = kEventTextInputUnicodeForKeyEvent,
57054   kEventOffsetToPos = kEventTextInputOffsetToPos,
57055   kEventPosToOffset = kEventTextInputPosToOffset,
57056   kEventShowHideBottomWindow = kEventTextInputShowHideBottomWindow,
57057   kEventGetSelectedText = kEventTextInputGetSelectedText
57058 };
57059
57060
57061
57062
57063
57064 typedef UInt32 EventClassID;
57065 typedef UInt32 EventClass;
57066 typedef UInt32 EventType;
57067
57068
57069
57070 enum {
57071   kMouseTrackingMousePressed = kMouseTrackingMouseDown,
57072   kMouseTrackingMouseReleased = kMouseTrackingMouseUp
57073 };
57074
57075 enum {
57076   kEventControlGetSubviewForMouseEvent = kEventControlInterceptSubviewClick
57077 };
57078
57079
57080
57081
57082 }
57083 extern "C" {
57084
57085
57086
57087 typedef ControlRef HIViewRef;
57088 typedef ControlID HIViewID;
57089 typedef ControlPartCode HIViewPartCode;
57090 extern const HIViewID kHIViewWindowContentID;
57091 extern const HIViewID kHIViewWindowGrowBoxID;
57092
57093
57094
57095
57096
57097
57098 enum {
57099
57100
57101
57102
57103   kHIViewZOrderAbove = 1,
57104
57105
57106
57107
57108   kHIViewZOrderBelow = 2
57109 };
57110
57111 typedef UInt32 HIViewZOrderOp;
57112 enum {
57113
57114
57115
57116
57117
57118
57119
57120   kHIViewSendCommandToUserFocus = (1 << 0)
57121 };
57122 extern HIViewRef
57123 HIViewGetRoot(WindowRef inWindow) ;
57124 extern OSStatus
57125 HIViewAddSubview(
57126   HIViewRef inParent,
57127   HIViewRef inNewChild) ;
57128 extern OSStatus
57129 HIViewRemoveFromSuperview(HIViewRef inView) ;
57130 extern HIViewRef
57131 HIViewGetSuperview(HIViewRef inView) ;
57132 extern HIViewRef
57133 HIViewGetFirstSubview(HIViewRef inView) ;
57134 extern HIViewRef
57135 HIViewGetLastSubview(HIViewRef inView) ;
57136 extern HIViewRef
57137 HIViewGetNextView(HIViewRef inView) ;
57138 extern HIViewRef
57139 HIViewGetPreviousView(HIViewRef inView) ;
57140 extern OSStatus
57141 HIViewSetZOrder(
57142   HIViewRef inView,
57143   HIViewZOrderOp inOp,
57144   HIViewRef inOther) ;
57145 extern OSStatus
57146 HIViewSetVisible(
57147   HIViewRef inView,
57148   Boolean inVisible) ;
57149 extern Boolean
57150 HIViewIsVisible(HIViewRef inView) ;
57151 extern OSStatus
57152 HIViewGetBounds(
57153   HIViewRef inView,
57154   HIRect * outRect) ;
57155 extern OSStatus
57156 HIViewGetFrame(
57157   HIViewRef inView,
57158   HIRect * outRect) ;
57159 extern OSStatus
57160 HIViewSetFrame(
57161   HIViewRef inView,
57162   const HIRect * inRect) ;
57163 extern OSStatus
57164 HIViewMoveBy(
57165   HIViewRef inView,
57166   float inDX,
57167   float inDY) ;
57168 extern OSStatus
57169 HIViewPlaceInSuperviewAt(
57170   HIViewRef inView,
57171   float inX,
57172   float inY) ;
57173 extern OSStatus
57174 HIViewReshapeStructure(HIViewRef inView) ;
57175 extern OSStatus
57176 HIViewGetViewForMouseEvent(
57177   HIViewRef inView,
57178   EventRef inEvent,
57179   HIViewRef * outView) ;
57180 extern OSStatus
57181 HIViewClick(
57182   HIViewRef inView,
57183   EventRef inEvent) ;
57184 extern OSStatus
57185 HIViewSimulateClick(
57186   HIViewRef inView,
57187   HIViewPartCode inPartToClick,
57188   UInt32 inModifiers,
57189   ControlPartCode * outPartClicked) ;
57190 extern OSStatus
57191 HIViewGetPartHit(
57192   HIViewRef inView,
57193   const HIPoint * inPoint,
57194   HIViewPartCode * outPart) ;
57195 extern OSStatus
57196 HIViewGetSubviewHit(
57197   HIViewRef inView,
57198   const HIPoint * inPoint,
57199   Boolean inDeep,
57200   HIViewRef * outView) ;
57201 extern Boolean
57202 HIViewGetNeedsDisplay(HIViewRef inView) ;
57203 extern OSStatus
57204 HIViewSetNeedsDisplay(
57205   HIViewRef inView,
57206   Boolean inNeedsDisplay) ;
57207 extern OSStatus
57208 HIViewSetNeedsDisplayInRegion(
57209   HIViewRef inView,
57210   RgnHandle inRgn,
57211   Boolean inNeedsDisplay) ;
57212 extern OSStatus
57213 HIViewFlashDirtyArea(WindowRef inWindow) ;
57214 extern OSStatus
57215 HIViewGetSizeConstraints(
57216   HIViewRef inView,
57217   HISize * outMinSize,
57218   HISize * outMaxSize) ;
57219 extern OSStatus
57220 HIViewConvertPoint(
57221   HIPoint * ioPoint,
57222   HIViewRef inSourceView,
57223   HIViewRef inDestView) ;
57224 extern OSStatus
57225 HIViewConvertRect(
57226   HIRect * ioRect,
57227   HIViewRef inSourceView,
57228   HIViewRef inDestView) ;
57229 extern OSStatus
57230 HIViewConvertRegion(
57231   RgnHandle ioRgn,
57232   HIViewRef inSourceView,
57233   HIViewRef inDestView) ;
57234 extern OSStatus
57235 HIViewSetDrawingEnabled(
57236   HIViewRef inView,
57237   Boolean inEnabled) ;
57238 extern Boolean
57239 HIViewIsDrawingEnabled(HIViewRef inView) ;
57240 extern OSStatus
57241 HIViewScrollRect(
57242   HIViewRef inView,
57243   const HIRect * inRect,
57244   float inDX,
57245   float inDY) ;
57246 extern OSStatus
57247 HIViewSetBoundsOrigin(
57248   HIViewRef inView,
57249   float inX,
57250   float inY) ;
57251 extern OSStatus
57252 HIViewAdvanceFocus(
57253   HIViewRef inRootForFocus,
57254   EventModifiers inModifiers) ;
57255 extern OSStatus
57256 HIViewGetFocusPart(
57257   HIViewRef inView,
57258   HIViewPartCode * outFocusPart) ;
57259 extern Boolean
57260 HIViewSubtreeContainsFocus(HIViewRef inSubtreeStart) ;
57261 extern OSStatus
57262 HIViewSetNextFocus(
57263   HIViewRef inView,
57264   HIViewRef inNextFocus) ;
57265 extern OSStatus
57266 HIViewSetFirstSubViewFocus(
57267   HIViewRef inParent,
57268   HIViewRef inSubView) ;
57269 extern OSStatus
57270 HIViewFindByID(
57271   HIViewRef inStartView,
57272   HIViewID inID,
57273   HIViewRef * outControl) ;
57274 extern OSStatus
57275 HIViewGetAttributes(
57276   HIViewRef inView,
57277   OptionBits * outAttrs) ;
57278 extern OSStatus
57279 HIViewChangeAttributes(
57280   HIViewRef inView,
57281   OptionBits inAttrsToSet,
57282   OptionBits inAttrsToClear) ;
57283 extern OSStatus
57284 HIViewCreateOffscreenImage(
57285   HIViewRef inView,
57286   OptionBits inOptions,
57287   HIRect * outFrame,
57288   CGImageRef * outImage) ;
57289 extern OSStatus
57290 HIViewDrawCGImage(
57291   CGContextRef inContext,
57292   const HIRect * inBounds,
57293   CGImageRef inImage) ;
57294 extern OSStatus
57295 HIGrowBoxViewSetTransparent(
57296   HIViewRef inGrowBoxView,
57297   Boolean inTransparent) ;
57298 extern Boolean
57299 HIGrowBoxViewIsTransparent(HIViewRef inGrowBoxView) ;
57300
57301
57302
57303
57304
57305
57306 enum {
57307   kEventClassScrollable = 'scrl'
57308 };
57309
57310 enum {
57311   kEventScrollableGetInfo = 1,
57312   kEventScrollableInfoChanged = 2,
57313   kEventScrollableScrollTo = 10
57314 };
57315
57316 enum {
57317   kEventParamImageSize = 'imsz',
57318   kEventParamViewSize = 'vwsz',
57319   kEventParamLineSize = 'lnsz',
57320   kEventParamOrigin = 'orgn'
57321 };
57322
57323
57324
57325
57326
57327
57328 enum {
57329
57330
57331
57332
57333   kHIScrollViewOptionsVertScroll = (1 << 0),
57334
57335
57336
57337
57338   kHIScrollViewOptionsHorizScroll = (1 << 1),
57339
57340
57341
57342
57343
57344
57345   kHIScrollViewOptionsAllowGrow = (1 << 2),
57346   kHIScrollViewValidOptions = (kHIScrollViewOptionsVertScroll | kHIScrollViewOptionsHorizScroll | kHIScrollViewOptionsAllowGrow)
57347 };
57348 extern OSStatus
57349 HIScrollViewCreate(
57350   OptionBits inOptions,
57351   HIViewRef * outView) ;
57352 extern OSStatus
57353 HIScrollViewSetScrollBarAutoHide(
57354   HIViewRef inView,
57355   Boolean inAutoHide) ;
57356 extern Boolean
57357 HIScrollViewGetScrollBarAutoHide(HIViewRef inView) ;
57358 extern OSStatus
57359 HIImageViewCreate(
57360   CGImageRef inImage,
57361   ControlRef * outControl) ;
57362
57363
57364 enum {
57365   kHIImageViewImageTag = 'imag'
57366 };
57367 extern OSStatus
57368 HIImageViewSetOpaque(
57369   HIViewRef inView,
57370   Boolean inOpaque) ;
57371 extern Boolean
57372 HIImageViewIsOpaque(HIViewRef inView) ;
57373 extern OSStatus
57374 HIImageViewSetAlpha(
57375   HIViewRef inView,
57376   float inAlpha) ;
57377 extern float
57378 HIImageViewGetAlpha(HIViewRef inView) ;
57379 extern OSStatus
57380 HIImageViewSetScaleToFit(
57381   HIViewRef inView,
57382   Boolean inScaleToFit) ;
57383 extern Boolean
57384 HIImageViewGetScaleToFit(HIViewRef inView) ;
57385 extern OSStatus
57386 HIImageViewSetImage(
57387   HIViewRef inView,
57388   CGImageRef inImage) ;
57389 extern CGImageRef
57390 HIImageViewCopyImage(HIViewRef inView) ;
57391 enum {
57392
57393
57394
57395
57396   kHIComboBoxNoAttributes = 0L,
57397
57398
57399
57400
57401
57402
57403   kHIComboBoxAutoCompletionAttribute = (1L << 0),
57404
57405
57406
57407
57408
57409   kHIComboBoxAutoDisclosureAttribute = (1L << 1),
57410
57411
57412
57413
57414
57415   kHIComboBoxAutoSortAttribute = (1L << 2),
57416
57417
57418
57419
57420
57421   kHIComboBoxAutoSizeListAttribute = (1L << 3),
57422
57423
57424
57425
57426   kHIComboBoxStandardAttributes = (kHIComboBoxAutoCompletionAttribute | kHIComboBoxAutoDisclosureAttribute | kHIComboBoxAutoSizeListAttribute)
57427 };
57428
57429
57430 enum {
57431   kControlKindHIComboBox = 'cbbx'
57432 };
57433
57434
57435 enum {
57436   kHIComboBoxEditTextPart = 5,
57437   kHIComboBoxDisclosurePart = 28
57438 };
57439
57440
57441
57442
57443
57444
57445 enum {
57446
57447
57448
57449
57450
57451
57452
57453   kHIComboBoxListTag = 'cbls',
57454
57455
57456
57457
57458
57459   kHIComboBoxListPixelWidthTag = 'cblw',
57460
57461
57462
57463
57464
57465   kHIComboBoxListPixelHeightTag = 'cblh',
57466
57467
57468
57469
57470
57471   kHIComboBoxNumVisibleItemsTag = 'cbni'
57472 };
57473 extern OSStatus
57474 HIComboBoxCreate(
57475   const HIRect * boundsRect,
57476   CFStringRef text,
57477   const ControlFontStyleRec * style,
57478   CFArrayRef list,
57479   OptionBits inAttributes,
57480   HIViewRef * outComboBox) ;
57481 extern ItemCount
57482 HIComboBoxGetItemCount(HIViewRef inComboBox) ;
57483 extern OSStatus
57484 HIComboBoxInsertTextItemAtIndex(
57485   HIViewRef inComboBox,
57486   CFIndex inIndex,
57487   CFStringRef inText) ;
57488 extern OSStatus
57489 HIComboBoxAppendTextItem(
57490   HIViewRef inComboBox,
57491   CFStringRef inText,
57492   CFIndex * outIndex) ;
57493 extern OSStatus
57494 HIComboBoxCopyTextItemAtIndex(
57495   HIViewRef inComboBox,
57496   CFIndex inIndex,
57497   CFStringRef * outString) ;
57498 extern OSStatus
57499 HIComboBoxRemoveItemAtIndex(
57500   HIViewRef inComboBox,
57501   CFIndex inIndex) ;
57502 extern OSStatus
57503 HIComboBoxChangeAttributes(
57504   HIViewRef inComboBox,
57505   OptionBits inAttributesToSet,
57506   OptionBits inAttributesToClear) ;
57507 extern OSStatus
57508 HIComboBoxGetAttributes(
57509   HIViewRef inComboBox,
57510   OptionBits * outAttributes) ;
57511
57512
57513
57514
57515
57516 }
57517
57518
57519
57520 extern "C" {
57521 extern OSStatus
57522 GetTextAndEncodingFromCFString(
57523   CFStringRef inString,
57524   BytePtr outText,
57525   ByteCount inTextMaxLength,
57526   ByteCount * outTextLength,
57527   TextEncoding * outEncoding) ;
57528
57529
57530
57531
57532 }
57533
57534
57535
57536 extern "C" {
57537 typedef const struct __HIShape* HIShapeRef;
57538 typedef struct __HIShape* HIMutableShapeRef;
57539 extern CFTypeID
57540 HIShapeGetTypeID(void) ;
57541 extern HIShapeRef
57542 HIShapeCreateWithQDRgn(RgnHandle inRgn) ;
57543 extern HIShapeRef
57544 HIShapeCreateWithRect(const HIRect * inRect) ;
57545 extern HIShapeRef
57546 HIShapeCreateCopy(HIShapeRef inShape) ;
57547 extern HIShapeRef
57548 HIShapeCreateIntersection(
57549   HIShapeRef inShape1,
57550   HIShapeRef inShape2) ;
57551 extern HIShapeRef
57552 HIShapeCreateDifference(
57553   HIShapeRef inShape1,
57554   HIShapeRef inShape2) ;
57555 extern HIShapeRef
57556 HIShapeCreateUnion(
57557   HIShapeRef inShape1,
57558   HIShapeRef inShape2) ;
57559 extern Boolean
57560 HIShapeIsEmpty(HIShapeRef inShape) ;
57561 extern Boolean
57562 HIShapeIsRectangular(HIShapeRef inShape) ;
57563 extern Boolean
57564 HIShapeContainsPoint(
57565   HIShapeRef inShape,
57566   const HIPoint * inPoint) ;
57567 extern HIRect *
57568 HIShapeGetBounds(
57569   HIShapeRef inShape,
57570   HIRect * outRect) ;
57571 extern OSStatus
57572 HIShapeGetAsQDRgn(
57573   HIShapeRef inShape,
57574   RgnHandle outRgn) ;
57575 extern OSStatus
57576 HIShapeReplacePathInCGContext(
57577   HIShapeRef inShape,
57578   CGContextRef inContext) ;
57579 extern OSStatus
57580 HIShapeSetQDClip(
57581   HIShapeRef inShape,
57582   CGrafPtr inPort) ;
57583 extern HIMutableShapeRef
57584 HIShapeCreateMutable(void) ;
57585 extern HIMutableShapeRef
57586 HIShapeCreateMutableCopy(HIShapeRef inOrig) ;
57587 extern OSStatus
57588 HIShapeSetEmpty(HIMutableShapeRef inShape) ;
57589 extern OSStatus
57590 HIShapeIntersect(
57591   HIShapeRef inShape1,
57592   HIShapeRef inShape2,
57593   HIMutableShapeRef outResult) ;
57594 extern OSStatus
57595 HIShapeDifference(
57596   HIShapeRef inShape1,
57597   HIShapeRef inShape2,
57598   HIMutableShapeRef outResult) ;
57599 extern OSStatus
57600 HIShapeUnion(
57601   HIShapeRef inShape1,
57602   HIShapeRef inShape2,
57603   HIMutableShapeRef outResult) ;
57604 extern OSStatus
57605 HIShapeOffset(
57606   HIMutableShapeRef inShape,
57607   float inDX,
57608   float inDY) ;
57609
57610
57611
57612
57613
57614 }
57615
57616
57617
57618 extern "C" {
57619
57620
57621
57622
57623
57624
57625
57626
57627
57628 typedef SInt16 BalloonVariant;
57629 enum {
57630   kTopLeftTipPointsLeftVariant = 0,
57631   kTopLeftTipPointsUpVariant = 1,
57632   kTopRightTipPointsUpVariant = 2,
57633   kTopRightTipPointsRightVariant = 3,
57634   kBottomRightTipPointsRightVariant = 4,
57635   kBottomRightTipPointsDownVariant = 5,
57636   kBottomLeftTipPointsDownVariant = 6,
57637   kBottomLeftTipPointsLeftVariant = 7,
57638   kBalloonVariantCount = 8
57639 };
57640
57641
57642 enum {
57643   hmBalloonHelpVersion = 0x0002
57644 };
57645
57646 enum {
57647   kHMHelpMenuID = -16490,
57648   kHMAboutHelpItem = 1,
57649   kHMShowBalloonsItem = 3
57650 };
57651
57652 enum {
57653   kHMHelpID = -5696,
57654   kBalloonWDEFID = 126
57655 };
57656
57657 enum {
57658
57659   helpItem = 1
57660 };
57661
57662 enum {
57663
57664   hmDefaultOptions = 0,
57665   hmUseSubIDBit = 0,
57666   hmAbsoluteCoordsBit = 1,
57667   hmSaveBitsNoWindowBit = 2,
57668   hmSaveBitsWindowBit = 3,
57669   hmMatchInTitleBit = 4,
57670   hmUseSubIDMask = (1 << hmUseSubIDBit),
57671   hmAbsoluteCoordsMask = (1 << hmAbsoluteCoordsBit),
57672   hmSaveBitsNoWindowMask = (1 << hmSaveBitsNoWindowBit),
57673   hmSaveBitsWindowMask = (1 << hmSaveBitsWindowBit),
57674   hmMatchInTitleMask = (1 << hmMatchInTitleBit)
57675 };
57676 enum {
57677
57678   kHMStringItem = 1,
57679   kHMPictItem = 2,
57680   kHMStringResItem = 3,
57681   kHMTEResItem = 6,
57682   kHMSTRResItem = 7,
57683   kHMSkipItem = 256,
57684   kHMCompareItem = 512,
57685   kHMNamedResourceItem = 1024,
57686   kHMTrackCntlItem = 2048
57687 };
57688
57689 enum {
57690
57691   khmmString = 1,
57692   khmmPict = 2,
57693   khmmStringRes = 3,
57694   khmmTEHandle = 4,
57695   khmmPictHandle = 5,
57696   khmmTERes = 6,
57697   khmmSTRRes = 7,
57698   kHMEnabledItem = 0
57699 };
57700
57701 enum {
57702
57703   kHMTETextResType = 'TEXT',
57704   kHMTEStyleResType = 'styl'
57705 };
57706
57707 enum {
57708   kHMDisabledItem = 1,
57709   kHMCheckedItem = 2,
57710   kHMOtherItem = 3,
57711
57712   kHMRegularWindow = 0,
57713   kHMSaveBitsNoWindow = 1,
57714   kHMSaveBitsWindow = 2
57715 };
57716
57717 enum {
57718
57719   kHMMenuResType = 'hmnu',
57720   kHMDialogResType = 'hdlg',
57721   kHMWindListResType = 'hwin',
57722   kHMRectListResType = 'hrct',
57723   kHMOverrideResType = 'hovr',
57724   kHMFinderApplResType = 'hfdr'
57725 };
57726
57727 struct HMStringResType {
57728   short hmmResID;
57729   short hmmIndex;
57730 };
57731 typedef struct HMStringResType HMStringResType;
57732 struct HMMessageRecord {
57733   SInt16 hmmHelpType;
57734   union {
57735     Str255 hmmString;
57736     SInt16 hmmPict;
57737     TEHandle hmmTEHandle;
57738     HMStringResType hmmStringRes;
57739     SInt16 hmmPictRes;
57740     PicHandle hmmPictHandle;
57741     SInt16 hmmTERes;
57742     SInt16 hmmSTRRes;
57743   } u;
57744 };
57745 typedef struct HMMessageRecord HMMessageRecord;
57746 typedef HMMessageRecord * HMMessageRecPtr;
57747 typedef OSErr ( * TipFunctionProcPtr)(Point tip, RgnHandle structure, Rect *r, BalloonVariant *balloonVariant);
57748 typedef TipFunctionProcPtr TipFunctionUPP;
57749
57750
57751 }
57752
57753
57754
57755
57756
57757
57758
57759 extern "C" {
57760
57761
57762
57763 typedef struct NMRec NMRec;
57764 typedef NMRec * NMRecPtr;
57765 typedef void ( * NMProcPtr)(NMRecPtr nmReqPtr);
57766 typedef NMProcPtr NMUPP;
57767 struct NMRec {
57768   QElemPtr qLink;
57769   short qType;
57770   short nmFlags;
57771   long nmPrivate;
57772   short nmReserved;
57773   short nmMark;
57774   Handle nmIcon;
57775   Handle nmSound;
57776   StringPtr nmStr;
57777   NMUPP nmResp;
57778   long nmRefCon;
57779 };
57780 extern NMUPP
57781 NewNMUPP(NMProcPtr userRoutine) ;
57782 extern void
57783 DisposeNMUPP(NMUPP userUPP) ;
57784 extern void
57785 InvokeNMUPP(
57786   NMRecPtr nmReqPtr,
57787   NMUPP userUPP) ;
57788 extern OSErr
57789 NMInstall(NMRecPtr nmReqPtr) ;
57790 extern OSErr
57791 NMRemove(NMRecPtr nmReqPtr) ;
57792
57793
57794
57795
57796
57797
57798 }
57799 extern "C" {
57800
57801
57802
57803 enum {
57804   kAppearanceEventClass = 'appr',
57805   kAEAppearanceChanged = 'thme',
57806   kAESystemFontChanged = 'sysf',
57807   kAESmallSystemFontChanged = 'ssfn',
57808   kAEViewsFontChanged = 'vfnt'
57809 };
57810
57811
57812
57813
57814 enum {
57815   kThemeDataFileType = 'thme',
57816   kThemePlatinumFileType = 'pltn',
57817   kThemeCustomThemesFileType = 'scen',
57818   kThemeSoundTrackFileType = 'tsnd'
57819 };
57820 enum {
57821   kThemeBrushDialogBackgroundActive = 1,
57822   kThemeBrushDialogBackgroundInactive = 2,
57823   kThemeBrushAlertBackgroundActive = 3,
57824   kThemeBrushAlertBackgroundInactive = 4,
57825   kThemeBrushModelessDialogBackgroundActive = 5,
57826   kThemeBrushModelessDialogBackgroundInactive = 6,
57827   kThemeBrushUtilityWindowBackgroundActive = 7,
57828   kThemeBrushUtilityWindowBackgroundInactive = 8,
57829   kThemeBrushListViewSortColumnBackground = 9,
57830   kThemeBrushListViewBackground = 10,
57831   kThemeBrushIconLabelBackground = 11,
57832   kThemeBrushListViewSeparator = 12,
57833   kThemeBrushChasingArrows = 13,
57834   kThemeBrushDragHilite = 14,
57835   kThemeBrushDocumentWindowBackground = 15,
57836   kThemeBrushFinderWindowBackground = 16
57837 };
57838
57839
57840 enum {
57841   kThemeBrushScrollBarDelimiterActive = 17,
57842   kThemeBrushScrollBarDelimiterInactive = 18,
57843   kThemeBrushFocusHighlight = 19,
57844   kThemeBrushPopupArrowActive = 20,
57845   kThemeBrushPopupArrowPressed = 21,
57846   kThemeBrushPopupArrowInactive = 22,
57847   kThemeBrushAppleGuideCoachmark = 23,
57848   kThemeBrushIconLabelBackgroundSelected = 24,
57849   kThemeBrushStaticAreaFill = 25,
57850   kThemeBrushActiveAreaFill = 26,
57851   kThemeBrushButtonFrameActive = 27,
57852   kThemeBrushButtonFrameInactive = 28,
57853   kThemeBrushButtonFaceActive = 29,
57854   kThemeBrushButtonFaceInactive = 30,
57855   kThemeBrushButtonFacePressed = 31,
57856   kThemeBrushButtonActiveDarkShadow = 32,
57857   kThemeBrushButtonActiveDarkHighlight = 33,
57858   kThemeBrushButtonActiveLightShadow = 34,
57859   kThemeBrushButtonActiveLightHighlight = 35,
57860   kThemeBrushButtonInactiveDarkShadow = 36,
57861   kThemeBrushButtonInactiveDarkHighlight = 37,
57862   kThemeBrushButtonInactiveLightShadow = 38,
57863   kThemeBrushButtonInactiveLightHighlight = 39,
57864   kThemeBrushButtonPressedDarkShadow = 40,
57865   kThemeBrushButtonPressedDarkHighlight = 41,
57866   kThemeBrushButtonPressedLightShadow = 42,
57867   kThemeBrushButtonPressedLightHighlight = 43,
57868   kThemeBrushBevelActiveLight = 44,
57869   kThemeBrushBevelActiveDark = 45,
57870   kThemeBrushBevelInactiveLight = 46,
57871   kThemeBrushBevelInactiveDark = 47
57872 };
57873
57874
57875 enum {
57876   kThemeBrushNotificationWindowBackground = 48
57877 };
57878
57879
57880 enum {
57881   kThemeBrushMovableModalBackground = 49,
57882   kThemeBrushSheetBackgroundOpaque = 50,
57883   kThemeBrushDrawerBackground = 51,
57884   kThemeBrushToolbarBackground = 52,
57885   kThemeBrushSheetBackgroundTransparent = 53,
57886   kThemeBrushMenuBackground = 54,
57887   kThemeBrushMenuBackgroundSelected = 55
57888 };
57889
57890
57891 enum {
57892   kThemeBrushSheetBackground = kThemeBrushSheetBackgroundOpaque
57893 };
57894
57895
57896
57897
57898 enum {
57899   kThemeBrushBlack = -1,
57900   kThemeBrushWhite = -2,
57901   kThemeBrushPrimaryHighlightColor = -3,
57902   kThemeBrushSecondaryHighlightColor = -4
57903 };
57904
57905 typedef SInt16 ThemeBrush;
57906 enum {
57907   kThemeTextColorDialogActive = 1,
57908   kThemeTextColorDialogInactive = 2,
57909   kThemeTextColorAlertActive = 3,
57910   kThemeTextColorAlertInactive = 4,
57911   kThemeTextColorModelessDialogActive = 5,
57912   kThemeTextColorModelessDialogInactive = 6,
57913   kThemeTextColorWindowHeaderActive = 7,
57914   kThemeTextColorWindowHeaderInactive = 8,
57915   kThemeTextColorPlacardActive = 9,
57916   kThemeTextColorPlacardInactive = 10,
57917   kThemeTextColorPlacardPressed = 11,
57918   kThemeTextColorPushButtonActive = 12,
57919   kThemeTextColorPushButtonInactive = 13,
57920   kThemeTextColorPushButtonPressed = 14,
57921   kThemeTextColorBevelButtonActive = 15,
57922   kThemeTextColorBevelButtonInactive = 16,
57923   kThemeTextColorBevelButtonPressed = 17,
57924   kThemeTextColorPopupButtonActive = 18,
57925   kThemeTextColorPopupButtonInactive = 19,
57926   kThemeTextColorPopupButtonPressed = 20,
57927   kThemeTextColorIconLabel = 21,
57928   kThemeTextColorListView = 22
57929 };
57930
57931
57932 enum {
57933   kThemeTextColorDocumentWindowTitleActive = 23,
57934   kThemeTextColorDocumentWindowTitleInactive = 24,
57935   kThemeTextColorMovableModalWindowTitleActive = 25,
57936   kThemeTextColorMovableModalWindowTitleInactive = 26,
57937   kThemeTextColorUtilityWindowTitleActive = 27,
57938   kThemeTextColorUtilityWindowTitleInactive = 28,
57939   kThemeTextColorPopupWindowTitleActive = 29,
57940   kThemeTextColorPopupWindowTitleInactive = 30,
57941   kThemeTextColorRootMenuActive = 31,
57942   kThemeTextColorRootMenuSelected = 32,
57943   kThemeTextColorRootMenuDisabled = 33,
57944   kThemeTextColorMenuItemActive = 34,
57945   kThemeTextColorMenuItemSelected = 35,
57946   kThemeTextColorMenuItemDisabled = 36,
57947   kThemeTextColorPopupLabelActive = 37,
57948   kThemeTextColorPopupLabelInactive = 38
57949 };
57950
57951
57952
57953 enum {
57954   kThemeTextColorTabFrontActive = 39,
57955   kThemeTextColorTabNonFrontActive = 40,
57956   kThemeTextColorTabNonFrontPressed = 41,
57957   kThemeTextColorTabFrontInactive = 42,
57958   kThemeTextColorTabNonFrontInactive = 43,
57959   kThemeTextColorIconLabelSelected = 44,
57960   kThemeTextColorBevelButtonStickyActive = 45,
57961   kThemeTextColorBevelButtonStickyInactive = 46
57962 };
57963
57964
57965 enum {
57966   kThemeTextColorNotification = 47
57967 };
57968
57969
57970
57971 enum {
57972   kThemeTextColorSystemDetail = 48
57973 };
57974
57975
57976
57977 enum {
57978   kThemeTextColorBlack = -1,
57979   kThemeTextColorWhite = -2
57980 };
57981
57982 typedef SInt16 ThemeTextColor;
57983
57984 enum {
57985   kThemeStateInactive = 0,
57986   kThemeStateActive = 1,
57987   kThemeStatePressed = 2,
57988   kThemeStateRollover = 6,
57989   kThemeStateUnavailable = 7,
57990   kThemeStateUnavailableInactive = 8
57991 };
57992
57993
57994 enum {
57995   kThemeStateDisabled = 0
57996 };
57997
57998 enum {
57999   kThemeStatePressedUp = 2,
58000   kThemeStatePressedDown = 3
58001 };
58002
58003 typedef UInt32 ThemeDrawState;
58004
58005
58006
58007 enum {
58008   kThemeArrowCursor = 0,
58009   kThemeCopyArrowCursor = 1,
58010   kThemeAliasArrowCursor = 2,
58011   kThemeContextualMenuArrowCursor = 3,
58012   kThemeIBeamCursor = 4,
58013   kThemeCrossCursor = 5,
58014   kThemePlusCursor = 6,
58015   kThemeWatchCursor = 7,
58016   kThemeClosedHandCursor = 8,
58017   kThemeOpenHandCursor = 9,
58018   kThemePointingHandCursor = 10,
58019   kThemeCountingUpHandCursor = 11,
58020   kThemeCountingDownHandCursor = 12,
58021   kThemeCountingUpAndDownHandCursor = 13,
58022   kThemeSpinningCursor = 14,
58023   kThemeResizeLeftCursor = 15,
58024   kThemeResizeRightCursor = 16,
58025   kThemeResizeLeftRightCursor = 17,
58026   kThemeNotAllowedCursor = 18
58027 };
58028
58029 typedef UInt32 ThemeCursor;
58030
58031
58032
58033 enum {
58034   kThemeMenuBarNormal = 0,
58035   kThemeMenuBarSelected = 1
58036 };
58037
58038 typedef UInt16 ThemeMenuBarState;
58039
58040 enum {
58041   kThemeMenuSquareMenuBar = (1 << 0)
58042 };
58043
58044
58045
58046
58047 enum {
58048   kThemeMenuActive = 0,
58049   kThemeMenuSelected = 1,
58050   kThemeMenuDisabled = 3
58051 };
58052
58053 typedef UInt16 ThemeMenuState;
58054
58055
58056
58057
58058 enum {
58059   kThemeMenuTypePullDown = 0,
58060   kThemeMenuTypePopUp = 1,
58061   kThemeMenuTypeHierarchical = 2,
58062   kThemeMenuTypeInactive = 0x0100
58063 };
58064
58065 typedef UInt16 ThemeMenuType;
58066 enum {
58067   kThemeMenuItemPlain = 0,
58068   kThemeMenuItemHierarchical = 1,
58069   kThemeMenuItemScrollUpArrow = 2,
58070   kThemeMenuItemScrollDownArrow = 3,
58071   kThemeMenuItemAtTop = 0x0100,
58072   kThemeMenuItemAtBottom = 0x0200,
58073   kThemeMenuItemHierBackground = 0x0400,
58074   kThemeMenuItemPopUpBackground = 0x0800,
58075   kThemeMenuItemHasIcon = 0x8000,
58076   kThemeMenuItemNoBackground = 0x4000
58077 };
58078
58079 typedef UInt16 ThemeMenuItemType;
58080
58081
58082
58083 enum {
58084   kThemeBackgroundTabPane = 1,
58085   kThemeBackgroundPlacard = 2,
58086   kThemeBackgroundWindowHeader = 3,
58087   kThemeBackgroundListViewWindowHeader = 4,
58088   kThemeBackgroundSecondaryGroupBox = 5
58089 };
58090
58091 typedef UInt32 ThemeBackgroundKind;
58092 enum {
58093   kThemeNameTag = 'name',
58094   kThemeVariantNameTag = 'varn',
58095   kThemeVariantBaseTintTag = 'tint',
58096   kThemeHighlightColorTag = 'hcol',
58097   kThemeScrollBarArrowStyleTag = 'sbar',
58098   kThemeScrollBarThumbStyleTag = 'sbth',
58099   kThemeSoundsEnabledTag = 'snds',
58100   kThemeDblClickCollapseTag = 'coll'
58101 };
58102
58103 enum {
58104   kThemeAppearanceFileNameTag = 'thme',
58105   kThemeSystemFontTag = 'lgsf',
58106   kThemeSmallSystemFontTag = 'smsf',
58107   kThemeViewsFontTag = 'vfnt',
58108   kThemeViewsFontSizeTag = 'vfsz',
58109   kThemeDesktopPatternNameTag = 'patn',
58110   kThemeDesktopPatternTag = 'patt',
58111   kThemeDesktopPictureNameTag = 'dpnm',
58112   kThemeDesktopPictureAliasTag = 'dpal',
58113   kThemeDesktopPictureAlignmentTag = 'dpan',
58114   kThemeHighlightColorNameTag = 'hcnm',
58115   kThemeExamplePictureIDTag = 'epic',
58116   kThemeSoundTrackNameTag = 'sndt',
58117   kThemeSoundMaskTag = 'smsk',
58118   kThemeUserDefinedTag = 'user',
58119   kThemeSmoothFontEnabledTag = 'smoo',
58120   kThemeSmoothFontMinSizeTag = 'smos'
58121 };
58122
58123
58124 enum {
58125   kTiledOnScreen = 1,
58126   kCenterOnScreen = 2,
58127   kFitToScreen = 3,
58128   kFillScreen = 4,
58129   kUseBestGuess = 5
58130 };
58131
58132
58133
58134
58135 enum {
58136   kThemeCheckBoxClassicX = 0,
58137   kThemeCheckBoxCheckMark = 1
58138 };
58139
58140 typedef UInt16 ThemeCheckBoxStyle;
58141 enum {
58142   kThemeScrollBarArrowsSingle = 0,
58143   kThemeScrollBarArrowsLowerRight = 1
58144 };
58145
58146 typedef UInt16 ThemeScrollBarArrowStyle;
58147 enum {
58148   kThemeScrollBarThumbNormal = 0,
58149   kThemeScrollBarThumbProportional = 1
58150 };
58151
58152 typedef UInt16 ThemeScrollBarThumbStyle;
58153 enum {
58154   kThemeSystemFont = 0,
58155
58156
58157
58158
58159
58160
58161   kThemeSmallSystemFont = 1,
58162
58163
58164
58165
58166
58167
58168   kThemeSmallEmphasizedSystemFont = 2,
58169
58170
58171
58172
58173
58174   kThemeViewsFont = 3,
58175
58176
58177
58178
58179
58180
58181
58182   kThemeEmphasizedSystemFont = 4,
58183
58184
58185
58186
58187
58188
58189
58190   kThemeApplicationFont = 5,
58191
58192
58193
58194
58195
58196
58197
58198   kThemeLabelFont = 6,
58199
58200
58201
58202
58203
58204   kThemeMenuTitleFont = 100,
58205
58206
58207
58208
58209
58210   kThemeMenuItemFont = 101,
58211
58212
58213
58214
58215
58216   kThemeMenuItemMarkFont = 102,
58217
58218
58219
58220
58221
58222   kThemeMenuItemCmdKeyFont = 103,
58223
58224
58225
58226
58227
58228   kThemeWindowTitleFont = 104,
58229
58230
58231
58232
58233
58234   kThemePushButtonFont = 105,
58235
58236
58237
58238
58239
58240   kThemeUtilityWindowTitleFont = 106,
58241
58242
58243
58244
58245
58246   kThemeAlertHeaderFont = 107,
58247   kThemeSystemFontDetail = 7,
58248   kThemeSystemFontDetailEmphasized = 8,
58249   kThemeCurrentPortFont = 200,
58250
58251
58252
58253
58254
58255   kThemeToolbarFont = 108
58256 };
58257
58258
58259 enum {
58260   kPublicThemeFontCount = 17
58261 };
58262
58263 typedef UInt16 ThemeFontID;
58264
58265
58266
58267 enum {
58268   kThemeTabNonFront = 0,
58269   kThemeTabNonFrontPressed = 1,
58270   kThemeTabNonFrontInactive = 2,
58271   kThemeTabFront = 3,
58272   kThemeTabFrontInactive = 4,
58273   kThemeTabNonFrontUnavailable = 5,
58274   kThemeTabFrontUnavailable = 6
58275 };
58276
58277 typedef UInt16 ThemeTabStyle;
58278 enum {
58279   kThemeTabNorth = 0,
58280   kThemeTabSouth = 1,
58281   kThemeTabEast = 2,
58282   kThemeTabWest = 3
58283 };
58284
58285 typedef UInt16 ThemeTabDirection;
58286
58287
58288
58289
58290
58291
58292 enum {
58293   kThemeSmallTabHeight = 16,
58294   kThemeLargeTabHeight = 21,
58295   kThemeTabPaneOverlap = 3,
58296   kThemeSmallTabHeightMax = 19,
58297   kThemeLargeTabHeightMax = 24
58298 };
58299
58300
58301
58302
58303 enum {
58304   kThemeMediumScrollBar = 0,
58305   kThemeSmallScrollBar = 1,
58306   kThemeMediumSlider = 2,
58307   kThemeMediumProgressBar = 3,
58308   kThemeMediumIndeterminateBar = 4,
58309   kThemeRelevanceBar = 5,
58310   kThemeSmallSlider = 6,
58311   kThemeLargeProgressBar = 7,
58312   kThemeLargeIndeterminateBar = 8
58313 };
58314
58315 typedef UInt16 ThemeTrackKind;
58316
58317
58318
58319 enum {
58320
58321   kThemeTrackActive = 0,
58322   kThemeTrackDisabled = 1,
58323   kThemeTrackNothingToScroll = 2,
58324   kThemeTrackInactive = 3
58325 };
58326
58327 typedef UInt8 ThemeTrackEnableState;
58328
58329
58330
58331 enum {
58332
58333   kThemeLeftOutsideArrowPressed = 0x01,
58334   kThemeLeftInsideArrowPressed = 0x02,
58335   kThemeLeftTrackPressed = 0x04,
58336   kThemeThumbPressed = 0x08,
58337   kThemeRightTrackPressed = 0x10,
58338   kThemeRightInsideArrowPressed = 0x20,
58339   kThemeRightOutsideArrowPressed = 0x40,
58340   kThemeTopOutsideArrowPressed = kThemeLeftOutsideArrowPressed,
58341   kThemeTopInsideArrowPressed = kThemeLeftInsideArrowPressed,
58342   kThemeTopTrackPressed = kThemeLeftTrackPressed,
58343   kThemeBottomTrackPressed = kThemeRightTrackPressed,
58344   kThemeBottomInsideArrowPressed = kThemeRightInsideArrowPressed,
58345   kThemeBottomOutsideArrowPressed = kThemeRightOutsideArrowPressed
58346 };
58347
58348 typedef UInt8 ThemeTrackPressState;
58349
58350
58351
58352 enum {
58353
58354   kThemeThumbPlain = 0,
58355   kThemeThumbUpward = 1,
58356   kThemeThumbDownward = 2
58357 };
58358
58359 typedef UInt8 ThemeThumbDirection;
58360 enum {
58361
58362
58363
58364
58365   kThemeTrackHorizontal = (1 << 0),
58366
58367
58368
58369
58370   kThemeTrackRightToLeft = (1 << 1),
58371
58372
58373
58374
58375   kThemeTrackShowThumb = (1 << 2),
58376
58377
58378
58379
58380   kThemeTrackThumbRgnIsNotGhost = (1 << 3),
58381
58382
58383
58384
58385
58386   kThemeTrackNoScrollBarArrows = (1 << 4),
58387
58388
58389
58390
58391
58392   kThemeTrackHasFocus = (1 << 5)
58393 };
58394
58395 typedef UInt16 ThemeTrackAttributes;
58396
58397
58398
58399 struct ScrollBarTrackInfo {
58400   SInt32 viewsize;
58401   ThemeTrackPressState pressState;
58402 };
58403 typedef struct ScrollBarTrackInfo ScrollBarTrackInfo;
58404 struct SliderTrackInfo {
58405   ThemeThumbDirection thumbDir;
58406   ThemeTrackPressState pressState;
58407 };
58408 typedef struct SliderTrackInfo SliderTrackInfo;
58409 struct ProgressTrackInfo {
58410   UInt8 phase;
58411 };
58412 typedef struct ProgressTrackInfo ProgressTrackInfo;
58413 struct ThemeTrackDrawInfo {
58414   ThemeTrackKind kind;
58415   Rect bounds;
58416   SInt32 min;
58417   SInt32 max;
58418   SInt32 value;
58419   UInt32 reserved;
58420
58421   ThemeTrackAttributes attributes;
58422   ThemeTrackEnableState enableState;
58423   UInt8 filler1;
58424
58425   union {
58426     ScrollBarTrackInfo scrollbar;
58427     SliderTrackInfo slider;
58428     ProgressTrackInfo progress;
58429   } trackInfo;
58430 };
58431 typedef struct ThemeTrackDrawInfo ThemeTrackDrawInfo;
58432
58433
58434
58435 enum {
58436   kThemeWindowHasGrow = (1 << 0),
58437   kThemeWindowHasHorizontalZoom = (1 << 3),
58438   kThemeWindowHasVerticalZoom = (1 << 4),
58439   kThemeWindowHasFullZoom = kThemeWindowHasHorizontalZoom + kThemeWindowHasVerticalZoom,
58440   kThemeWindowHasCloseBox = (1 << 5),
58441   kThemeWindowHasCollapseBox = (1 << 6),
58442   kThemeWindowHasTitleText = (1 << 7),
58443   kThemeWindowIsCollapsed = (1 << 8),
58444   kThemeWindowHasDirty = (1 << 9)
58445 };
58446
58447
58448 typedef UInt32 ThemeWindowAttributes;
58449
58450
58451
58452 enum {
58453   kThemeDocumentWindow = 0,
58454   kThemeDialogWindow = 1,
58455   kThemeMovableDialogWindow = 2,
58456   kThemeAlertWindow = 3,
58457   kThemeMovableAlertWindow = 4,
58458   kThemePlainDialogWindow = 5,
58459   kThemeShadowDialogWindow = 6,
58460   kThemePopupWindow = 7,
58461   kThemeUtilityWindow = 8,
58462   kThemeUtilitySideWindow = 9,
58463   kThemeSheetWindow = 10,
58464   kThemeDrawerWindow = 11
58465 };
58466
58467 typedef UInt16 ThemeWindowType;
58468
58469
58470
58471 enum {
58472   kThemeWidgetCloseBox = 0,
58473   kThemeWidgetZoomBox = 1,
58474   kThemeWidgetCollapseBox = 2,
58475   kThemeWidgetDirtyCloseBox = 6
58476 };
58477
58478 enum {
58479
58480   kThemeWidgetABox = 3,
58481   kThemeWidgetBBox = 4,
58482   kThemeWidgetBOffBox = 5
58483 };
58484
58485 typedef UInt16 ThemeTitleBarWidget;
58486
58487
58488
58489 enum {
58490   kThemeArrowLeft = 0,
58491   kThemeArrowDown = 1,
58492   kThemeArrowRight = 2,
58493   kThemeArrowUp = 3
58494 };
58495
58496 typedef UInt16 ThemeArrowOrientation;
58497
58498
58499
58500 enum {
58501   kThemeArrow3pt = 0,
58502   kThemeArrow5pt = 1,
58503   kThemeArrow7pt = 2,
58504   kThemeArrow9pt = 3
58505 };
58506
58507 typedef UInt16 ThemePopupArrowSize;
58508
58509
58510
58511 enum {
58512   kThemeGrowLeft = (1 << 0),
58513   kThemeGrowRight = (1 << 1),
58514   kThemeGrowUp = (1 << 2),
58515   kThemeGrowDown = (1 << 3)
58516 };
58517
58518 typedef UInt16 ThemeGrowDirection;
58519
58520
58521
58522 enum {
58523   kThemePushButton = 0,
58524   kThemeCheckBox = 1,
58525   kThemeRadioButton = 2,
58526   kThemeBevelButton = 3,
58527   kThemeArrowButton = 4,
58528   kThemePopupButton = 5,
58529   kThemeDisclosureButton = 6,
58530   kThemeIncDecButton = 7,
58531   kThemeSmallBevelButton = 8,
58532   kThemeMediumBevelButton = 3,
58533   kThemeLargeBevelButton = 9,
58534   kThemeListHeaderButton = 10,
58535   kThemeRoundButton = 11,
58536   kThemeLargeRoundButton = 12,
58537   kThemeSmallCheckBox = 13,
58538   kThemeSmallRadioButton = 14,
58539   kThemeRoundedBevelButton = 15,
58540   kThemeNormalCheckBox = kThemeCheckBox,
58541   kThemeNormalRadioButton = kThemeRadioButton
58542 };
58543
58544 typedef UInt16 ThemeButtonKind;
58545
58546
58547
58548 enum {
58549   kThemeButtonOff = 0,
58550   kThemeButtonOn = 1,
58551   kThemeButtonMixed = 2,
58552   kThemeDisclosureRight = 0,
58553   kThemeDisclosureDown = 1,
58554   kThemeDisclosureLeft = 2
58555 };
58556
58557 typedef UInt16 ThemeButtonValue;
58558
58559
58560
58561 enum {
58562   kThemeAdornmentNone = 0,
58563   kThemeAdornmentDefault = (1 << 0),
58564   kThemeAdornmentFocus = (1 << 2),
58565   kThemeAdornmentRightToLeft = (1 << 4),
58566   kThemeAdornmentDrawIndicatorOnly = (1 << 5),
58567   kThemeAdornmentHeaderButtonLeftNeighborSelected = (1 << 6),
58568   kThemeAdornmentHeaderButtonRightNeighborSelected = (1 << 7),
58569   kThemeAdornmentHeaderButtonSortUp = (1 << 8),
58570   kThemeAdornmentHeaderMenuButton = (1 << 9),
58571   kThemeAdornmentHeaderButtonNoShadow = (1 << 10),
58572   kThemeAdornmentHeaderButtonShadowOnly = (1 << 11),
58573   kThemeAdornmentNoShadow = kThemeAdornmentHeaderButtonNoShadow,
58574   kThemeAdornmentShadowOnly = kThemeAdornmentHeaderButtonShadowOnly,
58575   kThemeAdornmentArrowLeftArrow = (1 << 6),
58576   kThemeAdornmentArrowDownArrow = (1 << 7),
58577   kThemeAdornmentArrowDoubleArrow = (1 << 8),
58578   kThemeAdornmentArrowUpArrow = (1 << 9)
58579 };
58580
58581 typedef UInt16 ThemeButtonAdornment;
58582
58583
58584
58585 struct ThemeButtonDrawInfo {
58586   ThemeDrawState state;
58587   ThemeButtonValue value;
58588   ThemeButtonAdornment adornment;
58589 };
58590 typedef struct ThemeButtonDrawInfo ThemeButtonDrawInfo;
58591 typedef ThemeButtonDrawInfo * ThemeButtonDrawInfoPtr;
58592 enum {
58593   kThemeNoSounds = 0,
58594   kThemeWindowSoundsMask = (1 << 0),
58595   kThemeMenuSoundsMask = (1 << 1),
58596   kThemeControlSoundsMask = (1 << 2),
58597   kThemeFinderSoundsMask = (1 << 3)
58598 };
58599 enum {
58600   kThemeDragSoundNone = 0,
58601   kThemeDragSoundMoveWindow = 'wmov',
58602   kThemeDragSoundGrowWindow = 'wgro',
58603   kThemeDragSoundMoveUtilWindow = 'umov',
58604   kThemeDragSoundGrowUtilWindow = 'ugro',
58605   kThemeDragSoundMoveDialog = 'dmov',
58606   kThemeDragSoundMoveAlert = 'amov',
58607   kThemeDragSoundMoveIcon = 'imov',
58608   kThemeDragSoundSliderThumb = 'slth',
58609   kThemeDragSoundSliderGhost = 'slgh',
58610   kThemeDragSoundScrollBarThumb = 'sbth',
58611   kThemeDragSoundScrollBarGhost = 'sbgh',
58612   kThemeDragSoundScrollBarArrowDecreasing = 'sbad',
58613   kThemeDragSoundScrollBarArrowIncreasing = 'sbai',
58614   kThemeDragSoundDragging = 'drag'
58615 };
58616
58617 typedef OSType ThemeDragSoundKind;
58618 enum {
58619   kThemeSoundNone = 0,
58620   kThemeSoundMenuOpen = 'mnuo',
58621   kThemeSoundMenuClose = 'mnuc',
58622   kThemeSoundMenuItemHilite = 'mnui',
58623   kThemeSoundMenuItemRelease = 'mnus',
58624   kThemeSoundWindowClosePress = 'wclp',
58625   kThemeSoundWindowCloseEnter = 'wcle',
58626   kThemeSoundWindowCloseExit = 'wclx',
58627   kThemeSoundWindowCloseRelease = 'wclr',
58628   kThemeSoundWindowZoomPress = 'wzmp',
58629   kThemeSoundWindowZoomEnter = 'wzme',
58630   kThemeSoundWindowZoomExit = 'wzmx',
58631   kThemeSoundWindowZoomRelease = 'wzmr',
58632   kThemeSoundWindowCollapsePress = 'wcop',
58633   kThemeSoundWindowCollapseEnter = 'wcoe',
58634   kThemeSoundWindowCollapseExit = 'wcox',
58635   kThemeSoundWindowCollapseRelease = 'wcor',
58636   kThemeSoundWindowDragBoundary = 'wdbd',
58637   kThemeSoundUtilWinClosePress = 'uclp',
58638   kThemeSoundUtilWinCloseEnter = 'ucle',
58639   kThemeSoundUtilWinCloseExit = 'uclx',
58640   kThemeSoundUtilWinCloseRelease = 'uclr',
58641   kThemeSoundUtilWinZoomPress = 'uzmp',
58642   kThemeSoundUtilWinZoomEnter = 'uzme',
58643   kThemeSoundUtilWinZoomExit = 'uzmx',
58644   kThemeSoundUtilWinZoomRelease = 'uzmr',
58645   kThemeSoundUtilWinCollapsePress = 'ucop',
58646   kThemeSoundUtilWinCollapseEnter = 'ucoe',
58647   kThemeSoundUtilWinCollapseExit = 'ucox',
58648   kThemeSoundUtilWinCollapseRelease = 'ucor',
58649   kThemeSoundUtilWinDragBoundary = 'udbd',
58650   kThemeSoundWindowOpen = 'wopn',
58651   kThemeSoundWindowClose = 'wcls',
58652   kThemeSoundWindowZoomIn = 'wzmi',
58653   kThemeSoundWindowZoomOut = 'wzmo',
58654   kThemeSoundWindowCollapseUp = 'wcol',
58655   kThemeSoundWindowCollapseDown = 'wexp',
58656   kThemeSoundWindowActivate = 'wact',
58657   kThemeSoundUtilWindowOpen = 'uopn',
58658   kThemeSoundUtilWindowClose = 'ucls',
58659   kThemeSoundUtilWindowZoomIn = 'uzmi',
58660   kThemeSoundUtilWindowZoomOut = 'uzmo',
58661   kThemeSoundUtilWindowCollapseUp = 'ucol',
58662   kThemeSoundUtilWindowCollapseDown = 'uexp',
58663   kThemeSoundUtilWindowActivate = 'uact',
58664   kThemeSoundDialogOpen = 'dopn',
58665   kThemeSoundDialogClose = 'dlgc',
58666   kThemeSoundAlertOpen = 'aopn',
58667   kThemeSoundAlertClose = 'altc',
58668   kThemeSoundPopupWindowOpen = 'pwop',
58669   kThemeSoundPopupWindowClose = 'pwcl',
58670   kThemeSoundButtonPress = 'btnp',
58671   kThemeSoundButtonEnter = 'btne',
58672   kThemeSoundButtonExit = 'btnx',
58673   kThemeSoundButtonRelease = 'btnr',
58674   kThemeSoundDefaultButtonPress = 'dbtp',
58675   kThemeSoundDefaultButtonEnter = 'dbte',
58676   kThemeSoundDefaultButtonExit = 'dbtx',
58677   kThemeSoundDefaultButtonRelease = 'dbtr',
58678   kThemeSoundCancelButtonPress = 'cbtp',
58679   kThemeSoundCancelButtonEnter = 'cbte',
58680   kThemeSoundCancelButtonExit = 'cbtx',
58681   kThemeSoundCancelButtonRelease = 'cbtr',
58682   kThemeSoundCheckboxPress = 'chkp',
58683   kThemeSoundCheckboxEnter = 'chke',
58684   kThemeSoundCheckboxExit = 'chkx',
58685   kThemeSoundCheckboxRelease = 'chkr',
58686   kThemeSoundRadioPress = 'radp',
58687   kThemeSoundRadioEnter = 'rade',
58688   kThemeSoundRadioExit = 'radx',
58689   kThemeSoundRadioRelease = 'radr',
58690   kThemeSoundScrollArrowPress = 'sbap',
58691   kThemeSoundScrollArrowEnter = 'sbae',
58692   kThemeSoundScrollArrowExit = 'sbax',
58693   kThemeSoundScrollArrowRelease = 'sbar',
58694   kThemeSoundScrollEndOfTrack = 'sbte',
58695   kThemeSoundScrollTrackPress = 'sbtp',
58696   kThemeSoundSliderEndOfTrack = 'slte',
58697   kThemeSoundSliderTrackPress = 'sltp',
58698   kThemeSoundBalloonOpen = 'blno',
58699   kThemeSoundBalloonClose = 'blnc',
58700   kThemeSoundBevelPress = 'bevp',
58701   kThemeSoundBevelEnter = 'beve',
58702   kThemeSoundBevelExit = 'bevx',
58703   kThemeSoundBevelRelease = 'bevr',
58704   kThemeSoundLittleArrowUpPress = 'laup',
58705   kThemeSoundLittleArrowDnPress = 'ladp',
58706   kThemeSoundLittleArrowEnter = 'lare',
58707   kThemeSoundLittleArrowExit = 'larx',
58708   kThemeSoundLittleArrowUpRelease = 'laur',
58709   kThemeSoundLittleArrowDnRelease = 'ladr',
58710   kThemeSoundPopupPress = 'popp',
58711   kThemeSoundPopupEnter = 'pope',
58712   kThemeSoundPopupExit = 'popx',
58713   kThemeSoundPopupRelease = 'popr',
58714   kThemeSoundDisclosurePress = 'dscp',
58715   kThemeSoundDisclosureEnter = 'dsce',
58716   kThemeSoundDisclosureExit = 'dscx',
58717   kThemeSoundDisclosureRelease = 'dscr',
58718   kThemeSoundTabPressed = 'tabp',
58719   kThemeSoundTabEnter = 'tabe',
58720   kThemeSoundTabExit = 'tabx',
58721   kThemeSoundTabRelease = 'tabr',
58722   kThemeSoundDragTargetHilite = 'dthi',
58723   kThemeSoundDragTargetUnhilite = 'dtuh',
58724   kThemeSoundDragTargetDrop = 'dtdr',
58725   kThemeSoundEmptyTrash = 'ftrs',
58726   kThemeSoundSelectItem = 'fsel',
58727   kThemeSoundNewItem = 'fnew',
58728   kThemeSoundReceiveDrop = 'fdrp',
58729   kThemeSoundCopyDone = 'fcpd',
58730   kThemeSoundResolveAlias = 'fral',
58731   kThemeSoundLaunchApp = 'flap',
58732   kThemeSoundDiskInsert = 'dski',
58733   kThemeSoundDiskEject = 'dske',
58734   kThemeSoundFinderDragOnIcon = 'fdon',
58735   kThemeSoundFinderDragOffIcon = 'fdof'
58736 };
58737
58738 typedef OSType ThemeSoundKind;
58739 enum {
58740   kThemePopupTabNormalPosition = 0,
58741   kThemePopupTabCenterOnWindow = 1,
58742   kThemePopupTabCenterOnOffset = 2
58743 };
58744
58745 struct ThemeWindowMetrics {
58746   UInt16 metricSize;
58747   SInt16 titleHeight;
58748   SInt16 titleWidth;
58749   SInt16 popupTabOffset;
58750   SInt16 popupTabWidth;
58751   UInt16 popupTabPosition;
58752 };
58753 typedef struct ThemeWindowMetrics ThemeWindowMetrics;
58754 typedef ThemeWindowMetrics * ThemeWindowMetricsPtr;
58755 enum {
58756
58757
58758
58759
58760   kThemeMetricScrollBarWidth = 0,
58761
58762
58763
58764
58765   kThemeMetricSmallScrollBarWidth = 1,
58766
58767
58768
58769
58770   kThemeMetricCheckBoxHeight = 2,
58771
58772
58773
58774
58775   kThemeMetricRadioButtonHeight = 3,
58776   kThemeMetricEditTextWhitespace = 4,
58777
58778
58779
58780
58781
58782
58783
58784   kThemeMetricEditTextFrameOutset = 5,
58785
58786
58787
58788
58789
58790   kThemeMetricListBoxFrameOutset = 6,
58791
58792
58793
58794
58795
58796
58797   kThemeMetricFocusRectOutset = 7,
58798
58799
58800
58801
58802   kThemeMetricImageWellThickness = 8,
58803
58804
58805
58806
58807
58808
58809
58810   kThemeMetricScrollBarOverlap = 9,
58811
58812
58813
58814
58815   kThemeMetricLargeTabHeight = 10,
58816
58817
58818
58819
58820
58821   kThemeMetricLargeTabCapsWidth = 11,
58822
58823
58824
58825
58826
58827
58828
58829   kThemeMetricTabFrameOverlap = 12,
58830   kThemeMetricTabIndentOrStyle = 13,
58831
58832
58833
58834
58835
58836   kThemeMetricTabOverlap = 14,
58837
58838
58839
58840
58841
58842   kThemeMetricSmallTabHeight = 15,
58843
58844
58845
58846
58847
58848   kThemeMetricSmallTabCapsWidth = 16,
58849
58850
58851
58852
58853   kThemeMetricPushButtonHeight = 19,
58854
58855
58856
58857
58858   kThemeMetricListHeaderHeight = 20,
58859
58860
58861
58862
58863
58864   kThemeMetricDisclosureTriangleHeight = 25,
58865
58866
58867
58868
58869   kThemeMetricDisclosureTriangleWidth = 26,
58870
58871
58872
58873
58874   kThemeMetricLittleArrowsHeight = 27,
58875
58876
58877
58878
58879   kThemeMetricLittleArrowsWidth = 28,
58880
58881
58882
58883
58884   kThemeMetricPopupButtonHeight = 30,
58885
58886
58887
58888
58889   kThemeMetricSmallPopupButtonHeight = 31,
58890
58891
58892
58893
58894   kThemeMetricLargeProgressBarThickness = 32,
58895
58896
58897
58898
58899   kThemeMetricPullDownHeight = 33,
58900
58901
58902
58903
58904   kThemeMetricSmallPullDownHeight = 34,
58905
58906
58907
58908
58909   kThemeMetricResizeControlHeight = 38,
58910
58911
58912
58913
58914   kThemeMetricSmallResizeControlHeight = 39,
58915
58916
58917
58918
58919   kThemeMetricHSliderHeight = 41,
58920
58921
58922
58923
58924   kThemeMetricHSliderTickHeight = 42,
58925
58926
58927
58928
58929   kThemeMetricVSliderWidth = 45,
58930
58931
58932
58933
58934   kThemeMetricVSliderTickWidth = 46,
58935
58936
58937
58938
58939
58940   kThemeMetricTitleBarControlsHeight = 49,
58941
58942
58943
58944
58945   kThemeMetricCheckBoxWidth = 50,
58946
58947
58948
58949
58950   kThemeMetricRadioButtonWidth = 52,
58951
58952
58953
58954
58955   kThemeMetricNormalProgressBarThickness = 58,
58956
58957
58958
58959
58960   kThemeMetricProgressBarShadowOutset = 59,
58961
58962
58963
58964
58965
58966   kThemeMetricSmallProgressBarShadowOutset = 60,
58967
58968
58969
58970
58971
58972   kThemeMetricPrimaryGroupBoxContentInset = 61,
58973
58974
58975
58976
58977
58978   kThemeMetricSecondaryGroupBoxContentInset = 62,
58979
58980
58981
58982
58983   kThemeMetricMenuMarkColumnWidth = 63,
58984
58985
58986
58987
58988
58989   kThemeMetricMenuExcludedMarkColumnWidth = 64,
58990
58991
58992
58993
58994
58995   kThemeMetricMenuMarkIndent = 65,
58996
58997
58998
58999
59000   kThemeMetricMenuTextLeadingEdgeMargin = 66,
59001
59002
59003
59004
59005   kThemeMetricMenuTextTrailingEdgeMargin = 67,
59006
59007
59008
59009
59010   kThemeMetricMenuIndentWidth = 68,
59011
59012
59013
59014
59015
59016   kThemeMetricMenuIconTrailingEdgeMargin = 69
59017 };
59018
59019
59020
59021
59022
59023
59024 enum {
59025
59026
59027
59028
59029   kThemeMetricDisclosureButtonHeight = 17,
59030
59031
59032
59033
59034   kThemeMetricRoundButtonSize = 18,
59035
59036
59037
59038
59039   kThemeMetricSmallCheckBoxHeight = 21,
59040
59041
59042
59043
59044   kThemeMetricDisclosureButtonWidth = 22,
59045
59046
59047
59048
59049   kThemeMetricSmallDisclosureButtonHeight = 23,
59050
59051
59052
59053
59054   kThemeMetricSmallDisclosureButtonWidth = 24,
59055
59056
59057
59058
59059   kThemeMetricPaneSplitterHeight = 29,
59060
59061
59062
59063
59064   kThemeMetricSmallPushButtonHeight = 35,
59065
59066
59067
59068
59069   kThemeMetricSmallRadioButtonHeight = 36,
59070
59071
59072
59073
59074   kThemeMetricRelevanceIndicatorHeight = 37,
59075
59076
59077
59078
59079   kThemeMetricLargeRoundButtonSize = 40,
59080
59081
59082
59083
59084   kThemeMetricSmallHSliderHeight = 43,
59085
59086
59087
59088
59089
59090   kThemeMetricSmallHSliderTickHeight = 44,
59091
59092
59093
59094
59095   kThemeMetricSmallVSliderWidth = 47,
59096
59097
59098
59099
59100   kThemeMetricSmallVSliderTickWidth = 48,
59101
59102
59103
59104
59105   kThemeMetricSmallCheckBoxWidth = 51,
59106
59107
59108
59109
59110   kThemeMetricSmallRadioButtonWidth = 53,
59111
59112
59113
59114
59115
59116   kThemeMetricSmallHSliderMinThumbWidth = 54,
59117
59118
59119
59120
59121   kThemeMetricSmallVSliderMinThumbHeight = 55,
59122
59123
59124
59125
59126
59127   kThemeMetricSmallHSliderTickOffset = 56,
59128
59129
59130
59131
59132
59133   kThemeMetricSmallVSliderTickOffset = 57
59134 };
59135
59136 typedef UInt32 ThemeMetric;
59137
59138
59139
59140 typedef struct OpaqueThemeDrawingState* ThemeDrawingState;
59141
59142
59143
59144 typedef void ( * ThemeTabTitleDrawProcPtr)(const Rect *bounds, ThemeTabStyle style, ThemeTabDirection direction, SInt16 depth, Boolean isColorDev, UInt32 userData);
59145 typedef void ( * ThemeEraseProcPtr)(const Rect *bounds, UInt32 eraseData, SInt16 depth, Boolean isColorDev);
59146 typedef void ( * ThemeButtonDrawProcPtr)(const Rect *bounds, ThemeButtonKind kind, const ThemeButtonDrawInfo *info, UInt32 userData, SInt16 depth, Boolean isColorDev);
59147 typedef void ( * WindowTitleDrawingProcPtr)(const Rect *bounds, SInt16 depth, Boolean colorDevice, UInt32 userData);
59148 typedef Boolean ( * ThemeIteratorProcPtr)(ConstStr255Param inFileName, SInt16 resID, Collection inThemeSettings, void *inUserData);
59149 typedef ThemeTabTitleDrawProcPtr ThemeTabTitleDrawUPP;
59150 typedef ThemeEraseProcPtr ThemeEraseUPP;
59151 typedef ThemeButtonDrawProcPtr ThemeButtonDrawUPP;
59152 typedef WindowTitleDrawingProcPtr WindowTitleDrawingUPP;
59153 typedef ThemeIteratorProcPtr ThemeIteratorUPP;
59154 extern ThemeTabTitleDrawUPP
59155 NewThemeTabTitleDrawUPP(ThemeTabTitleDrawProcPtr userRoutine) ;
59156 extern ThemeEraseUPP
59157 NewThemeEraseUPP(ThemeEraseProcPtr userRoutine) ;
59158 extern ThemeButtonDrawUPP
59159 NewThemeButtonDrawUPP(ThemeButtonDrawProcPtr userRoutine) ;
59160 extern WindowTitleDrawingUPP
59161 NewWindowTitleDrawingUPP(WindowTitleDrawingProcPtr userRoutine) ;
59162 extern ThemeIteratorUPP
59163 NewThemeIteratorUPP(ThemeIteratorProcPtr userRoutine) ;
59164 extern void
59165 DisposeThemeTabTitleDrawUPP(ThemeTabTitleDrawUPP userUPP) ;
59166 extern void
59167 DisposeThemeEraseUPP(ThemeEraseUPP userUPP) ;
59168 extern void
59169 DisposeThemeButtonDrawUPP(ThemeButtonDrawUPP userUPP) ;
59170 extern void
59171 DisposeWindowTitleDrawingUPP(WindowTitleDrawingUPP userUPP) ;
59172 extern void
59173 DisposeThemeIteratorUPP(ThemeIteratorUPP userUPP) ;
59174 extern void
59175 InvokeThemeTabTitleDrawUPP(
59176   const Rect * bounds,
59177   ThemeTabStyle style,
59178   ThemeTabDirection direction,
59179   SInt16 depth,
59180   Boolean isColorDev,
59181   UInt32 userData,
59182   ThemeTabTitleDrawUPP userUPP) ;
59183 extern void
59184 InvokeThemeEraseUPP(
59185   const Rect * bounds,
59186   UInt32 eraseData,
59187   SInt16 depth,
59188   Boolean isColorDev,
59189   ThemeEraseUPP userUPP) ;
59190 extern void
59191 InvokeThemeButtonDrawUPP(
59192   const Rect * bounds,
59193   ThemeButtonKind kind,
59194   const ThemeButtonDrawInfo * info,
59195   UInt32 userData,
59196   SInt16 depth,
59197   Boolean isColorDev,
59198   ThemeButtonDrawUPP userUPP) ;
59199 extern void
59200 InvokeWindowTitleDrawingUPP(
59201   const Rect * bounds,
59202   SInt16 depth,
59203   Boolean colorDevice,
59204   UInt32 userData,
59205   WindowTitleDrawingUPP userUPP) ;
59206 extern Boolean
59207 InvokeThemeIteratorUPP(
59208   ConstStr255Param inFileName,
59209   SInt16 resID,
59210   Collection inThemeSettings,
59211   void * inUserData,
59212   ThemeIteratorUPP userUPP) ;
59213
59214
59215
59216
59217 typedef void ( * MenuTitleDrawingProcPtr)(const Rect *inBounds, SInt16 inDepth, Boolean inIsColorDevice, SInt32 inUserData);
59218 typedef void ( * MenuItemDrawingProcPtr)(const Rect *inBounds, SInt16 inDepth, Boolean inIsColorDevice, SInt32 inUserData);
59219 typedef MenuTitleDrawingProcPtr MenuTitleDrawingUPP;
59220 typedef MenuItemDrawingProcPtr MenuItemDrawingUPP;
59221 extern MenuTitleDrawingUPP
59222 NewMenuTitleDrawingUPP(MenuTitleDrawingProcPtr userRoutine) ;
59223 extern MenuItemDrawingUPP
59224 NewMenuItemDrawingUPP(MenuItemDrawingProcPtr userRoutine) ;
59225 extern void
59226 DisposeMenuTitleDrawingUPP(MenuTitleDrawingUPP userUPP) ;
59227 extern void
59228 DisposeMenuItemDrawingUPP(MenuItemDrawingUPP userUPP) ;
59229 extern void
59230 InvokeMenuTitleDrawingUPP(
59231   const Rect * inBounds,
59232   SInt16 inDepth,
59233   Boolean inIsColorDevice,
59234   SInt32 inUserData,
59235   MenuTitleDrawingUPP userUPP) ;
59236 extern void
59237 InvokeMenuItemDrawingUPP(
59238   const Rect * inBounds,
59239   SInt16 inDepth,
59240   Boolean inIsColorDevice,
59241   SInt32 inUserData,
59242   MenuItemDrawingUPP userUPP) ;
59243 extern OSStatus
59244 RegisterAppearanceClient(void) ;
59245 extern OSStatus
59246 UnregisterAppearanceClient(void) ;
59247 extern Boolean
59248 IsAppearanceClient(const ProcessSerialNumber * process) ;
59249 extern OSStatus
59250 SetThemePen(
59251   ThemeBrush inBrush,
59252   SInt16 inDepth,
59253   Boolean inIsColorDevice) ;
59254 extern OSStatus
59255 SetThemeBackground(
59256   ThemeBrush inBrush,
59257   SInt16 inDepth,
59258   Boolean inIsColorDevice) ;
59259 extern OSStatus
59260 SetThemeTextColor(
59261   ThemeTextColor inColor,
59262   SInt16 inDepth,
59263   Boolean inIsColorDevice) ;
59264 extern OSStatus
59265 SetThemeWindowBackground(
59266   WindowRef inWindow,
59267   ThemeBrush inBrush,
59268   Boolean inUpdate) ;
59269 extern OSStatus
59270 DrawThemeWindowHeader(
59271   const Rect * inRect,
59272   ThemeDrawState inState) ;
59273 extern OSStatus
59274 DrawThemeWindowListViewHeader(
59275   const Rect * inRect,
59276   ThemeDrawState inState) ;
59277 extern OSStatus
59278 DrawThemePlacard(
59279   const Rect * inRect,
59280   ThemeDrawState inState) ;
59281 extern OSStatus
59282 DrawThemeEditTextFrame(
59283   const Rect * inRect,
59284   ThemeDrawState inState) ;
59285 extern OSStatus
59286 DrawThemeListBoxFrame(
59287   const Rect * inRect,
59288   ThemeDrawState inState) ;
59289 extern OSStatus
59290 DrawThemeFocusRect(
59291   const Rect * inRect,
59292   Boolean inHasFocus) ;
59293 extern OSStatus
59294 DrawThemePrimaryGroup(
59295   const Rect * inRect,
59296   ThemeDrawState inState) ;
59297 extern OSStatus
59298 DrawThemeSecondaryGroup(
59299   const Rect * inRect,
59300   ThemeDrawState inState) ;
59301 extern OSStatus
59302 DrawThemeSeparator(
59303   const Rect * inRect,
59304   ThemeDrawState inState) ;
59305 extern OSStatus
59306 DrawThemeModelessDialogFrame(
59307   const Rect * inRect,
59308   ThemeDrawState inState) ;
59309 extern OSStatus
59310 DrawThemeGenericWell(
59311   const Rect * inRect,
59312   ThemeDrawState inState,
59313   Boolean inFillCenter) ;
59314 extern OSStatus
59315 DrawThemeFocusRegion(
59316   RgnHandle inRegion,
59317   Boolean inHasFocus) ;
59318 extern Boolean
59319 IsThemeInColor(
59320   SInt16 inDepth,
59321   Boolean inIsColorDevice) ;
59322 extern OSStatus
59323 GetThemeAccentColors(CTabHandle * outColors) ;
59324 extern OSStatus
59325 DrawThemeMenuBarBackground(
59326   const Rect * inBounds,
59327   ThemeMenuBarState inState,
59328   UInt32 inAttributes) ;
59329 extern OSStatus
59330 DrawThemeMenuTitle(
59331   const Rect * inMenuBarRect,
59332   const Rect * inTitleRect,
59333   ThemeMenuState inState,
59334   UInt32 inAttributes,
59335   MenuTitleDrawingUPP inTitleProc,
59336   UInt32 inTitleData) ;
59337 extern OSStatus
59338 GetThemeMenuBarHeight(SInt16 * outHeight) ;
59339 extern OSStatus
59340 DrawThemeMenuBackground(
59341   const Rect * inMenuRect,
59342   ThemeMenuType inMenuType) ;
59343 extern OSStatus
59344 GetThemeMenuBackgroundRegion(
59345   const Rect * inMenuRect,
59346   ThemeMenuType menuType,
59347   RgnHandle region) ;
59348 extern OSStatus
59349 DrawThemeMenuItem(
59350   const Rect * inMenuRect,
59351   const Rect * inItemRect,
59352   SInt16 inVirtualMenuTop,
59353   SInt16 inVirtualMenuBottom,
59354   ThemeMenuState inState,
59355   ThemeMenuItemType inItemType,
59356   MenuItemDrawingUPP inDrawProc,
59357   UInt32 inUserData) ;
59358 extern OSStatus
59359 DrawThemeMenuSeparator(const Rect * inItemRect) ;
59360 extern OSStatus
59361 GetThemeMenuSeparatorHeight(SInt16 * outHeight) ;
59362 extern OSStatus
59363 GetThemeMenuItemExtra(
59364   ThemeMenuItemType inItemType,
59365   SInt16 * outHeight,
59366   SInt16 * outWidth) ;
59367 extern OSStatus
59368 GetThemeMenuTitleExtra(
59369   SInt16 * outWidth,
59370   Boolean inIsSquished) ;
59371 extern OSStatus
59372 GetTheme(Collection ioCollection) ;
59373 extern OSStatus
59374 SetTheme(Collection ioCollection) ;
59375 extern OSStatus
59376 IterateThemes(
59377   ThemeIteratorUPP inProc,
59378   void * inUserData) ;
59379 extern OSStatus
59380 DrawThemeTabPane(
59381   const Rect * inRect,
59382   ThemeDrawState inState) ;
59383 extern OSStatus
59384 DrawThemeTab(
59385   const Rect * inRect,
59386   ThemeTabStyle inStyle,
59387   ThemeTabDirection inDirection,
59388   ThemeTabTitleDrawUPP labelProc,
59389   UInt32 userData) ;
59390 extern OSStatus
59391 GetThemeTabRegion(
59392   const Rect * inRect,
59393   ThemeTabStyle inStyle,
59394   ThemeTabDirection inDirection,
59395   RgnHandle ioRgn) ;
59396 extern OSStatus
59397 SetThemeCursor(ThemeCursor inCursor) ;
59398 extern OSStatus
59399 SetAnimatedThemeCursor(
59400   ThemeCursor inCursor,
59401   UInt32 inAnimationStep) ;
59402 extern OSStatus
59403 GetThemeScrollBarThumbStyle(ThemeScrollBarThumbStyle * outStyle) ;
59404 extern OSStatus
59405 GetThemeScrollBarArrowStyle(ThemeScrollBarArrowStyle * outStyle) ;
59406 extern OSStatus
59407 GetThemeCheckBoxStyle(ThemeCheckBoxStyle * outStyle) ;
59408 extern OSStatus
59409 UseThemeFont(
59410   ThemeFontID inFontID,
59411   ScriptCode inScript) ;
59412 extern OSStatus
59413 GetThemeFont(
59414   ThemeFontID inFontID,
59415   ScriptCode inScript,
59416   Str255 outFontName,
59417   SInt16 * outFontSize,
59418   Style * outStyle) ;
59419 extern OSStatus
59420 DrawThemeTextBox(
59421   CFStringRef inString,
59422   ThemeFontID inFontID,
59423   ThemeDrawState inState,
59424   Boolean inWrapToWidth,
59425   const Rect * inBoundingBox,
59426   SInt16 inJust,
59427   void * inContext) ;
59428 extern OSStatus
59429 TruncateThemeText(
59430   CFMutableStringRef inString,
59431   ThemeFontID inFontID,
59432   ThemeDrawState inState,
59433   SInt16 inPixelWidthLimit,
59434   TruncCode inTruncWhere,
59435   Boolean * outTruncated) ;
59436 extern OSStatus
59437 GetThemeTextDimensions(
59438   CFStringRef inString,
59439   ThemeFontID inFontID,
59440   ThemeDrawState inState,
59441   Boolean inWrapToWidth,
59442   Point * ioBounds,
59443   SInt16 * outBaseline) ;
59444 extern OSStatus
59445 GetThemeTextShadowOutset(
59446   ThemeFontID inFontID,
59447   ThemeDrawState inState,
59448   Rect * outOutset) ;
59449 extern OSStatus
59450 DrawThemeTrack(
59451   const ThemeTrackDrawInfo * drawInfo,
59452   RgnHandle rgnGhost,
59453   ThemeEraseUPP eraseProc,
59454   UInt32 eraseData) ;
59455 extern Boolean
59456 HitTestThemeTrack(
59457   const ThemeTrackDrawInfo * drawInfo,
59458   Point mousePoint,
59459   ControlPartCode * partHit) ;
59460 extern OSStatus
59461 GetThemeTrackBounds(
59462   const ThemeTrackDrawInfo * drawInfo,
59463   Rect * bounds) ;
59464 extern OSStatus
59465 GetThemeTrackThumbRgn(
59466   const ThemeTrackDrawInfo * drawInfo,
59467   RgnHandle thumbRgn) ;
59468 extern OSStatus
59469 GetThemeTrackDragRect(
59470   const ThemeTrackDrawInfo * drawInfo,
59471   Rect * dragRect) ;
59472 extern OSStatus
59473 DrawThemeTrackTickMarks(
59474   const ThemeTrackDrawInfo * drawInfo,
59475   ItemCount numTicks,
59476   ThemeEraseUPP eraseProc,
59477   UInt32 eraseData) ;
59478 extern OSStatus
59479 GetThemeTrackThumbPositionFromOffset(
59480   const ThemeTrackDrawInfo * drawInfo,
59481   Point thumbOffset,
59482   SInt32 * relativePosition) ;
59483 extern OSStatus
59484 GetThemeTrackThumbPositionFromRegion(
59485   const ThemeTrackDrawInfo * drawInfo,
59486   RgnHandle thumbRgn,
59487   SInt32 * relativePosition) ;
59488 extern OSStatus
59489 GetThemeTrackLiveValue(
59490   const ThemeTrackDrawInfo * drawInfo,
59491   SInt32 relativePosition,
59492   SInt32 * value) ;
59493 extern OSStatus
59494 DrawThemeScrollBarArrows(
59495   const Rect * bounds,
59496   ThemeTrackEnableState enableState,
59497   ThemeTrackPressState pressState,
59498   Boolean isHoriz,
59499   Rect * trackBounds) ;
59500 extern OSStatus
59501 GetThemeScrollBarTrackRect(
59502   const Rect * bounds,
59503   ThemeTrackEnableState enableState,
59504   ThemeTrackPressState pressState,
59505   Boolean isHoriz,
59506   Rect * trackBounds) ;
59507 extern Boolean
59508 HitTestThemeScrollBarArrows(
59509   const Rect * scrollBarBounds,
59510   ThemeTrackEnableState enableState,
59511   ThemeTrackPressState pressState,
59512   Boolean isHoriz,
59513   Point ptHit,
59514   Rect * trackBounds,
59515   ControlPartCode * partcode) ;
59516 extern OSStatus
59517 GetThemeWindowRegion(
59518   ThemeWindowType flavor,
59519   const Rect * contRect,
59520   ThemeDrawState state,
59521   const ThemeWindowMetrics * metrics,
59522   ThemeWindowAttributes attributes,
59523   WindowRegionCode winRegion,
59524   RgnHandle rgn) ;
59525 extern OSStatus
59526 DrawThemeWindowFrame(
59527   ThemeWindowType flavor,
59528   const Rect * contRect,
59529   ThemeDrawState state,
59530   const ThemeWindowMetrics * metrics,
59531   ThemeWindowAttributes attributes,
59532   WindowTitleDrawingUPP titleProc,
59533   UInt32 titleData) ;
59534 extern OSStatus
59535 DrawThemeTitleBarWidget(
59536   ThemeWindowType flavor,
59537   const Rect * contRect,
59538   ThemeDrawState state,
59539   const ThemeWindowMetrics * metrics,
59540   ThemeWindowAttributes attributes,
59541   ThemeTitleBarWidget widget) ;
59542 extern Boolean
59543 GetThemeWindowRegionHit(
59544   ThemeWindowType flavor,
59545   const Rect * inContRect,
59546   ThemeDrawState state,
59547   const ThemeWindowMetrics * metrics,
59548   ThemeWindowAttributes inAttributes,
59549   Point inPoint,
59550   WindowRegionCode * outRegionHit) ;
59551 extern OSStatus
59552 DrawThemeScrollBarDelimiters(
59553   ThemeWindowType flavor,
59554   const Rect * inContRect,
59555   ThemeDrawState state,
59556   ThemeWindowAttributes attributes) ;
59557 extern OSStatus
59558 DrawThemeButton(
59559   const Rect * inBounds,
59560   ThemeButtonKind inKind,
59561   const ThemeButtonDrawInfo * inNewInfo,
59562   const ThemeButtonDrawInfo * inPrevInfo,
59563   ThemeEraseUPP inEraseProc,
59564   ThemeButtonDrawUPP inLabelProc,
59565   UInt32 inUserData) ;
59566 extern OSStatus
59567 GetThemeButtonRegion(
59568   const Rect * inBounds,
59569   ThemeButtonKind inKind,
59570   const ThemeButtonDrawInfo * inNewInfo,
59571   RgnHandle outRegion) ;
59572 extern OSStatus
59573 GetThemeButtonContentBounds(
59574   const Rect * inBounds,
59575   ThemeButtonKind inKind,
59576   const ThemeButtonDrawInfo * inDrawInfo,
59577   Rect * outBounds) ;
59578 extern OSStatus
59579 GetThemeButtonBackgroundBounds(
59580   const Rect * inBounds,
59581   ThemeButtonKind inKind,
59582   const ThemeButtonDrawInfo * inDrawInfo,
59583   Rect * outBounds) ;
59584 extern OSStatus
59585 PlayThemeSound(ThemeSoundKind kind) ;
59586 extern OSStatus
59587 BeginThemeDragSound(ThemeDragSoundKind kind) ;
59588 extern OSStatus
59589 EndThemeDragSound(void) ;
59590 extern OSStatus
59591 DrawThemeTickMark(
59592   const Rect * bounds,
59593   ThemeDrawState state) ;
59594 extern OSStatus
59595 DrawThemeChasingArrows(
59596   const Rect * bounds,
59597   UInt32 index,
59598   ThemeDrawState state,
59599   ThemeEraseUPP eraseProc,
59600   UInt32 eraseData) ;
59601 extern OSStatus
59602 DrawThemePopupArrow(
59603   const Rect * bounds,
59604   ThemeArrowOrientation orientation,
59605   ThemePopupArrowSize size,
59606   ThemeDrawState state,
59607   ThemeEraseUPP eraseProc,
59608   UInt32 eraseData) ;
59609 extern OSStatus
59610 DrawThemeStandaloneGrowBox(
59611   Point origin,
59612   ThemeGrowDirection growDirection,
59613   Boolean isSmall,
59614   ThemeDrawState state) ;
59615 extern OSStatus
59616 DrawThemeStandaloneNoGrowBox(
59617   Point origin,
59618   ThemeGrowDirection growDirection,
59619   Boolean isSmall,
59620   ThemeDrawState state) ;
59621 extern OSStatus
59622 GetThemeStandaloneGrowBoxBounds(
59623   Point origin,
59624   ThemeGrowDirection growDirection,
59625   Boolean isSmall,
59626   Rect * bounds) ;
59627 extern OSStatus
59628 NormalizeThemeDrawingState(void) ;
59629 extern OSStatus
59630 GetThemeDrawingState(ThemeDrawingState * outState) ;
59631 extern OSStatus
59632 SetThemeDrawingState(
59633   ThemeDrawingState inState,
59634   Boolean inDisposeNow) ;
59635 extern OSStatus
59636 DisposeThemeDrawingState(ThemeDrawingState inState) ;
59637 extern OSStatus
59638 ApplyThemeBackground(
59639   ThemeBackgroundKind inKind,
59640   const Rect * bounds,
59641   ThemeDrawState inState,
59642   SInt16 inDepth,
59643   Boolean inColorDev) ;
59644 extern OSStatus
59645 SetThemeTextColorForWindow(
59646   WindowRef inWindow,
59647   Boolean inActive,
59648   SInt16 inDepth,
59649   Boolean inColorDev) ;
59650 extern Boolean
59651 IsValidAppearanceFileType(OSType fileType) ;
59652 extern OSStatus
59653 GetThemeBrushAsColor(
59654   ThemeBrush inBrush,
59655   SInt16 inDepth,
59656   Boolean inColorDev,
59657   RGBColor * outColor) ;
59658 extern OSStatus
59659 GetThemeTextColor(
59660   ThemeTextColor inColor,
59661   SInt16 inDepth,
59662   Boolean inColorDev,
59663   RGBColor * outColor) ;
59664 extern OSStatus
59665 GetThemeMetric(
59666   ThemeMetric inMetric,
59667   SInt32 * outMetric) ;
59668 extern OSStatus
59669 CopyThemeIdentifier(CFStringRef * outIdentifier) ;
59670
59671
59672
59673
59674
59675
59676 enum {
59677   appearanceBadBrushIndexErr = themeInvalidBrushErr,
59678   appearanceProcessRegisteredErr = themeProcessRegisteredErr,
59679   appearanceProcessNotRegisteredErr = themeProcessNotRegisteredErr,
59680   appearanceBadTextColorIndexErr = themeBadTextColorErr,
59681   appearanceThemeHasNoAccents = themeHasNoAccentsErr,
59682   appearanceBadCursorIndexErr = themeBadCursorIndexErr
59683 };
59684
59685 enum {
59686   kThemeActiveDialogBackgroundBrush = kThemeBrushDialogBackgroundActive,
59687   kThemeInactiveDialogBackgroundBrush = kThemeBrushDialogBackgroundInactive,
59688   kThemeActiveAlertBackgroundBrush = kThemeBrushAlertBackgroundActive,
59689   kThemeInactiveAlertBackgroundBrush = kThemeBrushAlertBackgroundInactive,
59690   kThemeActiveModelessDialogBackgroundBrush = kThemeBrushModelessDialogBackgroundActive,
59691   kThemeInactiveModelessDialogBackgroundBrush = kThemeBrushModelessDialogBackgroundInactive,
59692   kThemeActiveUtilityWindowBackgroundBrush = kThemeBrushUtilityWindowBackgroundActive,
59693   kThemeInactiveUtilityWindowBackgroundBrush = kThemeBrushUtilityWindowBackgroundInactive,
59694   kThemeListViewSortColumnBackgroundBrush = kThemeBrushListViewSortColumnBackground,
59695   kThemeListViewBackgroundBrush = kThemeBrushListViewBackground,
59696   kThemeIconLabelBackgroundBrush = kThemeBrushIconLabelBackground,
59697   kThemeListViewSeparatorBrush = kThemeBrushListViewSeparator,
59698   kThemeChasingArrowsBrush = kThemeBrushChasingArrows,
59699   kThemeDragHiliteBrush = kThemeBrushDragHilite,
59700   kThemeDocumentWindowBackgroundBrush = kThemeBrushDocumentWindowBackground,
59701   kThemeFinderWindowBackgroundBrush = kThemeBrushFinderWindowBackground
59702 };
59703
59704 enum {
59705   kThemeActiveScrollBarDelimiterBrush = kThemeBrushScrollBarDelimiterActive,
59706   kThemeInactiveScrollBarDelimiterBrush = kThemeBrushScrollBarDelimiterInactive,
59707   kThemeFocusHighlightBrush = kThemeBrushFocusHighlight,
59708   kThemeActivePopupArrowBrush = kThemeBrushPopupArrowActive,
59709   kThemePressedPopupArrowBrush = kThemeBrushPopupArrowPressed,
59710   kThemeInactivePopupArrowBrush = kThemeBrushPopupArrowInactive,
59711   kThemeAppleGuideCoachmarkBrush = kThemeBrushAppleGuideCoachmark
59712 };
59713
59714 enum {
59715   kThemeActiveDialogTextColor = kThemeTextColorDialogActive,
59716   kThemeInactiveDialogTextColor = kThemeTextColorDialogInactive,
59717   kThemeActiveAlertTextColor = kThemeTextColorAlertActive,
59718   kThemeInactiveAlertTextColor = kThemeTextColorAlertInactive,
59719   kThemeActiveModelessDialogTextColor = kThemeTextColorModelessDialogActive,
59720   kThemeInactiveModelessDialogTextColor = kThemeTextColorModelessDialogInactive,
59721   kThemeActiveWindowHeaderTextColor = kThemeTextColorWindowHeaderActive,
59722   kThemeInactiveWindowHeaderTextColor = kThemeTextColorWindowHeaderInactive,
59723   kThemeActivePlacardTextColor = kThemeTextColorPlacardActive,
59724   kThemeInactivePlacardTextColor = kThemeTextColorPlacardInactive,
59725   kThemePressedPlacardTextColor = kThemeTextColorPlacardPressed,
59726   kThemeActivePushButtonTextColor = kThemeTextColorPushButtonActive,
59727   kThemeInactivePushButtonTextColor = kThemeTextColorPushButtonInactive,
59728   kThemePressedPushButtonTextColor = kThemeTextColorPushButtonPressed,
59729   kThemeActiveBevelButtonTextColor = kThemeTextColorBevelButtonActive,
59730   kThemeInactiveBevelButtonTextColor = kThemeTextColorBevelButtonInactive,
59731   kThemePressedBevelButtonTextColor = kThemeTextColorBevelButtonPressed,
59732   kThemeActivePopupButtonTextColor = kThemeTextColorPopupButtonActive,
59733   kThemeInactivePopupButtonTextColor = kThemeTextColorPopupButtonInactive,
59734   kThemePressedPopupButtonTextColor = kThemeTextColorPopupButtonPressed,
59735   kThemeIconLabelTextColor = kThemeTextColorIconLabel,
59736   kThemeListViewTextColor = kThemeTextColorListView
59737 };
59738
59739 enum {
59740   kThemeActiveDocumentWindowTitleTextColor = kThemeTextColorDocumentWindowTitleActive,
59741   kThemeInactiveDocumentWindowTitleTextColor = kThemeTextColorDocumentWindowTitleInactive,
59742   kThemeActiveMovableModalWindowTitleTextColor = kThemeTextColorMovableModalWindowTitleActive,
59743   kThemeInactiveMovableModalWindowTitleTextColor = kThemeTextColorMovableModalWindowTitleInactive,
59744   kThemeActiveUtilityWindowTitleTextColor = kThemeTextColorUtilityWindowTitleActive,
59745   kThemeInactiveUtilityWindowTitleTextColor = kThemeTextColorUtilityWindowTitleInactive,
59746   kThemeActivePopupWindowTitleColor = kThemeTextColorPopupWindowTitleActive,
59747   kThemeInactivePopupWindowTitleColor = kThemeTextColorPopupWindowTitleInactive,
59748   kThemeActiveRootMenuTextColor = kThemeTextColorRootMenuActive,
59749   kThemeSelectedRootMenuTextColor = kThemeTextColorRootMenuSelected,
59750   kThemeDisabledRootMenuTextColor = kThemeTextColorRootMenuDisabled,
59751   kThemeActiveMenuItemTextColor = kThemeTextColorMenuItemActive,
59752   kThemeSelectedMenuItemTextColor = kThemeTextColorMenuItemSelected,
59753   kThemeDisabledMenuItemTextColor = kThemeTextColorMenuItemDisabled,
59754   kThemeActivePopupLabelTextColor = kThemeTextColorPopupLabelActive,
59755   kThemeInactivePopupLabelTextColor = kThemeTextColorPopupLabelInactive
59756 };
59757
59758 enum {
59759   kAEThemeSwitch = kAEAppearanceChanged
59760 };
59761
59762 enum {
59763   kThemeNoAdornment = kThemeAdornmentNone,
59764   kThemeDefaultAdornment = kThemeAdornmentDefault,
59765   kThemeFocusAdornment = kThemeAdornmentFocus,
59766   kThemeRightToLeftAdornment = kThemeAdornmentRightToLeft,
59767   kThemeDrawIndicatorOnly = kThemeAdornmentDrawIndicatorOnly
59768 };
59769
59770 enum {
59771   kThemeBrushPassiveAreaFill = kThemeBrushStaticAreaFill
59772 };
59773
59774 enum {
59775   kThemeMetricCheckBoxGlyphHeight = kThemeMetricCheckBoxHeight,
59776   kThemeMetricRadioButtonGlyphHeight = kThemeMetricRadioButtonHeight,
59777   kThemeMetricDisclosureButtonSize = kThemeMetricDisclosureButtonHeight,
59778   kThemeMetricBestListHeaderHeight = kThemeMetricListHeaderHeight,
59779   kThemeMetricSmallProgressBarThickness = kThemeMetricNormalProgressBarThickness,
59780   kThemeMetricProgressBarThickness = kThemeMetricLargeProgressBarThickness
59781 };
59782
59783 enum {
59784   kThemeScrollBar = kThemeMediumScrollBar,
59785   kThemeSlider = kThemeMediumSlider,
59786   kThemeProgressBar = kThemeMediumProgressBar,
59787   kThemeIndeterminateBar = kThemeMediumIndeterminateBar
59788 };
59789
59790
59791
59792
59793 }
59794 extern "C" {
59795
59796
59797
59798 enum {
59799
59800   kControlDialogItem = 4,
59801   kButtonDialogItem = kControlDialogItem | 0,
59802   kCheckBoxDialogItem = kControlDialogItem | 1,
59803   kRadioButtonDialogItem = kControlDialogItem | 2,
59804   kResourceControlDialogItem = kControlDialogItem | 3,
59805   kStaticTextDialogItem = 8,
59806   kEditTextDialogItem = 16,
59807   kIconDialogItem = 32,
59808   kPictureDialogItem = 64,
59809   kUserDialogItem = 0,
59810   kHelpDialogItem = 1,
59811   kItemDisableBit = 128
59812 };
59813
59814 enum {
59815
59816   ctrlItem = 4,
59817   btnCtrl = 0,
59818   chkCtrl = 1,
59819   radCtrl = 2,
59820   resCtrl = 3,
59821   statText = 8,
59822   editText = 16,
59823   iconItem = 32,
59824   picItem = 64,
59825   userItem = 0,
59826   itemDisable = 128
59827 };
59828
59829 enum {
59830
59831   kStdOkItemIndex = 1,
59832   kStdCancelItemIndex = 2,
59833   ok = kStdOkItemIndex,
59834   cancel = kStdCancelItemIndex
59835 };
59836
59837 enum {
59838
59839   kStopIcon = 0,
59840   kNoteIcon = 1,
59841   kCautionIcon = 2,
59842   stopIcon = kStopIcon,
59843   noteIcon = kNoteIcon,
59844   cautionIcon = kCautionIcon
59845 };
59846 typedef SInt16 DITLMethod;
59847 enum {
59848   overlayDITL = 0,
59849   appendDITLRight = 1,
59850   appendDITLBottom = 2
59851 };
59852
59853 typedef SInt16 StageList;
59854
59855 typedef DialogPtr DialogRef;
59856 struct DialogTemplate {
59857   Rect boundsRect;
59858   SInt16 procID;
59859   Boolean visible;
59860   Boolean filler1;
59861   Boolean goAwayFlag;
59862   Boolean filler2;
59863   SInt32 refCon;
59864   SInt16 itemsID;
59865   Str255 title;
59866 };
59867 typedef struct DialogTemplate DialogTemplate;
59868 typedef DialogTemplate * DialogTPtr;
59869 typedef DialogTPtr * DialogTHndl;
59870 struct AlertTemplate {
59871   Rect boundsRect;
59872   SInt16 itemsID;
59873   StageList stages;
59874 };
59875 typedef struct AlertTemplate AlertTemplate;
59876 typedef AlertTemplate * AlertTPtr;
59877 typedef AlertTPtr * AlertTHndl;
59878
59879 typedef SInt16 DialogItemIndexZeroBased;
59880 typedef SInt16 DialogItemIndex;
59881 typedef SInt16 DialogItemType;
59882
59883 typedef void ( * SoundProcPtr)(SInt16 soundNumber);
59884 typedef Boolean ( * ModalFilterProcPtr)(DialogRef theDialog, EventRecord *theEvent, DialogItemIndex *itemHit);
59885
59886 typedef Boolean ( * ModalFilterYDProcPtr)(DialogRef theDialog, EventRecord *theEvent, short *itemHit, void *yourDataPtr);
59887 typedef void ( * UserItemProcPtr)(DialogRef theDialog, DialogItemIndex itemNo);
59888 typedef SoundProcPtr SoundUPP;
59889 typedef ModalFilterProcPtr ModalFilterUPP;
59890 typedef ModalFilterYDProcPtr ModalFilterYDUPP;
59891 typedef UserItemProcPtr UserItemUPP;
59892 extern ModalFilterUPP
59893 NewModalFilterUPP(ModalFilterProcPtr userRoutine) ;
59894 extern ModalFilterYDUPP
59895 NewModalFilterYDUPP(ModalFilterYDProcPtr userRoutine) ;
59896 extern UserItemUPP
59897 NewUserItemUPP(UserItemProcPtr userRoutine) ;
59898 extern void
59899 DisposeModalFilterUPP(ModalFilterUPP userUPP) ;
59900 extern void
59901 DisposeModalFilterYDUPP(ModalFilterYDUPP userUPP) ;
59902 extern void
59903 DisposeUserItemUPP(UserItemUPP userUPP) ;
59904 extern Boolean
59905 InvokeModalFilterUPP(
59906   DialogRef theDialog,
59907   EventRecord * theEvent,
59908   DialogItemIndex * itemHit,
59909   ModalFilterUPP userUPP) ;
59910 extern Boolean
59911 InvokeModalFilterYDUPP(
59912   DialogRef theDialog,
59913   EventRecord * theEvent,
59914   short * itemHit,
59915   void * yourDataPtr,
59916   ModalFilterYDUPP userUPP) ;
59917 extern void
59918 InvokeUserItemUPP(
59919   DialogRef theDialog,
59920   DialogItemIndex itemNo,
59921   UserItemUPP userUPP) ;
59922
59923
59924
59925
59926
59927
59928
59929 enum {
59930
59931   kAlertStopAlert = 0,
59932   kAlertNoteAlert = 1,
59933   kAlertCautionAlert = 2,
59934   kAlertPlainAlert = 3
59935 };
59936
59937 typedef SInt16 AlertType;
59938 enum {
59939   kAlertDefaultOKText = -1,
59940   kAlertDefaultCancelText = -1,
59941   kAlertDefaultOtherText = -1
59942 };
59943
59944
59945 enum {
59946   kAlertStdAlertOKButton = 1,
59947   kAlertStdAlertCancelButton = 2,
59948   kAlertStdAlertOtherButton = 3,
59949   kAlertStdAlertHelpButton = 4
59950 };
59951
59952 enum {
59953
59954   kDialogFlagsUseThemeBackground = (1 << 0),
59955   kDialogFlagsUseControlHierarchy = (1 << 1),
59956   kDialogFlagsHandleMovableModal = (1 << 2),
59957   kDialogFlagsUseThemeControls = (1 << 3)
59958 };
59959
59960 enum {
59961
59962   kAlertFlagsUseThemeBackground = (1 << 0),
59963   kAlertFlagsUseControlHierarchy = (1 << 1),
59964   kAlertFlagsAlertIsMovable = (1 << 2),
59965   kAlertFlagsUseThemeControls = (1 << 3)
59966 };
59967
59968
59969 enum {
59970   kDialogFontNoFontStyle = 0,
59971   kDialogFontUseFontMask = 0x0001,
59972   kDialogFontUseFaceMask = 0x0002,
59973   kDialogFontUseSizeMask = 0x0004,
59974   kDialogFontUseForeColorMask = 0x0008,
59975   kDialogFontUseBackColorMask = 0x0010,
59976   kDialogFontUseModeMask = 0x0020,
59977   kDialogFontUseJustMask = 0x0040,
59978   kDialogFontUseAllMask = 0x00FF,
59979   kDialogFontAddFontSizeMask = 0x0100,
59980   kDialogFontUseFontNameMask = 0x0200,
59981   kDialogFontAddToMetaFontMask = 0x0400
59982 };
59983
59984
59985
59986 enum {
59987   kDialogFontUseThemeFontIDMask = 0x0080
59988 };
59989
59990 struct AlertStdAlertParamRec {
59991   Boolean movable;
59992   Boolean helpButton;
59993   ModalFilterUPP filterProc;
59994   ConstStringPtr defaultText;
59995   ConstStringPtr cancelText;
59996   ConstStringPtr otherText;
59997   SInt16 defaultButton;
59998   SInt16 cancelButton;
59999   UInt16 position;
60000
60001 };
60002 typedef struct AlertStdAlertParamRec AlertStdAlertParamRec;
60003 typedef AlertStdAlertParamRec * AlertStdAlertParamPtr;
60004 enum {
60005   kHICommandOther = 'othr'
60006 };
60007
60008 enum {
60009   kStdCFStringAlertVersionOne = 1
60010 };
60011
60012
60013
60014
60015
60016
60017
60018 enum {
60019
60020
60021
60022
60023
60024
60025   kStdAlertDoNotDisposeSheet = 1 << 0,
60026
60027
60028
60029
60030
60031
60032   kStdAlertDoNotAnimateOnDefault = 1 << 1,
60033
60034
60035
60036
60037
60038
60039   kStdAlertDoNotAnimateOnCancel = 1 << 2,
60040
60041
60042
60043
60044
60045
60046   kStdAlertDoNotAnimateOnOther = 1 << 3
60047 };
60048
60049 struct AlertStdCFStringAlertParamRec {
60050   UInt32 version;
60051   Boolean movable;
60052   Boolean helpButton;
60053   CFStringRef defaultText;
60054   CFStringRef cancelText;
60055   CFStringRef otherText;
60056   SInt16 defaultButton;
60057   SInt16 cancelButton;
60058   UInt16 position;
60059
60060   OptionBits flags;
60061 };
60062 typedef struct AlertStdCFStringAlertParamRec AlertStdCFStringAlertParamRec;
60063 typedef AlertStdCFStringAlertParamRec * AlertStdCFStringAlertParamPtr;
60064 extern DialogRef
60065 NewDialog(
60066   void * dStorage,
60067   const Rect * boundsRect,
60068   ConstStr255Param title,
60069   Boolean visible,
60070   SInt16 procID,
60071   WindowRef behind,
60072   Boolean goAwayFlag,
60073   SInt32 refCon,
60074   Handle items) ;
60075 extern DialogRef
60076 GetNewDialog(
60077   SInt16 dialogID,
60078   void * dStorage,
60079   WindowRef behind) ;
60080 extern DialogRef
60081 NewColorDialog(
60082   void * dStorage,
60083   const Rect * boundsRect,
60084   ConstStr255Param title,
60085   Boolean visible,
60086   SInt16 procID,
60087   WindowRef behind,
60088   Boolean goAwayFlag,
60089   SInt32 refCon,
60090   Handle items) ;
60091 extern void
60092 DisposeDialog(DialogRef theDialog) ;
60093 extern void
60094 ModalDialog(
60095   ModalFilterUPP modalFilter,
60096   DialogItemIndex * itemHit) ;
60097 extern Boolean
60098 IsDialogEvent(const EventRecord * theEvent) ;
60099 extern Boolean
60100 DialogSelect(
60101   const EventRecord * theEvent,
60102   DialogRef * theDialog,
60103   DialogItemIndex * itemHit) ;
60104 extern void
60105 DrawDialog(DialogRef theDialog) ;
60106 extern void
60107 UpdateDialog(
60108   DialogRef theDialog,
60109   RgnHandle updateRgn) ;
60110 extern void
60111 HideDialogItem(
60112   DialogRef theDialog,
60113   DialogItemIndex itemNo) ;
60114 extern void
60115 ShowDialogItem(
60116   DialogRef theDialog,
60117   DialogItemIndex itemNo) ;
60118 extern DialogItemIndexZeroBased
60119 FindDialogItem(
60120   DialogRef theDialog,
60121   Point thePt) ;
60122 extern void
60123 DialogCut(DialogRef theDialog) ;
60124 extern void
60125 DialogPaste(DialogRef theDialog) ;
60126 extern void
60127 DialogCopy(DialogRef theDialog) ;
60128 extern void
60129 DialogDelete(DialogRef theDialog) ;
60130 extern DialogItemIndex
60131 Alert(
60132   SInt16 alertID,
60133   ModalFilterUPP modalFilter) ;
60134 extern DialogItemIndex
60135 StopAlert(
60136   SInt16 alertID,
60137   ModalFilterUPP modalFilter) ;
60138 extern DialogItemIndex
60139 NoteAlert(
60140   SInt16 alertID,
60141   ModalFilterUPP modalFilter) ;
60142 extern DialogItemIndex
60143 CautionAlert(
60144   SInt16 alertID,
60145   ModalFilterUPP modalFilter) ;
60146 extern void
60147 GetDialogItem(
60148   DialogRef theDialog,
60149   DialogItemIndex itemNo,
60150   DialogItemType * itemType,
60151   Handle * item,
60152   Rect * box) ;
60153 extern void
60154 SetDialogItem(
60155   DialogRef theDialog,
60156   DialogItemIndex itemNo,
60157   DialogItemType itemType,
60158   Handle item,
60159   const Rect * box) ;
60160 extern void
60161 ParamText(
60162   ConstStr255Param param0,
60163   ConstStr255Param param1,
60164   ConstStr255Param param2,
60165   ConstStr255Param param3) ;
60166 extern void
60167 SelectDialogItemText(
60168   DialogRef theDialog,
60169   DialogItemIndex itemNo,
60170   SInt16 strtSel,
60171   SInt16 endSel) ;
60172 extern void
60173 GetDialogItemText(
60174   Handle item,
60175   Str255 text) ;
60176 extern void
60177 SetDialogItemText(
60178   Handle item,
60179   ConstStr255Param text) ;
60180 extern SInt16
60181 GetAlertStage(void) ;
60182 extern void
60183 SetDialogFont(SInt16 fontNum) ;
60184 extern void
60185 ResetAlertStage(void) ;
60186 extern void
60187 GetParamText(
60188   StringPtr param0,
60189   StringPtr param1,
60190   StringPtr param2,
60191   StringPtr param3) ;
60192 extern void
60193 AppendDITL(
60194   DialogRef theDialog,
60195   Handle theHandle,
60196   DITLMethod method) ;
60197 extern DialogItemIndex
60198 CountDITL(DialogRef theDialog) ;
60199 extern void
60200 ShortenDITL(
60201   DialogRef theDialog,
60202   DialogItemIndex numberItems) ;
60203 extern OSStatus
60204 InsertDialogItem(
60205   DialogRef theDialog,
60206   DialogItemIndex afterItem,
60207   DialogItemType itemType,
60208   Handle itemHandle,
60209   const Rect * box) ;
60210 extern OSStatus
60211 RemoveDialogItems(
60212   DialogRef theDialog,
60213   DialogItemIndex itemNo,
60214   DialogItemIndex amountToRemove,
60215   Boolean disposeItemData) ;
60216 extern Boolean
60217 StdFilterProc(
60218   DialogRef theDialog,
60219   EventRecord * event,
60220   DialogItemIndex * itemHit) ;
60221 extern OSErr
60222 GetStdFilterProc(ModalFilterUPP * theProc) ;
60223 extern OSErr
60224 SetDialogDefaultItem(
60225   DialogRef theDialog,
60226   DialogItemIndex newItem) ;
60227 extern OSErr
60228 SetDialogCancelItem(
60229   DialogRef theDialog,
60230   DialogItemIndex newItem) ;
60231 extern OSErr
60232 SetDialogTracksCursor(
60233   DialogRef theDialog,
60234   Boolean tracks) ;
60235 extern DialogRef
60236 NewFeaturesDialog(
60237   void * inStorage,
60238   const Rect * inBoundsRect,
60239   ConstStr255Param inTitle,
60240   Boolean inIsVisible,
60241   SInt16 inProcID,
60242   WindowRef inBehind,
60243   Boolean inGoAwayFlag,
60244   SInt32 inRefCon,
60245   Handle inItemListHandle,
60246   UInt32 inFlags) ;
60247 extern OSErr
60248 AutoSizeDialog(DialogRef inDialog) ;
60249 extern OSErr
60250 StandardAlert(
60251   AlertType inAlertType,
60252   ConstStr255Param inError,
60253   ConstStr255Param inExplanation,
60254   const AlertStdAlertParamRec * inAlertParam,
60255   SInt16 * outItemHit) ;
60256 extern OSStatus
60257 GetStandardAlertDefaultParams(
60258   AlertStdCFStringAlertParamPtr param,
60259   UInt32 version) ;
60260 extern OSStatus
60261 CreateStandardAlert(
60262   AlertType alertType,
60263   CFStringRef error,
60264   CFStringRef explanation,
60265   const AlertStdCFStringAlertParamRec * param,
60266   DialogRef * outAlert) ;
60267 extern OSStatus
60268 RunStandardAlert(
60269   DialogRef inAlert,
60270   ModalFilterUPP filterProc,
60271   DialogItemIndex * outItemHit) ;
60272 extern OSStatus
60273 CreateStandardSheet(
60274   AlertType alertType,
60275   CFStringRef error,
60276   CFStringRef explanation,
60277   const AlertStdCFStringAlertParamRec * param,
60278   EventTargetRef notifyTarget,
60279   DialogRef * outSheet) ;
60280 extern OSStatus
60281 CloseStandardSheet(
60282   DialogRef inSheet,
60283   UInt32 inResultCommand) ;
60284 extern OSErr
60285 GetDialogItemAsControl(
60286   DialogRef inDialog,
60287   SInt16 inItemNo,
60288   ControlRef * outControl) ;
60289 extern OSErr
60290 MoveDialogItem(
60291   DialogRef inDialog,
60292   SInt16 inItemNo,
60293   SInt16 inHoriz,
60294   SInt16 inVert) ;
60295 extern OSErr
60296 SizeDialogItem(
60297   DialogRef inDialog,
60298   SInt16 inItemNo,
60299   SInt16 inWidth,
60300   SInt16 inHeight) ;
60301 extern OSErr
60302 AppendDialogItemList(
60303   DialogRef dialog,
60304   SInt16 ditlID,
60305   DITLMethod method) ;
60306 extern OSStatus
60307 SetDialogTimeout(
60308   DialogRef inDialog,
60309   SInt16 inButtonToPress,
60310   UInt32 inSecondsToWait) ;
60311 extern OSStatus
60312 GetDialogTimeout(
60313   DialogRef inDialog,
60314   SInt16 * outButtonToPress,
60315   UInt32 * outSecondsToWait,
60316   UInt32 * outSecondsRemaining) ;
60317 extern OSStatus
60318 SetModalDialogEventMask(
60319   DialogRef inDialog,
60320   EventMask inMask) ;
60321 extern OSStatus
60322 GetModalDialogEventMask(
60323   DialogRef inDialog,
60324   EventMask * outMask) ;
60325 extern WindowRef
60326 GetDialogWindow(DialogRef dialog) ;
60327 extern TEHandle
60328 GetDialogTextEditHandle(DialogRef dialog) ;
60329 extern SInt16
60330 GetDialogDefaultItem(DialogRef dialog) ;
60331 extern SInt16
60332 GetDialogCancelItem(DialogRef dialog) ;
60333 extern SInt16
60334 GetDialogKeyboardFocusItem(DialogRef dialog) ;
60335 extern void
60336 SetPortDialogPort(DialogRef dialog) ;
60337 extern CGrafPtr
60338 GetDialogPort(DialogRef dialog) ;
60339 extern DialogRef
60340 GetDialogFromWindow(WindowRef window) ;
60341
60342
60343 }
60344
60345
60346
60347 extern "C" {
60348
60349
60350
60351 typedef Point Cell;
60352 typedef Rect ListBounds;
60353 typedef char DataArray[32001];
60354 typedef char * DataPtr;
60355 typedef DataPtr * DataHandle;
60356 typedef short ( * ListSearchProcPtr)(Ptr aPtr, Ptr bPtr, short aLen, short bLen);
60357 typedef Boolean ( * ListClickLoopProcPtr)(void);
60358 typedef ListSearchProcPtr ListSearchUPP;
60359 typedef ListClickLoopProcPtr ListClickLoopUPP;
60360 struct ListRec {
60361   Rect rView;
60362   GrafPtr port;
60363   Point indent;
60364   Point cellSize;
60365   ListBounds visible;
60366   ControlRef vScroll;
60367   ControlRef hScroll;
60368   SInt8 selFlags;
60369   Boolean lActive;
60370   SInt8 lReserved;
60371   SInt8 listFlags;
60372   long clikTime;
60373   Point clikLoc;
60374   Point mouseLoc;
60375   ListClickLoopUPP lClickLoop;
60376   Cell lastClick;
60377   long refCon;
60378   Handle listDefProc;
60379   Handle userHandle;
60380   ListBounds dataBounds;
60381   DataHandle cells;
60382   short maxIndex;
60383   short cellArray[1];
60384 };
60385 typedef struct ListRec ListRec;
60386 typedef ListRec * ListPtr;
60387 typedef ListPtr * ListHandle;
60388
60389 typedef ListHandle ListRef;
60390
60391
60392 enum {
60393
60394   lDrawingModeOffBit = 3,
60395   lDoVAutoscrollBit = 1,
60396   lDoHAutoscrollBit = 0
60397 };
60398
60399 enum {
60400
60401   lDrawingModeOff = 8,
60402   lDoVAutoscroll = 2,
60403   lDoHAutoscroll = 1
60404 };
60405
60406
60407 enum {
60408
60409   lOnlyOneBit = 7,
60410   lExtendDragBit = 6,
60411   lNoDisjointBit = 5,
60412   lNoExtendBit = 4,
60413   lNoRectBit = 3,
60414   lUseSenseBit = 2,
60415   lNoNilHiliteBit = 1
60416 };
60417
60418
60419 enum {
60420
60421   lOnlyOne = -128,
60422   lExtendDrag = 64,
60423   lNoDisjoint = 32,
60424   lNoExtend = 16,
60425   lNoRect = 8,
60426   lUseSense = 4,
60427   lNoNilHilite = 2
60428 };
60429
60430
60431 enum {
60432
60433   lInitMsg = 0,
60434   lDrawMsg = 1,
60435   lHiliteMsg = 2,
60436   lCloseMsg = 3
60437 };
60438
60439
60440
60441
60442
60443 struct StandardIconListCellDataRec {
60444   Handle iconHandle;
60445   short font;
60446   short face;
60447   short size;
60448   Str255 name;
60449 };
60450 typedef struct StandardIconListCellDataRec StandardIconListCellDataRec;
60451 typedef StandardIconListCellDataRec * StandardIconListCellDataPtr;
60452
60453
60454 typedef void ( * ListDefProcPtr)(short lMessage, Boolean lSelect, Rect *lRect, Cell lCell, short lDataOffset, short lDataLen, ListHandle lHandle);
60455 typedef ListDefProcPtr ListDefUPP;
60456 extern ListSearchUPP
60457 NewListSearchUPP(ListSearchProcPtr userRoutine) ;
60458 extern ListClickLoopUPP
60459 NewListClickLoopUPP(ListClickLoopProcPtr userRoutine) ;
60460 extern ListDefUPP
60461 NewListDefUPP(ListDefProcPtr userRoutine) ;
60462 extern void
60463 DisposeListSearchUPP(ListSearchUPP userUPP) ;
60464 extern void
60465 DisposeListClickLoopUPP(ListClickLoopUPP userUPP) ;
60466 extern void
60467 DisposeListDefUPP(ListDefUPP userUPP) ;
60468 extern short
60469 InvokeListSearchUPP(
60470   Ptr aPtr,
60471   Ptr bPtr,
60472   short aLen,
60473   short bLen,
60474   ListSearchUPP userUPP) ;
60475 extern Boolean
60476 InvokeListClickLoopUPP(ListClickLoopUPP userUPP) ;
60477 extern void
60478 InvokeListDefUPP(
60479   short lMessage,
60480   Boolean lSelect,
60481   Rect * lRect,
60482   Cell lCell,
60483   short lDataOffset,
60484   short lDataLen,
60485   ListHandle lHandle,
60486   ListDefUPP userUPP) ;
60487
60488 enum {
60489   kListDefProcPtr = 0,
60490   kListDefUserProcType = kListDefProcPtr,
60491   kListDefStandardTextType = 1,
60492   kListDefStandardIconType = 2
60493 };
60494
60495 typedef UInt32 ListDefType;
60496 struct ListDefSpec {
60497   ListDefType defType;
60498   union {
60499     ListDefUPP userProc;
60500   } u;
60501 };
60502 typedef struct ListDefSpec ListDefSpec;
60503 typedef ListDefSpec * ListDefSpecPtr;
60504 extern OSStatus
60505 CreateCustomList(
60506   const Rect * rView,
60507   const ListBounds * dataBounds,
60508   Point cellSize,
60509   const ListDefSpec * theSpec,
60510   WindowRef theWindow,
60511   Boolean drawIt,
60512   Boolean hasGrow,
60513   Boolean scrollHoriz,
60514   Boolean scrollVert,
60515   ListHandle * outList) ;
60516 extern ListHandle
60517 LNew(
60518   const Rect * rView,
60519   const ListBounds * dataBounds,
60520   Point cSize,
60521   short theProc,
60522   WindowRef theWindow,
60523   Boolean drawIt,
60524   Boolean hasGrow,
60525   Boolean scrollHoriz,
60526   Boolean scrollVert) ;
60527 extern void
60528 LDispose(ListHandle lHandle) ;
60529 extern short
60530 LAddColumn(
60531   short count,
60532   short colNum,
60533   ListHandle lHandle) ;
60534 extern short
60535 LAddRow(
60536   short count,
60537   short rowNum,
60538   ListHandle lHandle) ;
60539 extern void
60540 LDelColumn(
60541   short count,
60542   short colNum,
60543   ListHandle lHandle) ;
60544 extern void
60545 LDelRow(
60546   short count,
60547   short rowNum,
60548   ListHandle lHandle) ;
60549 extern Boolean
60550 LGetSelect(
60551   Boolean next,
60552   Cell * theCell,
60553   ListHandle lHandle) ;
60554 extern Cell
60555 LLastClick(ListHandle lHandle) ;
60556 extern Boolean
60557 LNextCell(
60558   Boolean hNext,
60559   Boolean vNext,
60560   Cell * theCell,
60561   ListHandle lHandle) ;
60562 extern Boolean
60563 LSearch(
60564   const void * dataPtr,
60565   short dataLen,
60566   ListSearchUPP searchProc,
60567   Cell * theCell,
60568   ListHandle lHandle) ;
60569 extern void
60570 LSize(
60571   short listWidth,
60572   short listHeight,
60573   ListHandle lHandle) ;
60574 extern void
60575 LSetDrawingMode(
60576   Boolean drawIt,
60577   ListHandle lHandle) ;
60578 extern void
60579 LScroll(
60580   short dCols,
60581   short dRows,
60582   ListHandle lHandle) ;
60583 extern void
60584 LAutoScroll(ListHandle lHandle) ;
60585 extern void
60586 LUpdate(
60587   RgnHandle theRgn,
60588   ListHandle lHandle) ;
60589 extern void
60590 LActivate(
60591   Boolean act,
60592   ListHandle lHandle) ;
60593 extern void
60594 LCellSize(
60595   Point cSize,
60596   ListHandle lHandle) ;
60597 extern Boolean
60598 LClick(
60599   Point pt,
60600   EventModifiers modifiers,
60601   ListHandle lHandle) ;
60602 extern void
60603 LAddToCell(
60604   const void * dataPtr,
60605   short dataLen,
60606   Cell theCell,
60607   ListHandle lHandle) ;
60608 extern void
60609 LClrCell(
60610   Cell theCell,
60611   ListHandle lHandle) ;
60612 extern void
60613 LGetCell(
60614   void * dataPtr,
60615   short * dataLen,
60616   Cell theCell,
60617   ListHandle lHandle) ;
60618 extern void
60619 LRect(
60620   Rect * cellRect,
60621   Cell theCell,
60622   ListHandle lHandle) ;
60623 extern void
60624 LSetCell(
60625   const void * dataPtr,
60626   short dataLen,
60627   Cell theCell,
60628   ListHandle lHandle) ;
60629 extern void
60630 LSetSelect(
60631   Boolean setIt,
60632   Cell theCell,
60633   ListHandle lHandle) ;
60634 extern void
60635 LDraw(
60636   Cell theCell,
60637   ListHandle lHandle) ;
60638 extern void
60639 LGetCellDataLocation(
60640   short * offset,
60641   short * len,
60642   Cell theCell,
60643   ListHandle lHandle) ;
60644 extern OSStatus
60645 RegisterListDefinition(
60646   SInt16 inResID,
60647   ListDefSpecPtr inDefSpec) ;
60648 extern Rect *
60649 GetListViewBounds(
60650   ListHandle list,
60651   Rect * view) ;
60652 extern CGrafPtr
60653 GetListPort(ListHandle list) ;
60654 extern Point *
60655 GetListCellIndent(
60656   ListHandle list,
60657   Point * indent) ;
60658 extern Point *
60659 GetListCellSize(
60660   ListHandle list,
60661   Point * size) ;
60662 extern ListBounds *
60663 GetListVisibleCells(
60664   ListHandle list,
60665   ListBounds * visible) ;
60666 extern ControlRef
60667 GetListVerticalScrollBar(ListHandle list) ;
60668 extern ControlRef
60669 GetListHorizontalScrollBar(ListHandle list) ;
60670 extern Boolean
60671 GetListActive(ListHandle list) ;
60672 extern SInt32
60673 GetListClickTime(ListHandle list) ;
60674 extern Point *
60675 GetListClickLocation(
60676   ListHandle list,
60677   Point * click) ;
60678 extern Point *
60679 GetListMouseLocation(
60680   ListHandle list,
60681   Point * mouse) ;
60682 extern ListClickLoopUPP
60683 GetListClickLoop(ListHandle list) ;
60684 extern SInt32
60685 GetListRefCon(ListHandle list) ;
60686 extern Handle
60687 GetListDefinition(ListHandle list) ;
60688 extern Handle
60689 GetListUserHandle(ListHandle list) ;
60690 extern ListBounds *
60691 GetListDataBounds(
60692   ListHandle list,
60693   ListBounds * bounds) ;
60694 extern DataHandle
60695 GetListDataHandle(ListHandle list) ;
60696 extern OptionBits
60697 GetListFlags(ListHandle list) ;
60698 extern OptionBits
60699 GetListSelectionFlags(ListHandle list) ;
60700 extern void
60701 SetListViewBounds(
60702   ListHandle list,
60703   const Rect * view) ;
60704 extern void
60705 SetListPort(
60706   ListHandle list,
60707   CGrafPtr port) ;
60708 extern void
60709 SetListCellIndent(
60710   ListHandle list,
60711   Point * indent) ;
60712 extern void
60713 SetListClickTime(
60714   ListHandle list,
60715   SInt32 time) ;
60716 extern void
60717 SetListClickLoop(
60718   ListHandle list,
60719   ListClickLoopUPP clickLoop) ;
60720 extern void
60721 SetListLastClick(
60722   ListHandle list,
60723   Cell * lastClick) ;
60724 extern void
60725 SetListRefCon(
60726   ListHandle list,
60727   SInt32 refCon) ;
60728 extern void
60729 SetListUserHandle(
60730   ListHandle list,
60731   Handle userHandle) ;
60732 extern void
60733 SetListFlags(
60734   ListHandle list,
60735   OptionBits listFlags) ;
60736 extern void
60737 SetListSelectionFlags(
60738   ListHandle list,
60739   OptionBits selectionFlags) ;
60740
60741
60742 }
60743 extern "C" {
60744
60745
60746
60747
60748
60749 typedef Boolean ( * AEIdleProcPtr)(EventRecord *theEvent, long *sleepTime, RgnHandle *mouseRgn);
60750 typedef Boolean ( * AEFilterProcPtr)(EventRecord *theEvent, long returnID, long transactionID, const AEAddressDesc *sender);
60751 typedef AEIdleProcPtr AEIdleUPP;
60752 typedef AEFilterProcPtr AEFilterUPP;
60753 extern OSErr
60754 AESend(
60755   const AppleEvent * theAppleEvent,
60756   AppleEvent * reply,
60757   AESendMode sendMode,
60758   AESendPriority sendPriority,
60759   long timeOutInTicks,
60760   AEIdleUPP idleProc,
60761   AEFilterUPP filterProc) ;
60762 extern OSErr
60763 AEProcessAppleEvent(const EventRecord * theEventRecord) ;
60764 extern OSErr
60765 AEResetTimer(const AppleEvent * reply) ;
60766 typedef SInt8 AEInteractAllowed;
60767 enum {
60768   kAEInteractWithSelf = 0,
60769   kAEInteractWithLocal = 1,
60770   kAEInteractWithAll = 2
60771 };
60772 extern OSErr
60773 AEGetInteractionAllowed(AEInteractAllowed * level) ;
60774 extern OSErr
60775 AESetInteractionAllowed(AEInteractAllowed level) ;
60776 extern OSErr
60777 AEInteractWithUser(
60778   long timeOutInTicks,
60779   NMRecPtr nmReqPtr,
60780   AEIdleUPP idleProc) ;
60781 extern OSErr
60782 AESuspendTheCurrentEvent(const AppleEvent * theAppleEvent) ;
60783 enum {
60784   kAEDoNotIgnoreHandler = 0x00000000,
60785   kAEIgnoreAppPhacHandler = 0x00000001,
60786   kAEIgnoreAppEventHandler = 0x00000002,
60787   kAEIgnoreSysPhacHandler = 0x00000004,
60788   kAEIgnoreSysEventHandler = 0x00000008,
60789   kAEIngoreBuiltInEventHandler = 0x00000010,
60790   kAEDontDisposeOnResume = (long)0x80000000
60791 };
60792
60793
60794 enum {
60795   kAENoDispatch = 0,
60796   kAEUseStandardDispatch = (long)0xFFFFFFFF
60797 };
60798 extern OSErr
60799 AEResumeTheCurrentEvent(
60800   const AppleEvent * theAppleEvent,
60801   const AppleEvent * reply,
60802   AEEventHandlerUPP dispatcher,
60803   long handlerRefcon) ;
60804 extern OSErr
60805 AEGetTheCurrentEvent(AppleEvent * theAppleEvent) ;
60806 extern OSErr
60807 AESetTheCurrentEvent(const AppleEvent * theAppleEvent) ;
60808 extern AEIdleUPP
60809 NewAEIdleUPP(AEIdleProcPtr userRoutine) ;
60810 extern AEFilterUPP
60811 NewAEFilterUPP(AEFilterProcPtr userRoutine) ;
60812 extern void
60813 DisposeAEIdleUPP(AEIdleUPP userUPP) ;
60814 extern void
60815 DisposeAEFilterUPP(AEFilterUPP userUPP) ;
60816 extern Boolean
60817 InvokeAEIdleUPP(
60818   EventRecord * theEvent,
60819   long * sleepTime,
60820   RgnHandle * mouseRgn,
60821   AEIdleUPP userUPP) ;
60822 extern Boolean
60823 InvokeAEFilterUPP(
60824   EventRecord * theEvent,
60825   long returnID,
60826   long transactionID,
60827   const AEAddressDesc * sender,
60828   AEFilterUPP userUPP) ;
60829
60830
60831
60832
60833
60834
60835 }
60836 extern "C" {
60837
60838
60839
60840 enum {
60841   kTextService = 'tsvc',
60842   kTSMVersion = 0x0150
60843 };
60844
60845
60846
60847
60848
60849
60850 enum {
60851   kKeyboardInputMethodClass = 'inpm',
60852   kInkInputMethodClass = 'ink ',
60853   kCharacterPaletteInputMethodClass = 'cplt'
60854 };
60855
60856 typedef OSType TextServiceClass;
60857 enum {
60858   kTSClassHonorUserSetting = 1,
60859   kTSClassForceSetting = 2,
60860   kTSClassForceToHonorUserSetting = 3
60861 };
60862
60863 typedef UInt32 TSClassEnablingForceLevel;
60864 enum {
60865   kUnicodeDocument = 'udoc',
60866   kUnicodeTextService = 'utsv'
60867 };
60868
60869
60870 enum {
60871   kTSMDocumentPropertySupportGlyphInfo = 'dpgi'
60872 };
60873
60874
60875
60876 enum {
60877   kUnknownLanguage = 0xFFFF,
60878   kUnknownScript = 0xFFFF,
60879   kNeutralScript = 0xFFFF
60880 };
60881
60882
60883 enum {
60884   kTextServiceVersion2 = 'tsv2'
60885 };
60886
60887
60888
60889 enum {
60890   kInteractiveServicesTag = 'tmin',
60891   kLocaleIDTag = 'loce',
60892   kTextInputObjectTag = 'tiot',
60893   kLocaleObjectRefTag = 'lobj',
60894   kLocaleRefTag = 'lref',
60895   kKeyboardInputMethodContextTag = 'kinp',
60896   kKeyboardLocaleObjectRefTag = 'kilo',
60897   kHandwritingInputMethodContextTag = 'hinp',
60898   kHandwritingLocaleObjectRefTag = 'hilo',
60899   kSpeechInputMethodContextTag = 'sinp',
60900   kSpeechLocaleObjectRefTag = 'silo',
60901   kPasswordModeTag = 'pwdm',
60902   kRefconTag = 'refc',
60903   kUseFloatingWindowTag = 'uswm',
60904   kReadOnlyDocumentTag = 'isro',
60905   kSupportsMultiInlineHolesTag = 'minl',
60906   kProtocolVersionTag = 'nprt',
60907   kTSMContextCollectionTag = 'tsmx'
60908 };
60909
60910
60911
60912 enum {
60913   kIMRomanInputMode = 'romn',
60914   kIMPasswordInputMode = 'pasw',
60915   kIMXingInputMode = 'xing',
60916   kIMHuaInputMode = 'huam',
60917   kIMPinyinInputMode = 'piny',
60918   kIMQuweiInputMode = 'quwe',
60919   kIMCangjieInputMode = 'cgji',
60920   kIMJianyiInputMode = 'jnyi',
60921   kIMZhuyinInputMode = 'zhuy',
60922   kIMB5CodeInputMode = 'b5cd',
60923   kIMKatakanaInputMode = 'kata',
60924   kIMHiraganaInputMode = 'hira'
60925 };
60926
60927
60928
60929 enum {
60930   kIM2ByteInputMode = '2byt',
60931   kIM1ByteInputMode = '1byt',
60932   kIMDirectInputMode = 'dinp'
60933 };
60934 enum {
60935   kNeedsInputWindow = 1,
60936   kHandlesUpdateRegion = 2,
60937   kHandlesGetRegion = 3,
60938   kHandlesPos2Offset = 4,
60939   kHandlesOffset2Pos = 5,
60940   kInPasswordMode = 6,
60941   kHandleMultipleHoles = 7,
60942   kDocumentIsReadOnly = 8
60943 };
60944
60945 enum {
60946
60947   bTakeActiveEvent = 15,
60948   bHandleAERecording = 16,
60949   bScriptMask = 0x00007F00,
60950   bLanguageMask = 0x000000FF,
60951   bScriptLanguageMask = bScriptMask + bLanguageMask
60952 };
60953
60954 enum {
60955
60956   kIMJaTypingMethodProperty = 'jtyp',
60957   kIMJaTypingMethodRoman = 'roma',
60958   kIMJaTypingMethodKana = 'kana'
60959 };
60960
60961 enum {
60962
60963   kCMGetScriptLangSupport = 0x0001,
60964   kCMInitiateTextService = 0x0002,
60965   kCMTerminateTextService = 0x0003,
60966   kCMActivateTextService = 0x0004,
60967   kCMDeactivateTextService = 0x0005,
60968   kCMTextServiceEvent = 0x0006,
60969   kCMGetTextServiceMenu = 0x0007,
60970   kCMTextServiceMenuSelect = 0x0008,
60971   kCMFixTextService = 0x0009,
60972   kCMSetTextServiceCursor = 0x000A,
60973   kCMHidePaletteWindows = 0x000B,
60974   kCMGetTextServiceProperty = 0x000C,
60975   kCMSetTextServiceProperty = 0x000D
60976 };
60977
60978 enum {
60979
60980   kCMUCTextServiceEvent = 0x000E
60981 };
60982
60983
60984
60985
60986
60987
60988
60989 typedef struct OpaqueTSMContext* TSMContext;
60990 typedef struct OpaqueTSMDocumentID* TSMDocumentID;
60991 typedef OSType InterfaceTypeList[1];
60992
60993
60994 struct TextServiceInfo {
60995   Component fComponent;
60996   Str255 fItemName;
60997 };
60998 typedef struct TextServiceInfo TextServiceInfo;
60999 typedef TextServiceInfo * TextServiceInfoPtr;
61000 struct TextServiceList {
61001   short fTextServiceCount;
61002   TextServiceInfo fServices[1];
61003 };
61004 typedef struct TextServiceList TextServiceList;
61005 typedef TextServiceList * TextServiceListPtr;
61006 typedef TextServiceListPtr * TextServiceListHandle;
61007 struct ScriptLanguageRecord {
61008   ScriptCode fScript;
61009   LangCode fLanguage;
61010 };
61011 typedef struct ScriptLanguageRecord ScriptLanguageRecord;
61012 struct ScriptLanguageSupport {
61013   short fScriptLanguageCount;
61014   ScriptLanguageRecord fScriptLanguageArray[1];
61015 };
61016 typedef struct ScriptLanguageSupport ScriptLanguageSupport;
61017 typedef ScriptLanguageSupport * ScriptLanguageSupportPtr;
61018 typedef ScriptLanguageSupportPtr * ScriptLanguageSupportHandle;
61019 struct TSMGlyphInfo {
61020   CFRange range;
61021   ATSFontRef fontRef;
61022   UInt16 collection;
61023   UInt16 glyphID;
61024 };
61025 typedef struct TSMGlyphInfo TSMGlyphInfo;
61026 struct TSMGlyphInfoArray {
61027   ItemCount numGlyphInfo;
61028   TSMGlyphInfo glyphInfo[1];
61029 };
61030 typedef struct TSMGlyphInfoArray TSMGlyphInfoArray;
61031 extern OSErr
61032 NewTSMDocument(
61033   short numOfInterface,
61034   InterfaceTypeList supportedInterfaceTypes,
61035   TSMDocumentID * idocID,
61036   long refcon) ;
61037 extern OSErr
61038 DeleteTSMDocument(TSMDocumentID idocID) ;
61039 extern OSErr
61040 ActivateTSMDocument(TSMDocumentID idocID) ;
61041 extern OSErr
61042 DeactivateTSMDocument(TSMDocumentID idocID) ;
61043 extern OSErr
61044 FixTSMDocument(TSMDocumentID idocID) ;
61045 extern OSErr
61046 GetServiceList(
61047   short numOfInterface,
61048   OSType * supportedInterfaceTypes,
61049   TextServiceListHandle * serviceInfo,
61050   long * seedValue) ;
61051 extern OSErr
61052 OpenTextService(
61053   TSMDocumentID idocID,
61054   Component aComponent,
61055   ComponentInstance * aComponentInstance) ;
61056 extern OSErr
61057 CloseTextService(
61058   TSMDocumentID idocID,
61059   ComponentInstance aComponentInstance) ;
61060 extern OSErr
61061 SendAEFromTSMComponent(
61062   const AppleEvent * theAppleEvent,
61063   AppleEvent * reply,
61064   AESendMode sendMode,
61065   AESendPriority sendPriority,
61066   long timeOutInTicks,
61067   AEIdleUPP idleProc,
61068   AEFilterUPP filterProc) ;
61069 extern OSStatus
61070 SendTextInputEvent(EventRef inEvent) ;
61071 extern OSErr
61072 SetDefaultInputMethod(
61073   Component ts,
61074   ScriptLanguageRecord * slRecordPtr) ;
61075 extern OSErr
61076 GetDefaultInputMethod(
61077   Component * ts,
61078   ScriptLanguageRecord * slRecordPtr) ;
61079 extern OSErr
61080 SetTextServiceLanguage(ScriptLanguageRecord * slRecordPtr) ;
61081 extern OSErr
61082 GetTextServiceLanguage(ScriptLanguageRecord * slRecordPtr) ;
61083 extern OSErr
61084 UseInputWindow(
61085   TSMDocumentID idocID,
61086   Boolean useWindow) ;
61087 extern OSStatus
61088 TSMSetInlineInputRegion(
61089   TSMDocumentID inTSMDocument,
61090   WindowRef inWindow,
61091   RgnHandle inRegion) ;
61092 extern ComponentResult
61093 GetScriptLanguageSupport(
61094   ComponentInstance ts,
61095   ScriptLanguageSupportHandle * scriptHdl) ;
61096 extern ComponentResult
61097 InitiateTextService(ComponentInstance ts) ;
61098 extern ComponentResult
61099 TerminateTextService(ComponentInstance ts) ;
61100 extern ComponentResult
61101 ActivateTextService(ComponentInstance ts) ;
61102 extern ComponentResult
61103 DeactivateTextService(ComponentInstance ts) ;
61104 extern ComponentResult
61105 GetTextServiceMenu(
61106   ComponentInstance ts,
61107   MenuRef * serviceMenu) ;
61108 extern ComponentResult
61109 TextServiceEventRef(
61110   ComponentInstance ts,
61111   EventRef event) ;
61112 extern ComponentResult
61113 FixTextService(ComponentInstance ts) ;
61114 extern ComponentResult
61115 HidePaletteWindows(ComponentInstance ts) ;
61116 extern ComponentResult
61117 GetTextServiceProperty(
61118   ComponentInstance ts,
61119   OSType propertySelector,
61120   SInt32 * result) ;
61121 extern ComponentResult
61122 SetTextServiceProperty(
61123   ComponentInstance ts,
61124   OSType propertySelector,
61125   SInt32 value) ;
61126 extern TSMDocumentID
61127 TSMGetActiveDocument(void) ;
61128 extern OSStatus
61129 GetDefaultInputMethodOfClass(
61130   Component * aComp,
61131   ScriptLanguageRecord * slRecPtr,
61132   TextServiceClass tsClass) ;
61133 extern OSStatus
61134 SetDefaultInputMethodOfClass(
61135   Component aComp,
61136   ScriptLanguageRecord * slRecPtr,
61137   TextServiceClass tsClass) ;
61138 extern OSStatus
61139 DeselectTextService(Component aComp) ;
61140 extern OSStatus
61141 SelectTextService(Component aComp) ;
61142 extern OSStatus
61143 TSMSetDocumentProperty(
61144   TSMDocumentID docID,
61145   OSType propertyTag,
61146   UInt32 propertySize,
61147   void * propertyData) ;
61148 extern OSStatus
61149 TSMGetDocumentProperty(
61150   TSMDocumentID docID,
61151   OSType propertyTag,
61152   UInt32 bufferSize,
61153   UInt32 * actualSize,
61154   void * propertyBuffer) ;
61155 extern OSStatus
61156 TSMRemoveDocumentProperty(
61157   TSMDocumentID docID,
61158   OSType propertyTag) ;
61159
61160
61161 }
61162
61163
61164
61165 extern "C" {
61166
61167
61168 typedef FourCharCode ScrapFlavorType;
61169
61170
61171
61172
61173
61174
61175 enum {
61176   kScrapFlavorTypePicture = 'PICT',
61177   kScrapFlavorTypeText = 'TEXT',
61178   kScrapFlavorTypeTextStyle = 'styl',
61179   kScrapFlavorTypeMovie = 'moov',
61180   kScrapFlavorTypeSound = 'snd ',
61181   kScrapFlavorTypeUnicode = 'utxt',
61182   kScrapFlavorTypeUnicodeStyle = 'ustl'
61183 };
61184 extern OSStatus
61185 LoadScrap(void) ;
61186 extern OSStatus
61187 UnloadScrap(void) ;
61188 enum {
61189   kScrapFlavorSizeUnknown = -1
61190 };
61191
61192
61193
61194
61195
61196
61197
61198 enum {
61199   kScrapReservedFlavorType = 'srft'
61200 };
61201 enum {
61202   kScrapFlavorMaskNone = 0x00000000,
61203   kScrapFlavorMaskSenderOnly = 0x00000001,
61204   kScrapFlavorMaskTranslated = 0x00000002
61205 };
61206
61207 typedef UInt32 ScrapFlavorFlags;
61208
61209
61210
61211
61212 struct ScrapFlavorInfo {
61213   ScrapFlavorType flavorType;
61214   ScrapFlavorFlags flavorFlags;
61215 };
61216 typedef struct ScrapFlavorInfo ScrapFlavorInfo;
61217 typedef struct OpaqueScrapRef* ScrapRef;
61218 enum {
61219   kScrapGetNamedScrap = 0,
61220   kScrapClearNamedScrap = (1L << 0)
61221 };
61222 extern OSStatus
61223 GetScrapByName(
61224   CFStringRef name,
61225   OptionBits options,
61226   ScrapRef * scrap) ;
61227 extern OSStatus
61228 GetCurrentScrap(ScrapRef * scrap) ;
61229 extern OSStatus
61230 GetScrapFlavorFlags(
61231   ScrapRef scrap,
61232   ScrapFlavorType flavorType,
61233   ScrapFlavorFlags * flavorFlags) ;
61234 extern OSStatus
61235 GetScrapFlavorSize(
61236   ScrapRef scrap,
61237   ScrapFlavorType flavorType,
61238   Size * byteCount) ;
61239 extern OSStatus
61240 GetScrapFlavorData(
61241   ScrapRef scrap,
61242   ScrapFlavorType flavorType,
61243   Size * byteCount,
61244   void * destination) ;
61245 extern OSStatus
61246 ClearCurrentScrap(void) ;
61247 extern OSStatus
61248 ClearScrap(ScrapRef * inOutScrap) ;
61249 extern OSStatus
61250 PutScrapFlavor(
61251   ScrapRef scrap,
61252   ScrapFlavorType flavorType,
61253   ScrapFlavorFlags flavorFlags,
61254   Size flavorSize,
61255   const void * flavorData) ;
61256 typedef OSStatus ( * ScrapPromiseKeeperProcPtr)(ScrapRef scrap, ScrapFlavorType flavorType, void *userData);
61257 typedef ScrapPromiseKeeperProcPtr ScrapPromiseKeeperUPP;
61258 extern ScrapPromiseKeeperUPP
61259 NewScrapPromiseKeeperUPP(ScrapPromiseKeeperProcPtr userRoutine) ;
61260 extern void
61261 DisposeScrapPromiseKeeperUPP(ScrapPromiseKeeperUPP userUPP) ;
61262 extern OSStatus
61263 InvokeScrapPromiseKeeperUPP(
61264   ScrapRef scrap,
61265   ScrapFlavorType flavorType,
61266   void * userData,
61267   ScrapPromiseKeeperUPP userUPP) ;
61268 extern OSStatus
61269 SetScrapPromiseKeeper(
61270   ScrapRef scrap,
61271   ScrapPromiseKeeperUPP upp,
61272   const void * userData) ;
61273 extern OSStatus
61274 GetScrapFlavorCount(
61275   ScrapRef scrap,
61276   UInt32 * infoCount) ;
61277 extern OSStatus
61278 GetScrapFlavorInfoList(
61279   ScrapRef scrap,
61280   UInt32 * infoCount,
61281   ScrapFlavorInfo info[]) ;
61282 extern OSStatus
61283 CallInScrapPromises(void) ;
61284
61285
61286
61287
61288
61289 }
61290
61291
61292
61293 extern "C" {
61294
61295
61296
61297
61298
61299 typedef struct OpaqueTXNObject* TXNObject;
61300 typedef struct OpaqueTXNFontMenuObject* TXNFontMenuObject;
61301 typedef UInt32 TXNFrameID;
61302 typedef UInt32 TXNVersionValue;
61303 enum {
61304   kTXNWillDefaultToATSUIBit = 0,
61305   kTXNWillDefaultToCarbonEventBit = 1
61306 };
61307
61308
61309 typedef OptionBits TXNFeatureBits;
61310 enum {
61311   kTXNWillDefaultToATSUIMask = 1L << kTXNWillDefaultToATSUIBit,
61312   kTXNWillDefaultToCarbonEventMask = 1L << kTXNWillDefaultToCarbonEventBit
61313 };
61314
61315 enum {
61316   kTXNWantMoviesBit = 0,
61317   kTXNWantSoundBit = 1,
61318   kTXNWantGraphicsBit = 2,
61319   kTXNAlwaysUseQuickDrawTextBit = 3,
61320   kTXNUseTemporaryMemoryBit = 4
61321 };
61322
61323
61324 typedef OptionBits TXNInitOptions;
61325 enum {
61326   kTXNWantMoviesMask = 1L << kTXNWantMoviesBit,
61327   kTXNWantSoundMask = 1L << kTXNWantSoundBit,
61328   kTXNWantGraphicsMask = 1L << kTXNWantGraphicsBit,
61329   kTXNAlwaysUseQuickDrawTextMask = 1L << kTXNAlwaysUseQuickDrawTextBit,
61330   kTXNUseTemporaryMemoryMask = 1L << kTXNUseTemporaryMemoryBit
61331 };
61332
61333 enum {
61334   kTXNDrawGrowIconBit = 0,
61335   kTXNShowWindowBit = 1,
61336   kTXNWantHScrollBarBit = 2,
61337   kTXNWantVScrollBarBit = 3,
61338   kTXNNoTSMEverBit = 4,
61339   kTXNReadOnlyBit = 5,
61340   kTXNNoKeyboardSyncBit = 6,
61341   kTXNNoSelectionBit = 7,
61342   kTXNSaveStylesAsSTYLResourceBit = 8,
61343   kOutputTextInUnicodeEncodingBit = 9,
61344   kTXNDoNotInstallDragProcsBit = 10,
61345   kTXNAlwaysWrapAtViewEdgeBit = 11,
61346   kTXNDontDrawCaretWhenInactiveBit = 12,
61347   kTXNDontDrawSelectionWhenInactiveBit = 13,
61348   kTXNSingleLineOnlyBit = 14,
61349   kTXNDisableDragAndDropBit = 15,
61350   kTXNUseQDforImagingBit = 16,
61351   kTXNMonostyledTextBit = 17
61352 };
61353 typedef OptionBits TXNFrameOptions;
61354 enum {
61355
61356
61357
61358
61359   kTXNDrawGrowIconMask = 1L << kTXNDrawGrowIconBit,
61360
61361
61362
61363
61364
61365
61366
61367   kTXNShowWindowMask = 1L << kTXNShowWindowBit,
61368
61369
61370
61371
61372   kTXNWantHScrollBarMask = 1L << kTXNWantHScrollBarBit,
61373
61374
61375
61376
61377   kTXNWantVScrollBarMask = 1L << kTXNWantVScrollBarBit,
61378
61379
61380
61381
61382
61383   kTXNNoTSMEverMask = 1L << kTXNNoTSMEverBit,
61384
61385
61386
61387
61388   kTXNReadOnlyMask = 1L << kTXNReadOnlyBit,
61389
61390
61391
61392
61393   kTXNNoKeyboardSyncMask = 1L << kTXNNoKeyboardSyncBit,
61394
61395
61396
61397
61398
61399   kTXNNoSelectionMask = 1L << kTXNNoSelectionBit,
61400   kTXNSaveStylesAsSTYLResourceMask = 1L << kTXNSaveStylesAsSTYLResourceBit,
61401
61402
61403
61404
61405   kOutputTextInUnicodeEncodingMask = 1L << kOutputTextInUnicodeEncodingBit,
61406
61407
61408
61409
61410
61411
61412   kTXNDoNotInstallDragProcsMask = 1L << kTXNDoNotInstallDragProcsBit,
61413
61414
61415
61416
61417   kTXNAlwaysWrapAtViewEdgeMask = 1L << kTXNAlwaysWrapAtViewEdgeBit,
61418
61419
61420
61421
61422
61423   kTXNDontDrawCaretWhenInactiveMask = 1L << kTXNDontDrawCaretWhenInactiveBit,
61424
61425
61426
61427
61428
61429   kTXNDontDrawSelectionWhenInactiveMask = 1L << kTXNDontDrawSelectionWhenInactiveBit,
61430
61431
61432
61433
61434
61435
61436
61437   kTXNSingleLineOnlyMask = 1L << kTXNSingleLineOnlyBit,
61438
61439
61440
61441
61442
61443   kTXNDisableDragAndDropMask = 1L << kTXNDisableDragAndDropBit,
61444
61445
61446
61447
61448
61449   kTXNUseQDforImagingMask = 1L << kTXNUseQDforImagingBit,
61450
61451
61452
61453
61454
61455   kTXNMonostyledTextMask = 1L << kTXNMonostyledTextBit
61456 };
61457
61458 enum {
61459   kTXNSetFlushnessBit = 0,
61460   kTXNSetJustificationBit = 1,
61461   kTXNUseFontFallBackBit = 2,
61462   kTXNRotateTextBit = 3,
61463   kTXNUseVerticalTextBit = 4,
61464   kTXNDontUpdateBoxRectBit = 5,
61465   kTXNDontDrawTextBit = 6,
61466   kTXNUseCGContextRefBit = 7,
61467   kTXNImageWithQDBit = 8,
61468   kTXNDontWrapTextBit = 9
61469 };
61470 typedef OptionBits TXNTextBoxOptions;
61471 enum {
61472
61473
61474
61475
61476
61477   kTXNSetFlushnessMask = 1L << kTXNSetFlushnessBit,
61478
61479
61480
61481
61482
61483
61484
61485   kTXNSetJustificationMask = 1L << kTXNSetJustificationBit,
61486
61487
61488
61489
61490
61491   kTXNUseFontFallBackMask = 1L << kTXNUseFontFallBackBit,
61492
61493
61494
61495
61496
61497
61498
61499   kTXNRotateTextMask = 1L << kTXNRotateTextBit,
61500
61501
61502
61503
61504
61505   kTXNUseVerticalTextMask = 1L << kTXNUseVerticalTextBit,
61506   kTXNDontUpdateBoxRectMask = 1L << kTXNDontUpdateBoxRectBit,
61507
61508
61509
61510
61511
61512   kTXNDontDrawTextMask = 1L << kTXNDontDrawTextBit,
61513
61514
61515
61516
61517
61518   kTXNUseCGContextRefMask = 1L << kTXNUseCGContextRefBit,
61519
61520
61521
61522
61523
61524   kTXNImageWithQDMask = 1L << kTXNImageWithQDBit,
61525
61526
61527
61528
61529   kTXNDontWrapTextMask = 1L << kTXNDontWrapTextBit
61530 };
61531
61532 struct TXNTextBoxOptionsData {
61533   TXNTextBoxOptions optionTags;
61534   Fract flushness;
61535   Fract justification;
61536   Fixed rotation;
61537   void * options;
61538 };
61539 typedef struct TXNTextBoxOptionsData TXNTextBoxOptionsData;
61540 enum {
61541   kTXNFontContinuousBit = 0,
61542   kTXNSizeContinuousBit = 1,
61543   kTXNStyleContinuousBit = 2,
61544   kTXNColorContinuousBit = 3
61545 };
61546
61547 typedef OptionBits TXNContinuousFlags;
61548 enum {
61549   kTXNFontContinuousMask = 1L << kTXNFontContinuousBit,
61550   kTXNSizeContinuousMask = 1L << kTXNSizeContinuousBit,
61551   kTXNStyleContinuousMask = 1L << kTXNStyleContinuousBit,
61552   kTXNColorContinuousMask = 1L << kTXNColorContinuousBit
61553 };
61554
61555 enum {
61556   kTXNIgnoreCaseBit = 0,
61557   kTXNEntireWordBit = 1,
61558   kTXNUseEncodingWordRulesBit = 31
61559 };
61560
61561 typedef OptionBits TXNMatchOptions;
61562 enum {
61563   kTXNIgnoreCaseMask = 1L << kTXNIgnoreCaseBit,
61564   kTXNEntireWordMask = 1L << kTXNEntireWordBit,
61565   kTXNUseEncodingWordRulesMask = (unsigned long)(1L << kTXNUseEncodingWordRulesBit)
61566 };
61567
61568
61569 typedef OSType TXNFileType;
61570 enum {
61571   kTXNTextensionFile = 'txtn',
61572   kTXNTextFile = 'TEXT',
61573   kTXNPictureFile = 'PICT',
61574   kTXNMovieFile = 'MooV',
61575   kTXNSoundFile = 'sfil',
61576   kTXNAIFFFile = 'AIFF',
61577   kTXNUnicodeTextFile = 'utxt'
61578 };
61579
61580
61581 typedef UInt32 TXNFrameType;
61582 enum {
61583   kTXNTextEditStyleFrameType = 1,
61584   kTXNPageFrameType = 2,
61585   kTXNMultipleFrameType = 3
61586 };
61587
61588
61589 typedef OSType TXNDataType;
61590 enum {
61591   kTXNTextData = 'TEXT',
61592   kTXNPictureData = 'PICT',
61593   kTXNMovieData = 'moov',
61594   kTXNSoundData = 'snd ',
61595   kTXNUnicodeTextData = 'utxt'
61596 };
61597
61598
61599 typedef FourCharCode TXNControlTag;
61600 enum {
61601   kTXNLineDirectionTag = 'lndr',
61602   kTXNJustificationTag = 'just',
61603   kTXNIOPrivilegesTag = 'iopv',
61604   kTXNSelectionStateTag = 'slst',
61605   kTXNInlineStateTag = 'inst',
61606   kTXNWordWrapStateTag = 'wwrs',
61607   kTXNKeyboardSyncStateTag = 'kbsy',
61608   kTXNAutoIndentStateTag = 'auin',
61609   kTXNTabSettingsTag = 'tabs',
61610   kTXNRefConTag = 'rfcn',
61611   kTXNMarginsTag = 'marg',
61612   kTXNFlattenMoviesTag = 'flat',
61613   kTXNDoFontSubstitution = 'fSub',
61614   kTXNNoUserIOTag = 'nuio',
61615   kTXNUseCarbonEvents = 'cbcb',
61616   kTXNDrawCaretWhenInactiveTag = 'dcrt',
61617   kTXNDrawSelectionWhenInactiveTag = 'dsln',
61618   kTXNDisableDragAndDropTag = 'drag',
61619   kTXNSingleLevelUndoTag = 'undo',
61620   kTXNVisibilityTag = 'visb'
61621 };
61622
61623 typedef UInt32 TXNActionKey;
61624 enum {
61625   kTXNTypingAction = 0,
61626   kTXNCutAction = 1,
61627   kTXNPasteAction = 2,
61628   kTXNClearAction = 3,
61629   kTXNChangeFontAction = 4,
61630   kTXNChangeFontColorAction = 5,
61631   kTXNChangeFontSizeAction = 6,
61632   kTXNChangeStyleAction = 7,
61633   kTXNAlignLeftAction = 8,
61634   kTXNAlignCenterAction = 9,
61635   kTXNAlignRightAction = 10,
61636   kTXNDropAction = 11,
61637   kTXNMoveAction = 12,
61638   kTXNFontFeatureAction = 13,
61639   kTXNFontVariationAction = 14,
61640   kTXNUndoLastAction = 1024
61641 };
61642
61643 enum {
61644   kTXNClearThisControl = (long)0xFFFFFFFF,
61645   kTXNClearTheseFontFeatures = (long)0x80000000
61646 };
61647
61648
61649
61650
61651
61652 enum {
61653   kTXNReadWrite = false,
61654   kTXNReadOnly = true
61655 };
61656
61657
61658 enum {
61659   kTXNSelectionOn = true,
61660   kTXNSelectionOff = false
61661 };
61662
61663
61664 enum {
61665   kTXNUseInline = false,
61666   kTXNUseBottomline = true
61667 };
61668
61669
61670
61671 enum {
61672   kTXNAutoWrap = false,
61673   kTXNNoAutoWrap = true
61674 };
61675
61676
61677 enum {
61678   kTXNSyncKeyboard = false,
61679   kTXNNoSyncKeyboard = true
61680 };
61681
61682
61683 enum {
61684   kTXNAutoIndentOff = false,
61685   kTXNAutoIndentOn = true
61686 };
61687
61688
61689 enum {
61690   kTXNDontDrawCaretWhenInactive = false,
61691   kTXNDrawCaretWhenInactive = true
61692 };
61693
61694
61695 enum {
61696   kTXNDontDrawSelectionWhenInactive = false,
61697   kTXNDrawSelectionWhenInactive = true
61698 };
61699
61700
61701 enum {
61702   kTXNEnableDragAndDrop = false,
61703   kTXNDisableDragAndDrop = true
61704 };
61705
61706 typedef SInt8 TXNTabType;
61707 enum {
61708   kTXNRightTab = -1,
61709   kTXNLeftTab = 0,
61710   kTXNCenterTab = 1
61711 };
61712
61713 struct TXNTab {
61714   SInt16 value;
61715   TXNTabType tabType;
61716   UInt8 filler;
61717 };
61718 typedef struct TXNTab TXNTab;
61719 enum {
61720   kTXNLeftToRight = 0,
61721   kTXNRightToLeft = 1
61722 };
61723
61724 enum {
61725   kTXNFlushDefault = 0,
61726   kTXNFlushLeft = 1,
61727   kTXNFlushRight = 2,
61728   kTXNCenter = 4,
61729   kTXNFullJust = 8,
61730   kTXNForceFullJust = 16
61731 };
61732
61733
61734
61735
61736
61737 struct TXNMargins {
61738   SInt16 topMargin;
61739   SInt16 leftMargin;
61740   SInt16 bottomMargin;
61741   SInt16 rightMargin;
61742 };
61743 typedef struct TXNMargins TXNMargins;
61744 union TXNControlData {
61745   UInt32 uValue;
61746   SInt32 sValue;
61747   TXNTab tabValue;
61748   TXNMargins * marginsPtr;
61749 };
61750 typedef union TXNControlData TXNControlData;
61751 typedef Boolean TXNScrollBarState;
61752 enum {
61753   kScrollBarsAlwaysActive = true,
61754   kScrollBarsSyncWithFocus = false
61755 };
61756
61757
61758
61759
61760
61761 enum {
61762   kTXNDontCareTypeSize = (long)0xFFFFFFFF,
61763   kTXNDontCareTypeStyle = 0xFF,
61764   kTXNIncrementTypeSize = 0x00000001,
61765   kTXNDecrementTypeSize = (long)0x80000000,
61766   kTXNUseScriptDefaultValue = -1,
61767   kTXNNoFontVariations = 0x7FFF
61768 };
61769
61770 typedef UInt32 TXNOffset;
61771 enum {
61772   kTXNUseCurrentSelection = (unsigned long)0xFFFFFFFF,
61773   kTXNStartOffset = 0,
61774   kTXNEndOffset = 0x7FFFFFFF
61775 };
61776
61777
61778 enum {
61779   kTXNSingleStylePerTextDocumentResType = 'MPSR',
61780   kTXNMultipleStylesPerTextDocumentResType = 'styl'
61781 };
61782
61783
61784 typedef void * TXNObjectRefcon;
61785
61786 enum {
61787   kTXNShowStart = false,
61788   kTXNShowEnd = true
61789 };
61790
61791 typedef OSStatus TXNErrors;
61792
61793
61794 enum {
61795   kTXNDefaultFontSize = 0x000C0000
61796 };
61797
61798 enum {
61799   kTXNDefaultFontStyle = normal
61800 };
61801
61802
61803 typedef UInt32 TXNHyperLinkState;
61804 enum {
61805   kTXNLinkNotPressed = 0,
61806   kTXNLinkWasPressed = 1,
61807   kTXNLinkTracking = 3
61808 };
61809
61810 typedef FourCharCode TXNTypeRunAttributes;
61811 enum {
61812   kTXNQDFontNameAttribute = 'fntn',
61813   kTXNQDFontFamilyIDAttribute = 'font',
61814   kTXNQDFontSizeAttribute = 'size',
61815   kTXNQDFontStyleAttribute = 'face',
61816   kTXNQDFontColorAttribute = 'klor',
61817   kTXNTextEncodingAttribute = 'encd',
61818   kTXNATSUIFontFeaturesAttribute = 'atfe',
61819   kTXNATSUIFontVariationsAttribute = 'atva',
61820   kTXNURLAttribute = 'urla'
61821 };
61822
61823
61824
61825
61826
61827
61828 typedef ByteCount TXNTypeRunAttributeSizes;
61829 enum {
61830   kTXNQDFontNameAttributeSize = sizeof(Str255),
61831   kTXNQDFontFamilyIDAttributeSize = sizeof(SInt16),
61832   kTXNQDFontSizeAttributeSize = sizeof(SInt16),
61833   kTXNQDFontStyleAttributeSize = sizeof(Style),
61834   kTXNQDFontColorAttributeSize = sizeof(RGBColor),
61835   kTXNTextEncodingAttributeSize = sizeof(TextEncoding),
61836   kTXNFontSizeAttributeSize = sizeof(Fixed)
61837 };
61838
61839 typedef UInt32 TXNPermanentTextEncodingType;
61840 enum {
61841   kTXNSystemDefaultEncoding = 0,
61842   kTXNMacOSEncoding = 1,
61843   kTXNUnicodeEncoding = 2
61844 };
61845
61846
61847
61848 typedef FourCharCode TXTNTag;
61849 struct TXNATSUIFeatures {
61850   ItemCount featureCount;
61851   ATSUFontFeatureType * featureTypes;
61852   ATSUFontFeatureSelector * featureSelectors;
61853 };
61854 typedef struct TXNATSUIFeatures TXNATSUIFeatures;
61855 struct TXNATSUIVariations {
61856   ItemCount variationCount;
61857   ATSUFontVariationAxis * variationAxis;
61858   ATSUFontVariationValue * variationValues;
61859 };
61860 typedef struct TXNATSUIVariations TXNATSUIVariations;
61861 union TXNAttributeData {
61862   void * dataPtr;
61863   UInt32 dataValue;
61864   TXNATSUIFeatures * atsuFeatures;
61865   TXNATSUIVariations * atsuVariations;
61866   CFURLRef urlReference;
61867 };
61868 typedef union TXNAttributeData TXNAttributeData;
61869 struct TXNTypeAttributes {
61870   TXTNTag tag;
61871   ByteCount size;
61872   TXNAttributeData data;
61873 };
61874 typedef struct TXNTypeAttributes TXNTypeAttributes;
61875 struct TXNMacOSPreferredFontDescription {
61876   UInt32 fontID;
61877   Fixed pointSize;
61878   TextEncoding encoding;
61879   Style fontStyle;
61880 };
61881 typedef struct TXNMacOSPreferredFontDescription TXNMacOSPreferredFontDescription;
61882 struct TXNMatchTextRecord {
61883   const void * iTextPtr;
61884   SInt32 iTextToMatchLength;
61885   TextEncoding iTextEncoding;
61886 };
61887 typedef struct TXNMatchTextRecord TXNMatchTextRecord;
61888
61889 typedef UInt32 TXNBackgroundType;
61890 enum {
61891   kTXNBackgroundTypeRGB = 1
61892 };
61893
61894
61895
61896
61897
61898 union TXNBackgroundData {
61899   RGBColor color;
61900 };
61901 typedef union TXNBackgroundData TXNBackgroundData;
61902 struct TXNBackground {
61903   TXNBackgroundType bgType;
61904   TXNBackgroundData bg;
61905 };
61906 typedef struct TXNBackground TXNBackground;
61907 struct TXNLongRect {
61908   SInt32 top;
61909   SInt32 left;
61910   SInt32 bottom;
61911   SInt32 right;
61912 };
61913 typedef struct TXNLongRect TXNLongRect;
61914
61915
61916
61917
61918 enum {
61919   kTXNTextInputCountBit = 0,
61920   kTXNRunCountBit = 1
61921 };
61922
61923 typedef OptionBits TXNCountOptions;
61924 enum {
61925   kTXNTextInputCountMask = 1L << kTXNTextInputCountBit,
61926   kTXNRunCountMask = 1L << kTXNRunCountBit,
61927   kTXNAllCountMask = kTXNTextInputCountMask | kTXNRunCountMask
61928 };
61929
61930
61931 typedef UInt32 TXNScrollUnit;
61932 enum {
61933   kTXNScrollUnitsInPixels = 0,
61934   kTXNScrollUnitsInLines = 1,
61935   kTXNScrollUnitsInViewRects = 2
61936 };
61937
61938 typedef UInt32 TXNScrollBarOrientation;
61939 enum {
61940   kTXNHorizontal = 0,
61941   kTXNVertical = 1
61942 };
61943
61944 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);
61945 typedef CFStringRef ( * TXNActionKeyMapperProcPtr)(TXNActionKey actionKey, UInt32 commandID);
61946
61947 typedef void ( * TXNScrollInfoProcPtr)(SInt32 iValue, SInt32 iMaximumValue, TXNScrollBarOrientation iScrollBarOrientation, SInt32 iRefCon);
61948 typedef TXNFindProcPtr TXNFindUPP;
61949 typedef TXNActionKeyMapperProcPtr TXNActionKeyMapperUPP;
61950 typedef TXNScrollInfoProcPtr TXNScrollInfoUPP;
61951 extern TXNFindUPP
61952 NewTXNFindUPP(TXNFindProcPtr userRoutine) ;
61953 extern TXNActionKeyMapperUPP
61954 NewTXNActionKeyMapperUPP(TXNActionKeyMapperProcPtr userRoutine) ;
61955 extern TXNScrollInfoUPP
61956 NewTXNScrollInfoUPP(TXNScrollInfoProcPtr userRoutine) ;
61957 extern void
61958 DisposeTXNFindUPP(TXNFindUPP userUPP) ;
61959 extern void
61960 DisposeTXNActionKeyMapperUPP(TXNActionKeyMapperUPP userUPP) ;
61961 extern void
61962 DisposeTXNScrollInfoUPP(TXNScrollInfoUPP userUPP) ;
61963 extern OSStatus
61964 InvokeTXNFindUPP(
61965   const TXNMatchTextRecord * matchData,
61966   TXNDataType iDataType,
61967   TXNMatchOptions iMatchOptions,
61968   const void * iSearchTextPtr,
61969   TextEncoding encoding,
61970   TXNOffset absStartOffset,
61971   ByteCount searchTextLength,
61972   TXNOffset * oStartMatch,
61973   TXNOffset * oEndMatch,
61974   Boolean * ofound,
61975   UInt32 refCon,
61976   TXNFindUPP userUPP) ;
61977 extern CFStringRef
61978 InvokeTXNActionKeyMapperUPP(
61979   TXNActionKey actionKey,
61980   UInt32 commandID,
61981   TXNActionKeyMapperUPP userUPP) ;
61982 extern void
61983 InvokeTXNScrollInfoUPP(
61984   SInt32 iValue,
61985   SInt32 iMaximumValue,
61986   TXNScrollBarOrientation iScrollBarOrientation,
61987   SInt32 iRefCon,
61988   TXNScrollInfoUPP userUPP) ;
61989 enum {
61990   kTXNNoAppleEventHandlersBit = 0,
61991   kTXNRestartAppleEventHandlersBit = 1
61992 };
61993
61994 enum {
61995   kTXNNoAppleEventHandlersMask = 1 << kTXNNoAppleEventHandlersBit,
61996   kTXNRestartAppleEventHandlersMask = 1 << kTXNRestartAppleEventHandlersBit
61997 };
61998 struct TXNCarbonEventInfo {
61999   Boolean useCarbonEvents;
62000   UInt8 filler;
62001   UInt16 flags;
62002   CFDictionaryRef fDictionary;
62003 };
62004 typedef struct TXNCarbonEventInfo TXNCarbonEventInfo;
62005 extern OSStatus
62006 TXNNewObject(
62007   const FSSpec * iFileSpec,
62008   WindowRef iWindow,
62009   const Rect * iFrame,
62010   TXNFrameOptions iFrameOptions,
62011   TXNFrameType iFrameType,
62012   TXNFileType iFileType,
62013   TXNPermanentTextEncodingType iPermanentEncoding,
62014   TXNObject * oTXNObject,
62015   TXNFrameID * oTXNFrameID,
62016   TXNObjectRefcon iRefCon) ;
62017 extern void
62018 TXNDeleteObject(TXNObject iTXNObject) ;
62019 extern void
62020 TXNResizeFrame(
62021   TXNObject iTXNObject,
62022   UInt32 iWidth,
62023   UInt32 iHeight,
62024   TXNFrameID iTXNFrameID) ;
62025 extern void
62026 TXNSetFrameBounds(
62027   TXNObject iTXNObject,
62028   SInt32 iTop,
62029   SInt32 iLeft,
62030   SInt32 iBottom,
62031   SInt32 iRight,
62032   TXNFrameID iTXNFrameID) ;
62033 extern OSStatus
62034 TXNInitTextension(
62035   const TXNMacOSPreferredFontDescription iDefaultFonts[],
62036   ItemCount iCountDefaultFonts,
62037   TXNInitOptions iUsageFlags) ;
62038 extern void
62039 TXNTerminateTextension(void) ;
62040 extern void
62041 TXNKeyDown(
62042   TXNObject iTXNObject,
62043   const EventRecord * iEvent) ;
62044 extern void
62045 TXNAdjustCursor(
62046   TXNObject iTXNObject,
62047   RgnHandle ioCursorRgn) ;
62048 extern void
62049 TXNClick(
62050   TXNObject iTXNObject,
62051   const EventRecord * iEvent) ;
62052 extern void
62053 TXNSelectAll(TXNObject iTXNObject) ;
62054 extern void
62055 TXNFocus(
62056   TXNObject iTXNObject,
62057   Boolean iBecomingFocused) ;
62058 extern void
62059 TXNUpdate(TXNObject iTXNObject) ;
62060 extern void
62061 TXNDraw(
62062   TXNObject iTXNObject,
62063   GWorldPtr iDrawPort) ;
62064 extern void
62065 TXNForceUpdate(TXNObject iTXNObject) ;
62066 extern UInt32
62067 TXNGetSleepTicks(TXNObject iTXNObject) ;
62068 extern void
62069 TXNIdle(TXNObject iTXNObject) ;
62070 extern void
62071 TXNGrowWindow(
62072   TXNObject iTXNObject,
62073   const EventRecord * iEvent) ;
62074 extern void
62075 TXNZoomWindow(
62076   TXNObject iTXNObject,
62077   SInt16 iPart) ;
62078 extern Boolean
62079 TXNCanUndo(
62080   TXNObject iTXNObject,
62081   TXNActionKey * oTXNActionKey) ;
62082 extern void
62083 TXNUndo(TXNObject iTXNObject) ;
62084 extern Boolean
62085 TXNCanRedo(
62086   TXNObject iTXNObject,
62087   TXNActionKey * oTXNActionKey) ;
62088 extern void
62089 TXNRedo(TXNObject iTXNObject) ;
62090 extern OSStatus
62091 TXNCut(TXNObject iTXNObject) ;
62092 extern OSStatus
62093 TXNCopy(TXNObject iTXNObject) ;
62094 extern OSStatus
62095 TXNPaste(TXNObject iTXNObject) ;
62096 extern OSStatus
62097 TXNClear(TXNObject iTXNObject) ;
62098 extern void
62099 TXNGetSelection(
62100   TXNObject iTXNObject,
62101   TXNOffset * oStartOffset,
62102   TXNOffset * oEndOffset) ;
62103 extern void
62104 TXNShowSelection(
62105   TXNObject iTXNObject,
62106   Boolean iShowEnd) ;
62107 extern Boolean
62108 TXNIsSelectionEmpty(TXNObject iTXNObject) ;
62109 extern OSStatus
62110 TXNSetSelection(
62111   TXNObject iTXNObject,
62112   TXNOffset iStartOffset,
62113   TXNOffset iEndOffset) ;
62114 extern OSStatus
62115 TXNGetContinuousTypeAttributes(
62116   TXNObject iTxnObject,
62117   TXNContinuousFlags * oContinuousFlags,
62118   ItemCount iCount,
62119   TXNTypeAttributes ioTypeAttributes[]) ;
62120 extern OSStatus
62121 TXNSetTypeAttributes(
62122   TXNObject iTXNObject,
62123   ItemCount iAttrCount,
62124   const TXNTypeAttributes iAttributes[],
62125   TXNOffset iStartOffset,
62126   TXNOffset iEndOffset) ;
62127 extern OSStatus
62128 TXNSetTXNObjectControls(
62129   TXNObject iTXNObject,
62130   Boolean iClearAll,
62131   ItemCount iControlCount,
62132   const TXNControlTag iControlTags[],
62133   const TXNControlData iControlData[]) ;
62134 extern OSStatus
62135 TXNGetTXNObjectControls(
62136   TXNObject iTXNObject,
62137   ItemCount iControlCount,
62138   const TXNControlTag iControlTags[],
62139   TXNControlData oControlData[]) ;
62140 extern OSStatus
62141 TXNCountRunsInRange(
62142   TXNObject iTXNObject,
62143   TXNOffset iStartOffset,
62144   TXNOffset iEndOffset,
62145   ItemCount * oRunCount) ;
62146 extern OSStatus
62147 TXNGetIndexedRunInfoFromRange(
62148   TXNObject iTXNObject,
62149   ItemCount iIndex,
62150   TXNOffset iStartOffset,
62151   TXNOffset iEndOffset,
62152   TXNOffset * oRunStartOffset,
62153   TXNOffset * oRunEndOffset,
62154   TXNDataType * oRunDataType,
62155   ItemCount iTypeAttributeCount,
62156   TXNTypeAttributes * ioTypeAttributes) ;
62157 extern ByteCount
62158 TXNDataSize(TXNObject iTXNObject) ;
62159 extern OSStatus
62160 TXNGetData(
62161   TXNObject iTXNObject,
62162   TXNOffset iStartOffset,
62163   TXNOffset iEndOffset,
62164   Handle * oDataHandle) ;
62165 extern OSStatus
62166 TXNGetDataEncoded(
62167   TXNObject iTXNObject,
62168   TXNOffset iStartOffset,
62169   TXNOffset iEndOffset,
62170   Handle * oDataHandle,
62171   TXNDataType iEncoding) ;
62172 extern OSStatus
62173 TXNSetDataFromFile(
62174   TXNObject iTXNObject,
62175   SInt16 iFileRefNum,
62176   OSType iFileType,
62177   ByteCount iFileLength,
62178   TXNOffset iStartOffset,
62179   TXNOffset iEndOffset) ;
62180 extern OSStatus
62181 TXNSetData(
62182   TXNObject iTXNObject,
62183   TXNDataType iDataType,
62184   const void * iDataPtr,
62185   ByteCount iDataSize,
62186   TXNOffset iStartOffset,
62187   TXNOffset iEndOffset) ;
62188 extern ItemCount
62189 TXNGetChangeCount(TXNObject iTXNObject) ;
62190 extern OSStatus
62191 TXNSave(
62192   TXNObject iTXNObject,
62193   TXNFileType iType,
62194   OSType iResType,
62195   TXNPermanentTextEncodingType iPermanentEncoding,
62196   const FSSpec * iFileSpecification,
62197   SInt16 iDataReference,
62198   SInt16 iResourceReference) ;
62199 extern OSStatus
62200 TXNRevert(TXNObject iTXNObject) ;
62201 extern OSStatus
62202 TXNPageSetup(TXNObject iTXNObject) ;
62203 extern OSStatus
62204 TXNPrint(TXNObject iTXNObject) ;
62205 extern Boolean
62206 TXNIsScrapPastable(void) ;
62207 extern OSStatus
62208 TXNConvertToPublicScrap(void) ;
62209 extern OSStatus
62210 TXNConvertFromPublicScrap(void) ;
62211 extern void
62212 TXNGetViewRect(
62213   TXNObject iTXNObject,
62214   Rect * oViewRect) ;
62215 extern void
62216 TXNSetViewRect(
62217   TXNObject iTXNObject,
62218   const Rect * iViewRect) ;
62219 extern OSStatus
62220 TXNFind(
62221   TXNObject iTXNObject,
62222   const TXNMatchTextRecord * iMatchTextDataPtr,
62223   TXNDataType iDataType,
62224   TXNMatchOptions iMatchOptions,
62225   TXNOffset iStartSearchOffset,
62226   TXNOffset iEndSearchOffset,
62227   TXNFindUPP iFindProc,
62228   SInt32 iRefCon,
62229   TXNOffset * oStartMatchOffset,
62230   TXNOffset * oEndMatchOffset) ;
62231 extern OSStatus
62232 TXNSetFontDefaults(
62233   TXNObject iTXNObject,
62234   ItemCount iCount,
62235   const TXNMacOSPreferredFontDescription iFontDefaults[]) ;
62236 extern OSStatus
62237 TXNGetFontDefaults(
62238   TXNObject iTXNObject,
62239   ItemCount * ioCount,
62240   TXNMacOSPreferredFontDescription ioFontDefaults[]) ;
62241 extern OSStatus
62242 TXNAttachObjectToWindow(
62243   TXNObject iTXNObject,
62244   GWorldPtr iWindow,
62245   Boolean iIsActualWindow) ;
62246 extern Boolean
62247 TXNIsObjectAttachedToWindow(TXNObject iTXNObject) ;
62248 extern OSErr
62249 TXNDragTracker(
62250   TXNObject iTXNObject,
62251   TXNFrameID iTXNFrameID,
62252   DragTrackingMessage iMessage,
62253   WindowRef iWindow,
62254   DragReference iDragReference,
62255   Boolean iDifferentObjectSameWindow) ;
62256 extern OSErr
62257 TXNDragReceiver(
62258   TXNObject iTXNObject,
62259   TXNFrameID iTXNFrameID,
62260   WindowRef iWindow,
62261   DragReference iDragReference,
62262   Boolean iDifferentObjectSameWindow) ;
62263 extern OSStatus
62264 TXNActivate(
62265   TXNObject iTXNObject,
62266   TXNFrameID iTXNFrameID,
62267   TXNScrollBarState iActiveState) ;
62268 extern OSStatus
62269 TXNSetBackground(
62270   TXNObject iTXNObject,
62271   const TXNBackground * iBackgroundInfo) ;
62272 extern OSStatus
62273 TXNEchoMode(
62274   TXNObject iTXNObject,
62275   UniChar iEchoCharacter,
62276   TextEncoding iEncoding,
62277   Boolean iOn) ;
62278 extern OSStatus
62279 TXNNewFontMenuObject(
62280   MenuRef iFontMenuHandle,
62281   SInt16 iMenuID,
62282   SInt16 iStartHierMenuID,
62283   TXNFontMenuObject * oTXNFontMenuObject) ;
62284 extern OSStatus
62285 TXNGetFontMenuHandle(
62286   TXNFontMenuObject iTXNFontMenuObject,
62287   MenuRef * oFontMenuHandle) ;
62288 extern OSStatus
62289 TXNDisposeFontMenuObject(TXNFontMenuObject iTXNFontMenuObject) ;
62290 extern OSStatus
62291 TXNDoFontMenuSelection(
62292   TXNObject iTXNObject,
62293   TXNFontMenuObject iTXNFontMenuObject,
62294   SInt16 iMenuID,
62295   SInt16 iMenuItem) ;
62296 extern OSStatus
62297 TXNPrepareFontMenu(
62298   TXNObject iTXNObject,
62299   TXNFontMenuObject iTXNFontMenuObject) ;
62300 extern TXNVersionValue
62301 TXNVersionInformation(TXNFeatureBits * oFeatureFlags) ;
62302 extern OSStatus
62303 TXNPointToOffset(
62304   TXNObject iTXNObject,
62305   Point iPoint,
62306   TXNOffset * oOffset) ;
62307 extern OSStatus
62308 TXNOffsetToPoint(
62309   TXNObject iTXNObject,
62310   TXNOffset iOffset,
62311   Point * oPoint) ;
62312 extern OSStatus
62313 TXNDrawUnicodeTextBox(
62314   const UniChar iText[],
62315   UniCharCount iLen,
62316   Rect * ioBox,
62317   ATSUStyle iStyle,
62318   const TXNTextBoxOptionsData * iOptions) ;
62319 extern OSStatus
62320 TXNDrawCFStringTextBox(
62321   CFStringRef iText,
62322   Rect * ioBox,
62323   ATSUStyle iStyle,
62324   const TXNTextBoxOptionsData * iOptions) ;
62325 extern OSStatus
62326 TXNGetLineCount(
62327   TXNObject iTXNObject,
62328   ItemCount * oLineTotal) ;
62329 extern OSStatus
62330 TXNGetLineMetrics(
62331   TXNObject iTXNObject,
62332   UInt32 iLineNumber,
62333   Fixed * oLineWidth,
62334   Fixed * oLineHeight) ;
62335 extern OSStatus
62336 TXNGetActionChangeCount(
62337   TXNObject iTXNObject,
62338   TXNCountOptions iOptions,
62339   ItemCount * oCount) ;
62340 extern OSStatus
62341 TXNClearActionChangeCount(
62342   TXNObject iTXNObject,
62343   TXNCountOptions iOptions) ;
62344 extern OSStatus
62345 TXNIsObjectAttachedToSpecificWindow(
62346   TXNObject iTXNObject,
62347   WindowRef iWindow,
62348   Boolean * oAttached) ;
62349 extern void
62350 TXNSetRectBounds(
62351   TXNObject iTXNObject,
62352   const Rect * iViewRect,
62353   const TXNLongRect * iDestinationRect,
62354   Boolean iUpdate) ;
62355 extern OSStatus
62356 TXNGetRectBounds(
62357   TXNObject iTXNObject,
62358   Rect * oViewRect,
62359   TXNLongRect * oDestinationRect,
62360   TXNLongRect * oTextRect) ;
62361 extern void
62362 TXNRecalcTextLayout(TXNObject iTXNObject) ;
62363 extern OSStatus
62364 TXNScroll(
62365   TXNObject iTXNObject,
62366   TXNScrollUnit iVerticalScrollUnit,
62367   TXNScrollUnit iHorizontalScrollUnit,
62368   SInt32 * ioVerticalDelta,
62369   SInt32 * ioHorizontalDelta) ;
62370 extern void
62371 TXNRegisterScrollInfoProc(
62372   TXNObject iTXNObject,
62373   TXNScrollInfoUPP iTXNScrollInfoUPP,
62374   SInt32 iRefCon) ;
62375 extern OSStatus
62376 TXNClearUndo(TXNObject iTXNObject) ;
62377
62378
62379
62380
62381
62382 }
62383
62384
62385
62386 extern "C" {
62387
62388
62389
62390
62391
62392
62393 enum {
62394   kMacHelpVersion = 0x0003
62395 };
62396
62397 typedef SInt16 HMContentRequest;
62398 enum {
62399   kHMSupplyContent = 0,
62400   kHMDisposeContent = 1
62401 };
62402
62403 typedef UInt32 HMContentType;
62404 enum {
62405   kHMNoContent = 'none',
62406   kHMCFStringContent = 'cfst',
62407   kHMCFStringLocalizedContent = 'cfsl',
62408   kHMPascalStrContent = 'pstr',
62409   kHMStringResContent = 'str#',
62410   kHMTEHandleContent = 'txth',
62411   kHMTextResContent = 'text',
62412   kHMStrResContent = 'str '
62413 };
62414 typedef SInt16 HMTagDisplaySide;
62415 enum {
62416
62417
62418
62419
62420   kHMDefaultSide = 0,
62421
62422
62423
62424
62425   kHMOutsideTopScriptAligned = 1,
62426
62427
62428
62429
62430   kHMOutsideLeftCenterAligned = 2,
62431   kHMOutsideBottomScriptAligned = 3,
62432
62433
62434
62435
62436   kHMOutsideRightCenterAligned = 4,
62437
62438
62439
62440
62441   kHMOutsideTopLeftAligned = 5,
62442
62443
62444
62445
62446   kHMOutsideTopRightAligned = 6,
62447
62448
62449
62450
62451   kHMOutsideLeftTopAligned = 7,
62452
62453
62454
62455
62456   kHMOutsideLeftBottomAligned = 8,
62457
62458
62459
62460
62461   kHMOutsideBottomLeftAligned = 9,
62462
62463
62464
62465
62466   kHMOutsideBottomRightAligned = 10,
62467   kHMOutsideRightTopAligned = 11,
62468   kHMOutsideRightBottomAligned = 12,
62469
62470
62471
62472
62473   kHMOutsideTopCenterAligned = 13,
62474
62475
62476
62477
62478   kHMOutsideBottomCenterAligned = 14,
62479
62480
62481
62482
62483   kHMInsideRightCenterAligned = 15,
62484
62485
62486
62487
62488   kHMInsideLeftCenterAligned = 16,
62489
62490
62491
62492
62493   kHMInsideBottomCenterAligned = 17,
62494
62495
62496
62497
62498   kHMInsideTopCenterAligned = 18,
62499
62500
62501
62502
62503   kHMInsideTopLeftCorner = 19,
62504
62505
62506
62507
62508   kHMInsideTopRightCorner = 20,
62509
62510
62511
62512
62513   kHMInsideBottomLeftCorner = 21,
62514
62515
62516
62517
62518   kHMInsideBottomRightCorner = 22,
62519
62520
62521
62522
62523   kHMAbsoluteCenterAligned = 23
62524 };
62525
62526
62527 enum {
62528   kHMTopSide = kHMOutsideTopScriptAligned,
62529   kHMLeftSide = kHMOutsideLeftCenterAligned,
62530   kHMBottomSide = kHMOutsideBottomScriptAligned,
62531   kHMRightSide = kHMOutsideRightCenterAligned,
62532   kHMTopLeftCorner = kHMOutsideTopLeftAligned,
62533   kHMTopRightCorner = kHMOutsideTopRightAligned,
62534   kHMLeftTopCorner = kHMOutsideLeftTopAligned,
62535   kHMLeftBottomCorner = kHMOutsideLeftBottomAligned,
62536   kHMBottomLeftCorner = kHMOutsideBottomLeftAligned,
62537   kHMBottomRightCorner = kHMOutsideBottomRightAligned,
62538   kHMRightTopCorner = kHMOutsideRightTopAligned,
62539   kHMRightBottomCorner = kHMOutsideRightBottomAligned
62540 };
62541
62542 typedef SInt16 HMContentProvidedType;
62543 enum {
62544   kHMContentProvided = 0,
62545   kHMContentNotProvided = 1,
62546   kHMContentNotProvidedDontPropagate = 2
62547 };
62548
62549 enum {
62550   kHMMinimumContentIndex = 0,
62551   kHMMaximumContentIndex = 1
62552 };
62553
62554 enum {
62555   errHMIllegalContentForMinimumState = -10980,
62556   errHMIllegalContentForMaximumState = -10981
62557 };
62558
62559
62560 enum {
62561   kHMIllegalContentForMinimumState = errHMIllegalContentForMinimumState
62562 };
62563
62564 enum {
62565   kHelpTagEventHandlerTag = 'hevt'
62566 };
62567
62568 struct HMHelpContent {
62569   HMContentType contentType;
62570   union {
62571     CFStringRef tagCFString;
62572     Str255 tagString;
62573     HMStringResType tagStringRes;
62574     TEHandle tagTEHandle;
62575     SInt16 tagTextRes;
62576     SInt16 tagStrRes;
62577   } u;
62578 };
62579 typedef struct HMHelpContent HMHelpContent;
62580 struct HMHelpContentRec {
62581   SInt32 version;
62582   Rect absHotRect;
62583   HMTagDisplaySide tagSide;
62584   HMHelpContent content[2];
62585 };
62586 typedef struct HMHelpContentRec HMHelpContentRec;
62587 typedef HMHelpContentRec * HMHelpContentPtr;
62588
62589
62590
62591 typedef OSStatus ( * HMControlContentProcPtr)(ControlRef inControl, Point inGlobalMouse, HMContentRequest inRequest, HMContentProvidedType *outContentProvided, HMHelpContentPtr ioHelpContent);
62592 typedef OSStatus ( * HMWindowContentProcPtr)(WindowRef inWindow, Point inGlobalMouse, HMContentRequest inRequest, HMContentProvidedType *outContentProvided, HMHelpContentPtr ioHelpContent);
62593 typedef OSStatus ( * HMMenuTitleContentProcPtr)(MenuRef inMenu, HMContentRequest inRequest, HMContentProvidedType *outContentProvided, HMHelpContentPtr ioHelpContent);
62594 typedef OSStatus ( * HMMenuItemContentProcPtr)(const MenuTrackingData *inTrackingData, HMContentRequest inRequest, HMContentProvidedType *outContentProvided, HMHelpContentPtr ioHelpContent);
62595 typedef HMControlContentProcPtr HMControlContentUPP;
62596 typedef HMWindowContentProcPtr HMWindowContentUPP;
62597 typedef HMMenuTitleContentProcPtr HMMenuTitleContentUPP;
62598 typedef HMMenuItemContentProcPtr HMMenuItemContentUPP;
62599 extern HMControlContentUPP
62600 NewHMControlContentUPP(HMControlContentProcPtr userRoutine) ;
62601 extern HMWindowContentUPP
62602 NewHMWindowContentUPP(HMWindowContentProcPtr userRoutine) ;
62603 extern HMMenuTitleContentUPP
62604 NewHMMenuTitleContentUPP(HMMenuTitleContentProcPtr userRoutine) ;
62605 extern HMMenuItemContentUPP
62606 NewHMMenuItemContentUPP(HMMenuItemContentProcPtr userRoutine) ;
62607 extern void
62608 DisposeHMControlContentUPP(HMControlContentUPP userUPP) ;
62609 extern void
62610 DisposeHMWindowContentUPP(HMWindowContentUPP userUPP) ;
62611 extern void
62612 DisposeHMMenuTitleContentUPP(HMMenuTitleContentUPP userUPP) ;
62613 extern void
62614 DisposeHMMenuItemContentUPP(HMMenuItemContentUPP userUPP) ;
62615 extern OSStatus
62616 InvokeHMControlContentUPP(
62617   ControlRef inControl,
62618   Point inGlobalMouse,
62619   HMContentRequest inRequest,
62620   HMContentProvidedType * outContentProvided,
62621   HMHelpContentPtr ioHelpContent,
62622   HMControlContentUPP userUPP) ;
62623 extern OSStatus
62624 InvokeHMWindowContentUPP(
62625   WindowRef inWindow,
62626   Point inGlobalMouse,
62627   HMContentRequest inRequest,
62628   HMContentProvidedType * outContentProvided,
62629   HMHelpContentPtr ioHelpContent,
62630   HMWindowContentUPP userUPP) ;
62631 extern OSStatus
62632 InvokeHMMenuTitleContentUPP(
62633   MenuRef inMenu,
62634   HMContentRequest inRequest,
62635   HMContentProvidedType * outContentProvided,
62636   HMHelpContentPtr ioHelpContent,
62637   HMMenuTitleContentUPP userUPP) ;
62638 extern OSStatus
62639 InvokeHMMenuItemContentUPP(
62640   const MenuTrackingData * inTrackingData,
62641   HMContentRequest inRequest,
62642   HMContentProvidedType * outContentProvided,
62643   HMHelpContentPtr ioHelpContent,
62644   HMMenuItemContentUPP userUPP) ;
62645 extern OSStatus
62646 HMGetHelpMenu(
62647   MenuRef * outHelpMenu,
62648   MenuItemIndex * outFirstCustomItemIndex) ;
62649 extern OSStatus
62650 HMSetControlHelpContent(
62651   ControlRef inControl,
62652   const HMHelpContentRec * inContent) ;
62653 extern OSStatus
62654 HMGetControlHelpContent(
62655   ControlRef inControl,
62656   HMHelpContentRec * outContent) ;
62657 extern OSStatus
62658 HMSetWindowHelpContent(
62659   WindowRef inWindow,
62660   const HMHelpContentRec * inContent) ;
62661 extern OSStatus
62662 HMGetWindowHelpContent(
62663   WindowRef inWindow,
62664   HMHelpContentRec * outContent) ;
62665 extern OSStatus
62666 HMSetMenuItemHelpContent(
62667   MenuRef inMenu,
62668   MenuItemIndex inItem,
62669   const HMHelpContentRec * inContent) ;
62670 extern OSStatus
62671 HMGetMenuItemHelpContent(
62672   MenuRef inMenu,
62673   MenuItemIndex inItem,
62674   HMHelpContentRec * outContent) ;
62675 extern OSStatus
62676 HMInstallControlContentCallback(
62677   ControlRef inControl,
62678   HMControlContentUPP inContentUPP) ;
62679 extern OSStatus
62680 HMInstallWindowContentCallback(
62681   WindowRef inWindow,
62682   HMWindowContentUPP inContentUPP) ;
62683 extern OSStatus
62684 HMInstallMenuTitleContentCallback(
62685   MenuRef inMenu,
62686   HMMenuTitleContentUPP inContentUPP) ;
62687 extern OSStatus
62688 HMInstallMenuItemContentCallback(
62689   MenuRef inMenu,
62690   HMMenuItemContentUPP inContentUPP) ;
62691 extern OSStatus
62692 HMGetControlContentCallback(
62693   ControlRef inControl,
62694   HMControlContentUPP * outContentUPP) ;
62695 extern OSStatus
62696 HMGetWindowContentCallback(
62697   WindowRef inWindow,
62698   HMWindowContentUPP * outContentUPP) ;
62699 extern OSStatus
62700 HMGetMenuTitleContentCallback(
62701   MenuRef inMenu,
62702   HMMenuTitleContentUPP * outContentUPP) ;
62703 extern OSStatus
62704 HMGetMenuItemContentCallback(
62705   MenuRef inMenu,
62706   HMMenuItemContentUPP * outContentUPP) ;
62707 extern Boolean
62708 HMAreHelpTagsDisplayed(void) ;
62709 extern OSStatus
62710 HMSetHelpTagsDisplayed(Boolean inDisplayTags) ;
62711 extern OSStatus
62712 HMSetTagDelay(Duration inDelay) ;
62713 extern OSStatus
62714 HMGetTagDelay(Duration * outDelay) ;
62715 extern OSStatus
62716 HMSetMenuHelpFromBalloonRsrc(
62717   MenuRef inMenu,
62718   SInt16 inHmnuRsrcID) ;
62719 extern OSStatus
62720 HMSetDialogHelpFromBalloonRsrc(
62721   DialogRef inDialog,
62722   SInt16 inHdlgRsrcID,
62723   SInt16 inItemStart) ;
62724 extern OSStatus
62725 HMDisplayTag(const HMHelpContentRec * inContent) ;
62726 extern OSStatus
62727 HMHideTag(void) ;
62728
62729
62730
62731
62732
62733 }
62734
62735
62736
62737 extern "C" {
62738
62739
62740 enum {
62741   kControlTabListResType = 'tab#',
62742   kControlListDescResType = 'ldes'
62743 };
62744
62745
62746
62747
62748 enum {
62749   kControlCheckBoxUncheckedValue = 0,
62750   kControlCheckBoxCheckedValue = 1,
62751   kControlCheckBoxMixedValue = 2
62752 };
62753
62754
62755
62756
62757 enum {
62758   kControlRadioButtonUncheckedValue = 0,
62759   kControlRadioButtonCheckedValue = 1,
62760   kControlRadioButtonMixedValue = 2
62761 };
62762
62763
62764
62765
62766
62767 enum {
62768   popupFixedWidth = 1 << 0,
62769   popupVariableWidth = 1 << 1,
62770   popupUseAddResMenu = 1 << 2,
62771   popupUseWFont = 1 << 3
62772 };
62773
62774
62775 enum {
62776   popupTitleBold = 1 << 8,
62777   popupTitleItalic = 1 << 9,
62778   popupTitleUnderline = 1 << 10,
62779   popupTitleOutline = 1 << 11,
62780   popupTitleShadow = 1 << 12,
62781   popupTitleCondense = 1 << 13,
62782   popupTitleExtend = 1 << 14,
62783   popupTitleNoStyle = 1 << 15
62784 };
62785
62786
62787 enum {
62788   popupTitleLeftJust = 0x00000000,
62789   popupTitleCenterJust = 0x00000001,
62790   popupTitleRightJust = 0x000000FF
62791 };
62792 enum {
62793   pushButProc = 0,
62794   checkBoxProc = 1,
62795   radioButProc = 2,
62796   scrollBarProc = 16,
62797   popupMenuProc = 1008
62798 };
62799
62800
62801
62802
62803 enum {
62804   kControlLabelPart = 1,
62805   kControlMenuPart = 2,
62806   kControlTrianglePart = 4,
62807   kControlEditTextPart = 5,
62808   kControlPicturePart = 6,
62809   kControlIconPart = 7,
62810   kControlClockPart = 8,
62811   kControlListBoxPart = 24,
62812   kControlListBoxDoubleClickPart = 25,
62813   kControlImageWellPart = 26,
62814   kControlRadioGroupPart = 27,
62815   kControlButtonPart = 10,
62816   kControlCheckBoxPart = 11,
62817   kControlRadioButtonPart = 11,
62818   kControlUpButtonPart = 20,
62819   kControlDownButtonPart = 21,
62820   kControlPageUpPart = 22,
62821   kControlPageDownPart = 23,
62822   kControlClockHourDayPart = 9,
62823   kControlClockMinuteMonthPart = 10,
62824   kControlClockSecondYearPart = 11,
62825   kControlClockAMPMPart = 12,
62826   kControlDataBrowserPart = 24,
62827   kControlDataBrowserDraggedPart = 25
62828 };
62829 enum {
62830   kControlBevelButtonSmallBevelProc = 32,
62831   kControlBevelButtonNormalBevelProc = 33,
62832   kControlBevelButtonLargeBevelProc = 34
62833 };
62834
62835
62836 enum {
62837   kControlBevelButtonSmallBevelVariant = 0,
62838   kControlBevelButtonNormalBevelVariant = (1 << 0),
62839   kControlBevelButtonLargeBevelVariant = (1 << 1),
62840   kControlBevelButtonMenuOnRightVariant = (1 << 2)
62841 };
62842
62843
62844 typedef UInt16 ControlBevelThickness;
62845 enum {
62846   kControlBevelButtonSmallBevel = 0,
62847   kControlBevelButtonNormalBevel = 1,
62848   kControlBevelButtonLargeBevel = 2
62849 };
62850
62851
62852
62853 enum {
62854   kControlBehaviorPushbutton = 0,
62855   kControlBehaviorToggles = 0x0100,
62856   kControlBehaviorSticky = 0x0200,
62857   kControlBehaviorSingleValueMenu = 0,
62858   kControlBehaviorMultiValueMenu = 0x4000,
62859   kControlBehaviorOffsetContents = 0x8000
62860 };
62861
62862
62863 enum {
62864   kControlBehaviorCommandMenu = 0x2000
62865 };
62866
62867 typedef UInt16 ControlBevelButtonBehavior;
62868 typedef UInt16 ControlBevelButtonMenuBehavior;
62869
62870 typedef UInt16 ControlBevelButtonMenuPlacement;
62871 enum {
62872   kControlBevelButtonMenuOnBottom = 0,
62873   kControlBevelButtonMenuOnRight = (1 << 2)
62874 };
62875
62876
62877 enum {
62878   kControlKindBevelButton = 'bevl'
62879 };
62880 extern OSStatus
62881 CreateBevelButtonControl(
62882   WindowRef window,
62883   const Rect * boundsRect,
62884   CFStringRef title,
62885   ControlBevelThickness thickness,
62886   ControlBevelButtonBehavior behavior,
62887   ControlButtonContentInfoPtr info,
62888   SInt16 menuID,
62889   ControlBevelButtonMenuBehavior menuBehavior,
62890   ControlBevelButtonMenuPlacement menuPlacement,
62891   ControlRef * outControl) ;
62892
62893
62894
62895
62896
62897 typedef SInt16 ControlButtonGraphicAlignment;
62898 enum {
62899   kControlBevelButtonAlignSysDirection = -1,
62900   kControlBevelButtonAlignCenter = 0,
62901   kControlBevelButtonAlignLeft = 1,
62902   kControlBevelButtonAlignRight = 2,
62903   kControlBevelButtonAlignTop = 3,
62904   kControlBevelButtonAlignBottom = 4,
62905   kControlBevelButtonAlignTopLeft = 5,
62906   kControlBevelButtonAlignBottomLeft = 6,
62907   kControlBevelButtonAlignTopRight = 7,
62908   kControlBevelButtonAlignBottomRight = 8
62909 };
62910
62911
62912 typedef SInt16 ControlButtonTextAlignment;
62913 enum {
62914   kControlBevelButtonAlignTextSysDirection = teFlushDefault,
62915   kControlBevelButtonAlignTextCenter = teCenter,
62916   kControlBevelButtonAlignTextFlushRight = teFlushRight,
62917   kControlBevelButtonAlignTextFlushLeft = teFlushLeft
62918 };
62919
62920
62921 typedef SInt16 ControlButtonTextPlacement;
62922 enum {
62923   kControlBevelButtonPlaceSysDirection = -1,
62924   kControlBevelButtonPlaceNormally = 0,
62925   kControlBevelButtonPlaceToRightOfGraphic = 1,
62926   kControlBevelButtonPlaceToLeftOfGraphic = 2,
62927   kControlBevelButtonPlaceBelowGraphic = 3,
62928   kControlBevelButtonPlaceAboveGraphic = 4
62929 };
62930
62931
62932
62933 enum {
62934   kControlBevelButtonContentTag = 'cont',
62935   kControlBevelButtonTransformTag = 'tran',
62936   kControlBevelButtonTextAlignTag = 'tali',
62937   kControlBevelButtonTextOffsetTag = 'toff',
62938   kControlBevelButtonGraphicAlignTag = 'gali',
62939   kControlBevelButtonGraphicOffsetTag = 'goff',
62940   kControlBevelButtonTextPlaceTag = 'tplc',
62941   kControlBevelButtonMenuValueTag = 'mval',
62942   kControlBevelButtonMenuHandleTag = 'mhnd',
62943   kControlBevelButtonMenuRefTag = 'mhnd',
62944   kControlBevelButtonCenterPopupGlyphTag = 'pglc'
62945 };
62946
62947
62948 enum {
62949   kControlBevelButtonLastMenuTag = 'lmnu',
62950   kControlBevelButtonMenuDelayTag = 'mdly'
62951 };
62952
62953
62954 enum {
62955
62956
62957
62958
62959
62960   kControlBevelButtonScaleIconTag = 'scal'
62961 };
62962
62963
62964 enum {
62965   kControlBevelButtonOwnedMenuRefTag = 'omrf',
62966   kControlBevelButtonKindTag = 'bebk'
62967 };
62968 extern OSErr
62969 GetBevelButtonMenuValue(
62970   ControlRef inButton,
62971   SInt16 * outValue) ;
62972 extern OSErr
62973 SetBevelButtonMenuValue(
62974   ControlRef inButton,
62975   SInt16 inValue) ;
62976 extern OSErr
62977 GetBevelButtonMenuHandle(
62978   ControlRef inButton,
62979   MenuHandle * outHandle) ;
62980 extern OSErr
62981 GetBevelButtonContentInfo(
62982   ControlRef inButton,
62983   ControlButtonContentInfoPtr outContent) ;
62984 extern OSErr
62985 SetBevelButtonContentInfo(
62986   ControlRef inButton,
62987   ControlButtonContentInfoPtr inContent) ;
62988 extern OSErr
62989 SetBevelButtonTransform(
62990   ControlRef inButton,
62991   IconTransformType transform) ;
62992 extern OSErr
62993 SetBevelButtonGraphicAlignment(
62994   ControlRef inButton,
62995   ControlButtonGraphicAlignment inAlign,
62996   SInt16 inHOffset,
62997   SInt16 inVOffset) ;
62998 extern OSErr
62999 SetBevelButtonTextAlignment(
63000   ControlRef inButton,
63001   ControlButtonTextAlignment inAlign,
63002   SInt16 inHOffset) ;
63003 extern OSErr
63004 SetBevelButtonTextPlacement(
63005   ControlRef inButton,
63006   ControlButtonTextPlacement inWhere) ;
63007 enum {
63008   kControlSliderProc = 48,
63009   kControlSliderLiveFeedback = (1 << 0),
63010   kControlSliderHasTickMarks = (1 << 1),
63011   kControlSliderReverseDirection = (1 << 2),
63012   kControlSliderNonDirectional = (1 << 3)
63013 };
63014
63015
63016 typedef UInt16 ControlSliderOrientation;
63017 enum {
63018   kControlSliderPointsDownOrRight = 0,
63019   kControlSliderPointsUpOrLeft = 1,
63020   kControlSliderDoesNotPoint = 2
63021 };
63022
63023
63024 enum {
63025   kControlKindSlider = 'sldr'
63026 };
63027 extern OSStatus
63028 CreateSliderControl(
63029   WindowRef window,
63030   const Rect * boundsRect,
63031   SInt32 value,
63032   SInt32 minimum,
63033   SInt32 maximum,
63034   ControlSliderOrientation orientation,
63035   UInt16 numTickMarks,
63036   Boolean liveTracking,
63037   ControlActionUPP liveTrackingProc,
63038   ControlRef * outControl) ;
63039 enum {
63040   kControlTriangleProc = 64,
63041   kControlTriangleLeftFacingProc = 65,
63042   kControlTriangleAutoToggleProc = 66,
63043   kControlTriangleLeftFacingAutoToggleProc = 67
63044 };
63045
63046 typedef UInt16 ControlDisclosureTriangleOrientation;
63047 enum {
63048   kControlDisclosureTrianglePointDefault = 0,
63049   kControlDisclosureTrianglePointRight = 1,
63050   kControlDisclosureTrianglePointLeft = 2
63051 };
63052
63053
63054 enum {
63055   kControlKindDisclosureTriangle = 'dist'
63056 };
63057 extern OSStatus
63058 CreateDisclosureTriangleControl(
63059   WindowRef inWindow,
63060   const Rect * inBoundsRect,
63061   ControlDisclosureTriangleOrientation inOrientation,
63062   CFStringRef inTitle,
63063   SInt32 inInitialValue,
63064   Boolean inDrawTitle,
63065   Boolean inAutoToggles,
63066   ControlRef * outControl) ;
63067
63068
63069
63070
63071 enum {
63072   kControlTriangleLastValueTag = 'last'
63073 };
63074 extern OSErr
63075 SetDisclosureTriangleLastValue(
63076   ControlRef inTabControl,
63077   SInt16 inValue) ;
63078 enum {
63079   kControlProgressBarProc = 80,
63080   kControlRelevanceBarProc = 81
63081 };
63082
63083
63084 enum {
63085   kControlKindProgressBar = 'prgb',
63086   kControlKindRelevanceBar = 'relb'
63087 };
63088 extern OSStatus
63089 CreateProgressBarControl(
63090   WindowRef window,
63091   const Rect * boundsRect,
63092   SInt32 value,
63093   SInt32 minimum,
63094   SInt32 maximum,
63095   Boolean indeterminate,
63096   ControlRef * outControl) ;
63097 extern OSStatus
63098 CreateRelevanceBarControl(
63099   WindowRef window,
63100   const Rect * boundsRect,
63101   SInt32 value,
63102   SInt32 minimum,
63103   SInt32 maximum,
63104   ControlRef * outControl) ;
63105
63106
63107
63108 enum {
63109   kControlProgressBarIndeterminateTag = 'inde',
63110   kControlProgressBarAnimatingTag = 'anim'
63111 };
63112
63113
63114
63115
63116
63117
63118
63119 enum {
63120   kControlLittleArrowsProc = 96
63121 };
63122
63123
63124 enum {
63125   kControlKindLittleArrows = 'larr'
63126 };
63127 extern OSStatus
63128 CreateLittleArrowsControl(
63129   WindowRef window,
63130   const Rect * boundsRect,
63131   SInt32 value,
63132   SInt32 minimum,
63133   SInt32 maximum,
63134   SInt32 increment,
63135   ControlRef * outControl) ;
63136 enum {
63137   kControlChasingArrowsProc = 112
63138 };
63139
63140
63141 enum {
63142   kControlKindChasingArrows = 'carr'
63143 };
63144 extern OSStatus
63145 CreateChasingArrowsControl(
63146   WindowRef window,
63147   const Rect * boundsRect,
63148   ControlRef * outControl) ;
63149
63150
63151
63152 enum {
63153   kControlChasingArrowsAnimatingTag = 'anim'
63154 };
63155 enum {
63156   kControlTabLargeProc = 128,
63157   kControlTabSmallProc = 129,
63158   kControlTabLargeNorthProc = 128,
63159   kControlTabSmallNorthProc = 129,
63160   kControlTabLargeSouthProc = 130,
63161   kControlTabSmallSouthProc = 131,
63162   kControlTabLargeEastProc = 132,
63163   kControlTabSmallEastProc = 133,
63164   kControlTabLargeWestProc = 134,
63165   kControlTabSmallWestProc = 135
63166 };
63167
63168
63169 typedef UInt16 ControlTabDirection;
63170 enum {
63171   kControlTabDirectionNorth = 0,
63172   kControlTabDirectionSouth = 1,
63173   kControlTabDirectionEast = 2,
63174   kControlTabDirectionWest = 3
63175 };
63176
63177
63178 typedef UInt16 ControlTabSize;
63179 enum {
63180   kControlTabSizeLarge = kControlSizeNormal,
63181   kControlTabSizeSmall = kControlSizeSmall
63182 };
63183
63184
63185
63186
63187
63188 struct ControlTabEntry {
63189   ControlButtonContentInfo * icon;
63190   CFStringRef name;
63191   Boolean enabled;
63192 };
63193 typedef struct ControlTabEntry ControlTabEntry;
63194
63195 enum {
63196   kControlKindTabs = 'tabs'
63197 };
63198 extern OSStatus
63199 CreateTabsControl(
63200   WindowRef window,
63201   const Rect * boundsRect,
63202   ControlTabSize size,
63203   ControlTabDirection direction,
63204   UInt16 numTabs,
63205   const ControlTabEntry * tabArray,
63206   ControlRef * outControl) ;
63207
63208
63209
63210
63211 enum {
63212   kControlTabContentRectTag = 'rect',
63213   kControlTabEnabledFlagTag = 'enab',
63214   kControlTabFontStyleTag = kControlFontStyleTag
63215 };
63216
63217
63218 enum {
63219   kControlTabInfoTag = 'tabi'
63220 };
63221
63222
63223 enum {
63224   kControlTabImageContentTag = 'cont'
63225 };
63226
63227 enum {
63228   kControlTabInfoVersionZero = 0,
63229   kControlTabInfoVersionOne = 1
63230 };
63231
63232 struct ControlTabInfoRec {
63233   SInt16 version;
63234   SInt16 iconSuiteID;
63235   Str255 name;
63236 };
63237 typedef struct ControlTabInfoRec ControlTabInfoRec;
63238 struct ControlTabInfoRecV1 {
63239   SInt16 version;
63240   SInt16 iconSuiteID;
63241   CFStringRef name;
63242
63243 };
63244 typedef struct ControlTabInfoRecV1 ControlTabInfoRecV1;
63245 extern OSErr
63246 GetTabContentRect(
63247   ControlRef inTabControl,
63248   Rect * outContentRect) ;
63249 extern OSErr
63250 SetTabEnabled(
63251   ControlRef inTabControl,
63252   SInt16 inTabToHilite,
63253   Boolean inEnabled) ;
63254 enum {
63255   kControlSeparatorLineProc = 144
63256 };
63257
63258
63259 enum {
63260   kControlKindSeparator = 'sepa'
63261 };
63262 extern OSStatus
63263 CreateSeparatorControl(
63264   WindowRef window,
63265   const Rect * boundsRect,
63266   ControlRef * outControl) ;
63267 enum {
63268   kControlGroupBoxTextTitleProc = 160,
63269   kControlGroupBoxCheckBoxProc = 161,
63270   kControlGroupBoxPopupButtonProc = 162,
63271   kControlGroupBoxSecondaryTextTitleProc = 164,
63272   kControlGroupBoxSecondaryCheckBoxProc = 165,
63273   kControlGroupBoxSecondaryPopupButtonProc = 166
63274 };
63275
63276
63277 enum {
63278   kControlKindGroupBox = 'grpb',
63279   kControlKindCheckGroupBox = 'cgrp',
63280   kControlKindPopupGroupBox = 'pgrp'
63281 };
63282 extern OSStatus
63283 CreateGroupBoxControl(
63284   WindowRef window,
63285   const Rect * boundsRect,
63286   CFStringRef title,
63287   Boolean primary,
63288   ControlRef * outControl) ;
63289 extern OSStatus
63290 CreateCheckGroupBoxControl(
63291   WindowRef window,
63292   const Rect * boundsRect,
63293   CFStringRef title,
63294   SInt32 initialValue,
63295   Boolean primary,
63296   Boolean autoToggle,
63297   ControlRef * outControl) ;
63298 extern OSStatus
63299 CreatePopupGroupBoxControl(
63300   WindowRef window,
63301   const Rect * boundsRect,
63302   CFStringRef title,
63303   Boolean primary,
63304   SInt16 menuID,
63305   Boolean variableWidth,
63306   SInt16 titleWidth,
63307   SInt16 titleJustification,
63308   Style titleStyle,
63309   ControlRef * outControl) ;
63310
63311
63312
63313
63314 enum {
63315   kControlGroupBoxMenuHandleTag = 'mhan',
63316   kControlGroupBoxMenuRefTag = 'mhan',
63317   kControlGroupBoxFontStyleTag = kControlFontStyleTag
63318 };
63319
63320
63321 enum {
63322   kControlGroupBoxTitleRectTag = 'trec'
63323 };
63324 enum {
63325   kControlImageWellProc = 176
63326 };
63327
63328
63329 enum {
63330   kControlKindImageWell = 'well'
63331 };
63332 extern OSStatus
63333 CreateImageWellControl(
63334   WindowRef window,
63335   const Rect * boundsRect,
63336   const ControlButtonContentInfo * info,
63337   ControlRef * outControl) ;
63338
63339
63340
63341 enum {
63342   kControlImageWellContentTag = 'cont',
63343   kControlImageWellTransformTag = 'tran',
63344   kControlImageWellIsDragDestinationTag = 'drag'
63345 };
63346 extern OSErr
63347 GetImageWellContentInfo(
63348   ControlRef inButton,
63349   ControlButtonContentInfoPtr outContent) ;
63350 extern OSErr
63351 SetImageWellContentInfo(
63352   ControlRef inButton,
63353   ControlButtonContentInfoPtr inContent) ;
63354 extern OSErr
63355 SetImageWellTransform(
63356   ControlRef inButton,
63357   IconTransformType inTransform) ;
63358 enum {
63359   kControlPopupArrowEastProc = 192,
63360   kControlPopupArrowWestProc = 193,
63361   kControlPopupArrowNorthProc = 194,
63362   kControlPopupArrowSouthProc = 195,
63363   kControlPopupArrowSmallEastProc = 196,
63364   kControlPopupArrowSmallWestProc = 197,
63365   kControlPopupArrowSmallNorthProc = 198,
63366   kControlPopupArrowSmallSouthProc = 199
63367 };
63368
63369
63370 enum {
63371   kControlPopupArrowOrientationEast = 0,
63372   kControlPopupArrowOrientationWest = 1,
63373   kControlPopupArrowOrientationNorth = 2,
63374   kControlPopupArrowOrientationSouth = 3
63375 };
63376
63377
63378 typedef UInt16 ControlPopupArrowOrientation;
63379
63380 enum {
63381   kControlPopupArrowSizeNormal = 0,
63382   kControlPopupArrowSizeSmall = 1
63383 };
63384
63385 typedef UInt16 ControlPopupArrowSize;
63386
63387 enum {
63388   kControlKindPopupArrow = 'parr'
63389 };
63390 extern OSStatus
63391 CreatePopupArrowControl(
63392   WindowRef window,
63393   const Rect * boundsRect,
63394   ControlPopupArrowOrientation orientation,
63395   ControlPopupArrowSize size,
63396   ControlRef * outControl) ;
63397
63398
63399
63400
63401
63402
63403 enum {
63404   kControlPlacardProc = 224
63405 };
63406
63407
63408 enum {
63409   kControlKindPlacard = 'plac'
63410 };
63411 extern OSStatus
63412 CreatePlacardControl(
63413   WindowRef window,
63414   const Rect * boundsRect,
63415   ControlRef * outControl) ;
63416 enum {
63417   kControlClockTimeProc = 240,
63418   kControlClockTimeSecondsProc = 241,
63419   kControlClockDateProc = 242,
63420   kControlClockMonthYearProc = 243
63421 };
63422
63423
63424 typedef UInt16 ControlClockType;
63425 enum {
63426   kControlClockTypeHourMinute = 0,
63427   kControlClockTypeHourMinuteSecond = 1,
63428   kControlClockTypeMonthDayYear = 2,
63429   kControlClockTypeMonthYear = 3
63430 };
63431
63432
63433
63434
63435 typedef UInt32 ControlClockFlags;
63436 enum {
63437   kControlClockFlagStandard = 0,
63438   kControlClockNoFlags = 0,
63439   kControlClockFlagDisplayOnly = 1,
63440   kControlClockIsDisplayOnly = 1,
63441   kControlClockFlagLive = 2,
63442   kControlClockIsLive = 2
63443 };
63444
63445
63446 enum {
63447   kControlKindClock = 'clck'
63448 };
63449 extern OSStatus
63450 CreateClockControl(
63451   WindowRef window,
63452   const Rect * boundsRect,
63453   ControlClockType clockType,
63454   ControlClockFlags clockFlags,
63455   ControlRef * outControl) ;
63456
63457
63458
63459 enum {
63460   kControlClockLongDateTag = 'date',
63461   kControlClockFontStyleTag = kControlFontStyleTag,
63462   kControlClockAnimatingTag = 'anim'
63463 };
63464 enum {
63465   kControlUserPaneProc = 256
63466 };
63467
63468
63469 enum {
63470   kControlKindUserPane = 'upan'
63471 };
63472 extern OSStatus
63473 CreateUserPaneControl(
63474   WindowRef window,
63475   const Rect * boundsRect,
63476   UInt32 features,
63477   ControlRef * outControl) ;
63478
63479
63480
63481
63482 enum {
63483   kControlUserItemDrawProcTag = 'uidp',
63484   kControlUserPaneDrawProcTag = 'draw',
63485   kControlUserPaneHitTestProcTag = 'hitt',
63486   kControlUserPaneTrackingProcTag = 'trak',
63487   kControlUserPaneIdleProcTag = 'idle',
63488   kControlUserPaneKeyDownProcTag = 'keyd',
63489   kControlUserPaneActivateProcTag = 'acti',
63490   kControlUserPaneFocusProcTag = 'foci',
63491   kControlUserPaneBackgroundProcTag = 'back'
63492 };
63493
63494 typedef void ( * ControlUserPaneDrawProcPtr)(ControlRef control, SInt16 part);
63495 typedef ControlPartCode ( * ControlUserPaneHitTestProcPtr)(ControlRef control, Point where);
63496 typedef ControlPartCode ( * ControlUserPaneTrackingProcPtr)(ControlRef control, Point startPt, ControlActionUPP actionProc);
63497 typedef void ( * ControlUserPaneIdleProcPtr)(ControlRef control);
63498 typedef ControlPartCode ( * ControlUserPaneKeyDownProcPtr)(ControlRef control, SInt16 keyCode, SInt16 charCode, SInt16 modifiers);
63499 typedef void ( * ControlUserPaneActivateProcPtr)(ControlRef control, Boolean activating);
63500 typedef ControlPartCode ( * ControlUserPaneFocusProcPtr)(ControlRef control, ControlFocusPart action);
63501 typedef void ( * ControlUserPaneBackgroundProcPtr)(ControlRef control, ControlBackgroundPtr info);
63502 typedef ControlUserPaneDrawProcPtr ControlUserPaneDrawUPP;
63503 typedef ControlUserPaneHitTestProcPtr ControlUserPaneHitTestUPP;
63504 typedef ControlUserPaneTrackingProcPtr ControlUserPaneTrackingUPP;
63505 typedef ControlUserPaneIdleProcPtr ControlUserPaneIdleUPP;
63506 typedef ControlUserPaneKeyDownProcPtr ControlUserPaneKeyDownUPP;
63507 typedef ControlUserPaneActivateProcPtr ControlUserPaneActivateUPP;
63508 typedef ControlUserPaneFocusProcPtr ControlUserPaneFocusUPP;
63509 typedef ControlUserPaneBackgroundProcPtr ControlUserPaneBackgroundUPP;
63510 extern ControlUserPaneDrawUPP
63511 NewControlUserPaneDrawUPP(ControlUserPaneDrawProcPtr userRoutine) ;
63512 extern ControlUserPaneHitTestUPP
63513 NewControlUserPaneHitTestUPP(ControlUserPaneHitTestProcPtr userRoutine) ;
63514 extern ControlUserPaneTrackingUPP
63515 NewControlUserPaneTrackingUPP(ControlUserPaneTrackingProcPtr userRoutine) ;
63516 extern ControlUserPaneIdleUPP
63517 NewControlUserPaneIdleUPP(ControlUserPaneIdleProcPtr userRoutine) ;
63518 extern ControlUserPaneKeyDownUPP
63519 NewControlUserPaneKeyDownUPP(ControlUserPaneKeyDownProcPtr userRoutine) ;
63520 extern ControlUserPaneActivateUPP
63521 NewControlUserPaneActivateUPP(ControlUserPaneActivateProcPtr userRoutine) ;
63522 extern ControlUserPaneFocusUPP
63523 NewControlUserPaneFocusUPP(ControlUserPaneFocusProcPtr userRoutine) ;
63524 extern ControlUserPaneBackgroundUPP
63525 NewControlUserPaneBackgroundUPP(ControlUserPaneBackgroundProcPtr userRoutine) ;
63526 extern void
63527 DisposeControlUserPaneDrawUPP(ControlUserPaneDrawUPP userUPP) ;
63528 extern void
63529 DisposeControlUserPaneHitTestUPP(ControlUserPaneHitTestUPP userUPP) ;
63530 extern void
63531 DisposeControlUserPaneTrackingUPP(ControlUserPaneTrackingUPP userUPP) ;
63532 extern void
63533 DisposeControlUserPaneIdleUPP(ControlUserPaneIdleUPP userUPP) ;
63534 extern void
63535 DisposeControlUserPaneKeyDownUPP(ControlUserPaneKeyDownUPP userUPP) ;
63536 extern void
63537 DisposeControlUserPaneActivateUPP(ControlUserPaneActivateUPP userUPP) ;
63538 extern void
63539 DisposeControlUserPaneFocusUPP(ControlUserPaneFocusUPP userUPP) ;
63540 extern void
63541 DisposeControlUserPaneBackgroundUPP(ControlUserPaneBackgroundUPP userUPP) ;
63542 extern void
63543 InvokeControlUserPaneDrawUPP(
63544   ControlRef control,
63545   SInt16 part,
63546   ControlUserPaneDrawUPP userUPP) ;
63547 extern ControlPartCode
63548 InvokeControlUserPaneHitTestUPP(
63549   ControlRef control,
63550   Point where,
63551   ControlUserPaneHitTestUPP userUPP) ;
63552 extern ControlPartCode
63553 InvokeControlUserPaneTrackingUPP(
63554   ControlRef control,
63555   Point startPt,
63556   ControlActionUPP actionProc,
63557   ControlUserPaneTrackingUPP userUPP) ;
63558 extern void
63559 InvokeControlUserPaneIdleUPP(
63560   ControlRef control,
63561   ControlUserPaneIdleUPP userUPP) ;
63562 extern ControlPartCode
63563 InvokeControlUserPaneKeyDownUPP(
63564   ControlRef control,
63565   SInt16 keyCode,
63566   SInt16 charCode,
63567   SInt16 modifiers,
63568   ControlUserPaneKeyDownUPP userUPP) ;
63569 extern void
63570 InvokeControlUserPaneActivateUPP(
63571   ControlRef control,
63572   Boolean activating,
63573   ControlUserPaneActivateUPP userUPP) ;
63574 extern ControlPartCode
63575 InvokeControlUserPaneFocusUPP(
63576   ControlRef control,
63577   ControlFocusPart action,
63578   ControlUserPaneFocusUPP userUPP) ;
63579 extern void
63580 InvokeControlUserPaneBackgroundUPP(
63581   ControlRef control,
63582   ControlBackgroundPtr info,
63583   ControlUserPaneBackgroundUPP userUPP) ;
63584
63585
63586
63587
63588
63589
63590
63591 enum {
63592   kControlEditTextProc = 272,
63593   kControlEditTextPasswordProc = 274
63594 };
63595
63596
63597 enum {
63598   kControlEditTextInlineInputProc = 276
63599 };
63600
63601
63602 enum {
63603   kControlKindEditText = 'etxt'
63604 };
63605 extern OSStatus
63606 CreateEditTextControl(
63607   WindowRef window,
63608   const Rect * boundsRect,
63609   CFStringRef text,
63610   Boolean isPassword,
63611   Boolean useInlineInput,
63612   const ControlFontStyleRec * style,
63613   ControlRef * outControl) ;
63614
63615
63616
63617
63618 enum {
63619   kControlEditTextStyleTag = kControlFontStyleTag,
63620   kControlEditTextTextTag = 'text',
63621   kControlEditTextTEHandleTag = 'than',
63622   kControlEditTextKeyFilterTag = kControlKeyFilterTag,
63623   kControlEditTextSelectionTag = 'sele',
63624   kControlEditTextPasswordTag = 'pass'
63625 };
63626
63627
63628 enum {
63629   kControlEditTextKeyScriptBehaviorTag = 'kscr',
63630
63631   kControlEditTextLockedTag = 'lock',
63632   kControlEditTextFixedTextTag = 'ftxt',
63633   kControlEditTextValidationProcTag = 'vali',
63634   kControlEditTextInlinePreUpdateProcTag = 'prup',
63635   kControlEditTextInlinePostUpdateProcTag = 'poup'
63636 };
63637
63638
63639
63640
63641
63642
63643 enum {
63644
63645
63646
63647
63648
63649
63650   kControlEditTextCFStringTag = 'cfst',
63651
63652
63653
63654
63655
63656
63657   kControlEditTextPasswordCFStringTag = 'pwcf'
63658 };
63659
63660
63661
63662
63663
63664 struct ControlEditTextSelectionRec {
63665   SInt16 selStart;
63666   SInt16 selEnd;
63667 };
63668 typedef struct ControlEditTextSelectionRec ControlEditTextSelectionRec;
63669 typedef ControlEditTextSelectionRec * ControlEditTextSelectionPtr;
63670 typedef void ( * ControlEditTextValidationProcPtr)(ControlRef control);
63671 typedef ControlEditTextValidationProcPtr ControlEditTextValidationUPP;
63672 extern ControlEditTextValidationUPP
63673 NewControlEditTextValidationUPP(ControlEditTextValidationProcPtr userRoutine) ;
63674 extern void
63675 DisposeControlEditTextValidationUPP(ControlEditTextValidationUPP userUPP) ;
63676 extern void
63677 InvokeControlEditTextValidationUPP(
63678   ControlRef control,
63679   ControlEditTextValidationUPP userUPP) ;
63680
63681
63682
63683
63684
63685 enum {
63686   kControlStaticTextProc = 288
63687 };
63688
63689
63690 enum {
63691   kControlKindStaticText = 'stxt'
63692 };
63693 extern OSStatus
63694 CreateStaticTextControl(
63695   WindowRef window,
63696   const Rect * boundsRect,
63697   CFStringRef text,
63698   const ControlFontStyleRec * style,
63699   ControlRef * outControl) ;
63700
63701
63702
63703
63704 enum {
63705   kControlStaticTextStyleTag = kControlFontStyleTag,
63706   kControlStaticTextTextTag = 'text',
63707   kControlStaticTextTextHeightTag = 'thei'
63708 };
63709
63710
63711 enum {
63712   kControlStaticTextTruncTag = 'trun'
63713 };
63714
63715
63716 enum {
63717   kControlStaticTextCFStringTag = 'cfst'
63718 };
63719 enum {
63720   kControlPictureProc = 304,
63721   kControlPictureNoTrackProc = 305
63722 };
63723
63724
63725 enum {
63726   kControlKindPicture = 'pict'
63727 };
63728 extern OSStatus
63729 CreatePictureControl(
63730   WindowRef window,
63731   const Rect * boundsRect,
63732   const ControlButtonContentInfo * content,
63733   Boolean dontTrack,
63734   ControlRef * outControl) ;
63735
63736
63737
63738 enum {
63739   kControlPictureHandleTag = 'pich'
63740 };
63741 enum {
63742   kControlIconProc = 320,
63743   kControlIconNoTrackProc = 321,
63744   kControlIconSuiteProc = 322,
63745   kControlIconSuiteNoTrackProc = 323
63746 };
63747
63748 enum {
63749
63750
63751
63752   kControlIconRefProc = 324,
63753   kControlIconRefNoTrackProc = 325
63754 };
63755
63756
63757 enum {
63758   kControlKindIcon = 'icon'
63759 };
63760 extern OSStatus
63761 CreateIconControl(
63762   WindowRef inWindow,
63763   const Rect * inBoundsRect,
63764   const ControlButtonContentInfo * inIconContent,
63765   Boolean inDontTrack,
63766   ControlRef * outControl) ;
63767
63768
63769
63770 enum {
63771   kControlIconTransformTag = 'trfm',
63772   kControlIconAlignmentTag = 'algn'
63773 };
63774
63775
63776 enum {
63777   kControlIconResourceIDTag = 'ires',
63778   kControlIconContentTag = 'cont'
63779 };
63780
63781
63782
63783
63784
63785 enum {
63786   kControlWindowHeaderProc = 336,
63787   kControlWindowListViewHeaderProc = 337
63788 };
63789
63790
63791 enum {
63792   kControlKindWindowHeader = 'whed'
63793 };
63794 extern OSStatus
63795 CreateWindowHeaderControl(
63796   WindowRef window,
63797   const Rect * boundsRect,
63798   Boolean isListHeader,
63799   ControlRef * outControl) ;
63800 enum {
63801   kControlListBoxProc = 352,
63802   kControlListBoxAutoSizeProc = 353
63803 };
63804
63805
63806 enum {
63807   kControlKindListBox = 'lbox'
63808 };
63809 extern OSStatus
63810 CreateListBoxControl(
63811   WindowRef window,
63812   const Rect * boundsRect,
63813   Boolean autoSize,
63814   SInt16 numRows,
63815   SInt16 numColumns,
63816   Boolean horizScroll,
63817   Boolean vertScroll,
63818   SInt16 cellHeight,
63819   SInt16 cellWidth,
63820   Boolean hasGrowSpace,
63821   const ListDefSpec * listDef,
63822   ControlRef * outControl) ;
63823
63824
63825
63826 enum {
63827   kControlListBoxListHandleTag = 'lhan',
63828   kControlListBoxKeyFilterTag = kControlKeyFilterTag,
63829   kControlListBoxFontStyleTag = kControlFontStyleTag
63830 };
63831
63832
63833 enum {
63834   kControlListBoxDoubleClickTag = 'dblc',
63835   kControlListBoxLDEFTag = 'ldef'
63836 };
63837 enum {
63838   kControlPushButtonProc = 368,
63839   kControlCheckBoxProc = 369,
63840   kControlRadioButtonProc = 370,
63841   kControlPushButLeftIconProc = 374,
63842   kControlPushButRightIconProc = 375
63843 };
63844
63845
63846 enum {
63847   kControlCheckBoxAutoToggleProc = 371,
63848   kControlRadioButtonAutoToggleProc = 372
63849 };
63850
63851
63852 typedef UInt16 ControlPushButtonIconAlignment;
63853 enum {
63854   kControlPushButtonIconOnLeft = 6,
63855   kControlPushButtonIconOnRight = 7
63856 };
63857
63858
63859 enum {
63860   kControlKindPushButton = 'push',
63861   kControlKindPushIconButton = 'picn',
63862   kControlKindRadioButton = 'rdio',
63863   kControlKindCheckBox = 'cbox'
63864 };
63865 extern OSStatus
63866 CreatePushButtonControl(
63867   WindowRef window,
63868   const Rect * boundsRect,
63869   CFStringRef title,
63870   ControlRef * outControl) ;
63871 extern OSStatus
63872 CreatePushButtonWithIconControl(
63873   WindowRef window,
63874   const Rect * boundsRect,
63875   CFStringRef title,
63876   ControlButtonContentInfo * icon,
63877   ControlPushButtonIconAlignment iconAlignment,
63878   ControlRef * outControl) ;
63879 extern OSStatus
63880 CreateRadioButtonControl(
63881   WindowRef window,
63882   const Rect * boundsRect,
63883   CFStringRef title,
63884   SInt32 initialValue,
63885   Boolean autoToggle,
63886   ControlRef * outControl) ;
63887 extern OSStatus
63888 CreateCheckBoxControl(
63889   WindowRef window,
63890   const Rect * boundsRect,
63891   CFStringRef title,
63892   SInt32 initialValue,
63893   Boolean autoToggle,
63894   ControlRef * outControl) ;
63895
63896
63897
63898
63899
63900 enum {
63901   kControlPushButtonDefaultTag = 'dflt',
63902   kControlPushButtonCancelTag = 'cncl'
63903 };
63904
63905
63906
63907
63908
63909
63910
63911 enum {
63912   kControlScrollBarProc = 384,
63913   kControlScrollBarLiveProc = 386
63914 };
63915
63916
63917 enum {
63918   kControlKindScrollBar = 'sbar'
63919 };
63920 extern OSStatus
63921 CreateScrollBarControl(
63922   WindowRef window,
63923   const Rect * boundsRect,
63924   SInt32 value,
63925   SInt32 minimum,
63926   SInt32 maximum,
63927   SInt32 viewSize,
63928   Boolean liveTracking,
63929   ControlActionUPP liveTrackingProc,
63930   ControlRef * outControl) ;
63931
63932
63933
63934 enum {
63935   kControlScrollBarShowsArrowsTag = 'arro'
63936 };
63937 enum {
63938   kControlPopupButtonProc = 400,
63939   kControlPopupFixedWidthVariant = 1 << 0,
63940   kControlPopupVariableWidthVariant = 1 << 1,
63941   kControlPopupUseAddResMenuVariant = 1 << 2,
63942   kControlPopupUseWFontVariant = kControlUsesOwningWindowsFontVariant
63943 };
63944
63945
63946 enum {
63947   kControlKindPopupButton = 'popb'
63948 };
63949 extern OSStatus
63950 CreatePopupButtonControl(
63951   WindowRef window,
63952   const Rect * boundsRect,
63953   CFStringRef title,
63954   SInt16 menuID,
63955   Boolean variableWidth,
63956   SInt16 titleWidth,
63957   SInt16 titleJustification,
63958   Style titleStyle,
63959   ControlRef * outControl) ;
63960
63961
63962
63963
63964
63965 enum {
63966   kControlPopupButtonMenuHandleTag = 'mhan',
63967   kControlPopupButtonMenuRefTag = 'mhan',
63968   kControlPopupButtonMenuIDTag = 'mnid'
63969 };
63970
63971
63972 enum {
63973   kControlPopupButtonExtraHeightTag = 'exht',
63974   kControlPopupButtonOwnedMenuRefTag = 'omrf'
63975 };
63976
63977
63978 enum {
63979   kControlPopupButtonCheckCurrentTag = 'chck'
63980 };
63981 enum {
63982   kControlRadioGroupProc = 416
63983 };
63984
63985
63986 enum {
63987   kControlKindRadioGroup = 'rgrp'
63988 };
63989 extern OSStatus
63990 CreateRadioGroupControl(
63991   WindowRef window,
63992   const Rect * boundsRect,
63993   ControlRef * outControl) ;
63994 enum {
63995   kControlScrollTextBoxProc = 432,
63996   kControlScrollTextBoxAutoScrollProc = 433
63997 };
63998
63999
64000 enum {
64001   kControlKindScrollingTextBox = 'stbx'
64002 };
64003 extern OSStatus
64004 CreateScrollingTextBoxControl(
64005   WindowRef window,
64006   const Rect * boundsRect,
64007   SInt16 contentResID,
64008   Boolean autoScroll,
64009   UInt32 delayBeforeAutoScroll,
64010   UInt32 delayBetweenAutoScroll,
64011   UInt16 autoScrollAmount,
64012   ControlRef * outControl) ;
64013
64014
64015
64016 enum {
64017   kControlScrollTextBoxDelayBeforeAutoScrollTag = 'stdl',
64018   kControlScrollTextBoxDelayBetweenAutoScrollTag = 'scdl',
64019   kControlScrollTextBoxAutoScrollAmountTag = 'samt',
64020   kControlScrollTextBoxContentsTag = 'tres',
64021   kControlScrollTextBoxAnimatingTag = 'anim'
64022 };
64023 extern OSStatus
64024 CreateDisclosureButtonControl(
64025   WindowRef inWindow,
64026   const Rect * inBoundsRect,
64027   SInt32 inValue,
64028   Boolean inAutoToggles,
64029   ControlRef * outControl) ;
64030
64031
64032
64033
64034 enum {
64035   kControlKindDisclosureButton = 'disb'
64036 };
64037
64038
64039
64040
64041
64042
64043 enum {
64044
64045
64046
64047
64048   kControlDisclosureButtonClosed = 0,
64049
64050
64051
64052
64053   kControlDisclosureButtonDisclosed = 1
64054 };
64055 typedef SInt16 ControlRoundButtonSize;
64056 enum {
64057
64058
64059
64060
64061   kControlRoundButtonNormalSize = kControlSizeNormal,
64062
64063
64064
64065
64066   kControlRoundButtonLargeSize = kControlSizeLarge
64067 };
64068
64069
64070 enum {
64071   kControlRoundButtonContentTag = 'cont',
64072   kControlRoundButtonSizeTag = kControlSizeTag
64073 };
64074
64075
64076 enum {
64077   kControlKindRoundButton = 'rndb'
64078 };
64079 extern OSStatus
64080 CreateRoundButtonControl(
64081   WindowRef inWindow,
64082   const Rect * inBoundsRect,
64083   ControlRoundButtonSize inSize,
64084   ControlButtonContentInfo * inContent,
64085   ControlRef * outControl) ;
64086 enum {
64087   kControlKindDataBrowser = 'datb'
64088 };
64089
64090
64091 enum {
64092   errDataBrowserNotConfigured = -4970,
64093   errDataBrowserItemNotFound = -4971,
64094   errDataBrowserItemNotAdded = -4975,
64095   errDataBrowserPropertyNotFound = -4972,
64096   errDataBrowserInvalidPropertyPart = -4973,
64097   errDataBrowserInvalidPropertyData = -4974,
64098   errDataBrowserPropertyNotSupported = -4979
64099 };
64100
64101 enum {
64102
64103   kControlDataBrowserIncludesFrameAndFocusTag = 'brdr',
64104   kControlDataBrowserKeyFilterTag = kControlEditTextKeyFilterTag,
64105   kControlDataBrowserEditTextKeyFilterTag = kControlDataBrowserKeyFilterTag,
64106   kControlDataBrowserEditTextValidationProcTag = kControlEditTextValidationProcTag
64107 };
64108
64109
64110 typedef OSType DataBrowserViewStyle;
64111 enum {
64112   kDataBrowserNoView = 0x3F3F3F3F,
64113   kDataBrowserListView = 'lstv',
64114   kDataBrowserColumnView = 'clmv'
64115 };
64116
64117
64118 typedef UInt32 DataBrowserSelectionFlags;
64119 enum {
64120   kDataBrowserDragSelect = 1 << 0,
64121   kDataBrowserSelectOnlyOne = 1 << 1,
64122   kDataBrowserResetSelection = 1 << 2,
64123   kDataBrowserCmdTogglesSelection = 1 << 3,
64124   kDataBrowserNoDisjointSelection = 1 << 4,
64125   kDataBrowserAlwaysExtendSelection = 1 << 5,
64126   kDataBrowserNeverEmptySelectionSet = 1 << 6
64127 };
64128
64129
64130 typedef UInt16 DataBrowserSortOrder;
64131 enum {
64132   kDataBrowserOrderUndefined = 0,
64133   kDataBrowserOrderIncreasing = 1,
64134   kDataBrowserOrderDecreasing = 2
64135 };
64136
64137
64138 typedef UInt32 DataBrowserItemID;
64139 enum {
64140   kDataBrowserNoItem = 0L
64141 };
64142
64143 typedef UInt32 DataBrowserItemState;
64144 enum {
64145   kDataBrowserItemNoState = 0,
64146   kDataBrowserItemAnyState = (unsigned long)(-1),
64147   kDataBrowserItemIsSelected = 1 << 0,
64148   kDataBrowserContainerIsOpen = 1 << 1,
64149   kDataBrowserItemIsDragTarget = 1 << 2
64150 };
64151
64152
64153 typedef UInt8 DataBrowserRevealOptions;
64154 enum {
64155   kDataBrowserRevealOnly = 0,
64156   kDataBrowserRevealAndCenterInView = 1 << 0,
64157   kDataBrowserRevealWithoutSelecting = 1 << 1
64158 };
64159
64160
64161 typedef UInt32 DataBrowserSetOption;
64162 enum {
64163   kDataBrowserItemsAdd = 0,
64164   kDataBrowserItemsAssign = 1,
64165   kDataBrowserItemsToggle = 2,
64166   kDataBrowserItemsRemove = 3
64167 };
64168
64169
64170 typedef UInt32 DataBrowserSelectionAnchorDirection;
64171 enum {
64172   kDataBrowserSelectionAnchorUp = 0,
64173   kDataBrowserSelectionAnchorDown = 1,
64174   kDataBrowserSelectionAnchorLeft = 2,
64175   kDataBrowserSelectionAnchorRight = 3
64176 };
64177
64178
64179 typedef UInt32 DataBrowserEditCommand;
64180 enum {
64181   kDataBrowserEditMsgUndo = kHICommandUndo,
64182   kDataBrowserEditMsgRedo = kHICommandRedo,
64183   kDataBrowserEditMsgCut = kHICommandCut,
64184   kDataBrowserEditMsgCopy = kHICommandCopy,
64185   kDataBrowserEditMsgPaste = kHICommandPaste,
64186   kDataBrowserEditMsgClear = kHICommandClear,
64187   kDataBrowserEditMsgSelectAll = kHICommandSelectAll
64188 };
64189
64190
64191 typedef UInt32 DataBrowserItemNotification;
64192 enum {
64193   kDataBrowserItemAdded = 1,
64194   kDataBrowserItemRemoved = 2,
64195   kDataBrowserEditStarted = 3,
64196   kDataBrowserEditStopped = 4,
64197   kDataBrowserItemSelected = 5,
64198   kDataBrowserItemDeselected = 6,
64199   kDataBrowserItemDoubleClicked = 7,
64200   kDataBrowserContainerOpened = 8,
64201   kDataBrowserContainerClosing = 9,
64202   kDataBrowserContainerClosed = 10,
64203   kDataBrowserContainerSorting = 11,
64204   kDataBrowserContainerSorted = 12,
64205   kDataBrowserUserToggledContainer = 16,
64206   kDataBrowserTargetChanged = 15,
64207   kDataBrowserUserStateChanged = 13,
64208   kDataBrowserSelectionSetChanged = 14
64209 };
64210
64211
64212
64213 typedef UInt32 DataBrowserPropertyID;
64214 enum {
64215
64216   kDataBrowserItemNoProperty = 0L,
64217   kDataBrowserItemIsActiveProperty = 1L,
64218   kDataBrowserItemIsSelectableProperty = 2L,
64219   kDataBrowserItemIsEditableProperty = 3L,
64220   kDataBrowserItemIsContainerProperty = 4L,
64221   kDataBrowserContainerIsOpenableProperty = 5L,
64222   kDataBrowserContainerIsClosableProperty = 6L,
64223   kDataBrowserContainerIsSortableProperty = 7L,
64224   kDataBrowserItemSelfIdentityProperty = 8L,
64225   kDataBrowserContainerAliasIDProperty = 9L,
64226   kDataBrowserColumnViewPreviewProperty = 10L,
64227   kDataBrowserItemParentContainerProperty = 11L
64228 };
64229
64230
64231
64232
64233 typedef OSType DataBrowserPropertyType;
64234 enum {
64235
64236   kDataBrowserCustomType = 0x3F3F3F3F,
64237   kDataBrowserIconType = 'icnr',
64238   kDataBrowserTextType = 'text',
64239   kDataBrowserDateTimeType = 'date',
64240   kDataBrowserSliderType = 'sldr',
64241   kDataBrowserCheckboxType = 'chbx',
64242   kDataBrowserProgressBarType = 'prog',
64243   kDataBrowserRelevanceRankType = 'rank',
64244   kDataBrowserPopupMenuType = 'menu',
64245   kDataBrowserIconAndTextType = 'ticn'
64246 };
64247
64248
64249
64250
64251 typedef OSType DataBrowserPropertyPart;
64252 enum {
64253   kDataBrowserPropertyEnclosingPart = 0L,
64254   kDataBrowserPropertyContentPart = '----',
64255   kDataBrowserPropertyDisclosurePart = 'disc',
64256   kDataBrowserPropertyTextPart = kDataBrowserTextType,
64257   kDataBrowserPropertyIconPart = kDataBrowserIconType,
64258   kDataBrowserPropertySliderPart = kDataBrowserSliderType,
64259   kDataBrowserPropertyCheckboxPart = kDataBrowserCheckboxType,
64260   kDataBrowserPropertyProgressBarPart = kDataBrowserProgressBarType,
64261   kDataBrowserPropertyRelevanceRankPart = kDataBrowserRelevanceRankType
64262 };
64263
64264
64265 typedef unsigned long DataBrowserPropertyFlags;
64266
64267 enum {
64268   kDataBrowserUniversalPropertyFlagsMask = 0xFF,
64269   kDataBrowserPropertyIsMutable = 1 << 0,
64270   kDataBrowserDefaultPropertyFlags = 0 << 0,
64271   kDataBrowserUniversalPropertyFlags = kDataBrowserUniversalPropertyFlagsMask,
64272   kDataBrowserPropertyIsEditable = kDataBrowserPropertyIsMutable
64273 };
64274
64275
64276 enum {
64277   kDataBrowserPropertyFlagsOffset = 8,
64278   kDataBrowserPropertyFlagsMask = 0xFF << kDataBrowserPropertyFlagsOffset,
64279   kDataBrowserCheckboxTriState = 1 << kDataBrowserPropertyFlagsOffset,
64280   kDataBrowserDateTimeRelative = 1 << (kDataBrowserPropertyFlagsOffset),
64281   kDataBrowserDateTimeDateOnly = 1 << (kDataBrowserPropertyFlagsOffset + 1),
64282   kDataBrowserDateTimeTimeOnly = 1 << (kDataBrowserPropertyFlagsOffset + 2),
64283   kDataBrowserDateTimeSecondsToo = 1 << (kDataBrowserPropertyFlagsOffset + 3),
64284   kDataBrowserSliderPlainThumb = kThemeThumbPlain << kDataBrowserPropertyFlagsOffset,
64285   kDataBrowserSliderUpwardThumb = kThemeThumbUpward << kDataBrowserPropertyFlagsOffset,
64286   kDataBrowserSliderDownwardThumb = kThemeThumbDownward << kDataBrowserPropertyFlagsOffset,
64287   kDataBrowserDoNotTruncateText = 3 << kDataBrowserPropertyFlagsOffset,
64288   kDataBrowserTruncateTextAtEnd = 2 << kDataBrowserPropertyFlagsOffset,
64289   kDataBrowserTruncateTextMiddle = 0 << kDataBrowserPropertyFlagsOffset,
64290   kDataBrowserTruncateTextAtStart = 1 << kDataBrowserPropertyFlagsOffset,
64291   kDataBrowserPropertyModificationFlags = kDataBrowserPropertyFlagsMask,
64292   kDataBrowserRelativeDateTime = kDataBrowserDateTimeRelative
64293 };
64294
64295
64296
64297
64298
64299 enum {
64300   kDataBrowserViewSpecificFlagsOffset = 16,
64301   kDataBrowserViewSpecificFlagsMask = 0xFF << kDataBrowserViewSpecificFlagsOffset,
64302   kDataBrowserViewSpecificPropertyFlags = kDataBrowserViewSpecificFlagsMask
64303 };
64304
64305
64306 enum {
64307   kDataBrowserClientPropertyFlagsOffset = 24,
64308   kDataBrowserClientPropertyFlagsMask = (unsigned long)(0xFF << kDataBrowserClientPropertyFlagsOffset)
64309 };
64310
64311
64312 struct DataBrowserPropertyDesc {
64313   DataBrowserPropertyID propertyID;
64314   DataBrowserPropertyType propertyType;
64315   DataBrowserPropertyFlags propertyFlags;
64316 };
64317 typedef struct DataBrowserPropertyDesc DataBrowserPropertyDesc;
64318
64319 typedef void ( * DataBrowserItemProcPtr)(DataBrowserItemID item, DataBrowserItemState state, void *clientData);
64320 typedef DataBrowserItemProcPtr DataBrowserItemUPP;
64321 extern DataBrowserItemUPP
64322 NewDataBrowserItemUPP(DataBrowserItemProcPtr userRoutine) ;
64323 extern void
64324 DisposeDataBrowserItemUPP(DataBrowserItemUPP userUPP) ;
64325 extern void
64326 InvokeDataBrowserItemUPP(
64327   DataBrowserItemID item,
64328   DataBrowserItemState state,
64329   void * clientData,
64330   DataBrowserItemUPP userUPP) ;
64331 extern OSStatus
64332 CreateDataBrowserControl(
64333   WindowRef window,
64334   const Rect * boundsRect,
64335   DataBrowserViewStyle style,
64336   ControlRef * outControl) ;
64337 extern OSStatus
64338 GetDataBrowserViewStyle(
64339   ControlRef browser,
64340   DataBrowserViewStyle * style) ;
64341 extern OSStatus
64342 SetDataBrowserViewStyle(
64343   ControlRef browser,
64344   DataBrowserViewStyle style) ;
64345 extern OSStatus
64346 AddDataBrowserItems(
64347   ControlRef browser,
64348   DataBrowserItemID container,
64349   UInt32 numItems,
64350   const DataBrowserItemID * items,
64351   DataBrowserPropertyID preSortProperty) ;
64352 extern OSStatus
64353 RemoveDataBrowserItems(
64354   ControlRef browser,
64355   DataBrowserItemID container,
64356   UInt32 numItems,
64357   const DataBrowserItemID * items,
64358   DataBrowserPropertyID preSortProperty) ;
64359 extern OSStatus
64360 UpdateDataBrowserItems(
64361   ControlRef browser,
64362   DataBrowserItemID container,
64363   UInt32 numItems,
64364   const DataBrowserItemID * items,
64365   DataBrowserPropertyID preSortProperty,
64366   DataBrowserPropertyID propertyID) ;
64367 extern Boolean
64368 EnableDataBrowserEditCommand(
64369   ControlRef browser,
64370   DataBrowserEditCommand command) ;
64371 extern OSStatus
64372 ExecuteDataBrowserEditCommand(
64373   ControlRef browser,
64374   DataBrowserEditCommand command) ;
64375 extern OSStatus
64376 GetDataBrowserSelectionAnchor(
64377   ControlRef browser,
64378   DataBrowserItemID * first,
64379   DataBrowserItemID * last) ;
64380 extern OSStatus
64381 MoveDataBrowserSelectionAnchor(
64382   ControlRef browser,
64383   DataBrowserSelectionAnchorDirection direction,
64384   Boolean extendSelection) ;
64385 extern OSStatus
64386 OpenDataBrowserContainer(
64387   ControlRef browser,
64388   DataBrowserItemID container) ;
64389 extern OSStatus
64390 CloseDataBrowserContainer(
64391   ControlRef browser,
64392   DataBrowserItemID container) ;
64393 extern OSStatus
64394 SortDataBrowserContainer(
64395   ControlRef browser,
64396   DataBrowserItemID container,
64397   Boolean sortChildren) ;
64398 extern OSStatus
64399 GetDataBrowserItems(
64400   ControlRef browser,
64401   DataBrowserItemID container,
64402   Boolean recurse,
64403   DataBrowserItemState state,
64404   Handle items) ;
64405 extern OSStatus
64406 GetDataBrowserItemCount(
64407   ControlRef browser,
64408   DataBrowserItemID container,
64409   Boolean recurse,
64410   DataBrowserItemState state,
64411   UInt32 * numItems) ;
64412 extern OSStatus
64413 ForEachDataBrowserItem(
64414   ControlRef browser,
64415   DataBrowserItemID container,
64416   Boolean recurse,
64417   DataBrowserItemState state,
64418   DataBrowserItemUPP callback,
64419   void * clientData) ;
64420 extern Boolean
64421 IsDataBrowserItemSelected(
64422   ControlRef browser,
64423   DataBrowserItemID item) ;
64424 extern OSStatus
64425 GetDataBrowserItemState(
64426   ControlRef browser,
64427   DataBrowserItemID item,
64428   DataBrowserItemState * state) ;
64429 extern OSStatus
64430 RevealDataBrowserItem(
64431   ControlRef browser,
64432   DataBrowserItemID item,
64433   DataBrowserPropertyID propertyID,
64434   DataBrowserRevealOptions options) ;
64435 extern OSStatus
64436 SetDataBrowserSelectedItems(
64437   ControlRef browser,
64438   UInt32 numItems,
64439   const DataBrowserItemID * items,
64440   DataBrowserSetOption operation) ;
64441 extern OSStatus
64442 SetDataBrowserUserState(
64443   ControlRef browser,
64444   CFDataRef stateInfo) ;
64445 extern OSStatus
64446 GetDataBrowserUserState(
64447   ControlRef browser,
64448   CFDataRef * stateInfo) ;
64449 extern OSStatus
64450 SetDataBrowserActiveItems(
64451   ControlRef browser,
64452   Boolean active) ;
64453 extern OSStatus
64454 GetDataBrowserActiveItems(
64455   ControlRef browser,
64456   Boolean * active) ;
64457 extern OSStatus
64458 SetDataBrowserScrollBarInset(
64459   ControlRef browser,
64460   Rect * insetRect) ;
64461 extern OSStatus
64462 GetDataBrowserScrollBarInset(
64463   ControlRef browser,
64464   Rect * insetRect) ;
64465 extern OSStatus
64466 SetDataBrowserTarget(
64467   ControlRef browser,
64468   DataBrowserItemID target) ;
64469 extern OSStatus
64470 GetDataBrowserTarget(
64471   ControlRef browser,
64472   DataBrowserItemID * target) ;
64473 extern OSStatus
64474 SetDataBrowserSortOrder(
64475   ControlRef browser,
64476   DataBrowserSortOrder order) ;
64477 extern OSStatus
64478 GetDataBrowserSortOrder(
64479   ControlRef browser,
64480   DataBrowserSortOrder * order) ;
64481 extern OSStatus
64482 SetDataBrowserScrollPosition(
64483   ControlRef browser,
64484   UInt32 top,
64485   UInt32 left) ;
64486 extern OSStatus
64487 GetDataBrowserScrollPosition(
64488   ControlRef browser,
64489   UInt32 * top,
64490   UInt32 * left) ;
64491 extern OSStatus
64492 SetDataBrowserHasScrollBars(
64493   ControlRef browser,
64494   Boolean horiz,
64495   Boolean vert) ;
64496 extern OSStatus
64497 GetDataBrowserHasScrollBars(
64498   ControlRef browser,
64499   Boolean * horiz,
64500   Boolean * vert) ;
64501 extern OSStatus
64502 SetDataBrowserSortProperty(
64503   ControlRef browser,
64504   DataBrowserPropertyID property) ;
64505 extern OSStatus
64506 GetDataBrowserSortProperty(
64507   ControlRef browser,
64508   DataBrowserPropertyID * property) ;
64509 extern OSStatus
64510 SetDataBrowserSelectionFlags(
64511   ControlRef browser,
64512   DataBrowserSelectionFlags selectionFlags) ;
64513 extern OSStatus
64514 GetDataBrowserSelectionFlags(
64515   ControlRef browser,
64516   DataBrowserSelectionFlags * selectionFlags) ;
64517 extern OSStatus
64518 SetDataBrowserPropertyFlags(
64519   ControlRef browser,
64520   DataBrowserPropertyID property,
64521   DataBrowserPropertyFlags flags) ;
64522 extern OSStatus
64523 GetDataBrowserPropertyFlags(
64524   ControlRef browser,
64525   DataBrowserPropertyID property,
64526   DataBrowserPropertyFlags * flags) ;
64527 extern OSStatus
64528 SetDataBrowserEditText(
64529   ControlRef browser,
64530   CFStringRef text) ;
64531 extern OSStatus
64532 CopyDataBrowserEditText(
64533   ControlRef browser,
64534   CFStringRef * text) ;
64535 extern OSStatus
64536 GetDataBrowserEditText(
64537   ControlRef browser,
64538   CFMutableStringRef text) ;
64539 extern OSStatus
64540 SetDataBrowserEditItem(
64541   ControlRef browser,
64542   DataBrowserItemID item,
64543   DataBrowserPropertyID property) ;
64544 extern OSStatus
64545 GetDataBrowserEditItem(
64546   ControlRef browser,
64547   DataBrowserItemID * item,
64548   DataBrowserPropertyID * property) ;
64549 extern OSStatus
64550 GetDataBrowserItemPartBounds(
64551   ControlRef browser,
64552   DataBrowserItemID item,
64553   DataBrowserPropertyID property,
64554   DataBrowserPropertyPart part,
64555   Rect * bounds) ;
64556
64557
64558
64559
64560
64561 typedef void * DataBrowserItemDataRef;
64562 extern OSStatus
64563 SetDataBrowserItemDataIcon(
64564   DataBrowserItemDataRef itemData,
64565   IconRef theData) ;
64566 extern OSStatus
64567 GetDataBrowserItemDataIcon(
64568   DataBrowserItemDataRef itemData,
64569   IconRef * theData) ;
64570 extern OSStatus
64571 SetDataBrowserItemDataText(
64572   DataBrowserItemDataRef itemData,
64573   CFStringRef theData) ;
64574 extern OSStatus
64575 GetDataBrowserItemDataText(
64576   DataBrowserItemDataRef itemData,
64577   CFStringRef * theData) ;
64578 extern OSStatus
64579 SetDataBrowserItemDataValue(
64580   DataBrowserItemDataRef itemData,
64581   SInt32 theData) ;
64582 extern OSStatus
64583 GetDataBrowserItemDataValue(
64584   DataBrowserItemDataRef itemData,
64585   SInt32 * theData) ;
64586 extern OSStatus
64587 SetDataBrowserItemDataMinimum(
64588   DataBrowserItemDataRef itemData,
64589   SInt32 theData) ;
64590 extern OSStatus
64591 GetDataBrowserItemDataMinimum(
64592   DataBrowserItemDataRef itemData,
64593   SInt32 * theData) ;
64594 extern OSStatus
64595 SetDataBrowserItemDataMaximum(
64596   DataBrowserItemDataRef itemData,
64597   SInt32 theData) ;
64598 extern OSStatus
64599 GetDataBrowserItemDataMaximum(
64600   DataBrowserItemDataRef itemData,
64601   SInt32 * theData) ;
64602 extern OSStatus
64603 SetDataBrowserItemDataBooleanValue(
64604   DataBrowserItemDataRef itemData,
64605   Boolean theData) ;
64606 extern OSStatus
64607 GetDataBrowserItemDataBooleanValue(
64608   DataBrowserItemDataRef itemData,
64609   Boolean * theData) ;
64610 extern OSStatus
64611 SetDataBrowserItemDataMenuRef(
64612   DataBrowserItemDataRef itemData,
64613   MenuRef theData) ;
64614 extern OSStatus
64615 GetDataBrowserItemDataMenuRef(
64616   DataBrowserItemDataRef itemData,
64617   MenuRef * theData) ;
64618 extern OSStatus
64619 SetDataBrowserItemDataRGBColor(
64620   DataBrowserItemDataRef itemData,
64621   const RGBColor * theData) ;
64622 extern OSStatus
64623 GetDataBrowserItemDataRGBColor(
64624   DataBrowserItemDataRef itemData,
64625   RGBColor * theData) ;
64626 extern OSStatus
64627 SetDataBrowserItemDataDrawState(
64628   DataBrowserItemDataRef itemData,
64629   ThemeDrawState theData) ;
64630 extern OSStatus
64631 GetDataBrowserItemDataDrawState(
64632   DataBrowserItemDataRef itemData,
64633   ThemeDrawState * theData) ;
64634 extern OSStatus
64635 SetDataBrowserItemDataButtonValue(
64636   DataBrowserItemDataRef itemData,
64637   ThemeButtonValue theData) ;
64638 extern OSStatus
64639 GetDataBrowserItemDataButtonValue(
64640   DataBrowserItemDataRef itemData,
64641   ThemeButtonValue * theData) ;
64642 extern OSStatus
64643 SetDataBrowserItemDataIconTransform(
64644   DataBrowserItemDataRef itemData,
64645   IconTransformType theData) ;
64646 extern OSStatus
64647 GetDataBrowserItemDataIconTransform(
64648   DataBrowserItemDataRef itemData,
64649   IconTransformType * theData) ;
64650 extern OSStatus
64651 SetDataBrowserItemDataDateTime(
64652   DataBrowserItemDataRef itemData,
64653   long theData) ;
64654 extern OSStatus
64655 GetDataBrowserItemDataDateTime(
64656   DataBrowserItemDataRef itemData,
64657   long * theData) ;
64658 extern OSStatus
64659 SetDataBrowserItemDataLongDateTime(
64660   DataBrowserItemDataRef itemData,
64661   const LongDateTime * theData) ;
64662 extern OSStatus
64663 GetDataBrowserItemDataLongDateTime(
64664   DataBrowserItemDataRef itemData,
64665   LongDateTime * theData) ;
64666 extern OSStatus
64667 SetDataBrowserItemDataItemID(
64668   DataBrowserItemDataRef itemData,
64669   DataBrowserItemID theData) ;
64670 extern OSStatus
64671 GetDataBrowserItemDataItemID(
64672   DataBrowserItemDataRef itemData,
64673   DataBrowserItemID * theData) ;
64674 extern OSStatus
64675 GetDataBrowserItemDataProperty(
64676   DataBrowserItemDataRef itemData,
64677   DataBrowserPropertyID * theData) ;
64678
64679
64680
64681
64682
64683
64684 typedef OSStatus ( * DataBrowserItemDataProcPtr)(ControlRef browser, DataBrowserItemID item, DataBrowserPropertyID property, DataBrowserItemDataRef itemData, Boolean setValue);
64685 typedef DataBrowserItemDataProcPtr DataBrowserItemDataUPP;
64686
64687
64688 typedef Boolean ( * DataBrowserItemCompareProcPtr)(ControlRef browser, DataBrowserItemID itemOne, DataBrowserItemID itemTwo, DataBrowserPropertyID sortProperty);
64689 typedef DataBrowserItemCompareProcPtr DataBrowserItemCompareUPP;
64690 typedef void ( * DataBrowserItemNotificationWithItemProcPtr)(ControlRef browser, DataBrowserItemID item, DataBrowserItemNotification message, DataBrowserItemDataRef itemData);
64691 typedef void ( * DataBrowserItemNotificationProcPtr)(ControlRef browser, DataBrowserItemID item, DataBrowserItemNotification message);
64692 typedef DataBrowserItemNotificationWithItemProcPtr DataBrowserItemNotificationWithItemUPP;
64693 typedef DataBrowserItemNotificationProcPtr DataBrowserItemNotificationUPP;
64694
64695
64696
64697 typedef Boolean ( * DataBrowserAddDragItemProcPtr)(ControlRef browser, DragReference theDrag, DataBrowserItemID item, ItemReference *itemRef);
64698 typedef Boolean ( * DataBrowserAcceptDragProcPtr)(ControlRef browser, DragReference theDrag, DataBrowserItemID item);
64699 typedef Boolean ( * DataBrowserReceiveDragProcPtr)(ControlRef browser, DragReference theDrag, DataBrowserItemID item);
64700 typedef void ( * DataBrowserPostProcessDragProcPtr)(ControlRef browser, DragReference theDrag, OSStatus trackDragResult);
64701 typedef DataBrowserAddDragItemProcPtr DataBrowserAddDragItemUPP;
64702 typedef DataBrowserAcceptDragProcPtr DataBrowserAcceptDragUPP;
64703 typedef DataBrowserReceiveDragProcPtr DataBrowserReceiveDragUPP;
64704 typedef DataBrowserPostProcessDragProcPtr DataBrowserPostProcessDragUPP;
64705
64706
64707 typedef void ( * DataBrowserGetContextualMenuProcPtr)(ControlRef browser, MenuRef *menu, UInt32 *helpType, CFStringRef *helpItemString, AEDesc *selection);
64708 typedef void ( * DataBrowserSelectContextualMenuProcPtr)(ControlRef browser, MenuRef menu, UInt32 selectionType, SInt16 menuID, MenuItemIndex menuItem);
64709 typedef DataBrowserGetContextualMenuProcPtr DataBrowserGetContextualMenuUPP;
64710 typedef DataBrowserSelectContextualMenuProcPtr DataBrowserSelectContextualMenuUPP;
64711
64712
64713 typedef void ( * DataBrowserItemHelpContentProcPtr)(ControlRef browser, DataBrowserItemID item, DataBrowserPropertyID property, HMContentRequest inRequest, HMContentProvidedType *outContentProvided, HMHelpContentPtr ioHelpContent);
64714 typedef DataBrowserItemHelpContentProcPtr DataBrowserItemHelpContentUPP;
64715 extern DataBrowserItemDataUPP
64716 NewDataBrowserItemDataUPP(DataBrowserItemDataProcPtr userRoutine) ;
64717 extern DataBrowserItemCompareUPP
64718 NewDataBrowserItemCompareUPP(DataBrowserItemCompareProcPtr userRoutine) ;
64719 extern DataBrowserItemNotificationWithItemUPP
64720 NewDataBrowserItemNotificationWithItemUPP(DataBrowserItemNotificationWithItemProcPtr userRoutine) ;
64721 extern DataBrowserItemNotificationUPP
64722 NewDataBrowserItemNotificationUPP(DataBrowserItemNotificationProcPtr userRoutine) ;
64723 extern DataBrowserAddDragItemUPP
64724 NewDataBrowserAddDragItemUPP(DataBrowserAddDragItemProcPtr userRoutine) ;
64725 extern DataBrowserAcceptDragUPP
64726 NewDataBrowserAcceptDragUPP(DataBrowserAcceptDragProcPtr userRoutine) ;
64727 extern DataBrowserReceiveDragUPP
64728 NewDataBrowserReceiveDragUPP(DataBrowserReceiveDragProcPtr userRoutine) ;
64729 extern DataBrowserPostProcessDragUPP
64730 NewDataBrowserPostProcessDragUPP(DataBrowserPostProcessDragProcPtr userRoutine) ;
64731 extern DataBrowserGetContextualMenuUPP
64732 NewDataBrowserGetContextualMenuUPP(DataBrowserGetContextualMenuProcPtr userRoutine) ;
64733 extern DataBrowserSelectContextualMenuUPP
64734 NewDataBrowserSelectContextualMenuUPP(DataBrowserSelectContextualMenuProcPtr userRoutine) ;
64735 extern DataBrowserItemHelpContentUPP
64736 NewDataBrowserItemHelpContentUPP(DataBrowserItemHelpContentProcPtr userRoutine) ;
64737 extern void
64738 DisposeDataBrowserItemDataUPP(DataBrowserItemDataUPP userUPP) ;
64739 extern void
64740 DisposeDataBrowserItemCompareUPP(DataBrowserItemCompareUPP userUPP) ;
64741 extern void
64742 DisposeDataBrowserItemNotificationWithItemUPP(DataBrowserItemNotificationWithItemUPP userUPP) ;
64743 extern void
64744 DisposeDataBrowserItemNotificationUPP(DataBrowserItemNotificationUPP userUPP) ;
64745 extern void
64746 DisposeDataBrowserAddDragItemUPP(DataBrowserAddDragItemUPP userUPP) ;
64747 extern void
64748 DisposeDataBrowserAcceptDragUPP(DataBrowserAcceptDragUPP userUPP) ;
64749 extern void
64750 DisposeDataBrowserReceiveDragUPP(DataBrowserReceiveDragUPP userUPP) ;
64751 extern void
64752 DisposeDataBrowserPostProcessDragUPP(DataBrowserPostProcessDragUPP userUPP) ;
64753 extern void
64754 DisposeDataBrowserGetContextualMenuUPP(DataBrowserGetContextualMenuUPP userUPP) ;
64755 extern void
64756 DisposeDataBrowserSelectContextualMenuUPP(DataBrowserSelectContextualMenuUPP userUPP) ;
64757 extern void
64758 DisposeDataBrowserItemHelpContentUPP(DataBrowserItemHelpContentUPP userUPP) ;
64759 extern OSStatus
64760 InvokeDataBrowserItemDataUPP(
64761   ControlRef browser,
64762   DataBrowserItemID item,
64763   DataBrowserPropertyID property,
64764   DataBrowserItemDataRef itemData,
64765   Boolean setValue,
64766   DataBrowserItemDataUPP userUPP) ;
64767 extern Boolean
64768 InvokeDataBrowserItemCompareUPP(
64769   ControlRef browser,
64770   DataBrowserItemID itemOne,
64771   DataBrowserItemID itemTwo,
64772   DataBrowserPropertyID sortProperty,
64773   DataBrowserItemCompareUPP userUPP) ;
64774 extern void
64775 InvokeDataBrowserItemNotificationWithItemUPP(
64776   ControlRef browser,
64777   DataBrowserItemID item,
64778   DataBrowserItemNotification message,
64779   DataBrowserItemDataRef itemData,
64780   DataBrowserItemNotificationWithItemUPP userUPP) ;
64781 extern void
64782 InvokeDataBrowserItemNotificationUPP(
64783   ControlRef browser,
64784   DataBrowserItemID item,
64785   DataBrowserItemNotification message,
64786   DataBrowserItemNotificationUPP userUPP) ;
64787 extern Boolean
64788 InvokeDataBrowserAddDragItemUPP(
64789   ControlRef browser,
64790   DragReference theDrag,
64791   DataBrowserItemID item,
64792   ItemReference * itemRef,
64793   DataBrowserAddDragItemUPP userUPP) ;
64794 extern Boolean
64795 InvokeDataBrowserAcceptDragUPP(
64796   ControlRef browser,
64797   DragReference theDrag,
64798   DataBrowserItemID item,
64799   DataBrowserAcceptDragUPP userUPP) ;
64800 extern Boolean
64801 InvokeDataBrowserReceiveDragUPP(
64802   ControlRef browser,
64803   DragReference theDrag,
64804   DataBrowserItemID item,
64805   DataBrowserReceiveDragUPP userUPP) ;
64806 extern void
64807 InvokeDataBrowserPostProcessDragUPP(
64808   ControlRef browser,
64809   DragReference theDrag,
64810   OSStatus trackDragResult,
64811   DataBrowserPostProcessDragUPP userUPP) ;
64812 extern void
64813 InvokeDataBrowserGetContextualMenuUPP(
64814   ControlRef browser,
64815   MenuRef * menu,
64816   UInt32 * helpType,
64817   CFStringRef * helpItemString,
64818   AEDesc * selection,
64819   DataBrowserGetContextualMenuUPP userUPP) ;
64820 extern void
64821 InvokeDataBrowserSelectContextualMenuUPP(
64822   ControlRef browser,
64823   MenuRef menu,
64824   UInt32 selectionType,
64825   SInt16 menuID,
64826   MenuItemIndex menuItem,
64827   DataBrowserSelectContextualMenuUPP userUPP) ;
64828 extern void
64829 InvokeDataBrowserItemHelpContentUPP(
64830   ControlRef browser,
64831   DataBrowserItemID item,
64832   DataBrowserPropertyID property,
64833   HMContentRequest inRequest,
64834   HMContentProvidedType * outContentProvided,
64835   HMHelpContentPtr ioHelpContent,
64836   DataBrowserItemHelpContentUPP userUPP) ;
64837
64838
64839 enum {
64840   kDataBrowserLatestCallbacks = 0
64841 };
64842
64843 struct DataBrowserCallbacks {
64844   UInt32 version;
64845
64846   union {
64847     struct {
64848       DataBrowserItemDataUPP itemDataCallback;
64849       DataBrowserItemCompareUPP itemCompareCallback;
64850       DataBrowserItemNotificationUPP itemNotificationCallback;
64851
64852       DataBrowserAddDragItemUPP addDragItemCallback;
64853       DataBrowserAcceptDragUPP acceptDragCallback;
64854       DataBrowserReceiveDragUPP receiveDragCallback;
64855       DataBrowserPostProcessDragUPP postProcessDragCallback;
64856
64857       DataBrowserItemHelpContentUPP itemHelpContentCallback;
64858       DataBrowserGetContextualMenuUPP getContextualMenuCallback;
64859       DataBrowserSelectContextualMenuUPP selectContextualMenuCallback;
64860     } v1;
64861   } u;
64862 };
64863 typedef struct DataBrowserCallbacks DataBrowserCallbacks;
64864 extern OSStatus
64865 InitDataBrowserCallbacks(DataBrowserCallbacks * callbacks) ;
64866 extern OSStatus
64867 GetDataBrowserCallbacks(
64868   ControlRef browser,
64869   DataBrowserCallbacks * callbacks) ;
64870 extern OSStatus
64871 SetDataBrowserCallbacks(
64872   ControlRef browser,
64873   const DataBrowserCallbacks * callbacks) ;
64874
64875
64876
64877
64878
64879 typedef unsigned long DataBrowserDragFlags;
64880 typedef SInt16 DataBrowserTrackingResult;
64881 enum {
64882   kDataBrowserContentHit = 1,
64883   kDataBrowserNothingHit = 0,
64884   kDataBrowserStopTracking = -1
64885 };
64886
64887 typedef void ( * DataBrowserDrawItemProcPtr)(ControlRef browser, DataBrowserItemID item, DataBrowserPropertyID property, DataBrowserItemState itemState, const Rect *theRect, SInt16 gdDepth, Boolean colorDevice);
64888 typedef Boolean ( * DataBrowserEditItemProcPtr)(ControlRef browser, DataBrowserItemID item, DataBrowserPropertyID property, CFStringRef theString, Rect *maxEditTextRect, Boolean *shrinkToFit);
64889 typedef Boolean ( * DataBrowserHitTestProcPtr)(ControlRef browser, DataBrowserItemID itemID, DataBrowserPropertyID property, const Rect *theRect, const Rect *mouseRect);
64890 typedef DataBrowserTrackingResult ( * DataBrowserTrackingProcPtr)(ControlRef browser, DataBrowserItemID itemID, DataBrowserPropertyID property, const Rect *theRect, Point startPt, EventModifiers modifiers);
64891 typedef void ( * DataBrowserItemDragRgnProcPtr)(ControlRef browser, DataBrowserItemID itemID, DataBrowserPropertyID property, const Rect *theRect, RgnHandle dragRgn);
64892 typedef DataBrowserDragFlags ( * DataBrowserItemAcceptDragProcPtr)(ControlRef browser, DataBrowserItemID itemID, DataBrowserPropertyID property, const Rect *theRect, DragReference theDrag);
64893 typedef Boolean ( * DataBrowserItemReceiveDragProcPtr)(ControlRef browser, DataBrowserItemID itemID, DataBrowserPropertyID property, DataBrowserDragFlags dragFlags, DragReference theDrag);
64894 typedef DataBrowserDrawItemProcPtr DataBrowserDrawItemUPP;
64895 typedef DataBrowserEditItemProcPtr DataBrowserEditItemUPP;
64896 typedef DataBrowserHitTestProcPtr DataBrowserHitTestUPP;
64897 typedef DataBrowserTrackingProcPtr DataBrowserTrackingUPP;
64898 typedef DataBrowserItemDragRgnProcPtr DataBrowserItemDragRgnUPP;
64899 typedef DataBrowserItemAcceptDragProcPtr DataBrowserItemAcceptDragUPP;
64900 typedef DataBrowserItemReceiveDragProcPtr DataBrowserItemReceiveDragUPP;
64901 extern DataBrowserDrawItemUPP
64902 NewDataBrowserDrawItemUPP(DataBrowserDrawItemProcPtr userRoutine) ;
64903 extern DataBrowserEditItemUPP
64904 NewDataBrowserEditItemUPP(DataBrowserEditItemProcPtr userRoutine) ;
64905 extern DataBrowserHitTestUPP
64906 NewDataBrowserHitTestUPP(DataBrowserHitTestProcPtr userRoutine) ;
64907 extern DataBrowserTrackingUPP
64908 NewDataBrowserTrackingUPP(DataBrowserTrackingProcPtr userRoutine) ;
64909 extern DataBrowserItemDragRgnUPP
64910 NewDataBrowserItemDragRgnUPP(DataBrowserItemDragRgnProcPtr userRoutine) ;
64911 extern DataBrowserItemAcceptDragUPP
64912 NewDataBrowserItemAcceptDragUPP(DataBrowserItemAcceptDragProcPtr userRoutine) ;
64913 extern DataBrowserItemReceiveDragUPP
64914 NewDataBrowserItemReceiveDragUPP(DataBrowserItemReceiveDragProcPtr userRoutine) ;
64915 extern void
64916 DisposeDataBrowserDrawItemUPP(DataBrowserDrawItemUPP userUPP) ;
64917 extern void
64918 DisposeDataBrowserEditItemUPP(DataBrowserEditItemUPP userUPP) ;
64919 extern void
64920 DisposeDataBrowserHitTestUPP(DataBrowserHitTestUPP userUPP) ;
64921 extern void
64922 DisposeDataBrowserTrackingUPP(DataBrowserTrackingUPP userUPP) ;
64923 extern void
64924 DisposeDataBrowserItemDragRgnUPP(DataBrowserItemDragRgnUPP userUPP) ;
64925 extern void
64926 DisposeDataBrowserItemAcceptDragUPP(DataBrowserItemAcceptDragUPP userUPP) ;
64927 extern void
64928 DisposeDataBrowserItemReceiveDragUPP(DataBrowserItemReceiveDragUPP userUPP) ;
64929 extern void
64930 InvokeDataBrowserDrawItemUPP(
64931   ControlRef browser,
64932   DataBrowserItemID item,
64933   DataBrowserPropertyID property,
64934   DataBrowserItemState itemState,
64935   const Rect * theRect,
64936   SInt16 gdDepth,
64937   Boolean colorDevice,
64938   DataBrowserDrawItemUPP userUPP) ;
64939 extern Boolean
64940 InvokeDataBrowserEditItemUPP(
64941   ControlRef browser,
64942   DataBrowserItemID item,
64943   DataBrowserPropertyID property,
64944   CFStringRef theString,
64945   Rect * maxEditTextRect,
64946   Boolean * shrinkToFit,
64947   DataBrowserEditItemUPP userUPP) ;
64948 extern Boolean
64949 InvokeDataBrowserHitTestUPP(
64950   ControlRef browser,
64951   DataBrowserItemID itemID,
64952   DataBrowserPropertyID property,
64953   const Rect * theRect,
64954   const Rect * mouseRect,
64955   DataBrowserHitTestUPP userUPP) ;
64956 extern DataBrowserTrackingResult
64957 InvokeDataBrowserTrackingUPP(
64958   ControlRef browser,
64959   DataBrowserItemID itemID,
64960   DataBrowserPropertyID property,
64961   const Rect * theRect,
64962   Point startPt,
64963   EventModifiers modifiers,
64964   DataBrowserTrackingUPP userUPP) ;
64965 extern void
64966 InvokeDataBrowserItemDragRgnUPP(
64967   ControlRef browser,
64968   DataBrowserItemID itemID,
64969   DataBrowserPropertyID property,
64970   const Rect * theRect,
64971   RgnHandle dragRgn,
64972   DataBrowserItemDragRgnUPP userUPP) ;
64973 extern DataBrowserDragFlags
64974 InvokeDataBrowserItemAcceptDragUPP(
64975   ControlRef browser,
64976   DataBrowserItemID itemID,
64977   DataBrowserPropertyID property,
64978   const Rect * theRect,
64979   DragReference theDrag,
64980   DataBrowserItemAcceptDragUPP userUPP) ;
64981 extern Boolean
64982 InvokeDataBrowserItemReceiveDragUPP(
64983   ControlRef browser,
64984   DataBrowserItemID itemID,
64985   DataBrowserPropertyID property,
64986   DataBrowserDragFlags dragFlags,
64987   DragReference theDrag,
64988   DataBrowserItemReceiveDragUPP userUPP) ;
64989
64990
64991 enum {
64992   kDataBrowserLatestCustomCallbacks = 0
64993 };
64994
64995 struct DataBrowserCustomCallbacks {
64996
64997   UInt32 version;
64998
64999   union {
65000     struct {
65001       DataBrowserDrawItemUPP drawItemCallback;
65002       DataBrowserEditItemUPP editTextCallback;
65003       DataBrowserHitTestUPP hitTestCallback;
65004       DataBrowserTrackingUPP trackingCallback;
65005
65006       DataBrowserItemDragRgnUPP dragRegionCallback;
65007       DataBrowserItemAcceptDragUPP acceptDragCallback;
65008       DataBrowserItemReceiveDragUPP receiveDragCallback;
65009     } v1;
65010   } u;
65011 };
65012 typedef struct DataBrowserCustomCallbacks DataBrowserCustomCallbacks;
65013 extern OSStatus
65014 InitDataBrowserCustomCallbacks(DataBrowserCustomCallbacks * callbacks) ;
65015 extern OSStatus
65016 GetDataBrowserCustomCallbacks(
65017   ControlRef browser,
65018   DataBrowserCustomCallbacks * callbacks) ;
65019 extern OSStatus
65020 SetDataBrowserCustomCallbacks(
65021   ControlRef browser,
65022   const DataBrowserCustomCallbacks * callbacks) ;
65023
65024
65025
65026
65027
65028
65029 typedef UInt32 DataBrowserTableViewHiliteStyle;
65030 enum {
65031   kDataBrowserTableViewMinimalHilite = 0,
65032   kDataBrowserTableViewFillHilite = 1
65033 };
65034
65035 typedef UInt32 DataBrowserTableViewPropertyFlags;
65036 enum {
65037
65038   kDataBrowserTableViewSelectionColumn = 1 << kDataBrowserViewSpecificFlagsOffset
65039 };
65040
65041
65042
65043 typedef UInt32 DataBrowserTableViewRowIndex;
65044 typedef UInt32 DataBrowserTableViewColumnIndex;
65045 typedef DataBrowserPropertyID DataBrowserTableViewColumnID;
65046 typedef DataBrowserPropertyDesc DataBrowserTableViewColumnDesc;
65047
65048
65049
65050 enum {
65051   kDataBrowserTableViewLastColumn = -1
65052 };
65053 extern OSStatus
65054 RemoveDataBrowserTableViewColumn(
65055   ControlRef browser,
65056   DataBrowserTableViewColumnID column) ;
65057 extern OSStatus
65058 GetDataBrowserTableViewColumnCount(
65059   ControlRef browser,
65060   UInt32 * numColumns) ;
65061 extern OSStatus
65062 SetDataBrowserTableViewHiliteStyle(
65063   ControlRef browser,
65064   DataBrowserTableViewHiliteStyle hiliteStyle) ;
65065 extern OSStatus
65066 GetDataBrowserTableViewHiliteStyle(
65067   ControlRef browser,
65068   DataBrowserTableViewHiliteStyle * hiliteStyle) ;
65069 extern OSStatus
65070 SetDataBrowserTableViewRowHeight(
65071   ControlRef browser,
65072   UInt16 height) ;
65073 extern OSStatus
65074 GetDataBrowserTableViewRowHeight(
65075   ControlRef browser,
65076   UInt16 * height) ;
65077 extern OSStatus
65078 SetDataBrowserTableViewColumnWidth(
65079   ControlRef browser,
65080   UInt16 width) ;
65081 extern OSStatus
65082 GetDataBrowserTableViewColumnWidth(
65083   ControlRef browser,
65084   UInt16 * width) ;
65085 extern OSStatus
65086 SetDataBrowserTableViewItemRowHeight(
65087   ControlRef browser,
65088   DataBrowserItemID item,
65089   UInt16 height) ;
65090 extern OSStatus
65091 GetDataBrowserTableViewItemRowHeight(
65092   ControlRef browser,
65093   DataBrowserItemID item,
65094   UInt16 * height) ;
65095 extern OSStatus
65096 SetDataBrowserTableViewNamedColumnWidth(
65097   ControlRef browser,
65098   DataBrowserTableViewColumnID column,
65099   UInt16 width) ;
65100 extern OSStatus
65101 GetDataBrowserTableViewNamedColumnWidth(
65102   ControlRef browser,
65103   DataBrowserTableViewColumnID column,
65104   UInt16 * width) ;
65105 extern OSStatus
65106 SetDataBrowserTableViewGeometry(
65107   ControlRef browser,
65108   Boolean variableWidthColumns,
65109   Boolean variableHeightRows) ;
65110 extern OSStatus
65111 GetDataBrowserTableViewGeometry(
65112   ControlRef browser,
65113   Boolean * variableWidthColumns,
65114   Boolean * variableHeightRows) ;
65115 extern OSStatus
65116 GetDataBrowserTableViewItemID(
65117   ControlRef browser,
65118   DataBrowserTableViewRowIndex row,
65119   DataBrowserItemID * item) ;
65120 extern OSStatus
65121 SetDataBrowserTableViewItemRow(
65122   ControlRef browser,
65123   DataBrowserItemID item,
65124   DataBrowserTableViewRowIndex row) ;
65125 extern OSStatus
65126 GetDataBrowserTableViewItemRow(
65127   ControlRef browser,
65128   DataBrowserItemID item,
65129   DataBrowserTableViewRowIndex * row) ;
65130 extern OSStatus
65131 SetDataBrowserTableViewColumnPosition(
65132   ControlRef browser,
65133   DataBrowserTableViewColumnID column,
65134   DataBrowserTableViewColumnIndex position) ;
65135 extern OSStatus
65136 GetDataBrowserTableViewColumnPosition(
65137   ControlRef browser,
65138   DataBrowserTableViewColumnID column,
65139   DataBrowserTableViewColumnIndex * position) ;
65140 extern OSStatus
65141 GetDataBrowserTableViewColumnProperty(
65142   ControlRef browser,
65143   DataBrowserTableViewColumnIndex column,
65144   DataBrowserTableViewColumnID * property) ;
65145
65146
65147
65148
65149
65150
65151 typedef UInt32 DataBrowserListViewPropertyFlags;
65152 enum {
65153
65154   kDataBrowserListViewMovableColumn = 1 << (kDataBrowserViewSpecificFlagsOffset + 1),
65155   kDataBrowserListViewSortableColumn = 1 << (kDataBrowserViewSpecificFlagsOffset + 2),
65156   kDataBrowserListViewSelectionColumn = kDataBrowserTableViewSelectionColumn,
65157   kDataBrowserListViewDefaultColumnFlags = kDataBrowserListViewMovableColumn + kDataBrowserListViewSortableColumn
65158 };
65159
65160
65161 enum {
65162   kDataBrowserListViewLatestHeaderDesc = 0
65163 };
65164
65165 struct DataBrowserListViewHeaderDesc {
65166   UInt32 version;
65167
65168   UInt16 minimumWidth;
65169   UInt16 maximumWidth;
65170
65171   SInt16 titleOffset;
65172   CFStringRef titleString;
65173   DataBrowserSortOrder initialOrder;
65174   ControlFontStyleRec btnFontStyle;
65175   ControlButtonContentInfo btnContentInfo;
65176 };
65177 typedef struct DataBrowserListViewHeaderDesc DataBrowserListViewHeaderDesc;
65178 struct DataBrowserListViewColumnDesc {
65179   DataBrowserTableViewColumnDesc propertyDesc;
65180   DataBrowserListViewHeaderDesc headerBtnDesc;
65181 };
65182 typedef struct DataBrowserListViewColumnDesc DataBrowserListViewColumnDesc;
65183
65184 enum {
65185   kDataBrowserListViewAppendColumn = kDataBrowserTableViewLastColumn
65186 };
65187 extern OSStatus
65188 AutoSizeDataBrowserListViewColumns(ControlRef browser) ;
65189 extern OSStatus
65190 AddDataBrowserListViewColumn(
65191   ControlRef browser,
65192   DataBrowserListViewColumnDesc * columnDesc,
65193   DataBrowserTableViewColumnIndex position) ;
65194 extern OSStatus
65195 GetDataBrowserListViewHeaderDesc(
65196   ControlRef browser,
65197   DataBrowserTableViewColumnID column,
65198   DataBrowserListViewHeaderDesc * desc) ;
65199 extern OSStatus
65200 SetDataBrowserListViewHeaderDesc(
65201   ControlRef browser,
65202   DataBrowserTableViewColumnID column,
65203   DataBrowserListViewHeaderDesc * desc) ;
65204 extern OSStatus
65205 SetDataBrowserListViewHeaderBtnHeight(
65206   ControlRef browser,
65207   UInt16 height) ;
65208 extern OSStatus
65209 GetDataBrowserListViewHeaderBtnHeight(
65210   ControlRef browser,
65211   UInt16 * height) ;
65212 extern OSStatus
65213 SetDataBrowserListViewUsePlainBackground(
65214   ControlRef browser,
65215   Boolean usePlainBackground) ;
65216 extern OSStatus
65217 GetDataBrowserListViewUsePlainBackground(
65218   ControlRef browser,
65219   Boolean * usePlainBackground) ;
65220 extern OSStatus
65221 SetDataBrowserListViewDisclosureColumn(
65222   ControlRef browser,
65223   DataBrowserTableViewColumnID column,
65224   Boolean expandableRows) ;
65225 extern OSStatus
65226 GetDataBrowserListViewDisclosureColumn(
65227   ControlRef browser,
65228   DataBrowserTableViewColumnID * column,
65229   Boolean * expandableRows) ;
65230 extern OSStatus
65231 GetDataBrowserColumnViewPath(
65232   ControlRef browser,
65233   Handle path) ;
65234 extern OSStatus
65235 GetDataBrowserColumnViewPathLength(
65236   ControlRef browser,
65237   UInt32 * pathLength) ;
65238 extern OSStatus
65239 SetDataBrowserColumnViewPath(
65240   ControlRef browser,
65241   UInt32 length,
65242   const DataBrowserItemID * path) ;
65243 extern OSStatus
65244 SetDataBrowserColumnViewDisplayType(
65245   ControlRef browser,
65246   DataBrowserPropertyType propertyType) ;
65247 extern OSStatus
65248 GetDataBrowserColumnViewDisplayType(
65249   ControlRef browser,
65250   DataBrowserPropertyType * propertyType) ;
65251 typedef Boolean ( * EditUnicodePostUpdateProcPtr)(UniCharArrayHandle uniText, UniCharCount uniTextLength, UniCharArrayOffset iStartOffset, UniCharArrayOffset iEndOffset, void *refcon);
65252 typedef EditUnicodePostUpdateProcPtr EditUnicodePostUpdateUPP;
65253 extern EditUnicodePostUpdateUPP
65254 NewEditUnicodePostUpdateUPP(EditUnicodePostUpdateProcPtr userRoutine) ;
65255 extern void
65256 DisposeEditUnicodePostUpdateUPP(EditUnicodePostUpdateUPP userUPP) ;
65257 extern Boolean
65258 InvokeEditUnicodePostUpdateUPP(
65259   UniCharArrayHandle uniText,
65260   UniCharCount uniTextLength,
65261   UniCharArrayOffset iStartOffset,
65262   UniCharArrayOffset iEndOffset,
65263   void * refcon,
65264   EditUnicodePostUpdateUPP userUPP) ;
65265
65266
65267
65268 enum {
65269   kControlEditUnicodeTextPostUpdateProcTag = 'upup'
65270 };
65271
65272
65273 enum {
65274   kControlEditUnicodeTextProc = 912,
65275   kControlEditUnicodeTextPasswordProc = 914
65276 };
65277
65278
65279 enum {
65280   kControlKindEditUnicodeText = 'eutx'
65281 };
65282 extern OSStatus
65283 CreateEditUnicodeTextControl(
65284   WindowRef window,
65285   const Rect * boundsRect,
65286   CFStringRef text,
65287   Boolean isPassword,
65288   const ControlFontStyleRec * style,
65289   ControlRef * outControl) ;
65290
65291
65292
65293 enum {
65294   kControlEditTextSingleLineTag = 'sglc'
65295 };
65296
65297
65298 }
65299
65300
65301
65302 extern "C" {
65303
65304
65305
65306
65307 enum {
65308   kTSMTESignature = 'tmTE',
65309   kTSMTEInterfaceType = 'tmTE'
65310 };
65311 enum {
65312   kTSMTEAutoScroll = 1
65313 };
65314
65315
65316
65317
65318 typedef void ( * TSMTEPreUpdateProcPtr)(TEHandle textH, long refCon);
65319 typedef void ( * TSMTEPostUpdateProcPtr)(TEHandle textH, long fixLen, long inputAreaStart, long inputAreaEnd, long pinStart, long pinEnd, long refCon);
65320 typedef TSMTEPreUpdateProcPtr TSMTEPreUpdateUPP;
65321 typedef TSMTEPostUpdateProcPtr TSMTEPostUpdateUPP;
65322
65323
65324
65325 struct TSMTERec {
65326   TEHandle textH;
65327   TSMTEPreUpdateUPP preUpdateProc;
65328   TSMTEPostUpdateUPP postUpdateProc;
65329   long updateFlag;
65330   long refCon;
65331 };
65332 typedef struct TSMTERec TSMTERec;
65333 typedef TSMTERec * TSMTERecPtr;
65334 typedef TSMTERecPtr * TSMTERecHandle;
65335 extern TSMTEPreUpdateUPP
65336 NewTSMTEPreUpdateUPP(TSMTEPreUpdateProcPtr userRoutine) ;
65337 extern TSMTEPostUpdateUPP
65338 NewTSMTEPostUpdateUPP(TSMTEPostUpdateProcPtr userRoutine) ;
65339 extern void
65340 DisposeTSMTEPreUpdateUPP(TSMTEPreUpdateUPP userUPP) ;
65341 extern void
65342 DisposeTSMTEPostUpdateUPP(TSMTEPostUpdateUPP userUPP) ;
65343 extern void
65344 InvokeTSMTEPreUpdateUPP(
65345   TEHandle textH,
65346   long refCon,
65347   TSMTEPreUpdateUPP userUPP) ;
65348 extern void
65349 InvokeTSMTEPostUpdateUPP(
65350   TEHandle textH,
65351   long fixLen,
65352   long inputAreaStart,
65353   long inputAreaEnd,
65354   long pinStart,
65355   long pinEnd,
65356   long refCon,
65357   TSMTEPostUpdateUPP userUPP) ;
65358 extern Boolean
65359 IsTSMTEDialog(DialogRef dialog) ;
65360 extern TSMDocumentID
65361 GetTSMTEDialogDocumentID(DialogRef dialog) ;
65362 extern TSMTERecHandle
65363 GetTSMTEDialogTSMTERecHandle(DialogRef dialog) ;
65364 extern void
65365 SetTSMTEDialogDocumentID(
65366   DialogRef dialog,
65367   TSMDocumentID documentID) ;
65368 extern void
65369 SetTSMTEDialogTSMTERecHandle(
65370   DialogRef dialog,
65371   TSMTERecHandle tsmteRecHandle) ;
65372
65373
65374
65375
65376
65377 }
65378
65379
65380
65381 extern "C" {
65382
65383
65384
65385 enum {
65386   kSupportsFileTranslation = 1,
65387   kSupportsScrapTranslation = 2,
65388   kTranslatorCanGenerateFilename = 4
65389 };
65390
65391
65392
65393 typedef OSType FileType;
65394 typedef ResType ScrapType;
65395
65396 typedef UInt32 TranslationAttributes;
65397 enum {
65398   taDstDocNeedsResourceFork = 1,
65399   taDstIsAppTranslation = 2
65400 };
65401
65402
65403 struct FileTypeSpec {
65404   FileType format;
65405   long hint;
65406   TranslationAttributes flags;
65407   OSType catInfoType;
65408   OSType catInfoCreator;
65409 };
65410 typedef struct FileTypeSpec FileTypeSpec;
65411 struct FileTranslationList {
65412   unsigned long modDate;
65413   unsigned long groupCount;
65414 };
65415 typedef struct FileTranslationList FileTranslationList;
65416 typedef FileTranslationList * FileTranslationListPtr;
65417 typedef FileTranslationListPtr * FileTranslationListHandle;
65418
65419 struct ScrapTypeSpec {
65420   ScrapType format;
65421   long hint;
65422 };
65423 typedef struct ScrapTypeSpec ScrapTypeSpec;
65424 struct ScrapTranslationList {
65425   unsigned long modDate;
65426   unsigned long groupCount;
65427 };
65428 typedef struct ScrapTranslationList ScrapTranslationList;
65429 typedef ScrapTranslationList * ScrapTranslationListPtr;
65430 typedef ScrapTranslationListPtr * ScrapTranslationListHandle;
65431
65432
65433
65434
65435
65436 typedef long TranslationRefNum;
65437 extern OSErr
65438 SetTranslationAdvertisement(
65439   TranslationRefNum refNum,
65440   PicHandle advertisement) ;
65441 extern OSErr
65442 UpdateTranslationProgress(
65443   TranslationRefNum refNum,
65444   short percentDone,
65445   Boolean * canceled) ;
65446
65447
65448
65449
65450
65451
65452
65453 enum {
65454   kTranslateGetFileTranslationList = 0,
65455   kTranslateIdentifyFile = 1,
65456   kTranslateTranslateFile = 2,
65457   kTranslateGetTranslatedFilename = 3,
65458   kTranslateGetScrapTranslationList = 10,
65459   kTranslateIdentifyScrap = 11,
65460   kTranslateTranslateScrap = 12,
65461   kTranslateGetScrapTranslationListConsideringData = 13
65462 };
65463
65464
65465
65466
65467
65468
65469
65470 typedef ComponentResult ( * DoGetFileTranslationListProcPtr)(ComponentInstance self, FileTranslationListHandle translationList);
65471 typedef ComponentResult ( * DoIdentifyFileProcPtr)(ComponentInstance self, const FSSpec *theDocument, FileType *docType);
65472 typedef ComponentResult ( * DoTranslateFileProcPtr)(ComponentInstance self, TranslationRefNum refNum, const FSSpec *sourceDocument, FileType srcType, long srcTypeHint, const FSSpec *dstDoc, FileType dstType, long dstTypeHint);
65473 typedef ComponentResult ( * DoGetTranslatedFilenameProcPtr)(ComponentInstance self, FileType dstType, long dstTypeHint, FSSpec *theDocument);
65474 typedef ComponentResult ( * DoGetScrapTranslationListProcPtr)(ComponentInstance self, ScrapTranslationListHandle list);
65475 typedef ComponentResult ( * DoIdentifyScrapProcPtr)(ComponentInstance self, const void *dataPtr, Size dataLength, ScrapType *dataFormat);
65476 typedef ComponentResult ( * DoTranslateScrapProcPtr)(ComponentInstance self, TranslationRefNum refNum, const void *srcDataPtr, Size srcDataLength, ScrapType srcType, long srcTypeHint, Handle dstData, ScrapType dstType, long dstTypeHint);
65477
65478
65479
65480 }
65481
65482
65483
65484 extern "C" {
65485
65486
65487
65488
65489 typedef short DocOpenMethod;
65490 enum {
65491   domCannot = 0,
65492   domNative = 1,
65493   domTranslateFirst = 2,
65494   domWildcard = 3
65495 };
65496
65497
65498 typedef OSType TypesBlock[64];
65499 typedef OSType * TypesBlockPtr;
65500
65501 enum {
65502   kTranslationScrapProgressDialogID = -16555
65503 };
65504
65505
65506 struct FileTranslationSpec {
65507   OSType componentSignature;
65508   const void * translationSystemInfo;
65509   FileTypeSpec src;
65510   FileTypeSpec dst;
65511 };
65512 typedef struct FileTranslationSpec FileTranslationSpec;
65513 typedef FileTranslationSpec * FileTranslationSpecArrayPtr;
65514 typedef FileTranslationSpecArrayPtr * FileTranslationSpecArrayHandle;
65515 extern OSErr
65516 GetFileTypesThatAppCanNativelyOpen(
65517   short appVRefNumHint,
65518   OSType appSignature,
65519   FileType * nativeTypes) ;
65520 extern OSErr
65521 ExtendFileTypeList(
65522   const FileType * originalTypeList,
65523   short numberOriginalTypes,
65524   FileType * extendedTypeList,
65525   short * numberExtendedTypes) ;
65526 extern OSErr
65527 CanDocBeOpened(
65528   const FSSpec * targetDocument,
65529   short appVRefNumHint,
65530   OSType appSignature,
65531   const FileType * nativeTypes,
65532   Boolean onlyNative,
65533   DocOpenMethod * howToOpen,
65534   FileTranslationSpec * howToTranslate) ;
65535 extern short
65536 GetFileTranslationPaths(
65537   const FSSpec * srcDocument,
65538   FileType dstDocType,
65539   unsigned short maxResultCount,
65540   FileTranslationSpecArrayPtr resultBuffer) ;
65541 extern OSErr
65542 GetPathFromTranslationDialog(
65543   const FSSpec * theDocument,
65544   const FSSpec * theApplication,
65545   TypesBlockPtr typeList,
65546   DocOpenMethod * howToOpen,
65547   FileTranslationSpec * howToTranslate) ;
65548 extern OSErr
65549 TranslateFile(
65550   const FSSpec * sourceDocument,
65551   const FSSpec * destinationDocument,
65552   const FileTranslationSpec * howToTranslate) ;
65553 extern OSErr
65554 GetDocumentKindString(
65555   short docVRefNum,
65556   OSType docType,
65557   OSType docCreator,
65558   Str63 kindString) ;
65559 extern OSErr
65560 GetTranslationExtensionName(
65561   const FileTranslationSpec * translationMethod,
65562   Str31 extensionName) ;
65563 typedef OSErr ( * GetScrapDataProcPtr)(ScrapType requestedFormat, Handle dataH, void *srcDataGetterRefCon);
65564 typedef GetScrapDataProcPtr GetScrapDataUPP;
65565 extern GetScrapDataUPP
65566 NewGetScrapDataUPP(GetScrapDataProcPtr userRoutine) ;
65567 extern void
65568 DisposeGetScrapDataUPP(GetScrapDataUPP userUPP) ;
65569 extern OSErr
65570 InvokeGetScrapDataUPP(
65571   ScrapType requestedFormat,
65572   Handle dataH,
65573   void * srcDataGetterRefCon,
65574   GetScrapDataUPP userUPP) ;
65575
65576 typedef GetScrapDataUPP GetScrapData;
65577 extern OSErr
65578 TranslateScrap(
65579   GetScrapDataUPP sourceDataGetter,
65580   void * sourceDataGetterRefCon,
65581   ScrapType destinationFormat,
65582   Handle destinationData,
65583   short progressDialogID) ;
65584
65585
65586
65587
65588
65589
65590
65591 }
65592
65593
65594
65595
65596
65597
65598
65599 extern "C" {
65600
65601
65602
65603 typedef SInt16 TSCode;
65604 enum {
65605   tsPreviousSelectMode = -1,
65606   tsNormalSelectMode = 0,
65607   tsNextSelectMode = 1
65608 };
65609
65610 struct TypeSelectRecord {
65611   unsigned long tsrLastKeyTime;
65612   ScriptCode tsrScript;
65613   Str63 tsrKeyStrokes;
65614 };
65615 typedef struct TypeSelectRecord TypeSelectRecord;
65616 typedef Boolean ( * IndexToStringProcPtr)(short item, ScriptCode *itemsScript, StringPtr *itemsStringPtr, void *yourDataPtr);
65617 typedef IndexToStringProcPtr IndexToStringUPP;
65618 extern void
65619 TypeSelectClear(TypeSelectRecord * tsr) ;
65620 extern Boolean
65621 TypeSelectNewKey(
65622   const EventRecord * theEvent,
65623   TypeSelectRecord * tsr) ;
65624 extern short
65625 TypeSelectFindItem(
65626   const TypeSelectRecord * tsr,
65627   short listSize,
65628   TSCode selectMode,
65629   IndexToStringUPP getStringProc,
65630   void * yourDataPtr) ;
65631 extern short
65632 TypeSelectCompare(
65633   const TypeSelectRecord * tsr,
65634   ScriptCode testStringScript,
65635   StringPtr testStringPtr) ;
65636 extern IndexToStringUPP
65637 NewIndexToStringUPP(IndexToStringProcPtr userRoutine) ;
65638 extern void
65639 DisposeIndexToStringUPP(IndexToStringUPP userUPP) ;
65640 extern Boolean
65641 InvokeIndexToStringUPP(
65642   short item,
65643   ScriptCode * itemsScript,
65644   StringPtr * itemsStringPtr,
65645   void * yourDataPtr,
65646   IndexToStringUPP userUPP) ;
65647
65648
65649
65650
65651
65652
65653
65654 }
65655
65656
65657
65658 extern "C" {
65659 enum {
65660
65661
65662
65663
65664   kUIModeNormal = 0,
65665   kUIModeContentSuppressed = 1,
65666
65667
65668
65669
65670
65671
65672
65673   kUIModeContentHidden = 2,
65674   kUIModeAllHidden = 3
65675 };
65676
65677 typedef UInt32 SystemUIMode;
65678
65679
65680
65681
65682
65683
65684 enum {
65685
65686
65687
65688
65689
65690
65691   kUIOptionAutoShowMenuBar = 1 << 0,
65692
65693
65694
65695
65696   kUIOptionDisableAppleMenu = 1 << 2,
65697   kUIOptionDisableProcessSwitch = 1 << 3,
65698
65699
65700
65701
65702
65703
65704
65705   kUIOptionDisableForceQuit = 1 << 4,
65706
65707
65708
65709
65710
65711
65712
65713   kUIOptionDisableSessionTerminate = 1 << 5
65714 };
65715
65716 typedef OptionBits SystemUIOptions;
65717 extern OSStatus
65718 SetSystemUIMode(
65719   SystemUIMode inMode,
65720   SystemUIOptions inOptions) ;
65721 extern void
65722 GetSystemUIMode(
65723   SystemUIMode * outMode,
65724   SystemUIOptions * outOptions) ;
65725 extern HIObjectRef
65726 HIApplicationGetCurrent(void) ;
65727 extern OSStatus
65728 SetApplicationDockTileImage(CGImageRef inImage) ;
65729 extern OSStatus
65730 OverlayApplicationDockTileImage(CGImageRef inImage) ;
65731 extern OSStatus
65732 RestoreApplicationDockTileImage(void) ;
65733 extern CGContextRef
65734 BeginCGContextForApplicationDockTile(void) ;
65735 extern void
65736 EndCGContextForApplicationDockTile(CGContextRef inContext) ;
65737 extern CGrafPtr
65738 BeginQDContextForApplicationDockTile(void) ;
65739 extern void
65740 EndQDContextForApplicationDockTile(CGrafPtr inContext) ;
65741 extern OSStatus
65742 SetApplicationDockTileMenu(MenuRef inMenu) ;
65743 extern MenuRef
65744 GetApplicationDockTileMenu(void) ;
65745 extern OSStatus
65746 CreateCGImageFromPixMaps(
65747   PixMapHandle inImage,
65748   PixMapHandle inMask,
65749   CGImageRef * outImage) ;
65750 extern TextEncoding
65751 GetApplicationTextEncoding(void) ;
65752 extern ScriptCode
65753 GetApplicationScript(void) ;
65754
65755
65756
65757
65758
65759 }
65760
65761
65762
65763 extern "C" {
65764
65765
65766
65767
65768
65769
65770 enum {
65771   _KeyboardDispatch = 0xAA7A
65772 };
65773
65774
65775 enum {
65776   gestaltKeyboardsAttr = 'kbds',
65777   gestaltKBPS2Keyboards = 1,
65778   gestaltKBPS2SetIDToAny = 2,
65779   gestaltKBPS2SetTranslationTable = 4
65780 };
65781
65782
65783
65784
65785
65786
65787 enum {
65788   errKBPS2KeyboardNotAvailable = -30850,
65789   errKBIlligalParameters = -30851,
65790   errKBFailSettingID = -30852,
65791   errKBFailSettingTranslationTable = -30853,
65792   errKBFailWritePreference = -30854
65793 };
65794 typedef UInt32 PhysicalKeyboardLayoutType;
65795 enum {
65796
65797
65798
65799
65800   kKeyboardJIS = 'JIS ',
65801
65802
65803
65804
65805   kKeyboardANSI = 'ANSI',
65806
65807
65808
65809
65810   kKeyboardISO = 'ISO ',
65811
65812
65813
65814
65815   kKeyboardUnknown = kUnknownType
65816 };
65817 extern OSType
65818 KBGetLayoutType(SInt16 iKeyboardType) ;
65819 typedef struct OpaqueKeyboardLayoutRef* KeyboardLayoutRef;
65820 typedef UInt32 KeyboardLayoutPropertyTag;
65821 enum {
65822
65823
65824
65825
65826
65827   kKLKCHRData = 0,
65828
65829
65830
65831
65832
65833   kKLuchrData = 1,
65834
65835
65836
65837
65838   kKLIdentifier = 2,
65839
65840
65841
65842
65843   kKLIcon = 3,
65844
65845
65846
65847
65848   kKLLocalizedName = 4,
65849
65850
65851
65852
65853   kKLName = 5,
65854
65855
65856
65857
65858   kKLGroupIdentifier = 6,
65859
65860
65861
65862
65863   kKLKind = 7
65864 };
65865 typedef SInt32 KeyboardLayoutKind;
65866 enum {
65867
65868
65869
65870
65871   kKLKCHRuchrKind = 0,
65872
65873
65874
65875
65876   kKLKCHRKind = 1,
65877
65878
65879
65880
65881   kKLuchrKind = 2
65882 };
65883 typedef SInt32 KeyboardLayoutIdentifier;
65884 enum {
65885   kKLUSKeyboard = 0
65886 };
65887 extern OSStatus
65888 KLGetKeyboardLayoutCount(CFIndex * oCount) ;
65889 extern OSStatus
65890 KLGetKeyboardLayoutAtIndex(
65891   CFIndex iIndex,
65892   KeyboardLayoutRef * oKeyboardLayout) ;
65893 extern OSStatus
65894 KLGetIndexedKeyboardLayout(
65895   CFIndex iIndex,
65896   KeyboardLayoutRef * oKeyboardLayout) ;
65897 extern OSStatus
65898 KLGetKeyboardLayoutProperty(
65899   KeyboardLayoutRef iKeyboardLayout,
65900   KeyboardLayoutPropertyTag iPropertyTag,
65901   const void ** oValue) ;
65902 extern OSStatus
65903 KLGetKeyboardLayoutWithIdentifier(
65904   SInt32 iIdentifier,
65905   KeyboardLayoutRef * oKeyboardLayout) ;
65906 extern OSStatus
65907 KLGetKeyboardLayoutWithName(
65908   CFStringRef iName,
65909   KeyboardLayoutRef * oKeyboardLayout) ;
65910 extern OSStatus
65911 KLGetCurrentKeyboardLayout(KeyboardLayoutRef * oKeyboardLayout) ;
65912 extern OSStatus
65913 KLSetCurrentKeyboardLayout(KeyboardLayoutRef iKeyboardLayout) ;
65914
65915
65916
65917
65918 }
65919
65920
65921
65922 extern "C" {
65923
65924
65925 enum {
65926   kIBCarbonRuntimeCantFindNibFile = -10960,
65927   kIBCarbonRuntimeObjectNotOfRequestedType = -10961,
65928   kIBCarbonRuntimeCantFindObject = -10962
65929 };
65930
65931
65932 typedef struct OpaqueIBNibRef* IBNibRef;
65933 extern OSStatus
65934 CreateNibReference(
65935   CFStringRef inNibName,
65936   IBNibRef * outNibRef) ;
65937 extern OSStatus
65938 CreateNibReferenceWithCFBundle(
65939   CFBundleRef inBundle,
65940   CFStringRef inNibName,
65941   IBNibRef * outNibRef) ;
65942 extern void
65943 DisposeNibReference(IBNibRef inNibRef) ;
65944 extern OSStatus
65945 CreateWindowFromNib(
65946   IBNibRef inNibRef,
65947   CFStringRef inName,
65948   WindowRef * outWindow) ;
65949 extern OSStatus
65950 CreateMenuFromNib(
65951   IBNibRef inNibRef,
65952   CFStringRef inName,
65953   MenuRef * outMenuRef) ;
65954 extern OSStatus
65955 CreateMenuBarFromNib(
65956   IBNibRef inNibRef,
65957   CFStringRef inName,
65958   Handle * outMenuBar) ;
65959 extern OSStatus
65960 SetMenuBarFromNib(
65961   IBNibRef inNibRef,
65962   CFStringRef inName) ;
65963
65964
65965
65966
65967 }
65968
65969
65970
65971 extern "C" {
65972
65973
65974 enum {
65975   soundListRsrc = 'snd ',
65976   kSoundCodecInfoResourceType = 'snfo'
65977 };
65978
65979 enum {
65980   kSimpleBeepID = 1
65981 };
65982
65983 enum {
65984   rate48khz = (long)0xBB800000,
65985   rate44khz = (long)0xAC440000,
65986   rate32khz = 0x7D000000,
65987   rate22050hz = 0x56220000,
65988   rate22khz = 0x56EE8BA3,
65989   rate16khz = 0x3E800000,
65990   rate11khz = 0x2B7745D1,
65991   rate11025hz = 0x2B110000,
65992   rate8khz = 0x1F400000
65993 };
65994
65995
65996 enum {
65997   sampledSynth = 5
65998 };
65999 enum {
66000   kMiddleC = 60
66001 };
66002
66003 enum {
66004   kNoVolume = 0,
66005   kFullVolume = 0x0100
66006 };
66007
66008 enum {
66009   stdQLength = 128
66010 };
66011
66012 enum {
66013   dataOffsetFlag = 0x8000
66014 };
66015
66016 enum {
66017   kUseOptionalOutputDevice = -1
66018 };
66019
66020 enum {
66021   notCompressed = 0,
66022   fixedCompression = -1,
66023   variableCompression = -2
66024 };
66025
66026 enum {
66027   twoToOne = 1,
66028   eightToThree = 2,
66029   threeToOne = 3,
66030   sixToOne = 4,
66031   sixToOnePacketSize = 8,
66032   threeToOnePacketSize = 16
66033 };
66034
66035 enum {
66036   stateBlockSize = 64,
66037   leftOverBlockSize = 32
66038 };
66039
66040 enum {
66041   firstSoundFormat = 0x0001,
66042   secondSoundFormat = 0x0002
66043 };
66044 enum {
66045   sysBeepDisable = 0x0000,
66046   sysBeepEnable = (1 << 0),
66047   sysBeepSynchronous = (1 << 1)
66048 };
66049
66050 enum {
66051   unitTypeNoSelection = 0xFFFF,
66052   unitTypeSeconds = 0x0000
66053 };
66054
66055 enum {
66056   stdSH = 0x00,
66057   extSH = 0xFF,
66058   cmpSH = 0xFE
66059 };
66060
66061
66062 enum {
66063   nullCmd = 0,
66064   quietCmd = 3,
66065   flushCmd = 4,
66066   reInitCmd = 5,
66067   waitCmd = 10,
66068   pauseCmd = 11,
66069   resumeCmd = 12,
66070   callBackCmd = 13,
66071   syncCmd = 14,
66072   availableCmd = 24,
66073   versionCmd = 25,
66074   volumeCmd = 46,
66075   getVolumeCmd = 47,
66076   clockComponentCmd = 50,
66077   getClockComponentCmd = 51,
66078   scheduledSoundCmd = 52,
66079   linkSoundComponentsCmd = 53,
66080   soundCmd = 80,
66081   bufferCmd = 81,
66082   rateMultiplierCmd = 86,
66083   getRateMultiplierCmd = 87
66084 };
66085 enum {
66086   initChanLeft = 0x0002,
66087   initChanRight = 0x0003,
66088   initNoInterp = 0x0004,
66089   initNoDrop = 0x0008,
66090   initMono = 0x0080,
66091   initStereo = 0x00C0,
66092   initMACE3 = 0x0300,
66093   initMACE6 = 0x0400,
66094   initPanMask = 0x0003,
66095   initSRateMask = 0x0030,
66096   initStereoMask = 0x00C0,
66097   initCompMask = 0xFF00
66098 };
66099
66100
66101 enum {
66102   siActiveChannels = 'chac',
66103   siActiveLevels = 'lmac',
66104   siAGCOnOff = 'agc ',
66105   siAsync = 'asyn',
66106   siAVDisplayBehavior = 'avdb',
66107   siChannelAvailable = 'chav',
66108   siCompressionAvailable = 'cmav',
66109   siCompressionFactor = 'cmfa',
66110   siCompressionHeader = 'cmhd',
66111   siCompressionNames = 'cnam',
66112   siCompressionParams = 'evaw',
66113   siCompressionSampleRate = 'cprt',
66114   siCompressionChannels = 'cpct',
66115   siCompressionOutputSampleRate = 'cort',
66116   siCompressionInputRateList = 'crtl',
66117   siCompressionType = 'comp',
66118   siCompressionConfiguration = 'ccfg',
66119   siContinuous = 'cont',
66120   siDecompressionParams = 'wave',
66121   siDecompressionConfiguration = 'dcfg',
66122   siDeviceBufferInfo = 'dbin',
66123   siDeviceConnected = 'dcon',
66124   siDeviceIcon = 'icon',
66125   siDeviceName = 'name',
66126   siEQSpectrumBands = 'eqsb',
66127   siEQSpectrumLevels = 'eqlv',
66128   siEQSpectrumOnOff = 'eqlo',
66129   siEQSpectrumResolution = 'eqrs',
66130   siEQToneControlGain = 'eqtg',
66131   siEQToneControlOnOff = 'eqtc',
66132   siHardwareBalance = 'hbal',
66133   siHardwareBalanceSteps = 'hbls',
66134   siHardwareBass = 'hbas',
66135   siHardwareBassSteps = 'hbst',
66136   siHardwareBusy = 'hwbs',
66137   siHardwareFormat = 'hwfm',
66138   siHardwareMute = 'hmut',
66139   siHardwareMuteNoPrefs = 'hmnp',
66140   siHardwareTreble = 'htrb',
66141   siHardwareTrebleSteps = 'hwts',
66142   siHardwareVolume = 'hvol',
66143   siHardwareVolumeSteps = 'hstp',
66144   siHeadphoneMute = 'pmut',
66145   siHeadphoneVolume = 'pvol',
66146   siHeadphoneVolumeSteps = 'hdst',
66147   siInputAvailable = 'inav',
66148   siInputGain = 'gain',
66149   siInputSource = 'sour',
66150   siInputSourceNames = 'snam',
66151   siLevelMeterOnOff = 'lmet',
66152   siModemGain = 'mgai',
66153   siMonitorAvailable = 'mnav',
66154   siMonitorSource = 'mons',
66155   siNumberChannels = 'chan',
66156   siOptionsDialog = 'optd',
66157   siOSTypeInputSource = 'inpt',
66158   siOSTypeInputAvailable = 'inav',
66159   siOutputDeviceName = 'onam',
66160   siPlayThruOnOff = 'plth',
66161   siPostMixerSoundComponent = 'psmx',
66162   siPreMixerSoundComponent = 'prmx',
66163   siQuality = 'qual',
66164   siRateMultiplier = 'rmul',
66165   siRecordingQuality = 'qual',
66166   siSampleRate = 'srat',
66167   siSampleRateAvailable = 'srav',
66168   siSampleSize = 'ssiz',
66169   siSampleSizeAvailable = 'ssav',
66170   siSetupCDAudio = 'sucd',
66171   siSetupModemAudio = 'sumd',
66172   siSlopeAndIntercept = 'flap',
66173   siSoundClock = 'sclk',
66174   siUseThisSoundClock = 'sclc',
66175   siSpeakerMute = 'smut',
66176   siSpeakerVolume = 'svol',
66177   siSSpCPULoadLimit = '3dll',
66178   siSSpLocalization = '3dif',
66179   siSSpSpeakerSetup = '3dst',
66180   siStereoInputGain = 'sgai',
66181   siSubwooferMute = 'bmut',
66182   siTerminalType = 'ttyp',
66183   siTwosComplementOnOff = 'twos',
66184   siVendorProduct = 'vpro',
66185   siVolume = 'volu',
66186   siVoxRecordInfo = 'voxr',
66187   siVoxStopInfo = 'voxs',
66188   siWideStereo = 'wide',
66189   siSupportedExtendedFlags = 'exfl',
66190   siRateConverterRollOffSlope = 'rcdb',
66191   siOutputLatency = 'olte',
66192   siHALAudioDeviceID = 'hlid',
66193   siHALAudioDeviceUniqueID = 'huid',
66194   siClientAcceptsVBR = 'cvbr',
66195   siSourceIsExhausted = 'srcx',
66196   siMediaContextID = 'uuid',
66197   siCompressionMaxPacketSize = 'cmxp'
66198 };
66199
66200 enum {
66201   siCloseDriver = 'clos',
66202   siInitializeDriver = 'init',
66203   siPauseRecording = 'paus',
66204   siUserInterruptProc = 'user'
66205 };
66206
66207
66208 enum {
66209   kInvalidSource = (long)0xFFFFFFFF,
66210   kNoSource = 'none',
66211   kCDSource = 'cd  ',
66212   kExtMicSource = 'emic',
66213   kSoundInSource = 'sinj',
66214   kRCAInSource = 'irca',
66215   kTVFMTunerSource = 'tvfm',
66216   kDAVInSource = 'idav',
66217   kIntMicSource = 'imic',
66218   kMediaBaySource = 'mbay',
66219   kModemSource = 'modm',
66220   kPCCardSource = 'pcm ',
66221   kZoomVideoSource = 'zvpc',
66222   kDVDSource = 'dvda',
66223   kMicrophoneArray = 'mica'
66224 };
66225
66226
66227 enum {
66228   kNoSoundComponentType = '****',
66229   kSoundComponentType = 'sift',
66230   kSoundComponentPPCType = 'nift',
66231   kRate8SubType = 'ratb',
66232   kRate16SubType = 'ratw',
66233   kConverterSubType = 'conv',
66234   kSndSourceSubType = 'sour',
66235   kMixerType = 'mixr',
66236   kMixer8SubType = 'mixb',
66237   kMixer16SubType = 'mixw',
66238   kSoundInputDeviceType = 'sinp',
66239   kWaveInSubType = 'wavi',
66240   kWaveInSnifferSubType = 'wisn',
66241   kSoundOutputDeviceType = 'sdev',
66242   kClassicSubType = 'clas',
66243   kASCSubType = 'asc ',
66244   kDSPSubType = 'dsp ',
66245   kAwacsSubType = 'awac',
66246   kGCAwacsSubType = 'awgc',
66247   kSingerSubType = 'sing',
66248   kSinger2SubType = 'sng2',
66249   kWhitSubType = 'whit',
66250   kSoundBlasterSubType = 'sbls',
66251   kWaveOutSubType = 'wavo',
66252   kWaveOutSnifferSubType = 'wosn',
66253   kDirectSoundSubType = 'dsnd',
66254   kDirectSoundSnifferSubType = 'dssn',
66255   kUNIXsdevSubType = 'un1x',
66256   kUSBSubType = 'usb ',
66257   kBlueBoxSubType = 'bsnd',
66258   kHALCustomComponentSubType = 'halx',
66259   kSoundCompressor = 'scom',
66260   kSoundDecompressor = 'sdec',
66261   kAudioComponentType = 'adio',
66262   kAwacsPhoneSubType = 'hphn',
66263   kAudioVisionSpeakerSubType = 'telc',
66264   kAudioVisionHeadphoneSubType = 'telh',
66265   kPhilipsFaderSubType = 'tvav',
66266   kSGSToneSubType = 'sgs0',
66267   kSoundEffectsType = 'snfx',
66268   kEqualizerSubType = 'eqal',
66269   kSSpLocalizationSubType = 'snd3'
66270 };
66271
66272
66273 enum {
66274   kSoundNotCompressed = 'NONE',
66275   k8BitOffsetBinaryFormat = 'raw ',
66276   k16BitBigEndianFormat = 'twos',
66277   k16BitLittleEndianFormat = 'sowt',
66278   kFloat32Format = 'fl32',
66279   kFloat64Format = 'fl64',
66280   k24BitFormat = 'in24',
66281   k32BitFormat = 'in32',
66282   k32BitLittleEndianFormat = '23ni',
66283   kMACE3Compression = 'MAC3',
66284   kMACE6Compression = 'MAC6',
66285   kCDXA4Compression = 'cdx4',
66286   kCDXA2Compression = 'cdx2',
66287   kIMACompression = 'ima4',
66288   kULawCompression = 'ulaw',
66289   kALawCompression = 'alaw',
66290   kMicrosoftADPCMFormat = 0x6D730002,
66291   kDVIIntelIMAFormat = 0x6D730011,
66292   kDVAudioFormat = 'dvca',
66293   kQDesignCompression = 'QDMC',
66294   kQDesign2Compression = 'QDM2',
66295   kQUALCOMMCompression = 'Qclp',
66296   kOffsetBinary = k8BitOffsetBinaryFormat,
66297   kTwosComplement = k16BitBigEndianFormat,
66298   kLittleEndianFormat = k16BitLittleEndianFormat,
66299   kMPEGLayer3Format = 0x6D730055,
66300   kFullMPEGLay3Format = '.mp3'
66301 };
66302 enum {
66303   k16BitNativeEndianFormat = k16BitBigEndianFormat,
66304   k16BitNonNativeEndianFormat = k16BitLittleEndianFormat
66305 };
66306
66307
66308
66309
66310 enum {
66311   k8BitRawIn = (1 << 0),
66312   k8BitTwosIn = (1 << 1),
66313   k16BitIn = (1 << 2),
66314   kStereoIn = (1 << 3),
66315   k8BitRawOut = (1 << 8),
66316   k8BitTwosOut = (1 << 9),
66317   k16BitOut = (1 << 10),
66318   kStereoOut = (1 << 11),
66319   kReverse = (1L << 16),
66320   kRateConvert = (1L << 17),
66321   kCreateSoundSource = (1L << 18),
66322   kVMAwareness = (1L << 21),
66323   kHighQuality = (1L << 22),
66324   kNonRealTime = (1L << 23)
66325 };
66326
66327
66328 enum {
66329   kSoundCodecInfoFixedCompression = (1L << 0),
66330   kSoundCodecInfoVariableCompression = (1L << 1),
66331   kSoundCodecInfoHasRestrictedInputRates = (1L << 2),
66332   kSoundCodecInfoCanChangeOutputRate = (1L << 3),
66333   kSoundCodecInfoRequiresExternalFraming = (1L << 4)
66334 };
66335
66336
66337 enum {
66338   kSourcePaused = (1 << 0),
66339   kPassThrough = (1L << 16),
66340   kNoSoundComponentChain = (1L << 17)
66341 };
66342
66343
66344 enum {
66345   kNoMixing = (1 << 0),
66346   kNoSampleRateConversion = (1 << 1),
66347   kNoSampleSizeConversion = (1 << 2),
66348   kNoSampleFormatConversion = (1 << 3),
66349   kNoChannelConversion = (1 << 4),
66350   kNoDecompression = (1 << 5),
66351   kNoVolumeConversion = (1 << 6),
66352   kNoRealtimeProcessing = (1 << 7),
66353   kScheduledSource = (1 << 8),
66354   kNonInterleavedBuffer = (1 << 9),
66355   kNonPagingMixer = (1 << 10),
66356   kSoundConverterMixer = (1 << 11),
66357   kPagingMixer = (1 << 12),
66358   kVMAwareMixer = (1 << 13),
66359   kExtendedSoundData = (1 << 14)
66360 };
66361
66362
66363 enum {
66364   kBestQuality = (1 << 0)
66365 };
66366
66367
66368 enum {
66369   kInputMask = 0x000000FF,
66370   kOutputMask = 0x0000FF00,
66371   kOutputShift = 8,
66372   kActionMask = 0x00FF0000,
66373   kSoundComponentBits = 0x00FFFFFF
66374 };
66375
66376
66377 enum {
66378   kAudioFormatAtomType = 'frma',
66379   kAudioEndianAtomType = 'enda',
66380   kAudioVBRAtomType = 'vbra',
66381   kAudioTerminatorAtomType = 0
66382 };
66383
66384
66385 enum {
66386   kAVDisplayHeadphoneRemove = 0,
66387   kAVDisplayHeadphoneInsert = 1,
66388   kAVDisplayPlainTalkRemove = 2,
66389   kAVDisplayPlainTalkInsert = 3
66390 };
66391
66392
66393 enum {
66394
66395   audioAllChannels = 0,
66396   audioLeftChannel = 1,
66397   audioRightChannel = 2,
66398
66399   audioUnmuted = 0,
66400   audioMuted = 1,
66401
66402   audioDoesMono = (1L << 0),
66403   audioDoesStereo = (1L << 1),
66404   audioDoesIndependentChannels = (1L << 2)
66405 };
66406
66407
66408 enum {
66409   siCDQuality = 'cd  ',
66410   siBestQuality = 'best',
66411   siBetterQuality = 'betr',
66412   siGoodQuality = 'good',
66413   siNoneQuality = 'none'
66414 };
66415
66416 enum {
66417   siDeviceIsConnected = 1,
66418   siDeviceNotConnected = 0,
66419   siDontKnowIfConnected = -1,
66420   siReadPermission = 0,
66421   siWritePermission = 1
66422 };
66423
66424
66425 enum {
66426   kSoundConverterDidntFillBuffer = (1 << 0),
66427   kSoundConverterHasLeftOverData = (1 << 1)
66428 };
66429
66430
66431 enum {
66432   kExtendedSoundSampleCountNotValid = 1L << 0,
66433   kExtendedSoundBufferSizeValid = 1L << 1,
66434   kExtendedSoundFrameSizesValid = 1L << 2,
66435   kExtendedSoundCommonFrameSizeValid = 1L << 3,
66436   kExtendedSoundExtensionsValid = 1L << 4,
66437   kExtendedSoundBufferFlagsValid = 1L << 5
66438 };
66439
66440
66441 enum {
66442   kExtendedSoundBufferIsDiscontinuous = 1L << 0,
66443   kExtendedSoundBufferIsFirstBuffer = 1L << 1
66444 };
66445
66446
66447
66448
66449
66450
66451
66452 struct SndCommand {
66453   unsigned short cmd;
66454   short param1;
66455   long param2;
66456 };
66457 typedef struct SndCommand SndCommand;
66458 typedef struct SndChannel SndChannel;
66459
66460 typedef SndChannel * SndChannelPtr;
66461 typedef void ( * SndCallBackProcPtr)(SndChannelPtr chan, SndCommand *cmd);
66462 typedef SndCallBackProcPtr SndCallBackUPP;
66463 struct SndChannel {
66464   SndChannelPtr nextChan;
66465   Ptr firstMod;
66466   SndCallBackUPP callBack;
66467   long userInfo;
66468   long wait;
66469   SndCommand cmdInProgress;
66470   short flags;
66471   short qLength;
66472   short qHead;
66473   short qTail;
66474   SndCommand queue[128];
66475 };
66476 extern SndCallBackUPP
66477 NewSndCallBackUPP(SndCallBackProcPtr userRoutine) ;
66478 extern void
66479 DisposeSndCallBackUPP(SndCallBackUPP userUPP) ;
66480 extern void
66481 InvokeSndCallBackUPP(
66482   SndChannelPtr chan,
66483   SndCommand * cmd,
66484   SndCallBackUPP userUPP) ;
66485
66486
66487 struct StateBlock {
66488   short stateVar[64];
66489 };
66490 typedef struct StateBlock StateBlock;
66491 typedef StateBlock * StateBlockPtr;
66492 struct LeftOverBlock {
66493   unsigned long count;
66494   SInt8 sampleArea[32];
66495 };
66496 typedef struct LeftOverBlock LeftOverBlock;
66497 typedef LeftOverBlock * LeftOverBlockPtr;
66498 struct ModRef {
66499   unsigned short modNumber;
66500   long modInit;
66501 };
66502 typedef struct ModRef ModRef;
66503 struct SndListResource {
66504   short format;
66505   short numModifiers;
66506   ModRef modifierPart[1];
66507   short numCommands;
66508   SndCommand commandPart[1];
66509   UInt8 dataPart[1];
66510 };
66511 typedef struct SndListResource SndListResource;
66512 typedef SndListResource * SndListPtr;
66513 typedef SndListPtr * SndListHandle;
66514 typedef SndListHandle SndListHndl;
66515
66516 struct Snd2ListResource {
66517   short format;
66518   short refCount;
66519   short numCommands;
66520   SndCommand commandPart[1];
66521   UInt8 dataPart[1];
66522 };
66523 typedef struct Snd2ListResource Snd2ListResource;
66524 typedef Snd2ListResource * Snd2ListPtr;
66525 typedef Snd2ListPtr * Snd2ListHandle;
66526 typedef Snd2ListHandle Snd2ListHndl;
66527 struct SoundHeader {
66528   Ptr samplePtr;
66529   unsigned long length;
66530   UnsignedFixed sampleRate;
66531   unsigned long loopStart;
66532   unsigned long loopEnd;
66533   UInt8 encode;
66534   UInt8 baseFrequency;
66535   UInt8 sampleArea[1];
66536 };
66537 typedef struct SoundHeader SoundHeader;
66538 typedef SoundHeader * SoundHeaderPtr;
66539 struct CmpSoundHeader {
66540   Ptr samplePtr;
66541   unsigned long numChannels;
66542   UnsignedFixed sampleRate;
66543   unsigned long loopStart;
66544   unsigned long loopEnd;
66545   UInt8 encode;
66546   UInt8 baseFrequency;
66547   unsigned long numFrames;
66548   extended80 AIFFSampleRate;
66549   Ptr markerChunk;
66550   OSType format;
66551   unsigned long futureUse2;
66552   StateBlockPtr stateVars;
66553   LeftOverBlockPtr leftOverSamples;
66554   short compressionID;
66555   unsigned short packetSize;
66556   unsigned short snthID;
66557   unsigned short sampleSize;
66558   UInt8 sampleArea[1];
66559 };
66560 typedef struct CmpSoundHeader CmpSoundHeader;
66561 typedef CmpSoundHeader * CmpSoundHeaderPtr;
66562 struct ExtSoundHeader {
66563   Ptr samplePtr;
66564   unsigned long numChannels;
66565   UnsignedFixed sampleRate;
66566   unsigned long loopStart;
66567   unsigned long loopEnd;
66568   UInt8 encode;
66569   UInt8 baseFrequency;
66570   unsigned long numFrames;
66571   extended80 AIFFSampleRate;
66572   Ptr markerChunk;
66573   Ptr instrumentChunks;
66574   Ptr AESRecording;
66575   unsigned short sampleSize;
66576   unsigned short futureUse1;
66577   unsigned long futureUse2;
66578   unsigned long futureUse3;
66579   unsigned long futureUse4;
66580   UInt8 sampleArea[1];
66581 };
66582 typedef struct ExtSoundHeader ExtSoundHeader;
66583 typedef ExtSoundHeader * ExtSoundHeaderPtr;
66584 union SoundHeaderUnion {
66585   SoundHeader stdHeader;
66586   CmpSoundHeader cmpHeader;
66587   ExtSoundHeader extHeader;
66588 };
66589 typedef union SoundHeaderUnion SoundHeaderUnion;
66590 struct ConversionBlock {
66591   short destination;
66592   short unused;
66593   CmpSoundHeaderPtr inputPtr;
66594   CmpSoundHeaderPtr outputPtr;
66595 };
66596 typedef struct ConversionBlock ConversionBlock;
66597 typedef ConversionBlock * ConversionBlockPtr;
66598
66599 enum {
66600   kScheduledSoundDoScheduled = 1 << 0,
66601   kScheduledSoundDoCallBack = 1 << 1,
66602   kScheduledSoundExtendedHdr = 1 << 2
66603 };
66604
66605 struct ScheduledSoundHeader {
66606   SoundHeaderUnion u;
66607   long flags;
66608   short reserved;
66609   short callBackParam1;
66610   long callBackParam2;
66611   TimeRecord startTime;
66612 };
66613 typedef struct ScheduledSoundHeader ScheduledSoundHeader;
66614 typedef ScheduledSoundHeader * ScheduledSoundHeaderPtr;
66615 struct ExtendedScheduledSoundHeader {
66616   SoundHeaderUnion u;
66617   long flags;
66618   short reserved;
66619   short callBackParam1;
66620   long callBackParam2;
66621   TimeRecord startTime;
66622   long recordSize;
66623   long extendedFlags;
66624   long bufferSize;
66625   long frameCount;
66626   long * frameSizesArray;
66627   long commonFrameSize;
66628   void * extensionsPtr;
66629   long extensionsSize;
66630   unsigned long bufferFlags;
66631   unsigned long bufferFlagsMask;
66632 };
66633 typedef struct ExtendedScheduledSoundHeader ExtendedScheduledSoundHeader;
66634 typedef ExtendedScheduledSoundHeader * ExtendedScheduledSoundHeaderPtr;
66635 struct SMStatus {
66636   short smMaxCPULoad;
66637   short smNumChannels;
66638   short smCurCPULoad;
66639 };
66640 typedef struct SMStatus SMStatus;
66641 typedef SMStatus * SMStatusPtr;
66642 struct SCStatus {
66643   UnsignedFixed scStartTime;
66644   UnsignedFixed scEndTime;
66645   UnsignedFixed scCurrentTime;
66646   Boolean scChannelBusy;
66647   Boolean scChannelDisposed;
66648   Boolean scChannelPaused;
66649   Boolean scUnused;
66650   unsigned long scChannelAttributes;
66651   long scCPULoad;
66652 };
66653 typedef struct SCStatus SCStatus;
66654 typedef SCStatus * SCStatusPtr;
66655 struct AudioSelection {
66656   long unitType;
66657   UnsignedFixed selStart;
66658   UnsignedFixed selEnd;
66659 };
66660 typedef struct AudioSelection AudioSelection;
66661 typedef AudioSelection * AudioSelectionPtr;
66662 struct SoundInfoList {
66663   short count;
66664   Handle infoHandle;
66665 };
66666 typedef struct SoundInfoList SoundInfoList;
66667 typedef SoundInfoList * SoundInfoListPtr;
66668 struct SoundComponentData {
66669   long flags;
66670   OSType format;
66671   short numChannels;
66672   short sampleSize;
66673   UnsignedFixed sampleRate;
66674   long sampleCount;
66675   Byte * buffer;
66676   long reserved;
66677 };
66678 typedef struct SoundComponentData SoundComponentData;
66679 typedef SoundComponentData * SoundComponentDataPtr;
66680 struct ExtendedSoundComponentData {
66681   SoundComponentData desc;
66682   long recordSize;
66683   long extendedFlags;
66684   long bufferSize;
66685   long frameCount;
66686   long * frameSizesArray;
66687   long commonFrameSize;
66688   void * extensionsPtr;
66689   long extensionsSize;
66690   unsigned long bufferFlags;
66691   unsigned long bufferFlagsMask;
66692 };
66693 typedef struct ExtendedSoundComponentData ExtendedSoundComponentData;
66694 typedef ExtendedSoundComponentData * ExtendedSoundComponentDataPtr;
66695 typedef struct SoundParamBlock SoundParamBlock;
66696 typedef SoundParamBlock * SoundParamBlockPtr;
66697 typedef Boolean ( * SoundParamProcPtr)(SoundParamBlockPtr * pb);
66698 typedef SoundParamProcPtr SoundParamUPP;
66699 struct SoundParamBlock {
66700   long recordSize;
66701   SoundComponentData desc;
66702   UnsignedFixed rateMultiplier;
66703   short leftVolume;
66704   short rightVolume;
66705   long quality;
66706   ComponentInstance filter;
66707   SoundParamUPP moreRtn;
66708   SoundParamUPP completionRtn;
66709   long refCon;
66710   short result;
66711 };
66712
66713 struct ExtendedSoundParamBlock {
66714   SoundParamBlock pb;
66715   short reserved;
66716   long extendedFlags;
66717   long bufferSize;
66718   long frameCount;
66719   long * frameSizesArray;
66720   long commonFrameSize;
66721   void * extensionsPtr;
66722   long extensionsSize;
66723   unsigned long bufferFlags;
66724   unsigned long bufferFlagsMask;
66725 };
66726 typedef struct ExtendedSoundParamBlock ExtendedSoundParamBlock;
66727 typedef ExtendedSoundParamBlock * ExtendedSoundParamBlockPtr;
66728 struct CompressionInfo {
66729   long recordSize;
66730   OSType format;
66731   short compressionID;
66732   unsigned short samplesPerPacket;
66733   unsigned short bytesPerPacket;
66734   unsigned short bytesPerFrame;
66735   unsigned short bytesPerSample;
66736   unsigned short futureUse1;
66737 };
66738 typedef struct CompressionInfo CompressionInfo;
66739 typedef CompressionInfo * CompressionInfoPtr;
66740 typedef CompressionInfoPtr * CompressionInfoHandle;
66741
66742 struct SoundSlopeAndInterceptRecord {
66743   Float64 slope;
66744   Float64 intercept;
66745   Float64 minClip;
66746   Float64 maxClip;
66747 };
66748 typedef struct SoundSlopeAndInterceptRecord SoundSlopeAndInterceptRecord;
66749 typedef SoundSlopeAndInterceptRecord * SoundSlopeAndInterceptPtr;
66750
66751 typedef struct OpaqueSoundConverter* SoundConverter;
66752
66753 typedef Boolean ( * SoundConverterFillBufferDataProcPtr)(SoundComponentDataPtr *data, void *refCon);
66754 typedef SoundConverterFillBufferDataProcPtr SoundConverterFillBufferDataUPP;
66755
66756 typedef struct OpaqueSoundSource* SoundSource;
66757 typedef SoundSource * SoundSourcePtr;
66758
66759
66760 struct SoundComponentLink {
66761   ComponentDescription description;
66762   SoundSource mixerID;
66763   SoundSource * linkID;
66764 };
66765 typedef struct SoundComponentLink SoundComponentLink;
66766 typedef SoundComponentLink * SoundComponentLinkPtr;
66767 struct AudioInfo {
66768   long capabilitiesFlags;
66769   long reserved;
66770   unsigned short numVolumeSteps;
66771 };
66772 typedef struct AudioInfo AudioInfo;
66773 typedef AudioInfo * AudioInfoPtr;
66774 struct AudioFormatAtom {
66775   long size;
66776   OSType atomType;
66777   OSType format;
66778 };
66779 typedef struct AudioFormatAtom AudioFormatAtom;
66780 typedef AudioFormatAtom * AudioFormatAtomPtr;
66781 struct AudioEndianAtom {
66782   long size;
66783   OSType atomType;
66784   short littleEndian;
66785 };
66786 typedef struct AudioEndianAtom AudioEndianAtom;
66787 typedef AudioEndianAtom * AudioEndianAtomPtr;
66788 struct AudioTerminatorAtom {
66789   long size;
66790   OSType atomType;
66791 };
66792 typedef struct AudioTerminatorAtom AudioTerminatorAtom;
66793 typedef AudioTerminatorAtom * AudioTerminatorAtomPtr;
66794 struct LevelMeterInfo {
66795   short numChannels;
66796   UInt8 leftMeter;
66797   UInt8 rightMeter;
66798 };
66799 typedef struct LevelMeterInfo LevelMeterInfo;
66800 typedef LevelMeterInfo * LevelMeterInfoPtr;
66801 struct EQSpectrumBandsRecord {
66802   short count;
66803   UnsignedFixedPtr frequency;
66804 };
66805 typedef struct EQSpectrumBandsRecord EQSpectrumBandsRecord;
66806 typedef EQSpectrumBandsRecord * EQSpectrumBandsRecordPtr;
66807
66808
66809
66810 typedef struct SPB SPB;
66811 typedef SPB * SPBPtr;
66812
66813
66814
66815 typedef void ( * SIInterruptProcPtr)(SPBPtr inParamPtr, Ptr dataBuffer, short peakAmplitude, long sampleSize);
66816 typedef void ( * SICompletionProcPtr)(SPBPtr inParamPtr);
66817 typedef SIInterruptProcPtr SIInterruptUPP;
66818 typedef SICompletionProcPtr SICompletionUPP;
66819
66820
66821
66822 struct SPB {
66823   long inRefNum;
66824   unsigned long count;
66825   unsigned long milliseconds;
66826   unsigned long bufferLength;
66827   Ptr bufferPtr;
66828   SICompletionUPP completionRoutine;
66829   SIInterruptUPP interruptRoutine;
66830   long userLong;
66831   OSErr error;
66832   long unused1;
66833 };
66834 extern SoundParamUPP
66835 NewSoundParamUPP(SoundParamProcPtr userRoutine) ;
66836 extern SoundConverterFillBufferDataUPP
66837 NewSoundConverterFillBufferDataUPP(SoundConverterFillBufferDataProcPtr userRoutine) ;
66838 extern SIInterruptUPP
66839 NewSIInterruptUPP(SIInterruptProcPtr userRoutine) ;
66840 extern SICompletionUPP
66841 NewSICompletionUPP(SICompletionProcPtr userRoutine) ;
66842 extern void
66843 DisposeSoundParamUPP(SoundParamUPP userUPP) ;
66844 extern void
66845 DisposeSoundConverterFillBufferDataUPP(SoundConverterFillBufferDataUPP userUPP) ;
66846 extern void
66847 DisposeSIInterruptUPP(SIInterruptUPP userUPP) ;
66848 extern void
66849 DisposeSICompletionUPP(SICompletionUPP userUPP) ;
66850 extern Boolean
66851 InvokeSoundParamUPP(
66852   SoundParamBlockPtr * pb,
66853   SoundParamUPP userUPP) ;
66854 extern Boolean
66855 InvokeSoundConverterFillBufferDataUPP(
66856   SoundComponentDataPtr * data,
66857   void * refCon,
66858   SoundConverterFillBufferDataUPP userUPP) ;
66859 extern void
66860 InvokeSIInterruptUPP(
66861   SPBPtr inParamPtr,
66862   Ptr dataBuffer,
66863   short peakAmplitude,
66864   long sampleSize,
66865   SIInterruptUPP userUPP) ;
66866 extern void
66867 InvokeSICompletionUPP(
66868   SPBPtr inParamPtr,
66869   SICompletionUPP userUPP) ;
66870
66871 typedef void ( * FilePlayCompletionProcPtr)(SndChannelPtr chan);
66872 typedef FilePlayCompletionProcPtr FilePlayCompletionUPP;
66873 extern void
66874 SysBeep(short duration) ;
66875 extern OSErr
66876 SndDoCommand(
66877   SndChannelPtr chan,
66878   const SndCommand * cmd,
66879   Boolean noWait) ;
66880 extern OSErr
66881 SndDoImmediate(
66882   SndChannelPtr chan,
66883   const SndCommand * cmd) ;
66884 extern OSErr
66885 SndNewChannel(
66886   SndChannelPtr * chan,
66887   short synth,
66888   long init,
66889   SndCallBackUPP userRoutine) ;
66890 extern OSErr
66891 SndDisposeChannel(
66892   SndChannelPtr chan,
66893   Boolean quietNow) ;
66894 extern OSErr
66895 SndPlay(
66896   SndChannelPtr chan,
66897   SndListHandle sndHandle,
66898   Boolean async) ;
66899 extern NumVersion
66900 SndSoundManagerVersion(void) ;
66901 extern OSErr
66902 SndChannelStatus(
66903   SndChannelPtr chan,
66904   short theLength,
66905   SCStatusPtr theStatus) ;
66906 extern OSErr
66907 SndManagerStatus(
66908   short theLength,
66909   SMStatusPtr theStatus) ;
66910 extern void
66911 SndGetSysBeepState(short * sysBeepState) ;
66912 extern OSErr
66913 SndSetSysBeepState(short sysBeepState) ;
66914 extern OSErr
66915 GetSysBeepVolume(long * level) ;
66916 extern OSErr
66917 SetSysBeepVolume(long level) ;
66918 extern OSErr
66919 GetDefaultOutputVolume(long * level) ;
66920 extern OSErr
66921 SetDefaultOutputVolume(long level) ;
66922 extern OSErr
66923 GetSoundHeaderOffset(
66924   SndListHandle sndHandle,
66925   long * offset) ;
66926 extern UnsignedFixed
66927 UnsignedFixedMulDiv(
66928   UnsignedFixed value,
66929   UnsignedFixed multiplier,
66930   UnsignedFixed divisor);
66931 extern OSErr
66932 GetCompressionInfo(
66933   short compressionID,
66934   OSType format,
66935   short numChannels,
66936   short sampleSize,
66937   CompressionInfoPtr cp) ;
66938 extern OSErr
66939 SetSoundPreference(
66940   OSType theType,
66941   Str255 name,
66942   Handle settings) ;
66943 extern OSErr
66944 GetSoundPreference(
66945   OSType theType,
66946   Str255 name,
66947   Handle settings) ;
66948 extern OSErr
66949 OpenMixerSoundComponent(
66950   SoundComponentDataPtr outputDescription,
66951   long outputFlags,
66952   ComponentInstance * mixerComponent) ;
66953 extern OSErr
66954 CloseMixerSoundComponent(ComponentInstance ci) ;
66955 extern OSErr
66956 SndGetInfo(
66957   SndChannelPtr chan,
66958   OSType selector,
66959   void * infoPtr) ;
66960 extern OSErr
66961 SndSetInfo(
66962   SndChannelPtr chan,
66963   OSType selector,
66964   const void * infoPtr) ;
66965 extern OSErr
66966 GetSoundOutputInfo(
66967   Component outputDevice,
66968   OSType selector,
66969   void * infoPtr) ;
66970 extern OSErr
66971 SetSoundOutputInfo(
66972   Component outputDevice,
66973   OSType selector,
66974   const void * infoPtr) ;
66975 extern OSErr
66976 GetCompressionName(
66977   OSType compressionType,
66978   Str255 compressionName) ;
66979 extern OSErr
66980 SoundConverterOpen(
66981   const SoundComponentData * inputFormat,
66982   const SoundComponentData * outputFormat,
66983   SoundConverter * sc) ;
66984 extern OSErr
66985 SoundConverterClose(SoundConverter sc) ;
66986 extern OSErr
66987 SoundConverterGetBufferSizes(
66988   SoundConverter sc,
66989   unsigned long inputBytesTarget,
66990   unsigned long * inputFrames,
66991   unsigned long * inputBytes,
66992   unsigned long * outputBytes) ;
66993 extern OSErr
66994 SoundConverterBeginConversion(SoundConverter sc) ;
66995 extern OSErr
66996 SoundConverterConvertBuffer(
66997   SoundConverter sc,
66998   const void * inputPtr,
66999   unsigned long inputFrames,
67000   void * outputPtr,
67001   unsigned long * outputFrames,
67002   unsigned long * outputBytes) ;
67003 extern OSErr
67004 SoundConverterEndConversion(
67005   SoundConverter sc,
67006   void * outputPtr,
67007   unsigned long * outputFrames,
67008   unsigned long * outputBytes) ;
67009 extern OSErr
67010 SoundConverterGetInfo(
67011   SoundConverter sc,
67012   OSType selector,
67013   void * infoPtr) ;
67014 extern OSErr
67015 SoundConverterSetInfo(
67016   SoundConverter sc,
67017   OSType selector,
67018   void * infoPtr) ;
67019 extern OSErr
67020 SoundConverterFillBuffer(
67021   SoundConverter sc,
67022   SoundConverterFillBufferDataUPP fillBufferDataUPP,
67023   void * fillBufferDataRefCon,
67024   void * outputBuffer,
67025   unsigned long outputBufferByteSize,
67026   unsigned long * bytesWritten,
67027   unsigned long * framesWritten,
67028   unsigned long * outputFlags) ;
67029 extern OSErr
67030 SoundManagerGetInfo(
67031   OSType selector,
67032   void * infoPtr) ;
67033 extern OSErr
67034 SoundManagerSetInfo(
67035   OSType selector,
67036   const void * infoPtr) ;
67037 extern ComponentResult
67038 SoundComponentInitOutputDevice(
67039   ComponentInstance ti,
67040   long actions) ;
67041 extern ComponentResult
67042 SoundComponentSetSource(
67043   ComponentInstance ti,
67044   SoundSource sourceID,
67045   ComponentInstance source) ;
67046 extern ComponentResult
67047 SoundComponentGetSource(
67048   ComponentInstance ti,
67049   SoundSource sourceID,
67050   ComponentInstance * source) ;
67051 extern ComponentResult
67052 SoundComponentGetSourceData(
67053   ComponentInstance ti,
67054   SoundComponentDataPtr * sourceData) ;
67055 extern ComponentResult
67056 SoundComponentSetOutput(
67057   ComponentInstance ti,
67058   SoundComponentDataPtr requested,
67059   SoundComponentDataPtr * actual) ;
67060 extern ComponentResult
67061 SoundComponentAddSource(
67062   ComponentInstance ti,
67063   SoundSource * sourceID) ;
67064 extern ComponentResult
67065 SoundComponentRemoveSource(
67066   ComponentInstance ti,
67067   SoundSource sourceID) ;
67068 extern ComponentResult
67069 SoundComponentGetInfo(
67070   ComponentInstance ti,
67071   SoundSource sourceID,
67072   OSType selector,
67073   void * infoPtr) ;
67074 extern ComponentResult
67075 SoundComponentSetInfo(
67076   ComponentInstance ti,
67077   SoundSource sourceID,
67078   OSType selector,
67079   void * infoPtr) ;
67080 extern ComponentResult
67081 SoundComponentStartSource(
67082   ComponentInstance ti,
67083   short count,
67084   SoundSource * sources) ;
67085 extern ComponentResult
67086 SoundComponentStopSource(
67087   ComponentInstance ti,
67088   short count,
67089   SoundSource * sources) ;
67090 extern ComponentResult
67091 SoundComponentPauseSource(
67092   ComponentInstance ti,
67093   short count,
67094   SoundSource * sources) ;
67095 extern ComponentResult
67096 SoundComponentPlaySourceBuffer(
67097   ComponentInstance ti,
67098   SoundSource sourceID,
67099   SoundParamBlockPtr pb,
67100   long actions) ;
67101
67102
67103
67104
67105 enum {
67106     kSoundComponentInitOutputDeviceSelect = 0x0001,
67107     kSoundComponentSetSourceSelect = 0x0002,
67108     kSoundComponentGetSourceSelect = 0x0003,
67109     kSoundComponentGetSourceDataSelect = 0x0004,
67110     kSoundComponentSetOutputSelect = 0x0005,
67111     kSoundComponentAddSourceSelect = 0x0101,
67112     kSoundComponentRemoveSourceSelect = 0x0102,
67113     kSoundComponentGetInfoSelect = 0x0103,
67114     kSoundComponentSetInfoSelect = 0x0104,
67115     kSoundComponentStartSourceSelect = 0x0105,
67116     kSoundComponentStopSourceSelect = 0x0106,
67117     kSoundComponentPauseSourceSelect = 0x0107,
67118     kSoundComponentPlaySourceBufferSelect = 0x0108
67119 };
67120 enum {
67121   kDelegatedSoundComponentSelectors = 0x0100
67122 };
67123 extern NumVersion
67124 SPBVersion(void) ;
67125 extern OSErr
67126 SndRecord(
67127   ModalFilterUPP filterProc,
67128   Point corner,
67129   OSType quality,
67130   SndListHandle * sndHandle) ;
67131 extern OSErr
67132 SPBSignInDevice(
67133   short deviceRefNum,
67134   ConstStr255Param deviceName) ;
67135 extern OSErr
67136 SPBSignOutDevice(short deviceRefNum) ;
67137 extern OSErr
67138 SPBGetIndexedDevice(
67139   short count,
67140   Str255 deviceName,
67141   Handle * deviceIconHandle) ;
67142 extern OSErr
67143 SPBOpenDevice(
67144   ConstStr255Param deviceName,
67145   short permission,
67146   long * inRefNum) ;
67147 extern OSErr
67148 SPBCloseDevice(long inRefNum) ;
67149 extern OSErr
67150 SPBRecord(
67151   SPBPtr inParamPtr,
67152   Boolean asynchFlag) ;
67153 extern OSErr
67154 SPBPauseRecording(long inRefNum) ;
67155 extern OSErr
67156 SPBResumeRecording(long inRefNum) ;
67157 extern OSErr
67158 SPBStopRecording(long inRefNum) ;
67159 extern OSErr
67160 SPBGetRecordingStatus(
67161   long inRefNum,
67162   short * recordingStatus,
67163   short * meterLevel,
67164   unsigned long * totalSamplesToRecord,
67165   unsigned long * numberOfSamplesRecorded,
67166   unsigned long * totalMsecsToRecord,
67167   unsigned long * numberOfMsecsRecorded) ;
67168 extern OSErr
67169 SPBGetDeviceInfo(
67170   long inRefNum,
67171   OSType infoType,
67172   void * infoData) ;
67173 extern OSErr
67174 SPBSetDeviceInfo(
67175   long inRefNum,
67176   OSType infoType,
67177   void * infoData) ;
67178 extern OSErr
67179 SPBMillisecondsToBytes(
67180   long inRefNum,
67181   long * milliseconds) ;
67182 extern OSErr
67183 SPBBytesToMilliseconds(
67184   long inRefNum,
67185   long * byteCount) ;
67186 extern OSErr
67187 SetupSndHeader(
67188   SndListHandle sndHandle,
67189   short numChannels,
67190   UnsignedFixed sampleRate,
67191   short sampleSize,
67192   OSType compressionType,
67193   short baseNote,
67194   unsigned long numBytes,
67195   short * headerLen) ;
67196 extern OSErr
67197 SetupAIFFHeader(
67198   short fRefNum,
67199   short numChannels,
67200   UnsignedFixed sampleRate,
67201   short sampleSize,
67202   OSType compressionType,
67203   unsigned long numBytes,
67204   unsigned long numFrames) ;
67205 extern OSErr
67206 ParseAIFFHeader(
67207   short fRefNum,
67208   SoundComponentData * sndInfo,
67209   unsigned long * numFrames,
67210   unsigned long * dataOffset) ;
67211 extern OSErr
67212 ParseSndHeader(
67213   SndListHandle sndHandle,
67214   SoundComponentData * sndInfo,
67215   unsigned long * numFrames,
67216   unsigned long * dataOffset) ;
67217 typedef struct SndInputCmpParam SndInputCmpParam;
67218 typedef SndInputCmpParam * SndInputCmpParamPtr;
67219 typedef void ( * SICCompletionProcPtr)(SndInputCmpParamPtr SICParmPtr);
67220 struct SndInputCmpParam {
67221   SICCompletionProcPtr ioCompletion;
67222   SIInterruptProcPtr ioInterrupt;
67223   OSErr ioResult;
67224   short pad;
67225   unsigned long ioReqCount;
67226   unsigned long ioActCount;
67227   Ptr ioBuffer;
67228   Ptr ioMisc;
67229 };
67230 extern ComponentResult
67231 SndInputReadAsync(
67232   ComponentInstance self,
67233   SndInputCmpParamPtr SICParmPtr) ;
67234 extern ComponentResult
67235 SndInputReadSync(
67236   ComponentInstance self,
67237   SndInputCmpParamPtr SICParmPtr) ;
67238 extern ComponentResult
67239 SndInputPauseRecording(ComponentInstance self) ;
67240 extern ComponentResult
67241 SndInputResumeRecording(ComponentInstance self) ;
67242 extern ComponentResult
67243 SndInputStopRecording(ComponentInstance self) ;
67244 extern ComponentResult
67245 SndInputGetStatus(
67246   ComponentInstance self,
67247   short * recordingStatus,
67248   unsigned long * totalSamplesToRecord,
67249   unsigned long * numberOfSamplesRecorded) ;
67250 extern ComponentResult
67251 SndInputGetDeviceInfo(
67252   ComponentInstance self,
67253   OSType infoType,
67254   void * infoData) ;
67255 extern ComponentResult
67256 SndInputSetDeviceInfo(
67257   ComponentInstance self,
67258   OSType infoType,
67259   void * infoData) ;
67260 extern ComponentResult
67261 SndInputInitHardware(ComponentInstance self) ;
67262
67263
67264
67265
67266 enum {
67267     kSndInputReadAsyncSelect = 0x0001,
67268     kSndInputReadSyncSelect = 0x0002,
67269     kSndInputPauseRecordingSelect = 0x0003,
67270     kSndInputResumeRecordingSelect = 0x0004,
67271     kSndInputStopRecordingSelect = 0x0005,
67272     kSndInputGetStatusSelect = 0x0006,
67273     kSndInputGetDeviceInfoSelect = 0x0007,
67274     kSndInputSetDeviceInfoSelect = 0x0008,
67275     kSndInputInitHardwareSelect = 0x0009
67276 };
67277
67278
67279
67280
67281
67282
67283 }
67284
67285
67286
67287 extern "C" {
67288
67289
67290 enum {
67291   kOSAComponentType = 'osa '
67292 };
67293
67294
67295 enum {
67296   kOSAGenericScriptingComponentSubtype = 'scpt'
67297 };
67298
67299
67300
67301 enum {
67302   kOSAFileType = 'osas'
67303 };
67304
67305
67306
67307
67308
67309
67310 enum {
67311   kOSASuite = 'ascr'
67312 };
67313
67314
67315 enum {
67316   kOSARecordedText = 'recd'
67317 };
67318
67319
67320
67321 enum {
67322   kOSAScriptIsModified = 'modi'
67323 };
67324
67325
67326
67327 enum {
67328   kOSAScriptIsTypeCompiledScript = 'cscr'
67329 };
67330
67331
67332
67333 enum {
67334   kOSAScriptIsTypeScriptValue = 'valu'
67335 };
67336
67337
67338
67339 enum {
67340   kOSAScriptIsTypeScriptContext = 'cntx'
67341 };
67342
67343
67344
67345 enum {
67346   kOSAScriptBestType = 'best'
67347 };
67348
67349
67350
67351
67352
67353
67354
67355 enum {
67356   kOSACanGetSource = 'gsrc'
67357 };
67358
67359
67360 enum {
67361   typeOSADialectInfo = 'difo',
67362   keyOSADialectName = 'dnam',
67363   keyOSADialectCode = 'dcod',
67364   keyOSADialectLangCode = 'dlcd',
67365   keyOSADialectScriptCode = 'dscd'
67366 };
67367
67368 typedef ComponentResult OSAError;
67369
67370 typedef unsigned long OSAID;
67371
67372
67373
67374
67375 enum {
67376   kOSANullScript = 0L
67377 };
67378
67379
67380 enum {
67381   kOSANullMode = 0,
67382   kOSAModeNull = 0
67383 };
67384
67385
67386
67387
67388
67389 typedef OSErr ( * OSACreateAppleEventProcPtr)(AEEventClass theAEEventClass, AEEventID theAEEventID, const AEAddressDesc *target, short returnID, long transactionID, AppleEvent *result, long refCon);
67390 typedef OSErr ( * OSASendProcPtr)(const AppleEvent *theAppleEvent, AppleEvent *reply, AESendMode sendMode, AESendPriority sendPriority, long timeOutInTicks, AEIdleUPP idleProc, AEFilterUPP filterProc, long refCon);
67391 typedef OSACreateAppleEventProcPtr OSACreateAppleEventUPP;
67392 typedef OSASendProcPtr OSASendUPP;
67393 extern OSACreateAppleEventUPP
67394 NewOSACreateAppleEventUPP(OSACreateAppleEventProcPtr userRoutine) ;
67395 extern OSASendUPP
67396 NewOSASendUPP(OSASendProcPtr userRoutine) ;
67397 extern void
67398 DisposeOSACreateAppleEventUPP(OSACreateAppleEventUPP userUPP) ;
67399 extern void
67400 DisposeOSASendUPP(OSASendUPP userUPP) ;
67401 extern OSErr
67402 InvokeOSACreateAppleEventUPP(
67403   AEEventClass theAEEventClass,
67404   AEEventID theAEEventID,
67405   const AEAddressDesc * target,
67406   short returnID,
67407   long transactionID,
67408   AppleEvent * result,
67409   long refCon,
67410   OSACreateAppleEventUPP userUPP) ;
67411 extern OSErr
67412 InvokeOSASendUPP(
67413   const AppleEvent * theAppleEvent,
67414   AppleEvent * reply,
67415   AESendMode sendMode,
67416   AESendPriority sendPriority,
67417   long timeOutInTicks,
67418   AEIdleUPP idleProc,
67419   AEFilterUPP filterProc,
67420   long refCon,
67421   OSASendUPP userUPP) ;
67422 enum {
67423   kOSASupportsCompiling = 0x0002,
67424   kOSASupportsGetSource = 0x0004,
67425   kOSASupportsAECoercion = 0x0008,
67426   kOSASupportsAESending = 0x0010,
67427   kOSASupportsRecording = 0x0020,
67428   kOSASupportsConvenience = 0x0040,
67429   kOSASupportsDialects = 0x0080,
67430   kOSASupportsEventHandling = 0x0100
67431 };
67432
67433
67434 enum {
67435   kOSASelectLoad = 0x0001,
67436   kOSASelectStore = 0x0002,
67437   kOSASelectExecute = 0x0003,
67438   kOSASelectDisplay = 0x0004,
67439   kOSASelectScriptError = 0x0005,
67440   kOSASelectDispose = 0x0006,
67441   kOSASelectSetScriptInfo = 0x0007,
67442   kOSASelectGetScriptInfo = 0x0008,
67443   kOSASelectSetActiveProc = 0x0009,
67444   kOSASelectGetActiveProc = 0x000A
67445 };
67446
67447
67448 enum {
67449   kOSASelectScriptingComponentName = 0x0102,
67450   kOSASelectCompile = 0x0103,
67451   kOSASelectCopyID = 0x0104
67452 };
67453
67454 enum {
67455   kOSASelectCopyScript = 0x0105
67456 };
67457
67458
67459 enum {
67460   kOSASelectGetSource = 0x0201
67461 };
67462
67463
67464 enum {
67465   kOSASelectCoerceFromDesc = 0x0301,
67466   kOSASelectCoerceToDesc = 0x0302
67467 };
67468
67469
67470 enum {
67471   kOSASelectSetSendProc = 0x0401,
67472   kOSASelectGetSendProc = 0x0402,
67473   kOSASelectSetCreateProc = 0x0403,
67474   kOSASelectGetCreateProc = 0x0404,
67475   kOSASelectSetDefaultTarget = 0x0405
67476 };
67477
67478
67479 enum {
67480   kOSASelectStartRecording = 0x0501,
67481   kOSASelectStopRecording = 0x0502
67482 };
67483
67484
67485 enum {
67486   kOSASelectLoadExecute = 0x0601,
67487   kOSASelectCompileExecute = 0x0602,
67488   kOSASelectDoScript = 0x0603
67489 };
67490
67491
67492 enum {
67493   kOSASelectSetCurrentDialect = 0x0701,
67494   kOSASelectGetCurrentDialect = 0x0702,
67495   kOSASelectAvailableDialects = 0x0703,
67496   kOSASelectGetDialectInfo = 0x0704,
67497   kOSASelectAvailableDialectCodeList = 0x0705
67498 };
67499
67500
67501 enum {
67502   kOSASelectSetResumeDispatchProc = 0x0801,
67503   kOSASelectGetResumeDispatchProc = 0x0802,
67504   kOSASelectExecuteEvent = 0x0803,
67505   kOSASelectDoEvent = 0x0804,
67506   kOSASelectMakeContext = 0x0805
67507 };
67508
67509
67510 enum {
67511   kOSADebuggerCreateSession = 0x0901,
67512   kOSADebuggerGetSessionState = 0x0902,
67513   kOSADebuggerSessionStep = 0x0903,
67514   kOSADebuggerDisposeSession = 0x0904,
67515   kOSADebuggerGetStatementRanges = 0x0905,
67516   kOSADebuggerGetBreakpoint = 0x0910,
67517   kOSADebuggerSetBreakpoint = 0x0911,
67518   kOSADebuggerGetDefaultBreakpoint = 0x0912,
67519   kOSADebuggerGetCurrentCallFrame = 0x0906,
67520   kOSADebuggerGetCallFrameState = 0x0907,
67521   kOSADebuggerGetVariable = 0x0908,
67522   kOSADebuggerSetVariable = 0x0909,
67523   kOSADebuggerGetPreviousCallFrame = 0x090A,
67524   kOSADebuggerDisposeCallFrame = 0x090B
67525 };
67526
67527
67528 enum {
67529   kOSASelectComponentSpecificStart = 0x1001
67530 };
67531 enum {
67532   kOSAModePreventGetSource = 0x00000001
67533 };
67534 enum {
67535   kOSAModeNeverInteract = kAENeverInteract,
67536   kOSAModeCanInteract = kAECanInteract,
67537   kOSAModeAlwaysInteract = kAEAlwaysInteract,
67538   kOSAModeDontReconnect = kAEDontReconnect
67539 };
67540 enum {
67541   kOSAModeCantSwitchLayer = 0x00000040
67542 };
67543 enum {
67544   kOSAModeDoRecord = 0x00001000
67545 };
67546 enum {
67547   kOSAModeCompileIntoContext = 0x00000002
67548 };
67549 enum {
67550   kOSAModeAugmentContext = 0x00000004
67551 };
67552
67553
67554
67555
67556
67557
67558
67559 enum {
67560   kOSAModeDisplayForHumans = 0x00000008
67561 };
67562
67563
67564
67565
67566
67567
67568
67569 enum {
67570   kOSAModeDontStoreParent = 0x00010000
67571 };
67572 enum {
67573   kOSAModeDispatchToDirectObject = 0x00020000
67574 };
67575
67576
67577
67578
67579
67580 enum {
67581   kOSAModeDontGetDataForArguments = 0x00040000
67582 };
67583
67584
67585
67586
67587
67588
67589 enum {
67590   kOSAModeFullyQualifyDescriptors = 0x00080000
67591 };
67592 enum {
67593   kOSAScriptResourceType = kOSAGenericScriptingComponentSubtype
67594 };
67595
67596
67597
67598
67599
67600 enum {
67601   typeOSAGenericStorage = kOSAScriptResourceType
67602 };
67603 extern OSAError
67604 OSALoad(
67605   ComponentInstance scriptingComponent,
67606   const AEDesc * scriptData,
67607   long modeFlags,
67608   OSAID * resultingScriptID) ;
67609 extern OSAError
67610 OSAStore(
67611   ComponentInstance scriptingComponent,
67612   OSAID scriptID,
67613   DescType desiredType,
67614   long modeFlags,
67615   AEDesc * resultingScriptData) ;
67616 extern OSAError
67617 OSAExecute(
67618   ComponentInstance scriptingComponent,
67619   OSAID compiledScriptID,
67620   OSAID contextID,
67621   long modeFlags,
67622   OSAID * resultingScriptValueID) ;
67623 extern OSAError
67624 OSADisplay(
67625   ComponentInstance scriptingComponent,
67626   OSAID scriptValueID,
67627   DescType desiredType,
67628   long modeFlags,
67629   AEDesc * resultingText) ;
67630 extern OSAError
67631 OSAScriptError(
67632   ComponentInstance scriptingComponent,
67633   OSType selector,
67634   DescType desiredType,
67635   AEDesc * resultingErrorDescription) ;
67636 enum {
67637   kOSAErrorNumber = keyErrorNumber
67638 };
67639 enum {
67640   kOSAErrorMessage = keyErrorString
67641 };
67642 enum {
67643   kOSAErrorBriefMessage = 'errb'
67644 };
67645 enum {
67646   kOSAErrorApp = 'erap'
67647 };
67648 enum {
67649   kOSAErrorPartialResult = 'ptlr'
67650 };
67651 enum {
67652   kOSAErrorOffendingObject = 'erob'
67653 };
67654
67655
67656
67657
67658
67659
67660 enum {
67661   kOSAErrorExpectedType = 'errt'
67662 };
67663 enum {
67664   kOSAErrorRange = 'erng'
67665 };
67666
67667
67668
67669
67670
67671
67672 enum {
67673   typeOSAErrorRange = 'erng'
67674 };
67675
67676
67677
67678 enum {
67679   keyOSASourceStart = 'srcs'
67680 };
67681
67682
67683
67684 enum {
67685   keyOSASourceEnd = 'srce'
67686 };
67687 extern OSAError
67688 OSADispose(
67689   ComponentInstance scriptingComponent,
67690   OSAID scriptID) ;
67691 extern OSAError
67692 OSASetScriptInfo(
67693   ComponentInstance scriptingComponent,
67694   OSAID scriptID,
67695   OSType selector,
67696   long value) ;
67697 extern OSAError
67698 OSAGetScriptInfo(
67699   ComponentInstance scriptingComponent,
67700   OSAID scriptID,
67701   OSType selector,
67702   long * result) ;
67703 typedef OSErr ( * OSAActiveProcPtr)(long refCon);
67704 typedef OSAActiveProcPtr OSAActiveUPP;
67705 extern OSAActiveUPP
67706 NewOSAActiveUPP(OSAActiveProcPtr userRoutine) ;
67707 extern void
67708 DisposeOSAActiveUPP(OSAActiveUPP userUPP) ;
67709 extern OSErr
67710 InvokeOSAActiveUPP(
67711   long refCon,
67712   OSAActiveUPP userUPP) ;
67713 extern OSAError
67714 OSASetActiveProc(
67715   ComponentInstance scriptingComponent,
67716   OSAActiveUPP activeProc,
67717   long refCon) ;
67718 extern OSAError
67719 OSAGetActiveProc(
67720   ComponentInstance scriptingComponent,
67721   OSAActiveUPP * activeProc,
67722   long * refCon) ;
67723 extern OSAError
67724 OSAScriptingComponentName(
67725   ComponentInstance scriptingComponent,
67726   AEDesc * resultingScriptingComponentName) ;
67727 extern OSAError
67728 OSACompile(
67729   ComponentInstance scriptingComponent,
67730   const AEDesc * sourceData,
67731   long modeFlags,
67732   OSAID * previousAndResultingScriptID) ;
67733 extern OSAError
67734 OSACopyID(
67735   ComponentInstance scriptingComponent,
67736   OSAID fromID,
67737   OSAID * toID) ;
67738 extern OSAError
67739 OSAGetSource(
67740   ComponentInstance scriptingComponent,
67741   OSAID scriptID,
67742   DescType desiredType,
67743   AEDesc * resultingSourceData) ;
67744 extern OSAError
67745 OSACoerceFromDesc(
67746   ComponentInstance scriptingComponent,
67747   const AEDesc * scriptData,
67748   long modeFlags,
67749   OSAID * resultingScriptID) ;
67750 extern OSAError
67751 OSACoerceToDesc(
67752   ComponentInstance scriptingComponent,
67753   OSAID scriptID,
67754   DescType desiredType,
67755   long modeFlags,
67756   AEDesc * result) ;
67757 extern OSAError
67758 OSASetSendProc(
67759   ComponentInstance scriptingComponent,
67760   OSASendUPP sendProc,
67761   long refCon) ;
67762 extern OSAError
67763 OSAGetSendProc(
67764   ComponentInstance scriptingComponent,
67765   OSASendUPP * sendProc,
67766   long * refCon) ;
67767 extern OSAError
67768 OSASetCreateProc(
67769   ComponentInstance scriptingComponent,
67770   OSACreateAppleEventUPP createProc,
67771   long refCon) ;
67772 extern OSAError
67773 OSAGetCreateProc(
67774   ComponentInstance scriptingComponent,
67775   OSACreateAppleEventUPP * createProc,
67776   long * refCon) ;
67777 extern OSAError
67778 OSASetDefaultTarget(
67779   ComponentInstance scriptingComponent,
67780   const AEAddressDesc * target) ;
67781 extern OSAError
67782 OSAStartRecording(
67783   ComponentInstance scriptingComponent,
67784   OSAID * compiledScriptToModifyID) ;
67785 extern OSAError
67786 OSAStopRecording(
67787   ComponentInstance scriptingComponent,
67788   OSAID compiledScriptID) ;
67789 extern OSAError
67790 OSALoadExecute(
67791   ComponentInstance scriptingComponent,
67792   const AEDesc * scriptData,
67793   OSAID contextID,
67794   long modeFlags,
67795   OSAID * resultingScriptValueID) ;
67796 extern OSAError
67797 OSACompileExecute(
67798   ComponentInstance scriptingComponent,
67799   const AEDesc * sourceData,
67800   OSAID contextID,
67801   long modeFlags,
67802   OSAID * resultingScriptValueID) ;
67803 extern OSAError
67804 OSADoScript(
67805   ComponentInstance scriptingComponent,
67806   const AEDesc * sourceData,
67807   OSAID contextID,
67808   DescType desiredType,
67809   long modeFlags,
67810   AEDesc * resultingText) ;
67811 extern OSAError
67812 OSASetCurrentDialect(
67813   ComponentInstance scriptingComponent,
67814   short dialectCode) ;
67815 extern OSAError
67816 OSAGetCurrentDialect(
67817   ComponentInstance scriptingComponent,
67818   short * resultingDialectCode) ;
67819 extern OSAError
67820 OSAAvailableDialects(
67821   ComponentInstance scriptingComponent,
67822   AEDesc * resultingDialectInfoList) ;
67823 extern OSAError
67824 OSAGetDialectInfo(
67825   ComponentInstance scriptingComponent,
67826   short dialectCode,
67827   OSType selector,
67828   AEDesc * resultingDialectInfo) ;
67829 extern OSAError
67830 OSAAvailableDialectCodeList(
67831   ComponentInstance scriptingComponent,
67832   AEDesc * resultingDialectCodeList) ;
67833 extern OSAError
67834 OSASetResumeDispatchProc(
67835   ComponentInstance scriptingComponent,
67836   AEEventHandlerUPP resumeDispatchProc,
67837   long refCon) ;
67838 enum {
67839   kOSAUseStandardDispatch = kAEUseStandardDispatch
67840 };
67841 enum {
67842   kOSANoDispatch = kAENoDispatch
67843 };
67844 enum {
67845   kOSADontUsePhac = 0x0001
67846 };
67847 extern OSAError
67848 OSAGetResumeDispatchProc(
67849   ComponentInstance scriptingComponent,
67850   AEEventHandlerUPP * resumeDispatchProc,
67851   long * refCon) ;
67852 extern OSAError
67853 OSAExecuteEvent(
67854   ComponentInstance scriptingComponent,
67855   const AppleEvent * theAppleEvent,
67856   OSAID contextID,
67857   long modeFlags,
67858   OSAID * resultingScriptValueID) ;
67859 extern OSAError
67860 OSADoEvent(
67861   ComponentInstance scriptingComponent,
67862   const AppleEvent * theAppleEvent,
67863   OSAID contextID,
67864   long modeFlags,
67865   AppleEvent * reply) ;
67866 extern OSAError
67867 OSAMakeContext(
67868   ComponentInstance scriptingComponent,
67869   const AEDesc * contextName,
67870   OSAID parentContext,
67871   OSAID * resultingContextID) ;
67872 typedef OSAID OSADebugSessionRef;
67873 typedef OSAID OSADebugCallFrameRef;
67874
67875
67876
67877 typedef UInt32 OSAProgramState;
67878 enum {
67879   eNotStarted = 0,
67880   eRunnable = 1,
67881   eRunning = 2,
67882   eStopped = 3,
67883   eTerminated = 4
67884 };
67885
67886 typedef UInt32 OSADebugStepKind;
67887 enum {
67888   eStepOver = 0,
67889   eStepIn = 1,
67890   eStepOut = 2,
67891   eRun = 3
67892 };
67893
67894
67895
67896
67897 enum {
67898   keyProgramState = 'dsps'
67899 };
67900
67901
67902
67903
67904 struct StatementRange {
67905   unsigned long startPos;
67906   unsigned long endPos;
67907 };
67908 typedef struct StatementRange StatementRange;
67909 enum {
67910   typeStatementRange = 'srng'
67911 };
67912
67913 enum {
67914   keyProcedureName = 'dfnm',
67915   keyStatementRange = 'dfsr',
67916   keyLocalsNames = 'dfln',
67917   keyGlobalsNames = 'dfgn',
67918   keyParamsNames = 'dfpn'
67919 };
67920 extern OSAError
67921 OSADebuggerCreateSession(
67922   ComponentInstance scriptingComponent,
67923   OSAID inScript,
67924   OSAID inContext,
67925   OSADebugSessionRef * outSession) ;
67926 extern OSAError
67927 OSADebuggerGetSessionState(
67928   ComponentInstance scriptingComponent,
67929   OSADebugSessionRef inSession,
67930   AERecord * outState) ;
67931 extern OSAError
67932 OSADebuggerSessionStep(
67933   ComponentInstance scriptingComponent,
67934   OSADebugSessionRef inSession,
67935   OSADebugStepKind inKind) ;
67936 extern OSAError
67937 OSADebuggerDisposeSession(
67938   ComponentInstance scriptingComponent,
67939   OSADebugSessionRef inSession) ;
67940 extern OSAError
67941 OSADebuggerGetStatementRanges(
67942   ComponentInstance scriptingComponent,
67943   OSADebugSessionRef inSession,
67944   AEDescList * outStatementRangeArray) ;
67945 extern OSAError
67946 OSADebuggerGetBreakpoint(
67947   ComponentInstance scriptingComponent,
67948   OSADebugSessionRef inSession,
67949   UInt32 inSrcOffset,
67950   OSAID * outBreakpoint) ;
67951 extern OSAError
67952 OSADebuggerSetBreakpoint(
67953   ComponentInstance scriptingComponent,
67954   OSADebugSessionRef inSession,
67955   UInt32 inSrcOffset,
67956   OSAID inBreakpoint) ;
67957 extern OSAError
67958 OSADebuggerGetDefaultBreakpoint(
67959   ComponentInstance scriptingComponent,
67960   OSADebugSessionRef inSession,
67961   OSAID * outBreakpoint) ;
67962 extern OSAError
67963 OSADebuggerGetCurrentCallFrame(
67964   ComponentInstance scriptingComponent,
67965   OSADebugSessionRef inSession,
67966   OSADebugCallFrameRef * outCallFrame) ;
67967 extern OSAError
67968 OSADebuggerGetCallFrameState(
67969   ComponentInstance scriptingComponent,
67970   OSADebugCallFrameRef inCallFrame,
67971   AERecord * outState) ;
67972 extern OSAError
67973 OSADebuggerGetVariable(
67974   ComponentInstance scriptingComponent,
67975   OSADebugCallFrameRef inCallFrame,
67976   const AEDesc * inVariableName,
67977   OSAID * outVariable) ;
67978 extern OSAError
67979 OSADebuggerSetVariable(
67980   ComponentInstance scriptingComponent,
67981   OSADebugCallFrameRef inCallFrame,
67982   const AEDesc * inVariableName,
67983   OSAID inVariable) ;
67984 extern OSAError
67985 OSADebuggerGetPreviousCallFrame(
67986   ComponentInstance scriptingComponent,
67987   OSADebugCallFrameRef inCurrentFrame,
67988   OSADebugCallFrameRef * outPrevFrame) ;
67989 extern OSAError
67990 OSADebuggerDisposeCallFrame(
67991   ComponentInstance scriptingComponent,
67992   OSADebugCallFrameRef inCallFrame) ;
67993
67994
67995
67996
67997
67998 }
67999
68000
68001
68002 extern "C" {
68003 extern OSErr
68004 OSAGetStorageType(
68005   AEDataStorage scriptData,
68006   DescType * dscType) ;
68007 extern OSErr
68008 OSAAddStorageType(
68009   AEDataStorage scriptData,
68010   DescType dscType) ;
68011 extern OSErr
68012 OSARemoveStorageType(AEDataStorage scriptData) ;
68013
68014
68015
68016
68017 }
68018
68019
68020
68021 extern "C" {
68022 enum {
68023
68024   kGenericComponentVersion = 0x0100
68025 };
68026
68027 enum {
68028   kGSSSelectGetDefaultScriptingComponent = 0x1001,
68029   kGSSSelectSetDefaultScriptingComponent = 0x1002,
68030   kGSSSelectGetScriptingComponent = 0x1003,
68031   kGSSSelectGetScriptingComponentFromStored = 0x1004,
68032   kGSSSelectGenericToRealID = 0x1005,
68033   kGSSSelectRealToGenericID = 0x1006,
68034   kGSSSelectOutOfRange = 0x1007
68035 };
68036
68037 typedef OSType ScriptingComponentSelector;
68038 typedef OSAID GenericID;
68039 extern OSAError
68040 OSAGetDefaultScriptingComponent(
68041   ComponentInstance genericScriptingComponent,
68042   ScriptingComponentSelector * scriptingSubType) ;
68043 extern OSAError
68044 OSASetDefaultScriptingComponent(
68045   ComponentInstance genericScriptingComponent,
68046   ScriptingComponentSelector scriptingSubType) ;
68047 extern OSAError
68048 OSAGetScriptingComponent(
68049   ComponentInstance genericScriptingComponent,
68050   ScriptingComponentSelector scriptingSubType,
68051   ComponentInstance * scriptingInstance) ;
68052 extern OSAError
68053 OSAGetScriptingComponentFromStored(
68054   ComponentInstance genericScriptingComponent,
68055   const AEDesc * scriptData,
68056   ScriptingComponentSelector * scriptingSubType) ;
68057 extern OSAError
68058 OSAGenericToRealID(
68059   ComponentInstance genericScriptingComponent,
68060   OSAID * theScriptID,
68061   ComponentInstance * theExactComponent) ;
68062 extern OSAError
68063 OSARealToGenericID(
68064   ComponentInstance genericScriptingComponent,
68065   OSAID * theScriptID,
68066   ComponentInstance theExactComponent) ;
68067
68068
68069
68070
68071
68072
68073 }
68074
68075
68076
68077 extern "C" {
68078 enum {
68079   typeAppleScript = 'ascr',
68080   kAppleScriptSubtype = typeAppleScript,
68081   typeASStorage = typeAppleScript
68082 };
68083
68084
68085
68086
68087
68088 enum {
68089   kASSelectInit = 0x1001,
68090   kASSelectSetSourceStyles = 0x1002,
68091   kASSelectGetSourceStyles = 0x1003,
68092   kASSelectGetSourceStyleNames = 0x1004
68093 };
68094
68095
68096
68097
68098
68099 enum {
68100   kASHasOpenHandler = 'hsod'
68101 };
68102 extern OSAError
68103 ASInit(
68104   ComponentInstance scriptingComponent,
68105   long modeFlags,
68106   long minStackSize,
68107   long preferredStackSize,
68108   long maxStackSize,
68109   long minHeapSize,
68110   long preferredHeapSize,
68111   long maxHeapSize) ;
68112 enum {
68113   kASDefaultMinStackSize = 4 * 1024,
68114   kASDefaultPreferredStackSize = 16 * 1024,
68115   kASDefaultMaxStackSize = 16 * 1024,
68116   kASDefaultMinHeapSize = 4 * 1024,
68117   kASDefaultPreferredHeapSize = 16 * 1024,
68118   kASDefaultMaxHeapSize = 32L * 1024 * 1024
68119 };
68120 extern OSAError
68121 ASSetSourceStyles(
68122   ComponentInstance scriptingComponent,
68123   STHandle sourceStyles) ;
68124 extern OSAError
68125 ASGetSourceStyles(
68126   ComponentInstance scriptingComponent,
68127   STHandle * resultingSourceStyles) ;
68128 extern OSAError
68129 ASGetSourceStyleNames(
68130   ComponentInstance scriptingComponent,
68131   long modeFlags,
68132   AEDescList * resultingSourceStyleNamesList) ;
68133 enum {
68134   kASSourceStyleUncompiledText = 0,
68135   kASSourceStyleNormalText = 1,
68136   kASSourceStyleLanguageKeyword = 2,
68137   kASSourceStyleApplicationKeyword = 3,
68138   kASSourceStyleComment = 4,
68139   kASSourceStyleLiteral = 5,
68140   kASSourceStyleUserSymbol = 6,
68141   kASSourceStyleObjectSpecifier = 7,
68142   kASNumberOfSourceStyles = 8
68143 };
68144
68145
68146
68147
68148 }
68149
68150
68151
68152 extern "C" {
68153 enum {
68154   kOSAModeDontDefine = 0x0001
68155 };
68156
68157
68158
68159
68160 enum {
68161   kASSelectSetPropertyObsolete = 0x1101,
68162   kASSelectGetPropertyObsolete = 0x1102,
68163   kASSelectSetHandlerObsolete = 0x1103,
68164   kASSelectGetHandlerObsolete = 0x1104,
68165   kASSelectGetAppTerminologyObsolete = 0x1105,
68166   kASSelectSetProperty = 0x1106,
68167   kASSelectGetProperty = 0x1107,
68168   kASSelectSetHandler = 0x1108,
68169   kASSelectGetHandler = 0x1109,
68170   kASSelectGetAppTerminology = 0x110A,
68171   kASSelectGetSysTerminology = 0x110B,
68172   kASSelectGetPropertyNames = 0x110C,
68173   kASSelectGetHandlerNames = 0x110D
68174 };
68175 extern OSAError
68176 OSASetProperty(
68177   ComponentInstance scriptingComponent,
68178   long modeFlags,
68179   OSAID contextID,
68180   const AEDesc * variableName,
68181   OSAID scriptValueID) ;
68182 extern OSAError
68183 OSAGetProperty(
68184   ComponentInstance scriptingComponent,
68185   long modeFlags,
68186   OSAID contextID,
68187   const AEDesc * variableName,
68188   OSAID * resultingScriptValueID) ;
68189 extern OSAError
68190 OSAGetPropertyNames(
68191   ComponentInstance scriptingComponent,
68192   long modeFlags,
68193   OSAID contextID,
68194   AEDescList * resultingPropertyNames) ;
68195 extern OSAError
68196 OSASetHandler(
68197   ComponentInstance scriptingComponent,
68198   long modeFlags,
68199   OSAID contextID,
68200   const AEDesc * handlerName,
68201   OSAID compiledScriptID) ;
68202 extern OSAError
68203 OSAGetHandler(
68204   ComponentInstance scriptingComponent,
68205   long modeFlags,
68206   OSAID contextID,
68207   const AEDesc * handlerName,
68208   OSAID * resultingCompiledScriptID) ;
68209 extern OSAError
68210 OSAGetHandlerNames(
68211   ComponentInstance scriptingComponent,
68212   long modeFlags,
68213   OSAID contextID,
68214   AEDescList * resultingHandlerNames) ;
68215 extern OSAError
68216 OSAGetAppTerminology(
68217   ComponentInstance scriptingComponent,
68218   long modeFlags,
68219   FSSpec * fileSpec,
68220   short terminologyID,
68221   Boolean * didLaunch,
68222   AEDesc * terminologyList) ;
68223 extern OSAError
68224 OSAGetSysTerminology(
68225   ComponentInstance scriptingComponent,
68226   long modeFlags,
68227   short terminologyID,
68228   AEDesc * terminologyList) ;
68229 extern OSAError
68230 ASSetProperty(
68231   ComponentInstance scriptingComponent,
68232   OSAID contextID,
68233   const AEDesc * variableName,
68234   OSAID scriptValueID) ;
68235 extern OSAError
68236 ASGetProperty(
68237   ComponentInstance scriptingComponent,
68238   OSAID contextID,
68239   const AEDesc * variableName,
68240   OSAID * resultingScriptValueID) ;
68241 extern OSAError
68242 ASSetHandler(
68243   ComponentInstance scriptingComponent,
68244   OSAID contextID,
68245   const AEDesc * handlerName,
68246   OSAID compiledScriptID) ;
68247 extern OSAError
68248 ASGetHandler(
68249   ComponentInstance scriptingComponent,
68250   OSAID contextID,
68251   const AEDesc * handlerName,
68252   OSAID * resultingCompiledScriptID) ;
68253 extern OSAError
68254 ASGetAppTerminology(
68255   ComponentInstance scriptingComponent,
68256   FSSpec * fileSpec,
68257   short terminologID,
68258   Boolean * didLaunch,
68259   AEDesc * terminologyList) ;
68260 }
68261
68262
68263
68264 enum {
68265   keyAETarget = 'targ',
68266   keySubjectAttr = 'subj',
68267   keyASReturning = 'Krtn',
68268   kASAppleScriptSuite = 'ascr',
68269   kASScriptEditorSuite = 'ToyS',
68270   kASTypeNamesSuite = 'tpnm',
68271   typeAETE = 'aete',
68272   typeAEUT = 'aeut',
68273   kGetAETE = 'gdte',
68274   kGetAEUT = 'gdut',
68275   kUpdateAEUT = 'udut',
68276   kUpdateAETE = 'udte',
68277   kCleanUpAEUT = 'cdut',
68278   kASComment = 'cmnt',
68279   kASLaunchEvent = 'noop',
68280   keyScszResource = 'scsz',
68281   typeScszResource = 'scsz',
68282   kASSubroutineEvent = 'psbr',
68283   keyASSubroutineName = 'snam',
68284   kASPrepositionalSubroutine = 'psbr',
68285   keyASPositionalArgs = 'parg'
68286 };
68287
68288 enum {
68289
68290   keyAppHandledCoercion = 'idas'
68291 };
68292
68293 enum {
68294
68295   kASStartLogEvent = 'log1',
68296   kASStopLogEvent = 'log0',
68297   kASCommentEvent = 'cmnt'
68298 };
68299
68300
68301
68302 enum {
68303
68304   kASAdd = '+   ',
68305   kASSubtract = '-   ',
68306   kASMultiply = '*   ',
68307   kASDivide = '/   ',
68308   kASQuotient = 'div ',
68309   kASRemainder = 'mod ',
68310   kASPower = '^   ',
68311   kASEqual = kAEEquals,
68312   kASNotEqual = '­   ',
68313   kASGreaterThan = kAEGreaterThan,
68314   kASGreaterThanOrEqual = kAEGreaterThanEquals,
68315   kASLessThan = kAELessThan,
68316   kASLessThanOrEqual = kAELessThanEquals,
68317   kASComesBefore = 'cbfr',
68318   kASComesAfter = 'cafr',
68319   kASConcatenate = 'ccat',
68320   kASStartsWith = kAEBeginsWith,
68321   kASEndsWith = kAEEndsWith,
68322   kASContains = kAEContains
68323 };
68324
68325 enum {
68326   kASAnd = kAEAND,
68327   kASOr = kAEOR,
68328   kASNot = kAENOT,
68329   kASNegate = 'neg ',
68330   keyASArg = 'arg '
68331 };
68332
68333 enum {
68334
68335   kASErrorEventCode = 'err ',
68336   kOSAErrorArgs = 'erra',
68337   keyAEErrorObject = 'erob',
68338   pLength = 'leng',
68339   pReverse = 'rvse',
68340   pRest = 'rest',
68341   pInherits = 'c@#^',
68342   pProperties = 'pALL',
68343   keyASUserRecordFields = 'usrf',
68344   typeUserRecordFields = typeAEList
68345 };
68346
68347
68348 enum {
68349   keyASPrepositionAt = 'at  ',
68350   keyASPrepositionIn = 'in  ',
68351   keyASPrepositionFrom = 'from',
68352   keyASPrepositionFor = 'for ',
68353   keyASPrepositionTo = 'to  ',
68354   keyASPrepositionThru = 'thru',
68355   keyASPrepositionThrough = 'thgh',
68356   keyASPrepositionBy = 'by  ',
68357   keyASPrepositionOn = 'on  ',
68358   keyASPrepositionInto = 'into',
68359   keyASPrepositionOnto = 'onto',
68360   keyASPrepositionBetween = 'btwn',
68361   keyASPrepositionAgainst = 'agst',
68362   keyASPrepositionOutOf = 'outo',
68363   keyASPrepositionInsteadOf = 'isto',
68364   keyASPrepositionAsideFrom = 'asdf',
68365   keyASPrepositionAround = 'arnd',
68366   keyASPrepositionBeside = 'bsid',
68367   keyASPrepositionBeneath = 'bnth',
68368   keyASPrepositionUnder = 'undr'
68369 };
68370
68371 enum {
68372   keyASPrepositionOver = 'over',
68373   keyASPrepositionAbove = 'abve',
68374   keyASPrepositionBelow = 'belw',
68375   keyASPrepositionApartFrom = 'aprt',
68376   keyASPrepositionGiven = 'givn',
68377   keyASPrepositionWith = 'with',
68378   keyASPrepositionWithout = 'wout',
68379   keyASPrepositionAbout = 'abou',
68380   keyASPrepositionSince = 'snce',
68381   keyASPrepositionUntil = 'till'
68382 };
68383
68384 enum {
68385
68386   kDialectBundleResType = 'Dbdl',
68387   cConstant = typeEnumerated,
68388   cClassIdentifier = pClass,
68389   cObjectBeingExamined = typeObjectBeingExamined,
68390   cList = typeAEList,
68391   cSmallReal = typeSMFloat,
68392   cReal = typeFloat,
68393   cRecord = typeAERecord,
68394   cReference = cObjectSpecifier,
68395   cUndefined = 'undf',
68396   cMissingValue = 'msng',
68397   cSymbol = 'symb',
68398   cLinkedList = 'llst',
68399   cVector = 'vect',
68400   cEventIdentifier = 'evnt',
68401   cKeyIdentifier = 'kyid',
68402   cUserIdentifier = 'uid ',
68403   cPreposition = 'prep',
68404   cKeyForm = enumKeyForm,
68405   cScript = 'scpt',
68406   cHandler = 'hand',
68407   cProcedure = 'proc'
68408 };
68409
68410 enum {
68411   cHandleBreakpoint = 'brak'
68412 };
68413
68414 enum {
68415   cClosure = 'clsr',
68416   cRawData = 'rdat',
68417   cStringClass = typeChar,
68418   cNumber = 'nmbr',
68419   cListElement = 'celm',
68420   cListOrRecord = 'lr  ',
68421   cListOrString = 'ls  ',
68422   cListRecordOrString = 'lrs ',
68423   cNumberOrString = 'ns  ',
68424   cNumberOrDateTime = 'nd  ',
68425   cNumberDateTimeOrString = 'nds ',
68426   cAliasOrString = 'sf  ',
68427   cSeconds = 'scnd',
68428   typeSound = 'snd ',
68429   enumBooleanValues = 'boov',
68430   kAETrue = typeTrue,
68431   kAEFalse = typeFalse,
68432   enumMiscValues = 'misc',
68433   kASCurrentApplication = 'cura',
68434   formUserPropertyID = 'usrp'
68435 };
68436
68437 enum {
68438   cString = cStringClass
68439 };
68440
68441 enum {
68442
68443   pASIt = 'it  ',
68444   pASMe = 'me  ',
68445   pASResult = 'rslt',
68446   pASSpace = 'spac',
68447   pASReturn = 'ret ',
68448   pASTab = 'tab ',
68449   pASPi = 'pi  ',
68450   pASParent = 'pare',
68451   kASInitializeEventCode = 'init',
68452   pASPrintLength = 'prln',
68453   pASPrintDepth = 'prdp',
68454   pASTopLevelScript = 'ascr'
68455 };
68456
68457 enum {
68458
68459   kAECase = 'case',
68460   kAEDiacritic = 'diac',
68461   kAEWhiteSpace = 'whit',
68462   kAEHyphens = 'hyph',
68463   kAEExpansion = 'expa',
68464   kAEPunctuation = 'punc',
68465   kAEZenkakuHankaku = 'zkhk',
68466   kAESmallKana = 'skna',
68467   kAEKataHiragana = 'hika',
68468   kASConsiderReplies = 'rmte',
68469   enumConsiderations = 'cons'
68470 };
68471
68472
68473 enum {
68474   kAECaseConsiderMask = 0x00000001,
68475   kAEDiacriticConsiderMask = 0x00000002,
68476   kAEWhiteSpaceConsiderMask = 0x00000004,
68477   kAEHyphensConsiderMask = 0x00000008,
68478   kAEExpansionConsiderMask = 0x00000010,
68479   kAEPunctuationConsiderMask = 0x00000020,
68480   kASConsiderRepliesConsiderMask = 0x00000040,
68481   kAECaseIgnoreMask = 0x00010000,
68482   kAEDiacriticIgnoreMask = 0x00020000,
68483   kAEWhiteSpaceIgnoreMask = 0x00040000,
68484   kAEHyphensIgnoreMask = 0x00080000,
68485   kAEExpansionIgnoreMask = 0x00100000,
68486   kAEPunctuationIgnoreMask = 0x00200000,
68487   kASConsiderRepliesIgnoreMask = 0x00400000,
68488   enumConsidsAndIgnores = 'csig'
68489 };
68490
68491 enum {
68492   cCoercion = 'coec',
68493   cCoerceUpperCase = 'txup',
68494   cCoerceLowerCase = 'txlo',
68495   cCoerceRemoveDiacriticals = 'txdc',
68496   cCoerceRemovePunctuation = 'txpc',
68497   cCoerceRemoveHyphens = 'txhy',
68498   cCoerceOneByteToTwoByte = 'txex',
68499   cCoerceRemoveWhiteSpace = 'txws',
68500   cCoerceSmallKana = 'txsk',
68501   cCoerceZenkakuhankaku = 'txze',
68502   cCoerceKataHiragana = 'txkh',
68503   cZone = 'zone',
68504   cMachine = 'mach',
68505   cAddress = 'addr',
68506   cRunningAddress = 'radd',
68507   cStorage = 'stor'
68508 };
68509
68510 enum {
68511
68512   pASWeekday = 'wkdy',
68513   pASMonth = 'mnth',
68514   pASDay = 'day ',
68515   pASYear = 'year',
68516   pASTime = 'time',
68517   pASDateString = 'dstr',
68518   pASTimeString = 'tstr',
68519   cMonth = pASMonth,
68520   cJanuary = 'jan ',
68521   cFebruary = 'feb ',
68522   cMarch = 'mar ',
68523   cApril = 'apr ',
68524   cMay = 'may ',
68525   cJune = 'jun ',
68526   cJuly = 'jul ',
68527   cAugust = 'aug ',
68528   cSeptember = 'sep ',
68529   cOctober = 'oct ',
68530   cNovember = 'nov ',
68531   cDecember = 'dec '
68532 };
68533
68534 enum {
68535
68536   cWeekday = pASWeekday,
68537   cSunday = 'sun ',
68538   cMonday = 'mon ',
68539   cTuesday = 'tue ',
68540   cWednesday = 'wed ',
68541   cThursday = 'thu ',
68542   cFriday = 'fri ',
68543   cSaturday = 'sat ',
68544   pASQuote = 'quot',
68545   pASSeconds = 'secs',
68546   pASMinutes = 'min ',
68547   pASHours = 'hour',
68548   pASDays = 'days',
68549   pASWeeks = 'week',
68550   cWritingCodeInfo = 'citl',
68551   pScriptCode = 'pscd',
68552   pLangCode = 'plcd',
68553   kASMagicTellEvent = 'tell',
68554   kASMagicEndTellEvent = 'tend'
68555 };
68556
68557
68558
68559 enum {
68560   kAEFinderSuite = 'fndr'
68561 };
68562
68563
68564
68565
68566
68567
68568 enum {
68569   kAECleanUp = 'fclu',
68570   kAEEject = 'ejct',
68571   kAEEmpty = 'empt',
68572   kAEErase = 'fera',
68573   kAEGestalt = 'gstl',
68574   kAEPutAway = 'ptwy',
68575   kAERebuildDesktopDB = 'rddb',
68576   kAESync = 'fupd',
68577   kAEInterceptOpen = 'fopn'
68578 };
68579
68580
68581 enum {
68582   kAEDatabaseSuite = 'DATA',
68583   kAESort = 'SORT'
68584 };
68585 enum {
68586   cInternalFinderObject = 'obj '
68587 };
68588
68589
68590
68591
68592
68593 enum {
68594
68595
68596
68597   cAliasFile = 'alia',
68598   cApplicationFile = 'appf',
68599   cControlPanelFile = 'ccdv',
68600   cDeskAccessoryFile = 'dafi',
68601   cDocumentFile = 'docf',
68602   cFontFile = 'fntf',
68603   cSoundFile = 'sndf',
68604   cClippingFile = 'clpf',
68605   cContainer = 'ctnr',
68606   cDesktop = 'cdsk',
68607   cSharableContainer = 'sctr',
68608   cDisk = 'cdis',
68609   cFolder = 'cfol',
68610   cSuitcase = 'stcs',
68611   cAccessorySuitcase = 'dsut',
68612   cFontSuitcase = 'fsut',
68613   cTrash = 'ctrs',
68614   cDesktopPrinter = 'dskp',
68615   cPackage = 'pack',
68616   cContentSpace = 'dwnd',
68617   cContainerWindow = 'cwnd',
68618   cInfoWindow = 'iwnd',
68619   cSharingWindow = 'swnd',
68620   cStatusWindow = 'qwnd',
68621   cClippingWindow = 'lwnd',
68622   cPreferencesWindow = 'pwnd',
68623   cDTPWindow = 'dtpw',
68624   cProcess = 'prcs',
68625   cAccessoryProcess = 'pcda',
68626   cApplicationProcess = 'pcap',
68627   cGroup = 'sgrp',
68628   cUser = 'cuse',
68629   cSharingPrivileges = 'priv',
68630   cPreferences = 'cprf',
68631   cLabel = 'clbl',
68632   cSound = 'snd ',
68633   cAliasList = 'alst',
68634   cSpecialFolders = 'spfl',
68635   cOnlineDisk = 'cods',
68636   cOnlineLocalDisk = 'clds',
68637   cOnlineRemoteDisk = 'crds',
68638   cEntireContents = 'ects',
68639   cIconFamily = 'ifam'
68640 };
68641 enum {
68642
68643   pComment = 'comt',
68644   pContainer = cContainer,
68645   pContentSpace = cContentSpace,
68646   pCreationDateOld = 'crtd',
68647   pCreationDate = 'ascd',
68648   pDescription = 'dscr',
68649   pDisk = cDisk,
68650   pFolderOld = cFolder,
68651   pFolder = 'asdr',
68652   pIconBitmap = 'iimg',
68653   pInfoWindow = cInfoWindow,
68654   pKind = 'kind',
68655   pLabelIndex = 'labi',
68656   pModificationDateOld = 'modd',
68657   pModificationDate = 'asmo',
68658
68659   pPhysicalSize = 'phys',
68660   pPosition = 'posn',
68661   pIsSelected = 'issl',
68662   pSize = pPointSize,
68663   pWindow = cWindow,
68664   pPreferencesWindow = cPreferencesWindow
68665 };
68666
68667
68668
68669 enum {
68670   pFileCreator = 'fcrt',
68671   pFileType = 'asty',
68672   pFileTypeOld = 'fitp',
68673   pIsLocked = 'aslk',
68674   pIsLockedOld = 'islk',
68675
68676
68677   pProductVersion = 'ver2'
68678 };
68679
68680
68681
68682 enum {
68683   pOriginalItem = 'orig'
68684 };
68685
68686
68687 enum {
68688   pMinAppPartition = 'mprt',
68689   pAppPartition = 'appt',
68690   pSuggestedAppPartition = 'sprt',
68691   pIsScriptable = 'isab'
68692 };
68693
68694
68695 enum {
68696   pInternetLocation = 'iloc'
68697 };
68698
68699
68700 enum {
68701   pSound = 'snd '
68702 };
68703 enum {
68704   pShowFolderSize = 'sfsz',
68705   pShowComment = 'scom',
68706   pShowDate = 'sdat',
68707   pShowCreationDate = 'scda',
68708   pShowKind = 'sknd',
68709   pShowLabel = 'slbl',
68710   pShowSize = 'ssiz',
68711   pShowVersion = 'svrs',
68712   pSortDirection = 'sord',
68713   pShowDiskInfo = 'sdin',
68714   pListViewIconSize = 'lvis',
68715   pGridIcons = 'fgrd',
68716   pStaggerIcons = 'fstg',
68717   pViewFont = 'vfnt',
68718   pViewFontSize = 'vfsz'
68719 };
68720
68721
68722 enum {
68723   pCompletelyExpanded = 'pexc',
68724   pContainerWindow = cContainerWindow,
68725   pEntireContents = cEntireContents,
68726   pExpandable = 'pexa',
68727   pExpanded = 'pexp',
68728   pPreviousView = 'svew',
68729   pView = 'pvew',
68730   pIconSize = pListViewIconSize,
68731   pKeepArranged = 'arrg',
68732   pKeepArrangedBy = 'arby'
68733 };
68734
68735
68736 enum {
68737   pStartupDisk = 'sdsk',
68738   pTrash = 'trsh'
68739 };
68740
68741
68742 enum {
68743   pOwner = 'sown',
68744   pOwnerPrivileges = 'ownr',
68745   pGroup = cGroup,
68746   pGroupPrivileges = 'gppr',
68747   pGuestPrivileges = 'gstp',
68748   pArePrivilegesInherited = 'iprv',
68749   pExported = 'sexp',
68750   pMounted = 'smou',
68751   pSharingProtection = 'spro',
68752   pSharing = 'shar',
68753   pSharingWindow = cSharingWindow
68754 };
68755
68756
68757 enum {
68758   pCapacity = 'capa',
68759   pEjectable = 'isej',
68760   pFreeSpace = 'frsp',
68761   pLocal = 'isrv',
68762   pIsStartup = 'istd'
68763 };
68764
68765
68766 enum {
68767   pWarnOnEmpty = 'warn'
68768 };
68769
68770
68771 enum {
68772   pIsZoomedFull = 'zumf',
68773   pIsPopup = 'drwr',
68774   pIsPulledOpen = 'pull',
68775   pIsCollapsed = 'wshd'
68776 };
68777
68778
68779 enum {
68780   pObject = cObject
68781 };
68782
68783
68784 enum {
68785   pSharableContainer = cSharableContainer
68786 };
68787
68788
68789 enum {
68790   pInfoPanel = 'panl'
68791 };
68792
68793
68794
68795 enum {
68796   pFileShareOn = 'fshr',
68797   pFileShareStartingUp = 'fsup',
68798   pProgramLinkingOn = 'iac '
68799 };
68800
68801
68802 enum {
68803
68804
68805   pShowModificationDate = pShowDate,
68806   pUseRelativeDate = 'urdt',
68807   pDelayBeforeSpringing = 'dela',
68808   pSpringOpenFolders = 'sprg',
68809   pUseShortMenus = 'usme',
68810   pUseWideGrid = 'uswg',
68811   pLabel1 = 'lbl1',
68812   pLabel2 = 'lbl2',
68813   pLabel3 = 'lbl3',
68814   pLabel4 = 'lbl4',
68815   pLabel5 = 'lbl5',
68816   pLabel6 = 'lbl6',
68817   pLabel7 = 'lbl7',
68818   pDefaultIconViewIconSize = 'iisz',
68819   pDefaultButtonViewIconSize = 'bisz',
68820   pDefaultListViewIconSize = 'lisz',
68821   pIconViewArrangement = 'iarr',
68822   pButtonViewArrangement = 'barr'
68823 };
68824
68825
68826
68827
68828
68829 enum {
68830   pNoArrangement = 'narr',
68831   pSnapToGridArrangement = 'grda',
68832   pByNameArrangement = 'nama',
68833   pByModificationDateArrangement = 'mdta',
68834   pByCreationDateArrangement = 'cdta',
68835   pBySizeArrangement = 'siza',
68836   pByKindArrangement = 'kina',
68837   pByLabelArrangement = 'laba'
68838 };
68839
68840
68841
68842
68843 enum {
68844
68845   pFile = cFile,
68846
68847
68848
68849   pPartitionSpaceUsed = 'pusd',
68850
68851   pLocalAndRemoteEvents = 'revt',
68852   pHasScriptingTerminology = 'hscr'
68853 };
68854
68855
68856 enum {
68857   pDeskAccessoryFile = cDeskAccessoryFile
68858 };
68859
68860
68861 enum {
68862   pApplicationFile = cApplicationFile
68863 };
68864 enum {
68865
68866
68867
68868
68869
68870
68871   pCanConnect = 'ccon',
68872   pCanChangePassword = 'ccpw',
68873   pCanDoProgramLinking = 'ciac',
68874   pIsOwner = 'isow',
68875   pARADialIn = 'arad',
68876   pShouldCallBack = 'calb',
68877   pCallBackNumber = 'cbnm'
68878 };
68879
68880
68881
68882
68883
68884 enum {
68885   pAboutMacintosh = 'abbx',
68886   pAppleMenuItemsFolder = 'amnu',
68887
68888   pControlPanelsFolder = 'ctrl',
68889   pDesktop = 'desk',
68890   pExtensionsFolder = 'extn',
68891
68892   pFinderPreferences = 'pfrp',
68893   pFontsFolder = 'font',
68894   pFontsFolderPreAllegro = 'ffnt',
68895
68896
68897   pLargestFreeBlock = 'mfre',
68898   pPreferencesFolder = 'pref',
68899
68900
68901
68902   pShortCuts = 'scut',
68903   pShutdownFolder = 'shdf',
68904   pStartupItemsFolder = 'strt',
68905   pSystemFolder = 'macs',
68906   pTemporaryFolder = 'temp',
68907
68908   pViewPreferences = 'pvwp',
68909   pStartingUp = 'awak'
68910 };
68911
68912
68913 enum {
68914   pSeeFiles = 'prvr',
68915   pSeeFolders = 'prvs',
68916   pMakeChanges = 'prvw'
68917 };
68918 enum {
68919   pSmallIcon = 'smic',
68920   pSmallButton = 'smbu',
68921   pLargeButton = 'lgbu',
68922   pGrid = 'grid'
68923 };
68924
68925
68926
68927
68928
68929
68930
68931 enum {
68932   enumViewBy = 'vwby',
68933   enumGestalt = 'gsen',
68934   enumConflicts = 'cflc',
68935   enumExistingItems = 'exsi',
68936   enumOlderItems = 'oldr'
68937 };
68938
68939 enum {
68940   enumDate = 'enda',
68941   enumAnyDate = 'anyd',
68942   enumToday = 'tday',
68943   enumYesterday = 'yday',
68944   enumThisWeek = 'twek',
68945   enumLastWeek = 'lwek',
68946   enumThisMonth = 'tmon',
68947   enumLastMonth = 'lmon',
68948   enumThisYear = 'tyer',
68949   enumLastYear = 'lyer',
68950   enumBeforeDate = 'bfdt',
68951   enumAfterDate = 'afdt',
68952   enumBetweenDate = 'btdt',
68953   enumOnDate = 'ondt'
68954 };
68955
68956 enum {
68957   enumAllDocuments = 'alld',
68958   enumFolders = 'fold',
68959   enumAliases = 'alia',
68960   enumStationery = 'stat'
68961 };
68962
68963 enum {
68964   enumWhere = 'wher',
68965   enumAllLocalDisks = 'aldk',
68966   enumAllRemoteDisks = 'ardk',
68967   enumAllDisks = 'alld',
68968   enumAllOpenFolders = 'aofo'
68969 };
68970
68971
68972 enum {
68973   enumIconSize = 'isiz',
68974   enumSmallIconSize = pSmallIcon,
68975   enumMiniIconSize = 'miic',
68976   enumLargeIconSize = 'lgic'
68977 };
68978
68979 enum {
68980   enumSortDirection = 'sodr',
68981   enumSortDirectionNormal = 'snrm',
68982   enumSortDirectionReverse = 'srvs'
68983 };
68984
68985 enum {
68986   enumArrangement = 'earr'
68987 };
68988
68989
68990 enum {
68991   enumInfoWindowPanel = 'ipnl',
68992   enumGeneralPanel = 'gpnl',
68993   enumSharingPanel = 'spnl',
68994   enumStatusNConfigPanel = 'scnl',
68995   enumFontsPanel = 'fpnl',
68996   enumMemoryPanel = 'mpnl'
68997 };
68998
68999
69000
69001 enum {
69002   enumPrefsWindowPanel = 'pple',
69003   enumPrefsGeneralPanel = 'pgnp',
69004   enumPrefsLabelPanel = 'plbp',
69005   enumPrefsIconViewPanel = 'pivp',
69006   enumPrefsButtonViewPanel = 'pbvp',
69007   enumPrefsListViewPanel = 'plvp'
69008 };
69009
69010
69011
69012
69013
69014
69015
69016 enum {
69017   typeIconFamily = cIconFamily,
69018   typeIconAndMask = 'ICN#',
69019   type8BitMask = 'l8mk',
69020   type32BitIcon = 'il32',
69021   type8BitIcon = 'icl8',
69022   type4BitIcon = 'icl4',
69023   typeSmallIconAndMask = 'ics#',
69024   typeSmall8BitMask = 's8mk',
69025   typeSmall32BitIcon = 'is32',
69026   typeSmall8BitIcon = 'ics8',
69027   typeSmall4BitIcon = 'ics4',
69028   typeRelativeTime = 'rtim',
69029   typeConceptualTime = 'timc'
69030 };
69031
69032
69033
69034
69035
69036
69037
69038 enum {
69039   keyIconAndMask = 'ICN#',
69040   key32BitIcon = 'il32',
69041   key8BitIcon = 'icl8',
69042   key4BitIcon = 'icl4',
69043   key8BitMask = 'l8mk',
69044   keySmallIconAndMask = 'ics#',
69045   keySmall8BitIcon = 'ics8',
69046   keySmall4BitIcon = 'ics4',
69047   keySmall32BitIcon = 'is32',
69048   keySmall8BitMask = 's8mk',
69049   keyMini1BitMask = 'icm#',
69050   keyMini4BitIcon = 'icm4',
69051   keyMini8BitIcon = 'icm8',
69052   keyAEUsing = 'usin',
69053   keyAEReplacing = 'alrp',
69054   keyAENoAutoRouting = 'rout',
69055   keyLocalPositionList = 'mvpl',
69056   keyGlobalPositionList = 'mvpg',
69057   keyRedirectedDocumentList = 'fpdl'
69058 };
69059
69060
69061
69062
69063
69064
69065
69066 enum {
69067   keyASPrepositionHas = 'has ',
69068   keyAll = 'kyal',
69069   keyOldFinderItems = 'fsel'
69070 };
69071
69072
69073
69074
69075
69076
69077
69078 enum {
69079   formAlias = typeAlias,
69080   formCreator = pFileCreator
69081 };
69082 enum {
69083   errFinderIsBusy = -15260,
69084   errFinderWindowNotOpen = -15261,
69085   errFinderCannotPutAway = -15262,
69086   errFinderWindowMustBeIconView = -15263,
69087   errFinderWindowMustBeListView = -15264,
69088   errFinderCantMoveToDestination = -15265,
69089   errFinderCantMoveSource = -15266,
69090   errFinderCantOverwrite = -15267,
69091   errFinderIncestuousMove = -15268,
69092   errFinderCantMoveToAncestor = -15269,
69093   errFinderCantUseTrashedItems = -15270,
69094   errFinderItemAlreadyInDest = -15271,
69095   errFinderUnknownUser = -15272,
69096   errFinderSharePointsCantInherit = -15273,
69097   errFinderWindowWrongType = -15274,
69098   errFinderPropertyNowWindowBased = -15275,
69099   errFinderAppFolderProtected = -15276,
69100   errFinderSysFolderProtected = -15277,
69101   errFinderBoundsWrong = -15278,
69102   errAEValueOutOfRange = -15279,
69103   errFinderPropertyDoesNotApply = -15280,
69104   errFinderFileSharingMustBeOn = -15281,
69105   errFinderMustBeActive = -15282,
69106   errFinderVolumeNotFound = -15283,
69107   errFinderLockedItemsInTrash = -15284,
69108   errFinderOnlyLockedItemsInTrash = -15285,
69109   errFinderProgramLinkingMustBeOn = -15286,
69110   errFinderWindowMustBeButtonView = -15287,
69111   errFinderBadPackageContents = -15288,
69112   errFinderUnsupportedInsidePackages = -15289,
69113   errFinderCorruptOpenFolderList = -15290,
69114   errFinderNoInvisibleFiles = -15291,
69115   errFinderCantDeleteImmediately = -15292,
69116   errFinderLastReserved = -15379
69117 };
69118
69119
69120
69121 enum {
69122   kDigiHubEventClass = 'dhub'
69123 };
69124
69125
69126
69127 enum {
69128   kDigiHubMusicCD = 'aucd',
69129   kDigiHubPictureCD = 'picd',
69130   kDigiHubVideoDVD = 'vdvd',
69131   kDigiHubBlankCD = 'bcd ',
69132   kDigiHubBlankDVD = 'bdvd'
69133 };
69134
69135
69136
69137 extern "C" {
69138
69139
69140
69141 typedef void ( * PMItemProcPtr)(DialogRef theDialog, short item);
69142 typedef void ( * PMPrintDialogInitProcPtr)(PMPrintSettings printSettings, PMDialog *theDialog);
69143 typedef void ( * PMPageSetupDialogInitProcPtr)(PMPageFormat pageFormat, PMDialog *theDialog);
69144 typedef void ( * PMSheetDoneProcPtr)(PMPrintSession printSession, WindowRef documentWindow, Boolean accepted);
69145 typedef PMItemProcPtr PMItemUPP;
69146 typedef PMPrintDialogInitProcPtr PMPrintDialogInitUPP;
69147 typedef PMPageSetupDialogInitProcPtr PMPageSetupDialogInitUPP;
69148 typedef PMSheetDoneProcPtr PMSheetDoneUPP;
69149 extern PMItemUPP
69150 NewPMItemUPP(PMItemProcPtr userRoutine) ;
69151 extern PMPrintDialogInitUPP
69152 NewPMPrintDialogInitUPP(PMPrintDialogInitProcPtr userRoutine) ;
69153 extern PMPageSetupDialogInitUPP
69154 NewPMPageSetupDialogInitUPP(PMPageSetupDialogInitProcPtr userRoutine) ;
69155 extern PMSheetDoneUPP
69156 NewPMSheetDoneUPP(PMSheetDoneProcPtr userRoutine) ;
69157 extern void
69158 DisposePMItemUPP(PMItemUPP userUPP) ;
69159 extern void
69160 DisposePMPrintDialogInitUPP(PMPrintDialogInitUPP userUPP) ;
69161 extern void
69162 DisposePMPageSetupDialogInitUPP(PMPageSetupDialogInitUPP userUPP) ;
69163 extern void
69164 DisposePMSheetDoneUPP(PMSheetDoneUPP userUPP) ;
69165 extern void
69166 InvokePMItemUPP(
69167   DialogRef theDialog,
69168   short item,
69169   PMItemUPP userUPP) ;
69170 extern void
69171 InvokePMPrintDialogInitUPP(
69172   PMPrintSettings printSettings,
69173   PMDialog * theDialog,
69174   PMPrintDialogInitUPP userUPP) ;
69175 extern void
69176 InvokePMPageSetupDialogInitUPP(
69177   PMPageFormat pageFormat,
69178   PMDialog * theDialog,
69179   PMPageSetupDialogInitUPP userUPP) ;
69180 extern void
69181 InvokePMSheetDoneUPP(
69182   PMPrintSession printSession,
69183   WindowRef documentWindow,
69184   Boolean accepted,
69185   PMSheetDoneUPP userUPP) ;
69186 extern OSStatus
69187 PMSessionBeginDocument(
69188   PMPrintSession printSession,
69189   PMPrintSettings printSettings,
69190   PMPageFormat pageFormat) ;
69191 extern OSStatus
69192 PMSessionEndDocument(PMPrintSession printSession) ;
69193 extern OSStatus
69194 PMSessionBeginPage(
69195   PMPrintSession printSession,
69196   PMPageFormat pageFormat,
69197   const PMRect * pageFrame) ;
69198 extern OSStatus
69199 PMSessionEndPage(PMPrintSession printSession) ;
69200 extern OSStatus
69201 PMSessionPageSetupDialog(
69202   PMPrintSession printSession,
69203   PMPageFormat pageFormat,
69204   Boolean * accepted) ;
69205 extern OSStatus
69206 PMSessionPrintDialog(
69207   PMPrintSession printSession,
69208   PMPrintSettings printSettings,
69209   PMPageFormat constPageFormat,
69210   Boolean * accepted) ;
69211 extern OSStatus
69212 PMSessionPageSetupDialogInit(
69213   PMPrintSession printSession,
69214   PMPageFormat pageFormat,
69215   PMDialog * newDialog) ;
69216 extern OSStatus
69217 PMSessionPrintDialogInit(
69218   PMPrintSession printSession,
69219   PMPrintSettings printSettings,
69220   PMPageFormat constPageFormat,
69221   PMDialog * newDialog) ;
69222 extern OSStatus
69223 PMSessionPrintDialogMain(
69224   PMPrintSession printSession,
69225   PMPrintSettings printSettings,
69226   PMPageFormat constPageFormat,
69227   Boolean * accepted,
69228   PMPrintDialogInitUPP myInitProc) ;
69229 extern OSStatus
69230 PMSessionPageSetupDialogMain(
69231   PMPrintSession printSession,
69232   PMPageFormat pageFormat,
69233   Boolean * accepted,
69234   PMPageSetupDialogInitUPP myInitProc) ;
69235 extern OSStatus
69236 PMSessionUseSheets(
69237   PMPrintSession printSession,
69238   WindowRef documentWindow,
69239   PMSheetDoneUPP sheetDoneProc) ;
69240 extern OSStatus
69241 PMGetDialogPtr(
69242   PMDialog pmDialog,
69243   DialogRef * theDialog) ;
69244 extern OSStatus
69245 PMGetModalFilterProc(
69246   PMDialog pmDialog,
69247   ModalFilterUPP * filterProc) ;
69248 extern OSStatus
69249 PMSetModalFilterProc(
69250   PMDialog pmDialog,
69251   ModalFilterUPP filterProc) ;
69252 extern OSStatus
69253 PMGetItemProc(
69254   PMDialog pmDialog,
69255   PMItemUPP * itemProc) ;
69256 extern OSStatus
69257 PMSetItemProc(
69258   PMDialog pmDialog,
69259   PMItemUPP itemProc) ;
69260 extern OSStatus
69261 PMGetDialogAccepted(
69262   PMDialog pmDialog,
69263   Boolean * process) ;
69264 extern OSStatus
69265 PMSetDialogAccepted(
69266   PMDialog pmDialog,
69267   Boolean process) ;
69268 extern OSStatus
69269 PMGetDialogDone(
69270   PMDialog pmDialog,
69271   Boolean * done) ;
69272 extern OSStatus
69273 PMSetDialogDone(
69274   PMDialog pmDialog,
69275   Boolean done) ;
69276 extern OSStatus
69277 PMSessionEnablePrinterPresets(
69278   PMPrintSession session,
69279   CFStringRef graphicsType) ;
69280 extern OSStatus
69281 PMSessionDisablePrinterPresets(PMPrintSession session) ;
69282
69283
69284
69285
69286 }
69287
69288
69289
69290 extern "C" {
69291
69292
69293
69294 typedef UInt32 NavAskSaveChangesAction;
69295 enum {
69296
69297   kNavSaveChangesClosingDocument = 1,
69298   kNavSaveChangesQuittingApplication = 2,
69299   kNavSaveChangesOther = 0
69300 };
69301
69302
69303 typedef UInt32 NavAskSaveChangesResult;
69304 enum {
69305
69306   kNavAskSaveChangesSave = 1,
69307   kNavAskSaveChangesCancel = 2,
69308   kNavAskSaveChangesDontSave = 3
69309 };
69310
69311
69312 typedef UInt32 NavAskDiscardChangesResult;
69313 enum {
69314
69315   kNavAskDiscardChanges = 1,
69316   kNavAskDiscardChangesCancel = 2
69317 };
69318
69319
69320 typedef SInt16 NavFilterModes;
69321 enum {
69322
69323   kNavFilteringBrowserList = 0,
69324   kNavFilteringFavorites = 1,
69325   kNavFilteringRecents = 2,
69326   kNavFilteringShortCutVolumes = 3,
69327   kNavFilteringLocationPopup = 4
69328 };
69329
69330
69331 enum {
69332   kNavFileOrFolderVersion = 1
69333 };
69334
69335 struct NavFileOrFolderInfo {
69336   UInt16 version;
69337   Boolean isFolder;
69338   Boolean visible;
69339   UInt32 creationDate;
69340   UInt32 modificationDate;
69341   union {
69342     struct {
69343       Boolean locked;
69344       Boolean resourceOpen;
69345       Boolean dataOpen;
69346       Boolean reserved1;
69347       UInt32 dataSize;
69348       UInt32 resourceSize;
69349       FInfo finderInfo;
69350       FXInfo finderXInfo;
69351     } fileInfo;
69352     struct {
69353       Boolean shareable;
69354       Boolean sharePoint;
69355       Boolean mounted;
69356       Boolean readable;
69357       Boolean writeable;
69358       Boolean reserved2;
69359       UInt32 numberOfFiles;
69360       DInfo finderDInfo;
69361       DXInfo finderDXInfo;
69362       OSType folderType;
69363       OSType folderCreator;
69364       char reserved3[206];
69365     } folderInfo;
69366
69367   } fileAndFolder;
69368 };
69369 typedef struct NavFileOrFolderInfo NavFileOrFolderInfo;
69370 union NavEventDataInfo {
69371   EventRecord * event;
69372   void * param;
69373 };
69374 typedef union NavEventDataInfo NavEventDataInfo;
69375 struct NavEventData {
69376   NavEventDataInfo eventDataParms;
69377   SInt16 itemHit;
69378 };
69379 typedef struct NavEventData NavEventData;
69380 typedef struct __NavDialog* NavDialogRef;
69381 typedef UInt32 NavUserAction;
69382 enum {
69383
69384
69385
69386
69387
69388   kNavUserActionNone = 0,
69389
69390
69391
69392
69393   kNavUserActionCancel = 1,
69394
69395
69396
69397
69398   kNavUserActionOpen = 2,
69399
69400
69401
69402
69403   kNavUserActionSaveAs = 3,
69404
69405
69406
69407
69408
69409   kNavUserActionChoose = 4,
69410
69411
69412
69413
69414   kNavUserActionNewFolder = 5,
69415
69416
69417
69418
69419   kNavUserActionSaveChanges = 6,
69420
69421
69422
69423
69424   kNavUserActionDontSaveChanges = 7,
69425
69426
69427
69428
69429
69430   kNavUserActionDiscardChanges = 8,
69431
69432
69433
69434
69435
69436   kNavUserActionReviewDocuments = 9,
69437
69438
69439
69440
69441
69442   kNavUserActionDiscardDocuments = 10
69443 };
69444
69445
69446
69447 enum {
69448   kNavCBRecVersion = 1
69449 };
69450 struct NavCBRec {
69451
69452
69453
69454
69455   UInt16 version;
69456
69457
69458
69459
69460   NavDialogRef context;
69461
69462
69463
69464
69465   WindowRef window;
69466
69467
69468
69469
69470   Rect customRect;
69471
69472
69473
69474
69475   Rect previewRect;
69476
69477
69478
69479
69480   NavEventData eventData;
69481
69482
69483
69484
69485
69486   NavUserAction userAction;
69487
69488
69489
69490
69491   char reserved[218];
69492 };
69493 typedef struct NavCBRec NavCBRec;
69494 typedef NavCBRec * NavCBRecPtr;
69495
69496
69497
69498
69499
69500
69501
69502 typedef SInt32 NavEventCallbackMessage;
69503 enum {
69504
69505
69506
69507
69508
69509   kNavCBEvent = 0,
69510
69511
69512
69513
69514
69515
69516
69517   kNavCBCustomize = 1,
69518
69519
69520
69521
69522
69523
69524   kNavCBStart = 2,
69525
69526
69527
69528
69529   kNavCBTerminate = 3,
69530
69531
69532
69533
69534
69535
69536   kNavCBAdjustRect = 4,
69537
69538
69539
69540
69541
69542
69543
69544   kNavCBNewLocation = 5,
69545
69546
69547
69548
69549   kNavCBShowDesktop = 6,
69550
69551
69552
69553
69554
69555
69556   kNavCBSelectEntry = 7,
69557   kNavCBPopupMenuSelect = 8,
69558
69559
69560
69561
69562   kNavCBAccept = 9,
69563
69564
69565
69566
69567   kNavCBCancel = 10,
69568
69569
69570
69571
69572
69573
69574   kNavCBAdjustPreview = 11,
69575
69576
69577
69578
69579
69580
69581
69582   kNavCBUserAction = 12,
69583
69584
69585
69586
69587
69588
69589   kNavCBOpenSelection = (long)0x80000000
69590 };
69591
69592
69593 typedef void * NavCallBackUserData;
69594
69595 typedef void ( * NavEventProcPtr)(NavEventCallbackMessage callBackSelector, NavCBRecPtr callBackParms, void *callBackUD);
69596
69597 typedef Boolean ( * NavPreviewProcPtr)(NavCBRecPtr callBackParms, void *callBackUD);
69598
69599 typedef Boolean ( * NavObjectFilterProcPtr)(AEDesc *theItem, void *info, void *callBackUD, NavFilterModes filterMode);
69600 typedef NavEventProcPtr NavEventUPP;
69601 typedef NavPreviewProcPtr NavPreviewUPP;
69602 typedef NavObjectFilterProcPtr NavObjectFilterUPP;
69603 extern NavEventUPP
69604 NewNavEventUPP(NavEventProcPtr userRoutine) ;
69605 extern NavPreviewUPP
69606 NewNavPreviewUPP(NavPreviewProcPtr userRoutine) ;
69607 extern NavObjectFilterUPP
69608 NewNavObjectFilterUPP(NavObjectFilterProcPtr userRoutine) ;
69609 extern void
69610 DisposeNavEventUPP(NavEventUPP userUPP) ;
69611 extern void
69612 DisposeNavPreviewUPP(NavPreviewUPP userUPP) ;
69613 extern void
69614 DisposeNavObjectFilterUPP(NavObjectFilterUPP userUPP) ;
69615 extern void
69616 InvokeNavEventUPP(
69617   NavEventCallbackMessage callBackSelector,
69618   NavCBRecPtr callBackParms,
69619   void * callBackUD,
69620   NavEventUPP userUPP) ;
69621 extern Boolean
69622 InvokeNavPreviewUPP(
69623   NavCBRecPtr callBackParms,
69624   void * callBackUD,
69625   NavPreviewUPP userUPP) ;
69626 extern Boolean
69627 InvokeNavObjectFilterUPP(
69628   AEDesc * theItem,
69629   void * info,
69630   void * callBackUD,
69631   NavFilterModes filterMode,
69632   NavObjectFilterUPP userUPP) ;
69633
69634 typedef SInt32 NavCustomControlMessage;
69635 enum {
69636   kNavCtlShowDesktop = 0,
69637   kNavCtlSortBy = 1,
69638   kNavCtlSortOrder = 2,
69639   kNavCtlScrollHome = 3,
69640   kNavCtlScrollEnd = 4,
69641   kNavCtlPageUp = 5,
69642   kNavCtlPageDown = 6,
69643   kNavCtlGetLocation = 7,
69644   kNavCtlSetLocation = 8,
69645   kNavCtlGetSelection = 9,
69646   kNavCtlSetSelection = 10,
69647   kNavCtlShowSelection = 11,
69648   kNavCtlOpenSelection = 12,
69649   kNavCtlEjectVolume = 13,
69650   kNavCtlNewFolder = 14,
69651   kNavCtlCancel = 15,
69652   kNavCtlAccept = 16,
69653   kNavCtlIsPreviewShowing = 17,
69654   kNavCtlAddControl = 18,
69655   kNavCtlAddControlList = 19,
69656   kNavCtlGetFirstControlID = 20,
69657   kNavCtlSelectCustomType = 21,
69658   kNavCtlSelectAllType = 22,
69659   kNavCtlGetEditFileName = 23,
69660   kNavCtlSetEditFileName = 24,
69661   kNavCtlSelectEditFileName = 25,
69662   kNavCtlBrowserSelectAll = 26,
69663   kNavCtlGotoParent = 27,
69664   kNavCtlSetActionState = 28,
69665   kNavCtlBrowserRedraw = 29,
69666   kNavCtlTerminate = 30
69667 };
69668
69669 typedef UInt32 NavActionState;
69670 enum {
69671   kNavNormalState = 0x00000000,
69672   kNavDontOpenState = 0x00000001,
69673   kNavDontSaveState = 0x00000002,
69674   kNavDontChooseState = 0x00000004,
69675   kNavDontNewFolderState = 0x00000010
69676 };
69677
69678 typedef UInt16 NavPopupMenuItem;
69679 enum {
69680   kNavAllKnownFiles = 0,
69681   kNavAllReadableFiles = 1,
69682   kNavAllFiles = 2
69683 };
69684
69685 typedef UInt16 NavSortKeyField;
69686 enum {
69687   kNavSortNameField = 0,
69688   kNavSortDateField = 1
69689 };
69690
69691
69692 typedef UInt16 NavSortOrder;
69693 enum {
69694   kNavSortAscending = 0,
69695   kNavSortDescending = 1
69696 };
69697
69698
69699 typedef UInt32 NavDialogOptionFlags;
69700 enum {
69701   kNavDefaultNavDlogOptions = 0x000000E4,
69702   kNavNoTypePopup = 0x00000001,
69703   kNavDontAutoTranslate = 0x00000002,
69704   kNavDontAddTranslateItems = 0x00000004,
69705   kNavAllFilesInPopup = 0x00000010,
69706   kNavAllowStationery = 0x00000020,
69707   kNavAllowPreviews = 0x00000040,
69708   kNavAllowMultipleFiles = 0x00000080,
69709   kNavAllowInvisibleFiles = 0x00000100,
69710   kNavDontResolveAliases = 0x00000200,
69711   kNavSelectDefaultLocation = 0x00000400,
69712   kNavSelectAllReadableItem = 0x00000800,
69713   kNavSupportPackages = 0x00001000,
69714   kNavAllowOpenPackages = 0x00002000,
69715   kNavDontAddRecents = 0x00004000,
69716   kNavDontUseCustomFrame = 0x00008000,
69717   kNavDontConfirmReplacement = 0x00010000,
69718   kNavPreserveSaveFileExtension = 0x00020000
69719 };
69720
69721
69722 typedef UInt32 NavTranslationOptions;
69723 enum {
69724   kNavTranslateInPlace = 0,
69725   kNavTranslateCopy = 1
69726 };
69727
69728
69729 enum {
69730   kNavMenuItemSpecVersion = 0
69731 };
69732
69733 struct NavMenuItemSpec {
69734   UInt16 version;
69735   OSType menuCreator;
69736   OSType menuType;
69737   Str255 menuItemName;
69738   char reserved[245];
69739 };
69740 typedef struct NavMenuItemSpec NavMenuItemSpec;
69741 typedef NavMenuItemSpec * NavMenuItemSpecArrayPtr;
69742 typedef NavMenuItemSpecArrayPtr * NavMenuItemSpecArrayHandle;
69743 typedef NavMenuItemSpecArrayPtr NavMenuItemSpecPtr;
69744 typedef NavMenuItemSpecArrayHandle NavMenuItemSpecHandle;
69745 enum {
69746   kNavGenericSignature = '****'
69747 };
69748
69749 struct NavTypeList {
69750   OSType componentSignature;
69751   short reserved;
69752   short osTypeCount;
69753   OSType osType[1];
69754 };
69755 typedef struct NavTypeList NavTypeList;
69756 typedef NavTypeList * NavTypeListPtr;
69757 typedef NavTypeListPtr * NavTypeListHandle;
69758 enum {
69759   kNavDialogOptionsVersion = 0
69760 };
69761
69762 struct NavDialogOptions {
69763   UInt16 version;
69764   NavDialogOptionFlags dialogOptionFlags;
69765   Point location;
69766   Str255 clientName;
69767   Str255 windowTitle;
69768   Str255 actionButtonLabel;
69769   Str255 cancelButtonLabel;
69770   Str255 savedFileName;
69771   Str255 message;
69772   UInt32 preferenceKey;
69773   NavMenuItemSpecArrayHandle popupExtension;
69774   char reserved[494];
69775 };
69776 typedef struct NavDialogOptions NavDialogOptions;
69777 enum {
69778   kNavReplyRecordVersion = 2
69779 };
69780 struct NavReplyRecord {
69781
69782
69783
69784
69785
69786
69787   UInt16 version;
69788
69789
69790
69791
69792   Boolean validRecord;
69793
69794
69795
69796
69797
69798
69799
69800   Boolean replacing;
69801
69802
69803
69804
69805
69806   Boolean isStationery;
69807
69808
69809
69810
69811
69812   Boolean translationNeeded;
69813   AEDescList selection;
69814
69815
69816
69817
69818
69819   ScriptCode keyScript;
69820
69821
69822
69823
69824
69825
69826
69827   FileTranslationSpecArrayHandle fileTranslation;
69828
69829
69830
69831
69832   UInt32 reserved1;
69833
69834
69835
69836
69837
69838
69839
69840   CFStringRef saveFileName;
69841   Boolean saveFileExtensionHidden;
69842
69843
69844
69845
69846   UInt8 reserved2;
69847
69848
69849
69850
69851   char reserved[225];
69852 };
69853 typedef struct NavReplyRecord NavReplyRecord;
69854 extern OSErr
69855 NavLoad(void);
69856 extern OSErr
69857 NavUnload(void);
69858 extern UInt32
69859 NavLibraryVersion(void) ;
69860 extern OSErr
69861 NavGetDefaultDialogOptions(NavDialogOptions * dialogOptions) ;
69862 extern OSErr
69863 NavGetFile(
69864   AEDesc * defaultLocation,
69865   NavReplyRecord * reply,
69866   NavDialogOptions * dialogOptions,
69867   NavEventUPP eventProc,
69868   NavPreviewUPP previewProc,
69869   NavObjectFilterUPP filterProc,
69870   NavTypeListHandle typeList,
69871   void * callBackUD) ;
69872 extern OSErr
69873 NavPutFile(
69874   AEDesc * defaultLocation,
69875   NavReplyRecord * reply,
69876   NavDialogOptions * dialogOptions,
69877   NavEventUPP eventProc,
69878   OSType fileType,
69879   OSType fileCreator,
69880   void * callBackUD) ;
69881 extern OSErr
69882 NavAskSaveChanges(
69883   NavDialogOptions * dialogOptions,
69884   NavAskSaveChangesAction action,
69885   NavAskSaveChangesResult * reply,
69886   NavEventUPP eventProc,
69887   void * callBackUD) ;
69888 extern OSErr
69889 NavCustomAskSaveChanges(
69890   NavDialogOptions * dialogOptions,
69891   NavAskSaveChangesResult * reply,
69892   NavEventUPP eventProc,
69893   void * callBackUD) ;
69894 extern OSErr
69895 NavAskDiscardChanges(
69896   NavDialogOptions * dialogOptions,
69897   NavAskDiscardChangesResult * reply,
69898   NavEventUPP eventProc,
69899   void * callBackUD) ;
69900 extern OSErr
69901 NavChooseFile(
69902   AEDesc * defaultLocation,
69903   NavReplyRecord * reply,
69904   NavDialogOptions * dialogOptions,
69905   NavEventUPP eventProc,
69906   NavPreviewUPP previewProc,
69907   NavObjectFilterUPP filterProc,
69908   NavTypeListHandle typeList,
69909   void * callBackUD) ;
69910 extern OSErr
69911 NavChooseFolder(
69912   AEDesc * defaultLocation,
69913   NavReplyRecord * reply,
69914   NavDialogOptions * dialogOptions,
69915   NavEventUPP eventProc,
69916   NavObjectFilterUPP filterProc,
69917   void * callBackUD) ;
69918 extern OSErr
69919 NavChooseVolume(
69920   AEDesc * defaultSelection,
69921   NavReplyRecord * reply,
69922   NavDialogOptions * dialogOptions,
69923   NavEventUPP eventProc,
69924   NavObjectFilterUPP filterProc,
69925   void * callBackUD) ;
69926 extern OSErr
69927 NavChooseObject(
69928   AEDesc * defaultLocation,
69929   NavReplyRecord * reply,
69930   NavDialogOptions * dialogOptions,
69931   NavEventUPP eventProc,
69932   NavObjectFilterUPP filterProc,
69933   void * callBackUD) ;
69934 extern OSErr
69935 NavNewFolder(
69936   AEDesc * defaultLocation,
69937   NavReplyRecord * reply,
69938   NavDialogOptions * dialogOptions,
69939   NavEventUPP eventProc,
69940   void * callBackUD) ;
69941 extern OSErr
69942 NavTranslateFile(
69943   NavReplyRecord * reply,
69944   NavTranslationOptions howToTranslate) ;
69945 extern OSErr
69946 NavCompleteSave(
69947   NavReplyRecord * reply,
69948   NavTranslationOptions howToTranslate) ;
69949 extern OSErr
69950 NavCustomControl(
69951   NavDialogRef dialog,
69952   NavCustomControlMessage selector,
69953   void * parms) ;
69954 extern OSErr
69955 NavCreatePreview(
69956   AEDesc * theObject,
69957   OSType previewDataType,
69958   const void * previewData,
69959   Size previewDataSize) ;
69960 extern OSErr
69961 NavDisposeReply(NavReplyRecord * reply) ;
69962 extern Boolean
69963 NavServicesCanRun(void);
69964     inline Boolean NavServicesAvailable() { return true; }
69965 enum {
69966   kNavDialogCreationOptionsVersion = 0
69967 };
69968 struct NavDialogCreationOptions {
69969
69970
69971
69972
69973
69974   UInt16 version;
69975
69976
69977
69978
69979
69980   NavDialogOptionFlags optionFlags;
69981
69982
69983
69984
69985
69986
69987   Point location;
69988   CFStringRef clientName;
69989
69990
69991
69992
69993
69994   CFStringRef windowTitle;
69995
69996
69997
69998
69999
70000   CFStringRef actionButtonLabel;
70001
70002
70003
70004
70005
70006   CFStringRef cancelButtonLabel;
70007
70008
70009
70010
70011
70012   CFStringRef saveFileName;
70013
70014
70015
70016
70017
70018
70019   CFStringRef message;
70020   UInt32 preferenceKey;
70021
70022
70023
70024
70025
70026
70027   CFArrayRef popupExtension;
70028
70029
70030
70031
70032
70033
70034
70035   WindowModality modality;
70036
70037
70038
70039
70040
70041   WindowRef parentWindow;
70042
70043
70044
70045
70046   char reserved[16];
70047 };
70048 typedef struct NavDialogCreationOptions NavDialogCreationOptions;
70049 extern OSStatus
70050 NavGetDefaultDialogCreationOptions(NavDialogCreationOptions * outOptions) ;
70051 extern OSStatus
70052 NavCreateGetFileDialog(
70053   const NavDialogCreationOptions * inOptions,
70054   NavTypeListHandle inTypeList,
70055   NavEventUPP inEventProc,
70056   NavPreviewUPP inPreviewProc,
70057   NavObjectFilterUPP inFilterProc,
70058   void * inClientData,
70059   NavDialogRef * outDialog) ;
70060 extern OSStatus
70061 NavCreatePutFileDialog(
70062   const NavDialogCreationOptions * inOptions,
70063   OSType inFileType,
70064   OSType inFileCreator,
70065   NavEventUPP inEventProc,
70066   void * inClientData,
70067   NavDialogRef * outDialog) ;
70068 extern OSStatus
70069 NavCreateAskReviewDocumentsDialog(
70070   const NavDialogCreationOptions * inOptions,
70071   UInt32 inDocumentCount,
70072   NavEventUPP inEventProc,
70073   void * inClientData,
70074   NavDialogRef * outDialog) ;
70075 extern OSStatus
70076 NavCreateAskSaveChangesDialog(
70077   const NavDialogCreationOptions * inOptions,
70078   NavAskSaveChangesAction inAction,
70079   NavEventUPP inEventProc,
70080   void * inClientData,
70081   NavDialogRef * outDialog) ;
70082 extern OSStatus
70083 NavCreateAskDiscardChangesDialog(
70084   const NavDialogCreationOptions * inOptions,
70085   NavEventUPP inEventProc,
70086   void * inClientData,
70087   NavDialogRef * outDialog) ;
70088 extern OSStatus
70089 NavCreateChooseFileDialog(
70090   const NavDialogCreationOptions * inOptions,
70091   NavTypeListHandle inTypeList,
70092   NavEventUPP inEventProc,
70093   NavPreviewUPP inPreviewProc,
70094   NavObjectFilterUPP inFilterProc,
70095   void * inClientData,
70096   NavDialogRef * outDialog) ;
70097 extern OSStatus
70098 NavCreateChooseFolderDialog(
70099   const NavDialogCreationOptions * inOptions,
70100   NavEventUPP inEventProc,
70101   NavObjectFilterUPP inFilterProc,
70102   void * inClientData,
70103   NavDialogRef * outDialog) ;
70104 extern OSStatus
70105 NavCreateChooseVolumeDialog(
70106   const NavDialogCreationOptions * inOptions,
70107   NavEventUPP inEventProc,
70108   NavObjectFilterUPP inFilterProc,
70109   void * inClientData,
70110   NavDialogRef * outDialog) ;
70111 extern OSStatus
70112 NavCreateChooseObjectDialog(
70113   const NavDialogCreationOptions * inOptions,
70114   NavEventUPP inEventProc,
70115   NavPreviewUPP inPreviewProc,
70116   NavObjectFilterUPP inFilterProc,
70117   void * inClientData,
70118   NavDialogRef * outDialog) ;
70119 extern OSStatus
70120 NavCreateNewFolderDialog(
70121   const NavDialogCreationOptions * inOptions,
70122   NavEventUPP inEventProc,
70123   void * inClientData,
70124   NavDialogRef * outDialog) ;
70125 extern OSStatus
70126 NavDialogRun(NavDialogRef inDialog) ;
70127 extern void
70128 NavDialogDispose(NavDialogRef inDialog) ;
70129 extern WindowRef
70130 NavDialogGetWindow(NavDialogRef inDialog) ;
70131 extern NavUserAction
70132 NavDialogGetUserAction(NavDialogRef inDialog) ;
70133 extern OSStatus
70134 NavDialogGetReply(
70135   NavDialogRef inDialog,
70136   NavReplyRecord * outReply) ;
70137 extern CFStringRef
70138 NavDialogGetSaveFileName(NavDialogRef inPutFileDialog) ;
70139 extern OSStatus
70140 NavDialogSetSaveFileName(
70141   NavDialogRef inPutFileDialog,
70142   CFStringRef inFileName) ;
70143 extern Boolean
70144 NavDialogGetSaveFileExtensionHidden(NavDialogRef inPutFileDialog) ;
70145 extern OSStatus
70146 NavDialogSetSaveFileExtensionHidden(
70147   NavDialogRef inPutFileDialog,
70148   Boolean inHidden) ;
70149
70150
70151
70152
70153
70154
70155 }
70156
70157
70158
70159 extern "C" {
70160
70161
70162
70163 enum {
70164
70165   kMaximumSmallFract = 0x0000FFFF
70166 };
70167
70168 enum {
70169   kDefaultColorPickerWidth = 383,
70170   kDefaultColorPickerHeight = 238
70171 };
70172
70173 typedef SInt16 DialogPlacementSpec;
70174 enum {
70175   kAtSpecifiedOrigin = 0,
70176   kDeepestColorScreen = 1,
70177   kCenterOnMainScreen = 2
70178 };
70179
70180
70181
70182 enum {
70183   kColorPickerDialogIsMoveable = 1,
70184   kColorPickerDialogIsModal = 2,
70185   kColorPickerCanModifyPalette = 4,
70186   kColorPickerCanAnimatePalette = 8,
70187   kColorPickerAppIsColorSyncAware = 16,
70188   kColorPickerInSystemDialog = 32,
70189   kColorPickerInApplicationDialog = 64,
70190   kColorPickerInPickerDialog = 128,
70191   kColorPickerDetachedFromChoices = 256,
70192   kColorPickerCallColorProcLive = 512
70193 };
70194 typedef unsigned short SmallFract;
70195
70196
70197
70198
70199 struct HSVColor {
70200   SmallFract hue;
70201   SmallFract saturation;
70202   SmallFract value;
70203 };
70204 typedef struct HSVColor HSVColor;
70205 struct HSLColor {
70206   SmallFract hue;
70207   SmallFract saturation;
70208   SmallFract lightness;
70209 };
70210 typedef struct HSLColor HSLColor;
70211 struct CMYColor {
70212   SmallFract cyan;
70213   SmallFract magenta;
70214   SmallFract yellow;
70215 };
70216 typedef struct CMYColor CMYColor;
70217 struct PMColor {
70218   CMProfileHandle profile;
70219   CMColor color;
70220 };
70221 typedef struct PMColor PMColor;
70222 typedef PMColor * PMColorPtr;
70223 struct NPMColor {
70224   CMProfileRef profile;
70225   CMColor color;
70226 };
70227 typedef struct NPMColor NPMColor;
70228 typedef NPMColor * NPMColorPtr;
70229 typedef struct OpaquePicker* Picker;
70230 typedef Picker picker;
70231 struct PickerMenuItemInfo {
70232   short editMenuID;
70233   short cutItem;
70234   short copyItem;
70235   short pasteItem;
70236   short clearItem;
70237   short undoItem;
70238 };
70239 typedef struct PickerMenuItemInfo PickerMenuItemInfo;
70240
70241
70242
70243
70244 typedef void ( * ColorChangedProcPtr)(long userData, PMColor *newColor);
70245 typedef void ( * NColorChangedProcPtr)(long userData, NPMColor *newColor);
70246 typedef Boolean ( * UserEventProcPtr)(EventRecord * event);
70247 typedef ColorChangedProcPtr ColorChangedUPP;
70248 typedef NColorChangedProcPtr NColorChangedUPP;
70249 typedef UserEventProcPtr UserEventUPP;
70250 struct ColorPickerInfo {
70251   PMColor theColor;
70252   CMProfileHandle dstProfile;
70253   UInt32 flags;
70254   DialogPlacementSpec placeWhere;
70255   Point dialogOrigin;
70256   OSType pickerType;
70257   UserEventUPP eventProc;
70258   ColorChangedUPP colorProc;
70259   UInt32 colorProcData;
70260   Str255 prompt;
70261   PickerMenuItemInfo mInfo;
70262   Boolean newColorChosen;
70263   SInt8 filler;
70264 };
70265 typedef struct ColorPickerInfo ColorPickerInfo;
70266 struct NColorPickerInfo {
70267   NPMColor theColor;
70268   CMProfileRef dstProfile;
70269   UInt32 flags;
70270   DialogPlacementSpec placeWhere;
70271   Point dialogOrigin;
70272   OSType pickerType;
70273   UserEventUPP eventProc;
70274   NColorChangedUPP colorProc;
70275   UInt32 colorProcData;
70276   Str255 prompt;
70277   PickerMenuItemInfo mInfo;
70278   Boolean newColorChosen;
70279   UInt8 reserved;
70280 };
70281 typedef struct NColorPickerInfo NColorPickerInfo;
70282 extern SmallFract
70283 Fix2SmallFract(Fixed f);
70284 extern Fixed
70285 SmallFract2Fix(SmallFract s);
70286 extern void
70287 CMY2RGB(
70288   const CMYColor * cColor,
70289   RGBColor * rColor);
70290 extern void
70291 RGB2CMY(
70292   const RGBColor * rColor,
70293   CMYColor * cColor);
70294 extern void
70295 HSL2RGB(
70296   const HSLColor * hColor,
70297   RGBColor * rColor);
70298 extern void
70299 RGB2HSL(
70300   const RGBColor * rColor,
70301   HSLColor * hColor);
70302 extern void
70303 HSV2RGB(
70304   const HSVColor * hColor,
70305   RGBColor * rColor);
70306 extern void
70307 RGB2HSV(
70308   const RGBColor * rColor,
70309   HSVColor * hColor);
70310 extern Boolean
70311 GetColor(
70312   Point where,
70313   ConstStr255Param prompt,
70314   const RGBColor * inColor,
70315   RGBColor * outColor);
70316 extern OSErr
70317 PickColor(ColorPickerInfo * theColorInfo);
70318 extern OSErr
70319 NPickColor(NColorPickerInfo * theColorInfo);
70320 extern ColorChangedUPP
70321 NewColorChangedUPP(ColorChangedProcPtr userRoutine);
70322 extern NColorChangedUPP
70323 NewNColorChangedUPP(NColorChangedProcPtr userRoutine);
70324 extern UserEventUPP
70325 NewUserEventUPP(UserEventProcPtr userRoutine);
70326 extern void
70327 DisposeColorChangedUPP(ColorChangedUPP userUPP);
70328 extern void
70329 DisposeNColorChangedUPP(NColorChangedUPP userUPP);
70330 extern void
70331 DisposeUserEventUPP(UserEventUPP userUPP);
70332 extern void
70333 InvokeColorChangedUPP(
70334   long userData,
70335   PMColor * newColor,
70336   ColorChangedUPP userUPP);
70337 extern void
70338 InvokeNColorChangedUPP(
70339   long userData,
70340   NPMColor * newColor,
70341   NColorChangedUPP userUPP);
70342 extern Boolean
70343 InvokeUserEventUPP(
70344   EventRecord * event,
70345   UserEventUPP userUPP);
70346
70347
70348
70349
70350
70351 }
70352
70353
70354
70355 extern "C" {
70356
70357
70358
70359 typedef void ( * CalibrateEventProcPtr)(EventRecord * event);
70360 typedef CalibrateEventProcPtr CalibrateEventUPP;
70361
70362
70363
70364 enum {
70365   kCalibratorNamePrefix = 'cali'
70366 };
70367
70368 struct CalibratorInfo {
70369   UInt32 dataSize;
70370   CMDisplayIDType displayID;
70371   UInt32 profileLocationSize;
70372   CMProfileLocation * profileLocationPtr;
70373   CalibrateEventUPP eventProc;
70374   Boolean isGood;
70375 };
70376 typedef struct CalibratorInfo CalibratorInfo;
70377 typedef Boolean ( * CanCalibrateProcPtr)(CMDisplayIDType displayID, Str255 errMessage);
70378 typedef OSErr ( * CalibrateProcPtr)(CalibratorInfo * theInfo);
70379 typedef CanCalibrateProcPtr CanCalibrateUPP;
70380 typedef CalibrateProcPtr CalibrateUPP;
70381 extern CalibrateEventUPP
70382 NewCalibrateEventUPP(CalibrateEventProcPtr userRoutine) ;
70383 extern CanCalibrateUPP
70384 NewCanCalibrateUPP(CanCalibrateProcPtr userRoutine);
70385 extern CalibrateUPP
70386 NewCalibrateUPP(CalibrateProcPtr userRoutine);
70387 extern void
70388 DisposeCalibrateEventUPP(CalibrateEventUPP userUPP) ;
70389 extern void
70390 DisposeCanCalibrateUPP(CanCalibrateUPP userUPP);
70391 extern void
70392 DisposeCalibrateUPP(CalibrateUPP userUPP);
70393 extern void
70394 InvokeCalibrateEventUPP(
70395   EventRecord * event,
70396   CalibrateEventUPP userUPP) ;
70397 extern Boolean
70398 InvokeCanCalibrateUPP(
70399   CMDisplayIDType displayID,
70400   Str255 errMessage,
70401   CanCalibrateUPP userUPP);
70402 extern OSErr
70403 InvokeCalibrateUPP(
70404   CalibratorInfo * theInfo,
70405   CalibrateUPP userUPP);
70406 extern OSErr
70407 CMCalibrateDisplay(CalibratorInfo * theInfo) ;
70408
70409
70410
70411
70412
70413
70414 }
70415
70416
70417
70418 extern "C" {
70419
70420
70421
70422 typedef UInt32 NSLDialogOptionFlags;
70423 enum {
70424   kNSLDefaultNSLDlogOptions = 0x00000000,
70425   kNSLNoURLTEField = 0x00000001,
70426   kNSLAddServiceTypes = 0x00000002,
70427   kNSLClientHandlesRecents = 0x00000004
70428 };
70429
70430
70431 struct NSLDialogOptions {
70432   UInt16 version;
70433   NSLDialogOptionFlags dialogOptionFlags;
70434   Str255 windowTitle;
70435   Str255 actionButtonLabel;
70436   Str255 cancelButtonLabel;
70437   Str255 message;
70438 };
70439 typedef struct NSLDialogOptions NSLDialogOptions;
70440 typedef Boolean ( * NSLURLFilterProcPtr)(char *url, Str255 displayString);
70441
70442 typedef void ( * NSLEventProcPtr)(EventRecord *newEvent, void *userContext);
70443 typedef NSLURLFilterProcPtr NSLURLFilterUPP;
70444 typedef NSLEventProcPtr NSLEventUPP;
70445 extern NSLURLFilterUPP
70446 NewNSLURLFilterUPP(NSLURLFilterProcPtr userRoutine);
70447 extern NSLEventUPP
70448 NewNSLEventUPP(NSLEventProcPtr userRoutine);
70449 extern void
70450 DisposeNSLURLFilterUPP(NSLURLFilterUPP userUPP);
70451 extern void
70452 DisposeNSLEventUPP(NSLEventUPP userUPP);
70453 extern Boolean
70454 InvokeNSLURLFilterUPP(
70455   char * url,
70456   Str255 displayString,
70457   NSLURLFilterUPP userUPP);
70458 extern void
70459 InvokeNSLEventUPP(
70460   EventRecord * newEvent,
70461   void * userContext,
70462   NSLEventUPP userUPP);
70463 extern OSStatus
70464 NSLStandardGetURL(
70465   NSLDialogOptions * dialogOptions,
70466   NSLEventUPP eventProc,
70467   void * eventProcContextPtr,
70468   NSLURLFilterUPP filterProc,
70469   char * serviceTypeList,
70470   char ** userSelectedURL);
70471 extern OSStatus
70472 NSLGetDefaultDialogOptions(NSLDialogOptions * dialogOptions);
70473 extern char *
70474 NSLFreeURL(char * url);
70475 extern OSErr
70476 NSLSaveURLAliasToFolder(
70477   OSType folderSelectorType,
70478   const char * url,
70479   const char * userFriendlyName);
70480
70481
70482
70483
70484
70485
70486
70487 }
70488
70489
70490
70491
70492
70493
70494
70495 extern "C" {
70496
70497
70498 enum {
70499
70500
70501
70502
70503   kEventClassFont = 'font'
70504 };
70505
70506
70507
70508
70509
70510
70511 enum {
70512
70513
70514
70515
70516
70517
70518
70519   kHICommandShowHideFontPanel = 'shfp'
70520 };
70521 enum {
70522
70523
70524
70525
70526
70527   kEventFontPanelClosed = 1,
70528   kEventFontSelection = 2
70529 };
70530 enum {
70531   typeATSUFontID = typeUInt32,
70532   typeATSUSize = typeFixed,
70533   typeFMFontFamily = typeSInt16,
70534   typeFMFontStyle = typeSInt16,
70535   typeFMFontSize = typeSInt16,
70536   typeFontColor = typeRGBColor,
70537   kEventParamATSUFontID = 'auid',
70538   kEventParamATSUFontSize = 'ausz',
70539   kEventParamFMFontFamily = 'fmfm',
70540   kEventParamFMFontStyle = 'fmst',
70541   kEventParamFMFontSize = 'fmsz',
70542   kEventParamFontColor = 'fclr'
70543 };
70544 enum {
70545   fontPanelShowErr = -8880,
70546   fontPanelSelectionStyleErr = -8881,
70547   fontPanelFontSelectionQDStyleVersionErr = -8882
70548 };
70549
70550
70551
70552
70553
70554
70555 enum {
70556   kFontSelectionATSUIType = 'astl',
70557   kFontSelectionQDType = 'qstl'
70558 };
70559
70560
70561
70562
70563
70564 enum {
70565   kFontSelectionQDStyleVersionZero = 0
70566 };
70567 struct FontSelectionQDStyle {
70568   UInt32 version;
70569   FMFontFamilyInstance instance;
70570   FMFontSize size;
70571   Boolean hasColor;
70572   UInt8 reserved;
70573   RGBColor color;
70574 };
70575 typedef struct FontSelectionQDStyle FontSelectionQDStyle;
70576 typedef FontSelectionQDStyle * FontSelectionQDStylePtr;
70577 extern Boolean
70578 FPIsFontPanelVisible(void) ;
70579 extern OSStatus
70580 FPShowHideFontPanel(void) ;
70581 extern OSStatus
70582 SetFontInfoForSelection(
70583   OSType iStyleType,
70584   UInt32 iNumStyles,
70585   void * iStyles,
70586   HIObjectRef iFPEventTarget) ;
70587
70588
70589
70590
70591
70592 }
70593
70594
70595
70596 extern "C" {
70597
70598
70599 typedef struct OpaqueHRReference* HRReference;
70600 extern OSStatus
70601 HRGetHTMLRenderingLibVersion(NumVersion * returnVers) ;
70602     inline Boolean HRHTMLRenderingLibAvailable() { return true; }
70603
70604
70605
70606
70607
70608 enum {
70609   kHRRendererHTML32Type = 'ht32'
70610 };
70611 extern OSStatus
70612 HRNewReference(
70613   HRReference * hrRef,
70614   OSType rendererType,
70615   GrafPtr grafPtr) ;
70616 extern OSStatus
70617 HRNewReferenceInWindow(
70618   HRReference * hrRef,
70619   OSType rendererType,
70620   WindowRef inWindowRef) ;
70621 extern OSStatus
70622 HRDisposeReference(HRReference hrRef) ;
70623 extern SInt32
70624 HRFreeMemory(Size inBytesNeeded) ;
70625 extern void
70626 HRScreenConfigurationChanged(void) ;
70627 extern Boolean
70628 HRIsHREvent(const EventRecord * eventRecord) ;
70629 extern OSStatus
70630 HRSetGrafPtr(
70631   HRReference hrRef,
70632   GrafPtr grafPtr) ;
70633 extern OSStatus
70634 HRSetWindowRef(
70635   HRReference hrRef,
70636   WindowRef windowRef) ;
70637 extern OSStatus
70638 HRSetEmbeddingControl(
70639   HRReference hrRef,
70640   ControlRef controlRef) ;
70641 extern OSStatus
70642 HRActivate(HRReference hrRef) ;
70643 extern OSStatus
70644 HRDeactivate(HRReference hrRef) ;
70645 extern OSStatus
70646 HRDraw(
70647   HRReference hrRef,
70648   RgnHandle updateRgnH) ;
70649 extern OSStatus
70650 HRDrawInPort(
70651   HRReference hrRef,
70652   RgnHandle updateRgnH,
70653   CGrafPtr grafPtr) ;
70654 extern OSStatus
70655 HRSetRenderingRect(
70656   HRReference hrRef,
70657   const Rect * renderingRect) ;
70658 extern OSStatus
70659 HRGetRenderedImageSize(
70660   HRReference hrRef,
70661   Point * renderingSize) ;
70662 extern OSStatus
70663 HRGetRenderedImageSize32(
70664   HRReference hrRef,
70665   UInt32 * height,
70666   UInt32 * width) ;
70667 extern OSStatus
70668 HRScrollToLocation(
70669   HRReference hrRef,
70670   Point * location) ;
70671 extern OSStatus
70672 HRScrollToImageLocation32(
70673   HRReference hrRef,
70674   SInt32 h,
70675   SInt32 v) ;
70676 extern OSStatus
70677 HRForceQuickdraw(
70678   HRReference hrRef,
70679   Boolean forceQuickdraw) ;
70680
70681
70682 typedef SInt16 HRScrollbarState;
70683 enum {
70684   eHRScrollbarOn = 0,
70685   eHRScrollbarOff = 1,
70686   eHRScrollbarAuto = 2
70687 };
70688 extern OSStatus
70689 HRSetScrollbarState(
70690   HRReference hrRef,
70691   HRScrollbarState hScrollbarState,
70692   HRScrollbarState vScrollbarState) ;
70693 extern OSStatus
70694 HRSetDrawBorder(
70695   HRReference hrRef,
70696   Boolean drawBorder) ;
70697 extern OSStatus
70698 HRSetGrowboxCutout(
70699   HRReference hrRef,
70700   Boolean allowCutout) ;
70701 extern OSStatus
70702 HRGoToFile(
70703   HRReference hrRef,
70704   const FSSpec * fsspec,
70705   Boolean addToHistory,
70706   Boolean forceRefresh) ;
70707 extern OSStatus
70708 HRGoToURL(
70709   HRReference hrRef,
70710   const char * url,
70711   Boolean addToHistory,
70712   Boolean forceRefresh) ;
70713 extern OSStatus
70714 HRGoToAnchor(
70715   HRReference hrRef,
70716   const char * anchorName) ;
70717 extern OSStatus
70718 HRGoToPtr(
70719   HRReference hrRef,
70720   char * buffer,
70721   UInt32 bufferSize,
70722   Boolean addToHistory,
70723   Boolean forceRefresh) ;
70724 extern OSStatus
70725 HRGoToFSRef(
70726   HRReference hrRef,
70727   const FSRef * fref,
70728   Boolean addToHistory,
70729   Boolean forceRefresh) ;
70730 extern OSStatus
70731 HRGoToCFURL(
70732   HRReference hrRef,
70733   CFURLRef url,
70734   Boolean addToHistory,
70735   Boolean forceRefresh) ;
70736 extern OSStatus
70737 HRGoToAnchorCFString(
70738   HRReference hrRef,
70739   CFStringRef anchorName) ;
70740 extern OSStatus
70741 HRGoToData(
70742   HRReference hrRef,
70743   CFDataRef data,
70744   Boolean addToHistory,
70745   Boolean forceRefresh) ;
70746 extern OSStatus
70747 HRGetRootURL(
70748   HRReference hrRef,
70749   Handle rootURLH) ;
70750 extern OSStatus
70751 HRGetBaseURL(
70752   HRReference hrRef,
70753   Handle baseURLH) ;
70754 extern OSStatus
70755 HRGetHTMLURL(
70756   HRReference hrRef,
70757   Handle HTMLURLH) ;
70758 extern OSStatus
70759 HRGetTitle(
70760   HRReference hrRef,
70761   StringPtr title) ;
70762 extern OSStatus
70763 HRGetHTMLFile(
70764   HRReference hrRef,
70765   FSSpec * fsspec) ;
70766 extern OSStatus
70767 HRGetRootURLAsCFString(
70768   HRReference hrRef,
70769   CFStringRef * rootString) ;
70770 extern OSStatus
70771 HRGetBaseURLAsCFString(
70772   HRReference hrRef,
70773   CFStringRef * baseString) ;
70774 extern OSStatus
70775 HRGetHTMLURLAsCFURL(
70776   HRReference hrRef,
70777   CFURLRef * theURL) ;
70778 extern OSStatus
70779 HRGetTitleAsCFString(
70780   HRReference hrRef,
70781   CFStringRef * title) ;
70782 extern OSStatus
70783 HRGetHTMLFileAsFSRef(
70784   HRReference hrRef,
70785   FSRef * fref) ;
70786 extern OSStatus
70787 HRUtilCreateFullURL(
70788   const char * rootURL,
70789   const char * linkURL,
70790   Handle fullURLH) ;
70791 extern OSStatus
70792 HRUtilGetFSSpecFromURL(
70793   const char * rootURL,
70794   const char * linkURL,
70795   FSSpec * destSpec) ;
70796 extern OSStatus
70797 HRUtilGetURLFromFSSpec(
70798   const FSSpec * fsspec,
70799   Handle urlHandle) ;
70800 extern OSStatus
70801 HRUtilCreateFullCFURL(
70802   CFStringRef rootString,
70803   CFStringRef linkString,
70804   CFURLRef * url) ;
70805 extern OSStatus
70806 HRUtilGetFSRefFromURL(
70807   CFStringRef rootString,
70808   CFStringRef linkString,
70809   FSRef * destRef) ;
70810 extern OSStatus
70811 HRUtilGetURLFromFSRef(
70812   const FSRef * fileRef,
70813   CFURLRef * url) ;
70814 typedef Boolean ( * HRWasURLVisitedProcPtr)(const char *url, void *refCon);
70815 typedef HRWasURLVisitedProcPtr HRWasURLVisitedUPP;
70816 extern void
70817 HRRegisterWasURLVisitedUPP(
70818   HRWasURLVisitedUPP inWasURLVisitedUPP,
70819   HRReference hrRef,
70820   void * inRefCon) ;
70821 extern void
70822 HRUnregisterWasURLVisitedUPP(HRReference hrRef) ;
70823 typedef Boolean ( * HRWasCFURLVisitedProcPtr)(CFURLRef url, void *refCon);
70824 typedef HRWasCFURLVisitedProcPtr HRWasCFURLVisitedUPP;
70825 extern void
70826 HRRegisterWasCFURLVisitedUPP(
70827   HRWasCFURLVisitedUPP inWasCFURLVisitedUPP,
70828   HRReference hrRef,
70829   void * inRefCon) ;
70830 extern void
70831 HRUnregisterWasCFURLVisitedUPP(HRReference hrRef) ;
70832 typedef OSStatus ( * HRNewURLProcPtr)(const char *url, const char *targetFrame, Boolean addToHistory, void *refCon);
70833 typedef HRNewURLProcPtr HRNewURLUPP;
70834 extern void
70835 HRRegisterNewURLUPP(
70836   HRNewURLUPP inNewURLUPP,
70837   HRReference hrRef,
70838   void * inRefCon) ;
70839 extern void
70840 HRUnregisterNewURLUPP(HRReference hrRef) ;
70841 typedef OSStatus ( * HRNewCFURLProcPtr)(CFURLRef url, CFStringRef targetString, Boolean addToHistory, void *refCon);
70842 typedef HRNewCFURLProcPtr HRNewCFURLUPP;
70843 extern void
70844 HRRegisterNewCFURLUPP(
70845   HRNewCFURLUPP inURLUPP,
70846   HRReference hrRef,
70847   void * inRefCon) ;
70848 extern void
70849 HRUnregisterNewCFURLUPP(HRReference hrRef) ;
70850 typedef UInt16 URLSourceType;
70851 enum {
70852   kHRLookingForHTMLSource = 1,
70853   kHRLookingForImage = 2,
70854   kHRLookingForEmbedded = 3,
70855   kHRLookingForImageMap = 4,
70856   kHRLookingForFrame = 5
70857 };
70858
70859 typedef OSStatus ( * HRURLToFSSpecProcPtr)(const char *rootURL, const char *linkURL, FSSpec *fsspec, URLSourceType urlSourceType, void *refCon);
70860 typedef HRURLToFSSpecProcPtr HRURLToFSSpecUPP;
70861 extern void
70862 HRRegisterURLToFSSpecUPP(
70863   HRURLToFSSpecUPP inURLToFSSpecUPP,
70864   HRReference hrRef,
70865   void * inRefCon) ;
70866 extern void
70867 HRUnregisterURLToFSSpecUPP(HRReference hrRef) ;
70868 typedef OSStatus ( * HRURLToFSRefProcPtr)(CFStringRef rootString, CFStringRef linkString, FSRef *fref, URLSourceType urlSourceType, void *refCon);
70869 typedef HRURLToFSRefProcPtr HRURLToFSRefUPP;
70870 extern void
70871 HRRegisterURLToFSRefUPP(
70872   HRURLToFSRefUPP inURLToFSRefUPP,
70873   HRReference hrRef,
70874   void * inRefCon) ;
70875 extern void
70876 HRUnregisterURLToFSRefUPP(HRReference hrRef) ;
70877 extern HRWasURLVisitedUPP
70878 NewHRWasURLVisitedUPP(HRWasURLVisitedProcPtr userRoutine) ;
70879 extern HRWasCFURLVisitedUPP
70880 NewHRWasCFURLVisitedUPP(HRWasCFURLVisitedProcPtr userRoutine) ;
70881 extern HRNewURLUPP
70882 NewHRNewURLUPP(HRNewURLProcPtr userRoutine) ;
70883 extern HRNewCFURLUPP
70884 NewHRNewCFURLUPP(HRNewCFURLProcPtr userRoutine) ;
70885 extern HRURLToFSSpecUPP
70886 NewHRURLToFSSpecUPP(HRURLToFSSpecProcPtr userRoutine) ;
70887 extern HRURLToFSRefUPP
70888 NewHRURLToFSRefUPP(HRURLToFSRefProcPtr userRoutine) ;
70889 extern void
70890 DisposeHRWasURLVisitedUPP(HRWasURLVisitedUPP userUPP) ;
70891 extern void
70892 DisposeHRWasCFURLVisitedUPP(HRWasCFURLVisitedUPP userUPP) ;
70893 extern void
70894 DisposeHRNewURLUPP(HRNewURLUPP userUPP) ;
70895 extern void
70896 DisposeHRNewCFURLUPP(HRNewCFURLUPP userUPP) ;
70897 extern void
70898 DisposeHRURLToFSSpecUPP(HRURLToFSSpecUPP userUPP) ;
70899 extern void
70900 DisposeHRURLToFSRefUPP(HRURLToFSRefUPP userUPP) ;
70901 extern Boolean
70902 InvokeHRWasURLVisitedUPP(
70903   const char * url,
70904   void * refCon,
70905   HRWasURLVisitedUPP userUPP) ;
70906 extern Boolean
70907 InvokeHRWasCFURLVisitedUPP(
70908   CFURLRef url,
70909   void * refCon,
70910   HRWasCFURLVisitedUPP userUPP) ;
70911 extern OSStatus
70912 InvokeHRNewURLUPP(
70913   const char * url,
70914   const char * targetFrame,
70915   Boolean addToHistory,
70916   void * refCon,
70917   HRNewURLUPP userUPP) ;
70918 extern OSStatus
70919 InvokeHRNewCFURLUPP(
70920   CFURLRef url,
70921   CFStringRef targetString,
70922   Boolean addToHistory,
70923   void * refCon,
70924   HRNewCFURLUPP userUPP) ;
70925 extern OSStatus
70926 InvokeHRURLToFSSpecUPP(
70927   const char * rootURL,
70928   const char * linkURL,
70929   FSSpec * fsspec,
70930   URLSourceType urlSourceType,
70931   void * refCon,
70932   HRURLToFSSpecUPP userUPP) ;
70933 extern OSStatus
70934 InvokeHRURLToFSRefUPP(
70935   CFStringRef rootString,
70936   CFStringRef linkString,
70937   FSRef * fref,
70938   URLSourceType urlSourceType,
70939   void * refCon,
70940   HRURLToFSRefUPP userUPP) ;
70941
70942
70943
70944 }
70945
70946
70947
70948 extern "C" {
70949
70950
70951
70952
70953 enum {
70954   kSRNotAvailable = -5100,
70955   kSRInternalError = -5101,
70956   kSRComponentNotFound = -5102,
70957   kSROutOfMemory = -5103,
70958   kSRNotASpeechObject = -5104,
70959   kSRBadParameter = -5105,
70960   kSRParamOutOfRange = -5106,
70961   kSRBadSelector = -5107,
70962   kSRBufferTooSmall = -5108,
70963   kSRNotARecSystem = -5109,
70964   kSRFeedbackNotAvail = -5110,
70965   kSRCantSetProperty = -5111,
70966   kSRCantGetProperty = -5112,
70967   kSRCantSetDuringRecognition = -5113,
70968   kSRAlreadyListening = -5114,
70969   kSRNotListeningState = -5115,
70970   kSRModelMismatch = -5116,
70971   kSRNoClientLanguageModel = -5117,
70972   kSRNoPendingUtterances = -5118,
70973   kSRRecognitionCanceled = -5119,
70974   kSRRecognitionDone = -5120,
70975   kSROtherRecAlreadyModal = -5121,
70976   kSRHasNoSubItems = -5122,
70977   kSRSubItemNotFound = -5123,
70978   kSRLanguageModelTooBig = -5124,
70979   kSRAlreadyReleased = -5125,
70980   kSRAlreadyFinished = -5126,
70981   kSRWordNotFound = -5127,
70982   kSRNotFinishedWithRejection = -5128,
70983   kSRExpansionTooDeep = -5129,
70984   kSRTooManyElements = -5130,
70985   kSRCantAdd = -5131,
70986   kSRSndInSourceDisconnected = -5132,
70987   kSRCantReadLanguageObject = -5133,
70988
70989   kSRNotImplementedYet = -5199
70990 };
70991
70992
70993
70994 typedef struct OpaqueSRSpeechObject* SRSpeechObject;
70995 typedef SRSpeechObject SRRecognitionSystem;
70996 typedef SRSpeechObject SRRecognizer;
70997 typedef SRSpeechObject SRSpeechSource;
70998 typedef SRSpeechSource SRRecognitionResult;
70999 typedef SRSpeechObject SRLanguageObject;
71000 typedef SRLanguageObject SRLanguageModel;
71001 typedef SRLanguageObject SRPath;
71002 typedef SRLanguageObject SRPhrase;
71003 typedef SRLanguageObject SRWord;
71004
71005 typedef unsigned short SRSpeedSetting;
71006
71007 typedef unsigned short SRRejectionLevel;
71008
71009
71010
71011 struct SRCallBackStruct {
71012   long what;
71013   long message;
71014   SRRecognizer instance;
71015   OSErr status;
71016   short flags;
71017   long refCon;
71018 };
71019 typedef struct SRCallBackStruct SRCallBackStruct;
71020
71021 typedef void ( * SRCallBackProcPtr)(SRCallBackStruct * param);
71022 typedef SRCallBackProcPtr SRCallBackUPP;
71023 extern SRCallBackUPP
71024 NewSRCallBackUPP(SRCallBackProcPtr userRoutine) ;
71025 extern void
71026 DisposeSRCallBackUPP(SRCallBackUPP userUPP) ;
71027 extern void
71028 InvokeSRCallBackUPP(
71029   SRCallBackStruct * param,
71030   SRCallBackUPP userUPP) ;
71031
71032 struct SRCallBackParam {
71033   SRCallBackUPP callBack;
71034   long refCon;
71035 };
71036 typedef struct SRCallBackParam SRCallBackParam;
71037
71038 enum {
71039   kSRDefaultRecognitionSystemID = 0
71040 };
71041
71042
71043 enum {
71044   kSRFeedbackAndListeningModes = 'fbwn',
71045   kSRRejectedWord = 'rejq',
71046   kSRCleanupOnClientExit = 'clup'
71047 };
71048
71049 enum {
71050   kSRNoFeedbackNoListenModes = 0,
71051   kSRHasFeedbackHasListenModes = 1,
71052   kSRNoFeedbackHasListenModes = 2
71053 };
71054
71055
71056 enum {
71057   kSRDefaultSpeechSource = 0,
71058   kSRLiveDesktopSpeechSource = 'dklv',
71059   kSRCanned22kHzSpeechSource = 'ca22'
71060 };
71061
71062
71063
71064 enum {
71065   kSRNotifyRecognitionBeginning = 1L << 0,
71066   kSRNotifyRecognitionDone = 1L << 1
71067 };
71068
71069
71070
71071 enum {
71072   kAESpeechSuite = 'sprc'
71073 };
71074
71075
71076 enum {
71077   kAESpeechDone = 'srsd',
71078   kAESpeechDetected = 'srbd'
71079 };
71080
71081
71082 enum {
71083   keySRRecognizer = 'krec',
71084   keySRSpeechResult = 'kspr',
71085   keySRSpeechStatus = 'ksst'
71086 };
71087
71088
71089 enum {
71090   typeSRRecognizer = 'trec',
71091   typeSRSpeechResult = 'tspr'
71092 };
71093
71094
71095
71096 enum {
71097   kSRNotificationParam = 'noti',
71098   kSRCallBackParam = 'call',
71099   kSRSearchStatusParam = 'stat',
71100   kSRAutoFinishingParam = 'afin',
71101   kSRForegroundOnly = 'fgon',
71102   kSRBlockBackground = 'blbg',
71103   kSRBlockModally = 'blmd',
71104   kSRWantsResultTextDrawn = 'txfb',
71105   kSRWantsAutoFBGestures = 'dfbr',
71106   kSRSoundInVolume = 'volu',
71107   kSRReadAudioFSSpec = 'aurd',
71108   kSRCancelOnSoundOut = 'caso',
71109   kSRSpeedVsAccuracyParam = 'sped'
71110 };
71111
71112
71113
71114 enum {
71115   kSRUseToggleListen = 0,
71116   kSRUsePushToTalk = 1
71117 };
71118
71119 enum {
71120   kSRListenKeyMode = 'lkmd',
71121   kSRListenKeyCombo = 'lkey',
71122   kSRListenKeyName = 'lnam',
71123   kSRKeyWord = 'kwrd',
71124   kSRKeyExpected = 'kexp'
71125 };
71126
71127
71128 enum {
71129   kSRIdleRecognizer = 1L << 0,
71130   kSRSearchInProgress = 1L << 1,
71131   kSRSearchWaitForAllClients = 1L << 2,
71132   kSRMustCancelSearch = 1L << 3,
71133   kSRPendingSearch = 1L << 4
71134 };
71135
71136
71137 enum {
71138   kSRTEXTFormat = 'TEXT',
71139   kSRPhraseFormat = 'lmph',
71140   kSRPathFormat = 'lmpt',
71141   kSRLanguageModelFormat = 'lmfm'
71142 };
71143
71144
71145 enum {
71146   kSRSpelling = 'spel',
71147   kSRLMObjType = 'lmtp',
71148   kSRRefCon = 'refc',
71149   kSROptional = 'optl',
71150   kSREnabled = 'enbl',
71151   kSRRepeatable = 'rptb',
71152   kSRRejectable = 'rjbl',
71153
71154   kSRRejectionLevel = 'rjct'
71155 };
71156
71157
71158 enum {
71159   kSRLanguageModelType = 'lmob',
71160   kSRPathType = 'path',
71161   kSRPhraseType = 'phra',
71162   kSRWordType = 'word'
71163 };
71164
71165
71166 enum {
71167   kSRDefaultRejectionLevel = 50
71168 };
71169 extern OSErr
71170 SROpenRecognitionSystem(
71171   SRRecognitionSystem * system,
71172   OSType systemID) ;
71173 extern OSErr
71174 SRCloseRecognitionSystem(SRRecognitionSystem system) ;
71175 extern OSErr
71176 SRSetProperty(
71177   SRSpeechObject srObject,
71178   OSType selector,
71179   const void * property,
71180   Size propertyLen) ;
71181 extern OSErr
71182 SRGetProperty(
71183   SRSpeechObject srObject,
71184   OSType selector,
71185   void * property,
71186   Size * propertyLen) ;
71187 extern OSErr
71188 SRReleaseObject(SRSpeechObject srObject) ;
71189 extern OSErr
71190 SRGetReference(
71191   SRSpeechObject srObject,
71192   SRSpeechObject * newObjectRef) ;
71193 extern OSErr
71194 SRNewRecognizer(
71195   SRRecognitionSystem system,
71196   SRRecognizer * recognizer,
71197   OSType sourceID) ;
71198 extern OSErr
71199 SRStartListening(SRRecognizer recognizer) ;
71200 extern OSErr
71201 SRStopListening(SRRecognizer recognizer) ;
71202 extern OSErr
71203 SRSetLanguageModel(
71204   SRRecognizer recognizer,
71205   SRLanguageModel languageModel) ;
71206 extern OSErr
71207 SRGetLanguageModel(
71208   SRRecognizer recognizer,
71209   SRLanguageModel * languageModel) ;
71210 extern OSErr
71211 SRContinueRecognition(SRRecognizer recognizer) ;
71212 extern OSErr
71213 SRCancelRecognition(SRRecognizer recognizer) ;
71214 extern OSErr
71215 SRIdle(void) ;
71216 extern OSErr
71217 SRNewLanguageModel(
71218   SRRecognitionSystem system,
71219   SRLanguageModel * model,
71220   const void * name,
71221   Size nameLength) ;
71222 extern OSErr
71223 SRNewPath(
71224   SRRecognitionSystem system,
71225   SRPath * path) ;
71226 extern OSErr
71227 SRNewPhrase(
71228   SRRecognitionSystem system,
71229   SRPhrase * phrase,
71230   const void * text,
71231   Size textLength) ;
71232 extern OSErr
71233 SRNewWord(
71234   SRRecognitionSystem system,
71235   SRWord * word,
71236   const void * text,
71237   Size textLength) ;
71238 extern OSErr
71239 SRPutLanguageObjectIntoHandle(
71240   SRLanguageObject languageObject,
71241   Handle lobjHandle) ;
71242 extern OSErr
71243 SRPutLanguageObjectIntoDataFile(
71244   SRLanguageObject languageObject,
71245   short fRefNum) ;
71246 extern OSErr
71247 SRNewLanguageObjectFromHandle(
71248   SRRecognitionSystem system,
71249   SRLanguageObject * languageObject,
71250   Handle lObjHandle) ;
71251 extern OSErr
71252 SRNewLanguageObjectFromDataFile(
71253   SRRecognitionSystem system,
71254   SRLanguageObject * languageObject,
71255   short fRefNum) ;
71256 extern OSErr
71257 SREmptyLanguageObject(SRLanguageObject languageObject) ;
71258 extern OSErr
71259 SRChangeLanguageObject(
71260   SRLanguageObject languageObject,
71261   const void * text,
71262   Size textLength) ;
71263 extern OSErr
71264 SRAddLanguageObject(
71265   SRLanguageObject base,
71266   SRLanguageObject addon) ;
71267 extern OSErr
71268 SRAddText(
71269   SRLanguageObject base,
71270   const void * text,
71271   Size textLength,
71272   long refCon) ;
71273 extern OSErr
71274 SRRemoveLanguageObject(
71275   SRLanguageObject base,
71276   SRLanguageObject toRemove) ;
71277 extern OSErr
71278 SRCountItems(
71279   SRSpeechObject container,
71280   long * count) ;
71281 extern OSErr
71282 SRGetIndexedItem(
71283   SRSpeechObject container,
71284   SRSpeechObject * item,
71285   long index) ;
71286 extern OSErr
71287 SRSetIndexedItem(
71288   SRSpeechObject container,
71289   SRSpeechObject item,
71290   long index) ;
71291 extern OSErr
71292 SRRemoveIndexedItem(
71293   SRSpeechObject container,
71294   long index) ;
71295 extern OSErr
71296 SRDrawText(
71297   SRRecognizer recognizer,
71298   const void * dispText,
71299   Size dispLength) ;
71300 extern OSErr
71301 SRDrawRecognizedText(
71302   SRRecognizer recognizer,
71303   const void * dispText,
71304   Size dispLength) ;
71305 extern OSErr
71306 SRSpeakText(
71307   SRRecognizer recognizer,
71308   const void * speakText,
71309   Size speakLength) ;
71310 extern OSErr
71311 SRSpeakAndDrawText(
71312   SRRecognizer recognizer,
71313   const void * text,
71314   Size textLength) ;
71315 extern OSErr
71316 SRStopSpeech(SRRecognizer recognizer) ;
71317 extern Boolean
71318 SRSpeechBusy(SRRecognizer recognizer) ;
71319 extern OSErr
71320 SRProcessBegin(
71321   SRRecognizer recognizer,
71322   Boolean failed) ;
71323 extern OSErr
71324 SRProcessEnd(
71325   SRRecognizer recognizer,
71326   Boolean failed) ;
71327
71328
71329
71330
71331
71332
71333
71334 }
71335
71336
71337
71338 extern "C" {
71339 extern OSStatus
71340 KCAddAppleSharePassword(
71341   AFPServerSignature * serverSignature,
71342   StringPtr serverAddress,
71343   StringPtr serverName,
71344   StringPtr volumeName,
71345   StringPtr accountName,
71346   UInt32 passwordLength,
71347   const void * passwordData,
71348   KCItemRef * item) ;
71349 extern OSStatus
71350 KCAddInternetPassword(
71351   StringPtr serverName,
71352   StringPtr securityDomain,
71353   StringPtr accountName,
71354   UInt16 port,
71355   OSType protocol,
71356   OSType authType,
71357   UInt32 passwordLength,
71358   const void * passwordData,
71359   KCItemRef * item) ;
71360 extern OSStatus
71361 KCAddInternetPasswordWithPath(
71362   StringPtr serverName,
71363   StringPtr securityDomain,
71364   StringPtr accountName,
71365   StringPtr path,
71366   UInt16 port,
71367   OSType protocol,
71368   OSType authType,
71369   UInt32 passwordLength,
71370   const void * passwordData,
71371   KCItemRef * item) ;
71372 extern OSStatus
71373 KCAddGenericPassword(
71374   StringPtr serviceName,
71375   StringPtr accountName,
71376   UInt32 passwordLength,
71377   const void * passwordData,
71378   KCItemRef * item) ;
71379 extern OSStatus
71380 KCAddItem(KCItemRef item) ;
71381 extern OSStatus
71382 KCUnlock(
71383   KCRef keychain,
71384   StringPtr password) ;
71385 extern OSStatus
71386 KCCreateKeychain(
71387   StringPtr password,
71388   KCRef * keychain) ;
71389 extern OSStatus
71390 KCChangeSettings(KCRef keychain) ;
71391 extern OSStatus
71392 kcunlock(
71393   KCRef keychain,
71394   const char * password) ;
71395 extern OSStatus
71396 kccreatekeychain(
71397   const char * password,
71398   KCRef * keychain) ;
71399 extern OSStatus
71400 kcaddapplesharepassword(
71401   AFPServerSignature * serverSignature,
71402   const char * serverAddress,
71403   const char * serverName,
71404   const char * volumeName,
71405   const char * accountName,
71406   UInt32 passwordLength,
71407   const void * passwordData,
71408   KCItemRef * item) ;
71409 extern OSStatus
71410 kcaddinternetpassword(
71411   const char * serverName,
71412   const char * securityDomain,
71413   const char * accountName,
71414   UInt16 port,
71415   OSType protocol,
71416   OSType authType,
71417   UInt32 passwordLength,
71418   const void * passwordData,
71419   KCItemRef * item) ;
71420 extern OSStatus
71421 kcaddinternetpasswordwithpath(
71422   const char * serverName,
71423   const char * securityDomain,
71424   const char * accountName,
71425   const char * path,
71426   UInt16 port,
71427   OSType protocol,
71428   OSType authType,
71429   UInt32 passwordLength,
71430   const void * passwordData,
71431   KCItemRef * item) ;
71432 extern OSStatus
71433 kcaddgenericpassword(
71434   const char * serviceName,
71435   const char * accountName,
71436   UInt32 passwordLength,
71437   const void * passwordData,
71438   KCItemRef * item) ;
71439 }
71440
71441
71442
71443 extern "C" {
71444
71445
71446
71447
71448 typedef struct OpaqueURLReference* URLReference;
71449 typedef UInt32 URLOpenFlags;
71450 enum {
71451   kURLReplaceExistingFlag = 1 << 0,
71452   kURLBinHexFileFlag = 1 << 1,
71453   kURLExpandFileFlag = 1 << 2,
71454   kURLDisplayProgressFlag = 1 << 3,
71455   kURLDisplayAuthFlag = 1 << 4,
71456   kURLUploadFlag = 1 << 5,
71457   kURLIsDirectoryHintFlag = 1 << 6,
71458   kURLDoNotTryAnonymousFlag = 1 << 7,
71459   kURLDirectoryListingFlag = 1 << 8,
71460   kURLExpandAndVerifyFlag = 1 << 9,
71461   kURLNoAutoRedirectFlag = 1 << 10,
71462   kURLDebinhexOnlyFlag = 1 << 11,
71463   kURLDoNotDeleteOnErrorFlag = 1 << 12,
71464
71465
71466   kURLResumeDownloadFlag = 1 << 13,
71467
71468
71469   kURLReservedFlag = (unsigned long)(1 << 31)
71470 };
71471
71472 typedef UInt32 URLState;
71473 enum {
71474   kURLNullState = 0,
71475   kURLInitiatingState = 1,
71476   kURLLookingUpHostState = 2,
71477   kURLConnectingState = 3,
71478   kURLResourceFoundState = 4,
71479   kURLDownloadingState = 5,
71480   kURLDataAvailableState = 0x10 + kURLDownloadingState,
71481   kURLTransactionCompleteState = 6,
71482   kURLErrorOccurredState = 7,
71483   kURLAbortingState = 8,
71484   kURLCompletedState = 9,
71485   kURLUploadingState = 10
71486 };
71487
71488 typedef UInt32 URLEvent;
71489 enum {
71490   kURLInitiatedEvent = kURLInitiatingState,
71491   kURLResourceFoundEvent = kURLResourceFoundState,
71492   kURLDownloadingEvent = kURLDownloadingState,
71493   kURLAbortInitiatedEvent = kURLAbortingState,
71494   kURLCompletedEvent = kURLCompletedState,
71495   kURLErrorOccurredEvent = kURLErrorOccurredState,
71496   kURLDataAvailableEvent = kURLDataAvailableState,
71497   kURLTransactionCompleteEvent = kURLTransactionCompleteState,
71498   kURLUploadingEvent = kURLUploadingState,
71499   kURLSystemEvent = 29,
71500   kURLPercentEvent = 30,
71501   kURLPeriodicEvent = 31,
71502   kURLPropertyChangedEvent = 32
71503 };
71504
71505 typedef unsigned long URLEventMask;
71506 enum {
71507   kURLInitiatedEventMask = 1 << (kURLInitiatedEvent - 1),
71508   kURLResourceFoundEventMask = 1 << (kURLResourceFoundEvent - 1),
71509   kURLDownloadingMask = 1 << (kURLDownloadingEvent - 1),
71510   kURLUploadingMask = 1 << (kURLUploadingEvent - 1),
71511   kURLAbortInitiatedMask = 1 << (kURLAbortInitiatedEvent - 1),
71512   kURLCompletedEventMask = 1 << (kURLCompletedEvent - 1),
71513   kURLErrorOccurredEventMask = 1 << (kURLErrorOccurredEvent - 1),
71514   kURLDataAvailableEventMask = 1 << (kURLDataAvailableEvent - 1),
71515   kURLTransactionCompleteEventMask = 1 << (kURLTransactionCompleteEvent - 1),
71516   kURLSystemEventMask = 1 << (kURLSystemEvent - 1),
71517   kURLPercentEventMask = 1 << (kURLPercentEvent - 1),
71518   kURLPeriodicEventMask = 1 << (kURLPeriodicEvent - 1),
71519   kURLPropertyChangedEventMask = 1 << (kURLPropertyChangedEvent - 1),
71520   kURLAllBufferEventsMask = kURLDataAvailableEventMask + kURLTransactionCompleteEventMask,
71521   kURLAllNonBufferEventsMask = kURLInitiatedEventMask + kURLDownloadingMask + kURLUploadingMask + kURLAbortInitiatedMask + kURLCompletedEventMask + kURLErrorOccurredEventMask + kURLPercentEventMask + kURLPeriodicEventMask + kURLPropertyChangedEventMask,
71522   kURLAllEventsMask = (long)0xFFFFFFFF
71523 };
71524
71525
71526 struct URLCallbackInfo {
71527   UInt32 version;
71528   URLReference urlRef;
71529   const char * property;
71530   UInt32 currentSize;
71531   EventRecord * systemEvent;
71532 };
71533 typedef struct URLCallbackInfo URLCallbackInfo;
71534
71535
71536 enum {
71537   kUserNameAndPasswordFlag = 0x00000001
71538 };
71539 extern OSStatus
71540 URLGetURLAccessVersion(UInt32 * returnVers) ;
71541     inline Boolean URLAccessAvailable() { return true; }
71542
71543
71544
71545
71546
71547 typedef OSStatus ( * URLNotifyProcPtr)(void *userContext, URLEvent event, URLCallbackInfo *callbackInfo);
71548 typedef OSStatus ( * URLSystemEventProcPtr)(void *userContext, EventRecord *event);
71549 typedef URLNotifyProcPtr URLNotifyUPP;
71550 typedef URLSystemEventProcPtr URLSystemEventUPP;
71551 extern URLNotifyUPP
71552 NewURLNotifyUPP(URLNotifyProcPtr userRoutine) ;
71553 extern URLSystemEventUPP
71554 NewURLSystemEventUPP(URLSystemEventProcPtr userRoutine) ;
71555 extern void
71556 DisposeURLNotifyUPP(URLNotifyUPP userUPP) ;
71557 extern void
71558 DisposeURLSystemEventUPP(URLSystemEventUPP userUPP) ;
71559 extern OSStatus
71560 InvokeURLNotifyUPP(
71561   void * userContext,
71562   URLEvent event,
71563   URLCallbackInfo * callbackInfo,
71564   URLNotifyUPP userUPP) ;
71565 extern OSStatus
71566 InvokeURLSystemEventUPP(
71567   void * userContext,
71568   EventRecord * event,
71569   URLSystemEventUPP userUPP) ;
71570 extern OSStatus
71571 URLSimpleDownload(
71572   const char * url,
71573   FSSpec * destination,
71574   Handle destinationHandle,
71575   URLOpenFlags openFlags,
71576   URLSystemEventUPP eventProc,
71577   void * userContext) ;
71578 extern OSStatus
71579 URLDownload(
71580   URLReference urlRef,
71581   FSSpec * destination,
71582   Handle destinationHandle,
71583   URLOpenFlags openFlags,
71584   URLSystemEventUPP eventProc,
71585   void * userContext) ;
71586 extern OSStatus
71587 URLSimpleUpload(
71588   const char * url,
71589   const FSSpec * source,
71590   URLOpenFlags openFlags,
71591   URLSystemEventUPP eventProc,
71592   void * userContext) ;
71593 extern OSStatus
71594 URLUpload(
71595   URLReference urlRef,
71596   const FSSpec * source,
71597   URLOpenFlags openFlags,
71598   URLSystemEventUPP eventProc,
71599   void * userContext) ;
71600 extern OSStatus
71601 URLNewReference(
71602   const char * url,
71603   URLReference * urlRef) ;
71604 extern OSStatus
71605 URLDisposeReference(URLReference urlRef) ;
71606 extern OSStatus
71607 URLOpen(
71608   URLReference urlRef,
71609   FSSpec * fileSpec,
71610   URLOpenFlags openFlags,
71611   URLNotifyUPP notifyProc,
71612   URLEventMask eventRegister,
71613   void * userContext) ;
71614 extern OSStatus
71615 URLAbort(URLReference urlRef) ;
71616 extern OSStatus
71617 URLGetDataAvailable(
71618   URLReference urlRef,
71619   Size * dataSize) ;
71620 extern OSStatus
71621 URLGetBuffer(
71622   URLReference urlRef,
71623   void ** buffer,
71624   Size * bufferSize) ;
71625 extern OSStatus
71626 URLReleaseBuffer(
71627   URLReference urlRef,
71628   void * buffer) ;
71629 extern OSStatus
71630 URLGetProperty(
71631   URLReference urlRef,
71632   const char * property,
71633   void * propertyBuffer,
71634   Size bufferSize) ;
71635 extern OSStatus
71636 URLGetPropertySize(
71637   URLReference urlRef,
71638   const char * property,
71639   Size * propertySize) ;
71640 extern OSStatus
71641 URLSetProperty(
71642   URLReference urlRef,
71643   const char * property,
71644   void * propertyBuffer,
71645   Size bufferSize) ;
71646 extern OSStatus
71647 URLGetCurrentState(
71648   URLReference urlRef,
71649   URLState * state) ;
71650 extern OSStatus
71651 URLGetError(
71652   URLReference urlRef,
71653   OSStatus * urlError) ;
71654 extern OSStatus
71655 URLIdle(void) ;
71656 extern OSStatus
71657 URLGetFileInfo(
71658   StringPtr fName,
71659   OSType * fType,
71660   OSType * fCreator) ;
71661
71662
71663
71664
71665
71666 }
71667
71668
71669
71670 extern "C" {
71671
71672
71673
71674 enum {
71675   kAHInternalErr = -10790,
71676   kAHInternetConfigPrefErr = -10791
71677 };
71678
71679
71680 typedef SInt16 AHTOCType;
71681 enum {
71682   kAHTOCTypeUser = 0,
71683   kAHTOCTypeDeveloper = 1
71684 };
71685 extern OSStatus
71686 AHSearch(
71687   CFStringRef bookname,
71688   CFStringRef query) ;
71689 extern OSStatus
71690 AHGotoMainTOC(AHTOCType toctype) ;
71691 extern OSStatus
71692 AHGotoPage(
71693   CFStringRef bookname,
71694   CFStringRef path,
71695   CFStringRef anchor) ;
71696 extern OSStatus
71697 AHLookupAnchor(
71698   CFStringRef bookname,
71699   CFStringRef anchor) ;
71700 extern OSStatus
71701 AHRegisterHelpBook(const FSRef * appBundleRef) ;
71702
71703
71704
71705
71706 }
71707
71708
71709
71710 extern "C" {
71711
71712
71713
71714 typedef struct OpaqueICAObject* ICAObject;
71715 typedef struct OpaqueICAProperty* ICAProperty;
71716 typedef struct OpaqueICAConnectionID* ICAConnectionID;
71717 typedef struct OpaqueICAEventDataCookie* ICAEventDataCookie;
71718 typedef struct OpaqueICAScannerSessionID* ICAScannerSessionID;
71719
71720
71721
71722
71723 enum {
71724   kICACommunicationErr = -9900,
71725   kICADeviceNotFoundErr = -9901,
71726   kICADeviceNotOpenErr = -9902,
71727   kICAFileCorruptedErr = -9903,
71728   kICAIOPendingErr = -9904,
71729   kICAInvalidObjectErr = -9905,
71730   kICAInvalidPropertyErr = -9906,
71731   kICAIndexOutOfRangeErr = -9907,
71732   kICAPropertyTypeNotFoundErr = -9908
71733 };
71734
71735
71736 enum {
71737   kICADevice = 'icdv',
71738   kICADeviceCamera = 'cmra',
71739   kICADeviceScanner = 'scan',
71740   kICADeviceMFP = 'mfp ',
71741   kICAList = 'objl',
71742   kICADirectory = 'dire',
71743   kICAFile = 'file',
71744   kICAFileImage = 'imag',
71745   kICAFileMovie = 'moov',
71746   kICAFileAudio = 'audo',
71747   kICAFileFirmware = 'firm',
71748   kICAFileOther = 'othe'
71749 };
71750
71751
71752 enum {
71753   kICAProperty = 'prop',
71754
71755
71756
71757   kICAPropertyImageWidth = '0100',
71758   kICAPropertyImageHeight = '0101',
71759   kICAPropertyImageBitDepth = '0102',
71760   kICAPropertyImageDPI = '011A',
71761   kICAPropertyImageExposureTime = '829A',
71762   kICAPropertyImageFNumber = '829D',
71763   kICAPropertyImageDateOriginal = '9003',
71764   kICAPropertyImageDateDigitized = '9004',
71765   kICAPropertyImageShutterSpeed = '9201',
71766   kICAPropertyImageAperture = '9202',
71767   kICAPropertyImageFlash = '9209',
71768   kICAPropertyColorSpace = 'A001',
71769   kICAPropertyImageFilename = 'ifil',
71770   kICAPropertyImageSize = 'isiz',
71771   kICAPropertyImageData = 'idat',
71772   kICAPropertyImageThumbnail = 'thum',
71773   kICAPropertyColorSyncProfile = 'prof'
71774 };
71775
71776
71777 enum {
71778   kICAMessageConnect = 'open',
71779   kICAMessageDisconnect = 'clos',
71780   kICAMessageReset = 'rese',
71781   kICAMessageCheckDevice = 'chkd'
71782 };
71783
71784
71785
71786 enum {
71787   kICATypeUInt16 = 'ui16',
71788   kICATypeUInt32 = 'ui32',
71789   kICATypeUInt64 = 'ui64',
71790   kICATypeSInt16 = 'si16',
71791   kICATypeSInt32 = 'si32',
71792   kICATypeSInt64 = 'si64',
71793   kICATypeFixed = 'sing',
71794   kICATypeBoolean = 'bool',
71795   kICATypeString = 'TEXT',
71796   kICATypeData = 'data',
71797   kICATypeThumbnail = 'thum'
71798 };
71799
71800
71801
71802 enum {
71803   kICAFlagReadWriteAccess = 1L << 0,
71804   kICAFlagReadAccess = 1L << 1
71805 };
71806
71807
71808
71809
71810 enum {
71811   kICAEventCancelTransaction = 'ecnt',
71812   kICAEventObjectAdded = 'eoba',
71813   kICAEventObjectRemoved = 'eobr',
71814   kICAEventStoreAdded = 'esta',
71815   kICAEventStoreRemoved = 'estr',
71816   kICAEventDeviceAdded = 'edea',
71817   kICAEventDeviceRemoved = 'eder',
71818   kICAEventDevicePropChanged = 'edpc',
71819   kICAEventObjectInfoChanged = 'eoic',
71820   kICAEventDeviceInfoChanged = 'edic',
71821   kICAEventRequestObjectTransfer = 'erot',
71822   kICAEventStoreFull = 'estf',
71823   kICAEventDeviceReset = 'edvr',
71824   kICAEventStorageInfoChanged = 'esic',
71825   kICAEventCaptureComplete = 'ecpc',
71826   kICAEventUnreportedStatus = 'eurs'
71827 };
71828
71829
71830
71831 enum {
71832   kICAStartAtBeginning = 0,
71833   kICAEntireLength = -1
71834 };
71835
71836
71837 enum {
71838   kDeleteAfterDownload = 0x00000001,
71839   kCreateCustomIcon = 0x00000002,
71840   kAddMetaDataToFinderComment = 0x00000004,
71841   kAdjustCreationDate = 0x00000008,
71842   kSetFileTypeAndCreator = 0x00000010,
71843   kEmbedColorSyncProfile = 0x00000020,
71844   kRotateImage = 0x00000040
71845 };
71846
71847
71848 enum {
71849   kExtendedNotificationPB = 'extd',
71850   kMessageGetEventData = 'mged',
71851   kEventClassPTPStandard = 'PTPs',
71852   kEventClassPTPVendor = 'PTPv'
71853 };
71854
71855
71856
71857
71858 struct ICAObjectInfo {
71859   OSType objectType;
71860   OSType objectSubtype;
71861 };
71862 typedef struct ICAObjectInfo ICAObjectInfo;
71863
71864
71865 struct ICAPropertyInfo {
71866   OSType propertyType;
71867   OSType dataType;
71868   UInt32 dataSize;
71869   UInt32 dataFlags;
71870 };
71871 typedef struct ICAPropertyInfo ICAPropertyInfo;
71872
71873
71874 struct ICAMessage {
71875   OSType messageType;
71876   UInt32 startByte;
71877   void * dataPtr;
71878   UInt32 dataSize;
71879   OSType dataType;
71880 };
71881 typedef struct ICAMessage ICAMessage;
71882
71883
71884 struct ICAThumbnail {
71885   UInt32 width;
71886   UInt32 height;
71887   UInt32 dataSize;
71888   UInt8 data[1];
71889 };
71890 typedef struct ICAThumbnail ICAThumbnail;
71891 enum {
71892   kICAPBVersion = 0x00010000
71893 };
71894 typedef struct ICAHeader ICAHeader;
71895 typedef void ( * ICACompletion)(ICAHeader * pb);
71896
71897
71898
71899
71900
71901 struct ICAHeader {
71902   OSErr err;
71903   UInt32 refcon;
71904 };
71905
71906
71907
71908
71909
71910
71911 struct ICAGetChildCountPB {
71912   ICAHeader header;
71913   ICAObject object;
71914   UInt32 count;
71915 };
71916 typedef struct ICAGetChildCountPB ICAGetChildCountPB;
71917
71918
71919 struct ICAGetNthChildPB {
71920   ICAHeader header;
71921   ICAObject parentObject;
71922   UInt32 index;
71923   ICAObject childObject;
71924   ICAObjectInfo childInfo;
71925 };
71926 typedef struct ICAGetNthChildPB ICAGetNthChildPB;
71927
71928
71929 struct ICAGetObjectInfoPB {
71930   ICAHeader header;
71931   ICAObject object;
71932   ICAObjectInfo objectInfo;
71933 };
71934 typedef struct ICAGetObjectInfoPB ICAGetObjectInfoPB;
71935
71936
71937 struct ICAGetParentOfObjectPB {
71938   ICAHeader header;
71939   ICAObject object;
71940   ICAObject parentObject;
71941   ICAObjectInfo parentInfo;
71942 };
71943 typedef struct ICAGetParentOfObjectPB ICAGetParentOfObjectPB;
71944
71945
71946 struct ICAGetRootOfObjectPB {
71947   ICAHeader header;
71948   ICAObject object;
71949   ICAObject rootObject;
71950   ICAObjectInfo rootInfo;
71951 };
71952 typedef struct ICAGetRootOfObjectPB ICAGetRootOfObjectPB;
71953
71954
71955 struct ICAGetObjectRefConPB {
71956   ICAHeader header;
71957   ICAObject object;
71958   UInt32 objectRefCon;
71959 };
71960 typedef struct ICAGetObjectRefConPB ICAGetObjectRefConPB;
71961
71962
71963 struct ICASetObjectRefConPB {
71964   ICAHeader header;
71965   ICAObject object;
71966   UInt32 objectRefCon;
71967 };
71968 typedef struct ICASetObjectRefConPB ICASetObjectRefConPB;
71969
71970
71971
71972
71973
71974 struct ICAGetPropertyCountPB {
71975   ICAHeader header;
71976   ICAObject object;
71977   UInt32 count;
71978 };
71979 typedef struct ICAGetPropertyCountPB ICAGetPropertyCountPB;
71980
71981
71982 struct ICAGetNthPropertyPB {
71983   ICAHeader header;
71984   ICAObject object;
71985   UInt32 index;
71986   ICAProperty property;
71987   ICAPropertyInfo propertyInfo;
71988 };
71989 typedef struct ICAGetNthPropertyPB ICAGetNthPropertyPB;
71990
71991
71992 struct ICAGetPropertyByTypePB {
71993   ICAHeader header;
71994   ICAObject object;
71995   OSType propertyType;
71996   ICAProperty property;
71997   ICAPropertyInfo propertyInfo;
71998 };
71999 typedef struct ICAGetPropertyByTypePB ICAGetPropertyByTypePB;
72000
72001
72002 struct ICAGetPropertyInfoPB {
72003   ICAHeader header;
72004   ICAProperty property;
72005   ICAPropertyInfo propertyInfo;
72006 };
72007 typedef struct ICAGetPropertyInfoPB ICAGetPropertyInfoPB;
72008
72009
72010 struct ICAGetPropertyDataPB {
72011   ICAHeader header;
72012   ICAProperty property;
72013   UInt32 startByte;
72014   UInt32 requestedSize;
72015   void * dataPtr;
72016   UInt32 actualSize;
72017   OSType dataType;
72018 };
72019 typedef struct ICAGetPropertyDataPB ICAGetPropertyDataPB;
72020
72021
72022 struct ICASetPropertyDataPB {
72023   ICAHeader header;
72024   ICAProperty property;
72025   UInt32 startByte;
72026   void * dataPtr;
72027   UInt32 dataSize;
72028   OSType dataType;
72029 };
72030 typedef struct ICASetPropertyDataPB ICASetPropertyDataPB;
72031
72032
72033 struct ICAGetParentOfPropertyPB {
72034   ICAHeader header;
72035   ICAProperty property;
72036   ICAObject parentObject;
72037   ICAObjectInfo parentInfo;
72038 };
72039 typedef struct ICAGetParentOfPropertyPB ICAGetParentOfPropertyPB;
72040
72041
72042 struct ICAGetRootOfPropertyPB {
72043   ICAHeader header;
72044   ICAProperty property;
72045   ICAObject rootObject;
72046   ICAObjectInfo rootInfo;
72047 };
72048 typedef struct ICAGetRootOfPropertyPB ICAGetRootOfPropertyPB;
72049
72050
72051 struct ICAGetPropertyRefConPB {
72052   ICAHeader header;
72053   ICAProperty property;
72054   UInt32 propertyRefCon;
72055 };
72056 typedef struct ICAGetPropertyRefConPB ICAGetPropertyRefConPB;
72057
72058
72059 struct ICASetPropertyRefConPB {
72060   ICAHeader header;
72061   ICAProperty property;
72062   UInt32 propertyRefCon;
72063 };
72064 typedef struct ICASetPropertyRefConPB ICASetPropertyRefConPB;
72065
72066
72067
72068
72069
72070 struct ICAGetDeviceListPB {
72071   ICAHeader header;
72072   ICAObject object;
72073 };
72074 typedef struct ICAGetDeviceListPB ICAGetDeviceListPB;
72075
72076
72077 struct ICAObjectSendMessagePB {
72078   ICAHeader header;
72079   ICAObject object;
72080   ICAMessage message;
72081   UInt32 result;
72082 };
72083 typedef struct ICAObjectSendMessagePB ICAObjectSendMessagePB;
72084
72085
72086 struct ICARegisterEventNotificationPB {
72087   ICAHeader header;
72088   ICAObject object;
72089   OSType notifyType;
72090   ICACompletion notifyProc;
72091 };
72092 typedef struct ICARegisterEventNotificationPB ICARegisterEventNotificationPB;
72093
72094
72095 struct ICAExtendedRegisterEventNotificationPB {
72096   ICAHeader header;
72097   ICAObject object;
72098   OSType extd;
72099   ICACompletion notifyProc;
72100
72101   UInt32 rawEventType;
72102   OSType eventType;
72103   OSType eventClass;
72104   UInt32 eventDataSize;
72105   ICAEventDataCookie eventDataCookie;
72106   ICAObject deviceObject;
72107 };
72108 typedef struct ICAExtendedRegisterEventNotificationPB ICAExtendedRegisterEventNotificationPB;
72109
72110
72111 struct ICADownloadFilePB {
72112   ICAHeader header;
72113   ICAObject object;
72114   FSRef * dirFSRef;
72115   UInt32 flags;
72116   OSType fileType;
72117   OSType fileCreator;
72118   Fixed rotationAngle;
72119   FSRef * fileFSRef;
72120 };
72121 typedef struct ICADownloadFilePB ICADownloadFilePB;
72122
72123
72124 struct ICACopyObjectPropertyDictionaryPB {
72125   ICAHeader header;
72126   ICAObject object;
72127   CFDictionaryRef * theDict;
72128 };
72129 typedef struct ICACopyObjectPropertyDictionaryPB ICACopyObjectPropertyDictionaryPB;
72130 extern OSErr
72131 ICAGetChildCount(
72132   ICAGetChildCountPB * pb,
72133   ICACompletion completion) ;
72134 extern OSErr
72135 ICAGetNthChild(
72136   ICAGetNthChildPB * pb,
72137   ICACompletion completion) ;
72138 extern OSErr
72139 ICAGetObjectInfo(
72140   ICAGetObjectInfoPB * pb,
72141   ICACompletion completion) ;
72142 extern OSErr
72143 ICAGetParentOfObject(
72144   ICAGetParentOfObjectPB * pb,
72145   ICACompletion completion) ;
72146 extern OSErr
72147 ICAGetRootOfObject(
72148   ICAGetRootOfObjectPB * pb,
72149   ICACompletion completion) ;
72150 extern OSErr
72151 ICAGetObjectRefCon(
72152   ICAGetObjectRefConPB * pb,
72153   ICACompletion completion) ;
72154 extern OSErr
72155 ICASetObjectRefCon(
72156   ICASetObjectRefConPB * pb,
72157   ICACompletion completion) ;
72158 extern OSErr
72159 ICAGetPropertyCount(
72160   ICAGetPropertyCountPB * pb,
72161   ICACompletion completion) ;
72162 extern OSErr
72163 ICAGetNthProperty(
72164   ICAGetNthPropertyPB * pb,
72165   ICACompletion completion) ;
72166 extern OSErr
72167 ICAGetPropertyByType(
72168   ICAGetPropertyByTypePB * pb,
72169   ICACompletion completion) ;
72170 extern OSErr
72171 ICAGetPropertyInfo(
72172   ICAGetPropertyInfoPB * pb,
72173   ICACompletion completion) ;
72174 extern OSErr
72175 ICAGetPropertyData(
72176   ICAGetPropertyDataPB * pb,
72177   ICACompletion completion) ;
72178 extern OSErr
72179 ICASetPropertyData(
72180   ICASetPropertyDataPB * pb,
72181   ICACompletion completion) ;
72182 extern OSErr
72183 ICAGetParentOfProperty(
72184   ICAGetParentOfPropertyPB * pb,
72185   ICACompletion completion) ;
72186 extern OSErr
72187 ICAGetRootOfProperty(
72188   ICAGetRootOfPropertyPB * pb,
72189   ICACompletion completion) ;
72190 extern OSErr
72191 ICAGetPropertyRefCon(
72192   ICAGetPropertyRefConPB * pb,
72193   ICACompletion completion) ;
72194 extern OSErr
72195 ICASetPropertyRefCon(
72196   ICASetPropertyRefConPB * pb,
72197   ICACompletion completion) ;
72198 extern OSErr
72199 ICAGetDeviceList(
72200   ICAGetDeviceListPB * pb,
72201   ICACompletion completion) ;
72202 extern OSErr
72203 ICAObjectSendMessage(
72204   ICAObjectSendMessagePB * pb,
72205   ICACompletion completion) ;
72206 extern OSErr
72207 ICARegisterEventNotification(
72208   ICARegisterEventNotificationPB * pb,
72209   ICACompletion completion) ;
72210 extern OSErr
72211 ICADownloadFile(
72212   ICADownloadFilePB * pb,
72213   ICACompletion completion) ;
72214 extern OSErr
72215 ICACopyObjectPropertyDictionary(
72216   ICACopyObjectPropertyDictionaryPB * pb,
72217   ICACompletion completion) ;
72218
72219
72220
72221
72222
72223
72224 struct ICAScannerOpenSessionPB {
72225   ICAHeader header;
72226   ICAObject object;
72227   ICAScannerSessionID sessionID;
72228 };
72229 typedef struct ICAScannerOpenSessionPB ICAScannerOpenSessionPB;
72230
72231
72232 struct ICAScannerCloseSessionPB {
72233   ICAHeader header;
72234   ICAScannerSessionID sessionID;
72235 };
72236 typedef struct ICAScannerCloseSessionPB ICAScannerCloseSessionPB;
72237
72238
72239 struct ICAScannerInitializePB {
72240   ICAHeader header;
72241   ICAScannerSessionID sessionID;
72242 };
72243 typedef struct ICAScannerInitializePB ICAScannerInitializePB;
72244
72245
72246 struct ICAScannerGetParametersPB {
72247   ICAHeader header;
72248   ICAScannerSessionID sessionID;
72249   CFMutableDictionaryRef theDict;
72250 };
72251 typedef struct ICAScannerGetParametersPB ICAScannerGetParametersPB;
72252
72253
72254 struct ICAScannerSetParametersPB {
72255   ICAHeader header;
72256   ICAScannerSessionID sessionID;
72257   CFMutableDictionaryRef theDict;
72258 };
72259 typedef struct ICAScannerSetParametersPB ICAScannerSetParametersPB;
72260
72261
72262 struct ICAScannerStatusPB {
72263   ICAHeader header;
72264   ICAScannerSessionID sessionID;
72265   UInt32 status;
72266 };
72267 typedef struct ICAScannerStatusPB ICAScannerStatusPB;
72268
72269
72270 struct ICAScannerStartPB {
72271   ICAHeader header;
72272   ICAScannerSessionID sessionID;
72273 };
72274 typedef struct ICAScannerStartPB ICAScannerStartPB;
72275 extern OSErr
72276 ICAScannerOpenSession(
72277   ICAScannerOpenSessionPB * pb,
72278   ICACompletion completion) ;
72279 extern OSErr
72280 ICAScannerCloseSession(
72281   ICAScannerCloseSessionPB * pb,
72282   ICACompletion completion) ;
72283 extern OSErr
72284 ICAScannerInitialize(
72285   ICAScannerInitializePB * pb,
72286   ICACompletion completion) ;
72287 extern OSErr
72288 ICAScannerGetParameters(
72289   ICAScannerGetParametersPB * pb,
72290   ICACompletion completion) ;
72291 extern OSErr
72292 ICAScannerSetParameters(
72293   ICAScannerSetParametersPB * pb,
72294   ICACompletion completion) ;
72295 extern OSErr
72296 ICAScannerStatus(
72297   ICAScannerStatusPB * pb,
72298   ICACompletion completion) ;
72299 extern OSErr
72300 ICAScannerStart(
72301   ICAScannerStartPB * pb,
72302   ICACompletion completion) ;
72303
72304
72305
72306
72307
72308 }
72309
72310
72311
72312 extern "C" {
72313
72314
72315 typedef struct ICDHeader ICDHeader;
72316 typedef void ( * ICDCompletion)(ICDHeader * pb);
72317
72318
72319
72320 struct ICDHeader {
72321   OSErr err;
72322   UInt32 refcon;
72323 };
72324
72325
72326
72327
72328 struct ICD_NewObjectPB {
72329   ICDHeader header;
72330
72331   ICAObject parentObject;
72332   ICAObjectInfo objectInfo;
72333
72334   ICAObject object;
72335 };
72336 typedef struct ICD_NewObjectPB ICD_NewObjectPB;
72337 struct ICD_DisposeObjectPB {
72338   ICDHeader header;
72339
72340   ICAObject object;
72341 };
72342 typedef struct ICD_DisposeObjectPB ICD_DisposeObjectPB;
72343
72344
72345
72346 struct ICD_NewPropertyPB {
72347   ICDHeader header;
72348
72349   ICAObject object;
72350   ICAPropertyInfo propertyInfo;
72351
72352   ICAProperty property;
72353 };
72354 typedef struct ICD_NewPropertyPB ICD_NewPropertyPB;
72355 struct ICD_DisposePropertyPB {
72356   ICDHeader header;
72357
72358   ICAProperty property;
72359 };
72360 typedef struct ICD_DisposePropertyPB ICD_DisposePropertyPB;
72361 extern OSErr
72362 ICDNewObject(
72363   ICD_NewObjectPB * pb,
72364   ICDCompletion completion) ;
72365 extern OSErr
72366 ICDDisposeObject(
72367   ICD_DisposeObjectPB * pb,
72368   ICDCompletion completion) ;
72369 extern OSErr
72370 ICDNewProperty(
72371   ICD_NewPropertyPB * pb,
72372   ICDCompletion completion) ;
72373 extern OSErr
72374 ICDDisposeProperty(
72375   ICD_DisposePropertyPB * pb,
72376   ICDCompletion completion) ;
72377
72378
72379
72380
72381
72382
72383
72384
72385
72386 }
72387
72388
72389
72390 enum {
72391
72392
72393
72394   kICAPropertyCameraBatteryLevel = '5001',
72395   kICAPropertyCameraFunctionalMode = '5002',
72396   kICAPropertyCameraImageSize = '5003',
72397   kICAPropertyCameraCompressionSetting = '5004',
72398   kICAPropertyCameraWhiteBalance = '5005',
72399   kICAPropertyCameraRGBGain = '5006',
72400   kICAPropertyCameraFNumber = '5007',
72401   kICAPropertyCameraFocalLength = '5008',
72402   kICAPropertyCameraFocusDistance = '5009',
72403   kICAPropertyCameraFocusMode = '500A',
72404   kICAPropertyCameraExposureMeteringMode = '500B',
72405   kICAPropertyCameraFlashMode = '500C',
72406   kICAPropertyCameraExposureTime = '500D',
72407   kICAPropertyCameraExposureProgramMode = '500E',
72408   kICAPropertyCameraExposureIndex = '500F',
72409   kICAPropertyCameraExposureBiasCompensation = '5010',
72410   kICAPropertyCameraDateTime = '5011',
72411   kICAPropertyCameraCaptureDelay = '5012',
72412   kICAPropertyCameraStillCaptureMode = '5013',
72413   kICAPropertyCameraContrast = '5014',
72414   kICAPropertyCameraSharpness = '5015',
72415   kICAPropertyCameraDigitalZoom = '5016',
72416   kICAPropertyCameraEffectMode = '5017',
72417   kICAPropertyCameraBurstNumber = '5018',
72418   kICAPropertyCameraBurstInterval = '5019',
72419   kICAPropertyCameraTimelapseNumber = '501A',
72420   kICAPropertyCameraTimelapseInterval = '501B',
72421   kICAPropertyCameraFocusMeteringMode = '501C'
72422 };
72423
72424 enum {
72425
72426   kICAPropertyCameraStorageType = 'stor',
72427   kICAPropertyCameraFilesystemType = 'fsys',
72428   kICAPropertyCameraAccessCapability = 'acap',
72429   kICAPropertyCameraMaxCapacity = 'maxc',
72430   kICAPropertyCameraFreeSpaceInBytes = 'fres',
72431   kICAPropertyCameraFreeSpaceInImages = 'frei',
72432   kICAPropertyCameraStorageDescription = 'stod',
72433   kICAPropertyCameraVolumeLabel = 'voll'
72434 };
72435
72436 enum {
72437
72438   kICAPropertyCameraIcon = 'icon',
72439   kICAPropertyCameraSupportedMessages = 'msgs'
72440 };
72441
72442 enum {
72443
72444   kICAStorageFixedROM = 0x0001,
72445   kICAStorageRemovableROM = 0x0002,
72446   kICAStorageFixedRAM = 0x0003,
72447   kICAStorageRemovableRAM = 0x0004
72448 };
72449
72450 enum {
72451
72452   kICAFileystemGenericFlat = 0x0001,
72453   kICAFileystemGenericHierarchical = 0x0002,
72454   kICAFileystemDCF = 0x0003
72455 };
72456
72457 enum {
72458
72459   kICAAccessReadWrite = 0x0000,
72460   kICAAccessReadOnly = 0x0001,
72461   kICAAccessReadOnlyWithObjectDeletion = 0x0002
72462 };
72463
72464 enum {
72465
72466   kICAMessageCameraCaptureNewImage = 'ccni',
72467   kICAMessageCameraDeleteOne = 'del1',
72468   kICAMessageCameraDeleteAll = 'dela',
72469   kICAMessageCameraSyncClock = 'sclk',
72470   kICAMessageCameraUploadData = 'load'
72471 };
72472
72473
72474 extern double acos (double);
72475 extern double asin (double);
72476 extern double atan (double);
72477 extern double atan2 (double, double);
72478 extern double ceil (double);
72479 extern double cos (double);
72480 extern double cosh (double);
72481 extern double exp (double);
72482 extern double fabs (double);
72483 extern double floor (double);
72484 extern double fmod (double, double);
72485 extern double frexp (double, int *);
72486 extern double ldexp (double, int);
72487 extern double log10 (double);
72488 extern double log (double);
72489 extern double modf (double, double *);
72490 extern double pow (double, double);
72491 extern double sin (double);
72492 extern double sinh (double);
72493 extern double sqrt (double);
72494 extern double tan (double);
72495 extern double tanh (double);
72496
72497
72498
72499
72500
72501 extern double acos (double);
72502 extern double asin (double);
72503 extern double atan (double);
72504 extern double atan2 (double, double);
72505 extern double ceil (double);
72506 extern double cos (double);
72507 extern double cosh (double);
72508 extern double exp (double);
72509 extern double fabs (double);
72510 extern double floor (double);
72511 extern double fmod (double, double);
72512 extern double frexp (double, int *);
72513 extern double ldexp (double, int);
72514 extern double log10 (double);
72515 extern double log (double);
72516 extern double modf (double, double *);
72517 extern double pow (double, double);
72518 extern double sin (double);
72519 extern double sinh (double);
72520 extern double sqrt (double);
72521 extern double tan (double);
72522 extern double tanh (double);
72523
72524
72525 enum {
72526
72527
72528
72529         kSCStatusOK = 0,
72530         kSCStatusFailed = 1001,
72531         kSCStatusInvalidArgument = 1002,
72532         kSCStatusAccessError = 1003,
72533
72534
72535
72536         kSCStatusNoKey = 1004,
72537         kSCStatusKeyExists = 1005,
72538         kSCStatusLocked = 1006,
72539         kSCStatusNeedLock = 1007,
72540
72541
72542
72543         kSCStatusNoStoreSession = 2001,
72544         kSCStatusNoStoreServer = 2002,
72545         kSCStatusNotifierActive = 2003,
72546
72547
72548
72549         kSCStatusNoPrefsSession = 3001,
72550         kSCStatusPrefsBusy = 3002,
72551         kSCStatusNoConfigFile = 3003,
72552         kSCStatusNoLink = 3004,
72553         kSCStatusStale = 3005,
72554         kSCStatusMaxLink = 3006,
72555
72556
72557
72558         kSCStatusReachabilityUnknown = 4001,
72559 };
72560
72561
72562
72563 extern "C" {
72564 void closelog (void);
72565 void openlog (const char *, int, int);
72566 int setlogmask (int);
72567 void syslog (int, const char *, ...);
72568 void vsyslog (int, const char *, __builtin_va_list);
72569 }
72570
72571
72572
72573 extern double acos (double);
72574 extern double asin (double);
72575 extern double atan (double);
72576 extern double atan2 (double, double);
72577 extern double ceil (double);
72578 extern double cos (double);
72579 extern double cosh (double);
72580 extern double exp (double);
72581 extern double fabs (double);
72582 extern double floor (double);
72583 extern double fmod (double, double);
72584 extern double frexp (double, int *);
72585 extern double ldexp (double, int);
72586 extern double log10 (double);
72587 extern double log (double);
72588 extern double modf (double, double *);
72589 extern double pow (double, double);
72590 extern double sin (double);
72591 extern double sinh (double);
72592 extern double sqrt (double);
72593 extern double tan (double);
72594 extern double tanh (double);
72595
72596
72597 typedef const struct __SCDynamicStore * SCDynamicStoreRef;
72598
72599
72600
72601
72602 typedef struct {
72603         CFIndex version;
72604         void * info;
72605         const void *(*retain)(const void *info);
72606         void (*release)(const void *info);
72607         CFStringRef (*copyDescription)(const void *info);
72608 } SCDynamicStoreContext;
72609 typedef void (*SCDynamicStoreCallBack) (
72610                                         SCDynamicStoreRef store,
72611                                         CFArrayRef changedKeys,
72612                                         void *info
72613                                         );
72614
72615
72616 extern "C" {
72617
72618
72619
72620
72621
72622 CFTypeID
72623 SCDynamicStoreGetTypeID (void);
72624 SCDynamicStoreRef
72625 SCDynamicStoreCreate (
72626                                         CFAllocatorRef allocator,
72627                                         CFStringRef name,
72628                                         SCDynamicStoreCallBack callout,
72629                                         SCDynamicStoreContext *context
72630                                         );
72631 CFRunLoopSourceRef
72632 SCDynamicStoreCreateRunLoopSource (
72633                                         CFAllocatorRef allocator,
72634                                         SCDynamicStoreRef store,
72635                                         CFIndex order
72636                                         );
72637 CFArrayRef
72638 SCDynamicStoreCopyKeyList (
72639                                         SCDynamicStoreRef store,
72640                                         CFStringRef pattern
72641                                         );
72642 Boolean
72643 SCDynamicStoreAddValue (
72644                                         SCDynamicStoreRef store,
72645                                         CFStringRef key,
72646                                         CFPropertyListRef value
72647                                         );
72648 Boolean
72649 SCDynamicStoreAddTemporaryValue (
72650                                         SCDynamicStoreRef store,
72651                                         CFStringRef key,
72652                                         CFPropertyListRef value
72653                                         );
72654 CFPropertyListRef
72655 SCDynamicStoreCopyValue (
72656                                         SCDynamicStoreRef store,
72657                                         CFStringRef key
72658                                         );
72659 CFDictionaryRef
72660 SCDynamicStoreCopyMultiple (
72661                                         SCDynamicStoreRef store,
72662                                         CFArrayRef keys,
72663                                         CFArrayRef patterns
72664                                         );
72665 Boolean
72666 SCDynamicStoreSetValue (
72667                                         SCDynamicStoreRef store,
72668                                         CFStringRef key,
72669                                         CFPropertyListRef value
72670                                         );
72671 Boolean
72672 SCDynamicStoreSetMultiple (
72673                                         SCDynamicStoreRef store,
72674                                         CFDictionaryRef keysToSet,
72675                                         CFArrayRef keysToRemove,
72676                                         CFArrayRef keysToNotify
72677                                         );
72678 Boolean
72679 SCDynamicStoreRemoveValue (
72680                                         SCDynamicStoreRef store,
72681                                         CFStringRef key
72682                                         );
72683 Boolean
72684 SCDynamicStoreNotifyValue (
72685                                         SCDynamicStoreRef store,
72686                                         CFStringRef key
72687                                         );
72688 Boolean
72689 SCDynamicStoreSetNotificationKeys (
72690                                         SCDynamicStoreRef store,
72691                                         CFArrayRef keys,
72692                                         CFArrayRef patterns
72693                                         );
72694 CFArrayRef
72695 SCDynamicStoreCopyNotifiedKeys (
72696                                         SCDynamicStoreRef store
72697                                         );
72698
72699 }
72700
72701
72702 extern double acos (double);
72703 extern double asin (double);
72704 extern double atan (double);
72705 extern double atan2 (double, double);
72706 extern double ceil (double);
72707 extern double cos (double);
72708 extern double cosh (double);
72709 extern double exp (double);
72710 extern double fabs (double);
72711 extern double floor (double);
72712 extern double fmod (double, double);
72713 extern double frexp (double, int *);
72714 extern double ldexp (double, int);
72715 extern double log10 (double);
72716 extern double log (double);
72717 extern double modf (double, double *);
72718 extern double pow (double, double);
72719 extern double sin (double);
72720 extern double sinh (double);
72721 extern double sqrt (double);
72722 extern double tan (double);
72723 extern double tanh (double);
72724
72725
72726
72727
72728
72729
72730
72731
72732
72733 extern "C" {
72734 CFStringRef
72735 SCDynamicStoreKeyCreate (
72736                                                 CFAllocatorRef allocator,
72737                                                 CFStringRef fmt,
72738                                                 ...
72739                                                 );
72740
72741
72742
72743
72744 CFStringRef
72745 SCDynamicStoreKeyCreateNetworkGlobalEntity (
72746                                                 CFAllocatorRef allocator,
72747                                                 CFStringRef domain,
72748                                                 CFStringRef entity
72749                                                 );
72750
72751
72752
72753
72754 CFStringRef
72755 SCDynamicStoreKeyCreateNetworkInterface (
72756                                                 CFAllocatorRef allocator,
72757                                                 CFStringRef domain
72758                                                 );
72759
72760
72761
72762
72763 CFStringRef
72764 SCDynamicStoreKeyCreateNetworkInterfaceEntity (
72765                                                 CFAllocatorRef allocator,
72766                                                 CFStringRef domain,
72767                                                 CFStringRef ifname,
72768                                                 CFStringRef entity
72769                                                 );
72770
72771
72772
72773
72774 CFStringRef
72775 SCDynamicStoreKeyCreateNetworkServiceEntity (
72776                                                 CFAllocatorRef allocator,
72777                                                 CFStringRef domain,
72778                                                 CFStringRef serviceID,
72779                                                 CFStringRef entity
72780                                                 );
72781 CFStringRef
72782 SCDynamicStoreKeyCreateComputerName (
72783                                                 CFAllocatorRef allocator
72784                                                 );
72785 CFStringRef
72786 SCDynamicStoreKeyCreateConsoleUser (
72787                                                 CFAllocatorRef allocator
72788                                                 );
72789 CFStringRef
72790 SCDynamicStoreKeyCreateHostNames (
72791                                                 CFAllocatorRef allocator
72792                                                 );
72793 CFStringRef
72794 SCDynamicStoreKeyCreateLocation (
72795                                                 CFAllocatorRef allocator
72796                                                 );
72797 CFStringRef
72798 SCDynamicStoreKeyCreateProxies (
72799                                                 CFAllocatorRef allocator
72800                                                 );
72801
72802 }
72803
72804
72805 extern double acos (double);
72806 extern double asin (double);
72807 extern double atan (double);
72808 extern double atan2 (double, double);
72809 extern double ceil (double);
72810 extern double cos (double);
72811 extern double cosh (double);
72812 extern double exp (double);
72813 extern double fabs (double);
72814 extern double floor (double);
72815 extern double fmod (double, double);
72816 extern double frexp (double, int *);
72817 extern double ldexp (double, int);
72818 extern double log10 (double);
72819 extern double log (double);
72820 extern double modf (double, double *);
72821 extern double pow (double, double);
72822 extern double sin (double);
72823 extern double sinh (double);
72824 extern double sqrt (double);
72825 extern double tan (double);
72826 extern double tanh (double);
72827
72828
72829 extern "C" {
72830 CFStringRef
72831 SCDynamicStoreCopyComputerName (
72832                                         SCDynamicStoreRef store,
72833                                         CFStringEncoding *nameEncoding
72834                                         );
72835 CFStringRef
72836 SCDynamicStoreCopyConsoleUser (
72837                                         SCDynamicStoreRef session,
72838                                         uid_t *uid,
72839                                         gid_t *gid
72840                                         );
72841 CFStringRef
72842 SCDynamicStoreCopyLocalHostName (
72843                                         SCDynamicStoreRef store
72844                                         );
72845 CFStringRef
72846 SCDynamicStoreCopyLocation (
72847                                         SCDynamicStoreRef store
72848                                         );
72849 CFDictionaryRef
72850 SCDynamicStoreCopyProxies (
72851                                         SCDynamicStoreRef store
72852                                         );
72853
72854 }
72855
72856
72857
72858
72859 extern double acos (double);
72860 extern double asin (double);
72861 extern double atan (double);
72862 extern double atan2 (double, double);
72863 extern double ceil (double);
72864 extern double cos (double);
72865 extern double cosh (double);
72866 extern double exp (double);
72867 extern double fabs (double);
72868 extern double floor (double);
72869 extern double fmod (double, double);
72870 extern double frexp (double, int *);
72871 extern double ldexp (double, int);
72872 extern double log10 (double);
72873 extern double log (double);
72874 extern double modf (double, double *);
72875 extern double pow (double, double);
72876 extern double sin (double);
72877 extern double sinh (double);
72878 extern double sqrt (double);
72879 extern double tan (double);
72880 extern double tanh (double);
72881
72882
72883 typedef const struct __SCPreferences * SCPreferencesRef;
72884
72885
72886 extern "C" {
72887
72888
72889
72890
72891
72892 CFTypeID
72893 SCPreferencesGetTypeID (void);
72894 SCPreferencesRef
72895 SCPreferencesCreate (
72896                                 CFAllocatorRef allocator,
72897                                 CFStringRef name,
72898                                 CFStringRef prefsID
72899                                 );
72900 Boolean
72901 SCPreferencesLock (
72902                                 SCPreferencesRef session,
72903                                 Boolean wait
72904                                 );
72905 Boolean
72906 SCPreferencesCommitChanges (
72907                                 SCPreferencesRef session
72908                                 );
72909 Boolean
72910 SCPreferencesApplyChanges (
72911                                 SCPreferencesRef session
72912                                 );
72913 Boolean
72914 SCPreferencesUnlock (
72915                                 SCPreferencesRef session
72916                                 );
72917 CFDataRef
72918 SCPreferencesGetSignature (
72919                                 SCPreferencesRef session
72920                                 );
72921 CFArrayRef
72922 SCPreferencesCopyKeyList (
72923                                 SCPreferencesRef session
72924                                 );
72925 CFPropertyListRef
72926 SCPreferencesGetValue (
72927                                 SCPreferencesRef session,
72928                                 CFStringRef key
72929                                 );
72930 Boolean
72931 SCPreferencesAddValue (
72932                                 SCPreferencesRef session,
72933                                 CFStringRef key,
72934                                 CFPropertyListRef value
72935                                 );
72936 Boolean
72937 SCPreferencesSetValue (
72938                                 SCPreferencesRef session,
72939                                 CFStringRef key,
72940                                 CFPropertyListRef value
72941                                 );
72942 Boolean
72943 SCPreferencesRemoveValue (
72944                                 SCPreferencesRef session,
72945                                 CFStringRef key
72946                                 );
72947
72948 }
72949
72950
72951 extern double acos (double);
72952 extern double asin (double);
72953 extern double atan (double);
72954 extern double atan2 (double, double);
72955 extern double ceil (double);
72956 extern double cos (double);
72957 extern double cosh (double);
72958 extern double exp (double);
72959 extern double fabs (double);
72960 extern double floor (double);
72961 extern double fmod (double, double);
72962 extern double frexp (double, int *);
72963 extern double ldexp (double, int);
72964 extern double log10 (double);
72965 extern double log (double);
72966 extern double modf (double, double *);
72967 extern double pow (double, double);
72968 extern double sin (double);
72969 extern double sinh (double);
72970 extern double sqrt (double);
72971 extern double tan (double);
72972 extern double tanh (double);
72973
72974
72975 extern "C" {
72976 CFStringRef
72977 SCPreferencesPathCreateUniqueChild (
72978                                         SCPreferencesRef session,
72979                                         CFStringRef prefix
72980                                         );
72981 CFDictionaryRef
72982 SCPreferencesPathGetValue (
72983                                         SCPreferencesRef session,
72984                                         CFStringRef path
72985                                         );
72986 CFStringRef
72987 SCPreferencesPathGetLink (
72988                                         SCPreferencesRef session,
72989                                         CFStringRef path
72990                                         );
72991 Boolean
72992 SCPreferencesPathSetValue (
72993                                         SCPreferencesRef session,
72994                                         CFStringRef path,
72995                                         CFDictionaryRef value
72996                                         );
72997 Boolean
72998 SCPreferencesPathSetLink (
72999                                         SCPreferencesRef session,
73000                                         CFStringRef path,
73001                                         CFStringRef link
73002                                         );
73003 Boolean
73004 SCPreferencesPathRemoveValue (
73005                                         SCPreferencesRef session,
73006                                         CFStringRef path
73007                                         );
73008
73009 }
73010
73011
73012
73013
73014 typedef u_char sa_family_t;
73015 struct linger {
73016         int l_onoff;
73017         int l_linger;
73018 };
73019 struct sockaddr {
73020         u_char sa_len;
73021         u_char sa_family;
73022         char sa_data[14];
73023 };
73024
73025
73026
73027
73028
73029
73030 struct sockproto {
73031         u_short sp_family;
73032         u_short sp_protocol;
73033 };
73034 struct sockaddr_storage {
73035         u_char ss_len;
73036         sa_family_t ss_family;
73037         char __ss_pad1[((sizeof(int64_t)) - sizeof(u_char) - sizeof(sa_family_t))];
73038         int64_t __ss_align;
73039         char __ss_pad2[(128 - sizeof(u_char) - sizeof(sa_family_t) - ((sizeof(int64_t)) - sizeof(u_char) - sizeof(sa_family_t)) - (sizeof(int64_t)))];
73040 };
73041 struct msghdr {
73042         caddr_t msg_name;
73043         u_int msg_namelen;
73044         struct iovec *msg_iov;
73045         u_int msg_iovlen;
73046         caddr_t msg_control;
73047         u_int msg_controllen;
73048         int msg_flags;
73049 };
73050 struct cmsghdr {
73051         u_int cmsg_len;
73052         int cmsg_level;
73053         int cmsg_type;
73054
73055 };
73056 struct osockaddr {
73057         u_short sa_family;
73058         char sa_data[14];
73059 };
73060
73061
73062
73063
73064 struct omsghdr {
73065         caddr_t msg_name;
73066         int msg_namelen;
73067         struct iovec *msg_iov;
73068         int msg_iovlen;
73069         caddr_t msg_accrights;
73070         int msg_accrightslen;
73071 };
73072 extern "C" {
73073 int accept (int, struct sockaddr *, int *);
73074 int bind (int, const struct sockaddr *, int);
73075 int connect (int, const struct sockaddr *, int);
73076 int getpeername (int, struct sockaddr *, int *);
73077 int getsockname (int, struct sockaddr *, int *);
73078 int getsockopt (int, int, int, void *, int *);
73079 int listen (int, int);
73080 ssize_t recv (int, void *, size_t, int);
73081 ssize_t recvfrom (int, void *, size_t, int, struct sockaddr *, int *);
73082 ssize_t recvmsg (int, struct msghdr *, int);
73083 ssize_t send (int, const void *, size_t, int);
73084 ssize_t sendto (int, const void *, size_t, int, const struct sockaddr *, int);
73085
73086 ssize_t sendmsg (int, const struct msghdr *, int);
73087
73088
73089
73090 int setsockopt (int, int, int, const void *, int);
73091 int shutdown (int, int);
73092 int socket (int, int, int);
73093 int socketpair (int, int, int, int *);
73094
73095 void pfctlinput (int, struct sockaddr *);
73096 }
73097
73098
73099 extern double acos (double);
73100 extern double asin (double);
73101 extern double atan (double);
73102 extern double atan2 (double, double);
73103 extern double ceil (double);
73104 extern double cos (double);
73105 extern double cosh (double);
73106 extern double exp (double);
73107 extern double fabs (double);
73108 extern double floor (double);
73109 extern double fmod (double, double);
73110 extern double frexp (double, int *);
73111 extern double ldexp (double, int);
73112 extern double log10 (double);
73113 extern double log (double);
73114 extern double modf (double, double *);
73115 extern double pow (double, double);
73116 extern double sin (double);
73117 extern double sinh (double);
73118 extern double sqrt (double);
73119 extern double tan (double);
73120 extern double tanh (double);
73121
73122
73123 typedef enum {
73124         kSCNetworkFlagsTransientConnection = 1<<0,
73125         kSCNetworkFlagsReachable = 1<<1,
73126         kSCNetworkFlagsConnectionRequired = 1<<2,
73127         kSCNetworkFlagsConnectionAutomatic = 1<<3,
73128         kSCNetworkFlagsInterventionRequired = 1<<4,
73129 } SCNetworkConnectionFlags;
73130
73131
73132 extern "C" {
73133 Boolean
73134 SCNetworkCheckReachabilityByAddress (
73135                                         const struct sockaddr *address,
73136                                         const int addrlen,
73137                                         SCNetworkConnectionFlags *flags
73138                                         );
73139 Boolean
73140 SCNetworkCheckReachabilityByName (
73141                                         const char *nodename,
73142                                         SCNetworkConnectionFlags *flags
73143                                         );
73144
73145 }
73146
73147 extern "C" {
73148
73149
73150
73151
73152
73153
73154 int SCError ();
73155 const char * SCErrorString (int status);
73156
73157 }
73158
73159
73160
73161 extern "C" {
73162 typedef GDHandle AGLDevice;
73163
73164
73165
73166
73167 typedef CGrafPtr AGLDrawable;
73168
73169
73170
73171
73172 typedef struct __AGLRendererInfoRec *AGLRendererInfo;
73173 typedef struct __AGLPixelFormatRec *AGLPixelFormat;
73174 typedef struct __AGLContextRec *AGLContext;
73175 extern AGLPixelFormat aglChoosePixelFormat(const AGLDevice *gdevs, GLint ndev, const GLint *attribs);
73176 extern void aglDestroyPixelFormat(AGLPixelFormat pix);
73177 extern AGLPixelFormat aglNextPixelFormat(AGLPixelFormat pix);
73178 extern GLboolean aglDescribePixelFormat(AGLPixelFormat pix, GLint attrib, GLint *value);
73179 extern AGLDevice *aglDevicesOfPixelFormat(AGLPixelFormat pix, GLint *ndevs);
73180
73181
73182
73183
73184 extern AGLRendererInfo aglQueryRendererInfo(const AGLDevice *gdevs, GLint ndev);
73185 extern void aglDestroyRendererInfo(AGLRendererInfo rend);
73186 extern AGLRendererInfo aglNextRendererInfo(AGLRendererInfo rend);
73187 extern GLboolean aglDescribeRenderer(AGLRendererInfo rend, GLint prop, GLint *value);
73188
73189
73190
73191
73192 extern AGLContext aglCreateContext(AGLPixelFormat pix, AGLContext share);
73193 extern GLboolean aglDestroyContext(AGLContext ctx);
73194 extern GLboolean aglCopyContext(AGLContext src, AGLContext dst, GLuint mask);
73195 extern GLboolean aglUpdateContext(AGLContext ctx);
73196
73197
73198
73199
73200 extern GLboolean aglSetCurrentContext(AGLContext ctx);
73201 extern AGLContext aglGetCurrentContext(void);
73202
73203
73204
73205
73206 extern GLboolean aglSetDrawable(AGLContext ctx, AGLDrawable draw);
73207 extern GLboolean aglSetOffScreen(AGLContext ctx, GLsizei width, GLsizei height, GLsizei rowbytes, GLvoid *baseaddr);
73208 extern GLboolean aglSetFullScreen(AGLContext ctx, GLsizei width, GLsizei height, GLsizei freq, GLint device);
73209 extern AGLDrawable aglGetDrawable(AGLContext ctx);
73210
73211
73212
73213
73214 extern GLboolean aglSetVirtualScreen(AGLContext ctx, GLint screen);
73215 extern GLint aglGetVirtualScreen(AGLContext ctx);
73216
73217
73218
73219
73220 extern void aglGetVersion(GLint *major, GLint *minor);
73221
73222
73223
73224
73225 extern GLboolean aglConfigure(GLenum pname, GLuint param);
73226
73227
73228
73229
73230 extern void aglSwapBuffers(AGLContext ctx);
73231
73232
73233
73234
73235 extern GLboolean aglEnable(AGLContext ctx, GLenum pname);
73236 extern GLboolean aglDisable(AGLContext ctx, GLenum pname);
73237 extern GLboolean aglIsEnabled(AGLContext ctx, GLenum pname);
73238 extern GLboolean aglSetInteger(AGLContext ctx, GLenum pname, const GLint *params);
73239 extern GLboolean aglGetInteger(AGLContext ctx, GLenum pname, GLint *params);
73240
73241
73242
73243
73244 extern GLboolean aglUseFont(AGLContext ctx, GLint fontID, Style face, GLint size, GLint first, GLint count, GLint base);
73245
73246
73247
73248
73249 extern GLenum aglGetError(void);
73250 extern const GLubyte *aglErrorString(GLenum code);
73251
73252
73253
73254
73255 extern void aglResetLibrary(void);
73256
73257
73258
73259
73260 extern void aglSurfaceTexture (AGLContext context, GLenum target, GLenum internalformat, AGLContext surfacecontext);
73261
73262
73263 }
73264
73265
73266
73267 // we have to include any #defines from Apple's headers that we need here
73268 #define InstallWindowEventHandler( t, h, n, l, u, r ) \
73269        InstallEventHandler( GetWindowEventTarget( t ), (h), (n), (l), (u), (r) )
73270 #define InstallControlEventHandler( t, h, n, l, u, r ) \
73271         InstallEventHandler( GetControlEventTarget( t ), (h), (n), (l), (u), (r) )
73272 #define InstallMenuEventHandler( t, h, n, l, u, r ) \
73273       InstallEventHandler( GetMenuEventTarget( t ), (h), (n), (l), (u), (r) )
73274
73275 #define AGL_VERSION_2_0  1
73276 #define AGL_NONE                   0
73277 #define AGL_ALL_RENDERERS          1  /* choose from all available renderers          */
73278 #define AGL_BUFFER_SIZE            2  /* depth of the index buffer                    */
73279 #define AGL_LEVEL                  3  /* level in plane stacking                      */
73280 #define AGL_RGBA                   4  /* choose an RGBA format                        */
73281 #define AGL_DOUBLEBUFFER           5  /* double buffering supported                   */
73282 #define AGL_STEREO                 6  /* stereo buffering supported                   */
73283 #define AGL_AUX_BUFFERS            7  /* number of aux buffers                        */
73284 #define AGL_RED_SIZE               8  /* number of red component bits                 */
73285 #define AGL_GREEN_SIZE             9  /* number of green component bits               */
73286 #define AGL_BLUE_SIZE             10  /* number of blue component bits                */
73287 #define AGL_ALPHA_SIZE            11  /* number of alpha component bits               */
73288 #define AGL_DEPTH_SIZE            12  /* number of depth bits                         */
73289 #define AGL_STENCIL_SIZE          13  /* number of stencil bits                       */
73290 #define AGL_ACCUM_RED_SIZE        14  /* number of red accum bits                     */
73291 #define AGL_ACCUM_GREEN_SIZE      15  /* number of green accum bits                   */
73292 #define AGL_ACCUM_BLUE_SIZE       16  /* number of blue accum bits                    */
73293 #define AGL_ACCUM_ALPHA_SIZE      17  /* number of alpha accum bits                   */
73294 #define AGL_PIXEL_SIZE            50  /* frame buffer bits per pixel                  */
73295 #define AGL_MINIMUM_POLICY        51  /* never choose smaller buffers than requested  */
73296 #define AGL_MAXIMUM_POLICY        52  /* choose largest buffers of type requested     */
73297 #define AGL_OFFSCREEN             53  /* choose an off-screen capable renderer        */
73298 #define AGL_FULLSCREEN            54  /* choose a full-screen capable renderer        */
73299 #define AGL_SAMPLE_BUFFERS_ARB    55  /* number of multi sample buffers               */
73300 #define AGL_SAMPLES_ARB           56  /* number of samples per multi sample buffer    */
73301 #define AGL_AUX_DEPTH_STENCIL     57  /* independent depth and/or stencil buffers for the aux buffer */
73302 #define AGL_RENDERER_ID           70  /* request renderer by ID                       */
73303 #define AGL_SINGLE_RENDERER       71  /* choose a single renderer for all screens     */
73304 #define AGL_NO_RECOVERY           72  /* disable all failure recovery systems         */
73305 #define AGL_ACCELERATED           73  /* choose a hardware accelerated renderer       */
73306 #define AGL_CLOSEST_POLICY        74  /* choose the closest color buffer to request   */
73307 #define AGL_ROBUST                75  /* renderer does not need failure recovery      */
73308 #define AGL_BACKING_STORE         76  /* back buffer contents are valid after swap    */
73309 #define AGL_MP_SAFE               78  /* renderer is multi-processor safe             */
73310 #define AGL_WINDOW                80  /* can be used to render to an onscreen window  */
73311 #define AGL_MULTISCREEN           81  /* single window can span multiple screens      */
73312 #define AGL_VIRTUAL_SCREEN        82  /* virtual screen number                        */
73313 #define AGL_COMPLIANT             83  /* renderer is opengl compliant                 */
73314 /* #define AGL_OFFSCREEN          53 */
73315 /* #define AGL_FULLSCREEN         54 */
73316 /* #define AGL_RENDERER_ID        70 */
73317 /* #define AGL_ACCELERATED        73 */
73318 /* #define AGL_ROBUST             75 */
73319 /* #define AGL_BACKING_STORE      76 */
73320 /* #define AGL_MP_SAFE            78 */
73321 /* #define AGL_WINDOW             80 */
73322 /* #define AGL_MULTISCREEN        81 */
73323 /* #define AGL_COMPLIANT          83 */
73324 #define AGL_BUFFER_MODES         100
73325 #define AGL_MIN_LEVEL            101
73326 #define AGL_MAX_LEVEL            102
73327 #define AGL_COLOR_MODES          103
73328 #define AGL_ACCUM_MODES          104
73329 #define AGL_DEPTH_MODES          105
73330 #define AGL_STENCIL_MODES        106
73331 #define AGL_MAX_AUX_BUFFERS      107
73332 #define AGL_VIDEO_MEMORY         120
73333 #define AGL_TEXTURE_MEMORY       121
73334 #define AGL_SWAP_RECT            200  /* Enable or set the swap rectangle              */
73335 #define AGL_BUFFER_RECT          202  /* Enable or set the buffer rectangle            */
73336 #define AGL_SWAP_LIMIT           203  /* Enable or disable the swap async limit        */
73337 #define AGL_COLORMAP_TRACKING    210  /* Enable or disable colormap tracking           */
73338 #define AGL_COLORMAP_ENTRY       212  /* Set a colormap entry to {index, r, g, b}      */
73339 #define AGL_RASTERIZATION        220  /* Enable or disable all rasterization           */
73340 #define AGL_SWAP_INTERVAL        222  /* 0 -> Don't sync, n -> Sync every n retrace    */
73341 #define AGL_STATE_VALIDATION     230  /* Validate state for multi-screen functionality */
73342 #define AGL_BUFFER_NAME          231  /* Set the buffer name. Allows for multi ctx to share a buffer */
73343 #define AGL_ORDER_CONTEXT_TO_FRONT  232  /* Order the current context in front of all the other contexts. */
73344 #define AGL_CONTEXT_SURFACE_ID   233  /* aglGetInteger only - returns the ID of the drawable surface for the context */
73345 #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 */
73346 #define AGL_SURFACE_ORDER        235  /* Position of OpenGL surface relative to window: 1 -> Above window, -1 -> Below Window */
73347 #define AGL_SURFACE_OPACITY      236  /* Opacity of OpenGL surface: 1 -> Surface is opaque (default), 0 -> non-opaque */
73348 #define AGL_CLIP_REGION          254  /* Enable or set the drawable clipping region */
73349 #define AGL_FS_CAPTURE_SINGLE    255  /* Enable the capture of only a single display for aglFullScreen, normally disabled */
73350 #define AGL_FORMAT_CACHE_SIZE    501  /* Set the size of the pixel format cache        */
73351 #define AGL_CLEAR_FORMAT_CACHE   502  /* Reset the pixel format cache                  */
73352 #define AGL_RETAIN_RENDERERS     503  /* Whether to retain loaded renderers in memory  */
73353 #define AGL_MONOSCOPIC_BIT       0x00000001
73354 #define AGL_STEREOSCOPIC_BIT     0x00000002
73355 #define AGL_SINGLEBUFFER_BIT     0x00000004
73356 #define AGL_DOUBLEBUFFER_BIT     0x00000008
73357 #define AGL_0_BIT                0x00000001
73358 #define AGL_1_BIT                0x00000002
73359 #define AGL_2_BIT                0x00000004
73360 #define AGL_3_BIT                0x00000008
73361 #define AGL_4_BIT                0x00000010
73362 #define AGL_5_BIT                0x00000020
73363 #define AGL_6_BIT                0x00000040
73364 #define AGL_8_BIT                0x00000080
73365 #define AGL_10_BIT               0x00000100
73366 #define AGL_12_BIT               0x00000200
73367 #define AGL_16_BIT               0x00000400
73368 #define AGL_24_BIT               0x00000800
73369 #define AGL_32_BIT               0x00001000
73370 #define AGL_48_BIT               0x00002000
73371 #define AGL_64_BIT               0x00004000
73372 #define AGL_96_BIT               0x00008000
73373 #define AGL_128_BIT              0x00010000
73374 #define AGL_RGB8_BIT             0x00000001  /* 8 rgb bit/pixel,     RGB=7:0, inverse colormap         */
73375 #define AGL_RGB8_A8_BIT          0x00000002  /* 8-8 argb bit/pixel,  A=7:0, RGB=7:0, inverse colormap  */
73376 #define AGL_BGR233_BIT           0x00000004  /* 8 rgb bit/pixel,     B=7:6, G=5:3, R=2:0               */
73377 #define AGL_BGR233_A8_BIT        0x00000008  /* 8-8 argb bit/pixel,  A=7:0, B=7:6, G=5:3, R=2:0        */
73378 #define AGL_RGB332_BIT           0x00000010  /* 8 rgb bit/pixel,     R=7:5, G=4:2, B=1:0               */
73379 #define AGL_RGB332_A8_BIT        0x00000020  /* 8-8 argb bit/pixel,  A=7:0, R=7:5, G=4:2, B=1:0        */
73380 #define AGL_RGB444_BIT           0x00000040  /* 16 rgb bit/pixel,    R=11:8, G=7:4, B=3:0              */
73381 #define AGL_ARGB4444_BIT         0x00000080  /* 16 argb bit/pixel,   A=15:12, R=11:8, G=7:4, B=3:0     */
73382 #define AGL_RGB444_A8_BIT        0x00000100  /* 8-16 argb bit/pixel, A=7:0, R=11:8, G=7:4, B=3:0       */
73383 #define AGL_RGB555_BIT           0x00000200  /* 16 rgb bit/pixel,    R=14:10, G=9:5, B=4:0             */
73384 #define AGL_ARGB1555_BIT         0x00000400  /* 16 argb bit/pixel,   A=15, R=14:10, G=9:5, B=4:0       */
73385 #define AGL_RGB555_A8_BIT        0x00000800  /* 8-16 argb bit/pixel, A=7:0, R=14:10, G=9:5, B=4:0      */
73386 #define AGL_RGB565_BIT           0x00001000  /* 16 rgb bit/pixel,    R=15:11, G=10:5, B=4:0            */
73387 #define AGL_RGB565_A8_BIT        0x00002000  /* 8-16 argb bit/pixel, A=7:0, R=15:11, G=10:5, B=4:0     */
73388 #define AGL_RGB888_BIT           0x00004000  /* 32 rgb bit/pixel,    R=23:16, G=15:8, B=7:0            */
73389 #define AGL_ARGB8888_BIT         0x00008000  /* 32 argb bit/pixel,   A=31:24, R=23:16, G=15:8, B=7:0   */
73390 #define AGL_RGB888_A8_BIT        0x00010000  /* 8-32 argb bit/pixel, A=7:0, R=23:16, G=15:8, B=7:0     */
73391 #define AGL_RGB101010_BIT        0x00020000  /* 32 rgb bit/pixel,    R=29:20, G=19:10, B=9:0           */
73392 #define AGL_ARGB2101010_BIT      0x00040000  /* 32 argb bit/pixel,   A=31:30  R=29:20, G=19:10, B=9:0  */
73393 #define AGL_RGB101010_A8_BIT     0x00080000  /* 8-32 argb bit/pixel, A=7:0  R=29:20, G=19:10, B=9:0    */
73394 #define AGL_RGB121212_BIT        0x00100000  /* 48 rgb bit/pixel,    R=35:24, G=23:12, B=11:0          */
73395 #define AGL_ARGB12121212_BIT     0x00200000  /* 48 argb bit/pixel,   A=47:36, R=35:24, G=23:12, B=11:0 */
73396 #define AGL_RGB161616_BIT        0x00400000  /* 64 rgb bit/pixel,    R=47:32, G=31:16, B=15:0          */
73397 #define AGL_ARGB16161616_BIT     0x00800000  /* 64 argb bit/pixel,   A=63:48, R=47:32, G=31:16, B=15:0 */
73398 #define AGL_INDEX8_BIT           0x20000000  /* 8 bit color look up table                              */
73399 #define AGL_INDEX16_BIT          0x40000000  /* 16 bit color look up table                             */
73400 #define AGL_NO_ERROR                 0 /* no error                        */
73401 #define AGL_BAD_ATTRIBUTE        10000 /* invalid pixel format attribute  */
73402 #define AGL_BAD_PROPERTY         10001 /* invalid renderer property       */
73403 #define AGL_BAD_PIXELFMT         10002 /* invalid pixel format            */
73404 #define AGL_BAD_RENDINFO         10003 /* invalid renderer info           */
73405 #define AGL_BAD_CONTEXT          10004 /* invalid context                 */
73406 #define AGL_BAD_DRAWABLE         10005 /* invalid drawable                */
73407 #define AGL_BAD_GDEV             10006 /* invalid graphics device         */
73408 #define AGL_BAD_STATE            10007 /* invalid context state           */
73409 #define AGL_BAD_VALUE            10008 /* invalid numerical value         */
73410 #define AGL_BAD_MATCH            10009 /* invalid share context           */
73411 #define AGL_BAD_ENUM             10010 /* invalid enumerant               */
73412 #define AGL_BAD_OFFSCREEN        10011 /* invalid offscreen drawable      */
73413 #define AGL_BAD_FULLSCREEN       10012 /* invalid offscreen drawable      */
73414 #define AGL_BAD_WINDOW           10013 /* invalid window                  */
73415 #define AGL_BAD_POINTER          10014 /* invalid pointer                 */
73416 #define AGL_BAD_MODULE           10015 /* invalid code module             */
73417 #define AGL_BAD_ALLOC            10016 /* memory allocation failure       */
73418
73419
73420 #define kSCPropNetOverridePrimary                SCSTR("OverridePrimary")                 /* CFNumber (0 or 1) */
73421 #define kSCPropNetServiceOrder                   SCSTR("ServiceOrder")                    /* CFArray[CFString] */
73422 #define kSCPropNetPPPOverridePrimary             SCSTR("PPPOverridePrimary")              /* CFNumber (0 or 1) */
73423 #define kSCPropNetInterfaces                     SCSTR("Interfaces")                      /* CFArray[CFString] */
73424 #define kSCPropNetLocalHostName                  SCSTR("LocalHostName")                   /* CFString */
73425 #define kSCPropNetAirPortAllowNetCreation        SCSTR("AllowNetCreation")                /* CFNumber (0 or 1) */
73426 #define kSCPropNetAirPortAuthPassword            SCSTR("AuthPassword")                    /* CFData */
73427 #define kSCPropNetAirPortAuthPasswordEncryption  SCSTR("AuthPasswordEncryption")          /* CFString */
73428 #define kSCPropNetAirPortJoinMode                SCSTR("JoinMode")                        /* CFString */
73429 #define kSCPropNetAirPortPowerEnabled            SCSTR("PowerEnabled")                    /* CFNumber (0 or 1) */
73430 #define kSCPropNetAirPortPreferredNetwork        SCSTR("PreferredNetwork")                /* CFString */
73431 #define kSCPropNetAirPortSavePasswords           SCSTR("SavePasswords")                   /* CFNumber (0 or 1) */
73432 /* kSCPropNetAirPortJoinMode values */
73433 #define kSCPropNetAppleTalkComputerName          SCSTR("ComputerName")                    /* CFString */
73434 #define kSCPropNetAppleTalkComputerNameEncoding  SCSTR("ComputerNameEncoding")            /* CFNumber */
73435 #define kSCPropNetAppleTalkConfigMethod          SCSTR("ConfigMethod")                    /* CFString */
73436 #define kSCPropNetAppleTalkDefaultZone           SCSTR("DefaultZone")                     /* CFString */
73437 #define kSCPropNetAppleTalkNetworkID             SCSTR("NetworkID")                       /* CFNumber */
73438 #define kSCPropNetAppleTalkNetworkRange          SCSTR("NetworkRange")                    /* CFArray[CFNumber] */
73439 #define kSCPropNetAppleTalkNodeID                SCSTR("NodeID")                          /* CFNumber */
73440 #define kSCPropNetAppleTalkSeedNetworkRange      SCSTR("SeedNetworkRange")                /* CFArray[CFNumber] */
73441 #define kSCPropNetAppleTalkSeedZones             SCSTR("SeedZones")                       /* CFArray[CFString] */
73442 /* kSCPropNetAppleTalkConfigMethod values */
73443 #define kSCPropNetDNSDomainName                  SCSTR("DomainName")                      /* CFString */
73444 #define kSCPropNetDNSSearchDomains               SCSTR("SearchDomains")                   /* CFArray[CFString] */
73445 #define kSCPropNetDNSServerAddresses             SCSTR("ServerAddresses")                 /* CFArray[CFString] */
73446 #define kSCPropNetDNSSortList                    SCSTR("SortList")                        /* CFArray[CFString] */
73447 #define kSCPropNetInterfaceDeviceName            SCSTR("DeviceName")                      /* CFString */
73448 #define kSCPropNetInterfaceHardware              SCSTR("Hardware")                        /* CFString */
73449 #define kSCPropNetInterfaceType                  SCSTR("Type")                            /* CFString */
73450 #define kSCPropNetInterfaceSubType               SCSTR("SubType")                         /* CFString */
73451 #define kSCPropNetInterfaceSupportsModemOnHold   SCSTR("SupportsModemOnHold")             /* CFNumber (0 or 1) */
73452 /* kSCPropNetInterfaceType values */
73453 /* kSCPropNetServiceSubType values (for PPP) */
73454 #define kSCPropNetIPv4Addresses                  SCSTR("Addresses")                       /* CFArray[CFString] */
73455 #define kSCPropNetIPv4ConfigMethod               SCSTR("ConfigMethod")                    /* CFString */
73456 #define kSCPropNetIPv4DHCPClientID               SCSTR("DHCPClientID")                    /* CFString */
73457 #define kSCPropNetIPv4Router                     SCSTR("Router")                          /* CFString */
73458 #define kSCPropNetIPv4SubnetMasks                SCSTR("SubnetMasks")                     /* CFArray[CFString] */
73459 #define kSCPropNetIPv4DestAddresses              SCSTR("DestAddresses")                   /* CFArray[CFString] */
73460 #define kSCPropNetIPv4BroadcastAddresses         SCSTR("BroadcastAddresses")              /* CFArray[CFString] */
73461 /* kSCPropNetIPv4ConfigMethod values */
73462 #define kSCPropNetIPv6Addresses                  SCSTR("Addresses")                       /* CFArray[CFString] */
73463 #define kSCPropNetIPv6ConfigMethod               SCSTR("ConfigMethod")                    /* CFString */
73464 #define kSCPropNetLinkActive                     SCSTR("Active")                          /* CFBoolean */
73465 #define kSCPropNetLinkDetaching                  SCSTR("Detaching")                       /* CFBoolean */
73466 #define kSCPropNetModemConnectionScript          SCSTR("ConnectionScript")                /* CFString */
73467 #define kSCPropNetModemConnectSpeed              SCSTR("ConnectSpeed")                    /* CFNumber */
73468 #define kSCPropNetModemDataCompression           SCSTR("DataCompression")                 /* CFNumber (0 or 1) */
73469 #define kSCPropNetModemDialMode                  SCSTR("DialMode")                        /* CFString */
73470 #define kSCPropNetModemErrorCorrection           SCSTR("ErrorCorrection")                 /* CFNumber (0 or 1) */
73471 #define kSCPropNetModemHoldCallWaitingAudibleAlert SCSTR("HoldCallWaitingAudibleAlert")     /* CFNumber (0 or 1) */
73472 #define kSCPropNetModemHoldDisconnectOnAnswer    SCSTR("HoldDisconnectOnAnswer")          /* CFNumber (0 or 1) */
73473 #define kSCPropNetModemHoldEnabled               SCSTR("HoldEnabled")                     /* CFNumber (0 or 1) */
73474 #define kSCPropNetModemHoldReminder              SCSTR("HoldReminder")                    /* CFNumber (0 or 1) */
73475 #define kSCPropNetModemHoldReminderTime          SCSTR("HoldReminderTime")                /* CFNumber */
73476 #define kSCPropNetModemNote                      SCSTR("Note")                            /* CFString */
73477 #define kSCPropNetModemPulseDial                 SCSTR("PulseDial")                       /* CFNumber (0 or 1) */
73478 #define kSCPropNetModemSpeaker                   SCSTR("Speaker")                         /* CFNumber (0 or 1) */
73479 #define kSCPropNetModemSpeed                     SCSTR("Speed")                           /* CFNumber */
73480 /* kSCPropNetModemDialMode values */
73481 #define kSCPropNetNetInfoBindingMethods          SCSTR("BindingMethods")                  /* CFString */
73482 #define kSCPropNetNetInfoServerAddresses         SCSTR("ServerAddresses")                 /* CFArray[CFString] */
73483 #define kSCPropNetNetInfoServerTags              SCSTR("ServerTags")                      /* CFArray[CFString] */
73484 #define kSCPropNetNetInfoBroadcastServerTag      SCSTR("BroadcastServerTag")              /* CFString */
73485 /* kSCPropNetNetInfoBindingMethods values */
73486 /* kSCPropNetNetInfoBroadcastServerTag default value */
73487 #define kSCPropNetPPPConnectTime                 SCSTR("ConnectTime")                     /* CFNumber */
73488 #define kSCPropNetPPPDeviceLastCause             SCSTR("DeviceLastCause")                 /* CFNumber */
73489 #define kSCPropNetPPPDialOnDemand                SCSTR("DialOnDemand")                    /* CFNumber (0 or 1) */
73490 #define kSCPropNetPPPDisconnectOnIdle            SCSTR("DisconnectOnIdle")                /* CFNumber (0 or 1) */
73491 #define kSCPropNetPPPDisconnectOnIdleTimer       SCSTR("DisconnectOnIdleTimer")           /* CFNumber */
73492 #define kSCPropNetPPPDisconnectOnLogout          SCSTR("DisconnectOnLogout")              /* CFNumber (0 or 1) */
73493 #define kSCPropNetPPPDisconnectOnSleep           SCSTR("DisconnectOnSleep")               /* CFNumber (0 or 1) */
73494 #define kSCPropNetPPPIdleReminderTimer           SCSTR("IdleReminderTimer")               /* CFNumber */
73495 #define kSCPropNetPPPIdleReminder                SCSTR("IdleReminder")                    /* CFNumber (0 or 1) */
73496 #define kSCPropNetPPPLastCause                   SCSTR("LastCause")                       /* CFNumber */
73497 #define kSCPropNetPPPLogfile                     SCSTR("Logfile")                         /* CFString */
73498 #define kSCPropNetPPPPlugins                     SCSTR("Plugins")                         /* CFArray[CFString] */
73499 #define kSCPropNetPPPSessionTimer                SCSTR("SessionTimer")                    /* CFNumber */
73500 #define kSCPropNetPPPStatus                      SCSTR("Status")                          /* CFString */
73501 #define kSCPropNetPPPUseSessionTimer             SCSTR("UseSessionTimer")                 /* CFNumber (0 or 1) */
73502 #define kSCPropNetPPPVerboseLogging              SCSTR("VerboseLogging")                  /* CFNumber (0 or 1) */
73503 #define kSCPropNetPPPAuthName                    SCSTR("AuthName")                        /* CFString */
73504 #define kSCPropNetPPPAuthPassword                SCSTR("AuthPassword")                    /* CFString */
73505 #define kSCPropNetPPPAuthPasswordEncryption      SCSTR("AuthPasswordEncryption")          /* CFString */
73506 #define kSCPropNetPPPAuthProtocol                SCSTR("AuthProtocol")                    /* CFArray[CFString] */
73507 /* kSCPropNetPPPAuthProtocol values */
73508 #define kSCPropNetPPPCommAlternateRemoteAddress  SCSTR("CommAlternateRemoteAddress")      /* CFString */
73509 #define kSCPropNetPPPCommConnectDelay            SCSTR("CommConnectDelay")                /* CFNumber */
73510 #define kSCPropNetPPPCommDisplayTerminalWindow   SCSTR("CommDisplayTerminalWindow")       /* CFNumber (0 or 1) */
73511 #define kSCPropNetPPPCommRedialCount             SCSTR("CommRedialCount")                 /* CFNumber */
73512 #define kSCPropNetPPPCommRedialEnabled           SCSTR("CommRedialEnabled")               /* CFNumber (0 or 1) */
73513 #define kSCPropNetPPPCommRedialInterval          SCSTR("CommRedialInterval")              /* CFNumber */
73514 #define kSCPropNetPPPCommRemoteAddress           SCSTR("CommRemoteAddress")               /* CFString */
73515 #define kSCPropNetPPPCommTerminalScript          SCSTR("CommTerminalScript")              /* CFString */
73516 #define kSCPropNetPPPCommUseTerminalScript       SCSTR("CommUseTerminalScript")           /* CFNumber (0 or 1) */
73517 #define kSCPropNetPPPCCPEnabled                  SCSTR("CCPEnabled")                      /* CFNumber (0 or 1) */
73518 #define kSCPropNetPPPIPCPCompressionVJ           SCSTR("IPCPCompressionVJ")               /* CFNumber (0 or 1) */
73519 #define kSCPropNetPPPLCPEchoEnabled              SCSTR("LCPEchoEnabled")                  /* CFNumber (0 or 1) */
73520 #define kSCPropNetPPPLCPEchoFailure              SCSTR("LCPEchoFailure")                  /* CFNumber */
73521 #define kSCPropNetPPPLCPEchoInterval             SCSTR("LCPEchoInterval")                 /* CFNumber */
73522 #define kSCPropNetPPPLCPCompressionACField       SCSTR("LCPCompressionACField")           /* CFNumber (0 or 1) */
73523 #define kSCPropNetPPPLCPCompressionPField        SCSTR("LCPCompressionPField")            /* CFNumber (0 or 1) */
73524 #define kSCPropNetPPPLCPMRU                      SCSTR("LCPMRU")                          /* CFNumber */
73525 #define kSCPropNetPPPLCPMTU                      SCSTR("LCPMTU")                          /* CFNumber */
73526 #define kSCPropNetPPPLCPReceiveACCM              SCSTR("LCPReceiveACCM")                  /* CFNumber */
73527 #define kSCPropNetPPPLCPTransmitACCM             SCSTR("LCPTransmitACCM")                 /* CFNumber */
73528 #define kSCPropNetProxiesExceptionsList          SCSTR("ExceptionsList")                  /* CFArray[CFString] */
73529 #define kSCPropNetProxiesFTPEnable               SCSTR("FTPEnable")                       /* CFNumber (0 or 1) */
73530 #define kSCPropNetProxiesFTPPassive              SCSTR("FTPPassive")                      /* CFNumber (0 or 1) */
73531 #define kSCPropNetProxiesFTPPort                 SCSTR("FTPPort")                         /* CFNumber */
73532 #define kSCPropNetProxiesFTPProxy                SCSTR("FTPProxy")                        /* CFString */
73533 #define kSCPropNetProxiesGopherEnable            SCSTR("GopherEnable")                    /* CFNumber (0 or 1) */
73534 #define kSCPropNetProxiesGopherPort              SCSTR("GopherPort")                      /* CFNumber */
73535 #define kSCPropNetProxiesGopherProxy             SCSTR("GopherProxy")                     /* CFString */
73536 #define kSCPropNetProxiesHTTPEnable              SCSTR("HTTPEnable")                      /* CFNumber (0 or 1) */
73537 #define kSCPropNetProxiesHTTPPort                SCSTR("HTTPPort")                        /* CFNumber */
73538 #define kSCPropNetProxiesHTTPProxy               SCSTR("HTTPProxy")                       /* CFString */
73539 #define kSCPropNetProxiesHTTPSEnable             SCSTR("HTTPSEnable")                     /* CFNumber (0 or 1) */
73540 #define kSCPropNetProxiesHTTPSPort               SCSTR("HTTPSPort")                       /* CFNumber */
73541 #define kSCPropNetProxiesHTTPSProxy              SCSTR("HTTPSProxy")                      /* CFString */
73542 #define kSCPropNetProxiesRTSPEnable              SCSTR("RTSPEnable")                      /* CFNumber (0 or 1) */
73543 #define kSCPropNetProxiesRTSPPort                SCSTR("RTSPPort")                        /* CFNumber */
73544 #define kSCPropNetProxiesRTSPProxy               SCSTR("RTSPProxy")                       /* CFString */
73545 #define kSCPropNetProxiesSOCKSEnable             SCSTR("SOCKSEnable")                     /* CFNumber (0 or 1) */
73546 #define kSCPropNetProxiesSOCKSPort               SCSTR("SOCKSPort")                       /* CFNumber */
73547 #define kSCPropNetProxiesSOCKSProxy              SCSTR("SOCKSProxy")                      /* CFString */
73548
73549 #define CFSTR(cStr)  __CFStringMakeConstantString("" cStr "")
73550 #define  SCSTR(s) CFSTR(s)
73551
73552 CFDictionaryRef
73553 SCDynamicStoreCopyProxies               (
73554                                         SCDynamicStoreRef       store
73555                                         );
73556
73557